@tipp/ui 1.1.1 → 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
@@ -1,4 +1,3 @@
1
- import "./chunk-PSINRHYW.js";
2
1
  import {
3
2
  useThemeContext
4
3
  } from "./chunk-MMGP4GEQ.js";
@@ -9,26 +8,27 @@ import "./chunk-PL37KFRJ.js";
9
8
  import {
10
9
  getCellAlign
11
10
  } from "./chunk-A7CXRZIO.js";
11
+ import "./chunk-PSINRHYW.js";
12
+ import {
13
+ EchartDefaultProps
14
+ } from "./chunk-2QFSCWES.js";
15
+ import {
16
+ HorizontalBarChart
17
+ } from "./chunk-SGMO4KBC.js";
12
18
  import "./chunk-KHHXN3CH.js";
19
+ import {
20
+ DatePicker
21
+ } from "./chunk-Z2PA5PMV.js";
13
22
  import {
14
23
  ExpandTable,
15
24
  createColumnHelper
16
25
  } from "./chunk-TJ45WWRH.js";
17
26
  import "./chunk-JFKC7O5G.js";
18
- import {
19
- DatePicker
20
- } from "./chunk-Z2PA5PMV.js";
21
- import "./chunk-BSTJBBEX.js";
22
- import "./chunk-NDUKDKGB.js";
23
27
  import {
24
28
  Navigation
25
29
  } from "./chunk-RKLEKAON.js";
26
- import {
27
- EchartDefaultProps
28
- } from "./chunk-2QFSCWES.js";
29
- import {
30
- HorizontalBarChart
31
- } from "./chunk-SGMO4KBC.js";
30
+ import "./chunk-BSTJBBEX.js";
31
+ import "./chunk-NDUKDKGB.js";
32
32
  import "./chunk-2ANGYYEV.js";
33
33
  import {
34
34
  Strong
@@ -1,17 +1,17 @@
1
1
  import "../chunk-KHHXN3CH.js";
2
+ import {
3
+ DatePicker
4
+ } from "../chunk-Z2PA5PMV.js";
2
5
  import {
3
6
  ExpandTable,
4
7
  createColumnHelper
5
8
  } from "../chunk-TJ45WWRH.js";
6
9
  import "../chunk-JFKC7O5G.js";
7
- import {
8
- DatePicker
9
- } from "../chunk-Z2PA5PMV.js";
10
- import "../chunk-BSTJBBEX.js";
11
- import "../chunk-NDUKDKGB.js";
12
10
  import {
13
11
  Navigation
14
12
  } from "../chunk-RKLEKAON.js";
13
+ import "../chunk-BSTJBBEX.js";
14
+ import "../chunk-NDUKDKGB.js";
15
15
  import "../chunk-2ANGYYEV.js";
16
16
  import "../chunk-74DX4CU7.js";
17
17
  import "../chunk-OYM4XCHQ.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.1",
3
+ "version": "1.1.3",
4
4
  "private": false,
5
5
  "sideEffects": false,
6
6
  "type": "module",
@@ -53,8 +53,8 @@
53
53
  "postcss-nesting": "12.0.2",
54
54
  "tsup": "^8.0.2",
55
55
  "typescript": "^5.3.3",
56
- "@tipp/typescript-config": "1.0.0",
57
- "@tipp/eslint-config": "1.0.0"
56
+ "@tipp/eslint-config": "1.0.0",
57
+ "@tipp/typescript-config": "1.0.0"
58
58
  },
59
59
  "scripts": {
60
60
  "build": "pnpm run build:js & pnpm run build:css",
@@ -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
+ }