@ballistix.digital/react-components 3.3.1 → 3.3.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/dist/index.d.ts CHANGED
@@ -495,6 +495,11 @@ declare const base$e: {
495
495
  container: string;
496
496
  row: string;
497
497
  checkbox: string;
498
+ column: {
499
+ pinned: {
500
+ cell: string;
501
+ };
502
+ };
498
503
  cell: {
499
504
  container: string;
500
505
  text: string;
package/dist/index.esm.js CHANGED
@@ -1,6 +1,6 @@
1
1
  import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
2
2
  import { ArrowPathIcon, ChevronDownIcon, EllipsisVerticalIcon, ExclamationCircleIcon, ChevronDoubleLeftIcon, ChevronLeftIcon, ChevronRightIcon, ChevronDoubleRightIcon, ChevronUpIcon, ChevronUpDownIcon, HomeIcon, ArrowLongLeftIcon, ArrowLongRightIcon } from '@heroicons/react/20/solid';
3
- import { isArray, map, set, get, noop as noop$2, indexOf, toSafeInteger, pick, isEmpty, some, compact as compact$1, forEach, assign, includes, findIndex, find, concat, times, intersection, trim, lastIndexOf } from 'lodash';
3
+ import { isArray, map, set, get, noop as noop$2, indexOf, toSafeInteger, pick, isEmpty, some, compact as compact$1, forEach, assign, includes, findIndex, last, first, find, concat, times, intersection, trim, lastIndexOf } from 'lodash';
4
4
  import get$1 from 'lodash/get';
5
5
  import React, { useState, useMemo, useRef, Children, Fragment as Fragment$1, useEffect, useCallback, useLayoutEffect, createContext, memo, useReducer, forwardRef, useContext, cloneElement, useImperativeHandle, createElement, PureComponent, Component } from 'react';
6
6
  import { library } from '@fortawesome/fontawesome-svg-core';
@@ -6015,18 +6015,24 @@ var TableList2 = function (props) {
6015
6015
  var pinnedColumnIndex = findIndex((_d = (_c = config.options) === null || _c === void 0 ? void 0 : _c.columnPinning) === null || _d === void 0 ? void 0 : _d[side], { name: id });
6016
6016
  if (pinnedColumnIndex === -1)
6017
6017
  return null;
6018
+ var startIndex = side === 'left' ? 0 : pinnedColumnIndex + 1;
6019
+ var endIndex = side === 'left'
6020
+ ? pinnedColumnIndex
6021
+ : pinnedColumns.length - pinnedColumnIndex + 1;
6018
6022
  return pinnedColumns
6019
- .slice(0, pinnedColumnIndex)
6023
+ .slice(startIndex, endIndex)
6020
6024
  .reduce(function (acc, size) { return acc + size; }, 0);
6021
6025
  }, [(_q = config.options) === null || _q === void 0 ? void 0 : _q.columnPinning]);
6022
6026
  var getCommonPinningStyles = useCallback(function (column) {
6023
- var _a, _b, _c, _d, _e;
6027
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l;
6024
6028
  var isPinned = column.getIsPinned();
6025
- var isLastLeftPinnedColumn = isPinned === 'left' && column.getIsLastColumn('left');
6026
- var isFirstRightPinnedColumn = isPinned === 'right' && column.getIsFirstColumn('right');
6027
- var width = (_e = find(concat((_b = (_a = config.options) === null || _a === void 0 ? void 0 : _a.columnPinning) === null || _b === void 0 ? void 0 : _b.left, (_d = (_c = config.options) === null || _c === void 0 ? void 0 : _c.columnPinning) === null || _d === void 0 ? void 0 : _d.right), {
6029
+ var isLastLeftPinnedColumn = column.id == ((_c = last((_b = (_a = config.options) === null || _a === void 0 ? void 0 : _a.columnPinning) === null || _b === void 0 ? void 0 : _b.left)) === null || _c === void 0 ? void 0 : _c.name);
6030
+ var isFirstRightPinnedColumn = column.id == ((_f = first((_e = (_d = config.options) === null || _d === void 0 ? void 0 : _d.columnPinning) === null || _e === void 0 ? void 0 : _e.right)) === null || _f === void 0 ? void 0 : _f.name);
6031
+ if (isFirstRightPinnedColumn)
6032
+ console.log(column.id);
6033
+ var width = (_l = find(concat((_h = (_g = config.options) === null || _g === void 0 ? void 0 : _g.columnPinning) === null || _h === void 0 ? void 0 : _h.left, (_k = (_j = config.options) === null || _j === void 0 ? void 0 : _j.columnPinning) === null || _k === void 0 ? void 0 : _k.right), {
6028
6034
  name: column.id,
6029
- })) === null || _e === void 0 ? void 0 : _e.size;
6035
+ })) === null || _l === void 0 ? void 0 : _l.size;
6030
6036
  return {
6031
6037
  width: width,
6032
6038
  maxWidth: width,
@@ -6058,7 +6064,7 @@ var TableList2 = function (props) {
6058
6064
  : ChevronDownIcon;
6059
6065
  }
6060
6066
  return (jsx("th", { colSpan: header.colSpan, className: toClassName(styles.body.table.head.cell.container, 'border-b', header.column.getCanSort() && 'cursor-pointer', header.column.getIsPinned() &&
6061
- styles.body.table.body.column.pinned.cell), onClick: header.column.getToggleSortingHandler(), style: __assign$1({ minWidth: !!header.column.columnDef.size &&
6067
+ styles.body.table.head.column.pinned.cell), onClick: header.column.getToggleSortingHandler(), style: __assign$1({ minWidth: !!header.column.columnDef.size &&
6062
6068
  header.column.columnDef.size !== 150
6063
6069
  ? "".concat(header.column.columnDef.size, "px")
6064
6070
  : 'auto' }, getCommonPinningStyles(header.column)), children: jsxs("div", { className: "grid gap-x-1 items-center", style: {
@@ -6105,6 +6111,11 @@ var base$c = {
6105
6111
  container: '',
6106
6112
  row: '',
6107
6113
  checkbox: 'absolute left-4 top-1/2 -mt-2 h-4 w-4 rounded border-gray-300 text-primary-600 focus:ring-primary-500 sm:left-6',
6114
+ column: {
6115
+ pinned: {
6116
+ cell: 'bg-white sticky z-10 overflow-hidden text-ellipsis',
6117
+ },
6118
+ },
6108
6119
  cell: {
6109
6120
  container: ' py-3.5 px-3 text-left text-sm font-semibold text-gray-900 group',
6110
6121
  text: 'whitespace-normal break-words',