@availity/mui-spaces 0.3.3 → 0.3.5
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/CHANGELOG.md +4 -0
- package/dist/index.d.mts +9 -13
- package/dist/index.d.ts +9 -13
- package/dist/index.js +153 -553
- package/dist/index.mjs +144 -548
- package/package.json +12 -1
- package/src/lib/SpacesLink/SpacesLink.test.tsx +6 -49
- package/src/lib/SpacesLink/SpacesLink.tsx +70 -38
- package/src/lib/SpacesLink/spaces-link-types.tsx +7 -5
- package/src/lib/SpacesLink/useLink.test.tsx +1 -1
package/dist/index.js
CHANGED
|
@@ -93,7 +93,7 @@ __export(src_exports, {
|
|
|
93
93
|
module.exports = __toCommonJS(src_exports);
|
|
94
94
|
|
|
95
95
|
// src/lib/Spaces.tsx
|
|
96
|
-
var
|
|
96
|
+
var import_react3 = require("react");
|
|
97
97
|
var import_react_query = require("@tanstack/react-query");
|
|
98
98
|
|
|
99
99
|
// src/lib/spaces-data.tsx
|
|
@@ -266,7 +266,7 @@ var configurationFindMany_default = `query configurationFindMany($ids: [String!]
|
|
|
266
266
|
}`;
|
|
267
267
|
|
|
268
268
|
// src/lib/modals/ModalProvider.tsx
|
|
269
|
-
var
|
|
269
|
+
var import_react2 = require("react");
|
|
270
270
|
var import_resolve_url = require("@availity/resolve-url");
|
|
271
271
|
var import_mui_dialog3 = require("@availity/mui-dialog");
|
|
272
272
|
var import_mui_button = require("@availity/mui-button");
|
|
@@ -345,72 +345,12 @@ var updateTopApps = (space, akaname) => __async(void 0, null, function* () {
|
|
|
345
345
|
});
|
|
346
346
|
|
|
347
347
|
// src/lib/modals/DisclaimerModal.tsx
|
|
348
|
-
var
|
|
348
|
+
var import_react = require("react");
|
|
349
349
|
var import_api_axios2 = require("@availity/api-axios");
|
|
350
350
|
var import_react_markdown = __toESM(require("react-markdown"));
|
|
351
|
-
|
|
352
|
-
// ../progress/src/lib/CircularProgress.tsx
|
|
353
|
-
var import_react = require("react");
|
|
354
|
-
var import_CircularProgress = __toESM(require("@mui/material/CircularProgress"));
|
|
355
|
-
var import_Stack = __toESM(require("@mui/material/Stack"));
|
|
356
|
-
var import_mui_icon = require("@availity/mui-icon");
|
|
357
|
-
var import_mui_typography = require("@availity/mui-typography");
|
|
358
|
-
var import_jsx_runtime = require("react/jsx-runtime");
|
|
359
|
-
var StatusIcon = ({ status, size }) => {
|
|
360
|
-
const fontSize = size === "small" ? "medium" : "large";
|
|
361
|
-
switch (status) {
|
|
362
|
-
case "error":
|
|
363
|
-
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_mui_icon.WarningCircleIcon, { color: "error", fontSize, titleAccess: "loading error" });
|
|
364
|
-
case "success":
|
|
365
|
-
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_mui_icon.SuccessCircleIcon, { color: "success", fontSize, titleAccess: "loading successful" });
|
|
366
|
-
default:
|
|
367
|
-
return null;
|
|
368
|
-
}
|
|
369
|
-
};
|
|
370
|
-
var getCaptionText = (status) => ({
|
|
371
|
-
loading: "Loading",
|
|
372
|
-
error: "Loading error",
|
|
373
|
-
success: "Loading successful"
|
|
374
|
-
})[status] || "";
|
|
375
|
-
var CircularProgress = (_a) => {
|
|
376
|
-
var _b = _a, {
|
|
377
|
-
loadingCaption = true,
|
|
378
|
-
error = false,
|
|
379
|
-
success = false,
|
|
380
|
-
size = "default"
|
|
381
|
-
} = _b, props = __objRest(_b, [
|
|
382
|
-
"loadingCaption",
|
|
383
|
-
"error",
|
|
384
|
-
"success",
|
|
385
|
-
"size"
|
|
386
|
-
]);
|
|
387
|
-
const [status, setStatus] = (0, import_react.useState)("loading");
|
|
388
|
-
(0, import_react.useEffect)(() => {
|
|
389
|
-
if (error) {
|
|
390
|
-
setStatus("error");
|
|
391
|
-
} else if (success) {
|
|
392
|
-
setStatus("success");
|
|
393
|
-
} else {
|
|
394
|
-
setStatus("loading");
|
|
395
|
-
}
|
|
396
|
-
}, [error, success]);
|
|
397
|
-
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_Stack.default, { width: "fit-content", alignItems: "center", children: [
|
|
398
|
-
status === "loading" ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
399
|
-
import_CircularProgress.default,
|
|
400
|
-
__spreadProps(__spreadValues({
|
|
401
|
-
"aria-label": "Loading"
|
|
402
|
-
}, props), {
|
|
403
|
-
size: size === "small" ? 24 : 40,
|
|
404
|
-
variant: "indeterminate"
|
|
405
|
-
})
|
|
406
|
-
) : /* @__PURE__ */ (0, import_jsx_runtime.jsx)(StatusIcon, { status, size }),
|
|
407
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_mui_typography.Typography, { marginTop: "8px", variant: "caption", children: loadingCaption || error || success ? getCaptionText(status) : null })
|
|
408
|
-
] });
|
|
409
|
-
};
|
|
410
|
-
|
|
411
|
-
// src/lib/modals/DisclaimerModal.tsx
|
|
351
|
+
var import_mui_progress = require("@availity/mui-progress");
|
|
412
352
|
var import_mui_dialog = require("@availity/mui-dialog");
|
|
413
|
-
var
|
|
353
|
+
var import_jsx_runtime = require("react/jsx-runtime");
|
|
414
354
|
var disclaimerQuery = `query disclaimerFindOne($id: ID!) {
|
|
415
355
|
configurationFindOne(id: $id) {
|
|
416
356
|
... on Text {
|
|
@@ -419,8 +359,8 @@ var disclaimerQuery = `query disclaimerFindOne($id: ID!) {
|
|
|
419
359
|
}
|
|
420
360
|
}`;
|
|
421
361
|
var DisclaimerModal = ({ disclaimerId }) => {
|
|
422
|
-
const [disclaimer, setDisclaimer] = (0,
|
|
423
|
-
(0,
|
|
362
|
+
const [disclaimer, setDisclaimer] = (0, import_react.useState)("");
|
|
363
|
+
(0, import_react.useEffect)(() => {
|
|
424
364
|
const fetchDisclaimer = () => __async(void 0, null, function* () {
|
|
425
365
|
if (disclaimerId) {
|
|
426
366
|
const result = yield import_api_axios2.avWebQLApi.create({ query: disclaimerQuery, variables: { id: disclaimerId } });
|
|
@@ -429,17 +369,18 @@ var DisclaimerModal = ({ disclaimerId }) => {
|
|
|
429
369
|
});
|
|
430
370
|
fetchDisclaimer();
|
|
431
371
|
}, [disclaimerId]);
|
|
432
|
-
return /* @__PURE__ */ (0,
|
|
372
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_mui_dialog.DialogContent, { children: disclaimer ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_react_markdown.default, { children: disclaimer }) : /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_mui_progress.CircularProgress, {}) });
|
|
433
373
|
};
|
|
434
374
|
|
|
435
375
|
// src/lib/modals/MultiPayerModal.tsx
|
|
436
376
|
var import_mui_dialog2 = require("@availity/mui-dialog");
|
|
437
377
|
var import_mui_layout = require("@availity/mui-layout");
|
|
438
|
-
var
|
|
378
|
+
var import_mui_typography = require("@availity/mui-typography");
|
|
439
379
|
|
|
440
380
|
// src/lib/SpacesImage.tsx
|
|
381
|
+
var import_mui_progress2 = require("@availity/mui-progress");
|
|
441
382
|
var import_react_image = require("react-image");
|
|
442
|
-
var
|
|
383
|
+
var import_jsx_runtime2 = require("react/jsx-runtime");
|
|
443
384
|
var SpacesImage = (_a) => {
|
|
444
385
|
var _b = _a, { spaceId, payerId, imageType = "url", fallback } = _b, props = __objRest(_b, ["spaceId", "payerId", "imageType", "fallback"]);
|
|
445
386
|
var _a2, _b2, _c, _d, _e, _f, _g, _h, _i, _j, _k;
|
|
@@ -461,29 +402,29 @@ var SpacesImage = (_a) => {
|
|
|
461
402
|
};
|
|
462
403
|
let url = imageMap[imageType];
|
|
463
404
|
if (!url && loading) {
|
|
464
|
-
return /* @__PURE__ */ (0,
|
|
405
|
+
return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_mui_progress2.CircularProgress, { id: `app-${id}-loading` });
|
|
465
406
|
}
|
|
466
407
|
if (!url && !loading && fallback) {
|
|
467
408
|
url = fallback;
|
|
468
409
|
}
|
|
469
410
|
if (!url || !id)
|
|
470
411
|
return null;
|
|
471
|
-
return /* @__PURE__ */ (0,
|
|
412
|
+
return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
|
|
472
413
|
import_react_image.Img,
|
|
473
414
|
__spreadValues({
|
|
474
415
|
id: props.id || `app-img-${id}`,
|
|
475
416
|
src: url,
|
|
476
417
|
alt: `Space ${imageType}`,
|
|
477
|
-
loader: /* @__PURE__ */ (0,
|
|
418
|
+
loader: /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_mui_progress2.CircularProgress, { id: `app-img-${id}-loading` })
|
|
478
419
|
}, props)
|
|
479
420
|
);
|
|
480
421
|
};
|
|
481
422
|
|
|
482
423
|
// src/lib/modals/MultiPayerModal.tsx
|
|
483
|
-
var
|
|
484
|
-
var MultiPayerModal = ({ parentPayerSpaces, name, state: { selectedOption }, setState }) => /* @__PURE__ */ (0,
|
|
485
|
-
/* @__PURE__ */ (0,
|
|
486
|
-
/* @__PURE__ */ (0,
|
|
424
|
+
var import_jsx_runtime3 = require("react/jsx-runtime");
|
|
425
|
+
var MultiPayerModal = ({ parentPayerSpaces, name, state: { selectedOption }, setState }) => /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)(import_mui_dialog2.DialogContent, { children: [
|
|
426
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_mui_typography.Typography, { children: `Open ${name} as: ${selectedOption ? selectedOption.name || selectedOption.id : ""}` }),
|
|
427
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_mui_layout.Grid, { direction: "row", children: parentPayerSpaces && parentPayerSpaces.map((payerSpace) => /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_mui_layout.Box, { onClick: () => setState({ selectedOption: payerSpace }), children: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(SpacesImage, { spaceId: payerSpace.configurationId, imageType: "images.tile" }) })) })
|
|
487
428
|
] });
|
|
488
429
|
|
|
489
430
|
// src/lib/modals/modal-types.tsx
|
|
@@ -491,16 +432,16 @@ var isModalOptions = (action) => action.spaceType !== void 0;
|
|
|
491
432
|
var isModalState = (action) => action.selectedOption !== void 0;
|
|
492
433
|
|
|
493
434
|
// src/lib/modals/ModalProvider.tsx
|
|
494
|
-
var
|
|
435
|
+
var import_jsx_runtime4 = require("react/jsx-runtime");
|
|
495
436
|
var MODAL_INITIAL_STATE = {
|
|
496
437
|
isOpen: false,
|
|
497
438
|
modalOptions: void 0,
|
|
498
439
|
modalState: { selectedOption: { id: "", name: "" } },
|
|
499
440
|
selectedModal: {}
|
|
500
441
|
};
|
|
501
|
-
var ModalContext = (0,
|
|
442
|
+
var ModalContext = (0, import_react2.createContext)(null);
|
|
502
443
|
var useModal = () => {
|
|
503
|
-
const ctx = (0,
|
|
444
|
+
const ctx = (0, import_react2.useContext)(ModalContext);
|
|
504
445
|
if (!ctx)
|
|
505
446
|
throw new Error("ModalContext be used inside a Provider");
|
|
506
447
|
return ctx;
|
|
@@ -571,27 +512,27 @@ var modalReducer = (state, _a) => {
|
|
|
571
512
|
return state;
|
|
572
513
|
};
|
|
573
514
|
var ModalProvider = ({ children }) => {
|
|
574
|
-
const [{ selectedModal, modalOptions, modalState, isOpen }, dispatch] = (0,
|
|
515
|
+
const [{ selectedModal, modalOptions, modalState, isOpen }, dispatch] = (0, import_react2.useReducer)(modalReducer, MODAL_INITIAL_STATE);
|
|
575
516
|
const toggle = () => dispatch({ type: "RESET" });
|
|
576
517
|
const buttonProps = (selectedModal == null ? void 0 : selectedModal.buttonProps) && (selectedModal == null ? void 0 : selectedModal.buttonProps(__spreadProps(__spreadValues({}, modalState), { modalOptions })));
|
|
577
518
|
const Body = selectedModal == null ? void 0 : selectedModal.body;
|
|
578
|
-
return /* @__PURE__ */ (0,
|
|
519
|
+
return /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(
|
|
579
520
|
ModalContext.Provider,
|
|
580
521
|
{
|
|
581
522
|
value: (modalType, modalOptions2) => dispatch(__spreadValues({ type: `OPEN_${modalType}` }, modalOptions2)),
|
|
582
523
|
children: [
|
|
583
|
-
/* @__PURE__ */ (0,
|
|
584
|
-
/* @__PURE__ */ (0,
|
|
585
|
-
Body && /* @__PURE__ */ (0,
|
|
524
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(import_mui_dialog3.Dialog, { open: isOpen, children: [
|
|
525
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_mui_dialog3.DialogTitle, { id: "disclaimer-header", children: modalOptions == null ? void 0 : modalOptions.title }),
|
|
526
|
+
Body && /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
|
|
586
527
|
Body,
|
|
587
528
|
__spreadProps(__spreadValues({}, modalOptions), {
|
|
588
529
|
setState: (newState) => dispatch(__spreadValues({ type: "UPDATE_MODAL_STATE" }, newState)),
|
|
589
530
|
state: modalState
|
|
590
531
|
})
|
|
591
532
|
),
|
|
592
|
-
/* @__PURE__ */ (0,
|
|
593
|
-
/* @__PURE__ */ (0,
|
|
594
|
-
/* @__PURE__ */ (0,
|
|
533
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(import_mui_dialog3.DialogActions, { children: [
|
|
534
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_mui_button.Button, { onClick: toggle, children: "Cancel" }),
|
|
535
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
|
|
595
536
|
import_mui_button.Button,
|
|
596
537
|
__spreadProps(__spreadValues({
|
|
597
538
|
color: "primary"
|
|
@@ -624,12 +565,12 @@ var ModalProvider = ({ children }) => {
|
|
|
624
565
|
};
|
|
625
566
|
|
|
626
567
|
// src/lib/Spaces.tsx
|
|
627
|
-
var
|
|
568
|
+
var import_jsx_runtime5 = require("react/jsx-runtime");
|
|
628
569
|
var INITIAL_STATE = {
|
|
629
570
|
loading: true
|
|
630
571
|
};
|
|
631
|
-
var SpacesContext = (0,
|
|
632
|
-
var useSpacesContext = () => (0,
|
|
572
|
+
var SpacesContext = (0, import_react3.createContext)(INITIAL_STATE);
|
|
573
|
+
var useSpacesContext = () => (0, import_react3.useContext)(SpacesContext);
|
|
633
574
|
var Spaces = ({
|
|
634
575
|
query = configurationFindMany_default,
|
|
635
576
|
variables = { types: ["PAYERSPACE"] },
|
|
@@ -639,7 +580,7 @@ var Spaces = ({
|
|
|
639
580
|
spaceIds,
|
|
640
581
|
spaces: spacesFromProps
|
|
641
582
|
}) => {
|
|
642
|
-
const [{ previousSpacesMap, previousSpacesByConfigMap, previousSpacesByPayerMap, loading, error }, dispatch] = (0,
|
|
583
|
+
const [{ previousSpacesMap, previousSpacesByConfigMap, previousSpacesByPayerMap, loading, error }, dispatch] = (0, import_react3.useReducer)(spacesReducer, INITIAL_STATE);
|
|
643
584
|
const spacesMap = new Map(previousSpacesMap);
|
|
644
585
|
const configIdsMap = new Map(previousSpacesByConfigMap);
|
|
645
586
|
const payerIdsMap = new Map(previousSpacesByPayerMap);
|
|
@@ -698,7 +639,7 @@ var Spaces = ({
|
|
|
698
639
|
}
|
|
699
640
|
]
|
|
700
641
|
});
|
|
701
|
-
(0,
|
|
642
|
+
(0, import_react3.useEffect)(() => {
|
|
702
643
|
if (isErrorByPayerIds || isErrorBySpaceIds) {
|
|
703
644
|
dispatch({
|
|
704
645
|
type: "ERROR",
|
|
@@ -707,7 +648,7 @@ var Spaces = ({
|
|
|
707
648
|
});
|
|
708
649
|
}
|
|
709
650
|
}, [isErrorByPayerIds, isErrorBySpaceIds]);
|
|
710
|
-
(0,
|
|
651
|
+
(0, import_react3.useEffect)(() => {
|
|
711
652
|
dispatch({
|
|
712
653
|
type: "LOADING",
|
|
713
654
|
loading: true
|
|
@@ -774,7 +715,7 @@ var Spaces = ({
|
|
|
774
715
|
return isReactNodeFunction(children) ? (() => children({ spaces: [spacesMap.values()], loading, error }))() : children;
|
|
775
716
|
}
|
|
776
717
|
};
|
|
777
|
-
return /* @__PURE__ */ (0,
|
|
718
|
+
return /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
|
|
778
719
|
SpacesContext.Provider,
|
|
779
720
|
{
|
|
780
721
|
value: {
|
|
@@ -784,7 +725,7 @@ var Spaces = ({
|
|
|
784
725
|
loading: loading || isLoadingByPayerIds || isLoadingBySpaceIds,
|
|
785
726
|
error
|
|
786
727
|
},
|
|
787
|
-
children: /* @__PURE__ */ (0,
|
|
728
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(ModalProvider, { children: spacesChildren() })
|
|
788
729
|
}
|
|
789
730
|
);
|
|
790
731
|
};
|
|
@@ -813,384 +754,17 @@ var useSpaces = (...ids) => {
|
|
|
813
754
|
|
|
814
755
|
// src/lib/SpacesLink/SpacesLink.tsx
|
|
815
756
|
var import_dayjs2 = __toESM(require("dayjs"));
|
|
816
|
-
|
|
817
|
-
|
|
818
|
-
var
|
|
819
|
-
var
|
|
820
|
-
var
|
|
821
|
-
var _b = _a, { children } = _b, rest = __objRest(_b, ["children"]);
|
|
822
|
-
return /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(import_Card.default, __spreadProps(__spreadValues({}, rest), { children }));
|
|
823
|
-
};
|
|
824
|
-
|
|
825
|
-
// ../card/src/lib/CardActionArea.tsx
|
|
826
|
-
var import_CardActionArea = __toESM(require("@mui/material/CardActionArea"));
|
|
827
|
-
var import_jsx_runtime8 = require("react/jsx-runtime");
|
|
828
|
-
|
|
829
|
-
// ../card/src/lib/CardActions.tsx
|
|
830
|
-
var import_CardActions = __toESM(require("@mui/material/CardActions"));
|
|
831
|
-
var import_jsx_runtime9 = require("react/jsx-runtime");
|
|
832
|
-
|
|
833
|
-
// ../card/src/lib/CardContent.tsx
|
|
834
|
-
var import_CardContent = __toESM(require("@mui/material/CardContent"));
|
|
835
|
-
var import_jsx_runtime10 = require("react/jsx-runtime");
|
|
836
|
-
var CardContent = (_a) => {
|
|
837
|
-
var _b = _a, { children } = _b, rest = __objRest(_b, ["children"]);
|
|
838
|
-
return /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_CardContent.default, __spreadProps(__spreadValues({}, rest), { children }));
|
|
839
|
-
};
|
|
840
|
-
|
|
841
|
-
// ../card/src/lib/CardHeader.tsx
|
|
842
|
-
var import_styles = require("@mui/material/styles");
|
|
843
|
-
var import_CardHeader = __toESM(require("@mui/material/CardHeader"));
|
|
844
|
-
var import_jsx_runtime11 = require("react/jsx-runtime");
|
|
845
|
-
var CardHeader = (_a) => {
|
|
846
|
-
var _b = _a, {
|
|
847
|
-
titleTypographyProps,
|
|
848
|
-
subheaderTypographyProps
|
|
849
|
-
} = _b, rest = __objRest(_b, [
|
|
850
|
-
"titleTypographyProps",
|
|
851
|
-
"subheaderTypographyProps"
|
|
852
|
-
]);
|
|
853
|
-
var _a2, _b2, _c, _d;
|
|
854
|
-
const theme = (0, import_styles.useTheme)();
|
|
855
|
-
const titleVariant = (_d = (_c = (_b2 = (_a2 = theme.components) == null ? void 0 : _a2.MuiCardHeader) == null ? void 0 : _b2.defaultProps) == null ? void 0 : _c.titleTypographyProps) == null ? void 0 : _d.variant;
|
|
856
|
-
return /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
|
|
857
|
-
import_CardHeader.default,
|
|
858
|
-
__spreadProps(__spreadValues({}, rest), {
|
|
859
|
-
titleTypographyProps: __spreadValues({
|
|
860
|
-
variant: titleVariant
|
|
861
|
-
}, titleTypographyProps),
|
|
862
|
-
subheaderTypographyProps: __spreadValues({ variant: "subtitle2" }, subheaderTypographyProps)
|
|
863
|
-
})
|
|
864
|
-
);
|
|
865
|
-
};
|
|
866
|
-
|
|
867
|
-
// ../card/src/lib/CardMedia.tsx
|
|
868
|
-
var import_CardMedia = __toESM(require("@mui/material/CardMedia"));
|
|
869
|
-
var import_jsx_runtime12 = require("react/jsx-runtime");
|
|
870
|
-
|
|
871
|
-
// src/lib/SpacesLink/SpacesLink.tsx
|
|
872
|
-
var import_mui_typography3 = require("@availity/mui-typography");
|
|
873
|
-
var import_mui_icon4 = require("@availity/mui-icon");
|
|
874
|
-
var import_react10 = require("react");
|
|
875
|
-
|
|
876
|
-
// ../chip/src/lib/Chip.tsx
|
|
877
|
-
var import_Chip = __toESM(require("@mui/material/Chip"));
|
|
878
|
-
var import_jsx_runtime13 = require("react/jsx-runtime");
|
|
879
|
-
var Chip = (props) => {
|
|
880
|
-
return /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(import_Chip.default, __spreadProps(__spreadValues({}, props), { color: "default", size: "medium" }));
|
|
881
|
-
};
|
|
882
|
-
|
|
883
|
-
// ../chip/src/lib/StatusChip.tsx
|
|
884
|
-
var import_Chip2 = __toESM(require("@mui/material/Chip"));
|
|
885
|
-
var import_jsx_runtime14 = require("react/jsx-runtime");
|
|
886
|
-
var StatusChip = (_a) => {
|
|
887
|
-
var _b = _a, { color = "default" } = _b, rest = __objRest(_b, ["color"]);
|
|
888
|
-
return /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_Chip2.default, __spreadProps(__spreadValues({ color }, rest), { size: "small" }));
|
|
889
|
-
};
|
|
890
|
-
|
|
891
|
-
// ../link/src/lib/Link.tsx
|
|
892
|
-
var import_react5 = require("react");
|
|
757
|
+
var import_mui_card = require("@availity/mui-card");
|
|
758
|
+
var import_mui_typography2 = require("@availity/mui-typography");
|
|
759
|
+
var import_react4 = require("react");
|
|
760
|
+
var import_mui_chip = require("@availity/mui-chip");
|
|
761
|
+
var import_mui_progress3 = require("@availity/mui-progress");
|
|
893
762
|
var import_Link = __toESM(require("@mui/material/Link"));
|
|
894
|
-
var
|
|
895
|
-
var import_jsx_runtime15 = require("react/jsx-runtime");
|
|
896
|
-
var ABSOLUTE_URL_REGEX = /^[a-zA-Z][a-zA-Z\d+\-.]*?:/;
|
|
897
|
-
var WINDOWS_PATH_REGEX = /^[a-zA-Z]:\\/;
|
|
898
|
-
function isAbsoluteUrl2(url) {
|
|
899
|
-
if (WINDOWS_PATH_REGEX.test(url)) {
|
|
900
|
-
return false;
|
|
901
|
-
}
|
|
902
|
-
return ABSOLUTE_URL_REGEX.test(url);
|
|
903
|
-
}
|
|
904
|
-
var getUrl2 = (url = "") => {
|
|
905
|
-
return `/public/apps/home/#!/loadApp?appUrl=${encodeURIComponent(url)}`;
|
|
906
|
-
};
|
|
907
|
-
var getLocation = (href) => {
|
|
908
|
-
const location = document.createElement("a");
|
|
909
|
-
location.href = href;
|
|
910
|
-
return location;
|
|
911
|
-
};
|
|
912
|
-
var setRel = (url, target, absolute) => {
|
|
913
|
-
if (target === "_blank" && absolute) {
|
|
914
|
-
const dest = getLocation(url);
|
|
915
|
-
if (dest.hostname !== window.location.hostname) {
|
|
916
|
-
return "noopener noreferrer";
|
|
917
|
-
}
|
|
918
|
-
}
|
|
919
|
-
return void 0;
|
|
920
|
-
};
|
|
921
|
-
var Link = (0, import_react5.forwardRef)((props, ref) => {
|
|
922
|
-
const _a = props, { href, target = "_self", children, onClick, loadApp = true, rel, iconPosition = "start" } = _a, rest = __objRest(_a, ["href", "target", "children", "onClick", "loadApp", "rel", "iconPosition"]);
|
|
923
|
-
const absolute = isAbsoluteUrl2(href);
|
|
924
|
-
const encode = !(absolute || !loadApp);
|
|
925
|
-
const url = encode ? getUrl2(href) : href;
|
|
926
|
-
const NewWindowIcon = target === "_blank" ? /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(import_mui_icon2.OpenInNewIcon, {}) : null;
|
|
927
|
-
const startIcon = iconPosition === "start";
|
|
928
|
-
const endIcon = iconPosition === "end";
|
|
929
|
-
return /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
|
|
930
|
-
import_Link.default,
|
|
931
|
-
__spreadProps(__spreadValues({
|
|
932
|
-
href: url,
|
|
933
|
-
target,
|
|
934
|
-
onClick: (event) => onClick && onClick(event, url),
|
|
935
|
-
rel: rel || setRel(url, target, absolute)
|
|
936
|
-
}, rest), {
|
|
937
|
-
ref,
|
|
938
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("span", { children: [
|
|
939
|
-
startIcon && NewWindowIcon,
|
|
940
|
-
" ",
|
|
941
|
-
children,
|
|
942
|
-
" ",
|
|
943
|
-
endIcon && NewWindowIcon
|
|
944
|
-
] })
|
|
945
|
-
})
|
|
946
|
-
);
|
|
947
|
-
});
|
|
948
|
-
|
|
949
|
-
// ../favorites/src/lib/Favorites.tsx
|
|
950
|
-
var import_react6 = require("react");
|
|
951
|
-
var import_react_query3 = require("@tanstack/react-query");
|
|
952
|
-
var import_message_core3 = __toESM(require("@availity/message-core"));
|
|
953
|
-
|
|
954
|
-
// ../favorites/src/lib/utils.ts
|
|
955
|
-
var import_message_core2 = __toESM(require("@availity/message-core"));
|
|
956
|
-
var import_api_axios3 = require("@availity/api-axios");
|
|
957
|
-
var import_react_query2 = require("@tanstack/react-query");
|
|
958
|
-
|
|
959
|
-
// ../favorites/src/lib/Favorites.tsx
|
|
960
|
-
var import_jsx_runtime16 = require("react/jsx-runtime");
|
|
961
|
-
var FavoritesContext = (0, import_react6.createContext)(null);
|
|
962
|
-
var noOp = () => {
|
|
963
|
-
};
|
|
964
|
-
var useFavorites = (id) => {
|
|
965
|
-
const context = (0, import_react6.useContext)(FavoritesContext);
|
|
966
|
-
if (context === null) {
|
|
967
|
-
throw new Error("useFavorites must be used within a FavoritesProvider");
|
|
968
|
-
}
|
|
969
|
-
const { favorites, queryStatus, mutationStatus, lastClickedFavoriteId, deleteFavorite, addFavorite } = context;
|
|
970
|
-
const isLastClickedFavorite = lastClickedFavoriteId === id;
|
|
971
|
-
const isFavorited = (0, import_react6.useMemo)(() => {
|
|
972
|
-
const fav = favorites == null ? void 0 : favorites.find((f) => f.id === id);
|
|
973
|
-
return !!fav;
|
|
974
|
-
}, [favorites, id]);
|
|
975
|
-
const toggleFavorite = () => isFavorited ? deleteFavorite(id) : addFavorite(id);
|
|
976
|
-
const isDisabled = queryStatus === "loading" || queryStatus === "idle" || mutationStatus === "loading";
|
|
977
|
-
let status = "initLoading";
|
|
978
|
-
if (queryStatus === "loading")
|
|
979
|
-
status = "initLoading";
|
|
980
|
-
if (mutationStatus === "loading")
|
|
981
|
-
status = "reloading";
|
|
982
|
-
if (queryStatus === "error" || mutationStatus === "error")
|
|
983
|
-
status = "error";
|
|
984
|
-
if (queryStatus === "success" && (mutationStatus === "success" || mutationStatus === "idle"))
|
|
985
|
-
status = "success";
|
|
986
|
-
return {
|
|
987
|
-
isFavorited,
|
|
988
|
-
status,
|
|
989
|
-
isLastClickedFavorite,
|
|
990
|
-
toggleFavorite: isDisabled ? noOp : toggleFavorite
|
|
991
|
-
};
|
|
992
|
-
};
|
|
993
|
-
|
|
994
|
-
// ../tooltip/src/lib/Tooltip.tsx
|
|
995
|
-
var import_Tooltip = __toESM(require("@mui/material/Tooltip"));
|
|
996
|
-
var import_jsx_runtime17 = require("react/jsx-runtime");
|
|
997
|
-
var Tooltip = (props) => {
|
|
998
|
-
const _a = props, { children, dangerouslySetTransitionTimer } = _a, rest = __objRest(_a, ["children", "dangerouslySetTransitionTimer"]);
|
|
999
|
-
return /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
|
|
1000
|
-
import_Tooltip.default,
|
|
1001
|
-
__spreadProps(__spreadValues({}, rest), {
|
|
1002
|
-
TransitionProps: { timeout: dangerouslySetTransitionTimer !== void 0 ? dangerouslySetTransitionTimer : 100 },
|
|
1003
|
-
arrow: true,
|
|
1004
|
-
children
|
|
1005
|
-
})
|
|
1006
|
-
);
|
|
1007
|
-
};
|
|
1008
|
-
|
|
1009
|
-
// ../favorites/src/lib/FavoriteHeart.tsx
|
|
1010
|
-
var import_mui_icon3 = require("@availity/mui-icon");
|
|
1011
|
-
var import_styles2 = require("@mui/material/styles");
|
|
1012
|
-
var import_jsx_runtime18 = require("react/jsx-runtime");
|
|
1013
|
-
var icons = {
|
|
1014
|
-
spinner: /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(CircularProgress, { "aria-hidden": true, size: "small", loadingCaption: false }),
|
|
1015
|
-
unknownDisabledHeart: /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(import_mui_icon3.HeartIcon, { "aria-hidden": true, color: "disabled" }),
|
|
1016
|
-
favoritedDisabledHeart: /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(import_mui_icon3.HeartIcon, { "aria-hidden": true, color: "error", opacity: "0.6" }),
|
|
1017
|
-
unfavoritedDisabledHeart: /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(import_mui_icon3.HeartEmptyIcon, { "aria-hidden": true, color: "disabled", opacity: "0.6" }),
|
|
1018
|
-
favoritedHeart: /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(import_mui_icon3.HeartIcon, { "aria-hidden": true, color: "error" }),
|
|
1019
|
-
unfavoritedHeart: /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(import_mui_icon3.HeartEmptyIcon, { "aria-hidden": true, color: "secondary" })
|
|
1020
|
-
};
|
|
1021
|
-
var FavoriteHeartContainer = (0, import_styles2.styled)("div", { name: "AvFavoriteHeart", slot: "root" })({});
|
|
1022
|
-
var FavoriteInput = (0, import_styles2.styled)("input", {
|
|
1023
|
-
name: "AvFavoriteHeart",
|
|
1024
|
-
slot: "input"
|
|
1025
|
-
})({});
|
|
1026
|
-
var FavoriteIcon = (0, import_styles2.styled)("div", {
|
|
1027
|
-
name: "AvFavoriteHeart",
|
|
1028
|
-
slot: "icon"
|
|
1029
|
-
})({});
|
|
1030
|
-
var FavoriteHeart = ({
|
|
1031
|
-
id,
|
|
1032
|
-
name,
|
|
1033
|
-
onChange,
|
|
1034
|
-
onMouseDown,
|
|
1035
|
-
disabled = false
|
|
1036
|
-
}) => {
|
|
1037
|
-
const { isFavorited, isLastClickedFavorite, status, toggleFavorite } = useFavorites(id);
|
|
1038
|
-
const handleChange = (event) => {
|
|
1039
|
-
onChange == null ? void 0 : onChange(isFavorited, event);
|
|
1040
|
-
toggleFavorite();
|
|
1041
|
-
};
|
|
1042
|
-
const handleKeyPress = (event) => {
|
|
1043
|
-
if (event.code === "Enter" || event.key === "Enter") {
|
|
1044
|
-
onChange == null ? void 0 : onChange(isFavorited, event);
|
|
1045
|
-
toggleFavorite();
|
|
1046
|
-
}
|
|
1047
|
-
};
|
|
1048
|
-
const iconKey = (() => {
|
|
1049
|
-
if (status === "initLoading")
|
|
1050
|
-
return "unknownDisabledHeart";
|
|
1051
|
-
if (status === "reloading") {
|
|
1052
|
-
if (isLastClickedFavorite)
|
|
1053
|
-
return "spinner";
|
|
1054
|
-
return isFavorited ? "favoritedDisabledHeart" : "unfavoritedDisabledHeart";
|
|
1055
|
-
}
|
|
1056
|
-
if (disabled) {
|
|
1057
|
-
return isFavorited ? "favoritedDisabledHeart" : "unfavoritedDisabledHeart";
|
|
1058
|
-
}
|
|
1059
|
-
if (isFavorited)
|
|
1060
|
-
return "favoritedHeart";
|
|
1061
|
-
return "unfavoritedHeart";
|
|
1062
|
-
})();
|
|
1063
|
-
const cursor = disabled || !isLastClickedFavorite && (status === "initLoading" || status === "reloading") ? "not-allowed" : void 0;
|
|
1064
|
-
const tooltipContent = `${isFavorited ? "Remove from" : "Add to"} My Favorites`;
|
|
1065
|
-
const favoriteInputProps = {
|
|
1066
|
-
onKeyDown: handleKeyPress,
|
|
1067
|
-
type: "checkbox",
|
|
1068
|
-
"aria-label": `Favorite ${name}`,
|
|
1069
|
-
id: `av-favorite-heart-${id}`,
|
|
1070
|
-
disabled,
|
|
1071
|
-
checked: isFavorited,
|
|
1072
|
-
onChange: handleChange,
|
|
1073
|
-
onMouseDown,
|
|
1074
|
-
style: { cursor }
|
|
1075
|
-
};
|
|
1076
|
-
return /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)(FavoriteHeartContainer, { children: [
|
|
1077
|
-
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)(FavoriteIcon, { children: icons[iconKey] }),
|
|
1078
|
-
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
|
|
1079
|
-
"span",
|
|
1080
|
-
{
|
|
1081
|
-
style: {
|
|
1082
|
-
position: "absolute",
|
|
1083
|
-
width: "1px",
|
|
1084
|
-
height: "1px",
|
|
1085
|
-
padding: 0,
|
|
1086
|
-
margin: "-1px",
|
|
1087
|
-
overflow: "hidden",
|
|
1088
|
-
clip: "rect(0,0,0,0)",
|
|
1089
|
-
whiteSpace: "nowrap",
|
|
1090
|
-
border: 0
|
|
1091
|
-
},
|
|
1092
|
-
"aria-live": isLastClickedFavorite && (status === "reloading" || status === "error") ? "polite" : "off",
|
|
1093
|
-
children: isLastClickedFavorite && status === "reloading" ? "Loading..." : isLastClickedFavorite && status === "error" ? "An error has occurred. Please try again." : ""
|
|
1094
|
-
}
|
|
1095
|
-
),
|
|
1096
|
-
disabled ? /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(FavoriteInput, __spreadValues({}, favoriteInputProps)) : /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(Tooltip, { title: tooltipContent, placement: "top", children: /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(FavoriteInput, __spreadValues({}, favoriteInputProps)) })
|
|
1097
|
-
] });
|
|
1098
|
-
};
|
|
1099
|
-
|
|
1100
|
-
// src/lib/SpacesLink/SpacesLink.tsx
|
|
763
|
+
var import_mui_favorites = require("@availity/mui-favorites");
|
|
1101
764
|
var import_mui_layout2 = require("@availity/mui-layout");
|
|
1102
|
-
|
|
1103
|
-
// ../list/src/lib/List.tsx
|
|
1104
|
-
var import_List = __toESM(require("@mui/material/List"));
|
|
1105
|
-
var import_jsx_runtime19 = require("react/jsx-runtime");
|
|
1106
|
-
|
|
1107
|
-
// ../list/src/lib/ListItem.tsx
|
|
1108
|
-
var import_ListItem = __toESM(require("@mui/material/ListItem"));
|
|
1109
|
-
var import_react7 = require("react");
|
|
1110
|
-
var import_jsx_runtime20 = require("react/jsx-runtime");
|
|
1111
|
-
var ListItem = (0, import_react7.forwardRef)((props, ref) => {
|
|
1112
|
-
return /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(import_ListItem.default, __spreadProps(__spreadValues({}, props), { ref }));
|
|
1113
|
-
});
|
|
1114
|
-
|
|
1115
|
-
// ../list/src/lib/ListItemAvatar.tsx
|
|
1116
|
-
var import_ListItemAvatar = __toESM(require("@mui/material/ListItemAvatar"));
|
|
1117
|
-
var import_jsx_runtime21 = require("react/jsx-runtime");
|
|
1118
|
-
|
|
1119
|
-
// ../list/src/lib/ListItemButton.tsx
|
|
1120
|
-
var import_ListItemButton = __toESM(require("@mui/material/ListItemButton"));
|
|
1121
|
-
var import_react8 = require("react");
|
|
1122
|
-
var import_jsx_runtime22 = require("react/jsx-runtime");
|
|
1123
|
-
var ListItemButton = (0, import_react8.forwardRef)((props, ref) => {
|
|
1124
|
-
return /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(import_ListItemButton.default, __spreadProps(__spreadValues({}, props), { ref }));
|
|
1125
|
-
});
|
|
1126
|
-
|
|
1127
|
-
// ../list/src/lib/ListItemIcon.tsx
|
|
1128
|
-
var import_ListItemIcon = __toESM(require("@mui/material/ListItemIcon"));
|
|
1129
|
-
var import_jsx_runtime23 = require("react/jsx-runtime");
|
|
1130
|
-
|
|
1131
|
-
// ../list/src/lib/ListItemStatusCard.tsx
|
|
1132
|
-
var import_react9 = require("react");
|
|
1133
|
-
var import_styles3 = require("@mui/material/styles");
|
|
1134
|
-
var import_ListItem2 = __toESM(require("@mui/material/ListItem"));
|
|
1135
|
-
var import_jsx_runtime24 = require("react/jsx-runtime");
|
|
1136
|
-
var ListItemStatusCardSlot = (0, import_styles3.styled)(import_ListItem2.default, {
|
|
1137
|
-
name: "AvListItemStatusCard",
|
|
1138
|
-
slot: "root",
|
|
1139
|
-
overridesResolver: (props, styles) => [styles.root, props.color && styles.color]
|
|
1140
|
-
})(({ theme, ownerState }) => __spreadValues({
|
|
1141
|
-
backgroundColor: theme.palette.background.paper,
|
|
1142
|
-
border: `1px solid ${theme.palette.divider}`,
|
|
1143
|
-
borderRadius: "4px",
|
|
1144
|
-
marginBottom: "4px",
|
|
1145
|
-
paddingLeft: "8px",
|
|
1146
|
-
"&.MuiListItem-padding.MuiListItem-gutters": {
|
|
1147
|
-
paddingLeft: "calc(16px + 8px)"
|
|
1148
|
-
}
|
|
1149
|
-
}, ownerState.color && ownerState.color !== "default" && {
|
|
1150
|
-
".AvListItemStatusCard-statusAccent": {
|
|
1151
|
-
backgroundColor: `${theme.palette[ownerState.color].main}`
|
|
1152
|
-
}
|
|
1153
|
-
}));
|
|
1154
|
-
var StatusAccent = (0, import_styles3.styled)("div", {
|
|
1155
|
-
name: "AvListItemStatusCard",
|
|
1156
|
-
slot: "statusAccent",
|
|
1157
|
-
overridesResolver: (props, styles) => [styles.statusAccent, props.color && styles.color]
|
|
1158
|
-
})(({ theme }) => ({
|
|
1159
|
-
position: "absolute",
|
|
1160
|
-
left: 0,
|
|
1161
|
-
top: 0,
|
|
1162
|
-
height: "100%",
|
|
1163
|
-
width: "8px",
|
|
1164
|
-
backgroundColor: theme.palette.divider,
|
|
1165
|
-
backgroundClip: "border-box",
|
|
1166
|
-
borderTopLeftRadius: "3px",
|
|
1167
|
-
borderBottomLeftRadius: "3px",
|
|
1168
|
-
content: "''"
|
|
1169
|
-
}));
|
|
1170
|
-
var ListItemStatusCard = (0, import_react9.forwardRef)((props, ref) => {
|
|
1171
|
-
const _a = props, { alignItems = "flex-start", children, color } = _a, rest = __objRest(_a, ["alignItems", "children", "color"]);
|
|
1172
|
-
const themeProps = (0, import_styles3.useThemeProps)({ props, name: "AvListItemStatusCard" });
|
|
1173
|
-
const ownerState = __spreadProps(__spreadValues({}, themeProps), { color });
|
|
1174
|
-
return /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)(ListItemStatusCardSlot, __spreadProps(__spreadValues({ alignItems, divider: false, ownerState }, rest), { ref, children: [
|
|
1175
|
-
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)(StatusAccent, { className: "AvListItemStatusCard-statusAccent" }),
|
|
1176
|
-
children
|
|
1177
|
-
] }));
|
|
1178
|
-
});
|
|
1179
|
-
|
|
1180
|
-
// ../list/src/lib/ListItemText.tsx
|
|
1181
|
-
var import_ListItemText = __toESM(require("@mui/material/ListItemText"));
|
|
1182
|
-
var import_jsx_runtime25 = require("react/jsx-runtime");
|
|
1183
|
-
var ListItemText = (_a) => {
|
|
1184
|
-
var _b = _a, { children } = _b, rest = __objRest(_b, ["children"]);
|
|
1185
|
-
return /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(import_ListItemText.default, __spreadProps(__spreadValues({}, rest), { children }));
|
|
1186
|
-
};
|
|
1187
|
-
|
|
1188
|
-
// ../list/src/lib/ListSubheader.tsx
|
|
1189
|
-
var import_ListSubheader = __toESM(require("@mui/material/ListSubheader"));
|
|
1190
|
-
var import_jsx_runtime26 = require("react/jsx-runtime");
|
|
1191
|
-
|
|
1192
|
-
// src/lib/SpacesLink/SpacesLink.tsx
|
|
765
|
+
var import_mui_list = require("@availity/mui-list");
|
|
1193
766
|
var import_react_markdown2 = __toESM(require("react-markdown"));
|
|
767
|
+
var import_styles = require("@mui/material/styles");
|
|
1194
768
|
|
|
1195
769
|
// src/lib/SpacesLink/useLink.tsx
|
|
1196
770
|
var import_hooks = require("@availity/hooks");
|
|
@@ -1333,26 +907,30 @@ var useLink = (spaceOrSpaceId, options) => {
|
|
|
1333
907
|
};
|
|
1334
908
|
|
|
1335
909
|
// src/lib/SpacesLink/SpacesLink.tsx
|
|
1336
|
-
var
|
|
910
|
+
var import_jsx_runtime6 = require("react/jsx-runtime");
|
|
911
|
+
var SpacesLinkContainer = (0, import_styles.styled)(import_mui_layout2.Box, { name: "AvSpacesLink", slot: "root" })({});
|
|
912
|
+
var DateInfo = (0, import_styles.styled)(import_mui_layout2.Grid, { name: "AvSpacesLink", slot: "AvDateInfo" })({});
|
|
913
|
+
var SpacesLinkFavoriteHeart = (0, import_styles.styled)(import_mui_layout2.Grid, { name: "AvSpacesLink", slot: "AvFavoriteHeart" })({});
|
|
914
|
+
var IconLink = (0, import_styles.styled)(import_Link.default, { name: "AvSpacesLink", slot: "IconLink" })({});
|
|
1337
915
|
var getDisplayDate = (date) => (0, import_dayjs2.default)(date).format("MM/DD/YYYY");
|
|
1338
916
|
var getContainerTag = (propTag, variant) => {
|
|
1339
917
|
if (variant && variant !== "default")
|
|
1340
|
-
return { card: Card, list: ListItem }[variant];
|
|
918
|
+
return { card: import_mui_card.Card, list: import_mui_list.ListItem }[variant];
|
|
1341
919
|
return propTag || "div";
|
|
1342
920
|
};
|
|
1343
921
|
var getBodyTag = (propTag, variant) => {
|
|
1344
922
|
if (variant && variant !== "default")
|
|
1345
|
-
return { card: CardContent, list: "div" }[variant];
|
|
923
|
+
return { card: import_mui_card.CardContent, list: "div" }[variant];
|
|
1346
924
|
return propTag || "div";
|
|
1347
925
|
};
|
|
1348
926
|
var getTitleTag = (propTag, variant) => {
|
|
1349
927
|
if (variant && variant !== "default")
|
|
1350
|
-
return
|
|
1351
|
-
return propTag ||
|
|
928
|
+
return import_Link.default;
|
|
929
|
+
return propTag || import_Link.default;
|
|
1352
930
|
};
|
|
1353
931
|
var getTextTag = (propTag, variant) => {
|
|
1354
932
|
if (variant && variant !== "default")
|
|
1355
|
-
return { card:
|
|
933
|
+
return { card: import_mui_typography2.Typography, list: import_mui_list.ListItemText }[variant];
|
|
1356
934
|
return propTag || "div";
|
|
1357
935
|
};
|
|
1358
936
|
var SpacesLink = (_a) => {
|
|
@@ -1362,7 +940,7 @@ var SpacesLink = (_a) => {
|
|
|
1362
940
|
className,
|
|
1363
941
|
children,
|
|
1364
942
|
favorite,
|
|
1365
|
-
icon,
|
|
943
|
+
icon: FileIcon,
|
|
1366
944
|
showName = true,
|
|
1367
945
|
showNew,
|
|
1368
946
|
showDate,
|
|
@@ -1420,22 +998,22 @@ var SpacesLink = (_a) => {
|
|
|
1420
998
|
const isLoading = loading || propsLoading;
|
|
1421
999
|
const [linkSpace, props] = useLink(propSpace || spaceId, { clientId: propsClientId, linkAttributes });
|
|
1422
1000
|
const showUrl = !(linkSpace == null ? void 0 : linkSpace.isGhosted) && ((_a2 = linkSpace == null ? void 0 : linkSpace.link) == null ? void 0 : _a2.url);
|
|
1423
|
-
const favoriteIcon = (0,
|
|
1424
|
-
() => (linkSpace == null ? void 0 : linkSpace.configurationId) && favorite && /* @__PURE__ */ (0,
|
|
1425
|
-
FavoriteHeart,
|
|
1001
|
+
const favoriteIcon = (0, import_react4.useMemo)(
|
|
1002
|
+
() => (linkSpace == null ? void 0 : linkSpace.configurationId) && favorite && /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(SpacesLinkFavoriteHeart, { children: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
|
|
1003
|
+
import_mui_favorites.FavoriteHeart,
|
|
1426
1004
|
{
|
|
1427
1005
|
id: `${idPrefix}${linkSpace == null ? void 0 : linkSpace.configurationId}`,
|
|
1428
1006
|
name: linkSpace == null ? void 0 : linkSpace.name,
|
|
1429
1007
|
onChange: (_, e) => e.stopPropagation()
|
|
1430
1008
|
}
|
|
1431
|
-
),
|
|
1009
|
+
) }),
|
|
1432
1010
|
[favorite, linkSpace == null ? void 0 : linkSpace.configurationId, linkSpace == null ? void 0 : linkSpace.name, idPrefix]
|
|
1433
1011
|
);
|
|
1434
|
-
const dateInfo = (0,
|
|
1435
|
-
() => (showNew || showDate) && /* @__PURE__ */ (0,
|
|
1436
|
-
showNew && (linkSpace == null ? void 0 : linkSpace.isNew) && /* @__PURE__ */ (0,
|
|
1437
|
-
showDate && /* @__PURE__ */ (0,
|
|
1438
|
-
|
|
1012
|
+
const dateInfo = (0, import_react4.useMemo)(
|
|
1013
|
+
() => (showNew || showDate) && /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(DateInfo, { textAlign: stacked ? "center" : "right", children: [
|
|
1014
|
+
showNew && (linkSpace == null ? void 0 : linkSpace.isNew) && /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_mui_chip.StatusChip, { id: `${idPrefix}app-new-badge-${linkSpace == null ? void 0 : linkSpace.configurationId}`, label: "New!", color: "secondary" }),
|
|
1015
|
+
showDate && /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
|
|
1016
|
+
import_mui_typography2.Typography,
|
|
1439
1017
|
{
|
|
1440
1018
|
id: `${idPrefix}app-date-badge-${linkSpace == null ? void 0 : linkSpace.configurationId}`,
|
|
1441
1019
|
variant: "caption",
|
|
@@ -1446,14 +1024,14 @@ var SpacesLink = (_a) => {
|
|
|
1446
1024
|
] }),
|
|
1447
1025
|
[linkSpace == null ? void 0 : linkSpace.activeDate, linkSpace == null ? void 0 : linkSpace.isNew, showDate, showNew, stacked, linkSpace == null ? void 0 : linkSpace.configurationId, idPrefix]
|
|
1448
1026
|
);
|
|
1449
|
-
const customBadgeDisplay = (0,
|
|
1450
|
-
() => customBadgeText && /* @__PURE__ */ (0,
|
|
1027
|
+
const customBadgeDisplay = (0, import_react4.useMemo)(
|
|
1028
|
+
() => customBadgeText && /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
|
|
1451
1029
|
import_mui_layout2.Box,
|
|
1452
1030
|
{
|
|
1453
1031
|
textAlign: stacked ? "center" : "inherit",
|
|
1454
|
-
marginRight: variant !== "card" && (showDate || showNew && (linkSpace == null ? void 0 : linkSpace.isNew)) ?
|
|
1455
|
-
children: /* @__PURE__ */ (0,
|
|
1456
|
-
StatusChip,
|
|
1032
|
+
marginRight: variant !== "card" && (showDate || showNew && (linkSpace == null ? void 0 : linkSpace.isNew)) ? 1 : void 0,
|
|
1033
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
|
|
1034
|
+
import_mui_chip.StatusChip,
|
|
1457
1035
|
{
|
|
1458
1036
|
color: customBadgeColor || "info",
|
|
1459
1037
|
id: `${idPrefix}app-custom-badge-${linkSpace == null ? void 0 : linkSpace.configurationId}-${customBadgeText}`,
|
|
@@ -1475,7 +1053,7 @@ var SpacesLink = (_a) => {
|
|
|
1475
1053
|
]
|
|
1476
1054
|
);
|
|
1477
1055
|
if (isLoading) {
|
|
1478
|
-
return /* @__PURE__ */ (0,
|
|
1056
|
+
return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_mui_progress3.CircularProgress, __spreadValues({ id: `${idPrefix}app-${linkSpace == null ? void 0 : linkSpace.configurationId}-loading` }, rest));
|
|
1479
1057
|
}
|
|
1480
1058
|
const Tag = getContainerTag(tag, variant);
|
|
1481
1059
|
const BodyTag = getBodyTag(bodyTag, variant);
|
|
@@ -1483,7 +1061,7 @@ var SpacesLink = (_a) => {
|
|
|
1483
1061
|
const TextTag = getTextTag(textTag, variant);
|
|
1484
1062
|
const renderChildren = () => {
|
|
1485
1063
|
if (children) {
|
|
1486
|
-
return isFunction(children) ? (() => children(__spreadValues(__spreadValues(__spreadValues({}, linkSpace), analytics), props)))() : (0,
|
|
1064
|
+
return isFunction(children) ? (() => children(__spreadValues(__spreadValues(__spreadValues({}, linkSpace), analytics), props)))() : (0, import_react4.cloneElement)(children, __spreadValues(__spreadValues({
|
|
1487
1065
|
role: "link",
|
|
1488
1066
|
tabIndex: 0,
|
|
1489
1067
|
style: { cursor: showUrl ? "pointer" : "not-allowed" },
|
|
@@ -1491,78 +1069,100 @@ var SpacesLink = (_a) => {
|
|
|
1491
1069
|
}, analytics), props));
|
|
1492
1070
|
}
|
|
1493
1071
|
};
|
|
1494
|
-
return /* @__PURE__ */ (0,
|
|
1495
|
-
|
|
1072
|
+
return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
|
|
1073
|
+
SpacesLinkContainer,
|
|
1496
1074
|
__spreadProps(__spreadValues({
|
|
1075
|
+
component: Tag,
|
|
1497
1076
|
title: linkSpace == null ? void 0 : linkSpace.name,
|
|
1498
1077
|
className
|
|
1499
1078
|
}, rest), {
|
|
1500
1079
|
style: __spreadValues({}, style),
|
|
1501
1080
|
role: variant === "list" ? "listitem" : role,
|
|
1502
|
-
children: /* @__PURE__ */ (0,
|
|
1503
|
-
|
|
1504
|
-
|
|
1505
|
-
|
|
1506
|
-
|
|
1507
|
-
|
|
1508
|
-
|
|
1509
|
-
|
|
1510
|
-
|
|
1511
|
-
|
|
1512
|
-
|
|
1513
|
-
|
|
1514
|
-
|
|
1515
|
-
|
|
1516
|
-
|
|
1517
|
-
|
|
1081
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(BodyTag, { style: { width: "100%" }, children: /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(
|
|
1082
|
+
import_mui_layout2.Grid,
|
|
1083
|
+
{
|
|
1084
|
+
alignItems: !showDescription || stacked ? "center" : "start",
|
|
1085
|
+
direction: stacked ? "column" : "row",
|
|
1086
|
+
container: true,
|
|
1087
|
+
flexWrap: "nowrap",
|
|
1088
|
+
children: [
|
|
1089
|
+
!stacked && favoriteIcon,
|
|
1090
|
+
FileIcon && (linkSpace == null ? void 0 : linkSpace.url) && ((_b2 = linkSpace == null ? void 0 : linkSpace.type) == null ? void 0 : _b2.toUpperCase()) === "FILE" ? /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
|
|
1091
|
+
IconLink,
|
|
1092
|
+
{
|
|
1093
|
+
target: "_blank",
|
|
1094
|
+
href: linkSpace == null ? void 0 : linkSpace.url,
|
|
1095
|
+
role: "link",
|
|
1096
|
+
"aria-labelledby": `${idPrefix}app-title-${linkSpace == null ? void 0 : linkSpace.configurationId}`,
|
|
1097
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(FileIcon, { "data-testid": "icon" })
|
|
1098
|
+
}
|
|
1099
|
+
) : null,
|
|
1100
|
+
children ? renderChildren() : body && /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(import_mui_layout2.Grid, { id: `${idPrefix}${linkSpace == null ? void 0 : linkSpace.type}-${linkSpace == null ? void 0 : linkSpace.configurationId}`, flexGrow: 1, children: [
|
|
1101
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
|
|
1102
|
+
import_mui_layout2.Box,
|
|
1103
|
+
{
|
|
1104
|
+
marginBottom: !customBadgeDisplay && (!showDescription || !(linkSpace == null ? void 0 : linkSpace.description)) ? 0 : void 0,
|
|
1105
|
+
paddingTop: stacked ? 3 : void 0,
|
|
1106
|
+
textAlign: stacked ? "center" : void 0,
|
|
1107
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
|
|
1108
|
+
TitleTag,
|
|
1109
|
+
__spreadProps(__spreadValues(__spreadValues({
|
|
1110
|
+
id: `${idPrefix}app-title-${linkSpace == null ? void 0 : linkSpace.configurationId}`,
|
|
1111
|
+
className: titleClassName,
|
|
1112
|
+
tabIndex: 0,
|
|
1113
|
+
style: {
|
|
1114
|
+
cursor: showUrl ? "pointer" : "not-allowed"
|
|
1115
|
+
}
|
|
1116
|
+
}, analytics), props), {
|
|
1117
|
+
role: showUrl ? "link" : role,
|
|
1118
|
+
"aria-label": linkSpace == null ? void 0 : linkSpace.name,
|
|
1119
|
+
"aria-describedby": showNew && (linkSpace == null ? void 0 : linkSpace.isNew) ? `${idPrefix}app-new-badge-${linkSpace == null ? void 0 : linkSpace.configurationId}` : void 0,
|
|
1120
|
+
variant: variant === "list" ? "h5" : "h6",
|
|
1121
|
+
title: showName ? linkSpace == null ? void 0 : linkSpace.name : void 0,
|
|
1122
|
+
children: showName ? linkSpace == null ? void 0 : linkSpace.name : void 0
|
|
1123
|
+
})
|
|
1124
|
+
)
|
|
1125
|
+
}
|
|
1126
|
+
),
|
|
1127
|
+
stacked && dateInfo,
|
|
1128
|
+
showDescription && (linkSpace == null ? void 0 : linkSpace.description) && /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
|
|
1129
|
+
TextTag,
|
|
1130
|
+
{
|
|
1131
|
+
component: "div",
|
|
1518
1132
|
style: {
|
|
1519
|
-
|
|
1520
|
-
|
|
1521
|
-
|
|
1522
|
-
|
|
1523
|
-
|
|
1524
|
-
|
|
1525
|
-
|
|
1526
|
-
|
|
1527
|
-
children:
|
|
1528
|
-
}
|
|
1529
|
-
)
|
|
1530
|
-
|
|
1531
|
-
|
|
1532
|
-
|
|
1533
|
-
|
|
1534
|
-
|
|
1535
|
-
|
|
1536
|
-
|
|
1537
|
-
textAlign: stacked ? "center" : void 0,
|
|
1538
|
-
overflow: "hidden",
|
|
1539
|
-
whiteSpace: maxDescriptionWidth ? "nowrap" : void 0,
|
|
1540
|
-
width: maxDescriptionWidth,
|
|
1541
|
-
textOverflow: "ellipsis",
|
|
1542
|
-
id: `${idPrefix}app-description-${linkSpace == null ? void 0 : linkSpace.configurationId}`,
|
|
1543
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(import_react_markdown2.default, { className: "Card-text", children: linkSpace == null ? void 0 : linkSpace.description })
|
|
1544
|
-
}
|
|
1545
|
-
),
|
|
1546
|
-
variant === "card" && customBadgeDisplay
|
|
1547
|
-
] }),
|
|
1548
|
-
variant !== "card" && customBadgeDisplay,
|
|
1549
|
-
!stacked && dateInfo
|
|
1550
|
-
] }) })
|
|
1133
|
+
marginTop: ".5rem",
|
|
1134
|
+
textAlign: stacked ? "center" : void 0,
|
|
1135
|
+
overflow: "hidden",
|
|
1136
|
+
whiteSpace: maxDescriptionWidth ? "nowrap" : void 0,
|
|
1137
|
+
width: maxDescriptionWidth,
|
|
1138
|
+
textOverflow: "ellipsis"
|
|
1139
|
+
},
|
|
1140
|
+
id: `${idPrefix}app-description-${linkSpace == null ? void 0 : linkSpace.configurationId}`,
|
|
1141
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_react_markdown2.default, { children: linkSpace == null ? void 0 : linkSpace.description })
|
|
1142
|
+
}
|
|
1143
|
+
),
|
|
1144
|
+
variant === "card" && customBadgeDisplay
|
|
1145
|
+
] }),
|
|
1146
|
+
variant !== "card" && customBadgeDisplay,
|
|
1147
|
+
!stacked && dateInfo
|
|
1148
|
+
]
|
|
1149
|
+
}
|
|
1150
|
+
) })
|
|
1551
1151
|
})
|
|
1552
1152
|
);
|
|
1553
1153
|
};
|
|
1554
1154
|
|
|
1555
1155
|
// src/lib/SpacesAgreement.tsx
|
|
1556
|
-
var
|
|
1156
|
+
var import_mui_typography3 = require("@availity/mui-typography");
|
|
1557
1157
|
var import_react_markdown3 = __toESM(require("react-markdown"));
|
|
1558
|
-
var
|
|
1158
|
+
var import_jsx_runtime7 = require("react/jsx-runtime");
|
|
1559
1159
|
var SpacesAgreement = ({ spaceId, markdown = false, id: elementId }) => {
|
|
1560
1160
|
const spaces = useSpaces(spaceId);
|
|
1561
1161
|
if (spaces && spaces.length > 0) {
|
|
1562
1162
|
const { description: agreement, id } = spaces[0];
|
|
1563
1163
|
if (agreement) {
|
|
1564
|
-
const children = markdown ? /* @__PURE__ */ (0,
|
|
1565
|
-
return /* @__PURE__ */ (0,
|
|
1164
|
+
const children = markdown ? /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(import_react_markdown3.default, { children: agreement }) : agreement;
|
|
1165
|
+
return /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(import_mui_typography3.Typography, { variant: "agreement", id: elementId || `spaces-agreement-${spaceId || id}`, children });
|
|
1566
1166
|
}
|
|
1567
1167
|
}
|
|
1568
1168
|
return null;
|
|
@@ -1571,7 +1171,7 @@ var SpacesAgreement = ({ spaceId, markdown = false, id: elementId }) => {
|
|
|
1571
1171
|
// src/lib/SpacesDisclaimer.tsx
|
|
1572
1172
|
var import_mui_disclaimer = require("@availity/mui-disclaimer");
|
|
1573
1173
|
var import_react_markdown4 = __toESM(require("react-markdown"));
|
|
1574
|
-
var
|
|
1174
|
+
var import_jsx_runtime8 = require("react/jsx-runtime");
|
|
1575
1175
|
var SpacesDisclaimer = (_a) => {
|
|
1576
1176
|
var _b = _a, {
|
|
1577
1177
|
accent = true,
|
|
@@ -1588,8 +1188,8 @@ var SpacesDisclaimer = (_a) => {
|
|
|
1588
1188
|
if (spaces && spaces.length > 0) {
|
|
1589
1189
|
const { description: disclaimer, id } = spaces[0];
|
|
1590
1190
|
if (disclaimer) {
|
|
1591
|
-
const children = markdown ? /* @__PURE__ */ (0,
|
|
1592
|
-
return /* @__PURE__ */ (0,
|
|
1191
|
+
const children = markdown ? /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(import_react_markdown4.default, { children: disclaimer }) : disclaimer;
|
|
1192
|
+
return /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
|
|
1593
1193
|
import_mui_disclaimer.Disclaimer,
|
|
1594
1194
|
__spreadValues({
|
|
1595
1195
|
accent,
|
|
@@ -1603,14 +1203,14 @@ var SpacesDisclaimer = (_a) => {
|
|
|
1603
1203
|
};
|
|
1604
1204
|
|
|
1605
1205
|
// src/lib/SpacesGhostText.tsx
|
|
1606
|
-
var
|
|
1206
|
+
var import_jsx_runtime9 = require("react/jsx-runtime");
|
|
1607
1207
|
var SpacesGhostText = (_a) => {
|
|
1608
1208
|
var _b = _a, { spaceId, id } = _b, props = __objRest(_b, ["spaceId", "id"]);
|
|
1609
1209
|
var _a2;
|
|
1610
1210
|
const spaces = useSpaces(spaceId);
|
|
1611
1211
|
const space = spaces == null ? void 0 : spaces[0];
|
|
1612
1212
|
if (space == null ? void 0 : space.isGhosted) {
|
|
1613
|
-
return /* @__PURE__ */ (0,
|
|
1213
|
+
return /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("small", __spreadProps(__spreadValues({ id: id || `app-ghost-text-${spaceId}` }, props), { children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("em", { children: (_a2 = space == null ? void 0 : space.meta) == null ? void 0 : _a2.ghostText }) }));
|
|
1614
1214
|
}
|
|
1615
1215
|
return null;
|
|
1616
1216
|
};
|