@sheetxl/utils-react 1.0.5 → 1.0.6

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.
@@ -1,11 +1,11 @@
1
1
  (function(){try{if(typeof document<`u`){var e=document.createElement(`style`);e.appendChild(document.createTextNode(`:root{--icon-size-sm:calc(var(--icon-size,1rem) * .875);--icon-size-md:var(--icon-size,1rem);--icon-size-lg:calc(var(--icon-size,1rem) * 1.25);--icon-size-xl:calc(var(--icon-size,1rem) * 1.5)}._Icon_1cewm_10{font-size:var(--icon-size,var(--icon-size-md));min-width:var(--icon-size,var(--icon-size-md));min-height:var(--icon-size,var(--icon-size-md));--icon-stroke-em:.085em;--icon-color:currentColor;--icon-secondary-color:color-mix(in oklab, currentColor 65%, transparent);--icon-tertiary-color:color-mix(in oklab, currentColor 40%, transparent);--icon-line-color:currentColor;--icon-main-opacity:1;--icon-secondary-opacity:.45;--icon-tertiary-opacity:.25;--icon-line-opacity:1;--icon-filter:none;filter:var(--icon-filter);vertical-align:middle;flex:none;justify-content:center;align-items:center;line-height:1;display:inline-flex}._Icon_1cewm_10 .sm{--icon-size:var(--icon-size-sm)}._Icon_1cewm_10 .md{--icon-size:var(--icon-size-md)}._Icon_1cewm_10 .lg{--icon-size:var(--icon-size-lg)}._Icon_1cewm_10 .xl{--icon-size:var(--icon-size-xl)}._Icon_1cewm_10>svg{width:var(--icon-size);height:var(--icon-size)}._Icon_1cewm_10>img{aspect-ratio:1;line-height:1;display:block}._Icon_1cewm_10 .fill,._Icon_1cewm_10 .line{--layer-color:var(--icon-color);--layer-opacity:var(--icon-main-opacity)}._Icon_1cewm_10 .tertiary{--layer-color:var(--icon-tertiary-color)}._Icon_1cewm_10 .primary{--layer-color:var(--icon-primary,var(--sxl-color-primary,#595b5e))}._Icon_1cewm_10 .accent{--layer-color:var(--icon-accent,var(--sxl-color-accent,#9c27b0))}._Icon_1cewm_10 .accent.tint{--layer-color:color-mix(in srgb, var(--icon-accent,var(--sxl-color-accent,#9c27b0)) 80%, white)}._Icon_1cewm_10 .success{--layer-color:var(--icon-success,var(--sxl-color-success,#22c55e))}._Icon_1cewm_10 .success.tint{--layer-color:color-mix(in srgb, var(--icon-success,var(--sxl-color-success,#22c55e)) 80%, white)}._Icon_1cewm_10 .info{--layer-color:var(--icon-info,var(--sxl-color-info,#3b82f6))}._Icon_1cewm_10 .warning{--layer-color:var(--icon-warning,var(--sxl-color-warning,#f59e0b))}._Icon_1cewm_10 .error{--layer-color:var(--icon-error,var(--sxl-color-error,#ef4444))}._Icon_1cewm_10 .error.tint{--layer-color:color-mix(in srgb, var(--icon-error,var(--sxl-color-error,#ef4444)) 80%, white)}._Icon_1cewm_10 .grey{--layer-color:var(--sxl-color-neutral,#ccc)}._Icon_1cewm_10 .shadow{--layer-color:var(--sxl-color-shadow,#ccc)}._Icon_1cewm_10 .fill:not(.fixed):not([fill]){fill:var(--layer-color);stroke:none}._Icon_1cewm_10 .line:not(.fixed):not([stroke]){fill:none;stroke:var(--layer-color,var(--icon-line-color));stroke-width:var(--icon-stroke-em);vector-effect:non-scaling-stroke;pointer-events:none;stroke-linecap:var(--icon-linecap,round);stroke-linejoin:var(--icon-linejoin,round);stroke-miterlimit:var(--icon-miter,4)}._Icon_1cewm_10 .fill:not(.fixed):not([fill]):not([opacity]){opacity:var(--layer-opacity)}._Icon_1cewm_10 .line:not(.fixed):not([stroke]):not([opacity]){opacity:var(--layer-opacity,var(--icon-line-opacity))}._Icon_1cewm_10 .fill.outlined:not(.fixed):not([fill]){stroke:var(--icon-outline,color-mix(in srgb, var(--layer-color) 62%, black));stroke-width:var(--icon-outline-width,1.25);stroke-linejoin:round;paint-order:stroke fill}._Icon_1cewm_10 .fill.rimmed:not(.fixed):not([fill]){--icon-outline:var(--icon-rim,light-dark(#3c3c3c,#101010));--icon-outline-width:2}._Icon_1cewm_10 .knockout{--layer-color:var(--icon-knockout,#fff)}._Icon_1cewm_10 .line.heavy:not(.fixed):not([stroke]){stroke-width:var(--icon-stroke-heavy-em,.155em)}._Icon_1cewm_10 .invert-dark{filter:var(--_sxl-image-filter,none)}._Icon_1cewm_10 .muted{opacity:calc(var(--layer-opacity,1) * .6)}@keyframes _sxl-walk_1cewm_1{to{stroke-dashoffset:0}}.icon.walking .walkable.line{stroke-dasharray:var(--walk-dash-length,5px) var(--walk-dash-gap,2px);stroke-dashoffset:calc(var(--walk-dash-length,5px) + var(--walk-dash-gap,2px));animation:_sxl-walk_1cewm_1 var(--walk-duration,.96s) linear infinite;will-change:stroke-dashoffset}._portal-root_105xh_14{pointer-events:none;z-index:1200;width:100%;height:100%;position:absolute;inset:0}._portal-root_105xh_14>*{pointer-events:auto}._fullscreen_105xh_31{z-index:1200}._dragging_at5p4_10,._dragging_at5p4_10 *{user-select:text!important}._float-popper_1z06c_1{max-width:100%;max-height:100%;font-family:var(--sxl-font-family,inherit);font-size:var(--sxl-font-size,inherit);font-weight:var(--sxl-font-weight,inherit);font-style:var(--sxl-font-style,inherit);color:var(--sxl-color-base-content,inherit);display:flex}._float-popper-grow_1z06c_14{opacity:0;will-change:transform, opacity;transition:transform .18s cubic-bezier(.4,0,.2,1),opacity .18s cubic-bezier(.4,0,.2,1);display:flex;transform:scale(.75)}._float-popper-grow_1z06c_14._entered_1z06c_22{opacity:1;transform:scale(1)}._float-popup_juap7_1{flex-direction:column;display:flex}._float-panel_qj0za_1{box-sizing:border-box;background:var(--sxl-color-base-100,#fff);color:var(--sxl-color-base-content,#000000de);border:1px solid var(--sxl-color-elevated-border,transparent);box-shadow:0 5px 5px -3px var(--sxl-color-shadow,#0003), 0 8px 10px 1px var(--sxl-color-shadow,#00000024), 0 3px 14px 2px var(--sxl-color-shadow,#0000001f);border-radius:4px;outline:none;display:flex;overflow:auto}:root{& .sxl-has-touch-thumb,& .sxl-has-touch-thumb *{--scrollbar-size:0px;--scrollbar-border-width:0px;--scrollbar-width:var(--scrollbar-size);--scrollbar-height:var(--scrollbar-size)}--scrollbar-width:var(--scrollbar-size);--scrollbar-height:var(--scrollbar-size);--scrollbar-border-radius:9999px;--scrollbar-border-width:2px;--scrollbar-min-thumb-size:24px}._scrollbar_z7hk1_1{& ::-webkit-scrollbar-button{background:0 0}border-radius:var(--scrollbar-border-radius);border:var(--scrollbar-border-width) solid transparent;flex:100%;align-items:center;display:flex;overflow:hidden;& ._track_z7hk1_29{background:var(--scrollbar-track-color);border-radius:var(--scrollbar-border-radius);border:var(--scrollbar-border-width) solid transparent;touch-action:none;box-sizing:border-box;flex:100%;position:relative;overflow:hidden}& ._thumb_z7hk1_41{background:var(--scrollbar-thumb-color);border-radius:var(--scrollbar-border-radius);touch-action:none;transition:background .12s}& ._thumb_z7hk1_41:hover{background:var(--scrollbar-active-color)}&.sxl-vertical{min-width:var(--scrollbar-width,0px);max-width:var(--scrollbar-width,100%);flex-direction:column;& ._thumb_z7hk1_41{min-height:var(--scrollbar-min-thumb-size)}& ._track_z7hk1_29{width:100%}}&.sxl-horizontal{min-height:var(--scrollbar-height,0px);max-height:var(--scrollbar-height,100%);flex-direction:row;& ._thumb_z7hk1_41{min-width:var(--scrollbar-min-thumb-size)}& ._track_z7hk1_29{height:100%}}&.sxl-dragging{& ._thumb_z7hk1_41{background:var(--scrollbar-active-color)}}&.sxl-has-touch-thumb{visibility:hidden}& ._scrollbar-button_z7hk1_90{background:0 0;border:none;justify-content:center;align-items:center;padding:0;display:flex;&>*{fill:var(--scrollbar-button-color);transition:fill .12s}&:hover:not([disabled])>*{fill:var(--scrollbar-active-color)}&[disabled]>*{fill:var(--scrollbar-button-color);opacity:.5}&.sxl-vertical{width:var(--scrollbar-width)}&.sxl-horizontal{height:var(--scrollbar-height)}}}._touch-thumb_z7hk1_125{cursor:grab;pointer-events:all;touch-action:none;will-change:opacity;opacity:.7;border-radius:9999px;transition-property:opacity;position:absolute;&:hover,&.sxl-dragging{opacity:1}}._scrollbar-themed_11amf_9,._scrollbar-colors_11amf_5{--scrollbar-track-color:color-mix(in srgb, var(--sxl-color-base-content) 4%, transparent);--scrollbar-thumb-color:color-mix(in srgb, var(--sxl-color-base-content) 26%, transparent);--scrollbar-button-color:color-mix(in srgb, var(--sxl-color-base-content) 26%, transparent);--scrollbar-active-color:var(--sxl-color-primary);--scrollbar-corner-color:var(--sxl-color-base-100)}._scrollbar-themed_11amf_9{scrollbar-color:auto;--scrollbar-width:13px;--scrollbar-height:13px;--scrollbar-border-radius:9999px;--scrollbar-border-width:2px;--scrollbar-min-thumb-size:24px}._scrollbar-themed_11amf_9::-webkit-scrollbar{background-color:var(--scrollbar-track-color);width:var(--scrollbar-width);height:var(--scrollbar-height)}._scrollbar-themed_11amf_9 ::-webkit-scrollbar{background-color:var(--scrollbar-track-color);width:var(--scrollbar-width);height:var(--scrollbar-height)}._scrollbar-themed_11amf_9::-webkit-scrollbar-button{display:none}._scrollbar-themed_11amf_9 ._scrollbar-button_11amf_40{fill:var(--scrollbar-thumb-color);transition:fill opacity .26s ease;width:var(--scrollbar-width);height:var(--scrollbar-height);background-color:#0000}._scrollbar-themed_11amf_9 ._scrollbar-button_11amf_40:hover:not([disabled]){fill:var(--scrollbar-active-color)}._scrollbar-themed_11amf_9 ._scrollbar-button_11amf_40:disabled{opacity:.8}._scrollbar-themed_11amf_9::-webkit-scrollbar-thumb{border-radius:var(--scrollbar-border-radius);background-color:var(--scrollbar-thumb-color);min-height:var(--scrollbar-min-thumb-size);min-width:var(--scrollbar-min-thumb-size);border:var(--scrollbar-border-width) solid transparent;background-clip:padding-box}._scrollbar-themed_11amf_9 ::-webkit-scrollbar-thumb{border-radius:var(--scrollbar-border-radius);background-color:var(--scrollbar-thumb-color);min-height:var(--scrollbar-min-thumb-size);min-width:var(--scrollbar-min-thumb-size);border:var(--scrollbar-border-width) solid transparent;background-clip:padding-box}._scrollbar-themed_11amf_9::-webkit-scrollbar-thumb:active{background-color:var(--scrollbar-active-color)}._scrollbar-themed_11amf_9 ::-webkit-scrollbar-thumb:active{background-color:var(--scrollbar-active-color)}._scrollbar-themed_11amf_9::-webkit-scrollbar-thumb:hover{background-color:var(--scrollbar-active-color)}._scrollbar-themed_11amf_9 ::-webkit-scrollbar-thumb:hover{background-color:var(--scrollbar-active-color)}._scrollbar-themed_11amf_9::-webkit-scrollbar-corner{background-color:var(--scrollbar-corner-color)}._scrollbar-themed_11amf_9 ::-webkit-scrollbar-corner{background-color:var(--scrollbar-corner-color)}._scrollbar-themed_11amf_9 ._pseudo-scrollbar_11amf_80{scrollbar-color:var(--scrollbar-thumb-color) transparent}._scrollbar-themed_11amf_9 ._pseudo-scrollbar_11amf_80:hover:not([disabled]){scrollbar-color:var(--scrollbar-active-color) transparent}._scrollpane_zdrii_2{min-width:min-content;min-height:min-content;display:flex;position:relative}._scrollpane-content_zdrii_20{box-sizing:border-box;flex:100%;grid-template-rows:1fr auto;grid-template-columns:1fr auto;width:100%;min-width:0;min-height:0;display:grid;position:relative}._scrollpane-content-cell_zdrii_33{grid-area:1/1/2/2;min-width:0;min-height:0;display:flex;position:relative;overflow:hidden}._vertical-container_zdrii_42{grid-area:1/2/2/3;min-height:0;display:flex}._horizontal-container_zdrii_50{grid-area:2/1/3/2;min-width:0;display:flex;overflow:hidden}._corner-container_zdrii_59{grid-area:2/2/3/3;display:flex}._touch-thumb-overlay_zdrii_68{pointer-events:none;grid-area:1/1/2/2;min-width:0;min-height:0;position:relative}/*$vite$:1*/`)),document.head.appendChild(e)}}catch(e){console.error(`vite-plugin-css-injected-by-js`,e)}})();
