0.8.11 • Published 2 years ago

uxcore-dialog v0.8.11

Weekly downloads
26
License
MIT
Repository
github
Last release
2 years ago

uxcore-dialog

Dialog Component base on React.

NPM version build status Test Coverage Dependency Status devDependency Status NPM downloads Sauce Test Status

Development

git clone https://github.com/uxcore/uxcore-dialog
cd uxcore-dialog
npm install
npm run server

if you'd like to save your install time,you can use uxcore-tools globally.

npm install uxcore-tools -g
git clone https://github.com/uxcore/uxcore-dialog
cd uxcore-dialog
npm install
npm run dep
npm run start

Test Case

npm run test

Coverage

npm run coverage

Demo

http://uxcore.github.io/components/dialog

API

参数说明类型默认值
titleTitle of the dialogStringReact.Element
visiblecurrent dialog's visible statusBooleanfalse
mousePositionset pageX and pageY of current mouse(it will cause transform origin to be set).{x:number,y:number}
onOkthe callback when ok clickedfunction
onCancelthe callback when dialog closedfunction
widthdialog widthString or Number520
footerfooter of the dialogReact.Element
closablewhether show close button and click mask to closeBooleantrue
maskClosablewhether click mask to close, this prop will be ignored if set closable prop to falseBooleanfalse
locale国际化(包括 zh-cn, en-us, 和 pl-pl)Stringzh-cn
classNameadditional className for dialogstring
wrapClassNameadditional className for dialog wrapstringvertical-center-dailog for vertical align the dialog
styleRoot style for dialog element.Such as width, heightObject{}
zIndexNumber
bodyStylebody style for dialog body element.Such as heightNumber{}
htmlClassNamethe className added to html element when dialog is visibleString''
draggabledrag title for resetting the position of dialogBooleanfalse

Dialog.xxx()

包括:

  • Dialog.info
  • Dialog.success
  • Dialog.error
  • Dialog.confirm

以上均为一个函数,参数为 object,具体属性如下:

参数说明类型默认值
title标题React.Element or String
onOk点击确定回调,参数为关闭函数,返回 promise 时 resolve 后自动关闭function
onCancel取消回调,参数为关闭函数,返回 promise 时 resolve 后自动关闭function
width宽度String or Number416
buttonSize按钮的尺寸,'small', 'medium', 'large' 三种可选String'medium'
icon自定义图标,可以自定义样式推荐使用Icon Elementuxcore-icon 的实例,http://uxco.re/components/icon/
iconClassName图标样式名Stringkuma-icon-caution
timer弹框自动关闭, 2000表示2s以后关闭Number, false or nullfalse
htmlClassNamethe className added to html element when dialog is visibleString''
okText确认按钮文字 , 0.7.1 版本后支持string-
cancelText取消按钮文字 , 0.7.1 版本后支持string-

返回值为一个object,具体属性如下:

  • close : 一个用于关闭当前dialog的function

    使用方法:

 const myConfirm = Dialog.confirm({title: '这里是标题'},)
 myConfirm.close() // 关闭当前对话框
0.8.11

2 years ago

0.8.10

2 years ago

0.8.9

5 years ago

0.8.8

6 years ago

0.8.7

6 years ago

0.8.6

6 years ago

0.8.5

7 years ago

0.8.4

7 years ago

0.8.3

7 years ago

0.8.2

7 years ago

0.8.1

7 years ago

0.8.0

7 years ago

0.7.13

7 years ago

0.7.12

7 years ago

0.7.11

7 years ago

0.7.10

7 years ago

0.7.9

7 years ago

0.7.8

7 years ago

0.7.7

8 years ago

0.7.6

8 years ago

0.7.5

8 years ago

0.7.4

8 years ago

0.7.3

8 years ago

0.7.2

8 years ago

0.7.1

8 years ago

0.6.4

8 years ago

0.6.3

8 years ago

0.6.2

8 years ago

0.7.0

8 years ago

0.6.1

8 years ago

0.6.0

8 years ago

0.5.5

8 years ago

0.5.4

8 years ago

0.5.3

8 years ago

0.5.2

8 years ago

0.5.1

8 years ago

0.5.0

8 years ago

0.4.5

9 years ago

0.4.4

9 years ago

0.4.3

9 years ago

0.4.2

9 years ago

0.4.1

9 years ago

0.4.0

9 years ago

0.3.10

9 years ago

0.3.9

9 years ago

0.3.8

9 years ago

0.3.7

9 years ago

0.3.6

9 years ago

0.3.5

9 years ago

0.3.4

9 years ago

0.3.3

9 years ago

0.2.10

9 years ago

0.3.2

9 years ago

0.3.1

9 years ago

0.3.0

9 years ago

0.2.9

9 years ago

0.2.8

9 years ago

0.2.7

9 years ago

0.2.6

10 years ago

0.2.5

10 years ago

0.2.4

10 years ago

0.2.3

10 years ago

0.2.2

10 years ago

0.2.1

10 years ago

0.2.0

10 years ago

0.1.0

10 years ago