@astral/features 3.229.0 → 3.230.0

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.
@@ -1,3 +1,4 @@
1
+ import { type ProductSwitcherProps } from '@astral/ui';
1
2
  import { ProductFilterType } from './enums';
2
3
  export type AstralProductSwitcherType = {
3
4
  /**
@@ -13,5 +14,9 @@ export type AstralProductSwitcherType = {
13
14
  * @deprecated
14
15
  * */
15
16
  tenantId?: string;
17
+ /**
18
+ * Альтернативная функция для фильтрации продуктов
19
+ */
20
+ filter?: ProductSwitcherProps['filter'];
16
21
  };
17
- export declare const AstralProductSwitcher: ({ identityUrl, filterBy, code, tenantId, }: AstralProductSwitcherType) => import("react/jsx-runtime").JSX.Element;
22
+ export declare const AstralProductSwitcher: ({ identityUrl, filterBy, code, filter, tenantId, }: AstralProductSwitcherType) => import("react/jsx-runtime").JSX.Element;
@@ -16,7 +16,7 @@ const react_1 = require("react");
16
16
  const utils_1 = require("../../utils");
17
17
  const enums_1 = require("./enums");
18
18
  const utils_2 = require("./utils");
19
- const AstralProductSwitcher = ({ identityUrl, filterBy = enums_1.ProductFilterType.Tenant, code = 'astral', tenantId, }) => {
19
+ const AstralProductSwitcher = ({ identityUrl, filterBy = enums_1.ProductFilterType.Tenant, code = 'astral', filter, tenantId, }) => {
20
20
  const [products, setProducts] = (0, react_1.useState)([]);
21
21
  const handleGetProducts = () => __awaiter(void 0, void 0, void 0, function* () {
22
22
  if (products.length) {
@@ -32,6 +32,6 @@ const AstralProductSwitcher = ({ identityUrl, filterBy = enums_1.ProductFilterTy
32
32
  setProducts(filteredProductsList);
33
33
  return filteredProductsList;
34
34
  });
35
- return (0, jsx_runtime_1.jsx)(ui_1.ProductSwitcher, { getProducts: handleGetProducts });
35
+ return (0, jsx_runtime_1.jsx)(ui_1.ProductSwitcher, { getProducts: handleGetProducts, filter: filter });
36
36
  };
37
37
  exports.AstralProductSwitcher = AstralProductSwitcher;
package/package.json CHANGED
@@ -2,9 +2,9 @@
2
2
  "name": "@astral/features",
3
3
  "browser": "./index.js",
4
4
  "main": "./node/index.js",
5
- "version": "3.229.0",
5
+ "version": "3.230.0",
6
6
  "dependencies": {
7
- "@astral/ui": "3.229.0",
7
+ "@astral/ui": "3.230.0",
8
8
  "mobx": "^6.8.0",
9
9
  "mobx-react-lite": "^3.4.0",
10
10
  "@astral/cryptopro-cades": "^1.5.1"
@@ -1,3 +1,4 @@
1
+ import { type ProductSwitcherProps } from '@astral/ui';
1
2
  import { ProductFilterType } from './enums';
2
3
  export type AstralProductSwitcherType = {
3
4
  /**
@@ -13,5 +14,9 @@ export type AstralProductSwitcherType = {
13
14
  * @deprecated
14
15
  * */
15
16
  tenantId?: string;
17
+ /**
18
+ * Альтернативная функция для фильтрации продуктов
19
+ */
20
+ filter?: ProductSwitcherProps['filter'];
16
21
  };
17
- export declare const AstralProductSwitcher: ({ identityUrl, filterBy, code, tenantId, }: AstralProductSwitcherType) => import("react/jsx-runtime").JSX.Element;
22
+ export declare const AstralProductSwitcher: ({ identityUrl, filterBy, code, filter, tenantId, }: AstralProductSwitcherType) => import("react/jsx-runtime").JSX.Element;
@@ -8,12 +8,12 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
8
8
  });
9
9
  };
10
10
  import { jsx as _jsx } from "react/jsx-runtime";
11
- import { ProductSwitcher } from '@astral/ui';
11
+ import { ProductSwitcher, } from '@astral/ui';
12
12
  import { useState } from 'react';
13
13
  import { getIdentityProducts } from '../../utils';
14
14
  import { ProductFilterType } from './enums';
15
15
  import { getFilteredProducts } from './utils';
16
- export const AstralProductSwitcher = ({ identityUrl, filterBy = ProductFilterType.Tenant, code = 'astral', tenantId, }) => {
16
+ export const AstralProductSwitcher = ({ identityUrl, filterBy = ProductFilterType.Tenant, code = 'astral', filter, tenantId, }) => {
17
17
  const [products, setProducts] = useState([]);
18
18
  const handleGetProducts = () => __awaiter(void 0, void 0, void 0, function* () {
19
19
  if (products.length) {
@@ -29,5 +29,5 @@ export const AstralProductSwitcher = ({ identityUrl, filterBy = ProductFilterTyp
29
29
  setProducts(filteredProductsList);
30
30
  return filteredProductsList;
31
31
  });
32
- return _jsx(ProductSwitcher, { getProducts: handleGetProducts });
32
+ return _jsx(ProductSwitcher, { getProducts: handleGetProducts, filter: filter });
33
33
  };