@symbo.ls/utils 2.11.360 → 2.11.365

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.
@@ -0,0 +1,34 @@
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/date.js
21
+ var date_exports = {};
22
+ __export(date_exports, {
23
+ formatDate: () => formatDate
24
+ });
25
+ module.exports = __toCommonJS(date_exports);
26
+ var formatDate = (timestamp) => {
27
+ if (!timestamp)
28
+ return "";
29
+ const d = new Date(timestamp);
30
+ const ye = new Intl.DateTimeFormat("en", { year: "numeric" }).format(d);
31
+ const mo = new Intl.DateTimeFormat("en", { month: "short" }).format(d);
32
+ const da = new Intl.DateTimeFormat("en", { day: "2-digit" }).format(d);
33
+ return `${da} ${mo}, ${ye}`;
34
+ };
@@ -0,0 +1,54 @@
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/detectHeight.js
21
+ var detectHeight_exports = {};
22
+ __export(detectHeight_exports, {
23
+ detectHeightOnInit: () => detectHeightOnInit
24
+ });
25
+ module.exports = __toCommonJS(detectHeight_exports);
26
+ var detectHeightOnInit = (element, state) => {
27
+ const heightTimeout = setTimeout(() => {
28
+ const { props } = element;
29
+ if (!state.clientHeight) {
30
+ const { node: { clientHeight } } = element;
31
+ if (clientHeight) {
32
+ state.clientHeight = clientHeight;
33
+ }
34
+ }
35
+ if (state.active) {
36
+ if (props.height === "auto")
37
+ return;
38
+ element.update({
39
+ props: { height: state.clientHeight }
40
+ }, { preventBeforeUpdateListener: true, preventChildrenUpdate: true });
41
+ const setAutoTimeout = setTimeout(() => {
42
+ element.update({
43
+ props: { height: "auto" }
44
+ }, { preventBeforeUpdateListener: true, preventChildrenUpdate: true });
45
+ clearTimeout(setAutoTimeout);
46
+ }, 450);
47
+ } else {
48
+ element.update({
49
+ props: { height: "0" }
50
+ }, { preventBeforeUpdateListener: true, preventChildrenUpdate: true });
51
+ }
52
+ clearTimeout(heightTimeout);
53
+ });
54
+ };
@@ -0,0 +1,32 @@
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/fibonacci.js
21
+ var fibonacci_exports = {};
22
+ __export(fibonacci_exports, {
23
+ fibonacciNumberByIndex: () => fibonacciNumberByIndex
24
+ });
25
+ module.exports = __toCommonJS(fibonacci_exports);
26
+ var fibonacciNumberByIndex = function fibonacciNumberByIndex2(n) {
27
+ const fib = [0, 1];
28
+ for (let i = 2; i <= n; i++) {
29
+ fib[i] = fib[i - 1] + fib[i - 2];
30
+ }
31
+ return fib[n];
32
+ };