2
2
  /**
3
- * @license @sheetxl/utils-react - Utils React - Utilities for React capabilities needed for all SheetXL components. - v1.0.5
3
+ * @license @sheetxl/utils-react - Utils React - Utilities for React capabilities needed for all SheetXL components. - v1.0.6
4
4
  *
5
5
  * (C) 2026-present SheetXL Inc. & Michael T. Ford
6
6
  * License: MIT
7
7
  */
8
- import { i as e, n as t, r as n, t as r } from "./Bai0CVjGmw6mt_hq.mjs";
8
+ import { i as e, n as t, r as n, t as r } from "./Bs0tOutsyxrwsx85.mjs";
9
9
  import { CommonUtils as i, DefaultLanguagePackService as a, ExpectedError as o, InternalClipboard as s, Notifier as c, TimerUtils as l, fetchLocaleResourceAll as u, formatMessage as d, loadPackageLocales as f, mergeMessageFiles as p, onResourceRootsChange as m, resolveLocaleChain as h } from "@sheetxl/utils";
10
10
  import * as g from "react";
11
11
  import _, { Component as v, cloneElement as y, createContext as b, createElement as x, forwardRef as S, isValidElement as C, lazy as w, memo as T, useCallback as E, useContext as D, useEffect as O, useImperativeHandle as k, useLayoutEffect as A, useMemo as j, useReducer as M, useRef as N, useState as P, useSyncExternalStore as F, version as I } from "react";
