@1337exp/taoui 5.32.1 → 5.32.2

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/CHANGELOG.md CHANGED
@@ -1,5 +1,11 @@
1
1
  # Changelog
2
2
 
3
+ ## 5.32.2
4
+
5
+ Nothing to migrate; a fix.
6
+
7
+ - **`TaoSegmented`: the thumb in a scaled parent.** The thumb was measured with `getBoundingClientRect()` (screen px) and drawn in layout px, so inside a parent with `transform: scale(...)` (a zoomed canvas of nodes) it came out smaller by the scale and sat off its option. A change of the zoom does not resize the track, so the `ResizeObserver` stayed quiet and the thumb kept the size of the zoom it appeared at. The boxes are now divided by the scale (the screen size of the track over its layout size), so the thumb is in layout px and right at any zoom; without a layout (SSR, jsdom) the scale is 1 and nothing changes. Found in `kupona`, a calculator on a canvas of nodes.
8
+
3
9
  ## 5.32.1
4
10
 
5
11
  Nothing to migrate; one look changes: the confirm dialog has no bar on its left edge.
package/dist/index.js CHANGED
@@ -9144,10 +9144,12 @@ const _sfc_main$r = /* @__PURE__ */ defineComponent({
9144
9144
  }
9145
9145
  const trackBox = track.getBoundingClientRect();
9146
9146
  const optionBox = selected.getBoundingClientRect();
9147
+ const scaleX = track.offsetWidth > 0 && trackBox.width > 0 ? trackBox.width / track.offsetWidth : 1;
9148
+ const scaleY = track.offsetHeight > 0 && trackBox.height > 0 ? trackBox.height / track.offsetHeight : 1;
9147
9149
  const next = {
9148
- width: `${optionBox.width}px`,
9149
- height: `${optionBox.height}px`,
9150
- transform: `translate(${optionBox.left - trackBox.left - track.clientLeft}px, ${optionBox.top - trackBox.top - track.clientTop}px)`,
9150
+ width: `${optionBox.width / scaleX}px`,
9151
+ height: `${optionBox.height / scaleY}px`,
9152
+ transform: `translate(${(optionBox.left - trackBox.left) / scaleX - track.clientLeft}px, ${(optionBox.top - trackBox.top) / scaleY - track.clientTop}px)`,
9151
9153
  opacity: "1"
9152
9154
  };
9153
9155
  const prev = thumbStyle.value;
@@ -9226,7 +9228,7 @@ const _sfc_main$r = /* @__PURE__ */ defineComponent({
9226
9228
  };
9227
9229
  }
9228
9230
  });
9229
- const TaoSegmented = /* @__PURE__ */ _export_sfc(_sfc_main$r, [["__scopeId", "data-v-49ed8ced"]]);
9231
+ const TaoSegmented = /* @__PURE__ */ _export_sfc(_sfc_main$r, [["__scopeId", "data-v-c4a6edd1"]]);
9230
9232
  const _hoisted_1$q = ["for"];
9231
9233
  const _hoisted_2$o = ["id", "name", "value", "checked", "disabled", "aria-label"];
9232
9234
  const _hoisted_3$k = { class: "tao-segmented-option__face" };