@carbonorm/carbonreact 3.0.6 → 3.0.8
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 +5 -0
- package/dist/components/Popup/Popup.d.ts +2 -2
- package/dist/hoc/setCookies.d.ts +2 -0
- package/dist/index.cjs.js +24 -1
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.d.ts +2 -0
- package/dist/index.esm.js +24 -2
- package/dist/index.esm.js.map +1 -1
- package/package.json +1 -1
- package/src/components/Popup/Popup.tsx +4 -6
- package/src/hoc/setCookies.tsx +34 -0
- package/src/index.ts +2 -0
package/dist/index.d.ts
CHANGED
|
@@ -36,6 +36,8 @@ export * from "./hoc/isEdgeBrowser";
|
|
|
36
36
|
export * from "./hoc/parseMultipleJson";
|
|
37
37
|
export { default as scrollIntoView } from "./hoc/scrollIntoView";
|
|
38
38
|
export * from "./hoc/scrollIntoView";
|
|
39
|
+
export { default as setCookies } from "./hoc/setCookies";
|
|
40
|
+
export * from "./hoc/setCookies";
|
|
39
41
|
export { default as setUrl } from "./hoc/setUrl";
|
|
40
42
|
export * from "./hoc/setUrl";
|
|
41
43
|
export { default as updateRestfulObjectArrays } from "./hoc/updateRestfulObjectArrays";
|
package/dist/index.esm.js
CHANGED
|
@@ -3944,10 +3944,11 @@ function getStyles(overrides) {
|
|
|
3944
3944
|
function Popup(_a) {
|
|
3945
3945
|
var _b = _a.open, open = _b === void 0 ? true : _b, handleClose = _a.handleClose, children = _a.children, maxWidth = _a.maxWidth;
|
|
3946
3946
|
if (false === open) {
|
|
3947
|
+
// @link https://legacy.reactjs.org/docs/conditional-rendering.html#preventing-component-from-rendering
|
|
3947
3948
|
return null;
|
|
3948
3949
|
}
|
|
3949
3950
|
var dig = getStyles();
|
|
3950
|
-
return jsxRuntime_1(
|
|
3951
|
+
return jsxRuntime_1("div", { className: classNames(dig.modal, dig.fade, dig.show, dig.dBlock), style: { backgroundColor: "rgba(0,0,0,0.8)" }, id: "exampleModalCenter", tabIndex: -1, "aria-labelledby": "exampleModalCenterTitle", "aria-modal": "true", role: "dialog", children: jsxRuntime_1("div", { style: { maxWidth: maxWidth }, className: classNames(dig.modalDialog, dig.modalDialogCentered), children: jsxRuntime_1(OutsideClickHandler, { onOutsideClick: function () { return handleClose(); }, children: jsxRuntime_1("div", { className: classNames(dig.modalContent, dig.bgTransparent, dig.modalDialogScrollable), children: children }) }) }) });
|
|
3951
3952
|
}
|
|
3952
3953
|
|
|
3953
3954
|
var isProduction = window.location.host.split(".")[0] === "www";
|
|
@@ -4183,6 +4184,27 @@ function ScrollIntoViewDirective(el) {
|
|
|
4183
4184
|
el === null || el === void 0 ? void 0 : el.scrollIntoView({ behavior: 'auto', block: 'nearest' });
|
|
4184
4185
|
}
|
|
4185
4186
|
|
|
4187
|
+
function setCookies(cookies, req) {
|
|
4188
|
+
if (req === void 0) { req = undefined; }
|
|
4189
|
+
console.log("Setting cookies", cookies);
|
|
4190
|
+
cookies.map(function (cookie) {
|
|
4191
|
+
var newCookie = cookie
|
|
4192
|
+
.replace("HttpOnly", "")
|
|
4193
|
+
.replace("secure", "");
|
|
4194
|
+
if (document === undefined || document === null) {
|
|
4195
|
+
var getStackTrace_1 = function () {
|
|
4196
|
+
var obj = {};
|
|
4197
|
+
Error.captureStackTrace(obj, getStackTrace_1);
|
|
4198
|
+
return obj.stack;
|
|
4199
|
+
};
|
|
4200
|
+
console.error(req);
|
|
4201
|
+
console.log('Testing error, document not defined', req);
|
|
4202
|
+
throw new Error("Document is undefined while trying to set cookie: (" + newCookie + ") in axiosInterceptors.tsx after (" + JSON.stringify([req === null || req === void 0 ? void 0 : req.config, req === null || req === void 0 ? void 0 : req.data], undefined, 4) + ") Please make sure all requests are wrapped in an act() from import {act} from '@testing-library/react'; (" + JSON.stringify(getStackTrace_1(), undefined, 4) + ")");
|
|
4203
|
+
}
|
|
4204
|
+
document.cookie = newCookie;
|
|
4205
|
+
});
|
|
4206
|
+
}
|
|
4207
|
+
|
|
4186
4208
|
// @link https://www.benmvp.com/blog/mocking-window-location-methods-jest-jsdom/
|
|
4187
4209
|
function setUrl(host, https) {
|
|
4188
4210
|
if (host === void 0) { host = 'www.example.com'; }
|
|
@@ -4408,5 +4430,5 @@ function useWindowDimensions() {
|
|
|
4408
4430
|
return windowDimensions;
|
|
4409
4431
|
}
|
|
4410
4432
|
|
|
4411
|
-
export { AccessDenied, Alert, BackendThrowable, C6, COLUMNS, CarbonReact, ErrorHttpCode, GlobalHistory, Loading, Nest, PageNotFound, Popup, TABLES, addAlert, addValidSQL$1 as addValidSQL, carbons, changed, comments, deleteRestfulObjectArrays, documentation, eUpdateInsertMethod, feature_group_references, features, getRootStyleValue, getStyles, globalNavigate, group_references, groups, hexToRgb, history_logs, initialCarbonReactState, initialRequiredCarbonORMState, initialRestfulObjectsState, isEdgeBrowser, isProduction, location_references, locations, parseMultipleJson, photos, range, reports, ScrollIntoViewDirective as scrollIntoView, setUrl, toDataURL, updateRestfulObjectArrays, uploadImage, uploadImageChange, user_followers, user_groups, user_messages, user_sessions, user_tasks, users, useWindowDimensions as windowDimensions, wp_commentmeta, wp_comments, wp_links, wp_options, wp_postmeta, wp_posts, wp_term_relationships, wp_term_taxonomy, wp_termmeta, wp_terms, wp_usermeta, wp_users };
|
|
4433
|
+
export { AccessDenied, Alert, BackendThrowable, C6, COLUMNS, CarbonReact, ErrorHttpCode, GlobalHistory, Loading, Nest, PageNotFound, Popup, TABLES, addAlert, addValidSQL$1 as addValidSQL, carbons, changed, comments, deleteRestfulObjectArrays, documentation, eUpdateInsertMethod, feature_group_references, features, getRootStyleValue, getStyles, globalNavigate, group_references, groups, hexToRgb, history_logs, initialCarbonReactState, initialRequiredCarbonORMState, initialRestfulObjectsState, isEdgeBrowser, isProduction, location_references, locations, parseMultipleJson, photos, range, reports, ScrollIntoViewDirective as scrollIntoView, setCookies, setUrl, toDataURL, updateRestfulObjectArrays, uploadImage, uploadImageChange, user_followers, user_groups, user_messages, user_sessions, user_tasks, users, useWindowDimensions as windowDimensions, wp_commentmeta, wp_comments, wp_links, wp_options, wp_postmeta, wp_posts, wp_term_relationships, wp_term_taxonomy, wp_termmeta, wp_terms, wp_usermeta, wp_users };
|
|
4412
4434
|
//# sourceMappingURL=index.esm.js.map
|