@tipp/ui 1.1.2 → 1.1.3

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/index.js CHANGED
@@ -16,6 +16,9 @@ import {
16
16
  HorizontalBarChart
17
17
  } from "./chunk-SGMO4KBC.js";
18
18
  import "./chunk-KHHXN3CH.js";
19
+ import {
20
+ DatePicker
21
+ } from "./chunk-Z2PA5PMV.js";
19
22
  import {
20
23
  ExpandTable,
21
24
  createColumnHelper
@@ -24,9 +27,6 @@ import "./chunk-JFKC7O5G.js";
24
27
  import {
25
28
  Navigation
26
29
  } from "./chunk-RKLEKAON.js";
27
- import {
28
- DatePicker
29
- } from "./chunk-Z2PA5PMV.js";
30
30
  import "./chunk-BSTJBBEX.js";
31
31
  import "./chunk-NDUKDKGB.js";
32
32
  import "./chunk-2ANGYYEV.js";
@@ -1,4 +1,7 @@
1
1
  import "../chunk-KHHXN3CH.js";
2
+ import {
3
+ DatePicker
4
+ } from "../chunk-Z2PA5PMV.js";
2
5
  import {
3
6
  ExpandTable,
4
7
  createColumnHelper
@@ -7,9 +10,6 @@ import "../chunk-JFKC7O5G.js";
7
10
  import {
8
11
  Navigation
9
12
  } from "../chunk-RKLEKAON.js";
10
- import {
11
- DatePicker
12
- } from "../chunk-Z2PA5PMV.js";
13
13
  import "../chunk-BSTJBBEX.js";
14
14
  import "../chunk-NDUKDKGB.js";
15
15
  import "../chunk-2ANGYYEV.js";
@@ -0,0 +1,55 @@
1
+ "use strict";
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __export = (target, all) => {
7
+ for (var name in all)
8
+ __defProp(target, name, { get: all[name], enumerable: true });
9
+ };
10
+ var __copyProps = (to, from, except, desc) => {
11
+ if (from && typeof from === "object" || typeof from === "function") {
12
+ for (let key of __getOwnPropNames(from))
13
+ if (!__hasOwnProp.call(to, key) && key !== except)
14
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
+ }
16
+ return to;
17
+ };
18
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
+
20
+ // src/utils/scroll-to.ts
21
+ var scroll_to_exports = {};
22
+ __export(scroll_to_exports, {
23
+ scrollTo: () => scrollTo
24
+ });
25
+ module.exports = __toCommonJS(scroll_to_exports);
26
+ function scrollTo(element, targetPosition, duration) {
27
+ const startPosition = element.scrollTop;
28
+ const distance = targetPosition - startPosition;
29
+ let startTime = null;
30
+ function animation(currentTime) {
31
+ if (startTime === null)
32
+ startTime = currentTime;
33
+ const timeElapsed = currentTime - startTime;
34
+ const run = ease(timeElapsed, startPosition, distance, duration);
35
+ element.scrollTop = run;
36
+ if (timeElapsed < duration) {
37
+ requestAnimationFrame(animation);
38
+ }
39
+ }
40
+ function ease(t, b, c, d) {
41
+ let [t2] = [t];
42
+ const [b2, c2, d2] = [b, c, d];
43
+ t2 /= d2 / 2;
44
+ if (t2 < 1)
45
+ return c2 / 2 * t2 * t2 + b2;
46
+ t2--;
47
+ return -c2 / 2 * (t2 * (t2 - 2) - 1) + b2;
48
+ }
49
+ requestAnimationFrame(animation);
50
+ }
51
+ // Annotate the CommonJS export names for ESM import in node:
52
+ 0 && (module.exports = {
53
+ scrollTo
54
+ });
55
+ //# sourceMappingURL=scroll-to.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/utils/scroll-to.ts"],"sourcesContent":["export function scrollTo(\n element: HTMLDivElement,\n targetPosition: number,\n duration: number\n): void {\n const startPosition = element.scrollTop;\n const distance = targetPosition - startPosition;\n let startTime: number | null = null;\n\n function animation(currentTime: number): void {\n if (startTime === null) startTime = currentTime;\n const timeElapsed = currentTime - startTime;\n const run = ease(timeElapsed, startPosition, distance, duration);\n element.scrollTop = run;\n if (timeElapsed < duration) {\n requestAnimationFrame(animation);\n }\n }\n\n function ease(t: number, b: number, c: number, d: number): number {\n let [t2] = [t];\n const [b2, c2, d2] = [b, c, d];\n t2 /= d2 / 2;\n if (t2 < 1) return (c2 / 2) * t2 * t2 + b2;\n t2--;\n return (-c2 / 2) * (t2 * (t2 - 2) - 1) + b2;\n }\n\n requestAnimationFrame(animation);\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAO,SAAS,SACd,SACA,gBACA,UACM;AACN,QAAM,gBAAgB,QAAQ;AAC9B,QAAM,WAAW,iBAAiB;AAClC,MAAI,YAA2B;AAE/B,WAAS,UAAU,aAA2B;AAC5C,QAAI,cAAc;AAAM,kBAAY;AACpC,UAAM,cAAc,cAAc;AAClC,UAAM,MAAM,KAAK,aAAa,eAAe,UAAU,QAAQ;AAC/D,YAAQ,YAAY;AACpB,QAAI,cAAc,UAAU;AAC1B,4BAAsB,SAAS;AAAA,IACjC;AAAA,EACF;AAEA,WAAS,KAAK,GAAW,GAAW,GAAW,GAAmB;AAChE,QAAI,CAAC,EAAE,IAAI,CAAC,CAAC;AACb,UAAM,CAAC,IAAI,IAAI,EAAE,IAAI,CAAC,GAAG,GAAG,CAAC;AAC7B,UAAM,KAAK;AACX,QAAI,KAAK;AAAG,aAAQ,KAAK,IAAK,KAAK,KAAK;AACxC;AACA,WAAQ,CAAC,KAAK,KAAM,MAAM,KAAK,KAAK,KAAK;AAAA,EAC3C;AAEA,wBAAsB,SAAS;AACjC;","names":[]}
@@ -0,0 +1,32 @@
1
+ import "../chunk-N552FDTV.js";
2
+
3
+ // src/utils/scroll-to.ts
4
+ function scrollTo(element, targetPosition, duration) {
5
+ const startPosition = element.scrollTop;
6
+ const distance = targetPosition - startPosition;
7
+ let startTime = null;
8
+ function animation(currentTime) {
9
+ if (startTime === null)
10
+ startTime = currentTime;
11
+ const timeElapsed = currentTime - startTime;
12
+ const run = ease(timeElapsed, startPosition, distance, duration);
13
+ element.scrollTop = run;
14
+ if (timeElapsed < duration) {
15
+ requestAnimationFrame(animation);
16
+ }
17
+ }
18
+ function ease(t, b, c, d) {
19
+ let [t2] = [t];
20
+ const [b2, c2, d2] = [b, c, d];
21
+ t2 /= d2 / 2;
22
+ if (t2 < 1)
23
+ return c2 / 2 * t2 * t2 + b2;
24
+ t2--;
25
+ return -c2 / 2 * (t2 * (t2 - 2) - 1) + b2;
26
+ }
27
+ requestAnimationFrame(animation);
28
+ }
29
+ export {
30
+ scrollTo
31
+ };
32
+ //# sourceMappingURL=scroll-to.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/utils/scroll-to.ts"],"sourcesContent":["export function scrollTo(\n element: HTMLDivElement,\n targetPosition: number,\n duration: number\n): void {\n const startPosition = element.scrollTop;\n const distance = targetPosition - startPosition;\n let startTime: number | null = null;\n\n function animation(currentTime: number): void {\n if (startTime === null) startTime = currentTime;\n const timeElapsed = currentTime - startTime;\n const run = ease(timeElapsed, startPosition, distance, duration);\n element.scrollTop = run;\n if (timeElapsed < duration) {\n requestAnimationFrame(animation);\n }\n }\n\n function ease(t: number, b: number, c: number, d: number): number {\n let [t2] = [t];\n const [b2, c2, d2] = [b, c, d];\n t2 /= d2 / 2;\n if (t2 < 1) return (c2 / 2) * t2 * t2 + b2;\n t2--;\n return (-c2 / 2) * (t2 * (t2 - 2) - 1) + b2;\n }\n\n requestAnimationFrame(animation);\n}\n"],"mappings":";;;AAAO,SAAS,SACd,SACA,gBACA,UACM;AACN,QAAM,gBAAgB,QAAQ;AAC9B,QAAM,WAAW,iBAAiB;AAClC,MAAI,YAA2B;AAE/B,WAAS,UAAU,aAA2B;AAC5C,QAAI,cAAc;AAAM,kBAAY;AACpC,UAAM,cAAc,cAAc;AAClC,UAAM,MAAM,KAAK,aAAa,eAAe,UAAU,QAAQ;AAC/D,YAAQ,YAAY;AACpB,QAAI,cAAc,UAAU;AAC1B,4BAAsB,SAAS;AAAA,IACjC;AAAA,EACF;AAEA,WAAS,KAAK,GAAW,GAAW,GAAW,GAAmB;AAChE,QAAI,CAAC,EAAE,IAAI,CAAC,CAAC;AACb,UAAM,CAAC,IAAI,IAAI,EAAE,IAAI,CAAC,GAAG,GAAG,CAAC;AAC7B,UAAM,KAAK;AACX,QAAI,KAAK;AAAG,aAAQ,KAAK,IAAK,KAAK,KAAK;AACxC;AACA,WAAQ,CAAC,KAAK,KAAM,MAAM,KAAK,KAAK,KAAK;AAAA,EAC3C;AAEA,wBAAsB,SAAS;AACjC;","names":[]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tipp/ui",
3
- "version": "1.1.2",
3
+ "version": "1.1.3",
4
4
  "private": false,
5
5
  "sideEffects": false,
6
6
  "type": "module",
@@ -0,0 +1,30 @@
1
+ export function scrollTo(
2
+ element: HTMLDivElement,
3
+ targetPosition: number,
4
+ duration: number
5
+ ): void {
6
+ const startPosition = element.scrollTop;
7
+ const distance = targetPosition - startPosition;
8
+ let startTime: number | null = null;
9
+
10
+ function animation(currentTime: number): void {
11
+ if (startTime === null) startTime = currentTime;
12
+ const timeElapsed = currentTime - startTime;
13
+ const run = ease(timeElapsed, startPosition, distance, duration);
14
+ element.scrollTop = run;
15
+ if (timeElapsed < duration) {
16
+ requestAnimationFrame(animation);
17
+ }
18
+ }
19
+
20
+ function ease(t: number, b: number, c: number, d: number): number {
21
+ let [t2] = [t];
22
+ const [b2, c2, d2] = [b, c, d];
23
+ t2 /= d2 / 2;
24
+ if (t2 < 1) return (c2 / 2) * t2 * t2 + b2;
25
+ t2--;
26
+ return (-c2 / 2) * (t2 * (t2 - 2) - 1) + b2;
27
+ }
28
+
29
+ requestAnimationFrame(animation);
30
+ }