ydb-ui-components 3.3.0 → 3.4.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.
Files changed (114) hide show
  1. package/CHANGELOG.md +14 -0
  2. package/build/{components → cjs/components}/TreeView/TreeView.css +0 -1
  3. package/build/esm/components/NavigationTree/EmptyView/EmptyView.css +4 -0
  4. package/build/esm/components/NavigationTree/EmptyView/EmptyView.d.ts +7 -0
  5. package/build/esm/components/NavigationTree/EmptyView/EmptyView.js +15 -0
  6. package/build/esm/components/NavigationTree/ErrorView/ErrorView.css +3 -0
  7. package/build/esm/components/NavigationTree/ErrorView/ErrorView.d.ts +7 -0
  8. package/build/esm/components/NavigationTree/ErrorView/ErrorView.js +15 -0
  9. package/build/esm/components/NavigationTree/LoaderView/LoaderView.css +7 -0
  10. package/build/esm/components/NavigationTree/LoaderView/LoaderView.d.ts +7 -0
  11. package/build/esm/components/NavigationTree/LoaderView/LoaderView.js +17 -0
  12. package/build/esm/components/NavigationTree/NavigationTree.d.ts +4 -0
  13. package/build/esm/components/NavigationTree/NavigationTree.js +103 -0
  14. package/build/esm/components/NavigationTree/NavigationTreeNode.d.ts +17 -0
  15. package/build/esm/components/NavigationTree/NavigationTreeNode.js +153 -0
  16. package/build/esm/components/NavigationTree/i18n/en.json +4 -0
  17. package/build/esm/components/NavigationTree/i18n/index.d.ts +2 -0
  18. package/build/esm/components/NavigationTree/i18n/index.js +8 -0
  19. package/build/esm/components/NavigationTree/i18n/ru.json +4 -0
  20. package/build/esm/components/NavigationTree/index.d.ts +2 -0
  21. package/build/esm/components/NavigationTree/index.js +2 -0
  22. package/build/esm/components/NavigationTree/state.d.ts +21 -0
  23. package/build/esm/components/NavigationTree/state.js +118 -0
  24. package/build/esm/components/NavigationTree/types.d.ts +41 -0
  25. package/build/esm/components/NavigationTree/types.js +1 -0
  26. package/build/esm/components/NavigationTree/utils.d.ts +6 -0
  27. package/build/esm/components/NavigationTree/utils.js +68 -0
  28. package/build/esm/components/TreeView/TreeView.css +90 -0
  29. package/build/esm/components/TreeView/TreeView.d.ts +18 -0
  30. package/build/esm/components/TreeView/TreeView.js +86 -0
  31. package/build/esm/components/TreeView/index.d.ts +1 -0
  32. package/build/esm/components/TreeView/index.js +1 -0
  33. package/build/esm/components/i18n.d.ts +2 -0
  34. package/build/esm/components/i18n.js +9 -0
  35. package/build/esm/components/icons/ColumnTable.d.ts +2 -0
  36. package/build/esm/components/icons/ColumnTable.js +14 -0
  37. package/build/esm/components/icons/Database.d.ts +2 -0
  38. package/build/esm/components/icons/Database.js +12 -0
  39. package/build/esm/components/icons/ExternalDataSource.d.ts +2 -0
  40. package/build/esm/components/icons/ExternalDataSource.js +14 -0
  41. package/build/esm/components/icons/ExternalTable.d.ts +2 -0
  42. package/build/esm/components/icons/ExternalTable.js +14 -0
  43. package/build/esm/components/icons/Folder.d.ts +2 -0
  44. package/build/esm/components/icons/Folder.js +12 -0
  45. package/build/esm/components/icons/FolderOpen.d.ts +2 -0
  46. package/build/esm/components/icons/FolderOpen.js +12 -0
  47. package/build/esm/components/icons/Index.d.ts +2 -0
  48. package/build/esm/components/icons/Index.js +14 -0
  49. package/build/esm/components/icons/Table.d.ts +2 -0
  50. package/build/esm/components/icons/Table.js +14 -0
  51. package/build/esm/components/icons/Topic.d.ts +2 -0
  52. package/build/esm/components/icons/Topic.js +28 -0
  53. package/build/esm/index.d.ts +3 -0
  54. package/build/esm/index.js +3 -0
  55. package/build/esm/utils/configure.d.ts +12 -0
  56. package/build/esm/utils/configure.js +26 -0
  57. package/build/esm/utils/index.d.ts +1 -0
  58. package/build/esm/utils/index.js +1 -0
  59. package/package.json +11 -3
  60. /package/build/{components → cjs/components}/NavigationTree/EmptyView/EmptyView.css +0 -0
  61. /package/build/{components → cjs/components}/NavigationTree/EmptyView/EmptyView.d.ts +0 -0
  62. /package/build/{components → cjs/components}/NavigationTree/EmptyView/EmptyView.js +0 -0
  63. /package/build/{components → cjs/components}/NavigationTree/ErrorView/ErrorView.css +0 -0
  64. /package/build/{components → cjs/components}/NavigationTree/ErrorView/ErrorView.d.ts +0 -0
  65. /package/build/{components → cjs/components}/NavigationTree/ErrorView/ErrorView.js +0 -0
  66. /package/build/{components → cjs/components}/NavigationTree/LoaderView/LoaderView.css +0 -0
  67. /package/build/{components → cjs/components}/NavigationTree/LoaderView/LoaderView.d.ts +0 -0
  68. /package/build/{components → cjs/components}/NavigationTree/LoaderView/LoaderView.js +0 -0
  69. /package/build/{components → cjs/components}/NavigationTree/NavigationTree.d.ts +0 -0
  70. /package/build/{components → cjs/components}/NavigationTree/NavigationTree.js +0 -0
  71. /package/build/{components → cjs/components}/NavigationTree/NavigationTreeNode.d.ts +0 -0
  72. /package/build/{components → cjs/components}/NavigationTree/NavigationTreeNode.js +0 -0
  73. /package/build/{components → cjs/components}/NavigationTree/i18n/en.json +0 -0
  74. /package/build/{components → cjs/components}/NavigationTree/i18n/index.d.ts +0 -0
  75. /package/build/{components → cjs/components}/NavigationTree/i18n/index.js +0 -0
  76. /package/build/{components → cjs/components}/NavigationTree/i18n/ru.json +0 -0
  77. /package/build/{components → cjs/components}/NavigationTree/index.d.ts +0 -0
  78. /package/build/{components → cjs/components}/NavigationTree/index.js +0 -0
  79. /package/build/{components → cjs/components}/NavigationTree/state.d.ts +0 -0
  80. /package/build/{components → cjs/components}/NavigationTree/state.js +0 -0
  81. /package/build/{components → cjs/components}/NavigationTree/types.d.ts +0 -0
  82. /package/build/{components → cjs/components}/NavigationTree/types.js +0 -0
  83. /package/build/{components → cjs/components}/NavigationTree/utils.d.ts +0 -0
  84. /package/build/{components → cjs/components}/NavigationTree/utils.js +0 -0
  85. /package/build/{components → cjs/components}/TreeView/TreeView.d.ts +0 -0
  86. /package/build/{components → cjs/components}/TreeView/TreeView.js +0 -0
  87. /package/build/{components → cjs/components}/TreeView/index.d.ts +0 -0
  88. /package/build/{components → cjs/components}/TreeView/index.js +0 -0
  89. /package/build/{components → cjs/components}/i18n.d.ts +0 -0
  90. /package/build/{components → cjs/components}/i18n.js +0 -0
  91. /package/build/{components → cjs/components}/icons/ColumnTable.d.ts +0 -0
  92. /package/build/{components → cjs/components}/icons/ColumnTable.js +0 -0
  93. /package/build/{components → cjs/components}/icons/Database.d.ts +0 -0
  94. /package/build/{components → cjs/components}/icons/Database.js +0 -0
  95. /package/build/{components → cjs/components}/icons/ExternalDataSource.d.ts +0 -0
  96. /package/build/{components → cjs/components}/icons/ExternalDataSource.js +0 -0
  97. /package/build/{components → cjs/components}/icons/ExternalTable.d.ts +0 -0
  98. /package/build/{components → cjs/components}/icons/ExternalTable.js +0 -0
  99. /package/build/{components → cjs/components}/icons/Folder.d.ts +0 -0
  100. /package/build/{components → cjs/components}/icons/Folder.js +0 -0
  101. /package/build/{components → cjs/components}/icons/FolderOpen.d.ts +0 -0
  102. /package/build/{components → cjs/components}/icons/FolderOpen.js +0 -0
  103. /package/build/{components → cjs/components}/icons/Index.d.ts +0 -0
  104. /package/build/{components → cjs/components}/icons/Index.js +0 -0
  105. /package/build/{components → cjs/components}/icons/Table.d.ts +0 -0
  106. /package/build/{components → cjs/components}/icons/Table.js +0 -0
  107. /package/build/{components → cjs/components}/icons/Topic.d.ts +0 -0
  108. /package/build/{components → cjs/components}/icons/Topic.js +0 -0
  109. /package/build/{index.d.ts → cjs/index.d.ts} +0 -0
  110. /package/build/{index.js → cjs/index.js} +0 -0
  111. /package/build/{utils → cjs/utils}/configure.d.ts +0 -0
  112. /package/build/{utils → cjs/utils}/configure.js +0 -0
  113. /package/build/{utils → cjs/utils}/index.d.ts +0 -0
  114. /package/build/{utils → cjs/utils}/index.js +0 -0
