@stackoverflow/stacks 0.73.1 → 0.76.0

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.
Files changed (87) hide show
  1. package/LICENSE.MD +9 -9
  2. package/README.md +47 -47
  3. package/dist/controllers/index.d.ts +7 -0
  4. package/dist/controllers/s-expandable-control.d.ts +17 -0
  5. package/dist/controllers/s-modal.d.ts +97 -0
  6. package/dist/controllers/s-navigation-tablist.d.ts +36 -0
  7. package/dist/controllers/s-popover.d.ts +155 -0
  8. package/dist/controllers/s-table.d.ts +8 -0
  9. package/dist/controllers/s-tooltip.d.ts +82 -0
  10. package/dist/controllers/s-uploader.d.ts +48 -0
  11. package/dist/css/stacks.css +441 -141
  12. package/dist/css/stacks.min.css +1 -1
  13. package/dist/index.d.ts +3 -0
  14. package/dist/js/stacks.js +6130 -5488
  15. package/dist/js/stacks.min.js +1 -1
  16. package/dist/stacks.d.ts +21 -0
  17. package/lib/css/atomic/_stacks-borders.less +378 -378
  18. package/lib/css/atomic/_stacks-colors.less +209 -209
  19. package/lib/css/atomic/_stacks-flex.less +374 -374
  20. package/lib/css/atomic/_stacks-grid.less +174 -173
  21. package/lib/css/atomic/_stacks-misc.less +343 -342
  22. package/lib/css/atomic/_stacks-spacing.less +168 -162
  23. package/lib/css/atomic/_stacks-typography.less +273 -270
  24. package/lib/css/atomic/_stacks-width-height.less +195 -189
  25. package/lib/css/base/_stacks-body.less +44 -46
  26. package/lib/css/base/_stacks-configuration-static.less +59 -59
  27. package/lib/css/base/_stacks-icons.less +20 -20
  28. package/lib/css/base/_stacks-internals.less +220 -230
  29. package/lib/css/base/_stacks-reset-meyer.less +64 -64
  30. package/lib/css/base/_stacks-reset-normalize.less +449 -449
  31. package/lib/css/base/_stacks-reset.less +20 -20
  32. package/lib/css/components/_stacks-activity-indicator.less +45 -45
  33. package/lib/css/components/_stacks-avatars.less +189 -189
  34. package/lib/css/components/_stacks-badges.less +209 -209
  35. package/lib/css/components/_stacks-banners.less +80 -81
  36. package/lib/css/components/_stacks-blank-states.less +26 -26
  37. package/lib/css/components/_stacks-breadcrumbs.less +44 -44
  38. package/lib/css/components/_stacks-button-groups.less +104 -104
  39. package/lib/css/components/_stacks-buttons.less +658 -660
  40. package/lib/css/components/_stacks-cards.less +44 -44
  41. package/lib/css/components/_stacks-code-blocks.less +130 -130
  42. package/lib/css/components/_stacks-collapsible.less +104 -104
  43. package/lib/css/components/_stacks-inputs.less +728 -724
  44. package/lib/css/components/_stacks-link-previews.less +136 -136
  45. package/lib/css/components/_stacks-links.less +218 -218
  46. package/lib/css/components/_stacks-menu.less +47 -47
  47. package/lib/css/components/_stacks-modals.less +133 -133
  48. package/lib/css/components/_stacks-navigation.less +146 -146
  49. package/lib/css/components/_stacks-notices.less +233 -233
  50. package/lib/css/components/_stacks-page-titles.less +60 -60
  51. package/lib/css/components/_stacks-pagination.less +55 -55
  52. package/lib/css/components/_stacks-popovers.less +197 -197
  53. package/lib/css/components/_stacks-post-summary.less +425 -311
  54. package/lib/css/components/_stacks-progress-bars.less +331 -331
  55. package/lib/css/components/_stacks-prose.less +503 -503
  56. package/lib/css/components/_stacks-spinner.less +107 -107
  57. package/lib/css/components/_stacks-tables.less +341 -341
  58. package/lib/css/components/_stacks-tags.less +237 -209
  59. package/lib/css/components/_stacks-toggle-switches.less +144 -137
  60. package/lib/css/components/_stacks-topbar.less +425 -440
  61. package/lib/css/components/_stacks-uploader.less +210 -210
  62. package/lib/css/components/_stacks-user-cards.less +169 -193
  63. package/lib/css/components/_stacks-widget-dynamic.less +33 -33
  64. package/lib/css/components/_stacks-widget-static.less +272 -272
  65. package/lib/css/exports/_stacks-constants-colors.less +1112 -1098
  66. package/lib/css/exports/_stacks-constants-helpers.less +139 -139
  67. package/lib/css/exports/_stacks-constants-type.less +152 -91
  68. package/lib/css/exports/_stacks-exports.less +15 -15
  69. package/lib/css/exports/_stacks-mixins.less +220 -220
  70. package/lib/css/stacks-dynamic.less +35 -36
  71. package/lib/css/stacks-static.less +86 -86
  72. package/lib/ts/controllers/index.ts +8 -0
  73. package/lib/ts/controllers/s-expandable-control.ts +189 -190
  74. package/lib/ts/controllers/s-modal.ts +321 -323
  75. package/lib/ts/controllers/s-navigation-tablist.ts +118 -119
  76. package/lib/ts/controllers/s-popover.ts +547 -549
  77. package/lib/ts/controllers/s-table.ts +220 -220
  78. package/lib/ts/controllers/s-tooltip.ts +246 -247
  79. package/lib/ts/controllers/s-uploader.ts +172 -174
  80. package/lib/ts/index.ts +20 -0
  81. package/lib/ts/stacks.ts +88 -83
  82. package/lib/tsconfig.json +13 -11
  83. package/package.json +87 -71
  84. package/dist/css/stacks-flexgrid-shim.min.css +0 -1
  85. package/lib/css/base/_stacks-configuration-dynamic.less +0 -106
  86. package/lib/ts/finalize.ts +0 -1
  87. package/lib/ts/stimulus.d.ts +0 -4
