dce-reactkit 3.7.16 → 3.7.18
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/cjs/index.js +30 -5
- package/dist/cjs/index.js.map +1 -1
- package/dist/cjs/types/components/ToggleSwitch.d.ts +1 -0
- package/dist/cjs/types/stylesheets/shared.css.d.ts +6 -0
- package/dist/esm/index.js +30 -5
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/types/components/ToggleSwitch.d.ts +1 -0
- package/dist/esm/types/stylesheets/shared.css.d.ts +6 -0
- package/dist/index.d.ts +1 -0
- package/package.json +1 -1
- package/src/components/AppWrapper.tsx +7 -0
- package/src/components/ToggleSwitch.tsx +4 -1
- package/src/helpers/genRouteHandler.ts +7 -1
- package/src/stylesheets/shared.css.ts +18 -0
package/dist/cjs/index.js
CHANGED
|
@@ -873,6 +873,23 @@ const logClientEvent = (opts) => __awaiter(void 0, void 0, void 0, function* ()
|
|
|
873
873
|
});
|
|
874
874
|
});
|
|
875
875
|
|
|
876
|
+
/**
|
|
877
|
+
* Universal stylesheet
|
|
878
|
+
* @author Gabe Abrams
|
|
879
|
+
*/
|
|
880
|
+
const shared = `
|
|
881
|
+
/* Button with no style */
|
|
882
|
+
.btn-nostyle {
|
|
883
|
+
border: 0 !important;
|
|
884
|
+
background: transparent !important;
|
|
885
|
+
outline: 0 !important;
|
|
886
|
+
font-size: inherit !important;
|
|
887
|
+
color: inherit !important;
|
|
888
|
+
padding: 0 !important;
|
|
889
|
+
margin: 0 !important;
|
|
890
|
+
}
|
|
891
|
+
`;
|
|
892
|
+
|
|
876
893
|
/**
|
|
877
894
|
* A wrapper for the entire React app that adds global functionality like
|
|
878
895
|
* handling for fatal error messages, adds bootstrap support
|
|
@@ -1138,6 +1155,8 @@ const style$9 = `
|
|
|
1138
1155
|
opacity: 1;
|
|
1139
1156
|
}
|
|
1140
1157
|
}
|
|
1158
|
+
|
|
1159
|
+
${shared}
|
|
1141
1160
|
`;
|
|
1142
1161
|
/*------------------------------------------------------------------------*/
|
|
1143
1162
|
/* ------------------------------ Component ----------------------------- */
|
|
@@ -12906,7 +12925,7 @@ const ToggleSwitch = (props) => {
|
|
|
12906
12925
|
/*------------------------------------------------------------------------*/
|
|
12907
12926
|
/* -------------- Props ------------- */
|
|
12908
12927
|
// Destructure all props
|
|
12909
|
-
const { isOn, onToggle, id, description, backgroundVariantWhenOn = Variant$1.Info, } = props;
|
|
12928
|
+
const { isOn, onToggle, id, className, description, backgroundVariantWhenOn = Variant$1.Info, } = props;
|
|
12910
12929
|
/*------------------------------------------------------------------------*/
|
|
12911
12930
|
/* ------------------------------- Render ------------------------------- */
|
|
12912
12931
|
/*------------------------------------------------------------------------*/
|
|
@@ -12916,7 +12935,7 @@ const ToggleSwitch = (props) => {
|
|
|
12916
12935
|
const backgroundVariant = (isOn
|
|
12917
12936
|
? backgroundVariantWhenOn
|
|
12918
12937
|
: 'secondary');
|
|
12919
|
-
return (React__default["default"].createElement("button", { id: id, "aria-label": `If on, ${description}. Currently ${isOn ? 'on' : 'off'}. Click to turn ${isOn ? 'off' : 'on'}.`, className: `alert alert-${backgroundVariant} bg-${backgroundVariant} mb-0 rounded-pill d-inline-block pt-0 pb-0 px-3`, onClick: () => {
|
|
12938
|
+
return (React__default["default"].createElement("button", { id: id, "aria-label": `If on, ${description}. Currently ${isOn ? 'on' : 'off'}. Click to turn ${isOn ? 'off' : 'on'}.`, className: `alert alert-${backgroundVariant} bg-${backgroundVariant} mb-0 rounded-pill d-inline-block pt-0 pb-0 px-3 ${className !== null && className !== void 0 ? className : ''}`, onClick: () => {
|
|
12920
12939
|
onToggle(!isOn);
|
|
12921
12940
|
}, type: "button" },
|
|
12922
12941
|
React__default["default"].createElement(reactFontawesome.FontAwesomeIcon, { icon: freeSolidSvgIcons.faCircle, className: "text-light", style: {
|
|
@@ -14753,10 +14772,16 @@ const genRouteHandler = (opts) => {
|
|
|
14753
14772
|
* @param [renderOpts.status=500] http status code
|
|
14754
14773
|
*/
|
|
14755
14774
|
const renderErrorPage = (renderOpts = {}) => {
|
|
14756
|
-
var _a, _b;
|
|
14775
|
+
var _a, _b, _c;
|
|
14757
14776
|
const html = genErrorPage(renderOpts);
|
|
14758
14777
|
send(html, (_a = renderOpts.status) !== null && _a !== void 0 ? _a : 500);
|
|
14759
|
-
// Log
|
|
14778
|
+
// Log server-side error if not a session expired error or 404
|
|
14779
|
+
if (renderOpts.status && renderOpts.status === 404) {
|
|
14780
|
+
return;
|
|
14781
|
+
}
|
|
14782
|
+
if ((_b = renderOpts.title) === null || _b === void 0 ? void 0 : _b.toLowerCase().includes('session expired')) {
|
|
14783
|
+
return;
|
|
14784
|
+
}
|
|
14760
14785
|
logServerEvent({
|
|
14761
14786
|
context: LogBuiltInMetadata.Context.ServerRenderedErrorPage,
|
|
14762
14787
|
error: {
|
|
@@ -14768,7 +14793,7 @@ const genRouteHandler = (opts) => {
|
|
|
14768
14793
|
description: renderOpts.description,
|
|
14769
14794
|
code: renderOpts.code,
|
|
14770
14795
|
pageTitle: renderOpts.pageTitle,
|
|
14771
|
-
status: (
|
|
14796
|
+
status: (_c = renderOpts.status) !== null && _c !== void 0 ? _c : 500,
|
|
14772
14797
|
},
|
|
14773
14798
|
});
|
|
14774
14799
|
};
|