@krosoft/react 0.0.281 → 0.0.282

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.
@@ -4,6 +4,7 @@ export interface AppTabsProps<T = unknown> {
4
4
  itemId?: string | null;
5
5
  item?: T | null;
6
6
  fit?: boolean;
7
+ paramName?: string;
7
8
  }
8
- export declare function AppTabs({ tabs, itemId, item, fit }: AppTabsProps): React.JSX.Element;
9
+ export declare function AppTabs({ tabs, itemId, item, fit, paramName }: AppTabsProps): React.JSX.Element;
9
10
  //# sourceMappingURL=AppTabs.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"AppTabs.d.ts","sourceRoot":"","sources":["../../../../src/components/core/tabs/AppTabs.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAMnD,MAAM,WAAW,YAAY,CAAC,CAAC,GAAG,OAAO;IACvC,IAAI,EAAE,SAAS,CAAC,CAAC,CAAC,EAAE,CAAC;IACrB,MAAM,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACvB,IAAI,CAAC,EAAE,CAAC,GAAG,IAAI,CAAC;IAChB,GAAG,CAAC,EAAE,OAAO,CAAC;CACf;AAED,wBAAgB,OAAO,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,GAAG,EAAE,EAAE,YAAY,GAAG,KAAK,CAAC,GAAG,CAAC,OAAO,CA8CpF"}
1
+ {"version":3,"file":"AppTabs.d.ts","sourceRoot":"","sources":["../../../../src/components/core/tabs/AppTabs.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAMnD,MAAM,WAAW,YAAY,CAAC,CAAC,GAAG,OAAO;IACvC,IAAI,EAAE,SAAS,CAAC,CAAC,CAAC,EAAE,CAAC;IACrB,MAAM,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACvB,IAAI,CAAC,EAAE,CAAC,GAAG,IAAI,CAAC;IAChB,GAAG,CAAC,EAAE,OAAO,CAAC;IAId,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,wBAAgB,OAAO,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,GAAG,EAAE,SAAiB,EAAE,EAAE,YAAY,GAAG,KAAK,CAAC,GAAG,CAAC,OAAO,CAgDvG"}
@@ -39,22 +39,22 @@ function w({ titleKey: e, descriptionKey: i, actions: a = [], className: o, chil
39
39
  }
40
40
  //#endregion
41
41
  //#region src/components/core/tabs/AppTabs.tsx
42
- function T({ tabs: t, itemId: n, item: r, fit: l }) {
43
- let { t: u } = i(), [d, f] = S(), p = d.get("tab"), m = t.find((e) => e.value === p)?.value ?? t[0]?.value, h = (e) => {
44
- let t = new URLSearchParams();
45
- t.set("tab", e), f(t);
46
- }, g = v(null);
42
+ function T({ tabs: t, itemId: n, item: r, fit: l, paramName: u = "tab" }) {
43
+ let { t: d } = i(), [f, p] = S(), m = f.get(u), h = t.find((e) => e.value === m)?.value ?? t[0]?.value, g = (e) => {
44
+ let t = new URLSearchParams(f);
45
+ t.set(u, e), p(t);
46
+ }, x = v(null);
47
47
  return _(() => {
48
- (g.current?.querySelector("[data-state=\"active\"]"))?.scrollIntoView?.({
48
+ (x.current?.querySelector("[data-state=\"active\"]"))?.scrollIntoView?.({
49
49
  behavior: "smooth",
50
50
  block: "nearest",
51
51
  inline: "nearest"
52
52
  });
53
- }, [m]), /* @__PURE__ */ b(c, {
54
- value: m,
55
- onValueChange: h,
53
+ }, [h]), /* @__PURE__ */ b(c, {
54
+ value: h,
55
+ onValueChange: g,
56
56
  children: [/* @__PURE__ */ y(o, {
57
- ref: g,
57
+ ref: x,
58
58
  className: e("w-full justify-start", l && "sm:w-fit"),
59
59
  children: t.map((e) => /* @__PURE__ */ b(a, {
60
60
  value: e.value,
@@ -67,7 +67,7 @@ function T({ tabs: t, itemId: n, item: r, fit: l }) {
67
67
  }) : null,
68
68
  /* @__PURE__ */ y("span", {
69
69
  className: "text-xs sm:text-sm",
70
- children: u(e.titleKey) ?? ""
70
+ children: d(e.titleKey) ?? ""
71
71
  }),
72
72
  e.count ? /* @__PURE__ */ b("span", {
73
73
  className: "text-gray-500 text-xs",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@krosoft/react",
3
- "version": "0.0.281",
3
+ "version": "0.0.282",
4
4
  "description": "Krosoft shared React package",
5
5
  "type": "module",
6
6
  "scripts": {