@gridsheet/react-core 2.0.5-0 → 2.1.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.
package/dist/index.js CHANGED
@@ -505,21 +505,17 @@ const isXSheetFocused = (store) => {
505
505
  };
506
506
  const getCellRectPositions = (table, { y, x }) => {
507
507
  var _a, _b;
508
- let { width, height } = table.getRectSize({
509
- top: 1,
510
- left: 1,
511
- bottom: y,
512
- right: x
513
- });
514
- width += table.headerWidth;
515
- height += table.headerHeight;
516
- const w = ((_a = table.getCellByPoint({ y: 0, x }, "SYSTEM")) == null ? void 0 : _a.width) || DEFAULT_WIDTH;
517
- const h = ((_b = table.getCellByPoint({ y, x: 0 }, "SYSTEM")) == null ? void 0 : _b.height) || DEFAULT_HEIGHT;
508
+ const colCell = table.getCellByPoint({ y: 0, x }, "SYSTEM");
509
+ const rowCell = table.getCellByPoint({ y, x: 0 }, "SYSTEM");
510
+ const left = ((_a = colCell == null ? void 0 : colCell.system) == null ? void 0 : _a.offsetLeft) ?? 0;
511
+ const top = ((_b = rowCell == null ? void 0 : rowCell.system) == null ? void 0 : _b.offsetTop) ?? 0;
512
+ const w = (colCell == null ? void 0 : colCell.width) || DEFAULT_WIDTH;
513
+ const h = (rowCell == null ? void 0 : rowCell.height) || DEFAULT_HEIGHT;
518
514
  return {
519
- top: height,
520
- left: width,
521
- bottom: height + h,
522
- right: width + w,
515
+ top,
516
+ left,
517
+ bottom: top + h,
518
+ right: left + w,
523
519
  width: w,
524
520
  height: h
525
521
  };
@@ -3192,7 +3188,6 @@ class InsertRowsAboveAction extends CoreAction {
3192
3188
  });
3193
3189
  return {
3194
3190
  ...store,
3195
- ...table.getTotalSize(),
3196
3191
  tableReactive: { current: table }
3197
3192
  };
3198
3193
  }
@@ -3230,7 +3225,6 @@ class InsertRowsBelowAction extends CoreAction {
3230
3225
  });
3231
3226
  return {
3232
3227
  ...store,
3233
- ...table.getTotalSize(),
3234
3228
  selectingZone: nextSelectingZone,
3235
3229
  choosing: nextChoosing,
3236
3230
  tableReactive: { current: table }
@@ -3264,7 +3258,6 @@ class InsertColsLeftAction extends CoreAction {
3264
3258
  });
3265
3259
  return {
3266
3260
  ...store,
3267
- ...table.getTotalSize(),
3268
3261
  tableReactive: { current: table }
3269
3262
  };
3270
3263
  }
@@ -3304,7 +3297,6 @@ class InsertColsRightAction extends CoreAction {
3304
3297
  });
3305
3298
  return {
3306
3299
  ...store,
3307
- ...table.getTotalSize(),
3308
3300
  selectingZone: nextSelectingZone,
3309
3301
  choosing: nextChoosing,
3310
3302
  tableReactive: { current: table }
@@ -3338,7 +3330,6 @@ class RemoveRowsAction extends CoreAction {
3338
3330
  });
3339
3331
  return {
3340
3332
  ...store,
3341
- ...table.getTotalSize(),
3342
3333
  tableReactive: { current: table }
3343
3334
  };
3344
3335
  }
@@ -3370,7 +3361,6 @@ class RemoveColsAction extends CoreAction {
3370
3361
  });
3371
3362
  return {
3372
3363
  ...store,
3373
- ...table.getTotalSize(),
3374
3364
  tableReactive: { current: table }
3375
3365
  };
3376
3366
  }
@@ -4652,8 +4642,7 @@ const Resizer = () => {
4652
4642
  });
4653
4643
  dispatch(
4654
4644
  setStore({
4655
- tableReactive: { current: table },
4656
- ...table.getTotalSize()
4645
+ tableReactive: { current: table }
4657
4646
  })
4658
4647
  );
4659
4648
  dispatch(setResizingPositionY([-1, -1, -1]));
