@vkontakte/vkui 4.25.1 → 4.25.2
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/.cache/.eslintcache +1 -1
- package/.cache/.stylelintcache +1 -1
- package/.cache/.tsbuildinfo +22 -22
- package/.cache/ts/src/components/Alert/Alert.d.ts +4 -3
- package/.cache/ts/src/components/Epic/Epic.d.ts +4 -4
- package/.cache/ts/src/components/ModalCard/ModalCard.d.ts +3 -3
- package/.cache/ts/src/components/ModalPage/ModalPage.d.ts +3 -3
- package/.cache/ts/src/components/ModalRoot/ModalRootAdaptive.d.ts +3 -3
- package/.cache/ts/src/components/ModalRoot/withModalRootContext.d.ts +1 -1
- package/.cache/ts/src/components/NativeSelect/NativeSelect.d.ts +3 -3
- package/.cache/ts/src/components/Panel/Panel.d.ts +3 -3
- package/.cache/ts/src/components/PopoutRoot/PopoutRoot.d.ts +4 -4
- package/.cache/ts/src/components/Select/Select.d.ts +3 -3
- package/.cache/ts/src/components/Snackbar/Snackbar.d.ts +3 -3
- package/dist/cjs/components/Alert/Alert.d.ts +4 -3
- package/dist/cjs/components/Alert/Alert.js.map +1 -1
- package/dist/cjs/components/Epic/Epic.d.ts +4 -4
- package/dist/cjs/components/Epic/Epic.js.map +1 -1
- package/dist/cjs/components/ModalCard/ModalCard.d.ts +3 -3
- package/dist/cjs/components/ModalCard/ModalCard.js.map +1 -1
- package/dist/cjs/components/ModalPage/ModalPage.d.ts +3 -3
- package/dist/cjs/components/ModalPage/ModalPage.js.map +1 -1
- package/dist/cjs/components/ModalRoot/ModalRootAdaptive.d.ts +3 -3
- package/dist/cjs/components/ModalRoot/ModalRootAdaptive.js.map +1 -1
- package/dist/cjs/components/ModalRoot/withModalRootContext.d.ts +1 -1
- package/dist/cjs/components/ModalRoot/withModalRootContext.js.map +1 -1
- package/dist/cjs/components/NativeSelect/NativeSelect.d.ts +3 -3
- package/dist/cjs/components/NativeSelect/NativeSelect.js.map +1 -1
- package/dist/cjs/components/Panel/Panel.d.ts +3 -3
- package/dist/cjs/components/Panel/Panel.js.map +1 -1
- package/dist/cjs/components/PopoutRoot/PopoutRoot.d.ts +4 -4
- package/dist/cjs/components/PopoutRoot/PopoutRoot.js.map +1 -1
- package/dist/cjs/components/Select/Select.d.ts +3 -3
- package/dist/cjs/components/Select/Select.js.map +1 -1
- package/dist/cjs/components/Snackbar/Snackbar.d.ts +3 -3
- package/dist/cjs/components/Snackbar/Snackbar.js.map +1 -1
- package/dist/components/Alert/Alert.d.ts +4 -3
- package/dist/components/Alert/Alert.js.map +1 -1
- package/dist/components/Epic/Epic.d.ts +4 -4
- package/dist/components/Epic/Epic.js.map +1 -1
- package/dist/components/ModalCard/ModalCard.d.ts +3 -3
- package/dist/components/ModalCard/ModalCard.js.map +1 -1
- package/dist/components/ModalPage/ModalPage.d.ts +3 -3
- package/dist/components/ModalPage/ModalPage.js.map +1 -1
- package/dist/components/ModalRoot/ModalRootAdaptive.d.ts +3 -3
- package/dist/components/ModalRoot/ModalRootAdaptive.js.map +1 -1
- package/dist/components/ModalRoot/withModalRootContext.d.ts +1 -1
- package/dist/components/ModalRoot/withModalRootContext.js.map +1 -1
- package/dist/components/NativeSelect/NativeSelect.d.ts +3 -3
- package/dist/components/NativeSelect/NativeSelect.js.map +1 -1
- package/dist/components/Panel/Panel.d.ts +3 -3
- package/dist/components/Panel/Panel.js.map +1 -1
- package/dist/components/PopoutRoot/PopoutRoot.d.ts +4 -4
- package/dist/components/PopoutRoot/PopoutRoot.js.map +1 -1
- package/dist/components/Select/Select.d.ts +3 -3
- package/dist/components/Select/Select.js.map +1 -1
- package/dist/components/Snackbar/Snackbar.d.ts +3 -3
- package/dist/components/Snackbar/Snackbar.js.map +1 -1
- package/dist/cssm/components/Alert/Alert.js.map +1 -1
- package/dist/cssm/components/Epic/Epic.js.map +1 -1
- package/dist/cssm/components/ModalCard/ModalCard.js.map +1 -1
- package/dist/cssm/components/ModalPage/ModalPage.js.map +1 -1
- package/dist/cssm/components/ModalRoot/ModalRootAdaptive.js.map +1 -1
- package/dist/cssm/components/ModalRoot/withModalRootContext.js.map +1 -1
- package/dist/cssm/components/NativeSelect/NativeSelect.js.map +1 -1
- package/dist/cssm/components/Panel/Panel.js.map +1 -1
- package/dist/cssm/components/PopoutRoot/PopoutRoot.js.map +1 -1
- package/dist/cssm/components/Select/Select.js.map +1 -1
- package/dist/cssm/components/Snackbar/Snackbar.js.map +1 -1
- package/package.json +1 -1
- package/src/components/Alert/Alert.tsx +11 -6
- package/src/components/Epic/Epic.tsx +8 -3
- package/src/components/ModalCard/ModalCard.tsx +8 -3
- package/src/components/ModalPage/ModalPage.tsx +8 -3
- package/src/components/ModalRoot/ModalRootAdaptive.tsx +8 -3
- package/src/components/ModalRoot/withModalRootContext.tsx +1 -1
- package/src/components/NativeSelect/NativeSelect.tsx +8 -3
- package/src/components/Panel/Panel.tsx +6 -3
- package/src/components/PopoutRoot/PopoutRoot.tsx +8 -5
- package/src/components/Select/Select.tsx +6 -5
- package/src/components/Snackbar/Snackbar.tsx +8 -3
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
2
|
import { HasPlatform } from "../../types";
|
|
3
3
|
import { ButtonProps } from "../Button/Button";
|
|
4
|
-
import { AdaptivityContextInterface } from "../AdaptivityProvider/AdaptivityContext";
|
|
4
|
+
import { AdaptivityContextInterface, AdaptivityProps } from "../AdaptivityProvider/AdaptivityContext";
|
|
5
5
|
import "./Alert.css";
|
|
6
6
|
export declare type AlertActionInterface = AlertAction & React.AnchorHTMLAttributes<HTMLElement>;
|
|
7
7
|
export interface AlertAction extends Pick<ButtonProps, "Component" | "href"> {
|
|
@@ -10,15 +10,16 @@ export interface AlertAction extends Pick<ButtonProps, "Component" | "href"> {
|
|
|
10
10
|
autoclose?: boolean;
|
|
11
11
|
mode: "cancel" | "destructive" | "default";
|
|
12
12
|
}
|
|
13
|
-
export interface AlertProps extends React.HTMLAttributes<HTMLElement>, HasPlatform,
|
|
13
|
+
export interface AlertProps extends React.HTMLAttributes<HTMLElement>, HasPlatform, AdaptivityProps {
|
|
14
14
|
actionsLayout?: "vertical" | "horizontal";
|
|
15
15
|
actions?: AlertAction[];
|
|
16
16
|
header?: React.ReactNode;
|
|
17
17
|
text?: React.ReactNode;
|
|
18
18
|
onClose?: VoidFunction;
|
|
19
19
|
}
|
|
20
|
+
export declare type TAlertProps = AlertProps & AdaptivityContextInterface;
|
|
20
21
|
export interface AlertState {
|
|
21
22
|
closing: boolean;
|
|
22
23
|
}
|
|
23
|
-
declare const _default: React.FC<Pick<Pick<
|
|
24
|
+
declare const _default: React.FC<Pick<Pick<TAlertProps, "platform" | "hidden" | "dir" | "header" | "slot" | "style" | "title" | "text" | "color" | "translate" | "prefix" | "children" | "className" | "id" | "lang" | "role" | "tabIndex" | "aria-activedescendant" | "aria-atomic" | "aria-autocomplete" | "aria-busy" | "aria-checked" | "aria-colcount" | "aria-colindex" | "aria-colspan" | "aria-controls" | "aria-current" | "aria-describedby" | "aria-details" | "aria-disabled" | "aria-dropeffect" | "aria-errormessage" | "aria-expanded" | "aria-flowto" | "aria-grabbed" | "aria-haspopup" | "aria-hidden" | "aria-invalid" | "aria-keyshortcuts" | "aria-label" | "aria-labelledby" | "aria-level" | "aria-live" | "aria-modal" | "aria-multiline" | "aria-multiselectable" | "aria-orientation" | "aria-owns" | "aria-placeholder" | "aria-posinset" | "aria-pressed" | "aria-readonly" | "aria-relevant" | "aria-required" | "aria-roledescription" | "aria-rowcount" | "aria-rowindex" | "aria-rowspan" | "aria-selected" | "aria-setsize" | "aria-sort" | "aria-valuemax" | "aria-valuemin" | "aria-valuenow" | "aria-valuetext" | "dangerouslySetInnerHTML" | "onCopy" | "onCopyCapture" | "onCut" | "onCutCapture" | "onPaste" | "onPasteCapture" | "onCompositionEnd" | "onCompositionEndCapture" | "onCompositionStart" | "onCompositionStartCapture" | "onCompositionUpdate" | "onCompositionUpdateCapture" | "onFocus" | "onFocusCapture" | "onBlur" | "onBlurCapture" | "onChange" | "onChangeCapture" | "onBeforeInput" | "onBeforeInputCapture" | "onInput" | "onInputCapture" | "onReset" | "onResetCapture" | "onSubmit" | "onSubmitCapture" | "onInvalid" | "onInvalidCapture" | "onLoad" | "onLoadCapture" | "onError" | "onErrorCapture" | "onKeyDown" | "onKeyDownCapture" | "onKeyPress" | "onKeyPressCapture" | "onKeyUp" | "onKeyUpCapture" | "onAbort" | "onAbortCapture" | "onCanPlay" | "onCanPlayCapture" | "onCanPlayThrough" | "onCanPlayThroughCapture" | "onDurationChange" | "onDurationChangeCapture" | "onEmptied" | "onEmptiedCapture" | "onEncrypted" | "onEncryptedCapture" | "onEnded" | "onEndedCapture" | "onLoadedData" | "onLoadedDataCapture" | "onLoadedMetadata" | "onLoadedMetadataCapture" | "onLoadStart" | "onLoadStartCapture" | "onPause" | "onPauseCapture" | "onPlay" | "onPlayCapture" | "onPlaying" | "onPlayingCapture" | "onProgress" | "onProgressCapture" | "onRateChange" | "onRateChangeCapture" | "onSeeked" | "onSeekedCapture" | "onSeeking" | "onSeekingCapture" | "onStalled" | "onStalledCapture" | "onSuspend" | "onSuspendCapture" | "onTimeUpdate" | "onTimeUpdateCapture" | "onVolumeChange" | "onVolumeChangeCapture" | "onWaiting" | "onWaitingCapture" | "onAuxClick" | "onAuxClickCapture" | "onClick" | "onClickCapture" | "onContextMenu" | "onContextMenuCapture" | "onDoubleClick" | "onDoubleClickCapture" | "onDrag" | "onDragCapture" | "onDragEnd" | "onDragEndCapture" | "onDragEnter" | "onDragEnterCapture" | "onDragExit" | "onDragExitCapture" | "onDragLeave" | "onDragLeaveCapture" | "onDragOver" | "onDragOverCapture" | "onDragStart" | "onDragStartCapture" | "onDrop" | "onDropCapture" | "onMouseDown" | "onMouseDownCapture" | "onMouseEnter" | "onMouseLeave" | "onMouseMove" | "onMouseMoveCapture" | "onMouseOut" | "onMouseOutCapture" | "onMouseOver" | "onMouseOverCapture" | "onMouseUp" | "onMouseUpCapture" | "onSelect" | "onSelectCapture" | "onTouchCancel" | "onTouchCancelCapture" | "onTouchEnd" | "onTouchEndCapture" | "onTouchMove" | "onTouchMoveCapture" | "onTouchStart" | "onTouchStartCapture" | "onPointerDown" | "onPointerDownCapture" | "onPointerMove" | "onPointerMoveCapture" | "onPointerUp" | "onPointerUpCapture" | "onPointerCancel" | "onPointerCancelCapture" | "onPointerEnter" | "onPointerEnterCapture" | "onPointerLeave" | "onPointerLeaveCapture" | "onPointerOver" | "onPointerOverCapture" | "onPointerOut" | "onPointerOutCapture" | "onGotPointerCapture" | "onGotPointerCaptureCapture" | "onLostPointerCapture" | "onLostPointerCaptureCapture" | "onScroll" | "onScrollCapture" | "onWheel" | "onWheelCapture" | "onAnimationStart" | "onAnimationStartCapture" | "onAnimationEnd" | "onAnimationEndCapture" | "onAnimationIteration" | "onAnimationIterationCapture" | "onTransitionEnd" | "onTransitionEndCapture" | "defaultChecked" | "defaultValue" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "accessKey" | "contentEditable" | "contextMenu" | "draggable" | "placeholder" | "spellCheck" | "radioGroup" | "about" | "datatype" | "inlist" | "property" | "resource" | "typeof" | "vocab" | "autoCapitalize" | "autoCorrect" | "autoSave" | "itemProp" | "itemScope" | "itemType" | "itemID" | "itemRef" | "results" | "security" | "unselectable" | "inputMode" | "is" | "onClose" | "actionsLayout" | "actions"> & import("../AdaptivityProvider/AdaptivityContext").SizeProps, "hidden" | "dir" | "header" | "slot" | "style" | "title" | "text" | "color" | "translate" | "prefix" | "children" | "className" | "id" | "lang" | "role" | "tabIndex" | "aria-activedescendant" | "aria-atomic" | "aria-autocomplete" | "aria-busy" | "aria-checked" | "aria-colcount" | "aria-colindex" | "aria-colspan" | "aria-controls" | "aria-current" | "aria-describedby" | "aria-details" | "aria-disabled" | "aria-dropeffect" | "aria-errormessage" | "aria-expanded" | "aria-flowto" | "aria-grabbed" | "aria-haspopup" | "aria-hidden" | "aria-invalid" | "aria-keyshortcuts" | "aria-label" | "aria-labelledby" | "aria-level" | "aria-live" | "aria-modal" | "aria-multiline" | "aria-multiselectable" | "aria-orientation" | "aria-owns" | "aria-placeholder" | "aria-posinset" | "aria-pressed" | "aria-readonly" | "aria-relevant" | "aria-required" | "aria-roledescription" | "aria-rowcount" | "aria-rowindex" | "aria-rowspan" | "aria-selected" | "aria-setsize" | "aria-sort" | "aria-valuemax" | "aria-valuemin" | "aria-valuenow" | "aria-valuetext" | "dangerouslySetInnerHTML" | "onCopy" | "onCopyCapture" | "onCut" | "onCutCapture" | "onPaste" | "onPasteCapture" | "onCompositionEnd" | "onCompositionEndCapture" | "onCompositionStart" | "onCompositionStartCapture" | "onCompositionUpdate" | "onCompositionUpdateCapture" | "onFocus" | "onFocusCapture" | "onBlur" | "onBlurCapture" | "onChange" | "onChangeCapture" | "onBeforeInput" | "onBeforeInputCapture" | "onInput" | "onInputCapture" | "onReset" | "onResetCapture" | "onSubmit" | "onSubmitCapture" | "onInvalid" | "onInvalidCapture" | "onLoad" | "onLoadCapture" | "onError" | "onErrorCapture" | "onKeyDown" | "onKeyDownCapture" | "onKeyPress" | "onKeyPressCapture" | "onKeyUp" | "onKeyUpCapture" | "onAbort" | "onAbortCapture" | "onCanPlay" | "onCanPlayCapture" | "onCanPlayThrough" | "onCanPlayThroughCapture" | "onDurationChange" | "onDurationChangeCapture" | "onEmptied" | "onEmptiedCapture" | "onEncrypted" | "onEncryptedCapture" | "onEnded" | "onEndedCapture" | "onLoadedData" | "onLoadedDataCapture" | "onLoadedMetadata" | "onLoadedMetadataCapture" | "onLoadStart" | "onLoadStartCapture" | "onPause" | "onPauseCapture" | "onPlay" | "onPlayCapture" | "onPlaying" | "onPlayingCapture" | "onProgress" | "onProgressCapture" | "onRateChange" | "onRateChangeCapture" | "onSeeked" | "onSeekedCapture" | "onSeeking" | "onSeekingCapture" | "onStalled" | "onStalledCapture" | "onSuspend" | "onSuspendCapture" | "onTimeUpdate" | "onTimeUpdateCapture" | "onVolumeChange" | "onVolumeChangeCapture" | "onWaiting" | "onWaitingCapture" | "onAuxClick" | "onAuxClickCapture" | "onClick" | "onClickCapture" | "onContextMenu" | "onContextMenuCapture" | "onDoubleClick" | "onDoubleClickCapture" | "onDrag" | "onDragCapture" | "onDragEnd" | "onDragEndCapture" | "onDragEnter" | "onDragEnterCapture" | "onDragExit" | "onDragExitCapture" | "onDragLeave" | "onDragLeaveCapture" | "onDragOver" | "onDragOverCapture" | "onDragStart" | "onDragStartCapture" | "onDrop" | "onDropCapture" | "onMouseDown" | "onMouseDownCapture" | "onMouseEnter" | "onMouseLeave" | "onMouseMove" | "onMouseMoveCapture" | "onMouseOut" | "onMouseOutCapture" | "onMouseOver" | "onMouseOverCapture" | "onMouseUp" | "onMouseUpCapture" | "onSelect" | "onSelectCapture" | "onTouchCancel" | "onTouchCancelCapture" | "onTouchEnd" | "onTouchEndCapture" | "onTouchMove" | "onTouchMoveCapture" | "onTouchStart" | "onTouchStartCapture" | "onPointerDown" | "onPointerDownCapture" | "onPointerMove" | "onPointerMoveCapture" | "onPointerUp" | "onPointerUpCapture" | "onPointerCancel" | "onPointerCancelCapture" | "onPointerEnter" | "onPointerEnterCapture" | "onPointerLeave" | "onPointerLeaveCapture" | "onPointerOver" | "onPointerOverCapture" | "onPointerOut" | "onPointerOutCapture" | "onGotPointerCapture" | "onGotPointerCaptureCapture" | "onLostPointerCapture" | "onLostPointerCaptureCapture" | "onScroll" | "onScrollCapture" | "onWheel" | "onWheelCapture" | "onAnimationStart" | "onAnimationStartCapture" | "onAnimationEnd" | "onAnimationEndCapture" | "onAnimationIteration" | "onAnimationIterationCapture" | "onTransitionEnd" | "onTransitionEndCapture" | "defaultChecked" | "defaultValue" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "accessKey" | "contentEditable" | "contextMenu" | "draggable" | "placeholder" | "spellCheck" | "radioGroup" | "about" | "datatype" | "inlist" | "property" | "resource" | "typeof" | "vocab" | "autoCapitalize" | "autoCorrect" | "autoSave" | "itemProp" | "itemScope" | "itemType" | "itemID" | "itemRef" | "results" | "security" | "unselectable" | "inputMode" | "is" | "sizeX" | "sizeY" | "onClose" | "actionsLayout" | "actions">>;
|
|
24
25
|
export default _default;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/components/Alert/Alert.tsx"],"names":["React","Tappable","PopoutWrapper","getClassName","classNames","transitionEvent","ANDROID","VKCOM","IOS","withPlatform","withAdaptivity","ViewWidth","Button","hasReactNode","Headline","Title","Caption","ModalDismissButton","FocusTrap","Alert","props","undefined","item","action","autoclose","setState","closing","waitTransitionFinish","e","propertyName","onClose","stopPropagation","i","platform","Component","href","mode","onItemClick","target","title","viewWidth","DESKTOP","element","createRef","state","eventHandler","supported","current","removeEventListener","name","addEventListener","transitionFinishTimeout","clearTimeout","setTimeout","bind","timeout","header","text","actions","actionsLayout","children","className","style","restProps","resolvedActionsLayout","canShowCloseButton","SMALL_TABLET","isDesktop","renderHeader","renderText","map","renderAction"],"mappings":";;;;;;;;;;AAAA,OAAO,KAAKA,KAAZ,MAAuB,OAAvB;AACA,OAAOC,QAAP;AACA,SAASC,aAAT;AACA,SAASC,YAAT;AACA,SAASC,UAAT;AACA,SAASC,eAAT;AACA,SAASC,OAAT,EAAkBC,KAAlB,EAAyBC,GAAzB;AAEA,SAASC,YAAT;AACA,SAASC,cAAT,EAAyBC,SAAzB;AACA,OAAOC,MAAP;AACA,SAASC,YAAT;AACA,OAAOC,QAAP;AACA,OAAOC,KAAP;AACA,OAAOC,OAAP;AACA,OAAOC,kBAAP;AACA,SAASC,SAAT;;IAiCMC,K;;;;;AACJ,iBAAYC,KAAZ,EAA+B;AAAA;;AAAA;;AAC7B,8BAAMA,KAAN;;AAD6B;;AAAA,8EAUuBC,SAVvB;;AAAA,kEAuBA,UAACC,IAAD;AAAA,aAAgC,YAAM;AACnE,YAAQC,MAAR,GAA8BD,IAA9B,CAAQC,MAAR;AAAA,YAAgBC,SAAhB,GAA8BF,IAA9B,CAAgBE,SAAhB;;AAEA,YAAIA,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EE,QAAA,UAAU,EAAE,KAAKrB,OAFnB;AAGE,QAAA,OAAO,EAAE,KAAKX,eAHhB;AAIE,QAAA,OAAO,EAAE,KAAKD,OAJhB;AAKE,QAAA,OAAO,EAAE,KAAKyB,OALhB;AAME,QAAA,SAAS,EAAEnD,UAAU,CAACD,YAAY,CAAC,OAAD,EAAU8B,QAAV,CAAb,EAAkC;AACrD,sBAAY+B,qBAAqB,KAAK,UADe;AAErD,sBAAYA,qBAAqB,KAAK,YAFe;AAGrD,4BAAkBtC,OAHmC;AAIrD,4BAAkByC;AAJmC,SAAlC;AANvB,UAaGF,kBAAkB,IAAI,oBAAC,kBAAD;AAAoB,QAAA,OAAO,EAAE,KAAKnC;AAAlC,QAbzB,EAcE;AAAK,QAAA,SAAS,EAAC;AAAf,SACGjB,YAAY,CAAC2C,MAAD,CAAZ,IAAwB,KAAKY,YAAL,CAAkBZ,MAAlB,CAD3B,EAEG3C,YAAY,CAAC4C,IAAD,CAAZ,IAAsB,KAAKY,UAAL,CAAgBZ,IAAhB,CAFzB,EAGGG,QAHH,CAdF,EAmBE;AAAQ,QAAA,SAAS,EAAC;AAAlB,SACGF,OADH,aACGA,OADH,uBACGA,OAAO,CAAEY,GAAT,CAAa,KAAKC,YAAlB,CADH,CAnBF,CANF,CADF;AAgCD;;;;EAtOiBvE,KAAK,CAACkC,S,GAyO1B;;;gBAzOMf,K,kBAauC;AACzCwC,EAAAA,aAAa,EAAE,YAD0B;AAEzCD,EAAAA,OAAO,EAAE;AAFgC,C;;AA6N7C,eAAejD,YAAY,CACzBC,cAAc,CAACS,KAAD,EAAQ;AACpBqB,EAAAA,SAAS,EAAE;AADS,CAAR,CADW,CAA3B","sourcesContent":["import * as React from \"react\";\nimport Tappable from \"../Tappable/Tappable\";\nimport { PopoutWrapper } from \"../PopoutWrapper/PopoutWrapper\";\nimport { getClassName } from \"../../helpers/getClassName\";\nimport { classNames } from \"../../lib/classNames\";\nimport { transitionEvent } from \"../../lib/supportEvents\";\nimport { ANDROID, VKCOM, IOS } from \"../../lib/platform\";\nimport { HasPlatform } from \"../../types\";\nimport { withPlatform } from \"../../hoc/withPlatform\";\nimport { withAdaptivity, ViewWidth } from \"../../hoc/withAdaptivity\";\nimport Button, { ButtonProps } from \"../Button/Button\";\nimport { hasReactNode } from \"../../lib/utils\";\nimport Headline from \"../Typography/Headline/Headline\";\nimport Title from \"../Typography/Title/Title\";\nimport Caption from \"../Typography/Caption/Caption\";\nimport ModalDismissButton from \"../ModalDismissButton/ModalDismissButton\";\nimport { FocusTrap } from \"../FocusTrap/FocusTrap\";\nimport { AdaptivityContextInterface } from \"../AdaptivityProvider/AdaptivityContext\";\nimport \"./Alert.css\";\n\nexport type AlertActionInterface = AlertAction &\n React.AnchorHTMLAttributes<HTMLElement>;\n\nexport interface AlertAction extends Pick<ButtonProps, \"Component\" | \"href\"> {\n title: string;\n action?: VoidFunction;\n autoclose?: boolean;\n mode: \"cancel\" | \"destructive\" | \"default\";\n}\n\nexport interface AlertProps\n extends React.HTMLAttributes<HTMLElement>,\n HasPlatform,\n AdaptivityContextInterface {\n actionsLayout?: \"vertical\" | \"horizontal\";\n actions?: AlertAction[];\n header?: React.ReactNode;\n text?: React.ReactNode;\n onClose?: VoidFunction;\n}\n\nexport interface AlertState {\n closing: boolean;\n}\n\ntype TransitionEndHandler = (e?: TransitionEvent) => void;\n\ntype ItemClickHander = (item: AlertActionInterface) => () => void;\n\nclass Alert extends React.Component<AlertProps, AlertState> {\n constructor(props: AlertProps) {\n super(props);\n this.element = React.createRef();\n this.state = {\n closing: false,\n };\n }\n\n element: React.RefObject<HTMLDivElement>;\n\n private transitionFinishTimeout: number | undefined = undefined;\n\n static defaultProps: Partial<AlertProps> = {\n actionsLayout: \"horizontal\",\n actions: [],\n };\n\n private get timeout(): number {\n return this.props.platform === ANDROID || this.props.platform === VKCOM\n ? 200\n : 300;\n }\n\n onItemClick: ItemClickHander = (item: AlertActionInterface) => () => {\n const { action, autoclose } = item;\n\n if (autoclose) {\n this.setState({ closing: true });\n this.waitTransitionFinish((e?: TransitionEvent) => {\n if (!e || e.propertyName === \"opacity\") {\n autoclose && this.props.onClose?.();\n action && action();\n }\n });\n } else {\n action && action();\n }\n };\n\n onClose: VoidFunction = () => {\n this.setState({ closing: true });\n this.waitTransitionFinish((e?: TransitionEvent) => {\n if (!e || e.propertyName === \"opacity\") {\n this.props.onClose?.();\n }\n });\n };\n\n stopPropagation: React.MouseEventHandler = (e: React.SyntheticEvent) => {\n e.stopPropagation();\n };\n\n waitTransitionFinish(eventHandler: TransitionEndHandler) {\n if (transitionEvent.supported && this.element.current) {\n this.element.current.removeEventListener(\n transitionEvent.name as string,\n eventHandler as () => void\n );\n this.element.current.addEventListener(\n transitionEvent.name as string,\n eventHandler as () => void\n );\n } else {\n if (this.transitionFinishTimeout) {\n clearTimeout(this.transitionFinishTimeout);\n }\n this.transitionFinishTimeout = setTimeout(\n eventHandler.bind(this),\n this.timeout\n );\n }\n }\n\n renderHeader(header: React.ReactNode) {\n switch (this.props.platform) {\n case VKCOM:\n return (\n <Headline vkuiClass=\"Alert__header\" weight=\"medium\">\n {header}\n </Headline>\n );\n case IOS:\n return (\n <Title vkuiClass=\"Alert__header\" weight=\"semibold\" level=\"3\">\n {header}\n </Title>\n );\n case ANDROID:\n return (\n <Title vkuiClass=\"Alert__header\" weight=\"medium\" level=\"2\">\n {header}\n </Title>\n );\n default:\n return undefined;\n }\n }\n\n renderText(text: React.ReactNode) {\n switch (this.props.platform) {\n case VKCOM:\n return (\n <Caption vkuiClass=\"Alert__text\" level=\"1\" weight=\"regular\">\n {text}\n </Caption>\n );\n case IOS:\n return (\n <Caption vkuiClass=\"Alert__text\" level=\"2\" weight=\"regular\">\n {text}\n </Caption>\n );\n case ANDROID:\n return (\n <Headline vkuiClass=\"Alert__text\" weight=\"regular\">\n {text}\n </Headline>\n );\n default:\n return undefined;\n }\n }\n\n renderAction = (action: AlertActionInterface, i: number) => {\n const { platform } = this.props;\n\n if (platform === IOS) {\n const { Component = \"button\" } = action;\n return (\n <Tappable\n Component={action.href ? \"a\" : Component}\n vkuiClass={classNames(\n \"Alert__action\",\n `Alert__action--${action.mode}`\n )}\n onClick={this.onItemClick(action)}\n href={action.href}\n key={`alert-action-${i}`}\n target={action.target}\n >\n {action.title}\n </Tappable>\n );\n }\n\n let mode: ButtonProps[\"mode\"] =\n action.mode === \"cancel\" ? \"secondary\" : \"primary\";\n\n if (platform === ANDROID) {\n mode = \"tertiary\";\n\n if (\n this.props.viewWidth === ViewWidth.DESKTOP &&\n action.mode === \"destructive\"\n ) {\n mode = \"destructive\";\n }\n }\n\n return (\n <Button\n vkuiClass={classNames(\"Alert__button\", `Alert__button--${action.mode}`)}\n mode={mode}\n size=\"m\"\n onClick={this.onItemClick(action)}\n Component={action.Component}\n href={action.href}\n key={`alert-action-${i}`}\n target={action.target}\n >\n {action.title}\n </Button>\n );\n };\n\n render() {\n const {\n actions,\n actionsLayout,\n children,\n className,\n style,\n platform,\n viewWidth,\n text,\n header,\n ...restProps\n } = this.props;\n const { closing } = this.state;\n\n const resolvedActionsLayout: AlertProps[\"actionsLayout\"] =\n platform === VKCOM ? \"horizontal\" : actionsLayout;\n const canShowCloseButton =\n platform === VKCOM ||\n (platform === ANDROID && viewWidth >= ViewWidth.SMALL_TABLET);\n const isDesktop = viewWidth >= ViewWidth.SMALL_TABLET;\n\n return (\n <PopoutWrapper\n className={className}\n closing={closing}\n style={style}\n onClick={this.onClose}\n >\n <FocusTrap\n {...restProps}\n getRootRef={this.element}\n onClick={this.stopPropagation}\n onClose={this.onClose}\n timeout={this.timeout}\n vkuiClass={classNames(getClassName(\"Alert\", platform), {\n \"Alert--v\": resolvedActionsLayout === \"vertical\",\n \"Alert--h\": resolvedActionsLayout === \"horizontal\",\n \"Alert--closing\": closing,\n \"Alert--desktop\": isDesktop,\n })}\n >\n {canShowCloseButton && <ModalDismissButton onClick={this.onClose} />}\n <div vkuiClass=\"Alert__content\">\n {hasReactNode(header) && this.renderHeader(header)}\n {hasReactNode(text) && this.renderText(text)}\n {children}\n </div>\n <footer vkuiClass=\"Alert__actions\">\n {actions?.map(this.renderAction)}\n </footer>\n </FocusTrap>\n </PopoutWrapper>\n );\n }\n}\n\n// eslint-disable-next-line import/no-default-export\nexport default withPlatform(\n withAdaptivity(Alert, {\n viewWidth: true,\n })\n);\n"],"file":"Alert.js"}
|
|
1
|
+
{"version":3,"sources":["../../../src/components/Alert/Alert.tsx"],"names":["React","Tappable","PopoutWrapper","getClassName","classNames","transitionEvent","ANDROID","VKCOM","IOS","withPlatform","withAdaptivity","ViewWidth","Button","hasReactNode","Headline","Title","Caption","ModalDismissButton","FocusTrap","Alert","props","undefined","item","action","autoclose","setState","closing","waitTransitionFinish","e","propertyName","onClose","stopPropagation","i","platform","Component","href","mode","onItemClick","target","title","viewWidth","DESKTOP","element","createRef","state","eventHandler","supported","current","removeEventListener","name","addEventListener","transitionFinishTimeout","clearTimeout","setTimeout","bind","timeout","header","text","actions","actionsLayout","children","className","style","restProps","resolvedActionsLayout","canShowCloseButton","SMALL_TABLET","isDesktop","renderHeader","renderText","map","renderAction"],"mappings":";;;;;;;;;;AAAA,OAAO,KAAKA,KAAZ,MAAuB,OAAvB;AACA,OAAOC,QAAP;AACA,SAASC,aAAT;AACA,SAASC,YAAT;AACA,SAASC,UAAT;AACA,SAASC,eAAT;AACA,SAASC,OAAT,EAAkBC,KAAlB,EAAyBC,GAAzB;AAEA,SAASC,YAAT;AACA,SAASC,cAAT,EAAyBC,SAAzB;AACA,OAAOC,MAAP;AACA,SAASC,YAAT;AACA,OAAOC,QAAP;AACA,OAAOC,KAAP;AACA,OAAOC,OAAP;AACA,OAAOC,kBAAP;AACA,SAASC,SAAT;;IAsCMC,K;;;;;AACJ,iBAAYC,KAAZ,EAAgC;AAAA;;AAAA;;AAC9B,8BAAMA,KAAN;;AAD8B;;AAAA,8EAUsBC,SAVtB;;AAAA,kEAuBD,UAACC,IAAD;AAAA,aAAgC,YAAM;AACnE,YAAQC,MAA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QAAA,KAAK,EAAEoC,KAHT;AAIE,QAAA,OAAO,EAAE,KAAKhC;AAJhB,SAME,oBAAC,SAAD,eACMiC,SADN;AAEE,QAAA,UAAU,EAAE,KAAKrB,OAFnB;AAGE,QAAA,OAAO,EAAE,KAAKX,eAHhB;AAIE,QAAA,OAAO,EAAE,KAAKD,OAJhB;AAKE,QAAA,OAAO,EAAE,KAAKyB,OALhB;AAME,QAAA,SAAS,EAAEnD,UAAU,CAACD,YAAY,CAAC,OAAD,EAAU8B,QAAV,CAAb,EAAkC;AACrD,sBAAY+B,qBAAqB,KAAK,UADe;AAErD,sBAAYA,qBAAqB,KAAK,YAFe;AAGrD,4BAAkBtC,OAHmC;AAIrD,4BAAkByC;AAJmC,SAAlC;AANvB,UAaGF,kBAAkB,IAAI,oBAAC,kBAAD;AAAoB,QAAA,OAAO,EAAE,KAAKnC;AAAlC,QAbzB,EAcE;AAAK,QAAA,SAAS,EAAC;AAAf,SACGjB,YAAY,CAAC2C,MAAD,CAAZ,IAAwB,KAAKY,YAAL,CAAkBZ,MAAlB,CAD3B,EAEG3C,YAAY,CAAC4C,IAAD,CAAZ,IAAsB,KAAKY,UAAL,CAAgBZ,IAAhB,CAFzB,EAGGG,QAHH,CAdF,EAmBE;AAAQ,QAAA,SAAS,EAAC;AAAlB,SACGF,OADH,aACGA,OADH,uBACGA,OAAO,CAAEY,GAAT,CAAa,KAAKC,YAAlB,CADH,CAnBF,CANF,CADF;AAgCD;;;;EAtOiBvE,KAAK,CAACkC,S,GAyO1B;;;gBAzOMf,K,kBAawC;AAC1CwC,EAAAA,aAAa,EAAE,YAD2B;AAE1CD,EAAAA,OAAO,EAAE;AAFiC,C;;AA6N9C,eAAejD,YAAY,CACzBC,cAAc,CAACS,KAAD,EAAQ;AACpBqB,EAAAA,SAAS,EAAE;AADS,CAAR,CADW,CAA3B","sourcesContent":["import * as React from \"react\";\nimport Tappable from \"../Tappable/Tappable\";\nimport { PopoutWrapper } from \"../PopoutWrapper/PopoutWrapper\";\nimport { getClassName } from \"../../helpers/getClassName\";\nimport { classNames } from \"../../lib/classNames\";\nimport { transitionEvent } from \"../../lib/supportEvents\";\nimport { ANDROID, VKCOM, IOS } from \"../../lib/platform\";\nimport { HasPlatform } from \"../../types\";\nimport { withPlatform } from \"../../hoc/withPlatform\";\nimport { withAdaptivity, ViewWidth } from \"../../hoc/withAdaptivity\";\nimport Button, { ButtonProps } from \"../Button/Button\";\nimport { hasReactNode } from \"../../lib/utils\";\nimport Headline from \"../Typography/Headline/Headline\";\nimport Title from \"../Typography/Title/Title\";\nimport Caption from \"../Typography/Caption/Caption\";\nimport ModalDismissButton from \"../ModalDismissButton/ModalDismissButton\";\nimport { FocusTrap } from \"../FocusTrap/FocusTrap\";\nimport {\n AdaptivityContextInterface,\n AdaptivityProps,\n} from \"../AdaptivityProvider/AdaptivityContext\";\nimport \"./Alert.css\";\n\nexport type AlertActionInterface = AlertAction &\n React.AnchorHTMLAttributes<HTMLElement>;\n\nexport interface AlertAction extends Pick<ButtonProps, \"Component\" | \"href\"> {\n title: string;\n action?: VoidFunction;\n autoclose?: boolean;\n mode: \"cancel\" | \"destructive\" | \"default\";\n}\n\nexport interface AlertProps\n extends React.HTMLAttributes<HTMLElement>,\n HasPlatform,\n AdaptivityProps {\n actionsLayout?: \"vertical\" | \"horizontal\";\n actions?: AlertAction[];\n header?: React.ReactNode;\n text?: React.ReactNode;\n onClose?: VoidFunction;\n}\n\nexport type TAlertProps = AlertProps & AdaptivityContextInterface;\n\nexport interface AlertState {\n closing: boolean;\n}\n\ntype TransitionEndHandler = (e?: TransitionEvent) => void;\n\ntype ItemClickHander = (item: AlertActionInterface) => () => void;\n\nclass Alert extends React.Component<TAlertProps, AlertState> {\n constructor(props: TAlertProps) {\n super(props);\n this.element = React.createRef();\n this.state = {\n closing: false,\n };\n }\n\n element: React.RefObject<HTMLDivElement>;\n\n private transitionFinishTimeout: number | undefined = undefined;\n\n static defaultProps: Partial<TAlertProps> = {\n actionsLayout: \"horizontal\",\n actions: [],\n };\n\n private get timeout(): number {\n return this.props.platform === ANDROID || this.props.platform === VKCOM\n ? 200\n : 300;\n }\n\n onItemClick: ItemClickHander = (item: AlertActionInterface) => () => {\n const { action, autoclose } = item;\n\n if (autoclose) {\n this.setState({ closing: true });\n this.waitTransitionFinish((e?: TransitionEvent) => {\n if (!e || e.propertyName === \"opacity\") {\n autoclose && this.props.onClose?.();\n action && action();\n }\n });\n } else {\n action && action();\n }\n };\n\n onClose: VoidFunction = () => {\n this.setState({ closing: true });\n this.waitTransitionFinish((e?: TransitionEvent) => {\n if (!e || e.propertyName === \"opacity\") {\n this.props.onClose?.();\n }\n });\n };\n\n stopPropagation: React.MouseEventHandler = (e: React.SyntheticEvent) => {\n e.stopPropagation();\n };\n\n waitTransitionFinish(eventHandler: TransitionEndHandler) {\n if (transitionEvent.supported && this.element.current) {\n this.element.current.removeEventListener(\n transitionEvent.name as string,\n eventHandler as () => void\n );\n this.element.current.addEventListener(\n transitionEvent.name as string,\n eventHandler as () => void\n );\n } else {\n if (this.transitionFinishTimeout) {\n clearTimeout(this.transitionFinishTimeout);\n }\n this.transitionFinishTimeout = setTimeout(\n eventHandler.bind(this),\n this.timeout\n );\n }\n }\n\n renderHeader(header: React.ReactNode) {\n switch (this.props.platform) {\n case VKCOM:\n return (\n <Headline vkuiClass=\"Alert__header\" weight=\"medium\">\n {header}\n </Headline>\n );\n case IOS:\n return (\n <Title vkuiClass=\"Alert__header\" weight=\"semibold\" level=\"3\">\n {header}\n </Title>\n );\n case ANDROID:\n return (\n <Title vkuiClass=\"Alert__header\" weight=\"medium\" level=\"2\">\n {header}\n </Title>\n );\n default:\n return undefined;\n }\n }\n\n renderText(text: React.ReactNode) {\n switch (this.props.platform) {\n case VKCOM:\n return (\n <Caption vkuiClass=\"Alert__text\" level=\"1\" weight=\"regular\">\n {text}\n </Caption>\n );\n case IOS:\n return (\n <Caption vkuiClass=\"Alert__text\" level=\"2\" weight=\"regular\">\n {text}\n </Caption>\n );\n case ANDROID:\n return (\n <Headline vkuiClass=\"Alert__text\" weight=\"regular\">\n {text}\n </Headline>\n );\n default:\n return undefined;\n }\n }\n\n renderAction = (action: AlertActionInterface, i: number) => {\n const { platform } = this.props;\n\n if (platform === IOS) {\n const { Component = \"button\" } = action;\n return (\n <Tappable\n Component={action.href ? \"a\" : Component}\n vkuiClass={classNames(\n \"Alert__action\",\n `Alert__action--${action.mode}`\n )}\n onClick={this.onItemClick(action)}\n href={action.href}\n key={`alert-action-${i}`}\n target={action.target}\n >\n {action.title}\n </Tappable>\n );\n }\n\n let mode: ButtonProps[\"mode\"] =\n action.mode === \"cancel\" ? \"secondary\" : \"primary\";\n\n if (platform === ANDROID) {\n mode = \"tertiary\";\n\n if (\n this.props.viewWidth === ViewWidth.DESKTOP &&\n action.mode === \"destructive\"\n ) {\n mode = \"destructive\";\n }\n }\n\n return (\n <Button\n vkuiClass={classNames(\"Alert__button\", `Alert__button--${action.mode}`)}\n mode={mode}\n size=\"m\"\n onClick={this.onItemClick(action)}\n Component={action.Component}\n href={action.href}\n key={`alert-action-${i}`}\n target={action.target}\n >\n {action.title}\n </Button>\n );\n };\n\n render() {\n const {\n actions,\n actionsLayout,\n children,\n className,\n style,\n platform,\n viewWidth,\n text,\n header,\n ...restProps\n } = this.props;\n const { closing } = this.state;\n\n const resolvedActionsLayout: TAlertProps[\"actionsLayout\"] =\n platform === VKCOM ? \"horizontal\" : actionsLayout;\n const canShowCloseButton =\n platform === VKCOM ||\n (platform === ANDROID && viewWidth >= ViewWidth.SMALL_TABLET);\n const isDesktop = viewWidth >= ViewWidth.SMALL_TABLET;\n\n return (\n <PopoutWrapper\n className={className}\n closing={closing}\n style={style}\n onClick={this.onClose}\n >\n <FocusTrap\n {...restProps}\n getRootRef={this.element}\n onClick={this.stopPropagation}\n onClose={this.onClose}\n timeout={this.timeout}\n vkuiClass={classNames(getClassName(\"Alert\", platform), {\n \"Alert--v\": resolvedActionsLayout === \"vertical\",\n \"Alert--h\": resolvedActionsLayout === \"horizontal\",\n \"Alert--closing\": closing,\n \"Alert--desktop\": isDesktop,\n })}\n >\n {canShowCloseButton && <ModalDismissButton onClick={this.onClose} />}\n <div vkuiClass=\"Alert__content\">\n {hasReactNode(header) && this.renderHeader(header)}\n {hasReactNode(text) && this.renderText(text)}\n {children}\n </div>\n <footer vkuiClass=\"Alert__actions\">\n {actions?.map(this.renderAction)}\n </footer>\n </FocusTrap>\n </PopoutWrapper>\n );\n }\n}\n\n// eslint-disable-next-line import/no-default-export\nexport default withPlatform(\n withAdaptivity(Alert, {\n viewWidth: true,\n })\n);\n"],"file":"Alert.js"}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
|
-
import { AdaptivityContextInterface } from "../AdaptivityProvider/AdaptivityContext";
|
|
2
|
+
import { AdaptivityContextInterface, AdaptivityProps } from "../AdaptivityProvider/AdaptivityContext";
|
|
3
3
|
import "./Epic.css";
|
|
4
|
-
export interface EpicProps extends React.HTMLAttributes<HTMLDivElement>,
|
|
4
|
+
export interface EpicProps extends React.HTMLAttributes<HTMLDivElement>, AdaptivityProps {
|
|
5
5
|
tabbar?: React.ReactNode;
|
|
6
6
|
activeStory: string;
|
|
7
7
|
}
|
|
8
|
-
export declare const Epic: React.FC<EpicProps>;
|
|
9
|
-
declare const _default: React.FC<Pick<EpicProps, "hidden" | "dir" | "slot" | "style" | "title" | "color" | "translate" | "prefix" | "children" | "className" | "id" | "lang" | "role" | "tabIndex" | "aria-activedescendant" | "aria-atomic" | "aria-autocomplete" | "aria-busy" | "aria-checked" | "aria-colcount" | "aria-colindex" | "aria-colspan" | "aria-controls" | "aria-current" | "aria-describedby" | "aria-details" | "aria-disabled" | "aria-dropeffect" | "aria-errormessage" | "aria-expanded" | "aria-flowto" | "aria-grabbed" | "aria-haspopup" | "aria-hidden" | "aria-invalid" | "aria-keyshortcuts" | "aria-label" | "aria-labelledby" | "aria-level" | "aria-live" | "aria-modal" | "aria-multiline" | "aria-multiselectable" | "aria-orientation" | "aria-owns" | "aria-placeholder" | "aria-posinset" | "aria-pressed" | "aria-readonly" | "aria-relevant" | "aria-required" | "aria-roledescription" | "aria-rowcount" | "aria-rowindex" | "aria-rowspan" | "aria-selected" | "aria-setsize" | "aria-sort" | "aria-valuemax" | "aria-valuemin" | "aria-valuenow" | "aria-valuetext" | "dangerouslySetInnerHTML" | "onCopy" | "onCopyCapture" | "onCut" | "onCutCapture" | "onPaste" | "onPasteCapture" | "onCompositionEnd" | "onCompositionEndCapture" | "onCompositionStart" | "onCompositionStartCapture" | "onCompositionUpdate" | "onCompositionUpdateCapture" | "onFocus" | "onFocusCapture" | "onBlur" | "onBlurCapture" | "onChange" | "onChangeCapture" | "onBeforeInput" | "onBeforeInputCapture" | "onInput" | "onInputCapture" | "onReset" | "onResetCapture" | "onSubmit" | "onSubmitCapture" | "onInvalid" | "onInvalidCapture" | "onLoad" | "onLoadCapture" | "onError" | "onErrorCapture" | "onKeyDown" | "onKeyDownCapture" | "onKeyPress" | "onKeyPressCapture" | "onKeyUp" | "onKeyUpCapture" | "onAbort" | "onAbortCapture" | "onCanPlay" | "onCanPlayCapture" | "onCanPlayThrough" | "onCanPlayThroughCapture" | "onDurationChange" | "onDurationChangeCapture" | "onEmptied" | "onEmptiedCapture" | "onEncrypted" | "onEncryptedCapture" | "onEnded" | "onEndedCapture" | "onLoadedData" | "onLoadedDataCapture" | "onLoadedMetadata" | "onLoadedMetadataCapture" | "onLoadStart" | "onLoadStartCapture" | "onPause" | "onPauseCapture" | "onPlay" | "onPlayCapture" | "onPlaying" | "onPlayingCapture" | "onProgress" | "onProgressCapture" | "onRateChange" | "onRateChangeCapture" | "onSeeked" | "onSeekedCapture" | "onSeeking" | "onSeekingCapture" | "onStalled" | "onStalledCapture" | "onSuspend" | "onSuspendCapture" | "onTimeUpdate" | "onTimeUpdateCapture" | "onVolumeChange" | "onVolumeChangeCapture" | "onWaiting" | "onWaitingCapture" | "onAuxClick" | "onAuxClickCapture" | "onClick" | "onClickCapture" | "onContextMenu" | "onContextMenuCapture" | "onDoubleClick" | "onDoubleClickCapture" | "onDrag" | "onDragCapture" | "onDragEnd" | "onDragEndCapture" | "onDragEnter" | "onDragEnterCapture" | "onDragExit" | "onDragExitCapture" | "onDragLeave" | "onDragLeaveCapture" | "onDragOver" | "onDragOverCapture" | "onDragStart" | "onDragStartCapture" | "onDrop" | "onDropCapture" | "onMouseDown" | "onMouseDownCapture" | "onMouseEnter" | "onMouseLeave" | "onMouseMove" | "onMouseMoveCapture" | "onMouseOut" | "onMouseOutCapture" | "onMouseOver" | "onMouseOverCapture" | "onMouseUp" | "onMouseUpCapture" | "onSelect" | "onSelectCapture" | "onTouchCancel" | "onTouchCancelCapture" | "onTouchEnd" | "onTouchEndCapture" | "onTouchMove" | "onTouchMoveCapture" | "onTouchStart" | "onTouchStartCapture" | "onPointerDown" | "onPointerDownCapture" | "onPointerMove" | "onPointerMoveCapture" | "onPointerUp" | "onPointerUpCapture" | "onPointerCancel" | "onPointerCancelCapture" | "onPointerEnter" | "onPointerEnterCapture" | "onPointerLeave" | "onPointerLeaveCapture" | "onPointerOver" | "onPointerOverCapture" | "onPointerOut" | "onPointerOutCapture" | "onGotPointerCapture" | "onGotPointerCaptureCapture" | "onLostPointerCapture" | "onLostPointerCaptureCapture" | "onScroll" | "onScrollCapture" | "onWheel" | "onWheelCapture" | "onAnimationStart" | "onAnimationStartCapture" | "onAnimationEnd" | "onAnimationEndCapture" | "onAnimationIteration" | "onAnimationIterationCapture" | "onTransitionEnd" | "onTransitionEndCapture" | "defaultChecked" | "defaultValue" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "accessKey" | "contentEditable" | "contextMenu" | "draggable" | "placeholder" | "spellCheck" | "radioGroup" | "about" | "datatype" | "inlist" | "property" | "resource" | "typeof" | "vocab" | "autoCapitalize" | "autoCorrect" | "autoSave" | "itemProp" | "itemScope" | "itemType" | "itemID" | "itemRef" | "results" | "security" | "unselectable" | "inputMode" | "is" | "tabbar" | "activeStory"> & import("../AdaptivityProvider/AdaptivityContext").SizeProps>;
|
|
8
|
+
export declare const Epic: React.FC<EpicProps & AdaptivityContextInterface>;
|
|
9
|
+
declare const _default: React.FC<Pick<EpicProps & AdaptivityContextInterface, "hidden" | "dir" | "slot" | "style" | "title" | "color" | "translate" | "prefix" | "children" | "className" | "id" | "lang" | "role" | "tabIndex" | "aria-activedescendant" | "aria-atomic" | "aria-autocomplete" | "aria-busy" | "aria-checked" | "aria-colcount" | "aria-colindex" | "aria-colspan" | "aria-controls" | "aria-current" | "aria-describedby" | "aria-details" | "aria-disabled" | "aria-dropeffect" | "aria-errormessage" | "aria-expanded" | "aria-flowto" | "aria-grabbed" | "aria-haspopup" | "aria-hidden" | "aria-invalid" | "aria-keyshortcuts" | "aria-label" | "aria-labelledby" | "aria-level" | "aria-live" | "aria-modal" | "aria-multiline" | "aria-multiselectable" | "aria-orientation" | "aria-owns" | "aria-placeholder" | "aria-posinset" | "aria-pressed" | "aria-readonly" | "aria-relevant" | "aria-required" | "aria-roledescription" | "aria-rowcount" | "aria-rowindex" | "aria-rowspan" | "aria-selected" | "aria-setsize" | "aria-sort" | "aria-valuemax" | "aria-valuemin" | "aria-valuenow" | "aria-valuetext" | "dangerouslySetInnerHTML" | "onCopy" | "onCopyCapture" | "onCut" | "onCutCapture" | "onPaste" | "onPasteCapture" | "onCompositionEnd" | "onCompositionEndCapture" | "onCompositionStart" | "onCompositionStartCapture" | "onCompositionUpdate" | "onCompositionUpdateCapture" | "onFocus" | "onFocusCapture" | "onBlur" | "onBlurCapture" | "onChange" | "onChangeCapture" | "onBeforeInput" | "onBeforeInputCapture" | "onInput" | "onInputCapture" | "onReset" | "onResetCapture" | "onSubmit" | "onSubmitCapture" | "onInvalid" | "onInvalidCapture" | "onLoad" | "onLoadCapture" | "onError" | "onErrorCapture" | "onKeyDown" | "onKeyDownCapture" | "onKeyPress" | "onKeyPressCapture" | "onKeyUp" | "onKeyUpCapture" | "onAbort" | "onAbortCapture" | "onCanPlay" | "onCanPlayCapture" | "onCanPlayThrough" | "onCanPlayThroughCapture" | "onDurationChange" | "onDurationChangeCapture" | "onEmptied" | "onEmptiedCapture" | "onEncrypted" | "onEncryptedCapture" | "onEnded" | "onEndedCapture" | "onLoadedData" | "onLoadedDataCapture" | "onLoadedMetadata" | "onLoadedMetadataCapture" | "onLoadStart" | "onLoadStartCapture" | "onPause" | "onPauseCapture" | "onPlay" | "onPlayCapture" | "onPlaying" | "onPlayingCapture" | "onProgress" | "onProgressCapture" | "onRateChange" | "onRateChangeCapture" | "onSeeked" | "onSeekedCapture" | "onSeeking" | "onSeekingCapture" | "onStalled" | "onStalledCapture" | "onSuspend" | "onSuspendCapture" | "onTimeUpdate" | "onTimeUpdateCapture" | "onVolumeChange" | "onVolumeChangeCapture" | "onWaiting" | "onWaitingCapture" | "onAuxClick" | "onAuxClickCapture" | "onClick" | "onClickCapture" | "onContextMenu" | "onContextMenuCapture" | "onDoubleClick" | "onDoubleClickCapture" | "onDrag" | "onDragCapture" | "onDragEnd" | "onDragEndCapture" | "onDragEnter" | "onDragEnterCapture" | "onDragExit" | "onDragExitCapture" | "onDragLeave" | "onDragLeaveCapture" | "onDragOver" | "onDragOverCapture" | "onDragStart" | "onDragStartCapture" | "onDrop" | "onDropCapture" | "onMouseDown" | "onMouseDownCapture" | "onMouseEnter" | "onMouseLeave" | "onMouseMove" | "onMouseMoveCapture" | "onMouseOut" | "onMouseOutCapture" | "onMouseOver" | "onMouseOverCapture" | "onMouseUp" | "onMouseUpCapture" | "onSelect" | "onSelectCapture" | "onTouchCancel" | "onTouchCancelCapture" | "onTouchEnd" | "onTouchEndCapture" | "onTouchMove" | "onTouchMoveCapture" | "onTouchStart" | "onTouchStartCapture" | "onPointerDown" | "onPointerDownCapture" | "onPointerMove" | "onPointerMoveCapture" | "onPointerUp" | "onPointerUpCapture" | "onPointerCancel" | "onPointerCancelCapture" | "onPointerEnter" | "onPointerEnterCapture" | "onPointerLeave" | "onPointerLeaveCapture" | "onPointerOver" | "onPointerOverCapture" | "onPointerOut" | "onPointerOutCapture" | "onGotPointerCapture" | "onGotPointerCaptureCapture" | "onLostPointerCapture" | "onLostPointerCaptureCapture" | "onScroll" | "onScrollCapture" | "onWheel" | "onWheelCapture" | "onAnimationStart" | "onAnimationStartCapture" | "onAnimationEnd" | "onAnimationEndCapture" | "onAnimationIteration" | "onAnimationIterationCapture" | "onTransitionEnd" | "onTransitionEndCapture" | "defaultChecked" | "defaultValue" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "accessKey" | "contentEditable" | "contextMenu" | "draggable" | "placeholder" | "spellCheck" | "radioGroup" | "about" | "datatype" | "inlist" | "property" | "resource" | "typeof" | "vocab" | "autoCapitalize" | "autoCorrect" | "autoSave" | "itemProp" | "itemScope" | "itemType" | "itemID" | "itemRef" | "results" | "security" | "unselectable" | "inputMode" | "is" | "tabbar" | "activeStory"> & import("../AdaptivityProvider/AdaptivityContext").SizeProps>;
|
|
10
10
|
export default _default;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/components/Epic/Epic.tsx"],"names":["React","getClassName","usePlatform","withAdaptivity","ViewWidth","ScrollSaver","getNavId","warnOnce","warn","Epic","props","platform","scroll","useRef","current","activeStory","tabbar","children","viewWidth","restProps","process","env","NODE_ENV","SMALL_TABLET","story","Children","toArray","find","isValidElement","value"],"mappings":";;;;AAAA,OAAO,KAAKA,KAAZ,MAAuB,OAAvB;AACA,SAASC,YAAT;AACA,SAASC,WAAT;AACA,SAASC,cAAT,EAAyBC,SAAzB;AACA,SAASC,WAAT;AACA,SAASC,QAAT;AACA,SAASC,QAAT;
|
|
1
|
+
{"version":3,"sources":["../../../src/components/Epic/Epic.tsx"],"names":["React","getClassName","usePlatform","withAdaptivity","ViewWidth","ScrollSaver","getNavId","warnOnce","warn","Epic","props","platform","scroll","useRef","current","activeStory","tabbar","children","viewWidth","restProps","process","env","NODE_ENV","SMALL_TABLET","story","Children","toArray","find","isValidElement","value"],"mappings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Aa,EAAEH,MAAM,CAACG,WAAD,CAAN,IAAuB,CAFxC;AAGE,IAAA,UAAU,EAAE,oBAACc,KAAD;AAAA,aAAYjB,MAAM,CAACG,WAAD,CAAN,GAAsBc,KAAlC;AAAA;AAHd,KAKGL,KALH,CADF,EAQGR,MARH,CADF;AAYD,CAjCM,C,CAmCP;;AACA,eAAeb,cAAc,CAACM,IAAD,EAAO;AAClCS,EAAAA,SAAS,EAAE;AADuB,CAAP,CAA7B","sourcesContent":["import * as React from \"react\";\nimport { getClassName } from \"../../helpers/getClassName\";\nimport { usePlatform } from \"../../hooks/usePlatform\";\nimport { withAdaptivity, ViewWidth } from \"../../hoc/withAdaptivity\";\nimport { ScrollSaver } from \"./ScrollSaver\";\nimport { getNavId } from \"../../lib/getNavId\";\nimport { warnOnce } from \"../../lib/warnOnce\";\nimport {\n AdaptivityContextInterface,\n AdaptivityProps,\n} from \"../AdaptivityProvider/AdaptivityContext\";\nimport \"./Epic.css\";\n\nexport interface EpicProps\n extends React.HTMLAttributes<HTMLDivElement>,\n AdaptivityProps {\n tabbar?: React.ReactNode;\n activeStory: string;\n}\n\nconst warn = warnOnce(\"Epic\");\n\nexport const Epic: React.FC<EpicProps & AdaptivityContextInterface> = (\n props\n) => {\n const platform = usePlatform();\n const scroll = React.useRef<{ [key: string]: number }>({}).current;\n const { activeStory, tabbar, children, viewWidth, ...restProps } = props;\n\n if (\n process.env.NODE_ENV === \"development\" &&\n !tabbar &&\n viewWidth < ViewWidth.SMALL_TABLET\n ) {\n warn(\"Using Epic without tabbar is not recommended on mobile\");\n }\n const story =\n (React.Children.toArray(children).find(\n (story) =>\n React.isValidElement(story) &&\n getNavId(story.props, warn) === activeStory\n ) as React.ReactElement | undefined) ?? null;\n\n return (\n <div {...restProps} vkuiClass={getClassName(\"Epic\", platform)}>\n <ScrollSaver\n key={activeStory}\n initialScroll={scroll[activeStory] || 0}\n saveScroll={(value) => (scroll[activeStory] = value)}\n >\n {story}\n </ScrollSaver>\n {tabbar}\n </div>\n );\n};\n\n// eslint-disable-next-line import/no-default-export\nexport default withAdaptivity(Epic, {\n viewWidth: true,\n});\n"],"file":"Epic.js"}
|
|
@@ -2,9 +2,9 @@ import * as React from "react";
|
|
|
2
2
|
import { HasPlatform } from "../../types";
|
|
3
3
|
import { NavIdProps } from "../../lib/getNavId";
|
|
4
4
|
import { ModalCardBaseProps } from "../ModalCardBase/ModalCardBase";
|
|
5
|
-
import { AdaptivityContextInterface } from "../AdaptivityProvider/AdaptivityContext";
|
|
5
|
+
import { AdaptivityContextInterface, AdaptivityProps } from "../AdaptivityProvider/AdaptivityContext";
|
|
6
6
|
import "./ModalCard.css";
|
|
7
|
-
export interface ModalCardProps extends HasPlatform,
|
|
7
|
+
export interface ModalCardProps extends HasPlatform, AdaptivityProps, NavIdProps, ModalCardBaseProps {
|
|
8
8
|
}
|
|
9
|
-
declare const _default: React.FC<Pick<Pick<ModalCardProps, "hidden" | "dir" | "header" | "nav" | "slot" | "style" | "title" | "color" | "icon" | "translate" | "prefix" | "children" | "className" | "id" | "lang" | "role" | "tabIndex" | "aria-activedescendant" | "aria-atomic" | "aria-autocomplete" | "aria-busy" | "aria-checked" | "aria-colcount" | "aria-colindex" | "aria-colspan" | "aria-controls" | "aria-current" | "aria-describedby" | "aria-details" | "aria-disabled" | "aria-dropeffect" | "aria-errormessage" | "aria-expanded" | "aria-flowto" | "aria-grabbed" | "aria-haspopup" | "aria-hidden" | "aria-invalid" | "aria-keyshortcuts" | "aria-label" | "aria-labelledby" | "aria-level" | "aria-live" | "aria-modal" | "aria-multiline" | "aria-multiselectable" | "aria-orientation" | "aria-owns" | "aria-placeholder" | "aria-posinset" | "aria-pressed" | "aria-readonly" | "aria-relevant" | "aria-required" | "aria-roledescription" | "aria-rowcount" | "aria-rowindex" | "aria-rowspan" | "aria-selected" | "aria-setsize" | "aria-sort" | "aria-valuemax" | "aria-valuemin" | "aria-valuenow" | "aria-valuetext" | "dangerouslySetInnerHTML" | "onCopy" | "onCopyCapture" | "onCut" | "onCutCapture" | "onPaste" | "onPasteCapture" | "onCompositionEnd" | "onCompositionEndCapture" | "onCompositionStart" | "onCompositionStartCapture" | "onCompositionUpdate" | "onCompositionUpdateCapture" | "onFocus" | "onFocusCapture" | "onBlur" | "onBlurCapture" | "onChange" | "onChangeCapture" | "onBeforeInput" | "onBeforeInputCapture" | "onInput" | "onInputCapture" | "onReset" | "onResetCapture" | "onSubmit" | "onSubmitCapture" | "onInvalid" | "onInvalidCapture" | "onLoad" | "onLoadCapture" | "onError" | "onErrorCapture" | "onKeyDown" | "onKeyDownCapture" | "onKeyPress" | "onKeyPressCapture" | "onKeyUp" | "onKeyUpCapture" | "onAbort" | "onAbortCapture" | "onCanPlay" | "onCanPlayCapture" | "onCanPlayThrough" | "onCanPlayThroughCapture" | "onDurationChange" | "onDurationChangeCapture" | "onEmptied" | "onEmptiedCapture" | "onEncrypted" | "onEncryptedCapture" | "onEnded" | "onEndedCapture" | "onLoadedData" | "onLoadedDataCapture" | "onLoadedMetadata" | "onLoadedMetadataCapture" | "onLoadStart" | "onLoadStartCapture" | "onPause" | "onPauseCapture" | "onPlay" | "onPlayCapture" | "onPlaying" | "onPlayingCapture" | "onProgress" | "onProgressCapture" | "onRateChange" | "onRateChangeCapture" | "onSeeked" | "onSeekedCapture" | "onSeeking" | "onSeekingCapture" | "onStalled" | "onStalledCapture" | "onSuspend" | "onSuspendCapture" | "onTimeUpdate" | "onTimeUpdateCapture" | "onVolumeChange" | "onVolumeChangeCapture" | "onWaiting" | "onWaitingCapture" | "onAuxClick" | "onAuxClickCapture" | "onClick" | "onClickCapture" | "onContextMenu" | "onContextMenuCapture" | "onDoubleClick" | "onDoubleClickCapture" | "onDrag" | "onDragCapture" | "onDragEnd" | "onDragEndCapture" | "onDragEnter" | "onDragEnterCapture" | "onDragExit" | "onDragExitCapture" | "onDragLeave" | "onDragLeaveCapture" | "onDragOver" | "onDragOverCapture" | "onDragStart" | "onDragStartCapture" | "onDrop" | "onDropCapture" | "onMouseDown" | "onMouseDownCapture" | "onMouseEnter" | "onMouseLeave" | "onMouseMove" | "onMouseMoveCapture" | "onMouseOut" | "onMouseOutCapture" | "onMouseOver" | "onMouseOverCapture" | "onMouseUp" | "onMouseUpCapture" | "onSelect" | "onSelectCapture" | "onTouchCancel" | "onTouchCancelCapture" | "onTouchEnd" | "onTouchEndCapture" | "onTouchMove" | "onTouchMoveCapture" | "onTouchStart" | "onTouchStartCapture" | "onPointerDown" | "onPointerDownCapture" | "onPointerMove" | "onPointerMoveCapture" | "onPointerUp" | "onPointerUpCapture" | "onPointerCancel" | "onPointerCancelCapture" | "onPointerEnter" | "onPointerEnterCapture" | "onPointerLeave" | "onPointerLeaveCapture" | "onPointerOver" | "onPointerOverCapture" | "onPointerOut" | "onPointerOutCapture" | "onGotPointerCapture" | "onGotPointerCaptureCapture" | "onLostPointerCapture" | "onLostPointerCaptureCapture" | "onScroll" | "onScrollCapture" | "onWheel" | "onWheelCapture" | "onAnimationStart" | "onAnimationStartCapture" | "onAnimationEnd" | "onAnimationEndCapture" | "onAnimationIteration" | "onAnimationIterationCapture" | "onTransitionEnd" | "onTransitionEndCapture" | "defaultChecked" | "defaultValue" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "accessKey" | "contentEditable" | "contextMenu" | "draggable" | "placeholder" | "spellCheck" | "radioGroup" | "about" | "datatype" | "inlist" | "property" | "resource" | "typeof" | "vocab" | "autoCapitalize" | "autoCorrect" | "autoSave" | "itemProp" | "itemScope" | "itemType" | "itemID" | "itemRef" | "results" | "security" | "unselectable" | "inputMode" | "is" | "getRootRef" | "viewWidth" | "viewHeight" | "hasMouse" | "deviceHasHover" | "sizeX" | "sizeY" | "onClose" | "actionsLayout" | "actions" | "subheader">, "hidden" | "dir" | "header" | "nav" | "slot" | "style" | "title" | "color" | "icon" | "translate" | "prefix" | "children" | "className" | "id" | "lang" | "role" | "tabIndex" | "aria-activedescendant" | "aria-atomic" | "aria-autocomplete" | "aria-busy" | "aria-checked" | "aria-colcount" | "aria-colindex" | "aria-colspan" | "aria-controls" | "aria-current" | "aria-describedby" | "aria-details" | "aria-disabled" | "aria-dropeffect" | "aria-errormessage" | "aria-expanded" | "aria-flowto" | "aria-grabbed" | "aria-haspopup" | "aria-hidden" | "aria-invalid" | "aria-keyshortcuts" | "aria-label" | "aria-labelledby" | "aria-level" | "aria-live" | "aria-modal" | "aria-multiline" | "aria-multiselectable" | "aria-orientation" | "aria-owns" | "aria-placeholder" | "aria-posinset" | "aria-pressed" | "aria-readonly" | "aria-relevant" | "aria-required" | "aria-roledescription" | "aria-rowcount" | "aria-rowindex" | "aria-rowspan" | "aria-selected" | "aria-setsize" | "aria-sort" | "aria-valuemax" | "aria-valuemin" | "aria-valuenow" | "aria-valuetext" | "dangerouslySetInnerHTML" | "onCopy" | "onCopyCapture" | "onCut" | "onCutCapture" | "onPaste" | "onPasteCapture" | "onCompositionEnd" | "onCompositionEndCapture" | "onCompositionStart" | "onCompositionStartCapture" | "onCompositionUpdate" | "onCompositionUpdateCapture" | "onFocus" | "onFocusCapture" | "onBlur" | "onBlurCapture" | "onChange" | "onChangeCapture" | "onBeforeInput" | "onBeforeInputCapture" | "onInput" | "onInputCapture" | "onReset" | "onResetCapture" | "onSubmit" | "onSubmitCapture" | "onInvalid" | "onInvalidCapture" | "onLoad" | "onLoadCapture" | "onError" | "onErrorCapture" | "onKeyDown" | "onKeyDownCapture" | "onKeyPress" | "onKeyPressCapture" | "onKeyUp" | "onKeyUpCapture" | "onAbort" | "onAbortCapture" | "onCanPlay" | "onCanPlayCapture" | "onCanPlayThrough" | "onCanPlayThroughCapture" | "onDurationChange" | "onDurationChangeCapture" | "onEmptied" | "onEmptiedCapture" | "onEncrypted" | "onEncryptedCapture" | "onEnded" | "onEndedCapture" | "onLoadedData" | "onLoadedDataCapture" | "onLoadedMetadata" | "onLoadedMetadataCapture" | "onLoadStart" | "onLoadStartCapture" | "onPause" | "onPauseCapture" | "onPlay" | "onPlayCapture" | "onPlaying" | "onPlayingCapture" | "onProgress" | "onProgressCapture" | "onRateChange" | "onRateChangeCapture" | "onSeeked" | "onSeekedCapture" | "onSeeking" | "onSeekingCapture" | "onStalled" | "onStalledCapture" | "onSuspend" | "onSuspendCapture" | "onTimeUpdate" | "onTimeUpdateCapture" | "onVolumeChange" | "onVolumeChangeCapture" | "onWaiting" | "onWaitingCapture" | "onAuxClick" | "onAuxClickCapture" | "onClick" | "onClickCapture" | "onContextMenu" | "onContextMenuCapture" | "onDoubleClick" | "onDoubleClickCapture" | "onDrag" | "onDragCapture" | "onDragEnd" | "onDragEndCapture" | "onDragEnter" | "onDragEnterCapture" | "onDragExit" | "onDragExitCapture" | "onDragLeave" | "onDragLeaveCapture" | "onDragOver" | "onDragOverCapture" | "onDragStart" | "onDragStartCapture" | "onDrop" | "onDropCapture" | "onMouseDown" | "onMouseDownCapture" | "onMouseEnter" | "onMouseLeave" | "onMouseMove" | "onMouseMoveCapture" | "onMouseOut" | "onMouseOutCapture" | "onMouseOver" | "onMouseOverCapture" | "onMouseUp" | "onMouseUpCapture" | "onSelect" | "onSelectCapture" | "onTouchCancel" | "onTouchCancelCapture" | "onTouchEnd" | "onTouchEndCapture" | "onTouchMove" | "onTouchMoveCapture" | "onTouchStart" | "onTouchStartCapture" | "onPointerDown" | "onPointerDownCapture" | "onPointerMove" | "onPointerMoveCapture" | "onPointerUp" | "onPointerUpCapture" | "onPointerCancel" | "onPointerCancelCapture" | "onPointerEnter" | "onPointerEnterCapture" | "onPointerLeave" | "onPointerLeaveCapture" | "onPointerOver" | "onPointerOverCapture" | "onPointerOut" | "onPointerOutCapture" | "onGotPointerCapture" | "onGotPointerCaptureCapture" | "onLostPointerCapture" | "onLostPointerCaptureCapture" | "onScroll" | "onScrollCapture" | "onWheel" | "onWheelCapture" | "onAnimationStart" | "onAnimationStartCapture" | "onAnimationEnd" | "onAnimationEndCapture" | "onAnimationIteration" | "onAnimationIterationCapture" | "onTransitionEnd" | "onTransitionEndCapture" | "defaultChecked" | "defaultValue" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "accessKey" | "contentEditable" | "contextMenu" | "draggable" | "placeholder" | "spellCheck" | "radioGroup" | "about" | "datatype" | "inlist" | "property" | "resource" | "typeof" | "vocab" | "autoCapitalize" | "autoCorrect" | "autoSave" | "itemProp" | "itemScope" | "itemType" | "itemID" | "itemRef" | "results" | "security" | "unselectable" | "inputMode" | "is" | "getRootRef" | "onClose" | "actionsLayout" | "actions" | "subheader"> & import("../AdaptivityProvider/AdaptivityContext").SizeProps>;
|
|
9
|
+
declare const _default: React.FC<Pick<Pick<ModalCardProps & AdaptivityContextInterface, "hidden" | "dir" | "header" | "nav" | "slot" | "style" | "title" | "color" | "icon" | "translate" | "prefix" | "children" | "className" | "id" | "lang" | "role" | "tabIndex" | "aria-activedescendant" | "aria-atomic" | "aria-autocomplete" | "aria-busy" | "aria-checked" | "aria-colcount" | "aria-colindex" | "aria-colspan" | "aria-controls" | "aria-current" | "aria-describedby" | "aria-details" | "aria-disabled" | "aria-dropeffect" | "aria-errormessage" | "aria-expanded" | "aria-flowto" | "aria-grabbed" | "aria-haspopup" | "aria-hidden" | "aria-invalid" | "aria-keyshortcuts" | "aria-label" | "aria-labelledby" | "aria-level" | "aria-live" | "aria-modal" | "aria-multiline" | "aria-multiselectable" | "aria-orientation" | "aria-owns" | "aria-placeholder" | "aria-posinset" | "aria-pressed" | "aria-readonly" | "aria-relevant" | "aria-required" | "aria-roledescription" | "aria-rowcount" | "aria-rowindex" | "aria-rowspan" | "aria-selected" | "aria-setsize" | "aria-sort" | "aria-valuemax" | "aria-valuemin" | "aria-valuenow" | "aria-valuetext" | "dangerouslySetInnerHTML" | "onCopy" | "onCopyCapture" | "onCut" | "onCutCapture" | "onPaste" | "onPasteCapture" | "onCompositionEnd" | "onCompositionEndCapture" | "onCompositionStart" | "onCompositionStartCapture" | "onCompositionUpdate" | "onCompositionUpdateCapture" | "onFocus" | "onFocusCapture" | "onBlur" | "onBlurCapture" | "onChange" | "onChangeCapture" | "onBeforeInput" | "onBeforeInputCapture" | "onInput" | "onInputCapture" | "onReset" | "onResetCapture" | "onSubmit" | "onSubmitCapture" | "onInvalid" | "onInvalidCapture" | "onLoad" | "onLoadCapture" | "onError" | "onErrorCapture" | "onKeyDown" | "onKeyDownCapture" | "onKeyPress" | "onKeyPressCapture" | "onKeyUp" | "onKeyUpCapture" | "onAbort" | "onAbortCapture" | "onCanPlay" | "onCanPlayCapture" | "onCanPlayThrough" | "onCanPlayThroughCapture" | "onDurationChange" | "onDurationChangeCapture" | "onEmptied" | "onEmptiedCapture" | "onEncrypted" | "onEncryptedCapture" | "onEnded" | "onEndedCapture" | "onLoadedData" | "onLoadedDataCapture" | "onLoadedMetadata" | "onLoadedMetadataCapture" | "onLoadStart" | "onLoadStartCapture" | "onPause" | "onPauseCapture" | "onPlay" | "onPlayCapture" | "onPlaying" | "onPlayingCapture" | "onProgress" | "onProgressCapture" | "onRateChange" | "onRateChangeCapture" | "onSeeked" | "onSeekedCapture" | "onSeeking" | "onSeekingCapture" | "onStalled" | "onStalledCapture" | "onSuspend" | "onSuspendCapture" | "onTimeUpdate" | "onTimeUpdateCapture" | "onVolumeChange" | "onVolumeChangeCapture" | "onWaiting" | "onWaitingCapture" | "onAuxClick" | "onAuxClickCapture" | "onClick" | "onClickCapture" | "onContextMenu" | "onContextMenuCapture" | "onDoubleClick" | "onDoubleClickCapture" | "onDrag" | "onDragCapture" | "onDragEnd" | "onDragEndCapture" | "onDragEnter" | "onDragEnterCapture" | "onDragExit" | "onDragExitCapture" | "onDragLeave" | "onDragLeaveCapture" | "onDragOver" | "onDragOverCapture" | "onDragStart" | "onDragStartCapture" | "onDrop" | "onDropCapture" | "onMouseDown" | "onMouseDownCapture" | "onMouseEnter" | "onMouseLeave" | "onMouseMove" | "onMouseMoveCapture" | "onMouseOut" | "onMouseOutCapture" | "onMouseOver" | "onMouseOverCapture" | "onMouseUp" | "onMouseUpCapture" | "onSelect" | "onSelectCapture" | "onTouchCancel" | "onTouchCancelCapture" | "onTouchEnd" | "onTouchEndCapture" | "onTouchMove" | "onTouchMoveCapture" | "onTouchStart" | "onTouchStartCapture" | "onPointerDown" | "onPointerDownCapture" | "onPointerMove" | "onPointerMoveCapture" | "onPointerUp" | "onPointerUpCapture" | "onPointerCancel" | "onPointerCancelCapture" | "onPointerEnter" | "onPointerEnterCapture" | "onPointerLeave" | "onPointerLeaveCapture" | "onPointerOver" | "onPointerOverCapture" | "onPointerOut" | "onPointerOutCapture" | "onGotPointerCapture" | "onGotPointerCaptureCapture" | "onLostPointerCapture" | "onLostPointerCaptureCapture" | "onScroll" | "onScrollCapture" | "onWheel" | "onWheelCapture" | "onAnimationStart" | "onAnimationStartCapture" | "onAnimationEnd" | "onAnimationEndCapture" | "onAnimationIteration" | "onAnimationIterationCapture" | "onTransitionEnd" | "onTransitionEndCapture" | "defaultChecked" | "defaultValue" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "accessKey" | "contentEditable" | "contextMenu" | "draggable" | "placeholder" | "spellCheck" | "radioGroup" | "about" | "datatype" | "inlist" | "property" | "resource" | "typeof" | "vocab" | "autoCapitalize" | "autoCorrect" | "autoSave" | "itemProp" | "itemScope" | "itemType" | "itemID" | "itemRef" | "results" | "security" | "unselectable" | "inputMode" | "is" | "getRootRef" | "viewWidth" | "viewHeight" | "hasMouse" | "deviceHasHover" | "sizeX" | "sizeY" | "onClose" | "actionsLayout" | "actions" | "subheader">, "hidden" | "dir" | "header" | "nav" | "slot" | "style" | "title" | "color" | "icon" | "translate" | "prefix" | "children" | "className" | "id" | "lang" | "role" | "tabIndex" | "aria-activedescendant" | "aria-atomic" | "aria-autocomplete" | "aria-busy" | "aria-checked" | "aria-colcount" | "aria-colindex" | "aria-colspan" | "aria-controls" | "aria-current" | "aria-describedby" | "aria-details" | "aria-disabled" | "aria-dropeffect" | "aria-errormessage" | "aria-expanded" | "aria-flowto" | "aria-grabbed" | "aria-haspopup" | "aria-hidden" | "aria-invalid" | "aria-keyshortcuts" | "aria-label" | "aria-labelledby" | "aria-level" | "aria-live" | "aria-modal" | "aria-multiline" | "aria-multiselectable" | "aria-orientation" | "aria-owns" | "aria-placeholder" | "aria-posinset" | "aria-pressed" | "aria-readonly" | "aria-relevant" | "aria-required" | "aria-roledescription" | "aria-rowcount" | "aria-rowindex" | "aria-rowspan" | "aria-selected" | "aria-setsize" | "aria-sort" | "aria-valuemax" | "aria-valuemin" | "aria-valuenow" | "aria-valuetext" | "dangerouslySetInnerHTML" | "onCopy" | "onCopyCapture" | "onCut" | "onCutCapture" | "onPaste" | "onPasteCapture" | "onCompositionEnd" | "onCompositionEndCapture" | "onCompositionStart" | "onCompositionStartCapture" | "onCompositionUpdate" | "onCompositionUpdateCapture" | "onFocus" | "onFocusCapture" | "onBlur" | "onBlurCapture" | "onChange" | "onChangeCapture" | "onBeforeInput" | "onBeforeInputCapture" | "onInput" | "onInputCapture" | "onReset" | "onResetCapture" | "onSubmit" | "onSubmitCapture" | "onInvalid" | "onInvalidCapture" | "onLoad" | "onLoadCapture" | "onError" | "onErrorCapture" | "onKeyDown" | "onKeyDownCapture" | "onKeyPress" | "onKeyPressCapture" | "onKeyUp" | "onKeyUpCapture" | "onAbort" | "onAbortCapture" | "onCanPlay" | "onCanPlayCapture" | "onCanPlayThrough" | "onCanPlayThroughCapture" | "onDurationChange" | "onDurationChangeCapture" | "onEmptied" | "onEmptiedCapture" | "onEncrypted" | "onEncryptedCapture" | "onEnded" | "onEndedCapture" | "onLoadedData" | "onLoadedDataCapture" | "onLoadedMetadata" | "onLoadedMetadataCapture" | "onLoadStart" | "onLoadStartCapture" | "onPause" | "onPauseCapture" | "onPlay" | "onPlayCapture" | "onPlaying" | "onPlayingCapture" | "onProgress" | "onProgressCapture" | "onRateChange" | "onRateChangeCapture" | "onSeeked" | "onSeekedCapture" | "onSeeking" | "onSeekingCapture" | "onStalled" | "onStalledCapture" | "onSuspend" | "onSuspendCapture" | "onTimeUpdate" | "onTimeUpdateCapture" | "onVolumeChange" | "onVolumeChangeCapture" | "onWaiting" | "onWaitingCapture" | "onAuxClick" | "onAuxClickCapture" | "onClick" | "onClickCapture" | "onContextMenu" | "onContextMenuCapture" | "onDoubleClick" | "onDoubleClickCapture" | "onDrag" | "onDragCapture" | "onDragEnd" | "onDragEndCapture" | "onDragEnter" | "onDragEnterCapture" | "onDragExit" | "onDragExitCapture" | "onDragLeave" | "onDragLeaveCapture" | "onDragOver" | "onDragOverCapture" | "onDragStart" | "onDragStartCapture" | "onDrop" | "onDropCapture" | "onMouseDown" | "onMouseDownCapture" | "onMouseEnter" | "onMouseLeave" | "onMouseMove" | "onMouseMoveCapture" | "onMouseOut" | "onMouseOutCapture" | "onMouseOver" | "onMouseOverCapture" | "onMouseUp" | "onMouseUpCapture" | "onSelect" | "onSelectCapture" | "onTouchCancel" | "onTouchCancelCapture" | "onTouchEnd" | "onTouchEndCapture" | "onTouchMove" | "onTouchMoveCapture" | "onTouchStart" | "onTouchStartCapture" | "onPointerDown" | "onPointerDownCapture" | "onPointerMove" | "onPointerMoveCapture" | "onPointerUp" | "onPointerUpCapture" | "onPointerCancel" | "onPointerCancelCapture" | "onPointerEnter" | "onPointerEnterCapture" | "onPointerLeave" | "onPointerLeaveCapture" | "onPointerOver" | "onPointerOverCapture" | "onPointerOut" | "onPointerOutCapture" | "onGotPointerCapture" | "onGotPointerCaptureCapture" | "onLostPointerCapture" | "onLostPointerCaptureCapture" | "onScroll" | "onScrollCapture" | "onWheel" | "onWheelCapture" | "onAnimationStart" | "onAnimationStartCapture" | "onAnimationEnd" | "onAnimationEndCapture" | "onAnimationIteration" | "onAnimationIterationCapture" | "onTransitionEnd" | "onTransitionEndCapture" | "defaultChecked" | "defaultValue" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "accessKey" | "contentEditable" | "contextMenu" | "draggable" | "placeholder" | "spellCheck" | "radioGroup" | "about" | "datatype" | "inlist" | "property" | "resource" | "typeof" | "vocab" | "autoCapitalize" | "autoCorrect" | "autoSave" | "itemProp" | "itemScope" | "itemType" | "itemID" | "itemRef" | "results" | "security" | "unselectable" | "inputMode" | "is" | "getRootRef" | "onClose" | "actionsLayout" | "actions" | "subheader"> & import("../AdaptivityProvider/AdaptivityContext").SizeProps>;
|
|
10
10
|
export default _default;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/components/ModalCard/ModalCard.tsx"],"names":["React","getClassName","classNames","withPlatform","withAdaptivity","ViewHeight","ViewWidth","ModalRootContext","useModalRegistry","ModalType","getNavId","warnOnce","ModalCardBase","warn","ModalCard","props","icon","header","subheader","children","actions","actionsLayout","onClose","platform","viewWidth","viewHeight","hasMouse","nav","restProps","isDesktop","SMALL_TABLET","MEDIUM","modalContext","useContext","CARD","refs","innerElement","defaultProps"],"mappings":";;;;AAAA,OAAO,KAAKA,KAAZ,MAAuB,OAAvB;AACA,SAASC,YAAT;AACA,SAASC,UAAT;AACA,SAASC,YAAT;AAEA,SACEC,cADF,EAEEC,UAFF,EAGEC,SAHF;AAKA,OAAOC,gBAAP,IACEC,gBADF;AAGA,SAASC,SAAT;AACA,SAASC,QAAT;AACA,SAASC,QAAT;AACA,SACEC,aADF;
|
|
1
|
+
{"version":3,"sources":["../../../src/components/ModalCard/ModalCard.tsx"],"names":["React","getClassName","classNames","withPlatform","withAdaptivity","ViewHeight","ViewWidth","ModalRootContext","useModalRegistry","ModalType","getNavId","warnOnce","ModalCardBase","warn","ModalCard","props","icon","header","subheader","children","actions","actionsLayout","onClose","platform","viewWidth","viewHeight","hasMouse","nav","restProps","isDesktop","SMALL_TABLET","MEDIUM","modalContext","useContext","CARD","refs","innerElement","defaultProps"],"mappings":";;;;AAAA,OAAO,KAAKA,KAAZ,MAAuB,OAAvB;AACA,SAASC,YAAT;AACA,SAASC,UAAT;AACA,SAASC,YAAT;AAEA,SACEC,cADF,EAEEC,UAFF,EAGEC,SAHF;AAKA,OAAOC,gBAAP,IACEC,gBADF;AAGA,SAASC,SAAT;AACA,SAASC,QAAT;AACA,SAASC,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EAAC,eADZ;AAEE,IAAA,UAAU,EAAEM,IAAI,CAACC,YAFnB;AAGE,IAAA,IAAI,EAAEpB,IAHR;AAIE,IAAA,MAAM,EAAEC,MAJV;AAKE,IAAA,SAAS,EAAEC,SALb;AAME,IAAA,OAAO,EAAEE,OANX;AAOE,IAAA,aAAa,EAAEC,aAPjB;AAQE,IAAA,OAAO,EAAEC,OAAO,IAAIU,YAAY,CAACV;AARnC,KAUGH,QAVH,CANF,CADF;AAqBD,CA/CD;;AAiDAL,SAAS,CAACuB,YAAV,GAAyB;AACvBhB,EAAAA,aAAa,EAAE;AADQ,CAAzB,C,CAIA;;AACA,eAAejB,cAAc,CAACD,YAAY,CAACW,SAAD,CAAb,EAA0B;AACrDU,EAAAA,SAAS,EAAE,IAD0C;AAErDC,EAAAA,UAAU,EAAE,IAFyC;AAGrDC,EAAAA,QAAQ,EAAE;AAH2C,CAA1B,CAA7B","sourcesContent":["import * as React from \"react\";\nimport { getClassName } from \"../../helpers/getClassName\";\nimport { classNames } from \"../../lib/classNames\";\nimport { withPlatform } from \"../../hoc/withPlatform\";\nimport { HasPlatform } from \"../../types\";\nimport {\n withAdaptivity,\n ViewHeight,\n ViewWidth,\n} from \"../../hoc/withAdaptivity\";\nimport ModalRootContext, {\n useModalRegistry,\n} from \"../ModalRoot/ModalRootContext\";\nimport { ModalType } from \"../ModalRoot/types\";\nimport { getNavId, NavIdProps } from \"../../lib/getNavId\";\nimport { warnOnce } from \"../../lib/warnOnce\";\nimport {\n ModalCardBase,\n ModalCardBaseProps,\n} from \"../ModalCardBase/ModalCardBase\";\nimport {\n AdaptivityContextInterface,\n AdaptivityProps,\n} from \"../AdaptivityProvider/AdaptivityContext\";\nimport \"./ModalCard.css\";\n\nexport interface ModalCardProps\n extends HasPlatform,\n AdaptivityProps,\n NavIdProps,\n ModalCardBaseProps {}\n\nconst warn = warnOnce(\"ModalCard\");\n\nconst ModalCard: React.FC<ModalCardProps & AdaptivityContextInterface> = (\n props\n) => {\n const {\n icon,\n header,\n subheader,\n children,\n actions,\n actionsLayout,\n onClose,\n platform,\n viewWidth,\n viewHeight,\n hasMouse,\n nav,\n ...restProps\n } = props;\n\n const isDesktop =\n viewWidth >= ViewWidth.SMALL_TABLET &&\n (hasMouse || viewHeight >= ViewHeight.MEDIUM);\n\n const modalContext = React.useContext(ModalRootContext);\n const { refs } = useModalRegistry(getNavId(props, warn), ModalType.CARD);\n\n return (\n <div\n {...restProps}\n vkuiClass={classNames(getClassName(\"ModalCard\", platform), {\n \"ModalCard--desktop\": isDesktop,\n })}\n >\n <ModalCardBase\n vkuiClass=\"ModalCard__in\"\n getRootRef={refs.innerElement}\n icon={icon}\n header={header}\n subheader={subheader}\n actions={actions}\n actionsLayout={actionsLayout}\n onClose={onClose || modalContext.onClose}\n >\n {children}\n </ModalCardBase>\n </div>\n );\n};\n\nModalCard.defaultProps = {\n actionsLayout: \"horizontal\",\n};\n\n// eslint-disable-next-line import/no-default-export\nexport default withAdaptivity(withPlatform(ModalCard), {\n viewWidth: true,\n viewHeight: true,\n hasMouse: true,\n});\n"],"file":"ModalCard.js"}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
|
-
import { AdaptivityContextInterface } from "../AdaptivityProvider/AdaptivityContext";
|
|
2
|
+
import { AdaptivityContextInterface, AdaptivityProps } from "../AdaptivityProvider/AdaptivityContext";
|
|
3
3
|
import { NavIdProps } from "../../lib/getNavId";
|
|
4
4
|
import "./ModalPage.css";
|
|
5
|
-
export interface ModalPageProps extends React.HTMLAttributes<HTMLDivElement>,
|
|
5
|
+
export interface ModalPageProps extends React.HTMLAttributes<HTMLDivElement>, AdaptivityProps, NavIdProps {
|
|
6
6
|
/**
|
|
7
7
|
* Шапка модальной страницы, `<ModalPageHeader />`
|
|
8
8
|
*/
|
|
@@ -18,5 +18,5 @@ export interface ModalPageProps extends React.HTMLAttributes<HTMLDivElement>, Ad
|
|
|
18
18
|
dynamicContentHeight?: boolean;
|
|
19
19
|
getModalContentRef?: React.Ref<HTMLDivElement>;
|
|
20
20
|
}
|
|
21
|
-
declare const _default: React.FC<Pick<ModalPageProps, "hidden" | "dir" | "header" | "nav" | "slot" | "style" | "title" | "color" | "translate" | "prefix" | "children" | "className" | "id" | "lang" | "role" | "tabIndex" | "aria-activedescendant" | "aria-atomic" | "aria-autocomplete" | "aria-busy" | "aria-checked" | "aria-colcount" | "aria-colindex" | "aria-colspan" | "aria-controls" | "aria-current" | "aria-describedby" | "aria-details" | "aria-disabled" | "aria-dropeffect" | "aria-errormessage" | "aria-expanded" | "aria-flowto" | "aria-grabbed" | "aria-haspopup" | "aria-hidden" | "aria-invalid" | "aria-keyshortcuts" | "aria-label" | "aria-labelledby" | "aria-level" | "aria-live" | "aria-modal" | "aria-multiline" | "aria-multiselectable" | "aria-orientation" | "aria-owns" | "aria-placeholder" | "aria-posinset" | "aria-pressed" | "aria-readonly" | "aria-relevant" | "aria-required" | "aria-roledescription" | "aria-rowcount" | "aria-rowindex" | "aria-rowspan" | "aria-selected" | "aria-setsize" | "aria-sort" | "aria-valuemax" | "aria-valuemin" | "aria-valuenow" | "aria-valuetext" | "dangerouslySetInnerHTML" | "onCopy" | "onCopyCapture" | "onCut" | "onCutCapture" | "onPaste" | "onPasteCapture" | "onCompositionEnd" | "onCompositionEndCapture" | "onCompositionStart" | "onCompositionStartCapture" | "onCompositionUpdate" | "onCompositionUpdateCapture" | "onFocus" | "onFocusCapture" | "onBlur" | "onBlurCapture" | "onChange" | "onChangeCapture" | "onBeforeInput" | "onBeforeInputCapture" | "onInput" | "onInputCapture" | "onReset" | "onResetCapture" | "onSubmit" | "onSubmitCapture" | "onInvalid" | "onInvalidCapture" | "onLoad" | "onLoadCapture" | "onError" | "onErrorCapture" | "onKeyDown" | "onKeyDownCapture" | "onKeyPress" | "onKeyPressCapture" | "onKeyUp" | "onKeyUpCapture" | "onAbort" | "onAbortCapture" | "onCanPlay" | "onCanPlayCapture" | "onCanPlayThrough" | "onCanPlayThroughCapture" | "onDurationChange" | "onDurationChangeCapture" | "onEmptied" | "onEmptiedCapture" | "onEncrypted" | "onEncryptedCapture" | "onEnded" | "onEndedCapture" | "onLoadedData" | "onLoadedDataCapture" | "onLoadedMetadata" | "onLoadedMetadataCapture" | "onLoadStart" | "onLoadStartCapture" | "onPause" | "onPauseCapture" | "onPlay" | "onPlayCapture" | "onPlaying" | "onPlayingCapture" | "onProgress" | "onProgressCapture" | "onRateChange" | "onRateChangeCapture" | "onSeeked" | "onSeekedCapture" | "onSeeking" | "onSeekingCapture" | "onStalled" | "onStalledCapture" | "onSuspend" | "onSuspendCapture" | "onTimeUpdate" | "onTimeUpdateCapture" | "onVolumeChange" | "onVolumeChangeCapture" | "onWaiting" | "onWaitingCapture" | "onAuxClick" | "onAuxClickCapture" | "onClick" | "onClickCapture" | "onContextMenu" | "onContextMenuCapture" | "onDoubleClick" | "onDoubleClickCapture" | "onDrag" | "onDragCapture" | "onDragEnd" | "onDragEndCapture" | "onDragEnter" | "onDragEnterCapture" | "onDragExit" | "onDragExitCapture" | "onDragLeave" | "onDragLeaveCapture" | "onDragOver" | "onDragOverCapture" | "onDragStart" | "onDragStartCapture" | "onDrop" | "onDropCapture" | "onMouseDown" | "onMouseDownCapture" | "onMouseEnter" | "onMouseLeave" | "onMouseMove" | "onMouseMoveCapture" | "onMouseOut" | "onMouseOutCapture" | "onMouseOver" | "onMouseOverCapture" | "onMouseUp" | "onMouseUpCapture" | "onSelect" | "onSelectCapture" | "onTouchCancel" | "onTouchCancelCapture" | "onTouchEnd" | "onTouchEndCapture" | "onTouchMove" | "onTouchMoveCapture" | "onTouchStart" | "onTouchStartCapture" | "onPointerDown" | "onPointerDownCapture" | "onPointerMove" | "onPointerMoveCapture" | "onPointerUp" | "onPointerUpCapture" | "onPointerCancel" | "onPointerCancelCapture" | "onPointerEnter" | "onPointerEnterCapture" | "onPointerLeave" | "onPointerLeaveCapture" | "onPointerOver" | "onPointerOverCapture" | "onPointerOut" | "onPointerOutCapture" | "onGotPointerCapture" | "onGotPointerCaptureCapture" | "onLostPointerCapture" | "onLostPointerCaptureCapture" | "onScroll" | "onScrollCapture" | "onWheel" | "onWheelCapture" | "onAnimationStart" | "onAnimationStartCapture" | "onAnimationEnd" | "onAnimationEndCapture" | "onAnimationIteration" | "onAnimationIterationCapture" | "onTransitionEnd" | "onTransitionEndCapture" | "defaultChecked" | "defaultValue" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "accessKey" | "contentEditable" | "contextMenu" | "draggable" | "placeholder" | "spellCheck" | "radioGroup" | "about" | "datatype" | "inlist" | "property" | "resource" | "typeof" | "vocab" | "autoCapitalize" | "autoCorrect" | "autoSave" | "itemProp" | "itemScope" | "itemType" | "itemID" | "itemRef" | "results" | "security" | "unselectable" | "inputMode" | "is" | "onClose" | "settlingHeight" | "dynamicContentHeight" | "getModalContentRef"> & import("../AdaptivityProvider/AdaptivityContext").SizeProps>;
|
|
21
|
+
declare const _default: React.FC<Pick<ModalPageProps & AdaptivityContextInterface, "hidden" | "dir" | "header" | "nav" | "slot" | "style" | "title" | "color" | "translate" | "prefix" | "children" | "className" | "id" | "lang" | "role" | "tabIndex" | "aria-activedescendant" | "aria-atomic" | "aria-autocomplete" | "aria-busy" | "aria-checked" | "aria-colcount" | "aria-colindex" | "aria-colspan" | "aria-controls" | "aria-current" | "aria-describedby" | "aria-details" | "aria-disabled" | "aria-dropeffect" | "aria-errormessage" | "aria-expanded" | "aria-flowto" | "aria-grabbed" | "aria-haspopup" | "aria-hidden" | "aria-invalid" | "aria-keyshortcuts" | "aria-label" | "aria-labelledby" | "aria-level" | "aria-live" | "aria-modal" | "aria-multiline" | "aria-multiselectable" | "aria-orientation" | "aria-owns" | "aria-placeholder" | "aria-posinset" | "aria-pressed" | "aria-readonly" | "aria-relevant" | "aria-required" | "aria-roledescription" | "aria-rowcount" | "aria-rowindex" | "aria-rowspan" | "aria-selected" | "aria-setsize" | "aria-sort" | "aria-valuemax" | "aria-valuemin" | "aria-valuenow" | "aria-valuetext" | "dangerouslySetInnerHTML" | "onCopy" | "onCopyCapture" | "onCut" | "onCutCapture" | "onPaste" | "onPasteCapture" | "onCompositionEnd" | "onCompositionEndCapture" | "onCompositionStart" | "onCompositionStartCapture" | "onCompositionUpdate" | "onCompositionUpdateCapture" | "onFocus" | "onFocusCapture" | "onBlur" | "onBlurCapture" | "onChange" | "onChangeCapture" | "onBeforeInput" | "onBeforeInputCapture" | "onInput" | "onInputCapture" | "onReset" | "onResetCapture" | "onSubmit" | "onSubmitCapture" | "onInvalid" | "onInvalidCapture" | "onLoad" | "onLoadCapture" | "onError" | "onErrorCapture" | "onKeyDown" | "onKeyDownCapture" | "onKeyPress" | "onKeyPressCapture" | "onKeyUp" | "onKeyUpCapture" | "onAbort" | "onAbortCapture" | "onCanPlay" | "onCanPlayCapture" | "onCanPlayThrough" | "onCanPlayThroughCapture" | "onDurationChange" | "onDurationChangeCapture" | "onEmptied" | "onEmptiedCapture" | "onEncrypted" | "onEncryptedCapture" | "onEnded" | "onEndedCapture" | "onLoadedData" | "onLoadedDataCapture" | "onLoadedMetadata" | "onLoadedMetadataCapture" | "onLoadStart" | "onLoadStartCapture" | "onPause" | "onPauseCapture" | "onPlay" | "onPlayCapture" | "onPlaying" | "onPlayingCapture" | "onProgress" | "onProgressCapture" | "onRateChange" | "onRateChangeCapture" | "onSeeked" | "onSeekedCapture" | "onSeeking" | "onSeekingCapture" | "onStalled" | "onStalledCapture" | "onSuspend" | "onSuspendCapture" | "onTimeUpdate" | "onTimeUpdateCapture" | "onVolumeChange" | "onVolumeChangeCapture" | "onWaiting" | "onWaitingCapture" | "onAuxClick" | "onAuxClickCapture" | "onClick" | "onClickCapture" | "onContextMenu" | "onContextMenuCapture" | "onDoubleClick" | "onDoubleClickCapture" | "onDrag" | "onDragCapture" | "onDragEnd" | "onDragEndCapture" | "onDragEnter" | "onDragEnterCapture" | "onDragExit" | "onDragExitCapture" | "onDragLeave" | "onDragLeaveCapture" | "onDragOver" | "onDragOverCapture" | "onDragStart" | "onDragStartCapture" | "onDrop" | "onDropCapture" | "onMouseDown" | "onMouseDownCapture" | "onMouseEnter" | "onMouseLeave" | "onMouseMove" | "onMouseMoveCapture" | "onMouseOut" | "onMouseOutCapture" | "onMouseOver" | "onMouseOverCapture" | "onMouseUp" | "onMouseUpCapture" | "onSelect" | "onSelectCapture" | "onTouchCancel" | "onTouchCancelCapture" | "onTouchEnd" | "onTouchEndCapture" | "onTouchMove" | "onTouchMoveCapture" | "onTouchStart" | "onTouchStartCapture" | "onPointerDown" | "onPointerDownCapture" | "onPointerMove" | "onPointerMoveCapture" | "onPointerUp" | "onPointerUpCapture" | "onPointerCancel" | "onPointerCancelCapture" | "onPointerEnter" | "onPointerEnterCapture" | "onPointerLeave" | "onPointerLeaveCapture" | "onPointerOver" | "onPointerOverCapture" | "onPointerOut" | "onPointerOutCapture" | "onGotPointerCapture" | "onGotPointerCaptureCapture" | "onLostPointerCapture" | "onLostPointerCaptureCapture" | "onScroll" | "onScrollCapture" | "onWheel" | "onWheelCapture" | "onAnimationStart" | "onAnimationStartCapture" | "onAnimationEnd" | "onAnimationEndCapture" | "onAnimationIteration" | "onAnimationIterationCapture" | "onTransitionEnd" | "onTransitionEndCapture" | "defaultChecked" | "defaultValue" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "accessKey" | "contentEditable" | "contextMenu" | "draggable" | "placeholder" | "spellCheck" | "radioGroup" | "about" | "datatype" | "inlist" | "property" | "resource" | "typeof" | "vocab" | "autoCapitalize" | "autoCorrect" | "autoSave" | "itemProp" | "itemScope" | "itemType" | "itemID" | "itemRef" | "results" | "security" | "unselectable" | "inputMode" | "is" | "onClose" | "settlingHeight" | "dynamicContentHeight" | "getModalContentRef"> & import("../AdaptivityProvider/AdaptivityContext").SizeProps>;
|
|
22
22
|
export default _default;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/components/ModalPage/ModalPage.tsx"],"names":["React","getClassName","classNames","ModalRootContext","useModalRegistry","usePlatform","withAdaptivity","ViewHeight","ViewWidth","ModalDismissButton","multiRef","ModalType","getNavId","warnOnce","warn","ModalPage","props","platform","useContext","updateModalHeight","children","header","viewWidth","viewHeight","sizeX","hasMouse","onClose","settlingHeight","dynamicContentHeight","getModalContentRef","nav","restProps","useEffect","isDesktop","SMALL_TABLET","MEDIUM","canShowCloseBtn","modalContext","PAGE","refs","innerElement","headerElement","contentElement","defaultProps"],"mappings":";;;;AAAA,OAAO,KAAKA,KAAZ,MAAuB,OAAvB;AACA,SAASC,YAAT;AACA,SAASC,UAAT;AACA,SACEC,gBADF,EAEEC,gBAFF;AAIA,SAASC,WAAT;AACA,SACEC,cADF,EAEEC,UAFF,EAGEC,SAHF;
|
|
1
|
+
{"version":3,"sources":["../../../src/components/ModalPage/ModalPage.tsx"],"names":["React","getClassName","classNames","ModalRootContext","useModalRegistry","usePlatform","withAdaptivity","ViewHeight","ViewWidth","ModalDismissButton","multiRef","ModalType","getNavId","warnOnce","warn","ModalPage","props","platform","useContext","updateModalHeight","children","header","viewWidth","viewHeight","sizeX","hasMouse","onClose","settlingHeight","dynamicContentHeight","getModalContentRef","nav","restProps","useEffect","isDesktop","SMALL_TABLET","MEDIUM","canShowCloseBtn","modalContext","PAGE","refs","innerElement","headerElement","contentElement","defaultProps"],"mappings":";;;;AAAA,OAAO,KAAKA,KAAZ,MAAuB,OAAvB;AACA,SAASC,YAAT;AACA,SAASC,UAAT;AACA,SACEC,gBADF,EAEEC,gBAFF;AAIA,SAASC,WAAT;AACA,SACEC,cADF,EAEEC,UAFF,EAGEC,SAHF;AASA,OAAOC,kBAAP;AACA,SAASC,QAAT;AACA,SAASC,SAAT;AACA,SAASC,QAAT;AACA,SAASC,QAAT;AAuBA,IAAMC,IAAI,GAAGD,QAAQ,CAAC,WAAD,CAArB;;AACA,IAAME,SAAgE,GAAG,SAAnEA,SAAmE,CACvEC,KADuE,EAEpE;AACH,MAAMC,QAAQ,GAAGZ,WAAW,EAA5B;;AACA,0BAA8B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CADO,6BAECO,KAFD,GAGnB;AACE,4BAAsBS;AADxB,KAHmB;AAFvB,MAUE;AAAK,IAAA,SAAS,EAAC,oBAAf;AAAoC,IAAA,GAAG,EAAEM,IAAI,CAACC;AAA9C,KACE;AAAK,IAAA,SAAS,EAAC;AAAf,KACE;AAAK,IAAA,SAAS,EAAC,mBAAf;AAAmC,IAAA,GAAG,EAAED,IAAI,CAACE;AAA7C,KACGpB,MADH,CADF,EAKE;AAAK,IAAA,SAAS,EAAC;AAAf,KACE;AACE,IAAA,SAAS,EAAC,oBADZ;AAEE,IAAA,GAAG,EAAEX,QAAQ,CACX6B,IAAI,CAACG,cADM,EAEXb,kBAFW;AAFf,KAOE;AAAK,IAAA,SAAS,EAAC;AAAf,KAAwCT,QAAxC,CAPF,CADF,CALF,EAgBGgB,eAAe,IACd,oBAAC,kBAAD;AAAoB,IAAA,OAAO,EAAEV,OAAO,IAAIW,YAAY,CAACX;AAArD,IAjBJ,CADF,CAVF,CADF;AAmCD,CAnED;;AAqEAX,SAAS,CAAC4B,YAAV,GAAyB;AACvBhB,EAAAA,cAAc,EAAE;AADO,CAAzB,C,CAIA;;AACA,eAAerB,cAAc,CAACS,SAAD,EAAY;AACvCO,EAAAA,SAAS,EAAE,IAD4B;AAEvCC,EAAAA,UAAU,EAAE,IAF2B;AAGvCC,EAAAA,KAAK,EAAE,IAHgC;AAIvCC,EAAAA,QAAQ,EAAE;AAJ6B,CAAZ,CAA7B","sourcesContent":["import * as React from \"react\";\nimport { getClassName } from \"../../helpers/getClassName\";\nimport { classNames } from \"../../lib/classNames\";\nimport {\n ModalRootContext,\n useModalRegistry,\n} from \"../ModalRoot/ModalRootContext\";\nimport { usePlatform } from \"../../hooks/usePlatform\";\nimport {\n withAdaptivity,\n ViewHeight,\n ViewWidth,\n} from \"../../hoc/withAdaptivity\";\nimport {\n AdaptivityContextInterface,\n AdaptivityProps,\n} from \"../AdaptivityProvider/AdaptivityContext\";\nimport ModalDismissButton from \"../ModalDismissButton/ModalDismissButton\";\nimport { multiRef } from \"../../lib/utils\";\nimport { ModalType } from \"../ModalRoot/types\";\nimport { getNavId, NavIdProps } from \"../../lib/getNavId\";\nimport { warnOnce } from \"../../lib/warnOnce\";\nimport \"./ModalPage.css\";\n\nexport interface ModalPageProps\n extends React.HTMLAttributes<HTMLDivElement>,\n AdaptivityProps,\n NavIdProps {\n /**\n * Шапка модальной страницы, `<ModalPageHeader />`\n */\n header?: React.ReactNode;\n onClose?: VoidFunction;\n /**\n * Процент, на который изначально будет открыта модальная страница. При `settlingHeight={100}` модальная страница раскрывается на всю высоту.\n */\n settlingHeight?: number;\n /**\n * Если высота контента в модальной странице может поменяться, нужно установить это свойство\n */\n dynamicContentHeight?: boolean;\n getModalContentRef?: React.Ref<HTMLDivElement>;\n}\n\nconst warn = warnOnce(\"ModalPage\");\nconst ModalPage: React.FC<ModalPageProps & AdaptivityContextInterface> = (\n props\n) => {\n const platform = usePlatform();\n const { updateModalHeight } = React.useContext(ModalRootContext);\n const {\n children,\n header,\n viewWidth,\n viewHeight,\n sizeX,\n hasMouse,\n onClose,\n settlingHeight,\n dynamicContentHeight,\n getModalContentRef,\n nav,\n ...restProps\n } = props;\n\n React.useEffect(() => {\n updateModalHeight();\n }, [children, updateModalHeight]);\n\n const isDesktop =\n viewWidth >= ViewWidth.SMALL_TABLET &&\n (hasMouse || viewHeight >= ViewHeight.MEDIUM);\n const canShowCloseBtn = viewWidth >= ViewWidth.SMALL_TABLET;\n\n const modalContext = React.useContext(ModalRootContext);\n const { refs } = useModalRegistry(getNavId(props, warn), ModalType.PAGE);\n\n return (\n <div\n {...restProps}\n vkuiClass={classNames(\n getClassName(\"ModalPage\", platform),\n `ModalPage--sizeX-${sizeX}`,\n {\n \"ModalPage--desktop\": isDesktop,\n }\n )}\n >\n <div vkuiClass=\"ModalPage__in-wrap\" ref={refs.innerElement}>\n <div vkuiClass=\"ModalPage__in\">\n <div vkuiClass=\"ModalPage__header\" ref={refs.headerElement}>\n {header}\n </div>\n\n <div vkuiClass=\"ModalPage__content-wrap\">\n <div\n vkuiClass=\"ModalPage__content\"\n ref={multiRef<HTMLDivElement>(\n refs.contentElement,\n getModalContentRef\n )}\n >\n <div vkuiClass=\"ModalPage__content-in\">{children}</div>\n </div>\n </div>\n {canShowCloseBtn && (\n <ModalDismissButton onClick={onClose || modalContext.onClose} />\n )}\n </div>\n </div>\n </div>\n );\n};\n\nModalPage.defaultProps = {\n settlingHeight: 75,\n};\n\n// eslint-disable-next-line import/no-default-export\nexport default withAdaptivity(ModalPage, {\n viewWidth: true,\n viewHeight: true,\n sizeX: true,\n hasMouse: true,\n});\n"],"file":"ModalPage.js"}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
|
-
import { AdaptivityContextInterface } from "../AdaptivityProvider/AdaptivityContext";
|
|
3
|
-
export interface ModalRootProps extends
|
|
2
|
+
import { AdaptivityContextInterface, AdaptivityProps } from "../AdaptivityProvider/AdaptivityContext";
|
|
3
|
+
export interface ModalRootProps extends AdaptivityProps {
|
|
4
4
|
activeModal?: string | null;
|
|
5
5
|
/**
|
|
6
6
|
* Будет вызвано при закрытии активной модалки с её id
|
|
7
7
|
*/
|
|
8
8
|
onClose?: (modalId: string) => void;
|
|
9
9
|
}
|
|
10
|
-
export declare const ModalRoot: React.FC<Pick<ModalRootProps, "onClose" | "activeModal"> & import("../AdaptivityProvider/AdaptivityContext").SizeProps>;
|
|
10
|
+
export declare const ModalRoot: React.FC<Pick<ModalRootProps & AdaptivityContextInterface, "onClose" | "activeModal"> & import("../AdaptivityProvider/AdaptivityContext").SizeProps>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/components/ModalRoot/ModalRootAdaptive.tsx"],"names":["withAdaptivity","ViewHeight","ViewWidth","ModalRootTouch","ModalRootDesktop","ModalRootComponent","props","viewWidth","viewHeight","hasMouse","isDesktop","SMALL_TABLET","MEDIUM","RootComponent","displayName","ModalRoot"],"mappings":";AACA,SACEA,cADF,EAEEC,UAFF,EAGEC,SAHF;AAKA,SAASC,cAAT;AACA,SAASC,gBAAT;;
|
|
1
|
+
{"version":3,"sources":["../../../src/components/ModalRoot/ModalRootAdaptive.tsx"],"names":["withAdaptivity","ViewHeight","ViewWidth","ModalRootTouch","ModalRootDesktop","ModalRootComponent","props","viewWidth","viewHeight","hasMouse","isDesktop","SMALL_TABLET","MEDIUM","RootComponent","displayName","ModalRoot"],"mappings":";AACA,SACEA,cADF,EAEEC,UAFF,EAGEC,SAHF;AAKA,SAASC,cAAT;AACA,SAASC,gBAAT;;AAeA,IAAMC,kBAEL,GAAG,SAFEA,kBAEF,CAACC,KAAD,EAAW;AACb,MAAQC,SAAR,GAA4CD,KAA5C,CAAQC,SAAR;AAAA,MAAmBC,UAAnB,GAA4CF,KAA5C,CAAmBE,UAAnB;AAAA,MAA+BC,QAA/B,GAA4CH,KAA5C,CAA+BG,QAA/B;AACA,MAAMC,SAAS,GACbH,SAAS,IAAIL,SAAS,CAACS,YAAvB,KACCF,QAAQ,IAAID,UAAU,IAAIP,UAAU,CAACW,MADtC,CADF;AAIA,MAAMC,aAAa,GAAGH,SAAS,GAAGN,gBAAH,GAAsBD,cAArD;AAEA,SAAO,oBAAC,aAAD,EAAmBG,KAAnB,CAAP;AACD,CAXD;;AAaAD,kBAAkB,CAACS,WAAnB,GAAiC,WAAjC;AAEA,OAAO,IAAMC,SAAS,GAAGf,cAAc,CAACK,kBAAD,EAAqB;AAC1DE,EAAAA,SAAS,EAAE,IAD+C;AAE1DC,EAAAA,UAAU,EAAE,IAF8C;AAG1DC,EAAAA,QAAQ,EAAE;AAHgD,CAArB,CAAhC","sourcesContent":["import * as React from \"react\";\nimport {\n withAdaptivity,\n ViewHeight,\n ViewWidth,\n} from \"../../hoc/withAdaptivity\";\nimport { ModalRootTouch } from \"./ModalRoot\";\nimport { ModalRootDesktop } from \"./ModalRootDesktop\";\nimport {\n AdaptivityContextInterface,\n AdaptivityProps,\n} from \"../AdaptivityProvider/AdaptivityContext\";\n\nexport interface ModalRootProps extends AdaptivityProps {\n activeModal?: string | null;\n\n /**\n * Будет вызвано при закрытии активной модалки с её id\n */\n onClose?: (modalId: string) => void;\n}\n\nconst ModalRootComponent: React.FC<\n ModalRootProps & AdaptivityContextInterface\n> = (props) => {\n const { viewWidth, viewHeight, hasMouse } = props;\n const isDesktop =\n viewWidth >= ViewWidth.SMALL_TABLET &&\n (hasMouse || viewHeight >= ViewHeight.MEDIUM);\n\n const RootComponent = isDesktop ? ModalRootDesktop : ModalRootTouch;\n\n return <RootComponent {...props} />;\n};\n\nModalRootComponent.displayName = \"ModalRoot\";\n\nexport const ModalRoot = withAdaptivity(ModalRootComponent, {\n viewWidth: true,\n viewHeight: true,\n hasMouse: true,\n});\n"],"file":"ModalRootAdaptive.js"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
2
|
import { ModalRootContextInterface } from "./ModalRootContext";
|
|
3
3
|
declare type PickedProps = Pick<ModalRootContextInterface, "updateModalHeight">;
|
|
4
|
-
export declare function withModalRootContext<P extends PickedProps>(Component: React.ComponentType<P>): React.ComponentType<P
|
|
4
|
+
export declare function withModalRootContext<P extends PickedProps>(Component: React.ComponentType<P>): React.ComponentType<Omit<P, keyof PickedProps>>;
|
|
5
5
|
export {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/components/ModalRoot/withModalRootContext.tsx"],"names":["React","ModalRootContext","withModalRootContext","Component","WithModalRootContext","props","useContext","updateModalHeight"],"mappings":";;AAAA,OAAO,KAAKA,KAAZ,MAAuB,OAAvB;AACA,OAAOC,gBAAP;AAMA,OAAO,SAASC,oBAAT,CACLC,SADK,
|
|
1
|
+
{"version":3,"sources":["../../../src/components/ModalRoot/withModalRootContext.tsx"],"names":["React","ModalRootContext","withModalRootContext","Component","WithModalRootContext","props","useContext","updateModalHeight"],"mappings":";;AAAA,OAAO,KAAKA,KAAZ,MAAuB,OAAvB;AACA,OAAOC,gBAAP;AAMA,OAAO,SAASC,oBAAT,CACLC,SADK,EAE4C;AACjD,WAASC,oBAAT,CAA8BC,KAA9B,EAAiE;AAC/D,4BAA8BL,KAAK,CAACM,UAAN,CAAiBL,gBAAjB,CAA9B;AAAA,QAAQM,iBAAR,qBAAQA,iBAAR;;AAEA,WACE,oBAAC,SAAD,eAAgBF,KAAhB;AAA6B,MAAA,iBAAiB,EAAEE;AAAhD,OADF;AAGD;;AACD,SAAOH,oBAAP;AACD","sourcesContent":["import * as React from \"react\";\nimport ModalRootContext, {\n ModalRootContextInterface,\n} from \"./ModalRootContext\";\n\ntype PickedProps = Pick<ModalRootContextInterface, \"updateModalHeight\">;\n\nexport function withModalRootContext<P extends PickedProps>(\n Component: React.ComponentType<P>\n): React.ComponentType<Omit<P, keyof PickedProps>> {\n function WithModalRootContext(props: Omit<P, keyof PickedProps>) {\n const { updateModalHeight } = React.useContext(ModalRootContext);\n\n return (\n <Component {...(props as P)} updateModalHeight={updateModalHeight} />\n );\n }\n return WithModalRootContext;\n}\n"],"file":"withModalRootContext.js"}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
2
|
import { HasAlign, HasRef, HasRootRef } from "../../types";
|
|
3
|
-
import { AdaptivityContextInterface } from "../AdaptivityProvider/AdaptivityContext";
|
|
3
|
+
import { AdaptivityContextInterface, AdaptivityProps } from "../AdaptivityProvider/AdaptivityContext";
|
|
4
4
|
import "../Select/Select.css";
|
|
5
|
-
export interface NativeSelectProps extends React.SelectHTMLAttributes<HTMLSelectElement>, HasRef<HTMLSelectElement>, HasRootRef<HTMLLabelElement>, HasAlign,
|
|
5
|
+
export interface NativeSelectProps extends React.SelectHTMLAttributes<HTMLSelectElement>, HasRef<HTMLSelectElement>, HasRootRef<HTMLLabelElement>, HasAlign, AdaptivityProps {
|
|
6
6
|
placeholder?: string;
|
|
7
7
|
multiline?: boolean;
|
|
8
8
|
}
|
|
@@ -11,5 +11,5 @@ export interface SelectState {
|
|
|
11
11
|
title?: string;
|
|
12
12
|
notSelected?: boolean;
|
|
13
13
|
}
|
|
14
|
-
declare const _default: React.FC<Pick<NativeSelectProps, "required" | "disabled" | "hidden" | "dir" | "form" | "slot" | "style" | "title" | "color" | "size" | "multiple" | "translate" | "prefix" | "children" | "className" | "id" | "lang" | "name" | "role" | "tabIndex" | "aria-activedescendant" | "aria-atomic" | "aria-autocomplete" | "aria-busy" | "aria-checked" | "aria-colcount" | "aria-colindex" | "aria-colspan" | "aria-controls" | "aria-current" | "aria-describedby" | "aria-details" | "aria-disabled" | "aria-dropeffect" | "aria-errormessage" | "aria-expanded" | "aria-flowto" | "aria-grabbed" | "aria-haspopup" | "aria-hidden" | "aria-invalid" | "aria-keyshortcuts" | "aria-label" | "aria-labelledby" | "aria-level" | "aria-live" | "aria-modal" | "aria-multiline" | "aria-multiselectable" | "aria-orientation" | "aria-owns" | "aria-placeholder" | "aria-posinset" | "aria-pressed" | "aria-readonly" | "aria-relevant" | "aria-required" | "aria-roledescription" | "aria-rowcount" | "aria-rowindex" | "aria-rowspan" | "aria-selected" | "aria-setsize" | "aria-sort" | "aria-valuemax" | "aria-valuemin" | "aria-valuenow" | "aria-valuetext" | "dangerouslySetInnerHTML" | "onCopy" | "onCopyCapture" | "onCut" | "onCutCapture" | "onPaste" | "onPasteCapture" | "onCompositionEnd" | "onCompositionEndCapture" | "onCompositionStart" | "onCompositionStartCapture" | "onCompositionUpdate" | "onCompositionUpdateCapture" | "onFocus" | "onFocusCapture" | "onBlur" | "onBlurCapture" | "onChange" | "onChangeCapture" | "onBeforeInput" | "onBeforeInputCapture" | "onInput" | "onInputCapture" | "onReset" | "onResetCapture" | "onSubmit" | "onSubmitCapture" | "onInvalid" | "onInvalidCapture" | "onLoad" | "onLoadCapture" | "onError" | "onErrorCapture" | "onKeyDown" | "onKeyDownCapture" | "onKeyPress" | "onKeyPressCapture" | "onKeyUp" | "onKeyUpCapture" | "onAbort" | "onAbortCapture" | "onCanPlay" | "onCanPlayCapture" | "onCanPlayThrough" | "onCanPlayThroughCapture" | "onDurationChange" | "onDurationChangeCapture" | "onEmptied" | "onEmptiedCapture" | "onEncrypted" | "onEncryptedCapture" | "onEnded" | "onEndedCapture" | "onLoadedData" | "onLoadedDataCapture" | "onLoadedMetadata" | "onLoadedMetadataCapture" | "onLoadStart" | "onLoadStartCapture" | "onPause" | "onPauseCapture" | "onPlay" | "onPlayCapture" | "onPlaying" | "onPlayingCapture" | "onProgress" | "onProgressCapture" | "onRateChange" | "onRateChangeCapture" | "onSeeked" | "onSeekedCapture" | "onSeeking" | "onSeekingCapture" | "onStalled" | "onStalledCapture" | "onSuspend" | "onSuspendCapture" | "onTimeUpdate" | "onTimeUpdateCapture" | "onVolumeChange" | "onVolumeChangeCapture" | "onWaiting" | "onWaitingCapture" | "onAuxClick" | "onAuxClickCapture" | "onClick" | "onClickCapture" | "onContextMenu" | "onContextMenuCapture" | "onDoubleClick" | "onDoubleClickCapture" | "onDrag" | "onDragCapture" | "onDragEnd" | "onDragEndCapture" | "onDragEnter" | "onDragEnterCapture" | "onDragExit" | "onDragExitCapture" | "onDragLeave" | "onDragLeaveCapture" | "onDragOver" | "onDragOverCapture" | "onDragStart" | "onDragStartCapture" | "onDrop" | "onDropCapture" | "onMouseDown" | "onMouseDownCapture" | "onMouseEnter" | "onMouseLeave" | "onMouseMove" | "onMouseMoveCapture" | "onMouseOut" | "onMouseOutCapture" | "onMouseOver" | "onMouseOverCapture" | "onMouseUp" | "onMouseUpCapture" | "onSelect" | "onSelectCapture" | "onTouchCancel" | "onTouchCancelCapture" | "onTouchEnd" | "onTouchEndCapture" | "onTouchMove" | "onTouchMoveCapture" | "onTouchStart" | "onTouchStartCapture" | "onPointerDown" | "onPointerDownCapture" | "onPointerMove" | "onPointerMoveCapture" | "onPointerUp" | "onPointerUpCapture" | "onPointerCancel" | "onPointerCancelCapture" | "onPointerEnter" | "onPointerEnterCapture" | "onPointerLeave" | "onPointerLeaveCapture" | "onPointerOver" | "onPointerOverCapture" | "onPointerOut" | "onPointerOutCapture" | "onGotPointerCapture" | "onGotPointerCaptureCapture" | "onLostPointerCapture" | "onLostPointerCaptureCapture" | "onScroll" | "onScrollCapture" | "onWheel" | "onWheelCapture" | "onAnimationStart" | "onAnimationStartCapture" | "onAnimationEnd" | "onAnimationEndCapture" | "onAnimationIteration" | "onAnimationIterationCapture" | "onTransitionEnd" | "onTransitionEndCapture" | "defaultChecked" | "defaultValue" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "accessKey" | "contentEditable" | "contextMenu" | "draggable" | "placeholder" | "spellCheck" | "radioGroup" | "about" | "datatype" | "inlist" | "property" | "resource" | "typeof" | "vocab" | "autoCapitalize" | "autoCorrect" | "autoSave" | "itemProp" | "itemScope" | "itemType" | "itemID" | "itemRef" | "results" | "security" | "unselectable" | "inputMode" | "is" | "value" | "autoFocus" | "autoComplete" | "align" | "getRootRef" | "getRef" | "multiline"> & import("../AdaptivityProvider/AdaptivityContext").SizeProps>;
|
|
14
|
+
declare const _default: React.FC<Pick<NativeSelectProps & AdaptivityContextInterface, "required" | "disabled" | "hidden" | "dir" | "form" | "slot" | "style" | "title" | "color" | "size" | "multiple" | "translate" | "prefix" | "children" | "className" | "id" | "lang" | "name" | "role" | "tabIndex" | "aria-activedescendant" | "aria-atomic" | "aria-autocomplete" | "aria-busy" | "aria-checked" | "aria-colcount" | "aria-colindex" | "aria-colspan" | "aria-controls" | "aria-current" | "aria-describedby" | "aria-details" | "aria-disabled" | "aria-dropeffect" | "aria-errormessage" | "aria-expanded" | "aria-flowto" | "aria-grabbed" | "aria-haspopup" | "aria-hidden" | "aria-invalid" | "aria-keyshortcuts" | "aria-label" | "aria-labelledby" | "aria-level" | "aria-live" | "aria-modal" | "aria-multiline" | "aria-multiselectable" | "aria-orientation" | "aria-owns" | "aria-placeholder" | "aria-posinset" | "aria-pressed" | "aria-readonly" | "aria-relevant" | "aria-required" | "aria-roledescription" | "aria-rowcount" | "aria-rowindex" | "aria-rowspan" | "aria-selected" | "aria-setsize" | "aria-sort" | "aria-valuemax" | "aria-valuemin" | "aria-valuenow" | "aria-valuetext" | "dangerouslySetInnerHTML" | "onCopy" | "onCopyCapture" | "onCut" | "onCutCapture" | "onPaste" | "onPasteCapture" | "onCompositionEnd" | "onCompositionEndCapture" | "onCompositionStart" | "onCompositionStartCapture" | "onCompositionUpdate" | "onCompositionUpdateCapture" | "onFocus" | "onFocusCapture" | "onBlur" | "onBlurCapture" | "onChange" | "onChangeCapture" | "onBeforeInput" | "onBeforeInputCapture" | "onInput" | "onInputCapture" | "onReset" | "onResetCapture" | "onSubmit" | "onSubmitCapture" | "onInvalid" | "onInvalidCapture" | "onLoad" | "onLoadCapture" | "onError" | "onErrorCapture" | "onKeyDown" | "onKeyDownCapture" | "onKeyPress" | "onKeyPressCapture" | "onKeyUp" | "onKeyUpCapture" | "onAbort" | "onAbortCapture" | "onCanPlay" | "onCanPlayCapture" | "onCanPlayThrough" | "onCanPlayThroughCapture" | "onDurationChange" | "onDurationChangeCapture" | "onEmptied" | "onEmptiedCapture" | "onEncrypted" | "onEncryptedCapture" | "onEnded" | "onEndedCapture" | "onLoadedData" | "onLoadedDataCapture" | "onLoadedMetadata" | "onLoadedMetadataCapture" | "onLoadStart" | "onLoadStartCapture" | "onPause" | "onPauseCapture" | "onPlay" | "onPlayCapture" | "onPlaying" | "onPlayingCapture" | "onProgress" | "onProgressCapture" | "onRateChange" | "onRateChangeCapture" | "onSeeked" | "onSeekedCapture" | "onSeeking" | "onSeekingCapture" | "onStalled" | "onStalledCapture" | "onSuspend" | "onSuspendCapture" | "onTimeUpdate" | "onTimeUpdateCapture" | "onVolumeChange" | "onVolumeChangeCapture" | "onWaiting" | "onWaitingCapture" | "onAuxClick" | "onAuxClickCapture" | "onClick" | "onClickCapture" | "onContextMenu" | "onContextMenuCapture" | "onDoubleClick" | "onDoubleClickCapture" | "onDrag" | "onDragCapture" | "onDragEnd" | "onDragEndCapture" | "onDragEnter" | "onDragEnterCapture" | "onDragExit" | "onDragExitCapture" | "onDragLeave" | "onDragLeaveCapture" | "onDragOver" | "onDragOverCapture" | "onDragStart" | "onDragStartCapture" | "onDrop" | "onDropCapture" | "onMouseDown" | "onMouseDownCapture" | "onMouseEnter" | "onMouseLeave" | "onMouseMove" | "onMouseMoveCapture" | "onMouseOut" | "onMouseOutCapture" | "onMouseOver" | "onMouseOverCapture" | "onMouseUp" | "onMouseUpCapture" | "onSelect" | "onSelectCapture" | "onTouchCancel" | "onTouchCancelCapture" | "onTouchEnd" | "onTouchEndCapture" | "onTouchMove" | "onTouchMoveCapture" | "onTouchStart" | "onTouchStartCapture" | "onPointerDown" | "onPointerDownCapture" | "onPointerMove" | "onPointerMoveCapture" | "onPointerUp" | "onPointerUpCapture" | "onPointerCancel" | "onPointerCancelCapture" | "onPointerEnter" | "onPointerEnterCapture" | "onPointerLeave" | "onPointerLeaveCapture" | "onPointerOver" | "onPointerOverCapture" | "onPointerOut" | "onPointerOutCapture" | "onGotPointerCapture" | "onGotPointerCaptureCapture" | "onLostPointerCapture" | "onLostPointerCaptureCapture" | "onScroll" | "onScrollCapture" | "onWheel" | "onWheelCapture" | "onAnimationStart" | "onAnimationStartCapture" | "onAnimationEnd" | "onAnimationEndCapture" | "onAnimationIteration" | "onAnimationIterationCapture" | "onTransitionEnd" | "onTransitionEndCapture" | "defaultChecked" | "defaultValue" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "accessKey" | "contentEditable" | "contextMenu" | "draggable" | "placeholder" | "spellCheck" | "radioGroup" | "about" | "datatype" | "inlist" | "property" | "resource" | "typeof" | "vocab" | "autoCapitalize" | "autoCorrect" | "autoSave" | "itemProp" | "itemScope" | "itemType" | "itemID" | "itemRef" | "results" | "security" | "unselectable" | "inputMode" | "is" | "value" | "autoFocus" | "autoComplete" | "align" | "getRootRef" | "getRef" | "multiline"> & import("../AdaptivityProvider/AdaptivityContext").SizeProps>;
|
|
15
15
|
export default _default;
|