@vkontakte/vkui 5.6.2 → 5.7.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/dist/cjs/components/ActionSheet/ActionSheet.d.ts +4 -4
- package/dist/cjs/components/ActionSheet/ActionSheet.js +14 -4
- package/dist/cjs/components/ActionSheet/ActionSheet.js.map +1 -1
- package/dist/cjs/components/ActionSheet/ActionSheetDropdown.d.ts +1 -1
- package/dist/cjs/components/ActionSheet/ActionSheetDropdown.js.map +1 -1
- package/dist/cjs/components/ActionSheet/ActionSheetDropdownDesktop.d.ts +1 -1
- package/dist/cjs/components/ActionSheet/ActionSheetDropdownDesktop.js +5 -3
- package/dist/cjs/components/ActionSheet/ActionSheetDropdownDesktop.js.map +1 -1
- package/dist/cjs/components/ActionSheet/types.d.ts +9 -0
- package/dist/cjs/components/ActionSheet/types.js.map +1 -1
- package/dist/cjs/components/Alert/Alert.d.ts +8 -3
- package/dist/cjs/components/Alert/Alert.js +16 -96
- package/dist/cjs/components/Alert/Alert.js.map +1 -1
- package/dist/cjs/components/Alert/AlertAction.d.ts +8 -0
- package/dist/cjs/components/Alert/AlertAction.js +52 -0
- package/dist/cjs/components/Alert/AlertAction.js.map +1 -0
- package/dist/cjs/components/Alert/AlertActions.d.ts +8 -0
- package/dist/cjs/components/Alert/AlertActions.js +54 -0
- package/dist/cjs/components/Alert/AlertActions.js.map +1 -0
- package/dist/cjs/components/Alert/AlertTypography.d.ts +8 -0
- package/dist/cjs/components/Alert/AlertTypography.js +65 -0
- package/dist/cjs/components/Alert/AlertTypography.js.map +1 -0
- package/dist/cjs/components/NativeSelect/NativeSelect.js +3 -1
- package/dist/cjs/components/NativeSelect/NativeSelect.js.map +1 -1
- package/dist/cjs/components/PopoutWrapper/PopoutWrapper.js +1 -1
- package/dist/cjs/components/PopoutWrapper/PopoutWrapper.js.map +1 -1
- package/dist/cjs/components/Popover/Popover.js +1 -1
- package/dist/cjs/components/Popover/Popover.js.map +1 -1
- package/dist/cjs/components/PopperArrow/PopperArrow.d.ts +1 -2
- package/dist/cjs/components/PopperArrow/PopperArrow.js.map +1 -1
- package/dist/cjs/components/Progress/Progress.d.ts +5 -1
- package/dist/cjs/components/Progress/Progress.js +18 -3
- package/dist/cjs/components/Progress/Progress.js.map +1 -1
- package/dist/cjs/components/Root/Root.js +4 -4
- package/dist/cjs/components/Search/Search.d.ts +5 -1
- package/dist/cjs/components/Search/Search.js +10 -4
- package/dist/cjs/components/Search/Search.js.map +1 -1
- package/dist/cjs/components/Snackbar/Snackbar.d.ts +5 -1
- package/dist/cjs/components/Snackbar/Snackbar.js +8 -3
- package/dist/cjs/components/Snackbar/Snackbar.js.map +1 -1
- package/dist/cjs/components/SubnavigationButton/SubnavigationButton.d.ts +2 -1
- package/dist/cjs/components/SubnavigationButton/SubnavigationButton.js +17 -10
- package/dist/cjs/components/SubnavigationButton/SubnavigationButton.js.map +1 -1
- package/dist/cjs/components/Tooltip/Tooltip.d.ts +3 -37
- package/dist/cjs/components/Tooltip/Tooltip.js +14 -39
- package/dist/cjs/components/Tooltip/Tooltip.js.map +1 -1
- package/dist/cjs/components/TooltipBase/TooltipBase.d.ts +49 -0
- package/dist/cjs/components/TooltipBase/TooltipBase.js +58 -0
- package/dist/cjs/components/TooltipBase/TooltipBase.js.map +1 -0
- package/dist/cjs/components/View/View.js +4 -4
- package/dist/cjs/components/View/ViewInfinite.js +4 -4
- package/dist/components/ActionSheet/ActionSheet.d.ts +4 -4
- package/dist/components/ActionSheet/ActionSheet.js +14 -4
- package/dist/components/ActionSheet/ActionSheet.js.map +1 -1
- package/dist/components/ActionSheet/ActionSheetDropdown.d.ts +1 -1
- package/dist/components/ActionSheet/ActionSheetDropdown.js.map +1 -1
- package/dist/components/ActionSheet/ActionSheetDropdownDesktop.d.ts +1 -1
- package/dist/components/ActionSheet/ActionSheetDropdownDesktop.js +5 -3
- package/dist/components/ActionSheet/ActionSheetDropdownDesktop.js.map +1 -1
- package/dist/components/ActionSheet/types.d.ts +9 -0
- package/dist/components/ActionSheet/types.js.map +1 -1
- package/dist/components/Alert/Alert.d.ts +8 -3
- package/dist/components/Alert/Alert.js +14 -94
- package/dist/components/Alert/Alert.js.map +1 -1
- package/dist/components/Alert/AlertAction.d.ts +8 -0
- package/dist/components/Alert/AlertAction.js +41 -0
- package/dist/components/Alert/AlertAction.js.map +1 -0
- package/dist/components/Alert/AlertActions.d.ts +8 -0
- package/dist/components/Alert/AlertActions.js +43 -0
- package/dist/components/Alert/AlertActions.js.map +1 -0
- package/dist/components/Alert/AlertTypography.d.ts +8 -0
- package/dist/components/Alert/AlertTypography.js +46 -0
- package/dist/components/Alert/AlertTypography.js.map +1 -0
- package/dist/components/NativeSelect/NativeSelect.js +3 -1
- package/dist/components/NativeSelect/NativeSelect.js.map +1 -1
- package/dist/components/PopoutWrapper/PopoutWrapper.js +1 -1
- package/dist/components/PopoutWrapper/PopoutWrapper.js.map +1 -1
- package/dist/components/Popover/Popover.js +1 -1
- package/dist/components/Popover/Popover.js.map +1 -1
- package/dist/components/PopperArrow/PopperArrow.d.ts +1 -2
- package/dist/components/PopperArrow/PopperArrow.js.map +1 -1
- package/dist/components/Progress/Progress.d.ts +5 -1
- package/dist/components/Progress/Progress.js +18 -3
- package/dist/components/Progress/Progress.js.map +1 -1
- package/dist/components/Root/Root.js +4 -4
- package/dist/components/Search/Search.d.ts +5 -1
- package/dist/components/Search/Search.js +10 -4
- package/dist/components/Search/Search.js.map +1 -1
- package/dist/components/Snackbar/Snackbar.d.ts +5 -1
- package/dist/components/Snackbar/Snackbar.js +8 -3
- package/dist/components/Snackbar/Snackbar.js.map +1 -1
- package/dist/components/SubnavigationButton/SubnavigationButton.d.ts +2 -1
- package/dist/components/SubnavigationButton/SubnavigationButton.js +17 -10
- package/dist/components/SubnavigationButton/SubnavigationButton.js.map +1 -1
- package/dist/components/Tooltip/Tooltip.d.ts +3 -37
- package/dist/components/Tooltip/Tooltip.js +15 -40
- package/dist/components/Tooltip/Tooltip.js.map +1 -1
- package/dist/components/TooltipBase/TooltipBase.d.ts +49 -0
- package/dist/components/TooltipBase/TooltipBase.js +51 -0
- package/dist/components/TooltipBase/TooltipBase.js.map +1 -0
- package/dist/components/View/View.js +4 -4
- package/dist/components/View/ViewInfinite.js +4 -4
- package/dist/components.css +10 -9
- package/dist/components.css.map +1 -1
- package/dist/components.js.tmp +1490 -1085
- package/dist/cssm/components/ActionSheet/ActionSheet.d.ts +4 -4
- package/dist/cssm/components/ActionSheet/ActionSheet.js +12 -3
- package/dist/cssm/components/ActionSheet/ActionSheet.js.map +1 -1
- package/dist/cssm/components/ActionSheet/ActionSheet.module.css +0 -1
- package/dist/cssm/components/ActionSheet/ActionSheetDropdown.d.ts +1 -1
- package/dist/cssm/components/ActionSheet/ActionSheetDropdown.js.map +1 -1
- package/dist/cssm/components/ActionSheet/ActionSheetDropdownDesktop.d.ts +1 -1
- package/dist/cssm/components/ActionSheet/ActionSheetDropdownDesktop.js +3 -2
- package/dist/cssm/components/ActionSheet/ActionSheetDropdownDesktop.js.map +1 -1
- package/dist/cssm/components/ActionSheet/types.d.ts +9 -0
- package/dist/cssm/components/ActionSheet/types.js.map +1 -1
- package/dist/cssm/components/Alert/Alert.d.ts +8 -3
- package/dist/cssm/components/Alert/Alert.js +11 -87
- package/dist/cssm/components/Alert/Alert.js.map +1 -1
- package/dist/cssm/components/Alert/Alert.module.css +36 -30
- package/dist/cssm/components/Alert/AlertAction.d.ts +8 -0
- package/dist/cssm/components/Alert/AlertAction.js +36 -0
- package/dist/cssm/components/Alert/AlertAction.js.map +1 -0
- package/dist/cssm/components/Alert/AlertActions.d.ts +8 -0
- package/dist/cssm/components/Alert/AlertActions.js +34 -0
- package/dist/cssm/components/Alert/AlertActions.js.map +1 -0
- package/dist/cssm/components/Alert/AlertTypography.d.ts +8 -0
- package/dist/cssm/components/Alert/AlertTypography.js +51 -0
- package/dist/cssm/components/Alert/AlertTypography.js.map +1 -0
- package/dist/cssm/components/Button/Button.module.css +1 -1
- package/dist/cssm/components/Link/Link.module.css +1 -0
- package/dist/cssm/components/NativeSelect/NativeSelect.js +3 -1
- package/dist/cssm/components/NativeSelect/NativeSelect.js.map +1 -1
- package/dist/cssm/components/PopoutWrapper/PopoutWrapper.module.css +1 -0
- package/dist/cssm/components/Popover/Popover.js +1 -1
- package/dist/cssm/components/Popover/Popover.js.map +1 -1
- package/dist/cssm/components/Popover/Popover.module.css +4 -0
- package/dist/cssm/components/PopperArrow/PopperArrow.d.ts +1 -2
- package/dist/cssm/components/PopperArrow/PopperArrow.js.map +1 -1
- package/dist/cssm/components/Progress/Progress.d.ts +5 -1
- package/dist/cssm/components/Progress/Progress.js +17 -1
- package/dist/cssm/components/Progress/Progress.js.map +1 -1
- package/dist/cssm/components/Search/Search.d.ts +5 -1
- package/dist/cssm/components/Search/Search.js +8 -3
- package/dist/cssm/components/Search/Search.js.map +1 -1
- package/dist/cssm/components/Search/Search.module.css +4 -1
- package/dist/cssm/components/Snackbar/Snackbar.d.ts +5 -1
- package/dist/cssm/components/Snackbar/Snackbar.js +6 -2
- package/dist/cssm/components/Snackbar/Snackbar.js.map +1 -1
- package/dist/cssm/components/SubnavigationButton/SubnavigationButton.d.ts +2 -1
- package/dist/cssm/components/SubnavigationButton/SubnavigationButton.js +16 -10
- package/dist/cssm/components/SubnavigationButton/SubnavigationButton.js.map +1 -1
- package/dist/cssm/components/SubnavigationButton/SubnavigationButton.module.css +25 -4
- package/dist/cssm/components/Tooltip/Tooltip.d.ts +3 -37
- package/dist/cssm/components/Tooltip/Tooltip.js +13 -33
- package/dist/cssm/components/Tooltip/Tooltip.js.map +1 -1
- package/dist/cssm/components/Tooltip/Tooltip.module.css +3 -53
- package/dist/cssm/components/TooltipBase/TooltipBase.d.ts +49 -0
- package/dist/cssm/components/TooltipBase/TooltipBase.js +37 -0
- package/dist/cssm/components/TooltipBase/TooltipBase.js.map +1 -0
- package/dist/cssm/components/TooltipBase/TooltipBase.module.css +57 -0
- package/dist/vkui.css +10 -9
- package/dist/vkui.css.map +1 -1
- package/dist/vkui.js.tmp +1490 -1085
- package/package.json +1 -1
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", {
|
|
3
|
+
value: true
|
|
4
|
+
});
|
|
5
|
+
Object.defineProperty(exports, "AlertActions", {
|
|
6
|
+
enumerable: true,
|
|
7
|
+
get: function() {
|
|
8
|
+
return AlertActions;
|
|
9
|
+
}
|
|
10
|
+
});
|
|
11
|
+
var _interop_require_wildcard = require("@swc/helpers/_/_interop_require_wildcard");
|
|
12
|
+
var _object_spread = require("@swc/helpers/_/_object_spread");
|
|
13
|
+
var _object_without_properties = require("@swc/helpers/_/_object_without_properties");
|
|
14
|
+
var _react = /*#__PURE__*/ _interop_require_wildcard._(require("react"));
|
|
15
|
+
var _vkjs = require("@vkontakte/vkjs");
|
|
16
|
+
var _usePlatform = require("../../hooks/usePlatform");
|
|
17
|
+
var _platform = require("../../lib/platform");
|
|
18
|
+
var _AlertAction = require("./AlertAction");
|
|
19
|
+
var alignStyles = {
|
|
20
|
+
left: "vkuiAlert__actions--align-left",
|
|
21
|
+
center: "vkuiAlert__actions--align-center",
|
|
22
|
+
right: "vkuiAlert__actions--align-right"
|
|
23
|
+
};
|
|
24
|
+
var directionStyles = {
|
|
25
|
+
vertical: "vkuiAlert__actions--direction-vertical",
|
|
26
|
+
horizontal: "vkuiAlert__actions--direction-horizontal"
|
|
27
|
+
};
|
|
28
|
+
var AlertActions = function(param) {
|
|
29
|
+
var _param_actions = param.actions, actions = _param_actions === void 0 ? [] : _param_actions, _param_renderAction = param.renderAction, renderAction = _param_renderAction === void 0 ? function(props) {
|
|
30
|
+
return /*#__PURE__*/ _react.createElement(_AlertAction.AlertAction, props);
|
|
31
|
+
} : _param_renderAction, onItemClick = param.onItemClick, actionsAlign = param.actionsAlign, actionsLayout = param.actionsLayout;
|
|
32
|
+
var platform = (0, _usePlatform.usePlatform)();
|
|
33
|
+
var direction = platform === _platform.Platform.VKCOM ? "horizontal" : actionsLayout;
|
|
34
|
+
return /*#__PURE__*/ _react.createElement("div", {
|
|
35
|
+
className: (0, _vkjs.classNames)("vkuiAlert__actions", actionsAlign && alignStyles[actionsAlign], direction && directionStyles[direction])
|
|
36
|
+
}, actions.map(function(action, i) {
|
|
37
|
+
// Убираем
|
|
38
|
+
var children = action.title, _ = action.action, autoClose = action.autoClose, restProps = _object_without_properties._(action, [
|
|
39
|
+
"title",
|
|
40
|
+
"action",
|
|
41
|
+
"autoClose"
|
|
42
|
+
]);
|
|
43
|
+
return /*#__PURE__*/ _react.createElement(_react.Fragment, {
|
|
44
|
+
key: i
|
|
45
|
+
}, renderAction(_object_spread._({
|
|
46
|
+
children: children,
|
|
47
|
+
onClick: function() {
|
|
48
|
+
return onItemClick(action);
|
|
49
|
+
}
|
|
50
|
+
}, restProps)));
|
|
51
|
+
}));
|
|
52
|
+
};
|
|
53
|
+
|
|
54
|
+
//# sourceMappingURL=AlertActions.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../src/components/Alert/AlertActions.tsx"],"sourcesContent":["import * as React from 'react';\nimport { classNames } from '@vkontakte/vkjs';\nimport { usePlatform } from '../../hooks/usePlatform';\nimport { Platform } from '../../lib/platform';\nimport { AlertActionInterface, AlertProps } from './Alert';\nimport { AlertAction } from './AlertAction';\nimport styles from './Alert.module.css';\n\nconst alignStyles = {\n left: styles['Alert__actions--align-left'],\n center: styles['Alert__actions--align-center'],\n right: styles['Alert__actions--align-right'],\n};\n\nconst directionStyles = {\n vertical: styles['Alert__actions--direction-vertical'],\n horizontal: styles['Alert__actions--direction-horizontal'],\n};\n\ntype ItemClickHandler = (item: AlertActionInterface) => void;\ninterface AlertActionsProps\n extends Pick<AlertProps, 'actions' | 'actionsAlign' | 'renderAction' | 'actionsLayout'> {\n onItemClick: ItemClickHandler;\n}\nexport const AlertActions = ({\n actions = [],\n renderAction = (props) => <AlertAction {...props} />,\n onItemClick,\n actionsAlign,\n actionsLayout,\n}: AlertActionsProps) => {\n const platform = usePlatform();\n\n const direction: AlertProps['actionsLayout'] =\n platform === Platform.VKCOM ? 'horizontal' : actionsLayout;\n\n return (\n <div\n className={classNames(\n styles['Alert__actions'],\n actionsAlign && alignStyles[actionsAlign],\n direction && directionStyles[direction],\n )}\n >\n {actions.map((action, i) => {\n // Убираем\n const { title: children, action: _, autoClose, ...restProps } = action;\n\n return (\n <React.Fragment key={i}>\n {renderAction({\n children,\n onClick: () => onItemClick(action),\n ...restProps,\n })}\n </React.Fragment>\n );\n })}\n </div>\n );\n};\n"],"names":["AlertActions","alignStyles","left","center","right","directionStyles","vertical","horizontal","actions","renderAction","props","AlertAction","onItemClick","actionsAlign","actionsLayout","platform","usePlatform","direction","Platform","VKCOM","div","className","classNames","map","action","i","title","children","_","autoClose","restProps","React","Fragment","key","onClick"],"mappings":";;;;+BAwBaA;;;eAAAA;;;;;;+DAxBU;oBACI;2BACC;wBACH;2BAEG;AAG5B,IAAMC,cAAc;IAClBC,IAAI;IACJC,MAAM;IACNC,KAAK;AACP;AAEA,IAAMC,kBAAkB;IACtBC,QAAQ;IACRC,UAAU;AACZ;AAOO,IAAMP,eAAe;+BAC1BQ,SAAAA,sCAAU,EAAE,+CACZC,cAAAA,gDAAe,SAACC;6BAAU,qBAACC,wBAAW,EAAKD;6BAC3CE,oBAAAA,aACAC,qBAAAA,cACAC,sBAAAA;IAEA,IAAMC,WAAWC,IAAAA,wBAAW;IAE5B,IAAMC,YACJF,aAAaG,kBAAQ,CAACC,KAAK,GAAG,eAAeL;IAE/C,qBACE,qBAACM;QACCC,WAAWC,IAAAA,gBAAU,wBAEnBT,gBAAgBZ,WAAW,CAACY,aAAa,EACzCI,aAAaZ,eAAe,CAACY,UAAU;OAGxCT,QAAQe,GAAG,CAAC,SAACC,QAAQC;QACpB,UAAU;QACV,IAAQC,AAAOC,WAAiDH,OAAxDE,OAAiBF,AAAQI,IAA+BJ,OAAvCA,QAAWK,YAA4BL,OAA5BK,WAAcC,yCAAcN;YAAxDE;YAAiBF;YAAWK;;QAEpC,qBACE,qBAACE,OAAMC,QAAQ;YAACC,KAAKR;WAClBhB,aAAa;YACZkB,UAAAA;YACAO,SAAS;uBAAMtB,YAAYY;;WACxBM;IAIX;AAGN"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { HasChildren } from '../../types';
|
|
3
|
+
interface AlertTypography extends HasChildren {
|
|
4
|
+
id: string;
|
|
5
|
+
}
|
|
6
|
+
export declare const AlertHeader: (props: AlertTypography) => React.JSX.Element;
|
|
7
|
+
export declare const AlertText: (props: AlertTypography) => React.JSX.Element;
|
|
8
|
+
export {};
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", {
|
|
3
|
+
value: true
|
|
4
|
+
});
|
|
5
|
+
function _export(target, all) {
|
|
6
|
+
for(var name in all)Object.defineProperty(target, name, {
|
|
7
|
+
enumerable: true,
|
|
8
|
+
get: all[name]
|
|
9
|
+
});
|
|
10
|
+
}
|
|
11
|
+
_export(exports, {
|
|
12
|
+
AlertHeader: function() {
|
|
13
|
+
return AlertHeader;
|
|
14
|
+
},
|
|
15
|
+
AlertText: function() {
|
|
16
|
+
return AlertText;
|
|
17
|
+
}
|
|
18
|
+
});
|
|
19
|
+
var _interop_require_wildcard = require("@swc/helpers/_/_interop_require_wildcard");
|
|
20
|
+
var _object_spread = require("@swc/helpers/_/_object_spread");
|
|
21
|
+
var _react = /*#__PURE__*/ _interop_require_wildcard._(require("react"));
|
|
22
|
+
var _usePlatform = require("../../hooks/usePlatform");
|
|
23
|
+
var _platform = require("../../lib/platform");
|
|
24
|
+
var _Caption = require("../Typography/Caption/Caption");
|
|
25
|
+
var _Footnote = require("../Typography/Footnote/Footnote");
|
|
26
|
+
var _Text = require("../Typography/Text/Text");
|
|
27
|
+
var _Title = require("../Typography/Title/Title");
|
|
28
|
+
var AlertHeader = function(props) {
|
|
29
|
+
var platform = (0, _usePlatform.usePlatform)();
|
|
30
|
+
switch(platform){
|
|
31
|
+
case _platform.Platform.IOS:
|
|
32
|
+
return /*#__PURE__*/ _react.createElement(_Title.Title, _object_spread._({
|
|
33
|
+
className: "vkuiAlert__header",
|
|
34
|
+
weight: "1",
|
|
35
|
+
level: "3"
|
|
36
|
+
}, props));
|
|
37
|
+
default:
|
|
38
|
+
return /*#__PURE__*/ _react.createElement(_Title.Title, _object_spread._({
|
|
39
|
+
className: "vkuiAlert__header",
|
|
40
|
+
weight: "2",
|
|
41
|
+
level: "2"
|
|
42
|
+
}, props));
|
|
43
|
+
}
|
|
44
|
+
};
|
|
45
|
+
var AlertText = function(props) {
|
|
46
|
+
var platform = (0, _usePlatform.usePlatform)();
|
|
47
|
+
switch(platform){
|
|
48
|
+
case _platform.Platform.VKCOM:
|
|
49
|
+
return /*#__PURE__*/ _react.createElement(_Footnote.Footnote, _object_spread._({
|
|
50
|
+
className: "vkuiAlert__text"
|
|
51
|
+
}, props));
|
|
52
|
+
case _platform.Platform.IOS:
|
|
53
|
+
return /*#__PURE__*/ _react.createElement(_Caption.Caption, _object_spread._({
|
|
54
|
+
className: "vkuiAlert__text"
|
|
55
|
+
}, props));
|
|
56
|
+
default:
|
|
57
|
+
return /*#__PURE__*/ _react.createElement(_Text.Text, _object_spread._({
|
|
58
|
+
Component: "span",
|
|
59
|
+
className: "vkuiAlert__text",
|
|
60
|
+
weight: "3"
|
|
61
|
+
}, props));
|
|
62
|
+
}
|
|
63
|
+
};
|
|
64
|
+
|
|
65
|
+
//# sourceMappingURL=AlertTypography.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../src/components/Alert/AlertTypography.tsx"],"sourcesContent":["import * as React from 'react';\nimport { usePlatform } from '../../hooks/usePlatform';\nimport { Platform } from '../../lib/platform';\nimport { HasChildren } from '../../types';\nimport { Caption } from '../Typography/Caption/Caption';\nimport { Footnote } from '../Typography/Footnote/Footnote';\nimport { Text } from '../Typography/Text/Text';\nimport { Title } from '../Typography/Title/Title';\nimport styles from './Alert.module.css';\n\ninterface AlertTypography extends HasChildren {\n id: string;\n}\nexport const AlertHeader = (props: AlertTypography) => {\n const platform = usePlatform();\n\n switch (platform) {\n case Platform.IOS:\n return <Title className={styles['Alert__header']} weight=\"1\" level=\"3\" {...props} />;\n default:\n return <Title className={styles['Alert__header']} weight=\"2\" level=\"2\" {...props} />;\n }\n};\nexport const AlertText = (props: AlertTypography) => {\n const platform = usePlatform();\n\n switch (platform) {\n case Platform.VKCOM:\n return <Footnote className={styles['Alert__text']} {...props} />;\n case Platform.IOS:\n return <Caption className={styles['Alert__text']} {...props} />;\n default:\n return <Text Component=\"span\" className={styles['Alert__text']} weight=\"3\" {...props} />;\n }\n};\n"],"names":["AlertHeader","AlertText","props","platform","usePlatform","Platform","IOS","Title","className","weight","level","VKCOM","Footnote","Caption","Text","Component"],"mappings":";;;;;;;;;;;IAaaA,WAAW;eAAXA;;IAUAC,SAAS;eAATA;;;;;+DAvBU;2BACK;wBACH;uBAED;wBACC;oBACJ;qBACC;AAMf,IAAMD,cAAc,SAACE;IAC1B,IAAMC,WAAWC,IAAAA,wBAAW;IAE5B,OAAQD;QACN,KAAKE,kBAAQ,CAACC,GAAG;YACf,qBAAO,qBAACC,YAAK;gBAACC,SAAS;gBAA2BC,QAAO;gBAAIC,OAAM;eAAQR;QAC7E;YACE,qBAAO,qBAACK,YAAK;gBAACC,SAAS;gBAA2BC,QAAO;gBAAIC,OAAM;eAAQR;IAC/E;AACF;AACO,IAAMD,YAAY,SAACC;IACxB,IAAMC,WAAWC,IAAAA,wBAAW;IAE5B,OAAQD;QACN,KAAKE,kBAAQ,CAACM,KAAK;YACjB,qBAAO,qBAACC,kBAAQ;gBAACJ,SAAS;eAA6BN;QACzD,KAAKG,kBAAQ,CAACC,GAAG;YACf,qBAAO,qBAACO,gBAAO;gBAACL,SAAS;eAA6BN;QACxD;YACE,qBAAO,qBAACY,UAAI;gBAACC,WAAU;gBAAOP,SAAS;gBAAyBC,QAAO;eAAQP;IACnF;AACF"}
|
|
@@ -20,6 +20,7 @@ var _useAdaptivity = require("../../hooks/useAdaptivity");
|
|
|
20
20
|
var _useEnsuredControl = require("../../hooks/useEnsuredControl");
|
|
21
21
|
var _useExternRef = require("../../hooks/useExternRef");
|
|
22
22
|
var _adaptivity = require("../../lib/adaptivity");
|
|
23
|
+
var _select = require("../../lib/select");
|
|
23
24
|
var _useIsomorphicLayoutEffect = require("../../lib/useIsomorphicLayoutEffect");
|
|
24
25
|
var _DropdownIcon = require("../DropdownIcon/DropdownIcon");
|
|
25
26
|
var _FormField = require("../FormField/FormField");
|
|
@@ -77,7 +78,8 @@ var sizeYClassNames = _define_property._({
|
|
|
77
78
|
disabled: disabled,
|
|
78
79
|
before: before,
|
|
79
80
|
after: icon,
|
|
80
|
-
status: status
|
|
81
|
+
status: status,
|
|
82
|
+
mode: (0, _select.getFormFieldModeFromSelectType)(selectType)
|
|
81
83
|
}, /*#__PURE__*/ _react.createElement("select", _object_spread_props._(_object_spread._({}, restProps), {
|
|
82
84
|
disabled: disabled,
|
|
83
85
|
className: "vkuiSelect__el",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/components/NativeSelect/NativeSelect.tsx"],"sourcesContent":["import * as React from 'react';\nimport { classNames } from '@vkontakte/vkjs';\nimport { useAdaptivity } from '../../hooks/useAdaptivity';\nimport { useEnsuredControl } from '../../hooks/useEnsuredControl';\nimport { useExternRef } from '../../hooks/useExternRef';\nimport { SizeType } from '../../lib/adaptivity';\nimport { useIsomorphicLayoutEffect } from '../../lib/useIsomorphicLayoutEffect';\nimport { HasAlign, HasRef, HasRootRef } from '../../types';\nimport { DropdownIcon } from '../DropdownIcon/DropdownIcon';\nimport { FormField, FormFieldProps } from '../FormField/FormField';\nimport type { SelectType } from '../Select/Select';\nimport { SelectTypography } from '../SelectTypography/SelectTypography';\nimport styles from '../Select/Select.module.css';\n\nconst sizeYClassNames = {\n none: styles['Select--sizeY-none'],\n [SizeType.COMPACT]: styles['Select--sizeY-compact'],\n};\n\nexport interface NativeSelectProps\n extends Omit<React.SelectHTMLAttributes<HTMLSelectElement>, 'multiple'>,\n HasRef<HTMLSelectElement>,\n HasRootRef<HTMLLabelElement>,\n HasAlign,\n Pick<FormFieldProps, 'before' | 'status'> {\n placeholder?: string;\n multiline?: boolean;\n selectType?: SelectType;\n /**\n * Иконка раскрывающегося списка\n */\n icon?: React.ReactNode;\n}\n\nexport interface SelectState {\n value?: React.SelectHTMLAttributes<HTMLSelectElement>['value'];\n title?: string;\n notSelected?: boolean;\n}\n\n/**\n * @see https://vkcom.github.io/VKUI/#/NativeSelect\n */\nconst NativeSelect = ({\n style,\n defaultValue = '',\n align,\n placeholder,\n children,\n className,\n getRef,\n getRootRef,\n disabled,\n multiline,\n selectType = 'default',\n status,\n icon = <DropdownIcon />,\n before,\n onChange: onChangeProp,\n value: valueProp,\n ...restProps\n}: NativeSelectProps) => {\n const [title, setTitle] = React.useState('');\n const [empty, setEmpty] = React.useState(false);\n const [value, onChange] = useEnsuredControl({\n defaultValue,\n disabled,\n onChange: onChangeProp,\n value: valueProp,\n });\n const selectRef = useExternRef(getRef);\n const { sizeY = 'none' } = useAdaptivity();\n\n useIsomorphicLayoutEffect(() => {\n const selectedOption = selectRef.current?.options[selectRef.current.selectedIndex];\n if (selectedOption) {\n setTitle(selectedOption.text);\n setEmpty(selectedOption.value === '' && placeholder != null);\n }\n }, [value, children]);\n\n return (\n <FormField\n Component=\"label\"\n className={classNames(\n styles['Select'],\n 'vkuiInternalNativeSelect',\n before && styles['Select--hasBefore'],\n empty && styles['Select--empty'],\n multiline && styles['Select--multiline'],\n align === 'center' && styles['Select--align-center'],\n align === 'right' && styles['Select--align-right'],\n sizeY !== SizeType.REGULAR && sizeYClassNames[sizeY],\n className,\n )}\n style={style}\n getRootRef={getRootRef}\n disabled={disabled}\n before={before}\n after={icon}\n status={status}\n >\n <select\n {...restProps}\n disabled={disabled}\n className={styles['Select__el']}\n onChange={onChange}\n value={value}\n ref={selectRef}\n >\n {placeholder && <option value=\"\">{placeholder}</option>}\n {children}\n </select>\n <div className={styles['Select__container']} aria-hidden>\n <SelectTypography className={styles['Select__title']} selectType={selectType}>\n {title}\n </SelectTypography>\n </div>\n </FormField>\n );\n};\n\nexport { NativeSelect };\n"],"names":["NativeSelect","sizeYClassNames","none","SizeType","COMPACT","style","defaultValue","align","placeholder","children","className","getRef","getRootRef","disabled","multiline","selectType","status","icon","DropdownIcon","before","onChange","onChangeProp","value","valueProp","restProps","React","useState","title","setTitle","empty","setEmpty","useEnsuredControl","selectRef","useExternRef","useAdaptivity","sizeY","useIsomorphicLayoutEffect","selectedOption","current","options","selectedIndex","text","FormField","Component","classNames","REGULAR","after","select","ref","option","div","aria-hidden","SelectTypography"],"mappings":";;;;+
|
|
1
|
+
{"version":3,"sources":["../../../../src/components/NativeSelect/NativeSelect.tsx"],"sourcesContent":["import * as React from 'react';\nimport { classNames } from '@vkontakte/vkjs';\nimport { useAdaptivity } from '../../hooks/useAdaptivity';\nimport { useEnsuredControl } from '../../hooks/useEnsuredControl';\nimport { useExternRef } from '../../hooks/useExternRef';\nimport { SizeType } from '../../lib/adaptivity';\nimport { getFormFieldModeFromSelectType } from '../../lib/select';\nimport { useIsomorphicLayoutEffect } from '../../lib/useIsomorphicLayoutEffect';\nimport { HasAlign, HasRef, HasRootRef } from '../../types';\nimport { DropdownIcon } from '../DropdownIcon/DropdownIcon';\nimport { FormField, FormFieldProps } from '../FormField/FormField';\nimport type { SelectType } from '../Select/Select';\nimport { SelectTypography } from '../SelectTypography/SelectTypography';\nimport styles from '../Select/Select.module.css';\n\nconst sizeYClassNames = {\n none: styles['Select--sizeY-none'],\n [SizeType.COMPACT]: styles['Select--sizeY-compact'],\n};\n\nexport interface NativeSelectProps\n extends Omit<React.SelectHTMLAttributes<HTMLSelectElement>, 'multiple'>,\n HasRef<HTMLSelectElement>,\n HasRootRef<HTMLLabelElement>,\n HasAlign,\n Pick<FormFieldProps, 'before' | 'status'> {\n placeholder?: string;\n multiline?: boolean;\n selectType?: SelectType;\n /**\n * Иконка раскрывающегося списка\n */\n icon?: React.ReactNode;\n}\n\nexport interface SelectState {\n value?: React.SelectHTMLAttributes<HTMLSelectElement>['value'];\n title?: string;\n notSelected?: boolean;\n}\n\n/**\n * @see https://vkcom.github.io/VKUI/#/NativeSelect\n */\nconst NativeSelect = ({\n style,\n defaultValue = '',\n align,\n placeholder,\n children,\n className,\n getRef,\n getRootRef,\n disabled,\n multiline,\n selectType = 'default',\n status,\n icon = <DropdownIcon />,\n before,\n onChange: onChangeProp,\n value: valueProp,\n ...restProps\n}: NativeSelectProps) => {\n const [title, setTitle] = React.useState('');\n const [empty, setEmpty] = React.useState(false);\n const [value, onChange] = useEnsuredControl({\n defaultValue,\n disabled,\n onChange: onChangeProp,\n value: valueProp,\n });\n const selectRef = useExternRef(getRef);\n const { sizeY = 'none' } = useAdaptivity();\n\n useIsomorphicLayoutEffect(() => {\n const selectedOption = selectRef.current?.options[selectRef.current.selectedIndex];\n if (selectedOption) {\n setTitle(selectedOption.text);\n setEmpty(selectedOption.value === '' && placeholder != null);\n }\n }, [value, children]);\n\n return (\n <FormField\n Component=\"label\"\n className={classNames(\n styles['Select'],\n 'vkuiInternalNativeSelect',\n before && styles['Select--hasBefore'],\n empty && styles['Select--empty'],\n multiline && styles['Select--multiline'],\n align === 'center' && styles['Select--align-center'],\n align === 'right' && styles['Select--align-right'],\n sizeY !== SizeType.REGULAR && sizeYClassNames[sizeY],\n className,\n )}\n style={style}\n getRootRef={getRootRef}\n disabled={disabled}\n before={before}\n after={icon}\n status={status}\n mode={getFormFieldModeFromSelectType(selectType)}\n >\n <select\n {...restProps}\n disabled={disabled}\n className={styles['Select__el']}\n onChange={onChange}\n value={value}\n ref={selectRef}\n >\n {placeholder && <option value=\"\">{placeholder}</option>}\n {children}\n </select>\n <div className={styles['Select__container']} aria-hidden>\n <SelectTypography className={styles['Select__title']} selectType={selectType}>\n {title}\n </SelectTypography>\n </div>\n </FormField>\n );\n};\n\nexport { NativeSelect };\n"],"names":["NativeSelect","sizeYClassNames","none","SizeType","COMPACT","style","defaultValue","align","placeholder","children","className","getRef","getRootRef","disabled","multiline","selectType","status","icon","DropdownIcon","before","onChange","onChangeProp","value","valueProp","restProps","React","useState","title","setTitle","empty","setEmpty","useEnsuredControl","selectRef","useExternRef","useAdaptivity","sizeY","useIsomorphicLayoutEffect","selectedOption","current","options","selectedIndex","text","FormField","Component","classNames","REGULAR","after","mode","getFormFieldModeFromSelectType","select","ref","option","div","aria-hidden","SelectTypography"],"mappings":";;;;+BA4HSA;;;eAAAA;;;;;;;;;+DA5Hc;oBACI;6BACG;iCACI;4BACL;0BACJ;sBACsB;yCACL;4BAEb;yBACa;gCAET;AAGjC,IAAMC;IACJC,IAAI;GACHC,oBAAQ,CAACC,OAAO;AAwBnB;;CAEC,GACD,IAAMJ,eAAe;QACnBK,eAAAA,oCACAC,cAAAA,gDAAe,0BACfC,eAAAA,OACAC,qBAAAA,aACAC,kBAAAA,UACAC,mBAAAA,WACAC,gBAAAA,QACAC,oBAAAA,YACAC,kBAAAA,UACAC,mBAAAA,sCACAC,YAAAA,4CAAa,+BACbC,gBAAAA,6BACAC,MAAAA,8CAAO,qBAACC,0BAAY,uBACpBC,gBAAAA,QACAC,AAAUC,sBAAVD,UACAE,AAAOC,mBAAPD,OACGE;QAhBHnB;QACAC;QACAC;QACAC;QACAC;QACAC;QACAC;QACAC;QACAC;QACAC;QACAC;QACAC;QACAC;QACAE;QACAC;QACAE;;IAGA,IAA0BG,qCAAAA,OAAMC,QAAQ,CAAC,SAAlCC,QAAmBF,oBAAZG,WAAYH;IAC1B,IAA0BA,sCAAAA,OAAMC,QAAQ,CAAC,YAAlCG,QAAmBJ,qBAAZK,WAAYL;IAC1B,IAA0BM,yCAAAA,IAAAA,oCAAiB,EAAC;QAC1CzB,cAAAA;QACAO,UAAAA;QACAO,UAAUC;QACVC,OAAOC;IACT,QALOD,QAAmBS,wBAAZX,WAAYW;IAM1B,IAAMC,YAAYC,IAAAA,0BAAY,EAACtB;IAC/B,IAA2BuB,kBAAAA,IAAAA,4BAAa,4BAAbA,gBAAnBC,OAAAA,0CAAQ;IAEhBC,IAAAA,oDAAyB,EAAC;YACDJ;QAAvB,IAAMK,kBAAiBL,qBAAAA,UAAUM,OAAO,cAAjBN,yCAAAA,mBAAmBO,OAAO,CAACP,UAAUM,OAAO,CAACE,aAAa,CAAC;QAClF,IAAIH,gBAAgB;YAClBT,SAASS,eAAeI,IAAI;YAC5BX,SAASO,eAAef,KAAK,KAAK,MAAMd,eAAe;QACzD;IACF,GAAG;QAACc;QAAOb;KAAS;IAEpB,qBACE,qBAACiC,oBAAS;QACRC,WAAU;QACVjC,WAAWkC,IAAAA,gBAAU,gBAEnB,4BACAzB,mCACAU,8BACAf,sCACAP,UAAU,wCACVA,UAAU,sCACV4B,UAAUhC,oBAAQ,CAAC0C,OAAO,IAAI5C,eAAe,CAACkC,MAAM,EACpDzB;QAEFL,OAAOA;QACPO,YAAYA;QACZC,UAAUA;QACVM,QAAQA;QACR2B,OAAO7B;QACPD,QAAQA;QACR+B,MAAMC,IAAAA,sCAA8B,EAACjC;qBAErC,qBAACkC,sDACKzB;QACJX,UAAUA;QACVH,SAAS;QACTU,UAAUA;QACVE,OAAOA;QACP4B,KAAKlB;QAEJxB,6BAAe,qBAAC2C;QAAO7B,OAAM;OAAId,cACjCC,yBAEH,qBAAC2C;QAAI1C,SAAS;QAA+B2C,eAAAA;qBAC3C,qBAACC,kCAAgB;QAAC5C,SAAS;QAA2BK,YAAYA;OAC/DY;AAKX"}
|
|
@@ -35,7 +35,7 @@ var PopoutWrapper = function(_param) {
|
|
|
35
35
|
var _React_useState = _sliced_to_array._(_react.useState(!hasMask), 2), opened = _React_useState[0], setOpened = _React_useState[1];
|
|
36
36
|
var elRef = _react.useRef(null);
|
|
37
37
|
var onFadeInEnd = function(e) {
|
|
38
|
-
if (!e || e.animationName === "
|
|
38
|
+
if (!e || e.animationName === "vkuivkui-animation-full-fade-in") {
|
|
39
39
|
setOpened(true);
|
|
40
40
|
}
|
|
41
41
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/components/PopoutWrapper/PopoutWrapper.tsx"],"sourcesContent":["import * as React from 'react';\nimport { classNames } from '@vkontakte/vkjs';\nimport { useGlobalEventListener } from '../../hooks/useGlobalEventListener';\nimport { usePlatform } from '../../hooks/usePlatform';\nimport { useTimeout } from '../../hooks/useTimeout';\nimport { useDOM } from '../../lib/dom';\nimport { Platform } from '../../lib/platform';\nimport styles from './PopoutWrapper.module.css';\n\nexport interface PopoutWrapperProps extends React.HTMLAttributes<HTMLDivElement> {\n hasMask?: boolean;\n fixed?: boolean;\n alignY?: 'top' | 'center' | 'bottom';\n alignX?: 'left' | 'center' | 'right';\n closing?: boolean;\n}\n\n/**\n * @see https://vkcom.github.io/VKUI/#/PopoutWrapper\n */\nexport const PopoutWrapper = ({\n alignY = 'center',\n alignX = 'center',\n closing = false,\n hasMask = true,\n fixed = true,\n children,\n onClick,\n className,\n ...restProps\n}: PopoutWrapperProps) => {\n const platform = usePlatform();\n const [opened, setOpened] = React.useState(!hasMask);\n const elRef = React.useRef<HTMLDivElement>(null);\n\n const onFadeInEnd = (e?: React.AnimationEvent) => {\n if (!e || e.animationName === styles['vkui-animation-full-fade-in']) {\n setOpened(true);\n }\n };\n const animationFinishFallback = useTimeout(onFadeInEnd, platform === Platform.IOS ? 300 : 200);\n React.useEffect(() => {\n !opened && animationFinishFallback.set();\n }, [animationFinishFallback, opened]);\n\n const { window } = useDOM();\n useGlobalEventListener(window, 'touchmove', (e) => e.preventDefault(), {\n passive: false,\n });\n\n return (\n <div\n {...restProps}\n className={classNames(\n styles['PopoutWrapper'],\n {\n center: styles['PopoutWrapper--alignY-center'],\n top: styles['PopoutWrapper--alignY-top'],\n bottom: styles['PopoutWrapper--alignY-bottom'],\n }[alignY],\n {\n center: styles['PopoutWrapper--alignX-center'],\n left: styles['PopoutWrapper--alignX-left'],\n right: styles['PopoutWrapper--alignX-right'],\n }[alignX],\n closing && styles['PopoutWrapper--closing'],\n opened && styles['PopoutWrapper--opened'],\n fixed && styles['PopoutWrapper--fixed'],\n hasMask && styles['PopoutWrapper--masked'],\n className,\n )}\n onAnimationEnd={opened ? undefined : onFadeInEnd}\n ref={elRef}\n >\n <div className={styles['PopoutWrapper__container']}>\n <div className={styles['PopoutWrapper__overlay']} onClick={onClick} />\n <div className={styles['PopoutWrapper__content']}>{children}</div>\n </div>\n </div>\n );\n};\n"],"names":["PopoutWrapper","alignY","alignX","closing","hasMask","fixed","children","onClick","className","restProps","platform","usePlatform","React","useState","opened","setOpened","elRef","useRef","onFadeInEnd","e","animationName","animationFinishFallback","useTimeout","Platform","IOS","useEffect","set","window","useDOM","useGlobalEventListener","preventDefault","passive","div","classNames","center","top","bottom","left","right","onAnimationEnd","undefined","ref"],"mappings":";;;;+BAoBaA;;;eAAAA;;;;;;;;+DApBU;oBACI;sCACY;2BACX;0BACD;mBACJ;wBACE;AAclB,IAAMA,gBAAgB;+BAC3BC,QAAAA,oCAAS,iDACTC,QAAAA,oCAAS,kDACTC,SAAAA,sCAAU,gDACVC,SAAAA,sCAAU,6CACVC,OAAAA,kCAAQ,qBACRC,kBAAAA,UACAC,iBAAAA,SACAC,mBAAAA,WACGC;QARHR;QACAC;QACAC;QACAC;QACAC;QACAC;QACAC;QACAC;;IAGA,IAAME,WAAWC,IAAAA,wBAAW;IAC5B,IAA4BC,qCAAAA,OAAMC,QAAQ,CAAC,CAACT,cAArCU,SAAqBF,oBAAbG,YAAaH;IAC5B,IAAMI,QAAQJ,OAAMK,MAAM,CAAiB;IAE3C,IAAMC,cAAc,SAACC;QACnB,IAAI,CAACA,KAAKA,EAAEC,aAAa,
|
|
1
|
+
{"version":3,"sources":["../../../../src/components/PopoutWrapper/PopoutWrapper.tsx"],"sourcesContent":["import * as React from 'react';\nimport { classNames } from '@vkontakte/vkjs';\nimport { useGlobalEventListener } from '../../hooks/useGlobalEventListener';\nimport { usePlatform } from '../../hooks/usePlatform';\nimport { useTimeout } from '../../hooks/useTimeout';\nimport { useDOM } from '../../lib/dom';\nimport { Platform } from '../../lib/platform';\nimport styles from './PopoutWrapper.module.css';\n\nexport interface PopoutWrapperProps extends React.HTMLAttributes<HTMLDivElement> {\n hasMask?: boolean;\n fixed?: boolean;\n alignY?: 'top' | 'center' | 'bottom';\n alignX?: 'left' | 'center' | 'right';\n closing?: boolean;\n}\n\n/**\n * @see https://vkcom.github.io/VKUI/#/PopoutWrapper\n */\nexport const PopoutWrapper = ({\n alignY = 'center',\n alignX = 'center',\n closing = false,\n hasMask = true,\n fixed = true,\n children,\n onClick,\n className,\n ...restProps\n}: PopoutWrapperProps) => {\n const platform = usePlatform();\n const [opened, setOpened] = React.useState(!hasMask);\n const elRef = React.useRef<HTMLDivElement>(null);\n\n const onFadeInEnd = (e?: React.AnimationEvent) => {\n if (!e || e.animationName === styles['vkui-animation-full-fade-in']) {\n setOpened(true);\n }\n };\n const animationFinishFallback = useTimeout(onFadeInEnd, platform === Platform.IOS ? 300 : 200);\n React.useEffect(() => {\n !opened && animationFinishFallback.set();\n }, [animationFinishFallback, opened]);\n\n const { window } = useDOM();\n useGlobalEventListener(window, 'touchmove', (e) => e.preventDefault(), {\n passive: false,\n });\n\n return (\n <div\n {...restProps}\n className={classNames(\n styles['PopoutWrapper'],\n {\n center: styles['PopoutWrapper--alignY-center'],\n top: styles['PopoutWrapper--alignY-top'],\n bottom: styles['PopoutWrapper--alignY-bottom'],\n }[alignY],\n {\n center: styles['PopoutWrapper--alignX-center'],\n left: styles['PopoutWrapper--alignX-left'],\n right: styles['PopoutWrapper--alignX-right'],\n }[alignX],\n closing && styles['PopoutWrapper--closing'],\n opened && styles['PopoutWrapper--opened'],\n fixed && styles['PopoutWrapper--fixed'],\n hasMask && styles['PopoutWrapper--masked'],\n className,\n )}\n onAnimationEnd={opened ? undefined : onFadeInEnd}\n ref={elRef}\n >\n <div className={styles['PopoutWrapper__container']}>\n <div className={styles['PopoutWrapper__overlay']} onClick={onClick} />\n <div className={styles['PopoutWrapper__content']}>{children}</div>\n </div>\n </div>\n );\n};\n"],"names":["PopoutWrapper","alignY","alignX","closing","hasMask","fixed","children","onClick","className","restProps","platform","usePlatform","React","useState","opened","setOpened","elRef","useRef","onFadeInEnd","e","animationName","animationFinishFallback","useTimeout","Platform","IOS","useEffect","set","window","useDOM","useGlobalEventListener","preventDefault","passive","div","classNames","center","top","bottom","left","right","onAnimationEnd","undefined","ref"],"mappings":";;;;+BAoBaA;;;eAAAA;;;;;;;;+DApBU;oBACI;sCACY;2BACX;0BACD;mBACJ;wBACE;AAclB,IAAMA,gBAAgB;+BAC3BC,QAAAA,oCAAS,iDACTC,QAAAA,oCAAS,kDACTC,SAAAA,sCAAU,gDACVC,SAAAA,sCAAU,6CACVC,OAAAA,kCAAQ,qBACRC,kBAAAA,UACAC,iBAAAA,SACAC,mBAAAA,WACGC;QARHR;QACAC;QACAC;QACAC;QACAC;QACAC;QACAC;QACAC;;IAGA,IAAME,WAAWC,IAAAA,wBAAW;IAC5B,IAA4BC,qCAAAA,OAAMC,QAAQ,CAAC,CAACT,cAArCU,SAAqBF,oBAAbG,YAAaH;IAC5B,IAAMI,QAAQJ,OAAMK,MAAM,CAAiB;IAE3C,IAAMC,cAAc,SAACC;QACnB,IAAI,CAACA,KAAKA,EAAEC,aAAa,wCAA4C;YACnEL,UAAU;QACZ;IACF;IACA,IAAMM,0BAA0BC,IAAAA,sBAAU,EAACJ,aAAaR,aAAaa,kBAAQ,CAACC,GAAG,GAAG,MAAM;IAC1FZ,OAAMa,SAAS,CAAC;QACd,CAACX,UAAUO,wBAAwBK,GAAG;IACxC,GAAG;QAACL;QAAyBP;KAAO;IAEpC,IAAM,AAAEa,SAAWC,IAAAA,WAAM,IAAjBD;IACRE,IAAAA,8CAAsB,EAACF,QAAQ,aAAa,SAACR;eAAMA,EAAEW,cAAc;OAAI;QACrEC,SAAS;IACX;IAEA,qBACE,qBAACC,mDACKvB;QACJD,WAAWyB,IAAAA,gBAAU,uBAEnB;YACEC,MAAM;YACNC,GAAG;YACHC,MAAM;QACR,CAAC,CAACnC,OAAO,EACT;YACEiC,MAAM;YACNG,IAAI;YACJC,KAAK;QACP,CAAC,CAACpC,OAAO,EACTC,yCACAW,uCACAT,qCACAD,wCACAI;QAEF+B,gBAAgBzB,SAAS0B,YAAYtB;QACrCuB,KAAKzB;sBAEL,qBAACgB;QAAIxB,SAAS;qBACZ,qBAACwB;QAAIxB,SAAS;QAAoCD,SAASA;sBAC3D,qBAACyB;QAAIxB,SAAS;OAAqCF;AAI3D"}
|
|
@@ -130,7 +130,7 @@ var Popover = function(_param) {
|
|
|
130
130
|
renderContent: function(param) {
|
|
131
131
|
var wrapperClassName = param.className;
|
|
132
132
|
return /*#__PURE__*/ _react.createElement(_FocusTrap.FocusTrap, {
|
|
133
|
-
className: wrapperClassName,
|
|
133
|
+
className: (0, _vkjs.classNames)("vkuiPopover__in", wrapperClassName),
|
|
134
134
|
onClose: handleContentKeyDownEscape,
|
|
135
135
|
restoreFocus: restoreFocus
|
|
136
136
|
}, content);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/components/Popover/Popover.tsx"],"sourcesContent":["import * as React from 'react';\nimport { classNames } from '@vkontakte/vkjs';\nimport { useEventListener } from '../../hooks/useEventListener';\nimport { useExternRef } from '../../hooks/useExternRef';\nimport { useGlobalEventListener } from '../../hooks/useGlobalEventListener';\nimport { usePatchChildrenRef } from '../../hooks/usePatchChildrenRef';\nimport { useTimeout } from '../../hooks/useTimeout';\nimport { useDOM } from '../../lib/dom';\nimport { FocusTrap, FocusTrapProps } from '../FocusTrap/FocusTrap';\nimport { Popper, PopperCommonProps } from '../Popper/Popper';\nimport styles from './Popover.module.css';\n\nexport interface PopoverProps\n extends Omit<\n PopperCommonProps,\n 'arrow' | 'arrowClassName' | 'arrowHeight' | 'arrowPadding' | 'ArrowIcon' | 'content'\n >,\n Pick<FocusTrapProps, 'restoreFocus'> {\n /**\n * Механика вызова всплывающего окна.\n *\n * - `\"click\"` – показывается/скрывается только при нажатии.\n * - `\"hover\"` – помимо нажатия, будет показываться/скрывается при наведении/отведении мыши.\n *\n * > ⚠️`\"hover\"` на тач-устройствах будет работать как `\"click\"`, с одним лишь нюансом, что не будет закрываться\n * > при повторном нажатии на целевой элемент. Для закрытия необходимо нажать на область вне целевого элемента\n * > и выпадающего окна.\n */\n action?: 'click' | 'hover';\n /**\n * Если передан, то всплывающее окно будет показано/скрыто в зависимости от значения свойства.\n */\n shown?: boolean;\n /**\n * Количество миллисекунд, после которых произойдёт показ всплывающего окна.\n *\n * > Используется только для `action=\"hover\"` при наведении/отведении мыши.\n */\n showDelay?: number;\n /**\n * Количество миллисекунд, после которых произойдёт скрытие всплывающего окна.\n *\n * > Используется только для `action=\"hover\"` при наведении/отведении мыши.\n */\n hideDelay?: number;\n /**\n * Содержимое всплывающего окна.\n */\n content?: React.ReactNode;\n /**\n * Целевой элемент. Всплывающее окно появится возле него.\n *\n * > ⚠️ Если это пользовательский компонент, то он должен предоставлять параметры либо `getRootRef`, либо `ref` для получения ссылки на DOM-узел.\n */\n children?: React.ReactElement;\n /**\n * Вызывается при каждом изменении видимости всплывающего окна.\n */\n onShownChange?(shown: boolean): void;\n}\n\n/**\n * @see https://vkcom.github.io/VKUI/#/Popover\n */\nexport const Popover = ({\n action = 'click',\n shown: shownProp,\n showDelay = 150,\n hideDelay = 150,\n offsetDistance = 8,\n content,\n children,\n style: styleProp,\n className,\n getRef,\n onShownChange,\n restoreFocus = true,\n ...restProps\n}: PopoverProps) => {\n const { document } = useDOM();\n\n const hoverable = action === 'hover';\n const hovered = React.useRef(false);\n const [computedShown, setComputedShown] = React.useState(shownProp || false);\n const [dropdownNode, setPopperNode] = React.useState<HTMLElement | null>(null);\n\n const shown = typeof shownProp === 'boolean' ? shownProp : computedShown;\n\n const patchedPopperRef = useExternRef<HTMLDivElement>(setPopperNode, getRef);\n\n const [childRef, child] = usePatchChildrenRef(children);\n\n const setShown = (value: boolean) => {\n if (typeof shownProp !== 'boolean') {\n setComputedShown(value);\n }\n typeof onShownChange === 'function' && onShownChange(value);\n };\n\n const showTimeout = useTimeout(() => setShown(true), showDelay);\n\n const hideTimeout = useTimeout(() => setShown(false), hideDelay);\n\n const handleTargetEnter = () => {\n hovered.current = true;\n hideTimeout.clear();\n showTimeout.set();\n };\n\n const handleTargetClick = () => {\n if (hovered.current && shown) {\n return;\n }\n setShown(!shown);\n };\n\n const handleTargetLeave = () => {\n hovered.current = false;\n showTimeout.clear();\n hideTimeout.set();\n };\n\n const handleContentKeyDownEscape = () => {\n setShown(false);\n };\n\n const handleOutsideClick = (e: MouseEvent) => {\n if (\n dropdownNode &&\n !childRef.current?.contains(e.target as Node) &&\n !dropdownNode.contains(e.target as Node)\n ) {\n setShown(false);\n }\n };\n\n useGlobalEventListener(document, 'click', handleOutsideClick, {\n capture: true,\n passive: true,\n });\n const targetEnterListener = useEventListener('mouseenter', handleTargetEnter);\n const targetClickEvent = useEventListener('click', handleTargetClick);\n const targetLeaveListener = useEventListener('mouseleave', handleTargetLeave);\n\n React.useEffect(() => {\n if (!childRef.current) {\n return;\n }\n\n targetClickEvent.add(childRef.current);\n }, [childRef, targetClickEvent]);\n\n React.useEffect(() => {\n if (!childRef.current) {\n return;\n }\n\n if (hoverable) {\n targetEnterListener.add(childRef.current);\n targetLeaveListener.add(childRef.current);\n }\n\n return () => {\n targetEnterListener.remove();\n targetLeaveListener.remove();\n };\n }, [childRef, hoverable, targetEnterListener, targetLeaveListener]);\n\n return (\n <React.Fragment>\n {child}\n {shown && (\n <Popper\n {...restProps}\n className={classNames(styles['Popover'], className)}\n targetRef={childRef}\n getRef={patchedPopperRef}\n offsetDistance={offsetDistance}\n style={\n // Reason: Typescript ругается на CSS Custom Properties в объекте\n // eslint-disable-next-line @typescript-eslint/consistent-type-assertions\n {\n ...styleProp,\n '--vkui_internal--popover_safe_zone_padding': `${offsetDistance}px`,\n } as React.CSSProperties\n }\n renderContent={({ className: wrapperClassName }) => (\n <FocusTrap\n className={wrapperClassName}\n onClose={handleContentKeyDownEscape}\n restoreFocus={restoreFocus}\n >\n {content}\n </FocusTrap>\n )}\n onMouseOver={hoverable ? hideTimeout.clear : undefined}\n onMouseOut={hoverable ? handleTargetLeave : undefined}\n />\n )}\n </React.Fragment>\n );\n};\n"],"names":["Popover","action","shown","shownProp","showDelay","hideDelay","offsetDistance","content","children","style","styleProp","className","getRef","onShownChange","restoreFocus","restProps","document","useDOM","hoverable","hovered","React","useRef","useState","computedShown","setComputedShown","dropdownNode","setPopperNode","patchedPopperRef","useExternRef","usePatchChildrenRef","childRef","child","setShown","value","showTimeout","useTimeout","hideTimeout","handleTargetEnter","current","clear","set","handleTargetClick","handleTargetLeave","handleContentKeyDownEscape","handleOutsideClick","e","contains","target","useGlobalEventListener","capture","passive","targetEnterListener","useEventListener","targetClickEvent","targetLeaveListener","useEffect","add","remove","Fragment","Popper","classNames","targetRef","renderContent","wrapperClassName","FocusTrap","onClose","onMouseOver","undefined","onMouseOut"],"mappings":"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
|
|
1
|
+
{"version":3,"sources":["../../../../src/components/Popover/Popover.tsx"],"sourcesContent":["import * as React from 'react';\nimport { classNames } from '@vkontakte/vkjs';\nimport { useEventListener } from '../../hooks/useEventListener';\nimport { useExternRef } from '../../hooks/useExternRef';\nimport { useGlobalEventListener } from '../../hooks/useGlobalEventListener';\nimport { usePatchChildrenRef } from '../../hooks/usePatchChildrenRef';\nimport { useTimeout } from '../../hooks/useTimeout';\nimport { useDOM } from '../../lib/dom';\nimport { FocusTrap, FocusTrapProps } from '../FocusTrap/FocusTrap';\nimport { Popper, PopperCommonProps } from '../Popper/Popper';\nimport styles from './Popover.module.css';\n\nexport interface PopoverProps\n extends Omit<\n PopperCommonProps,\n 'arrow' | 'arrowClassName' | 'arrowHeight' | 'arrowPadding' | 'ArrowIcon' | 'content'\n >,\n Pick<FocusTrapProps, 'restoreFocus'> {\n /**\n * Механика вызова всплывающего окна.\n *\n * - `\"click\"` – показывается/скрывается только при нажатии.\n * - `\"hover\"` – помимо нажатия, будет показываться/скрывается при наведении/отведении мыши.\n *\n * > ⚠️`\"hover\"` на тач-устройствах будет работать как `\"click\"`, с одним лишь нюансом, что не будет закрываться\n * > при повторном нажатии на целевой элемент. Для закрытия необходимо нажать на область вне целевого элемента\n * > и выпадающего окна.\n */\n action?: 'click' | 'hover';\n /**\n * Если передан, то всплывающее окно будет показано/скрыто в зависимости от значения свойства.\n */\n shown?: boolean;\n /**\n * Количество миллисекунд, после которых произойдёт показ всплывающего окна.\n *\n * > Используется только для `action=\"hover\"` при наведении/отведении мыши.\n */\n showDelay?: number;\n /**\n * Количество миллисекунд, после которых произойдёт скрытие всплывающего окна.\n *\n * > Используется только для `action=\"hover\"` при наведении/отведении мыши.\n */\n hideDelay?: number;\n /**\n * Содержимое всплывающего окна.\n */\n content?: React.ReactNode;\n /**\n * Целевой элемент. Всплывающее окно появится возле него.\n *\n * > ⚠️ Если это пользовательский компонент, то он должен предоставлять параметры либо `getRootRef`, либо `ref` для получения ссылки на DOM-узел.\n */\n children?: React.ReactElement;\n /**\n * Вызывается при каждом изменении видимости всплывающего окна.\n */\n onShownChange?(shown: boolean): void;\n}\n\n/**\n * @see https://vkcom.github.io/VKUI/#/Popover\n */\nexport const Popover = ({\n action = 'click',\n shown: shownProp,\n showDelay = 150,\n hideDelay = 150,\n offsetDistance = 8,\n content,\n children,\n style: styleProp,\n className,\n getRef,\n onShownChange,\n restoreFocus = true,\n ...restProps\n}: PopoverProps) => {\n const { document } = useDOM();\n\n const hoverable = action === 'hover';\n const hovered = React.useRef(false);\n const [computedShown, setComputedShown] = React.useState(shownProp || false);\n const [dropdownNode, setPopperNode] = React.useState<HTMLElement | null>(null);\n\n const shown = typeof shownProp === 'boolean' ? shownProp : computedShown;\n\n const patchedPopperRef = useExternRef<HTMLDivElement>(setPopperNode, getRef);\n\n const [childRef, child] = usePatchChildrenRef(children);\n\n const setShown = (value: boolean) => {\n if (typeof shownProp !== 'boolean') {\n setComputedShown(value);\n }\n typeof onShownChange === 'function' && onShownChange(value);\n };\n\n const showTimeout = useTimeout(() => setShown(true), showDelay);\n\n const hideTimeout = useTimeout(() => setShown(false), hideDelay);\n\n const handleTargetEnter = () => {\n hovered.current = true;\n hideTimeout.clear();\n showTimeout.set();\n };\n\n const handleTargetClick = () => {\n if (hovered.current && shown) {\n return;\n }\n setShown(!shown);\n };\n\n const handleTargetLeave = () => {\n hovered.current = false;\n showTimeout.clear();\n hideTimeout.set();\n };\n\n const handleContentKeyDownEscape = () => {\n setShown(false);\n };\n\n const handleOutsideClick = (e: MouseEvent) => {\n if (\n dropdownNode &&\n !childRef.current?.contains(e.target as Node) &&\n !dropdownNode.contains(e.target as Node)\n ) {\n setShown(false);\n }\n };\n\n useGlobalEventListener(document, 'click', handleOutsideClick, {\n capture: true,\n passive: true,\n });\n const targetEnterListener = useEventListener('mouseenter', handleTargetEnter);\n const targetClickEvent = useEventListener('click', handleTargetClick);\n const targetLeaveListener = useEventListener('mouseleave', handleTargetLeave);\n\n React.useEffect(() => {\n if (!childRef.current) {\n return;\n }\n\n targetClickEvent.add(childRef.current);\n }, [childRef, targetClickEvent]);\n\n React.useEffect(() => {\n if (!childRef.current) {\n return;\n }\n\n if (hoverable) {\n targetEnterListener.add(childRef.current);\n targetLeaveListener.add(childRef.current);\n }\n\n return () => {\n targetEnterListener.remove();\n targetLeaveListener.remove();\n };\n }, [childRef, hoverable, targetEnterListener, targetLeaveListener]);\n\n return (\n <React.Fragment>\n {child}\n {shown && (\n <Popper\n {...restProps}\n className={classNames(styles['Popover'], className)}\n targetRef={childRef}\n getRef={patchedPopperRef}\n offsetDistance={offsetDistance}\n style={\n // Reason: Typescript ругается на CSS Custom Properties в объекте\n // eslint-disable-next-line @typescript-eslint/consistent-type-assertions\n {\n ...styleProp,\n '--vkui_internal--popover_safe_zone_padding': `${offsetDistance}px`,\n } as React.CSSProperties\n }\n renderContent={({ className: wrapperClassName }) => (\n <FocusTrap\n className={classNames(styles['Popover__in'], wrapperClassName)}\n onClose={handleContentKeyDownEscape}\n restoreFocus={restoreFocus}\n >\n {content}\n </FocusTrap>\n )}\n onMouseOver={hoverable ? hideTimeout.clear : undefined}\n onMouseOut={hoverable ? handleTargetLeave : undefined}\n />\n )}\n </React.Fragment>\n );\n};\n"],"names":["Popover","action","shown","shownProp","showDelay","hideDelay","offsetDistance","content","children","style","styleProp","className","getRef","onShownChange","restoreFocus","restProps","document","useDOM","hoverable","hovered","React","useRef","useState","computedShown","setComputedShown","dropdownNode","setPopperNode","patchedPopperRef","useExternRef","usePatchChildrenRef","childRef","child","setShown","value","showTimeout","useTimeout","hideTimeout","handleTargetEnter","current","clear","set","handleTargetClick","handleTargetLeave","handleContentKeyDownEscape","handleOutsideClick","e","contains","target","useGlobalEventListener","capture","passive","targetEnterListener","useEventListener","targetClickEvent","targetLeaveListener","useEffect","add","remove","Fragment","Popper","classNames","targetRef","renderContent","wrapperClassName","FocusTrap","onClose","onMouseOver","undefined","onMouseOut"],"mappings":"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"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import type { Placement } from '../../lib/floating';
|
|
3
3
|
import type { HasRootRef } from '../../types';
|
|
4
|
-
type Coords = {
|
|
4
|
+
export type Coords = {
|
|
5
5
|
x?: number;
|
|
6
6
|
y?: number;
|
|
7
7
|
};
|
|
@@ -12,4 +12,3 @@ export interface PopperArrowProps extends HasRootRef<HTMLDivElement> {
|
|
|
12
12
|
Icon?: React.ComponentType<React.SVGAttributes<SVGSVGElement>>;
|
|
13
13
|
}
|
|
14
14
|
export declare const PopperArrow: ({ coords, arrowClassName, placement, getRootRef, Icon, }: PopperArrowProps) => React.JSX.Element;
|
|
15
|
-
export {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/components/PopperArrow/PopperArrow.tsx"],"sourcesContent":["import * as React from 'react';\nimport { classNames } from '@vkontakte/vkjs';\nimport type { Placement } from '../../lib/floating';\nimport type { HasRootRef } from '../../types';\nimport { DefaultIcon } from './DefaultIcon';\nimport styles from './PopperArrow.module.css';\n\
|
|
1
|
+
{"version":3,"sources":["../../../../src/components/PopperArrow/PopperArrow.tsx"],"sourcesContent":["import * as React from 'react';\nimport { classNames } from '@vkontakte/vkjs';\nimport type { Placement } from '../../lib/floating';\nimport type { HasRootRef } from '../../types';\nimport { DefaultIcon } from './DefaultIcon';\nimport styles from './PopperArrow.module.css';\n\nexport type Coords = {\n x?: number;\n y?: number;\n};\n\nconst placementClassNames = {\n right: styles['PopperArrow--placement-right'],\n bottom: styles['PopperArrow--placement-bottom'],\n left: styles['PopperArrow--placement-left'],\n};\n\nexport interface PopperArrowProps extends HasRootRef<HTMLDivElement> {\n coords?: Coords;\n placement: Placement;\n arrowClassName?: string;\n Icon?: React.ComponentType<React.SVGAttributes<SVGSVGElement>>;\n}\n\nexport const PopperArrow = ({\n coords,\n arrowClassName,\n placement,\n getRootRef,\n Icon = DefaultIcon,\n}: PopperArrowProps) => {\n const [arrowPlacement, arrowStyles] = getArrowPositionData(placement, coords);\n\n return (\n <div\n ref={getRootRef}\n style={arrowStyles}\n className={classNames(\n styles['PopperArrow'],\n arrowPlacement && placementClassNames[arrowPlacement],\n )}\n >\n <Icon className={classNames(styles['PopperArrow__in'], arrowClassName)} />\n </div>\n );\n};\n\nfunction getArrowPositionData(\n placement: Placement,\n coords: Coords = { x: 0, y: 0 },\n): [undefined | 'right' | 'bottom' | 'left', React.CSSProperties] {\n if (placement.startsWith('top')) {\n return [\n 'bottom',\n {\n top: '100%',\n left: coords.x,\n },\n ];\n } else if (placement.startsWith('right')) {\n return [\n 'left',\n {\n top: coords.y,\n left: 0,\n },\n ];\n } else if (placement.startsWith('bottom')) {\n return [\n undefined,\n {\n bottom: '100%',\n left: coords.x,\n },\n ];\n } else {\n return [\n 'right',\n {\n top: coords.y,\n right: 0,\n },\n ];\n }\n}\n"],"names":["PopperArrow","placementClassNames","right","bottom","left","coords","arrowClassName","placement","getRootRef","Icon","DefaultIcon","getArrowPositionData","arrowPlacement","arrowStyles","div","ref","style","className","classNames","x","y","startsWith","top","undefined"],"mappings":";;;;+BAyBaA;;;eAAAA;;;;;+DAzBU;oBACI;2BAGC;AAQ5B,IAAMC,sBAAsB;IAC1BC,KAAK;IACLC,MAAM;IACNC,IAAI;AACN;AASO,IAAMJ,cAAc;QACzBK,eAAAA,QACAC,uBAAAA,gBACAC,kBAAAA,WACAC,mBAAAA,gCACAC,MAAAA,gCAAOC,wBAAW;IAElB,IAAsCC,2CAAAA,qBAAqBJ,WAAWF,aAA/DO,iBAA+BD,0BAAfE,cAAeF;IAEtC,qBACE,qBAACG;QACCC,KAAKP;QACLQ,OAAOH;QACPI,WAAWC,IAAAA,gBAAU,qBAEnBN,kBAAkBX,mBAAmB,CAACW,eAAe;qBAGvD,qBAACH;QAAKQ,WAAWC,IAAAA,gBAAU,yBAA4BZ;;AAG7D;AAEA,SAASK,qBACPJ,SAAoB;QACpBF,SAAAA,iEAAiB;QAAEc,GAAG;QAAGC,GAAG;IAAE;IAE9B,IAAIb,UAAUc,UAAU,CAAC,QAAQ;QAC/B,OAAO;YACL;YACA;gBACEC,KAAK;gBACLlB,MAAMC,OAAOc,CAAC;YAChB;SACD;IACH,OAAO,IAAIZ,UAAUc,UAAU,CAAC,UAAU;QACxC,OAAO;YACL;YACA;gBACEC,KAAKjB,OAAOe,CAAC;gBACbhB,MAAM;YACR;SACD;IACH,OAAO,IAAIG,UAAUc,UAAU,CAAC,WAAW;QACzC,OAAO;YACLE;YACA;gBACEpB,QAAQ;gBACRC,MAAMC,OAAOc,CAAC;YAChB;SACD;IACH,OAAO;QACL,OAAO;YACL;YACA;gBACEG,KAAKjB,OAAOe,CAAC;gBACblB,OAAO;YACT;SACD;IACH;AACF"}
|
|
@@ -6,8 +6,12 @@ export interface ProgressProps extends React.HTMLAttributes<HTMLDivElement>, Has
|
|
|
6
6
|
*/
|
|
7
7
|
appearance?: 'accent' | 'positive' | 'negative';
|
|
8
8
|
value?: number;
|
|
9
|
+
/**
|
|
10
|
+
* Высота элемента.
|
|
11
|
+
*/
|
|
12
|
+
height?: number;
|
|
9
13
|
}
|
|
10
14
|
/**
|
|
11
15
|
* @see https://vkcom.github.io/VKUI/#/Progress
|
|
12
16
|
*/
|
|
13
|
-
export declare const Progress: ({ value, getRootRef, className, appearance, ...restProps }: ProgressProps) => React.JSX.Element;
|
|
17
|
+
export declare const Progress: ({ value, getRootRef, className, appearance, height, style: styleProps, ...restProps }: ProgressProps) => React.JSX.Element;
|
|
@@ -15,20 +15,35 @@ var _object_without_properties = require("@swc/helpers/_/_object_without_propert
|
|
|
15
15
|
var _react = /*#__PURE__*/ _interop_require_wildcard._(require("react"));
|
|
16
16
|
var _vkjs = require("@vkontakte/vkjs");
|
|
17
17
|
var _math = require("../../helpers/math");
|
|
18
|
+
function progressCustomHeightStyle(height) {
|
|
19
|
+
return height ? {
|
|
20
|
+
height: height,
|
|
21
|
+
borderRadius: height / 2
|
|
22
|
+
} : undefined;
|
|
23
|
+
}
|
|
24
|
+
function progressStyle(height, styleProps) {
|
|
25
|
+
var styleHeight = progressCustomHeightStyle(height);
|
|
26
|
+
var style = styleHeight ? _object_spread._({}, styleProps, styleHeight) : styleProps;
|
|
27
|
+
return style;
|
|
28
|
+
}
|
|
18
29
|
var PROGRESS_MIN_VALUE = 0;
|
|
19
30
|
var PROGRESS_MAX_VALUE = 100;
|
|
20
31
|
var Progress = function(_param) {
|
|
21
|
-
var _param_value = _param.value, value = _param_value === void 0 ? 0 : _param_value, getRootRef = _param.getRootRef, className = _param.className, _param_appearance = _param.appearance, appearance = _param_appearance === void 0 ? "accent" : _param_appearance, restProps = _object_without_properties._(_param, [
|
|
32
|
+
var _param_value = _param.value, value = _param_value === void 0 ? 0 : _param_value, getRootRef = _param.getRootRef, className = _param.className, _param_appearance = _param.appearance, appearance = _param_appearance === void 0 ? "accent" : _param_appearance, height = _param.height, styleProps = _param.style, restProps = _object_without_properties._(_param, [
|
|
22
33
|
"value",
|
|
23
34
|
"getRootRef",
|
|
24
35
|
"className",
|
|
25
|
-
"appearance"
|
|
36
|
+
"appearance",
|
|
37
|
+
"height",
|
|
38
|
+
"style"
|
|
26
39
|
]);
|
|
27
40
|
var progress = (0, _math.clamp)(value, PROGRESS_MIN_VALUE, PROGRESS_MAX_VALUE);
|
|
28
41
|
var title = "".concat(progress, " / ").concat(PROGRESS_MAX_VALUE);
|
|
42
|
+
var style = progressStyle(height, styleProps);
|
|
29
43
|
return /*#__PURE__*/ _react.createElement("div", _object_spread_props._(_object_spread._({
|
|
30
44
|
"aria-valuenow": value,
|
|
31
|
-
title: title
|
|
45
|
+
title: title,
|
|
46
|
+
style: style
|
|
32
47
|
}, restProps), {
|
|
33
48
|
role: "progressbar",
|
|
34
49
|
"aria-valuemin": PROGRESS_MIN_VALUE,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/components/Progress/Progress.tsx"],"sourcesContent":["import * as React from 'react';\nimport { classNames } from '@vkontakte/vkjs';\nimport { clamp } from '../../helpers/math';\nimport { HasRootRef } from '../../types';\nimport styles from './Progress.module.css';\n\nexport interface ProgressProps\n extends React.HTMLAttributes<HTMLDivElement>,\n HasRootRef<HTMLDivElement> {\n /**\n * Стиль отображения прогрессбара\n */\n appearance?: 'accent' | 'positive' | 'negative';\n value?: number;\n}\n\nconst PROGRESS_MIN_VALUE = 0;\nconst PROGRESS_MAX_VALUE = 100;\n\n/**\n * @see https://vkcom.github.io/VKUI/#/Progress\n */\nexport const Progress = ({\n value = 0,\n getRootRef,\n className,\n appearance = 'accent',\n ...restProps\n}: ProgressProps) => {\n const progress = clamp(value, PROGRESS_MIN_VALUE, PROGRESS_MAX_VALUE);\n const title = `${progress} / ${PROGRESS_MAX_VALUE}`;\n\n return (\n <div\n aria-valuenow={value}\n title={title}\n {...restProps}\n role=\"progressbar\"\n aria-valuemin={PROGRESS_MIN_VALUE}\n aria-valuemax={PROGRESS_MAX_VALUE}\n ref={getRootRef}\n className={classNames(\n styles['Progress'],\n {\n accent: styles['Progress--appearance-accent'],\n positive: styles['Progress--appearance-positive'],\n negative: styles['Progress--appearance-negative'],\n }[appearance],\n className,\n )}\n >\n <div className={styles['Progress__in']} style={{ width: `${progress}%` }} />\n </div>\n );\n};\n"],"names":["Progress","PROGRESS_MIN_VALUE","PROGRESS_MAX_VALUE","value","getRootRef","className","appearance","restProps","progress","clamp","title","div","aria-valuenow","role","aria-valuemin","aria-valuemax","ref","classNames","accent","positive","negative","
|
|
1
|
+
{"version":3,"sources":["../../../../src/components/Progress/Progress.tsx"],"sourcesContent":["import * as React from 'react';\nimport { classNames } from '@vkontakte/vkjs';\nimport { clamp } from '../../helpers/math';\nimport { HasRootRef } from '../../types';\nimport styles from './Progress.module.css';\n\nfunction progressCustomHeightStyle(height: number | undefined): React.CSSProperties | undefined {\n return height\n ? {\n height,\n borderRadius: height / 2,\n }\n : undefined;\n}\n\nfunction progressStyle(height: number | undefined, styleProps: React.CSSProperties | undefined) {\n const styleHeight = progressCustomHeightStyle(height);\n const style = styleHeight ? { ...styleProps, ...styleHeight } : styleProps;\n\n return style;\n}\n\nexport interface ProgressProps\n extends React.HTMLAttributes<HTMLDivElement>,\n HasRootRef<HTMLDivElement> {\n /**\n * Стиль отображения прогрессбара\n */\n appearance?: 'accent' | 'positive' | 'negative';\n value?: number;\n /**\n * Высота элемента.\n */\n height?: number;\n}\n\nconst PROGRESS_MIN_VALUE = 0;\nconst PROGRESS_MAX_VALUE = 100;\n\n/**\n * @see https://vkcom.github.io/VKUI/#/Progress\n */\nexport const Progress = ({\n value = 0,\n getRootRef,\n className,\n appearance = 'accent',\n height,\n style: styleProps,\n ...restProps\n}: ProgressProps) => {\n const progress = clamp(value, PROGRESS_MIN_VALUE, PROGRESS_MAX_VALUE);\n const title = `${progress} / ${PROGRESS_MAX_VALUE}`;\n\n const style = progressStyle(height, styleProps);\n\n return (\n <div\n aria-valuenow={value}\n title={title}\n style={style}\n {...restProps}\n role=\"progressbar\"\n aria-valuemin={PROGRESS_MIN_VALUE}\n aria-valuemax={PROGRESS_MAX_VALUE}\n ref={getRootRef}\n className={classNames(\n styles['Progress'],\n {\n accent: styles['Progress--appearance-accent'],\n positive: styles['Progress--appearance-positive'],\n negative: styles['Progress--appearance-negative'],\n }[appearance],\n className,\n )}\n >\n <div className={styles['Progress__in']} style={{ width: `${progress}%` }} />\n </div>\n );\n};\n"],"names":["Progress","progressCustomHeightStyle","height","borderRadius","undefined","progressStyle","styleProps","styleHeight","style","PROGRESS_MIN_VALUE","PROGRESS_MAX_VALUE","value","getRootRef","className","appearance","restProps","progress","clamp","title","div","aria-valuenow","role","aria-valuemin","aria-valuemax","ref","classNames","accent","positive","negative","width"],"mappings":";;;;+BA0CaA;;;eAAAA;;;;;;;+DA1CU;oBACI;oBACL;AAItB,SAASC,0BAA0BC,MAA0B;IAC3D,OAAOA,SACH;QACEA,QAAAA;QACAC,cAAcD,SAAS;IACzB,IACAE;AACN;AAEA,SAASC,cAAcH,MAA0B,EAAEI,UAA2C;IAC5F,IAAMC,cAAcN,0BAA0BC;IAC9C,IAAMM,QAAQD,cAAc,qBAAKD,YAAeC,eAAgBD;IAEhE,OAAOE;AACT;AAgBA,IAAMC,qBAAqB;AAC3B,IAAMC,qBAAqB;AAKpB,IAAMV,WAAW;8BACtBW,OAAAA,kCAAQ,kBACRC,oBAAAA,YACAC,mBAAAA,sCACAC,YAAAA,4CAAa,8BACbZ,gBAAAA,QACAM,AAAOF,oBAAPE,OACGO;QANHJ;QACAC;QACAC;QACAC;QACAZ;QACAM;;IAGA,IAAMQ,WAAWC,IAAAA,WAAK,EAACN,OAAOF,oBAAoBC;IAClD,IAAMQ,QAAQ,AAAC,GAAgBR,OAAdM,UAAS,OAAwB,OAAnBN;IAE/B,IAAMF,QAAQH,cAAcH,QAAQI;IAEpC,qBACE,qBAACa;QACCC,iBAAeT;QACfO,OAAOA;QACPV,OAAOA;OACHO;QACJM,MAAK;QACLC,iBAAeb;QACfc,iBAAeb;QACfc,KAAKZ;QACLC,WAAWY,IAAAA,gBAAU,kBAEnB;YACEC,MAAM;YACNC,QAAQ;YACRC,QAAQ;QACV,CAAC,CAACd,WAAW,EACbD;sBAGF,qBAACM;QAAIN,SAAS;QAA0BL,OAAO;YAAEqB,OAAO,AAAC,GAAW,OAATb,UAAS;QAAG;;AAG7E"}
|
|
@@ -113,10 +113,10 @@ var Root = function(_param) {
|
|
|
113
113
|
]);
|
|
114
114
|
var onAnimationEnd = function(e) {
|
|
115
115
|
if ([
|
|
116
|
-
"
|
|
117
|
-
"
|
|
118
|
-
"
|
|
119
|
-
"
|
|
116
|
+
"vkuivkui-root-android-animation-hide-back",
|
|
117
|
+
"vkuivkui-root-android-animation-show-forward",
|
|
118
|
+
"vkuivkui-root-ios-animation-hide-back",
|
|
119
|
+
"vkuivkui-root-ios-animation-show-forward"
|
|
120
120
|
].includes(e.animationName)) {
|
|
121
121
|
finishTransition();
|
|
122
122
|
}
|
|
@@ -12,8 +12,12 @@ export interface SearchProps extends React.InputHTMLAttributes<HTMLInputElement>
|
|
|
12
12
|
defaultValue?: string;
|
|
13
13
|
iconAriaLabel?: string;
|
|
14
14
|
clearAriaLabel?: string;
|
|
15
|
+
/**
|
|
16
|
+
* Удаляет отступы у компонента
|
|
17
|
+
*/
|
|
18
|
+
noPadding?: boolean;
|
|
15
19
|
}
|
|
16
20
|
/**
|
|
17
21
|
* @see https://vkcom.github.io/VKUI/#/Search
|
|
18
22
|
*/
|
|
19
|
-
export declare const Search: ({ before, className, defaultValue, placeholder, after, getRef, icon, onIconClick, style, autoComplete, onChange: onChangeProp, value: valueProp, iconAriaLabel, clearAriaLabel, ...inputProps }: SearchProps) => React.JSX.Element;
|
|
23
|
+
export declare const Search: ({ before, className, defaultValue, placeholder, after, getRef, icon, onIconClick, style, autoComplete, onChange: onChangeProp, value: valueProp, iconAriaLabel, clearAriaLabel, noPadding, ...inputProps }: SearchProps) => React.JSX.Element;
|
|
@@ -23,11 +23,12 @@ var _useExternRef = require("../../hooks/useExternRef");
|
|
|
23
23
|
var _usePlatform = require("../../hooks/usePlatform");
|
|
24
24
|
var _adaptivity = require("../../lib/adaptivity");
|
|
25
25
|
var _platform = require("../../lib/platform");
|
|
26
|
+
var _touch = require("../../lib/touch");
|
|
26
27
|
var _Button = require("../Button/Button");
|
|
27
28
|
var _IconButton = require("../IconButton/IconButton");
|
|
28
29
|
var _Headline = require("../Typography/Headline/Headline");
|
|
29
30
|
var Search = function(_param) {
|
|
30
|
-
var _param_before = _param.before, before = _param_before === void 0 ? /*#__PURE__*/ _react.createElement(_icons.Icon16SearchOutline, null) : _param_before, className = _param.className, _param_defaultValue = _param.defaultValue, defaultValue = _param_defaultValue === void 0 ? "" : _param_defaultValue, _param_placeholder = _param.placeholder, placeholder = _param_placeholder === void 0 ? "Поиск" : _param_placeholder, _param_after = _param.after, after = _param_after === void 0 ? "Отмена" : _param_after, getRef = _param.getRef, icon = _param.icon, _param_onIconClick = _param.onIconClick, onIconClick = _param_onIconClick === void 0 ? _vkjs.noop : _param_onIconClick, style = _param.style, _param_autoComplete = _param.autoComplete, autoComplete = _param_autoComplete === void 0 ? "off" : _param_autoComplete, onChangeProp = _param.onChange, valueProp = _param.value, iconAriaLabel = _param.iconAriaLabel, _param_clearAriaLabel = _param.clearAriaLabel, clearAriaLabel = _param_clearAriaLabel === void 0 ? "Очистить" : _param_clearAriaLabel, inputProps = _object_without_properties._(_param, [
|
|
31
|
+
var _param_before = _param.before, before = _param_before === void 0 ? /*#__PURE__*/ _react.createElement(_icons.Icon16SearchOutline, null) : _param_before, className = _param.className, _param_defaultValue = _param.defaultValue, defaultValue = _param_defaultValue === void 0 ? "" : _param_defaultValue, _param_placeholder = _param.placeholder, placeholder = _param_placeholder === void 0 ? "Поиск" : _param_placeholder, _param_after = _param.after, after = _param_after === void 0 ? "Отмена" : _param_after, getRef = _param.getRef, icon = _param.icon, _param_onIconClick = _param.onIconClick, onIconClick = _param_onIconClick === void 0 ? _vkjs.noop : _param_onIconClick, style = _param.style, _param_autoComplete = _param.autoComplete, autoComplete = _param_autoComplete === void 0 ? "off" : _param_autoComplete, onChangeProp = _param.onChange, valueProp = _param.value, iconAriaLabel = _param.iconAriaLabel, _param_clearAriaLabel = _param.clearAriaLabel, clearAriaLabel = _param_clearAriaLabel === void 0 ? "Очистить" : _param_clearAriaLabel, noPadding = _param.noPadding, inputProps = _object_without_properties._(_param, [
|
|
31
32
|
"before",
|
|
32
33
|
"className",
|
|
33
34
|
"defaultValue",
|
|
@@ -41,7 +42,8 @@ var Search = function(_param) {
|
|
|
41
42
|
"onChange",
|
|
42
43
|
"value",
|
|
43
44
|
"iconAriaLabel",
|
|
44
|
-
"clearAriaLabel"
|
|
45
|
+
"clearAriaLabel",
|
|
46
|
+
"noPadding"
|
|
45
47
|
]);
|
|
46
48
|
var inputRef = (0, _useExternRef.useExternRef)(getRef);
|
|
47
49
|
var _useBooleanState1 = (0, _useBooleanState.useBooleanState)(false), isFocused = _useBooleanState1.value, setFocusedTrue = _useBooleanState1.setTrue, setFocusedFalse = _useBooleanState1.setFalse;
|
|
@@ -81,11 +83,15 @@ var Search = function(_param) {
|
|
|
81
83
|
var _inputRef_current;
|
|
82
84
|
e.originalEvent.preventDefault();
|
|
83
85
|
(_inputRef_current = inputRef.current) === null || _inputRef_current === void 0 ? void 0 : _inputRef_current.focus();
|
|
86
|
+
if ((0, _touch.touchEnabled)()) {
|
|
87
|
+
onCancel();
|
|
88
|
+
}
|
|
84
89
|
}, [
|
|
85
|
-
inputRef
|
|
90
|
+
inputRef,
|
|
91
|
+
onCancel
|
|
86
92
|
]);
|
|
87
93
|
return /*#__PURE__*/ _react.createElement("div", {
|
|
88
|
-
className: (0, _vkjs.classNames)("vkuiInternalSearch", "vkuiSearch", sizeY === "none" && "vkuiSearch--sizeY-none", sizeY === _adaptivity.SizeType.COMPACT && "vkuiSearch--sizeY-compact", isFocused && "vkuiSearch--focused", value && "vkuiSearch--has-value", after && "vkuiSearch--has-after", icon && "vkuiSearch--has-icon", inputProps.disabled && "vkuiSearch--disabled", className),
|
|
94
|
+
className: (0, _vkjs.classNames)("vkuiInternalSearch", "vkuiSearch", sizeY === "none" && "vkuiSearch--sizeY-none", sizeY === _adaptivity.SizeType.COMPACT && "vkuiSearch--sizeY-compact", isFocused && "vkuiSearch--focused", value && "vkuiSearch--has-value", after && "vkuiSearch--has-after", icon && "vkuiSearch--has-icon", inputProps.disabled && "vkuiSearch--disabled", !noPadding && "vkuiSearch--withPadding", className),
|
|
89
95
|
style: style
|
|
90
96
|
}, /*#__PURE__*/ _react.createElement("div", {
|
|
91
97
|
className: "vkuiSearch__field"
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/components/Search/Search.tsx"],"sourcesContent":["import * as React from 'react';\nimport { Icon16Clear, Icon16SearchOutline, Icon24Cancel } from '@vkontakte/icons';\nimport { classNames, noop } from '@vkontakte/vkjs';\nimport { useAdaptivity } from '../../hooks/useAdaptivity';\nimport { useBooleanState } from '../../hooks/useBooleanState';\nimport { useEnsuredControl } from '../../hooks/useEnsuredControl';\nimport { useExternRef } from '../../hooks/useExternRef';\nimport { usePlatform } from '../../hooks/usePlatform';\nimport { SizeType } from '../../lib/adaptivity';\nimport { Platform } from '../../lib/platform';\nimport { VKUITouchEvent } from '../../lib/touch';\nimport { HasRef } from '../../types';\nimport { Button } from '../Button/Button';\nimport { IconButton } from '../IconButton/IconButton';\nimport { TouchEvent } from '../Touch/Touch';\nimport { Headline } from '../Typography/Headline/Headline';\nimport styles from './Search.module.css';\n\nexport interface SearchProps\n extends React.InputHTMLAttributes<HTMLInputElement>,\n HasRef<HTMLInputElement> {\n /**\n * iOS only. Текст кнопки \"отмена\", которая чистит текстовое поле и убирает фокус.\n */\n after?: React.ReactNode;\n before?: React.ReactNode;\n icon?: React.ReactNode;\n onIconClick?: (e: VKUITouchEvent) => void;\n defaultValue?: string;\n iconAriaLabel?: string;\n clearAriaLabel?: string;\n}\n\n/**\n * @see https://vkcom.github.io/VKUI/#/Search\n */\nexport const Search = ({\n before = <Icon16SearchOutline />,\n className,\n defaultValue = '',\n placeholder = 'Поиск',\n after = 'Отмена',\n getRef,\n icon,\n onIconClick = noop,\n style,\n autoComplete = 'off',\n onChange: onChangeProp,\n value: valueProp,\n iconAriaLabel,\n clearAriaLabel = 'Очистить',\n ...inputProps\n}: SearchProps) => {\n const inputRef = useExternRef(getRef);\n const {\n value: isFocused,\n setTrue: setFocusedTrue,\n setFalse: setFocusedFalse,\n } = useBooleanState(false);\n\n const [value, onChange] = useEnsuredControl({\n defaultValue,\n onChange: onChangeProp,\n value: valueProp,\n });\n const { sizeY = 'none' } = useAdaptivity();\n const platform = usePlatform();\n\n const onFocus = (e: React.FocusEvent<HTMLInputElement>) => {\n setFocusedTrue();\n inputProps.onFocus && inputProps.onFocus(e);\n };\n\n const onBlur = (e: React.FocusEvent<HTMLInputElement>) => {\n setFocusedFalse();\n inputProps.onBlur && inputProps.onBlur(e);\n };\n\n const onCancel = React.useCallback(() => {\n // eslint-disable-next-line @typescript-eslint/unbound-method\n const nativeInputValueSetter = Object.getOwnPropertyDescriptor(\n HTMLInputElement.prototype,\n 'value',\n )?.set;\n nativeInputValueSetter?.call(inputRef.current, '');\n\n const ev2 = new Event('input', { bubbles: true });\n inputRef.current?.dispatchEvent(ev2);\n }, [inputRef]);\n\n const onIconClickStart = React.useCallback(\n (e: TouchEvent) => onIconClick(e.originalEvent),\n [onIconClick],\n );\n\n const onIconCancelClickStart = React.useCallback(\n (e: TouchEvent) => {\n e.originalEvent.preventDefault();\n inputRef.current?.focus();\n },\n [inputRef],\n );\n\n return (\n <div\n className={classNames(\n 'vkuiInternalSearch',\n styles['Search'],\n sizeY === 'none' && styles['Search--sizeY-none'],\n sizeY === SizeType.COMPACT && styles['Search--sizeY-compact'],\n isFocused && styles['Search--focused'],\n value && styles['Search--has-value'],\n after && styles['Search--has-after'],\n icon && styles['Search--has-icon'],\n inputProps.disabled && styles['Search--disabled'],\n className,\n )}\n style={style}\n >\n <div className={styles['Search__field']}>\n <label className={styles['Search__control']}>\n {before}\n <Headline\n Component=\"input\"\n type=\"search\"\n level=\"1\"\n weight=\"3\"\n {...inputProps}\n placeholder={placeholder}\n autoComplete={autoComplete}\n getRootRef={inputRef}\n className={styles['Search__input']}\n onFocus={onFocus}\n onBlur={onBlur}\n onChange={onChange}\n value={value}\n />\n </label>\n <div className={styles['Search__icons']}>\n {icon && (\n <IconButton\n hoverMode=\"opacity\"\n onStart={onIconClickStart}\n className={styles['Search__icon']}\n onFocus={setFocusedTrue}\n onBlur={setFocusedFalse}\n aria-label={iconAriaLabel}\n >\n {icon}\n </IconButton>\n )}\n {!!value && (\n <IconButton\n hoverMode=\"opacity\"\n onStart={onIconCancelClickStart}\n onClick={onCancel}\n className={styles['Search__icon']}\n aria-label={clearAriaLabel}\n >\n {platform === Platform.IOS ? <Icon16Clear /> : <Icon24Cancel />}\n </IconButton>\n )}\n </div>\n </div>\n {platform === Platform.IOS && after && (\n <Button\n mode=\"tertiary\"\n size=\"m\"\n className={styles['Search__after']}\n focusVisibleMode=\"inside\"\n onClick={onCancel}\n onFocus={setFocusedTrue}\n onBlur={setFocusedFalse}\n >\n <span className={styles['Search__afterText']}>{after}</span>\n </Button>\n )}\n </div>\n );\n};\n"],"names":["Search","before","Icon16SearchOutline","className","defaultValue","placeholder","after","getRef","icon","onIconClick","noop","style","autoComplete","onChange","onChangeProp","value","valueProp","iconAriaLabel","clearAriaLabel","inputProps","inputRef","useExternRef","useBooleanState","isFocused","setTrue","setFocusedTrue","setFalse","setFocusedFalse","useEnsuredControl","useAdaptivity","sizeY","platform","usePlatform","onFocus","e","onBlur","onCancel","React","useCallback","Object","nativeInputValueSetter","getOwnPropertyDescriptor","HTMLInputElement","prototype","set","call","current","ev2","Event","bubbles","dispatchEvent","onIconClickStart","originalEvent","onIconCancelClickStart","preventDefault","focus","div","classNames","SizeType","COMPACT","disabled","label","Headline","Component","type","level","weight","getRootRef","IconButton","hoverMode","onStart","aria-label","onClick","Platform","IOS","Icon16Clear","Icon24Cancel","Button","mode","size","focusVisibleMode","span"],"mappings":";;;;+
|
|
1
|
+
{"version":3,"sources":["../../../../src/components/Search/Search.tsx"],"sourcesContent":["import * as React from 'react';\nimport { Icon16Clear, Icon16SearchOutline, Icon24Cancel } from '@vkontakte/icons';\nimport { classNames, noop } from '@vkontakte/vkjs';\nimport { useAdaptivity } from '../../hooks/useAdaptivity';\nimport { useBooleanState } from '../../hooks/useBooleanState';\nimport { useEnsuredControl } from '../../hooks/useEnsuredControl';\nimport { useExternRef } from '../../hooks/useExternRef';\nimport { usePlatform } from '../../hooks/usePlatform';\nimport { SizeType } from '../../lib/adaptivity';\nimport { Platform } from '../../lib/platform';\nimport { touchEnabled, VKUITouchEvent } from '../../lib/touch';\nimport { HasRef } from '../../types';\nimport { Button } from '../Button/Button';\nimport { IconButton } from '../IconButton/IconButton';\nimport { TouchEvent } from '../Touch/Touch';\nimport { Headline } from '../Typography/Headline/Headline';\nimport styles from './Search.module.css';\n\nexport interface SearchProps\n extends React.InputHTMLAttributes<HTMLInputElement>,\n HasRef<HTMLInputElement> {\n /**\n * iOS only. Текст кнопки \"отмена\", которая чистит текстовое поле и убирает фокус.\n */\n after?: React.ReactNode;\n before?: React.ReactNode;\n icon?: React.ReactNode;\n onIconClick?: (e: VKUITouchEvent) => void;\n defaultValue?: string;\n iconAriaLabel?: string;\n clearAriaLabel?: string;\n /**\n * Удаляет отступы у компонента\n */\n noPadding?: boolean;\n}\n\n/**\n * @see https://vkcom.github.io/VKUI/#/Search\n */\nexport const Search = ({\n before = <Icon16SearchOutline />,\n className,\n defaultValue = '',\n placeholder = 'Поиск',\n after = 'Отмена',\n getRef,\n icon,\n onIconClick = noop,\n style,\n autoComplete = 'off',\n onChange: onChangeProp,\n value: valueProp,\n iconAriaLabel,\n clearAriaLabel = 'Очистить',\n noPadding,\n ...inputProps\n}: SearchProps) => {\n const inputRef = useExternRef(getRef);\n const {\n value: isFocused,\n setTrue: setFocusedTrue,\n setFalse: setFocusedFalse,\n } = useBooleanState(false);\n\n const [value, onChange] = useEnsuredControl({\n defaultValue,\n onChange: onChangeProp,\n value: valueProp,\n });\n const { sizeY = 'none' } = useAdaptivity();\n const platform = usePlatform();\n\n const onFocus = (e: React.FocusEvent<HTMLInputElement>) => {\n setFocusedTrue();\n inputProps.onFocus && inputProps.onFocus(e);\n };\n\n const onBlur = (e: React.FocusEvent<HTMLInputElement>) => {\n setFocusedFalse();\n inputProps.onBlur && inputProps.onBlur(e);\n };\n\n const onCancel = React.useCallback(() => {\n // eslint-disable-next-line @typescript-eslint/unbound-method\n const nativeInputValueSetter = Object.getOwnPropertyDescriptor(\n HTMLInputElement.prototype,\n 'value',\n )?.set;\n nativeInputValueSetter?.call(inputRef.current, '');\n\n const ev2 = new Event('input', { bubbles: true });\n inputRef.current?.dispatchEvent(ev2);\n }, [inputRef]);\n\n const onIconClickStart = React.useCallback(\n (e: TouchEvent) => onIconClick(e.originalEvent),\n [onIconClick],\n );\n\n const onIconCancelClickStart = React.useCallback(\n (e: TouchEvent) => {\n e.originalEvent.preventDefault();\n inputRef.current?.focus();\n if (touchEnabled()) {\n onCancel();\n }\n },\n [inputRef, onCancel],\n );\n\n return (\n <div\n className={classNames(\n 'vkuiInternalSearch',\n styles['Search'],\n sizeY === 'none' && styles['Search--sizeY-none'],\n sizeY === SizeType.COMPACT && styles['Search--sizeY-compact'],\n isFocused && styles['Search--focused'],\n value && styles['Search--has-value'],\n after && styles['Search--has-after'],\n icon && styles['Search--has-icon'],\n inputProps.disabled && styles['Search--disabled'],\n !noPadding && styles['Search--withPadding'],\n className,\n )}\n style={style}\n >\n <div className={styles['Search__field']}>\n <label className={styles['Search__control']}>\n {before}\n <Headline\n Component=\"input\"\n type=\"search\"\n level=\"1\"\n weight=\"3\"\n {...inputProps}\n placeholder={placeholder}\n autoComplete={autoComplete}\n getRootRef={inputRef}\n className={styles['Search__input']}\n onFocus={onFocus}\n onBlur={onBlur}\n onChange={onChange}\n value={value}\n />\n </label>\n <div className={styles['Search__icons']}>\n {icon && (\n <IconButton\n hoverMode=\"opacity\"\n onStart={onIconClickStart}\n className={styles['Search__icon']}\n onFocus={setFocusedTrue}\n onBlur={setFocusedFalse}\n aria-label={iconAriaLabel}\n >\n {icon}\n </IconButton>\n )}\n {!!value && (\n <IconButton\n hoverMode=\"opacity\"\n onStart={onIconCancelClickStart}\n onClick={onCancel}\n className={styles['Search__icon']}\n aria-label={clearAriaLabel}\n >\n {platform === Platform.IOS ? <Icon16Clear /> : <Icon24Cancel />}\n </IconButton>\n )}\n </div>\n </div>\n {platform === Platform.IOS && after && (\n <Button\n mode=\"tertiary\"\n size=\"m\"\n className={styles['Search__after']}\n focusVisibleMode=\"inside\"\n onClick={onCancel}\n onFocus={setFocusedTrue}\n onBlur={setFocusedFalse}\n >\n <span className={styles['Search__afterText']}>{after}</span>\n </Button>\n )}\n </div>\n );\n};\n"],"names":["Search","before","Icon16SearchOutline","className","defaultValue","placeholder","after","getRef","icon","onIconClick","noop","style","autoComplete","onChange","onChangeProp","value","valueProp","iconAriaLabel","clearAriaLabel","noPadding","inputProps","inputRef","useExternRef","useBooleanState","isFocused","setTrue","setFocusedTrue","setFalse","setFocusedFalse","useEnsuredControl","useAdaptivity","sizeY","platform","usePlatform","onFocus","e","onBlur","onCancel","React","useCallback","Object","nativeInputValueSetter","getOwnPropertyDescriptor","HTMLInputElement","prototype","set","call","current","ev2","Event","bubbles","dispatchEvent","onIconClickStart","originalEvent","onIconCancelClickStart","preventDefault","focus","touchEnabled","div","classNames","SizeType","COMPACT","disabled","label","Headline","Component","type","level","weight","getRootRef","IconButton","hoverMode","onStart","aria-label","onClick","Platform","IOS","Icon16Clear","Icon24Cancel","Button","mode","size","focusVisibleMode","span"],"mappings":"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"}
|
|
@@ -42,8 +42,12 @@ export interface SnackbarProps extends React.HTMLAttributes<HTMLElement> {
|
|
|
42
42
|
* Не может использоваться одновременно с `action`
|
|
43
43
|
*/
|
|
44
44
|
subtitle?: React.ReactNode;
|
|
45
|
+
/**
|
|
46
|
+
* Величина отступа снизу. Используется для позиционирования элемента в случае, когда нежелательно, чтобы Snackbar при появлении перекрывал важные элементы интерфейса.
|
|
47
|
+
*/
|
|
48
|
+
offsetY?: React.CSSProperties['bottom'];
|
|
45
49
|
}
|
|
46
50
|
/**
|
|
47
51
|
* @see https://vkcom.github.io/VKUI/#/Snackbar
|
|
48
52
|
*/
|
|
49
|
-
export declare const Snackbar: ({ children, layout: layoutProps, action, before, after, duration, onActionClick, onClose, mode, className, subtitle, ...restProps }: SnackbarProps) => React.JSX.Element;
|
|
53
|
+
export declare const Snackbar: ({ children, layout: layoutProps, action, before, after, duration, onActionClick, onClose, mode, className, subtitle, offsetY, style, ...restProps }: SnackbarProps) => React.JSX.Element;
|