@luminati-io/uikit 3.2.13 → 3.2.14

Sign up to get free protection for your applications and to get access to all the features.
@@ -38662,7 +38662,8 @@ var Number = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().forwardRe
38662
38662
  placeholder = props.placeholder,
38663
38663
  changeOnBlur = props.changeOnBlur;
38664
38664
  var handleChange = (0,react__WEBPACK_IMPORTED_MODULE_0__.useCallback)(function (e) {
38665
- var v = +e.target.value;
38665
+ var v = e.target.value;
38666
+ if (v != '') v = +v;
38666
38667
  onChange === null || onChange === void 0 ? void 0 : onChange(v, e);
38667
38668
  }, [onChange, minValue, maxValue]);
38668
38669
  var handleBlur = (0,react__WEBPACK_IMPORTED_MODULE_0__.useCallback)(function (e) {
@@ -41402,6 +41403,7 @@ __webpack_require__.r(__webpack_exports__);
41402
41403
  /* harmony import */ var _pinned_columns__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./pinned_columns */ "./src/table/pinned_columns.js");
41403
41404
  /* harmony import */ var _util__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./util */ "./src/table/util.js");
41404
41405
  /* harmony import */ var _expandable_rows__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./expandable_rows */ "./src/table/expandable_rows.js");
41406
+ /* harmony import */ var _select_rows__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ./select_rows */ "./src/table/select_rows.js");
41405
41407
  // LICENSE_CODE ZON
41406
41408
 
41407
41409
 
@@ -41435,6 +41437,7 @@ function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) r
41435
41437
 
41436
41438
 
41437
41439
 
41440
+
41438
41441
  var assign = Object.assign;
41439
41442
  var defaultPropGetter = function defaultPropGetter() {
41440
41443
  return {};
@@ -41525,7 +41528,7 @@ var Provider = function Provider(props) {
41525
41528
  getCellProps: getCellProps,
41526
41529
  getFooterProps: getFooterProps,
41527
41530
  ExpandHandleComp: ExpandHandleComp
41528
- }, rest), useCanHideColumns, react_table__WEBPACK_IMPORTED_MODULE_2__.useExpanded, _expandable_rows__WEBPACK_IMPORTED_MODULE_9__.useExpandHandle, react_table__WEBPACK_IMPORTED_MODULE_2__.usePagination, props.fullWidth ? react_table__WEBPACK_IMPORTED_MODULE_2__.useFlexLayout : react_table__WEBPACK_IMPORTED_MODULE_2__.useBlockLayout, react_table__WEBPACK_IMPORTED_MODULE_2__.useResizeColumns, react_table__WEBPACK_IMPORTED_MODULE_2__.useColumnOrder, _pinned_columns__WEBPACK_IMPORTED_MODULE_7__.usePinnedColumns, _editable_columns__WEBPACK_IMPORTED_MODULE_6__.useEditableColumns].concat(_toConsumableArray(hooks)));
41531
+ }, rest), useCanHideColumns, react_table__WEBPACK_IMPORTED_MODULE_2__.useExpanded, _expandable_rows__WEBPACK_IMPORTED_MODULE_9__.useExpandHandle, react_table__WEBPACK_IMPORTED_MODULE_2__.usePagination, props.fullWidth ? react_table__WEBPACK_IMPORTED_MODULE_2__.useFlexLayout : react_table__WEBPACK_IMPORTED_MODULE_2__.useBlockLayout, react_table__WEBPACK_IMPORTED_MODULE_2__.useResizeColumns, react_table__WEBPACK_IMPORTED_MODULE_2__.useColumnOrder, _pinned_columns__WEBPACK_IMPORTED_MODULE_7__.usePinnedColumns, _editable_columns__WEBPACK_IMPORTED_MODULE_6__.useEditableColumns, react_table__WEBPACK_IMPORTED_MODULE_2__.useRowSelect, _select_rows__WEBPACK_IMPORTED_MODULE_10__.useSelectRows].concat(_toConsumableArray(hooks)));
41529
41532
  var _table$state = table.state,
