@marimo-team/islands 0.19.7-dev30 → 0.19.7-dev31
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/{ConnectedDataExplorerComponent-CukLYFVV.js → ConnectedDataExplorerComponent-DewsKLl2.js} +12 -12
- package/dist/{glide-data-editor-uGGDZv6S.js → glide-data-editor-DHsjQhtP.js} +1362 -1360
- package/dist/{label-DC2pbeUJ.js → label-C4PtQcza.js} +14 -22
- package/dist/main.js +29 -29
- package/dist/{spec-C9rnT0AN.js → spec-Dmb1KfK3.js} +24 -16
- package/dist/{types-ZLLMdAtn.js → types-DBsIRhMX.js} +23 -23
- package/package.json +1 -1
- package/src/plugins/impl/DataEditorPlugin.tsx +1 -1
- package/src/plugins/impl/data-editor/glide-data-editor.tsx +49 -33
|
@@ -318,12 +318,6 @@ function usePrevious(e) {
|
|
|
318
318
|
});
|
|
319
319
|
return import_react.useMemo(() => (i.current.value !== e && (i.current.previous = i.current.value, i.current.value = e), i.current.previous), [e]);
|
|
320
320
|
}
|
|
321
|
-
function useOnMount(e) {
|
|
322
|
-
(0, import_react.useEffect)(e, []);
|
|
323
|
-
}
|
|
324
|
-
function useOnUnmount(e) {
|
|
325
|
-
(0, import_react.useEffect)(() => e(), []);
|
|
326
|
-
}
|
|
327
321
|
function clamp(e, [i, a]) {
|
|
328
322
|
return Math.min(a, Math.max(i, e));
|
|
329
323
|
}
|
|
@@ -1278,19 +1272,18 @@ var Root = Label$1, import_compiler_runtime = require_compiler_runtime(), labelV
|
|
|
1278
1272
|
});
|
|
1279
1273
|
Label.displayName = Root.displayName;
|
|
1280
1274
|
export {
|
|
1281
|
-
|
|
1282
|
-
ChevronDown as B,
|
|
1275
|
+
$a916eb452884faea$export$b7a616150fdb9f44 as A,
|
|
1283
1276
|
useDirection as C,
|
|
1284
|
-
|
|
1285
|
-
|
|
1286
|
-
$
|
|
1287
|
-
|
|
1288
|
-
|
|
1289
|
-
$
|
|
1290
|
-
$
|
|
1291
|
-
|
|
1292
|
-
$
|
|
1293
|
-
|
|
1277
|
+
assertNever as D,
|
|
1278
|
+
usePrevious as E,
|
|
1279
|
+
$b5e257d569688ac6$export$619500959fc48b26 as F,
|
|
1280
|
+
X as I,
|
|
1281
|
+
ChevronUp as L,
|
|
1282
|
+
$18f2051aff69b9bf$export$43bb16f9c6d9e3f7 as M,
|
|
1283
|
+
$18f2051aff69b9bf$export$a54013f0d02a8f82 as N,
|
|
1284
|
+
logNever as O,
|
|
1285
|
+
$b5e257d569688ac6$export$535bd6ca7f90a273 as P,
|
|
1286
|
+
ChevronDown as R,
|
|
1294
1287
|
Trigger as S,
|
|
1295
1288
|
clamp as T,
|
|
1296
1289
|
menuItemVariants as _,
|
|
@@ -1302,8 +1295,8 @@ export {
|
|
|
1302
1295
|
menuControlVariants as g,
|
|
1303
1296
|
menuControlCheckVariants as h,
|
|
1304
1297
|
SelectContent as i,
|
|
1305
|
-
|
|
1306
|
-
|
|
1298
|
+
$488c6ddbf4ef74c2$export$cc77c4ff7e8673c5 as j,
|
|
1299
|
+
upperFirst_default as k,
|
|
1307
1300
|
SelectTrigger as l,
|
|
1308
1301
|
menuContentCommon as m,
|
|
1309
1302
|
Primitive as n,
|
|
@@ -1316,6 +1309,5 @@ export {
|
|
|
1316
1309
|
menuLabelVariants as v,
|
|
1317
1310
|
createCollection as w,
|
|
1318
1311
|
Icon as x,
|
|
1319
|
-
menuSeparatorVariants as y
|
|
1320
|
-
ChevronUp as z
|
|
1312
|
+
menuSeparatorVariants as y
|
|
1321
1313
|
};
|
package/dist/main.js
CHANGED
|
@@ -7,10 +7,10 @@ import { t as require_compiler_runtime } from "./compiler-runtime-DHFVbq0b.js";
|
|
|
7
7
|
import { n as Copy, r as toast, t as copyToClipboard } from "./copy-B59Bw3-w.js";
|
|
8
8
|
import { _ as require_cjs$1, c as markdownLineEnding, d as SKIP, f as visitParents, g as s$2, h as h$1, l as longestStreak, m as webNamespaces, o as xn$1, p as convert$1, s as factorySpace, u as ok, __tla as __tla_0 } from "./chunk-5FQGJX7Z-D5VFKHmt.js";
|
|
9
9
|
import { C as useLayoutEffect2, D as dispatchDiscreteCustomEvent, E as Primitive, M as composeEventHandlers$1, N as createLucideIcon, O as createSlot, S as useId$12, T as useCallbackRef, _ as Arrow, a as __awaiter, b as createPopperScope, c as withSmartCollisionBoundary, d as Root$5, g as Anchor, h as Portal, i as useFocusGuards, j as createContextScope, l as isInVscodeExtension, m as Presence, n as hideOthers, o as MAX_HEIGHT_OFFSET, p as useControllableState, r as FocusScope, s as withFullScreenAsRoot, t as Combination_default, u as StyleNamespace, v as Content$3, w as DismissableLayer, x as useSize, y as Root2$6 } from "./Combination-Bg-xN8JV.js";
|
|
10
|
-
import { A as
|
|
10
|
+
import { A as useOnMount, B as Table$1, C as DEFAULT_COLOR_SCHEME, D as SCALE_TYPE_DESCRIPTIONS, E as EMPTY_VALUE$1, F as $896ba0a80a8f4d36$export$85fd5fdf27bacc79, G as ChartColumn, H as ListFilter, I as $fb18d541ea1ad717$export$ad991b66133851cf, K as Calendar, L as $5a387cc49350e6db$export$722debc0e56fea39, M as Badge, N as createReducerAndAtoms, O as TIME_UNIT_DESCRIPTIONS, P as startCase_default, R as Type, S as DEFAULT_AGGREGATION, T as DEFAULT_TIME_UNIT, U as Hash, V as SquareFunction, W as ChartPie, _ as AGGREGATION_TYPE_DESCRIPTIONS, a as AGGREGATION_FNS$1, b as COLOR_SCHEMES, c as COLOR_BY_FIELDS, d as NONE_VALUE, f as SELECTABLE_DATA_TYPES, g as TIME_UNITS, h as STRING_AGGREGATION_FNS, i as convertDataTypeToSelectable, j as useOnUnmount, k as escapeFieldName, l as COMBINED_TIME_UNITS, m as SORT_TYPES, n as createSpecWithoutData, o as BIN_AGGREGATION, p as SINGLE_TIME_UNITS, r as isFieldSet, s as CHART_TYPES, t as augmentSpecWithData, u as ChartType, v as AGGREGATION_TYPE_ICON, w as DEFAULT_MAX_BINS_FACET, x as COUNT_FIELD, y as CHART_TYPE_ICON, z as ToggleLeft } from "./spec-Dmb1KfK3.js";
|
|
11
11
|
import { t as Check } from "./check-CM_kewwn.js";
|
|
12
|
-
import { A as
|
|
13
|
-
import { $ as $514c0188e459b4c0$export$9afb8bc826b033ea, $t as $65484d02dcb7eb3e$export$457c3d6518dd4c6f, A as ItemIndicator, At as $6db58dc88e78b024$export$2f817fcdc4b89ae0, B as createMenuScope, Bt as $458b0a5536c1a7cf$export$40bfa8c7b0832715, C as DropdownMenuTrigger, Ct as $e5be200c675c3b3a$export$fc1a364ae1f3ff10, D as Content2$3, Dt as $6c7bd7858deea686$export$cd11ab140839f11d, E as CheckboxItem, Et as $701a24aa0da5b062$export$ea18c227d4417cc3, F as Root3, Ft as $507fabe10e71c6fb$export$630ff653c5ada6a9, G as $3985021b0ad6602f$export$37fb8590cf2c088c, Gt as $df56164dff5785e2$export$4338b53315abf666, H as Root$6, Ht as $b4b717babfbb907b$export$bebd5a1431fec25d, I as Separator, It as $f6c31cce2adf654f$export$45712eceda6fad21, J as $a049562f99e7db0e$export$f9c6924e160136d1, Jt as $c87311424ea30a05$export$78551043582a6a98, K as $3985021b0ad6602f$export$f5b8910cec6cf069, Kt as $313b98861ee5dd6c$export$d6875122194c7b44, L as Sub, Lt as _class_private_field_init, M as Portal$2, Mt as $6179b936705e76d3$export$ae780daf29e6d456, N as RadioGroup$2, Nt as $9ab94262bd0047c7$export$420e68273165f4ec, O as Group$1, Ot as $fca6afa0e843324b$export$87b761675e8eaa10, P as RadioItem, Pt as $3ad3f6e1647bc98d$export$80f3e147d781571c, Q as $514c0188e459b4c0$export$5f1af8db9871e1d6, Qt as $7215afc6de606d6b$export$de79e2c695e052f3, R as SubContent, Rt as $ae1eeba8b9eafd08$export$5165eccb35aaadb5, S as DropdownMenuSubTrigger, St as $e5be200c675c3b3a$export$dad6ae84456c676a, T as Arrow2, Tt as $f7dceffc5ad7768b$export$4e328f61c538687f, U as createRovingFocusGroupScope, Ut as $99facab73266f662$export$5add1d006293d136, V as Item$2, Vt as $b4b717babfbb907b$export$4c063cf1350e6fed, W as ErrorBoundary, Wt as $e9faafb641e167db$export$90fc3a17d93f704c, X as $ee014567cb39d3f0$export$f551688fc98f2e09, Xt as $c87311424ea30a05$export$a11b0059900ceec8, Y as $d3e0e05bdfcf66bd$export$c24727297075ec6a, Yt as $c87311424ea30a05$export$9ac100e40613ea10, Z as $ee014567cb39d3f0$export$ff05c3ac10437e03, Zt as $c87311424ea30a05$export$fedb369cb70207f1, _ as DropdownMenuLabel, _n as ChevronRight, _t as $2baaea4c71418dea$export$294aa081a6c6f55d, a as OnBlurredInput, an as $431fbd86ca7dc216$export$b204af158042fbac, at as $64fa3d84918910a7$export$2881499e37b75b9a, b as DropdownMenuSub, bt as $e5be200c675c3b3a$export$a763b9476acd3eb, c as NumberField, cn as $bdb11010cef70236$export$b4cc09c592e8fdb8, ct as $64fa3d84918910a7$export$9d4c57ee4c6ffdd8, d as prettyNumber, dn as $f0a04ccd8dbdd83b$export$e5c5a5f917a5871c, dt as $64fa3d84918910a7$export$ef03459518577ad4, en as $3ef42575df84b30b$export$9d1611c77c2fe928, et as $d2b4bc8c273e7be6$export$24d547caef80ccd1, f as prettyScientificNumber, fn as Trash, ft as $64fa3d84918910a7$export$fabf2dc03a41866e, g as DropdownMenuItem, gn as Circle, gt as $d2e8511e6f209edf$export$e908e06f4b8e3402, h as DropdownMenuGroup, hn as Pencil, ht as capitalize_default, i as Input, in as $f4e2df6bd15f8569$export$98658e8c59125e6a, it as $f39a9eba43920ace$export$b5d7cc18bb8d2b59, j as Label$2, jt as $5b160d28a433310d$export$c17fa47878dc55b6, k as Item2$2, kt as $fca6afa0e843324b$export$f12b703ca79dfbb1, l as maxFractionalDigits, ln as $bdb11010cef70236$export$f680877a34711e37, lt as $64fa3d84918910a7$export$c245e6201fed2f75, m as DropdownMenuContent, mn as Plus, mt as marked, n as DebouncedInput, nn as $d4ee10de306f2510$export$cd4e5573fbe2b576, nt as $01b77f81d0f07f68$export$75b6ee27786ba447, o as useDebounceControlledState, on as $431fbd86ca7dc216$export$f21a1ffae260145a, ot as $64fa3d84918910a7$export$29f1550f4b0d4415, p as DropdownMenu, pn as Search, pt as useNonce, q as $a049562f99e7db0e$export$eb2fcfdbd7ba97d4, qt as $c87311424ea30a05$export$6446a186d09e379e, r as DebouncedNumberInput, rn as $d4ee10de306f2510$export$e58f029f0fbfdb29, rt as $01b77f81d0f07f68$export$b04be29aa201d4f5, s as useDebouncedCallback, sn as $ff5963eb1fccf552$export$e08e3b67e392101e, st as $64fa3d84918910a7$export$4d86445c2cf5e3, t as BulkEdit, tn as $d4ee10de306f2510$export$4282f70798064fe0, tt as $d2b4bc8c273e7be6$export$353f5b6fc5456de1, u as prettyEngineeringNumber, un as $8ae05eaa5c114e9c$export$7f54fc3180508a52, ut as $64fa3d84918910a7$export$c62b8e45d58ddad9, v as DropdownMenuPortal, vt as $e93e671b31057976$export$b8473d3665f3a75a, w as Anchor2, wt as $319e236875307eab$export$a9b970dcc4ae71a9, x as DropdownMenuSubContent, xt as $e5be200c675c3b3a$export$aca958c65c314e6c, y as DropdownMenuSeparator, yt as $e5be200c675c3b3a$export$75ee7c75d68f5b0e, z as SubTrigger, zt as $9446cca9a3875146$export$7d15b64cf5a3a4c4 } from "./types-
|
|
12
|
+
import { A as $a916eb452884faea$export$b7a616150fdb9f44, C as useDirection, D as assertNever, E as usePrevious$1, I as X, M as $18f2051aff69b9bf$export$43bb16f9c6d9e3f7, N as $18f2051aff69b9bf$export$a54013f0d02a8f82, O as logNever, P as $b5e257d569688ac6$export$535bd6ca7f90a273, R as ChevronDown, S as Trigger$5, T as clamp$2, _ as menuItemVariants, a as SelectGroup, b as menuSubTriggerVariants, c as SelectSeparator, d as NativeSelect, f as selectStyles, g as menuControlVariants, h as menuControlCheckVariants, i as SelectContent, l as SelectTrigger, m as menuContentCommon, n as Primitive$1, o as SelectItem, p as MENU_ITEM_DISABLED, r as Select, s as SelectLabel, t as Label, u as SelectValue, v as menuLabelVariants, w as createCollection, x as Icon, y as menuSeparatorVariants } from "./label-C4PtQcza.js";
|
|
13
|
+
import { $ as $514c0188e459b4c0$export$9afb8bc826b033ea, $t as $65484d02dcb7eb3e$export$457c3d6518dd4c6f, A as ItemIndicator, At as $6db58dc88e78b024$export$2f817fcdc4b89ae0, B as createMenuScope, Bt as $458b0a5536c1a7cf$export$40bfa8c7b0832715, C as DropdownMenuTrigger, Ct as $e5be200c675c3b3a$export$fc1a364ae1f3ff10, D as Content2$3, Dt as $6c7bd7858deea686$export$cd11ab140839f11d, E as CheckboxItem, Et as $701a24aa0da5b062$export$ea18c227d4417cc3, F as Root3, Ft as $507fabe10e71c6fb$export$630ff653c5ada6a9, G as $3985021b0ad6602f$export$37fb8590cf2c088c, Gt as $df56164dff5785e2$export$4338b53315abf666, H as Root$6, Ht as $b4b717babfbb907b$export$bebd5a1431fec25d, I as Separator, It as $f6c31cce2adf654f$export$45712eceda6fad21, J as $a049562f99e7db0e$export$f9c6924e160136d1, Jt as $c87311424ea30a05$export$78551043582a6a98, K as $3985021b0ad6602f$export$f5b8910cec6cf069, Kt as $313b98861ee5dd6c$export$d6875122194c7b44, L as Sub, Lt as _class_private_field_init, M as Portal$2, Mt as $6179b936705e76d3$export$ae780daf29e6d456, N as RadioGroup$2, Nt as $9ab94262bd0047c7$export$420e68273165f4ec, O as Group$1, Ot as $fca6afa0e843324b$export$87b761675e8eaa10, P as RadioItem, Pt as $3ad3f6e1647bc98d$export$80f3e147d781571c, Q as $514c0188e459b4c0$export$5f1af8db9871e1d6, Qt as $7215afc6de606d6b$export$de79e2c695e052f3, R as SubContent, Rt as $ae1eeba8b9eafd08$export$5165eccb35aaadb5, S as DropdownMenuSubTrigger, St as $e5be200c675c3b3a$export$dad6ae84456c676a, T as Arrow2, Tt as $f7dceffc5ad7768b$export$4e328f61c538687f, U as createRovingFocusGroupScope, Ut as $99facab73266f662$export$5add1d006293d136, V as Item$2, Vt as $b4b717babfbb907b$export$4c063cf1350e6fed, W as ErrorBoundary, Wt as $e9faafb641e167db$export$90fc3a17d93f704c, X as $ee014567cb39d3f0$export$f551688fc98f2e09, Xt as $c87311424ea30a05$export$a11b0059900ceec8, Y as $d3e0e05bdfcf66bd$export$c24727297075ec6a, Yt as $c87311424ea30a05$export$9ac100e40613ea10, Z as $ee014567cb39d3f0$export$ff05c3ac10437e03, Zt as $c87311424ea30a05$export$fedb369cb70207f1, _ as DropdownMenuLabel, _n as ChevronRight, _t as $2baaea4c71418dea$export$294aa081a6c6f55d, a as OnBlurredInput, an as $431fbd86ca7dc216$export$b204af158042fbac, at as $64fa3d84918910a7$export$2881499e37b75b9a, b as DropdownMenuSub, bt as $e5be200c675c3b3a$export$a763b9476acd3eb, c as NumberField, cn as $bdb11010cef70236$export$b4cc09c592e8fdb8, ct as $64fa3d84918910a7$export$9d4c57ee4c6ffdd8, d as prettyNumber, dn as $f0a04ccd8dbdd83b$export$e5c5a5f917a5871c, dt as $64fa3d84918910a7$export$ef03459518577ad4, en as $3ef42575df84b30b$export$9d1611c77c2fe928, et as $d2b4bc8c273e7be6$export$24d547caef80ccd1, f as prettyScientificNumber, fn as Trash, ft as $64fa3d84918910a7$export$fabf2dc03a41866e, g as DropdownMenuItem, gn as Circle, gt as $d2e8511e6f209edf$export$e908e06f4b8e3402, h as DropdownMenuGroup, hn as Pencil, ht as capitalize_default, i as Input, in as $f4e2df6bd15f8569$export$98658e8c59125e6a, it as $f39a9eba43920ace$export$b5d7cc18bb8d2b59, j as Label$2, jt as $5b160d28a433310d$export$c17fa47878dc55b6, k as Item2$2, kt as $fca6afa0e843324b$export$f12b703ca79dfbb1, l as maxFractionalDigits, ln as $bdb11010cef70236$export$f680877a34711e37, lt as $64fa3d84918910a7$export$c245e6201fed2f75, m as DropdownMenuContent, mn as Plus, mt as marked, n as DebouncedInput, nn as $d4ee10de306f2510$export$cd4e5573fbe2b576, nt as $01b77f81d0f07f68$export$75b6ee27786ba447, o as useDebounceControlledState, on as $431fbd86ca7dc216$export$f21a1ffae260145a, ot as $64fa3d84918910a7$export$29f1550f4b0d4415, p as DropdownMenu, pn as Search, pt as useNonce, q as $a049562f99e7db0e$export$eb2fcfdbd7ba97d4, qt as $c87311424ea30a05$export$6446a186d09e379e, r as DebouncedNumberInput, rn as $d4ee10de306f2510$export$e58f029f0fbfdb29, rt as $01b77f81d0f07f68$export$b04be29aa201d4f5, s as useDebouncedCallback, sn as $ff5963eb1fccf552$export$e08e3b67e392101e, st as $64fa3d84918910a7$export$4d86445c2cf5e3, t as BulkEdit, tn as $d4ee10de306f2510$export$4282f70798064fe0, tt as $d2b4bc8c273e7be6$export$353f5b6fc5456de1, u as prettyEngineeringNumber, un as $8ae05eaa5c114e9c$export$7f54fc3180508a52, ut as $64fa3d84918910a7$export$c62b8e45d58ddad9, v as DropdownMenuPortal, vt as $e93e671b31057976$export$b8473d3665f3a75a, w as Anchor2, wt as $319e236875307eab$export$a9b970dcc4ae71a9, x as DropdownMenuSubContent, xt as $e5be200c675c3b3a$export$aca958c65c314e6c, y as DropdownMenuSeparator, yt as $e5be200c675c3b3a$export$75ee7c75d68f5b0e, z as SubTrigger, zt as $9446cca9a3875146$export$7d15b64cf5a3a4c4 } from "./types-DBsIRhMX.js";
|
|
14
14
|
import { S as CircleQuestionMark, _ as isUrl, a as AlertTitle, b as Deferred, c as constructFrom, d as millisecondsInMinute, f as millisecondsInSecond, g as appendQueryParams, h as getRuntimeManager, i as AlertDescription, l as millisecondsInDay, m as asRemoteURL, n as arrow, o as isValid$1, p as millisecondsInWeek, r as Alert, s as toDate, t as useDeepCompareMemoize, u as millisecondsInHour, v as require_cuid2, x as isWasm, y as waitForConnectionOpen } from "./useDeepCompareMemoize-CfoxVor3.js";
|
|
15
15
|
import { n as clsx_default } from "./clsx-D2KVTYnW.js";
|
|
16
16
|
import { a as cva, c as useComposedRefs, l as Events, n as buttonVariants, o as useEventListener, r as Slot$1, s as composeRefs, t as Button, u as cn } from "./button-BWvsJ2Wr.js";
|
|
@@ -73082,7 +73082,7 @@ Image URL: ${r.imageUrl}`)), contextToXml({
|
|
|
73082
73082
|
return Logger.warn("Failed to get version from mount config"), null;
|
|
73083
73083
|
}
|
|
73084
73084
|
}
|
|
73085
|
-
const marimoVersionAtom = atom(getVersionFromMountConfig() || "0.19.7-
|
|
73085
|
+
const marimoVersionAtom = atom(getVersionFromMountConfig() || "0.19.7-dev31"), showCodeInRunModeAtom = atom(true);
|
|
73086
73086
|
atom(null);
|
|
73087
73087
|
var import_compiler_runtime$88 = require_compiler_runtime();
|
|
73088
73088
|
function useKeydownOnElement(e, r) {
|
|
@@ -74638,7 +74638,7 @@ Image URL: ${r.imageUrl}`)), contextToXml({
|
|
|
74638
74638
|
function getVegaFieldTypes(e) {
|
|
74639
74639
|
return !e || Object.keys(e).length === 0 ? "auto" : Objects.mapValues(e, (e2) => e2 === "date" || e2 === "time" ? "string" : e2 === "datetime" ? "date" : e2);
|
|
74640
74640
|
}
|
|
74641
|
-
var import_compiler_runtime$81 = require_compiler_runtime(), LazyDataEditor = import_react.lazy(() => import("./glide-data-editor-
|
|
74641
|
+
var import_compiler_runtime$81 = require_compiler_runtime(), LazyDataEditor = import_react.lazy(() => import("./glide-data-editor-DHsjQhtP.js").then(async (m2) => {
|
|
74642
74642
|
await m2.__tla;
|
|
74643
74643
|
return m2;
|
|
74644
74644
|
}));
|
|
@@ -78497,21 +78497,21 @@ ${c}
|
|
|
78497
78497
|
isSelected: rX,
|
|
78498
78498
|
onSelect: aX
|
|
78499
78499
|
}, r[64] = aX, r[65] = rX, r[66] = _X) : _X = r[66];
|
|
78500
|
-
let
|
|
78501
|
-
r[67] !== c || r[68] !== _X ? (
|
|
78500
|
+
let vX;
|
|
78501
|
+
r[67] !== c || r[68] !== _X ? (vX = (0, import_jsx_runtime.jsx)(ComboboxContext, {
|
|
78502
78502
|
value: _X,
|
|
78503
78503
|
children: c
|
|
78504
|
-
}), r[67] = c, r[68] = _X, r[69] =
|
|
78505
|
-
let
|
|
78506
|
-
r[70] !== gX || r[71] !==
|
|
78504
|
+
}), r[67] = c, r[68] = _X, r[69] = vX) : vX = r[69];
|
|
78505
|
+
let yX;
|
|
78506
|
+
r[70] !== gX || r[71] !== vX ? (yX = (0, import_jsx_runtime.jsxs)(CommandList, {
|
|
78507
78507
|
className: "max-h-60 py-.5",
|
|
78508
78508
|
children: [
|
|
78509
78509
|
gX,
|
|
78510
|
-
|
|
78510
|
+
vX
|
|
78511
78511
|
]
|
|
78512
|
-
}), r[70] = gX, r[71] =
|
|
78513
|
-
let
|
|
78514
|
-
r[73] !== S || r[74] !== UY || r[75] !== hX || r[76] !==
|
|
78512
|
+
}), r[70] = gX, r[71] = vX, r[72] = yX) : yX = r[72];
|
|
78513
|
+
let bX;
|
|
78514
|
+
r[73] !== S || r[74] !== UY || r[75] !== hX || r[76] !== yX ? (bX = (0, import_jsx_runtime.jsx)(PopoverContent, {
|
|
78515
78515
|
className: "w-full min-w-(--radix-popover-trigger-width) p-0",
|
|
78516
78516
|
align: "start",
|
|
78517
78517
|
children: (0, import_jsx_runtime.jsxs)(Command, {
|
|
@@ -78519,21 +78519,21 @@ ${c}
|
|
|
78519
78519
|
shouldFilter: UY,
|
|
78520
78520
|
children: [
|
|
78521
78521
|
hX,
|
|
78522
|
-
|
|
78522
|
+
yX
|
|
78523
78523
|
]
|
|
78524
78524
|
})
|
|
78525
|
-
}), r[73] = S, r[74] = UY, r[75] = hX, r[76] =
|
|
78526
|
-
let
|
|
78527
|
-
r[78] !== ZY || r[79] !== XY || r[80] !== mX || r[81] !==
|
|
78525
|
+
}), r[73] = S, r[74] = UY, r[75] = hX, r[76] = yX, r[77] = bX) : bX = r[77];
|
|
78526
|
+
let xX;
|
|
78527
|
+
r[78] !== ZY || r[79] !== XY || r[80] !== mX || r[81] !== bX ? (xX = (0, import_jsx_runtime.jsxs)(Popover$1, {
|
|
78528
78528
|
open: ZY,
|
|
78529
78529
|
onOpenChange: XY,
|
|
78530
78530
|
children: [
|
|
78531
78531
|
mX,
|
|
78532
|
-
|
|
78532
|
+
bX
|
|
78533
78533
|
]
|
|
78534
|
-
}), r[78] = ZY, r[79] = XY, r[80] = mX, r[81] =
|
|
78535
|
-
let
|
|
78536
|
-
r[83] !== KY || r[84] !== d || r[85] !== y || r[86] !== aX || r[87] !== HY || r[88] !== eX ? (
|
|
78534
|
+
}), r[78] = ZY, r[79] = XY, r[80] = mX, r[81] = bX, r[82] = xX) : xX = r[82];
|
|
78535
|
+
let SX;
|
|
78536
|
+
r[83] !== KY || r[84] !== d || r[85] !== y || r[86] !== aX || r[87] !== HY || r[88] !== eX ? (SX = HY && KY && (0, import_jsx_runtime.jsx)("div", {
|
|
78537
78537
|
className: cn("flex flex-col gap-1 items-start", d),
|
|
78538
78538
|
children: Array.isArray(eX) && eX.map((e2) => e2 == null ? null : (0, import_jsx_runtime.jsxs)(Badge, {
|
|
78539
78539
|
variant: "secondary",
|
|
@@ -78547,16 +78547,16 @@ ${c}
|
|
|
78547
78547
|
})
|
|
78548
78548
|
]
|
|
78549
78549
|
}, String(e2)))
|
|
78550
|
-
}), r[83] = KY, r[84] = d, r[85] = y, r[86] = aX, r[87] = HY, r[88] = eX, r[89] =
|
|
78551
|
-
let
|
|
78552
|
-
return r[90] !== G || r[91] !==
|
|
78550
|
+
}), r[83] = KY, r[84] = d, r[85] = y, r[86] = aX, r[87] = HY, r[88] = eX, r[89] = SX) : SX = r[89];
|
|
78551
|
+
let CX;
|
|
78552
|
+
return r[90] !== G || r[91] !== xX || r[92] !== SX ? (CX = (0, import_jsx_runtime.jsxs)("div", {
|
|
78553
78553
|
className: cX,
|
|
78554
78554
|
...G,
|
|
78555
78555
|
children: [
|
|
78556
|
-
|
|
78557
|
-
|
|
78556
|
+
xX,
|
|
78557
|
+
SX
|
|
78558
78558
|
]
|
|
78559
|
-
}), r[90] = G, r[91] =
|
|
78559
|
+
}), r[90] = G, r[91] = xX, r[92] = SX, r[93] = CX) : CX = r[93], CX;
|
|
78560
78560
|
}, ComboboxItem = import_react.forwardRef((e, r) => {
|
|
78561
78561
|
let c = (0, import_compiler_runtime$78.c)(17), { children: d, className: f, value: _, onSelect: v, disabled: y } = e, S = typeof _ == "object" && "value" in _ ? _.value : String(_), w = import_react.use(ComboboxContext), E;
|
|
78562
78562
|
c[0] === f ? E = c[1] : (E = cn("pl-6 m-1 py-1", f), c[0] = f, c[1] = E);
|
|
@@ -84708,7 +84708,7 @@ ${c}
|
|
|
84708
84708
|
fullWidth: y,
|
|
84709
84709
|
children: G
|
|
84710
84710
|
}), r[19] = y, r[20] = S, r[21] = c, r[22] = G, r[23] = q) : q = r[23], q;
|
|
84711
|
-
}, LazyDataExplorerComponent = import_react.lazy(() => import("./ConnectedDataExplorerComponent-
|
|
84711
|
+
}, LazyDataExplorerComponent = import_react.lazy(() => import("./ConnectedDataExplorerComponent-DewsKLl2.js"));
|
|
84712
84712
|
const DataExplorerPlugin = createPlugin("marimo-data-explorer").withData(object$1({
|
|
84713
84713
|
label: string$2().nullish(),
|
|
84714
84714
|
data: string$2()
|
|
@@ -2,7 +2,7 @@ import { s as __toESM } from "./chunk-BNovOVIE.js";
|
|
|
2
2
|
import { t as require_react } from "./react-DdA8EBol.js";
|
|
3
3
|
import { t as require_compiler_runtime } from "./compiler-runtime-DHFVbq0b.js";
|
|
4
4
|
import { N as createLucideIcon } from "./Combination-Bg-xN8JV.js";
|
|
5
|
-
import {
|
|
5
|
+
import { M as $18f2051aff69b9bf$export$43bb16f9c6d9e3f7, O as logNever, k as upperFirst_default } from "./label-C4PtQcza.js";
|
|
6
6
|
import { a as cva, u as cn } from "./button-BWvsJ2Wr.js";
|
|
7
7
|
import { s as Logger } from "./hotkeys-B5WnGZXF.js";
|
|
8
8
|
import { t as require_jsx_runtime } from "./jsx-runtime-CTBg5pdT.js";
|
|
@@ -750,6 +750,12 @@ var import_compiler_runtime = require_compiler_runtime(), import_jsx_runtime = /
|
|
|
750
750
|
...I
|
|
751
751
|
}), P[7] = I, P[8] = R, P[9] = z) : z = P[9], z;
|
|
752
752
|
};
|
|
753
|
+
function useOnMount(a) {
|
|
754
|
+
(0, import_react.useEffect)(a, []);
|
|
755
|
+
}
|
|
756
|
+
function useOnUnmount(a) {
|
|
757
|
+
(0, import_react.useEffect)(() => a(), []);
|
|
758
|
+
}
|
|
753
759
|
function escapeFieldName(a) {
|
|
754
760
|
return a && a.replaceAll(".", "\\.").replaceAll("[", "\\[").replaceAll("]", "\\]").replaceAll(":", "\\:");
|
|
755
761
|
}
|
|
@@ -1195,25 +1201,27 @@ function getResolve(a, P) {
|
|
|
1195
1201
|
return (a == null ? void 0 : a.linkXAxis) === false && (F.x = "independent"), (P == null ? void 0 : P.linkYAxis) === false && (F.y = "independent"), Object.keys(F).length > 0 ? { resolve: { axis: F } } : void 0;
|
|
1196
1202
|
}
|
|
1197
1203
|
export {
|
|
1198
|
-
|
|
1199
|
-
|
|
1204
|
+
useOnMount as A,
|
|
1205
|
+
Table as B,
|
|
1200
1206
|
DEFAULT_COLOR_SCHEME as C,
|
|
1201
1207
|
SCALE_TYPE_DESCRIPTIONS as D,
|
|
1202
1208
|
EMPTY_VALUE as E,
|
|
1203
|
-
$
|
|
1204
|
-
|
|
1205
|
-
|
|
1206
|
-
|
|
1207
|
-
|
|
1208
|
-
$
|
|
1209
|
+
$896ba0a80a8f4d36$export$85fd5fdf27bacc79 as F,
|
|
1210
|
+
ChartColumn as G,
|
|
1211
|
+
ListFilter as H,
|
|
1212
|
+
$fb18d541ea1ad717$export$ad991b66133851cf as I,
|
|
1213
|
+
Calendar as K,
|
|
1214
|
+
$5a387cc49350e6db$export$722debc0e56fea39 as L,
|
|
1215
|
+
Badge as M,
|
|
1216
|
+
createReducerAndAtoms as N,
|
|
1209
1217
|
TIME_UNIT_DESCRIPTIONS as O,
|
|
1210
|
-
|
|
1211
|
-
|
|
1218
|
+
startCase_default as P,
|
|
1219
|
+
Type as R,
|
|
1212
1220
|
DEFAULT_AGGREGATION as S,
|
|
1213
1221
|
DEFAULT_TIME_UNIT as T,
|
|
1214
|
-
|
|
1215
|
-
|
|
1216
|
-
|
|
1222
|
+
Hash as U,
|
|
1223
|
+
SquareFunction as V,
|
|
1224
|
+
ChartPie as W,
|
|
1217
1225
|
AGGREGATION_TYPE_DESCRIPTIONS as _,
|
|
1218
1226
|
AGGREGATION_FNS as a,
|
|
1219
1227
|
COLOR_SCHEMES as b,
|
|
@@ -1223,7 +1231,7 @@ export {
|
|
|
1223
1231
|
TIME_UNITS as g,
|
|
1224
1232
|
STRING_AGGREGATION_FNS as h,
|
|
1225
1233
|
convertDataTypeToSelectable as i,
|
|
1226
|
-
|
|
1234
|
+
useOnUnmount as j,
|
|
1227
1235
|
escapeFieldName as k,
|
|
1228
1236
|
COMBINED_TIME_UNITS as l,
|
|
1229
1237
|
SORT_TYPES as m,
|
|
@@ -1238,5 +1246,5 @@ export {
|
|
|
1238
1246
|
DEFAULT_MAX_BINS_FACET as w,
|
|
1239
1247
|
COUNT_FIELD as x,
|
|
1240
1248
|
CHART_TYPE_ICON as y,
|
|
1241
|
-
|
|
1249
|
+
ToggleLeft as z
|
|
1242
1250
|
};
|
|
@@ -7,7 +7,7 @@ import { t as require_react } from "./react-DdA8EBol.js";
|
|
|
7
7
|
import { t as require_compiler_runtime } from "./compiler-runtime-DHFVbq0b.js";
|
|
8
8
|
import { D as dispatchDiscreteCustomEvent, E as Primitive, M as composeEventHandlers, N as createLucideIcon, O as createSlot, S as useId, T as useCallbackRef, _ as Arrow, b as createPopperScope, c as withSmartCollisionBoundary, g as Anchor, h as Portal, i as useFocusGuards, j as createContextScope, m as Presence, n as hideOthers, o as MAX_HEIGHT_OFFSET, p as useControllableState, r as FocusScope, s as withFullScreenAsRoot, t as Combination_default, u as StyleNamespace, v as Content, w as DismissableLayer, y as Root2$1 } from "./Combination-Bg-xN8JV.js";
|
|
9
9
|
import { t as Check } from "./check-CM_kewwn.js";
|
|
10
|
-
import {
|
|
10
|
+
import { A as $a916eb452884faea$export$b7a616150fdb9f44, C as useDirection, F as $b5e257d569688ac6$export$619500959fc48b26, I as X, L as ChevronUp, M as $18f2051aff69b9bf$export$43bb16f9c6d9e3f7, R as ChevronDown, _ as menuItemVariants, b as menuSubTriggerVariants, g as menuControlVariants, h as menuControlCheckVariants, j as $488c6ddbf4ef74c2$export$cc77c4ff7e8673c5, k as upperFirst_default, m as menuContentCommon, v as menuLabelVariants, w as createCollection, y as menuSeparatorVariants } from "./label-C4PtQcza.js";
|
|
11
11
|
import { n as clsx_default } from "./clsx-D2KVTYnW.js";
|
|
12
12
|
import { c as useComposedRefs, l as Events, s as composeRefs, t as Button, u as cn } from "./button-BWvsJ2Wr.js";
|
|
13
13
|
import { s as Logger } from "./hotkeys-B5WnGZXF.js";
|
|
@@ -1711,37 +1711,37 @@ function $de67e98908f0c6ee$export$7f629e9dc1ecf37c(e4) {
|
|
|
1711
1711
|
}, M = () => {
|
|
1712
1712
|
let e5 = j("+", t);
|
|
1713
1713
|
e5 === d && h(b(e5)), f(e5), x.commitValidation();
|
|
1714
|
-
},
|
|
1714
|
+
}, N = () => {
|
|
1715
1715
|
let e5 = j("-", n);
|
|
1716
1716
|
e5 === d && h(b(e5)), f(e5), x.commitValidation();
|
|
1717
|
-
},
|
|
1717
|
+
}, P = () => {
|
|
1718
1718
|
n != null && (f($9446cca9a3875146$export$cb6e0bb50bc19463(n, t, n, S)), x.commitValidation());
|
|
1719
|
-
},
|
|
1719
|
+
}, F = () => {
|
|
1720
1720
|
t != null && (f(t), x.commitValidation());
|
|
1721
|
-
},
|
|
1721
|
+
}, I = (0, import_react.useMemo)(() => !l && !u && (isNaN(k) || n === void 0 || isNaN(n) || $9446cca9a3875146$export$cb6e0bb50bc19463(k, t, n, S) > k || $de67e98908f0c6ee$var$handleDecimalOperation("+", k, S) <= n), [
|
|
1722
1722
|
l,
|
|
1723
1723
|
u,
|
|
1724
1724
|
t,
|
|
1725
1725
|
n,
|
|
1726
1726
|
S,
|
|
1727
1727
|
k
|
|
1728
|
-
]),
|
|
1728
|
+
]), L = (0, import_react.useMemo)(() => !l && !u && (isNaN(k) || t === void 0 || isNaN(t) || $9446cca9a3875146$export$cb6e0bb50bc19463(k, t, n, S) < k || $de67e98908f0c6ee$var$handleDecimalOperation("-", k, S) >= t), [
|
|
1729
1729
|
l,
|
|
1730
1730
|
u,
|
|
1731
1731
|
t,
|
|
1732
1732
|
n,
|
|
1733
1733
|
S,
|
|
1734
1734
|
k
|
|
1735
|
-
]),
|
|
1735
|
+
]), R = (e5) => g.isValidPartialNumber(e5, t, n);
|
|
1736
1736
|
return {
|
|
1737
1737
|
...x,
|
|
1738
|
-
validate:
|
|
1738
|
+
validate: R,
|
|
1739
1739
|
increment: M,
|
|
1740
|
-
incrementToMax:
|
|
1741
|
-
decrement:
|
|
1742
|
-
decrementToMin:
|
|
1743
|
-
canIncrement:
|
|
1744
|
-
canDecrement:
|
|
1740
|
+
incrementToMax: P,
|
|
1741
|
+
decrement: N,
|
|
1742
|
+
decrementToMin: F,
|
|
1743
|
+
canIncrement: I,
|
|
1744
|
+
canDecrement: L,
|
|
1745
1745
|
minValue: t,
|
|
1746
1746
|
maxValue: n,
|
|
1747
1747
|
numberValue: k,
|
|
@@ -2336,8 +2336,8 @@ function $parcel$interopDefault(e4) {
|
|
|
2336
2336
|
}
|
|
2337
2337
|
function $81397a9303501bda$export$23f548e970bdf099(e4, t, n) {
|
|
2338
2338
|
let { id: r, decrementAriaLabel: i, incrementAriaLabel: a, isDisabled: o, isReadOnly: s, isRequired: c, minValue: l, maxValue: u, autoFocus: d, label: f, formatOptions: p, onBlur: m = () => {
|
|
2339
|
-
}, onFocus: h, onFocusChange: g, onKeyDown: _, onKeyUp: v, description: y, errorMessage: b, isWheelDisabled: x, ...S } = e4, { increment: C, incrementToMax: w, decrement: T, decrementToMin: E, numberValue: D, inputValue: O, commit:
|
|
2340
|
-
|
|
2339
|
+
}, onFocus: h, onFocusChange: g, onKeyDown: _, onKeyUp: v, description: y, errorMessage: b, isWheelDisabled: x, ...S } = e4, { increment: C, incrementToMax: w, decrement: T, decrementToMin: E, numberValue: D, inputValue: O, commit: A, commitValidation: j } = t, M = $fca6afa0e843324b$export$f12b703ca79dfbb1($parcel$interopDefault($280a227d7cb94b92$exports), "@react-aria/numberfield"), N = $bdb11010cef70236$export$f680877a34711e37(r), { focusProps: P } = $a1ea59d68270f0dd$export$f8168d8dd8fd66e6({ onBlur() {
|
|
2340
|
+
A();
|
|
2341
2341
|
} }), F = $a916eb452884faea$export$b7a616150fdb9f44(p), I = (0, import_react.useMemo)(() => F.resolvedOptions(), [F]), L = $a916eb452884faea$export$b7a616150fdb9f44({
|
|
2342
2342
|
...p,
|
|
2343
2343
|
currencySign: void 0
|
|
@@ -2368,8 +2368,8 @@ function $81397a9303501bda$export$23f548e970bdf099(e4, t, n) {
|
|
|
2368
2368
|
let sd = (e5) => {
|
|
2369
2369
|
t.validate(e5) && t.setInputValue(e5);
|
|
2370
2370
|
}, cd = $65484d02dcb7eb3e$export$457c3d6518dd4c6f(e4), W = (0, import_react.useCallback)((e5) => {
|
|
2371
|
-
e5.nativeEvent.isComposing || (e5.key === "Enter" ? (
|
|
2372
|
-
}, [
|
|
2371
|
+
e5.nativeEvent.isComposing || (e5.key === "Enter" ? (A(), j()) : e5.continuePropagation());
|
|
2372
|
+
}, [A, j]), { isInvalid: G, validationErrors: ld, validationDetails: ud } = t.displayValidation, { labelProps: K, inputProps: dd, descriptionProps: fd, errorMessageProps: pd } = $d841c8010a73d545$export$4f384c9210e583c3({
|
|
2373
2373
|
...S,
|
|
2374
2374
|
...cd,
|
|
2375
2375
|
name: void 0,
|
|
@@ -2401,7 +2401,7 @@ function $81397a9303501bda$export$23f548e970bdf099(e4, t, n) {
|
|
|
2401
2401
|
$99facab73266f662$export$5add1d006293d136(n, t.defaultNumberValue, t.setNumberValue);
|
|
2402
2402
|
let q = $3ef42575df84b30b$export$9d1611c77c2fe928(R, P, dd, {
|
|
2403
2403
|
role: null,
|
|
2404
|
-
"aria-roledescription": $c87311424ea30a05$export$fedb369cb70207f1() ? null :
|
|
2404
|
+
"aria-roledescription": $c87311424ea30a05$export$fedb369cb70207f1() ? null : M.format("numberField"),
|
|
2405
2405
|
"aria-valuemax": null,
|
|
2406
2406
|
"aria-valuemin": null,
|
|
2407
2407
|
"aria-valuenow": null,
|
|
@@ -2416,7 +2416,7 @@ function $81397a9303501bda$export$23f548e970bdf099(e4, t, n) {
|
|
|
2416
2416
|
}, Y = e4["aria-label"] || (typeof e4.label == "string" ? e4.label : ""), Z;
|
|
2417
2417
|
Y || (Z = e4.label == null ? e4["aria-labelledby"] : K.id);
|
|
2418
2418
|
let Q = $bdb11010cef70236$export$f680877a34711e37(), $ = $bdb11010cef70236$export$f680877a34711e37(), md = $3ef42575df84b30b$export$9d1611c77c2fe928(z, {
|
|
2419
|
-
"aria-label": a ||
|
|
2419
|
+
"aria-label": a || M.format("increase", { fieldLabel: Y }).trim(),
|
|
2420
2420
|
id: Z && !a ? Q : null,
|
|
2421
2421
|
"aria-labelledby": Z && !a ? `${Q} ${Z}` : null,
|
|
2422
2422
|
"aria-controls": N,
|
|
@@ -2426,7 +2426,7 @@ function $81397a9303501bda$export$23f548e970bdf099(e4, t, n) {
|
|
|
2426
2426
|
isDisabled: !t.canIncrement,
|
|
2427
2427
|
onPressStart: J
|
|
2428
2428
|
}), hd = $3ef42575df84b30b$export$9d1611c77c2fe928(B, {
|
|
2429
|
-
"aria-label": i ||
|
|
2429
|
+
"aria-label": i || M.format("decrease", { fieldLabel: Y }).trim(),
|
|
2430
2430
|
id: Z && !i ? $ : null,
|
|
2431
2431
|
"aria-labelledby": Z && !i ? `${$} ${Z}` : null,
|
|
2432
2432
|
"aria-controls": N,
|
|
@@ -5422,12 +5422,12 @@ const NumberField = import_react.forwardRef((e4, t) => {
|
|
|
5422
5422
|
className: d,
|
|
5423
5423
|
children: [h, D]
|
|
5424
5424
|
}), n[31] = D, n[32] = d, n[33] = h, n[34] = O) : O = n[34];
|
|
5425
|
-
let
|
|
5426
|
-
return n[35] !== c || n[36] !== a || n[37] !== O || n[38] !== u ? (
|
|
5425
|
+
let k;
|
|
5426
|
+
return n[35] !== c || n[36] !== a || n[37] !== O || n[38] !== u ? (k = /* @__PURE__ */ (0, import_jsx_runtime.jsx)(c, {
|
|
5427
5427
|
...a,
|
|
5428
5428
|
formatOptions: u,
|
|
5429
5429
|
children: O
|
|
5430
|
-
}), n[35] = c, n[36] = a, n[37] = O, n[38] = u, n[39] =
|
|
5430
|
+
}), n[35] = c, n[36] = a, n[37] = O, n[38] = u, n[39] = k) : k = n[39], k;
|
|
5431
5431
|
});
|
|
5432
5432
|
NumberField.displayName = "NumberField";
|
|
5433
5433
|
var StepperButton = (e4) => {
|
package/package.json
CHANGED
|
@@ -132,7 +132,7 @@ const LoadingDataEditor = (props: Props) => {
|
|
|
132
132
|
columnFields={columnFields}
|
|
133
133
|
setColumnFields={setColumnFields}
|
|
134
134
|
editableColumns={props.editableColumns}
|
|
135
|
-
edits={props.edits.edits}
|
|
135
|
+
edits={props.edits.edits}
|
|
136
136
|
onAddEdits={(edits) => {
|
|
137
137
|
props.onEdits((v) => ({ ...v, edits: [...v.edits, ...edits] }));
|
|
138
138
|
}}
|
|
@@ -14,7 +14,13 @@ import DataEditor, {
|
|
|
14
14
|
type Rectangle,
|
|
15
15
|
} from "@glideapps/glide-data-grid";
|
|
16
16
|
import { CopyIcon, TrashIcon } from "lucide-react";
|
|
17
|
-
import React, {
|
|
17
|
+
import React, {
|
|
18
|
+
useCallback,
|
|
19
|
+
useEffect,
|
|
20
|
+
useMemo,
|
|
21
|
+
useRef,
|
|
22
|
+
useState,
|
|
23
|
+
} from "react";
|
|
18
24
|
import useEvent from "react-use-event-hook";
|
|
19
25
|
import type { FieldTypes } from "@/components/data-table/types";
|
|
20
26
|
import {
|
|
@@ -40,7 +46,6 @@ import { ErrorBoundary } from "@/components/editor/boundary/ErrorBoundary";
|
|
|
40
46
|
import { Button } from "@/components/ui/button";
|
|
41
47
|
import { toast } from "@/components/ui/use-toast";
|
|
42
48
|
import type { DataType } from "@/core/kernel/messages";
|
|
43
|
-
import { useOnMount } from "@/hooks/useLifecycle";
|
|
44
49
|
import { useNonce } from "@/hooks/useNonce";
|
|
45
50
|
import { logNever } from "@/utils/assertNever";
|
|
46
51
|
import { Events } from "@/utils/events";
|
|
@@ -93,9 +98,47 @@ export const GlideDataEditor = <T,>({
|
|
|
93
98
|
|
|
94
99
|
const [columnWidths, setColumnWidths] = useState<Record<string, number>>({});
|
|
95
100
|
const rerender = useNonce();
|
|
101
|
+
const hasAppliedEdits = useRef(false);
|
|
96
102
|
|
|
97
|
-
|
|
98
|
-
|
|
103
|
+
const columns: ModifiedGridColumn[] = useMemo(() => {
|
|
104
|
+
const columns: ModifiedGridColumn[] = [];
|
|
105
|
+
for (const [columnName, fieldType] of Object.entries(columnFields)) {
|
|
106
|
+
const editable =
|
|
107
|
+
editableColumns === "all" || editableColumns.includes(columnName);
|
|
108
|
+
|
|
109
|
+
columns.push({
|
|
110
|
+
id: columnName,
|
|
111
|
+
title: columnName,
|
|
112
|
+
width: columnWidths[columnName], // Enables resizing
|
|
113
|
+
icon: editable
|
|
114
|
+
? getColumnHeaderIcon(fieldType)
|
|
115
|
+
: GridColumnIcon.ProtectedColumnOverlay,
|
|
116
|
+
style: "normal",
|
|
117
|
+
kind: getColumnKind(fieldType),
|
|
118
|
+
dataType: fieldType,
|
|
119
|
+
hasMenu: true,
|
|
120
|
+
themeOverride: editable
|
|
121
|
+
? undefined
|
|
122
|
+
: {
|
|
123
|
+
bgCell: theme === "light" ? "#F9F9FA" : "#1e1e21",
|
|
124
|
+
},
|
|
125
|
+
});
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
return columns;
|
|
129
|
+
}, [columnFields, columnWidths, editableColumns, theme]);
|
|
130
|
+
|
|
131
|
+
// Apply initial edits after data has loaded
|
|
132
|
+
useEffect(() => {
|
|
133
|
+
// Don't apply if already applied or data hasn't loaded yet
|
|
134
|
+
if (hasAppliedEdits.current || data.length === 0) {
|
|
135
|
+
return;
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
// Mark as applied once data loads - prevents re-applying user edits
|
|
139
|
+
hasAppliedEdits.current = true;
|
|
140
|
+
|
|
141
|
+
// No initial edits to apply
|
|
99
142
|
if (edits.length === 0) {
|
|
100
143
|
return;
|
|
101
144
|
}
|
|
@@ -184,35 +227,8 @@ export const GlideDataEditor = <T,>({
|
|
|
184
227
|
|
|
185
228
|
// Force re-render to update the total rows
|
|
186
229
|
rerender();
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
const columns: ModifiedGridColumn[] = useMemo(() => {
|
|
190
|
-
const columns: ModifiedGridColumn[] = [];
|
|
191
|
-
for (const [columnName, fieldType] of Object.entries(columnFields)) {
|
|
192
|
-
const editable =
|
|
193
|
-
editableColumns === "all" || editableColumns.includes(columnName);
|
|
194
|
-
|
|
195
|
-
columns.push({
|
|
196
|
-
id: columnName,
|
|
197
|
-
title: columnName,
|
|
198
|
-
width: columnWidths[columnName], // Enables resizing
|
|
199
|
-
icon: editable
|
|
200
|
-
? getColumnHeaderIcon(fieldType)
|
|
201
|
-
: GridColumnIcon.ProtectedColumnOverlay,
|
|
202
|
-
style: "normal",
|
|
203
|
-
kind: getColumnKind(fieldType),
|
|
204
|
-
dataType: fieldType,
|
|
205
|
-
hasMenu: true,
|
|
206
|
-
themeOverride: editable
|
|
207
|
-
? undefined
|
|
208
|
-
: {
|
|
209
|
-
bgCell: theme === "light" ? "#F9F9FA" : "#1e1e21",
|
|
210
|
-
},
|
|
211
|
-
});
|
|
212
|
-
}
|
|
213
|
-
|
|
214
|
-
return columns;
|
|
215
|
-
}, [columnFields, columnWidths, editableColumns, theme]);
|
|
230
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
231
|
+
}, [data.length]);
|
|
216
232
|
|
|
217
233
|
const getCellContent = useCallback(
|
|
218
234
|
(cell: Item): GridCell => {
|