@luminati-io/uikit 3.3.5-beta.0 → 3.3.5-beta.2

Sign up to get free protection for your applications and to get access to all the features.
@@ -33478,14 +33478,7 @@ var BarChart = function BarChart(props) {
33478
33478
  xAccessor: lineData.accessors[horizontal ? 'yAccessor' : 'xAccessor'],
33479
33479
  yAccessor: lineData.accessors[horizontal ? 'xAccessor' : 'yAccessor'],
33480
33480
  colorAccessor: lineData.accessors.colorAccessor
33481
- }, lineData.barProps, {
33482
- onFocus: function onFocus() {
33483
- for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
33484
- args[_key] = arguments[_key];
33485
- }
33486
- return console.log(args);
33487
- }
33488
- }));
33481
+ }, lineData.barProps));
33489
33482
  })), !!showAnnotations && /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_bar_annotation__WEBPACK_IMPORTED_MODULE_3__.AnnotationGroup, null, data.map(function (lineData) {
33490
33483
  return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_bar_annotation__WEBPACK_IMPORTED_MODULE_3__.Annotation, {
33491
33484
  key: lineData.name,
@@ -36156,18 +36149,20 @@ var useStateWithCallback = function useStateWithCallback(initialValue, callback)
36156
36149
  __webpack_require__.r(__webpack_exports__);
36157
36150
  /* harmony export */ __webpack_require__.d(__webpack_exports__, {
36158
36151
  /* harmony export */ useDebouncedCallback: () => (/* reexport safe */ _use_debounced_callback__WEBPACK_IMPORTED_MODULE_0__["default"]),
36159
- /* harmony export */ useEventListener: () => (/* reexport safe */ _use_event_listener__WEBPACK_IMPORTED_MODULE_1__["default"]),
36160
- /* harmony export */ useLabelId: () => (/* reexport safe */ _use_label_id__WEBPACK_IMPORTED_MODULE_2__["default"]),
36161
- /* harmony export */ useOutsideClick: () => (/* reexport safe */ _use_outside_click__WEBPACK_IMPORTED_MODULE_3__["default"]),
36162
- /* harmony export */ useResize: () => (/* reexport safe */ _use_resize__WEBPACK_IMPORTED_MODULE_4__.useResize),
36163
- /* harmony export */ useScroll: () => (/* reexport safe */ _use_scroll__WEBPACK_IMPORTED_MODULE_5__["default"])
36152
+ /* harmony export */ useDidUpdate: () => (/* reexport safe */ _use_did_update__WEBPACK_IMPORTED_MODULE_1__.useDidUpdate),
36153
+ /* harmony export */ useEventListener: () => (/* reexport safe */ _use_event_listener__WEBPACK_IMPORTED_MODULE_2__["default"]),
36154
+ /* harmony export */ useLabelId: () => (/* reexport safe */ _use_label_id__WEBPACK_IMPORTED_MODULE_3__["default"]),
36155
+ /* harmony export */ useOutsideClick: () => (/* reexport safe */ _use_outside_click__WEBPACK_IMPORTED_MODULE_4__["default"]),
36156
+ /* harmony export */ useResize: () => (/* reexport safe */ _use_resize__WEBPACK_IMPORTED_MODULE_5__.useResize),
36157
+ /* harmony export */ useScroll: () => (/* reexport safe */ _use_scroll__WEBPACK_IMPORTED_MODULE_6__["default"])
36164
36158
  /* harmony export */ });
36165
36159
  /* harmony import */ var _use_debounced_callback__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./use_debounced_callback */ "./src/hooks/use_debounced_callback.js");
36166
- /* harmony import */ var _use_event_listener__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./use_event_listener */ "./src/hooks/use_event_listener.js");
36167
- /* harmony import */ var _use_label_id__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./use_label_id */ "./src/hooks/use_label_id.js");
36168
- /* harmony import */ var _use_outside_click__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./use_outside_click */ "./src/hooks/use_outside_click.js");
36169
- /* harmony import */ var _use_resize__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./use_resize */ "./src/hooks/use_resize.js");
36170
- /* harmony import */ var _use_scroll__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./use_scroll */ "./src/hooks/use_scroll.js");
36160
+ /* harmony import */ var _use_did_update__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./use_did_update */ "./src/hooks/use_did_update.js");
36161
+ /* harmony import */ var _use_event_listener__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./use_event_listener */ "./src/hooks/use_event_listener.js");
36162
+ /* harmony import */ var _use_label_id__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./use_label_id */ "./src/hooks/use_label_id.js");
36163
+ /* harmony import */ var _use_outside_click__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./use_outside_click */ "./src/hooks/use_outside_click.js");
36164
+ /* harmony import */ var _use_resize__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./use_resize */ "./src/hooks/use_resize.js");
36165
+ /* harmony import */ var _use_scroll__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./use_scroll */ "./src/hooks/use_scroll.js");
36171
36166
  // LICENSE_CODE ZON
