@dartcom/ui-kit 10.5.7 → 10.5.9

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/README.md CHANGED
@@ -4,7 +4,7 @@
4
4
 
5
5
  ## Начальная установка
6
6
 
7
- ```javascript
7
+ ```ts
8
8
  // Установка сторонних заивимостей из package.json
9
9
  npm i
10
10
 
@@ -32,7 +32,7 @@ npm pack
32
32
 
33
33
  Основные ссылки
34
34
 
35
- ```javascript
35
+ ```ts
36
36
  https://unpkg.com/leaflet-textpath@1.3.0/leaflet.textpath.js
37
37
  ```
38
38
 
@@ -42,104 +42,9 @@ https://unpkg.com/leaflet-textpath@1.3.0/leaflet.textpath.js
42
42
 
43
43
  - Для начала работы потребуется установить следующие библиотеки:
44
44
 
45
- ```javascript
45
+ ```ts
46
46
  npm i -S react react-dom leaflet react-leaflet @dartcom/ui-kit
47
47
  ```
48
48
 
49
- - Основную часть приложения, где будет использоваться карта, нужно обернуть в **DartcomProviders**:
50
-
51
- ```javascript
52
- import { DartcomProviders } from '@dartcom/ui-kit';
53
-
54
- <DartcomProviders
55
- configOptions={{
56
- private_key: 'Ваш приватный ключ',
57
-
58
- apiConfig: {
59
- baseURL: 'Основной адрес backend',
60
- },
61
- }}>
62
- {...Content}
63
- </DartcomProviders>;
64
- ```
65
-
66
- **private_key** - ключ доступа к библиотеки, он выдается администрацией и проверяется для доступа как к самой карте, так и к определенным компонентам внтури библиотеки
67
-
68
- **baseURL** - адрес backend части вашего приложения, куда отсылаются основные запросы
69
-
70
-
71
- - Далее в вашем приложении нужно инициализировать карту leafet внтури основного **DartcomProviders**:
72
-
73
- ```javascript
74
- import { MapContainer } from 'react-leaflet';
75
-
76
- <MapContainer center={[51.505, -0.09]} zoom={13} scrollWheelZoom={false}>
77
- {...Content}
78
- </MapContainer>;
79
- ```
80
-
81
- - Теперь нужно поместить внутрь MapContainer компонент с нашим слоем:
82
-
83
- ```javascript
84
- import DartcomLayer from './your-path';
85
-
86
- import { MapContainer } from 'react-leaflet';
87
-
88
- <MapContainer center={[51.505, -0.09]} zoom={13} scrollWheelZoom={false}>
89
- <DartcomLayer />
90
-
91
- {...Content}
92
- </MapContainer>;
93
- ```
94
-
95
- - В компоненте нужно инициализировать слой и добавить его на карту как основную подложку:
96
-
97
- ```javascript
98
- // your-path.tsx
99
-
100
- import * as React from 'react';
101
-
102
- import { useMap } from 'react-leaflet';
103
-
104
- import {
105
- getAllLayers,
106
- SourceLayers,
107
- TangramLayer,
108
- TangramSourceNames,
109
- } from '@dartcom/ui-kit';
110
-
111
- const DartcomLayer: React.FC = () => {
112
- const map = useMap();
113
-
114
- React.useEffect(() => {
115
- const { current: layersControl } = controlRef;
116
-
117
- const defaultLayers = getAllLayers(TangramSourceNames.TILE);
118
-
119
- new TangramLayer({
120
- defaultLayers,
121
-
122
- eventHandlers: {
123
- [SourceLayers[name]]: {
124
- click: ({ properties }) => {},
125
- hover: ({ properties }) => {},
126
- },
127
- },
128
-
129
- onCreate: ({ layer }) => {
130
- layer.addTo(map);
131
- },
132
-
133
- onDestroy: ({ layer }) => {
134
- layer.removeFrom(map);
135
- },
136
- });
137
- }, []);
138
-
139
- return null;
140
- };
141
-
142
- export default DartcomLayer;
143
- ```
144
-
145
- - **defaultLayers** - это основной список слоев, которые можно получить из библиотеки и который будет показываться на карте. В примере мы грузим все слои из ресурса **TangramSourceNames.TILE** с помощью функции **getAllLayers**, но пожно подгружать разные слои из разных ресурсов
49
+ ## Documentation
50
+ - [Providers](https://github.com/Dalganmap/tiles_library/tree/develop/docs/providers/README.md)
package/dist/index.cjs CHANGED
@@ -46500,11 +46500,13 @@ const AuthPage = ({ onSuccess, onError }) => {
46500
46500
  onSuccess(signIn.data);
46501
46501
  }
46502
46502
  }, [signIn.data]);
46503
- return (jsxRuntime.jsx(AuthLayout, { children: jsxRuntime.jsxs(CustomForm, { form: form, onSubmit: onSubmit, sx: {
46504
- justifyContent: 'center',
46505
- justifyItems: 'center',
46506
- alignContent: 'center',
46507
- alignItems: 'center',
46503
+ return (jsxRuntime.jsx(AuthLayout, { children: jsxRuntime.jsxs(CustomForm, { form: form, onSubmit: onSubmit, sx: () => {
46504
+ return {
46505
+ justifyContent: 'center',
46506
+ justifyItems: 'center',
46507
+ alignContent: 'center',
46508
+ alignItems: 'center',
46509
+ };
46508
46510
  }, children: [jsxRuntime.jsx(material.Typography, { variant: "h4", children: "\u0410\u0432\u0442\u043E\u0440\u0438\u0437\u0430\u0446\u0438\u044F" }), jsxRuntime.jsx(CustomInput, { ...register('username'), label: "\u041B\u043E\u0433\u0438\u043D", placeholder: "\u0412\u0432\u0435\u0434\u0438\u0442\u0435 \u043B\u043E\u0433\u0438\u043D" }), jsxRuntime.jsx(CustomInput, { ...register('password'), label: "\u041F\u0430\u0440\u043E\u043B\u044C", placeholder: "\u0412\u0432\u0435\u0434\u0438\u0442\u0435 \u043F\u0430\u0440\u043E\u043B\u044C", type: "password" }), jsxRuntime.jsx(Button, { type: "submit", disabled: !isValid, children: "\u0412\u043E\u0439\u0442\u0438" })] }) }));
46509
46511
  };
46510
46512