@steroidsjs/core 3.0.0-beta.33 → 3.0.0-beta.35

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.
@@ -1,59 +0,0 @@
1
- "use strict";
2
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
- if (k2 === undefined) k2 = k;
4
- var desc = Object.getOwnPropertyDescriptor(m, k);
5
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
- desc = { enumerable: true, get: function() { return m[k]; } };
7
- }
8
- Object.defineProperty(o, k2, desc);
9
- }) : (function(o, m, k, k2) {
10
- if (k2 === undefined) k2 = k;
11
- o[k2] = m[k];
12
- }));
13
- var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
- Object.defineProperty(o, "default", { enumerable: true, value: v });
15
- }) : function(o, v) {
16
- o["default"] = v;
17
- });
18
- var __importStar = (this && this.__importStar) || function (mod) {
19
- if (mod && mod.__esModule) return mod;
20
- var result = {};
21
- if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
22
- __setModuleDefault(result, mod);
23
- return result;
24
- };
25
- var __importDefault = (this && this.__importDefault) || function (mod) {
26
- return (mod && mod.__esModule) ? mod : { "default": mod };
27
- };
28
- exports.__esModule = true;
29
- exports.controls = void 0;
30
- var React = __importStar(require("react"));
31
- var Controls_1 = __importDefault(require("../Controls"));
32
- exports.controls = [
33
- {
34
- id: 'back',
35
- onClick: function () { return alert('Go back'); }
36
- }, {
37
- id: 'create',
38
- onClick: function () { return alert('Something is created'); }
39
- },
40
- {
41
- id: 'view',
42
- onClick: function () { return alert('Something is shown'); }
43
- },
44
- {
45
- id: 'update',
46
- onClick: function () { return alert('Something is updated'); }
47
- },
48
- {
49
- id: 'delete',
50
- onClick: function () { return alert('Something is deleted'); }
51
- },
52
- ];
53
- /**
54
- * Basic
55
- * @order 1
56
- * @col 6
57
- */
58
- exports["default"] = (function () { return (React.createElement(React.Fragment, null,
59
- React.createElement(Controls_1["default"], { items: exports.controls }))); });
@@ -1,16 +0,0 @@
1
- import * as React from 'react';
2
- interface IConnectedRouterProps {
3
- store?: any;
4
- history?: any;
5
- stateCompareFunction?: any;
6
- noInitialPop?: any;
7
- }
8
- export default class ConnectedRouter extends React.PureComponent<React.PropsWithChildren<IConnectedRouterProps>> {
9
- inTimeTravelling?: any;
10
- unsubscribe?: any;
11
- unlisten?: any;
12
- constructor(props: any);
13
- componentWillUnmount(): void;
14
- render(): JSX.Element;
15
- }
16
- export {};
@@ -1,107 +0,0 @@
1
- "use strict";
2
- var __extends = (this && this.__extends) || (function () {
3
- var extendStatics = function (d, b) {
4
- extendStatics = Object.setPrototypeOf ||
5
- ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
6
- function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
7
- return extendStatics(d, b);
8
- };
9
- return function (d, b) {
10
- if (typeof b !== "function" && b !== null)
11
- throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
12
- extendStatics(d, b);
13
- function __() { this.constructor = d; }
14
- d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
15
- };
16
- })();
17
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
18
- if (k2 === undefined) k2 = k;
19
- var desc = Object.getOwnPropertyDescriptor(m, k);
20
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
21
- desc = { enumerable: true, get: function() { return m[k]; } };
22
- }
23
- Object.defineProperty(o, k2, desc);
24
- }) : (function(o, m, k, k2) {
25
- if (k2 === undefined) k2 = k;
26
- o[k2] = m[k];
27
- }));
28
- var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
29
- Object.defineProperty(o, "default", { enumerable: true, value: v });
30
- }) : function(o, v) {
31
- o["default"] = v;
32
- });
33
- var __importStar = (this && this.__importStar) || function (mod) {
34
- if (mod && mod.__esModule) return mod;
35
- var result = {};
36
- if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
37
- __setModuleDefault(result, mod);
38
- return result;
39
- };
40
- var __importDefault = (this && this.__importDefault) || function (mod) {
41
- return (mod && mod.__esModule) ? mod : { "default": mod };
42
- };
43
- exports.__esModule = true;
44
- var React = __importStar(require("react"));
45
- var react_router_1 = require("react-router");
46
- var isEqualWith_1 = __importDefault(require("lodash-es/isEqualWith"));
47
- var actions_1 = require("connected-react-router/lib/actions");
48
- var selectors_1 = __importDefault(require("connected-react-router/lib/selectors"));
49
- var plain_1 = __importDefault(require("connected-react-router/lib/structure/plain"));
50
- var ConnectedRouter = /** @class */ (function (_super) {
51
- __extends(ConnectedRouter, _super);
52
- function ConnectedRouter(props) {
53
- var _this = _super.call(this, props) || this;
54
- var store = props.store, history = props.history, stateCompareFunction = props.stateCompareFunction;
55
- _this.inTimeTravelling = false;
56
- // Subscribe to store changes to check if we are in time travelling
57
- _this.unsubscribe = store.subscribe(function () {
58
- // Extract store's location
59
- var _a = (0, selectors_1["default"])(plain_1["default"]).getLocation(store.getState()), pathnameInStore = _a.pathname, searchInStore = _a.search, hashInStore = _a.hash, stateInStore = _a.state;
60
- // Extract history's location
61
- var _b = history.location, pathnameInHistory = _b.pathname, searchInHistory = _b.search, hashInHistory = _b.hash, stateInHistory = _b.state;
62
- // If we do time travelling, the location in store is changed but location in history is not changed
63
- if (props.history.action === 'PUSH'
64
- && (pathnameInHistory !== pathnameInStore
65
- || searchInHistory !== searchInStore
66
- || hashInHistory !== hashInStore
67
- || !(0, isEqualWith_1["default"])(stateInStore, stateInHistory, stateCompareFunction))) {
68
- _this.inTimeTravelling = true;
69
- // Update history's location to match store's location
70
- history.push({
71
- pathname: pathnameInStore,
72
- search: searchInStore,
73
- hash: hashInStore,
74
- state: stateInStore
75
- });
76
- }
77
- });
78
- var handleLocationChange = function (location, action, isFirstRendering) {
79
- if (isFirstRendering === void 0) { isFirstRendering = false; }
80
- // Dispatch onLocationChanged except when we're in time travelling
81
- if (!_this.inTimeTravelling) {
82
- _this.props.store.dispatch((0, actions_1.onLocationChanged)(location, action, isFirstRendering));
83
- }
84
- else {
85
- _this.inTimeTravelling = false;
86
- }
87
- };
88
- // Listen to history changes
89
- _this.unlisten = history.listen(handleLocationChange);
90
- if (!props.noInitialPop) {
91
- // Dispatch a location change action for the initial location.
92
- // This makes it backward-compatible with react-router-redux.
93
- // But, we add `isFirstRendering` to `true` to prevent double-rendering.
94
- handleLocationChange(history.location, history.action, true);
95
- }
96
- return _this;
97
- }
98
- ConnectedRouter.prototype.componentWillUnmount = function () {
99
- this.unlisten();
100
- this.unsubscribe();
101
- };
102
- ConnectedRouter.prototype.render = function () {
103
- return (React.createElement(react_router_1.Router, { history: this.props.history }, this.props.children));
104
- };
105
- return ConnectedRouter;
106
- }(React.PureComponent));
107
- exports["default"] = ConnectedRouter;