@sis-cc/dotstatsuite-visions 12.11.0 → 12.12.1

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,5 +1,5 @@
1
1
  /*!
2
- * @sis-cc/dotstatsuite-visions v12.11.0 - https://visions-qa.siscc.org/#o
2
+ * @sis-cc/dotstatsuite-visions v12.12.1 - https://visions-qa.siscc.org/#o
3
3
  * MIT Licensed
4
4
  */
5
5
  (function webpackUniversalModuleDefinition(root, factory) {
@@ -7571,23 +7571,54 @@ exports.findInArray = findInArray;
7571
7571
  exports.int = int;
7572
7572
  exports.isFunction = isFunction;
7573
7573
  exports.isNum = isNum;
7574
+
7574
7575
  // @credits https://gist.github.com/rogozhnikoff/a43cfed27c41e4e68cdc
7575
- function findInArray(array /*: Array<any> | TouchList*/, callback /*: Function*/) /*: any*/{
7576
- for (let i = 0, length = array.length; i < length; i++) {
7576
+ function findInArray(array
7577
+ /*: Array<any> | TouchList*/
7578
+ , callback
7579
+ /*: Function*/
7580
+ )
7581
+ /*: any*/
7582
+ {
7583
+ for (var i = 0, length = array.length; i < length; i++) {
7577
7584
  if (callback.apply(callback, [array[i], i, array])) return array[i];
7578
7585
  }
7579
7586
  }
7580
- function isFunction(func /*: any*/) /*: boolean %checks*/{
7587
+
7588
+ function isFunction(func
7589
+ /*: any*/
7590
+ )
7591
+ /*: boolean %checks*/
7592
+ {
7581
7593
  // $FlowIgnore[method-unbinding]
7582
7594
  return typeof func === 'function' || Object.prototype.toString.call(func) === '[object Function]';
7583
7595
  }
7584
- function isNum(num /*: any*/) /*: boolean %checks*/{
7596
+
7597
+ function isNum(num
7598
+ /*: any*/
7599
+ )
7600
+ /*: boolean %checks*/
7601
+ {
7585
7602
  return typeof num === 'number' && !isNaN(num);
7586
7603
  }
7587
- function int(a /*: string*/) /*: number*/{
7604
+
7605
+ function int(a
7606
+ /*: string*/
7607
+ )
7608
+ /*: number*/
7609
+ {
7588
7610
  return parseInt(a, 10);
7589
7611
  }
7590
- function dontSetMe(props /*: Object*/, propName /*: string*/, componentName /*: string*/) /*: ?Error*/{
7612
+
7613
+ function dontSetMe(props
7614
+ /*: Object*/
7615
+ , propName
7616
+ /*: string*/
7617
+ , componentName
7618
+ /*: string*/
7619
+ )
7620
+ /*: ?Error*/
7621
+ {
7591
7622
  if (props[propName]) {
7592
7623
  return new Error("Invalid prop ".concat(propName, " passed to ").concat(componentName, " - do not set this, set it on the child."));
7593
7624
  }
@@ -8545,6 +8576,8 @@ exports["default"] = ScalingCellSizeAndPositionManager;
8545
8576
  "use strict";
8546
8577
 
8547
8578
 
8579
+ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
8580
+
8548
8581
  Object.defineProperty(exports, "__esModule", {
8549
8582
  value: true
8550
8583
  });
@@ -8566,46 +8599,83 @@ exports.outerWidth = outerWidth;
8566
8599
  exports.removeClassName = removeClassName;
8567
8600
  exports.removeEvent = removeEvent;
8568
8601
  exports.removeUserSelectStyles = removeUserSelectStyles;
8602
+
8569
8603
  var _shims = __webpack_require__(108);
8604
+
8570
8605
  var _getPrefix = _interopRequireWildcard(__webpack_require__(422));
8571
- function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
8572
- function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
8573
- /*:: import type {ControlPosition, PositionOffsetControlPosition, MouseTouchEvent} from './types';*/
8574
- let matchesSelectorFunc = '';
8575
- function matchesSelector(el /*: Node*/, selector /*: string*/) /*: boolean*/{
8606
+
8607
+ function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
8608
+
8609
+ function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
8610
+
8611
+ function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
8612
+
8613
+ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
8614
+
8615
+ function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
8616
+
8617
+ var matchesSelectorFunc = '';
8618
+
8619
+ function matchesSelector(el
8620
+ /*: Node*/
8621
+ , selector
8622
+ /*: string*/
8623
+ )
8624
+ /*: boolean*/
8625
+ {
8576
8626
  if (!matchesSelectorFunc) {
8577
8627
  matchesSelectorFunc = (0, _shims.findInArray)(['matches', 'webkitMatchesSelector', 'mozMatchesSelector', 'msMatchesSelector', 'oMatchesSelector'], function (method) {
8578
8628
  // $FlowIgnore: Doesn't think elements are indexable
8579
8629
  return (0, _shims.isFunction)(el[method]);
8580
8630
  });
8581
- }
8582
-
8583
- // Might not be found entirely (not an Element?) - in that case, bail
8631
+ } // Might not be found entirely (not an Element?) - in that case, bail
8584
8632
  // $FlowIgnore: Doesn't think elements are indexable
8585
- if (!(0, _shims.isFunction)(el[matchesSelectorFunc])) return false;
8586
8633
 
8587
- // $FlowIgnore: Doesn't think elements are indexable
8634
+
8635
+ if (!(0, _shims.isFunction)(el[matchesSelectorFunc])) return false; // $FlowIgnore: Doesn't think elements are indexable
8636
+
8588
8637
  return el[matchesSelectorFunc](selector);
8589
- }
8638
+ } // Works up the tree to the draggable itself attempting to match selector.
8639
+
8640
+
8641
+ function matchesSelectorAndParentsTo(el
8642
+ /*: Node*/
8643
+ , selector
8644
+ /*: string*/
8645
+ , baseNode
8646
+ /*: Node*/
8647
+ )
8648
+ /*: boolean*/
8649
+ {
8650
+ var node = el;
8590
8651
 
8591
- // Works up the tree to the draggable itself attempting to match selector.
8592
- function matchesSelectorAndParentsTo(el /*: Node*/, selector /*: string*/, baseNode /*: Node*/) /*: boolean*/{
8593
- let node = el;
8594
8652
  do {
8595
8653
  if (matchesSelector(node, selector)) return true;
8596
8654
  if (node === baseNode) return false;
8597
- // $FlowIgnore[incompatible-type]
8598
8655
  node = node.parentNode;
8599
8656
  } while (node);
8657
+
8600
8658
  return false;
8601
8659
  }
8602
- function addEvent(el /*: ?Node*/, event /*: string*/, handler /*: Function*/, inputOptions /*: Object*/) /*: void*/{
8660
+
8661
+ function addEvent(el
8662
+ /*: ?Node*/
8663
+ , event
8664
+ /*: string*/
8665
+ , handler
8666
+ /*: Function*/
8667
+ , inputOptions
8668
+ /*: Object*/
8669
+ )
8670
+ /*: void*/
8671
+ {
8603
8672
  if (!el) return;
8604
- const options = {
8605
- capture: true,
8606
- ...inputOptions
8607
- };
8608
- // $FlowIgnore[method-unbinding]
8673
+
8674
+ var options = _objectSpread({
8675
+ capture: true
8676
+ }, inputOptions); // $FlowIgnore[method-unbinding]
8677
+
8678
+
8609
8679
  if (el.addEventListener) {
8610
8680
  el.addEventListener(event, handler, options);
8611
8681
  } else if (el.attachEvent) {
@@ -8615,13 +8685,25 @@ function addEvent(el /*: ?Node*/, event /*: string*/, handler /*: Function*/, in
8615
8685
  el['on' + event] = handler;
8616
8686
  }
8617
8687
  }
8618
- function removeEvent(el /*: ?Node*/, event /*: string*/, handler /*: Function*/, inputOptions /*: Object*/) /*: void*/{
8688
+
8689
+ function removeEvent(el
8690
+ /*: ?Node*/
8691
+ , event
8692
+ /*: string*/
8693
+ , handler
8694
+ /*: Function*/
8695
+ , inputOptions
8696
+ /*: Object*/
8697
+ )
8698
+ /*: void*/
8699
+ {
8619
8700
  if (!el) return;
8620
- const options = {
8621
- capture: true,
8622
- ...inputOptions
8623
- };
8624
- // $FlowIgnore[method-unbinding]
8701
+
8702
+ var options = _objectSpread({
8703
+ capture: true
8704
+ }, inputOptions); // $FlowIgnore[method-unbinding]
8705
+
8706
+
8625
8707
  if (el.removeEventListener) {
8626
8708
  el.removeEventListener(event, handler, options);
8627
8709
  } else if (el.detachEvent) {
@@ -8631,34 +8713,54 @@ function removeEvent(el /*: ?Node*/, event /*: string*/, handler /*: Function*/,
8631
8713
  el['on' + event] = null;
8632
8714
  }
8633
8715
  }
8634
- function outerHeight(node /*: HTMLElement*/) /*: number*/{
8716
+
8717
+ function outerHeight(node
8718
+ /*: HTMLElement*/
8719
+ )
8720
+ /*: number*/
8721
+ {
8635
8722
  // This is deliberately excluding margin for our calculations, since we are using
8636
8723
  // offsetTop which is including margin. See getBoundPosition
8637
- let height = node.clientHeight;
8638
- const computedStyle = node.ownerDocument.defaultView.getComputedStyle(node);
8724
+ var height = node.clientHeight;
8725
+ var computedStyle = node.ownerDocument.defaultView.getComputedStyle(node);
8639
8726
  height += (0, _shims.int)(computedStyle.borderTopWidth);
8640
8727
  height += (0, _shims.int)(computedStyle.borderBottomWidth);
8641
8728
  return height;
8642
8729
  }
8643
- function outerWidth(node /*: HTMLElement*/) /*: number*/{
8730
+
8731
+ function outerWidth(node
8732
+ /*: HTMLElement*/
8733
+ )
8734
+ /*: number*/
8735
+ {
8644
8736
  // This is deliberately excluding margin for our calculations, since we are using
8645
8737
  // offsetLeft which is including margin. See getBoundPosition
8646
- let width = node.clientWidth;
8647
- const computedStyle = node.ownerDocument.defaultView.getComputedStyle(node);
8738
+ var width = node.clientWidth;
8739
+ var computedStyle = node.ownerDocument.defaultView.getComputedStyle(node);
8648
8740
  width += (0, _shims.int)(computedStyle.borderLeftWidth);
8649
8741
  width += (0, _shims.int)(computedStyle.borderRightWidth);
8650
8742
  return width;
8651
8743
  }
8652
- function innerHeight(node /*: HTMLElement*/) /*: number*/{
8653
- let height = node.clientHeight;
8654
- const computedStyle = node.ownerDocument.defaultView.getComputedStyle(node);
8744
+
8745
+ function innerHeight(node
8746
+ /*: HTMLElement*/
8747
+ )
8748
+ /*: number*/
8749
+ {
8750
+ var height = node.clientHeight;
8751
+ var computedStyle = node.ownerDocument.defaultView.getComputedStyle(node);
8655
8752
  height -= (0, _shims.int)(computedStyle.paddingTop);
8656
8753
  height -= (0, _shims.int)(computedStyle.paddingBottom);
8657
8754
  return height;
8658
8755
  }
8659
- function innerWidth(node /*: HTMLElement*/) /*: number*/{
8660
- let width = node.clientWidth;
8661
- const computedStyle = node.ownerDocument.defaultView.getComputedStyle(node);
8756
+
8757
+ function innerWidth(node
8758
+ /*: HTMLElement*/
8759
+ )
8760
+ /*: number*/
8761
+ {
8762
+ var width = node.clientWidth;
8763
+ var computedStyle = node.ownerDocument.defaultView.getComputedStyle(node);
8662
8764
  width -= (0, _shims.int)(computedStyle.paddingLeft);
8663
8765
  width -= (0, _shims.int)(computedStyle.paddingRight);
8664
8766
  return width;
@@ -8666,59 +8768,106 @@ function innerWidth(node /*: HTMLElement*/) /*: number*/{
8666
8768
  /*:: interface EventWithOffset {
8667
8769
  clientX: number, clientY: number
8668
8770
  }*/
8771
+
8772
+
8669
8773
  // Get from offsetParent
8670
- function offsetXYFromParent(evt /*: EventWithOffset*/, offsetParent /*: HTMLElement*/, scale /*: number*/) /*: ControlPosition*/{
8671
- const isBody = offsetParent === offsetParent.ownerDocument.body;
8672
- const offsetParentRect = isBody ? {
8774
+ function offsetXYFromParent(evt
8775
+ /*: EventWithOffset*/
8776
+ , offsetParent
8777
+ /*: HTMLElement*/
8778
+ , scale
8779
+ /*: number*/
8780
+ )
8781
+ /*: ControlPosition*/
8782
+ {
8783
+ var isBody = offsetParent === offsetParent.ownerDocument.body;
8784
+ var offsetParentRect = isBody ? {
8673
8785
  left: 0,
8674
8786
  top: 0
8675
8787
  } : offsetParent.getBoundingClientRect();
8676
- const x = (evt.clientX + offsetParent.scrollLeft - offsetParentRect.left) / scale;
8677
- const y = (evt.clientY + offsetParent.scrollTop - offsetParentRect.top) / scale;
8788
+ var x = (evt.clientX + offsetParent.scrollLeft - offsetParentRect.left) / scale;
8789
+ var y = (evt.clientY + offsetParent.scrollTop - offsetParentRect.top) / scale;
8678
8790
  return {
8679
- x,
8680
- y
8791
+ x: x,
8792
+ y: y
8681
8793
  };
8682
8794
  }
8683
- function createCSSTransform(controlPos /*: ControlPosition*/, positionOffset /*: PositionOffsetControlPosition*/) /*: Object*/{
8684
- const translation = getTranslation(controlPos, positionOffset, 'px');
8685
- return {
8686
- [(0, _getPrefix.browserPrefixToKey)('transform', _getPrefix.default)]: translation
8687
- };
8795
+
8796
+ function createCSSTransform(controlPos
8797
+ /*: ControlPosition*/
8798
+ , positionOffset
8799
+ /*: PositionOffsetControlPosition*/
8800
+ )
8801
+ /*: Object*/
8802
+ {
8803
+ var translation = getTranslation(controlPos, positionOffset, 'px');
8804
+ return _defineProperty({}, (0, _getPrefix.browserPrefixToKey)('transform', _getPrefix.default), translation);
8688
8805
  }
8689
- function createSVGTransform(controlPos /*: ControlPosition*/, positionOffset /*: PositionOffsetControlPosition*/) /*: string*/{
8690
- const translation = getTranslation(controlPos, positionOffset, '');
8806
+
8807
+ function createSVGTransform(controlPos
8808
+ /*: ControlPosition*/
8809
+ , positionOffset
8810
+ /*: PositionOffsetControlPosition*/
8811
+ )
8812
+ /*: string*/
8813
+ {
8814
+ var translation = getTranslation(controlPos, positionOffset, '');
8691
8815
  return translation;
8692
8816
  }
8693
- function getTranslation(_ref /*:: */, positionOffset /*: PositionOffsetControlPosition*/, unitSuffix /*: string*/) /*: string*/{
8694
- let {
8695
- x,
8696
- y
8697
- } /*: ControlPosition*/ = _ref /*: ControlPosition*/;
8698
- let translation = "translate(".concat(x).concat(unitSuffix, ",").concat(y).concat(unitSuffix, ")");
8817
+
8818
+ function getTranslation(_ref2, positionOffset
8819
+ /*: PositionOffsetControlPosition*/
8820
+ , unitSuffix
8821
+ /*: string*/
8822
+ )
8823
+ /*: string*/
8824
+ {
8825
+ var x = _ref2.x,
8826
+ y = _ref2.y;
8827
+ var translation = "translate(".concat(x).concat(unitSuffix, ",").concat(y).concat(unitSuffix, ")");
8828
+
8699
8829
  if (positionOffset) {
8700
- const defaultX = "".concat(typeof positionOffset.x === 'string' ? positionOffset.x : positionOffset.x + unitSuffix);
8701
- const defaultY = "".concat(typeof positionOffset.y === 'string' ? positionOffset.y : positionOffset.y + unitSuffix);
8830
+ var defaultX = "".concat(typeof positionOffset.x === 'string' ? positionOffset.x : positionOffset.x + unitSuffix);
8831
+ var defaultY = "".concat(typeof positionOffset.y === 'string' ? positionOffset.y : positionOffset.y + unitSuffix);
8702
8832
  translation = "translate(".concat(defaultX, ", ").concat(defaultY, ")") + translation;
8703
8833
  }
8834
+
8704
8835
  return translation;
8705
8836
  }
8706
- function getTouch(e /*: MouseTouchEvent*/, identifier /*: number*/) /*: ?{clientX: number, clientY: number}*/{
8707
- return e.targetTouches && (0, _shims.findInArray)(e.targetTouches, t => identifier === t.identifier) || e.changedTouches && (0, _shims.findInArray)(e.changedTouches, t => identifier === t.identifier);
8837
+
8838
+ function getTouch(e
8839
+ /*: MouseTouchEvent*/
8840
+ , identifier
8841
+ /*: number*/
8842
+ )
8843
+ /*: ?{clientX: number, clientY: number}*/
8844
+ {
8845
+ return e.targetTouches && (0, _shims.findInArray)(e.targetTouches, function (t) {
8846
+ return identifier === t.identifier;
8847
+ }) || e.changedTouches && (0, _shims.findInArray)(e.changedTouches, function (t) {
8848
+ return identifier === t.identifier;
8849
+ });
8708
8850
  }
8709
- function getTouchIdentifier(e /*: MouseTouchEvent*/) /*: ?number*/{
8851
+
8852
+ function getTouchIdentifier(e
8853
+ /*: MouseTouchEvent*/
8854
+ )
8855
+ /*: ?number*/
8856
+ {
8710
8857
  if (e.targetTouches && e.targetTouches[0]) return e.targetTouches[0].identifier;
8711
8858
  if (e.changedTouches && e.changedTouches[0]) return e.changedTouches[0].identifier;
8712
- }
8713
-
8714
- // User-select Hacks:
8859
+ } // User-select Hacks:
8715
8860
  //
8716
8861
  // Useful for preventing blue highlights all over everything when dragging.
8717
-
8718
8862
  // Note we're passing `document` b/c we could be iframed
8719
- function addUserSelectStyles(doc /*: ?Document*/) {
8863
+
8864
+
8865
+ function addUserSelectStyles(doc
8866
+ /*: ?Document*/
8867
+ ) {
8720
8868
  if (!doc) return;
8721
- let styleEl = doc.getElementById('react-draggable-style-el');
8869
+ var styleEl = doc.getElementById('react-draggable-style-el');
8870
+
8722
8871
  if (!styleEl) {
8723
8872
  styleEl = doc.createElement('style');
8724
8873
  styleEl.type = 'text/css';
@@ -8727,29 +8876,39 @@ function addUserSelectStyles(doc /*: ?Document*/) {
8727
8876
  styleEl.innerHTML += '.react-draggable-transparent-selection *::selection {all: inherit;}\n';
8728
8877
  doc.getElementsByTagName('head')[0].appendChild(styleEl);
8729
8878
  }
8879
+
8730
8880
  if (doc.body) addClassName(doc.body, 'react-draggable-transparent-selection');
8731
8881
  }
8732
- function removeUserSelectStyles(doc /*: ?Document*/) {
8882
+
8883
+ function removeUserSelectStyles(doc
8884
+ /*: ?Document*/
8885
+ ) {
8733
8886
  if (!doc) return;
8887
+
8734
8888
  try {
8735
- if (doc.body) removeClassName(doc.body, 'react-draggable-transparent-selection');
8736
- // $FlowIgnore: IE
8889
+ if (doc.body) removeClassName(doc.body, 'react-draggable-transparent-selection'); // $FlowIgnore: IE
8890
+
8737
8891
  if (doc.selection) {
8738
8892
  // $FlowIgnore: IE
8739
8893
  doc.selection.empty();
8740
8894
  } else {
8741
8895
  // Remove selection caused by scroll, unless it's a focused input
8742
8896
  // (we use doc.defaultView in case we're in an iframe)
8743
- const selection = (doc.defaultView || window).getSelection();
8897
+ var selection = (doc.defaultView || window).getSelection();
8898
+
8744
8899
  if (selection && selection.type !== 'Caret') {
8745
8900
  selection.removeAllRanges();
8746
8901
  }
8747
8902
  }
8748
- } catch (e) {
8749
- // probably IE
8903
+ } catch (e) {// probably IE
8750
8904
  }
8751
8905
  }
8752
- function addClassName(el /*: HTMLElement*/, className /*: string*/) {
8906
+
8907
+ function addClassName(el
8908
+ /*: HTMLElement*/
8909
+ , className
8910
+ /*: string*/
8911
+ ) {
8753
8912
  if (el.classList) {
8754
8913
  el.classList.add(className);
8755
8914
  } else {
@@ -8758,7 +8917,12 @@ function addClassName(el /*: HTMLElement*/, className /*: string*/) {
8758
8917
  }
8759
8918
  }
8760
8919
  }
8761
- function removeClassName(el /*: HTMLElement*/, className /*: string*/) {
8920
+
8921
+ function removeClassName(el
8922
+ /*: HTMLElement*/
8923
+ , className
8924
+ /*: string*/
8925
+ ) {
8762
8926
  if (el.classList) {
8763
8927
  el.classList.remove(className);
8764
8928
  } else {
@@ -9187,7 +9351,7 @@ if (true) {
9187
9351
  /* 166 */
9188
9352
  /***/ (function(module) {
9189
9353
 
9190
- module.exports = {"name":"@sis-cc/dotstatsuite-visions","version":"12.11.0","description":"Library of visual components","author":"OECD","homepage":"https://visions-qa.siscc.org/#o","license":"MIT","repository":"https://gitlab.com/sis-cc/.stat-suite/dotstatsuite-visions","main":"lib/index.js","module":"es/index.js","engines":{"node":">=14"},"files":["css","es","lib","umd"],"scripts":{"build":"nwb build-react-component --copy-files --no-demo && node scripts/doc && nwb build-demo","build:dev":"nwb build-react-component --copy-files --no-demo","clean":"nwb clean-module && nwb clean-demo","prepublishOnly":"npm run build","start":"nwb serve-react-demo","test":"jest","test:watch":"jest --watch --no-cache","lint":"eslint src/ --color","precommit":"lint-staged"},"dependencies":{"@emotion/react":"^11.13.0","@emotion/styled":"^11.13.0","@hello-pangea/dnd":"^16.6.0","@mui/icons-material":"^5.16.5","@mui/material":"^5.16.5","@mui/styles":"^5.16.5","@react-hook/size":"^2.1.1","classnames":"^2.2.6","cross-env":"^7.0.3","date-fns":"^1.30.1","isemail":"^3.2.0","numeral":"^2.0.6","prop-types":"^15.7.2","ramda":"^0.27.0","react-draggable":"^4.4.5","react-error-boundary":"^4.0.10","react-virtualized":"^9.21.2"},"peerDependencies":{"@mui/icons-material":"^5.16.5","@mui/material":"^5.16.5","react":"^18","react-dom":"^18"},"devDependencies":{"@babel/eslint-parser":"^7.5.4","@babel/plugin-syntax-dynamic-import":"^7.2.0","@cfaester/enzyme-adapter-react-18":"^0.7.0","@mui/icons-material":"^5.16.5","@mui/material":"^5.16.5","@testing-library/jest-dom":"^5.16.5","@testing-library/react":"^14.0.0","babel-jest":"^24.8.0","babel-preset-react-app":"^9.0.0","dox":"^0.9.0","eslint":"^8.39.0","eslint-plugin-import":"^2.27.5","eslint-plugin-jsx-a11y":"^6.7.1","eslint-plugin-prettier":"^4.2.1","eslint-plugin-react":"^7.32.2","eslint-plugin-react-hooks":"^4.6.0","husky":"^2.7.0","identity-obj-proxy":"^3.0.0","jest":"^24.8.0","jss":"^10.10.0","jss-rtl":"^0.2.3","lint-staged":"^8.2.1","mutationobserver-shim":"^0.3.7","nwb":"0.23.0","prettier":"^2.8.8","pretty-quick":"^3.1.3","react":"^18","react-a11y":"^1.1.0","react-dom":"^18","react-helmet":"^5.2.1","react-scrollable-anchor":"^0.6.1","react-syntax-highlighter":"^10.2.1","sanitize-html":"2.7.0","webpack":"^5.68.0","webpack-cli":"^4.9.2","webpack-dev-server":"^4.7.4"},"jest":{"verbose":true,"coverageDirectory":"coverage","collectCoverageFrom":["src/**/*.{js,jsx,ts,tsx}","!src/ScopeList/*.{js,jsx,ts,tsx}","!src/**/*.d.ts"],"setupFilesAfterEnv":["<rootDir>/tests/setup.js"],"testMatch":["**/tests/**/*.{spec,test}.{js,jsx,ts,tsx}","!**/tests/ScopeList.test.js"],"testEnvironment":"jsdom","transform":{"^.+\\.(js|jsx|ts|tsx)$":"<rootDir>/node_modules/babel-jest"},"transformIgnorePatterns":["[/\\\\]node_modules[/\\\\].+\\.(js|jsx|ts|tsx)$","^.+\\.module\\.(css|sass|scss)$"],"modulePaths":[],"moduleNameMapper":{"^react-native$":"react-native-web","^.+\\.module\\.(css|sass|scss)$":"identity-obj-proxy","\\.(jpg|jpeg|png)$":"identity-obj-proxy"},"moduleFileExtensions":["web.js","js","web.ts","ts","web.tsx","tsx","json","web.jsx","jsx","node"]},"babel":{"presets":["react-app"],"plugins":["@babel/plugin-syntax-dynamic-import"]},"eslintConfig":{"env":{"browser":true,"jest":true,"node":true,"es6":true},"extends":["eslint:recommended","plugin:react/recommended","plugin:jsx-a11y/recommended"],"parser":"@babel/eslint-parser","parserOptions":{"babelOptions":{"presets":[["babel-preset-react-app",false],"babel-preset-react-app/test"]},"ecmaFeatures":{"experimentalObjectRestSpread":true,"jsx":true},"sourceType":"module"},"plugins":["prettier","react","import","react-hooks","jsx-a11y"],"rules":{"no-console":"warn","no-unused-vars":"error","react/display-name":"off","react-hooks/rules-of-hooks":"error","react-hooks/exhaustive-deps":"warn","no-use-before-define":"error"}},"browserslist":{"production":[">0.2%","not dead","not op_mini all"],"development":["last 1 chrome version","last 1 firefox version","last 1 safari version"]},"husky":{"hooks":{"pre-commit":"lint-staged"}},"lint-staged":{"src/**/*.{js,css}":["prettier --write","git add","yarn lint"]},"prettier":{"endOfLine":"lf","useTabs":false,"printWidth":100,"tabWidth":2,"singleQuote":true,"trailingComma":"all","bracketSameLine":false,"bracketSpacing":true,"parser":"babel","semi":true,"arrowParens":"avoid"}};
9354
+ module.exports = {"name":"@sis-cc/dotstatsuite-visions","version":"12.12.1","description":"Library of visual components","author":"OECD","homepage":"https://visions-qa.siscc.org/#o","license":"MIT","repository":"https://gitlab.com/sis-cc/.stat-suite/dotstatsuite-visions","main":"lib/index.js","module":"es/index.js","engines":{"node":">=14"},"files":["css","es","lib","umd"],"scripts":{"build":"nwb build-react-component --copy-files --no-demo && node scripts/doc && nwb build-demo","build:dev":"nwb build-react-component --copy-files --no-demo","clean":"nwb clean-module && nwb clean-demo","prepublishOnly":"npm run build","start":"nwb serve-react-demo","test":"jest","test:watch":"jest --watch --no-cache","lint":"eslint src/ --color","precommit":"lint-staged"},"dependencies":{"@emotion/react":"^11.13.0","@emotion/styled":"^11.13.0","@hello-pangea/dnd":"^16.6.0","@mui/icons-material":"^5.16.5","@mui/material":"^5.16.5","@mui/styles":"^5.16.5","@react-hook/size":"^2.1.1","classnames":"^2.2.6","cross-env":"^7.0.3","date-fns":"^1.30.1","isemail":"^3.2.0","numeral":"^2.0.6","prop-types":"^15.7.2","ramda":"^0.27.0","react-draggable":"4.4.5","react-error-boundary":"^4.0.10","react-virtualized":"^9.21.2"},"peerDependencies":{"@mui/icons-material":"^5.16.5","@mui/material":"^5.16.5","react":"^18","react-dom":"^18"},"devDependencies":{"@babel/eslint-parser":"^7.5.4","@babel/plugin-syntax-dynamic-import":"^7.2.0","@cfaester/enzyme-adapter-react-18":"^0.7.0","@mui/icons-material":"^5.16.5","@mui/material":"^5.16.5","@testing-library/jest-dom":"^5.16.5","@testing-library/react":"^14.0.0","babel-jest":"^24.8.0","babel-preset-react-app":"^9.0.0","dox":"^0.9.0","eslint":"^8.39.0","eslint-plugin-import":"^2.27.5","eslint-plugin-jsx-a11y":"^6.7.1","eslint-plugin-prettier":"^4.2.1","eslint-plugin-react":"^7.32.2","eslint-plugin-react-hooks":"^4.6.0","husky":"^2.7.0","identity-obj-proxy":"^3.0.0","jest":"^24.8.0","jss":"^10.10.0","jss-rtl":"^0.2.3","lint-staged":"^8.2.1","mutationobserver-shim":"^0.3.7","nwb":"0.23.0","prettier":"^2.8.8","pretty-quick":"^3.1.3","react":"^18","react-a11y":"^1.1.0","react-dom":"^18","react-helmet":"^5.2.1","react-scrollable-anchor":"^0.6.1","react-syntax-highlighter":"^10.2.1","sanitize-html":"2.7.0","webpack":"^5.68.0","webpack-cli":"^4.9.2","webpack-dev-server":"^4.7.4"},"jest":{"verbose":true,"coverageDirectory":"coverage","collectCoverageFrom":["src/**/*.{js,jsx,ts,tsx}","!src/ScopeList/*.{js,jsx,ts,tsx}","!src/**/*.d.ts"],"setupFilesAfterEnv":["<rootDir>/tests/setup.js"],"testMatch":["**/tests/**/*.{spec,test}.{js,jsx,ts,tsx}","!**/tests/ScopeList.test.js"],"testEnvironment":"jsdom","transform":{"^.+\\.(js|jsx|ts|tsx)$":"<rootDir>/node_modules/babel-jest"},"transformIgnorePatterns":["[/\\\\]node_modules[/\\\\].+\\.(js|jsx|ts|tsx)$","^.+\\.module\\.(css|sass|scss)$"],"modulePaths":[],"moduleNameMapper":{"^react-native$":"react-native-web","^.+\\.module\\.(css|sass|scss)$":"identity-obj-proxy","\\.(jpg|jpeg|png)$":"identity-obj-proxy"},"moduleFileExtensions":["web.js","js","web.ts","ts","web.tsx","tsx","json","web.jsx","jsx","node"]},"babel":{"presets":["react-app"],"plugins":["@babel/plugin-syntax-dynamic-import"]},"eslintConfig":{"env":{"browser":true,"jest":true,"node":true,"es6":true},"extends":["eslint:recommended","plugin:react/recommended","plugin:jsx-a11y/recommended"],"parser":"@babel/eslint-parser","parserOptions":{"babelOptions":{"presets":[["babel-preset-react-app",false],"babel-preset-react-app/test"]},"ecmaFeatures":{"experimentalObjectRestSpread":true,"jsx":true},"sourceType":"module"},"plugins":["prettier","react","import","react-hooks","jsx-a11y"],"rules":{"no-console":"warn","no-unused-vars":"error","react/display-name":"off","react-hooks/rules-of-hooks":"error","react-hooks/exhaustive-deps":"warn","no-use-before-define":"error"}},"browserslist":{"production":[">0.2%","not dead","not op_mini all"],"development":["last 1 chrome version","last 1 firefox version","last 1 safari version"]},"husky":{"hooks":{"pre-commit":"lint-staged"}},"lint-staged":{"src/**/*.{js,css}":["prettier --write","git add","yarn lint"]},"prettier":{"endOfLine":"lf","useTabs":false,"printWidth":100,"tabWidth":2,"singleQuote":true,"trailingComma":"all","bracketSameLine":false,"bracketSpacing":true,"parser":"babel","semi":true,"arrowParens":"avoid"}};
9191
9355
 
9192
9356
  /***/ }),
9193
9357
  /* 167 */
@@ -11051,110 +11215,163 @@ exports.createDraggableData = createDraggableData;
11051
11215
  exports.getBoundPosition = getBoundPosition;
11052
11216
  exports.getControlPosition = getControlPosition;
11053
11217
  exports.snapToGrid = snapToGrid;
11218
+
11054
11219
  var _shims = __webpack_require__(108);
11220
+
11055
11221
  var _domFns = __webpack_require__(138);
11056
- /*:: import type Draggable from '../Draggable';*/
11057
- /*:: import type {Bounds, ControlPosition, DraggableData, MouseTouchEvent} from './types';*/
11058
- /*:: import type DraggableCore from '../DraggableCore';*/
11059
- function getBoundPosition(draggable /*: Draggable*/, x /*: number*/, y /*: number*/) /*: [number, number]*/{
11222
+
11223
+ function getBoundPosition(draggable
11224
+ /*: Draggable*/
11225
+ , x
11226
+ /*: number*/
11227
+ , y
11228
+ /*: number*/
11229
+ )
11230
+ /*: [number, number]*/
11231
+ {
11060
11232
  // If no bounds, short-circuit and move on
11061
- if (!draggable.props.bounds) return [x, y];
11233
+ if (!draggable.props.bounds) return [x, y]; // Clone new bounds
11062
11234
 
11063
- // Clone new bounds
11064
- let {
11065
- bounds
11066
- } = draggable.props;
11235
+ var bounds = draggable.props.bounds;
11067
11236
  bounds = typeof bounds === 'string' ? bounds : cloneBounds(bounds);
11068
- const node = findDOMNode(draggable);
11237
+ var node = findDOMNode(draggable);
11238
+
11069
11239
  if (typeof bounds === 'string') {
11070
- const {
11071
- ownerDocument
11072
- } = node;
11073
- const ownerWindow = ownerDocument.defaultView;
11074
- let boundNode;
11240
+ var ownerDocument = node.ownerDocument;
11241
+ var ownerWindow = ownerDocument.defaultView;
11242
+ var boundNode;
11243
+
11075
11244
  if (bounds === 'parent') {
11076
11245
  boundNode = node.parentNode;
11077
11246
  } else {
11078
11247
  boundNode = ownerDocument.querySelector(bounds);
11079
11248
  }
11249
+
11080
11250
  if (!(boundNode instanceof ownerWindow.HTMLElement)) {
11081
11251
  throw new Error('Bounds selector "' + bounds + '" could not find an element.');
11082
11252
  }
11083
- const boundNodeEl /*: HTMLElement*/ = boundNode; // for Flow, can't seem to refine correctly
11084
- const nodeStyle = ownerWindow.getComputedStyle(node);
11085
- const boundNodeStyle = ownerWindow.getComputedStyle(boundNodeEl);
11086
- // Compute bounds. This is a pain with padding and offsets but this gets it exactly right.
11253
+
11254
+ var boundNodeEl
11255
+ /*: HTMLElement*/
11256
+ = boundNode; // for Flow, can't seem to refine correctly
11257
+
11258
+ var nodeStyle = ownerWindow.getComputedStyle(node);
11259
+ var boundNodeStyle = ownerWindow.getComputedStyle(boundNodeEl); // Compute bounds. This is a pain with padding and offsets but this gets it exactly right.
11260
+
11087
11261
  bounds = {
11088
11262
  left: -node.offsetLeft + (0, _shims.int)(boundNodeStyle.paddingLeft) + (0, _shims.int)(nodeStyle.marginLeft),
11089
11263
  top: -node.offsetTop + (0, _shims.int)(boundNodeStyle.paddingTop) + (0, _shims.int)(nodeStyle.marginTop),
11090
11264
  right: (0, _domFns.innerWidth)(boundNodeEl) - (0, _domFns.outerWidth)(node) - node.offsetLeft + (0, _shims.int)(boundNodeStyle.paddingRight) - (0, _shims.int)(nodeStyle.marginRight),
11091
11265
  bottom: (0, _domFns.innerHeight)(boundNodeEl) - (0, _domFns.outerHeight)(node) - node.offsetTop + (0, _shims.int)(boundNodeStyle.paddingBottom) - (0, _shims.int)(nodeStyle.marginBottom)
11092
11266
  };
11093
- }
11267
+ } // Keep x and y below right and bottom limits...
11268
+
11094
11269
 
11095
- // Keep x and y below right and bottom limits...
11096
11270
  if ((0, _shims.isNum)(bounds.right)) x = Math.min(x, bounds.right);
11097
- if ((0, _shims.isNum)(bounds.bottom)) y = Math.min(y, bounds.bottom);
11271
+ if ((0, _shims.isNum)(bounds.bottom)) y = Math.min(y, bounds.bottom); // But above left and top limits.
11098
11272
 
11099
- // But above left and top limits.
11100
11273
  if ((0, _shims.isNum)(bounds.left)) x = Math.max(x, bounds.left);
11101
11274
  if ((0, _shims.isNum)(bounds.top)) y = Math.max(y, bounds.top);
11102
11275
  return [x, y];
11103
11276
  }
11104
- function snapToGrid(grid /*: [number, number]*/, pendingX /*: number*/, pendingY /*: number*/) /*: [number, number]*/{
11105
- const x = Math.round(pendingX / grid[0]) * grid[0];
11106
- const y = Math.round(pendingY / grid[1]) * grid[1];
11277
+
11278
+ function snapToGrid(grid
11279
+ /*: [number, number]*/
11280
+ , pendingX
11281
+ /*: number*/
11282
+ , pendingY
11283
+ /*: number*/
11284
+ )
11285
+ /*: [number, number]*/
11286
+ {
11287
+ var x = Math.round(pendingX / grid[0]) * grid[0];
11288
+ var y = Math.round(pendingY / grid[1]) * grid[1];
11107
11289
  return [x, y];
11108
11290
  }
11109
- function canDragX(draggable /*: Draggable*/) /*: boolean*/{
11291
+
11292
+ function canDragX(draggable
11293
+ /*: Draggable*/
11294
+ )
11295
+ /*: boolean*/
11296
+ {
11110
11297
  return draggable.props.axis === 'both' || draggable.props.axis === 'x';
11111
11298
  }
11112
- function canDragY(draggable /*: Draggable*/) /*: boolean*/{
11299
+
11300
+ function canDragY(draggable
11301
+ /*: Draggable*/
11302
+ )
11303
+ /*: boolean*/
11304
+ {
11113
11305
  return draggable.props.axis === 'both' || draggable.props.axis === 'y';
11114
- }
11306
+ } // Get {x, y} positions from event.
11115
11307
 
11116
- // Get {x, y} positions from event.
11117
- function getControlPosition(e /*: MouseTouchEvent*/, touchIdentifier /*: ?number*/, draggableCore /*: DraggableCore*/) /*: ?ControlPosition*/{
11118
- const touchObj = typeof touchIdentifier === 'number' ? (0, _domFns.getTouch)(e, touchIdentifier) : null;
11308
+
11309
+ function getControlPosition(e
11310
+ /*: MouseTouchEvent*/
11311
+ , touchIdentifier
11312
+ /*: ?number*/
11313
+ , draggableCore
11314
+ /*: DraggableCore*/
11315
+ )
11316
+ /*: ?ControlPosition*/
11317
+ {
11318
+ var touchObj = typeof touchIdentifier === 'number' ? (0, _domFns.getTouch)(e, touchIdentifier) : null;
11119
11319
  if (typeof touchIdentifier === 'number' && !touchObj) return null; // not the right touch
11120
- const node = findDOMNode(draggableCore);
11121
- // User can provide an offsetParent if desired.
11122
- const offsetParent = draggableCore.props.offsetParent || node.offsetParent || node.ownerDocument.body;
11320
+
11321
+ var node = findDOMNode(draggableCore); // User can provide an offsetParent if desired.
11322
+
11323
+ var offsetParent = draggableCore.props.offsetParent || node.offsetParent || node.ownerDocument.body;
11123
11324
  return (0, _domFns.offsetXYFromParent)(touchObj || e, offsetParent, draggableCore.props.scale);
11124
- }
11325
+ } // Create an data object exposed by <DraggableCore>'s events
11326
+
11327
+
11328
+ function createCoreData(draggable
11329
+ /*: DraggableCore*/
11330
+ , x
11331
+ /*: number*/
11332
+ , y
11333
+ /*: number*/
11334
+ )
11335
+ /*: DraggableData*/
11336
+ {
11337
+ var state = draggable.state;
11338
+ var isStart = !(0, _shims.isNum)(state.lastX);
11339
+ var node = findDOMNode(draggable);
11125
11340
 
11126
- // Create an data object exposed by <DraggableCore>'s events
11127
- function createCoreData(draggable /*: DraggableCore*/, x /*: number*/, y /*: number*/) /*: DraggableData*/{
11128
- const isStart = !(0, _shims.isNum)(draggable.lastX);
11129
- const node = findDOMNode(draggable);
11130
11341
  if (isStart) {
11131
11342
  // If this is our first move, use the x and y as last coords.
11132
11343
  return {
11133
- node,
11344
+ node: node,
11134
11345
  deltaX: 0,
11135
11346
  deltaY: 0,
11136
11347
  lastX: x,
11137
11348
  lastY: y,
11138
- x,
11139
- y
11349
+ x: x,
11350
+ y: y
11140
11351
  };
11141
11352
  } else {
11142
11353
  // Otherwise calculate proper values.
11143
11354
  return {
11144
- node,
11145
- deltaX: x - draggable.lastX,
11146
- deltaY: y - draggable.lastY,
11147
- lastX: draggable.lastX,
11148
- lastY: draggable.lastY,
11149
- x,
11150
- y
11355
+ node: node,
11356
+ deltaX: x - state.lastX,
11357
+ deltaY: y - state.lastY,
11358
+ lastX: state.lastX,
11359
+ lastY: state.lastY,
11360
+ x: x,
11361
+ y: y
11151
11362
  };
11152
11363
  }
11153
- }
11364
+ } // Create an data exposed by <Draggable>'s events
11365
+
11154
11366
 
11155
- // Create an data exposed by <Draggable>'s events
11156
- function createDraggableData(draggable /*: Draggable*/, coreData /*: DraggableData*/) /*: DraggableData*/{
11157
- const scale = draggable.props.scale;
11367
+ function createDraggableData(draggable
11368
+ /*: Draggable*/
11369
+ , coreData
11370
+ /*: DraggableData*/
11371
+ )
11372
+ /*: DraggableData*/
11373
+ {
11374
+ var scale = draggable.props.scale;
11158
11375
  return {
11159
11376
  node: coreData.node,
11160
11377
  x: draggable.state.x + coreData.deltaX / scale,
@@ -11164,10 +11381,14 @@ function createDraggableData(draggable /*: Draggable*/, coreData /*: DraggableDa
11164
11381
  lastX: draggable.state.x,
11165
11382
  lastY: draggable.state.y
11166
11383
  };
11167
- }
11384
+ } // A lot faster than stringify/parse
11385
+
11168
11386
 
11169
- // A lot faster than stringify/parse
11170
- function cloneBounds(bounds /*: Bounds*/) /*: Bounds*/{
11387
+ function cloneBounds(bounds
11388
+ /*: Bounds*/
11389
+ )
11390
+ /*: Bounds*/
11391
+ {
11171
11392
  return {
11172
11393
  left: bounds.left,
11173
11394
  top: bounds.top,
@@ -11175,12 +11396,19 @@ function cloneBounds(bounds /*: Bounds*/) /*: Bounds*/{
11175
11396
  bottom: bounds.bottom
11176
11397
  };
11177
11398
  }
11178
- function findDOMNode(draggable /*: Draggable | DraggableCore*/) /*: HTMLElement*/{
11179
- const node = draggable.findDOMNode();
11399
+
11400
+ function findDOMNode(draggable
11401
+ /*: Draggable | DraggableCore*/
11402
+ )
11403
+ /*: HTMLElement*/
11404
+ {
11405
+ var node = draggable.findDOMNode();
11406
+
11180
11407
  if (!node) {
11181
11408
  throw new Error('<DraggableCore>: Unmounted during event!');
11182
- }
11183
- // $FlowIgnore we can't assert on HTMLElement due to tests... FIXME
11409
+ } // $FlowIgnore we can't assert on HTMLElement due to tests... FIXME
11410
+
11411
+
11184
11412
  return node;
11185
11413
  }
11186
11414
 
@@ -11195,9 +11423,12 @@ Object.defineProperty(exports, "__esModule", {
11195
11423
  value: true
11196
11424
  });
11197
11425
  exports.default = log;
11426
+
11198
11427
  /*eslint no-console:0*/
11199
11428
  function log() {
11200
- if (undefined) console.log(...arguments);
11429
+ var _console;
11430
+
11431
+ if (undefined) (_console = console).log.apply(_console, arguments);
11201
11432
  }
11202
11433
 
11203
11434
  /***/ }),
@@ -13215,14 +13446,13 @@ var _default = exports.default = (0, _createSvgIcon.default)( /*#__PURE__*/(0, _
13215
13446
  "use strict";
13216
13447
 
13217
13448
 
13218
- const {
13219
- default: Draggable,
13220
- DraggableCore
13221
- } = __webpack_require__(420);
13222
-
13223
- // Previous versions of this lib exported <Draggable> as the root export. As to no-// them, or TypeScript, we export *both* as the root and as 'default'.
13449
+ var _require = __webpack_require__(420),
13450
+ Draggable = _require.default,
13451
+ DraggableCore = _require.DraggableCore; // Previous versions of this lib exported <Draggable> as the root export. As to no-// them, or TypeScript, we export *both* as the root and as 'default'.
13224
13452
  // See https://github.com/mzabriskie/react-draggable/pull/254
13225
13453
  // and https://github.com/mzabriskie/react-draggable/issues/266
13454
+
13455
+
13226
13456
  module.exports = Draggable;
13227
13457
  module.exports.default = Draggable;
13228
13458
  module.exports.DraggableCore = DraggableCore;
@@ -24558,174 +24788,196 @@ function defaultOverscanIndicesGetter(_ref) {
24558
24788
  "use strict";
24559
24789
 
24560
24790
 
24791
+ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
24792
+
24561
24793
  Object.defineProperty(exports, "__esModule", {
24562
24794
  value: true
24563
24795
  });
24564
24796
  Object.defineProperty(exports, "DraggableCore", {
24565
24797
  enumerable: true,
24566
- get: function () {
24798
+ get: function get() {
24567
24799
  return _DraggableCore.default;
24568
24800
  }
24569
24801
  });
24570
24802
  exports.default = void 0;
24803
+
24571
24804
  var React = _interopRequireWildcard(__webpack_require__(0));
24805
+
24572
24806
  var _propTypes = _interopRequireDefault(__webpack_require__(1));
24807
+
24573
24808
  var _reactDom = _interopRequireDefault(__webpack_require__(38));
24574
- var _clsx = _interopRequireDefault(__webpack_require__(421));
24809
+
24810
+ var _clsx2 = _interopRequireDefault(__webpack_require__(421));
24811
+
24575
24812
  var _domFns = __webpack_require__(138);
24813
+
24576
24814
  var _positionFns = __webpack_require__(210);
24815
+
24577
24816
  var _shims = __webpack_require__(108);
24817
+
24578
24818
  var _DraggableCore = _interopRequireDefault(__webpack_require__(423));
24819
+
24579
24820
  var _log = _interopRequireDefault(__webpack_require__(211));
24821
+
24822
+ var _excluded = ["axis", "bounds", "children", "defaultPosition", "defaultClassName", "defaultClassNameDragging", "defaultClassNameDragged", "position", "positionOffset", "scale"];
24823
+
24580
24824
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
24581
- function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
24582
- function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
24583
- function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
24584
- function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
24585
- function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return typeof key === "symbol" ? key : String(key); }
24586
- function _toPrimitive(input, hint) { if (typeof input !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (typeof res !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); } /*:: import type {ControlPosition, PositionOffsetControlPosition, DraggableCoreProps, DraggableCoreDefaultProps} from './DraggableCore';*/
24587
- /*:: import type {Bounds, DraggableEventHandler} from './utils/types';*/
24588
- /*:: import type {Element as ReactElement} from 'react';*/
24589
- /*:: type DraggableState = {
24590
- dragging: boolean,
24591
- dragged: boolean,
24592
- x: number, y: number,
24593
- slackX: number, slackY: number,
24594
- isElementSVG: boolean,
24595
- prevPropsPosition: ?ControlPosition,
24596
- };*/
24597
- /*:: export type DraggableDefaultProps = {
24598
- ...DraggableCoreDefaultProps,
24599
- axis: 'both' | 'x' | 'y' | 'none',
24600
- bounds: Bounds | string | false,
24601
- defaultClassName: string,
24602
- defaultClassNameDragging: string,
24603
- defaultClassNameDragged: string,
24604
- defaultPosition: ControlPosition,
24605
- scale: number,
24606
- };*/
24607
- /*:: export type DraggableProps = {
24608
- ...DraggableCoreProps,
24609
- ...DraggableDefaultProps,
24610
- positionOffset: PositionOffsetControlPosition,
24611
- position: ControlPosition,
24612
- };*/
24825
+
24826
+ function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
24827
+
24828
+ function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
24829
+
24830
+ function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
24831
+
24832
+ function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
24833
+
24834
+ function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
24835
+
24836
+ function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
24837
+
24838
+ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
24839
+
24840
+ function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
24841
+
24842
+ function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
24843
+
24844
+ function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
24845
+
24846
+ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
24847
+
24848
+ function _iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"]; if (_i == null) return; var _arr = []; var _n = true; var _d = false; var _s, _e; try { for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; }
24849
+
24850
+ function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
24851
+
24852
+ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
24853
+
24854
+ function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
24855
+
24856
+ function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
24857
+
24858
+ function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) _setPrototypeOf(subClass, superClass); }
24859
+
24860
+ function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
24861
+
24862
+ function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
24863
+
24864
+ function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return _assertThisInitialized(self); }
24865
+
24866
+ function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
24867
+
24868
+ function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
24869
+
24870
+ function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
24871
+
24872
+ function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
24873
+
24613
24874
  //
24614
24875
  // Define <Draggable>
24615
24876
  //
24616
- class Draggable extends React.Component /*:: <DraggableProps, DraggableState>*/{
24617
- // React 16.3+
24618
- // Arity (props, state)
24619
- static getDerivedStateFromProps(_ref /*:: */, _ref2 /*:: */) /*: ?Partial<DraggableState>*/{
24620
- let {
24621
- position
24622
- } /*: DraggableProps*/ = _ref /*: DraggableProps*/;
24623
- let {
24624
- prevPropsPosition
24625
- } /*: DraggableState*/ = _ref2 /*: DraggableState*/;
24626
- // Set x/y if a new position is provided in props that is different than the previous.
24627
- if (position && (!prevPropsPosition || position.x !== prevPropsPosition.x || position.y !== prevPropsPosition.y)) {
24628
- (0, _log.default)('Draggable: getDerivedStateFromProps %j', {
24629
- position,
24630
- prevPropsPosition
24631
- });
24632
- return {
24633
- x: position.x,
24634
- y: position.y,
24635
- prevPropsPosition: {
24636
- ...position
24637
- }
24638
- };
24639
- }
24640
- return null;
24641
- }
24642
- constructor(props /*: DraggableProps*/) {
24643
- super(props);
24644
- _defineProperty(this, "onDragStart", (e, coreData) => {
24645
- (0, _log.default)('Draggable: onDragStart: %j', coreData);
24877
+ var Draggable = /*#__PURE__*/function (_React$Component) {
24878
+ _inherits(Draggable, _React$Component);
24879
+
24880
+ var _super = _createSuper(Draggable);
24881
+
24882
+ function Draggable(props
24883
+ /*: DraggableProps*/
24884
+ ) {
24885
+ var _this;
24886
+
24887
+ _classCallCheck(this, Draggable);
24888
+
24889
+ _this = _super.call(this, props);
24890
+
24891
+ _defineProperty(_assertThisInitialized(_this), "onDragStart", function (e, coreData) {
24892
+ (0, _log.default)('Draggable: onDragStart: %j', coreData); // Short-circuit if user's callback killed it.
24893
+
24894
+ var shouldStart = _this.props.onStart(e, (0, _positionFns.createDraggableData)(_assertThisInitialized(_this), coreData)); // Kills start event on core as well, so move handlers are never bound.
24895
+
24646
24896
 
24647
- // Short-circuit if user's callback killed it.
24648
- const shouldStart = this.props.onStart(e, (0, _positionFns.createDraggableData)(this, coreData));
24649
- // Kills start event on core as well, so move handlers are never bound.
24650
24897
  if (shouldStart === false) return false;
24651
- this.setState({
24898
+
24899
+ _this.setState({
24652
24900
  dragging: true,
24653
24901
  dragged: true
24654
24902
  });
24655
24903
  });
24656
- _defineProperty(this, "onDrag", (e, coreData) => {
24657
- if (!this.state.dragging) return false;
24904
+
24905
+ _defineProperty(_assertThisInitialized(_this), "onDrag", function (e, coreData) {
24906
+ if (!_this.state.dragging) return false;
24658
24907
  (0, _log.default)('Draggable: onDrag: %j', coreData);
24659
- const uiData = (0, _positionFns.createDraggableData)(this, coreData);
24660
- const newState = {
24908
+ var uiData = (0, _positionFns.createDraggableData)(_assertThisInitialized(_this), coreData);
24909
+ var newState
24910
+ /*: $Shape<DraggableState>*/
24911
+ = {
24661
24912
  x: uiData.x,
24662
- y: uiData.y,
24663
- slackX: 0,
24664
- slackY: 0
24665
- };
24913
+ y: uiData.y
24914
+ }; // Keep within bounds.
24666
24915
 
24667
- // Keep within bounds.
24668
- if (this.props.bounds) {
24916
+ if (_this.props.bounds) {
24669
24917
  // Save original x and y.
24670
- const {
24671
- x,
24672
- y
24673
- } = newState;
24674
-
24675
- // Add slack to the values used to calculate bound position. This will ensure that if
24918
+ var x = newState.x,
24919
+ y = newState.y; // Add slack to the values used to calculate bound position. This will ensure that if
24676
24920
  // we start removing slack, the element won't react to it right away until it's been
24677
24921
  // completely removed.
24678
- newState.x += this.state.slackX;
24679
- newState.y += this.state.slackY;
24680
24922
 
24681
- // Get bound position. This will ceil/floor the x and y within the boundaries.
24682
- const [newStateX, newStateY] = (0, _positionFns.getBoundPosition)(this, newState.x, newState.y);
24923
+ newState.x += _this.state.slackX;
24924
+ newState.y += _this.state.slackY; // Get bound position. This will ceil/floor the x and y within the boundaries.
24925
+
24926
+ var _getBoundPosition = (0, _positionFns.getBoundPosition)(_assertThisInitialized(_this), newState.x, newState.y),
24927
+ _getBoundPosition2 = _slicedToArray(_getBoundPosition, 2),
24928
+ newStateX = _getBoundPosition2[0],
24929
+ newStateY = _getBoundPosition2[1];
24930
+
24683
24931
  newState.x = newStateX;
24684
- newState.y = newStateY;
24932
+ newState.y = newStateY; // Recalculate slack by noting how much was shaved by the boundPosition handler.
24685
24933
 
24686
- // Recalculate slack by noting how much was shaved by the boundPosition handler.
24687
- newState.slackX = this.state.slackX + (x - newState.x);
24688
- newState.slackY = this.state.slackY + (y - newState.y);
24934
+ newState.slackX = _this.state.slackX + (x - newState.x);
24935
+ newState.slackY = _this.state.slackY + (y - newState.y); // Update the event we fire to reflect what really happened after bounds took effect.
24689
24936
 
24690
- // Update the event we fire to reflect what really happened after bounds took effect.
24691
24937
  uiData.x = newState.x;
24692
24938
  uiData.y = newState.y;
24693
- uiData.deltaX = newState.x - this.state.x;
24694
- uiData.deltaY = newState.y - this.state.y;
24695
- }
24939
+ uiData.deltaX = newState.x - _this.state.x;
24940
+ uiData.deltaY = newState.y - _this.state.y;
24941
+ } // Short-circuit if user's callback killed it.
24942
+
24943
+
24944
+ var shouldUpdate = _this.props.onDrag(e, uiData);
24696
24945
 
24697
- // Short-circuit if user's callback killed it.
24698
- const shouldUpdate = this.props.onDrag(e, uiData);
24699
24946
  if (shouldUpdate === false) return false;
24700
- this.setState(newState);
24947
+
24948
+ _this.setState(newState);
24701
24949
  });
24702
- _defineProperty(this, "onDragStop", (e, coreData) => {
24703
- if (!this.state.dragging) return false;
24704
24950
 
24705
- // Short-circuit if user's callback killed it.
24706
- const shouldContinue = this.props.onStop(e, (0, _positionFns.createDraggableData)(this, coreData));
24951
+ _defineProperty(_assertThisInitialized(_this), "onDragStop", function (e, coreData) {
24952
+ if (!_this.state.dragging) return false; // Short-circuit if user's callback killed it.
24953
+
24954
+ var shouldContinue = _this.props.onStop(e, (0, _positionFns.createDraggableData)(_assertThisInitialized(_this), coreData));
24955
+
24707
24956
  if (shouldContinue === false) return false;
24708
24957
  (0, _log.default)('Draggable: onDragStop: %j', coreData);
24709
- const newState /*: Partial<DraggableState>*/ = {
24958
+ var newState
24959
+ /*: $Shape<DraggableState>*/
24960
+ = {
24710
24961
  dragging: false,
24711
24962
  slackX: 0,
24712
24963
  slackY: 0
24713
- };
24714
-
24715
- // If this is a controlled component, the result of this operation will be to
24964
+ }; // If this is a controlled component, the result of this operation will be to
24716
24965
  // revert back to the old position. We expect a handler on `onDragStop`, at the least.
24717
- const controlled = Boolean(this.props.position);
24966
+
24967
+ var controlled = Boolean(_this.props.position);
24968
+
24718
24969
  if (controlled) {
24719
- const {
24720
- x,
24721
- y
24722
- } = this.props.position;
24970
+ var _this$props$position = _this.props.position,
24971
+ x = _this$props$position.x,
24972
+ y = _this$props$position.y;
24723
24973
  newState.x = x;
24724
24974
  newState.y = y;
24725
24975
  }
24726
- this.setState(newState);
24976
+
24977
+ _this.setState(newState);
24727
24978
  });
24728
- this.state = {
24979
+
24980
+ _this.state = {
24729
24981
  // Whether or not we are currently dragging.
24730
24982
  dragging: false,
24731
24983
  // Whether or not we have been dragged before.
@@ -24733,106 +24985,142 @@ class Draggable extends React.Component /*:: <DraggableProps, DraggableState>*/{
24733
24985
  // Current transform x and y.
24734
24986
  x: props.position ? props.position.x : props.defaultPosition.x,
24735
24987
  y: props.position ? props.position.y : props.defaultPosition.y,
24736
- prevPropsPosition: {
24737
- ...props.position
24738
- },
24988
+ prevPropsPosition: _objectSpread({}, props.position),
24739
24989
  // Used for compensating for out-of-bounds drags
24740
24990
  slackX: 0,
24741
24991
  slackY: 0,
24742
24992
  // Can only determine if SVG after mounting
24743
24993
  isElementSVG: false
24744
24994
  };
24995
+
24745
24996
  if (props.position && !(props.onDrag || props.onStop)) {
24746
24997
  // eslint-disable-next-line no-console
24747
24998
  console.warn('A `position` was applied to this <Draggable>, without drag handlers. This will make this ' + 'component effectively undraggable. Please attach `onDrag` or `onStop` handlers so you can adjust the ' + '`position` of this element.');
24748
24999
  }
25000
+
25001
+ return _this;
24749
25002
  }
24750
- componentDidMount() {
24751
- // Check to see if the element passed is an instanceof SVGElement
24752
- if (typeof window.SVGElement !== 'undefined' && this.findDOMNode() instanceof window.SVGElement) {
25003
+
25004
+ _createClass(Draggable, [{
25005
+ key: "componentDidMount",
25006
+ value: function componentDidMount() {
25007
+ // Check to see if the element passed is an instanceof SVGElement
25008
+ if (typeof window.SVGElement !== 'undefined' && this.findDOMNode() instanceof window.SVGElement) {
25009
+ this.setState({
25010
+ isElementSVG: true
25011
+ });
25012
+ }
25013
+ }
25014
+ }, {
25015
+ key: "componentWillUnmount",
25016
+ value: function componentWillUnmount() {
24753
25017
  this.setState({
24754
- isElementSVG: true
24755
- });
25018
+ dragging: false
25019
+ }); // prevents invariant if unmounted while dragging
25020
+ } // React Strict Mode compatibility: if `nodeRef` is passed, we will use it instead of trying to find
25021
+ // the underlying DOM node ourselves. See the README for more information.
25022
+
25023
+ }, {
25024
+ key: "findDOMNode",
25025
+ value: function findDOMNode()
25026
+ /*: ?HTMLElement*/
25027
+ {
25028
+ var _this$props$nodeRef$c, _this$props, _this$props$nodeRef;
25029
+
25030
+ return (_this$props$nodeRef$c = (_this$props = this.props) === null || _this$props === void 0 ? void 0 : (_this$props$nodeRef = _this$props.nodeRef) === null || _this$props$nodeRef === void 0 ? void 0 : _this$props$nodeRef.current) !== null && _this$props$nodeRef$c !== void 0 ? _this$props$nodeRef$c : _reactDom.default.findDOMNode(this);
24756
25031
  }
24757
- }
24758
- componentWillUnmount() {
24759
- this.setState({
24760
- dragging: false
24761
- }); // prevents invariant if unmounted while dragging
24762
- }
25032
+ }, {
25033
+ key: "render",
25034
+ value: function render()
25035
+ /*: ReactElement<any>*/
25036
+ {
25037
+ var _clsx;
24763
25038
 
24764
- // React Strict Mode compatibility: if `nodeRef` is passed, we will use it instead of trying to find
24765
- // the underlying DOM node ourselves. See the README for more information.
24766
- findDOMNode() /*: ?HTMLElement*/{
24767
- var _this$props$nodeRef$c, _this$props;
24768
- return (_this$props$nodeRef$c = (_this$props = this.props) === null || _this$props === void 0 || (_this$props = _this$props.nodeRef) === null || _this$props === void 0 ? void 0 : _this$props.current) !== null && _this$props$nodeRef$c !== void 0 ? _this$props$nodeRef$c : _reactDom.default.findDOMNode(this);
24769
- }
24770
- render() /*: ReactElement<any>*/{
24771
- const {
24772
- axis,
24773
- bounds,
24774
- children,
24775
- defaultPosition,
24776
- defaultClassName,
24777
- defaultClassNameDragging,
24778
- defaultClassNameDragged,
24779
- position,
24780
- positionOffset,
24781
- scale,
24782
- ...draggableCoreProps
24783
- } = this.props;
24784
- let style = {};
24785
- let svgTransform = null;
24786
-
24787
- // If this is controlled, we don't want to move it - unless it's dragging.
24788
- const controlled = Boolean(position);
24789
- const draggable = !controlled || this.state.dragging;
24790
- const validPosition = position || defaultPosition;
24791
- const transformOpts = {
24792
- // Set left if horizontal drag is enabled
24793
- x: (0, _positionFns.canDragX)(this) && draggable ? this.state.x : validPosition.x,
24794
- // Set top if vertical drag is enabled
24795
- y: (0, _positionFns.canDragY)(this) && draggable ? this.state.y : validPosition.y
24796
- };
25039
+ var _this$props2 = this.props,
25040
+ axis = _this$props2.axis,
25041
+ bounds = _this$props2.bounds,
25042
+ children = _this$props2.children,
25043
+ defaultPosition = _this$props2.defaultPosition,
25044
+ defaultClassName = _this$props2.defaultClassName,
25045
+ defaultClassNameDragging = _this$props2.defaultClassNameDragging,
25046
+ defaultClassNameDragged = _this$props2.defaultClassNameDragged,
25047
+ position = _this$props2.position,
25048
+ positionOffset = _this$props2.positionOffset,
25049
+ scale = _this$props2.scale,
25050
+ draggableCoreProps = _objectWithoutProperties(_this$props2, _excluded);
25051
+
25052
+ var style = {};
25053
+ var svgTransform = null; // If this is controlled, we don't want to move it - unless it's dragging.
25054
+
25055
+ var controlled = Boolean(position);
25056
+ var draggable = !controlled || this.state.dragging;
25057
+ var validPosition = position || defaultPosition;
25058
+ var transformOpts = {
25059
+ // Set left if horizontal drag is enabled
25060
+ x: (0, _positionFns.canDragX)(this) && draggable ? this.state.x : validPosition.x,
25061
+ // Set top if vertical drag is enabled
25062
+ y: (0, _positionFns.canDragY)(this) && draggable ? this.state.y : validPosition.y
25063
+ }; // If this element was SVG, we use the `transform` attribute.
25064
+
25065
+ if (this.state.isElementSVG) {
25066
+ svgTransform = (0, _domFns.createSVGTransform)(transformOpts, positionOffset);
25067
+ } else {
25068
+ // Add a CSS transform to move the element around. This allows us to move the element around
25069
+ // without worrying about whether or not it is relatively or absolutely positioned.
25070
+ // If the item you are dragging already has a transform set, wrap it in a <span> so <Draggable>
25071
+ // has a clean slate.
25072
+ style = (0, _domFns.createCSSTransform)(transformOpts, positionOffset);
25073
+ } // Mark with class while dragging
25074
+
25075
+
25076
+ var className = (0, _clsx2.default)(children.props.className || '', defaultClassName, (_clsx = {}, _defineProperty(_clsx, defaultClassNameDragging, this.state.dragging), _defineProperty(_clsx, defaultClassNameDragged, this.state.dragged), _clsx)); // Reuse the child provided
25077
+ // This makes it flexible to use whatever element is wanted (div, ul, etc)
25078
+
25079
+ return /*#__PURE__*/React.createElement(_DraggableCore.default, _extends({}, draggableCoreProps, {
25080
+ onStart: this.onDragStart,
25081
+ onDrag: this.onDrag,
25082
+ onStop: this.onDragStop
25083
+ }), /*#__PURE__*/React.cloneElement(React.Children.only(children), {
25084
+ className: className,
25085
+ style: _objectSpread(_objectSpread({}, children.props.style), style),
25086
+ transform: svgTransform
25087
+ }));
25088
+ }
25089
+ }], [{
25090
+ key: "getDerivedStateFromProps",
25091
+ value: // React 16.3+
25092
+ // Arity (props, state)
25093
+ function getDerivedStateFromProps(_ref, _ref2)
25094
+ /*: ?$Shape<DraggableState>*/
25095
+ {
25096
+ var position = _ref.position;
25097
+ var prevPropsPosition = _ref2.prevPropsPosition;
25098
+
25099
+ // Set x/y if a new position is provided in props that is different than the previous.
25100
+ if (position && (!prevPropsPosition || position.x !== prevPropsPosition.x || position.y !== prevPropsPosition.y)) {
25101
+ (0, _log.default)('Draggable: getDerivedStateFromProps %j', {
25102
+ position: position,
25103
+ prevPropsPosition: prevPropsPosition
25104
+ });
25105
+ return {
25106
+ x: position.x,
25107
+ y: position.y,
25108
+ prevPropsPosition: _objectSpread({}, position)
25109
+ };
25110
+ }
24797
25111
 
24798
- // If this element was SVG, we use the `transform` attribute.
24799
- if (this.state.isElementSVG) {
24800
- svgTransform = (0, _domFns.createSVGTransform)(transformOpts, positionOffset);
24801
- } else {
24802
- // Add a CSS transform to move the element around. This allows us to move the element around
24803
- // without worrying about whether or not it is relatively or absolutely positioned.
24804
- // If the item you are dragging already has a transform set, wrap it in a <span> so <Draggable>
24805
- // has a clean slate.
24806
- style = (0, _domFns.createCSSTransform)(transformOpts, positionOffset);
25112
+ return null;
24807
25113
  }
25114
+ }]);
24808
25115
 
24809
- // Mark with class while dragging
24810
- const className = (0, _clsx.default)(children.props.className || '', defaultClassName, {
24811
- [defaultClassNameDragging]: this.state.dragging,
24812
- [defaultClassNameDragged]: this.state.dragged
24813
- });
25116
+ return Draggable;
25117
+ }(React.Component);
24814
25118
 
24815
- // Reuse the child provided
24816
- // This makes it flexible to use whatever element is wanted (div, ul, etc)
24817
- return /*#__PURE__*/React.createElement(_DraggableCore.default, _extends({}, draggableCoreProps, {
24818
- onStart: this.onDragStart,
24819
- onDrag: this.onDrag,
24820
- onStop: this.onDragStop
24821
- }), /*#__PURE__*/React.cloneElement(React.Children.only(children), {
24822
- className: className,
24823
- style: {
24824
- ...children.props.style,
24825
- ...style
24826
- },
24827
- transform: svgTransform
24828
- }));
24829
- }
24830
- }
24831
25119
  exports.default = Draggable;
25120
+
24832
25121
  _defineProperty(Draggable, "displayName", 'Draggable');
24833
- _defineProperty(Draggable, "propTypes", {
24834
- // Accepts all props <DraggableCore> accepts.
24835
- ..._DraggableCore.default.propTypes,
25122
+
25123
+ _defineProperty(Draggable, "propTypes", _objectSpread(_objectSpread({}, _DraggableCore.default.propTypes), {}, {
24836
25124
  /**
24837
25125
  * `axis` determines which axis the draggable can move.
24838
25126
  *
@@ -24847,6 +25135,7 @@ _defineProperty(Draggable, "propTypes", {
24847
25135
  * Defaults to 'both'.
24848
25136
  */
24849
25137
  axis: _propTypes.default.oneOf(['both', 'x', 'y', 'none']),
25138
+
24850
25139
  /**
24851
25140
  * `bounds` determines the range of movement available to the element.
24852
25141
  * Available values are:
@@ -24882,6 +25171,7 @@ _defineProperty(Draggable, "propTypes", {
24882
25171
  defaultClassName: _propTypes.default.string,
24883
25172
  defaultClassNameDragging: _propTypes.default.string,
24884
25173
  defaultClassNameDragged: _propTypes.default.string,
25174
+
24885
25175
  /**
24886
25176
  * `defaultPosition` specifies the x and y that the dragged item should start at
24887
25177
  *
@@ -24907,6 +25197,7 @@ _defineProperty(Draggable, "propTypes", {
24907
25197
  x: _propTypes.default.oneOfType([_propTypes.default.number, _propTypes.default.string]),
24908
25198
  y: _propTypes.default.oneOfType([_propTypes.default.number, _propTypes.default.string])
24909
25199
  }),
25200
+
24910
25201
  /**
24911
25202
  * `position`, if present, defines the current position of the element.
24912
25203
  *
@@ -24931,15 +25222,16 @@ _defineProperty(Draggable, "propTypes", {
24931
25222
  x: _propTypes.default.number,
24932
25223
  y: _propTypes.default.number
24933
25224
  }),
25225
+
24934
25226
  /**
24935
25227
  * These properties should be defined on the child, not here.
24936
25228
  */
24937
25229
  className: _shims.dontSetMe,
24938
25230
  style: _shims.dontSetMe,
24939
25231
  transform: _shims.dontSetMe
24940
- });
24941
- _defineProperty(Draggable, "defaultProps", {
24942
- ..._DraggableCore.default.defaultProps,
25232
+ }));
25233
+
25234
+ _defineProperty(Draggable, "defaultProps", _objectSpread(_objectSpread({}, _DraggableCore.default.defaultProps), {}, {
24943
25235
  axis: 'both',
24944
25236
  bounds: false,
24945
25237
  defaultClassName: 'react-draggable',
@@ -24950,7 +25242,7 @@ _defineProperty(Draggable, "defaultProps", {
24950
25242
  y: 0
24951
25243
  },
24952
25244
  scale: 1
24953
- });
25245
+ }));
24954
25246
 
24955
25247
  /***/ }),
24956
25248
  /* 421 */
@@ -24975,34 +25267,61 @@ exports.browserPrefixToKey = browserPrefixToKey;
24975
25267
  exports.browserPrefixToStyle = browserPrefixToStyle;
24976
25268
  exports.default = void 0;
24977
25269
  exports.getPrefix = getPrefix;
24978
- const prefixes = ['Moz', 'Webkit', 'O', 'ms'];
24979
- function getPrefix() /*: string*/{
24980
- var _window$document;
24981
- let prop /*: string*/ = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'transform';
25270
+ var prefixes = ['Moz', 'Webkit', 'O', 'ms'];
25271
+
25272
+ function getPrefix()
25273
+ /*: string*/
25274
+ {
25275
+ var _window$document, _window$document$docu;
25276
+
25277
+ var prop
25278
+ /*: string*/
25279
+ = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'transform';
24982
25280
  // Ensure we're running in an environment where there is actually a global
24983
25281
  // `window` obj
24984
- if (typeof window === 'undefined') return '';
24985
-
24986
- // If we're in a pseudo-browser server-side environment, this access
25282
+ if (typeof window === 'undefined') return ''; // If we're in a pseudo-browser server-side environment, this access
24987
25283
  // path may not exist, so bail out if it doesn't.
24988
- const style = (_window$document = window.document) === null || _window$document === void 0 || (_window$document = _window$document.documentElement) === null || _window$document === void 0 ? void 0 : _window$document.style;
25284
+
25285
+ var style = (_window$document = window.document) === null || _window$document === void 0 ? void 0 : (_window$document$docu = _window$document.documentElement) === null || _window$document$docu === void 0 ? void 0 : _window$document$docu.style;
24989
25286
  if (!style) return '';
24990
25287
  if (prop in style) return '';
24991
- for (let i = 0; i < prefixes.length; i++) {
25288
+
25289
+ for (var i = 0; i < prefixes.length; i++) {
24992
25290
  if (browserPrefixToKey(prop, prefixes[i]) in style) return prefixes[i];
24993
25291
  }
25292
+
24994
25293
  return '';
24995
25294
  }
24996
- function browserPrefixToKey(prop /*: string*/, prefix /*: string*/) /*: string*/{
25295
+
25296
+ function browserPrefixToKey(prop
25297
+ /*: string*/
25298
+ , prefix
25299
+ /*: string*/
25300
+ )
25301
+ /*: string*/
25302
+ {
24997
25303
  return prefix ? "".concat(prefix).concat(kebabToTitleCase(prop)) : prop;
24998
25304
  }
24999
- function browserPrefixToStyle(prop /*: string*/, prefix /*: string*/) /*: string*/{
25305
+
25306
+ function browserPrefixToStyle(prop
25307
+ /*: string*/
25308
+ , prefix
25309
+ /*: string*/
25310
+ )
25311
+ /*: string*/
25312
+ {
25000
25313
  return prefix ? "-".concat(prefix.toLowerCase(), "-").concat(prop) : prop;
25001
25314
  }
25002
- function kebabToTitleCase(str /*: string*/) /*: string*/{
25003
- let out = '';
25004
- let shouldCapitalize = true;
25005
- for (let i = 0; i < str.length; i++) {
25315
+
25316
+ function kebabToTitleCase(str
25317
+ /*: string*/
25318
+ )
25319
+ /*: string*/
25320
+ {
25321
+ var out = '';
25322
+ var shouldCapitalize = true;
25323
+
25324
+ for (var i = 0; i < str.length; i++) {
25006
25325
  if (shouldCapitalize) {
25007
25326
  out += str[i].toUpperCase();
25008
25327
  shouldCapitalize = false;
@@ -25012,13 +25331,18 @@ function kebabToTitleCase(str /*: string*/) /*: string*/{
25012
25331
  out += str[i];
25013
25332
  }
25014
25333
  }
25015
- return out;
25016
- }
25017
25334
 
25018
- // Default export is the prefix itself, like 'Moz', 'Webkit', etc
25335
+ return out;
25336
+ } // Default export is the prefix itself, like 'Moz', 'Webkit', etc
25019
25337
  // Note that you may have to re-test for certain things; for instance, Chrome 50
25020
25338
  // can handle unprefixed `transform`, but not unprefixed `user-select`
25021
- var _default = exports.default = (getPrefix() /*: string*/);
25339
+
25340
+
25341
+ var _default = (getPrefix()
25342
+ /*: string*/
25343
+ );
25344
+
25345
+ exports.default = _default;
25022
25346
 
25023
25347
  /***/ }),
25024
25348
  /* 423 */
@@ -25027,27 +25351,69 @@ var _default = exports.default = (getPrefix() /*: string*/);
25027
25351
  "use strict";
25028
25352
 
25029
25353
 
25354
+ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
25355
+
25030
25356
  Object.defineProperty(exports, "__esModule", {
25031
25357
  value: true
25032
25358
  });
25033
25359
  exports.default = void 0;
25360
+
25034
25361
  var React = _interopRequireWildcard(__webpack_require__(0));
25362
+
25035
25363
  var _propTypes = _interopRequireDefault(__webpack_require__(1));
25364
+
25036
25365
  var _reactDom = _interopRequireDefault(__webpack_require__(38));
25366
+
25037
25367
  var _domFns = __webpack_require__(138);
25368
+
25038
25369
  var _positionFns = __webpack_require__(210);
25370
+
25039
25371
  var _shims = __webpack_require__(108);
25372
+
25040
25373
  var _log = _interopRequireDefault(__webpack_require__(211));
25374
+
25041
25375
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
25042
- function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
25043
- function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
25044
- function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
25045
- function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return typeof key === "symbol" ? key : String(key); }
25046
- function _toPrimitive(input, hint) { if (typeof input !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (typeof res !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
25047
- /*:: import type {EventHandler, MouseTouchEvent} from './utils/types';*/
25048
- /*:: import type {Element as ReactElement} from 'react';*/
25376
+
25377
+ function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
25378
+
25379
+ function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
25380
+
25381
+ function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
25382
+
25383
+ function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
25384
+
25385
+ function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
25386
+
25387
+ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
25388
+
25389
+ function _iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"]; if (_i == null) return; var _arr = []; var _n = true; var _d = false; var _s, _e; try { for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; }
25390
+
25391
+ function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
25392
+
25393
+ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
25394
+
25395
+ function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
25396
+
25397
+ function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
25398
+
25399
+ function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) _setPrototypeOf(subClass, superClass); }
25400
+
25401
+ function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
25402
+
25403
+ function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
25404
+
25405
+ function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return _assertThisInitialized(self); }
25406
+
25407
+ function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
25408
+
25409
+ function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
25410
+
25411
+ function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
25412
+
25413
+ function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
25414
+
25049
25415
  // Simple abstraction for dragging events names.
25050
- const eventsFor = {
25416
+ var eventsFor = {
25051
25417
  touch: {
25052
25418
  start: 'touchstart',
25053
25419
  move: 'touchmove',
@@ -25058,19 +25424,29 @@ const eventsFor = {
25058
25424
  move: 'mousemove',
25059
25425
  stop: 'mouseup'
25060
25426
  }
25061
- };
25427
+ }; // Default to mouse events.
25428
+
25429
+ var dragEventFor = eventsFor.mouse;
25430
+ /*:: type DraggableCoreState = {
25431
+ dragging: boolean,
25432
+ lastX: number,
25433
+ lastY: number,
25434
+ touchIdentifier: ?number
25435
+ };*/
25062
25436
 
25063
- // Default to mouse events.
25064
- let dragEventFor = eventsFor.mouse;
25065
25437
  /*:: export type DraggableData = {
25066
25438
  node: HTMLElement,
25067
25439
  x: number, y: number,
25068
25440
  deltaX: number, deltaY: number,
25069
25441
  lastX: number, lastY: number,
25070
25442
  };*/
25443
+
25071
25444
  /*:: export type DraggableEventHandler = (e: MouseEvent, data: DraggableData) => void | false;*/
25445
+
25072
25446
  /*:: export type ControlPosition = {x: number, y: number};*/
25447
+
25073
25448
  /*:: export type PositionOffsetControlPosition = {x: number|string, y: number|string};*/
25449
+
25074
25450
  /*:: export type DraggableCoreDefaultProps = {
25075
25451
  allowAnyClick: boolean,
25076
25452
  disabled: boolean,
@@ -25081,6 +25457,7 @@ let dragEventFor = eventsFor.mouse;
25081
25457
  onMouseDown: (e: MouseEvent) => void,
25082
25458
  scale: number,
25083
25459
  };*/
25460
+
25084
25461
  /*:: export type DraggableCoreProps = {
25085
25462
  ...DraggableCoreDefaultProps,
25086
25463
  cancel: string,
@@ -25090,240 +25467,305 @@ let dragEventFor = eventsFor.mouse;
25090
25467
  handle: string,
25091
25468
  nodeRef?: ?React.ElementRef<any>,
25092
25469
  };*/
25470
+
25093
25471
  //
25094
25472
  // Define <DraggableCore>.
25095
25473
  //
25096
25474
  // <DraggableCore> is for advanced usage of <Draggable>. It maintains minimal internal state so it can
25097
25475
  // work well with libraries that require more control over the element.
25098
25476
  //
25477
+ var DraggableCore = /*#__PURE__*/function (_React$Component) {
25478
+ _inherits(DraggableCore, _React$Component);
25099
25479
 
25100
- class DraggableCore extends React.Component /*:: <DraggableCoreProps>*/{
25101
- constructor() {
25102
- super(...arguments);
25103
- _defineProperty(this, "dragging", false);
25104
- // Used while dragging to determine deltas.
25105
- _defineProperty(this, "lastX", NaN);
25106
- _defineProperty(this, "lastY", NaN);
25107
- _defineProperty(this, "touchIdentifier", null);
25108
- _defineProperty(this, "mounted", false);
25109
- _defineProperty(this, "handleDragStart", e => {
25480
+ var _super = _createSuper(DraggableCore);
25481
+
25482
+ function DraggableCore() {
25483
+ var _this;
25484
+
25485
+ _classCallCheck(this, DraggableCore);
25486
+
25487
+ for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
25488
+ args[_key] = arguments[_key];
25489
+ }
25490
+
25491
+ _this = _super.call.apply(_super, [this].concat(args));
25492
+
25493
+ _defineProperty(_assertThisInitialized(_this), "state", {
25494
+ dragging: false,
25495
+ // Used while dragging to determine deltas.
25496
+ lastX: NaN,
25497
+ lastY: NaN,
25498
+ touchIdentifier: null
25499
+ });
25500
+
25501
+ _defineProperty(_assertThisInitialized(_this), "mounted", false);
25502
+
25503
+ _defineProperty(_assertThisInitialized(_this), "handleDragStart", function (e) {
25110
25504
  // Make it possible to attach event handlers on top of this one.
25111
- this.props.onMouseDown(e);
25505
+ _this.props.onMouseDown(e); // Only accept left-clicks.
25506
+
25112
25507
 
25113
- // Only accept left-clicks.
25114
- if (!this.props.allowAnyClick && typeof e.button === 'number' && e.button !== 0) return false;
25508
+ if (!_this.props.allowAnyClick && typeof e.button === 'number' && e.button !== 0) return false; // Get nodes. Be sure to grab relative document (could be iframed)
25509
+
25510
+ var thisNode = _this.findDOMNode();
25115
25511
 
25116
- // Get nodes. Be sure to grab relative document (could be iframed)
25117
- const thisNode = this.findDOMNode();
25118
25512
  if (!thisNode || !thisNode.ownerDocument || !thisNode.ownerDocument.body) {
25119
25513
  throw new Error('<DraggableCore> not mounted on DragStart!');
25120
25514
  }
25121
- const {
25122
- ownerDocument
25123
- } = thisNode;
25124
25515
 
25125
- // Short circuit if handle or cancel prop was provided and selector doesn't match.
25126
- if (this.props.disabled || !(e.target instanceof ownerDocument.defaultView.Node) || this.props.handle && !(0, _domFns.matchesSelectorAndParentsTo)(e.target, this.props.handle, thisNode) || this.props.cancel && (0, _domFns.matchesSelectorAndParentsTo)(e.target, this.props.cancel, thisNode)) {
25127
- return;
25128
- }
25516
+ var ownerDocument = thisNode.ownerDocument; // Short circuit if handle or cancel prop was provided and selector doesn't match.
25129
25517
 
25130
- // Prevent scrolling on mobile devices, like ipad/iphone.
25518
+ if (_this.props.disabled || !(e.target instanceof ownerDocument.defaultView.Node) || _this.props.handle && !(0, _domFns.matchesSelectorAndParentsTo)(e.target, _this.props.handle, thisNode) || _this.props.cancel && (0, _domFns.matchesSelectorAndParentsTo)(e.target, _this.props.cancel, thisNode)) {
25519
+ return;
25520
+ } // Prevent scrolling on mobile devices, like ipad/iphone.
25131
25521
  // Important that this is after handle/cancel.
25132
- if (e.type === 'touchstart') e.preventDefault();
25133
25522
 
25134
- // Set touch identifier in component state if this is a touch event. This allows us to
25523
+
25524
+ if (e.type === 'touchstart') e.preventDefault(); // Set touch identifier in component state if this is a touch event. This allows us to
25135
25525
  // distinguish between individual touches on multitouch screens by identifying which
25136
25526
  // touchpoint was set to this element.
25137
- const touchIdentifier = (0, _domFns.getTouchIdentifier)(e);
25138
- this.touchIdentifier = touchIdentifier;
25139
25527
 
25140
- // Get the current drag point from the event. This is used as the offset.
25141
- const position = (0, _positionFns.getControlPosition)(e, touchIdentifier, this);
25528
+ var touchIdentifier = (0, _domFns.getTouchIdentifier)(e);
25529
+
25530
+ _this.setState({
25531
+ touchIdentifier: touchIdentifier
25532
+ }); // Get the current drag point from the event. This is used as the offset.
25533
+
25534
+
25535
+ var position = (0, _positionFns.getControlPosition)(e, touchIdentifier, _assertThisInitialized(_this));
25142
25536
  if (position == null) return; // not possible but satisfies flow
25143
- const {
25144
- x,
25145
- y
25146
- } = position;
25147
25537
 
25148
- // Create an event object with all the data parents need to make a decision here.
25149
- const coreEvent = (0, _positionFns.createCoreData)(this, x, y);
25150
- (0, _log.default)('DraggableCore: handleDragStart: %j', coreEvent);
25538
+ var x = position.x,
25539
+ y = position.y; // Create an event object with all the data parents need to make a decision here.
25540
+
25541
+ var coreEvent = (0, _positionFns.createCoreData)(_assertThisInitialized(_this), x, y);
25542
+ (0, _log.default)('DraggableCore: handleDragStart: %j', coreEvent); // Call event handler. If it returns explicit false, cancel.
25543
+
25544
+ (0, _log.default)('calling', _this.props.onStart);
25151
25545
 
25152
- // Call event handler. If it returns explicit false, cancel.
25153
- (0, _log.default)('calling', this.props.onStart);
25154
- const shouldUpdate = this.props.onStart(e, coreEvent);
25155
- if (shouldUpdate === false || this.mounted === false) return;
25546
+ var shouldUpdate = _this.props.onStart(e, coreEvent);
25156
25547
 
25157
- // Add a style to the body to disable user-select. This prevents text from
25548
+ if (shouldUpdate === false || _this.mounted === false) return; // Add a style to the body to disable user-select. This prevents text from
25158
25549
  // being selected all over the page.
25159
- if (this.props.enableUserSelectHack) (0, _domFns.addUserSelectStyles)(ownerDocument);
25160
25550
 
25161
- // Initiate dragging. Set the current x and y as offsets
25551
+ if (_this.props.enableUserSelectHack) (0, _domFns.addUserSelectStyles)(ownerDocument); // Initiate dragging. Set the current x and y as offsets
25162
25552
  // so we know how much we've moved during the drag. This allows us
25163
25553
  // to drag elements around even if they have been moved, without issue.
25164
- this.dragging = true;
25165
- this.lastX = x;
25166
- this.lastY = y;
25167
25554
 
25168
- // Add events to the document directly so we catch when the user's mouse/touch moves outside of
25555
+ _this.setState({
25556
+ dragging: true,
25557
+ lastX: x,
25558
+ lastY: y
25559
+ }); // Add events to the document directly so we catch when the user's mouse/touch moves outside of
25169
25560
  // this element. We use different events depending on whether or not we have detected that this
25170
25561
  // is a touch-capable device.
25171
- (0, _domFns.addEvent)(ownerDocument, dragEventFor.move, this.handleDrag);
25172
- (0, _domFns.addEvent)(ownerDocument, dragEventFor.stop, this.handleDragStop);
25562
+
25563
+
25564
+ (0, _domFns.addEvent)(ownerDocument, dragEventFor.move, _this.handleDrag);
25565
+ (0, _domFns.addEvent)(ownerDocument, dragEventFor.stop, _this.handleDragStop);
25173
25566
  });
25174
- _defineProperty(this, "handleDrag", e => {
25567
+
25568
+ _defineProperty(_assertThisInitialized(_this), "handleDrag", function (e) {
25175
25569
  // Get the current drag point from the event. This is used as the offset.
25176
- const position = (0, _positionFns.getControlPosition)(e, this.touchIdentifier, this);
25570
+ var position = (0, _positionFns.getControlPosition)(e, _this.state.touchIdentifier, _assertThisInitialized(_this));
25177
25571
  if (position == null) return;
25178
- let {
25179
- x,
25180
- y
25181
- } = position;
25182
-
25183
- // Snap to grid if prop has been provided
25184
- if (Array.isArray(this.props.grid)) {
25185
- let deltaX = x - this.lastX,
25186
- deltaY = y - this.lastY;
25187
- [deltaX, deltaY] = (0, _positionFns.snapToGrid)(this.props.grid, deltaX, deltaY);
25572
+ var x = position.x,
25573
+ y = position.y; // Snap to grid if prop has been provided
25574
+
25575
+ if (Array.isArray(_this.props.grid)) {
25576
+ var deltaX = x - _this.state.lastX,
25577
+ deltaY = y - _this.state.lastY;
25578
+
25579
+ var _snapToGrid = (0, _positionFns.snapToGrid)(_this.props.grid, deltaX, deltaY);
25580
+
25581
+ var _snapToGrid2 = _slicedToArray(_snapToGrid, 2);
25582
+
25583
+ deltaX = _snapToGrid2[0];
25584
+ deltaY = _snapToGrid2[1];
25188
25585
  if (!deltaX && !deltaY) return; // skip useless drag
25189
- x = this.lastX + deltaX, y = this.lastY + deltaY;
25586
+
25587
+ x = _this.state.lastX + deltaX, y = _this.state.lastY + deltaY;
25190
25588
  }
25191
- const coreEvent = (0, _positionFns.createCoreData)(this, x, y);
25192
- (0, _log.default)('DraggableCore: handleDrag: %j', coreEvent);
25193
25589
 
25194
- // Call event handler. If it returns explicit false, trigger end.
25195
- const shouldUpdate = this.props.onDrag(e, coreEvent);
25196
- if (shouldUpdate === false || this.mounted === false) {
25590
+ var coreEvent = (0, _positionFns.createCoreData)(_assertThisInitialized(_this), x, y);
25591
+ (0, _log.default)('DraggableCore: handleDrag: %j', coreEvent); // Call event handler. If it returns explicit false, trigger end.
25592
+
25593
+ var shouldUpdate = _this.props.onDrag(e, coreEvent);
25594
+
25595
+ if (shouldUpdate === false || _this.mounted === false) {
25197
25596
  try {
25198
25597
  // $FlowIgnore
25199
- this.handleDragStop(new MouseEvent('mouseup'));
25598
+ _this.handleDragStop(new MouseEvent('mouseup'));
25200
25599
  } catch (err) {
25201
25600
  // Old browsers
25202
- const event = ((document.createEvent('MouseEvents') /*: any*/) /*: MouseTouchEvent*/);
25203
- // I see why this insanity was deprecated
25601
+ var event = ((document.createEvent('MouseEvents')
25602
+ /*: any*/
25603
+ )
25604
+ /*: MouseTouchEvent*/
25605
+ ); // I see why this insanity was deprecated
25204
25606
  // $FlowIgnore
25607
+
25205
25608
  event.initMouseEvent('mouseup', true, true, window, 0, 0, 0, 0, 0, false, false, false, false, 0, null);
25206
- this.handleDragStop(event);
25609
+
25610
+ _this.handleDragStop(event);
25207
25611
  }
25612
+
25208
25613
  return;
25209
25614
  }
25210
- this.lastX = x;
25211
- this.lastY = y;
25615
+
25616
+ _this.setState({
25617
+ lastX: x,
25618
+ lastY: y
25619
+ });
25212
25620
  });
25213
- _defineProperty(this, "handleDragStop", e => {
25214
- if (!this.dragging) return;
25215
- const position = (0, _positionFns.getControlPosition)(e, this.touchIdentifier, this);
25621
+
25622
+ _defineProperty(_assertThisInitialized(_this), "handleDragStop", function (e) {
25623
+ if (!_this.state.dragging) return;
25624
+ var position = (0, _positionFns.getControlPosition)(e, _this.state.touchIdentifier, _assertThisInitialized(_this));
25216
25625
  if (position == null) return;
25217
- let {
25218
- x,
25219
- y
25220
- } = position;
25221
-
25222
- // Snap to grid if prop has been provided
25223
- if (Array.isArray(this.props.grid)) {
25224
- let deltaX = x - this.lastX || 0;
25225
- let deltaY = y - this.lastY || 0;
25226
- [deltaX, deltaY] = (0, _positionFns.snapToGrid)(this.props.grid, deltaX, deltaY);
25227
- x = this.lastX + deltaX, y = this.lastY + deltaY;
25228
- }
25229
- const coreEvent = (0, _positionFns.createCoreData)(this, x, y);
25230
-
25231
- // Call event handler
25232
- const shouldContinue = this.props.onStop(e, coreEvent);
25233
- if (shouldContinue === false || this.mounted === false) return false;
25234
- const thisNode = this.findDOMNode();
25626
+ var x = position.x,
25627
+ y = position.y; // Snap to grid if prop has been provided
25628
+
25629
+ if (Array.isArray(_this.props.grid)) {
25630
+ var deltaX = x - _this.state.lastX || 0;
25631
+ var deltaY = y - _this.state.lastY || 0;
25632
+
25633
+ var _snapToGrid3 = (0, _positionFns.snapToGrid)(_this.props.grid, deltaX, deltaY);
25634
+
25635
+ var _snapToGrid4 = _slicedToArray(_snapToGrid3, 2);
25636
+
25637
+ deltaX = _snapToGrid4[0];
25638
+ deltaY = _snapToGrid4[1];
25639
+ x = _this.state.lastX + deltaX, y = _this.state.lastY + deltaY;
25640
+ }
25641
+
25642
+ var coreEvent = (0, _positionFns.createCoreData)(_assertThisInitialized(_this), x, y); // Call event handler
25643
+
25644
+ var shouldContinue = _this.props.onStop(e, coreEvent);
25645
+
25646
+ if (shouldContinue === false || _this.mounted === false) return false;
25647
+
25648
+ var thisNode = _this.findDOMNode();
25649
+
25235
25650
  if (thisNode) {
25236
25651
  // Remove user-select hack
25237
- if (this.props.enableUserSelectHack) (0, _domFns.removeUserSelectStyles)(thisNode.ownerDocument);
25652
+ if (_this.props.enableUserSelectHack) (0, _domFns.removeUserSelectStyles)(thisNode.ownerDocument);
25238
25653
  }
25239
- (0, _log.default)('DraggableCore: handleDragStop: %j', coreEvent);
25240
25654
 
25241
- // Reset the el.
25242
- this.dragging = false;
25243
- this.lastX = NaN;
25244
- this.lastY = NaN;
25655
+ (0, _log.default)('DraggableCore: handleDragStop: %j', coreEvent); // Reset the el.
25656
+
25657
+ _this.setState({
25658
+ dragging: false,
25659
+ lastX: NaN,
25660
+ lastY: NaN
25661
+ });
25662
+
25245
25663
  if (thisNode) {
25246
25664
  // Remove event handlers
25247
25665
  (0, _log.default)('DraggableCore: Removing handlers');
25248
- (0, _domFns.removeEvent)(thisNode.ownerDocument, dragEventFor.move, this.handleDrag);
25249
- (0, _domFns.removeEvent)(thisNode.ownerDocument, dragEventFor.stop, this.handleDragStop);
25666
+ (0, _domFns.removeEvent)(thisNode.ownerDocument, dragEventFor.move, _this.handleDrag);
25667
+ (0, _domFns.removeEvent)(thisNode.ownerDocument, dragEventFor.stop, _this.handleDragStop);
25250
25668
  }
25251
25669
  });
25252
- _defineProperty(this, "onMouseDown", e => {
25670
+
25671
+ _defineProperty(_assertThisInitialized(_this), "onMouseDown", function (e) {
25253
25672
  dragEventFor = eventsFor.mouse; // on touchscreen laptops we could switch back to mouse
25254
25673
 
25255
- return this.handleDragStart(e);
25674
+ return _this.handleDragStart(e);
25256
25675
  });
25257
- _defineProperty(this, "onMouseUp", e => {
25676
+
25677
+ _defineProperty(_assertThisInitialized(_this), "onMouseUp", function (e) {
25258
25678
  dragEventFor = eventsFor.mouse;
25259
- return this.handleDragStop(e);
25679
+ return _this.handleDragStop(e);
25260
25680
  });
25261
- // Same as onMouseDown (start drag), but now consider this a touch device.
25262
- _defineProperty(this, "onTouchStart", e => {
25681
+
25682
+ _defineProperty(_assertThisInitialized(_this), "onTouchStart", function (e) {
25263
25683
  // We're on a touch device now, so change the event handlers
25264
25684
  dragEventFor = eventsFor.touch;
25265
- return this.handleDragStart(e);
25685
+ return _this.handleDragStart(e);
25266
25686
  });
25267
- _defineProperty(this, "onTouchEnd", e => {
25687
+
25688
+ _defineProperty(_assertThisInitialized(_this), "onTouchEnd", function (e) {
25268
25689
  // We're on a touch device now, so change the event handlers
25269
25690
  dragEventFor = eventsFor.touch;
25270
- return this.handleDragStop(e);
25691
+ return _this.handleDragStop(e);
25271
25692
  });
25693
+
25694
+ return _this;
25272
25695
  }
25273
- componentDidMount() {
25274
- this.mounted = true;
25275
- // Touch handlers must be added with {passive: false} to be cancelable.
25276
- // https://developers.google.com/web/updates/2017/01/scrolling-intervention
25277
- const thisNode = this.findDOMNode();
25278
- if (thisNode) {
25279
- (0, _domFns.addEvent)(thisNode, eventsFor.touch.start, this.onTouchStart, {
25280
- passive: false
25281
- });
25696
+
25697
+ _createClass(DraggableCore, [{
25698
+ key: "componentDidMount",
25699
+ value: function componentDidMount() {
25700
+ this.mounted = true; // Touch handlers must be added with {passive: false} to be cancelable.
25701
+ // https://developers.google.com/web/updates/2017/01/scrolling-intervention
25702
+
25703
+ var thisNode = this.findDOMNode();
25704
+
25705
+ if (thisNode) {
25706
+ (0, _domFns.addEvent)(thisNode, eventsFor.touch.start, this.onTouchStart, {
25707
+ passive: false
25708
+ });
25709
+ }
25282
25710
  }
25283
- }
25284
- componentWillUnmount() {
25285
- this.mounted = false;
25286
- // Remove any leftover event handlers. Remove both touch and mouse handlers in case
25287
- // some browser quirk caused a touch event to fire during a mouse move, or vice versa.
25288
- const thisNode = this.findDOMNode();
25289
- if (thisNode) {
25290
- const {
25291
- ownerDocument
25292
- } = thisNode;
25293
- (0, _domFns.removeEvent)(ownerDocument, eventsFor.mouse.move, this.handleDrag);
25294
- (0, _domFns.removeEvent)(ownerDocument, eventsFor.touch.move, this.handleDrag);
25295
- (0, _domFns.removeEvent)(ownerDocument, eventsFor.mouse.stop, this.handleDragStop);
25296
- (0, _domFns.removeEvent)(ownerDocument, eventsFor.touch.stop, this.handleDragStop);
25297
- (0, _domFns.removeEvent)(thisNode, eventsFor.touch.start, this.onTouchStart, {
25298
- passive: false
25711
+ }, {
25712
+ key: "componentWillUnmount",
25713
+ value: function componentWillUnmount() {
25714
+ this.mounted = false; // Remove any leftover event handlers. Remove both touch and mouse handlers in case
25715
+ // some browser quirk caused a touch event to fire during a mouse move, or vice versa.
25716
+
25717
+ var thisNode = this.findDOMNode();
25718
+
25719
+ if (thisNode) {
25720
+ var ownerDocument = thisNode.ownerDocument;
25721
+ (0, _domFns.removeEvent)(ownerDocument, eventsFor.mouse.move, this.handleDrag);
25722
+ (0, _domFns.removeEvent)(ownerDocument, eventsFor.touch.move, this.handleDrag);
25723
+ (0, _domFns.removeEvent)(ownerDocument, eventsFor.mouse.stop, this.handleDragStop);
25724
+ (0, _domFns.removeEvent)(ownerDocument, eventsFor.touch.stop, this.handleDragStop);
25725
+ (0, _domFns.removeEvent)(thisNode, eventsFor.touch.start, this.onTouchStart, {
25726
+ passive: false
25727
+ });
25728
+ if (this.props.enableUserSelectHack) (0, _domFns.removeUserSelectStyles)(ownerDocument);
25729
+ }
25730
+ } // React Strict Mode compatibility: if `nodeRef` is passed, we will use it instead of trying to find
25731
+ // the underlying DOM node ourselves. See the README for more information.
25732
+
25733
+ }, {
25734
+ key: "findDOMNode",
25735
+ value: function findDOMNode()
25736
+ /*: ?HTMLElement*/
25737
+ {
25738
+ var _this$props, _this$props2, _this$props2$nodeRef;
25739
+
25740
+ return (_this$props = this.props) !== null && _this$props !== void 0 && _this$props.nodeRef ? (_this$props2 = this.props) === null || _this$props2 === void 0 ? void 0 : (_this$props2$nodeRef = _this$props2.nodeRef) === null || _this$props2$nodeRef === void 0 ? void 0 : _this$props2$nodeRef.current : _reactDom.default.findDOMNode(this);
25741
+ }
25742
+ }, {
25743
+ key: "render",
25744
+ value: function render()
25745
+ /*: React.Element<any>*/
25746
+ {
25747
+ // Reuse the child provided
25748
+ // This makes it flexible to use whatever element is wanted (div, ul, etc)
25749
+ return /*#__PURE__*/React.cloneElement(React.Children.only(this.props.children), {
25750
+ // Note: mouseMove handler is attached to document so it will still function
25751
+ // when the user drags quickly and leaves the bounds of the element.
25752
+ onMouseDown: this.onMouseDown,
25753
+ onMouseUp: this.onMouseUp,
25754
+ // onTouchStart is added on `componentDidMount` so they can be added with
25755
+ // {passive: false}, which allows it to cancel. See
25756
+ // https://developers.google.com/web/updates/2017/01/scrolling-intervention
25757
+ onTouchEnd: this.onTouchEnd
25299
25758
  });
25300
- if (this.props.enableUserSelectHack) (0, _domFns.removeUserSelectStyles)(ownerDocument);
25301
- }
25302
- }
25303
-
25304
- // React Strict Mode compatibility: if `nodeRef` is passed, we will use it instead of trying to find
25305
- // the underlying DOM node ourselves. See the README for more information.
25306
- findDOMNode() /*: ?HTMLElement*/{
25307
- var _this$props, _this$props2;
25308
- return (_this$props = this.props) !== null && _this$props !== void 0 && _this$props.nodeRef ? (_this$props2 = this.props) === null || _this$props2 === void 0 || (_this$props2 = _this$props2.nodeRef) === null || _this$props2 === void 0 ? void 0 : _this$props2.current : _reactDom.default.findDOMNode(this);
25309
- }
25310
- render() /*: React.Element<any>*/{
25311
- // Reuse the child provided
25312
- // This makes it flexible to use whatever element is wanted (div, ul, etc)
25313
- return /*#__PURE__*/React.cloneElement(React.Children.only(this.props.children), {
25314
- // Note: mouseMove handler is attached to document so it will still function
25315
- // when the user drags quickly and leaves the bounds of the element.
25316
- onMouseDown: this.onMouseDown,
25317
- onMouseUp: this.onMouseUp,
25318
- // onTouchStart is added on `componentDidMount` so they can be added with
25319
- // {passive: false}, which allows it to cancel. See
25320
- // https://developers.google.com/web/updates/2017/01/scrolling-intervention
25321
- onTouchEnd: this.onTouchEnd
25322
- });
25323
- }
25324
- }
25759
+ }
25760
+ }]);
25761
+
25762
+ return DraggableCore;
25763
+ }(React.Component);
25764
+
25325
25765
  exports.default = DraggableCore;
25766
+
25326
25767
  _defineProperty(DraggableCore, "displayName", 'DraggableCore');
25768
+
25327
25769
  _defineProperty(DraggableCore, "propTypes", {
25328
25770
  /**
25329
25771
  * `allowAnyClick` allows dragging using any mouse button.
@@ -25332,31 +25774,39 @@ _defineProperty(DraggableCore, "propTypes", {
25332
25774
  * Defaults to `false`.
25333
25775
  */
25334
25776
  allowAnyClick: _propTypes.default.bool,
25335
- children: _propTypes.default.node.isRequired,
25777
+
25336
25778
  /**
25337
25779
  * `disabled`, if true, stops the <Draggable> from dragging. All handlers,
25338
25780
  * with the exception of `onMouseDown`, will not fire.
25339
25781
  */
25340
25782
  disabled: _propTypes.default.bool,
25783
+
25341
25784
  /**
25342
25785
  * By default, we add 'user-select:none' attributes to the document body
25343
25786
  * to prevent ugly text selection during drag. If this is causing problems
25344
25787
  * for your app, set this to `false`.
25345
25788
  */
25346
25789
  enableUserSelectHack: _propTypes.default.bool,
25790
+
25347
25791
  /**
25348
25792
  * `offsetParent`, if set, uses the passed DOM node to compute drag offsets
25349
25793
  * instead of using the parent node.
25350
25794
  */
25351
- offsetParent: function (props /*: DraggableCoreProps*/, propName /*: $Keys<DraggableCoreProps>*/) {
25795
+ offsetParent: function offsetParent(props
25796
+ /*: DraggableCoreProps*/
25797
+ , propName
25798
+ /*: $Keys<DraggableCoreProps>*/
25799
+ ) {
25352
25800
  if (props[propName] && props[propName].nodeType !== 1) {
25353
25801
  throw new Error('Draggable\'s offsetParent must be a DOM Node.');
25354
25802
  }
25355
25803
  },
25804
+
25356
25805
  /**
25357
25806
  * `grid` specifies the x and y that dragging should snap to.
25358
25807
  */
25359
25808
  grid: _propTypes.default.arrayOf(_propTypes.default.number),
25809
+
25360
25810
  /**
25361
25811
  * `handle` specifies a selector to be used as the handle that initiates drag.
25362
25812
  *
@@ -25378,6 +25828,7 @@ _defineProperty(DraggableCore, "propTypes", {
25378
25828
  * ```
25379
25829
  */
25380
25830
  handle: _propTypes.default.string,
25831
+
25381
25832
  /**
25382
25833
  * `cancel` specifies a selector to be used to prevent drag initialization.
25383
25834
  *
@@ -25399,6 +25850,7 @@ _defineProperty(DraggableCore, "propTypes", {
25399
25850
  * ```
25400
25851
  */
25401
25852
  cancel: _propTypes.default.string,
25853
+
25402
25854
  /* If running in React Strict mode, ReactDOM.findDOMNode() is deprecated.
25403
25855
  * Unfortunately, in order for <Draggable> to work properly, we need raw access
25404
25856
  * to the underlying DOM node. If you want to avoid the warning, pass a `nodeRef`
@@ -25417,30 +25869,36 @@ _defineProperty(DraggableCore, "propTypes", {
25417
25869
  * pointing to the actual child DOM node and not a custom component.
25418
25870
  */
25419
25871
  nodeRef: _propTypes.default.object,
25872
+
25420
25873
  /**
25421
25874
  * Called when dragging starts.
25422
25875
  * If this function returns the boolean false, dragging will be canceled.
25423
25876
  */
25424
25877
  onStart: _propTypes.default.func,
25878
+
25425
25879
  /**
25426
25880
  * Called while dragging.
25427
25881
  * If this function returns the boolean false, dragging will be canceled.
25428
25882
  */
25429
25883
  onDrag: _propTypes.default.func,
25884
+
25430
25885
  /**
25431
25886
  * Called when dragging stops.
25432
25887
  * If this function returns the boolean false, the drag will remain active.
25433
25888
  */
25434
25889
  onStop: _propTypes.default.func,
25890
+
25435
25891
  /**
25436
25892
  * A workaround option which can be passed if onMouseDown needs to be accessed,
25437
25893
  * since it'll always be blocked (as there is internal use of onMouseDown)
25438
25894
  */
25439
25895
  onMouseDown: _propTypes.default.func,
25896
+
25440
25897
  /**
25441
25898
  * `scale`, if set, applies scaling while dragging an element
25442
25899
  */
25443
25900
  scale: _propTypes.default.number,
25901
+
25444
25902
  /**
25445
25903
  * These properties should be defined on the child, not here.
25446
25904
  */
@@ -25448,15 +25906,16 @@ _defineProperty(DraggableCore, "propTypes", {
25448
25906
  style: _shims.dontSetMe,
25449
25907
  transform: _shims.dontSetMe
25450
25908
  });
25909
+
25451
25910
  _defineProperty(DraggableCore, "defaultProps", {
25452
25911
  allowAnyClick: false,
25453
25912
  // by default only accept left click
25454
25913
  disabled: false,
25455
25914
  enableUserSelectHack: true,
25456
- onStart: function () {},
25457
- onDrag: function () {},
25458
- onStop: function () {},
25459
- onMouseDown: function () {},
25915
+ onStart: function onStart() {},
25916
+ onDrag: function onDrag() {},
25917
+ onStop: function onStop() {},
25918
+ onMouseDown: function onMouseDown() {},
25460
25919
  scale: 1
25461
25920
  });
25462
25921
 
@@ -56476,8 +56935,7 @@ var sisccTheme = function sisccTheme(_ref) {
56476
56935
  share: {
56477
56936
  title: {
56478
56937
  fontWeight: 400,
56479
- fontFamily: "'Roboto Slab', serif",
56480
- fontSize: 18
56938
+ fontFamily: "'Roboto Slab', serif"
56481
56939
  }
56482
56940
  },
56483
56941
  spotlight: {