ydb-ui-components 3.6.0 → 4.1.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.
- package/README.md +1 -1
- package/build/cjs/components/NavigationTree/EmptyView/EmptyView.d.ts +1 -1
- package/build/cjs/components/NavigationTree/EmptyView/EmptyView.js +12 -28
- package/build/cjs/components/NavigationTree/ErrorView/ErrorView.d.ts +1 -1
- package/build/cjs/components/NavigationTree/ErrorView/ErrorView.js +12 -28
- package/build/cjs/components/NavigationTree/LoaderView/LoaderView.d.ts +1 -1
- package/build/cjs/components/NavigationTree/LoaderView/LoaderView.js +11 -30
- package/build/cjs/components/NavigationTree/NavigationTree.js +36 -116
- package/build/cjs/components/NavigationTree/NavigationTreeNode.d.ts +2 -2
- package/build/cjs/components/NavigationTree/NavigationTreeNode.js +89 -173
- package/build/cjs/components/NavigationTree/i18n/index.d.ts +1 -1
- package/build/cjs/components/NavigationTree/i18n/index.js +7 -25
- package/build/cjs/components/NavigationTree/index.d.ts +1 -1
- package/build/cjs/components/NavigationTree/index.js +3 -30
- package/build/cjs/components/NavigationTree/state.d.ts +31 -5
- package/build/cjs/components/NavigationTree/state.js +58 -122
- package/build/cjs/components/NavigationTree/types.d.ts +3 -3
- package/build/cjs/components/NavigationTree/types.js +1 -4
- package/build/cjs/components/NavigationTree/utils.d.ts +1 -1
- package/build/cjs/components/NavigationTree/utils.js +42 -72
- package/build/cjs/components/TreeView/TreeView.d.ts +2 -2
- package/build/cjs/components/TreeView/TreeView.js +43 -104
- package/build/cjs/components/TreeView/index.js +3 -17
- package/build/cjs/components/icons/ColumnTable.js +6 -22
- package/build/cjs/components/icons/Database.js +6 -20
- package/build/cjs/components/icons/ExternalDataSource.js +6 -22
- package/build/cjs/components/icons/ExternalTable.js +6 -22
- package/build/cjs/components/icons/Folder.js +6 -20
- package/build/cjs/components/icons/FolderOpen.js +6 -20
- package/build/cjs/components/icons/Index.js +6 -22
- package/build/cjs/components/icons/Table.js +6 -22
- package/build/cjs/components/icons/Topic.js +6 -36
- package/build/cjs/components/icons/View.d.ts +2 -0
- package/build/cjs/components/icons/View.js +8 -0
- package/build/cjs/index.d.ts +0 -1
- package/build/cjs/index.js +4 -43
- package/build/cjs/utils/cn.d.ts +1 -0
- package/build/cjs/utils/cn.js +5 -0
- package/build/esm/components/NavigationTree/EmptyView/EmptyView.d.ts +1 -1
- package/build/esm/components/NavigationTree/EmptyView/EmptyView.js +7 -13
- package/build/esm/components/NavigationTree/ErrorView/ErrorView.d.ts +1 -1
- package/build/esm/components/NavigationTree/ErrorView/ErrorView.js +7 -13
- package/build/esm/components/NavigationTree/LoaderView/LoaderView.d.ts +1 -1
- package/build/esm/components/NavigationTree/LoaderView/LoaderView.js +6 -14
- package/build/esm/components/NavigationTree/NavigationTree.js +29 -98
- package/build/esm/components/NavigationTree/NavigationTreeNode.d.ts +2 -2
- package/build/esm/components/NavigationTree/NavigationTreeNode.js +79 -142
- package/build/esm/components/NavigationTree/i18n/index.d.ts +1 -1
- package/build/esm/components/NavigationTree/i18n/index.js +3 -6
- package/build/esm/components/NavigationTree/index.d.ts +1 -1
- package/build/esm/components/NavigationTree/index.js +0 -1
- package/build/esm/components/NavigationTree/state.d.ts +31 -5
- package/build/esm/components/NavigationTree/state.js +51 -106
- package/build/esm/components/NavigationTree/types.d.ts +3 -3
- package/build/esm/components/NavigationTree/types.js +1 -1
- package/build/esm/components/NavigationTree/utils.d.ts +1 -1
- package/build/esm/components/NavigationTree/utils.js +37 -62
- package/build/esm/components/TreeView/TreeView.d.ts +2 -2
- package/build/esm/components/TreeView/TreeView.js +38 -84
- package/build/esm/components/TreeView/index.js +1 -1
- package/build/esm/components/icons/ColumnTable.js +3 -12
- package/build/esm/components/icons/Database.js +3 -10
- package/build/esm/components/icons/ExternalDataSource.js +3 -12
- package/build/esm/components/icons/ExternalTable.js +3 -12
- package/build/esm/components/icons/Folder.js +3 -10
- package/build/esm/components/icons/FolderOpen.js +3 -10
- package/build/esm/components/icons/Index.js +3 -12
- package/build/esm/components/icons/Table.js +3 -12
- package/build/esm/components/icons/Topic.js +3 -26
- package/build/esm/components/icons/View.d.ts +2 -0
- package/build/esm/components/icons/View.js +5 -0
- package/build/esm/index.d.ts +0 -1
- package/build/esm/index.js +0 -1
- package/build/esm/utils/cn.d.ts +1 -0
- package/build/esm/utils/cn.js +2 -0
- package/package.json +52 -29
- package/CHANGELOG.md +0 -233
- package/build/cjs/components/i18n.d.ts +0 -2
- package/build/cjs/components/i18n.js +0 -19
- package/build/cjs/utils/configure.d.ts +0 -12
- package/build/cjs/utils/configure.js +0 -42
- package/build/cjs/utils/index.d.ts +0 -1
- package/build/cjs/utils/index.js +0 -19
- package/build/esm/components/i18n.d.ts +0 -2
- package/build/esm/components/i18n.js +0 -9
- package/build/esm/utils/configure.d.ts +0 -12
- package/build/esm/utils/configure.js +0 -26
- package/build/esm/utils/index.d.ts +0 -1
- package/build/esm/utils/index.js +0 -1
package/CHANGELOG.md
DELETED
|
@@ -1,233 +0,0 @@
|
|
|
1
|
-
# Changelog
|
|
2
|
-
|
|
3
|
-
## [3.6.0](https://github.com/ydb-platform/ydb-ui-components/compare/v3.5.0...v3.6.0) (2024-01-15)
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
### Features
|
|
7
|
-
|
|
8
|
-
* **TreeView:** remove `react-treeview` package to avoid using native `addEventListener` ([#64](https://github.com/ydb-platform/ydb-ui-components/issues/64)) ([48d0e4e](https://github.com/ydb-platform/ydb-ui-components/commit/48d0e4e32e28c3d0bebcbeaa086c3b82312f0848))
|
|
9
|
-
|
|
10
|
-
## [3.5.0](https://github.com/ydb-platform/ydb-ui-components/compare/v3.4.0...v3.5.0) (2023-12-12)
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
### Features
|
|
14
|
-
|
|
15
|
-
* update to uikit5 ([#62](https://github.com/ydb-platform/ydb-ui-components/issues/62)) ([03cf678](https://github.com/ydb-platform/ydb-ui-components/commit/03cf6786f27ed433a040cb4d2ad70764eaa8e4b1))
|
|
16
|
-
|
|
17
|
-
## [3.4.0](https://github.com/ydb-platform/ydb-ui-components/compare/v3.3.1...v3.4.0) (2023-10-23)
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
### Features
|
|
21
|
-
|
|
22
|
-
* build with both cjs and esm as targets ([#60](https://github.com/ydb-platform/ydb-ui-components/issues/60)) ([7b29759](https://github.com/ydb-platform/ydb-ui-components/commit/7b297599bb1129a40dc6797fcf0673165dd52a42))
|
|
23
|
-
|
|
24
|
-
## [3.3.1](https://github.com/ydb-platform/ydb-ui-components/compare/v3.3.0...v3.3.1) (2023-08-09)
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
### Bug Fixes
|
|
28
|
-
|
|
29
|
-
* **NavigationTree:** fix actions overflow ([#58](https://github.com/ydb-platform/ydb-ui-components/issues/58)) ([38c816f](https://github.com/ydb-platform/ydb-ui-components/commit/38c816fc6b5ed3173dfe4c74752ceafff93f8fc5))
|
|
30
|
-
|
|
31
|
-
## [3.3.0](https://github.com/ydb-platform/ydb-ui-components/compare/v3.2.2...v3.3.0) (2023-08-09)
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
### Features
|
|
35
|
-
|
|
36
|
-
* **NavigationTree:** add additionalNodeElements to NavigationTree ([#55](https://github.com/ydb-platform/ydb-ui-components/issues/55)) ([d462aaf](https://github.com/ydb-platform/ydb-ui-components/commit/d462aafd8dd61aca3cc17b17f57419af4c7e8910))
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
### Bug Fixes
|
|
40
|
-
|
|
41
|
-
* **NavigationTree:** add new NavigationTreeNodeType 'stream' ([#57](https://github.com/ydb-platform/ydb-ui-components/issues/57)) ([270f607](https://github.com/ydb-platform/ydb-ui-components/commit/270f607e952f197c51fccd89a313390fdd8f055d))
|
|
42
|
-
|
|
43
|
-
## [3.2.2](https://github.com/ydb-platform/ydb-ui-components/compare/v3.2.1...v3.2.2) (2023-08-03)
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
### Bug Fixes
|
|
47
|
-
|
|
48
|
-
* update icons for external table ([#53](https://github.com/ydb-platform/ydb-ui-components/issues/53)) ([928e8f7](https://github.com/ydb-platform/ydb-ui-components/commit/928e8f7d591e7557a9d939f07edbe8ae6ebcdaff))
|
|
49
|
-
|
|
50
|
-
## [3.2.1](https://github.com/ydb-platform/ydb-ui-components/compare/v3.2.0...v3.2.1) (2023-07-26)
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
### Bug Fixes
|
|
54
|
-
|
|
55
|
-
* fix clip and fill rules ([#51](https://github.com/ydb-platform/ydb-ui-components/issues/51)) ([13d8f4a](https://github.com/ydb-platform/ydb-ui-components/commit/13d8f4a9be934bac18e704c88674dcb349355938))
|
|
56
|
-
|
|
57
|
-
## [3.2.0](https://github.com/ydb-platform/ydb-ui-components/compare/v3.1.0...v3.2.0) (2023-07-21)
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
### Features
|
|
61
|
-
|
|
62
|
-
* **NavigationTree:** support external table and data source ([b6334dc](https://github.com/ydb-platform/ydb-ui-components/commit/b6334dc66a073d9584d7b9d106f08e9103246b6a))
|
|
63
|
-
|
|
64
|
-
## [3.1.0](https://github.com/ydb-platform/ydb-ui-components/compare/v3.0.3...v3.1.0) (2023-03-28)
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
### chore
|
|
68
|
-
|
|
69
|
-
* update @gravity-ui/uikit to 4.3.0 ([6482a17](https://github.com/ydb-platform/ydb-ui-components/commit/6482a1747285730a8650b4cadc4f9c8040dec0ff))
|
|
70
|
-
* update react, react-dom to 18.2.0 ([aca9cbf](https://github.com/ydb-platform/ydb-ui-components/commit/aca9cbfa8a0825c3e180b310a825dcc5ebe13eb0))
|
|
71
|
-
* update peerDependencies ([aa131fd](https://github.com/ydb-platform/ydb-ui-components/commit/aa131fdb0819e9a40937329ceef9d7093c4121da))
|
|
72
|
-
|
|
73
|
-
## [3.0.3](https://github.com/ydb-platform/ydb-ui-components/compare/v3.0.2...v3.0.3) (2023-02-17)
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
### Bug Fixes
|
|
77
|
-
|
|
78
|
-
* **NavigationTree:** update IndexTable icon ([1deab3e](https://github.com/ydb-platform/ydb-ui-components/commit/1deab3eda7611faa4b25c80493f31fff821c9c80))
|
|
79
|
-
|
|
80
|
-
## [3.0.2](https://github.com/ydb-platform/ydb-ui-components/compare/v3.0.1...v3.0.2) (2022-12-16)
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
### Bug Fixes
|
|
84
|
-
|
|
85
|
-
* icons fill and clip rule in camelCase ([04638fc](https://github.com/ydb-platform/ydb-ui-components/commit/04638fc41279557d5e72d909995cbaf3f71566a0))
|
|
86
|
-
|
|
87
|
-
## [3.0.1](https://github.com/ydb-platform/ydb-ui-components/compare/v3.0.0...v3.0.1) (2022-09-23)
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
### Bug Fixes
|
|
91
|
-
|
|
92
|
-
* **NavigatioinTree:** update icons ([0d0674d](https://github.com/ydb-platform/ydb-ui-components/commit/0d0674dfc1b14bf8115135ee75090a7f967da2d4))
|
|
93
|
-
|
|
94
|
-
## [3.0.0](https://github.com/ydb-platform/ydb-ui-components/compare/v2.4.1...v3.0.0) (2022-09-21)
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
### ⚠ BREAKING CHANGES
|
|
98
|
-
|
|
99
|
-
* peer deps update: migrated from `@yandex-cloud/uikit` to `@gravity-ui/uikit`
|
|
100
|
-
* updated i18n, and removed it from peer deps
|
|
101
|
-
* removed deprecated i18n instance export
|
|
102
|
-
|
|
103
|
-
#### Setting language in ydb-ui-components
|
|
104
|
-
|
|
105
|
-
**v2**
|
|
106
|
-
```js
|
|
107
|
-
import {i18n} from 'ydb-ui-components';
|
|
108
|
-
|
|
109
|
-
i18n.setLang('en');
|
|
110
|
-
```
|
|
111
|
-
|
|
112
|
-
**v3**
|
|
113
|
-
```js
|
|
114
|
-
import {configure} from 'ydb-ui-components';
|
|
115
|
-
|
|
116
|
-
configure({lang: 'en'});
|
|
117
|
-
```
|
|
118
|
-
|
|
119
|
-
## [2.4.1](https://github.com/ydb-platform/ydb-ui-components/compare/v2.4.0...v2.4.1) (2022-08-02)
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
### Bug Fixes
|
|
123
|
-
|
|
124
|
-
* **NavigationTree:** add node types & update icons ([909b560](https://github.com/ydb-platform/ydb-ui-components/commit/909b5607b6309cb42401afdb7b869f2a2e8ab908))
|
|
125
|
-
|
|
126
|
-
## [2.4.0](https://github.com/ydb-platform/ydb-ui-components/compare/v2.3.0...v2.4.0) (2022-07-28)
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
### Features
|
|
130
|
-
|
|
131
|
-
* **NavigationTree:** virtualized render ([7388ff5](https://github.com/ydb-platform/ydb-ui-components/commit/7388ff5a5b05ffa30b86fb4ae2d8e52a7bd9dad8))
|
|
132
|
-
* **TreeView:** a prop to determine tree view nesting level ([2e5d42a](https://github.com/ydb-platform/ydb-ui-components/commit/2e5d42abf78e81fdd61747958822dc3b96eab42f))
|
|
133
|
-
|
|
134
|
-
## [2.3.0](https://github.com/ydb-platform/ydb-ui-components/compare/v2.2.0...v2.3.0) (2022-07-18)
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
### Features
|
|
138
|
-
|
|
139
|
-
* **i18n:** add configure function ([c48e58e](https://github.com/ydb-platform/ydb-ui-components/commit/c48e58e33e361cf4f507190cd0a8d0a896975fb1))
|
|
140
|
-
|
|
141
|
-
## [2.2.0](https://github.com/ydb-platform/ydb-ui-components/compare/v2.1.0...v2.2.0) (2022-07-05)
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
### Features
|
|
145
|
-
|
|
146
|
-
* **NavigationTree:** add index and index_table node types! ([d6ed6ba](https://github.com/ydb-platform/ydb-ui-components/commit/d6ed6bae7e882a6217d4205f931ac3704b8ed9f6))
|
|
147
|
-
|
|
148
|
-
## [2.1.0](https://github.com/ydb-platform/ydb-ui-components/compare/v2.0.2...v2.1.0) (2022-06-28)
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
### Features
|
|
152
|
-
|
|
153
|
-
* **NavigationTree:** explicitly specify expandable nodes ([1791d59](https://github.com/ydb-platform/ydb-ui-components/commit/1791d59d4ed5b27050fdbd9c29500c4fe916f631))
|
|
154
|
-
|
|
155
|
-
### [2.0.2](https://github.com/ydb-platform/ydb-ui-components/compare/v2.0.1...v2.0.2) (2022-05-30)
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
### Bug Fixes
|
|
159
|
-
|
|
160
|
-
* add i18n export ([13a34e0](https://github.com/ydb-platform/ydb-ui-components/commit/13a34e0056a9fa42b5ad02fc41e5323af0ac98e9))
|
|
161
|
-
|
|
162
|
-
### [2.0.1](https://github.com/ydb-platform/ydb-ui-components/compare/v2.0.0...v2.0.1) (2022-05-26)
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
### chore
|
|
166
|
-
|
|
167
|
-
* update @yandex-cloud/uikit to 2.4.0 ([663c8d2](https://github.com/ydb-platform/ydb-ui-components/commit/663c8d26c704bd83be97c81f4fd4080a7cfbb3d0))
|
|
168
|
-
|
|
169
|
-
## [2.0.0](https://github.com/ydb-platform/ydb-ui-components/compare/v1.2.3...v2.0.0) (2022-05-25)
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
### ⚠ BREAKING CHANGES
|
|
173
|
-
|
|
174
|
-
* major version update of peer dependency @yandex-cloud/uikit, see changelog here: https://github.com/yandex-cloud/uikit/blob/main/CHANGELOG_V2.md
|
|
175
|
-
|
|
176
|
-
### chore
|
|
177
|
-
|
|
178
|
-
* update @yandex-cloud/uikit to v2.3.1 ([ba67dd6](https://github.com/ydb-platform/ydb-ui-components/commit/ba67dd6f8f01b2a58ed67bd064ad8962f2f8a244))
|
|
179
|
-
* update @yandex-cloud/i18n to v0.6.0 ([237c2cd](https://github.com/ydb-platform/ydb-ui-components/commit/237c2cdd5064565da2cf62fbebb0fc0ae1195d0e))
|
|
180
|
-
|
|
181
|
-
### [1.2.3](https://github.com/ydb-platform/ydb-ui-components/compare/v1.2.2...v1.2.3) (2022-05-23)
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
### Bug Fixes
|
|
185
|
-
|
|
186
|
-
* **NavigationTree:** expand tree to initial active path ([6a84dfb](https://github.com/ydb-platform/ydb-ui-components/commit/6a84dfb8b89f8411bd5b11f7b18582ed547c6d0d))
|
|
187
|
-
|
|
188
|
-
### [1.2.2](https://github.com/ydb-platform/ydb-ui-components/compare/v1.2.1...v1.2.2) (2022-05-23)
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
### Bug Fixes
|
|
192
|
-
|
|
193
|
-
* add missing index file for TreeView ([7496d9b](https://github.com/ydb-platform/ydb-ui-components/commit/7496d9b7074d6ee5c2f280030ca38cc9373b0f34))
|
|
194
|
-
|
|
195
|
-
### [1.2.1](https://github.com/ydb-platform/ydb-ui-components/compare/v1.2.0...v1.2.1) (2022-05-23)
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
### Bug Fixes
|
|
199
|
-
|
|
200
|
-
* add missing component export ([9b71eb7](https://github.com/ydb-platform/ydb-ui-components/commit/9b71eb78f8c2adfd773e45edddc41ea97c64aa35))
|
|
201
|
-
|
|
202
|
-
## [1.2.0](https://github.com/ydb-platform/ydb-ui-components/compare/v1.1.3...v1.2.0) (2022-05-23)
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
### Features
|
|
206
|
-
|
|
207
|
-
* a param to always refetch nodes data ([6cee325](https://github.com/ydb-platform/ydb-ui-components/commit/6cee32581d0a16ecc8bb742eb8f2c27d2d9a1cad))
|
|
208
|
-
|
|
209
|
-
### [1.1.3](https://github.com/ydb-platform/ydb-ui-components/compare/v1.1.2...v1.1.3) (2022-05-23)
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
### Bug Fixes
|
|
213
|
-
|
|
214
|
-
* add @yandex-cloud/uikit to peer deps ([61d5628](https://github.com/ydb-platform/ydb-ui-components/commit/61d5628088528e5c532c096bacebb2eca3f68206))
|
|
215
|
-
|
|
216
|
-
### [1.1.2](https://github.com/ydb-platform/ydb-ui-components/compare/v1.1.1...v1.1.2) (2022-05-19)
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
### Bug Fixes
|
|
220
|
-
|
|
221
|
-
* move react-treeview to prod deps ([#5](https://github.com/ydb-platform/ydb-ui-components/issues/5)) ([04d307b](https://github.com/ydb-platform/ydb-ui-components/commit/04d307b226b8b0d7bdaf58542df8d214fb49acce))
|
|
222
|
-
* @yandex-cloud/browserslist-config as peer dependency ([c3b48a7](https://github.com/ydb-platform/ydb-ui-components/commit/c3b48a7ea0370c854fb68b1e1fc12541e8a6494e))
|
|
223
|
-
* use provided root path ([203abd1](https://github.com/ydb-platform/ydb-ui-components/commit/203abd1892ad1e8c8c4555b06b99aa41ff01ab01))
|
|
224
|
-
* include i18n files ([8363de6](https://github.com/ydb-platform/ydb-ui-components/commit/8363de686cbad9e10753b47a62e7917610dcc84d))
|
|
225
|
-
|
|
226
|
-
### [1.1.1](https://www.github.com/ydb-platform/ydb-ui-components/compare/v1.1.0...v1.1.1) (2022-05-13)
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
### Bug Fixes
|
|
230
|
-
|
|
231
|
-
* fix package ([67b3b0e](https://www.github.com/ydb-platform/ydb-ui-components/commit/67b3b0e3c2678452847ca3b1489be11fc73ea6c2))
|
|
232
|
-
|
|
233
|
-
## 1.1.0 (2022-04-18)
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.i18n = void 0;
|
|
7
|
-
|
|
8
|
-
var _i18n = require("@gravity-ui/i18n");
|
|
9
|
-
|
|
10
|
-
var _configure = require("../utils/configure");
|
|
11
|
-
|
|
12
|
-
var i18n = new _i18n.I18N();
|
|
13
|
-
exports.i18n = i18n;
|
|
14
|
-
i18n.setLang((0, _configure.getConfig)().lang || _configure.Lang.En);
|
|
15
|
-
(0, _configure.subscribeConfigure)(function (config) {
|
|
16
|
-
if (config.lang) {
|
|
17
|
-
i18n.setLang(config.lang);
|
|
18
|
-
}
|
|
19
|
-
});
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
export declare enum Lang {
|
|
2
|
-
Ru = "ru",
|
|
3
|
-
En = "en"
|
|
4
|
-
}
|
|
5
|
-
interface Config {
|
|
6
|
-
lang?: Lang;
|
|
7
|
-
}
|
|
8
|
-
declare type Subscriber = (config: Config) => void;
|
|
9
|
-
export declare const configure: (newConfig: Config) => void;
|
|
10
|
-
export declare const subscribeConfigure: (sub: Subscriber) => () => void;
|
|
11
|
-
export declare const getConfig: () => Config;
|
|
12
|
-
export {};
|
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.subscribeConfigure = exports.getConfig = exports.configure = exports.Lang = void 0;
|
|
7
|
-
var Lang;
|
|
8
|
-
exports.Lang = Lang;
|
|
9
|
-
|
|
10
|
-
(function (Lang) {
|
|
11
|
-
Lang["Ru"] = "ru";
|
|
12
|
-
Lang["En"] = "en";
|
|
13
|
-
})(Lang || (exports.Lang = Lang = {}));
|
|
14
|
-
|
|
15
|
-
var subs = [];
|
|
16
|
-
var config = {};
|
|
17
|
-
|
|
18
|
-
var configure = function configure(newConfig) {
|
|
19
|
-
Object.assign(config, newConfig);
|
|
20
|
-
subs.forEach(function (sub) {
|
|
21
|
-
sub(config);
|
|
22
|
-
});
|
|
23
|
-
};
|
|
24
|
-
|
|
25
|
-
exports.configure = configure;
|
|
26
|
-
|
|
27
|
-
var subscribeConfigure = function subscribeConfigure(sub) {
|
|
28
|
-
subs.push(sub);
|
|
29
|
-
return function () {
|
|
30
|
-
subs = subs.filter(function (item) {
|
|
31
|
-
return item !== sub;
|
|
32
|
-
});
|
|
33
|
-
};
|
|
34
|
-
};
|
|
35
|
-
|
|
36
|
-
exports.subscribeConfigure = subscribeConfigure;
|
|
37
|
-
|
|
38
|
-
var getConfig = function getConfig() {
|
|
39
|
-
return config;
|
|
40
|
-
};
|
|
41
|
-
|
|
42
|
-
exports.getConfig = getConfig;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { configure, Lang } from './configure';
|
package/build/cjs/utils/index.js
DELETED
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
Object.defineProperty(exports, "Lang", {
|
|
7
|
-
enumerable: true,
|
|
8
|
-
get: function get() {
|
|
9
|
-
return _configure.Lang;
|
|
10
|
-
}
|
|
11
|
-
});
|
|
12
|
-
Object.defineProperty(exports, "configure", {
|
|
13
|
-
enumerable: true,
|
|
14
|
-
get: function get() {
|
|
15
|
-
return _configure.configure;
|
|
16
|
-
}
|
|
17
|
-
});
|
|
18
|
-
|
|
19
|
-
var _configure = require("./configure");
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { I18N } from '@gravity-ui/i18n';
|
|
2
|
-
import { getConfig, subscribeConfigure, Lang } from '../utils/configure';
|
|
3
|
-
export var i18n = new I18N();
|
|
4
|
-
i18n.setLang(getConfig().lang || Lang.En);
|
|
5
|
-
subscribeConfigure(function (config) {
|
|
6
|
-
if (config.lang) {
|
|
7
|
-
i18n.setLang(config.lang);
|
|
8
|
-
}
|
|
9
|
-
});
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
export declare enum Lang {
|
|
2
|
-
Ru = "ru",
|
|
3
|
-
En = "en"
|
|
4
|
-
}
|
|
5
|
-
interface Config {
|
|
6
|
-
lang?: Lang;
|
|
7
|
-
}
|
|
8
|
-
declare type Subscriber = (config: Config) => void;
|
|
9
|
-
export declare const configure: (newConfig: Config) => void;
|
|
10
|
-
export declare const subscribeConfigure: (sub: Subscriber) => () => void;
|
|
11
|
-
export declare const getConfig: () => Config;
|
|
12
|
-
export {};
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
export var Lang;
|
|
2
|
-
|
|
3
|
-
(function (Lang) {
|
|
4
|
-
Lang["Ru"] = "ru";
|
|
5
|
-
Lang["En"] = "en";
|
|
6
|
-
})(Lang || (Lang = {}));
|
|
7
|
-
|
|
8
|
-
var subs = [];
|
|
9
|
-
var config = {};
|
|
10
|
-
export var configure = function configure(newConfig) {
|
|
11
|
-
Object.assign(config, newConfig);
|
|
12
|
-
subs.forEach(function (sub) {
|
|
13
|
-
sub(config);
|
|
14
|
-
});
|
|
15
|
-
};
|
|
16
|
-
export var subscribeConfigure = function subscribeConfigure(sub) {
|
|
17
|
-
subs.push(sub);
|
|
18
|
-
return function () {
|
|
19
|
-
subs = subs.filter(function (item) {
|
|
20
|
-
return item !== sub;
|
|
21
|
-
});
|
|
22
|
-
};
|
|
23
|
-
};
|
|
24
|
-
export var getConfig = function getConfig() {
|
|
25
|
-
return config;
|
|
26
|
-
};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { configure, Lang } from './configure';
|
package/build/esm/utils/index.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { configure, Lang } from './configure';
|