@gravity-ui/navigation 0.15.0 → 0.17.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 +17 -1
- package/build/cjs/components/AsideHeader/AsideHeader.d.ts +4 -2
- package/build/cjs/components/AsideHeader/i18n/index.d.ts +2 -0
- package/build/cjs/components/CompositeBar/CompositeBar.d.ts +2 -2
- package/build/cjs/components/CompositeBar/HighlightedItem/HighlightedItem.d.ts +12 -0
- package/build/cjs/components/CompositeBar/Item/Item.d.ts +3 -0
- package/build/cjs/components/CompositeBar/constants.d.ts +0 -1
- package/build/cjs/components/CompositeBar/utils.d.ts +2 -2
- package/build/cjs/components/MobileHeader/Burger/Burger.d.ts +5 -2
- package/build/cjs/components/MobileHeader/MobileHeader.d.ts +2 -0
- package/build/cjs/components/MobileHeader/i18n/index.d.ts +2 -0
- package/build/cjs/components/Settings/Settings.d.ts +4 -7
- package/build/cjs/components/Settings/i18n/index.d.ts +2 -0
- package/build/cjs/components/Title/Title.d.ts +1 -3
- package/build/cjs/components/Title/i18n/index.d.ts +2 -0
- package/build/cjs/components/constants.d.ts +1 -8
- package/build/cjs/components/index.d.ts +1 -0
- package/build/cjs/components/types.d.ts +0 -10
- package/build/cjs/components/utils/cn.d.ts +3 -3
- package/build/cjs/components/utils/registerKeyset.d.ts +5 -0
- package/build/cjs/i18n.d.ts +2 -0
- package/build/cjs/index.js +1346 -1085
- package/build/cjs/index.js.map +1 -1
- package/build/esm/components/AsideHeader/AsideHeader.d.ts +4 -2
- package/build/esm/components/AsideHeader/i18n/index.d.ts +2 -0
- package/build/esm/components/CompositeBar/CompositeBar.d.ts +2 -2
- package/build/esm/components/CompositeBar/HighlightedItem/HighlightedItem.d.ts +12 -0
- package/build/esm/components/CompositeBar/Item/Item.d.ts +3 -0
- package/build/esm/components/CompositeBar/constants.d.ts +0 -1
- package/build/esm/components/CompositeBar/utils.d.ts +2 -2
- package/build/esm/components/MobileHeader/Burger/Burger.d.ts +5 -2
- package/build/esm/components/MobileHeader/MobileHeader.d.ts +2 -0
- package/build/esm/components/MobileHeader/i18n/index.d.ts +2 -0
- package/build/esm/components/Settings/Settings.d.ts +4 -7
- package/build/esm/components/Settings/i18n/index.d.ts +2 -0
- package/build/esm/components/Title/Title.d.ts +1 -3
- package/build/esm/components/Title/i18n/index.d.ts +2 -0
- package/build/esm/components/constants.d.ts +1 -8
- package/build/esm/components/index.d.ts +1 -0
- package/build/esm/components/types.d.ts +0 -10
- package/build/esm/components/utils/cn.d.ts +3 -3
- package/build/esm/components/utils/registerKeyset.d.ts +5 -0
- package/build/esm/i18n.d.ts +2 -0
- package/build/esm/index.js +1272 -1012
- package/build/esm/index.js.map +1 -1
- package/package.json +4 -1
package/build/cjs/index.js
CHANGED
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
5
|
var React = require('react');
|
|
6
|
+
var classname = require('@bem-react/classname');
|
|
6
7
|
var uikit = require('@gravity-ui/uikit');
|
|
7
8
|
var ReactDOM = require('react-dom');
|
|
8
9
|
var icons = require('@gravity-ui/icons');
|
|
@@ -10,112 +11,34 @@ var icons = require('@gravity-ui/icons');
|
|
|
10
11
|
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
11
12
|
|
|
12
13
|
function _interopNamespace(e) {
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
14
|
+
if (e && e.__esModule) return e;
|
|
15
|
+
var n = Object.create(null);
|
|
16
|
+
if (e) {
|
|
17
|
+
Object.keys(e).forEach(function (k) {
|
|
18
|
+
if (k !== 'default') {
|
|
19
|
+
var d = Object.getOwnPropertyDescriptor(e, k);
|
|
20
|
+
Object.defineProperty(n, k, d.get ? d : {
|
|
21
|
+
enumerable: true,
|
|
22
|
+
get: function () { return e[k]; }
|
|
23
|
+
});
|
|
24
|
+
}
|
|
25
|
+
});
|
|
26
|
+
}
|
|
27
|
+
n["default"] = e;
|
|
28
|
+
return Object.freeze(n);
|
|
28
29
|
}
|
|
29
30
|
|
|
30
31
|
var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
|
|
31
32
|
var React__namespace = /*#__PURE__*/_interopNamespace(React);
|
|
32
33
|
var ReactDOM__default = /*#__PURE__*/_interopDefaultLegacy(ReactDOM);
|
|
33
34
|
|
|
34
|
-
var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};
|
|
35
|
-
|
|
36
|
-
var lib$1 = {};
|
|
37
|
-
|
|
38
|
-
var lib = {exports: {}};
|
|
39
|
-
|
|
40
|
-
/*!
|
|
41
|
-
* bem-cn v3.0.1
|
|
42
|
-
* Friendly BEM class names generator, greate for React
|
|
43
|
-
* @author Alexander Burtsev, https://github.com/albburtsev
|
|
44
|
-
*/
|
|
45
|
-
|
|
46
|
-
(function (module, exports) {
|
|
47
|
-
!function(n,t){module.exports=t();}(commonjsGlobal,function(){return function(n){var t={};function e(r){if(t[r])return t[r].exports;var o=t[r]={i:r,l:!1,exports:{}};return n[r].call(o.exports,o,o.exports,e),o.l=!0,o.exports}return e.m=n,e.c=t,e.d=function(n,t,r){e.o(n,t)||Object.defineProperty(n,t,{enumerable:!0,get:r});},e.r=function(n){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(n,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(n,"__esModule",{value:!0});},e.t=function(n,t){if(1&t&&(n=e(n)),8&t)return n;if(4&t&&"object"==typeof n&&n&&n.__esModule)return n;var r=Object.create(null);if(e.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:n}),2&t&&"string"!=typeof n)for(var o in n)e.d(r,o,function(t){return n[t]}.bind(null,o));return r},e.n=function(n){var t=n&&n.__esModule?function(){return n.default}:function(){return n};return e.d(t,"a",t),t},e.o=function(n,t){return Object.prototype.hasOwnProperty.call(n,t)},e.p="",e(e.s=0)}([function(n,t,e){Object.defineProperty(t,"__esModule",{value:!0});var r=e(1);t.ERROR_BLOCK_NAME_TYPE="Block name should be a string",t.ERROR_BLOCK_NAME_EMPTY="Block name should be non-empty";var o={ns:"",el:"__",mod:"_",modValue:"_"},i=function(n){return "string"==typeof n},u=function(n){return "string"!=typeof n},s=function(n,t){for(var e=[],o=2;o<arguments.length;o++)e[o-2]=arguments[o];var i=r.assign({},t);return i.mixes=i.mixes.concat(e),c(i,n)},a=function(n,t,e){for(var o=[],i=3;i<arguments.length;i++)o[i-3]=arguments[i];var u=r.assign({},t),s=r.assign({},u.states||{});return s[e]=r.assign.apply(void 0,[{},s[e]||{}].concat(o)),u.states=s,c(u,n)},l=function(n,t,e,r){return String.prototype.split.call(f(n,t),e,r)},f=function(n,t){var e=t.name,r=t.mods,o=t.mixes,i=t.states,u=[e];if(r&&(u=u.concat(Object.keys(r).filter(function(n){return r[n]}).map(function(t){var o=r[t];return !0===o?e+n.mod+t:e+n.mod+t+n.modValue+o}))),i&&Object.keys(i).forEach(function(n){var t=i[n];u=u.concat(Object.keys(t).filter(function(n){return t[n]}).map(function(t){return n+t}));}),n.ns&&(u=u.map(function(t){return n.ns+t})),o&&(u=u.concat(function(n){return void 0===n&&(n=[]),n.map(function(n){return Array.isArray(n)?n.join(" "):"object"==typeof n&&null!==n?n.toString():"function"==typeof n?n.toString():"string"==typeof n?n:""}).filter(function(n){return !!n})}(o))),n.classMap){var s=n.classMap;u=u.map(function(n){return s[n]||n});}return u.join(" ")},c=function(n,t){return {mix:s.bind(null,t,n),split:l.bind(null,t,n),is:a.bind(null,t,n,"is-"),has:a.bind(null,t,n,"has-"),state:a.bind(null,t,n,"is-"),toString:f.bind(null,t,n)}},d=function(n,t){var e={name:n,mods:{},mixes:[],states:{"is-":{},"has-":{}}},o=function(n,t){for(var e=[],o=2;o<arguments.length;o++)e[o-2]=arguments[o];if(!e.length)return f(n,t);var s=r.assign({},t),a=e.filter(i).reduce(function(t,e){return t+n.el+e},"");a&&(s.name=s.name+a);var l=e.filter(u).reduce(function(n,t){return r.assign(n,t)},{});return s.mods=r.assign({},s.mods,l),c(s,n)}.bind(null,t,e);return o.mix=s.bind(null,t,e),o.split=l.bind(null,t,e),o.is=a.bind(null,t,e,"is-"),o.has=a.bind(null,t,e,"has-"),o.state=a.bind(null,t,e,"is-"),o.toString=f.bind(null,t,e),o};t.setup=function(n){return void 0===n&&(n={}),function(e){if("string"!=typeof e)throw new Error(t.ERROR_BLOCK_NAME_TYPE);var i=e.trim();if(!i)throw new Error(t.ERROR_BLOCK_NAME_EMPTY);return d(i,r.assign({},o,n))}},t.block=t.setup(),t.default=t.block;},function(n,t,e){Object.defineProperty(t,"__esModule",{value:!0}),t.assign=function(n){for(var t=[],e=1;e<arguments.length;e++)t[e-1]=arguments[e];for(var r=0;r<t.length;r++){var o=t[r];for(var i in o)o.hasOwnProperty(i)&&(n[i]=o[i]);}return n};}])});
|
|
48
|
-
} (lib));
|
|
49
|
-
|
|
50
|
-
Object.defineProperty(lib$1, "__esModule", { value: true });
|
|
51
|
-
var bem_cn_1 = lib.exports;
|
|
52
|
-
var block$1 = (0, bem_cn_1.setup)();
|
|
53
|
-
function isString(data) {
|
|
54
|
-
return typeof data === 'string';
|
|
55
|
-
}
|
|
56
|
-
function hasMixinShape(data) {
|
|
57
|
-
return isString(data) || (Array.isArray(data) && data.every(isString));
|
|
58
|
-
}
|
|
59
|
-
function bemClassNameLite(blockName) {
|
|
60
|
-
var b = block$1(blockName);
|
|
61
|
-
function element() {
|
|
62
|
-
var args = [];
|
|
63
|
-
for (var _i = 0; _i < arguments.length; _i++) {
|
|
64
|
-
args[_i] = arguments[_i];
|
|
65
|
-
}
|
|
66
|
-
var elementName = args.shift();
|
|
67
|
-
var modifiers = args[0], mixin = args[1];
|
|
68
|
-
var result;
|
|
69
|
-
if (typeof elementName !== 'string' || hasMixinShape(modifiers)) {
|
|
70
|
-
mixin = modifiers;
|
|
71
|
-
modifiers = null;
|
|
72
|
-
}
|
|
73
|
-
result = b(elementName, modifiers);
|
|
74
|
-
if (mixin) {
|
|
75
|
-
result = result.mix(mixin);
|
|
76
|
-
}
|
|
77
|
-
return result.toString();
|
|
78
|
-
}
|
|
79
|
-
element.builder = function () {
|
|
80
|
-
return b;
|
|
81
|
-
};
|
|
82
|
-
return element;
|
|
83
|
-
}
|
|
84
|
-
bemClassNameLite.setup = function (config) {
|
|
85
|
-
block$1 = (0, bem_cn_1.setup)(config);
|
|
86
|
-
};
|
|
87
|
-
bemClassNameLite.reset = function () {
|
|
88
|
-
block$1 = (0, bem_cn_1.setup)();
|
|
89
|
-
};
|
|
90
|
-
var _default = lib$1.default = bemClassNameLite;
|
|
91
|
-
|
|
92
35
|
const NAMESPACE = 'gn-';
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
}
|
|
36
|
+
classname.withNaming({ e: '__', m: '_' });
|
|
37
|
+
const block = classname.withNaming({ n: NAMESPACE, e: '__', m: '_' });
|
|
96
38
|
|
|
97
|
-
|
|
98
|
-
(function (MobileHeaderDict) {
|
|
99
|
-
MobileHeaderDict["CloseBurger"] = "button_close-burger";
|
|
100
|
-
MobileHeaderDict["OpenBurger"] = "button_open-burger";
|
|
101
|
-
})(exports.MobileHeaderDict || (exports.MobileHeaderDict = {}));
|
|
102
|
-
exports.Dict = void 0;
|
|
103
|
-
(function (Dict) {
|
|
104
|
-
Dict["ExpandButton"] = "button_expand";
|
|
105
|
-
Dict["CollapseButton"] = "button_collapse";
|
|
106
|
-
Dict["MoreButton"] = "button_more";
|
|
107
|
-
})(exports.Dict || (exports.Dict = {}));
|
|
108
|
-
|
|
109
|
-
const ASIDE_HEADER_FOOTER_ICON_SIZE = 20;
|
|
39
|
+
const ASIDE_HEADER_ICON_SIZE = 18;
|
|
110
40
|
const ASIDE_HEADER_COMPACT_WIDTH = 56;
|
|
111
41
|
const ASIDE_HEADER_EXPANDED_WIDTH = 236;
|
|
112
|
-
const defaultDict$2 = {
|
|
113
|
-
[exports.Dict.CollapseButton]: 'Collapse',
|
|
114
|
-
[exports.Dict.ExpandButton]: 'Expand',
|
|
115
|
-
[exports.Dict.MoreButton]: 'More',
|
|
116
|
-
[exports.MobileHeaderDict.CloseBurger]: 'Close menu',
|
|
117
|
-
[exports.MobileHeaderDict.OpenBurger]: 'Open menu',
|
|
118
|
-
};
|
|
119
42
|
|
|
120
43
|
function _extends$2() {
|
|
121
44
|
_extends$2 = Object.assign ? Object.assign.bind() : function (target) {
|
|
@@ -159,6 +82,8 @@ function _inheritsLoose(subClass, superClass) {
|
|
|
159
82
|
_setPrototypeOf(subClass, superClass);
|
|
160
83
|
}
|
|
161
84
|
|
|
85
|
+
var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};
|
|
86
|
+
|
|
162
87
|
var propTypes = {exports: {}};
|
|
163
88
|
|
|
164
89
|
var reactIs = {exports: {}};
|
|
@@ -1384,7 +1309,7 @@ function removeClass$1(element, className) {
|
|
|
1384
1309
|
}
|
|
1385
1310
|
}
|
|
1386
1311
|
|
|
1387
|
-
var config = {
|
|
1312
|
+
var config$1 = {
|
|
1388
1313
|
disabled: false
|
|
1389
1314
|
};
|
|
1390
1315
|
|
|
@@ -1664,7 +1589,7 @@ var Transition = /*#__PURE__*/function (_React$Component) {
|
|
|
1664
1589
|
var enterTimeout = appearing ? timeouts.appear : timeouts.enter; // no enter animation skip right to ENTERED
|
|
1665
1590
|
// if we are mounting and running this it means appear _must_ be set
|
|
1666
1591
|
|
|
1667
|
-
if (!mounting && !enter || config.disabled) {
|
|
1592
|
+
if (!mounting && !enter || config$1.disabled) {
|
|
1668
1593
|
this.safeSetState({
|
|
1669
1594
|
status: ENTERED
|
|
1670
1595
|
}, function () {
|
|
@@ -1696,7 +1621,7 @@ var Transition = /*#__PURE__*/function (_React$Component) {
|
|
|
1696
1621
|
var timeouts = this.getTimeouts();
|
|
1697
1622
|
var maybeNode = this.props.nodeRef ? undefined : ReactDOM__default["default"].findDOMNode(this); // no exit animation skip right to EXITED
|
|
1698
1623
|
|
|
1699
|
-
if (!exit || config.disabled) {
|
|
1624
|
+
if (!exit || config$1.disabled) {
|
|
1700
1625
|
this.safeSetState({
|
|
1701
1626
|
status: EXITED
|
|
1702
1627
|
}, function () {
|
|
@@ -3163,15 +3088,15 @@ function styleInject(css, ref) {
|
|
|
3163
3088
|
}
|
|
3164
3089
|
}
|
|
3165
3090
|
|
|
3166
|
-
var css_248z$
|
|
3167
|
-
styleInject(css_248z$
|
|
3091
|
+
var css_248z$n = ".gn-drawer__item {\n position: absolute;\n left: 0;\n top: 0;\n bottom: 0;\n height: 100%;\n will-change: transform;\n background-color: var(--g-color-base-background);\n}\n.gn-drawer__item_direction_right {\n left: auto;\n right: 0;\n}\n.gn-drawer__item-transition-enter {\n transform: translate(-100%, 0);\n}\n.gn-drawer__item-transition_direction_right-enter {\n transform: translate(100%, 0);\n}\n.gn-drawer__item-transition-enter-active, .gn-drawer__item-transition_direction_right-enter-active {\n transform: translate(0, 0);\n transition: transform 300ms;\n}\n.gn-drawer__item-transition-enter-done, .gn-drawer__item-transition_direction_right-enter-done {\n filter: blur(0px);\n transform: translateZ(0);\n}\n.gn-drawer__item-transition-exit, .gn-drawer__item-transition_direction_right-exit {\n transform: translate(0, 0);\n}\n.gn-drawer__item-transition-exit-active, .gn-drawer__item-transition_direction_right-exit-active {\n transition: transform 300ms;\n}\n.gn-drawer__item-transition-exit-active {\n transform: translate(-100%, 0);\n}\n.gn-drawer__item-transition_direction_right-exit-active {\n transform: translate(100%, 0);\n}\n.gn-drawer__item-transition-exit-done, .gn-drawer__item-transition_direction_right-exit-done {\n visibility: hidden;\n}\n.gn-drawer__veil {\n position: absolute;\n left: 0;\n right: 0;\n bottom: 0;\n top: 0;\n background-color: var(--g-color-sfx-veil);\n}\n.gn-drawer__veil-transition-enter {\n opacity: 0;\n}\n.gn-drawer__veil-transition-enter-active {\n opacity: 1;\n transition: opacity 300ms;\n}\n.gn-drawer__veil-transition-exit {\n opacity: 1;\n}\n.gn-drawer__veil-transition-exit-active {\n opacity: 0;\n transition: opacity 300ms;\n}\n.gn-drawer__veil-transition-exit-done {\n visibility: hidden;\n}";
|
|
3092
|
+
styleInject(css_248z$n);
|
|
3168
3093
|
|
|
3169
|
-
const b$
|
|
3094
|
+
const b$o = block('drawer');
|
|
3170
3095
|
const TIMEOUT = 300;
|
|
3171
3096
|
const DrawerItem = ({ visible, content, direction, className }) => {
|
|
3172
3097
|
const itemRef = React__default["default"].useRef(null);
|
|
3173
|
-
return (React__default["default"].createElement(CSSTransition, { in: visible, timeout: TIMEOUT, unmountOnExit: true, classNames: b$
|
|
3174
|
-
React__default["default"].createElement("div", { ref: itemRef, className: b$
|
|
3098
|
+
return (React__default["default"].createElement(CSSTransition, { in: visible, timeout: TIMEOUT, unmountOnExit: true, classNames: b$o('item-transition', { direction }), nodeRef: itemRef },
|
|
3099
|
+
React__default["default"].createElement("div", { ref: itemRef, className: b$o('item', { direction }, className) }, content)));
|
|
3175
3100
|
};
|
|
3176
3101
|
const Drawer = ({ className, children, style, onVeilClick, onEscape, preventScrollBody = true, }) => {
|
|
3177
3102
|
let someItemVisible = false;
|
|
@@ -3202,9 +3127,9 @@ const Drawer = ({ className, children, style, onVeilClick, onEscape, preventScro
|
|
|
3202
3127
|
const veilRef = React__default["default"].useRef(null);
|
|
3203
3128
|
return (React__default["default"].createElement(Transition, { in: someItemVisible, timeout: { enter: 0, exit: TIMEOUT }, mountOnEnter: true, unmountOnExit: true, nodeRef: containerRef }, (state) => {
|
|
3204
3129
|
const childrenVisible = someItemVisible && state === 'entered';
|
|
3205
|
-
return (React__default["default"].createElement("div", { ref: containerRef, className: b$
|
|
3206
|
-
React__default["default"].createElement(CSSTransition, { in: childrenVisible, timeout: TIMEOUT, unmountOnExit: true, classNames: b$
|
|
3207
|
-
React__default["default"].createElement("div", { ref: veilRef, className: b$
|
|
3130
|
+
return (React__default["default"].createElement("div", { ref: containerRef, className: b$o(null, className), style: style },
|
|
3131
|
+
React__default["default"].createElement(CSSTransition, { in: childrenVisible, timeout: TIMEOUT, unmountOnExit: true, classNames: b$o('veil-transition'), nodeRef: veilRef },
|
|
3132
|
+
React__default["default"].createElement("div", { ref: veilRef, className: b$o('veil'), onClick: onVeilClick })),
|
|
3208
3133
|
React__default["default"].Children.map(children, (child) => {
|
|
3209
3134
|
const childElem = child;
|
|
3210
3135
|
if (childElem.type === DrawerItem) {
|
|
@@ -3223,10 +3148,10 @@ const AsideHeaderContext = React__default["default"].createContext({
|
|
|
3223
3148
|
const AsideHeaderContextProvider = AsideHeaderContext.Provider;
|
|
3224
3149
|
const useAsideHeaderContext = () => React__default["default"].useContext(AsideHeaderContext);
|
|
3225
3150
|
|
|
3226
|
-
var css_248z$
|
|
3227
|
-
styleInject(css_248z$
|
|
3151
|
+
var css_248z$m = ".gn-logo {\n display: flex;\n align-items: center;\n flex-shrink: 0;\n height: 40px;\n}\n.gn-logo__logo-btn-place {\n flex-shrink: 0;\n width: var(--gn-aside-header-min-width);\n display: flex;\n align-items: center;\n justify-content: center;\n cursor: pointer;\n}\n.gn-logo__logo-btn-place .yc-button::before {\n background-color: transparent;\n}\n.gn-logo__btn-logo.yc-button_view_flat.yc-button_size_l {\n --yc-button-height: var(--gn-aside-header-item-icon-background-size);\n}\n.gn-logo__logo {\n font-size: var(--g-text-body-2-font-size);\n line-height: var(--g-text-body-2-line-height);\n font-weight: var(--g-text-body-font-weight);\n vertical-align: middle;\n cursor: pointer;\n}\n.gn-logo__logo-link, .gn-logo__logo-link:hover, .gn-logo__logo-link:active, .gn-logo__logo-link:visited, .gn-logo__logo-link:focus {\n text-decoration: none;\n outline: none;\n color: inherit;\n}\n.g-root .gn-logo__btn-logo.button2_theme_flat.button2_hovered_yes::before {\n background-color: transparent;\n}";
|
|
3152
|
+
styleInject(css_248z$m);
|
|
3228
3153
|
|
|
3229
|
-
const b$
|
|
3154
|
+
const b$n = block('logo');
|
|
3230
3155
|
const Logo$1 = ({ text, icon, iconSrc, iconClassName, iconSize = 24, textSize = 15, href, wrapper, onClick, }) => {
|
|
3231
3156
|
const { compact } = useAsideHeaderContext();
|
|
3232
3157
|
const hasWrapper = typeof wrapper === 'function';
|
|
@@ -3238,18 +3163,18 @@ const Logo$1 = ({ text, icon, iconSrc, iconClassName, iconSize = 24, textSize =
|
|
|
3238
3163
|
else if (icon) {
|
|
3239
3164
|
buttonIcon = React__default["default"].createElement(uikit.Icon, { data: icon, size: iconSize, className: iconClassName });
|
|
3240
3165
|
}
|
|
3241
|
-
const button = (React__default["default"].createElement(uikit.Button, { view: "flat", size: "l", className: b$
|
|
3166
|
+
const button = (React__default["default"].createElement(uikit.Button, { view: "flat", size: "l", className: b$n('btn-logo'), component: hasWrapper ? 'span' : undefined, onClick: onClick, target: "_self", href: href }, buttonIcon));
|
|
3242
3167
|
let logo;
|
|
3243
3168
|
if (typeof text === 'function') {
|
|
3244
3169
|
logo = text();
|
|
3245
3170
|
}
|
|
3246
3171
|
else {
|
|
3247
|
-
logo = (React__default["default"].createElement("div", { className: b$
|
|
3172
|
+
logo = (React__default["default"].createElement("div", { className: b$n('logo'), style: { fontSize: textSize } }, text));
|
|
3248
3173
|
}
|
|
3249
|
-
return (React__default["default"].createElement("div", { className: b$
|
|
3250
|
-
React__default["default"].createElement("div", { className: b$
|
|
3174
|
+
return (React__default["default"].createElement("div", { className: b$n() },
|
|
3175
|
+
React__default["default"].createElement("div", { className: b$n('logo-btn-place') }, hasWrapper ? wrapper(button, compact) : button),
|
|
3251
3176
|
!compact &&
|
|
3252
|
-
(hasWrapper ? (React__default["default"].createElement("div", { onClick: onClick }, wrapper(logo, compact))) : (React__default["default"].createElement("a", { href: href !== null && href !== void 0 ? href : '/', target: "_self", className: b$
|
|
3177
|
+
(hasWrapper ? (React__default["default"].createElement("div", { onClick: onClick }, wrapper(logo, compact))) : (React__default["default"].createElement("a", { href: href !== null && href !== void 0 ? href : '/', target: "_self", className: b$n('logo-link'), onClick: onClick }, logo)))));
|
|
3253
3178
|
};
|
|
3254
3179
|
|
|
3255
3180
|
/**
|
|
@@ -3627,7 +3552,6 @@ class AutoSizer extends React.Component {
|
|
|
3627
3552
|
}
|
|
3628
3553
|
}
|
|
3629
3554
|
|
|
3630
|
-
const ICON_SIZE = 24;
|
|
3631
3555
|
const ITEM_HEIGHT = 40;
|
|
3632
3556
|
const ITEM_TYPE_REGULAR = 'regular';
|
|
3633
3557
|
const COLLAPSE_ITEM_ID = 'collapse-item-id';
|
|
@@ -3675,12 +3599,10 @@ function getItemsMinHeight(items) {
|
|
|
3675
3599
|
getItemsHeight(afterMoreButtonItems) +
|
|
3676
3600
|
(pinnedItems.length === items.length ? 0 : ITEM_HEIGHT));
|
|
3677
3601
|
}
|
|
3678
|
-
function getMoreButtonItem(
|
|
3679
|
-
var _a;
|
|
3680
|
-
const title = (_a = dict === null || dict === void 0 ? void 0 : dict[exports.Dict.MoreButton]) !== null && _a !== void 0 ? _a : defaultDict$2[exports.Dict.MoreButton];
|
|
3602
|
+
function getMoreButtonItem(menuMoreTitle) {
|
|
3681
3603
|
return {
|
|
3682
3604
|
id: COLLAPSE_ITEM_ID,
|
|
3683
|
-
title,
|
|
3605
|
+
title: menuMoreTitle,
|
|
3684
3606
|
icon: icons.Ellipsis,
|
|
3685
3607
|
iconSize: 18,
|
|
3686
3608
|
};
|
|
@@ -3728,1116 +3650,1428 @@ function isMenuItem(item) {
|
|
|
3728
3650
|
return (item === null || item === void 0 ? void 0 : item.id) !== undefined;
|
|
3729
3651
|
}
|
|
3730
3652
|
|
|
3731
|
-
|
|
3732
|
-
|
|
3653
|
+
/**
|
|
3654
|
+
* Checks if `value` is the
|
|
3655
|
+
* [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types)
|
|
3656
|
+
* of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)
|
|
3657
|
+
*
|
|
3658
|
+
* @static
|
|
3659
|
+
* @memberOf _
|
|
3660
|
+
* @since 0.1.0
|
|
3661
|
+
* @category Lang
|
|
3662
|
+
* @param {*} value The value to check.
|
|
3663
|
+
* @returns {boolean} Returns `true` if `value` is an object, else `false`.
|
|
3664
|
+
* @example
|
|
3665
|
+
*
|
|
3666
|
+
* _.isObject({});
|
|
3667
|
+
* // => true
|
|
3668
|
+
*
|
|
3669
|
+
* _.isObject([1, 2, 3]);
|
|
3670
|
+
* // => true
|
|
3671
|
+
*
|
|
3672
|
+
* _.isObject(_.noop);
|
|
3673
|
+
* // => true
|
|
3674
|
+
*
|
|
3675
|
+
* _.isObject(null);
|
|
3676
|
+
* // => false
|
|
3677
|
+
*/
|
|
3733
3678
|
|
|
3734
|
-
|
|
3735
|
-
|
|
3736
|
-
|
|
3737
|
-
if (item.rightAdornment) {
|
|
3738
|
-
titleNode = (React__default["default"].createElement(React__default["default"].Fragment, null,
|
|
3739
|
-
titleNode,
|
|
3740
|
-
React__default["default"].createElement("div", { className: b$l('title-adornment') }, item.rightAdornment)));
|
|
3741
|
-
}
|
|
3742
|
-
return titleNode;
|
|
3743
|
-
}
|
|
3744
|
-
const defaultPopupPlacement = ['right-end'];
|
|
3745
|
-
const defaultPopupOffset = [-20, 8];
|
|
3746
|
-
const Item$1 = (props) => {
|
|
3747
|
-
const { item, className, collapseItems, onMouseLeave, onMouseEnter, enableTooltip = true, popupVisible = false, popupAnchor, popupPlacement = defaultPopupPlacement, popupOffset = defaultPopupOffset, popupKeepMounted, renderPopupContent, onClosePopup, onItemClick, onItemClickCapture, } = props;
|
|
3748
|
-
const { compact } = useAsideHeaderContext();
|
|
3749
|
-
if (item.type === 'divider') {
|
|
3750
|
-
return React__default["default"].createElement("div", { className: b$l('menu-divider') });
|
|
3751
|
-
}
|
|
3752
|
-
const [open, toggleOpen] = React__default["default"].useState(false);
|
|
3753
|
-
const ref = React__default["default"].useRef(null);
|
|
3754
|
-
const anchorRef = popupAnchor || ref;
|
|
3755
|
-
const type = item.type || ITEM_TYPE_REGULAR;
|
|
3756
|
-
const current = item.current || false;
|
|
3757
|
-
const tooltipText = item.tooltipText || item.title;
|
|
3758
|
-
const icon = item.icon;
|
|
3759
|
-
const iconSize = item.iconSize || ICON_SIZE;
|
|
3760
|
-
const collapsedItem = item.id === COLLAPSE_ITEM_ID;
|
|
3761
|
-
const onClose = React__default["default"].useCallback((event) => {
|
|
3762
|
-
var _a;
|
|
3763
|
-
if (event instanceof MouseEvent &&
|
|
3764
|
-
event.target &&
|
|
3765
|
-
((_a = ref.current) === null || _a === void 0 ? void 0 : _a.contains(event.target))) {
|
|
3766
|
-
return;
|
|
3767
|
-
}
|
|
3768
|
-
onClosePopup === null || onClosePopup === void 0 ? void 0 : onClosePopup();
|
|
3769
|
-
}, [onClosePopup]);
|
|
3770
|
-
const makeNode = ({ icon: iconEl, title: titleEl }) => {
|
|
3771
|
-
const createdNode = (React__default["default"].createElement("div", { className: b$l({ type, current, compact }, className), ref: ref, onClick: (event) => {
|
|
3772
|
-
if (collapsedItem) {
|
|
3773
|
-
/**
|
|
3774
|
-
* If we call onItemClick for collapsedItem then:
|
|
3775
|
-
* - User get unexpected item in onItemClick callback
|
|
3776
|
-
* - onClosePanel calls twice for each popuped item, as result it will prevent opening of panelItems
|
|
3777
|
-
*/
|
|
3778
|
-
toggleOpen(!open);
|
|
3779
|
-
}
|
|
3780
|
-
else {
|
|
3781
|
-
onItemClick === null || onItemClick === void 0 ? void 0 : onItemClick(item, false, event);
|
|
3782
|
-
}
|
|
3783
|
-
}, onClickCapture: onItemClickCapture, onMouseEnter: () => {
|
|
3784
|
-
if (!compact) {
|
|
3785
|
-
onMouseEnter === null || onMouseEnter === void 0 ? void 0 : onMouseEnter();
|
|
3786
|
-
}
|
|
3787
|
-
}, onMouseLeave: () => {
|
|
3788
|
-
if (!compact) {
|
|
3789
|
-
onMouseLeave === null || onMouseLeave === void 0 ? void 0 : onMouseLeave();
|
|
3790
|
-
}
|
|
3791
|
-
} },
|
|
3792
|
-
React__default["default"].createElement("div", { className: b$l('icon-place') }, compact ? (React__default["default"].createElement(uikit.Tooltip, { content: tooltipText, disabled: !enableTooltip || (collapsedItem && open) || popupVisible, placement: "right", className: b$l('icon-tooltip', { 'item-type': type }) },
|
|
3793
|
-
React__default["default"].createElement("div", { onMouseEnter: () => onMouseEnter === null || onMouseEnter === void 0 ? void 0 : onMouseEnter(), onMouseLeave: () => onMouseLeave === null || onMouseLeave === void 0 ? void 0 : onMouseLeave(), className: b$l('btn-icon') }, iconEl))) : (iconEl)),
|
|
3794
|
-
React__default["default"].createElement("div", { className: b$l('title'), title: typeof item.title === 'string' ? item.title : undefined }, titleEl),
|
|
3795
|
-
renderPopupContent && Boolean(anchorRef === null || anchorRef === void 0 ? void 0 : anchorRef.current) && (React__default["default"].createElement(uikit.Popup, { contentClassName: b$l('popup'), open: popupVisible, keepMounted: popupKeepMounted, placement: popupPlacement, offset: popupOffset, anchorRef: anchorRef, onClose: onClose }, renderPopupContent()))));
|
|
3796
|
-
return item.link ? (React__default["default"].createElement("a", { href: item.link, className: b$l('link') }, createdNode)) : (createdNode);
|
|
3797
|
-
};
|
|
3798
|
-
const iconNode = icon ? React__default["default"].createElement(uikit.Icon, { data: icon, size: iconSize, className: b$l('icon') }) : null;
|
|
3799
|
-
const titleNode = renderItemTitle(item);
|
|
3800
|
-
const params = { icon: iconNode, title: titleNode };
|
|
3801
|
-
let node;
|
|
3802
|
-
const opts = { compact, collapsed: false, item, ref };
|
|
3803
|
-
if (typeof item.itemWrapper === 'function') {
|
|
3804
|
-
node = item.itemWrapper(params, makeNode, opts);
|
|
3805
|
-
}
|
|
3806
|
-
else {
|
|
3807
|
-
node = makeNode(params);
|
|
3808
|
-
}
|
|
3809
|
-
return (React__default["default"].createElement(React__default["default"].Fragment, null,
|
|
3810
|
-
node,
|
|
3811
|
-
open && collapsedItem && (collapseItems === null || collapseItems === void 0 ? void 0 : collapseItems.length) && Boolean(anchorRef === null || anchorRef === void 0 ? void 0 : anchorRef.current) && (React__default["default"].createElement(CollapsedPopup, Object.assign({}, props, { anchorRef: ref, onClose: () => toggleOpen(false) })))));
|
|
3812
|
-
};
|
|
3813
|
-
Item$1.displayName = 'Item';
|
|
3814
|
-
function CollapsedPopup({ onItemClick, collapseItems, anchorRef, onClose, }) {
|
|
3815
|
-
const { compact } = useAsideHeaderContext();
|
|
3816
|
-
return (collapseItems === null || collapseItems === void 0 ? void 0 : collapseItems.length) ? (React__default["default"].createElement(uikit.Popup, { placement: POPUP_PLACEMENT, open: true, anchorRef: anchorRef, onClose: onClose },
|
|
3817
|
-
React__default["default"].createElement("div", { className: b$l('collapse-items-popup-content') },
|
|
3818
|
-
React__default["default"].createElement(uikit.List, { itemClassName: b$l('root-collapse-item'), items: collapseItems, selectedItemIndex: getSelectedItemIndex$1(collapseItems), itemHeight: POPUP_ITEM_HEIGHT, itemsHeight: collapseItems.length * POPUP_ITEM_HEIGHT, virtualized: false, filterable: false, sortable: false, renderItem: (collapseItem) => {
|
|
3819
|
-
const makeCollapseNode = ({ title: titleEl }) => {
|
|
3820
|
-
const res = (React__default["default"].createElement("div", { className: b$l('collapse-item'), onClick: (event) => {
|
|
3821
|
-
onItemClick === null || onItemClick === void 0 ? void 0 : onItemClick(collapseItem, true, event);
|
|
3822
|
-
} }, titleEl));
|
|
3823
|
-
return collapseItem.link ? (React__default["default"].createElement("a", { href: collapseItem.link, className: b$l('link') }, res)) : (res);
|
|
3824
|
-
};
|
|
3825
|
-
const titleNode = renderItemTitle(collapseItem);
|
|
3826
|
-
const params = { title: titleNode };
|
|
3827
|
-
const opts = { compact, collapsed: true, item: collapseItem, ref: anchorRef };
|
|
3828
|
-
if (typeof collapseItem.itemWrapper === 'function') {
|
|
3829
|
-
return collapseItem.itemWrapper(params, makeCollapseNode, opts);
|
|
3830
|
-
}
|
|
3831
|
-
else {
|
|
3832
|
-
return makeCollapseNode(params);
|
|
3833
|
-
}
|
|
3834
|
-
} })))) : null;
|
|
3679
|
+
function isObject$2(value) {
|
|
3680
|
+
var type = typeof value;
|
|
3681
|
+
return value != null && (type == 'object' || type == 'function');
|
|
3835
3682
|
}
|
|
3836
3683
|
|
|
3837
|
-
|
|
3838
|
-
active: false,
|
|
3839
|
-
activeIndex: undefined,
|
|
3840
|
-
hideCollapseItemTooltip: false,
|
|
3841
|
-
lastClickedItemIndex: undefined,
|
|
3842
|
-
setValue: () => { },
|
|
3843
|
-
};
|
|
3844
|
-
const MultipleTooltipContext = React__default["default"].createContext(multipleTooltipContextDefaults);
|
|
3845
|
-
class MultipleTooltipProvider extends React__default["default"].PureComponent {
|
|
3846
|
-
constructor() {
|
|
3847
|
-
super(...arguments);
|
|
3848
|
-
this.state = Object.assign({}, multipleTooltipContextDefaults);
|
|
3849
|
-
this.setValue = (value) => {
|
|
3850
|
-
this.setState(Object.assign({}, value));
|
|
3851
|
-
};
|
|
3852
|
-
}
|
|
3853
|
-
render() {
|
|
3854
|
-
const { children } = this.props;
|
|
3855
|
-
return (React__default["default"].createElement(MultipleTooltipContext.Provider, { value: Object.assign(Object.assign({}, this.state), { setValue: this.setValue }) }, children));
|
|
3856
|
-
}
|
|
3857
|
-
}
|
|
3684
|
+
var isObject_1 = isObject$2;
|
|
3858
3685
|
|
|
3859
|
-
|
|
3860
|
-
styleInject(css_248z$j);
|
|
3686
|
+
/** Detect free variable `global` from Node.js. */
|
|
3861
3687
|
|
|
3862
|
-
|
|
3863
|
-
|
|
3864
|
-
|
|
3865
|
-
|
|
3866
|
-
|
|
3867
|
-
|
|
3868
|
-
|
|
3869
|
-
|
|
3870
|
-
|
|
3871
|
-
|
|
3872
|
-
|
|
3873
|
-
|
|
3874
|
-
|
|
3875
|
-
|
|
3876
|
-
|
|
3877
|
-
|
|
3878
|
-
|
|
3879
|
-
|
|
3880
|
-
|
|
3881
|
-
|
|
3882
|
-
|
|
3883
|
-
|
|
3884
|
-
|
|
3885
|
-
|
|
3886
|
-
|
|
3688
|
+
var freeGlobal$1 = typeof commonjsGlobal == 'object' && commonjsGlobal && commonjsGlobal.Object === Object && commonjsGlobal;
|
|
3689
|
+
|
|
3690
|
+
var _freeGlobal = freeGlobal$1;
|
|
3691
|
+
|
|
3692
|
+
var freeGlobal = _freeGlobal;
|
|
3693
|
+
|
|
3694
|
+
/** Detect free variable `self`. */
|
|
3695
|
+
var freeSelf = typeof self == 'object' && self && self.Object === Object && self;
|
|
3696
|
+
|
|
3697
|
+
/** Used as a reference to the global object. */
|
|
3698
|
+
var root$2 = freeGlobal || freeSelf || Function('return this')();
|
|
3699
|
+
|
|
3700
|
+
var _root = root$2;
|
|
3701
|
+
|
|
3702
|
+
var root$1 = _root;
|
|
3703
|
+
|
|
3704
|
+
/**
|
|
3705
|
+
* Gets the timestamp of the number of milliseconds that have elapsed since
|
|
3706
|
+
* the Unix epoch (1 January 1970 00:00:00 UTC).
|
|
3707
|
+
*
|
|
3708
|
+
* @static
|
|
3709
|
+
* @memberOf _
|
|
3710
|
+
* @since 2.4.0
|
|
3711
|
+
* @category Date
|
|
3712
|
+
* @returns {number} Returns the timestamp.
|
|
3713
|
+
* @example
|
|
3714
|
+
*
|
|
3715
|
+
* _.defer(function(stamp) {
|
|
3716
|
+
* console.log(_.now() - stamp);
|
|
3717
|
+
* }, _.now());
|
|
3718
|
+
* // => Logs the number of milliseconds it took for the deferred invocation.
|
|
3719
|
+
*/
|
|
3720
|
+
var now$1 = function() {
|
|
3721
|
+
return root$1.Date.now();
|
|
3887
3722
|
};
|
|
3888
3723
|
|
|
3889
|
-
var
|
|
3890
|
-
styleInject(css_248z$i);
|
|
3724
|
+
var now_1 = now$1;
|
|
3891
3725
|
|
|
3892
|
-
|
|
3893
|
-
const CompositeBarView = ({ type, items, onItemClick, collapseItems, multipleTooltip = false, }) => {
|
|
3894
|
-
const ref = React.useRef(null);
|
|
3895
|
-
const tooltipRef = React.useRef(null);
|
|
3896
|
-
const { setValue: setMultipleTooltipContextValue, active: multipleTooltipActive, activeIndex, lastClickedItemIndex, } = React.useContext(MultipleTooltipContext);
|
|
3897
|
-
const { compact } = useAsideHeaderContext();
|
|
3898
|
-
const onTooltipMouseEnter = React.useCallback((e) => {
|
|
3899
|
-
if (!multipleTooltipActive &&
|
|
3900
|
-
activeIndex !== lastClickedItemIndex &&
|
|
3901
|
-
e.clientX <= ASIDE_HEADER_COMPACT_WIDTH) {
|
|
3902
|
-
setMultipleTooltipContextValue === null || setMultipleTooltipContextValue === void 0 ? void 0 : setMultipleTooltipContextValue({
|
|
3903
|
-
active: true,
|
|
3904
|
-
});
|
|
3905
|
-
}
|
|
3906
|
-
}, [multipleTooltipActive, activeIndex, lastClickedItemIndex, setMultipleTooltipContextValue]);
|
|
3907
|
-
const onTooltipMouseLeave = React.useCallback(() => {
|
|
3908
|
-
if (multipleTooltipActive) {
|
|
3909
|
-
setMultipleTooltipContextValue === null || setMultipleTooltipContextValue === void 0 ? void 0 : setMultipleTooltipContextValue({
|
|
3910
|
-
active: false,
|
|
3911
|
-
lastClickedItemIndex: undefined,
|
|
3912
|
-
});
|
|
3913
|
-
}
|
|
3914
|
-
}, [multipleTooltipActive, setMultipleTooltipContextValue]);
|
|
3915
|
-
const onMouseEnterByIndex = React.useCallback((itemIndex) => () => {
|
|
3916
|
-
if (multipleTooltip) {
|
|
3917
|
-
let multipleTooltipActiveValue = multipleTooltipActive;
|
|
3918
|
-
if (!multipleTooltipActive && itemIndex !== lastClickedItemIndex) {
|
|
3919
|
-
multipleTooltipActiveValue = true;
|
|
3920
|
-
}
|
|
3921
|
-
if (activeIndex === itemIndex &&
|
|
3922
|
-
multipleTooltipActive === multipleTooltipActiveValue) {
|
|
3923
|
-
return;
|
|
3924
|
-
}
|
|
3925
|
-
setMultipleTooltipContextValue({
|
|
3926
|
-
activeIndex: itemIndex,
|
|
3927
|
-
active: multipleTooltipActiveValue,
|
|
3928
|
-
});
|
|
3929
|
-
}
|
|
3930
|
-
}, [multipleTooltipActive, activeIndex, lastClickedItemIndex, setMultipleTooltipContextValue]);
|
|
3931
|
-
const onMouseLeave = React.useCallback(() => {
|
|
3932
|
-
var _a;
|
|
3933
|
-
if (compact) {
|
|
3934
|
-
(_a = ref.current) === null || _a === void 0 ? void 0 : _a.activateItem(undefined);
|
|
3935
|
-
if (multipleTooltip &&
|
|
3936
|
-
(activeIndex !== undefined || lastClickedItemIndex !== undefined)) {
|
|
3937
|
-
setMultipleTooltipContextValue({
|
|
3938
|
-
activeIndex: undefined,
|
|
3939
|
-
lastClickedItemIndex: undefined,
|
|
3940
|
-
});
|
|
3941
|
-
}
|
|
3942
|
-
}
|
|
3943
|
-
}, [activeIndex, lastClickedItemIndex, setMultipleTooltipContextValue]);
|
|
3944
|
-
const onItemClickByIndex = React.useCallback((itemIndex) => (item, collapsed, event) => {
|
|
3945
|
-
if (compact &&
|
|
3946
|
-
multipleTooltip &&
|
|
3947
|
-
itemIndex !== lastClickedItemIndex &&
|
|
3948
|
-
item.id !== COLLAPSE_ITEM_ID) {
|
|
3949
|
-
setMultipleTooltipContextValue({
|
|
3950
|
-
lastClickedItemIndex: itemIndex,
|
|
3951
|
-
active: false,
|
|
3952
|
-
});
|
|
3953
|
-
}
|
|
3954
|
-
onItemClick === null || onItemClick === void 0 ? void 0 : onItemClick(item, collapsed, event);
|
|
3955
|
-
}, [lastClickedItemIndex, setMultipleTooltipContextValue]);
|
|
3956
|
-
return (React__default["default"].createElement(React__default["default"].Fragment, null,
|
|
3957
|
-
React__default["default"].createElement("div", { ref: tooltipRef, onMouseEnter: onTooltipMouseEnter, onMouseLeave: onTooltipMouseLeave },
|
|
3958
|
-
React__default["default"].createElement(uikit.List, { ref: ref, items: items, selectedItemIndex: type === 'menu' ? getSelectedItemIndex$1(items) : undefined, itemHeight: getItemHeight$1, itemsHeight: getItemsHeight, itemClassName: b$j('root-menu-item'), virtualized: false, filterable: false, sortable: false, renderItem: (item, _isItemActive, itemIndex) => {
|
|
3959
|
-
const itemExtraProps = isMenuItem(item) ? { item } : item;
|
|
3960
|
-
const enableTooltip = isMenuItem(item)
|
|
3961
|
-
? !multipleTooltip
|
|
3962
|
-
: item.enableTooltip;
|
|
3963
|
-
return (React__default["default"].createElement(Item$1, Object.assign({}, itemExtraProps, { enableTooltip: enableTooltip, onMouseEnter: onMouseEnterByIndex(itemIndex), onMouseLeave: onMouseLeave, onItemClick: onItemClickByIndex(itemIndex), collapseItems: collapseItems })));
|
|
3964
|
-
} })),
|
|
3965
|
-
type === 'menu' && (React__default["default"].createElement(MultipleTooltip, { open: compact && multipleTooltip && multipleTooltipActive, anchorRef: tooltipRef, placement: ['right-start'], items: items }))));
|
|
3966
|
-
};
|
|
3967
|
-
const CompositeBar = ({ type, items, dict, onItemClick, multipleTooltip = false, }) => {
|
|
3968
|
-
if (items.length === 0) {
|
|
3969
|
-
return null;
|
|
3970
|
-
}
|
|
3971
|
-
let node;
|
|
3972
|
-
if (type === 'menu') {
|
|
3973
|
-
const minHeight = getItemsMinHeight(items);
|
|
3974
|
-
const collapseItem = getMoreButtonItem(dict);
|
|
3975
|
-
node = (React__default["default"].createElement("div", { className: b$j({ autosizer: true }), style: { minHeight } }, items.length !== 0 && (React__default["default"].createElement(AutoSizer, null, ({ width, height }) => {
|
|
3976
|
-
const { listItems, collapseItems } = getAutosizeListItems(items, height, collapseItem);
|
|
3977
|
-
return (React__default["default"].createElement("div", { style: { width, height } },
|
|
3978
|
-
React__default["default"].createElement(CompositeBarView, { type: "menu", items: listItems, onItemClick: onItemClick, collapseItems: collapseItems, multipleTooltip: multipleTooltip })));
|
|
3979
|
-
}))));
|
|
3980
|
-
}
|
|
3981
|
-
else {
|
|
3982
|
-
node = (React__default["default"].createElement("div", { className: b$j() },
|
|
3983
|
-
React__default["default"].createElement(CompositeBarView, { type: "subheader", items: items, onItemClick: onItemClick })));
|
|
3984
|
-
}
|
|
3985
|
-
return React__default["default"].createElement(MultipleTooltipProvider, null, node);
|
|
3986
|
-
};
|
|
3726
|
+
/** Used to match a single whitespace character. */
|
|
3987
3727
|
|
|
3988
|
-
|
|
3989
|
-
const RenderContent = React__default["default"].memo(({ renderContent, size }) => {
|
|
3990
|
-
return React__default["default"].createElement(React__default["default"].Fragment, null, renderContent({ size }));
|
|
3991
|
-
});
|
|
3992
|
-
RenderContent.displayName = 'RenderContent';
|
|
3993
|
-
const Content = ({ size, // TODO: move to context when MobileHeader will support it
|
|
3994
|
-
className, cssSizeVariableName = '--aside-header-size', renderContent, }) => {
|
|
3995
|
-
return (React__default["default"].createElement("div", { className: className, style: Object.assign({}, { [cssSizeVariableName]: `${size}px` }) }, typeof renderContent === 'function' && (React__default["default"].createElement(RenderContent, { size: size, renderContent: renderContent }))));
|
|
3996
|
-
};
|
|
3728
|
+
var reWhitespace = /\s/;
|
|
3997
3729
|
|
|
3998
|
-
|
|
3999
|
-
|
|
4000
|
-
|
|
4001
|
-
|
|
3730
|
+
/**
|
|
3731
|
+
* Used by `_.trim` and `_.trimEnd` to get the index of the last non-whitespace
|
|
3732
|
+
* character of `string`.
|
|
3733
|
+
*
|
|
3734
|
+
* @private
|
|
3735
|
+
* @param {string} string The string to inspect.
|
|
3736
|
+
* @returns {number} Returns the index of the last non-whitespace character.
|
|
3737
|
+
*/
|
|
3738
|
+
function trimmedEndIndex$1(string) {
|
|
3739
|
+
var index = string.length;
|
|
3740
|
+
|
|
3741
|
+
while (index-- && reWhitespace.test(string.charAt(index))) {}
|
|
3742
|
+
return index;
|
|
4002
3743
|
}
|
|
4003
3744
|
|
|
4004
|
-
var
|
|
4005
|
-
function _extends$1() { _extends$1 = Object.assign ? Object.assign.bind() : 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$1.apply(this, arguments); }
|
|
4006
|
-
var SvgControlMenuButton = function SvgControlMenuButton(props) {
|
|
4007
|
-
return /*#__PURE__*/React__namespace.createElement("svg", _extends$1({
|
|
4008
|
-
width: 8,
|
|
4009
|
-
height: 8,
|
|
4010
|
-
viewBox: "0 0 8 8",
|
|
4011
|
-
fill: "currentColor",
|
|
4012
|
-
xmlns: "http://www.w3.org/2000/svg"
|
|
4013
|
-
}, props), _path$1 || (_path$1 = /*#__PURE__*/React__namespace.createElement("path", {
|
|
4014
|
-
d: "m.72 7.64 6.39-3.2a.5.5 0 0 0 0-.89L.72.36A.5.5 0 0 0 0 .81v6.38c0 .37.4.61.72.45Z"
|
|
4015
|
-
})));
|
|
4016
|
-
};
|
|
4017
|
-
var controlMenuButtonIcon = SvgControlMenuButton;
|
|
3745
|
+
var _trimmedEndIndex = trimmedEndIndex$1;
|
|
4018
3746
|
|
|
4019
|
-
var
|
|
4020
|
-
function _extends() { _extends = Object.assign ? Object.assign.bind() : 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); }
|
|
4021
|
-
var SvgDividerCollapsed = function SvgDividerCollapsed(props) {
|
|
4022
|
-
return /*#__PURE__*/React__namespace.createElement("svg", _extends({
|
|
4023
|
-
width: 56,
|
|
4024
|
-
height: 29,
|
|
4025
|
-
viewBox: "0 0 56 29",
|
|
4026
|
-
fill: "currentColor",
|
|
4027
|
-
xmlns: "http://www.w3.org/2000/svg"
|
|
4028
|
-
}, props), _path || (_path = /*#__PURE__*/React__namespace.createElement("path", {
|
|
4029
|
-
d: "M56 0v29c-.8-1-7-6.1-17.7-8.4L13 15.7A16 16 0 0 1 0 0Z"
|
|
4030
|
-
})));
|
|
4031
|
-
};
|
|
4032
|
-
var headerDividerCollapsedIcon = SvgDividerCollapsed;
|
|
3747
|
+
var trimmedEndIndex = _trimmedEndIndex;
|
|
4033
3748
|
|
|
4034
|
-
|
|
4035
|
-
|
|
3749
|
+
/** Used to match leading whitespace. */
|
|
3750
|
+
var reTrimStart = /^\s+/;
|
|
4036
3751
|
|
|
4037
|
-
|
|
4038
|
-
|
|
4039
|
-
|
|
4040
|
-
|
|
4041
|
-
|
|
4042
|
-
|
|
4043
|
-
|
|
4044
|
-
|
|
4045
|
-
|
|
4046
|
-
|
|
4047
|
-
|
|
4048
|
-
React__default["default"].createElement("div", { className: b$i('aside-popup-anchor'), ref: this.asideRef }),
|
|
4049
|
-
React__default["default"].createElement("div", { className: b$i('aside-content', { ['with-decoration']: headerDecoration }) },
|
|
4050
|
-
this.renderHeader(),
|
|
4051
|
-
(menuItems === null || menuItems === void 0 ? void 0 : menuItems.length) ? (React__default["default"].createElement(CompositeBar, { type: "menu", items: menuItems, dict: dict, onItemClick: this.onItemClick, multipleTooltip: multipleTooltip })) : (React__default["default"].createElement("div", { className: b$i('menu-items') })),
|
|
4052
|
-
this.renderFooter(size),
|
|
4053
|
-
this.renderCollapseButton())),
|
|
4054
|
-
panelItems && this.renderPanels(size)));
|
|
4055
|
-
};
|
|
4056
|
-
this.renderSecondPane = (size) => {
|
|
4057
|
-
return (React__default["default"].createElement(Content, { size: size, renderContent: this.props.renderContent, className: b$i('content') }));
|
|
4058
|
-
};
|
|
4059
|
-
this.renderLogo = () => React__default["default"].createElement(Logo$1, Object.assign({}, this.props.logo, { onClick: this.onLogoClick }));
|
|
4060
|
-
this.renderHeader = () => (React__default["default"].createElement("div", { className: b$i('header', { ['with-decoration']: this.props.headerDecoration }) },
|
|
4061
|
-
this.renderLogo(),
|
|
4062
|
-
React__default["default"].createElement(CompositeBar, { type: "subheader", items: this.props.subheaderItems, onItemClick: this.onItemClick }),
|
|
4063
|
-
React__default["default"].createElement(uikit.Icon, { data: headerDividerCollapsedIcon, className: b$i('header-divider'), width: ASIDE_HEADER_COMPACT_WIDTH, height: "29" })));
|
|
4064
|
-
this.renderFooter = (size) => {
|
|
4065
|
-
const { renderFooter, compact } = this.props;
|
|
4066
|
-
return (React__default["default"].createElement("div", { className: b$i('footer') }, renderFooter === null || renderFooter === void 0 ? void 0 : renderFooter({
|
|
4067
|
-
size,
|
|
4068
|
-
compact,
|
|
4069
|
-
asideRef: this.asideRef,
|
|
4070
|
-
})));
|
|
4071
|
-
};
|
|
4072
|
-
this.renderPanels = (size) => {
|
|
4073
|
-
const { panelItems } = this.props;
|
|
4074
|
-
return (React__default["default"].createElement(Drawer, { className: b$i('panels'), onVeilClick: this.onCloseDrawer, onEscape: this.onCloseDrawer, style: { left: size } }, panelItems.map((item) => (React__default["default"].createElement(DrawerItem, Object.assign({ key: item.id }, item))))));
|
|
4075
|
-
};
|
|
4076
|
-
this.renderCollapseButton = () => {
|
|
4077
|
-
var _a;
|
|
4078
|
-
const { dict, compact } = this.props;
|
|
4079
|
-
const typeButton = compact ? exports.Dict.ExpandButton : exports.Dict.CollapseButton;
|
|
4080
|
-
return (React__default["default"].createElement(uikit.Button, { className: b$i('collapse-button', { compact }), view: "flat", onClick: this.onCollapseButtonClick, title: (_a = dict === null || dict === void 0 ? void 0 : dict[typeButton]) !== null && _a !== void 0 ? _a : defaultDict$2[typeButton] },
|
|
4081
|
-
React__default["default"].createElement(NotIcon, { data: controlMenuButtonIcon, className: b$i('collapse-icon'), width: "16", height: "10" })));
|
|
4082
|
-
};
|
|
4083
|
-
this.onCollapseButtonClick = () => {
|
|
4084
|
-
var _a, _b;
|
|
4085
|
-
(_b = (_a = this.props).onChangeCompact) === null || _b === void 0 ? void 0 : _b.call(_a, !this.props.compact);
|
|
4086
|
-
};
|
|
4087
|
-
this.onCloseDrawer = () => {
|
|
4088
|
-
var _a, _b;
|
|
4089
|
-
(_b = (_a = this.props).onClosePanel) === null || _b === void 0 ? void 0 : _b.call(_a);
|
|
4090
|
-
};
|
|
4091
|
-
this.onItemClick = (item, collapsed, event) => {
|
|
4092
|
-
var _a, _b, _c;
|
|
4093
|
-
(_b = (_a = this.props).onClosePanel) === null || _b === void 0 ? void 0 : _b.call(_a);
|
|
4094
|
-
(_c = item.onItemClick) === null || _c === void 0 ? void 0 : _c.call(item, item, collapsed, event);
|
|
4095
|
-
};
|
|
4096
|
-
this.onLogoClick = (event) => {
|
|
4097
|
-
var _a, _b, _c, _d;
|
|
4098
|
-
(_b = (_a = this.props).onClosePanel) === null || _b === void 0 ? void 0 : _b.call(_a);
|
|
4099
|
-
(_d = (_c = this.props.logo).onClick) === null || _d === void 0 ? void 0 : _d.call(_c, event);
|
|
4100
|
-
};
|
|
4101
|
-
}
|
|
4102
|
-
render() {
|
|
4103
|
-
const { className, compact } = this.props;
|
|
4104
|
-
const size = compact ? ASIDE_HEADER_COMPACT_WIDTH : ASIDE_HEADER_EXPANDED_WIDTH;
|
|
4105
|
-
return (React__default["default"].createElement(AsideHeaderContextProvider, { value: { compact, size } },
|
|
4106
|
-
React__default["default"].createElement("div", { className: b$i({ compact }, className) },
|
|
4107
|
-
React__default["default"].createElement("div", { className: b$i('pane-container') },
|
|
4108
|
-
this.renderFirstPane(size),
|
|
4109
|
-
this.renderSecondPane(size)))));
|
|
4110
|
-
}
|
|
3752
|
+
/**
|
|
3753
|
+
* The base implementation of `_.trim`.
|
|
3754
|
+
*
|
|
3755
|
+
* @private
|
|
3756
|
+
* @param {string} string The string to trim.
|
|
3757
|
+
* @returns {string} Returns the trimmed string.
|
|
3758
|
+
*/
|
|
3759
|
+
function baseTrim$1(string) {
|
|
3760
|
+
return string
|
|
3761
|
+
? string.slice(0, trimmedEndIndex(string) + 1).replace(reTrimStart, '')
|
|
3762
|
+
: string;
|
|
4111
3763
|
}
|
|
4112
|
-
AsideHeader.defaultProps = {
|
|
4113
|
-
panelItems: [],
|
|
4114
|
-
subheaderItems: [],
|
|
4115
|
-
menuItems: [],
|
|
4116
|
-
headerDecoration: true,
|
|
4117
|
-
};
|
|
4118
3764
|
|
|
4119
|
-
|
|
4120
|
-
Copyright (c) Microsoft Corporation.
|
|
3765
|
+
var _baseTrim = baseTrim$1;
|
|
4121
3766
|
|
|
4122
|
-
|
|
4123
|
-
purpose with or without fee is hereby granted.
|
|
3767
|
+
var root = _root;
|
|
4124
3768
|
|
|
4125
|
-
|
|
4126
|
-
|
|
4127
|
-
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
|
|
4128
|
-
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
|
4129
|
-
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
|
4130
|
-
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
4131
|
-
PERFORMANCE OF THIS SOFTWARE.
|
|
4132
|
-
***************************************************************************** */
|
|
3769
|
+
/** Built-in value references. */
|
|
3770
|
+
var Symbol$3 = root.Symbol;
|
|
4133
3771
|
|
|
4134
|
-
|
|
4135
|
-
var t = {};
|
|
4136
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
4137
|
-
t[p] = s[p];
|
|
4138
|
-
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
4139
|
-
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
4140
|
-
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
4141
|
-
t[p[i]] = s[p[i]];
|
|
4142
|
-
}
|
|
4143
|
-
return t;
|
|
4144
|
-
}
|
|
3772
|
+
var _Symbol = Symbol$3;
|
|
4145
3773
|
|
|
4146
|
-
|
|
4147
|
-
var e = new Error(message);
|
|
4148
|
-
return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e;
|
|
4149
|
-
};
|
|
4150
|
-
|
|
4151
|
-
var css_248z$g = ".gn-footer-item {\n width: 100%;\n height: 40px;\n}";
|
|
4152
|
-
styleInject(css_248z$g);
|
|
3774
|
+
var Symbol$2 = _Symbol;
|
|
4153
3775
|
|
|
4154
|
-
|
|
4155
|
-
|
|
4156
|
-
var { item } = _a, props = __rest(_a, ["item"]);
|
|
4157
|
-
return (React__default["default"].createElement(Item$1, Object.assign({}, props, { item: Object.assign({ iconSize: ASIDE_HEADER_FOOTER_ICON_SIZE }, item), className: b$h({ compact: props.compact }), onItemClick: item.onItemClick, onItemClickCapture: item.onItemClickCapture })));
|
|
4158
|
-
};
|
|
3776
|
+
/** Used for built-in method references. */
|
|
3777
|
+
var objectProto$1 = Object.prototype;
|
|
4159
3778
|
|
|
4160
|
-
|
|
4161
|
-
|
|
3779
|
+
/** Used to check objects for own properties. */
|
|
3780
|
+
var hasOwnProperty = objectProto$1.hasOwnProperty;
|
|
4162
3781
|
|
|
4163
|
-
|
|
4164
|
-
|
|
4165
|
-
|
|
4166
|
-
|
|
4167
|
-
|
|
3782
|
+
/**
|
|
3783
|
+
* Used to resolve the
|
|
3784
|
+
* [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)
|
|
3785
|
+
* of values.
|
|
3786
|
+
*/
|
|
3787
|
+
var nativeObjectToString$1 = objectProto$1.toString;
|
|
4168
3788
|
|
|
4169
|
-
|
|
4170
|
-
|
|
3789
|
+
/** Built-in value references. */
|
|
3790
|
+
var symToStringTag$1 = Symbol$2 ? Symbol$2.toStringTag : undefined;
|
|
4171
3791
|
|
|
4172
|
-
|
|
4173
|
-
|
|
4174
|
-
|
|
4175
|
-
|
|
4176
|
-
|
|
3792
|
+
/**
|
|
3793
|
+
* A specialized version of `baseGetTag` which ignores `Symbol.toStringTag` values.
|
|
3794
|
+
*
|
|
3795
|
+
* @private
|
|
3796
|
+
* @param {*} value The value to query.
|
|
3797
|
+
* @returns {string} Returns the raw `toStringTag`.
|
|
3798
|
+
*/
|
|
3799
|
+
function getRawTag$1(value) {
|
|
3800
|
+
var isOwn = hasOwnProperty.call(value, symToStringTag$1),
|
|
3801
|
+
tag = value[symToStringTag$1];
|
|
4177
3802
|
|
|
4178
|
-
|
|
4179
|
-
|
|
3803
|
+
try {
|
|
3804
|
+
value[symToStringTag$1] = undefined;
|
|
3805
|
+
var unmasked = true;
|
|
3806
|
+
} catch (e) {}
|
|
4180
3807
|
|
|
4181
|
-
|
|
4182
|
-
|
|
4183
|
-
|
|
4184
|
-
|
|
4185
|
-
|
|
3808
|
+
var result = nativeObjectToString$1.call(value);
|
|
3809
|
+
if (unmasked) {
|
|
3810
|
+
if (isOwn) {
|
|
3811
|
+
value[symToStringTag$1] = tag;
|
|
3812
|
+
} else {
|
|
3813
|
+
delete value[symToStringTag$1];
|
|
3814
|
+
}
|
|
3815
|
+
}
|
|
3816
|
+
return result;
|
|
3817
|
+
}
|
|
4186
3818
|
|
|
4187
|
-
var
|
|
4188
|
-
styleInject(css_248z$c);
|
|
3819
|
+
var _getRawTag = getRawTag$1;
|
|
4189
3820
|
|
|
4190
|
-
|
|
4191
|
-
const ActionBarSeparator = () => {
|
|
4192
|
-
return React__default["default"].createElement("li", { role: "separator", className: b$d() });
|
|
4193
|
-
};
|
|
4194
|
-
ActionBarSeparator.displayName = 'ActionBar.Separator';
|
|
3821
|
+
/** Used for built-in method references. */
|
|
4195
3822
|
|
|
4196
|
-
var
|
|
4197
|
-
styleInject(css_248z$b);
|
|
3823
|
+
var objectProto = Object.prototype;
|
|
4198
3824
|
|
|
4199
|
-
|
|
4200
|
-
|
|
4201
|
-
|
|
4202
|
-
|
|
4203
|
-
|
|
4204
|
-
|
|
4205
|
-
Section: ActionBarSection,
|
|
4206
|
-
Group: ActionBarGroup,
|
|
4207
|
-
Item: ActionBarItem,
|
|
4208
|
-
Separator: ActionBarSeparator,
|
|
4209
|
-
});
|
|
3825
|
+
/**
|
|
3826
|
+
* Used to resolve the
|
|
3827
|
+
* [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)
|
|
3828
|
+
* of values.
|
|
3829
|
+
*/
|
|
3830
|
+
var nativeObjectToString = objectProto.toString;
|
|
4210
3831
|
|
|
4211
|
-
|
|
4212
|
-
|
|
3832
|
+
/**
|
|
3833
|
+
* Converts `value` to a string using `Object.prototype.toString`.
|
|
3834
|
+
*
|
|
3835
|
+
* @private
|
|
3836
|
+
* @param {*} value The value to convert.
|
|
3837
|
+
* @returns {string} Returns the converted string.
|
|
3838
|
+
*/
|
|
3839
|
+
function objectToString$1(value) {
|
|
3840
|
+
return nativeObjectToString.call(value);
|
|
3841
|
+
}
|
|
4213
3842
|
|
|
4214
|
-
|
|
4215
|
-
const defaultDict$1 = {
|
|
4216
|
-
close: 'Close',
|
|
4217
|
-
};
|
|
4218
|
-
const Title = ({ children, closeIconSize = 23, hasSeparator, dict = defaultDict$1, onClose, }) => {
|
|
4219
|
-
return (React__default["default"].createElement("div", { className: b$b({ separator: hasSeparator }) },
|
|
4220
|
-
React__default["default"].createElement(uikit.Text, { className: b$b('text'), as: 'h3', variant: 'subheader-3' }, children),
|
|
4221
|
-
onClose && (React__default["default"].createElement(uikit.Button, { onClick: onClose, view: "flat", size: "l", extraProps: {
|
|
4222
|
-
'aria-label': dict['close'],
|
|
4223
|
-
} },
|
|
4224
|
-
React__default["default"].createElement(uikit.Icon, { data: icons.Xmark, size: closeIconSize })))));
|
|
4225
|
-
};
|
|
4226
|
-
Title.displayName = 'Title';
|
|
3843
|
+
var _objectToString = objectToString$1;
|
|
4227
3844
|
|
|
4228
|
-
|
|
4229
|
-
|
|
4230
|
-
|
|
4231
|
-
result.push({
|
|
4232
|
-
title: hotkeysGroup.title,
|
|
4233
|
-
group: true,
|
|
4234
|
-
});
|
|
4235
|
-
result.push(...hotkeysGroup.items);
|
|
4236
|
-
}
|
|
4237
|
-
return result;
|
|
4238
|
-
}
|
|
3845
|
+
var Symbol$1 = _Symbol,
|
|
3846
|
+
getRawTag = _getRawTag,
|
|
3847
|
+
objectToString = _objectToString;
|
|
4239
3848
|
|
|
4240
|
-
|
|
4241
|
-
|
|
4242
|
-
|
|
4243
|
-
const normalizedFilter = filter.toLowerCase();
|
|
4244
|
-
for (const hotkeysBlock of hotkeys) {
|
|
4245
|
-
const filteredItems = hotkeysBlock.items.filter((item) => item.title.toLowerCase().includes(normalizedFilter));
|
|
4246
|
-
if (filteredItems.length > 0) {
|
|
4247
|
-
result.push(Object.assign(Object.assign({}, hotkeysBlock), { items: filteredItems }));
|
|
4248
|
-
}
|
|
4249
|
-
}
|
|
4250
|
-
return result;
|
|
4251
|
-
}
|
|
4252
|
-
return hotkeys;
|
|
4253
|
-
}
|
|
3849
|
+
/** `Object#toString` result references. */
|
|
3850
|
+
var nullTag = '[object Null]',
|
|
3851
|
+
undefinedTag = '[object Undefined]';
|
|
4254
3852
|
|
|
4255
|
-
|
|
4256
|
-
|
|
3853
|
+
/** Built-in value references. */
|
|
3854
|
+
var symToStringTag = Symbol$1 ? Symbol$1.toStringTag : undefined;
|
|
4257
3855
|
|
|
4258
|
-
|
|
4259
|
-
|
|
4260
|
-
|
|
4261
|
-
|
|
4262
|
-
|
|
4263
|
-
|
|
4264
|
-
|
|
4265
|
-
|
|
4266
|
-
|
|
4267
|
-
|
|
4268
|
-
|
|
4269
|
-
|
|
4270
|
-
|
|
4271
|
-
|
|
4272
|
-
React__default["default"].createElement(uikit.List, Object.assign({ className: b$a('list'), virtualized: false, filterable: false, items: hotkeysList, renderItem: renderItem, itemClassName: b$a('item', itemClassName), emptyPlaceholder: emptyState }, listProps))));
|
|
4273
|
-
return (React__default["default"].createElement(Drawer, { className: b$a(null, className), onVeilClick: onClose, onEscape: onClose, preventScrollBody: preventScrollBody, style: {
|
|
4274
|
-
left: leftOffset,
|
|
4275
|
-
top: topOffset,
|
|
4276
|
-
} },
|
|
4277
|
-
React__default["default"].createElement(DrawerItem, { id: "hotkeys", visible: visible, className: b$a('drawer-item'), content: drawerItemContent })));
|
|
3856
|
+
/**
|
|
3857
|
+
* The base implementation of `getTag` without fallbacks for buggy environments.
|
|
3858
|
+
*
|
|
3859
|
+
* @private
|
|
3860
|
+
* @param {*} value The value to query.
|
|
3861
|
+
* @returns {string} Returns the `toStringTag`.
|
|
3862
|
+
*/
|
|
3863
|
+
function baseGetTag$1(value) {
|
|
3864
|
+
if (value == null) {
|
|
3865
|
+
return value === undefined ? undefinedTag : nullTag;
|
|
3866
|
+
}
|
|
3867
|
+
return (symToStringTag && symToStringTag in Object(value))
|
|
3868
|
+
? getRawTag(value)
|
|
3869
|
+
: objectToString(value);
|
|
4278
3870
|
}
|
|
4279
3871
|
|
|
3872
|
+
var _baseGetTag = baseGetTag$1;
|
|
3873
|
+
|
|
4280
3874
|
/**
|
|
4281
|
-
*
|
|
3875
|
+
* Checks if `value` is object-like. A value is object-like if it's not `null`
|
|
3876
|
+
* and has a `typeof` result of "object".
|
|
4282
3877
|
*
|
|
4283
3878
|
* @static
|
|
4284
|
-
* @since 0.1.0
|
|
4285
3879
|
* @memberOf _
|
|
4286
|
-
* @
|
|
4287
|
-
* @
|
|
4288
|
-
* @
|
|
3880
|
+
* @since 4.0.0
|
|
3881
|
+
* @category Lang
|
|
3882
|
+
* @param {*} value The value to check.
|
|
3883
|
+
* @returns {boolean} Returns `true` if `value` is object-like, else `false`.
|
|
4289
3884
|
* @example
|
|
4290
3885
|
*
|
|
4291
|
-
*
|
|
3886
|
+
* _.isObjectLike({});
|
|
3887
|
+
* // => true
|
|
4292
3888
|
*
|
|
4293
|
-
*
|
|
3889
|
+
* _.isObjectLike([1, 2, 3]);
|
|
4294
3890
|
* // => true
|
|
3891
|
+
*
|
|
3892
|
+
* _.isObjectLike(_.noop);
|
|
3893
|
+
* // => false
|
|
3894
|
+
*
|
|
3895
|
+
* _.isObjectLike(null);
|
|
3896
|
+
* // => false
|
|
4295
3897
|
*/
|
|
4296
3898
|
|
|
4297
|
-
function
|
|
4298
|
-
return value;
|
|
3899
|
+
function isObjectLike$1(value) {
|
|
3900
|
+
return value != null && typeof value == 'object';
|
|
4299
3901
|
}
|
|
4300
3902
|
|
|
4301
|
-
var
|
|
3903
|
+
var isObjectLike_1 = isObjectLike$1;
|
|
3904
|
+
|
|
3905
|
+
var baseGetTag = _baseGetTag,
|
|
3906
|
+
isObjectLike = isObjectLike_1;
|
|
3907
|
+
|
|
3908
|
+
/** `Object#toString` result references. */
|
|
3909
|
+
var symbolTag = '[object Symbol]';
|
|
4302
3910
|
|
|
4303
3911
|
/**
|
|
4304
|
-
* Checks if `value` is
|
|
4305
|
-
* [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types)
|
|
4306
|
-
* of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)
|
|
3912
|
+
* Checks if `value` is classified as a `Symbol` primitive or object.
|
|
4307
3913
|
*
|
|
4308
3914
|
* @static
|
|
4309
3915
|
* @memberOf _
|
|
4310
|
-
* @since 0.
|
|
3916
|
+
* @since 4.0.0
|
|
4311
3917
|
* @category Lang
|
|
4312
3918
|
* @param {*} value The value to check.
|
|
4313
|
-
* @returns {boolean} Returns `true` if `value` is
|
|
3919
|
+
* @returns {boolean} Returns `true` if `value` is a symbol, else `false`.
|
|
4314
3920
|
* @example
|
|
4315
3921
|
*
|
|
4316
|
-
* _.
|
|
4317
|
-
* // => true
|
|
4318
|
-
*
|
|
4319
|
-
* _.isObject([1, 2, 3]);
|
|
4320
|
-
* // => true
|
|
4321
|
-
*
|
|
4322
|
-
* _.isObject(_.noop);
|
|
3922
|
+
* _.isSymbol(Symbol.iterator);
|
|
4323
3923
|
* // => true
|
|
4324
3924
|
*
|
|
4325
|
-
* _.
|
|
3925
|
+
* _.isSymbol('abc');
|
|
4326
3926
|
* // => false
|
|
4327
3927
|
*/
|
|
4328
|
-
|
|
4329
|
-
|
|
4330
|
-
|
|
4331
|
-
return value != null && (type == 'object' || type == 'function');
|
|
3928
|
+
function isSymbol$1(value) {
|
|
3929
|
+
return typeof value == 'symbol' ||
|
|
3930
|
+
(isObjectLike(value) && baseGetTag(value) == symbolTag);
|
|
4332
3931
|
}
|
|
4333
3932
|
|
|
4334
|
-
var
|
|
3933
|
+
var isSymbol_1 = isSymbol$1;
|
|
4335
3934
|
|
|
4336
|
-
|
|
3935
|
+
var baseTrim = _baseTrim,
|
|
3936
|
+
isObject$1 = isObject_1,
|
|
3937
|
+
isSymbol = isSymbol_1;
|
|
4337
3938
|
|
|
4338
|
-
|
|
3939
|
+
/** Used as references for various `Number` constants. */
|
|
3940
|
+
var NAN = 0 / 0;
|
|
4339
3941
|
|
|
4340
|
-
|
|
4341
|
-
|
|
4342
|
-
var freeGlobal = _freeGlobal;
|
|
4343
|
-
|
|
4344
|
-
/** Detect free variable `self`. */
|
|
4345
|
-
var freeSelf = typeof self == 'object' && self && self.Object === Object && self;
|
|
3942
|
+
/** Used to detect bad signed hexadecimal string values. */
|
|
3943
|
+
var reIsBadHex = /^[-+]0x[0-9a-f]+$/i;
|
|
4346
3944
|
|
|
4347
|
-
/** Used
|
|
4348
|
-
var
|
|
3945
|
+
/** Used to detect binary string values. */
|
|
3946
|
+
var reIsBinary = /^0b[01]+$/i;
|
|
4349
3947
|
|
|
4350
|
-
|
|
3948
|
+
/** Used to detect octal string values. */
|
|
3949
|
+
var reIsOctal = /^0o[0-7]+$/i;
|
|
4351
3950
|
|
|
4352
|
-
|
|
3951
|
+
/** Built-in method references without a dependency on `root`. */
|
|
3952
|
+
var freeParseInt = parseInt;
|
|
4353
3953
|
|
|
4354
3954
|
/**
|
|
4355
|
-
*
|
|
4356
|
-
* the Unix epoch (1 January 1970 00:00:00 UTC).
|
|
3955
|
+
* Converts `value` to a number.
|
|
4357
3956
|
*
|
|
4358
3957
|
* @static
|
|
4359
3958
|
* @memberOf _
|
|
4360
|
-
* @since
|
|
4361
|
-
* @category
|
|
4362
|
-
* @
|
|
3959
|
+
* @since 4.0.0
|
|
3960
|
+
* @category Lang
|
|
3961
|
+
* @param {*} value The value to process.
|
|
3962
|
+
* @returns {number} Returns the number.
|
|
4363
3963
|
* @example
|
|
4364
3964
|
*
|
|
4365
|
-
* _.
|
|
4366
|
-
*
|
|
4367
|
-
*
|
|
4368
|
-
*
|
|
3965
|
+
* _.toNumber(3.2);
|
|
3966
|
+
* // => 3.2
|
|
3967
|
+
*
|
|
3968
|
+
* _.toNumber(Number.MIN_VALUE);
|
|
3969
|
+
* // => 5e-324
|
|
3970
|
+
*
|
|
3971
|
+
* _.toNumber(Infinity);
|
|
3972
|
+
* // => Infinity
|
|
3973
|
+
*
|
|
3974
|
+
* _.toNumber('3.2');
|
|
3975
|
+
* // => 3.2
|
|
4369
3976
|
*/
|
|
4370
|
-
|
|
4371
|
-
|
|
4372
|
-
|
|
3977
|
+
function toNumber$1(value) {
|
|
3978
|
+
if (typeof value == 'number') {
|
|
3979
|
+
return value;
|
|
3980
|
+
}
|
|
3981
|
+
if (isSymbol(value)) {
|
|
3982
|
+
return NAN;
|
|
3983
|
+
}
|
|
3984
|
+
if (isObject$1(value)) {
|
|
3985
|
+
var other = typeof value.valueOf == 'function' ? value.valueOf() : value;
|
|
3986
|
+
value = isObject$1(other) ? (other + '') : other;
|
|
3987
|
+
}
|
|
3988
|
+
if (typeof value != 'string') {
|
|
3989
|
+
return value === 0 ? value : +value;
|
|
3990
|
+
}
|
|
3991
|
+
value = baseTrim(value);
|
|
3992
|
+
var isBinary = reIsBinary.test(value);
|
|
3993
|
+
return (isBinary || reIsOctal.test(value))
|
|
3994
|
+
? freeParseInt(value.slice(2), isBinary ? 2 : 8)
|
|
3995
|
+
: (reIsBadHex.test(value) ? NAN : +value);
|
|
3996
|
+
}
|
|
4373
3997
|
|
|
4374
|
-
var
|
|
3998
|
+
var toNumber_1 = toNumber$1;
|
|
4375
3999
|
|
|
4376
|
-
|
|
4000
|
+
var isObject = isObject_1,
|
|
4001
|
+
now = now_1,
|
|
4002
|
+
toNumber = toNumber_1;
|
|
4377
4003
|
|
|
4378
|
-
|
|
4004
|
+
/** Error message constants. */
|
|
4005
|
+
var FUNC_ERROR_TEXT = 'Expected a function';
|
|
4006
|
+
|
|
4007
|
+
/* Built-in method references for those with the same name as other `lodash` methods. */
|
|
4008
|
+
var nativeMax = Math.max,
|
|
4009
|
+
nativeMin = Math.min;
|
|
4379
4010
|
|
|
4380
4011
|
/**
|
|
4381
|
-
*
|
|
4382
|
-
*
|
|
4012
|
+
* Creates a debounced function that delays invoking `func` until after `wait`
|
|
4013
|
+
* milliseconds have elapsed since the last time the debounced function was
|
|
4014
|
+
* invoked. The debounced function comes with a `cancel` method to cancel
|
|
4015
|
+
* delayed `func` invocations and a `flush` method to immediately invoke them.
|
|
4016
|
+
* Provide `options` to indicate whether `func` should be invoked on the
|
|
4017
|
+
* leading and/or trailing edge of the `wait` timeout. The `func` is invoked
|
|
4018
|
+
* with the last arguments provided to the debounced function. Subsequent
|
|
4019
|
+
* calls to the debounced function return the result of the last `func`
|
|
4020
|
+
* invocation.
|
|
4383
4021
|
*
|
|
4384
|
-
*
|
|
4385
|
-
*
|
|
4386
|
-
*
|
|
4022
|
+
* **Note:** If `leading` and `trailing` options are `true`, `func` is
|
|
4023
|
+
* invoked on the trailing edge of the timeout only if the debounced function
|
|
4024
|
+
* is invoked more than once during the `wait` timeout.
|
|
4025
|
+
*
|
|
4026
|
+
* If `wait` is `0` and `leading` is `false`, `func` invocation is deferred
|
|
4027
|
+
* until to the next tick, similar to `setTimeout` with a timeout of `0`.
|
|
4028
|
+
*
|
|
4029
|
+
* See [David Corbacho's article](https://css-tricks.com/debouncing-throttling-explained-examples/)
|
|
4030
|
+
* for details over the differences between `_.debounce` and `_.throttle`.
|
|
4031
|
+
*
|
|
4032
|
+
* @static
|
|
4033
|
+
* @memberOf _
|
|
4034
|
+
* @since 0.1.0
|
|
4035
|
+
* @category Function
|
|
4036
|
+
* @param {Function} func The function to debounce.
|
|
4037
|
+
* @param {number} [wait=0] The number of milliseconds to delay.
|
|
4038
|
+
* @param {Object} [options={}] The options object.
|
|
4039
|
+
* @param {boolean} [options.leading=false]
|
|
4040
|
+
* Specify invoking on the leading edge of the timeout.
|
|
4041
|
+
* @param {number} [options.maxWait]
|
|
4042
|
+
* The maximum time `func` is allowed to be delayed before it's invoked.
|
|
4043
|
+
* @param {boolean} [options.trailing=true]
|
|
4044
|
+
* Specify invoking on the trailing edge of the timeout.
|
|
4045
|
+
* @returns {Function} Returns the new debounced function.
|
|
4046
|
+
* @example
|
|
4047
|
+
*
|
|
4048
|
+
* // Avoid costly calculations while the window size is in flux.
|
|
4049
|
+
* jQuery(window).on('resize', _.debounce(calculateLayout, 150));
|
|
4050
|
+
*
|
|
4051
|
+
* // Invoke `sendMail` when clicked, debouncing subsequent calls.
|
|
4052
|
+
* jQuery(element).on('click', _.debounce(sendMail, 300, {
|
|
4053
|
+
* 'leading': true,
|
|
4054
|
+
* 'trailing': false
|
|
4055
|
+
* }));
|
|
4056
|
+
*
|
|
4057
|
+
* // Ensure `batchLog` is invoked once after 1 second of debounced calls.
|
|
4058
|
+
* var debounced = _.debounce(batchLog, 250, { 'maxWait': 1000 });
|
|
4059
|
+
* var source = new EventSource('/stream');
|
|
4060
|
+
* jQuery(source).on('message', debounced);
|
|
4061
|
+
*
|
|
4062
|
+
* // Cancel the trailing debounced invocation.
|
|
4063
|
+
* jQuery(window).on('popstate', debounced.cancel);
|
|
4387
4064
|
*/
|
|
4388
|
-
function
|
|
4389
|
-
var
|
|
4065
|
+
function debounce(func, wait, options) {
|
|
4066
|
+
var lastArgs,
|
|
4067
|
+
lastThis,
|
|
4068
|
+
maxWait,
|
|
4069
|
+
result,
|
|
4070
|
+
timerId,
|
|
4071
|
+
lastCallTime,
|
|
4072
|
+
lastInvokeTime = 0,
|
|
4073
|
+
leading = false,
|
|
4074
|
+
maxing = false,
|
|
4075
|
+
trailing = true;
|
|
4390
4076
|
|
|
4391
|
-
|
|
4392
|
-
|
|
4393
|
-
}
|
|
4077
|
+
if (typeof func != 'function') {
|
|
4078
|
+
throw new TypeError(FUNC_ERROR_TEXT);
|
|
4079
|
+
}
|
|
4080
|
+
wait = toNumber(wait) || 0;
|
|
4081
|
+
if (isObject(options)) {
|
|
4082
|
+
leading = !!options.leading;
|
|
4083
|
+
maxing = 'maxWait' in options;
|
|
4084
|
+
maxWait = maxing ? nativeMax(toNumber(options.maxWait) || 0, wait) : maxWait;
|
|
4085
|
+
trailing = 'trailing' in options ? !!options.trailing : trailing;
|
|
4086
|
+
}
|
|
4394
4087
|
|
|
4395
|
-
|
|
4088
|
+
function invokeFunc(time) {
|
|
4089
|
+
var args = lastArgs,
|
|
4090
|
+
thisArg = lastThis;
|
|
4396
4091
|
|
|
4397
|
-
|
|
4092
|
+
lastArgs = lastThis = undefined;
|
|
4093
|
+
lastInvokeTime = time;
|
|
4094
|
+
result = func.apply(thisArg, args);
|
|
4095
|
+
return result;
|
|
4096
|
+
}
|
|
4398
4097
|
|
|
4399
|
-
|
|
4400
|
-
|
|
4098
|
+
function leadingEdge(time) {
|
|
4099
|
+
// Reset any `maxWait` timer.
|
|
4100
|
+
lastInvokeTime = time;
|
|
4101
|
+
// Start the timer for the trailing edge.
|
|
4102
|
+
timerId = setTimeout(timerExpired, wait);
|
|
4103
|
+
// Invoke the leading edge.
|
|
4104
|
+
return leading ? invokeFunc(time) : result;
|
|
4105
|
+
}
|
|
4401
4106
|
|
|
4402
|
-
|
|
4403
|
-
|
|
4404
|
-
|
|
4405
|
-
|
|
4406
|
-
* @param {string} string The string to trim.
|
|
4407
|
-
* @returns {string} Returns the trimmed string.
|
|
4408
|
-
*/
|
|
4409
|
-
function baseTrim$1(string) {
|
|
4410
|
-
return string
|
|
4411
|
-
? string.slice(0, trimmedEndIndex(string) + 1).replace(reTrimStart, '')
|
|
4412
|
-
: string;
|
|
4413
|
-
}
|
|
4107
|
+
function remainingWait(time) {
|
|
4108
|
+
var timeSinceLastCall = time - lastCallTime,
|
|
4109
|
+
timeSinceLastInvoke = time - lastInvokeTime,
|
|
4110
|
+
timeWaiting = wait - timeSinceLastCall;
|
|
4414
4111
|
|
|
4415
|
-
|
|
4112
|
+
return maxing
|
|
4113
|
+
? nativeMin(timeWaiting, maxWait - timeSinceLastInvoke)
|
|
4114
|
+
: timeWaiting;
|
|
4115
|
+
}
|
|
4416
4116
|
|
|
4417
|
-
|
|
4117
|
+
function shouldInvoke(time) {
|
|
4118
|
+
var timeSinceLastCall = time - lastCallTime,
|
|
4119
|
+
timeSinceLastInvoke = time - lastInvokeTime;
|
|
4418
4120
|
|
|
4419
|
-
|
|
4420
|
-
|
|
4121
|
+
// Either this is the first call, activity has stopped and we're at the
|
|
4122
|
+
// trailing edge, the system time has gone backwards and we're treating
|
|
4123
|
+
// it as the trailing edge, or we've hit the `maxWait` limit.
|
|
4124
|
+
return (lastCallTime === undefined || (timeSinceLastCall >= wait) ||
|
|
4125
|
+
(timeSinceLastCall < 0) || (maxing && timeSinceLastInvoke >= maxWait));
|
|
4126
|
+
}
|
|
4421
4127
|
|
|
4422
|
-
|
|
4128
|
+
function timerExpired() {
|
|
4129
|
+
var time = now();
|
|
4130
|
+
if (shouldInvoke(time)) {
|
|
4131
|
+
return trailingEdge(time);
|
|
4132
|
+
}
|
|
4133
|
+
// Restart the timer.
|
|
4134
|
+
timerId = setTimeout(timerExpired, remainingWait(time));
|
|
4135
|
+
}
|
|
4423
4136
|
|
|
4424
|
-
|
|
4137
|
+
function trailingEdge(time) {
|
|
4138
|
+
timerId = undefined;
|
|
4425
4139
|
|
|
4426
|
-
|
|
4427
|
-
|
|
4140
|
+
// Only invoke if we have `lastArgs` which means `func` has been
|
|
4141
|
+
// debounced at least once.
|
|
4142
|
+
if (trailing && lastArgs) {
|
|
4143
|
+
return invokeFunc(time);
|
|
4144
|
+
}
|
|
4145
|
+
lastArgs = lastThis = undefined;
|
|
4146
|
+
return result;
|
|
4147
|
+
}
|
|
4428
4148
|
|
|
4429
|
-
|
|
4430
|
-
|
|
4149
|
+
function cancel() {
|
|
4150
|
+
if (timerId !== undefined) {
|
|
4151
|
+
clearTimeout(timerId);
|
|
4152
|
+
}
|
|
4153
|
+
lastInvokeTime = 0;
|
|
4154
|
+
lastArgs = lastCallTime = lastThis = timerId = undefined;
|
|
4155
|
+
}
|
|
4431
4156
|
|
|
4432
|
-
|
|
4433
|
-
|
|
4434
|
-
|
|
4435
|
-
* of values.
|
|
4436
|
-
*/
|
|
4437
|
-
var nativeObjectToString$1 = objectProto$1.toString;
|
|
4157
|
+
function flush() {
|
|
4158
|
+
return timerId === undefined ? result : trailingEdge(now());
|
|
4159
|
+
}
|
|
4438
4160
|
|
|
4439
|
-
|
|
4440
|
-
var
|
|
4441
|
-
|
|
4442
|
-
/**
|
|
4443
|
-
* A specialized version of `baseGetTag` which ignores `Symbol.toStringTag` values.
|
|
4444
|
-
*
|
|
4445
|
-
* @private
|
|
4446
|
-
* @param {*} value The value to query.
|
|
4447
|
-
* @returns {string} Returns the raw `toStringTag`.
|
|
4448
|
-
*/
|
|
4449
|
-
function getRawTag$1(value) {
|
|
4450
|
-
var isOwn = hasOwnProperty.call(value, symToStringTag$1),
|
|
4451
|
-
tag = value[symToStringTag$1];
|
|
4161
|
+
function debounced() {
|
|
4162
|
+
var time = now(),
|
|
4163
|
+
isInvoking = shouldInvoke(time);
|
|
4452
4164
|
|
|
4453
|
-
|
|
4454
|
-
|
|
4455
|
-
|
|
4456
|
-
} catch (e) {}
|
|
4165
|
+
lastArgs = arguments;
|
|
4166
|
+
lastThis = this;
|
|
4167
|
+
lastCallTime = time;
|
|
4457
4168
|
|
|
4458
|
-
|
|
4459
|
-
|
|
4460
|
-
|
|
4461
|
-
|
|
4462
|
-
|
|
4463
|
-
|
|
4169
|
+
if (isInvoking) {
|
|
4170
|
+
if (timerId === undefined) {
|
|
4171
|
+
return leadingEdge(lastCallTime);
|
|
4172
|
+
}
|
|
4173
|
+
if (maxing) {
|
|
4174
|
+
// Handle invocations in a tight loop.
|
|
4175
|
+
clearTimeout(timerId);
|
|
4176
|
+
timerId = setTimeout(timerExpired, wait);
|
|
4177
|
+
return invokeFunc(lastCallTime);
|
|
4178
|
+
}
|
|
4464
4179
|
}
|
|
4180
|
+
if (timerId === undefined) {
|
|
4181
|
+
timerId = setTimeout(timerExpired, wait);
|
|
4182
|
+
}
|
|
4183
|
+
return result;
|
|
4465
4184
|
}
|
|
4466
|
-
|
|
4185
|
+
debounced.cancel = cancel;
|
|
4186
|
+
debounced.flush = flush;
|
|
4187
|
+
return debounced;
|
|
4467
4188
|
}
|
|
4468
4189
|
|
|
4469
|
-
var
|
|
4190
|
+
var debounce_1 = debounce;
|
|
4470
4191
|
|
|
4471
|
-
|
|
4192
|
+
var css_248z$l = ".gn-composite-bar-highlighted-item {\n position: absolute;\n z-index: 10000;\n display: flex;\n justify-content: center;\n}\n.gn-composite-bar-highlighted-item__icon {\n width: var(--gn-aside-header-item-icon-background-size);\n height: var(--gn-aside-header-item-icon-background-size);\n border-radius: 7px;\n cursor: pointer;\n background-color: var(--g-color-base-background);\n display: flex;\n justify-content: center;\n align-items: center;\n position: relative;\n transform: translateY(1px);\n overflow: hidden;\n box-shadow: 0 8px 20px 0 var(--g-color-sfx-shadow);\n}\n.gn-composite-bar-highlighted-item__icon::before {\n content: \"\";\n position: absolute;\n width: 100%;\n height: 100%;\n z-index: -1;\n background-color: var(--g-color-base-selection);\n}\n.gn-composite-bar-highlighted-item__icon:hover::before {\n background-color: var(--g-color-base-selection-hover);\n}";
|
|
4193
|
+
styleInject(css_248z$l);
|
|
4472
4194
|
|
|
4473
|
-
|
|
4195
|
+
const b$m = block('composite-bar-highlighted-item');
|
|
4196
|
+
const DEBOUNCE_TIME = 200;
|
|
4197
|
+
const HighlightedItem = ({ iconRef, iconNode, onClick, onClickCapture, openModalSubscriber, }) => {
|
|
4198
|
+
const [{ top, left, width, height }, setPosition] = React.useState({
|
|
4199
|
+
top: 0,
|
|
4200
|
+
left: 0,
|
|
4201
|
+
width: 0,
|
|
4202
|
+
height: 0,
|
|
4203
|
+
});
|
|
4204
|
+
const [isModalOpen, setIsModalOpen] = React.useState(false);
|
|
4205
|
+
const handleResize = React.useCallback(debounce_1(() => {
|
|
4206
|
+
var _a;
|
|
4207
|
+
const { top = 0, left = 0, width = 0, height = 0, } = ((_a = iconRef === null || iconRef === void 0 ? void 0 : iconRef.current) === null || _a === void 0 ? void 0 : _a.getBoundingClientRect()) || {};
|
|
4208
|
+
setPosition({
|
|
4209
|
+
top: top + window.scrollY,
|
|
4210
|
+
left: left + window.scrollX,
|
|
4211
|
+
width,
|
|
4212
|
+
height,
|
|
4213
|
+
});
|
|
4214
|
+
}, DEBOUNCE_TIME, { leading: true }), []);
|
|
4215
|
+
React.useEffect(() => {
|
|
4216
|
+
if (!isModalOpen) {
|
|
4217
|
+
return;
|
|
4218
|
+
}
|
|
4219
|
+
handleResize();
|
|
4220
|
+
window.addEventListener('resize', handleResize);
|
|
4221
|
+
return () => window.removeEventListener('resize', handleResize);
|
|
4222
|
+
}, [handleResize, isModalOpen]);
|
|
4223
|
+
openModalSubscriber === null || openModalSubscriber === void 0 ? void 0 : openModalSubscriber((open) => {
|
|
4224
|
+
setIsModalOpen(open);
|
|
4225
|
+
});
|
|
4226
|
+
if (!iconNode || !isModalOpen) {
|
|
4227
|
+
return null;
|
|
4228
|
+
}
|
|
4229
|
+
return (React__default["default"].createElement(uikit.Portal, null,
|
|
4230
|
+
React__default["default"].createElement("div", { className: b$m(), style: { left, top, width, height }, onClick: onClick, onClickCapture: onClickCapture, "data-toast": true },
|
|
4231
|
+
React__default["default"].createElement("div", { className: b$m('icon') }, iconNode))));
|
|
4232
|
+
};
|
|
4233
|
+
HighlightedItem.displayName = 'HighlightedItem';
|
|
4474
4234
|
|
|
4475
|
-
|
|
4476
|
-
|
|
4477
|
-
* [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)
|
|
4478
|
-
* of values.
|
|
4479
|
-
*/
|
|
4480
|
-
var nativeObjectToString = objectProto.toString;
|
|
4235
|
+
var css_248z$k = ".gn-composite-bar-item {\n --gn-composite-bar-item-action-size: 36px;\n display: flex;\n width: 100%;\n height: 100%;\n align-items: center;\n cursor: pointer;\n}\n.gn-composite-bar-item__icon {\n color: var(--g-color-text-misc);\n}\n.gn-footer-item .gn-composite-bar-item__icon, .gn-composite-bar-highlighted-item .gn-composite-bar-item__icon {\n color: var(--gn-aside-header-footer-item-icon-color);\n}\n.gn-composite-bar_subheader .gn-composite-bar-item__icon {\n color: var(--gn-aside-header-subheader-item-icon-color);\n}\n.gn-composite-bar-item__icon-place {\n flex-shrink: 0;\n width: var(--gn-aside-header-min-width);\n display: flex;\n align-items: center;\n justify-content: center;\n height: 100%;\n}\n.gn-composite-bar-item__title {\n display: flex;\n overflow: hidden;\n}\n.gn-composite-bar-item__title-text {\n white-space: nowrap;\n text-overflow: ellipsis;\n overflow: hidden;\n}\n.gn-composite-bar-item__title-adornment {\n margin: 0 10px;\n}\n.gn-composite-bar-item__collapse-item {\n display: flex;\n padding: 0 16px;\n align-items: center;\n width: 100%;\n height: 100%;\n cursor: pointer;\n}\n.gn-composite-bar-item__collapse-item .gn-composite-bar-item__title-adornment {\n margin-right: 0;\n}\n.gn-composite-bar-item__menu-divider {\n margin: 0 8px;\n width: 100%;\n border-top: 1px solid var(--g-color-line-generic);\n cursor: default;\n}\n.gn-composite-bar-item__collapse-items-popup-content {\n padding: 4px 0;\n}\n.gn-composite-bar-item__link {\n display: flex;\n width: 100%;\n height: 100%;\n align-items: center;\n}\n.gn-composite-bar-item__link, .gn-composite-bar-item__link:hover, .gn-composite-bar-item__link:active, .gn-composite-bar-item__link:visited, .gn-composite-bar-item__link:focus {\n text-decoration: none;\n outline: none;\n color: inherit;\n}\n.gn-composite-bar-item__btn-icon {\n width: 100%;\n height: 100%;\n display: flex;\n align-items: center;\n justify-content: center;\n}\n.gn-composite-bar-item_type_action {\n justify-content: center;\n height: var(--gn-composite-bar-item-action-size);\n margin: 0 10px 8px;\n background: var(--g-color-base-float);\n box-shadow: 0px 0px 0px 1px rgba(0, 0, 0, 0.03), 0px 5px 6px rgba(0, 0, 0, 0.12);\n border-radius: var(--gn-composite-bar-item-action-size);\n transition: transform 0.1s ease-out, background-color 0.15s linear;\n}\n.gn-composite-bar-item_type_action:focus {\n box-shadow: 0 0 0 2px var(--g-color-line-misc);\n}\n.gn-composite-bar-item_type_action:focus:not(:focus-visible) {\n box-shadow: none;\n}\n.gn-composite-bar-item_type_action:hover {\n background-color: var(--g-color-base-float-hover);\n}\n.gn-composite-bar-item_type_action:active {\n box-shadow: 0 1px 2px var(--g-color-sfx-shadow);\n transition: none;\n transform: scale(0.96);\n}\n.gn-composite-bar-item_type_action .gn-composite-bar-item__icon-place {\n width: var(--gn-composite-bar-item-action-size);\n}\n.gn-composite-bar-item_type_action .gn-composite-bar-item__title {\n margin-right: 16px;\n}\n.gn-composite-bar-item__icon-tooltip_item-type_action {\n margin-left: 10px;\n}\n.gn-composite-bar-item:not(.gn-composite-bar-item_compact).gn-composite-bar-item_current.gn-composite-bar-item_type_regular {\n background-color: var(--g-color-base-selection);\n}\n.gn-composite-bar-item:not(.gn-composite-bar-item_compact):not(.gn-composite-bar-item_current):hover.gn-composite-bar-item_type_regular {\n background-color: var(--g-color-base-simple-hover);\n}\n.gn-composite-bar-item_compact.gn-composite-bar-item_type_action {\n width: var(--gn-composite-bar-item-action-size);\n}\n.gn-composite-bar-item_compact.gn-composite-bar-item_type_action .gn-composite-bar-item__title {\n margin: 0;\n}\n.gn-composite-bar-item_compact.gn-composite-bar-item_current.gn-composite-bar-item_type_regular .gn-composite-bar-item__btn-icon {\n position: relative;\n background-color: transparent;\n}\n.gn-composite-bar-item_compact.gn-composite-bar-item_current.gn-composite-bar-item_type_regular .gn-composite-bar-item__btn-icon::before {\n content: \"\";\n position: absolute;\n top: 50%;\n left: 50%;\n z-index: -1;\n width: var(--gn-aside-header-item-icon-background-size);\n height: var(--gn-aside-header-item-icon-background-size);\n margin-top: -19px;\n margin-left: -19px;\n border-radius: 7px;\n}\n.gn-composite-bar-item_compact.gn-composite-bar-item_current.gn-composite-bar-item_type_regular .gn-composite-bar-item__btn-icon::before {\n background-color: var(--g-color-base-selection);\n}\n.gn-composite-bar-item_compact:not(.gn-composite-bar-item_current):hover.gn-composite-bar-item_type_regular .gn-composite-bar-item__btn-icon {\n position: relative;\n background-color: transparent;\n}\n.gn-composite-bar-item_compact:not(.gn-composite-bar-item_current):hover.gn-composite-bar-item_type_regular .gn-composite-bar-item__btn-icon::before {\n content: \"\";\n position: absolute;\n top: 50%;\n left: 50%;\n z-index: -1;\n width: var(--gn-aside-header-item-icon-background-size);\n height: var(--gn-aside-header-item-icon-background-size);\n margin-top: -19px;\n margin-left: -19px;\n border-radius: 7px;\n}\n.gn-composite-bar-item_compact:not(.gn-composite-bar-item_current):hover.gn-composite-bar-item_type_regular .gn-composite-bar-item__btn-icon::before {\n background-color: var(--g-color-base-simple-hover);\n}";
|
|
4236
|
+
styleInject(css_248z$k);
|
|
4481
4237
|
|
|
4482
|
-
|
|
4483
|
-
|
|
4484
|
-
|
|
4485
|
-
|
|
4486
|
-
|
|
4487
|
-
|
|
4488
|
-
|
|
4489
|
-
|
|
4490
|
-
|
|
4238
|
+
const b$l = block('composite-bar-item');
|
|
4239
|
+
function renderItemTitle(item) {
|
|
4240
|
+
let titleNode = React__default["default"].createElement("div", { className: b$l('title-text') }, item.title);
|
|
4241
|
+
if (item.rightAdornment) {
|
|
4242
|
+
titleNode = (React__default["default"].createElement(React__default["default"].Fragment, null,
|
|
4243
|
+
titleNode,
|
|
4244
|
+
React__default["default"].createElement("div", { className: b$l('title-adornment') }, item.rightAdornment)));
|
|
4245
|
+
}
|
|
4246
|
+
return titleNode;
|
|
4247
|
+
}
|
|
4248
|
+
const defaultPopupPlacement = ['right-end'];
|
|
4249
|
+
const defaultPopupOffset = [-20, 8];
|
|
4250
|
+
const Item$1 = (props) => {
|
|
4251
|
+
const { item, className, collapseItems, onMouseLeave, onMouseEnter, enableTooltip = true, popupVisible = false, popupAnchor, popupPlacement = defaultPopupPlacement, popupOffset = defaultPopupOffset, popupKeepMounted, renderPopupContent, onClosePopup, onItemClick, onItemClickCapture, bringForward, openModalSubscriber, } = props;
|
|
4252
|
+
const { compact } = useAsideHeaderContext();
|
|
4253
|
+
if (item.type === 'divider') {
|
|
4254
|
+
return React__default["default"].createElement("div", { className: b$l('menu-divider') });
|
|
4255
|
+
}
|
|
4256
|
+
const [open, toggleOpen] = React__default["default"].useState(false);
|
|
4257
|
+
const ref = React__default["default"].useRef(null);
|
|
4258
|
+
const anchorRef = popupAnchor || ref;
|
|
4259
|
+
const highlightedRef = React__default["default"].useRef(null);
|
|
4260
|
+
const type = item.type || ITEM_TYPE_REGULAR;
|
|
4261
|
+
const current = item.current || false;
|
|
4262
|
+
const tooltipText = item.tooltipText || item.title;
|
|
4263
|
+
const icon = item.icon;
|
|
4264
|
+
const iconSize = item.iconSize || ASIDE_HEADER_ICON_SIZE;
|
|
4265
|
+
const collapsedItem = item.id === COLLAPSE_ITEM_ID;
|
|
4266
|
+
const onClose = React__default["default"].useCallback((event) => {
|
|
4267
|
+
var _a;
|
|
4268
|
+
if (event instanceof MouseEvent &&
|
|
4269
|
+
event.target &&
|
|
4270
|
+
((_a = ref.current) === null || _a === void 0 ? void 0 : _a.contains(event.target))) {
|
|
4271
|
+
return;
|
|
4272
|
+
}
|
|
4273
|
+
onClosePopup === null || onClosePopup === void 0 ? void 0 : onClosePopup();
|
|
4274
|
+
}, [onClosePopup]);
|
|
4275
|
+
const makeIconNode = (iconEl) => {
|
|
4276
|
+
return compact ? (React__default["default"].createElement(uikit.Tooltip, { content: tooltipText, disabled: !enableTooltip || (collapsedItem && open) || popupVisible, placement: "right", className: b$l('icon-tooltip', { 'item-type': type }) },
|
|
4277
|
+
React__default["default"].createElement("div", { onMouseEnter: () => onMouseEnter === null || onMouseEnter === void 0 ? void 0 : onMouseEnter(), onMouseLeave: () => onMouseLeave === null || onMouseLeave === void 0 ? void 0 : onMouseLeave(), className: b$l('btn-icon') }, iconEl))) : (iconEl);
|
|
4278
|
+
};
|
|
4279
|
+
const makeNode = ({ icon: iconEl, title: titleEl }) => {
|
|
4280
|
+
const createdNode = (React__default["default"].createElement("div", { className: b$l({ type, current, compact }, className), ref: ref, onClick: (event) => {
|
|
4281
|
+
if (collapsedItem) {
|
|
4282
|
+
/**
|
|
4283
|
+
* If we call onItemClick for collapsedItem then:
|
|
4284
|
+
* - User get unexpected item in onItemClick callback
|
|
4285
|
+
* - onClosePanel calls twice for each popuped item, as result it will prevent opening of panelItems
|
|
4286
|
+
*/
|
|
4287
|
+
toggleOpen(!open);
|
|
4288
|
+
}
|
|
4289
|
+
else {
|
|
4290
|
+
onItemClick === null || onItemClick === void 0 ? void 0 : onItemClick(item, false, event);
|
|
4291
|
+
}
|
|
4292
|
+
}, onClickCapture: onItemClickCapture, onMouseEnter: () => {
|
|
4293
|
+
if (!compact) {
|
|
4294
|
+
onMouseEnter === null || onMouseEnter === void 0 ? void 0 : onMouseEnter();
|
|
4295
|
+
}
|
|
4296
|
+
}, onMouseLeave: () => {
|
|
4297
|
+
if (!compact) {
|
|
4298
|
+
onMouseLeave === null || onMouseLeave === void 0 ? void 0 : onMouseLeave();
|
|
4299
|
+
}
|
|
4300
|
+
} },
|
|
4301
|
+
React__default["default"].createElement("div", { className: b$l('icon-place'), ref: highlightedRef }, makeIconNode(iconEl)),
|
|
4302
|
+
React__default["default"].createElement("div", { className: b$l('title'), title: typeof item.title === 'string' ? item.title : undefined }, titleEl),
|
|
4303
|
+
renderPopupContent && Boolean(anchorRef === null || anchorRef === void 0 ? void 0 : anchorRef.current) && (React__default["default"].createElement(uikit.Popup, { contentClassName: b$l('popup'), open: popupVisible, keepMounted: popupKeepMounted, placement: popupPlacement, offset: popupOffset, anchorRef: anchorRef, onClose: onClose }, renderPopupContent()))));
|
|
4304
|
+
return item.link ? (React__default["default"].createElement("a", { href: item.link, className: b$l('link') }, createdNode)) : (createdNode);
|
|
4305
|
+
};
|
|
4306
|
+
const iconNode = icon ? React__default["default"].createElement(uikit.Icon, { data: icon, size: iconSize, className: b$l('icon') }) : null;
|
|
4307
|
+
const titleNode = renderItemTitle(item);
|
|
4308
|
+
const params = { icon: iconNode, title: titleNode };
|
|
4309
|
+
let node;
|
|
4310
|
+
const opts = { compact, collapsed: false, item, ref };
|
|
4311
|
+
if (typeof item.itemWrapper === 'function') {
|
|
4312
|
+
node = item.itemWrapper(params, makeNode, opts);
|
|
4313
|
+
}
|
|
4314
|
+
else {
|
|
4315
|
+
node = makeNode(params);
|
|
4316
|
+
}
|
|
4317
|
+
const highlightedNode = makeIconNode(iconNode);
|
|
4318
|
+
return (React__default["default"].createElement(React__default["default"].Fragment, null,
|
|
4319
|
+
bringForward && (React__default["default"].createElement(HighlightedItem, { iconNode: highlightedNode, iconRef: highlightedRef, onClick: (event) => onItemClick === null || onItemClick === void 0 ? void 0 : onItemClick(item, false, event), onClickCapture: onItemClickCapture, openModalSubscriber: openModalSubscriber })),
|
|
4320
|
+
node,
|
|
4321
|
+
open && collapsedItem && (collapseItems === null || collapseItems === void 0 ? void 0 : collapseItems.length) && Boolean(anchorRef === null || anchorRef === void 0 ? void 0 : anchorRef.current) && (React__default["default"].createElement(CollapsedPopup, Object.assign({}, props, { anchorRef: ref, onClose: () => toggleOpen(false) })))));
|
|
4322
|
+
};
|
|
4323
|
+
Item$1.displayName = 'Item';
|
|
4324
|
+
function CollapsedPopup({ onItemClick, collapseItems, anchorRef, onClose, }) {
|
|
4325
|
+
const { compact } = useAsideHeaderContext();
|
|
4326
|
+
return (collapseItems === null || collapseItems === void 0 ? void 0 : collapseItems.length) ? (React__default["default"].createElement(uikit.Popup, { placement: POPUP_PLACEMENT, open: true, anchorRef: anchorRef, onClose: onClose },
|
|
4327
|
+
React__default["default"].createElement("div", { className: b$l('collapse-items-popup-content') },
|
|
4328
|
+
React__default["default"].createElement(uikit.List, { itemClassName: b$l('root-collapse-item'), items: collapseItems, selectedItemIndex: getSelectedItemIndex$1(collapseItems), itemHeight: POPUP_ITEM_HEIGHT, itemsHeight: collapseItems.length * POPUP_ITEM_HEIGHT, virtualized: false, filterable: false, sortable: false, renderItem: (collapseItem) => {
|
|
4329
|
+
const makeCollapseNode = ({ title: titleEl }) => {
|
|
4330
|
+
const res = (React__default["default"].createElement("div", { className: b$l('collapse-item'), onClick: (event) => {
|
|
4331
|
+
onItemClick === null || onItemClick === void 0 ? void 0 : onItemClick(collapseItem, true, event);
|
|
4332
|
+
} }, titleEl));
|
|
4333
|
+
return collapseItem.link ? (React__default["default"].createElement("a", { href: collapseItem.link, className: b$l('link') }, res)) : (res);
|
|
4334
|
+
};
|
|
4335
|
+
const titleNode = renderItemTitle(collapseItem);
|
|
4336
|
+
const params = { title: titleNode };
|
|
4337
|
+
const opts = { compact, collapsed: true, item: collapseItem, ref: anchorRef };
|
|
4338
|
+
if (typeof collapseItem.itemWrapper === 'function') {
|
|
4339
|
+
return collapseItem.itemWrapper(params, makeCollapseNode, opts);
|
|
4340
|
+
}
|
|
4341
|
+
else {
|
|
4342
|
+
return makeCollapseNode(params);
|
|
4343
|
+
}
|
|
4344
|
+
} })))) : null;
|
|
4491
4345
|
}
|
|
4492
4346
|
|
|
4493
|
-
|
|
4494
|
-
|
|
4495
|
-
|
|
4496
|
-
|
|
4497
|
-
|
|
4347
|
+
const multipleTooltipContextDefaults = {
|
|
4348
|
+
active: false,
|
|
4349
|
+
activeIndex: undefined,
|
|
4350
|
+
hideCollapseItemTooltip: false,
|
|
4351
|
+
lastClickedItemIndex: undefined,
|
|
4352
|
+
setValue: () => { },
|
|
4353
|
+
};
|
|
4354
|
+
const MultipleTooltipContext = React__default["default"].createContext(multipleTooltipContextDefaults);
|
|
4355
|
+
class MultipleTooltipProvider extends React__default["default"].PureComponent {
|
|
4356
|
+
constructor() {
|
|
4357
|
+
super(...arguments);
|
|
4358
|
+
this.state = Object.assign({}, multipleTooltipContextDefaults);
|
|
4359
|
+
this.setValue = (value) => {
|
|
4360
|
+
this.setState(Object.assign({}, value));
|
|
4361
|
+
};
|
|
4362
|
+
}
|
|
4363
|
+
render() {
|
|
4364
|
+
const { children } = this.props;
|
|
4365
|
+
return (React__default["default"].createElement(MultipleTooltipContext.Provider, { value: Object.assign(Object.assign({}, this.state), { setValue: this.setValue }) }, children));
|
|
4366
|
+
}
|
|
4367
|
+
}
|
|
4498
4368
|
|
|
4499
|
-
|
|
4500
|
-
|
|
4501
|
-
undefinedTag = '[object Undefined]';
|
|
4369
|
+
var css_248z$j = ".g-root_theme_dark .gn-multiple-tooltip,\n.g-root_theme_dark-hc .gn-multiple-tooltip {\n --multiple-tooltip-item-bg-color: #424147;\n --multiple-tooltip-item-active-bg-color: var(--g-color-base-float-heavy);\n --multiple-tooltip-backdrop-background: linear-gradient(\n 90deg,\n #313036 0%,\n rgba(49, 48, 54, 0.3) 100%\n );\n --multiple-tooltip-backdrop-filter: blur(16px);\n}\n\n.g-root_theme_light .gn-multiple-tooltip,\n.g-root_theme_light-hc .gn-multiple-tooltip {\n --multiple-tooltip-item-bg-color: #7a7a7a;\n --multiple-tooltip-item-active-bg-color: var(--g-color-base-float-heavy);\n --multiple-tooltip-backdrop-background: linear-gradient(\n 90deg,\n #ffffff 0%,\n rgba(255, 255, 255, 0.3) 100%\n );\n --multiple-tooltip-backdrop-filter: blur(12px);\n}\n\n.gn-multiple-tooltip {\n background-color: transparent;\n box-shadow: none;\n}\n.gn-multiple-tooltip::before {\n content: \"\";\n box-shadow: none;\n position: absolute;\n width: 100%;\n height: 100%;\n z-index: -1;\n background: var(--multiple-tooltip-backdrop-background);\n filter: var(--multiple-tooltip-backdrop-filter);\n}\n.gn-multiple-tooltip__items-container {\n display: flex;\n flex-direction: column;\n align-items: flex-start;\n padding: 32px 40px 32px 12px;\n}\n.gn-multiple-tooltip__item {\n display: flex;\n box-sizing: border-box;\n height: 30px;\n padding: 8px 12px;\n background-color: var(--multiple-tooltip-item-bg-color);\n position: relative;\n border-radius: 5px;\n align-items: center;\n color: var(--g-color-text-light-primary);\n margin-bottom: 5px;\n transition: transform 100ms ease-in-out;\n}\n.gn-multiple-tooltip__item:not(.gn-multiple-tooltip__item_divider) + .gn-multiple-tooltip__item:not(.gn-multiple-tooltip__item_divider), .gn-multiple-tooltip__item:first-child {\n margin-top: 5px;\n}\n.gn-multiple-tooltip__item_divider + .gn-multiple-tooltip__item:not(.gn-multiple-tooltip__item_divider) {\n margin-top: 4px;\n}\n.gn-multiple-tooltip__item_active {\n background-color: var(--multiple-tooltip-item-active-bg-color);\n transform: translateX(-12px);\n}\n.gn-multiple-tooltip__item_divider {\n height: 15px;\n visibility: hidden;\n margin: 0;\n}";
|
|
4370
|
+
styleInject(css_248z$j);
|
|
4502
4371
|
|
|
4503
|
-
|
|
4504
|
-
|
|
4372
|
+
const b$k = block('multiple-tooltip');
|
|
4373
|
+
const POPUP_OFFSET = [-32, 4];
|
|
4374
|
+
const POPUP_MODIFIERS = [
|
|
4375
|
+
{
|
|
4376
|
+
name: 'preventOverflow',
|
|
4377
|
+
enabled: false,
|
|
4378
|
+
},
|
|
4379
|
+
];
|
|
4380
|
+
const MultipleTooltip = ({ items, open, anchorRef, placement, }) => {
|
|
4381
|
+
const { activeIndex, hideCollapseItemTooltip } = React__default["default"].useContext(MultipleTooltipContext);
|
|
4382
|
+
const activeItem = activeIndex === undefined ? null : items[activeIndex];
|
|
4383
|
+
return (React__default["default"].createElement(uikit.Popup, { open: open, anchorRef: anchorRef, placement: placement, offset: POPUP_OFFSET, contentClassName: b$k(null), modifiers: POPUP_MODIFIERS },
|
|
4384
|
+
React__default["default"].createElement("div", { className: b$k('items-container') }, items
|
|
4385
|
+
.filter(({ type = 'regular', id }) => !hideCollapseItemTooltip ||
|
|
4386
|
+
(id !== COLLAPSE_ITEM_ID && type !== 'action'))
|
|
4387
|
+
.map((item, idx) => {
|
|
4388
|
+
switch (item.type) {
|
|
4389
|
+
case 'divider':
|
|
4390
|
+
return (React__default["default"].createElement("div", { className: b$k('item', { divider: true }), key: idx }, item.title));
|
|
4391
|
+
default:
|
|
4392
|
+
return (React__default["default"].createElement("div", { className: b$k('item', {
|
|
4393
|
+
active: item === activeItem,
|
|
4394
|
+
}), key: idx }, item.title));
|
|
4395
|
+
}
|
|
4396
|
+
}))));
|
|
4397
|
+
};
|
|
4505
4398
|
|
|
4506
|
-
|
|
4507
|
-
|
|
4508
|
-
*
|
|
4509
|
-
* @private
|
|
4510
|
-
* @param {*} value The value to query.
|
|
4511
|
-
* @returns {string} Returns the `toStringTag`.
|
|
4512
|
-
*/
|
|
4513
|
-
function baseGetTag$1(value) {
|
|
4514
|
-
if (value == null) {
|
|
4515
|
-
return value === undefined ? undefinedTag : nullTag;
|
|
4516
|
-
}
|
|
4517
|
-
return (symToStringTag && symToStringTag in Object(value))
|
|
4518
|
-
? getRawTag(value)
|
|
4519
|
-
: objectToString(value);
|
|
4520
|
-
}
|
|
4399
|
+
var css_248z$i = ".gn-composite-bar {\n flex: 1 0 auto;\n width: 100%;\n min-height: 40px;\n}\n.gn-composite-bar .gn-composite-bar__root-menu-item[class] {\n background-color: transparent;\n}";
|
|
4400
|
+
styleInject(css_248z$i);
|
|
4521
4401
|
|
|
4522
|
-
|
|
4402
|
+
const b$j = block('composite-bar');
|
|
4403
|
+
const CompositeBarView = ({ type, items, onItemClick, collapseItems, multipleTooltip = false, }) => {
|
|
4404
|
+
const ref = React.useRef(null);
|
|
4405
|
+
const tooltipRef = React.useRef(null);
|
|
4406
|
+
const { setValue: setMultipleTooltipContextValue, active: multipleTooltipActive, activeIndex, lastClickedItemIndex, } = React.useContext(MultipleTooltipContext);
|
|
4407
|
+
const { compact } = useAsideHeaderContext();
|
|
4408
|
+
React__default["default"].useEffect(() => {
|
|
4409
|
+
function handleBlurWindow() {
|
|
4410
|
+
if (multipleTooltip && multipleTooltipActive) {
|
|
4411
|
+
setMultipleTooltipContextValue({ active: false });
|
|
4412
|
+
}
|
|
4413
|
+
}
|
|
4414
|
+
window.addEventListener('blur', handleBlurWindow);
|
|
4415
|
+
return () => {
|
|
4416
|
+
window.removeEventListener('blur', handleBlurWindow);
|
|
4417
|
+
};
|
|
4418
|
+
}, [multipleTooltip, multipleTooltipActive, setMultipleTooltipContextValue]);
|
|
4419
|
+
const onTooltipMouseEnter = React.useCallback((e) => {
|
|
4420
|
+
if (multipleTooltip &&
|
|
4421
|
+
compact &&
|
|
4422
|
+
!multipleTooltipActive &&
|
|
4423
|
+
document.hasFocus() &&
|
|
4424
|
+
activeIndex !== lastClickedItemIndex &&
|
|
4425
|
+
e.clientX <= ASIDE_HEADER_COMPACT_WIDTH) {
|
|
4426
|
+
setMultipleTooltipContextValue === null || setMultipleTooltipContextValue === void 0 ? void 0 : setMultipleTooltipContextValue({
|
|
4427
|
+
active: true,
|
|
4428
|
+
});
|
|
4429
|
+
}
|
|
4430
|
+
}, [
|
|
4431
|
+
multipleTooltip,
|
|
4432
|
+
compact,
|
|
4433
|
+
multipleTooltipActive,
|
|
4434
|
+
activeIndex,
|
|
4435
|
+
lastClickedItemIndex,
|
|
4436
|
+
setMultipleTooltipContextValue,
|
|
4437
|
+
]);
|
|
4438
|
+
const onTooltipMouseLeave = React.useCallback(() => {
|
|
4439
|
+
if (multipleTooltip && multipleTooltipActive && document.hasFocus()) {
|
|
4440
|
+
setMultipleTooltipContextValue === null || setMultipleTooltipContextValue === void 0 ? void 0 : setMultipleTooltipContextValue({
|
|
4441
|
+
active: false,
|
|
4442
|
+
lastClickedItemIndex: undefined,
|
|
4443
|
+
});
|
|
4444
|
+
}
|
|
4445
|
+
}, [multipleTooltipActive, setMultipleTooltipContextValue]);
|
|
4446
|
+
const onMouseEnterByIndex = React.useCallback((itemIndex) => () => {
|
|
4447
|
+
if (multipleTooltip) {
|
|
4448
|
+
let multipleTooltipActiveValue = multipleTooltipActive;
|
|
4449
|
+
if (!multipleTooltipActive && itemIndex !== lastClickedItemIndex) {
|
|
4450
|
+
multipleTooltipActiveValue = true;
|
|
4451
|
+
}
|
|
4452
|
+
if (activeIndex === itemIndex &&
|
|
4453
|
+
multipleTooltipActive === multipleTooltipActiveValue) {
|
|
4454
|
+
return;
|
|
4455
|
+
}
|
|
4456
|
+
setMultipleTooltipContextValue({
|
|
4457
|
+
activeIndex: itemIndex,
|
|
4458
|
+
active: multipleTooltipActiveValue,
|
|
4459
|
+
});
|
|
4460
|
+
}
|
|
4461
|
+
}, [multipleTooltipActive, activeIndex, lastClickedItemIndex, setMultipleTooltipContextValue]);
|
|
4462
|
+
const onMouseLeave = React.useCallback(() => {
|
|
4463
|
+
var _a;
|
|
4464
|
+
if (compact) {
|
|
4465
|
+
(_a = ref.current) === null || _a === void 0 ? void 0 : _a.activateItem(undefined);
|
|
4466
|
+
if (multipleTooltip &&
|
|
4467
|
+
(activeIndex !== undefined || lastClickedItemIndex !== undefined)) {
|
|
4468
|
+
setMultipleTooltipContextValue({
|
|
4469
|
+
activeIndex: undefined,
|
|
4470
|
+
lastClickedItemIndex: undefined,
|
|
4471
|
+
});
|
|
4472
|
+
}
|
|
4473
|
+
}
|
|
4474
|
+
}, [activeIndex, lastClickedItemIndex, setMultipleTooltipContextValue]);
|
|
4475
|
+
const onItemClickByIndex = React.useCallback((itemIndex) => (item, collapsed, event) => {
|
|
4476
|
+
if (compact &&
|
|
4477
|
+
multipleTooltip &&
|
|
4478
|
+
itemIndex !== lastClickedItemIndex &&
|
|
4479
|
+
item.id !== COLLAPSE_ITEM_ID) {
|
|
4480
|
+
setMultipleTooltipContextValue({
|
|
4481
|
+
lastClickedItemIndex: itemIndex,
|
|
4482
|
+
active: false,
|
|
4483
|
+
});
|
|
4484
|
+
}
|
|
4485
|
+
onItemClick === null || onItemClick === void 0 ? void 0 : onItemClick(item, collapsed, event);
|
|
4486
|
+
}, [lastClickedItemIndex, setMultipleTooltipContextValue]);
|
|
4487
|
+
return (React__default["default"].createElement(React__default["default"].Fragment, null,
|
|
4488
|
+
React__default["default"].createElement("div", { ref: tooltipRef, onMouseEnter: onTooltipMouseEnter, onMouseLeave: onTooltipMouseLeave },
|
|
4489
|
+
React__default["default"].createElement(uikit.List, { ref: ref, items: items, selectedItemIndex: type === 'menu' ? getSelectedItemIndex$1(items) : undefined, itemHeight: getItemHeight$1, itemsHeight: getItemsHeight, itemClassName: b$j('root-menu-item'), virtualized: false, filterable: false, sortable: false, renderItem: (item, _isItemActive, itemIndex) => {
|
|
4490
|
+
const itemExtraProps = isMenuItem(item) ? { item } : item;
|
|
4491
|
+
const enableTooltip = isMenuItem(item)
|
|
4492
|
+
? !multipleTooltip
|
|
4493
|
+
: item.enableTooltip;
|
|
4494
|
+
return (React__default["default"].createElement(Item$1, Object.assign({}, itemExtraProps, { enableTooltip: enableTooltip, onMouseEnter: onMouseEnterByIndex(itemIndex), onMouseLeave: onMouseLeave, onItemClick: onItemClickByIndex(itemIndex), collapseItems: collapseItems })));
|
|
4495
|
+
} })),
|
|
4496
|
+
type === 'menu' && (React__default["default"].createElement(MultipleTooltip, { open: compact && multipleTooltip && multipleTooltipActive, anchorRef: tooltipRef, placement: ['right-start'], items: items }))));
|
|
4497
|
+
};
|
|
4498
|
+
const CompositeBar = ({ type, items, menuMoreTitle, onItemClick, multipleTooltip = false, }) => {
|
|
4499
|
+
if (items.length === 0) {
|
|
4500
|
+
return null;
|
|
4501
|
+
}
|
|
4502
|
+
let node;
|
|
4503
|
+
if (type === 'menu') {
|
|
4504
|
+
const minHeight = getItemsMinHeight(items);
|
|
4505
|
+
const collapseItem = getMoreButtonItem(menuMoreTitle);
|
|
4506
|
+
node = (React__default["default"].createElement("div", { className: b$j({ autosizer: true }), style: { minHeight } }, items.length !== 0 && (React__default["default"].createElement(AutoSizer, null, ({ width, height }) => {
|
|
4507
|
+
const { listItems, collapseItems } = getAutosizeListItems(items, height, collapseItem);
|
|
4508
|
+
return (React__default["default"].createElement("div", { style: { width, height } },
|
|
4509
|
+
React__default["default"].createElement(CompositeBarView, { type: "menu", items: listItems, onItemClick: onItemClick, collapseItems: collapseItems, multipleTooltip: multipleTooltip })));
|
|
4510
|
+
}))));
|
|
4511
|
+
}
|
|
4512
|
+
else {
|
|
4513
|
+
node = (React__default["default"].createElement("div", { className: b$j({ subheader: true }) },
|
|
4514
|
+
React__default["default"].createElement(CompositeBarView, { type: "subheader", items: items, onItemClick: onItemClick })));
|
|
4515
|
+
}
|
|
4516
|
+
return React__default["default"].createElement(MultipleTooltipProvider, null, node);
|
|
4517
|
+
};
|
|
4523
4518
|
|
|
4524
|
-
|
|
4525
|
-
|
|
4526
|
-
|
|
4527
|
-
|
|
4528
|
-
|
|
4529
|
-
|
|
4530
|
-
|
|
4531
|
-
|
|
4532
|
-
|
|
4533
|
-
* @returns {boolean} Returns `true` if `value` is object-like, else `false`.
|
|
4534
|
-
* @example
|
|
4535
|
-
*
|
|
4536
|
-
* _.isObjectLike({});
|
|
4537
|
-
* // => true
|
|
4538
|
-
*
|
|
4539
|
-
* _.isObjectLike([1, 2, 3]);
|
|
4540
|
-
* // => true
|
|
4541
|
-
*
|
|
4542
|
-
* _.isObjectLike(_.noop);
|
|
4543
|
-
* // => false
|
|
4544
|
-
*
|
|
4545
|
-
* _.isObjectLike(null);
|
|
4546
|
-
* // => false
|
|
4547
|
-
*/
|
|
4519
|
+
/* Used by renderContent AsideHeader prop */
|
|
4520
|
+
const RenderContent = React__default["default"].memo(({ renderContent, size }) => {
|
|
4521
|
+
return React__default["default"].createElement(React__default["default"].Fragment, null, renderContent({ size }));
|
|
4522
|
+
});
|
|
4523
|
+
RenderContent.displayName = 'RenderContent';
|
|
4524
|
+
const Content = ({ size, // TODO: move to context when MobileHeader will support it
|
|
4525
|
+
className, cssSizeVariableName = '--gn-aside-header-size', renderContent, }) => {
|
|
4526
|
+
return (React__default["default"].createElement("div", { className: className, style: Object.assign({}, { [cssSizeVariableName]: `${size}px` }) }, typeof renderContent === 'function' && (React__default["default"].createElement(RenderContent, { size: size, renderContent: renderContent }))));
|
|
4527
|
+
};
|
|
4548
4528
|
|
|
4549
|
-
function
|
|
4550
|
-
|
|
4529
|
+
function fakeDisplayName(newDisplayName, Component) {
|
|
4530
|
+
const Fake = (props) => React__default["default"].createElement(Component, Object.assign({}, props));
|
|
4531
|
+
Fake.displayName = newDisplayName;
|
|
4532
|
+
return Fake;
|
|
4551
4533
|
}
|
|
4552
4534
|
|
|
4553
|
-
|
|
4535
|
+
const PARAM_REGEXP = /{{(.*?)}}/g;
|
|
4536
|
+
function replaceParams(keyValue, params) {
|
|
4537
|
+
let result = '';
|
|
4538
|
+
let lastIndex = (PARAM_REGEXP.lastIndex = 0);
|
|
4539
|
+
let match;
|
|
4540
|
+
while ((match = PARAM_REGEXP.exec(keyValue))) {
|
|
4541
|
+
if (lastIndex !== match.index) {
|
|
4542
|
+
result += keyValue.slice(lastIndex, match.index);
|
|
4543
|
+
}
|
|
4544
|
+
lastIndex = PARAM_REGEXP.lastIndex;
|
|
4545
|
+
const [all, key] = match;
|
|
4546
|
+
if (Object.prototype.hasOwnProperty.call(params, key)) {
|
|
4547
|
+
result += params[key];
|
|
4548
|
+
}
|
|
4549
|
+
else {
|
|
4550
|
+
result += all;
|
|
4551
|
+
}
|
|
4552
|
+
}
|
|
4553
|
+
if (lastIndex < keyValue.length) {
|
|
4554
|
+
result += keyValue.slice(lastIndex);
|
|
4555
|
+
}
|
|
4556
|
+
return result;
|
|
4557
|
+
}
|
|
4554
4558
|
|
|
4555
|
-
var
|
|
4556
|
-
|
|
4559
|
+
var PluralForm;
|
|
4560
|
+
(function (PluralForm) {
|
|
4561
|
+
PluralForm[PluralForm["One"] = 0] = "One";
|
|
4562
|
+
PluralForm[PluralForm["Few"] = 1] = "Few";
|
|
4563
|
+
PluralForm[PluralForm["Many"] = 2] = "Many";
|
|
4564
|
+
PluralForm[PluralForm["None"] = 3] = "None";
|
|
4565
|
+
})(PluralForm || (PluralForm = {}));
|
|
4566
|
+
|
|
4567
|
+
function pluralizerEn (count, pluralForms) {
|
|
4568
|
+
if (count === 0) {
|
|
4569
|
+
return pluralForms.None;
|
|
4570
|
+
}
|
|
4571
|
+
if (count === 1 || count === -1) {
|
|
4572
|
+
return pluralForms.One;
|
|
4573
|
+
}
|
|
4574
|
+
return pluralForms.Many;
|
|
4575
|
+
}
|
|
4557
4576
|
|
|
4558
|
-
|
|
4559
|
-
|
|
4577
|
+
function pluralizerRu (count, pluralForms) {
|
|
4578
|
+
// the rules for negative numbers are the same
|
|
4579
|
+
const lastDigit = Math.abs(count % 10);
|
|
4580
|
+
const last2Digits = Math.abs(count % 100);
|
|
4581
|
+
if (count === 0) {
|
|
4582
|
+
return pluralForms.None;
|
|
4583
|
+
}
|
|
4584
|
+
if (lastDigit === 1 && last2Digits !== 11) {
|
|
4585
|
+
return pluralForms.One;
|
|
4586
|
+
}
|
|
4587
|
+
if ((lastDigit > 1 && lastDigit < 5) && (last2Digits < 10 || last2Digits > 20)) {
|
|
4588
|
+
return pluralForms.Few;
|
|
4589
|
+
}
|
|
4590
|
+
return pluralForms.Many;
|
|
4591
|
+
}
|
|
4560
4592
|
|
|
4561
|
-
|
|
4562
|
-
|
|
4563
|
-
|
|
4564
|
-
|
|
4565
|
-
|
|
4566
|
-
|
|
4567
|
-
|
|
4568
|
-
|
|
4569
|
-
|
|
4570
|
-
|
|
4571
|
-
|
|
4572
|
-
|
|
4573
|
-
|
|
4574
|
-
|
|
4575
|
-
|
|
4576
|
-
|
|
4577
|
-
|
|
4578
|
-
|
|
4579
|
-
|
|
4580
|
-
|
|
4593
|
+
class I18N {
|
|
4594
|
+
constructor(options) {
|
|
4595
|
+
this.data = {};
|
|
4596
|
+
this.lang = undefined;
|
|
4597
|
+
this.pluralizers = {
|
|
4598
|
+
en: pluralizerEn,
|
|
4599
|
+
ru: pluralizerRu,
|
|
4600
|
+
};
|
|
4601
|
+
this.logger = null;
|
|
4602
|
+
this.logger = (options === null || options === void 0 ? void 0 : options.logger) || null;
|
|
4603
|
+
}
|
|
4604
|
+
setLang(lang) {
|
|
4605
|
+
this.lang = lang;
|
|
4606
|
+
}
|
|
4607
|
+
configurePluralization(pluralizers) {
|
|
4608
|
+
this.pluralizers = Object.assign({}, this.pluralizers, pluralizers);
|
|
4609
|
+
}
|
|
4610
|
+
registerKeyset(lang, keysetName, data = {}) {
|
|
4611
|
+
if (this.data[lang] && Object.prototype.hasOwnProperty.call(this.data[lang], keysetName)) {
|
|
4612
|
+
throw new Error(`Keyset '${keysetName}' is already registered, aborting!`);
|
|
4613
|
+
}
|
|
4614
|
+
this.data[lang] = Object.assign({}, this.data[lang], { [keysetName]: data });
|
|
4615
|
+
}
|
|
4616
|
+
registerKeysets(lang, data) {
|
|
4617
|
+
Object.keys(data).forEach((keysetName) => {
|
|
4618
|
+
this.registerKeyset(lang, keysetName, data[keysetName]);
|
|
4619
|
+
});
|
|
4620
|
+
}
|
|
4621
|
+
has(keysetName, key, lang) {
|
|
4622
|
+
const languageData = this.getLanguageData(lang);
|
|
4623
|
+
return Boolean(languageData && languageData[keysetName] && languageData[keysetName][key]);
|
|
4624
|
+
}
|
|
4625
|
+
i18n(keysetName, key, params) {
|
|
4626
|
+
const languageData = this.getLanguageData(this.lang);
|
|
4627
|
+
if (typeof languageData === 'undefined') {
|
|
4628
|
+
throw new Error(`Language '${this.lang}' is not defined, make sure you call setLang for the same language you called registerKeysets for!`);
|
|
4629
|
+
}
|
|
4630
|
+
if (Object.keys(languageData).length === 0) {
|
|
4631
|
+
this.warn('Language data is empty.');
|
|
4632
|
+
return key;
|
|
4633
|
+
}
|
|
4634
|
+
const keyset = languageData[keysetName];
|
|
4635
|
+
if (!keyset) {
|
|
4636
|
+
this.warn('Keyset not found.', keysetName);
|
|
4637
|
+
return key;
|
|
4638
|
+
}
|
|
4639
|
+
if (Object.keys(keyset).length === 0) {
|
|
4640
|
+
this.warn('Keyset is empty.', keysetName);
|
|
4641
|
+
return key;
|
|
4642
|
+
}
|
|
4643
|
+
const keyValue = keyset && keyset[key];
|
|
4644
|
+
let result;
|
|
4645
|
+
if (typeof keyValue === 'undefined') {
|
|
4646
|
+
this.warn('Missing key.', keysetName, key);
|
|
4647
|
+
return key;
|
|
4648
|
+
}
|
|
4649
|
+
if (Array.isArray(keyValue)) {
|
|
4650
|
+
if (keyValue.length < 3) {
|
|
4651
|
+
this.warn('Missing required plurals', keysetName, key);
|
|
4652
|
+
return key;
|
|
4653
|
+
}
|
|
4654
|
+
const count = Number(params === null || params === void 0 ? void 0 : params.count);
|
|
4655
|
+
if (Number.isNaN(count)) {
|
|
4656
|
+
this.warn('Missing params.count for key.', keysetName, key);
|
|
4657
|
+
return key;
|
|
4658
|
+
}
|
|
4659
|
+
const pluralizer = this.getLanguagePluralizer(this.lang);
|
|
4660
|
+
result = keyValue[pluralizer(count, PluralForm)] || keyValue[PluralForm.Many];
|
|
4661
|
+
if (keyValue[PluralForm.None] === undefined) {
|
|
4662
|
+
this.warn('Missing key for 0', keysetName, key);
|
|
4663
|
+
}
|
|
4664
|
+
}
|
|
4665
|
+
else {
|
|
4666
|
+
result = keyValue;
|
|
4667
|
+
}
|
|
4668
|
+
if (params) {
|
|
4669
|
+
result = replaceParams(result, params);
|
|
4670
|
+
}
|
|
4671
|
+
return result;
|
|
4672
|
+
}
|
|
4673
|
+
keyset(keysetName) {
|
|
4674
|
+
return (key, params) => {
|
|
4675
|
+
return this.i18n(keysetName, key, params);
|
|
4676
|
+
};
|
|
4677
|
+
}
|
|
4678
|
+
warn(msg, keyset, key) {
|
|
4679
|
+
var _a;
|
|
4680
|
+
let cacheKey = '';
|
|
4681
|
+
if (keyset) {
|
|
4682
|
+
cacheKey += keyset;
|
|
4683
|
+
if (key) {
|
|
4684
|
+
cacheKey += `.${key}`;
|
|
4685
|
+
}
|
|
4686
|
+
}
|
|
4687
|
+
else {
|
|
4688
|
+
cacheKey = 'languageData';
|
|
4689
|
+
}
|
|
4690
|
+
(_a = this.logger) === null || _a === void 0 ? void 0 : _a.log(`I18n: ${msg}`, {
|
|
4691
|
+
level: 'info',
|
|
4692
|
+
logger: cacheKey,
|
|
4693
|
+
extra: {
|
|
4694
|
+
type: 'i18n'
|
|
4695
|
+
}
|
|
4696
|
+
});
|
|
4697
|
+
}
|
|
4698
|
+
getLanguageData(lang) {
|
|
4699
|
+
const langCode = lang || this.lang;
|
|
4700
|
+
return langCode ? this.data[langCode] : undefined;
|
|
4701
|
+
}
|
|
4702
|
+
getLanguagePluralizer(lang) {
|
|
4703
|
+
const pluralizer = lang ? this.pluralizers[lang] : undefined;
|
|
4704
|
+
if (!pluralizer) {
|
|
4705
|
+
this.warn(`Pluralization is not configured for language '${lang}', falling back to the english ruleset`);
|
|
4706
|
+
}
|
|
4707
|
+
return pluralizer || pluralizerEn;
|
|
4708
|
+
}
|
|
4581
4709
|
}
|
|
4582
4710
|
|
|
4583
|
-
|
|
4711
|
+
exports.Lang = void 0;
|
|
4712
|
+
(function (Lang) {
|
|
4713
|
+
Lang["Ru"] = "ru";
|
|
4714
|
+
Lang["En"] = "en";
|
|
4715
|
+
})(exports.Lang || (exports.Lang = {}));
|
|
4716
|
+
let subs = [];
|
|
4717
|
+
const config = {
|
|
4718
|
+
lang: exports.Lang.En,
|
|
4719
|
+
};
|
|
4720
|
+
const configure = (newConfig) => {
|
|
4721
|
+
Object.assign(config, newConfig);
|
|
4722
|
+
subs.forEach((sub) => {
|
|
4723
|
+
sub(config);
|
|
4724
|
+
});
|
|
4725
|
+
};
|
|
4726
|
+
const subscribeConfigure = (sub) => {
|
|
4727
|
+
subs.push(sub);
|
|
4728
|
+
return () => {
|
|
4729
|
+
subs = subs.filter((item) => item !== sub);
|
|
4730
|
+
};
|
|
4731
|
+
};
|
|
4732
|
+
const getConfig = () => config;
|
|
4584
4733
|
|
|
4585
|
-
|
|
4586
|
-
|
|
4587
|
-
|
|
4734
|
+
const i18n$4 = new I18N();
|
|
4735
|
+
i18n$4.setLang(getConfig().lang);
|
|
4736
|
+
subscribeConfigure((config) => {
|
|
4737
|
+
i18n$4.setLang(config.lang);
|
|
4738
|
+
});
|
|
4588
4739
|
|
|
4589
|
-
|
|
4590
|
-
|
|
4740
|
+
function registerKeyset(data, keysetName) {
|
|
4741
|
+
Object.entries(data).forEach(([lang, keys]) => i18n$4.registerKeyset(lang, keysetName, keys));
|
|
4742
|
+
return i18n$4.keyset(keysetName);
|
|
4743
|
+
}
|
|
4591
4744
|
|
|
4592
|
-
|
|
4593
|
-
var
|
|
4745
|
+
var button_collapse$1 = "Collapse";
|
|
4746
|
+
var button_expand$1 = "Expand";
|
|
4747
|
+
var label_more$1 = "More";
|
|
4748
|
+
var en$3 = {
|
|
4749
|
+
button_collapse: button_collapse$1,
|
|
4750
|
+
button_expand: button_expand$1,
|
|
4751
|
+
label_more: label_more$1
|
|
4752
|
+
};
|
|
4594
4753
|
|
|
4595
|
-
|
|
4596
|
-
var
|
|
4754
|
+
var button_collapse = "Свернуть";
|
|
4755
|
+
var button_expand = "Развернуть";
|
|
4756
|
+
var label_more = "Ещё";
|
|
4757
|
+
var ru$3 = {
|
|
4758
|
+
button_collapse: button_collapse,
|
|
4759
|
+
button_expand: button_expand,
|
|
4760
|
+
label_more: label_more
|
|
4761
|
+
};
|
|
4597
4762
|
|
|
4598
|
-
|
|
4599
|
-
var
|
|
4763
|
+
const COMPONENT$3 = 'AsideHeader';
|
|
4764
|
+
var i18n$3 = registerKeyset({ en: en$3, ru: ru$3 }, COMPONENT$3);
|
|
4600
4765
|
|
|
4601
|
-
|
|
4602
|
-
var
|
|
4766
|
+
var _path$1;
|
|
4767
|
+
function _extends$1() { _extends$1 = Object.assign ? Object.assign.bind() : 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$1.apply(this, arguments); }
|
|
4768
|
+
var SvgControlMenuButton = function SvgControlMenuButton(props) {
|
|
4769
|
+
return /*#__PURE__*/React__namespace.createElement("svg", _extends$1({
|
|
4770
|
+
width: 8,
|
|
4771
|
+
height: 8,
|
|
4772
|
+
viewBox: "0 0 8 8",
|
|
4773
|
+
fill: "currentColor",
|
|
4774
|
+
xmlns: "http://www.w3.org/2000/svg"
|
|
4775
|
+
}, props), _path$1 || (_path$1 = /*#__PURE__*/React__namespace.createElement("path", {
|
|
4776
|
+
d: "m.72 7.64 6.39-3.2a.5.5 0 0 0 0-.89L.72.36A.5.5 0 0 0 0 .81v6.38c0 .37.4.61.72.45Z"
|
|
4777
|
+
})));
|
|
4778
|
+
};
|
|
4779
|
+
var controlMenuButtonIcon = SvgControlMenuButton;
|
|
4603
4780
|
|
|
4604
|
-
|
|
4605
|
-
|
|
4606
|
-
|
|
4607
|
-
|
|
4608
|
-
|
|
4609
|
-
|
|
4610
|
-
|
|
4611
|
-
|
|
4612
|
-
|
|
4613
|
-
|
|
4614
|
-
|
|
4615
|
-
|
|
4616
|
-
|
|
4617
|
-
|
|
4618
|
-
* _.toNumber(Number.MIN_VALUE);
|
|
4619
|
-
* // => 5e-324
|
|
4620
|
-
*
|
|
4621
|
-
* _.toNumber(Infinity);
|
|
4622
|
-
* // => Infinity
|
|
4623
|
-
*
|
|
4624
|
-
* _.toNumber('3.2');
|
|
4625
|
-
* // => 3.2
|
|
4626
|
-
*/
|
|
4627
|
-
function toNumber$1(value) {
|
|
4628
|
-
if (typeof value == 'number') {
|
|
4629
|
-
return value;
|
|
4630
|
-
}
|
|
4631
|
-
if (isSymbol(value)) {
|
|
4632
|
-
return NAN;
|
|
4633
|
-
}
|
|
4634
|
-
if (isObject$1(value)) {
|
|
4635
|
-
var other = typeof value.valueOf == 'function' ? value.valueOf() : value;
|
|
4636
|
-
value = isObject$1(other) ? (other + '') : other;
|
|
4637
|
-
}
|
|
4638
|
-
if (typeof value != 'string') {
|
|
4639
|
-
return value === 0 ? value : +value;
|
|
4640
|
-
}
|
|
4641
|
-
value = baseTrim(value);
|
|
4642
|
-
var isBinary = reIsBinary.test(value);
|
|
4643
|
-
return (isBinary || reIsOctal.test(value))
|
|
4644
|
-
? freeParseInt(value.slice(2), isBinary ? 2 : 8)
|
|
4645
|
-
: (reIsBadHex.test(value) ? NAN : +value);
|
|
4646
|
-
}
|
|
4781
|
+
var _path;
|
|
4782
|
+
function _extends() { _extends = Object.assign ? Object.assign.bind() : 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); }
|
|
4783
|
+
var SvgDividerCollapsed = function SvgDividerCollapsed(props) {
|
|
4784
|
+
return /*#__PURE__*/React__namespace.createElement("svg", _extends({
|
|
4785
|
+
width: 56,
|
|
4786
|
+
height: 29,
|
|
4787
|
+
viewBox: "0 0 56 29",
|
|
4788
|
+
fill: "currentColor",
|
|
4789
|
+
xmlns: "http://www.w3.org/2000/svg"
|
|
4790
|
+
}, props), _path || (_path = /*#__PURE__*/React__namespace.createElement("path", {
|
|
4791
|
+
d: "M56 0v29c-.8-1-7-6.1-17.7-8.4L13 15.7A16 16 0 0 1 0 0Z"
|
|
4792
|
+
})));
|
|
4793
|
+
};
|
|
4794
|
+
var headerDividerCollapsedIcon = SvgDividerCollapsed;
|
|
4647
4795
|
|
|
4648
|
-
var
|
|
4796
|
+
var css_248z$h = ".g-root {\n --gn-aside-header-background-color: var(--g-color-base-warning-light);\n --gn-aside-header-collapse-button-divider-line-color: var(\n --gn-aside-header-subheader-divider-line-color\n );\n --gn-aside-header-footer-item-icon-color: var(--g-color-text-primary);\n --gn-aside-header-subheader-item-icon-color: var(--g-color-text-primary);\n --gn-aside-header-item-icon-background-size: 38px;\n}\n\n.g-root_theme_light,\n.g-root_theme_light-hc {\n --gn-aside-header-divider-line-color: transparent;\n --gn-aside-header-subheader-divider-line-color: var(--g-color-line-generic);\n}\n\n.g-root_theme_dark,\n.g-root_theme_dark-hc {\n --gn-aside-header-divider-line-color: var(--g-color-line-generic-solid);\n --gn-aside-header-subheader-divider-line-color: var(--g-color-line-generic-solid);\n}\n\n.gn-aside-header {\n --gn-aside-header-min-width: 56px;\n height: 100%;\n width: 100%;\n position: relative;\n background-color: var(--g-color-base-background);\n}\n.gn-aside-header__aside {\n position: sticky;\n top: 0;\n left: 0;\n height: 100vh;\n width: inherit;\n display: flex;\n flex-direction: column;\n background-color: var(--g-color-base-background);\n z-index: 100;\n box-sizing: border-box;\n}\n.gn-aside-header__aside::after {\n position: absolute;\n top: 0;\n right: 0;\n z-index: 2;\n width: 1px;\n height: 100%;\n content: \"\";\n background-color: var(--gn-aside-header-divider-line-color);\n}\n.gn-aside-header__aside-popup-anchor {\n position: absolute;\n top: 0;\n right: 0;\n bottom: 0;\n left: 0;\n z-index: 1;\n}\n.gn-aside-header__aside-content {\n --gradient-height: 334px;\n display: flex;\n flex-direction: column;\n overflow-x: hidden;\n width: inherit;\n height: inherit;\n position: relative;\n z-index: 2;\n user-select: none;\n}\n.gn-aside-header__aside-content::after {\n position: absolute;\n top: 0;\n right: -100px;\n bottom: 0;\n width: 100px;\n content: \"\";\n box-shadow: 0px 0px 4px rgba(0, 0, 0, 0.1), 0px 0px 24px rgba(0, 0, 0, 0.08);\n}\n.gn-aside-header__aside-content > .gn-aside-header-logo {\n margin: 8px 0;\n}\n.gn-aside-header__aside-content_with-decoration {\n background: linear-gradient(180deg, var(--gn-aside-header-background-color) calc(var(--gradient-height) * 0.33), transparent calc(var(--gradient-height) * 0.88));\n}\n.gn-aside-header_compact .gn-aside-header__aside-content {\n background: transparent;\n}\n.gn-aside-header__header {\n --gn-aside-header-header-divider-height: 29px;\n position: relative;\n z-index: 1;\n flex: none;\n box-sizing: border-box;\n width: 100%;\n padding-top: 8px;\n padding-bottom: 22px;\n}\n.gn-aside-header__header .gn-aside-header__header-divider {\n position: absolute;\n bottom: 0;\n left: 0;\n z-index: -2;\n display: none;\n color: var(--gn-aside-header-background-color);\n}\n.gn-aside-header__header_with-decoration::before {\n position: absolute;\n top: 0;\n left: 0;\n z-index: -2;\n display: none;\n width: 100%;\n height: calc(100% - var(--gn-aside-header-header-divider-height));\n content: \"\";\n background-color: var(--gn-aside-header-background-color);\n}\n.gn-aside-header__header::after {\n position: absolute;\n bottom: 12px;\n left: 0;\n z-index: -2;\n width: 100%;\n height: 1px;\n content: \"\";\n background-color: var(--gn-aside-header-subheader-divider-line-color);\n}\n.gn-aside-header_compact .gn-aside-header__header::before {\n display: block;\n}\n.gn-aside-header_compact .gn-aside-header__header_with-decoration .gn-aside-header__header-divider {\n display: block;\n}\n.gn-aside-header_compact .gn-aside-header__header_with-decoration::after {\n display: none;\n}\n.gn-aside-header__menu-items {\n flex-grow: 1;\n}\n.gn-aside-header__footer {\n flex-shrink: 0;\n width: 100%;\n margin: 8px 0;\n display: flex;\n flex-direction: column;\n}\n.gn-aside-header__panels {\n z-index: 98;\n position: fixed;\n left: 0;\n right: 0;\n bottom: 0;\n top: 0;\n overflow: auto;\n}\n.gn-aside-header__panel {\n height: 100%;\n}\n.gn-aside-header__pane-container {\n display: flex;\n outline: none;\n overflow: visible;\n user-select: text;\n flex-direction: row;\n}\n.gn-aside-header__content {\n width: calc(100% - var(--gn-aside-header-size));\n z-index: 95;\n}\n.gn-aside-header__collapse-button {\n --yc-button-background-color-hover: transparent;\n overflow: hidden;\n box-sizing: border-box;\n flex: none;\n width: 100%;\n height: 20px;\n border-top: 1px solid var(--gn-aside-header-collapse-button-divider-line-color);\n margin-top: auto;\n}\n.gn-aside-header__collapse-button > .yc-button__text {\n display: flex;\n align-items: center;\n justify-content: center;\n height: 20px;\n}\n.gn-aside-header__collapse-button:not(.gn-aside-header__collapse-button_compact) .gn-aside-header__collapse-icon {\n transform: rotate(180deg);\n}\n.gn-aside-header__collapse-button .gn-aside-header__collapse-icon {\n color: var(--g-color-text-secondary);\n}\n.gn-aside-header__collapse-button:hover .gn-aside-header__collapse-icon {\n color: var(--g-color-text-primary);\n}";
|
|
4797
|
+
styleInject(css_248z$h);
|
|
4649
4798
|
|
|
4650
|
-
|
|
4651
|
-
|
|
4652
|
-
|
|
4799
|
+
// TODO: remove temporary fix for expand button
|
|
4800
|
+
const NotIcon = fakeDisplayName('NotIcon', uikit.Icon);
|
|
4801
|
+
const b$i = block('aside-header');
|
|
4802
|
+
class AsideHeader extends React__default["default"].Component {
|
|
4803
|
+
constructor() {
|
|
4804
|
+
super(...arguments);
|
|
4805
|
+
this.asideRef = React__default["default"].createRef();
|
|
4806
|
+
this.renderFirstPane = (size) => {
|
|
4807
|
+
const { menuItems, panelItems, headerDecoration, multipleTooltip, menuMoreTitle } = this.props;
|
|
4808
|
+
return (React__default["default"].createElement(React__default["default"].Fragment, null,
|
|
4809
|
+
React__default["default"].createElement("div", { className: b$i('aside'), style: { width: size } },
|
|
4810
|
+
React__default["default"].createElement("div", { className: b$i('aside-popup-anchor'), ref: this.asideRef }),
|
|
4811
|
+
React__default["default"].createElement("div", { className: b$i('aside-content', { ['with-decoration']: headerDecoration }) },
|
|
4812
|
+
this.renderHeader(),
|
|
4813
|
+
(menuItems === null || menuItems === void 0 ? void 0 : menuItems.length) ? (React__default["default"].createElement(CompositeBar, { type: "menu", items: menuItems, menuMoreTitle: menuMoreTitle !== null && menuMoreTitle !== void 0 ? menuMoreTitle : i18n$3('label_more'), onItemClick: this.onItemClick, multipleTooltip: multipleTooltip })) : (React__default["default"].createElement("div", { className: b$i('menu-items') })),
|
|
4814
|
+
this.renderFooter(size),
|
|
4815
|
+
this.renderCollapseButton())),
|
|
4816
|
+
panelItems && this.renderPanels(size)));
|
|
4817
|
+
};
|
|
4818
|
+
this.renderSecondPane = (size) => {
|
|
4819
|
+
return (React__default["default"].createElement(Content, { size: size, renderContent: this.props.renderContent, className: b$i('content') }));
|
|
4820
|
+
};
|
|
4821
|
+
this.renderLogo = () => React__default["default"].createElement(Logo$1, Object.assign({}, this.props.logo, { onClick: this.onLogoClick }));
|
|
4822
|
+
this.renderHeader = () => (React__default["default"].createElement("div", { className: b$i('header', { ['with-decoration']: this.props.headerDecoration }) },
|
|
4823
|
+
this.renderLogo(),
|
|
4824
|
+
React__default["default"].createElement(CompositeBar, { type: "subheader", items: this.props.subheaderItems, onItemClick: this.onItemClick }),
|
|
4825
|
+
React__default["default"].createElement(uikit.Icon, { data: headerDividerCollapsedIcon, className: b$i('header-divider'), width: ASIDE_HEADER_COMPACT_WIDTH, height: "29" })));
|
|
4826
|
+
this.renderFooter = (size) => {
|
|
4827
|
+
const { renderFooter, compact } = this.props;
|
|
4828
|
+
return (React__default["default"].createElement("div", { className: b$i('footer') }, renderFooter === null || renderFooter === void 0 ? void 0 : renderFooter({
|
|
4829
|
+
size,
|
|
4830
|
+
compact,
|
|
4831
|
+
asideRef: this.asideRef,
|
|
4832
|
+
})));
|
|
4833
|
+
};
|
|
4834
|
+
this.renderPanels = (size) => {
|
|
4835
|
+
const { panelItems } = this.props;
|
|
4836
|
+
return (React__default["default"].createElement(Drawer, { className: b$i('panels'), onVeilClick: this.onCloseDrawer, onEscape: this.onCloseDrawer, style: { left: size } }, panelItems.map((item) => (React__default["default"].createElement(DrawerItem, Object.assign({ key: item.id }, item))))));
|
|
4837
|
+
};
|
|
4838
|
+
this.renderCollapseButton = () => {
|
|
4839
|
+
const { expandTitle, collapseTitle, compact } = this.props;
|
|
4840
|
+
const buttonTitle = compact
|
|
4841
|
+
? expandTitle || i18n$3('button_expand')
|
|
4842
|
+
: collapseTitle || i18n$3('button_collapse');
|
|
4843
|
+
return (React__default["default"].createElement(uikit.Button, { className: b$i('collapse-button', { compact }), view: "flat", onClick: this.onCollapseButtonClick, title: buttonTitle },
|
|
4844
|
+
React__default["default"].createElement(NotIcon, { data: controlMenuButtonIcon, className: b$i('collapse-icon'), width: "16", height: "10" })));
|
|
4845
|
+
};
|
|
4846
|
+
this.onCollapseButtonClick = () => {
|
|
4847
|
+
var _a, _b;
|
|
4848
|
+
(_b = (_a = this.props).onChangeCompact) === null || _b === void 0 ? void 0 : _b.call(_a, !this.props.compact);
|
|
4849
|
+
};
|
|
4850
|
+
this.onCloseDrawer = () => {
|
|
4851
|
+
var _a, _b;
|
|
4852
|
+
(_b = (_a = this.props).onClosePanel) === null || _b === void 0 ? void 0 : _b.call(_a);
|
|
4853
|
+
};
|
|
4854
|
+
this.onItemClick = (item, collapsed, event) => {
|
|
4855
|
+
var _a, _b, _c;
|
|
4856
|
+
(_b = (_a = this.props).onClosePanel) === null || _b === void 0 ? void 0 : _b.call(_a);
|
|
4857
|
+
(_c = item.onItemClick) === null || _c === void 0 ? void 0 : _c.call(item, item, collapsed, event);
|
|
4858
|
+
};
|
|
4859
|
+
this.onLogoClick = (event) => {
|
|
4860
|
+
var _a, _b, _c, _d;
|
|
4861
|
+
(_b = (_a = this.props).onClosePanel) === null || _b === void 0 ? void 0 : _b.call(_a);
|
|
4862
|
+
(_d = (_c = this.props.logo).onClick) === null || _d === void 0 ? void 0 : _d.call(_c, event);
|
|
4863
|
+
};
|
|
4864
|
+
}
|
|
4865
|
+
render() {
|
|
4866
|
+
const { className, compact } = this.props;
|
|
4867
|
+
const size = compact ? ASIDE_HEADER_COMPACT_WIDTH : ASIDE_HEADER_EXPANDED_WIDTH;
|
|
4868
|
+
return (React__default["default"].createElement(AsideHeaderContextProvider, { value: { compact, size } },
|
|
4869
|
+
React__default["default"].createElement("div", { className: b$i({ compact }, className) },
|
|
4870
|
+
React__default["default"].createElement("div", { className: b$i('pane-container') },
|
|
4871
|
+
this.renderFirstPane(size),
|
|
4872
|
+
this.renderSecondPane(size)))));
|
|
4873
|
+
}
|
|
4874
|
+
}
|
|
4875
|
+
AsideHeader.defaultProps = {
|
|
4876
|
+
panelItems: [],
|
|
4877
|
+
subheaderItems: [],
|
|
4878
|
+
menuItems: [],
|
|
4879
|
+
headerDecoration: true,
|
|
4880
|
+
};
|
|
4653
4881
|
|
|
4654
|
-
|
|
4655
|
-
|
|
4882
|
+
/******************************************************************************
|
|
4883
|
+
Copyright (c) Microsoft Corporation.
|
|
4656
4884
|
|
|
4657
|
-
|
|
4658
|
-
|
|
4659
|
-
nativeMin = Math.min;
|
|
4885
|
+
Permission to use, copy, modify, and/or distribute this software for any
|
|
4886
|
+
purpose with or without fee is hereby granted.
|
|
4660
4887
|
|
|
4661
|
-
|
|
4662
|
-
|
|
4663
|
-
|
|
4664
|
-
|
|
4665
|
-
|
|
4666
|
-
|
|
4667
|
-
|
|
4668
|
-
|
|
4669
|
-
* calls to the debounced function return the result of the last `func`
|
|
4670
|
-
* invocation.
|
|
4671
|
-
*
|
|
4672
|
-
* **Note:** If `leading` and `trailing` options are `true`, `func` is
|
|
4673
|
-
* invoked on the trailing edge of the timeout only if the debounced function
|
|
4674
|
-
* is invoked more than once during the `wait` timeout.
|
|
4675
|
-
*
|
|
4676
|
-
* If `wait` is `0` and `leading` is `false`, `func` invocation is deferred
|
|
4677
|
-
* until to the next tick, similar to `setTimeout` with a timeout of `0`.
|
|
4678
|
-
*
|
|
4679
|
-
* See [David Corbacho's article](https://css-tricks.com/debouncing-throttling-explained-examples/)
|
|
4680
|
-
* for details over the differences between `_.debounce` and `_.throttle`.
|
|
4681
|
-
*
|
|
4682
|
-
* @static
|
|
4683
|
-
* @memberOf _
|
|
4684
|
-
* @since 0.1.0
|
|
4685
|
-
* @category Function
|
|
4686
|
-
* @param {Function} func The function to debounce.
|
|
4687
|
-
* @param {number} [wait=0] The number of milliseconds to delay.
|
|
4688
|
-
* @param {Object} [options={}] The options object.
|
|
4689
|
-
* @param {boolean} [options.leading=false]
|
|
4690
|
-
* Specify invoking on the leading edge of the timeout.
|
|
4691
|
-
* @param {number} [options.maxWait]
|
|
4692
|
-
* The maximum time `func` is allowed to be delayed before it's invoked.
|
|
4693
|
-
* @param {boolean} [options.trailing=true]
|
|
4694
|
-
* Specify invoking on the trailing edge of the timeout.
|
|
4695
|
-
* @returns {Function} Returns the new debounced function.
|
|
4696
|
-
* @example
|
|
4697
|
-
*
|
|
4698
|
-
* // Avoid costly calculations while the window size is in flux.
|
|
4699
|
-
* jQuery(window).on('resize', _.debounce(calculateLayout, 150));
|
|
4700
|
-
*
|
|
4701
|
-
* // Invoke `sendMail` when clicked, debouncing subsequent calls.
|
|
4702
|
-
* jQuery(element).on('click', _.debounce(sendMail, 300, {
|
|
4703
|
-
* 'leading': true,
|
|
4704
|
-
* 'trailing': false
|
|
4705
|
-
* }));
|
|
4706
|
-
*
|
|
4707
|
-
* // Ensure `batchLog` is invoked once after 1 second of debounced calls.
|
|
4708
|
-
* var debounced = _.debounce(batchLog, 250, { 'maxWait': 1000 });
|
|
4709
|
-
* var source = new EventSource('/stream');
|
|
4710
|
-
* jQuery(source).on('message', debounced);
|
|
4711
|
-
*
|
|
4712
|
-
* // Cancel the trailing debounced invocation.
|
|
4713
|
-
* jQuery(window).on('popstate', debounced.cancel);
|
|
4714
|
-
*/
|
|
4715
|
-
function debounce(func, wait, options) {
|
|
4716
|
-
var lastArgs,
|
|
4717
|
-
lastThis,
|
|
4718
|
-
maxWait,
|
|
4719
|
-
result,
|
|
4720
|
-
timerId,
|
|
4721
|
-
lastCallTime,
|
|
4722
|
-
lastInvokeTime = 0,
|
|
4723
|
-
leading = false,
|
|
4724
|
-
maxing = false,
|
|
4725
|
-
trailing = true;
|
|
4888
|
+
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
|
|
4889
|
+
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
|
|
4890
|
+
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
|
|
4891
|
+
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
|
4892
|
+
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
|
4893
|
+
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
4894
|
+
PERFORMANCE OF THIS SOFTWARE.
|
|
4895
|
+
***************************************************************************** */
|
|
4726
4896
|
|
|
4727
|
-
|
|
4728
|
-
|
|
4729
|
-
|
|
4730
|
-
|
|
4731
|
-
if (
|
|
4732
|
-
|
|
4733
|
-
|
|
4734
|
-
|
|
4735
|
-
|
|
4736
|
-
|
|
4897
|
+
function __rest(s, e) {
|
|
4898
|
+
var t = {};
|
|
4899
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
4900
|
+
t[p] = s[p];
|
|
4901
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
4902
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
4903
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
4904
|
+
t[p[i]] = s[p[i]];
|
|
4905
|
+
}
|
|
4906
|
+
return t;
|
|
4907
|
+
}
|
|
4737
4908
|
|
|
4738
|
-
|
|
4739
|
-
|
|
4740
|
-
|
|
4909
|
+
typeof SuppressedError === "function" ? SuppressedError : function (error, suppressed, message) {
|
|
4910
|
+
var e = new Error(message);
|
|
4911
|
+
return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e;
|
|
4912
|
+
};
|
|
4741
4913
|
|
|
4742
|
-
|
|
4743
|
-
|
|
4744
|
-
result = func.apply(thisArg, args);
|
|
4745
|
-
return result;
|
|
4746
|
-
}
|
|
4914
|
+
var css_248z$g = ".gn-footer-item {\n width: 100%;\n height: 40px;\n}";
|
|
4915
|
+
styleInject(css_248z$g);
|
|
4747
4916
|
|
|
4748
|
-
|
|
4749
|
-
|
|
4750
|
-
|
|
4751
|
-
|
|
4752
|
-
|
|
4753
|
-
// Invoke the leading edge.
|
|
4754
|
-
return leading ? invokeFunc(time) : result;
|
|
4755
|
-
}
|
|
4917
|
+
const b$h = block('footer-item');
|
|
4918
|
+
const FooterItem$1 = (_a) => {
|
|
4919
|
+
var { item } = _a, props = __rest(_a, ["item"]);
|
|
4920
|
+
return (React__default["default"].createElement(Item$1, Object.assign({}, props, { item: Object.assign({ iconSize: ASIDE_HEADER_ICON_SIZE }, item), className: b$h({ compact: props.compact }), onItemClick: item.onItemClick, onItemClickCapture: item.onItemClickCapture })));
|
|
4921
|
+
};
|
|
4756
4922
|
|
|
4757
|
-
|
|
4758
|
-
|
|
4759
|
-
timeSinceLastInvoke = time - lastInvokeTime,
|
|
4760
|
-
timeWaiting = wait - timeSinceLastCall;
|
|
4923
|
+
var css_248z$f = ".gn-action-bar-group {\n display: flex;\n flex-flow: row nowrap;\n align-items: center;\n justify-content: flex-start;\n margin: 0;\n padding: 0;\n}\n.gn-action-bar-group_pull_left {\n margin-left: 0;\n margin-right: auto;\n}\n.gn-action-bar-group_pull_right {\n margin-left: auto;\n margin-right: 0;\n}\n.gn-action-bar-group_pull_center {\n margin-left: auto;\n margin-right: auto;\n}";
|
|
4924
|
+
styleInject(css_248z$f);
|
|
4761
4925
|
|
|
4762
|
-
|
|
4763
|
-
|
|
4764
|
-
|
|
4765
|
-
|
|
4926
|
+
const b$g = block('action-bar-group');
|
|
4927
|
+
const ActionBarGroup = ({ children, className, pull }) => {
|
|
4928
|
+
return (React__default["default"].createElement("ul", { className: b$g({ pull }, className), role: "group" }, children));
|
|
4929
|
+
};
|
|
4930
|
+
ActionBarGroup.displayName = 'ActionBar.Group';
|
|
4766
4931
|
|
|
4767
|
-
|
|
4768
|
-
|
|
4769
|
-
timeSinceLastInvoke = time - lastInvokeTime;
|
|
4932
|
+
var css_248z$e = ".gn-action-bar-item {\n list-style: none;\n margin: 0;\n padding: 0;\n}\n.gn-action-bar-item_pull_left {\n margin-left: 0;\n margin-right: auto;\n}\n.gn-action-bar-item_pull_right {\n margin-left: auto;\n margin-right: 0;\n}\n.gn-action-bar-item_pull_center {\n margin-left: auto;\n margin-right: auto;\n}\n.gn-action-bar-item + .gn-action-bar-item_spacing {\n margin-left: 8px;\n}";
|
|
4933
|
+
styleInject(css_248z$e);
|
|
4770
4934
|
|
|
4771
|
-
|
|
4772
|
-
|
|
4773
|
-
|
|
4774
|
-
|
|
4775
|
-
|
|
4776
|
-
}
|
|
4935
|
+
const b$f = block('action-bar-item');
|
|
4936
|
+
const ActionBarItem = ({ children, className, pull, spacing = true }) => {
|
|
4937
|
+
return React__default["default"].createElement("li", { className: b$f({ pull, spacing }, className) }, children);
|
|
4938
|
+
};
|
|
4939
|
+
ActionBarItem.displayName = 'ActionBar.Item';
|
|
4777
4940
|
|
|
4778
|
-
|
|
4779
|
-
|
|
4780
|
-
if (shouldInvoke(time)) {
|
|
4781
|
-
return trailingEdge(time);
|
|
4782
|
-
}
|
|
4783
|
-
// Restart the timer.
|
|
4784
|
-
timerId = setTimeout(timerExpired, remainingWait(time));
|
|
4785
|
-
}
|
|
4941
|
+
var css_248z$d = ".gn-action-bar-section {\n display: flex;\n flex-flow: row nowrap;\n justify-content: flex-start;\n align-items: stretch;\n}\n.gn-action-bar-section + .gn-action-bar-section {\n border-left: solid 1px var(--g-color-line-generic);\n}\n.gn-action-bar-section_type_primary {\n flex: 1 1 auto;\n padding-left: 20px;\n padding-right: 20px;\n}\n.gn-action-bar-section_type_secondary {\n padding-left: 6px;\n padding-right: 6px;\n}";
|
|
4942
|
+
styleInject(css_248z$d);
|
|
4786
4943
|
|
|
4787
|
-
|
|
4788
|
-
|
|
4944
|
+
const b$e = block('action-bar-section');
|
|
4945
|
+
const ActionBarSection = ({ children, type = 'primary' }) => {
|
|
4946
|
+
return React__default["default"].createElement("div", { className: b$e({ type }) }, children);
|
|
4947
|
+
};
|
|
4948
|
+
ActionBarSection.displayName = 'ActionBar.Section';
|
|
4789
4949
|
|
|
4790
|
-
|
|
4791
|
-
|
|
4792
|
-
|
|
4793
|
-
|
|
4950
|
+
var css_248z$c = ".gn-action-bar-separator {\n list-style: none;\n margin: 0;\n padding: 0;\n margin-left: 6px;\n margin-right: 6px;\n border-right: solid 1px var(--g-color-line-generic);\n height: 40px;\n}";
|
|
4951
|
+
styleInject(css_248z$c);
|
|
4952
|
+
|
|
4953
|
+
const b$d = block('action-bar-separator');
|
|
4954
|
+
const ActionBarSeparator = () => {
|
|
4955
|
+
return React__default["default"].createElement("li", { role: "separator", className: b$d() });
|
|
4956
|
+
};
|
|
4957
|
+
ActionBarSeparator.displayName = 'ActionBar.Separator';
|
|
4958
|
+
|
|
4959
|
+
var css_248z$b = ".gn-action-bar {\n box-sizing: border-box;\n height: 40px;\n border-bottom: solid 1px var(--g-color-line-generic);\n display: flex;\n flex-flow: row nowrap;\n justify-content: flex-start;\n align-items: stretch;\n}";
|
|
4960
|
+
styleInject(css_248z$b);
|
|
4961
|
+
|
|
4962
|
+
const b$c = block('action-bar');
|
|
4963
|
+
const ActionBar = ({ children, className, 'aria-label': ariaLabel }) => {
|
|
4964
|
+
return (React__default["default"].createElement("section", { className: b$c(null, className), "aria-label": ariaLabel }, children));
|
|
4965
|
+
};
|
|
4966
|
+
ActionBar.displayName = 'ActionBar';
|
|
4967
|
+
const PublicActionBar = Object.assign(ActionBar, {
|
|
4968
|
+
Section: ActionBarSection,
|
|
4969
|
+
Group: ActionBarGroup,
|
|
4970
|
+
Item: ActionBarItem,
|
|
4971
|
+
Separator: ActionBarSeparator,
|
|
4972
|
+
});
|
|
4973
|
+
|
|
4974
|
+
var button_close$1 = "Close";
|
|
4975
|
+
var en$2 = {
|
|
4976
|
+
button_close: button_close$1
|
|
4977
|
+
};
|
|
4978
|
+
|
|
4979
|
+
var button_close = "Закрыть";
|
|
4980
|
+
var ru$2 = {
|
|
4981
|
+
button_close: button_close
|
|
4982
|
+
};
|
|
4983
|
+
|
|
4984
|
+
const COMPONENT$2 = 'Title';
|
|
4985
|
+
var i18n$2 = registerKeyset({ en: en$2, ru: ru$2 }, COMPONENT$2);
|
|
4986
|
+
|
|
4987
|
+
var css_248z$a = ".gn-title {\n box-sizing: border-box;\n padding: 14px 10px 14px 20px;\n min-height: 64px;\n display: flex;\n justify-content: space-between;\n align-items: center;\n}\n.gn-title_separator {\n border-bottom: 1px solid var(--g-color-line-generic);\n}\n.gn-title__text {\n margin: 0;\n margin-right: 20px;\n}";
|
|
4988
|
+
styleInject(css_248z$a);
|
|
4989
|
+
|
|
4990
|
+
const b$b = block('title');
|
|
4991
|
+
const Title = ({ children, closeIconSize = 23, hasSeparator, closeTitle = i18n$2('button_close'), onClose, }) => {
|
|
4992
|
+
return (React__default["default"].createElement("div", { className: b$b({ separator: hasSeparator }) },
|
|
4993
|
+
React__default["default"].createElement(uikit.Text, { className: b$b('text'), as: 'h3', variant: 'subheader-3' }, children),
|
|
4994
|
+
onClose && (React__default["default"].createElement(uikit.Button, { onClick: onClose, view: "flat", size: "l", extraProps: {
|
|
4995
|
+
'aria-label': closeTitle,
|
|
4996
|
+
} },
|
|
4997
|
+
React__default["default"].createElement(uikit.Icon, { data: icons.Xmark, size: closeIconSize })))));
|
|
4998
|
+
};
|
|
4999
|
+
Title.displayName = 'Title';
|
|
5000
|
+
|
|
5001
|
+
function flattenHotkeyGroups(hotkeys) {
|
|
5002
|
+
const result = [];
|
|
5003
|
+
for (const hotkeysGroup of hotkeys) {
|
|
5004
|
+
result.push({
|
|
5005
|
+
title: hotkeysGroup.title,
|
|
5006
|
+
group: true,
|
|
5007
|
+
});
|
|
5008
|
+
result.push(...hotkeysGroup.items);
|
|
4794
5009
|
}
|
|
4795
|
-
lastArgs = lastThis = undefined;
|
|
4796
5010
|
return result;
|
|
4797
|
-
|
|
5011
|
+
}
|
|
4798
5012
|
|
|
4799
|
-
|
|
4800
|
-
if (
|
|
4801
|
-
|
|
5013
|
+
function filterHotkeys(hotkeys, filter) {
|
|
5014
|
+
if (filter) {
|
|
5015
|
+
const result = [];
|
|
5016
|
+
const normalizedFilter = filter.toLowerCase();
|
|
5017
|
+
for (const hotkeysBlock of hotkeys) {
|
|
5018
|
+
const filteredItems = hotkeysBlock.items.filter((item) => item.title.toLowerCase().includes(normalizedFilter));
|
|
5019
|
+
if (filteredItems.length > 0) {
|
|
5020
|
+
result.push(Object.assign(Object.assign({}, hotkeysBlock), { items: filteredItems }));
|
|
5021
|
+
}
|
|
5022
|
+
}
|
|
5023
|
+
return result;
|
|
4802
5024
|
}
|
|
4803
|
-
|
|
4804
|
-
|
|
4805
|
-
}
|
|
5025
|
+
return hotkeys;
|
|
5026
|
+
}
|
|
4806
5027
|
|
|
4807
|
-
|
|
4808
|
-
|
|
4809
|
-
}
|
|
5028
|
+
var css_248z$9 = ".gn-hotkeys-panel {\n position: fixed;\n top: 0;\n left: 0;\n right: 0;\n bottom: 0;\n --hotkeys-panel-width: 400px;\n --hotkeys-panel-vertical-padding: 18px;\n --hotkeys-panel-horizontal-padding: 24px;\n}\n.gn-hotkeys-panel__drawer-item {\n width: var(--hotkeys-panel-width);\n padding: var(--hotkeys-panel-vertical-padding) 0;\n box-sizing: border-box;\n display: flex;\n flex-direction: column;\n}\n.gn-hotkeys-panel__title {\n margin: 0 var(--hotkeys-panel-horizontal-padding) 16px var(--hotkeys-panel-horizontal-padding);\n}\n.gn-hotkeys-panel__search {\n padding: 0 var(--hotkeys-panel-horizontal-padding);\n margin-bottom: 14px;\n}\n.gn-hotkeys-panel__list {\n flex: 1;\n overflow-y: auto;\n}\n.gn-hotkeys-panel__item {\n height: auto;\n padding: 8px var(--hotkeys-panel-horizontal-padding);\n}\n.gn-hotkeys-panel__item.yc-list__item_active {\n background: inherit;\n}\n.gn-hotkeys-panel__item-content {\n display: flex;\n align-items: baseline;\n justify-content: space-between;\n width: 100%;\n font-size: var(--g-text-body-1-font-size);\n line-height: var(--g-text-body-1-line-height);\n color: var(--g-color-text-primary);\n}\n.gn-hotkeys-panel__item-content_group {\n font-size: var(--g-text-body-2-font-size);\n font-weight: 500;\n line-height: var(--g-text-body-2-line-height);\n}\n.gn-hotkeys-panel__hotkey {\n color: var(--g-color-text-complementary);\n}";
|
|
5029
|
+
styleInject(css_248z$9);
|
|
4810
5030
|
|
|
4811
|
-
|
|
4812
|
-
|
|
4813
|
-
|
|
5031
|
+
const b$a = block('hotkeys-panel');
|
|
5032
|
+
function HotkeysPanel(_a) {
|
|
5033
|
+
var { visible, onClose, leftOffset, topOffset, className, preventScrollBody, hotkeys, itemClassName, filterPlaceholder, title, emptyState } = _a, listProps = __rest(_a, ["visible", "onClose", "leftOffset", "topOffset", "className", "preventScrollBody", "hotkeys", "itemClassName", "filterPlaceholder", "title", "emptyState"]);
|
|
5034
|
+
const [filter, setFilter] = React.useState('');
|
|
5035
|
+
const hotkeysList = React.useMemo(() => {
|
|
5036
|
+
const filteredHotkeys = filterHotkeys(hotkeys, filter);
|
|
5037
|
+
return flattenHotkeyGroups(filteredHotkeys);
|
|
5038
|
+
}, [hotkeys, filter]);
|
|
5039
|
+
const renderItem = React.useCallback((item) => (React__default["default"].createElement("div", { className: b$a('item-content', { group: item.group }), key: item.title },
|
|
5040
|
+
item.title,
|
|
5041
|
+
item.value && React__default["default"].createElement(uikit.Hotkey, { className: b$a('hotkey'), value: item.value }))), []);
|
|
5042
|
+
const drawerItemContent = (React__default["default"].createElement(React__default["default"].Fragment, null,
|
|
5043
|
+
React__default["default"].createElement("h2", { className: b$a('title') }, title),
|
|
5044
|
+
React__default["default"].createElement(uikit.TextInput, { value: filter, onUpdate: setFilter, placeholder: filterPlaceholder, autoFocus: true, className: b$a('search') }),
|
|
5045
|
+
React__default["default"].createElement(uikit.List, Object.assign({ className: b$a('list'), virtualized: false, filterable: false, items: hotkeysList, renderItem: renderItem, itemClassName: b$a('item', itemClassName), emptyPlaceholder: emptyState }, listProps))));
|
|
5046
|
+
return (React__default["default"].createElement(Drawer, { className: b$a(null, className), onVeilClick: onClose, onEscape: onClose, preventScrollBody: preventScrollBody, style: {
|
|
5047
|
+
left: leftOffset,
|
|
5048
|
+
top: topOffset,
|
|
5049
|
+
} },
|
|
5050
|
+
React__default["default"].createElement(DrawerItem, { id: "hotkeys", visible: visible, className: b$a('drawer-item'), content: drawerItemContent })));
|
|
5051
|
+
}
|
|
4814
5052
|
|
|
4815
|
-
|
|
4816
|
-
|
|
4817
|
-
|
|
5053
|
+
/**
|
|
5054
|
+
* This method returns the first argument it receives.
|
|
5055
|
+
*
|
|
5056
|
+
* @static
|
|
5057
|
+
* @since 0.1.0
|
|
5058
|
+
* @memberOf _
|
|
5059
|
+
* @category Util
|
|
5060
|
+
* @param {*} value Any value.
|
|
5061
|
+
* @returns {*} Returns `value`.
|
|
5062
|
+
* @example
|
|
5063
|
+
*
|
|
5064
|
+
* var object = { 'a': 1 };
|
|
5065
|
+
*
|
|
5066
|
+
* console.log(_.identity(object) === object);
|
|
5067
|
+
* // => true
|
|
5068
|
+
*/
|
|
4818
5069
|
|
|
4819
|
-
|
|
4820
|
-
|
|
4821
|
-
return leadingEdge(lastCallTime);
|
|
4822
|
-
}
|
|
4823
|
-
if (maxing) {
|
|
4824
|
-
// Handle invocations in a tight loop.
|
|
4825
|
-
clearTimeout(timerId);
|
|
4826
|
-
timerId = setTimeout(timerExpired, wait);
|
|
4827
|
-
return invokeFunc(lastCallTime);
|
|
4828
|
-
}
|
|
4829
|
-
}
|
|
4830
|
-
if (timerId === undefined) {
|
|
4831
|
-
timerId = setTimeout(timerExpired, wait);
|
|
4832
|
-
}
|
|
4833
|
-
return result;
|
|
4834
|
-
}
|
|
4835
|
-
debounced.cancel = cancel;
|
|
4836
|
-
debounced.flush = flush;
|
|
4837
|
-
return debounced;
|
|
5070
|
+
function identity(value) {
|
|
5071
|
+
return value;
|
|
4838
5072
|
}
|
|
4839
5073
|
|
|
4840
|
-
var
|
|
5074
|
+
var identity_1 = identity;
|
|
4841
5075
|
|
|
4842
5076
|
function useStableCallback(func) {
|
|
4843
5077
|
const funcRef = React__namespace.useRef();
|
|
@@ -4981,6 +5215,23 @@ const SettingsMenuMobile = ({ items, onChange, activeItemId, className, }) => {
|
|
|
4981
5215
|
React__default["default"].createElement(uikit.Tabs, { items: tabItems, className: b$7(null, className), size: "l", activeTab: activeItemId, onSelectTab: onChange })));
|
|
4982
5216
|
};
|
|
4983
5217
|
|
|
5218
|
+
var label_title$1 = "Settings";
|
|
5219
|
+
var en$1 = {
|
|
5220
|
+
label_title: label_title$1,
|
|
5221
|
+
"label_filter-placeholder": "Search settings",
|
|
5222
|
+
"label_empty-placeholder": "No results found"
|
|
5223
|
+
};
|
|
5224
|
+
|
|
5225
|
+
var label_title = "Настройки";
|
|
5226
|
+
var ru$1 = {
|
|
5227
|
+
label_title: label_title,
|
|
5228
|
+
"label_filter-placeholder": "Найти настройки",
|
|
5229
|
+
"label_empty-placeholder": "Ничего не найдено"
|
|
5230
|
+
};
|
|
5231
|
+
|
|
5232
|
+
const COMPONENT$1 = 'Settings';
|
|
5233
|
+
var i18n$1 = registerKeyset({ en: en$1, ru: ru$1 }, COMPONENT$1);
|
|
5234
|
+
|
|
4984
5235
|
function getSettingsFromChildren(children, searchText = '') {
|
|
4985
5236
|
// 'abc def fg' -> abc.*?cde.*?fg
|
|
4986
5237
|
const preparedFilter = escapeStringForRegExp(searchText).replace(/\s+/g, '.*?');
|
|
@@ -5106,11 +5357,6 @@ var css_248z$6 = ".gn-settings {\n display: grid;\n grid-template-columns: 216
|
|
|
5106
5357
|
styleInject(css_248z$6);
|
|
5107
5358
|
|
|
5108
5359
|
const b$6 = block('settings');
|
|
5109
|
-
const defaultDict = {
|
|
5110
|
-
heading_settings: 'Settings',
|
|
5111
|
-
placeholder_search: 'Search settings',
|
|
5112
|
-
not_found: 'No results found',
|
|
5113
|
-
};
|
|
5114
5360
|
function Settings(_a) {
|
|
5115
5361
|
var { loading, renderLoading, children, view = 'normal' } = _a, props = __rest(_a, ["loading", "renderLoading", "children", "view"]);
|
|
5116
5362
|
if (loading) {
|
|
@@ -5130,10 +5376,7 @@ const getPageTitleById = (menu, activePage) => {
|
|
|
5130
5376
|
}
|
|
5131
5377
|
return '';
|
|
5132
5378
|
};
|
|
5133
|
-
|
|
5134
|
-
dict: defaultDict,
|
|
5135
|
-
};
|
|
5136
|
-
function SettingsContent({ initialPage, children, renderNotFound, dict, view, onPageChange, onClose, }) {
|
|
5379
|
+
function SettingsContent({ initialPage, children, renderNotFound, title = i18n$1('label_title'), filterPlaceholder = i18n$1('label_filter-placeholder'), emptyPlaceholder = i18n$1('label_empty-placeholder'), view, onPageChange, onClose, }) {
|
|
5137
5380
|
var _a, _b;
|
|
5138
5381
|
const [search, setSearch] = React__default["default"].useState('');
|
|
5139
5382
|
const { menu, pages } = getSettingsFromChildren(children, search);
|
|
@@ -5175,7 +5418,7 @@ function SettingsContent({ initialPage, children, renderNotFound, dict, view, on
|
|
|
5175
5418
|
});
|
|
5176
5419
|
const renderPageContent = () => {
|
|
5177
5420
|
if (!activePage) {
|
|
5178
|
-
return typeof renderNotFound === 'function' ? (renderNotFound()) : (React__default["default"].createElement("div", { className: b$6('not-found') },
|
|
5421
|
+
return typeof renderNotFound === 'function' ? (renderNotFound()) : (React__default["default"].createElement("div", { className: b$6('not-found') }, emptyPlaceholder));
|
|
5179
5422
|
}
|
|
5180
5423
|
const filteredSections = pages[activePage].sections.filter((section) => !section.hidden);
|
|
5181
5424
|
return (React__default["default"].createElement(React__default["default"].Fragment, null,
|
|
@@ -5202,8 +5445,8 @@ function SettingsContent({ initialPage, children, renderNotFound, dict, view, on
|
|
|
5202
5445
|
}
|
|
5203
5446
|
}
|
|
5204
5447
|
} },
|
|
5205
|
-
React__default["default"].createElement(Title, null,
|
|
5206
|
-
React__default["default"].createElement(SettingsSearch, { inputRef: searchInputRef, className: b$6('search'), onChange: setSearch, placeholder:
|
|
5448
|
+
React__default["default"].createElement(Title, null, title),
|
|
5449
|
+
React__default["default"].createElement(SettingsSearch, { inputRef: searchInputRef, className: b$6('search'), onChange: setSearch, placeholder: filterPlaceholder, autoFocus: true }),
|
|
5207
5450
|
React__default["default"].createElement(SettingsMenu, { ref: menuRef, items: menu, onChange: handlePageChange, activeItemId: activePage }))),
|
|
5208
5451
|
React__default["default"].createElement("div", { className: b$6('page') }, renderPageContent())));
|
|
5209
5452
|
}
|
|
@@ -5266,7 +5509,7 @@ var css_248z$5 = ".gn-mobile-header-burger {\n margin: 0;\n padding: 0;\n fon
|
|
|
5266
5509
|
styleInject(css_248z$5);
|
|
5267
5510
|
|
|
5268
5511
|
const b$5 = block('mobile-header-burger');
|
|
5269
|
-
const Burger = React__default["default"].memo(({ opened, className, onClick }) => (React__default["default"].createElement("button", { className: b$5({ opened }, className), onClick: onClick, "aria-label": opened ?
|
|
5512
|
+
const Burger = React__default["default"].memo(({ closeTitle, openTitle, opened, className, onClick }) => (React__default["default"].createElement("button", { className: b$5({ opened }, className), onClick: onClick, "aria-label": opened ? closeTitle : openTitle },
|
|
5270
5513
|
React__default["default"].createElement("span", { className: b$5('icon') },
|
|
5271
5514
|
React__default["default"].createElement("span", { className: b$5('icon-dash') })))));
|
|
5272
5515
|
Burger.displayName = 'Burger';
|
|
@@ -5372,11 +5615,28 @@ const BurgerMenu = React__default["default"].memo(({ items = [], renderFooter, m
|
|
|
5372
5615
|
});
|
|
5373
5616
|
BurgerMenu.displayName = 'BurgerMenu';
|
|
5374
5617
|
|
|
5618
|
+
var burger_button_close$1 = "Close menu";
|
|
5619
|
+
var burger_button_open$1 = "Open menu";
|
|
5620
|
+
var en = {
|
|
5621
|
+
burger_button_close: burger_button_close$1,
|
|
5622
|
+
burger_button_open: burger_button_open$1
|
|
5623
|
+
};
|
|
5624
|
+
|
|
5625
|
+
var burger_button_close = "Закрыть меню";
|
|
5626
|
+
var burger_button_open = "Открыть меню";
|
|
5627
|
+
var ru = {
|
|
5628
|
+
burger_button_close: burger_button_close,
|
|
5629
|
+
burger_button_open: burger_button_open
|
|
5630
|
+
};
|
|
5631
|
+
|
|
5632
|
+
const COMPONENT = 'MobileHeader';
|
|
5633
|
+
var i18n = registerKeyset({ en, ru }, COMPONENT);
|
|
5634
|
+
|
|
5375
5635
|
var css_248z$1 = ".gn-mobile-header {\n --mobile-header-min-heigth: 50px;\n --mobile-header-icon-size: 20px;\n background-color: var(--g-color-base-background);\n}\n.gn-mobile-header__header {\n background-color: var(--g-color-base-background);\n border-bottom: 1px solid var(--g-color-line-generic);\n position: sticky;\n top: 0;\n padding: 0 10px;\n box-sizing: border-box;\n display: flex;\n justify-content: space-between;\n align-items: center;\n z-index: 100;\n}\n.gn-mobile-header__burger {\n padding: 12px;\n}\n.gn-mobile-header__burger-menu, .gn-mobile-header__panel-item {\n background-color: var(--g-color-base-background);\n width: 320px;\n max-width: 90vw;\n max-height: 100%;\n}\n.gn-mobile-header__user-menu {\n overflow-y: auto;\n}\n.gn-mobile-header__panels {\n z-index: 98;\n position: fixed;\n left: 0;\n right: 0;\n bottom: 0;\n top: var(--mobile-header-min-heigth);\n overflow: hidden;\n}\n.gn-mobile-header__content {\n overflow: auto;\n}";
|
|
5376
5636
|
styleInject(css_248z$1);
|
|
5377
5637
|
|
|
5378
5638
|
const b$1 = block('mobile-header');
|
|
5379
|
-
const MobileHeader = React__default["default"].forwardRef(({ logo, burgerMenu, panelItems = [], renderContent, sideItemRenderContent, onClosePanel, onEvent, className, }, ref) => {
|
|
5639
|
+
const MobileHeader = React__default["default"].forwardRef(({ logo, burgerMenu, burgerCloseTitle = i18n('burger_button_close'), burgerOpenTitle = i18n('burger_button_open'), panelItems = [], renderContent, sideItemRenderContent, onClosePanel, onEvent, className, }, ref) => {
|
|
5380
5640
|
const targetRef = useForwardRef(ref);
|
|
5381
5641
|
const [compact] = React.useState(true);
|
|
5382
5642
|
const [visiblePanel, setVisiblePanel] = React.useState(null);
|
|
@@ -5466,7 +5726,7 @@ const MobileHeader = React__default["default"].forwardRef(({ logo, burgerMenu, p
|
|
|
5466
5726
|
}, [targetRef, onBurgerClose, onBurgerOpen]);
|
|
5467
5727
|
return (React__default["default"].createElement("div", { className: b$1({ compact }, className), ref: targetRef },
|
|
5468
5728
|
React__default["default"].createElement("header", { className: b$1('header'), style: { height: size } },
|
|
5469
|
-
React__default["default"].createElement(Burger, { opened: visiblePanel === burgerPanelItem.id, onClick: () => onPanelToggle(BURGER_PANEL_ITEM_ID), className: b$1('burger') }),
|
|
5729
|
+
React__default["default"].createElement(Burger, { opened: visiblePanel === burgerPanelItem.id, onClick: () => onPanelToggle(BURGER_PANEL_ITEM_ID), className: b$1('burger'), closeTitle: burgerCloseTitle, openTitle: burgerOpenTitle }),
|
|
5470
5730
|
React__default["default"].createElement(Logo, Object.assign({}, logo, { compact: compact, onClick: onLogoClick })),
|
|
5471
5731
|
React__default["default"].createElement("div", { className: b$1('side-item') }, sideItemRenderContent === null || sideItemRenderContent === void 0 ? void 0 : sideItemRenderContent({ size }))),
|
|
5472
5732
|
React__default["default"].createElement(Drawer, { className: b$1('panels'), onVeilClick: onCloseDrawer, onEscape: onCloseDrawer, style: { top: size } }, [burgerPanelItem, ...panelItems].map((item) => (React__default["default"].createElement(DrawerItem, Object.assign({}, item, { key: item.id, visible: visiblePanel === item.id, className: b$1('panel-item', item.className) }))))),
|
|
@@ -5504,5 +5764,6 @@ exports.MobileHeader = MobileHeader;
|
|
|
5504
5764
|
exports.MobileHeaderFooterItem = FooterItem;
|
|
5505
5765
|
exports.Settings = Settings;
|
|
5506
5766
|
exports.Title = Title;
|
|
5767
|
+
exports.configure = configure;
|
|
5507
5768
|
exports.useAsideHeaderContext = useAsideHeaderContext;
|
|
5508
5769
|
//# sourceMappingURL=index.js.map
|