36172
36167
 
36173
36168
 
@@ -36180,6 +36175,7 @@ __webpack_require__.r(__webpack_exports__);
36180
36175
 
36181
36176
 
36182
36177
 
36178
+
36183
36179
  /***/ }),
36184
36180
 
36185
36181
  /***/ "./src/hooks/use_debounced_callback.js":
@@ -36217,6 +36213,40 @@ var useDebouncedCallback = function useDebouncedCallback(callback) {
36217
36213
 
36218
36214
  /***/ }),
36219
36215
 
36216
+ /***/ "./src/hooks/use_did_update.js":
36217
+ /*!*************************************!*\
36218
+ !*** ./src/hooks/use_did_update.js ***!
36219
+ \*************************************/
36220
+ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
36221
+
36222
+ "use strict";
36223
+ __webpack_require__.r(__webpack_exports__);
36224
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
36225
+ /* harmony export */ useDidUpdate: () => (/* binding */ useDidUpdate)
36226
+ /* harmony export */ });
36227
+ /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "react");
36228
+ /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);
36229
+ // LICENSE_CODE ZON
36230
+
36231
+
36232
+ /*jslint react:true*/
36233
+
36234
+ var useDidUpdate = function useDidUpdate(fn, dependencies) {
36235
+ var mounted = (0,react__WEBPACK_IMPORTED_MODULE_0__.useRef)(false);
36236
+ (0,react__WEBPACK_IMPORTED_MODULE_0__.useEffect)(function () {
36237
+ return function () {
36238
+ mounted.current = false;
36239
+ };
36240
+ }, []);
36241
+ (0,react__WEBPACK_IMPORTED_MODULE_0__.useEffect)(function () {
36242
+ if (mounted.current) return fn();
36243
+ mounted.current = true;
36244
+ return undefined;
36245
+ }, dependencies);
36246
+ };
36247
+
36248
+ /***/ }),
36249
+
36220
36250
  /***/ "./src/hooks/use_event_listener.js":
36221
36251
  /*!*****************************************!*\
36222
36252
  !*** ./src/hooks/use_event_listener.js ***!
@@ -43458,12 +43488,16 @@ __webpack_require__.r(__webpack_exports__);
43458
43488
  /* harmony export */ });
43459
43489
  /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "react");
43460
43490
  /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);
43461
- /* harmony import */ var _constants__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../constants */ "./src/constants.js");
43491
+ /* harmony import */ var react_table__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! react-table */ "react-table");
43492
+ /* harmony import */ var react_table__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(react_table__WEBPACK_IMPORTED_MODULE_1__);
43493
+ /* harmony import */ var _constants__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../constants */ "./src/constants.js");
43494
+ /* harmony import */ var _hooks__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../hooks */ "./src/hooks/index.js");
43495
+ /* harmony import */ var _input__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../input */ "./src/input/index.js");
43462
43496
  // LICENSE_CODE ZON
43463
43497
 
43464
43498
 
43465
43499
  /*jslint react:true*/
43466
- var _excluded = ["indeterminate"];
43500
+ var _excluded = ["onChange"];
43467
43501
  function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
43468
43502
  function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
43469
43503
  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); }
@@ -43475,36 +43509,56 @@ function _objectWithoutProperties(source, excluded) { if (source == null) return
43475
43509
  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; }
43476
43510
 
43477
43511
 
43512
+
43513
+
43514
+
43478
43515
  var WIDTH = 54;
