@mark1russell7/site-pages 0.3.3 → 0.3.5

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.
@@ -1261,6 +1261,7 @@ function mountRecord(host, record, options) {
1261
1261
  let frame = 0;
1262
1262
  let drawnWidth = 0;
1263
1263
  let view;
1264
+ let idleOpen = false;
1264
1265
  const controls = h("div", { class: "rx-controls" });
1265
1266
  const panels = h("div", { class: "rx-panels" });
1266
1267
  const error = h("p", { class: "rx-error" });
@@ -1344,7 +1345,7 @@ function mountRecord(host, record, options) {
1344
1345
  choose: () => update(setMeasure(record, state, m.id))
1345
1346
  })), "");
1346
1347
  const axes = h("div", { class: "rx-axes" }, dimensionSelect("Across", "x", axisChoices(record, state, "x"), state.x, null, (id) => update(setAxis(record, state, "x", id))), dimensionSelect("Up", "y", axisChoices(record, state, "y"), state.y, "None (a curve)", (id) => update(setAxis(record, state, "y", id))), dimensionSelect("Panels", "facet", facetChoices(record, state), state.facet, "One panel", (id) => update(setFacet(record, state, id))));
1347
- const holds = holdControls(record, state).map((control) => {
1348
+ const holdOf = (control) => {
1348
1349
  if (control.kind === "stops") return stopSlider(control, `hold:${control.id}`, (value) => {
1349
1350
  state = setHold(record, state, control.id, value);
1350
1351
  later();
@@ -1357,8 +1358,21 @@ function mountRecord(host, record, options) {
1357
1358
  choose: () => update(setHold(record, state, control.id, option.value))
1358
1359
  }));
1359
1360
  return levelGroup(control.label, `hold:${control.id}`, `rx-${mount}-${control.id}`, levels, control.note);
1361
+ };
1362
+ const holds = holdControls(record, state);
1363
+ const idle = holds.filter((control) => !control.applies);
1364
+ const fold = idle.length === 0 ? null : h("details", {
1365
+ class: "rx-idle",
1366
+ open: idleOpen
1367
+ }, h("summary", {}, `Held values that do not apply (${idle.length})`), h("div", { class: "rx-idle-list" }, ...idle.map(holdOf)));
1368
+ fold?.addEventListener("toggle", () => {
1369
+ idleOpen = fold.open;
1360
1370
  });
1361
- const held = holds.length === 0 ? [] : [h("p", { class: "rx-section" }, "Held values"), ...holds];
1371
+ const held = holds.length === 0 ? [] : [
1372
+ h("p", { class: "rx-section" }, "Held values"),
1373
+ ...holds.filter((control) => control.applies).map(holdOf),
1374
+ ...fold === null ? [] : [fold]
1375
+ ];
1362
1376
  controls.replaceChildren(measures, axes, ...held);
1363
1377
  if (focused !== void 0) [...controls.querySelectorAll("[data-key]")].find((el) => el.dataset["key"] === focused)?.focus();
1364
1378
  };