@@ -0,0 +1,68 @@
1
+ function _createForOfIteratorHelper(o, allowArrayLike) { var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"]; if (!it) { if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e) { throw _e; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = it.call(o); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e2) { didErr = true; err = _e2; }, f: function f() { try { if (!normalCompletion && it["return"] != null) it["return"](); } finally { if (didErr) throw err; } } }; }
2
+
3
+ function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
4
+
5
+ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
6
+
7
+ export function isServiceNode(node) {
8
+ return 'status' in node;
9
+ }
10
+ export function getServiceNode(node, level) {
11
+ if (node.collapsed) {
12
+ return undefined;
13
+ }
14
+
15
+ if (node.loading) {
16
+ return {
17
+ path: node.path,
18
+ status: 'loading',
19
+ level: level + 1
20
+ };
21
+ }
22
+
23
+ if (node.error) {
24
+ return {
25
+ path: node.path,
26
+ status: 'error',
27
+ level: level + 1
28
+ };
29
+ }
30
+
31
+ if (node.loaded && node.children.length === 0) {
32
+ return {
33
+ path: node.path,
34
+ status: 'empty',
35
+ level: level + 1
36
+ };
37
+ }
38
+
39
+ return undefined;
40
+ }
41
+ export function traverseDFS(state, path, visit) {
42
+ var level = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : 0;
43
+ var currentNode = state[path];
44
+
45
+ if (!currentNode) {
46
+ return;
47
+ }
48
+
49
+ visit(currentNode, level, path, state);
50
+
51
+ if (currentNode.collapsed) {
52
+ return;
53
+ }
54
+
55
+ var _iterator = _createForOfIteratorHelper(currentNode.children),
56
+ _step;
57
+
58
+ try {
59
+ for (_iterator.s(); !(_step = _iterator.n()).done;) {
60
+ var childPath = _step.value;
61
+ traverseDFS(state, "".concat(path, "/").concat(childPath), visit, level + 1);
62
+ }
63
+ } catch (err) {
64
+ _iterator.e(err);
65
+ } finally {
66
+ _iterator.f();
67
+ }
68
+ }
@@ -0,0 +1,90 @@
1
+ .ydb-tree-view {
2
+ --ydb-tree-view-level: 0;
3
+ font-size: 13px;
4
+ line-height: 18px;
5
+ }
6
+ .ydb-tree-view, .ydb-tree-view * {
7
+ box-sizing: border-box;
8
+ }
9
+ .ydb-tree-view__item {
10
+ display: flex;
11
+ align-items: center;
12
+ height: 24px;
13
+ padding-left: calc(24px * var(--ydb-tree-view-level));
14
+ padding-right: 3px;
15
+ border-bottom: 1px solid var(--yc-color-line-solid);
16
+ cursor: pointer;
17
+ }
18
+ .ydb-tree-view__item:hover {
19
+ background-color: var(--yc-color-base-simple-hover);
20
+ }
21
+ .ydb-tree-view__item:hover .ydb-tree-view__actions {
22
+ display: flex;
23
+ }
24
+ .ydb-tree-view__item_active {
25
+ font-weight: bold;
26
+ background-color: var(--yc-color-base-selection);
27
+ }
28
+ .ydb-tree-view__item_active:hover {
29
+ background-color: var(--yc-color-base-selection-hover);
30
+ }
31
+ .ydb-tree-view__content {
32
+ flex-grow: 1;
33
+ display: flex;
34
+ align-items: center;
35
+ overflow: hidden;
36
+ }
37
+ .ydb-tree-view__icon {
38
+ flex-shrink: 0;
39
+ display: flex;
40
+ align-items: center;
41
+ justify-content: center;
42
+ width: 24px;
43
+ height: 24px;
44
+ color: var(--yc-color-text-hint);
45
+ }
46
+ .ydb-tree-view__icon svg {
47
+ display: block;
48
+ }
49
+ .ydb-tree-view__text {
50
+ flex-grow: 1;
51
+ white-space: nowrap;
52
+ overflow: hidden;
53
+ text-overflow: ellipsis;
54
+ }
55
+ .ydb-tree-view__actions {
56
+ display: none;
57
+ margin-left: 6px;
58
+ align-items: center;
59
+ }
60
+ .ydb-tree-view .tree-view_arrow {
61
+ flex-shrink: 0;
62
+ width: 24px;
63
+ height: 24px;
64
+ cursor: pointer;
65
+ background: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 6 12" width="6" height="12"><path d="M0.192529 10.7483C-0.0845649 11.0562 -0.0596061 11.5304 0.248276 11.8075C0.556159 12.0846 1.03038 12.0596 1.30747 11.7517L0.192529 10.7483ZM5.25 6.25L5.80747 6.75172C6.06418 6.46649 6.06418 6.0335 5.80747 5.74828L5.25 6.25ZM1.30747 0.748277C1.03038 0.440394 0.556159 0.415435 0.248276 0.69253C-0.0596065 0.969624 -0.0845653 1.44384 0.192529 1.75172L1.30747 0.748277ZM1.30747 11.7517L5.80747 6.75172L4.69253 5.74828L0.192529 10.7483L1.30747 11.7517ZM5.80747 5.74828L1.30747 0.748277L0.192529 1.75172L4.69253 6.75172L5.80747 5.74828Z" fill="rgba(0, 0, 0, 0.85)"/></svg>') no-repeat center center;
66
+ }
67
+ .yc-root_theme_dark .ydb-tree-view .tree-view_arrow {
68
+ background: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 6 12" width="6" height="12"><path d="M0.192529 10.7483C-0.0845649 11.0562 -0.0596061 11.5304 0.248276 11.8075C0.556159 12.0846 1.03038 12.0596 1.30747 11.7517L0.192529 10.7483ZM5.25 6.25L5.80747 6.75172C6.06418 6.46649 6.06418 6.0335 5.80747 5.74828L5.25 6.25ZM1.30747 0.748277C1.03038 0.440394 0.556159 0.415435 0.248276 0.69253C-0.0596065 0.969624 -0.0845653 1.44384 0.192529 1.75172L1.30747 0.748277ZM1.30747 11.7517L5.80747 6.75172L4.69253 5.74828L0.192529 10.7483L1.30747 11.7517ZM5.80747 5.74828L1.30747 0.748277L0.192529 1.75172L4.69253 6.75172L5.80747 5.74828Z" fill="rgba(255, 255, 255, 0.85)"/></svg>') no-repeat center center;
69
+ }
70
+ .ydb-tree-view .tree-view_arrow:not(.tree-view_arrow-collapsed) {
71
+ transform: rotate(90deg);
72
+ }
73
+ .ydb-tree-view_no-arrow .tree-view_arrow {
74
+ visibility: hidden;
75
+ }
76
+ .ydb-tree-view .ydb-tree-view .ydb-tree-view__item {
77
+ padding-left: calc(24px * 1);
78
+ }
79
+ .ydb-tree-view .ydb-tree-view .ydb-tree-view .ydb-tree-view__item {
80
+ padding-left: calc(24px * 2);
81
+ }
82
+ .ydb-tree-view .ydb-tree-view .ydb-tree-view .ydb-tree-view .ydb-tree-view__item {
83
+ padding-left: calc(24px * 3);
84
+ }
85
+ .ydb-tree-view .ydb-tree-view .ydb-tree-view .ydb-tree-view .ydb-tree-view .ydb-tree-view__item {
86
+ padding-left: calc(24px * 4);
87
+ }
88
+ .ydb-tree-view .ydb-tree-view .ydb-tree-view .ydb-tree-view .ydb-tree-view .ydb-tree-view .ydb-tree-view__item {
89
+ padding-left: calc(24px * 5);
90
+ }
@@ -0,0 +1,18 @@
1
+ import React from 'react';
2
+ import { DropdownMenuItemMixed } from '@gravity-ui/uikit';
3
+ import './TreeView.scss';
4
+ export interface TreeViewProps {
5
+ children?: React.ReactNode;
6
+ name: React.ReactNode;
7
+ title?: string;
8
+ icon?: React.ReactNode;
9
+ collapsed?: boolean;
10
+ active?: boolean;
11
+ onClick?: () => void;
12
+ onArrowClick?: () => void;
13
+ hasArrow?: boolean;
14
+ actions?: DropdownMenuItemMixed<any>[];
15
+ additionalNodeElements?: JSX.Element;
16
+ level?: number;
17
+ }
18
+ export declare function TreeView({ children, name, title, icon, collapsed, active, onClick, onArrowClick, hasArrow, actions, additionalNodeElements, level, }: TreeViewProps): JSX.Element;
@@ -0,0 +1,86 @@
1
+ function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
2
+
3
+ import React from 'react';
4
+ import block from 'bem-cn-lite';
5
+ import ReactTreeView from 'react-treeview';
6
+ import { DropdownMenu } from '@gravity-ui/uikit';
7
+ import './TreeView.css';
8
+ var TREE_LEVEL_CSS_VAR = '--ydb-tree-view-level';
9
+ var b = block('ydb-tree-view');
10
+ export function TreeView(_ref) {
11
+ var children = _ref.children,
12
+ name = _ref.name,
13
+ title = _ref.title,
14
+ icon = _ref.icon,
15
+ _ref$collapsed = _ref.collapsed,
16
+ collapsed = _ref$collapsed === void 0 ? true : _ref$collapsed,
17
+ _ref$active = _ref.active,
18
+ active = _ref$active === void 0 ? false : _ref$active,
19
+ onClick = _ref.onClick,
20
+ onArrowClick = _ref.onArrowClick,
21
+ _ref$hasArrow = _ref.hasArrow,
22
+ hasArrow = _ref$hasArrow === void 0 ? false : _ref$hasArrow,
23
+ actions = _ref.actions,
24
+ additionalNodeElements = _ref.additionalNodeElements,
25
+ level = _ref.level;
26
+ var rootRef = React.useRef(null);
27
+ var nodeLabel = /*#__PURE__*/React.createElement("div", {
28
+ className: b('content')
29
+ }, icon && /*#__PURE__*/React.createElement("div", {
30
+ className: b('icon')
31
+ }, icon), /*#__PURE__*/React.createElement("div", {
32
+ className: b('text'),
33
+ title: title
34
+ }, name), actions && actions.length > 0 && /*#__PURE__*/React.createElement("div", {
35
+ className: b('actions')
36
+ }, additionalNodeElements, /*#__PURE__*/React.createElement(DropdownMenu, {
37
+ defaultSwitcherProps: {
38
+ view: 'flat-secondary',
39
+ size: 's',
40
+ pin: 'brick-brick'
41
+ },
42
+ items: actions
43
+ })));
44
+ React.useEffect(function () {
45
+ var rootEl = rootRef.current;
46
+ var itemEl = rootEl && rootEl.querySelector(".".concat(b('item')));
47
+
48
+ if (!onClick || !itemEl) {
49
+ return;
50
+ }
51
+
52
+ var skipClicksSelector = ".tree-view_arrow, .".concat(b('actions'));
53
+
54
+ function handleClick(event) {
55
+ var path = event.composedPath().filter(function (item) {
56
+ return item.nodeType === Node.ELEMENT_NODE;
57
+ });
58
+ var hasSkipped = path.some(function (el) {
59
+ return el.matches(skipClicksSelector);
60
+ });
61
+
62
+ if (!hasSkipped) {
63
+ onClick();
64
+ }
65
+ }
66
+
67
+ itemEl.addEventListener('click', handleClick);
68
+ return function () {
69
+ itemEl.removeEventListener('click', handleClick);
70
+ };
71
+ }, [onClick]);
72
+ return /*#__PURE__*/React.createElement("div", {
73
+ ref: rootRef,
74
+ className: b({
75
+ 'no-arrow': !hasArrow
76
+ }),
77
+ style: _defineProperty({}, TREE_LEVEL_CSS_VAR, level)
78
+ }, /*#__PURE__*/React.createElement(ReactTreeView, {
79
+ collapsed: collapsed,
80
+ itemClassName: b('item', {
81
+ active: active
82
+ }),
83
+ nodeLabel: nodeLabel,
84
+ onClick: onArrowClick
85
+ }, children));
86
+ }
@@ -0,0 +1 @@
1
+ export * from './TreeView';
@@ -0,0 +1 @@
1
+ export * from './TreeView';
@@ -0,0 +1,2 @@
1
+ import { I18N } from '@gravity-ui/i18n';
2
+ export declare const i18n: I18N;
@@ -0,0 +1,9 @@
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
+ });
@@ -0,0 +1,2 @@
1
+ import React from 'react';
2
+ export declare function ColumnTableIcon(props: React.SVGProps<SVGSVGElement>): JSX.Element;
@@ -0,0 +1,14 @@
1
+ function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
2
+
3
+ import React from 'react';
4
+ export function ColumnTableIcon(props) {
5
+ return /*#__PURE__*/React.createElement("svg", _extends({
6
+ xmlns: "http://www.w3.org/2000/svg",
7
+ viewBox: "0 0 16 16",
8
+ fill: "currentColor"
9
+ }, props), /*#__PURE__*/React.createElement("path", {
10
+ fillRule: "evenodd",
11
+ clipRule: "evenodd",
12
+ d: "M2.01033 3.79551C2.11275 2.787 2.96447 2 4 2H5.5H7H9H10.5H12C13.1046 2 14 2.89543 14 4V5.5V12C14 13.1046 13.1046 14 12 14H10.5H9H7H5.5H4C2.89543 14 2 13.1046 2 12V5.5V4C2 3.93096 2.0035 3.86275 2.01033 3.79551ZM10.5 12.5H11.5C12.0523 12.5 12.5 12.0523 12.5 11.5V5.5H10.5L10.5 12.5ZM9 5.5L9 12.5H7L7 5.5H9ZM3.5 5.5H5.5L5.5 12.5H4.5C3.94772 12.5 3.5 12.0523 3.5 11.5V5.5Z"
13
+ }));
14
+ }
@@ -0,0 +1,2 @@
1
+ import React from 'react';
2
+ export declare function DatabaseIcon(props: React.SVGProps<SVGSVGElement>): JSX.Element;
@@ -0,0 +1,12 @@
1
+ function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
2
+
3
+ import React from 'react';
4
+ export function DatabaseIcon(props) {
5
+ return /*#__PURE__*/React.createElement("svg", _extends({
6
+ xmlns: "http://www.w3.org/2000/svg",
7
+ viewBox: "0 0 448 512",
8
+ fill: "currentColor"
9
+ }, props), /*#__PURE__*/React.createElement("path", {
10
+ d: "M448 80V128C448 172.2 347.7 208 224 208C100.3 208 0 172.2 0 128V80C0 35.82 100.3 0 224 0C347.7 0 448 35.82 448 80zM393.2 214.7C413.1 207.3 433.1 197.8 448 186.1V288C448 332.2 347.7 368 224 368C100.3 368 0 332.2 0 288V186.1C14.93 197.8 34.02 207.3 54.85 214.7C99.66 230.7 159.5 240 224 240C288.5 240 348.3 230.7 393.2 214.7V214.7zM54.85 374.7C99.66 390.7 159.5 400 224 400C288.5 400 348.3 390.7 393.2 374.7C413.1 367.3 433.1 357.8 448 346.1V432C448 476.2 347.7 512 224 512C100.3 512 0 476.2 0 432V346.1C14.93 357.8 34.02 367.3 54.85 374.7z"
11
+ }));
12
+ }
@@ -0,0 +1,2 @@
1
+ import React from 'react';
2
+ export declare function ExternalDataSourceIcon(props: React.SVGProps<SVGSVGElement>): JSX.Element;
@@ -0,0 +1,14 @@
1
+ function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
2
+
3
+ import React from 'react';
4
+ export function ExternalDataSourceIcon(props) {
5
+ return /*#__PURE__*/React.createElement("svg", _extends({
6
+ xmlns: "http://www.w3.org/2000/svg",
7
+ viewBox: "0 0 16 16",
8
+ fill: "currentColor"
9
+ }, props), /*#__PURE__*/React.createElement("path", {
10
+ fillRule: "evenodd",
11
+ clipRule: "evenodd",
12
+ d: "M0 6.75C0 6.35156 0.338542 6 0.722222 6L3.61111 6V3L0.722222 3C0.338542 3 0 2.67188 0 2.25C0 1.85156 0.338542 1.5 0.722222 1.5L3.61111 1.5V0.750001C3.61111 0.351563 3.94965 0 4.33333 0C4.73958 0 5.05556 0.351563 5.05556 0.750001H5.77778C7.53819 0.750001 8.98264 2.03906 9.32118 3.75H12V5.25H9.32118C9.29095 5.4049 9.25189 5.55606 9.20457 5.70291C9.10459 5.73587 9.00778 5.77066 8.9144 5.80723C8.505 5.96755 8.12646 6.17556 7.83841 6.44187C7.5498 6.70871 7.3 7.08678 7.3 7.56255V7.90902C6.83862 8.12843 6.32337 8.25 5.77778 8.25H5.05556C5.05556 8.67188 4.73958 9 4.33333 9C3.94965 9 3.61111 8.67188 3.61111 8.25V7.5L0.722222 7.5C0.338542 7.5 0 7.17188 0 6.75ZM16 8.5V7.5625C16 6.70312 14.1964 6 12 6C9.78571 6 8 6.70312 8 7.5625V8.5C8 9.37891 9.78571 10.0625 12 10.0625C14.1964 10.0625 16 9.37891 16 8.5ZM16 9.65234C15.7321 9.86719 15.375 10.0625 15.0179 10.1992C14.2143 10.5117 13.1429 10.6875 12 10.6875C10.8393 10.6875 9.76786 10.5117 8.96429 10.1992C8.60714 10.0625 8.25 9.86719 8 9.65234V11.625C8 12.5039 9.78571 13.1875 12 13.1875C14.1964 13.1875 16 12.5039 16 11.625V9.65234ZM12 13.8125C10.8393 13.8125 9.76786 13.6367 8.96429 13.3242C8.60714 13.1875 8.25 12.9922 8 12.7773V14.4375C8 15.3164 9.78571 16 12 16C14.1964 16 16 15.3164 16 14.4375V12.7773C15.7321 12.9922 15.375 13.1875 15.0179 13.3242C14.2143 13.6367 13.1429 13.8125 12 13.8125Z"
13
+ }));
14
+ }
@@ -0,0 +1,2 @@
1
+ import React from 'react';
2
+ export declare function ExternalTableIcon(props: React.SVGProps<SVGSVGElement>): JSX.Element;
@@ -0,0 +1,14 @@
1
+ function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
2
+
3
+ import React from 'react';
4
+ export function ExternalTableIcon(props) {
5
+ return /*#__PURE__*/React.createElement("svg", _extends({
6
+ xmlns: "http://www.w3.org/2000/svg",
7
+ viewBox: "0 0 16 16",
8
+ fill: "currentColor"
9
+ }, props), /*#__PURE__*/React.createElement("path", {
10
+ fillRule: "evenodd",
11
+ clipRule: "evenodd",
12
+ d: "M0 6.75C0 6.35156 0.351562 6 0.75 6L3.75 6V3L0.75 3C0.351562 3 0 2.67188 0 2.25C0 1.85156 0.351562 1.5 0.75 1.5L3.75 1.5V0.750001C3.75 0.351563 4.10156 0 4.5 0C4.92188 0 5.25 0.351563 5.25 0.750001H6C7.82812 0.750001 9.32812 2.03906 9.67969 3.75H12V5.25H9.67969C9.60376 5.62455 9.47428 5.97724 9.2995 6.30005H7.19969C6.09701 6.30005 5.26846 7.20143 5.25 8.25C5.25 8.67188 4.92188 9 4.5 9C4.10156 9 3.75 8.67188 3.75 8.25V7.5L0.75 7.5C0.351562 7.5 0 7.17188 0 6.75ZM16 8.28571C16 7.58259 15.4336 7 14.75 7H7.25C6.54688 7 6 7.58259 6 8.28571V14.7143C6 15.4375 6.54688 16 7.25 16H14.75C15.4336 16 16 15.4375 16 14.7143V8.28571ZM10.375 9.57143V11.5H7.25V9.57143H10.375ZM7.25 14.7143V12.7857H10.375V14.7143H7.25ZM14.75 14.7143H11.625V12.7857H14.75V14.7143ZM14.75 9.57143V11.5H11.625V9.57143H14.75Z"
13
+ }));
14
+ }
@@ -0,0 +1,2 @@
1
+ import React from 'react';
2
+ export declare function FolderIcon(props: React.SVGProps<SVGSVGElement>): JSX.Element;
@@ -0,0 +1,12 @@
1
+ function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
2
+
3
+ import React from 'react';
4
+ export function FolderIcon(props) {
5
+ return /*#__PURE__*/React.createElement("svg", _extends({
6
+ xmlns: "http://www.w3.org/2000/svg",
7
+ viewBox: "0 0 16 16",
8
+ fill: "currentColor"
9
+ }, props), /*#__PURE__*/React.createElement("path", {
10
+ d: "M13.2812 4.875H8.40625L6.78125 3.25H2.71875C2.0332 3.25 1.5 3.80859 1.5 4.46875V11.7812C1.5 12.4668 2.0332 13 2.71875 13H13.2812C13.9414 13 14.5 12.4668 14.5 11.7812V6.09375C14.5 5.43359 13.9414 4.875 13.2812 4.875Z"
11
+ }));
12
+ }
@@ -0,0 +1,2 @@
1
+ import React from 'react';
2
+ export declare function FolderOpenIcon(props: React.SVGProps<SVGSVGElement>): JSX.Element;
@@ -0,0 +1,12 @@
1
+ function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
2
+
3
+ import React from 'react';
4
+ export function FolderOpenIcon(props) {
5
+ return /*#__PURE__*/React.createElement("svg", _extends({
6
+ xmlns: "http://www.w3.org/2000/svg",
7
+ viewBox: "0 0 16 16",
8
+ fill: "currentColor"
9
+ }, props), /*#__PURE__*/React.createElement("path", {
10
+ d: "M15.2109 9.06445C15.4648 8.6582 15.1602 8.125 14.6777 8.125H4.54688C4.01367 8.125 3.37891 8.50586 3.125 8.9375L1.29688 12.0859C1.04297 12.4922 1.34766 13 1.83008 13H11.9609C12.4941 13 13.1289 12.6445 13.3828 12.2129L15.2109 9.06445ZM4.54688 7.3125H12.875V6.09375C12.875 5.43359 12.3164 4.875 11.6562 4.875H7.59375L5.96875 3.25H1.90625C1.2207 3.25 0.6875 3.80859 0.6875 4.46875V11.5527L2.43945 8.53125C2.87109 7.79492 3.6582 7.3125 4.54688 7.3125Z"
11
+ }));
12
+ }
@@ -0,0 +1,2 @@
1
+ import React from 'react';
2
+ export declare function IndexIcon(props: React.SVGProps<SVGSVGElement>): JSX.Element;
@@ -0,0 +1,14 @@
1
+ function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
2
+
3
+ import React from 'react';
4
+ export function IndexIcon(props) {
5
+ return /*#__PURE__*/React.createElement("svg", _extends({
6
+ xmlns: "http://www.w3.org/2000/svg",
7
+ viewBox: "0 0 16 16",
8
+ fill: "currentColor"
9
+ }, props), /*#__PURE__*/React.createElement("path", {
10
+ fillRule: "evenodd",
11
+ clipRule: "evenodd",
12
+ d: "M9.24935 2.94323L8.5 9.5H12.1L11.1446 14.2772C11.0322 14.839 11.7994 15.1177 12.0738 14.6147L15.9111 7.57956C16.1765 7.09311 15.8244 6.5 15.2703 6.5H12.9L13.5325 3.33728C13.6192 2.90413 13.2879 2.5 12.8461 2.5H9.74611C9.49194 2.5 9.27821 2.69069 9.24935 2.94323ZM7.40003 10.5L8.25717 3H1.625C0.710938 3 0 3.73633 0 4.625V12.75C0 13.6641 0.710938 14.375 1.625 14.375H10.1517C10.1538 14.2803 10.1646 14.1822 10.1848 14.0811L10.901 10.5H7.40003ZM5.6875 8.6875V6.25H1.625V8.6875H5.6875ZM1.625 10.3125V12.75H5.6875V10.3125H1.625Z"
13
+ }));
14
+ }
@@ -0,0 +1,2 @@
1
+ import React from 'react';
2
+ export declare function TableIcon(props: React.SVGProps<SVGSVGElement>): JSX.Element;
@@ -0,0 +1,14 @@
1
+ function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
2
+
3
+ import React from 'react';
4
+ export function TableIcon(props) {
5
+ return /*#__PURE__*/React.createElement("svg", _extends({
6
+ xmlns: "http://www.w3.org/2000/svg",
7
+ viewBox: "0 0 16 16",
8
+ fill: "currentColor"
9
+ }, props), /*#__PURE__*/React.createElement("path", {
10
+ fillRule: "evenodd",
11
+ clipRule: "evenodd",
12
+ d: "M2.01033 3.79551C2.11275 2.787 2.96447 2 4 2H7.3H8.8H12C13.1046 2 14 2.89543 14 4V5.5V8.2002V9.7002V12C14 13.1046 13.1046 14 12 14H8.8H7.3H4C2.89543 14 2 13.1046 2 12V9.7002V8.2002V5.5V4C2 3.93096 2.0035 3.86275 2.01033 3.79551ZM8.8 12.5H11.5C12.0523 12.5 12.5 12.0523 12.5 11.5V9.7002H8.8V12.5ZM7.3 9.7002V12.5H4.5C3.94772 12.5 3.5 12.0523 3.5 11.5V9.7002H7.3ZM8.8 8.2002H12.5V5.5H8.8L8.8 8.2002ZM7.3 5.5L7.3 8.2002H3.5V5.5H7.3Z"
13
+ }));
14
+ }
@@ -0,0 +1,2 @@
1
+ import React from 'react';
2
+ export declare function TopicIcon(props: React.SVGProps<SVGSVGElement>): JSX.Element;
@@ -0,0 +1,28 @@
1
+ function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
2
+
3
+ import React from 'react';
4
+ export function TopicIcon(props) {
5
+ return /*#__PURE__*/React.createElement("svg", _extends({
6
+ xmlns: "http://www.w3.org/2000/svg",
7
+ viewBox: "0 0 16 16",
8
+ fill: "currentColor"
9
+ }, props), /*#__PURE__*/React.createElement("rect", {
10
+ x: "2",
11
+ y: "2.20001",
12
+ width: "9",
13
+ height: "2.5",
14
+ rx: "0.5"
15
+ }), /*#__PURE__*/React.createElement("rect", {
16
+ x: "5",
17
+ y: "6.70001",
18
+ width: "9",
19
+ height: "2.5",
20
+ rx: "0.5"
21
+ }), /*#__PURE__*/React.createElement("rect", {
22
+ x: "2",
23
+ y: "11.2",
24
+ width: "9",
25
+ height: "2.5",
26
+ rx: "0.5"
27
+ }));
28
+ }
@@ -0,0 +1,3 @@
1
+ export * from './components/NavigationTree';
2
+ export * from './components/TreeView';
3
+ export * from './utils';
@@ -0,0 +1,3 @@
1
+ export * from './components/NavigationTree';
2
+ export * from './components/TreeView';
3
+ export * from './utils';
@@ -0,0 +1,12 @@
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 {};
@@ -0,0 +1,26 @@
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
+ };
@@ -0,0 +1 @@
1
+ export { configure, Lang } from './configure';
@@ -0,0 +1 @@
1
+ export { configure, Lang } from './configure';
package/package.json CHANGED
@@ -1,10 +1,18 @@
1
1
  {
2
2
  "name": "ydb-ui-components",
3
- "version": "3.3.0",
3
+ "version": "3.4.0",
4
4
  "description": "",
5
5
  "license": "MIT",
6
- "main": "build/index.js",
7
- "types": "build/index.d.ts",
6
+ "exports": {
7
+ ".": {
8
+ "types": "./build/esm/index.d.ts",
9
+ "require": "./build/cjs/index.js",
10
+ "import": "./build/esm/index.js"
11
+ }
12
+ },
13
+ "main": "./build/cjs/index.js",
14
+ "module": "./build/esm/index.js",
15
+ "types": "./build/esm/index.d.ts",
8
16
  "sideEffects": [
9
17
  "*.css",
10
18
  "*.scss"
File without changes