@tanstack/react-table 8.5.10 → 8.5.13

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.
@@ -660,11 +660,11 @@ var drawChart = (function (exports) {
660
660
  return availableSizeProperties;
661
661
  };
662
662
 
663
- var t,u,r,o,i=0,c=[],f=[],e=l$1.__b,a=l$1.__r,v=l$1.diffed,l=l$1.__c,m=l$1.unmount;function p(t,r){l$1.__h&&l$1.__h(u,t,i||r),i=0;var o=u.__H||(u.__H={__:[],__h:[]});return t>=o.__.length&&o.__.push({__V:f}),o.__[t]}function y(n){return i=1,d(z,n)}function d(n,r,o){var i=p(t++,2);return i.t=n,i.__c||(i.__=[o?o(r):z(void 0,r),function(n){var t=i.t(i.__[0],n);i.__[0]!==t&&(i.__=[t,i.__[1]],i.__c.setState({}));}],i.__c=u),i.__}function _(r,o){var i=p(t++,3);!l$1.__s&&w(i.__H,o)&&(i.__=r,i.u=o,u.__H.__h.push(i));}function h(r,o){var i=p(t++,4);!l$1.__s&&w(i.__H,o)&&(i.__=r,i.u=o,u.__h.push(i));}function s(n){return i=5,F(function(){return {current:n}},[])}function F(n,u){var r=p(t++,7);return w(r.__H,u)?(r.__V=n(),r.u=u,r.__h=n,r.__V):r.__}function q(n){var r=u.context[n.__c],o=p(t++,9);return o.c=n,r?(null==o.__&&(o.__=!0,r.sub(u)),r.props.value):n.__}function b(){for(var t;t=c.shift();)if(t.__P)try{t.__H.__h.forEach(j),t.__H.__h.forEach(k),t.__H.__h=[];}catch(u){t.__H.__h=[],l$1.__e(u,t.__v);}}l$1.__b=function(n){u=null,e&&e(n);},l$1.__r=function(n){a&&a(n),t=0;var o=(u=n.__c).__H;o&&(r===u?(o.__h=[],u.__h=[],o.__.forEach(function(n){n.__V=f,n.u=void 0;})):(o.__h.forEach(j),o.__h.forEach(k),o.__h=[])),r=u;},l$1.diffed=function(t){v&&v(t);var i=t.__c;i&&i.__H&&(i.__H.__h.length&&(1!==c.push(i)&&o===l$1.requestAnimationFrame||((o=l$1.requestAnimationFrame)||function(n){var t,u=function(){clearTimeout(r),g&&cancelAnimationFrame(t),setTimeout(n);},r=setTimeout(u,100);g&&(t=requestAnimationFrame(u));})(b)),i.__H.__.forEach(function(n){n.u&&(n.__H=n.u),n.__V!==f&&(n.__=n.__V),n.u=void 0,n.__V=f;})),r=u=null;},l$1.__c=function(t,u){u.some(function(t){try{t.__h.forEach(j),t.__h=t.__h.filter(function(n){return !n.__||k(n)});}catch(r){u.some(function(n){n.__h&&(n.__h=[]);}),u=[],l$1.__e(r,t.__v);}}),l&&l(t,u);},l$1.unmount=function(t){m&&m(t);var u,r=t.__c;r&&r.__H&&(r.__H.__.forEach(function(n){try{j(n);}catch(n){u=n;}}),u&&l$1.__e(u,r.__v));};var g="function"==typeof requestAnimationFrame;function j(n){var t=u,r=n.__c;"function"==typeof r&&(n.__c=void 0,r()),u=t;}function k(n){var t=u;n.__c=n.__(),u=t;}function w(n,t){return !n||n.length!==t.length||t.some(function(t,u){return t!==n[u]})}function z(n,t){return "function"==typeof t?t(n):t}
663
+ var t,r,u,i,o=0,c=[],f=[],e=l$1.__b,a=l$1.__r,v=l$1.diffed,l=l$1.__c,m=l$1.unmount;function d(t,u){l$1.__h&&l$1.__h(r,t,o||u),o=0;var i=r.__H||(r.__H={__:[],__h:[]});return t>=i.__.length&&i.__.push({__V:f}),i.__[t]}function p(n){return o=1,y(z,n)}function y(n,u,i){var o=d(t++,2);if(o.t=n,!o.__c&&(o.__=[i?i(u):z(void 0,u),function(n){var t=o.__N?o.__N[0]:o.__[0],r=o.t(t,n);t!==r&&(o.__N=[r,o.__[1]],o.__c.setState({}));}],o.__c=r,!r.u)){r.u=!0;var c=r.shouldComponentUpdate;r.shouldComponentUpdate=function(n,t,r){if(!o.__c.__H)return !0;var u=o.__c.__H.__.filter(function(n){return n.__c});if(u.every(function(n){return !n.__N}))return !c||c.call(this,n,t,r);var i=!1;return u.forEach(function(n){if(n.__N){var t=n.__[0];n.__=n.__N,n.__N=void 0,t!==n.__[0]&&(i=!0);}}),!!i&&(!c||c.call(this,n,t,r))};}return o.__N||o.__}function h(u,i){var o=d(t++,3);!l$1.__s&&w(o.__H,i)&&(o.__=u,o.i=i,r.__H.__h.push(o));}function s(u,i){var o=d(t++,4);!l$1.__s&&w(o.__H,i)&&(o.__=u,o.i=i,r.__h.push(o));}function _(n){return o=5,F(function(){return {current:n}},[])}function F(n,r){var u=d(t++,7);return w(u.__H,r)?(u.__V=n(),u.i=r,u.__h=n,u.__V):u.__}function q(n){var u=r.context[n.__c],i=d(t++,9);return i.c=n,u?(null==i.__&&(i.__=!0,u.sub(r)),u.props.value):n.__}function b(){for(var t;t=c.shift();)if(t.__P&&t.__H)try{t.__H.__h.forEach(j),t.__H.__h.forEach(k),t.__H.__h=[];}catch(r){t.__H.__h=[],l$1.__e(r,t.__v);}}l$1.__b=function(n){r=null,e&&e(n);},l$1.__r=function(n){a&&a(n),t=0;var i=(r=n.__c).__H;i&&(u===r?(i.__h=[],r.__h=[],i.__.forEach(function(n){n.__N&&(n.__=n.__N),n.__V=f,n.__N=n.i=void 0;})):(i.__h.forEach(j),i.__h.forEach(k),i.__h=[])),u=r;},l$1.diffed=function(t){v&&v(t);var o=t.__c;o&&o.__H&&(o.__H.__h.length&&(1!==c.push(o)&&i===l$1.requestAnimationFrame||((i=l$1.requestAnimationFrame)||function(n){var t,r=function(){clearTimeout(u),g&&cancelAnimationFrame(t),setTimeout(n);},u=setTimeout(r,100);g&&(t=requestAnimationFrame(r));})(b)),o.__H.__.forEach(function(n){n.i&&(n.__H=n.i),n.__V!==f&&(n.__=n.__V),n.i=void 0,n.__V=f;})),u=r=null;},l$1.__c=function(t,r){r.some(function(t){try{t.__h.forEach(j),t.__h=t.__h.filter(function(n){return !n.__||k(n)});}catch(u){r.some(function(n){n.__h&&(n.__h=[]);}),r=[],l$1.__e(u,t.__v);}}),l&&l(t,r);},l$1.unmount=function(t){m&&m(t);var r,u=t.__c;u&&u.__H&&(u.__H.__.forEach(function(n){try{j(n);}catch(n){r=n;}}),r&&l$1.__e(r,u.__v));};var g="function"==typeof requestAnimationFrame;function j(n){var t=r,u=n.__c;"function"==typeof u&&(n.__c=void 0,u()),r=t;}function k(n){var t=r;n.__c=n.__(),r=t;}function w(n,t){return !n||n.length!==t.length||t.some(function(t,r){return t!==n[r]})}function z(n,t){return "function"==typeof t?t(n):t}
664
664
 
665
665
  const SideBar = ({ availableSizeProperties, sizeProperty, setSizeProperty, onExcludeChange, onIncludeChange, }) => {
666
- const [includeValue, setIncludeValue] = y("");
667
- const [excludeValue, setExcludeValue] = y("");
666
+ const [includeValue, setIncludeValue] = p("");
667
+ const [excludeValue, setExcludeValue] = p("");
668
668
  const handleSizePropertyChange = (sizeProp) => () => {
669
669
  if (sizeProp !== sizeProperty) {
670
670
  setSizeProperty(sizeProp);
@@ -700,8 +700,8 @@ var drawChart = (function (exports) {
700
700
  };
701
701
  };
702
702
  const useFilter = () => {
703
- const [includeFilter, setIncludeFilter] = y("");
704
- const [excludeFilter, setExcludeFilter] = y("");
703
+ const [includeFilter, setIncludeFilter] = p("");
704
+ const [excludeFilter, setExcludeFilter] = p("");
705
705
  const setIncludeFilterTrottled = F(() => throttleFilter(setIncludeFilter, 200), []);
706
706
  const setExcludeFilterTrottled = F(() => throttleFilter(setExcludeFilter, 200), []);
707
707
  const isModuleIncluded = F(() => {
@@ -954,8 +954,8 @@ var drawChart = (function (exports) {
954
954
  const { getModuleColor } = q(StaticContext);
955
955
  const { backgroundColor, fontColor } = getModuleColor(node);
956
956
  const { x0, x1, y1, y0, data, children = null } = node;
957
- const textRef = s(null);
958
- const textRectRef = s();
957
+ const textRef = _(null);
958
+ const textRectRef = _();
959
959
  const width = x1 - x0;
960
960
  const height = y1 - y0;
961
961
  const textProps = {
@@ -970,7 +970,7 @@ var drawChart = (function (exports) {
970
970
  else {
971
971
  textProps.y = height / 2;
972
972
  }
973
- h(() => {
973
+ s(() => {
974
974
  if (width == 0 || height == 0 || !textRef.current) {
975
975
  return;
976
976
  }
@@ -1208,8 +1208,8 @@ var drawChart = (function (exports) {
1208
1208
  const COMPRESSED = (e$1("span", { children: [e$1("b", { children: LABELS.gzipLength }), " and ", e$1("b", { children: LABELS.brotliLength }), " is a byte size of individual file after individual", " ", "transformations,", e$1("br", {}), " treeshake and compression."] }));
1209
1209
  const Tooltip = ({ node, visible, root, sizeProperty }) => {
1210
1210
  const { availableSizeProperties, getModuleSize, data } = q(StaticContext);
1211
- const ref = s(null);
1212
- const [style, setStyle] = y({});
1211
+ const ref = _(null);
1212
+ const [style, setStyle] = p({});
1213
1213
  const content = F(() => {
1214
1214
  if (!node)
1215
1215
  return null;
@@ -1257,7 +1257,7 @@ var drawChart = (function (exports) {
1257
1257
  }
1258
1258
  setStyle(pos);
1259
1259
  };
1260
- _(() => {
1260
+ h(() => {
1261
1261
  const handleMouseMove = (event) => {
1262
1262
  updatePosition({
1263
1263
  x: event.pageX,
@@ -1273,9 +1273,9 @@ var drawChart = (function (exports) {
1273
1273
  };
1274
1274
 
1275
1275
  const Chart = ({ root, sizeProperty, selectedNode, setSelectedNode }) => {
1276
- const [showTooltip, setShowTooltip] = y(false);
1277
- const [tooltipNode, setTooltipNode] = y(undefined);
1278
- _(() => {
1276
+ const [showTooltip, setShowTooltip] = p(false);
1277
+ const [tooltipNode, setTooltipNode] = p(undefined);
1278
+ h(() => {
1279
1279
  const handleMouseOut = () => {
1280
1280
  setShowTooltip(false);
1281
1281
  };
@@ -1294,8 +1294,8 @@ var drawChart = (function (exports) {
1294
1294
 
1295
1295
  const Main = () => {
1296
1296
  const { availableSizeProperties, rawHierarchy, getModuleSize, layout, data } = q(StaticContext);
1297
- const [sizeProperty, setSizeProperty] = y(availableSizeProperties[0]);
1298
- const [selectedNode, setSelectedNode] = y(undefined);
1297
+ const [sizeProperty, setSizeProperty] = p(availableSizeProperties[0]);
1298
+ const [selectedNode, setSelectedNode] = p(undefined);
1299
1299
  const { getModuleFilterMultiplier, setExcludeFilter, setIncludeFilter } = useFilter();
1300
1300
  console.time("getNodeSizeMultiplier");
1301
1301
  const getNodeSizeMultiplier = F(() => {
@@ -4014,7 +4014,7 @@ var drawChart = (function (exports) {
4014
4014
  </script>
4015
4015
  <script>
4016
4016
  /*<!--*/
4017
- const data = {"version":2,"tree":{"name":"root","children":[{"name":"index.production.js","children":[{"name":"packages","children":[{"name":"table-core/build/esm/index.js","uid":"00d2-127"},{"name":"react-table/src/index.tsx","uid":"00d2-129"}]}]}],"isRoot":true},"nodeParts":{"00d2-127":{"renderedLength":138375,"gzipLength":24016,"brotliLength":0,"mainUid":"00d2-126"},"00d2-129":{"renderedLength":1900,"gzipLength":752,"brotliLength":0,"mainUid":"00d2-128"}},"nodeMetas":{"00d2-126":{"id":"/packages/table-core/build/esm/index.js","moduleParts":{"index.production.js":"00d2-127"},"imported":[],"importedBy":[{"uid":"00d2-128"}]},"00d2-128":{"id":"/packages/react-table/src/index.tsx","moduleParts":{"index.production.js":"00d2-129"},"imported":[{"uid":"00d2-130"},{"uid":"00d2-126"}],"importedBy":[],"isEntry":true},"00d2-130":{"id":"react","moduleParts":{},"imported":[],"importedBy":[{"uid":"00d2-128"}],"isExternal":true}},"env":{"rollup":"2.77.2"},"options":{"gzip":true,"brotli":false,"sourcemap":false}};
4017
+ const data = {"version":2,"tree":{"name":"root","children":[{"name":"index.production.js","children":[{"name":"packages","children":[{"name":"table-core/build/esm/index.js","uid":"0e66-127"},{"name":"react-table/src/index.tsx","uid":"0e66-129"}]}]}],"isRoot":true},"nodeParts":{"0e66-127":{"renderedLength":138541,"gzipLength":24040,"brotliLength":0,"mainUid":"0e66-126"},"0e66-129":{"renderedLength":1900,"gzipLength":752,"brotliLength":0,"mainUid":"0e66-128"}},"nodeMetas":{"0e66-126":{"id":"/packages/table-core/build/esm/index.js","moduleParts":{"index.production.js":"0e66-127"},"imported":[],"importedBy":[{"uid":"0e66-128"}]},"0e66-128":{"id":"/packages/react-table/src/index.tsx","moduleParts":{"index.production.js":"0e66-129"},"imported":[{"uid":"0e66-130"},{"uid":"0e66-126"}],"importedBy":[],"isEntry":true},"0e66-130":{"id":"react","moduleParts":{},"imported":[],"importedBy":[{"uid":"0e66-128"}],"isExternal":true}},"env":{"rollup":"2.79.0"},"options":{"gzip":true,"brotli":false,"sourcemap":false}};
4018
4018
 
4019
4019
  const run = () => {
4020
4020
  const width = window.innerWidth;
@@ -11,11 +11,11 @@
11
11
  "children": [
12
12
  {
13
13
  "name": "table-core/build/esm/index.js",
14
- "uid": "00d2-132"
14
+ "uid": "0e66-132"
15
15
  },
16
16
  {
17
17
  "name": "react-table/src/index.tsx",
18
- "uid": "00d2-134"
18
+ "uid": "0e66-134"
19
19
  }
20
20
  ]
21
21
  }
@@ -25,62 +25,62 @@
25
25
  "isRoot": true
26
26
  },
27
27
  "nodeParts": {
28
- "00d2-132": {
29
- "renderedLength": 138375,
30
- "gzipLength": 24016,
28
+ "0e66-132": {
29
+ "renderedLength": 138541,
30
+ "gzipLength": 24040,
31
31
  "brotliLength": 0,
32
- "mainUid": "00d2-131"
32
+ "mainUid": "0e66-131"
33
33
  },
34
- "00d2-134": {
34
+ "0e66-134": {
35
35
  "renderedLength": 1900,
36
36
  "gzipLength": 752,
37
37
  "brotliLength": 0,
38
- "mainUid": "00d2-133"
38
+ "mainUid": "0e66-133"
39
39
  }
40
40
  },
41
41
  "nodeMetas": {
42
- "00d2-131": {
42
+ "0e66-131": {
43
43
  "id": "/packages/table-core/build/esm/index.js",
44
44
  "moduleParts": {
45
- "index.production.js": "00d2-132"
45
+ "index.production.js": "0e66-132"
46
46
  },
47
47
  "imported": [],
48
48
  "importedBy": [
49
49
  {
50
- "uid": "00d2-133"
50
+ "uid": "0e66-133"
51
51
  }
52
52
  ]
53
53
  },
54
- "00d2-133": {
54
+ "0e66-133": {
55
55
  "id": "/packages/react-table/src/index.tsx",
56
56
  "moduleParts": {
57
- "index.production.js": "00d2-134"
57
+ "index.production.js": "0e66-134"
58
58
  },
59
59
  "imported": [
60
60
  {
61
- "uid": "00d2-135"
61
+ "uid": "0e66-135"
62
62
  },
63
63
  {
64
- "uid": "00d2-131"
64
+ "uid": "0e66-131"
65
65
  }
66
66
  ],
67
67
  "importedBy": [],
68
68
  "isEntry": true
69
69
  },
70
- "00d2-135": {
70
+ "0e66-135": {
71
71
  "id": "react",
72
72
  "moduleParts": {},
73
73
  "imported": [],
74
74
  "importedBy": [
75
75
  {
76
- "uid": "00d2-133"
76
+ "uid": "0e66-133"
77
77
  }
78
78
  ],
79
79
  "isExternal": true
80
80
  }
81
81
  },
82
82
  "env": {
83
- "rollup": "2.77.2"
83
+ "rollup": "2.79.0"
84
84
  },
85
85
  "options": {
86
86
  "gzip": true,
@@ -1933,7 +1933,7 @@
1933
1933
  }),
1934
1934
  getRightVisibleCells: memo(() => [row._getAllVisibleCells(), table.getState().columnPinning.right], (allCells, right) => {
1935
1935
  const cells = (right != null ? right : []).map(columnId => allCells.find(cell => cell.column.id === columnId)).filter(Boolean).map(d => ({ ...d,
1936
- position: 'left'
1936
+ position: 'right'
1937
1937
  }));
1938
1938
  return cells;
1939
1939
  }, {
@@ -3083,13 +3083,16 @@
3083
3083
  column,
3084
3084
  getValue: () => row.getValue(columnId),
3085
3085
  renderValue: getRenderValue,
3086
- getContext: () => ({
3086
+ getContext: memo(() => [table, column, row, cell], (table, column, row, cell) => ({
3087
3087
  table,
3088
3088
  column,
3089
3089
  row,
3090
3090
  cell: cell,
3091
3091
  getValue: cell.getValue,
3092
3092
  renderValue: cell.renderValue
3093
+ }), {
3094
+ key: 'cell.getContext',
3095
+ debug: () => table.options.debugAll
3093
3096
  })
3094
3097
  };
3095
3098