@@ -633,12 +633,15 @@ var Le = class e {
633
633
  if (e._root !== this._root) throw Error("setParent only reorders within the same root tree.");
634
634
  for (let t = e; t; t = t._parent) if (t === this) throw Error("setParent would create a cycle.");
635
635
  }
636
- this._parent?._children.delete(this.key), this._parent = e, e?._children.set(this.key, this), this._root._bump();
636
+ this._parent?._detachChild(this), this._parent = e, e?._children.set(this.key, this), this._root._bump();
637
637
  }
638
638
  }
639
+ _detachChild(e) {
640
+ this._children.get(e.key) === e && this._children.delete(e.key);
641
+ }
639
642
  dispose() {
640
643
  for (let e of [...this._children.values()]) e.dispose();
641
- this._children.clear(), this._setupDisposer?.(), this._setupDisposer = void 0, this._defs.clear(), this._layers.clear(), this._middleware.length = 0, this._registryUnsub?.(), this._registryUnsub = void 0, this._parent?._children.delete(this.key), this._root._bump();
644
+ this._children.clear(), this._setupDisposer?.(), this._setupDisposer = void 0, this._defs.clear(), this._layers.clear(), this._middleware.length = 0, this._registryUnsub?.(), this._registryUnsub = void 0, this._parent?._detachChild(this), this._root._bump();
642
645
  }