@@ -7717,6 +7706,8 @@ class Table {
7717
7706
  this.prevSheetName = "";
7718
7707
  this.status = 0;
7719
7708
  this.idsToBeIdentified = [];
7709
+ this.totalWidth = 0;
7710
+ this.totalHeight = 0;
7720
7711
  this.version = 0;
7721
7712
  this.area = { top: 0, left: 0, bottom: 0, right: 0 };
7722
7713
  this.addressCaches = /* @__PURE__ */ new Map();
@@ -7893,42 +7884,63 @@ class Table {
7893
7884
  return (this.wire.cellHead++).toString(36);
7894
7885
  }
7895
7886
  getRectSize({ top, left, bottom, right }) {
7896
- var _a, _b;
7897
- let width = 0, height = 0;
7898
- for (let x = left || 1; x < right; x++) {
7899
- width += ((_a = this.getCellByPoint({ y: 0, x }, "SYSTEM")) == null ? void 0 : _a.width) || DEFAULT_WIDTH;
7900
- }
7901
- for (let y = top || 1; y < bottom; y++) {
7902
- height += ((_b = this.getCellByPoint({ y, x: 0 }, "SYSTEM")) == null ? void 0 : _b.height) || DEFAULT_HEIGHT;
7903
- }
7887
+ var _a, _b, _c, _d;
7888
+ const l = left || 1;
7889
+ const t = top || 1;
7890
+ const colRightCell = this.getCellByPoint({ y: 0, x: right }, "SYSTEM");
7891
+ const colLeftCell = this.getCellByPoint({ y: 0, x: l }, "SYSTEM");
7892
+ const rowBottomCell = this.getCellByPoint({ y: bottom, x: 0 }, "SYSTEM");
7893
+ const rowTopCell = this.getCellByPoint({ y: t, x: 0 }, "SYSTEM");
7894
+ const rw = ((_a = colRightCell == null ? void 0 : colRightCell.system) == null ? void 0 : _a.offsetLeft) ?? 0;
7895
+ const lw = ((_b = colLeftCell == null ? void 0 : colLeftCell.system) == null ? void 0 : _b.offsetLeft) ?? 0;
7896
+ const rh = ((_c = rowBottomCell == null ? void 0 : rowBottomCell.system) == null ? void 0 : _c.offsetTop) ?? 0;
7897
+ const th = ((_d = rowTopCell == null ? void 0 : rowTopCell.system) == null ? void 0 : _d.offsetTop) ?? 0;
7898
+ const width = Math.max(0, rw - lw);
7899
+ const height = Math.max(0, rh - th);
7904
7900
  return { width, height };
7905
7901
  }
7906
- getTotalSize() {
7907
- const { bottom, right } = this.area;
7908
- const { width, height } = this.getRectSize({
7909
- top: 1,
7910
- left: 1,
7911
- bottom: bottom + 1,
7912
- right: right + 1
7913
- });
7914
- return {
7915
- totalWidth: width + this.headerWidth,
7916
- totalHeight: height + this.headerHeight
7917
- };
7918
- }
7919
- refresh(keepAddressCache = true) {
7902
+ setTotalSize() {
7903
+ const numCols = this.getNumCols();
7904
+ const numRows = this.getNumRows();
7905
+ const headerW = this.headerWidth;
7906
+ const headerH = this.headerHeight;
7907
+ let accW = 0;
7908
+ for (let x = 1; x <= numCols; x++) {
7909
+ const cell = this.getCellByPoint({ y: 0, x }, "SYSTEM");
7910
+ const w = (cell == null ? void 0 : cell.width) || DEFAULT_WIDTH;
7911
+ if (cell == null ? void 0 : cell.system) {
7912
+ cell.system.offsetLeft = headerW + accW;
7913
+ }
7914
+ accW += w;
7915
+ }
7916
+ this.totalWidth = headerW + accW;
7917
+ let accH = 0;
7918
+ for (let y = 1; y <= numRows; y++) {
7919
+ const cell = this.getCellByPoint({ y, x: 0 }, "SYSTEM");
7920
+ const h = (cell == null ? void 0 : cell.height) || DEFAULT_HEIGHT;
7921
+ if (cell == null ? void 0 : cell.system) {
7922
+ cell.system.offsetTop = headerH + accH;
7923
+ }
7924
+ accH += h;
7925
+ }
7926
+ this.totalHeight = headerH + accH;
7927
+ }
7928
+ refresh(relocate = false, resize = false) {
7920
7929
  this.incrementVersion();
7921
7930
  this.lastChangedAt = this.changedAt;
7922
7931
  this.changedAt = /* @__PURE__ */ new Date();
7923
7932
  this.clearSolvedCaches();
7924
- if (!keepAddressCache) {
7933
+ if (relocate) {
7925
7934
  this.addressCaches.clear();
7926
7935
  }
7936
+ if (resize) {
7937
+ this.setTotalSize();
7938
+ }
7927
7939
  return this;
7928
7940
  }
7929
- clone(keepAddressCache = true) {
7941
+ clone(relocate = false) {
7930
7942
  const copied = Object.assign(Object.create(Object.getPrototypeOf(this)), this);
7931
- return copied.refresh(keepAddressCache);
7943
+ return copied.refresh(relocate);
7932
7944
  }
7933
7945
  getPointById(id, slideY = 0, slideX = 0) {
7934
7946
  const absCol = id.startsWith("$");
@@ -8446,7 +8458,7 @@ class Table {
8446
8458
  this.wire.onEdit({ table: srcTable.__raw__.trim(src) });
8447
8459
  this.wire.onEdit({ table: this.__raw__.trim(dst) });
8448
8460
  }
8449
- return this.refresh(false);
8461
+ return this.refresh(true);
8450
8462
  }
8451
8463
  copy({
8452
8464
  srcTable = this,
@@ -8532,15 +8544,16 @@ class Table {
8532
8544
  const diffBefore = {};
8533
8545
  const diffAfter = {};
8534
8546
  const changedAt = /* @__PURE__ */ new Date();
8547
+ let resized = false;
8535
8548
  Object.keys(diff).forEach((address) => {
8536
8549
  var _a, _b, _c, _d;
8537
8550
  const point = a2p(address);
8538
8551
  const id = this.getId(point);
8539
8552
  const original = this.wire.data[id];
8540
- let patch = { ...diff[address] };
8541
8553
  if (operator === "USER" && hasOperation(original.prevention, Update)) {
8542
8554
  return;
8543
8555
  }
8556
+ let patch = { ...diff[address] };
8544
8557
  if (formulaIdentify) {
8545
8558
  patch.value = identifyFormula(patch.value, {
8546
8559
  table: this,
@@ -8570,6 +8583,9 @@ class Table {
8570
8583
  if (updateChangedAt) {
8571
8584
  this.setChangedAt(patch, changedAt);
8572
8585
  }
8586
+ if (patch.width != null || patch.height != null) {
8587
+ resized = true;
8588
+ }
8573
8589
  diffBefore[id] = { ...original };
8574
8590
  const policy = this.policies[original.policy] ?? defaultPolicy;
8575
8591
  const p = policy.restrict({
@@ -8592,7 +8608,8 @@ class Table {
8592
8608
  }
8593
8609
  return {
8594
8610
  diffBefore,
8595
- diffAfter
8611
+ diffAfter,
8612
+ resized
8596
8613
  };
8597
8614
  }
8598
8615
  update({
@@ -8605,7 +8622,7 @@ class Table {
8605
8622
  undoReflection,
8606
8623
  redoReflection
8607
8624
  }) {
8608
- const { diffBefore, diffAfter } = this._update({
8625
+ const { diffBefore, diffAfter, resized } = this._update({
8609
8626
  diff,
8610
8627
  partial,
8611
8628
  operator,
@@ -8625,7 +8642,7 @@ class Table {
8625
8642
  partial
8626
8643
  });
8627
8644
  }
8628
- return this.refresh(true);
8645
+ return this.refresh(false, resized);
8629
8646
  }
8630
8647
  writeRawCellMatrix({
8631
8648
  point,
@@ -8755,7 +8772,7 @@ class Table {
8755
8772
  cloned.addressCaches = /* @__PURE__ */ new Map();
8756
8773
  this.wire.onInsertRows({ table: cloned, y, numRows });
8757
8774
  }
8758
- return this.refresh(false);
8775
+ return this.refresh(true, true);
8759
8776
  }
8760
8777
  removeRows({
8761
8778
  y,
@@ -8817,7 +8834,7 @@ class Table {
8817
8834
  cloned.addressCaches = /* @__PURE__ */ new Map();
8818
8835
  this.wire.onRemoveRows({ table: cloned, ys: ys.reverse() });
8819
8836
  }
8820
- return this.refresh(false);
8837
+ return this.refresh(true, true);
8821
8838
  }
8822
8839
  insertCols({
8823
8840
  x,
@@ -8883,7 +8900,7 @@ class Table {
8883
8900
  cloned.addressCaches = /* @__PURE__ */ new Map();
8884
8901
  this.wire.onInsertCols({ table: cloned, x, numCols });
8885
8902
  }
8886
- return this.refresh(false);
8903
+ return this.refresh(true, true);
8887
8904
  }
8888
8905
  removeCols({
8889
8906
  x,
@@ -8948,7 +8965,7 @@ class Table {
8948
8965
  cloned.addressCaches = /* @__PURE__ */ new Map();
8949
8966
  this.wire.onRemoveCols({ table: cloned, xs: xs.reverse() });
8950
8967
  }
8951
- return this.refresh(false);
8968
+ return this.refresh(true, true);
8952
8969
  }
8953
8970
  getHistories() {
8954
8971
  return [...this.wire.histories];
@@ -9108,7 +9125,7 @@ class Table {
9108
9125
  break;
9109
9126
  }
9110
9127
  }
9111
- this.refresh(!shouldTracking(history.operation));
9128
+ this.refresh(shouldTracking(history.operation), true);
9112
9129
  return {
9113
9130
  history,
9114
9131
  callback: ({ tableReactive: tableRef }) => {
@@ -9180,7 +9197,7 @@ class Table {
9180
9197
  }
9181
9198
  }
9182
9199
  }
9183
- this.refresh(!shouldTracking(history.operation));
9200
+ this.refresh(shouldTracking(history.operation), true);
9184
9201
  return {
9185
9202
  history,
9186
9203
  callback: ({ tableReactive: tableRef }) => {
@@ -9262,7 +9279,7 @@ const safePreventDefault = (e) => {
9262
9279
  e.preventDefault();
9263
9280
  }
9264
9281
  };
9265
- const Cell = memo(({ y, x, operationStyle }) => {
9282
+ const Cell = memo(({ y, x }) => {
9266
9283
  const rowId = y2r(y);
9267
9284
  const colId = x2c(x);
9268
9285
  const address = `${colId}${rowId}`;
@@ -9498,8 +9515,7 @@ const Cell = memo(({ y, x, operationStyle }) => {
9498
9515
  "data-address": address,
9499
9516
  className: `gs-cell ${among(selectingArea, { y, x }) ? "gs-selecting" : ""} ${pointed ? "gs-choosing" : ""} ${editing ? "gs-editing" : ""}`,
9500
9517
  style: {
9501
- ...cell == null ? void 0 : cell.style,
9502
- ...operationStyle
9518
+ ...cell == null ? void 0 : cell.style
9503
9519
  },
9504
9520
  onContextMenu,
9505
9521
  onDoubleClick,
@@ -10075,6 +10091,260 @@ const HeaderCellLeft = memo(({ y }) => {
10075
10091
  }
10076
10092
  );
10077
10093
  });
10094
+ const COLOR_POINTED = "#0077ff";
10095
+ const COLOR_SELECTED = "#0077ff";
10096
+ const SELECTING_FILL = "rgba(0, 128, 255, 0.2)";
10097
+ const COLOR_COPYING = "#0077ff";
10098
+ const COLOR_CUTTING = "#0077ff";
10099
+ const SEARCH_MATCHING_BACKGROUND = "rgba(0, 200, 100, 0.2)";
10100
+ const COLOR_SEARCH_MATCHING = "#00aa78";
10101
+ const COLOR_AUTOFILL = "#444444";
10102
+ const HEADER_COLORS = {
10103
+ light: {
10104
+ selecting: "rgba(0, 0, 0, 0.1)",
10105
+ choosing: "rgba(0, 0, 0, 0.2)",
10106
+ thSelecting: "rgba(0, 0, 0, 0.55)"
10107
+ },
10108
+ dark: {
10109
+ selecting: "rgba(255, 255, 255, 0.08)",
10110
+ choosing: "rgba(255, 255, 255, 0.18)",
10111
+ thSelecting: "rgba(255, 255, 255, 0.4)"
10112
+ }
10113
+ };
10114
+ const fillRect = (ctx, x, y, width, height, color) => {
10115
+ ctx.fillStyle = color;
10116
+ ctx.fillRect(x, y, width, height);
10117
+ };
10118
+ const drawRect = (ctx, x, y, width, height, color, lineWidth = 2, dashPattern = [], fillColor) => {
10119
+ if (fillColor) {
10120
+ ctx.fillStyle = fillColor;
10121
+ ctx.fillRect(x, y, width, height);
10122
+ }
10123
+ ctx.strokeStyle = color;
10124
+ ctx.lineWidth = lineWidth;
10125
+ ctx.setLineDash(dashPattern);
10126
+ ctx.strokeRect(x + lineWidth / 2, y + lineWidth / 2, width - lineWidth, height - lineWidth);
10127
+ ctx.setLineDash([]);
10128
+ };
10129
+ const drawAreaRectViewport = (ctx, table, scrollTop, scrollLeft, viewW, viewH, area, color, lineWidth = 2, dashPattern = [], fillColor) => {
10130
+ const { top, left, bottom, right } = area;
10131
+ if (top === -1 || left === -1 || bottom === -1 || right === -1) {
10132
+ return;
10133
+ }
10134
+ const topLeft = getCellRectPositions(table, { y: top, x: left });
10135
+ const bottomRight = getCellRectPositions(table, { y: bottom, x: right });
10136
+ const x1 = topLeft.left - scrollLeft;
10137
+ const y1 = topLeft.top - scrollTop;
10138
+ const x2 = bottomRight.right - scrollLeft;
10139
+ const y2 = bottomRight.bottom - scrollTop;
10140
+ if (x2 < 0 || x1 > viewW || y2 < 0 || y1 > viewH) {
10141
+ return;
10142
+ }
10143
+ drawRect(ctx, x1, y1, x2 - x1, y2 - y1, color, lineWidth, dashPattern, fillColor);
10144
+ };
10145
+ const CellStateOverlay = ({ refs = {} }) => {
10146
+ const { store } = useContext(Context);
10147
+ const {
10148
+ tableReactive,
10149
+ tabularRef,
10150
+ choosing,
10151
+ selectingZone,
10152
+ matchingCells,
10153
+ matchingCellIndex,
10154
+ autofillDraggingTo,
10155
+ topHeaderSelecting,
10156
+ leftHeaderSelecting,
10157
+ mode,
10158
+ dragging
10159
+ } = store;
10160
+ const table = tableReactive.current;
10161
+ const canvasRef = useRef(null);
10162
+ const rafIdRef = useRef(0);
10163
+ const storeRef = useRef(store);
10164
+ storeRef.current = store;
10165
+ const drawCanvas = useCallback(() => {
10166
+ if (!table || !tabularRef.current || !canvasRef.current) {
10167
+ return;
10168
+ }
10169
+ const canvas = canvasRef.current;
10170
+ const ctx = canvas.getContext("2d");
10171
+ if (!ctx) {
10172
+ return;
10173
+ }
10174
+ const container = tabularRef.current;
10175
+ const dpr = window.devicePixelRatio || 1;
10176
+ const w = container.clientWidth;
10177
+ const h = container.clientHeight;
10178
+ if (canvas.width !== w * dpr || canvas.height !== h * dpr) {
10179
+ canvas.style.width = `${w}px`;
10180
+ canvas.style.height = `${h}px`;
10181
+ canvas.width = w * dpr;
10182
+ canvas.height = h * dpr;
10183
+ }
10184
+ ctx.setTransform(dpr, 0, 0, dpr, 0, 0);
10185
+ ctx.clearRect(0, 0, w, h);
10186
+ const { wire } = table;
10187
+ const scrollTop = container.scrollTop;
10188
+ const scrollLeft = container.scrollLeft;
10189
+ const headerW = table.headerWidth;
10190
+ const headerH = table.headerHeight;
10191
+ ctx.save();
10192
+ ctx.beginPath();
10193
+ ctx.rect(headerW, headerH, w - headerW, h - headerH);
10194
+ ctx.clip();
10195
+ const selectingArea = zoneToArea(selectingZone);
10196
+ drawAreaRectViewport(ctx, table, scrollTop, scrollLeft, w, h, selectingArea, COLOR_SELECTED, 1, [], SELECTING_FILL);
10197
+ if (autofillDraggingTo) {
10198
+ const autofill = new Autofill(storeRef.current, autofillDraggingTo);
10199
+ drawAreaRectViewport(ctx, table, scrollTop, scrollLeft, w, h, autofill.wholeArea, COLOR_AUTOFILL, 1, [5, 5]);
10200
+ }
10201
+ {
10202
+ const { y, x } = choosing;
10203
+ if (y !== -1 && x !== -1) {
10204
+ const pos = getCellRectPositions(table, { y, x });
10205
+ const vx = pos.left - scrollLeft;
10206
+ const vy = pos.top - scrollTop;
10207
+ drawRect(ctx, vx, vy, pos.width, pos.height, COLOR_POINTED, 2, []);
10208
+ }
10209
+ }
10210
+ const { copyingSheetId, copyingZone, cutting } = wire;
10211
+ if (table.sheetId === copyingSheetId) {
10212
+ const copyingArea = zoneToArea(copyingZone);
10213
+ const color = cutting ? COLOR_CUTTING : COLOR_COPYING;
10214
+ const dashPattern = cutting ? [4, 4] : [6, 4];
10215
+ drawAreaRectViewport(ctx, table, scrollTop, scrollLeft, w, h, copyingArea, color, 2.5, dashPattern);
10216
+ }
10217
+ Object.entries(refs).forEach(([ref, i]) => {
10218
+ const palette = COLOR_PALETTE[i % COLOR_PALETTE.length];
10219
+ try {
10220
+ const refArea = table.rangeToArea(ref);
10221
+ drawAreaRectViewport(ctx, table, scrollTop, scrollLeft, w, h, refArea, palette, 2, [5, 5]);
10222
+ } catch (e) {
10223
+ }
10224
+ });
10225
+ matchingCells.forEach((address, index) => {
10226
+ const { y, x } = a2p(address);
10227
+ const pos = getCellRectPositions(table, { y, x });
10228
+ const vx = pos.left - scrollLeft;
10229
+ const vy = pos.top - scrollTop;
10230
+ if (vx + pos.width < 0 || vx > w || vy + pos.height < 0 || vy > h) {
10231
+ return;
10232
+ }
10233
+ const isCurrentMatch = index === matchingCellIndex;
10234
+ drawRect(
10235
+ ctx,
10236
+ vx,
10237
+ vy,
10238
+ pos.width,
10239
+ pos.height,
10240
+ isCurrentMatch ? COLOR_SEARCH_MATCHING : "transparent",
10241
+ isCurrentMatch ? 2 : 0,
10242
+ [],
10243
+ SEARCH_MATCHING_BACKGROUND
10244
+ );
10245
+ });
10246
+ ctx.restore();
10247
+ const headerColors = HEADER_COLORS[mode] || HEADER_COLORS.light;
10248
+ const numCols = table.getNumCols();
10249
+ const numRows = table.getNumRows();
10250
+ for (let x = 1; x <= numCols; x++) {
10251
+ let color = null;
10252
+ if (between({ start: selectingZone.startX, end: selectingZone.endX }, x)) {
10253
+ color = topHeaderSelecting ? headerColors.thSelecting : headerColors.selecting;
10254
+ }
10255
+ if (choosing.x === x) {
10256
+ color = headerColors.choosing;
10257
+ }
10258
+ if (!color) {
10259
+ continue;
10260
+ }
10261
+ const pos = getCellRectPositions(table, { y: 1, x });
10262
+ const left = pos.left - scrollLeft;
10263
+ if (left + pos.width < headerW || left > w) {
10264
+ continue;
10265
+ }
10266
+ fillRect(ctx, left, 0, pos.width, headerH, color);
10267
+ }
10268
+ for (let y = 1; y <= numRows; y++) {
10269
+ let color = null;
10270
+ if (between({ start: selectingZone.startY, end: selectingZone.endY }, y)) {
10271
+ color = leftHeaderSelecting ? headerColors.thSelecting : headerColors.selecting;
10272
+ }
10273
+ if (choosing.y === y) {
10274
+ color = headerColors.choosing;
10275
+ }
10276
+ if (!color) {
10277
+ continue;
10278
+ }
10279
+ const pos = getCellRectPositions(table, { y, x: 1 });
10280
+ const top = pos.top - scrollTop;
10281
+ if (top + pos.height < headerH || top > h) {
10282
+ continue;
10283
+ }
10284
+ fillRect(ctx, 0, top, headerW, pos.height, color);
10285
+ }
10286
+ }, [
10287
+ table,
10288
+ tabularRef,
10289
+ choosing,
10290
+ selectingZone,
10291
+ matchingCells,
10292
+ matchingCellIndex,
10293
+ autofillDraggingTo,
10294
+ topHeaderSelecting,
10295
+ leftHeaderSelecting,
10296
+ mode,
10297
+ dragging,
10298
+ refs
10299
+ ]);
10300
+ const scheduleDrawCanvas = useCallback(() => {
10301
+ cancelAnimationFrame(rafIdRef.current);
10302
+ rafIdRef.current = requestAnimationFrame(drawCanvas);
10303
+ }, [drawCanvas]);
10304
+ const handleScroll = useCallback(() => {
10305
+ drawCanvas();
10306
+ }, [drawCanvas]);
10307
+ useEffect(() => {
10308
+ scheduleDrawCanvas();
10309
+ return () => cancelAnimationFrame(rafIdRef.current);
10310
+ }, [scheduleDrawCanvas]);
10311
+ useEffect(() => {
10312
+ const container = tabularRef.current;
10313
+ if (!container) {
10314
+ return;
10315
+ }
10316
+ container.addEventListener("scroll", handleScroll);
10317
+ return () => {
10318
+ container.removeEventListener("scroll", handleScroll);
10319
+ };
10320
+ }, [tabularRef, handleScroll]);
10321
+ return /* @__PURE__ */ jsx(
10322
+ "div",
10323
+ {
10324
+ style: {
10325
+ position: "sticky",
10326
+ top: 0,
10327
+ left: 0,
10328
+ width: 0,
10329
+ height: 0,
10330
+ overflow: "visible",
10331
+ pointerEvents: "none",
10332
+ zIndex: 10
10333
+ },
10334
+ children: /* @__PURE__ */ jsx(
10335
+ "canvas",
10336
+ {
10337
+ ref: canvasRef,
10338
+ className: "gs-cell-state-overlay",
10339
+ style: {
10340
+ pointerEvents: "none",
10341
+ display: "block"
10342
+ }
10343
+ }
10344
+ )
10345
+ }
10346
+ );
10347
+ };
10078
10348
  const Tabular = () => {
10079
10349
  var _a, _b, _c, _d, _e, _f, _g, _h, _i;
10080
10350
  const [palette, setPalette] = useState({});
@@ -10089,9 +10359,7 @@ const Tabular = () => {
10089
10359
  sheetHeight,
10090
10360
  inputting,
10091
10361
  leftHeaderSelecting,
10092
- topHeaderSelecting,
10093
- totalWidth,
10094
- totalHeight
10362
+ topHeaderSelecting
10095
10363
  } = store;
10096
10364
  const table = tableReactive.current;
10097
10365
  const [virtualized, setVirtualized] = useState(null);
@@ -10177,13 +10445,13 @@ const Tabular = () => {
10177
10445
  }
10178
10446
  setVirtualized(virtualize(table, tabularRef.current));
10179
10447
  }, [tabularRef.current, tableReactive, (_a = mainRef.current) == null ? void 0 : _a.clientHeight, (_b = mainRef.current) == null ? void 0 : _b.clientWidth]);
10448
+ const mergedRefs = {
10449
+ ...palette,
10450
+ ...table ? table.wire.paletteBySheetName[table.sheetName] : {}
10451
+ };
10180
10452
  if (!table || !table.wire.ready) {
10181
10453
  return null;
10182
10454
  }
10183
- const operationStyles = useOperationStyles(store, {
10184
- ...palette,
10185
- ...table.wire.paletteBySheetName[table.sheetName]
10186
- });
10187
10455
  return /* @__PURE__ */ jsx(Fragment, { children: /* @__PURE__ */ jsx(
10188
10456
  "div",
10189
10457
  {
@@ -10195,212 +10463,81 @@ const Tabular = () => {
10195
10463
  ref: tabularRef,
10196
10464
  onMouseMove: handleMouseMove,
10197
10465
  onScroll: handleScroll,
10198
- children: /* @__PURE__ */ jsx(
10466
+ children: /* @__PURE__ */ jsxs(
10199
10467
  "div",
10200
10468
  {
10201
10469
  className: "gs-tabular-inner",
10202
10470
  style: {
10203
- width: totalWidth + 1,
10204
- height: totalHeight + 1
10471
+ width: table.totalWidth + 1,
10472
+ height: table.totalHeight + 1
10205
10473
  },
10206
- children: /* @__PURE__ */ jsxs("table", { className: `gs-table`, children: [
10207
- /* @__PURE__ */ jsx("thead", { className: "gs-thead", style: { height: table.headerHeight }, children: /* @__PURE__ */ jsxs("tr", { className: "gs-row", children: [
10208
- /* @__PURE__ */ jsx(
10209
- "th",
10210
- {
10211
- className: "gs-th gs-th-left gs-th-top",
10212
- style: { position: "sticky", width: table.headerWidth, height: table.headerHeight },
10213
- onClick: handleSelectAllClick,
10214
- children: /* @__PURE__ */ jsx("div", { className: "gs-th-inner", children: /* @__PURE__ */ jsx(
10215
- ScrollHandle,
10216
- {
10217
- className: leftHeaderSelecting || topHeaderSelecting ? "gs-hidden" : "",
10218
- style: { position: "absolute" },
10219
- horizontal: leftHeaderSelecting ? 0 : -1,
10220
- vertical: topHeaderSelecting ? 0 : -1
10221
- }
10222
- ) })
10223
- }
10224
- ),
10225
- /* @__PURE__ */ jsx(
10226
- "th",
10227
- {
10228
- className: "gs-adjuster gs-adjuster-horizontal gs-adjuster-horizontal-left",
10229
- style: { width: ((_c = virtualized == null ? void 0 : virtualized.adjuster) == null ? void 0 : _c.left) ?? 1 }
10230
- }
10231
- ),
10232
- (_e = (_d = virtualized == null ? void 0 : virtualized.xs) == null ? void 0 : _d.map) == null ? void 0 : _e.call(_d, (x) => /* @__PURE__ */ jsx(HeaderCellTop, { x }, x)),
10233
- /* @__PURE__ */ jsx(
10234
- "th",
10235
- {
10236
- className: "gs-adjuster gs-adjuster-horizontal gs-adjuster-horizontal-right",
10237
- style: { width: (_f = virtualized == null ? void 0 : virtualized.adjuster) == null ? void 0 : _f.right }
10238
- }
10239
- )
10240
- ] }) }),
10241
- /* @__PURE__ */ jsx("tbody", { className: "gs-table-body-adjuster", children: /* @__PURE__ */ jsxs("tr", { className: "gs-row", children: [
10242
- /* @__PURE__ */ jsx(
10243
- "th",
10244
- {
10245
- className: `gs-adjuster gs-adjuster-horizontal gs-adjuster-vertical`,
10246
- style: { height: ((_g = virtualized == null ? void 0 : virtualized.adjuster) == null ? void 0 : _g.top) ?? 1 }
10247
- }
10248
- ),
10249
- /* @__PURE__ */ jsx("td", { className: "gs-adjuster gs-adjuster-vertical" }),
10250
- (_h = virtualized == null ? void 0 : virtualized.xs) == null ? void 0 : _h.map((x) => /* @__PURE__ */ jsx("td", { className: "gs-adjuster gs-adjuster-vertical" }, x)),
10251
- /* @__PURE__ */ jsx("th", { className: `gs-adjuster gs-adjuster-horizontal gs-adjuster-vertical` })
10252
- ] }) }),
10253
- /* @__PURE__ */ jsx("tbody", { className: "gs-table-body-data", children: (_i = virtualized == null ? void 0 : virtualized.ys) == null ? void 0 : _i.map((y) => {
10254
- var _a2;
10255
- return /* @__PURE__ */ jsxs("tr", { className: "gs-row", children: [
10256
- /* @__PURE__ */ jsx(HeaderCellLeft, { y }),
10257
- /* @__PURE__ */ jsx("td", { className: "gs-adjuster gs-adjuster-horizontal gs-adjuster-horizontal-left" }),
10258
- (_a2 = virtualized == null ? void 0 : virtualized.xs) == null ? void 0 : _a2.map((x) => /* @__PURE__ */ jsx(Cell, { y, x, operationStyle: operationStyles[p2a({ y, x })] }, x)),
10259
- /* @__PURE__ */ jsx("td", { className: "gs-adjuster gs-adjuster-horizontal gs-adjuster-horizontal-right" })
10260
- ] }, y);
10261
- }) })
10262
- ] })
10474
+ children: [
10475
+ /* @__PURE__ */ jsx(CellStateOverlay, { refs: mergedRefs }),
10476
+ /* @__PURE__ */ jsxs("table", { className: `gs-table`, children: [
10477
+ /* @__PURE__ */ jsx("thead", { className: "gs-thead", style: { height: table.headerHeight }, children: /* @__PURE__ */ jsxs("tr", { className: "gs-row", children: [
10478
+ /* @__PURE__ */ jsx(
10479
+ "th",
10480
+ {
10481
+ className: "gs-th gs-th-left gs-th-top",
10482
+ style: { position: "sticky", width: table.headerWidth, height: table.headerHeight },
10483
+ onClick: handleSelectAllClick,
10484
+ children: /* @__PURE__ */ jsx("div", { className: "gs-th-inner", children: /* @__PURE__ */ jsx(
10485
+ ScrollHandle,
10486
+ {
10487
+ className: leftHeaderSelecting || topHeaderSelecting ? "gs-hidden" : "",
10488
+ style: { position: "absolute" },
10489
+ horizontal: leftHeaderSelecting ? 0 : -1,
10490
+ vertical: topHeaderSelecting ? 0 : -1
10491
+ }
10492
+ ) })
10493
+ }
10494
+ ),
10495
+ /* @__PURE__ */ jsx(
10496
+ "th",
10497
+ {
10498
+ className: "gs-adjuster gs-adjuster-horizontal gs-adjuster-horizontal-left",
10499
+ style: { width: ((_c = virtualized == null ? void 0 : virtualized.adjuster) == null ? void 0 : _c.left) ?? 1 }
10500
+ }
10501
+ ),
10502
+ (_e = (_d = virtualized == null ? void 0 : virtualized.xs) == null ? void 0 : _d.map) == null ? void 0 : _e.call(_d, (x) => /* @__PURE__ */ jsx(HeaderCellTop, { x }, x)),
10503
+ /* @__PURE__ */ jsx(
10504
+ "th",
10505
+ {
10506
+ className: "gs-adjuster gs-adjuster-horizontal gs-adjuster-horizontal-right",
10507
+ style: { width: (_f = virtualized == null ? void 0 : virtualized.adjuster) == null ? void 0 : _f.right }
10508
+ }
10509
+ )
10510
+ ] }) }),
10511
+ /* @__PURE__ */ jsx("tbody", { className: "gs-table-body-adjuster", children: /* @__PURE__ */ jsxs("tr", { className: "gs-row", children: [
10512
+ /* @__PURE__ */ jsx(
10513
+ "th",
10514
+ {
10515
+ className: `gs-adjuster gs-adjuster-horizontal gs-adjuster-vertical`,
10516
+ style: { height: ((_g = virtualized == null ? void 0 : virtualized.adjuster) == null ? void 0 : _g.top) ?? 1 }
10517
+ }
10518
+ ),
10519
+ /* @__PURE__ */ jsx("td", { className: "gs-adjuster gs-adjuster-vertical" }),
10520
+ (_h = virtualized == null ? void 0 : virtualized.xs) == null ? void 0 : _h.map((x) => /* @__PURE__ */ jsx("td", { className: "gs-adjuster gs-adjuster-vertical" }, x)),
10521
+ /* @__PURE__ */ jsx("th", { className: `gs-adjuster gs-adjuster-horizontal gs-adjuster-vertical` })
10522
+ ] }) }),
10523
+ /* @__PURE__ */ jsx("tbody", { className: "gs-table-body-data", children: (_i = virtualized == null ? void 0 : virtualized.ys) == null ? void 0 : _i.map((y) => {
10524
+ var _a2;
10525
+ return /* @__PURE__ */ jsxs("tr", { className: "gs-row", children: [
10526
+ /* @__PURE__ */ jsx(HeaderCellLeft, { y }),
10527
+ /* @__PURE__ */ jsx("td", { className: "gs-adjuster gs-adjuster-horizontal gs-adjuster-horizontal-left" }),
10528
+ (_a2 = virtualized == null ? void 0 : virtualized.xs) == null ? void 0 : _a2.map((x) => /* @__PURE__ */ jsx(Cell, { y, x }, x)),
10529
+ /* @__PURE__ */ jsx("td", { className: "gs-adjuster gs-adjuster-horizontal gs-adjuster-horizontal-right" })
10530
+ ] }, y);
10531
+ }) })
10532
+ ] })
10533
+ ]
10263
10534
  }
10264
10535
  )
10265
10536
  }
10266
10537
  ) });
10267
10538
  };
10268
- const BORDER_POINTED = "solid 2px #0077ff";
10269
- const BORDER_SELECTED = "solid 1px #0077ff";
10270
- const BORDER_CUTTING = "dotted 2px #0077ff";
10271
- const BORDER_COPYING = "dashed 2px #0077ff";
10272
- const SEARCH_MATCHING_BACKGROUND = "rgba(0,200,100,.2)";
10273
- const SEARCH_MATCHING_BORDER = "solid 2px #00aa78";
10274
- const AUTOFILL_BORDER = "dashed 1px #444444";
10275
- const useOperationStyles = (store, refs) => {
10276
- const cellStyles = {};
10277
- const updateStyle = (point, style) => {
10278
- const address = p2a(point);
10279
- cellStyles[address] = cellStyles[address] || {};
10280
- Object.assign(cellStyles[address], style);
10281
- };
10282
- const {
10283
- choosing,
10284
- selectingZone,
10285
- matchingCells,
10286
- matchingCellIndex,
10287
- tableReactive,
10288
- autofillDraggingTo,
10289
- editingAddress
10290
- } = store;
10291
- const table = tableReactive.current;
10292
- if (!table) {
10293
- return {};
10294
- }
10295
- const { wire } = table;
10296
- const { copyingSheetId, copyingZone, cutting } = wire;
10297
- const editingAnywhere = !!(wire.editingAddress || editingAddress);
10298
- {
10299
- const { top, left, bottom, right } = zoneToArea(selectingZone);
10300
- if (!editingAnywhere) {
10301
- for (let y = top; y <= bottom; y++) {
10302
- updateStyle({ y, x: left - 1 }, { borderRight: BORDER_SELECTED });
10303
- updateStyle({ y, x: left }, { borderLeft: BORDER_SELECTED });
10304
- updateStyle({ y, x: right }, { borderRight: BORDER_SELECTED });
10305
- updateStyle({ y, x: right + 1 }, { borderLeft: BORDER_SELECTED });
10306
- }
10307
- for (let x = left; x <= right; x++) {
10308
- updateStyle({ y: top - 1, x }, { borderBottom: BORDER_SELECTED });
10309
- updateStyle({ y: top, x }, { borderTop: BORDER_SELECTED });
10310
- updateStyle({ y: bottom, x }, { borderBottom: BORDER_SELECTED });
10311
- updateStyle({ y: bottom + 1, x }, { borderTop: BORDER_SELECTED });
10312
- }
10313
- }
10314
- }
10315
- if (autofillDraggingTo) {
10316
- const autofill = new Autofill(store, autofillDraggingTo);
10317
- const { top, left, bottom, right } = autofill.wholeArea;
10318
- for (let y = top; y <= bottom; y++) {
10319
- updateStyle({ y, x: left - 1 }, { borderRight: AUTOFILL_BORDER });
10320
- updateStyle({ y, x: left }, { borderLeft: AUTOFILL_BORDER });
10321
- updateStyle({ y, x: right }, { borderRight: AUTOFILL_BORDER });
10322
- updateStyle({ y, x: right + 1 }, { borderLeft: AUTOFILL_BORDER });
10323
- }
10324
- for (let x = left; x <= right; x++) {
10325
- updateStyle({ y: top - 1, x }, { borderBottom: AUTOFILL_BORDER });
10326
- updateStyle({ y: top, x }, { borderTop: AUTOFILL_BORDER });
10327
- updateStyle({ y: bottom, x }, { borderBottom: AUTOFILL_BORDER });
10328
- updateStyle({ y: bottom + 1, x }, { borderTop: AUTOFILL_BORDER });
10329
- }
10330
- }
10331
- {
10332
- const { y, x } = choosing;
10333
- updateStyle(
10334
- { y, x },
10335
- {
10336
- borderLeft: BORDER_POINTED,
10337
- borderRight: BORDER_POINTED,
10338
- borderTop: BORDER_POINTED,
10339
- borderBottom: BORDER_POINTED
10340
- }
10341
- );
10342
- updateStyle({ y, x: x - 1 }, { borderRight: BORDER_POINTED });
10343
- updateStyle({ y, x: x + 1 }, { borderLeft: BORDER_POINTED });
10344
- updateStyle({ y: y - 1, x }, { borderBottom: BORDER_POINTED });
10345
- updateStyle({ y: y + 1, x }, { borderTop: BORDER_POINTED });
10346
- }
10347
- if (table.sheetId === copyingSheetId) {
10348
- const borderStyle = cutting ? BORDER_CUTTING : BORDER_COPYING;
10349
- const { top, left, bottom, right } = zoneToArea(copyingZone);
10350
- for (let y = top; y <= bottom; y++) {
10351
- updateStyle({ y, x: left - 1 }, { borderRight: borderStyle });
10352
- updateStyle({ y, x: left }, { borderLeft: borderStyle });
10353
- updateStyle({ y, x: right }, { borderRight: borderStyle });
10354
- updateStyle({ y, x: right + 1 }, { borderLeft: borderStyle });
10355
- }
10356
- for (let x = left; x <= right; x++) {
10357
- updateStyle({ y: top - 1, x }, { borderBottom: borderStyle });
10358
- updateStyle({ y: top, x }, { borderTop: borderStyle });
10359
- updateStyle({ y: bottom, x }, { borderBottom: borderStyle });
10360
- updateStyle({ y: bottom + 1, x }, { borderTop: borderStyle });
10361
- }
10362
- }
10363
- Object.entries(refs).forEach(([ref, i]) => {
10364
- const palette = COLOR_PALETTE[i % COLOR_PALETTE.length];
10365
- const borderStyle = `dashed 2px ${palette}`;
10366
- const { top, left, bottom, right } = table.rangeToArea(ref);
10367
- for (let y = top; y <= bottom; y++) {
10368
- updateStyle({ y, x: left - 1 }, { borderRight: borderStyle });
10369
- updateStyle({ y, x: left }, { borderLeft: borderStyle });
10370
- updateStyle({ y, x: right }, { borderRight: borderStyle });
10371
- updateStyle({ y, x: right + 1 }, { borderLeft: borderStyle });
10372
- }
10373
- for (let x = left; x <= right; x++) {
10374
- updateStyle({ y: top - 1, x }, { borderBottom: borderStyle });
10375
- updateStyle({ y: top, x }, { borderTop: borderStyle });
10376
- updateStyle({ y: bottom, x }, { borderBottom: borderStyle });
10377
- updateStyle({ y: bottom + 1, x }, { borderTop: borderStyle });
10378
- }
10379
- });
10380
- matchingCells.forEach((address) => {
10381
- const { y, x } = a2p(address);
10382
- updateStyle({ y, x }, { backgroundColor: SEARCH_MATCHING_BACKGROUND });
10383
- });
10384
- if (matchingCells.length > 0) {
10385
- const { y, x } = a2p(matchingCells[matchingCellIndex]);
10386
- updateStyle(
10387
- { y, x },
10388
- {
10389
- borderLeft: SEARCH_MATCHING_BORDER,
10390
- borderRight: SEARCH_MATCHING_BORDER,
10391
- borderTop: SEARCH_MATCHING_BORDER,
10392
- borderBottom: SEARCH_MATCHING_BORDER
10393
- }
10394
- );
10395
- updateStyle({ y, x: x - 1 }, { borderRight: SEARCH_MATCHING_BORDER });
10396
- updateStyle({ y, x: x + 1 }, { borderLeft: SEARCH_MATCHING_BORDER });
10397
- updateStyle({ y: y - 1, x }, { borderBottom: SEARCH_MATCHING_BORDER });
10398
- updateStyle({ y: y + 1, x }, { borderTop: SEARCH_MATCHING_BORDER });
10399
- }
10400
- return cellStyles;
10401
- };
10402
- const LAST_MODIFIED = 1753483021;
10403
- const CSS = `.gs-root1{display:inline-block;position:relative;border-spacing:0;width:fit-content;max-width:100%;overflow:auto;font-family:"SF Pro Text","SF Pro Icons","Helvetica Neue",Helvetica,Arial,Meiryo,sans-serif;visibility:hidden;opacity:0}.gs-root1.gs-initialized{visibility:visible;opacity:1;transition:opacity .2s ease-in-out}.gs-root1 .gs-main{flex:1;max-width:100%;overflow:hidden;position:relative;box-sizing:border-box;-webkit-box-sizing:border-box;-moz-box-sizing:border-box}.gs-root1 .gs-resizing{width:100%;height:100%;position:absolute;background-color:rgba(0,127,255,.08);top:0;left:0;z-index:2}.gs-root1 .gs-line-horizontal{width:100%}.gs-root1 .gs-line-vertical{height:100%}.gs-root1 .gs-line{position:relative;top:0;left:0;border:dotted 1px #07f;box-sizing:border-box}.gs-root1 .gs-line span{font-size:10px;padding:3px;background-color:#07f;color:#fff;margin:0;position:absolute;top:0;left:0}.gs-root1 .gs-scroll-handle{width:100%;height:100%;cursor:cell}.gs-hidden{visibility:hidden;position:absolute;top:0;left:0;width:0;height:0;overflow:hidden;pointer-events:none;z-index:-1}.gs-fixed{position:fixed;top:0;left:0;z-index:1}.gs-root1[data-mode=light]{background-color:#e2e2e2;color:#000}.gs-root1[data-mode=light] .gs-main{background-color:#e2e2e2;border-right:solid 1px #ddd;border-bottom:solid 1px #ddd}.gs-root1[data-mode=light] .gs-tabular{background-color:#e2e2e2}.gs-root1[data-mode=light] .gs-formula-bar{background-color:#efefef}.gs-root1[data-mode=light] .gs-formula-bar-editor-inner{color:#555}.gs-root1[data-mode=light] .gs-cell{border-top:solid 1px #ddd;border-left:solid 1px #ddd}.gs-root1[data-mode=light] .gs-adjuster{background-color:#ddd}.gs-root1[data-mode=light] .gs-tabular-inner{background-color:#f7f7f7}.gs-root1[data-mode=light] .gs-th{background-color:#efefef;color:#666}.gs-root1[data-mode=light] .gs-th.gs-selecting{background-color:#d2d2d2}.gs-root1[data-mode=light] .gs-th.gs-choosing{background-color:#bbb}.gs-root1[data-mode=light] .gs-th.gs-th-selecting{background-color:#555;color:#fff}.gs-root1[data-mode=light] .gs-th-top{border-left:solid 1px #ddd}.gs-root1[data-mode=light] .gs-th-top .gs-th-inner{border-top:solid 1px #ddd}.gs-root1[data-mode=light] .gs-th-left{border-top:solid 1px #ddd}.gs-root1[data-mode=light] .gs-th-left .gs-th-inner{border-left:solid 1px #ddd}.gs-root1[data-mode=light] .gs-search-bar{color:rgba(0,0,0,.3)}.gs-editor[data-mode=light].gs-editing textarea{caret-color:#000000}.gs-editor[data-mode=light].gs-editing .gs-editor-hl{background-color:#f7f7f7;color:#000}.gs-editor[data-mode=light] .gs-editor-options{color:#000;background-color:#f7f7f7;border:solid 1px #ddd}.gs-root1[data-mode=dark]{background-color:#5a5a5a;color:#eee}.gs-root1[data-mode=dark] .gs-main{background-color:#3f3f3f;border-right:solid 1px #5a5a5a;border-bottom:solid 1px #5a5a5a}.gs-root1[data-mode=dark] .gs-tabular{background-color:#3f3f3f}.gs-root1[data-mode=dark] .gs-formula-bar{background-color:#4f4f4f}.gs-root1[data-mode=dark] .gs-formula-bar-editor-inner{color:#bbb}.gs-root1[data-mode=dark] .gs-cell{border-top:solid 1px #5a5a5a;border-left:solid 1px #5a5a5a}.gs-root1[data-mode=dark] .gs-adjuster{background-color:#5a5a5a}.gs-root1[data-mode=dark] .gs-tabular-inner{background-color:#212121}.gs-root1[data-mode=dark] .gs-large-editor textarea{color:#eee;caret-color:#eeeeee}.gs-root1[data-mode=dark] .gs-th{background-color:#4f4f4f;color:#eee}.gs-root1[data-mode=dark] .gs-th.gs-selecting{background-color:#606060}.gs-root1[data-mode=dark] .gs-th.gs-choosing{background-color:#777}.gs-root1[data-mode=dark] .gs-th.gs-th-selecting{background-color:#aaa;color:#444}.gs-root1[data-mode=dark] .gs-th-top{border-left:solid 1px #5a5a5a}.gs-root1[data-mode=dark] .gs-th-top .gs-th-inner{border-top:solid 1px #5a5a5a}.gs-root1[data-mode=dark] .gs-th-left{border-top:solid 1px #5a5a5a}.gs-root1[data-mode=dark] .gs-th-left .gs-th-inner{border-left:solid 1px #5a5a5a}.gs-root1[data-mode=dark] .gs-search-bar textarea{color:#eee;caret-color:#eeeeee}.gs-root1[data-mode=dark] .gs-search-bar{color:rgba(255,255,255,.3)}.gs-editor[data-mode=dark].gs-editing textarea{caret-color:#eeeeee}.gs-editor[data-mode=dark].gs-editing .gs-editor-hl{background-color:#212121;color:#eee}.gs-editor[data-mode=dark] .gs-editor-options{color:#eee;background-color:#5a5a5a;border:solid 1px #5a5a5a}.gs-cell{transition:border-color .2s ease;padding:0;margin:0;box-sizing:border-box;position:relative;font-size:13px;letter-spacing:1px;line-height:24px;cursor:cell;user-select:none;-webkit-user-select:none;-moz-user-select:none}.gs-cell .gs-cell-inner-wrap.gs-selecting{background-color:rgba(0,128,255,.2)}.gs-cell.gs-copying textarea:focus{outline:solid 1px #0077ff}.gs-cell.gs-selecting{z-index:1}.gs-cell.gs-selecting .gs-cell-inner{background-color:rgba(0,128,255,.2)}.gs-cell.gs-selecting .gs-cell-label{display:block}.gs-cell.gs-choosing{margin-top:-1px;margin-left:-1px;z-index:1}.gs-cell.gs-choosing.gs-editing{color:transparent}.gs-cell.gs-choosing .gs-cell-label{display:block}.gs-cell .gs-formula-error-triangle{position:absolute;top:0;right:0;border-top:3px solid rgba(200,0,0,.9);border-right:3px solid rgba(200,0,0,.9);border-bottom:3px solid transparent;border-left:3px solid transparent;z-index:1}.gs-cell .gs-cell-label{font-size:8px;font-weight:400;font-style:normal;font-family:math,monospace,serif;letter-spacing:1px;line-height:14px;position:absolute;top:0;right:0;background-color:rgba(0,128,255,.2);color:rgba(255,255,255,.6);padding:0 2px;display:none;opacity:.7}.gs-cell .gs-cell-inner-wrap{width:100%;height:100%;position:absolute;top:0;left:0}.gs-cell .gs-cell-inner{width:100%;height:100%;overflow:hidden;display:flex;box-sizing:border-box;border:none!important}.gs-cell .gs-cell-rendered{overflow:hidden;white-space:pre-wrap;cursor:cell;word-wrap:break-word;word-break:break-all;padding:0 2px;width:100%;height:100%}.gs-cell .gs-cell-rendered>*{position:relative}.gs-cell .gs-cell-rendered>.backface{z-index:0}.gs-cell .gs-autofill-drag{background-color:#07f;position:absolute;width:7px;height:7px;bottom:0;right:0;margin-right:-3.5px;margin-bottom:-3.5px;cursor:crosshair;z-index:1}.gs-th[data-x="1"] .gs-th-inner-wrap{border-left:none}.gs-th[data-y="1"] .gs-th-inner-wrap{border-top:none}.gs-cell[data-x="1"]{border-left:none}.gs-cell[data-y="1"]{border-top:none}.gs-contextmenu-modal{width:100%;height:100vh;z-index:3}.gs-contextmenu{z-index:3;position:fixed;background-color:#fff;padding:5px 0;border-radius:5px;box-shadow:rgba(60,64,67,.3) 0 1px 2px 0,rgba(60,64,67,.15) 0 1px 3px 1px}.gs-contextmenu ul{min-width:250px;color:#555;margin:0;padding:0}.gs-contextmenu li{padding:5px 10px;list-style-type:none;display:flex}.gs-contextmenu li.gs-enabled{cursor:pointer}.gs-contextmenu li.gs-enabled:hover{background-color:#eee}.gs-contextmenu li.gs-disabled{opacity:.5;cursor:not-allowed}.gs-contextmenu li.gs-menu-divider{background-color:#aaa;margin:10px 0;padding:0;height:1px}.gs-contextmenu li .gs-menu-name{flex:1;font-size:15px;letter-spacing:1px}.gs-contextmenu li .gs-menu-shortcut{font-size:10px;line-height:20px;color:#999}.gs-contextmenu li .gs-menu-shortcut:before{content:"( "}.gs-contextmenu li .gs-menu-shortcut:after{content:" )"}.gs-contextmenu li .gs-menu-shortcut .gs-menu-underline{text-decoration:underline}.gs-editor-hl{padding:0 2px!important;position:absolute;font-family:monospace,Arial;font-size:12px;line-height:24px;letter-spacing:1px}.gs-formula-bar-editor-inner{position:relative;display:table-cell}.gs-editor{opacity:0;z-index:-1}.gs-editor .gs-editor-inner{position:relative}.gs-editor .gs-editor-hl{box-sizing:content-box;border:solid 2px #07f;margin:-2px -1px}.gs-editor textarea{width:100%;padding:0 2px!important;position:absolute;font-size:12px;font-family:monospace,Arial;line-height:24px;letter-spacing:1px;top:0;left:0;border:none;outline:0;background-color:transparent;color:transparent;resize:none;box-sizing:border-box;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;overflow:hidden;cursor:default;white-space:pre;height:auto}.gs-editor.gs-editing{z-index:3;opacity:1}.gs-editor.gs-editing .gs-cell-label{pointer-events:none;font-family:math,monospace,serif;position:absolute;top:0;right:0;margin-top:-15px;margin-right:-2px;padding:0 2px;font-size:10px;background-color:rgba(0,119,255,.75);color:#fff;z-index:1}.gs-formula-bar{width:100%;position:relative;display:table;align-items:center;justify-content:center;border-top:solid 1px rgba(128,128,128,.3);border-left:solid 1px rgba(128,128,128,.3);border-right:solid 1px rgba(128,128,128,.3);box-sizing:border-box}.gs-formula-bar .gs-selecting-address{display:table-cell;vertical-align:middle;width:60px;color:rgba(200,200,200);font-size:13px;text-align:center}.gs-formula-bar .gs-fx{display:table-cell;vertical-align:middle;width:30px;color:rgba(200,200,200);font-style:italic;font-family:cursive;text-align:center;border-left:solid 1px rgba(128,128,128,.5);font-size:15px}.gs-formula-bar .gs-editor-hl{z-index:0;overflow-y:auto;box-sizing:border-box;white-space:pre-wrap;word-break:break-all}.gs-formula-bar textarea{position:relative;z-index:1;width:100%;vertical-align:bottom;color:transparent;border:none;background-color:transparent;padding:0 2px;box-sizing:border-box;outline:0;-webkit-box-shadow:none;-moz-box-shadow:none;box-shadow:none;font-size:12px;font-family:monospace,Arial;height:24px;line-height:24px;min-height:24px;letter-spacing:1px;resize:vertical;caret-color:rgba(128,128,128);white-space:pre-wrap;word-break:break-all}.gs-token-type-INVALID_REF{color:red}.gs-token-type-VALUE.gs-token-entity-type-boolean,.gs-token-type-VALUE.gs-token-entity-type-number{color:#39f}.gs-token-type-VALUE.gs-token-entity-type-string{color:#090}.gs-editor-options{padding:0;box-shadow:0 2px 8px rgba(0,0,0,.25);border:1px solid rgba(128,128,128,.2);border-radius:4px}.gs-editor-option{cursor:pointer;list-style:none;padding:5px;font-size:12px}.gs-editor-option:hover{background-color:rgba(128,128,128,.1)}.gs-editor-option-selected{background-color:rgba(128,128,128,.2)}.gs-adjuster{padding:0}.gs-table{margin:0}.gs-tabular{overflow:auto;display:block;box-sizing:border-box;overscroll-behavior-x:contain}.gs-tabular-inner>table{table-layout:fixed;border-collapse:collapse;border-spacing:0}.gs-th{z-index:2;padding:0;position:sticky;font-size:13px;font-weight:400;box-sizing:border-box;vertical-align:top}.gs-th .gs-resizer{position:absolute;border-color:transparent;box-sizing:border-box;z-index:2}.gs-th .gs-resizer:hover{background-color:#07f}.gs-th .gs-resizer.gs-protected{display:none}.gs-th-inner{height:100%;box-sizing:border-box;vertical-align:middle;overflow:hidden;display:flex;align-items:center;justify-content:center}.gs-th-inner-wrap{height:100%;box-sizing:border-box;background-color:transparent}.gs-th-top{top:0;overflow:hidden}.gs-th-top .gs-resizer{top:0;right:0;width:3px;cursor:e-resize}.gs-th-top .gs-resizer.gs-dragging{border-right-style:dotted;height:1000000px!important;cursor:e-resize}.gs-th-left{left:0;overflow:hidden;min-width:30px;border-top:solid 1px #ddd}.gs-th-left .gs-resizer{left:0;bottom:0;height:3px;cursor:n-resize}.gs-th-left .gs-resizer.gs-dragging{border-bottom-style:dotted;width:1000000px!important;cursor:n-resize}.gs-th-top.gs-th-left{top:0;left:0;z-index:3;border:none!important}.gs-search-bar{width:100%;display:table;align-items:center;justify-content:center;border-top:solid 1px rgba(128,128,128,.3);border-left:solid 1px rgba(128,128,128,.3);border-right:solid 1px rgba(128,128,128,.3);box-sizing:border-box;background-color:rgba(200,50,0,.2)}.gs-search-bar.gs-search-found{background-color:rgba(0,200,100,.2)}.gs-search-bar .gs-search-bar-inner{vertical-align:middle;border-left:solid 1px rgba(128,128,128,.5)}.gs-search-bar .gs-search-bar-icon{border-left:solid 1px rgba(128,128,128,.3);display:table-cell;vertical-align:middle;width:30px}.gs-search-bar textarea{background-color:transparent;border:none;padding:0 2px;box-sizing:border-box;outline:0;-webkit-box-shadow:none;-moz-box-shadow:none;box-shadow:none;font-size:12px;font-family:monospace,Arial;height:24px;line-height:24px;min-height:24px;letter-spacing:1px;caret-color:rgba(128,128,128);white-space:pre-wrap;word-break:break-all;display:table-cell;vertical-align:middle;width:100%;resize:none}.gs-search-progress{display:table-cell;color:#999;font-size:13px;width:60px;vertical-align:middle;white-space:nowrap;text-align:center}.gs-search-close{display:table-cell;cursor:pointer;vertical-align:middle;width:24px}.gs-search-casesensitive{display:table-cell;cursor:pointer;vertical-align:middle;width:30px}.gs-search-casesensitive span{font-size:14px;padding:0 3px}.gs-search-casesensitive span.gs-search-casesensitive-on{color:#07f;background-color:rgba(200,200,255,.5);border-radius:3px}@keyframes spin{0%{transform:rotate(0)}100%{transform:rotate(360deg)}}`;
10539
+ const LAST_MODIFIED = 1770663713;
10540
+ const CSS = `.gs-root1{display:inline-block;position:relative;border-spacing:0;width:fit-content;max-width:100%;line-height:normal;overflow:auto;font-family:"SF Pro Text","SF Pro Icons","Helvetica Neue",Helvetica,Arial,Meiryo,sans-serif;visibility:hidden;opacity:0}.gs-root1.gs-initialized{visibility:visible;opacity:1;transition:opacity .2s ease-in-out}.gs-root1 .gs-main{flex:1;max-width:100%;overflow:hidden;position:relative;box-sizing:border-box;-webkit-box-sizing:border-box;-moz-box-sizing:border-box}.gs-root1 .gs-resizing{width:100%;height:100%;position:absolute;background-color:rgba(0,127,255,.08);top:0;left:0;z-index:2}.gs-root1 .gs-line-horizontal{width:100%}.gs-root1 .gs-line-vertical{height:100%}.gs-root1 .gs-line{position:relative;top:0;left:0;border:dotted 1px #07f;box-sizing:border-box}.gs-root1 .gs-line span{font-size:10px;padding:3px;background-color:#07f;color:#fff;margin:0;position:absolute;top:0;left:0}.gs-root1 .gs-scroll-handle{width:100%;height:100%;cursor:cell}.gs-hidden{visibility:hidden;position:absolute;top:0;left:0;width:0;height:0;overflow:hidden;pointer-events:none;z-index:-1}.gs-fixed{position:fixed;top:0;left:0;z-index:1}.gs-root1[data-mode=light]{background-color:#e2e2e2;color:#000}.gs-root1[data-mode=light] .gs-main{background-color:#e2e2e2;border-right:solid 1px #ddd;border-bottom:solid 1px #ddd}.gs-root1[data-mode=light] .gs-tabular{background-color:#e2e2e2}.gs-root1[data-mode=light] .gs-formula-bar{background-color:#efefef}.gs-root1[data-mode=light] .gs-formula-bar-editor-inner{color:#555}.gs-root1[data-mode=light] .gs-cell{border-top:solid 1px #ddd;border-left:solid 1px #ddd}.gs-root1[data-mode=light] .gs-adjuster{background-color:#ddd}.gs-root1[data-mode=light] .gs-tabular-inner{background-color:#f7f7f7}.gs-root1[data-mode=light] .gs-th{background-color:#efefef;color:#666}.gs-root1[data-mode=light] .gs-th-top{border-left:solid 1px #ddd}.gs-root1[data-mode=light] .gs-th-top .gs-th-inner{border-top:solid 1px #ddd}.gs-root1[data-mode=light] .gs-th-left{border-top:solid 1px #ddd}.gs-root1[data-mode=light] .gs-th-left .gs-th-inner{border-left:solid 1px #ddd}.gs-root1[data-mode=light] .gs-search-bar{color:rgba(0,0,0,.3)}.gs-editor[data-mode=light].gs-editing textarea{caret-color:#000000}.gs-editor[data-mode=light].gs-editing .gs-editor-hl{background-color:#f7f7f7;color:#000}.gs-editor[data-mode=light] .gs-editor-options{color:#000;background-color:#f7f7f7;border:solid 1px #ddd}.gs-root1[data-mode=dark]{background-color:#5a5a5a;color:#eee}.gs-root1[data-mode=dark] .gs-main{background-color:#3f3f3f;border-right:solid 1px #5a5a5a;border-bottom:solid 1px #5a5a5a}.gs-root1[data-mode=dark] .gs-tabular{background-color:#3f3f3f}.gs-root1[data-mode=dark] .gs-formula-bar{background-color:#4f4f4f}.gs-root1[data-mode=dark] .gs-formula-bar-editor-inner{color:#bbb}.gs-root1[data-mode=dark] .gs-cell{border-top:solid 1px #5a5a5a;border-left:solid 1px #5a5a5a}.gs-root1[data-mode=dark] .gs-adjuster{background-color:#5a5a5a}.gs-root1[data-mode=dark] .gs-tabular-inner{background-color:#212121}.gs-root1[data-mode=dark] .gs-large-editor textarea{color:#eee;caret-color:#eeeeee}.gs-root1[data-mode=dark] .gs-th{background-color:#4f4f4f;color:#eee}.gs-root1[data-mode=dark] .gs-th-top{border-left:solid 1px #5a5a5a}.gs-root1[data-mode=dark] .gs-th-top .gs-th-inner{border-top:solid 1px #5a5a5a}.gs-root1[data-mode=dark] .gs-th-left{border-top:solid 1px #5a5a5a}.gs-root1[data-mode=dark] .gs-th-left .gs-th-inner{border-left:solid 1px #5a5a5a}.gs-root1[data-mode=dark] .gs-search-bar textarea{color:#eee;caret-color:#eeeeee}.gs-root1[data-mode=dark] .gs-search-bar{color:rgba(255,255,255,.3)}.gs-editor[data-mode=dark].gs-editing textarea{caret-color:#eeeeee}.gs-editor[data-mode=dark].gs-editing .gs-editor-hl{background-color:#212121;color:#eee}.gs-editor[data-mode=dark] .gs-editor-options{color:#eee;background-color:#5a5a5a;border:solid 1px #5a5a5a}.gs-cell{transition:border-color .2s ease;padding:0;margin:0;box-sizing:border-box;position:relative;font-size:13px;letter-spacing:1px;line-height:24px;cursor:cell;user-select:none;-webkit-user-select:none;-moz-user-select:none}.gs-cell.gs-copying textarea:focus{outline:solid 1px #0077ff}.gs-cell.gs-selecting{z-index:1}.gs-cell.gs-selecting .gs-cell-label{display:block}.gs-cell.gs-choosing{margin-top:-1px;margin-left:-1px;z-index:1}.gs-cell.gs-choosing.gs-editing{color:transparent}.gs-cell.gs-choosing .gs-cell-label{display:block}.gs-cell .gs-formula-error-triangle{position:absolute;top:0;right:0;border-top:3px solid rgba(200,0,0,.9);border-right:3px solid rgba(200,0,0,.9);border-bottom:3px solid transparent;border-left:3px solid transparent;z-index:1}.gs-cell .gs-cell-label{font-size:8px;font-weight:400;font-style:normal;font-family:math,monospace,serif;letter-spacing:1px;line-height:14px;position:absolute;top:0;right:0;background-color:rgba(0,128,255,.2);color:rgba(255,255,255,.6);padding:0 2px;display:none;opacity:.7}.gs-cell .gs-cell-inner-wrap{width:100%;height:100%;position:absolute;top:0;left:0}.gs-cell .gs-cell-inner{width:100%;height:100%;overflow:hidden;display:flex;box-sizing:border-box;border:none!important}.gs-cell .gs-cell-rendered{overflow:hidden;white-space:pre-wrap;cursor:cell;word-wrap:break-word;word-break:break-all;padding:0 2px;width:100%;height:100%}.gs-cell .gs-cell-rendered>*{position:relative}.gs-cell .gs-cell-rendered>.backface{z-index:0}.gs-cell .gs-autofill-drag{background-color:#07f;position:absolute;width:7px;height:7px;bottom:0;right:0;margin-right:-3.5px;margin-bottom:-3.5px;cursor:crosshair;z-index:1}.gs-th[data-x="1"] .gs-th-inner-wrap{border-left:none}.gs-th[data-y="1"] .gs-th-inner-wrap{border-top:none}.gs-cell[data-x="1"]{border-left:none}.gs-cell[data-y="1"]{border-top:none}.gs-contextmenu-modal{width:100%;height:100vh;z-index:3}.gs-contextmenu{z-index:3;position:fixed;background-color:#fff;padding:5px 0;border-radius:5px;box-shadow:rgba(60,64,67,.3) 0 1px 2px 0,rgba(60,64,67,.15) 0 1px 3px 1px}.gs-contextmenu ul{min-width:250px;color:#555;margin:0;padding:0}.gs-contextmenu li{padding:5px 10px;list-style-type:none;display:flex}.gs-contextmenu li.gs-enabled{cursor:pointer}.gs-contextmenu li.gs-enabled:hover{background-color:#eee}.gs-contextmenu li.gs-disabled{opacity:.5;cursor:not-allowed}.gs-contextmenu li.gs-menu-divider{background-color:#aaa;margin:10px 0;padding:0;height:1px}.gs-contextmenu li .gs-menu-name{flex:1;font-size:15px;letter-spacing:1px}.gs-contextmenu li .gs-menu-shortcut{font-size:10px;line-height:20px;color:#999}.gs-contextmenu li .gs-menu-shortcut:before{content:"( "}.gs-contextmenu li .gs-menu-shortcut:after{content:" )"}.gs-contextmenu li .gs-menu-shortcut .gs-menu-underline{text-decoration:underline}.gs-editor-hl{padding:0 2px!important;position:absolute;font-family:monospace,Arial;font-size:12px;line-height:24px;letter-spacing:1px}.gs-formula-bar-editor-inner{position:relative;display:table-cell}.gs-editor{opacity:0;z-index:-1}.gs-editor .gs-editor-inner{position:relative}.gs-editor .gs-editor-hl{box-sizing:content-box;border:solid 2px #07f;margin:-2px -1px}.gs-editor textarea{width:100%;padding:0 2px!important;position:absolute;font-size:12px;font-family:monospace,Arial;line-height:24px;letter-spacing:1px;top:0;left:0;border:none;outline:0;background-color:transparent;color:transparent;resize:none;box-sizing:border-box;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;overflow:hidden;cursor:default;white-space:pre;height:auto}.gs-editor.gs-editing{z-index:11;opacity:1}.gs-editor.gs-editing .gs-cell-label{pointer-events:none;font-family:math,monospace,serif;position:absolute;top:0;right:0;margin-top:-15px;margin-right:-2px;padding:0 2px;font-size:10px;background-color:rgba(0,119,255,.75);color:#fff;z-index:1}.gs-formula-bar{width:100%;position:relative;display:table;align-items:center;justify-content:center;border-top:solid 1px rgba(128,128,128,.3);border-left:solid 1px rgba(128,128,128,.3);border-right:solid 1px rgba(128,128,128,.3);box-sizing:border-box}.gs-formula-bar .gs-selecting-address{display:table-cell;vertical-align:middle;width:60px;color:rgba(200,200,200);font-size:13px;text-align:center}.gs-formula-bar .gs-fx{display:table-cell;vertical-align:middle;width:30px;color:rgba(200,200,200);font-style:italic;font-family:cursive;text-align:center;border-left:solid 1px rgba(128,128,128,.5);font-size:15px}.gs-formula-bar .gs-editor-hl{z-index:0;overflow-y:auto;box-sizing:border-box;white-space:pre-wrap;word-break:break-all}.gs-formula-bar textarea{position:relative;z-index:1;width:100%;vertical-align:bottom;color:transparent;border:none;background-color:transparent;padding:0 2px;box-sizing:border-box;outline:0;-webkit-box-shadow:none;-moz-box-shadow:none;box-shadow:none;font-size:12px;font-family:monospace,Arial;height:24px;line-height:24px;min-height:24px;letter-spacing:1px;resize:vertical;caret-color:rgba(128,128,128);white-space:pre-wrap;word-break:break-all}.gs-token-type-INVALID_REF{color:red}.gs-token-type-VALUE.gs-token-entity-type-boolean,.gs-token-type-VALUE.gs-token-entity-type-number{color:#39f}.gs-token-type-VALUE.gs-token-entity-type-string{color:#090}.gs-editor-options{padding:0;box-shadow:0 2px 8px rgba(0,0,0,.25);border:1px solid rgba(128,128,128,.2);border-radius:4px}.gs-editor-option{cursor:pointer;list-style:none;padding:5px;font-size:12px}.gs-editor-option:hover{background-color:rgba(128,128,128,.1)}.gs-editor-option-selected{background-color:rgba(128,128,128,.2)}.gs-adjuster{padding:0}.gs-table{margin:0}.gs-tabular{overflow:auto;display:block;box-sizing:border-box;overscroll-behavior:none;position:relative}.gs-tabular-inner>table{table-layout:fixed;border-collapse:collapse;border-spacing:0}.gs-th{z-index:2;padding:0;position:sticky;font-size:13px;font-weight:400;box-sizing:border-box;vertical-align:top}.gs-th .gs-resizer{position:absolute;border-color:transparent;box-sizing:border-box;z-index:2}.gs-th .gs-resizer:hover{background-color:#07f}.gs-th .gs-resizer.gs-protected{display:none}.gs-th-inner{height:100%;box-sizing:border-box;vertical-align:middle;overflow:hidden;display:flex;align-items:center;justify-content:center}.gs-th-inner-wrap{height:100%;box-sizing:border-box;background-color:transparent}.gs-th-top{top:0;overflow:hidden}.gs-th-top .gs-resizer{top:0;right:0;width:3px;cursor:e-resize}.gs-th-top .gs-resizer.gs-dragging{border-right-style:dotted;height:1000000px!important;cursor:e-resize}.gs-th-left{left:0;overflow:hidden;min-width:30px;border-top:solid 1px #ddd}.gs-th-left .gs-resizer{left:0;bottom:0;height:3px;cursor:n-resize}.gs-th-left .gs-resizer.gs-dragging{border-bottom-style:dotted;width:1000000px!important;cursor:n-resize}.gs-th-top.gs-th-left{top:0;left:0;z-index:3;border:none!important}.gs-search-bar{width:100%;display:table;align-items:center;justify-content:center;border-top:solid 1px rgba(128,128,128,.3);border-left:solid 1px rgba(128,128,128,.3);border-right:solid 1px rgba(128,128,128,.3);box-sizing:border-box;background-color:rgba(200,50,0,.2)}.gs-search-bar.gs-search-found{background-color:rgba(0,200,100,.2)}.gs-search-bar .gs-search-bar-inner{vertical-align:middle;border-left:solid 1px rgba(128,128,128,.5)}.gs-search-bar .gs-search-bar-icon{border-left:solid 1px rgba(128,128,128,.3);display:table-cell;vertical-align:middle;width:30px}.gs-search-bar textarea{background-color:transparent;border:none;padding:0 2px;box-sizing:border-box;outline:0;-webkit-box-shadow:none;-moz-box-shadow:none;box-shadow:none;font-size:12px;font-family:monospace,Arial;height:24px;line-height:24px;min-height:24px;letter-spacing:1px;caret-color:rgba(128,128,128);white-space:pre-wrap;word-break:break-all;display:table-cell;vertical-align:middle;width:100%;resize:none}.gs-search-progress{display:table-cell;color:#999;font-size:13px;width:60px;vertical-align:middle;white-space:nowrap;text-align:center}.gs-search-close{display:table-cell;cursor:pointer;vertical-align:middle;width:24px}.gs-search-casesensitive{display:table-cell;cursor:pointer;vertical-align:middle;width:30px}.gs-search-casesensitive span{font-size:14px;padding:0 3px}.gs-search-casesensitive span.gs-search-casesensitive-on{color:#07f;background-color:rgba(200,200,255,.5);border-radius:3px}@keyframes spin{0%{transform:rotate(0)}100%{transform:rotate(360deg)}}`;
10404
10541
  const embedStyle = () => {
10405
10542
  if (typeof window === "undefined") {
10406
10543
  return;
@@ -10735,6 +10872,7 @@ function GridSheet({
10735
10872
  style,
10736
10873
  hub: initialHub
10737
10874
  }) {
10875
+ var _a, _b;
10738
10876
  const { sheetResize, showFormulaBar = true, mode = "light" } = options;
10739
10877
  const rootRef = useRef(null);
10740
10878
  const mainRef = useRef(null);
@@ -10754,7 +10892,7 @@ function GridSheet({
10754
10892
  const sheetId = sheetIdRef.current;
10755
10893
  const tableReactive = useRef(null);
10756
10894
  const [initialState] = useState(() => {
10757
- var _a;
10895
+ var _a2;
10758
10896
  if (!sheetName) {
10759
10897
  sheetName = `Sheet${sheetId}`;
10760
10898
  console.debug("GridSheet: sheetName is not provided, using default name:", sheetName);
@@ -10771,7 +10909,8 @@ function GridSheet({
10771
10909
  table.sheetId = sheetId;
10772
10910
  wire.sheetIdsByName[sheetName] = sheetId;
10773
10911
  table.initialize(initialCells);
10774
- (_a = wire.onInit) == null ? void 0 : _a.call(wire, { table });
10912
+ (_a2 = wire.onInit) == null ? void 0 : _a2.call(wire, { table });
10913
+ table.setTotalSize();
10775
10914
  tableReactive.current = table;
10776
10915
  const store2 = {
10777
10916
  sheetId,
@@ -10807,8 +10946,7 @@ function GridSheet({
10807
10946
  maxNumRows: -1,
10808
10947
  minNumCols: 1,
10809
10948
  maxNumCols: -1,
10810
- mode: "light",
10811
- ...table.getTotalSize()
10949
+ mode: "light"
10812
10950
  };
10813
10951
  return store2;
10814
10952
  });
@@ -10824,9 +10962,9 @@ function GridSheet({
10824
10962
  const [sheetWidth, setSheetWidth] = useState((options == null ? void 0 : options.sheetWidth) || estimateSheetWidth(initialCells));
10825
10963
  useEffect(() => {
10826
10964
  const intervalId = window.setInterval(() => {
10827
- var _a, _b;
10828
- setSheetHeight(((_a = mainRef.current) == null ? void 0 : _a.clientHeight) || 0);
10829
- setSheetWidth(((_b = mainRef.current) == null ? void 0 : _b.clientWidth) || 0);
10965
+ var _a2, _b2;
10966
+ setSheetHeight(((_a2 = mainRef.current) == null ? void 0 : _a2.clientHeight) || 0);
10967
+ setSheetWidth(((_b2 = mainRef.current) == null ? void 0 : _b2.clientWidth) || 0);
10830
10968
  }, 1e3);
10831
10969
  return () => window.clearInterval(intervalId);
10832
10970
  }, []);
@@ -10859,8 +10997,8 @@ function GridSheet({
10859
10997
  ref: mainRef,
10860
10998
  style: {
10861
10999
  //width: '100%',
10862
- maxWidth: (store.totalWidth || 0) + 2,
10863
- maxHeight: (store.totalHeight || 0) + 2,
11000
+ maxWidth: (((_a = store.tableReactive.current) == null ? void 0 : _a.totalWidth) || 0) + 2,
11001
+ maxHeight: (((_b = store.tableReactive.current) == null ? void 0 : _b.totalHeight) || 0) + 2,
10864
11002
  overflow: "auto",
10865
11003
  resize: sheetResize,
10866
11004
  ...style