@elliemae/ds-shared 2.0.0-rc.9 → 2.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.
@@ -72,9 +72,7 @@ const noop = () => null;
72
72
  class FocusGroup {
73
73
  constructor() {
74
74
  let options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
75
-
76
- _defineProperty__default["default"](this, "items", []);
77
-
75
+ this.items = [];
78
76
  this.options = _objectSpread(_objectSpread({}, defaultOptions), options);
79
77
  const {
80
78
  orientation
@@ -1,7 +1,6 @@
1
1
  'use strict';
2
2
 
3
3
  var _jsx = require('@babel/runtime/helpers/jsx');
4
- var _defineProperty = require('@babel/runtime/helpers/defineProperty');
5
4
  var React = require('react');
6
5
  var dsUtilities = require('@elliemae/ds-utilities');
7
6
  var FocusGroup = require('./FocusGroup.js');
@@ -10,16 +9,13 @@ var FocusGroupContext = require('./FocusGroupContext.js');
10
9
  function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
11
10
 
12
11
  var _jsx__default = /*#__PURE__*/_interopDefaultLegacy(_jsx);
13
- var _defineProperty__default = /*#__PURE__*/_interopDefaultLegacy(_defineProperty);
14
12
 
15
13
  const noop = () => null;
16
14
 
17
15
  class FocusGroupProvider extends React.Component {
18
16
  constructor(props) {
19
17
  super(props);
20
-
21
- _defineProperty__default["default"](this, "activated", false);
22
-
18
+ this.activated = false;
23
19
  this.focusGroup = new FocusGroup(props);
24
20
  props.onFocusGroupSet(this);
25
21
  this.actions = {
@@ -107,8 +103,7 @@ class FocusGroupProvider extends React.Component {
107
103
  }
108
104
 
109
105
  }
110
-
111
- _defineProperty__default["default"](FocusGroupProvider, "defaultProps", {
106
+ FocusGroupProvider.defaultProps = {
112
107
  exitWhenNoPrevious: false,
113
108
  exitWhenNoNext: false,
114
109
  keyBindings: {},
@@ -117,6 +112,6 @@ _defineProperty__default["default"](FocusGroupProvider, "defaultProps", {
117
112
  onFocusPreviousGroup: noop,
118
113
  onFocusNextGroup: noop,
119
114
  onFocusGroupSet: noop
120
- });
115
+ };
121
116
 
122
117
  module.exports = FocusGroupProvider;
@@ -3,7 +3,6 @@
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
5
  var _jsx = require('@babel/runtime/helpers/jsx');
6
- var _defineProperty = require('@babel/runtime/helpers/defineProperty');
7
6
  require('core-js/modules/esnext.async-iterator.for-each.js');
8
7
  require('core-js/modules/esnext.iterator.constructor.js');
9
8
  require('core-js/modules/esnext.iterator.for-each.js');
@@ -14,7 +13,6 @@ var React = require('react');
14
13
  function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
15
14
 
16
15
  var _jsx__default = /*#__PURE__*/_interopDefaultLegacy(_jsx);
17
- var _defineProperty__default = /*#__PURE__*/_interopDefaultLegacy(_defineProperty);
18
16
  var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
19
17
 
20
18
  const ScrollSyncContext = /*#__PURE__*/React__default["default"].createContext();
@@ -24,10 +22,9 @@ const {
24
22
  class ScrollSync extends React.Component {
25
23
  constructor(props) {
26
24
  super(props);
25
+ this.panes = {};
27
26
 
28
- _defineProperty__default["default"](this, "panes", {});
29
-
30
- _defineProperty__default["default"](this, "registerPane", (node, groups) => {
27
+ this.registerPane = (node, groups) => {
31
28
  groups.forEach(group => {
32
29
  if (!this.panes[group]) {
33
30
  this.panes[group] = [];
@@ -40,36 +37,36 @@ class ScrollSync extends React.Component {
40
37
  this.panes[group].push(node);
41
38
  });
42
39
  this.addEvents(node, groups);
43
- });
40
+ };
44
41
 
45
- _defineProperty__default["default"](this, "unregisterPane", (node, groups) => {
42
+ this.unregisterPane = (node, groups) => {
46
43
  groups.forEach(group => {
47
44
  if (this.findPane(node, group)) {
48
45
  this.removeEvents(node);
49
46
  this.panes[group].splice(this.panes[group].indexOf(node), 1);
50
47
  }
51
48
  });
52
- });
49
+ };
53
50
 
54
- _defineProperty__default["default"](this, "addEvents", (node, groups) => {
51
+ this.addEvents = (node, groups) => {
55
52
  /* For some reason element.addEventListener doesnt work with document.body */
56
53
  node.onscroll = this.handlePaneScroll.bind(this, node, groups); // eslint-disable-line
57
- });
54
+ };
58
55
 
59
- _defineProperty__default["default"](this, "removeEvents", node => {
56
+ this.removeEvents = node => {
60
57
  /* For some reason element.removeEventListener doesnt work with document.body */
61
58
  node.onscroll = null; // eslint-disable-line
62
- });
59
+ };
63
60
 
64
- _defineProperty__default["default"](this, "findPane", (node, group) => {
61
+ this.findPane = (node, group) => {
65
62
  if (!this.panes[group]) {
66
63
  return false;
67
64
  }
68
65
 
69
66
  return this.panes[group].find(pane => pane === node);
70
- });
67
+ };
71
68
 
72
- _defineProperty__default["default"](this, "handlePaneScroll", (node, groups, e) => {
69
+ this.handlePaneScroll = (node, groups, e) => {
73
70
  const {
74
71
  enabled
75
72
  } = this.props;
@@ -78,9 +75,9 @@ class ScrollSync extends React.Component {
78
75
  window.requestAnimationFrame(() => {
79
76
  this.syncScrollPositions(node, groups);
80
77
  });
81
- });
78
+ };
82
79
 
83
- _defineProperty__default["default"](this, "syncScrollPositions", (scrolledPane, groups) => {
80
+ this.syncScrollPositions = (scrolledPane, groups) => {
84
81
  groups.forEach(group => {
85
82
  this.panes[group].forEach(pane => {
86
83
  /* For all panes beside the currently scrolling one */
@@ -96,7 +93,7 @@ class ScrollSync extends React.Component {
96
93
  }
97
94
  });
98
95
  });
99
- });
96
+ };
100
97
 
101
98
  this.syncContext = {
102
99
  registerPane: this.registerPane,
@@ -145,13 +142,12 @@ class ScrollSync extends React.Component {
145
142
  }
146
143
 
147
144
  }
148
-
149
- _defineProperty__default["default"](ScrollSync, "defaultProps", {
145
+ ScrollSync.defaultProps = {
150
146
  proportional: true,
151
147
  vertical: true,
152
148
  horizontal: true,
153
149
  enabled: true
154
- });
150
+ };
155
151
 
156
152
  exports.ScrollSyncContext = ScrollSyncContext;
157
153
  exports["default"] = ScrollSync;
@@ -28,7 +28,7 @@ class ScrollSyncPane extends React.Component {
28
28
  constructor() {
29
29
  super(...arguments);
30
30
 
31
- _defineProperty__default["default"](this, "toArray", groups => [].concat(groups));
31
+ this.toArray = groups => [].concat(groups);
32
32
  }
33
33
 
34
34
  componentWillUnmount() {
@@ -70,11 +70,10 @@ class ScrollSyncPane extends React.Component {
70
70
 
71
71
  }
72
72
 
73
- _defineProperty__default["default"](ScrollSyncPane, "defaultProps", {
73
+ ScrollSyncPane.defaultProps = {
74
74
  group: 'default',
75
75
  enabled: true
76
- });
77
-
76
+ };
78
77
  var ScrollSyncPane$1 = (props => /*#__PURE__*/_jsx__default["default"](ScrollSync.ScrollSyncContext.Consumer, {}, void 0, context => /*#__PURE__*/jsxRuntime.jsx(ScrollSyncPane, _objectSpread(_objectSpread({}, props), {}, {
79
78
  syncContext: context
80
79
  }))));
@@ -25,10 +25,9 @@ function deferComponentRender(WrappedComponent, fallback) {
25
25
  class DeferredRenderWrapper extends React.PureComponent {
26
26
  constructor() {
27
27
  super(...arguments);
28
-
29
- _defineProperty__default["default"](this, "state", {
28
+ this.state = {
30
29
  shouldRender: false
31
- });
30
+ };
32
31
  }
33
32
 
34
33
  componentDidMount() {
@@ -1,18 +1,13 @@
1
1
  'use strict';
2
2
 
3
- var _defineProperty = require('@babel/runtime/helpers/defineProperty');
4
3
  require('core-js/modules/esnext.async-iterator.for-each.js');
5
4
  require('core-js/modules/esnext.iterator.constructor.js');
6
5
  require('core-js/modules/esnext.iterator.for-each.js');
7
6
  var dsUtilities = require('@elliemae/ds-utilities');
8
7
 
9
- function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
10
-
11
- var _defineProperty__default = /*#__PURE__*/_interopDefaultLegacy(_defineProperty);
12
-
13
8
  class VolatileRowsListener {
14
9
  constructor() {
15
- _defineProperty__default["default"](this, "observers", []);
10
+ this.observers = [];
16
11
  }
17
12
 
18
13
  observe(listener) {
@@ -65,9 +65,7 @@ const noop = () => null;
65
65
  class FocusGroup {
66
66
  constructor() {
67
67
  let options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
68
-
69
- _defineProperty(this, "items", []);
70
-
68
+ this.items = [];
71
69
  this.options = _objectSpread(_objectSpread({}, defaultOptions), options);
72
70
  const {
73
71
  orientation
@@ -1,5 +1,4 @@
1
1
  import _jsx from '@babel/runtime/helpers/esm/jsx';
2
- import _defineProperty from '@babel/runtime/helpers/esm/defineProperty';
3
2
  import { Component } from 'react';
4
3
  import { isFunction } from '@elliemae/ds-utilities';
5
4
  import FocusGroup from './FocusGroup.js';
@@ -10,9 +9,7 @@ const noop = () => null;
10
9
  class FocusGroupProvider extends Component {
11
10
  constructor(props) {
12
11
  super(props);
13
-
14
- _defineProperty(this, "activated", false);
15
-
12
+ this.activated = false;
16
13
  this.focusGroup = new FocusGroup(props);
17
14
  props.onFocusGroupSet(this);
18
15
  this.actions = {
@@ -100,8 +97,7 @@ class FocusGroupProvider extends Component {
100
97
  }
101
98
 
102
99
  }
103
-
104
- _defineProperty(FocusGroupProvider, "defaultProps", {
100
+ FocusGroupProvider.defaultProps = {
105
101
  exitWhenNoPrevious: false,
106
102
  exitWhenNoNext: false,
107
103
  keyBindings: {},
@@ -110,6 +106,6 @@ _defineProperty(FocusGroupProvider, "defaultProps", {
110
106
  onFocusPreviousGroup: noop,
111
107
  onFocusNextGroup: noop,
112
108
  onFocusGroupSet: noop
113
- });
109
+ };
114
110
 
115
111
  export { FocusGroupProvider as default };
@@ -1,5 +1,4 @@
1
1
  import _jsx from '@babel/runtime/helpers/esm/jsx';
2
- import _defineProperty from '@babel/runtime/helpers/esm/defineProperty';
3
2
  import 'core-js/modules/esnext.async-iterator.for-each.js';
4
3
  import 'core-js/modules/esnext.iterator.constructor.js';
5
4
  import 'core-js/modules/esnext.iterator.for-each.js';
@@ -14,10 +13,9 @@ const {
14
13
  class ScrollSync extends Component {
15
14
  constructor(props) {
16
15
  super(props);
16
+ this.panes = {};
17
17
 
18
- _defineProperty(this, "panes", {});
19
-
20
- _defineProperty(this, "registerPane", (node, groups) => {
18
+ this.registerPane = (node, groups) => {
21
19
  groups.forEach(group => {
22
20
  if (!this.panes[group]) {
23
21
  this.panes[group] = [];
@@ -30,36 +28,36 @@ class ScrollSync extends Component {
30
28
  this.panes[group].push(node);
31
29
  });
32
30
  this.addEvents(node, groups);
33
- });
31
+ };
34
32
 
35
- _defineProperty(this, "unregisterPane", (node, groups) => {
33
+ this.unregisterPane = (node, groups) => {
36
34
  groups.forEach(group => {
37
35
  if (this.findPane(node, group)) {
38
36
  this.removeEvents(node);
39
37
  this.panes[group].splice(this.panes[group].indexOf(node), 1);
40
38
  }
41
39
  });
42
- });
40
+ };
43
41
 
44
- _defineProperty(this, "addEvents", (node, groups) => {
42
+ this.addEvents = (node, groups) => {
45
43
  /* For some reason element.addEventListener doesnt work with document.body */
46
44
  node.onscroll = this.handlePaneScroll.bind(this, node, groups); // eslint-disable-line
47
- });
45
+ };
48
46
 
49
- _defineProperty(this, "removeEvents", node => {
47
+ this.removeEvents = node => {
50
48
  /* For some reason element.removeEventListener doesnt work with document.body */
51
49
  node.onscroll = null; // eslint-disable-line
52
- });
50
+ };
53
51
 
54
- _defineProperty(this, "findPane", (node, group) => {
52
+ this.findPane = (node, group) => {
55
53
  if (!this.panes[group]) {
56
54
  return false;
57
55
  }
58
56
 
59
57
  return this.panes[group].find(pane => pane === node);
60
- });
58
+ };
61
59
 
62
- _defineProperty(this, "handlePaneScroll", (node, groups, e) => {
60
+ this.handlePaneScroll = (node, groups, e) => {
63
61
  const {
64
62
  enabled
65
63
  } = this.props;
@@ -68,9 +66,9 @@ class ScrollSync extends Component {
68
66
  window.requestAnimationFrame(() => {
69
67
  this.syncScrollPositions(node, groups);
70
68
  });
71
- });
69
+ };
72
70
 
73
- _defineProperty(this, "syncScrollPositions", (scrolledPane, groups) => {
71
+ this.syncScrollPositions = (scrolledPane, groups) => {
74
72
  groups.forEach(group => {
75
73
  this.panes[group].forEach(pane => {
76
74
  /* For all panes beside the currently scrolling one */
@@ -86,7 +84,7 @@ class ScrollSync extends Component {
86
84
  }
87
85
  });
88
86
  });
89
- });
87
+ };
90
88
 
91
89
  this.syncContext = {
92
90
  registerPane: this.registerPane,
@@ -135,12 +133,11 @@ class ScrollSync extends Component {
135
133
  }
136
134
 
137
135
  }
138
-
139
- _defineProperty(ScrollSync, "defaultProps", {
136
+ ScrollSync.defaultProps = {
140
137
  proportional: true,
141
138
  vertical: true,
142
139
  horizontal: true,
143
140
  enabled: true
144
- });
141
+ };
145
142
 
146
143
  export { ScrollSyncContext, ScrollSync as default };
@@ -21,7 +21,7 @@ class ScrollSyncPane extends Component {
21
21
  constructor() {
22
22
  super(...arguments);
23
23
 
24
- _defineProperty(this, "toArray", groups => [].concat(groups));
24
+ this.toArray = groups => [].concat(groups);
25
25
  }
26
26
 
27
27
  componentWillUnmount() {
@@ -63,11 +63,10 @@ class ScrollSyncPane extends Component {
63
63
 
64
64
  }
65
65
 
66
- _defineProperty(ScrollSyncPane, "defaultProps", {
66
+ ScrollSyncPane.defaultProps = {
67
67
  group: 'default',
68
68
  enabled: true
69
- });
70
-
69
+ };
71
70
  var ScrollSyncPane$1 = (props => /*#__PURE__*/_jsx(ScrollSyncContext.Consumer, {}, void 0, context => /*#__PURE__*/jsx(ScrollSyncPane, _objectSpread(_objectSpread({}, props), {}, {
72
71
  syncContext: context
73
72
  }))));
@@ -1,10 +1,10 @@
1
- import _defineProperty from '@babel/runtime/helpers/esm/defineProperty';
2
- import 'core-js/modules/web.dom-collections.iterator.js';
3
1
  import 'core-js/modules/esnext.async-iterator.filter.js';
4
2
  import 'core-js/modules/esnext.iterator.constructor.js';
5
3
  import 'core-js/modules/esnext.iterator.filter.js';
6
4
  import 'core-js/modules/esnext.async-iterator.for-each.js';
7
5
  import 'core-js/modules/esnext.iterator.for-each.js';
6
+ import _defineProperty from '@babel/runtime/helpers/esm/defineProperty';
7
+ import 'core-js/modules/web.dom-collections.iterator.js';
8
8
  import { PureComponent } from 'react';
9
9
  import raf from 'raf';
10
10
  import hoistNonReactStatic from 'hoist-non-react-statics';
@@ -17,10 +17,9 @@ function deferComponentRender(WrappedComponent, fallback) {
17
17
  class DeferredRenderWrapper extends PureComponent {
18
18
  constructor() {
19
19
  super(...arguments);
20
-
21
- _defineProperty(this, "state", {
20
+ this.state = {
22
21
  shouldRender: false
23
- });
22
+ };
24
23
  }
25
24
 
26
25
  componentDidMount() {
@@ -1,4 +1,3 @@
1
- import _defineProperty from '@babel/runtime/helpers/esm/defineProperty';
2
1
  import 'core-js/modules/esnext.async-iterator.for-each.js';
3
2
  import 'core-js/modules/esnext.iterator.constructor.js';
4
3
  import 'core-js/modules/esnext.iterator.for-each.js';
@@ -6,7 +5,7 @@ import { safeCall } from '@elliemae/ds-utilities';
6
5
 
7
6
  class VolatileRowsListener {
8
7
  constructor() {
9
- _defineProperty(this, "observers", []);
8
+ this.observers = [];
10
9
  }
11
10
 
12
11
  observe(listener) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@elliemae/ds-shared",
3
- "version": "2.0.0-rc.9",
3
+ "version": "2.0.0",
4
4
  "license": "MIT",
5
5
  "description": "ICE MT - Dimsum - Shared components and utilities",
6
6
  "module": "./esm/index.js",
@@ -213,8 +213,8 @@
213
213
  "generateSubmodules": true
214
214
  },
215
215
  "dependencies": {
216
- "@elliemae/ds-popper": "2.0.0-rc.9",
217
- "@elliemae/ds-utilities": "2.0.0-rc.9",
216
+ "@elliemae/ds-popper": "2.0.0",
217
+ "@elliemae/ds-utilities": "2.0.0",
218
218
  "hoist-non-react-statics": "~3.3.2",
219
219
  "hotkeys-js": "~3.8.2",
220
220
  "prop-types": "~15.7.2",