@@ -1,220 +1,220 @@
1
- (function(){
2
- Stacks.application.register("s-table", class extends Stacks.StacksController {
3
- static targets = ["column"];
4
- readonly columnTarget!: Element;
5
- readonly columnTargets!: Element[];
6
-
7
- setCurrentSort(headElem: Element, direction: "asc" | "desc" | "none") {
8
- if (["asc", "desc", "none"].indexOf(direction) < 0) {
9
- throw "direction must be one of asc, desc, or none"
10
- }
11
- var controller = this;
12
- this.columnTargets.forEach(function (target) {
13
- var isCurrrent = target === headElem;
14
-
15
- target.classList.toggle("is-sorted", isCurrrent && direction !== "none");
16
-
17
- target.querySelectorAll(".js-sorting-indicator").forEach(function (icon) {
18
- var visible = isCurrrent ? direction : "none";
19
- icon.classList.toggle("d-none", !icon.classList.contains("js-sorting-indicator-" + visible));
20
- });
21
-
22
- if (!isCurrrent || direction === "none") {
23
- controller.removeElementData(target, "sort-direction");
24
- } else {
25
- controller.setElementData(target, "sort-direction", direction);
26
- }
27
- });
28
- };
29
-
30
- sort(evt: Event) {
31
- var controller = this;
32
- var colHead = evt.currentTarget;
33
- if (!(colHead instanceof HTMLTableCellElement)) {
34
- throw "invalid event target";
35
- }
36
- var table = this.element as HTMLTableElement;
37
- var tbody = table.tBodies[0];
38
-
39
- // the column slot number of the clicked header
40
- var colno = getCellSlot(colHead);
41
-
42
- if (colno < 0) { // this shouldn't happen if the clicked element is actually a column head
43
- return;
44
- }
45
-
46
- // an index of the <tbody>, so we can find out for each row which <td> element is
47
- // in the same column slot as the header
48
- var slotIndex = buildIndex(tbody);
49
-
50
- // the default behavior when clicking a header is to sort by this column in ascending
51
- // direction, *unless* it is already sorted that way
52
- var direction = this.getElementData(colHead, "sort-direction") === "asc" ? -1 : 1;
53
-
54
- var rows = Array.from(table.tBodies[0].rows);
55
-
56
- // if this is still false after traversing the data, that means all values are integers (or empty)
57
- // and thus we'll sort numerically.
58
- var anyNonInt = false;
59
-
60
- // data will be a list of tuples [value, rowNum], where value is what we're sorting by
61
- var data: [string | number, number][] = [];
62
- var firstBottomRow: HTMLTableRowElement;
63
- rows.forEach(function (row, index) {
64
- var force = controller.getElementData(row, "sort-to");
65
- if (force === "top") {
66
- return; // rows not added to the list will automatically end up at the top
67
- } else if (force === "bottom") {
68
- if (!firstBottomRow) {
69
- firstBottomRow = row;
70
- }
71
- return;
72
- }
73
- var cell = slotIndex[index][colno];
74
- if (!cell) {
75
- data.push(["", index]);
76
- return;
77
- }
78
-
79
- // unless the to-be-sorted-by value is explicitly provided on the element via this attribute,
80
- // the value we're using is the cell's text, trimmed of any whitespace
81
- var explicit = controller.getElementData(cell, "sort-val");
82
- var d = typeof explicit === "string" ? explicit : cell.textContent!.trim();
83
-
84
- if ((d !== "") && (parseInt(d, 10) + "" !== d)) {
85
- anyNonInt = true;
86
- }
87
- data.push([d, index]);
88
- });
89
-
90
- // If all values were integers (or empty cells), sort numerically, with empty cells treated as
91
- // having the lowest possible value (i.e. sorted to the top if ascending, bottom if descending)
92
- if (!anyNonInt) {
93
- data.forEach(function (tuple) {
94
- tuple[0] = tuple[0] === "" ? Number.MIN_VALUE : parseInt(tuple[0] as string, 10);
95
- });
96
- }
97
-
98
- // We don't sort an array of <tr>, but instead an arrays of row *numbers*, because this way we
99
- // can enforce stable sorting, i.e. rows that compare equal are guaranteed to remain in the same
100
- // order (the JS standard does not gurantee this for sort()).
101
- data.sort(function (a, b) {
102
- // first compare the values (a[0])
103
- if (a[0] > b[0]) {
104
- return 1 * direction;
105
- } else if (a[0] < b[0]) {
106
- return -1 * direction;
107
- } else {
108
- // if the values are equal, compare the row numbers (a[1]) to guarantee stable sorting
109
- // (note that this comparison is independent of the sorting direction)
110
- return a[1] > b[1] ? 1 : -1;
111
- }
112
- });
113
-
114
- // this is the actual reordering of the table rows
115
- data.forEach(function (tup) {
116
- var row = rows[tup[1]];
117
- row.parentElement!.removeChild(row);
118
- if (firstBottomRow) {
119
- tbody.insertBefore(row, firstBottomRow);
120
- } else {
121
- tbody.appendChild(row);
122
- }
123
- });
124
-
125
- // update the UI and set the `data-sort-direction` attribute if appropriate, so that the next click
126
- // will cause sorting in descending direction
127
- this.setCurrentSort(colHead, direction === 1 ? "asc" : "desc");
128
- }
129
-
130
- });
131
-
132
- function buildIndex(section: HTMLTableSectionElement): HTMLTableCellElement[][] {
133
- const result = buildIndexOrGetCellSlot(section);
134
- if (!(result instanceof Array)) {
135
- throw "shouldn't happen"
136
- }
137
- return result;
138
- }
139
-
140
- function getCellSlot(cell: HTMLTableCellElement): number {
141
- if (!(cell.parentElement && cell.parentElement.parentElement instanceof HTMLTableSectionElement)) {
142
- throw "invalid table"
143
- }
144
- const result = buildIndexOrGetCellSlot(cell.parentElement.parentElement, cell);
145
- if (typeof result !== "number") {
146
- throw "shouldn't happen"
147
- }
148
- return result
149
- }
150
-
151
- // Just because a <td> is the 4th *child* of its <tr> doesn't mean it belongs to the 4th *column*
152
- // of the table. Previous cells may have a colspan; cells in previous rows may have a rowspan.
153
- // Because we need to know which header cells and data cells belong together, we have to 1) find out
154
- // which column number (or "slot" as we call it here) the header cell has, and 2) for each row find
155
- // out which <td> cell corresponds to this slot (because those are the rows we're sorting by).
156
- //
157
- // That's what the following function does. If the second argument is not given, it returns an index
158
- // of the table, which is an array of arrays. Each of the sub-arrays corresponds to a table row. The
159
- // indices of the sub-array correspond to column slots; the values are the actual table cell elements.
160
- // For example index[4][3] is the <td> or <th> in row 4, column 3 of the table section (<tbody> or <thead>).
161
- // Note that this element is not necessarily even in the 4th (zero-based) <tr> -- if it has a rowSpan > 1,
162
- // it may also be in a previous <tr>.
163
- //
164
- // If the second argument is given, it's a <td> or <th> that we're trying to find, and the algorithm
165
- // stops as soon as it has found it and the function returns its slot number.
166
- function buildIndexOrGetCellSlot(section: HTMLTableSectionElement, findCell?: HTMLTableCellElement) {
167
- var index = [];
168
- var curRow = section.children[0];
169
-
170
- // the elements of these two arrays are synchronized; the first array contains table cell elements,
171
- // the second one contains a number that indicates for how many more rows this elements will
172
- // exist (i.e. the value is initially one less than the cell's rowspan, and will be decreased for each row)
173
- var growing: HTMLTableCellElement[] = [];
174
- var growingRowsLeft: number[] = [];
175
-
176
- // continue while we have actual <tr>'s left *or* we still have rowspan'ed elements that aren't done
177
- while (curRow || growingRowsLeft.some(function (e) { return e !== 0; })) {
178
- var curIndexRow: HTMLTableCellElement[] = [];
179
- index.push(curIndexRow);
180
-
181
- var curSlot = 0;
182
- if (curRow) {
183
- for (var curCellInd = 0; curCellInd < curRow.children.length; curCellInd++) {
184
- while (growingRowsLeft[curSlot]) {
185
- growingRowsLeft[curSlot]--;
186
- curIndexRow[curSlot] = growing[curSlot];
187
- curSlot++;
188
- }
189
- var cell = curRow.children[curCellInd];
190
- if (!(cell instanceof HTMLTableCellElement)) {
191
- throw "invalid table"
192
- }
193
- if (getComputedStyle(cell).display === "none") {
194
- continue;
195
- }
196
- if (cell === findCell) {
197
- return curSlot;
198
- }
199
- var nextFreeSlot = curSlot + cell.colSpan;
200
- for (; curSlot < nextFreeSlot; curSlot++) {
201
- growingRowsLeft[curSlot] = cell.rowSpan - 1; // if any of these is already growing, the table is broken -- no guarantees of anything
202
- growing[curSlot] = cell;
203
- curIndexRow[curSlot] = cell;
204
- }
205
- }
206
- }
207
- while (curSlot < growing.length) {
208
- if (growingRowsLeft[curSlot]) {
209
- growingRowsLeft[curSlot]--;
210
- curIndexRow[curSlot] = growing[curSlot];
211
- }
212
- curSlot++;
213
- }
214
- if (curRow) {
215
- curRow = curRow.nextElementSibling!;
216
- }
217
- }
218
- return findCell ? -1 : index; /* if findCell was given but we end up here, that means it isn't in this section */
219
- }
220
- })();
1
+ import * as Stacks from "../stacks";
2
+
3
+ export class TableController extends Stacks.StacksController {
4
+ static targets = ["column"];
5
+ readonly columnTarget!: Element;
6
+ readonly columnTargets!: Element[];
7
+
8
+ setCurrentSort(headElem: Element, direction: "asc" | "desc" | "none") {
9
+ if (["asc", "desc", "none"].indexOf(direction) < 0) {
10
+ throw "direction must be one of asc, desc, or none"
11
+ }
12
+ var controller = this;
13
+ this.columnTargets.forEach(function (target) {
14
+ var isCurrrent = target === headElem;
15
+
16
+ target.classList.toggle("is-sorted", isCurrrent && direction !== "none");
17
+
18
+ target.querySelectorAll(".js-sorting-indicator").forEach(function (icon) {
19
+ var visible = isCurrrent ? direction : "none";
20
+ icon.classList.toggle("d-none", !icon.classList.contains("js-sorting-indicator-" + visible));
21
+ });
22
+
23
+ if (!isCurrrent || direction === "none") {
24
+ controller.removeElementData(target, "sort-direction");
25
+ } else {
26
+ controller.setElementData(target, "sort-direction", direction);
27
+ }
28
+ });
29
+ };
30
+
31
+ sort(evt: Event) {
32
+ var controller = this;
33
+ var colHead = evt.currentTarget;
34
+ if (!(colHead instanceof HTMLTableCellElement)) {
35
+ throw "invalid event target";
36
+ }
37
+ var table = this.element as HTMLTableElement;
38
+ var tbody = table.tBodies[0];
39
+
40
+ // the column slot number of the clicked header
41
+ var colno = getCellSlot(colHead);
42
+
43
+ if (colno < 0) { // this shouldn't happen if the clicked element is actually a column head
44
+ return;
45
+ }
46
+
47
+ // an index of the <tbody>, so we can find out for each row which <td> element is
48
+ // in the same column slot as the header
49
+ var slotIndex = buildIndex(tbody);
50
+
51
+ // the default behavior when clicking a header is to sort by this column in ascending
52
+ // direction, *unless* it is already sorted that way
53
+ var direction = this.getElementData(colHead, "sort-direction") === "asc" ? -1 : 1;
54
+
55
+ var rows = Array.from(table.tBodies[0].rows);
56
+
57
+ // if this is still false after traversing the data, that means all values are integers (or empty)
58
+ // and thus we'll sort numerically.
59
+ var anyNonInt = false;
60
+
61
+ // data will be a list of tuples [value, rowNum], where value is what we're sorting by
62
+ var data: [string | number, number][] = [];
63
+ var firstBottomRow: HTMLTableRowElement;
64
+ rows.forEach(function (row, index) {
65
+ var force = controller.getElementData(row, "sort-to");
66
+ if (force === "top") {
67
+ return; // rows not added to the list will automatically end up at the top
68
+ } else if (force === "bottom") {
69
+ if (!firstBottomRow) {
70
+ firstBottomRow = row;
71
+ }
72
+ return;
73
+ }
74
+ var cell = slotIndex[index][colno];
75
+ if (!cell) {
76
+ data.push(["", index]);
77
+ return;
78
+ }
79
+
80
+ // unless the to-be-sorted-by value is explicitly provided on the element via this attribute,
81
+ // the value we're using is the cell's text, trimmed of any whitespace
82
+ var explicit = controller.getElementData(cell, "sort-val");
83
+ var d = typeof explicit === "string" ? explicit : cell.textContent!.trim();
84
+
85
+ if ((d !== "") && (parseInt(d, 10) + "" !== d)) {
86
+ anyNonInt = true;
87
+ }
88
+ data.push([d, index]);
89
+ });
90
+
91
+ // If all values were integers (or empty cells), sort numerically, with empty cells treated as
92
+ // having the lowest possible value (i.e. sorted to the top if ascending, bottom if descending)
93
+ if (!anyNonInt) {
94
+ data.forEach(function (tuple) {
95
+ tuple[0] = tuple[0] === "" ? Number.MIN_VALUE : parseInt(tuple[0] as string, 10);
96
+ });
97
+ }
98
+
99
+ // We don't sort an array of <tr>, but instead an arrays of row *numbers*, because this way we
100
+ // can enforce stable sorting, i.e. rows that compare equal are guaranteed to remain in the same
101
+ // order (the JS standard does not gurantee this for sort()).
102
+ data.sort(function (a, b) {
103
+ // first compare the values (a[0])
104
+ if (a[0] > b[0]) {
105
+ return 1 * direction;
106
+ } else if (a[0] < b[0]) {
107
+ return -1 * direction;
108
+ } else {
109
+ // if the values are equal, compare the row numbers (a[1]) to guarantee stable sorting
110
+ // (note that this comparison is independent of the sorting direction)
111
+ return a[1] > b[1] ? 1 : -1;
112
+ }
113
+ });
114
+
115
+ // this is the actual reordering of the table rows
116
+ data.forEach(function (tup) {
117
+ var row = rows[tup[1]];
118
+ row.parentElement!.removeChild(row);
119
+ if (firstBottomRow) {
120
+ tbody.insertBefore(row, firstBottomRow);
121
+ } else {
122
+ tbody.appendChild(row);
123
+ }
124
+ });
125
+
126
+ // update the UI and set the `data-sort-direction` attribute if appropriate, so that the next click
127
+ // will cause sorting in descending direction
128
+ this.setCurrentSort(colHead, direction === 1 ? "asc" : "desc");
129
+ }
130
+
131
+ }
132
+
133
+ function buildIndex(section: HTMLTableSectionElement): HTMLTableCellElement[][] {
134
+ const result = buildIndexOrGetCellSlot(section);
135
+ if (!(result instanceof Array)) {
136
+ throw "shouldn't happen"
137
+ }
138
+ return result;
139
+ }
140
+
141
+ function getCellSlot(cell: HTMLTableCellElement): number {
142
+ if (!(cell.parentElement && cell.parentElement.parentElement instanceof HTMLTableSectionElement)) {
143
+ throw "invalid table"
144
+ }
145
+ const result = buildIndexOrGetCellSlot(cell.parentElement.parentElement, cell);
146
+ if (typeof result !== "number") {
147
+ throw "shouldn't happen"
148
+ }
149
+ return result
150
+ }
151
+
152
+ // Just because a <td> is the 4th *child* of its <tr> doesn't mean it belongs to the 4th *column*
153
+ // of the table. Previous cells may have a colspan; cells in previous rows may have a rowspan.
154
+ // Because we need to know which header cells and data cells belong together, we have to 1) find out
155
+ // which column number (or "slot" as we call it here) the header cell has, and 2) for each row find
156
+ // out which <td> cell corresponds to this slot (because those are the rows we're sorting by).
157
+ //
158
+ // That's what the following function does. If the second argument is not given, it returns an index
159
+ // of the table, which is an array of arrays. Each of the sub-arrays corresponds to a table row. The
160
+ // indices of the sub-array correspond to column slots; the values are the actual table cell elements.
161
+ // For example index[4][3] is the <td> or <th> in row 4, column 3 of the table section (<tbody> or <thead>).
162
+ // Note that this element is not necessarily even in the 4th (zero-based) <tr> -- if it has a rowSpan > 1,
163
+ // it may also be in a previous <tr>.
164
+ //
165
+ // If the second argument is given, it's a <td> or <th> that we're trying to find, and the algorithm
166
+ // stops as soon as it has found it and the function returns its slot number.
167
+ function buildIndexOrGetCellSlot(section: HTMLTableSectionElement, findCell?: HTMLTableCellElement) {
168
+ var index = [];
169
+ var curRow = section.children[0];
170
+
171
+ // the elements of these two arrays are synchronized; the first array contains table cell elements,
172
+ // the second one contains a number that indicates for how many more rows this elements will
173
+ // exist (i.e. the value is initially one less than the cell's rowspan, and will be decreased for each row)
174
+ var growing: HTMLTableCellElement[] = [];
175
+ var growingRowsLeft: number[] = [];
176
+
177
+ // continue while we have actual <tr>'s left *or* we still have rowspan'ed elements that aren't done
178
+ while (curRow || growingRowsLeft.some(function (e) { return e !== 0; })) {
179
+ var curIndexRow: HTMLTableCellElement[] = [];
180
+ index.push(curIndexRow);
181
+
182
+ var curSlot = 0;
183
+ if (curRow) {
184
+ for (var curCellInd = 0; curCellInd < curRow.children.length; curCellInd++) {
185
+ while (growingRowsLeft[curSlot]) {
186
+ growingRowsLeft[curSlot]--;
187
+ curIndexRow[curSlot] = growing[curSlot];
188
+ curSlot++;
189
+ }
190
+ var cell = curRow.children[curCellInd];
191
+ if (!(cell instanceof HTMLTableCellElement)) {
192
+ throw "invalid table"
193
+ }
194
+ if (getComputedStyle(cell).display === "none") {
195
+ continue;
196
+ }
197
+ if (cell === findCell) {
198
+ return curSlot;
199
+ }
200
+ var nextFreeSlot = curSlot + cell.colSpan;
201
+ for (; curSlot < nextFreeSlot; curSlot++) {
202
+ growingRowsLeft[curSlot] = cell.rowSpan - 1; // if any of these is already growing, the table is broken -- no guarantees of anything
203
+ growing[curSlot] = cell;
204
+ curIndexRow[curSlot] = cell;
205
+ }
206
+ }
207
+ }
208
+ while (curSlot < growing.length) {
209
+ if (growingRowsLeft[curSlot]) {
210
+ growingRowsLeft[curSlot]--;
211
+ curIndexRow[curSlot] = growing[curSlot];
212
+ }
213
+ curSlot++;
214
+ }
215
+ if (curRow) {
216
+ curRow = curRow.nextElementSibling!;
217
+ }
218
+ }
219
+ return findCell ? -1 : index; /* if findCell was given but we end up here, that means it isn't in this section */
220
+ }