41530
41533
  pageIndex = _table$state.pageIndex,
41531
41534
  _pageSize = _table$state.pageSize;
@@ -41620,7 +41623,8 @@ Provider.propTypes = {
41620
41623
  onRowClick: (prop_types__WEBPACK_IMPORTED_MODULE_0___default().func),
41621
41624
  stickyHeader: prop_types__WEBPACK_IMPORTED_MODULE_0___default().oneOfType([(prop_types__WEBPACK_IMPORTED_MODULE_0___default().bool), (prop_types__WEBPACK_IMPORTED_MODULE_0___default().object)]),
41622
41625
  scrollTarget: (prop_types__WEBPACK_IMPORTED_MODULE_0___default().any),
41623
- className: (prop_types__WEBPACK_IMPORTED_MODULE_0___default().string)
41626
+ className: (prop_types__WEBPACK_IMPORTED_MODULE_0___default().string),
41627
+ onSelectRows: (prop_types__WEBPACK_IMPORTED_MODULE_0___default().func)
41624
41628
  };
41625
41629
  var calcPageCount = function calcPageCount(totalCount, pageSize) {
41626
41630
  return Math.ceil(totalCount / pageSize);
@@ -42980,20 +42984,17 @@ var usePinnedColumns = function usePinnedColumns(hooks) {
42980
42984
  hooks.getHeaderProps.push(function (props, _ref) {
42981
42985
  var instance = _ref.instance,
42982
42986
  column = _ref.column;
42983
- var nextProps = getPinnedProps(column, instance);
42984
- return [props, nextProps];
42987
+ return [props, getPinnedProps(column, instance)];
42985
42988
  });
42986
42989
  hooks.getCellProps.push(function (props, _ref2) {
42987
42990
  var instance = _ref2.instance,
42988
42991
  cell = _ref2.cell;
42989
- var nextProps = getPinnedProps(cell.column, instance);
42990
- return [props, nextProps];
42992
+ return [props, getPinnedProps(cell.column, instance)];
42991
42993
  });
42992
42994
  hooks.getFooterProps.push(function (props, _ref3) {
42993
42995
  var instance = _ref3.instance,
42994
42996
  column = _ref3.column;
42995
- var nextProps = getPinnedProps(column, instance);
42996
- return [props, nextProps];
42997
+ return [props, getPinnedProps(column, instance)];
42997
42998
  });
42998
42999
  hooks.stateReducers.push(usePinnedReducer);
42999
43000
  hooks.useInstance.push(usePinnedInstance);
@@ -43126,6 +43127,125 @@ var renderRow = function renderRow(opt) {
43126
43127
 
43127
43128
  /***/ }),
43128
43129
 
43130
+ /***/ "./src/table/select_rows.js":
43131
+ /*!**********************************!*\
43132
+ !*** ./src/table/select_rows.js ***!
43133
+ \**********************************/
43134
+ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
43135
+
43136
+ "use strict";
43137
+ __webpack_require__.r(__webpack_exports__);
43138
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
43139
+ /* harmony export */ useSelectRows: () => (/* binding */ useSelectRows)
43140
+ /* harmony export */ });
43141
+ /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "react");
43142
+ /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);
43143
+ /* harmony import */ var _constants__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../constants */ "./src/constants.js");
43144
+ // LICENSE_CODE ZON
43145
+
43146
+
43147
+ /*jslint react:true*/
43148
+ var _excluded = ["indeterminate"];
43149
+ function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
43150
+ 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."); }
43151
+ 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); }
43152
+ function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
43153
+ function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
43154
+ 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; }
43155
+ 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); }
43156
+ 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; }
43157
+ 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; }
43158
+
43159
+
43160
+ var WIDTH = 54;
43161
+ var IndeterminateCheckbox = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().forwardRef(function (_ref, ref) {
43162
+ var indeterminate = _ref.indeterminate,
43163
+ rest = _objectWithoutProperties(_ref, _excluded);
43164
+ var defaultRef = react__WEBPACK_IMPORTED_MODULE_0___default().useRef();
43165
+ var resolvedRef = ref || defaultRef;
43166
+ react__WEBPACK_IMPORTED_MODULE_0___default().useEffect(function () {
43167
+ resolvedRef.current.indeterminate = indeterminate;
43168
+ }, [resolvedRef, indeterminate]);
43169
+ return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement("input", _extends({
43170
+ type: "checkbox",
43171
+ ref: resolvedRef
43172
+ }, rest));
43173
+ });
43174
+ var useInstance = function useInstance(instance) {
43175
+ var onSelectRows = instance.onSelectRows,
43176
+ state = instance.state;
43177
+ react__WEBPACK_IMPORTED_MODULE_0___default().useEffect(function () {
43178
+ if (onSelectRows) onSelectRows(state.selectedRowIds);
43179
+ }, [onSelectRows, state.selectedRowIds]);
43180
+ };
43181
+ var getCellProps = function getCellProps(header, instance) {
43182
+ var style = {};
43183
+ if (header.id == 'selection') {
43184
+ style = {
43185
+ position: 'sticky',
43186
+ width: "".concat(WIDTH, "px"),
43187
+ left: '0',
43188
+ zIndex: _constants__WEBPACK_IMPORTED_MODULE_1__.Z_INDEX.pinnedColumnHeader + 1
43189
+ };
43190
+ }
43191
+ return {
43192
+ style: style
43193
+ };
43194
+ };
43195
+ var useSelectRows = function useSelectRows(hooks) {
43196
+ hooks.visibleColumns.push(function (columns, _ref2) {
43197
+ var instance = _ref2.instance;
43198
+ if (!instance.onSelectRows) return columns;
43199
+ var onClick = function onClick(e) {
43200
+ // e.preventDefault();
43201
+ e.stopPropagation();
43202
+ };
43203
+ // Let's make a column for selection
43204
+ return [{
43205
+ id: 'selection',
43206
+ // The header can use the table's getToggleAllRowsSelectedProps
43207
+ // method to render a checkbox
43208
+ Header: function Header(_ref3) {
43209
+ var getToggleAllRowsSelectedProps = _ref3.getToggleAllRowsSelectedProps;
43210
+ return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(IndeterminateCheckbox, getToggleAllRowsSelectedProps());
43211
+ },
43212
+ // The cell can use the individual row's getToggleRowSelectedProps
43213
+ // method to the render a checkbox
43214
+ Cell: function Cell(_ref4) {
43215
+ var row = _ref4.row;
43216
+ return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement("div", {
43217
+ onClick: onClick
43218
+ }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(IndeterminateCheckbox, row.getToggleRowSelectedProps()));
43219
+ },
43220
+ disableResizing: true,
43221
+ disableHiding: true,
43222
+ disablePinning: true,
43223
+ width: WIDTH,
43224
+ maxWidth: WIDTH,
43225
+ minWidth: WIDTH
43226
+ }].concat(_toConsumableArray(columns));
43227
+ });
43228
+ hooks.useInstance.push(useInstance);
43229
+ hooks.getHeaderProps.push(function (props, _ref5) {
43230
+ var instance = _ref5.instance,
43231
+ column = _ref5.column;
43232
+ return [props, getCellProps(column, instance)];
43233
+ });
43234
+ hooks.getCellProps.push(function (props, _ref6) {
43235
+ var instance = _ref6.instance,
43236
+ cell = _ref6.cell;
43237
+ return [props, getCellProps(cell.column, instance)];
43238
+ });
43239
+ hooks.getFooterProps.push(function (props, _ref7) {
43240
+ var instance = _ref7.instance,
43241
+ column = _ref7.column;
43242
+ return [props, getCellProps(column, instance)];
43243
+ });
43244
+ };
43245
+ useSelectRows.pluginName = 'useSelectRows';
43246
+
43247
+ /***/ }),
43248
+
43129
43249
  /***/ "./src/table/sort_icon.js":
43130
43250
  /*!********************************!*\
43131
43251
  !*** ./src/table/sort_icon.js ***!