@carbonorm/carbonreact 3.0.5 → 3.0.7

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 CHANGED
@@ -8,3 +8,8 @@ The Carbon Node is currently under development and is not yet ready for use.
8
8
 
9
9
  ## Links
10
10
  https://saturncloud.io/blog/whats-the-difference-between-dependencies-devdependencies-and-peerdependencies-in-npm-packagejson-file/
11
+
12
+ ## @notes
13
+ https://fontawesome.com/v4/icons/
14
+
15
+
@@ -1,3 +1,4 @@
1
+ import CarbonReact from "CarbonReact";
1
2
  import { tRestfulObjectArrayValues, tStatefulApiData } from "variables/C6";
2
3
  import { KeysMatching } from "./KeysMatching";
3
- export default function deleteRestfulObjectArrays<ObjectType = tRestfulObjectArrayValues, S = {}, P = {}>(dataOrCallback: ObjectType[] | (<K extends keyof S>(state: ((prevState: Readonly<S>, props: Readonly<P>) => (Pick<S, K> | S | null)) | (Pick<S, K> | S | null), callback?: () => void) => null | (ObjectType[])), stateKey: KeysMatching<S, tStatefulApiData<ObjectType>>, uniqueObjectId: (keyof ObjectType) | (keyof ObjectType)[], callback?: () => void): void;
4
+ export default function deleteRestfulObjectArrays<ObjectType = tRestfulObjectArrayValues, S = typeof CarbonReact.instance.state, P = typeof CarbonReact.instance.props>(dataOrCallback: ObjectType[] | (<K extends keyof S>(state: ((prevState: Readonly<S>, props: Readonly<P>) => (Pick<S, K> | S | null)) | (Pick<S, K> | S | null), callback?: () => void) => null | (ObjectType[])), stateKey: KeysMatching<S, tStatefulApiData<ObjectType>>, uniqueObjectId: (keyof ObjectType) | (keyof ObjectType)[], callback?: () => void): void;
@@ -0,0 +1,2 @@
1
+ import { AxiosResponse } from "axios";
2
+ export default function setCookies(cookies: string[], req?: AxiosResponse | undefined): void;
@@ -1,4 +1,5 @@
1
1
  import { tRestfulObjectArrayValues, tStatefulApiData } from "variables/C6";
2
+ import CarbonReact from "CarbonReact";
2
3
  import { KeysMatching } from "./KeysMatching";
3
4
  export declare enum eUpdateInsertMethod {
4
5
  REPLACE = 0,
@@ -15,4 +16,4 @@ export declare enum eUpdateInsertMethod {
15
16
  * @param callback - if you want to do something with the updated state, you can pass a callback here. Run as the second
16
17
  * parameter of setState.
17
18
  */
18
- export default function updateRestfulObjectArrays<ObjectType = tRestfulObjectArrayValues, S = {}, P = {}>(dataOrCallback: ObjectType[] | (<K extends keyof S>(state: ((prevState: Readonly<S>, props: Readonly<P>) => (Pick<S, K> | S | null)) | (Pick<S, K> | S | null), callback?: () => void) => null | (ObjectType[])), stateKey: KeysMatching<S, tStatefulApiData<ObjectType>>, uniqueObjectId: (keyof ObjectType) | (keyof ObjectType)[], insertUpdateOrder?: eUpdateInsertMethod, callback?: () => void): void;
19
+ export default function updateRestfulObjectArrays<ObjectType = tRestfulObjectArrayValues, S = typeof CarbonReact.instance.state, P = typeof CarbonReact.instance.props>(dataOrCallback: ObjectType[] | (<K extends keyof S>(state: ((prevState: Readonly<S>, props: Readonly<P>) => (Pick<S, K> | S | null)) | (Pick<S, K> | S | null), callback?: () => void) => null | (ObjectType[])), stateKey: KeysMatching<S, tStatefulApiData<ObjectType>>, uniqueObjectId: (keyof ObjectType) | (keyof ObjectType)[], insertUpdateOrder?: eUpdateInsertMethod, callback?: () => void): void;
package/dist/index.cjs.js CHANGED
@@ -4185,6 +4185,27 @@ function ScrollIntoViewDirective(el) {
4185
4185
  el === null || el === void 0 ? void 0 : el.scrollIntoView({ behavior: 'auto', block: 'nearest' });
4186
4186
  }
4187
4187
 
4188
+ function setCookies(cookies, req) {
4189
+ if (req === void 0) { req = undefined; }
4190
+ console.log("Setting cookies", cookies);
4191
+ cookies.map(function (cookie) {
4192
+ var newCookie = cookie
4193
+ .replace("HttpOnly", "")
4194
+ .replace("secure", "");
4195
+ if (document === undefined || document === null) {
4196
+ var getStackTrace_1 = function () {
4197
+ var obj = {};
4198
+ Error.captureStackTrace(obj, getStackTrace_1);
4199
+ return obj.stack;
4200
+ };
4201
+ console.error(req);
4202
+ console.log('Testing error, document not defined', req);
4203
+ 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) + ")");
4204
+ }
4205
+ document.cookie = newCookie;
4206
+ });
4207
+ }
4208
+
4188
4209
  // @link https://www.benmvp.com/blog/mocking-window-location-methods-jest-jsdom/
4189
4210
  function setUrl(host, https) {
4190
4211
  if (host === void 0) { host = 'www.example.com'; }
@@ -4450,6 +4471,7 @@ exports.photos = photos;
4450
4471
  exports.range = range;
4451
4472
  exports.reports = reports;
4452
4473
  exports.scrollIntoView = ScrollIntoViewDirective;
4474
+ exports.setCookies = setCookies;
4453
4475
  exports.setUrl = setUrl;
4454
4476
  exports.toDataURL = toDataURL;
4455
4477
  exports.updateRestfulObjectArrays = updateRestfulObjectArrays;