victory-group 36.9.2-next.1 → 36.9.2-next.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +4 -3
- package/dist/victory-group.js +300 -198
- package/dist/victory-group.min.js +1 -1
- package/package.json +4 -4
package/CHANGELOG.md
CHANGED
|
@@ -1,18 +1,19 @@
|
|
|
1
1
|
# victory-group
|
|
2
2
|
|
|
3
|
-
## 36.9.2-next.
|
|
3
|
+
## 36.9.2-next.3
|
|
4
4
|
|
|
5
5
|
### Patch Changes
|
|
6
6
|
|
|
7
7
|
- Updated dependencies [7da790934]
|
|
8
8
|
- Updated dependencies [3f2da66e3]
|
|
9
9
|
- Updated dependencies [c13308624]
|
|
10
|
+
- Updated dependencies [65d02419f]
|
|
10
11
|
- Updated dependencies [7efd582cc]
|
|
11
12
|
- Updated dependencies [9cdaf2c08]
|
|
12
13
|
- Updated dependencies [f6f7cc515]
|
|
13
14
|
- Updated dependencies [6e34169a5]
|
|
14
|
-
- victory-core@36.9.2-next.
|
|
15
|
-
- victory-shared-events@36.9.2-next.
|
|
15
|
+
- victory-core@36.9.2-next.3
|
|
16
|
+
- victory-shared-events@36.9.2-next.3
|
|
16
17
|
|
|
17
18
|
## 36.9.1
|
|
18
19
|
|
package/dist/victory-group.js
CHANGED
|
@@ -5434,203 +5434,259 @@ module.exports = function isEqual(a, b) {
|
|
|
5434
5434
|
"use strict";
|
|
5435
5435
|
__webpack_require__.r(__webpack_exports__);
|
|
5436
5436
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
5437
|
-
/* harmony export */ "VictoryContainer": () => (/* binding */ VictoryContainer)
|
|
5438
|
-
/* harmony export */ "useVictoryContainer": () => (/* binding */ useVictoryContainer)
|
|
5437
|
+
/* harmony export */ "VictoryContainer": () => (/* binding */ VictoryContainer)
|
|
5439
5438
|
/* harmony export */ });
|
|
5440
|
-
/* harmony import */ var
|
|
5441
|
-
/* harmony import */ var
|
|
5442
|
-
/* harmony import */ var
|
|
5443
|
-
/* harmony import */ var
|
|
5444
|
-
/* harmony import */ var
|
|
5445
|
-
/* harmony import */ var
|
|
5446
|
-
/* harmony import */ var
|
|
5447
|
-
/* harmony import */ var
|
|
5439
|
+
/* harmony import */ var lodash_isObject__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! lodash/isObject */ "../../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/isObject.js");
|
|
5440
|
+
/* harmony import */ var lodash_isObject__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(lodash_isObject__WEBPACK_IMPORTED_MODULE_0__);
|
|
5441
|
+
/* harmony import */ var lodash_uniqueId__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! lodash/uniqueId */ "../../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/uniqueId.js");
|
|
5442
|
+
/* harmony import */ var lodash_uniqueId__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(lodash_uniqueId__WEBPACK_IMPORTED_MODULE_1__);
|
|
5443
|
+
/* harmony import */ var lodash_defaults__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! lodash/defaults */ "../../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/defaults.js");
|
|
5444
|
+
/* harmony import */ var lodash_defaults__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(lodash_defaults__WEBPACK_IMPORTED_MODULE_2__);
|
|
5445
|
+
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! react */ "react");
|
|
5446
|
+
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_3__);
|
|
5447
|
+
/* harmony import */ var _victory_portal_portal__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../victory-portal/portal */ "../../victory-core/es/victory-portal/portal.js");
|
|
5448
|
+
/* harmony import */ var _victory_portal_portal_context__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../victory-portal/portal-context */ "../../victory-core/es/victory-portal/portal-context.js");
|
|
5449
|
+
/* harmony import */ var _victory_util_timer_context__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../victory-util/timer-context */ "../../victory-core/es/victory-util/timer-context.js");
|
|
5450
|
+
/* harmony import */ var _victory_util_helpers__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../victory-util/helpers */ "../../victory-core/es/victory-util/helpers.js");
|
|
5451
|
+
/* harmony import */ var _victory_util_user_props__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../victory-util/user-props */ "../../victory-core/es/victory-util/user-props.js");
|
|
5452
|
+
|
|
5453
|
+
|
|
5448
5454
|
|
|
5449
5455
|
|
|
5450
5456
|
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); }
|
|
5451
5457
|
|
|
5452
|
-
function
|
|
5458
|
+
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; }
|
|
5453
5459
|
|
|
5454
|
-
function
|
|
5460
|
+
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; }
|
|
5455
5461
|
|
|
5456
|
-
function
|
|
5462
|
+
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; }
|
|
5457
5463
|
|
|
5458
|
-
function
|
|
5464
|
+
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
5459
5465
|
|
|
5460
|
-
function
|
|
5466
|
+
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); } }
|
|
5461
5467
|
|
|
5462
|
-
function
|
|
5468
|
+
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
|
|
5463
5469
|
|
|
5464
|
-
function
|
|
5470
|
+
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); }
|
|
5465
5471
|
|
|
5466
|
-
function
|
|
5472
|
+
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
|
|
5467
5473
|
|
|
5468
|
-
function
|
|
5474
|
+
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); }; }
|
|
5469
5475
|
|
|
5476
|
+
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); }
|
|
5470
5477
|
|
|
5478
|
+
function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
|
|
5471
5479
|
|
|
5480
|
+
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; } }
|
|
5472
5481
|
|
|
5482
|
+
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
|
|
5473
5483
|
|
|
5474
5484
|
|
|
5475
|
-
var defaultProps = {
|
|
5476
|
-
className: "VictoryContainer",
|
|
5477
|
-
portalComponent: /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement(_victory_portal_portal__WEBPACK_IMPORTED_MODULE_2__.Portal, null),
|
|
5478
|
-
portalZIndex: 99,
|
|
5479
|
-
responsive: true,
|
|
5480
|
-
role: "img"
|
|
5481
|
-
};
|
|
5482
|
-
function useVictoryContainer(initialProps) {
|
|
5483
|
-
var props = _objectSpread(_objectSpread({}, defaultProps), initialProps);
|
|
5484
5485
|
|
|
5485
|
-
var title = props.title,
|
|
5486
|
-
desc = props.desc,
|
|
5487
|
-
width = props.width,
|
|
5488
|
-
height = props.height,
|
|
5489
|
-
responsive = props.responsive;
|
|
5490
|
-
var localContainerRef = (0,react__WEBPACK_IMPORTED_MODULE_1__.useRef)(null);
|
|
5491
5486
|
|
|
5492
|
-
var _React$useState = react__WEBPACK_IMPORTED_MODULE_1___default().useState(),
|
|
5493
|
-
_React$useState2 = _slicedToArray(_React$useState, 2),
|
|
5494
|
-
portalElement = _React$useState2[0],
|
|
5495
|
-
setPortalElement = _React$useState2[1];
|
|
5496
5487
|
|
|
5497
|
-
var portalRef = function (element) {
|
|
5498
|
-
return setPortalElement(element);
|
|
5499
|
-
}; // Generated ID stored in ref because it needs to persist across renders
|
|
5500
5488
|
|
|
5501
5489
|
|
|
5502
|
-
|
|
5503
|
-
|
|
5490
|
+
var VictoryContainer = /*#__PURE__*/function (_React$Component) {
|
|
5491
|
+
_inherits(VictoryContainer, _React$Component);
|
|
5504
5492
|
|
|
5505
|
-
var
|
|
5506
|
-
return "".concat(containerId, "-").concat(elName);
|
|
5507
|
-
};
|
|
5493
|
+
var _super = _createSuper(VictoryContainer);
|
|
5508
5494
|
|
|
5509
|
-
|
|
5510
|
-
|
|
5511
|
-
|
|
5512
|
-
|
|
5513
|
-
|
|
5514
|
-
|
|
5515
|
-
|
|
5516
|
-
|
|
5517
|
-
|
|
5518
|
-
|
|
5519
|
-
|
|
5520
|
-
|
|
5521
|
-
|
|
5522
|
-
|
|
5523
|
-
|
|
5524
|
-
|
|
5525
|
-
|
|
5526
|
-
|
|
5527
|
-
|
|
5528
|
-
|
|
5529
|
-
|
|
5530
|
-
|
|
5531
|
-
|
|
5532
|
-
|
|
5533
|
-
|
|
5534
|
-
|
|
5535
|
-
|
|
5536
|
-
|
|
5537
|
-
|
|
5538
|
-
|
|
5539
|
-
|
|
5540
|
-
|
|
5541
|
-
|
|
5542
|
-
|
|
5543
|
-
|
|
5544
|
-
|
|
5545
|
-
|
|
5546
|
-
|
|
5547
|
-
|
|
5548
|
-
|
|
5549
|
-
tabIndex = _useVictoryContainer.tabIndex,
|
|
5550
|
-
responsive = _useVictoryContainer.responsive,
|
|
5551
|
-
events = _useVictoryContainer.events,
|
|
5552
|
-
ouiaId = _useVictoryContainer.ouiaId,
|
|
5553
|
-
ouiaSafe = _useVictoryContainer.ouiaSafe,
|
|
5554
|
-
ouiaType = _useVictoryContainer.ouiaType,
|
|
5555
|
-
dimensions = _useVictoryContainer.dimensions,
|
|
5556
|
-
ariaDescribedBy = _useVictoryContainer.ariaDescribedBy,
|
|
5557
|
-
ariaLabelledBy = _useVictoryContainer.ariaLabelledBy,
|
|
5558
|
-
viewBox = _useVictoryContainer.viewBox,
|
|
5559
|
-
preserveAspectRatio = _useVictoryContainer.preserveAspectRatio,
|
|
5560
|
-
userProps = _useVictoryContainer.userProps,
|
|
5561
|
-
titleId = _useVictoryContainer.titleId,
|
|
5562
|
-
descId = _useVictoryContainer.descId,
|
|
5563
|
-
portalElement = _useVictoryContainer.portalElement,
|
|
5564
|
-
portalRef = _useVictoryContainer.portalRef,
|
|
5565
|
-
containerRef = _useVictoryContainer.containerRef,
|
|
5566
|
-
localContainerRef = _useVictoryContainer.localContainerRef;
|
|
5567
|
-
|
|
5568
|
-
react__WEBPACK_IMPORTED_MODULE_1___default().useEffect(function () {
|
|
5569
|
-
// TODO check that this works
|
|
5570
|
-
if (!(events !== null && events !== void 0 && events.onWheel)) return;
|
|
5571
|
-
|
|
5572
|
-
var handleWheel = function (e) {
|
|
5495
|
+
// @ts-expect-error Ref will be initialized on mount
|
|
5496
|
+
// @ts-expect-error Ref will be initialized on mount
|
|
5497
|
+
function VictoryContainer(props) {
|
|
5498
|
+
var _this;
|
|
5499
|
+
|
|
5500
|
+
_classCallCheck(this, VictoryContainer);
|
|
5501
|
+
|
|
5502
|
+
_this = _super.call(this, props);
|
|
5503
|
+
_this.containerId = void 0;
|
|
5504
|
+
_this.portalRef = void 0;
|
|
5505
|
+
_this.containerRef = void 0;
|
|
5506
|
+
_this.shouldHandleWheel = void 0;
|
|
5507
|
+
|
|
5508
|
+
_this.savePortalRef = function (portal) {
|
|
5509
|
+
_this.portalRef = portal;
|
|
5510
|
+
return portal;
|
|
5511
|
+
};
|
|
5512
|
+
|
|
5513
|
+
_this.portalUpdate = function (key, el) {
|
|
5514
|
+
return _this.portalRef.portalUpdate(key, el);
|
|
5515
|
+
};
|
|
5516
|
+
|
|
5517
|
+
_this.portalRegister = function () {
|
|
5518
|
+
return _this.portalRef.portalRegister();
|
|
5519
|
+
};
|
|
5520
|
+
|
|
5521
|
+
_this.portalDeregister = function (key) {
|
|
5522
|
+
return _this.portalRef.portalDeregister(key);
|
|
5523
|
+
};
|
|
5524
|
+
|
|
5525
|
+
_this.saveContainerRef = function (container) {
|
|
5526
|
+
if (_victory_util_helpers__WEBPACK_IMPORTED_MODULE_4__.isFunction(_this.props.containerRef)) {
|
|
5527
|
+
_this.props.containerRef(container);
|
|
5528
|
+
}
|
|
5529
|
+
|
|
5530
|
+
_this.containerRef = container;
|
|
5531
|
+
return container;
|
|
5532
|
+
};
|
|
5533
|
+
|
|
5534
|
+
_this.handleWheel = function (e) {
|
|
5573
5535
|
return e.preventDefault();
|
|
5574
5536
|
};
|
|
5575
5537
|
|
|
5576
|
-
|
|
5577
|
-
|
|
5578
|
-
return
|
|
5579
|
-
|
|
5580
|
-
|
|
5581
|
-
|
|
5582
|
-
|
|
5583
|
-
value: {
|
|
5584
|
-
|
|
5538
|
+
_this.containerId = !lodash_isObject__WEBPACK_IMPORTED_MODULE_0___default()(props) || props.containerId === undefined ? lodash_uniqueId__WEBPACK_IMPORTED_MODULE_1___default()("victory-container-") : props.containerId;
|
|
5539
|
+
_this.shouldHandleWheel = !!(props && props.events && props.events.onWheel);
|
|
5540
|
+
return _this;
|
|
5541
|
+
}
|
|
5542
|
+
|
|
5543
|
+
_createClass(VictoryContainer, [{
|
|
5544
|
+
key: "componentDidMount",
|
|
5545
|
+
value: function componentDidMount() {
|
|
5546
|
+
if (this.shouldHandleWheel && this.containerRef) {
|
|
5547
|
+
this.containerRef.addEventListener("wheel", this.handleWheel);
|
|
5548
|
+
}
|
|
5585
5549
|
}
|
|
5586
|
-
},
|
|
5587
|
-
|
|
5588
|
-
|
|
5589
|
-
|
|
5590
|
-
|
|
5591
|
-
|
|
5592
|
-
|
|
5593
|
-
|
|
5594
|
-
|
|
5595
|
-
|
|
5596
|
-
|
|
5597
|
-
|
|
5598
|
-
|
|
5599
|
-
},
|
|
5600
|
-
|
|
5601
|
-
|
|
5602
|
-
|
|
5603
|
-
|
|
5604
|
-
|
|
5605
|
-
|
|
5606
|
-
|
|
5607
|
-
|
|
5608
|
-
|
|
5609
|
-
|
|
5610
|
-
|
|
5611
|
-
|
|
5612
|
-
|
|
5613
|
-
|
|
5614
|
-
|
|
5615
|
-
|
|
5616
|
-
|
|
5617
|
-
|
|
5618
|
-
|
|
5619
|
-
|
|
5620
|
-
|
|
5621
|
-
|
|
5622
|
-
|
|
5623
|
-
|
|
5624
|
-
|
|
5625
|
-
|
|
5626
|
-
|
|
5627
|
-
|
|
5628
|
-
|
|
5629
|
-
|
|
5630
|
-
|
|
5631
|
-
|
|
5632
|
-
|
|
5550
|
+
}, {
|
|
5551
|
+
key: "componentWillUnmount",
|
|
5552
|
+
value: function componentWillUnmount() {
|
|
5553
|
+
if (this.shouldHandleWheel && this.containerRef) {
|
|
5554
|
+
this.containerRef.removeEventListener("wheel", this.handleWheel);
|
|
5555
|
+
}
|
|
5556
|
+
}
|
|
5557
|
+
}, {
|
|
5558
|
+
key: "getIdForElement",
|
|
5559
|
+
value: function getIdForElement(elementName) {
|
|
5560
|
+
return "".concat(this.containerId, "-").concat(elementName);
|
|
5561
|
+
} // overridden in custom containers
|
|
5562
|
+
|
|
5563
|
+
}, {
|
|
5564
|
+
key: "getChildren",
|
|
5565
|
+
value: function getChildren(props) {
|
|
5566
|
+
return props.children;
|
|
5567
|
+
} // Get props defined by the Open UI Automation (OUIA) 1.0-RC spec
|
|
5568
|
+
// See https://ouia.readthedocs.io/en/latest/README.html#ouia-component
|
|
5569
|
+
|
|
5570
|
+
}, {
|
|
5571
|
+
key: "getOUIAProps",
|
|
5572
|
+
value: function getOUIAProps(props) {
|
|
5573
|
+
var ouiaId = props.ouiaId,
|
|
5574
|
+
ouiaSafe = props.ouiaSafe,
|
|
5575
|
+
ouiaType = props.ouiaType;
|
|
5576
|
+
return _objectSpread(_objectSpread(_objectSpread({}, ouiaId && {
|
|
5577
|
+
"data-ouia-component-id": ouiaId
|
|
5578
|
+
}), ouiaType && {
|
|
5579
|
+
"data-ouia-component-type": ouiaType
|
|
5580
|
+
}), ouiaSafe !== undefined && {
|
|
5581
|
+
"data-ouia-safe": ouiaSafe
|
|
5582
|
+
});
|
|
5583
|
+
}
|
|
5584
|
+
}, {
|
|
5585
|
+
key: "renderContainer",
|
|
5586
|
+
value: function renderContainer(props, svgProps, style) {
|
|
5587
|
+
var title = props.title,
|
|
5588
|
+
desc = props.desc,
|
|
5589
|
+
portalComponent = props.portalComponent,
|
|
5590
|
+
className = props.className,
|
|
5591
|
+
width = props.width,
|
|
5592
|
+
height = props.height,
|
|
5593
|
+
portalZIndex = props.portalZIndex,
|
|
5594
|
+
responsive = props.responsive;
|
|
5595
|
+
var children = this.getChildren(props);
|
|
5596
|
+
var dimensions = responsive ? {
|
|
5597
|
+
width: "100%",
|
|
5598
|
+
height: "100%"
|
|
5599
|
+
} : {
|
|
5600
|
+
width: width,
|
|
5601
|
+
height: height
|
|
5602
|
+
};
|
|
5603
|
+
var divStyle = Object.assign({
|
|
5604
|
+
pointerEvents: "none",
|
|
5605
|
+
touchAction: "none",
|
|
5606
|
+
position: "relative"
|
|
5607
|
+
}, dimensions);
|
|
5608
|
+
var portalDivStyle = Object.assign({
|
|
5609
|
+
zIndex: portalZIndex,
|
|
5610
|
+
position: "absolute",
|
|
5611
|
+
top: 0,
|
|
5612
|
+
left: 0
|
|
5613
|
+
}, dimensions);
|
|
5614
|
+
var svgStyle = Object.assign({
|
|
5615
|
+
pointerEvents: "all"
|
|
5616
|
+
}, dimensions);
|
|
5617
|
+
var portalSvgStyle = Object.assign({
|
|
5618
|
+
overflow: "visible"
|
|
5619
|
+
}, dimensions);
|
|
5620
|
+
var portalProps = {
|
|
5621
|
+
width: width,
|
|
5622
|
+
height: height,
|
|
5623
|
+
viewBox: svgProps.viewBox,
|
|
5624
|
+
preserveAspectRatio: svgProps.preserveAspectRatio,
|
|
5625
|
+
style: portalSvgStyle
|
|
5626
|
+
};
|
|
5627
|
+
return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_3___default().createElement(_victory_portal_portal_context__WEBPACK_IMPORTED_MODULE_5__.PortalContext.Provider, {
|
|
5628
|
+
value: {
|
|
5629
|
+
portalUpdate: this.portalUpdate,
|
|
5630
|
+
portalRegister: this.portalRegister,
|
|
5631
|
+
portalDeregister: this.portalDeregister
|
|
5632
|
+
}
|
|
5633
|
+
}, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_3___default().createElement("div", _extends({
|
|
5634
|
+
style: lodash_defaults__WEBPACK_IMPORTED_MODULE_2___default()({}, style, divStyle),
|
|
5635
|
+
className: className,
|
|
5636
|
+
ref: this.saveContainerRef
|
|
5637
|
+
}, this.getOUIAProps(props)), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_3___default().createElement("svg", _extends({}, svgProps, {
|
|
5638
|
+
style: svgStyle
|
|
5639
|
+
}), title ? /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_3___default().createElement("title", {
|
|
5640
|
+
id: this.getIdForElement("title")
|
|
5641
|
+
}, title) : null, desc ? /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_3___default().createElement("desc", {
|
|
5642
|
+
id: this.getIdForElement("desc")
|
|
5643
|
+
}, desc) : null, children), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_3___default().createElement("div", {
|
|
5644
|
+
style: portalDivStyle
|
|
5645
|
+
}, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_3___default().cloneElement(portalComponent, _objectSpread(_objectSpread({}, portalProps), {}, {
|
|
5646
|
+
ref: this.savePortalRef
|
|
5647
|
+
})))));
|
|
5648
|
+
}
|
|
5649
|
+
}, {
|
|
5650
|
+
key: "render",
|
|
5651
|
+
value: function render() {
|
|
5652
|
+
var _this$props = this.props,
|
|
5653
|
+
width = _this$props.width,
|
|
5654
|
+
height = _this$props.height,
|
|
5655
|
+
responsive = _this$props.responsive,
|
|
5656
|
+
events = _this$props.events,
|
|
5657
|
+
title = _this$props.title,
|
|
5658
|
+
desc = _this$props.desc,
|
|
5659
|
+
tabIndex = _this$props.tabIndex,
|
|
5660
|
+
preserveAspectRatio = _this$props.preserveAspectRatio,
|
|
5661
|
+
role = _this$props.role;
|
|
5662
|
+
var style = responsive ? this.props.style : _victory_util_helpers__WEBPACK_IMPORTED_MODULE_4__.omit(this.props.style, ["height", "width"]);
|
|
5663
|
+
var userProps = _victory_util_user_props__WEBPACK_IMPORTED_MODULE_6__.getSafeUserProps(this.props);
|
|
5664
|
+
var svgProps = Object.assign(_objectSpread({
|
|
5665
|
+
width: width,
|
|
5666
|
+
height: height,
|
|
5667
|
+
tabIndex: tabIndex,
|
|
5668
|
+
role: role,
|
|
5669
|
+
"aria-labelledby": [title && this.getIdForElement("title"), this.props["aria-labelledby"]].filter(Boolean).join(" ") || undefined,
|
|
5670
|
+
"aria-describedby": [desc && this.getIdForElement("desc"), this.props["aria-describedby"]].filter(Boolean).join(" ") || undefined,
|
|
5671
|
+
viewBox: responsive ? "0 0 ".concat(width, " ").concat(height) : undefined,
|
|
5672
|
+
preserveAspectRatio: responsive ? preserveAspectRatio : undefined
|
|
5673
|
+
}, userProps), events);
|
|
5674
|
+
return this.renderContainer(this.props, svgProps, style);
|
|
5675
|
+
}
|
|
5676
|
+
}]);
|
|
5677
|
+
|
|
5678
|
+
return VictoryContainer;
|
|
5679
|
+
}((react__WEBPACK_IMPORTED_MODULE_3___default().Component));
|
|
5680
|
+
VictoryContainer.displayName = "VictoryContainer";
|
|
5633
5681
|
VictoryContainer.role = "container";
|
|
5682
|
+
VictoryContainer.defaultProps = {
|
|
5683
|
+
className: "VictoryContainer",
|
|
5684
|
+
portalComponent: /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_3___default().createElement(_victory_portal_portal__WEBPACK_IMPORTED_MODULE_7__.Portal, null),
|
|
5685
|
+
portalZIndex: 99,
|
|
5686
|
+
responsive: true,
|
|
5687
|
+
role: "img"
|
|
5688
|
+
};
|
|
5689
|
+
VictoryContainer.contextType = _victory_util_timer_context__WEBPACK_IMPORTED_MODULE_8__["default"];
|
|
5634
5690
|
|
|
5635
5691
|
/***/ }),
|
|
5636
5692
|
|
|
@@ -5653,7 +5709,7 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
5653
5709
|
* The React context object consumers may use to access the context of the
|
|
5654
5710
|
* portal.
|
|
5655
5711
|
*/
|
|
5656
|
-
var PortalContext = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createContext(
|
|
5712
|
+
var PortalContext = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createContext({});
|
|
5657
5713
|
PortalContext.displayName = "PortalContext";
|
|
5658
5714
|
|
|
5659
5715
|
/***/ }),
|
|
@@ -5671,14 +5727,85 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
5671
5727
|
/* harmony export */ });
|
|
5672
5728
|
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "react");
|
|
5673
5729
|
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);
|
|
5674
|
-
function
|
|
5730
|
+
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
5675
5731
|
|
|
5732
|
+
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); } }
|
|
5676
5733
|
|
|
5677
|
-
|
|
5678
|
-
|
|
5679
|
-
|
|
5680
|
-
|
|
5681
|
-
});
|
|
5734
|
+
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
|
|
5735
|
+
|
|
5736
|
+
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); }
|
|
5737
|
+
|
|
5738
|
+
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
|
|
5739
|
+
|
|
5740
|
+
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); }; }
|
|
5741
|
+
|
|
5742
|
+
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); }
|
|
5743
|
+
|
|
5744
|
+
function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
|
|
5745
|
+
|
|
5746
|
+
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; } }
|
|
5747
|
+
|
|
5748
|
+
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
|
|
5749
|
+
|
|
5750
|
+
|
|
5751
|
+
var Portal = /*#__PURE__*/function (_ref) {
|
|
5752
|
+
_inherits(Portal, _ref);
|
|
5753
|
+
|
|
5754
|
+
var _super = _createSuper(Portal);
|
|
5755
|
+
|
|
5756
|
+
function Portal(props) {
|
|
5757
|
+
var _this;
|
|
5758
|
+
|
|
5759
|
+
_classCallCheck(this, Portal);
|
|
5760
|
+
|
|
5761
|
+
_this = _super.call(this, props);
|
|
5762
|
+
_this.map = void 0;
|
|
5763
|
+
_this.index = void 0;
|
|
5764
|
+
|
|
5765
|
+
_this.portalRegister = function () {
|
|
5766
|
+
return ++_this.index;
|
|
5767
|
+
};
|
|
5768
|
+
|
|
5769
|
+
_this.portalUpdate = function (key, element) {
|
|
5770
|
+
_this.map[key] = element;
|
|
5771
|
+
|
|
5772
|
+
_this.forceUpdate();
|
|
5773
|
+
};
|
|
5774
|
+
|
|
5775
|
+
_this.portalDeregister = function (key) {
|
|
5776
|
+
delete _this.map[key];
|
|
5777
|
+
|
|
5778
|
+
_this.forceUpdate();
|
|
5779
|
+
};
|
|
5780
|
+
|
|
5781
|
+
_this.map = {};
|
|
5782
|
+
_this.index = 1;
|
|
5783
|
+
return _this;
|
|
5784
|
+
}
|
|
5785
|
+
|
|
5786
|
+
_createClass(Portal, [{
|
|
5787
|
+
key: "getChildren",
|
|
5788
|
+
value: function getChildren() {
|
|
5789
|
+
var _this2 = this;
|
|
5790
|
+
|
|
5791
|
+
return Object.keys(this.map).map(function (key) {
|
|
5792
|
+
var el = _this2.map[key];
|
|
5793
|
+
return el ? /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().cloneElement(el, {
|
|
5794
|
+
key: key
|
|
5795
|
+
}) : el;
|
|
5796
|
+
});
|
|
5797
|
+
} // Overridden in victory-core-native
|
|
5798
|
+
|
|
5799
|
+
}, {
|
|
5800
|
+
key: "render",
|
|
5801
|
+
value: function render() {
|
|
5802
|
+
return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement("svg", this.props, this.getChildren());
|
|
5803
|
+
}
|
|
5804
|
+
}]);
|
|
5805
|
+
|
|
5806
|
+
return Portal;
|
|
5807
|
+
}((react__WEBPACK_IMPORTED_MODULE_0___default().Component));
|
|
5808
|
+
Portal.displayName = "Portal";
|
|
5682
5809
|
|
|
5683
5810
|
/***/ }),
|
|
5684
5811
|
|
|
@@ -8983,31 +9110,6 @@ function warn(message) {
|
|
|
8983
9110
|
|
|
8984
9111
|
/***/ }),
|
|
8985
9112
|
|
|
8986
|
-
/***/ "../../victory-core/es/victory-util/merge-refs.js":
|
|
8987
|
-
/*!********************************************************!*\
|
|
8988
|
-
!*** ../../victory-core/es/victory-util/merge-refs.js ***!
|
|
8989
|
-
\********************************************************/
|
|
8990
|
-
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
8991
|
-
|
|
8992
|
-
"use strict";
|
|
8993
|
-
__webpack_require__.r(__webpack_exports__);
|
|
8994
|
-
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
8995
|
-
/* harmony export */ "mergeRefs": () => (/* binding */ mergeRefs)
|
|
8996
|
-
/* harmony export */ });
|
|
8997
|
-
function mergeRefs(refs) {
|
|
8998
|
-
return function (value) {
|
|
8999
|
-
refs.forEach(function (ref) {
|
|
9000
|
-
if (typeof ref === "function") {
|
|
9001
|
-
ref(value);
|
|
9002
|
-
} else if (ref !== null && ref !== undefined) {
|
|
9003
|
-
ref.current = value;
|
|
9004
|
-
}
|
|
9005
|
-
});
|
|
9006
|
-
};
|
|
9007
|
-
}
|
|
9008
|
-
|
|
9009
|
-
/***/ }),
|
|
9010
|
-
|
|
9011
9113
|
/***/ "../../victory-core/es/victory-util/scale.js":
|
|
9012
9114
|
/*!***************************************************!*\
|
|
9013
9115
|
!*** ../../victory-core/es/victory-util/scale.js ***!
|