@redneckz/wildless-cms-uni-blocks 0.14.517 → 0.14.519
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/bin/migration-scripts/0.14.518.js +29 -0
- package/bundle/blocks.schema.json +1 -1
- package/bundle/bundle.umd.js +8 -18
- package/bundle/bundle.umd.min.js +1 -1
- package/bundle/components/TariffsTable/EmbeddableCellData.d.ts +1 -1
- package/bundle/ui-kit/InnerTable/InnerTable.d.ts +6 -3
- package/bundle/ui-kit/InnerTable/InnerTableProps.d.ts +2 -1
- package/bundle/ui-kit/Loader/Loader.d.ts +7 -0
- package/dist/components/OfficesAtmsMap/OfficesAtmsMapLayout.js +2 -2
- package/dist/components/OfficesAtmsMap/OfficesAtmsMapLayout.js.map +1 -1
- package/dist/components/TariffsTable/EmbeddableCellData.d.ts +1 -1
- package/dist/components/TariffsTable/EmbeddableCellData.js +2 -2
- package/dist/components/TariffsTable/EmbeddableCellData.js.map +1 -1
- package/dist/components/TariffsTable/dataFixture.js +1 -1
- package/dist/components/TariffsTable/dataFixture.js.map +1 -1
- package/dist/ui-kit/InnerTable/InnerTable.d.ts +6 -3
- package/dist/ui-kit/InnerTable/InnerTable.js +3 -4
- package/dist/ui-kit/InnerTable/InnerTable.js.map +1 -1
- package/dist/ui-kit/InnerTable/InnerTableProps.d.ts +2 -1
- package/dist/ui-kit/Loader/Loader.d.ts +7 -0
- package/dist/ui-kit/Loader/Loader.js +7 -0
- package/dist/ui-kit/Loader/Loader.js.map +1 -0
- package/lib/common.css +1 -1
- package/lib/components/OfficesAtmsMap/OfficesAtmsMapLayout.js +2 -2
- package/lib/components/OfficesAtmsMap/OfficesAtmsMapLayout.js.map +1 -1
- package/lib/components/TariffsTable/EmbeddableCellData.d.ts +1 -1
- package/lib/components/TariffsTable/EmbeddableCellData.js +2 -2
- package/lib/components/TariffsTable/EmbeddableCellData.js.map +1 -1
- package/lib/components/TariffsTable/dataFixture.js +1 -1
- package/lib/components/TariffsTable/dataFixture.js.map +1 -1
- package/lib/ui-kit/InnerTable/InnerTable.d.ts +6 -3
- package/lib/ui-kit/InnerTable/InnerTable.js +3 -4
- package/lib/ui-kit/InnerTable/InnerTable.js.map +1 -1
- package/lib/ui-kit/InnerTable/InnerTableProps.d.ts +2 -1
- package/lib/ui-kit/Loader/Loader.d.ts +7 -0
- package/lib/ui-kit/Loader/Loader.fixture.d.ts +6 -0
- package/lib/ui-kit/Loader/Loader.js +5 -0
- package/lib/ui-kit/Loader/Loader.js.map +1 -0
- package/mobile/bundle/bundle.umd.js +8 -18
- package/mobile/bundle/bundle.umd.min.js +1 -1
- package/mobile/bundle/components/TariffsTable/EmbeddableCellData.d.ts +1 -1
- package/mobile/bundle/ui-kit/InnerTable/InnerTable.d.ts +6 -3
- package/mobile/bundle/ui-kit/InnerTable/InnerTableProps.d.ts +2 -1
- package/mobile/bundle/ui-kit/Loader/Loader.d.ts +7 -0
- package/mobile/dist/components/OfficesAtmsMap/OfficesAtmsMapLayout.js +2 -2
- package/mobile/dist/components/OfficesAtmsMap/OfficesAtmsMapLayout.js.map +1 -1
- package/mobile/dist/components/TariffsTable/EmbeddableCellData.d.ts +1 -1
- package/mobile/dist/components/TariffsTable/EmbeddableCellData.js +2 -2
- package/mobile/dist/components/TariffsTable/EmbeddableCellData.js.map +1 -1
- package/mobile/dist/components/TariffsTable/dataFixture.js +1 -1
- package/mobile/dist/components/TariffsTable/dataFixture.js.map +1 -1
- package/mobile/dist/ui-kit/InnerTable/InnerTable.d.ts +6 -3
- package/mobile/dist/ui-kit/InnerTable/InnerTable.js +3 -4
- package/mobile/dist/ui-kit/InnerTable/InnerTable.js.map +1 -1
- package/mobile/dist/ui-kit/InnerTable/InnerTableProps.d.ts +2 -1
- package/mobile/dist/ui-kit/Loader/Loader.d.ts +7 -0
- package/mobile/dist/ui-kit/Loader/Loader.js +7 -0
- package/mobile/dist/ui-kit/Loader/Loader.js.map +1 -0
- package/mobile/lib/common.css +1 -1
- package/mobile/lib/components/OfficesAtmsMap/OfficesAtmsMapLayout.js +2 -2
- package/mobile/lib/components/OfficesAtmsMap/OfficesAtmsMapLayout.js.map +1 -1
- package/mobile/lib/components/TariffsTable/EmbeddableCellData.d.ts +1 -1
- package/mobile/lib/components/TariffsTable/EmbeddableCellData.js +2 -2
- package/mobile/lib/components/TariffsTable/EmbeddableCellData.js.map +1 -1
- package/mobile/lib/components/TariffsTable/dataFixture.js +1 -1
- package/mobile/lib/components/TariffsTable/dataFixture.js.map +1 -1
- package/mobile/lib/ui-kit/InnerTable/InnerTable.d.ts +6 -3
- package/mobile/lib/ui-kit/InnerTable/InnerTable.js +3 -4
- package/mobile/lib/ui-kit/InnerTable/InnerTable.js.map +1 -1
- package/mobile/lib/ui-kit/InnerTable/InnerTableProps.d.ts +2 -1
- package/mobile/lib/ui-kit/Loader/Loader.d.ts +7 -0
- package/mobile/lib/ui-kit/Loader/Loader.js +5 -0
- package/mobile/lib/ui-kit/Loader/Loader.js.map +1 -0
- package/mobile/src/components/OfficesAtmsMap/OfficesAtmsMapLayout.tsx +2 -2
- package/mobile/src/components/TariffsTable/EmbeddableCellData.tsx +2 -2
- package/mobile/src/components/TariffsTable/dataFixture.tsx +1 -1
- package/mobile/src/ui-kit/InnerTable/InnerTable.tsx +7 -5
- package/mobile/src/ui-kit/InnerTable/InnerTableProps.ts +2 -1
- package/mobile/src/ui-kit/Loader/Loader.tsx +28 -0
- package/package.json +1 -1
- package/src/components/OfficesAtmsMap/OfficesAtmsMapLayout.tsx +2 -2
- package/src/components/TariffsTable/EmbeddableCellData.tsx +2 -2
- package/src/components/TariffsTable/dataFixture.tsx +1 -1
- package/src/ui-kit/InnerTable/InnerTable.fixture.mobile.tsx +4 -1
- package/src/ui-kit/InnerTable/InnerTable.fixture.tsx +4 -1
- package/src/ui-kit/InnerTable/InnerTable.tsx +7 -5
- package/src/ui-kit/InnerTable/InnerTableProps.ts +2 -1
- package/src/ui-kit/Loader/Loader.fixture.tsx +14 -0
- package/src/ui-kit/Loader/Loader.tsx +28 -0
- package/bundle/ui-kit/InnerTable/useTariffsInnerTableData.d.ts +0 -1
- package/dist/ui-kit/InnerTable/useTariffsInnerTableData.d.ts +0 -1
- package/dist/ui-kit/InnerTable/useTariffsInnerTableData.js +0 -16
- package/dist/ui-kit/InnerTable/useTariffsInnerTableData.js.map +0 -1
- package/lib/ui-kit/InnerTable/useTariffsInnerTableData.d.ts +0 -1
- package/lib/ui-kit/InnerTable/useTariffsInnerTableData.js +0 -13
- package/lib/ui-kit/InnerTable/useTariffsInnerTableData.js.map +0 -1
- package/mobile/bundle/ui-kit/InnerTable/useTariffsInnerTableData.d.ts +0 -1
- package/mobile/dist/ui-kit/InnerTable/useTariffsInnerTableData.d.ts +0 -1
- package/mobile/dist/ui-kit/InnerTable/useTariffsInnerTableData.js +0 -16
- package/mobile/dist/ui-kit/InnerTable/useTariffsInnerTableData.js.map +0 -1
- package/mobile/lib/ui-kit/InnerTable/useTariffsInnerTableData.d.ts +0 -1
- package/mobile/lib/ui-kit/InnerTable/useTariffsInnerTableData.js +0 -13
- package/mobile/lib/ui-kit/InnerTable/useTariffsInnerTableData.js.map +0 -1
- package/mobile/src/ui-kit/InnerTable/useTariffsInnerTableData.ts +0 -20
- package/src/ui-kit/InnerTable/useTariffsInnerTableData.ts +0 -20
|
@@ -1,14 +1,13 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "@redneckz/uni-jsx/jsx-runtime";
|
|
2
|
-
import { JSX } from '@redneckz/uni-jsx';
|
|
3
2
|
import { useCallback, useState } from '@redneckz/uni-jsx/lib/hooks';
|
|
3
|
+
import { UniBlock } from '../../UniBlock/UniBlock.js';
|
|
4
4
|
import { Text } from '../Text/Text.js';
|
|
5
5
|
import { InnerTableBody } from './InnerTableBody.js';
|
|
6
6
|
import { TableInnerButton } from './InnerTableButton.js';
|
|
7
7
|
import { InnerTableHeader } from './InnerTableHeader.js';
|
|
8
|
-
import { useTariffsInnerTableData } from './useTariffsInnerTableData.js';
|
|
9
8
|
const EMPTY_DATA = 'Данных нет';
|
|
10
|
-
export const InnerTable =
|
|
11
|
-
const
|
|
9
|
+
export const InnerTable = UniBlock(({ tableSource, pdfUrl, onClick }) => {
|
|
10
|
+
const tableData = tableSource?.tableData;
|
|
12
11
|
const [activeTabIndex, setActiveTabIndex] = useState(0);
|
|
13
12
|
const handleActiveTabIndex = useCallback((_) => setActiveTabIndex(_), []);
|
|
14
13
|
const items = tableData?.[activeTabIndex]?.items ?? [];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"InnerTable.js","sourceRoot":"","sources":["../../../src/ui-kit/InnerTable/InnerTable.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"InnerTable.js","sourceRoot":"","sources":["../../../src/ui-kit/InnerTable/InnerTable.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,WAAW,EAAE,QAAQ,EAAE,MAAM,6BAA6B,CAAC;AAEpE,OAAO,EAAE,QAAQ,EAAE,MAAM,yBAAyB,CAAC;AAEnD,OAAO,EAAE,IAAI,EAAE,MAAM,cAAc,CAAC;AACpC,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAClD,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AACtD,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AAQtD,MAAM,UAAU,GAAG,YAAY,CAAC;AAEhC,MAAM,CAAC,MAAM,UAAU,GAAG,QAAQ,CAAkB,CAAC,EAAE,WAAW,EAAE,MAAM,EAAE,OAAO,EAAE,EAAE,EAAE;IACvF,MAAM,SAAS,GAAG,WAAW,EAAE,SAAS,CAAC;IACzC,MAAM,CAAC,cAAc,EAAE,iBAAiB,CAAC,GAAG,QAAQ,CAAC,CAAC,CAAC,CAAC;IACxD,MAAM,oBAAoB,GAAG,WAAW,CAAC,CAAC,CAAS,EAAE,EAAE,CAAC,iBAAiB,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC;IAClF,MAAM,KAAK,GAAG,SAAS,EAAE,CAAC,cAAc,CAAC,EAAE,KAAK,IAAI,EAAE,CAAC;IACvD,MAAM,UAAU,GAAG,SAAS,EAAE,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,QAAQ,IAAI,EAAE,CAAC,CAAC;IAEjE,OAAO,SAAS,CAAC,CAAC,CAAC,CACjB,eAAK,SAAS,EAAC,eAAe,aAC5B,KAAC,gBAAgB,IACf,UAAU,EAAE,UAAU,EACtB,cAAc,EAAE,cAAc,EAC9B,iBAAiB,EAAE,oBAAoB,EACvC,SAAS,EAAE,MAAM,GACjB,EACF,KAAC,cAAc,IAAC,cAAc,EAAE,cAAc,EAAE,KAAK,EAAE,KAAK,GAAI,EAChE,KAAC,gBAAgB,IAAC,SAAS,EAAC,OAAO,EAAC,OAAO,EAAE,OAAO,EAAE,MAAM,SAAG,IAC3D,CACP,CAAC,CAAC,CAAC,CACF,eAAK,SAAS,EAAC,6BAA6B,aAC1C,KAAC,IAAI,IAAC,IAAI,EAAC,SAAS,YAAE,UAAU,GAAQ,EACxC,KAAC,gBAAgB,IAAC,OAAO,EAAE,OAAO,EAAE,MAAM,SAAG,IACzC,CACP,CAAC;AACJ,CAAC,CAAC,CAAC"}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { type JSONRefObject } from '../../data/JSONRefObject';
|
|
1
2
|
import { type TitleProps } from '../../model/HeadlineType';
|
|
2
3
|
export declare type RowsData = {
|
|
3
4
|
data?: string;
|
|
@@ -15,7 +16,7 @@ export declare type TableFetchData = {
|
|
|
15
16
|
};
|
|
16
17
|
export interface TariffsTableInnerContent {
|
|
17
18
|
/** @title Справочник */
|
|
18
|
-
|
|
19
|
+
tableSource?: JSONRefObject;
|
|
19
20
|
/** @title Ссылка PDF-файл */
|
|
20
21
|
pdfUrl?: string;
|
|
21
22
|
}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { jsx as _jsx } from "@redneckz/uni-jsx/jsx-runtime";
|
|
2
|
+
import { JSX } from '@redneckz/uni-jsx';
|
|
3
|
+
import { style } from '../../utils/style.js';
|
|
4
|
+
export const Loader = JSX(({ color = 'text-primary-main', position = 'absolute' }) => (_jsx("div", { className: style('flex justify-center items-center h-full w-full backdrop-blur-sm z-50', position), children: _jsx("div", { className: style('inline-block h-28 w-28', 'animate-spin rounded-full', 'border-8 border-solid border-current', 'border-r-transparent', color), role: "status" }) })));
|
|
5
|
+
//# sourceMappingURL=Loader.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Loader.js","sourceRoot":"","sources":["../../../src/ui-kit/Loader/Loader.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,mBAAmB,CAAC;AAExC,OAAO,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAC;AAO1C,MAAM,CAAC,MAAM,MAAM,GAAG,GAAG,CAAc,CAAC,EAAE,KAAK,GAAG,mBAAmB,EAAE,QAAQ,GAAG,UAAU,EAAE,EAAE,EAAE,CAAC,CACjG,cACE,SAAS,EAAE,KAAK,CACd,sEAAsE,EACtE,QAAQ,CACT,YAED,cACE,SAAS,EAAE,KAAK,CACd,wBAAwB,EACxB,2BAA2B,EAC3B,sCAAsC,EACtC,sBAAsB,EACtB,KAAK,CACN,EACD,IAAI,EAAC,QAAQ,GACb,GACE,CACP,CAAC,CAAC"}
|
|
@@ -5,7 +5,7 @@ import { type VNode } from '../../model/VNode';
|
|
|
5
5
|
import { Button } from '../../ui-kit/Button/Button';
|
|
6
6
|
import { ClientOnly } from '../../ui-kit/ClientOnly';
|
|
7
7
|
import { Heading } from '../../ui-kit/Heading/Heading';
|
|
8
|
-
import {
|
|
8
|
+
import { Loader } from '../../ui-kit/Loader/Loader';
|
|
9
9
|
import { Text } from '../../ui-kit/Text/Text';
|
|
10
10
|
import { YandexMap } from '../../ui-kit/YandexMap/YandexMap';
|
|
11
11
|
import { getVersion } from '../../utils/getVersion';
|
|
@@ -105,7 +105,7 @@ export const OfficesAtmsMapLayout = JSX<OfficesAtmsMapLayoutProps<Branch | Atm |
|
|
|
105
105
|
</div>
|
|
106
106
|
<div className="h-[600px]">
|
|
107
107
|
<ClientOnly>
|
|
108
|
-
{points?.length ? <YandexMap points={points} className="h-full" /> : <
|
|
108
|
+
{points?.length ? <YandexMap points={points} className="h-full" /> : <Loader />}
|
|
109
109
|
</ClientOnly>
|
|
110
110
|
</div>
|
|
111
111
|
</div>
|
|
@@ -56,7 +56,7 @@ const renderRichTextCellData = ({ __html, isDotted = true }: RichTextProps) => (
|
|
|
56
56
|
const renderInnerTableCellData = ({
|
|
57
57
|
isVisible,
|
|
58
58
|
displayTable,
|
|
59
|
-
|
|
59
|
+
tableSource,
|
|
60
60
|
pdfUrl,
|
|
61
61
|
isOpen,
|
|
62
62
|
}: TableCellDataProps) =>
|
|
@@ -64,7 +64,7 @@ const renderInnerTableCellData = ({
|
|
|
64
64
|
<TableInnerButton
|
|
65
65
|
isOpen={isOpen}
|
|
66
66
|
onClick={() => {
|
|
67
|
-
displayTable({
|
|
67
|
+
displayTable({ tableSource, pdfUrl });
|
|
68
68
|
}}
|
|
69
69
|
/>
|
|
70
70
|
) : null;
|
|
@@ -36,7 +36,7 @@ const LABEL_DESCRIPTION_BLOCK: LabelDescriptionCellDef = {
|
|
|
36
36
|
|
|
37
37
|
const TABLE_BLOCK: InnerTableBlockDef = {
|
|
38
38
|
tableCellType: 'Table',
|
|
39
|
-
|
|
39
|
+
tableSource: { $ref: '/wcms-resources/tariffs-inner-table-data.json' },
|
|
40
40
|
pdfUrl: '#',
|
|
41
41
|
};
|
|
42
42
|
|
|
@@ -1,20 +1,22 @@
|
|
|
1
|
-
import { JSX } from '@redneckz/uni-jsx';
|
|
2
1
|
import { useCallback, useState } from '@redneckz/uni-jsx/lib/hooks';
|
|
2
|
+
import { type JSONRefObject } from '../../data/JSONRefObject';
|
|
3
|
+
import { UniBlock } from '../../UniBlock/UniBlock';
|
|
4
|
+
import { type UniBlockProps } from '../../UniBlock/UniBlockProps';
|
|
3
5
|
import { Text } from '../Text/Text';
|
|
4
6
|
import { InnerTableBody } from './InnerTableBody';
|
|
5
7
|
import { TableInnerButton } from './InnerTableButton';
|
|
6
8
|
import { InnerTableHeader } from './InnerTableHeader';
|
|
7
9
|
import { type TableFetchData, type TariffsTableInnerContent } from './InnerTableProps';
|
|
8
|
-
import { useTariffsInnerTableData } from './useTariffsInnerTableData';
|
|
9
10
|
|
|
10
|
-
export interface InnerTableProps extends TariffsTableInnerContent {
|
|
11
|
+
export interface InnerTableProps extends TariffsTableInnerContent, UniBlockProps {
|
|
11
12
|
onClick?: () => void;
|
|
13
|
+
tableSource?: JSONRefObject & TableFetchData;
|
|
12
14
|
}
|
|
13
15
|
|
|
14
16
|
const EMPTY_DATA = 'Данных нет';
|
|
15
17
|
|
|
16
|
-
export const InnerTable =
|
|
17
|
-
const
|
|
18
|
+
export const InnerTable = UniBlock<InnerTableProps>(({ tableSource, pdfUrl, onClick }) => {
|
|
19
|
+
const tableData = tableSource?.tableData;
|
|
18
20
|
const [activeTabIndex, setActiveTabIndex] = useState(0);
|
|
19
21
|
const handleActiveTabIndex = useCallback((_: number) => setActiveTabIndex(_), []);
|
|
20
22
|
const items = tableData?.[activeTabIndex]?.items ?? [];
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { type JSONRefObject } from '../../data/JSONRefObject';
|
|
1
2
|
import { type TitleProps } from '../../model/HeadlineType';
|
|
2
3
|
|
|
3
4
|
export type RowsData = {
|
|
@@ -20,7 +21,7 @@ export type TableFetchData = {
|
|
|
20
21
|
|
|
21
22
|
export interface TariffsTableInnerContent {
|
|
22
23
|
/** @title Справочник */
|
|
23
|
-
|
|
24
|
+
tableSource?: JSONRefObject;
|
|
24
25
|
/** @title Ссылка PDF-файл */
|
|
25
26
|
pdfUrl?: string;
|
|
26
27
|
}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { JSX } from '@redneckz/uni-jsx';
|
|
2
|
+
import { type TextColor } from '../../ui-kit/Text/TextProps';
|
|
3
|
+
import { style } from '../../utils/style';
|
|
4
|
+
|
|
5
|
+
interface LoaderProps {
|
|
6
|
+
color?: TextColor;
|
|
7
|
+
position?: 'static' | 'absolute';
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
export const Loader = JSX<LoaderProps>(({ color = 'text-primary-main', position = 'absolute' }) => (
|
|
11
|
+
<div
|
|
12
|
+
className={style(
|
|
13
|
+
'flex justify-center items-center h-full w-full backdrop-blur-sm z-50',
|
|
14
|
+
position,
|
|
15
|
+
)}
|
|
16
|
+
>
|
|
17
|
+
<div
|
|
18
|
+
className={style(
|
|
19
|
+
'inline-block h-28 w-28',
|
|
20
|
+
'animate-spin rounded-full',
|
|
21
|
+
'border-8 border-solid border-current',
|
|
22
|
+
'border-r-transparent',
|
|
23
|
+
color,
|
|
24
|
+
)}
|
|
25
|
+
role="status"
|
|
26
|
+
/>
|
|
27
|
+
</div>
|
|
28
|
+
));
|
package/package.json
CHANGED
|
@@ -5,7 +5,7 @@ import { type VNode } from '../../model/VNode';
|
|
|
5
5
|
import { Button } from '../../ui-kit/Button/Button';
|
|
6
6
|
import { ClientOnly } from '../../ui-kit/ClientOnly';
|
|
7
7
|
import { Heading } from '../../ui-kit/Heading/Heading';
|
|
8
|
-
import {
|
|
8
|
+
import { Loader } from '../../ui-kit/Loader/Loader';
|
|
9
9
|
import { Text } from '../../ui-kit/Text/Text';
|
|
10
10
|
import { YandexMap } from '../../ui-kit/YandexMap/YandexMap';
|
|
11
11
|
import { getVersion } from '../../utils/getVersion';
|
|
@@ -105,7 +105,7 @@ export const OfficesAtmsMapLayout = JSX<OfficesAtmsMapLayoutProps<Branch | Atm |
|
|
|
105
105
|
</div>
|
|
106
106
|
<div className="h-[600px]">
|
|
107
107
|
<ClientOnly>
|
|
108
|
-
{points?.length ? <YandexMap points={points} className="h-full" /> : <
|
|
108
|
+
{points?.length ? <YandexMap points={points} className="h-full" /> : <Loader />}
|
|
109
109
|
</ClientOnly>
|
|
110
110
|
</div>
|
|
111
111
|
</div>
|
|
@@ -56,7 +56,7 @@ const renderRichTextCellData = ({ __html, isDotted = true }: RichTextProps) => (
|
|
|
56
56
|
const renderInnerTableCellData = ({
|
|
57
57
|
isVisible,
|
|
58
58
|
displayTable,
|
|
59
|
-
|
|
59
|
+
tableSource,
|
|
60
60
|
pdfUrl,
|
|
61
61
|
isOpen,
|
|
62
62
|
}: TableCellDataProps) =>
|
|
@@ -64,7 +64,7 @@ const renderInnerTableCellData = ({
|
|
|
64
64
|
<TableInnerButton
|
|
65
65
|
isOpen={isOpen}
|
|
66
66
|
onClick={() => {
|
|
67
|
-
displayTable({
|
|
67
|
+
displayTable({ tableSource, pdfUrl });
|
|
68
68
|
}}
|
|
69
69
|
/>
|
|
70
70
|
) : null;
|
|
@@ -36,7 +36,7 @@ const LABEL_DESCRIPTION_BLOCK: LabelDescriptionCellDef = {
|
|
|
36
36
|
|
|
37
37
|
const TABLE_BLOCK: InnerTableBlockDef = {
|
|
38
38
|
tableCellType: 'Table',
|
|
39
|
-
|
|
39
|
+
tableSource: { $ref: '/wcms-resources/tariffs-inner-table-data.json' },
|
|
40
40
|
pdfUrl: '#',
|
|
41
41
|
};
|
|
42
42
|
|
|
@@ -5,7 +5,10 @@ import { InnerTable } from './InnerTable';
|
|
|
5
5
|
export default {
|
|
6
6
|
default: (
|
|
7
7
|
<div className="p-m bg-white">
|
|
8
|
-
<InnerTable
|
|
8
|
+
<InnerTable
|
|
9
|
+
pdfUrl="#"
|
|
10
|
+
tableSource={{ $ref: '/wcms-resources/tariffs-inner-table-data.json' }}
|
|
11
|
+
/>
|
|
9
12
|
</div>
|
|
10
13
|
),
|
|
11
14
|
};
|
|
@@ -5,7 +5,10 @@ import { InnerTable } from './InnerTable';
|
|
|
5
5
|
export default {
|
|
6
6
|
default: (
|
|
7
7
|
<div className="p-m bg-white">
|
|
8
|
-
<InnerTable
|
|
8
|
+
<InnerTable
|
|
9
|
+
pdfUrl="#"
|
|
10
|
+
tableSource={{ $ref: '/wcms-resources/tariffs-inner-table-data.json' }}
|
|
11
|
+
/>
|
|
9
12
|
</div>
|
|
10
13
|
),
|
|
11
14
|
};
|
|
@@ -1,20 +1,22 @@
|
|
|
1
|
-
import { JSX } from '@redneckz/uni-jsx';
|
|
2
1
|
import { useCallback, useState } from '@redneckz/uni-jsx/lib/hooks';
|
|
2
|
+
import { type JSONRefObject } from '../../data/JSONRefObject';
|
|
3
|
+
import { UniBlock } from '../../UniBlock/UniBlock';
|
|
4
|
+
import { type UniBlockProps } from '../../UniBlock/UniBlockProps';
|
|
3
5
|
import { Text } from '../Text/Text';
|
|
4
6
|
import { InnerTableBody } from './InnerTableBody';
|
|
5
7
|
import { TableInnerButton } from './InnerTableButton';
|
|
6
8
|
import { InnerTableHeader } from './InnerTableHeader';
|
|
7
9
|
import { type TableFetchData, type TariffsTableInnerContent } from './InnerTableProps';
|
|
8
|
-
import { useTariffsInnerTableData } from './useTariffsInnerTableData';
|
|
9
10
|
|
|
10
|
-
export interface InnerTableProps extends TariffsTableInnerContent {
|
|
11
|
+
export interface InnerTableProps extends TariffsTableInnerContent, UniBlockProps {
|
|
11
12
|
onClick?: () => void;
|
|
13
|
+
tableSource?: JSONRefObject & TableFetchData;
|
|
12
14
|
}
|
|
13
15
|
|
|
14
16
|
const EMPTY_DATA = 'Данных нет';
|
|
15
17
|
|
|
16
|
-
export const InnerTable =
|
|
17
|
-
const
|
|
18
|
+
export const InnerTable = UniBlock<InnerTableProps>(({ tableSource, pdfUrl, onClick }) => {
|
|
19
|
+
const tableData = tableSource?.tableData;
|
|
18
20
|
const [activeTabIndex, setActiveTabIndex] = useState(0);
|
|
19
21
|
const handleActiveTabIndex = useCallback((_: number) => setActiveTabIndex(_), []);
|
|
20
22
|
const items = tableData?.[activeTabIndex]?.items ?? [];
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { type JSONRefObject } from '../../data/JSONRefObject';
|
|
1
2
|
import { type TitleProps } from '../../model/HeadlineType';
|
|
2
3
|
|
|
3
4
|
export type RowsData = {
|
|
@@ -20,7 +21,7 @@ export type TableFetchData = {
|
|
|
20
21
|
|
|
21
22
|
export interface TariffsTableInnerContent {
|
|
22
23
|
/** @title Справочник */
|
|
23
|
-
|
|
24
|
+
tableSource?: JSONRefObject;
|
|
24
25
|
/** @title Ссылка PDF-файл */
|
|
25
26
|
pdfUrl?: string;
|
|
26
27
|
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { Loader } from './Loader';
|
|
2
|
+
|
|
3
|
+
export default {
|
|
4
|
+
default: (
|
|
5
|
+
<div className="flex justify-center">
|
|
6
|
+
<Loader />
|
|
7
|
+
</div>
|
|
8
|
+
),
|
|
9
|
+
'secondary version': (
|
|
10
|
+
<div className="flex justify-center">
|
|
11
|
+
<Loader color="text-secondary-text" />
|
|
12
|
+
</div>
|
|
13
|
+
),
|
|
14
|
+
};
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { JSX } from '@redneckz/uni-jsx';
|
|
2
|
+
import { type TextColor } from '../../ui-kit/Text/TextProps';
|
|
3
|
+
import { style } from '../../utils/style';
|
|
4
|
+
|
|
5
|
+
interface LoaderProps {
|
|
6
|
+
color?: TextColor;
|
|
7
|
+
position?: 'static' | 'absolute';
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
export const Loader = JSX<LoaderProps>(({ color = 'text-primary-main', position = 'absolute' }) => (
|
|
11
|
+
<div
|
|
12
|
+
className={style(
|
|
13
|
+
'flex justify-center items-center h-full w-full backdrop-blur-sm z-50',
|
|
14
|
+
position,
|
|
15
|
+
)}
|
|
16
|
+
>
|
|
17
|
+
<div
|
|
18
|
+
className={style(
|
|
19
|
+
'inline-block h-28 w-28',
|
|
20
|
+
'animate-spin rounded-full',
|
|
21
|
+
'border-8 border-solid border-current',
|
|
22
|
+
'border-r-transparent',
|
|
23
|
+
color,
|
|
24
|
+
)}
|
|
25
|
+
role="status"
|
|
26
|
+
/>
|
|
27
|
+
</div>
|
|
28
|
+
));
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare function useTariffsInnerTableData(directoryName?: string): any;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare function useTariffsInnerTableData(directoryName?: string): any;
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
2
|
-
exports.useTariffsInnerTableData = void 0;
|
|
3
|
-
const useAsyncData_1 = require("@redneckz/uni-jsx/lib/hooks/useAsyncData");
|
|
4
|
-
function useTariffsInnerTableData(directoryName) {
|
|
5
|
-
const { data } = (0, useAsyncData_1.useAsyncData)(tariffsInnerTableDataUrl(directoryName), fetchTariffsInnerTableData);
|
|
6
|
-
return data || {};
|
|
7
|
-
}
|
|
8
|
-
exports.useTariffsInnerTableData = useTariffsInnerTableData;
|
|
9
|
-
async function fetchTariffsInnerTableData(url) {
|
|
10
|
-
const response = await fetch(url);
|
|
11
|
-
return await response.json();
|
|
12
|
-
}
|
|
13
|
-
function tariffsInnerTableDataUrl(directoryName) {
|
|
14
|
-
return `/wcms-resources/${directoryName || 'tariffs-inner-table-data'}.json`;
|
|
15
|
-
}
|
|
16
|
-
//# sourceMappingURL=useTariffsInnerTableData.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"useTariffsInnerTableData.js","sourceRoot":"","sources":["../../../src/ui-kit/InnerTable/useTariffsInnerTableData.ts"],"names":[],"mappings":";;AAAA,2EAAwE;AAExE,SAAgB,wBAAwB,CAAC,aAAsB;IAC7D,MAAM,EAAE,IAAI,EAAE,GAAG,IAAA,2BAAY,EAC3B,wBAAwB,CAAC,aAAa,CAAC,EACvC,0BAA0B,CAC3B,CAAC;IAEF,OAAO,IAAI,IAAI,EAAE,CAAC;AACpB,CAAC;AAPD,4DAOC;AAED,KAAK,UAAU,0BAA0B,CAAC,GAAW;IACnD,MAAM,QAAQ,GAAG,MAAM,KAAK,CAAC,GAAG,CAAC,CAAC;IAElC,OAAO,MAAM,QAAQ,CAAC,IAAI,EAAE,CAAC;AAC/B,CAAC;AAED,SAAS,wBAAwB,CAAC,aAAsB;IACtD,OAAO,mBAAmB,aAAa,IAAI,0BAA0B,OAAO,CAAC;AAC/E,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare function useTariffsInnerTableData(directoryName?: string): any;
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { useAsyncData } from '@redneckz/uni-jsx/lib/hooks/useAsyncData';
|
|
2
|
-
export function useTariffsInnerTableData(directoryName) {
|
|
3
|
-
const { data } = useAsyncData(tariffsInnerTableDataUrl(directoryName), fetchTariffsInnerTableData);
|
|
4
|
-
return data || {};
|
|
5
|
-
}
|
|
6
|
-
async function fetchTariffsInnerTableData(url) {
|
|
7
|
-
const response = await fetch(url);
|
|
8
|
-
return await response.json();
|
|
9
|
-
}
|
|
10
|
-
function tariffsInnerTableDataUrl(directoryName) {
|
|
11
|
-
return `/wcms-resources/${directoryName || 'tariffs-inner-table-data'}.json`;
|
|
12
|
-
}
|
|
13
|
-
//# sourceMappingURL=useTariffsInnerTableData.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"useTariffsInnerTableData.js","sourceRoot":"","sources":["../../../src/ui-kit/InnerTable/useTariffsInnerTableData.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,0CAA0C,CAAC;AAExE,MAAM,UAAU,wBAAwB,CAAC,aAAsB;IAC7D,MAAM,EAAE,IAAI,EAAE,GAAG,YAAY,CAC3B,wBAAwB,CAAC,aAAa,CAAC,EACvC,0BAA0B,CAC3B,CAAC;IAEF,OAAO,IAAI,IAAI,EAAE,CAAC;AACpB,CAAC;AAED,KAAK,UAAU,0BAA0B,CAAC,GAAW;IACnD,MAAM,QAAQ,GAAG,MAAM,KAAK,CAAC,GAAG,CAAC,CAAC;IAElC,OAAO,MAAM,QAAQ,CAAC,IAAI,EAAE,CAAC;AAC/B,CAAC;AAED,SAAS,wBAAwB,CAAC,aAAsB;IACtD,OAAO,mBAAmB,aAAa,IAAI,0BAA0B,OAAO,CAAC;AAC/E,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare function useTariffsInnerTableData(directoryName?: string): any;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare function useTariffsInnerTableData(directoryName?: string): any;
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
2
|
-
exports.useTariffsInnerTableData = void 0;
|
|
3
|
-
const useAsyncData_1 = require("@redneckz/uni-jsx/lib/hooks/useAsyncData");
|
|
4
|
-
function useTariffsInnerTableData(directoryName) {
|
|
5
|
-
const { data } = (0, useAsyncData_1.useAsyncData)(tariffsInnerTableDataUrl(directoryName), fetchTariffsInnerTableData);
|
|
6
|
-
return data || {};
|
|
7
|
-
}
|
|
8
|
-
exports.useTariffsInnerTableData = useTariffsInnerTableData;
|
|
9
|
-
async function fetchTariffsInnerTableData(url) {
|
|
10
|
-
const response = await fetch(url);
|
|
11
|
-
return await response.json();
|
|
12
|
-
}
|
|
13
|
-
function tariffsInnerTableDataUrl(directoryName) {
|
|
14
|
-
return `/wcms-resources/${directoryName || 'tariffs-inner-table-data'}.json`;
|
|
15
|
-
}
|
|
16
|
-
//# sourceMappingURL=useTariffsInnerTableData.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"useTariffsInnerTableData.js","sourceRoot":"","sources":["../../../src/ui-kit/InnerTable/useTariffsInnerTableData.ts"],"names":[],"mappings":";;AAAA,2EAAwE;AAExE,SAAgB,wBAAwB,CAAC,aAAsB;IAC7D,MAAM,EAAE,IAAI,EAAE,GAAG,IAAA,2BAAY,EAC3B,wBAAwB,CAAC,aAAa,CAAC,EACvC,0BAA0B,CAC3B,CAAC;IAEF,OAAO,IAAI,IAAI,EAAE,CAAC;AACpB,CAAC;AAPD,4DAOC;AAED,KAAK,UAAU,0BAA0B,CAAC,GAAW;IACnD,MAAM,QAAQ,GAAG,MAAM,KAAK,CAAC,GAAG,CAAC,CAAC;IAElC,OAAO,MAAM,QAAQ,CAAC,IAAI,EAAE,CAAC;AAC/B,CAAC;AAED,SAAS,wBAAwB,CAAC,aAAsB;IACtD,OAAO,mBAAmB,aAAa,IAAI,0BAA0B,OAAO,CAAC;AAC/E,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare function useTariffsInnerTableData(directoryName?: string): any;
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { useAsyncData } from '@redneckz/uni-jsx/lib/hooks/useAsyncData';
|
|
2
|
-
export function useTariffsInnerTableData(directoryName) {
|
|
3
|
-
const { data } = useAsyncData(tariffsInnerTableDataUrl(directoryName), fetchTariffsInnerTableData);
|
|
4
|
-
return data || {};
|
|
5
|
-
}
|
|
6
|
-
async function fetchTariffsInnerTableData(url) {
|
|
7
|
-
const response = await fetch(url);
|
|
8
|
-
return await response.json();
|
|
9
|
-
}
|
|
10
|
-
function tariffsInnerTableDataUrl(directoryName) {
|
|
11
|
-
return `/wcms-resources/${directoryName || 'tariffs-inner-table-data'}.json`;
|
|
12
|
-
}
|
|
13
|
-
//# sourceMappingURL=useTariffsInnerTableData.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"useTariffsInnerTableData.js","sourceRoot":"","sources":["../../../src/ui-kit/InnerTable/useTariffsInnerTableData.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,0CAA0C,CAAC;AAExE,MAAM,UAAU,wBAAwB,CAAC,aAAsB;IAC7D,MAAM,EAAE,IAAI,EAAE,GAAG,YAAY,CAC3B,wBAAwB,CAAC,aAAa,CAAC,EACvC,0BAA0B,CAC3B,CAAC;IAEF,OAAO,IAAI,IAAI,EAAE,CAAC;AACpB,CAAC;AAED,KAAK,UAAU,0BAA0B,CAAC,GAAW;IACnD,MAAM,QAAQ,GAAG,MAAM,KAAK,CAAC,GAAG,CAAC,CAAC;IAElC,OAAO,MAAM,QAAQ,CAAC,IAAI,EAAE,CAAC;AAC/B,CAAC;AAED,SAAS,wBAAwB,CAAC,aAAsB;IACtD,OAAO,mBAAmB,aAAa,IAAI,0BAA0B,OAAO,CAAC;AAC/E,CAAC"}
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import { useAsyncData } from '@redneckz/uni-jsx/lib/hooks/useAsyncData';
|
|
2
|
-
|
|
3
|
-
export function useTariffsInnerTableData(directoryName?: string): any {
|
|
4
|
-
const { data } = useAsyncData(
|
|
5
|
-
tariffsInnerTableDataUrl(directoryName),
|
|
6
|
-
fetchTariffsInnerTableData,
|
|
7
|
-
);
|
|
8
|
-
|
|
9
|
-
return data || {};
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
async function fetchTariffsInnerTableData(url: string): Promise<any> {
|
|
13
|
-
const response = await fetch(url);
|
|
14
|
-
|
|
15
|
-
return await response.json();
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
function tariffsInnerTableDataUrl(directoryName?: string) {
|
|
19
|
-
return `/wcms-resources/${directoryName || 'tariffs-inner-table-data'}.json`;
|
|
20
|
-
}
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import { useAsyncData } from '@redneckz/uni-jsx/lib/hooks/useAsyncData';
|
|
2
|
-
|
|
3
|
-
export function useTariffsInnerTableData(directoryName?: string): any {
|
|
4
|
-
const { data } = useAsyncData(
|
|
5
|
-
tariffsInnerTableDataUrl(directoryName),
|
|
6
|
-
fetchTariffsInnerTableData,
|
|
7
|
-
);
|
|
8
|
-
|
|
9
|
-
return data || {};
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
async function fetchTariffsInnerTableData(url: string): Promise<any> {
|
|
13
|
-
const response = await fetch(url);
|
|
14
|
-
|
|
15
|
-
return await response.json();
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
function tariffsInnerTableDataUrl(directoryName?: string) {
|
|
19
|
-
return `/wcms-resources/${directoryName || 'tariffs-inner-table-data'}.json`;
|
|
20
|
-
}
|