43479
- var IndeterminateCheckbox = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().forwardRef(function (_ref, ref) {
43480
- var indeterminate = _ref.indeterminate,
43516
+ var IndeterminateCheckbox = /*#__PURE__*/(0,react__WEBPACK_IMPORTED_MODULE_0__.forwardRef)(function (_ref, ref) {
43517
+ var onChange = _ref.onChange,
43481
43518
  rest = _objectWithoutProperties(_ref, _excluded);
43482
- var defaultRef = react__WEBPACK_IMPORTED_MODULE_0___default().useRef();
43483
- var resolvedRef = ref || defaultRef;
43484
- react__WEBPACK_IMPORTED_MODULE_0___default().useEffect(function () {
43485
- resolvedRef.current.indeterminate = indeterminate;
43486
- }, [resolvedRef, indeterminate]);
43487
- return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement("input", _extends({
43488
- type: "checkbox",
43489
- ref: resolvedRef
43519
+ var handleChange = (0,react__WEBPACK_IMPORTED_MODULE_0__.useCallback)(function (checked, evt) {
43520
+ evt.preventDefault();
43521
+ evt.stopPropagation();
43522
+ onChange === null || onChange === void 0 ? void 0 : onChange({
43523
+ target: {
43524
+ checked: checked
43525
+ }
43526
+ });
43527
+ }, [onChange]);
43528
+ return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_input__WEBPACK_IMPORTED_MODULE_4__.Checkbox, _extends({
43529
+ ref: ref,
43530
+ onChange: handleChange
43490
43531
  }, rest));
43491
43532
  });
43492
43533
  IndeterminateCheckbox.displayName = 'IndeterminateCheckbox';
43534
+ function reducer(state, action, _previousState, instance) {
43535
+ var onSelectRows = instance.onSelectRows;
43536
+ if (onSelectRows) {
43537
+ // if (action.type === actions.resetSelectedRows)
43538
+ if (action.type == react_table__WEBPACK_IMPORTED_MODULE_1__.actions.toggleAllRowsSelected || action.type == react_table__WEBPACK_IMPORTED_MODULE_1__.actions.toggleRowSelected || action.type == react_table__WEBPACK_IMPORTED_MODULE_1__.actions.toggleAllPageRowsSelected) {
43539
+ onSelectRows(state.selectedRowIds);
43540
+ }
43541
+ }
43542
+ return state;
43543
+ }
43493
43544
  var useInstance = function useInstance(instance) {
43494
- var onSelectRows = instance.onSelectRows,
43495
- state = instance.state;
43496
- react__WEBPACK_IMPORTED_MODULE_0___default().useEffect(function () {
43497
- if (onSelectRows) onSelectRows(state.selectedRowIds);
43498
- }, [onSelectRows, state.selectedRowIds]);
43545
+ var dispatch = instance.dispatch,
43546
+ initialState = instance.initialState;
43547
+ (0,_hooks__WEBPACK_IMPORTED_MODULE_3__.useDidUpdate)(function () {
43548
+ console.log('did update', initialState.selectedRowIds);
43549
+ dispatch({
43550
+ type: react_table__WEBPACK_IMPORTED_MODULE_1__.actions.resetSelectedRows
43551
+ });
43552
+ }, [initialState.selectedRowIds]);
43499
43553
  };
43500
- var getCellProps = function getCellProps(header, instance) {
43554
+ var getCellProps = function getCellProps(header) {
43501
43555
  var style = {};
43502
43556
  if (header.id == 'selection') {
43503
43557
  style = {
43504
43558
  position: 'sticky',
43505
43559
  width: "".concat(WIDTH, "px"),
43506
43560
  left: '0',
43507
- zIndex: _constants__WEBPACK_IMPORTED_MODULE_1__.Z_INDEX.pinnedColumnHeader + 1
43561
+ zIndex: _constants__WEBPACK_IMPORTED_MODULE_2__.Z_INDEX.pinnedColumnHeader + 1
43508
43562
  };
43509
43563
  }
43510
43564
  return {
@@ -43515,10 +43569,6 @@ var useSelectRows = function useSelectRows(hooks) {
43515
43569
  hooks.visibleColumns.push(function (columns, _ref2) {
43516
43570
  var instance = _ref2.instance;
43517
43571
  if (!instance.onSelectRows) return columns;
43518
- var onClick = function onClick(e) {
43519
- // e.preventDefault();
43520
- e.stopPropagation();
43521
- };
43522
43572
  // Let's make a column for selection
43523
43573
  return [{
43524
43574
  id: 'selection',
@@ -43532,9 +43582,7 @@ var useSelectRows = function useSelectRows(hooks) {
43532
43582
  // method to the render a checkbox
43533
43583
  Cell: function Cell(_ref4) {
43534
43584
  var row = _ref4.row;
43535
- return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement("div", {
43536
- onClick: onClick
43537
- }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(IndeterminateCheckbox, row.getToggleRowSelectedProps()));
43585
+ return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(IndeterminateCheckbox, row.getToggleRowSelectedProps());
43538
43586
  },
43539
43587
  disableResizing: true,
43540
43588
  disableHiding: true,
@@ -43544,6 +43592,7 @@ var useSelectRows = function useSelectRows(hooks) {
43544
43592
  minWidth: WIDTH
43545
43593
  }].concat(_toConsumableArray(columns));
43546
43594
  });
43595
+ hooks.stateReducers.push(reducer);
43547
43596
  hooks.useInstance.push(useInstance);
43548
43597
  hooks.getHeaderProps.push(function (props, _ref5) {
43549
43598
  var instance = _ref5.instance,