@carbonorm/carbonreact 5.0.4 → 6.0.0
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/components/Alert/Alert.d.ts +1 -1
- package/dist/components/Errors/BackendThrowable.d.ts +1 -1
- package/dist/components/WebSocket/CarbonWebSocket.d.ts +1 -1
- package/dist/{CarbonReact.d.ts → core/CarbonReact.d.ts} +4 -4
- package/dist/env/getEnv.d.ts +1 -0
- package/dist/env/isProduction.d.ts +2 -0
- package/dist/index.cjs +674 -786
- package/dist/index.cjs.map +1 -1
- package/dist/index.css +5101 -5101
- package/dist/index.css.map +1 -1
- package/dist/index.d.ts +41 -44
- package/dist/index.esm.css +5101 -5101
- package/dist/index.esm.css.map +1 -1
- package/dist/index.esm.js +658 -769
- package/dist/index.esm.js.map +1 -1
- package/dist/{variables → schema}/C6.d.ts +1 -1
- package/dist/{hoc → state}/deleteRestfulObjectArrays.d.ts +2 -2
- package/dist/{hoc → state}/updateRestfulObjectArrays.d.ts +2 -2
- package/dist/{hoc → styles}/getStyles.d.ts +1 -1
- package/package.json +2 -2
- package/src/components/Alert/Alert.tsx +4 -5
- package/src/components/Errors/BackendThrowable.tsx +2 -2
- package/src/components/Loading/Loading.tsx +1 -2
- package/src/components/Popup/Popup.tsx +1 -2
- package/src/components/WebSocket/CarbonWebSocket.tsx +11 -3
- package/src/{CarbonReact.tsx → core/CarbonReact.tsx} +18 -24
- package/src/{hoc → dom}/isEdgeBrowser.tsx +4 -2
- package/src/{hoc → dom}/setCookies.tsx +1 -1
- package/src/env/getEnv.ts +29 -0
- package/src/env/isProduction.tsx +6 -0
- package/src/{hoc → hooks}/windowDimensions.tsx +9 -1
- package/src/index.ts +41 -44
- package/src/{variables → schema}/C6.tsx +1 -2
- package/src/{hoc → state}/deleteRestfulObjectArrays.tsx +2 -2
- package/src/{hoc → state}/updateRestfulObjectArrays.tsx +3 -3
- package/src/{hoc → styles}/getStyles.tsx +6 -2
- package/src/{hoc → testing}/setupTests.tsx +4 -1
- package/dist/components/Nest/Nest.d.ts +0 -49
- package/dist/hoc/setUrl.d.ts +0 -1
- package/dist/variables/isProduction.d.ts +0 -2
- package/src/components/Nest/Nest.tsx +0 -241
- package/src/hoc/setUrl.tsx +0 -38
- package/src/variables/isProduction.tsx +0 -5
- /package/dist/api/{hoc/getStatefulObjectWithWhere.d.ts → getStatefulObjectWithWhere.d.ts} +0 -0
- /package/dist/{hoc → dom}/isEdgeBrowser.d.ts +0 -0
- /package/dist/{hoc → dom}/scrollIntoView.d.ts +0 -0
- /package/dist/{hoc → dom}/setCookies.d.ts +0 -0
- /package/dist/{hoc → dom}/uploadImage.d.ts +0 -0
- /package/dist/{api/hoc → dom}/watchInputElementChangeEvent.d.ts +0 -0
- /package/dist/{api/hoc → hooks}/useEffectOnce.d.ts +0 -0
- /package/dist/{hoc → hooks}/windowDimensions.d.ts +0 -0
- /package/dist/{hoc → routing}/GlobalHistory.d.ts +0 -0
- /package/dist/{hoc → testing}/addValidSQL.d.ts +0 -0
- /package/dist/{hoc → testing}/setupTests.d.ts +0 -0
- /package/dist/{hoc → testing}/validSQL.d.ts +0 -0
- /package/dist/{hoc → types}/KeysMatching.d.ts +0 -0
- /package/dist/{hoc → types}/SubsetMatching.d.ts +0 -0
- /package/dist/{hoc → utils}/changed.d.ts +0 -0
- /package/dist/{hoc → utils}/hexToRgb.d.ts +0 -0
- /package/dist/{hoc → utils}/parseMultipleJson.d.ts +0 -0
- /package/src/api/{hoc/getStatefulObjectWithWhere.tsx → getStatefulObjectWithWhere.tsx} +0 -0
- /package/src/{hoc → dom}/scrollIntoView.tsx +0 -0
- /package/src/{hoc → dom}/uploadImage.tsx +0 -0
- /package/src/{api/hoc → dom}/watchInputElementChangeEvent.tsx +0 -0
- /package/src/{api/hoc → hooks}/useEffectOnce.tsx +0 -0
- /package/src/{hoc → routing}/GlobalHistory.tsx +0 -0
- /package/src/{variables → styles}/bootstrap.module.css +0 -0
- /package/src/{variables → styles}/bootstrap.module.css.d.ts +0 -0
- /package/src/{variables → styles}/bootstrap.module.css.json +0 -0
- /package/src/{variables → styles}/bootstrap.module.css.map +0 -0
- /package/src/{variables → styles}/bootstrap.module.scss +0 -0
- /package/src/{variables → styles}/bootstrap.module.scss.d.ts +0 -0
- /package/src/{hoc → testing}/addValidSQL.tsx +0 -0
- /package/src/{hoc → testing}/validSQL.tsx +0 -0
- /package/src/{hoc → types}/KeysMatching.ts +0 -0
- /package/src/{hoc → types}/SubsetMatching.ts +0 -0
- /package/src/{hoc → utils}/changed.tsx +0 -0
- /package/src/{hoc → utils}/hexToRgb.tsx +0 -0
- /package/src/{hoc → utils}/parseMultipleJson.tsx +0 -0
package/src/hoc/setUrl.tsx
DELETED
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
// @link https://www.benmvp.com/blog/mocking-window-location-methods-jest-jsdom/
|
|
2
|
-
import {axiosInstance} from "@carbonorm/carbonnode";
|
|
3
|
-
|
|
4
|
-
export default function setUrl(host: string = 'www.example.com', https: boolean = false) {
|
|
5
|
-
|
|
6
|
-
if (!global.structuredClone){
|
|
7
|
-
|
|
8
|
-
global.structuredClone = function structuredClone(objectToClone: any) {
|
|
9
|
-
const stringify = JSON.stringify(objectToClone);
|
|
10
|
-
return JSON.parse(stringify);
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
// noinspection HttpUrlsUsage
|
|
16
|
-
axiosInstance.defaults.baseURL = 'http' + (https ? 's' : '') + '://' + host + '/';
|
|
17
|
-
|
|
18
|
-
Object.defineProperty(global.window, 'location', {
|
|
19
|
-
writable: true,
|
|
20
|
-
value: {
|
|
21
|
-
hash: '',
|
|
22
|
-
host: host,
|
|
23
|
-
hostname: host,
|
|
24
|
-
port: '80',
|
|
25
|
-
protocol: 'http:',
|
|
26
|
-
href: axiosInstance.defaults.baseURL,
|
|
27
|
-
origin: axiosInstance.defaults.baseURL,
|
|
28
|
-
pathname: '/',
|
|
29
|
-
search: '',
|
|
30
|
-
toString: () => {
|
|
31
|
-
return global.window.location.href
|
|
32
|
-
}
|
|
33
|
-
}
|
|
34
|
-
});
|
|
35
|
-
|
|
36
|
-
console.log(global.window.location)
|
|
37
|
-
|
|
38
|
-
}
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|