alif-ui 1.15.1 → 1.15.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/components/Timeline/Timeline.context.d.ts +1 -1
- package/dist/components/Timeline/Timeline.context.d.ts.map +1 -1
- package/dist/components/Timeline/Timeline.js +1 -1
- package/dist/components/Timeline/Timeline.types.d.ts +3 -1
- package/dist/components/Timeline/Timeline.types.d.ts.map +1 -1
- package/dist/components/Timeline/TimelineItem/TimelineItem.js +8 -8
- package/dist/providers/Localization/localization.d.ts +2 -1
- package/dist/providers/Localization/localization.d.ts.map +1 -1
- package/dist/providers/Localization/localization.js +25 -22
- package/dist/providers/Localization/useTranslation/useTranslation.d.ts +1 -1
- package/dist/providers/Localization/useTranslation/useTranslation.d.ts.map +1 -1
- package/dist/providers/Localization/useTranslation/useTranslation.js +4 -4
- package/package.json +1 -2
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Timeline.context.d.ts","sourceRoot":"","sources":["../../../src/lib/components/Timeline/Timeline.context.ts"],"names":[],"mappings":";AAEA,MAAM,WAAW,eAAe;IAC/B,UAAU,EAAE,OAAO,CAAC;IACpB,MAAM,EAAE,MAAM,CAAC;
|
|
1
|
+
{"version":3,"file":"Timeline.context.d.ts","sourceRoot":"","sources":["../../../src/lib/components/Timeline/Timeline.context.ts"],"names":[],"mappings":";AAEA,MAAM,WAAW,eAAe;IAC/B,UAAU,EAAE,OAAO,CAAC;IACpB,MAAM,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACvB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,YAAY,CAAC,EAAE;QACd,QAAQ,CAAC,EAAE,MAAM,CAAC;QAClB,IAAI,CAAC,EAAE,MAAM,CAAC;KACd,CAAC;CACF;AAED,eAAO,MAAO,uBAAuB;;;+CAAE,kBAAkB,uBAGvD,CAAC"}
|
|
@@ -10,8 +10,10 @@ export interface TimelineProps {
|
|
|
10
10
|
children?: ReactNode;
|
|
11
11
|
/**
|
|
12
12
|
* Indicates the currently active timeline step.
|
|
13
|
+
* Pass `null` (or any negative number) when no step is active yet —
|
|
14
|
+
* every item is then rendered as `inactive`.
|
|
13
15
|
**/
|
|
14
|
-
active?: number;
|
|
16
|
+
active?: number | null;
|
|
15
17
|
/**
|
|
16
18
|
* Adjusts the flex grow ratio between opposite content and content.
|
|
17
19
|
* **Important**: This prop only has an effect when the timeline is vertical (horizontal = false).
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Timeline.types.d.ts","sourceRoot":"","sources":["../../../src/lib/components/Timeline/Timeline.types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAElC,MAAM,WAAW,aAAa;IAC7B;;QAEI;IACJ,UAAU,CAAC,EAAE,OAAO,CAAC;IAErB;;OAEG;IACH,QAAQ,CAAC,EAAE,SAAS,CAAC;IAErB
|
|
1
|
+
{"version":3,"file":"Timeline.types.d.ts","sourceRoot":"","sources":["../../../src/lib/components/Timeline/Timeline.types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAElC,MAAM,WAAW,aAAa;IAC7B;;QAEI;IACJ,UAAU,CAAC,EAAE,OAAO,CAAC;IAErB;;OAEG;IACH,QAAQ,CAAC,EAAE,SAAS,CAAC;IAErB;;;;QAII;IACJ,MAAM,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAEvB;;;OAGG;IACH,YAAY,CAAC,EAAE;QACd,QAAQ,CAAC,EAAE,MAAM,CAAC;QAClB,IAAI,CAAC,EAAE,MAAM,CAAC;KACd,CAAC;CACF;AAED,MAAM,MAAM,MAAM,GAAG,QAAQ,GAAG,UAAU,GAAG,WAAW,CAAC;AACzD,MAAM,MAAM,KAAK,GAAG,OAAO,GAAG,QAAQ,GAAG,MAAM,CAAC"}
|
|
@@ -2,28 +2,28 @@ import { jsxs as a, jsx as i } from "react/jsx-runtime";
|
|
|
2
2
|
import { Children as v } from "react";
|
|
3
3
|
import { classNames as o } from "../../../utils/class-names.js";
|
|
4
4
|
import { s as t, T as N } from "../../../TimelineBullet-CpAQu1IW.js";
|
|
5
|
-
import { findChildByType as c, getTimelineItemStyles as
|
|
6
|
-
import { useTimelineContext as
|
|
5
|
+
import { findChildByType as c, getTimelineItemStyles as g } from "./TimelineItem.utils.js";
|
|
6
|
+
import { useTimelineContext as x } from "../Timeline.context.js";
|
|
7
7
|
import { getStatus as j, getOrder as z } from "../Timeline.utils.js";
|
|
8
8
|
import { TimelineOppositeContent as A } from "../TimelineOppositeContent/TimelineOppositeContent.js";
|
|
9
9
|
import { TimelineContent as B } from "../TimelineContent/TimelineContent.js";
|
|
10
|
-
const
|
|
10
|
+
const F = ({
|
|
11
11
|
children: p,
|
|
12
12
|
bullet: d,
|
|
13
13
|
tabIndex: n = 0
|
|
14
14
|
}) => {
|
|
15
|
-
const { horizontal: s, active: f, countChildren: r } =
|
|
15
|
+
const { horizontal: s, active: f, countChildren: r } = x(), C = f ?? -1, h = o(
|
|
16
16
|
t.root,
|
|
17
17
|
s && t.horizontal
|
|
18
18
|
), l = v.toArray(p), T = c(
|
|
19
19
|
l,
|
|
20
20
|
A
|
|
21
|
-
), y = c(l, B), e = j(
|
|
21
|
+
), y = c(l, B), e = j(C, n), m = z(n, r), u = m === "last" || r === 1;
|
|
22
22
|
return /* @__PURE__ */ a(
|
|
23
23
|
"li",
|
|
24
24
|
{
|
|
25
|
-
style:
|
|
26
|
-
className:
|
|
25
|
+
style: g(s, m),
|
|
26
|
+
className: h,
|
|
27
27
|
children: [
|
|
28
28
|
T,
|
|
29
29
|
/* @__PURE__ */ a("div", { className: t.lineContainer, children: [
|
|
@@ -49,5 +49,5 @@ const E = ({
|
|
|
49
49
|
);
|
|
50
50
|
};
|
|
51
51
|
export {
|
|
52
|
-
|
|
52
|
+
F as TimelineItem
|
|
53
53
|
};
|
|
@@ -6,7 +6,8 @@ declare class Localization {
|
|
|
6
6
|
constructor();
|
|
7
7
|
init(): Promise<void>;
|
|
8
8
|
load(locale: string): Promise<void>;
|
|
9
|
-
t(key: string): string;
|
|
9
|
+
t(key: string, params?: Record<string, string | number>): string;
|
|
10
|
+
private interpolate;
|
|
10
11
|
}
|
|
11
12
|
export declare const localization: Localization;
|
|
12
13
|
export {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"localization.d.ts","sourceRoot":"","sources":["../../../src/lib/providers/Localization/localization.ts"],"names":[],"mappings":"AAGA,cAAM,YAAY;IAEjB,OAAO,CAAC,YAAY,CAA2B;IAC/C,OAAO,CAAC,MAAM,CAA0B;IAExC,OAAO,CAAC,KAAK,CAA2B;IACxC,OAAO,CAAC,KAAK,CAAS;;IAShB,IAAI;IAMJ,IAAI,CAAC,MAAM,EAAE,MAAM;IA6BzB,CAAC,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM;
|
|
1
|
+
{"version":3,"file":"localization.d.ts","sourceRoot":"","sources":["../../../src/lib/providers/Localization/localization.ts"],"names":[],"mappings":"AAGA,cAAM,YAAY;IAEjB,OAAO,CAAC,YAAY,CAA2B;IAC/C,OAAO,CAAC,MAAM,CAA0B;IAExC,OAAO,CAAC,KAAK,CAA2B;IACxC,OAAO,CAAC,KAAK,CAAS;;IAShB,IAAI;IAMJ,IAAI,CAAC,MAAM,EAAE,MAAM;IA6BzB,CAAC,CAAC,GAAG,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,CAAC,GAAG,MAAM;IAkBhE,OAAO,CAAC,WAAW;CAQnB;AAED,eAAO,MAAM,YAAY,cAAqB,CAAC"}
|
|
@@ -1,18 +1,18 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var
|
|
4
|
-
import { getDefaultLocale as
|
|
5
|
-
const
|
|
6
|
-
class
|
|
1
|
+
var a = Object.defineProperty;
|
|
2
|
+
var c = (e, t, s) => t in e ? a(e, t, { enumerable: !0, configurable: !0, writable: !0, value: s }) : e[t] = s;
|
|
3
|
+
var o = (e, t, s) => c(e, typeof t != "symbol" ? t + "" : t, s);
|
|
4
|
+
import { getDefaultLocale as l } from "../AlifProvider/AlifProvider.utils.js";
|
|
5
|
+
const h = l();
|
|
6
|
+
class f {
|
|
7
7
|
constructor() {
|
|
8
8
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
9
|
-
|
|
10
|
-
|
|
9
|
+
o(this, "translations", {});
|
|
10
|
+
o(this, "locale", h);
|
|
11
11
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
12
|
-
|
|
13
|
-
|
|
12
|
+
o(this, "cache", {});
|
|
13
|
+
o(this, "ready", !1);
|
|
14
14
|
if (typeof window < "u") {
|
|
15
|
-
const t = localStorage.getItem("
|
|
15
|
+
const t = localStorage.getItem("locale");
|
|
16
16
|
t && (this.locale = t);
|
|
17
17
|
}
|
|
18
18
|
}
|
|
@@ -31,25 +31,28 @@ class h {
|
|
|
31
31
|
console.error(`Failed to fetch locale ${t}: ${s.status}`), this.translations = {};
|
|
32
32
|
return;
|
|
33
33
|
}
|
|
34
|
-
const
|
|
35
|
-
this.cache[t] =
|
|
34
|
+
const n = await s.json();
|
|
35
|
+
this.cache[t] = n, this.translations = n, this.locale = t;
|
|
36
36
|
} catch (s) {
|
|
37
37
|
console.error(`Failed to load ${t} translations`, s), this.translations = {};
|
|
38
38
|
}
|
|
39
39
|
}
|
|
40
40
|
}
|
|
41
|
-
t(t) {
|
|
42
|
-
const
|
|
43
|
-
let
|
|
44
|
-
for (const
|
|
45
|
-
if (
|
|
46
|
-
|
|
41
|
+
t(t, s) {
|
|
42
|
+
const n = t.split(".");
|
|
43
|
+
let i = this.translations;
|
|
44
|
+
for (const r of n)
|
|
45
|
+
if (i && typeof i == "object" && r in i)
|
|
46
|
+
i = i[r];
|
|
47
47
|
else
|
|
48
48
|
return t;
|
|
49
|
-
return typeof
|
|
49
|
+
return typeof i != "string" ? t : s ? this.interpolate(i, s) : i;
|
|
50
|
+
}
|
|
51
|
+
interpolate(t, s) {
|
|
52
|
+
return t.replace(/\{\{\s*(\w+)\s*\}\}/g, (n, i) => i in s ? String(s[i]) : n);
|
|
50
53
|
}
|
|
51
54
|
}
|
|
52
|
-
const
|
|
55
|
+
const p = new f();
|
|
53
56
|
export {
|
|
54
|
-
|
|
57
|
+
p as localization
|
|
55
58
|
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Locale } from '../../AlifProvider/AlifProvider.types';
|
|
2
2
|
export declare const useTranslation: () => {
|
|
3
|
-
t: (key: string) => string;
|
|
3
|
+
t: (key: string, params?: Record<string, string | number>) => string;
|
|
4
4
|
language: Locale;
|
|
5
5
|
changeLanguage: (nextLocale: Locale | ((prev: Locale) => Locale)) => Promise<void>;
|
|
6
6
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useTranslation.d.ts","sourceRoot":"","sources":["../../../../src/lib/providers/Localization/useTranslation/useTranslation.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,MAAM,EAAE,MAAM,uCAAuC,CAAC;AAE/D,eAAO,MAAM,cAAc;aAaV,MAAM;;
|
|
1
|
+
{"version":3,"file":"useTranslation.d.ts","sourceRoot":"","sources":["../../../../src/lib/providers/Localization/useTranslation/useTranslation.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,MAAM,EAAE,MAAM,uCAAuC,CAAC;AAE/D,eAAO,MAAM,cAAc;aAaV,MAAM,WAAW,OAAO,MAAM,EAAE,MAAM,GAAG,MAAM,CAAC;;kDATlC,MAAM,KAAK,MAAM;CAY/C,CAAC"}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { useAlifProviderContext as c } from "../../AlifProvider/AlifProvider.context.js";
|
|
2
2
|
import { localization as n } from "../localization.js";
|
|
3
3
|
const g = () => {
|
|
4
|
-
const { locale:
|
|
5
|
-
return { t: (o) => n.t(o), language:
|
|
6
|
-
const
|
|
7
|
-
await n.load(
|
|
4
|
+
const { locale: a, setLocale: e } = c();
|
|
5
|
+
return { t: (o, t) => n.t(o, t), language: a, changeLanguage: async (o) => {
|
|
6
|
+
const t = typeof o == "function" ? o(a) : o;
|
|
7
|
+
await n.load(t), e(t);
|
|
8
8
|
} };
|
|
9
9
|
};
|
|
10
10
|
export {
|
package/package.json
CHANGED
|
@@ -21,7 +21,7 @@
|
|
|
21
21
|
},
|
|
22
22
|
"license": "ISC",
|
|
23
23
|
"private": false,
|
|
24
|
-
"version": "1.15.
|
|
24
|
+
"version": "1.15.3",
|
|
25
25
|
"type": "module",
|
|
26
26
|
"files": [
|
|
27
27
|
"dist"
|
|
@@ -49,7 +49,6 @@
|
|
|
49
49
|
"stylelint": "stylelint \"**/*.css\" --fix",
|
|
50
50
|
"eslint": "eslint --ext .ts,.tsx --fix",
|
|
51
51
|
"format": "prettier --no-error-on-unmatched-pattern --write **/*.{jsx,ts,tsx}",
|
|
52
|
-
"prepare": "husky",
|
|
53
52
|
"test": "jest --config config/jest/jestconfig.json",
|
|
54
53
|
"storybook": "storybook dev -p 6006",
|
|
55
54
|
"build-storybook": "storybook build"
|