643
646
  updateCommand(e, t) {
644
647
  let n = this._defs.get(e), r = n ? { ...n } : { key: e };
@@ -687,7 +690,7 @@ var Le = class e {
687
690
  use(t) {
688
691
  r.push(e.use(t));
689
692
  },
690
- getKeysByTag: (t) => e.collectKeysByTag(t, e),
693
+ getKeysByTag: (t, n) => e.collectKeysByTag(t, e, n?.own ? e : void 0),
691
694
  remove() {
692
695
  for (let r of n) e._removeLayer(r, t);
693
696
  n.clear();
@@ -718,14 +721,15 @@ var Le = class e {
718
721
  }
719
722
  return [...n];
720
723
  }
721
- collectKeysByTag(e, t = this._root) {
722
- let n = /* @__PURE__ */ new Set(), r = this._root._registry, i = t;
723
- for (; i;) {
724
- for (let [t, r] of i._defs) r.tags?.includes(e) && n.add(t);
725
- if (r) for (let t of r.collectKeysByTag(i.name, e)) n.add(t);
726
- i = i._parent;
724
+ collectKeysByTag(e, t = this._root, n) {
725
+ let r = /* @__PURE__ */ new Set(), i = this._root._registry, a = t;
726
+ for (; a;) {
727
+ for (let [t, n] of a._defs) n.tags?.includes(e) && r.add(t);
728
+ if (i) for (let t of i.collectKeysByTag(a.name, e)) r.add(t);
729
+ if (a === n) break;
730
+ a = a._parent;
727
731
  }
728
- return [...n];
732
+ return [...r];
729
733
  }
730
734
  getVersion() {
731
735
  return this._root._version;
@@ -912,16 +916,28 @@ var ze = class {
912
916
  register(e, t) {
913
917
  let n = {
914
918
  scope: e,
915
- z: t
919
+ z: t,
920
+ attach: null
916
921
  };
917
922
  return this._layers = [...this._layers, n], this._rechain(), () => {
918
923
  let e = this._layers.filter((e) => e !== n);
919
924
  e.length !== this._layers.length && (this._layers = e, this._rechain());
920
925
  };
921
926
  }
927
+ setAttach(e, t) {
928
+ let n = this._layers.find((t) => t.scope === e);
929
+ n && n.attach !== t && (n.attach = t, this._rechain());
930
+ }
931
+ _findAncestor(e) {
932
+ for (let t = this._base; t; t = t.getParent()) if (t.name === e) return t;
933
+ return null;
934
+ }
922
935
  _rechain() {
923
936
  let e = [...this._layers].sort((e, t) => e.z - t.z), t = this._base;
924
- for (let n of e) n.scope.setParent(t), t = n.scope;
937
+ for (let n of e) {
938
+ let e = n.attach ? this._findAncestor(n.attach) : null;
939
+ n.scope.setParent(e ?? t), t = n.scope;
940
+ }
925
941
  this._top = t, this._listeners.forEach((e) => e());
926
942
  }
927
943
  getBase() {
@@ -1229,52 +1245,61 @@ function It(e, t) {
1229
1245
  r = !0, n?.();
1230
1246
  };
1231
1247
  }
1232
- function Lt({ spec: e, scope: t, use: n, order: r, elementRef: i, region: a, scopeRef: o, children: s }) {
1233
- let c = Ft(), l = jt(), u = Nt(), d = r ?? u, f = e ? typeof e.scopeName == "string" ? e.scopeName : e.scopeName.key : null, p = j(() => e && c ? c.createChild(e.scopeName) : null, [c, f]), m = p ?? t ?? null;
1248
+ function Lt({ spec: e, scope: t, use: n, order: r, attachTo: i, elementRef: a, region: o, scopeRef: s, children: c }) {
1249
+ let l = Ft(), u = jt(), d = Nt(), f = r ?? d, p = e ? typeof e.scopeName == "string" ? e.scopeName : e.scopeName.key : null, m = j(() => e && l ? l.createChild(e.scopeName) : null, [l, p]), h = m ?? t ?? null;
1234
1250
  O(() => {
1235
- if (!p) return;
1236
- let e = l ? l.register(p, d) : void 0;
1237
- return () => {
1238
- e?.(), p.dispose();
1239
- };
1251
+ if (m && u) return u.register(m, f);
1240
1252
  }, [
1241
- p,
1242
- l,
1243
- d
1253
+ m,
1254
+ u,
1255
+ f
1244
1256
  ]);
1245
- let h = e?.contributor?.dynamic, g = e?.data;
1257
+ let g = i ?? null;
1258
+ O(() => {
1259
+ m && u && u.setAttach(m, g);
1260
+ }, [
1261
+ m,
1262
+ u,
1263
+ f,
1264
+ g
1265
+ ]), O(() => {
1266
+ if (m) return () => {
1267
+ m.dispose();
1268
+ };
1269
+ }, [m]);
1270
+ let _ = e?.contributor?.dynamic, v = e?.data;
1246
1271
  O(() => {
1247
- if (!p || !h) return;
1248
- let e = p.contribution(), t = h(e, g);
1272
+ if (!m || !_) return;
1273
+ let e = m.contribution(), t = _(e, v);
1249
1274
  return () => {
1250
1275
  typeof t == "function" && t(), e.remove();
1251
1276
  };
1252
1277
  }, [
1253
- p,
1254
- h,
1255
- g
1278
+ m,
1279
+ _,
1280
+ v
1256
1281
  ]), O(() => {
1257
- if (!p || !n) return;
1258
- let e = (Array.isArray(n) ? n : [n]).map((e) => p.use(e));
1282
+ if (!m || !n) return;
1283
+ let e = (Array.isArray(n) ? n : [n]).map((e) => m.use(e));
1259
1284
  return () => {
1260
1285
  for (let t of e) t();
1261
1286
  };
1262
- }, [p, n]), O(() => {
1263
- if (o) return o.current = m, () => {
1264
- o.current = null;
1287
+ }, [m, n]), O(() => {
1288
+ if (s) return s.current = h, () => {
1289
+ s.current = null;
1265
1290
  };
1266
- }, [o, m]);
1267
- let _ = N(null), v = i ?? _;
1268
- Rt(i || typeof s == "function" ? m : null, v, a);
1269
- let y = j(() => p ? p.getRegistry()?.getDynamic(p.name) ?? [] : [], [p]);
1291
+ }, [s, h]);
1292
+ let y = N(null), b = a ?? y;
1293
+ Rt(a || typeof c == "function" ? h : null, b, o);
1294
+ let x = j(() => m ? m.getRegistry()?.getDynamic(m.name) ?? [] : [], [m]);
1270
1295
  return R(Pt.Provider, {
1271
- value: m,
1296
+ value: h,
1272
1297
  children: ee(At.Provider, {
1273
- value: p ? null : l,
1274
- children: [p && y.map((e, t) => R(e, {
1275
- scope: p,
1276
- data: g
1277
- }, t)), typeof s == "function" ? s(v) : s]
1298
+ value: m ? null : u,
1299
+ children: [m && x.map((e, t) => R(e, {
1300
+ scope: m,
1301
+ data: v
1302
+ }, t)), typeof c == "function" ? c(b) : c]
1278
1303
  })
1279
1304
  });
1280
1305
  }
@@ -4058,30 +4083,31 @@ var Bo = (e) => R(zo, { ...e }), Vo = (e) => {
4058
4083
  }, r = t;
4059
4084
  return typeof e == "string" && ((e = e.trim().toLowerCase()).endsWith("px") ? (e = e.substring(0, e.length - 2), r = !1) : e.endsWith("%") && (e = e.substring(0, e.length - 1), r = !0), e = parseFloat(e)), r ? n.percent = e : n.pixels = e, Object.freeze(n);
4060
4085
  }, Yo = T(S((e, t) => {
4061
- let { elementBefore: n, elementAfter: r, splitDirection: i = "row", fixedPane: a = null, position: o, onPositionChange: s, minBefore: c, maxBefore: l, minAfter: u, maxAfter: d, children: f, className: p, style: m, disabled: h = !1, onDragStart: g, onDragResize: _, onDragFinish: v, propsResizer: y = Go, propsPane: b = Go, propsPaneBefore: x = Go, propsPaneAfter: S = Go, renderResizer: w = Wo } = e;
4062
- if (f) throw Error("Use elementBefore and elementAfter instead of children.");
4063
- let T = j(() => C(r) && C(n), [r, n]), E = j(() => {
4086
+ let { elementBefore: n, elementAfter: r, splitDirection: i = "row", fixedPane: a = null, collapsed: o = !1, position: s, onPositionChange: c, minBefore: l, maxBefore: u, minAfter: d, maxAfter: f, children: p, className: m, style: h, disabled: g = !1, onDragStart: _, onDragResize: v, onDragFinish: y, propsResizer: b = Go, propsPane: x = Go, propsPaneBefore: S = Go, propsPaneAfter: w = Go, renderResizer: T = Wo } = e;
4087
+ if (p) throw Error("Use elementBefore and elementAfter instead of children.");
4088
+ let E = j(() => C(r) && C(n), [r, n]), D = o && E && !!a, k = j(() => {
4064
4089
  let e = null;
4065
4090
  a && (a === "before" ? e = 0 : a === "after" && (e = 1));
4066
4091
  let t = e === null;
4067
4092
  return {
4068
4093
  fixedPaneOffset: e,
4069
4094
  isPercent: t,
4070
- minBefore: Jo(c, t),
4071
- maxBefore: Jo(l, t),
4072
- minAfter: Jo(u, t),
4073
- maxAfter: Jo(d, t)
4095
+ minBefore: Jo(l, t),
4096
+ maxBefore: Jo(u, t),
4097
+ minAfter: Jo(d, t),
4098
+ maxAfter: Jo(f, t)
4074
4099
  };
4075
4100
  }, [
4076
- c,
4101
+ a,
4077
4102
  l,
4078
4103
  u,
4079
- d
4080
- ]), D = J(s ?? (() => {}), [s]), [k, A] = P(() => Jo(o, a === null));
4104
+ d,
4105
+ f
4106
+ ]), A = J(c ?? (() => {}), [c]), [M, F] = P(() => Jo(s, a === null));
4081
4107
  O(() => {
4082
- A(Jo(o, a === null));
4083
- }, [o, a]);
4084
- let [M, { width: F, height: I }] = Hr(), [L, { width: z, height: B }] = Hr(), V = i === "row" ? z : B, te = i === "row" ? F : I, H = j(() => ((e, t, n, r) => {
4108
+ F(Jo(s, a === null));
4109
+ }, [s, a]);
4110
+ let [I, { width: L, height: z }] = Hr(), [B, { width: V, height: te }] = Hr(), H = i === "row" ? V : te, U = i === "row" ? L : z, W = j(() => ((e, t, n, r) => {
4085
4111
  let i = [null, null], a = [null, null];
4086
4112
  if (e ||= {
4087
4113
  percent: r.fixedPaneOffset === null ? 50 : null,
@@ -4105,13 +4131,13 @@ var Bo = (e) => R(zo, { ...e }), Vo = (e) => {
4105
4131
  maxBefore: `${i[0]}px`,
4106
4132
  maxAfter: `${i[1]}px`
4107
4133
  };
4108
- })(k, te, V, E), [
4109
- E,
4134
+ })(M, U, H, k), [
4110
4135
  k,
4111
- te,
4112
- V,
4136
+ M,
4137
+ U,
4138
+ H,
4113
4139
  i
4114
- ]), [U, W] = P(!1), G = J(g ?? (() => {}), [g]), ne = J(_ ?? (() => {}), [_]), re = J(v ?? (() => {}), [v]), ie = N(null), K = N(null), ae = N(null), { style: oe, className: se, ...ce } = b, le = {
4140
+ ]), [G, ne] = P(!1), re = J(_ ?? (() => {}), [_]), ie = J(v ?? (() => {}), [v]), K = J(y ?? (() => {}), [y]), ae = N(null), oe = N(null), se = N(null), { style: ce, className: le, ...ue } = x, de = {
4115
4141
  minWidth: 0,
4116
4142
  minHeight: 0,
4117
4143
  maxWidth: "100%",
@@ -4121,134 +4147,150 @@ var Bo = (e) => R(zo, { ...e }), Vo = (e) => {
4121
4147
  display: "flex",
4122
4148
  overflow: "hidden",
4123
4149
  position: "relative",
4124
- ...oe
4125
- }, { className: ue, style: de, ...fe } = x, { className: pe, style: q, ...me } = S, he = {
4150
+ ...ce
4151
+ }, { className: fe, style: pe, ...q } = S, { className: me, style: he, ...ge } = w, _e = {
4126
4152
  flex: "1 1 100%",
4127
4153
  width: "100%",
4128
- ...m,
4154
+ ...h,
4129
4155
  flexDirection: i,
4130
4156
  display: "flex"
4131
- }, { className: ge, style: _e, onPointerDown: ve, ...ye } = y, be = J((e) => {
4157
+ }, { className: ve, style: ye, onPointerDown: be, ...xe } = b, Se = J((e) => {
4132
4158
  let t = Jo(e, a === null);
4133
- A(t);
4134
- }, [a]), xe = J((e) => {
4135
- if (h || !U) return;
4136
- let t = we.current?.getBoundingClientRect(), n = 0;
4137
- n = i === "row" ? (e.clientX ?? e.touches?.[0]?.clientX) - t.x : (e.clientY ?? e.touches?.[0]?.clientY) - t.y, n = Math.max(0, Math.min(te, n)), E.fixedPaneOffset === 1 && (n = te - n), o && k?.pixels === n || A({
4159
+ F(t);
4160
+ }, [a]), Ce = J((e) => {
4161
+ if (g || !G) return;
4162
+ let t = Ee.current?.getBoundingClientRect(), n = 0;
4163
+ n = i === "row" ? (e.clientX ?? e.touches?.[0]?.clientX) - t.x : (e.clientY ?? e.touches?.[0]?.clientY) - t.y, n = Math.max(0, Math.min(U, n)), k.fixedPaneOffset === 1 && (n = U - n), s && M?.pixels === n || F({
4138
4164
  pixels: n,
4139
4165
  percent: null
4140
- }), ne?.(n), e.stopPropagation(), e.preventDefault();
4166
+ }), ie?.(n), e.stopPropagation(), e.preventDefault();
4141
4167
  }, [
4142
- E,
4143
- i,
4144
- h,
4145
- U,
4146
4168
  k,
4147
- te
4148
- ]), Se = J((e) => {
4149
- if (document.removeEventListener("pointermove", xe), document.removeEventListener("touchmove", xe), document.removeEventListener("pointerup", Se), U && (W(!1), k)) {
4150
- if (re(k.pixels ?? 0), !Jo(o, a === null) || k.pixels !== o) {
4151
- let e = k.pixels ?? 0, t = {
4169
+ i,
4170
+ g,
4171
+ G,
4172
+ M,
4173
+ U
4174
+ ]), we = J((e) => {
4175
+ if (document.removeEventListener("pointermove", Ce), document.removeEventListener("touchmove", Ce), document.removeEventListener("pointerup", we), G && (ne(!1), M)) {
4176
+ if (K(M.pixels ?? 0), !Jo(s, a === null) || M.pixels !== s) {
4177
+ let e = M.pixels ?? 0, t = {
4152
4178
  pixels: e,
4153
- percent: k.percent ?? e / te * 100
4179
+ percent: M.percent ?? e / U * 100
4154
4180
  };
4155
- D(t);
4181
+ A(t);
4156
4182
  }
4157
4183
  e.stopPropagation(), e.preventDefault();
4158
4184
  }
4159
4185
  }, [
4160
- k,
4161
- U,
4162
- o,
4186
+ M,
4187
+ G,
4188
+ s,
4163
4189
  a,
4164
- te
4165
- ]), Ce = J((e) => {
4166
- ve?.(e), e.defaultPrevented || h || U || (W(!0), G(), document.addEventListener("pointermove", xe, { passive: !1 }), document.addEventListener("touchmove", xe, { passive: !1 }), document.addEventListener("pointerup", Se, { passive: !1 }));
4167
- }, [ve]), we = jr(t, () => ({
4168
- setPosition: be,
4190
+ U
4191
+ ]), Te = J((e) => {
4192
+ be?.(e), e.defaultPrevented || g || G || (ne(!0), re(), document.addEventListener("pointermove", Ce, { passive: !1 }), document.addEventListener("touchmove", Ce, { passive: !1 }), document.addEventListener("pointerup", we, { passive: !1 }));
4193
+ }, [be]), Ee = jr(t, () => ({
4194
+ setPosition: Se,
4169
4195
  isSplitPane: () => !0
4170
- }), []), Te = ri([L, K]), Ee = j(() => T ? R(ai, {
4171
- render: w,
4196
+ }), []), De = ri([B, oe]), Oe = j(() => !E || D ? null : R(ai, {
4197
+ render: T,
4172
4198
  props: {
4173
- ref: Te,
4174
- className: Y("sxl-resizer", ge),
4175
- onPointerDownCapture: Ce,
4199
+ ref: De,
4200
+ className: Y("sxl-resizer", ve),
4201
+ onPointerDownCapture: Te,
4176
4202
  style: {
4177
- cursor: h ? void 0 : i === "row" ? "ew-resize" : "ns-resize",
4203
+ cursor: g ? void 0 : i === "row" ? "ew-resize" : "ns-resize",
4178
4204
  minWidth: i === "row" ? "2px" : void 0,
4179
4205
  minHeight: i === "row" ? void 0 : "2px",
4180
4206
  boxSizing: "border-box",
4181
4207
  pointerEvents: "all",
4182
4208
  zIndex: 1,
4183
- ..._e
4209
+ ...ye
4184
4210
  },
4185
4211
  splitDirection: i,
4186
- disabled: h,
4187
- ...ye
4212
+ disabled: g,
4213
+ ...xe
4188
4214
  }
4189
- }, "resizer") : null, [
4190
- T,
4191
- Te,
4192
- ge,
4193
- ye,
4215
+ }, "resizer"), [
4216
+ E,
4217
+ D,
4218
+ De,
4219
+ ve,
4220
+ xe,
4194
4221
  i,
4195
- _e,
4196
- h
4197
- ]), De = i === "row" ? "Width" : "Height", Oe = j(() => {
4222
+ ye,
4223
+ g
4224
+ ]), ke = i === "row" ? "Width" : "Height", Ae = j(() => {
4198
4225
  if (!n) return null;
4199
- let e = {
4200
- ...le,
4226
+ let e = D ? {
4227
+ ...de,
4228
+ ...pe,
4229
+ ...k.fixedPaneOffset === 0 ? { display: "none" } : { flex: "1 1 100%" }
4230
+ } : {
4201
4231
  ...de,
4202
- flex: E.fixedPaneOffset === 0 && H?.pixels[0] !== null ? `0 0 ${Math.round(H?.pixels[0] ?? 0)}px` : `1 1 ${Math.round(H?.percents[0] ?? 100)}%`,
4203
- [`min${De}`]: H?.minBefore,
4204
- [`max${De}`]: r ? H?.maxBefore : "100%"
4232
+ ...pe,
4233
+ flex: k.fixedPaneOffset === 0 && W?.pixels[0] !== null ? `0 0 ${Math.round(W?.pixels[0] ?? 0)}px` : `1 1 ${Math.round(W?.percents[0] ?? 100)}%`,
4234
+ [`min${ke}`]: W?.minBefore,
4235
+ [`max${ke}`]: r ? W?.maxBefore : "100%"
4205
4236
  };
4206
4237
  return R("div", {
4207
- ref: ie,
4208
- className: Y("sxl-before", se, ue),
4238
+ ref: ae,
4239
+ className: Y("sxl-before", le, fe),
4209
4240
  style: e,
4210
- ...ce,
4211
- ...fe,
4241
+ ...ue,
4242
+ ...q,
4212
4243
  children: n
4213
4244
  }, "before");
4214
4245
  }, [
4215
4246
  n,
4216
- b,
4217
4247
  x,
4218
- E,
4219
- H
4220
- ]), ke = j(() => {
4248
+ S,
4249
+ k,
4250
+ W,
4251
+ D,
4252
+ ke
4253
+ ]), je = j(() => {
4221
4254
  if (!r) return null;
4222
- let e = {
4223
- ...le,
4224
- ...q,
4225
- flex: E.fixedPaneOffset === 1 && H?.pixels[1] !== null ? `0 0 ${Math.round(H?.pixels[1] ?? 0)}px` : `1 1 ${Math.round(H?.percents[1] ?? 100)}%`,
4226
- [`min${De}`]: H?.minAfter,
4227
- [`max${De}`]: n ? H?.maxAfter : "100%"
4255
+ let e = D ? {
4256
+ ...de,
4257
+ ...he,
4258
+ ...k.fixedPaneOffset === 1 ? { display: "none" } : { flex: "1 1 100%" }
4259
+ } : {
4260
+ ...de,
4261
+ ...he,
4262
+ flex: k.fixedPaneOffset === 1 && W?.pixels[1] !== null ? `0 0 ${Math.round(W?.pixels[1] ?? 0)}px` : `1 1 ${Math.round(W?.percents[1] ?? 100)}%`,
4263
+ [`min${ke}`]: W?.minAfter,
4264
+ [`max${ke}`]: n ? W?.maxAfter : "100%"
4228
4265
  };
4229
4266
  return R("div", {
4230
- ref: ae,
4231
- className: Y("sxl-after", se, pe),
4267
+ ref: se,
4268
+ className: Y("sxl-after", le, me),
4232
4269
  style: e,
4233
- ...ce,
4234
- ...me,
4270
+ ...ue,
4271
+ ...ge,
4235
4272
  children: r
4236
4273
  }, "after");
4237
4274
  }, [
4238
4275
  r,
4239
- b,
4240
- S,
4241
- E,
4242
- H
4243
- ]), Ae = ri([M, we]);
4276
+ x,
4277
+ w,
4278
+ k,
4279
+ W,
4280
+ D,
4281
+ ke
4282
+ ]), Me = ri([I, Ee]);
4244
4283
  return ee("div", {
4245
- ref: Ae,
4246
- className: Y("sxl-splitPane", i === "row" ? "sxl-vertical" : "sxl-horizontal", { "sxl-dragging": U }, p),
4247
- style: he,
4284
+ ref: Me,
4285
+ className: Y("sxl-splitPane", i === "row" ? "sxl-vertical" : "sxl-horizontal", {
4286
+ "sxl-dragging": G,
4287
+ "sxl-collapsed": D
4288
+ }, m),
4289
+ style: _e,
4248
4290
  children: [
4291
+ Ae,
4249
4292
  Oe,
4250
- Ee,
4251
- ke
4293
+ je
4252
4294
  ]
4253
4295
  });
4254
4296
  }));
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @license @sheetxl/utils-react - Utils React - Utilities for React capabilities needed for all SheetXL components. - v1.0.5
2
+ * @license @sheetxl/utils-react - Utils React - Utilities for React capabilities needed for all SheetXL components. - v1.0.6
3
3
  *
4
4
  * (C) 2026-present SheetXL Inc. & Michael T. Ford
5
5
  * License: MIT