@meshmakers/shared-ui 3.4.320 → 3.4.340

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@meshmakers/shared-ui",
3
- "version": "3.4.320",
3
+ "version": "3.4.340",
4
4
  "peerDependencies": {
5
5
  "@angular/common": "^22.0.0",
6
6
  "@angular/core": "^22.0.0",
@@ -1537,11 +1537,18 @@ type Quarter = 1 | 2 | 3 | 4;
1537
1537
  * local timezone — e.g. year 2026 = `[Jan 1 00:00 local, Jan 1 next-year 00:00 local)`.
1538
1538
  * - `'utc'`: boundaries are wall-clock instants in UTC — e.g. year 2026 =
1539
1539
  * `[2026-01-01T00:00:00Z, 2027-01-01T00:00:00Z)`.
1540
+ * - any **IANA time-zone id** (e.g. `'Europe/Vienna'`, `'Europe/Lisbon'`): boundaries
1541
+ * are wall-clock instants in that zone, resolved DST-correctly regardless of the
1542
+ * browser's own zone — so "yesterday in `Europe/Lisbon`" is right even from a Vienna
1543
+ * browser (AB#4190). A local calendar day across a DST transition is 23 h or 25 h.
1540
1544
  *
1541
1545
  * Relative ranges (last N hours/days) are timezone-independent (a fixed offset
1542
1546
  * from "now") and ignore this setting.
1547
+ *
1548
+ * The `(string & {})` member keeps the `'local'` / `'utc'` literals in editor
1549
+ * autocomplete while still accepting an arbitrary IANA id.
1543
1550
  */
1544
- type TimeRangeZone = 'local' | 'utc';
1551
+ type TimeRangeZone = 'local' | 'utc' | (string & {});
1545
1552
  /**
1546
1553
  * Configuration for the time range picker
1547
1554
  */
@@ -1627,6 +1634,30 @@ declare const DEFAULT_TIME_RANGE_LABELS: TimeRangePickerLabels;
1627
1634
  * Utility functions for time range calculations
1628
1635
  */
1629
1636
  declare class TimeRangeUtils {
1637
+ /**
1638
+ * Offset (wall-clock − UTC), in milliseconds, of an IANA `zone` at the instant `utcMs`.
1639
+ * Computed via `Intl.DateTimeFormat` so it is DST-correct and independent of the browser's
1640
+ * own zone. Positive east of UTC (e.g. +7 200 000 for `Europe/Vienna` in summer).
1641
+ */
1642
+ private static zoneOffsetMs;
1643
+ /**
1644
+ * The UTC instant whose wall-clock time in IANA `zone` equals the given civil fields.
1645
+ * Two-pass so DST transitions resolve correctly (the offset is re-read at the candidate
1646
+ * instant, not just at the naive UTC guess). Field overflow normalizes like `Date.UTC`
1647
+ * (e.g. month 12 ⇒ next January, day 32 ⇒ next month).
1648
+ */
1649
+ private static zonedCivilToUtc;
1650
+ /**
1651
+ * Build a calendar-boundary instant for the given civil fields in `zone`.
1652
+ * `'utc'` and `'local'` keep the historical `Date.UTC` / browser-local-constructor
1653
+ * behaviour byte-for-byte; any other value is treated as an IANA id (AB#4190).
1654
+ */
1655
+ private static boundary;
1656
+ /**
1657
+ * Extract the calendar year/month/day of `date` as seen in `zone`. Used to normalize
1658
+ * custom ranges to that zone's civil-day boundaries.
1659
+ */
1660
+ private static civilDateParts;
1630
1661
  /**
1631
1662
  * Calculate time range for a specific year.
1632
1663
  * Uses exclusive end boundary (start of next year) for correct LESS_THAN filtering.
@@ -2136,6 +2167,17 @@ declare class WindowStateService {
2136
2167
  saveDimensions(dialogKey: string, dimensions: WindowDimensions): void;
2137
2168
  clearDimensions(dialogKey: string): void;
2138
2169
  resolveWindowSize(dialogKey: string, defaults: WindowDimensions, min?: WindowDimensions): WindowDimensions;
2170
+ /**
2171
+ * Keeps a dialog fully on screen: neither a large default nor a size stored
2172
+ * on a bigger monitor may exceed the current viewport (minus a margin), or
2173
+ * the action bar ends up unreachable below the fold on small resolutions.
2174
+ * The clamp deliberately wins over the dialog's minWidth/minHeight — a
2175
+ * slightly-too-small dialog is usable, an off-screen one is not. Stored
2176
+ * sizes stay untouched, so returning to a larger screen restores them.
2177
+ */
2178
+ private clampToViewport;
2179
+ /** Seam for tests — window.innerWidth/innerHeight are not assignable in Karma. */
2180
+ protected viewportSize(): WindowDimensions;
2139
2181
  captureAndSave(dialogKey: string, windowElement: HTMLElement, min?: WindowDimensions): void;
2140
2182
  private parsePixels;
2141
2183
  /**