-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into city_select_code_2
- Loading branch information
Showing
40 changed files
with
3,214 additions
and
79 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
# 代码质量检查 | ||
name: Code Check | ||
|
||
on: [push, pull_request] | ||
on: [push] | ||
|
||
jobs: | ||
run-lint: | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
# 运行单测 | ||
name: Unit Tests | ||
|
||
on: [push, pull_request] | ||
on: [push] | ||
|
||
jobs: | ||
run-ci-test: | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
{ | ||
"version": "0.1.1", | ||
"version": "1.0.5", | ||
"npmClient": "npm", | ||
"packages": ["packages/*"], | ||
"command": { | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,82 @@ | ||
import { useForkRef } from '@bifrostui/utils'; | ||
import clsx from 'clsx'; | ||
import React, { useState } from 'react'; | ||
import { View, ViewProps } from '@tarojs/components'; | ||
import Backdrop from '../Backdrop'; | ||
import Portal from '../Portal'; | ||
import './Modal.less'; | ||
import { ModalProps } from './Modal.types'; | ||
|
||
const prefixCls = 'bui-modal'; | ||
|
||
const Modal = React.forwardRef<HTMLDivElement, ViewProps & ModalProps>( | ||
(props, ref) => { | ||
const { | ||
className, | ||
open, | ||
BackdropProps, | ||
children, | ||
container, | ||
disablePortal, | ||
disableScrollLock, | ||
hideBackdrop, | ||
onClose, | ||
keepMounted, | ||
...others | ||
} = props; | ||
const modalRef = React.useRef(null); | ||
const handleRef = useForkRef(modalRef, ref); | ||
const [backdropExited, setBackDropExited] = useState(hideBackdrop || !open); | ||
const mounted = open || !backdropExited || keepMounted; | ||
|
||
const handleBackdropClick = (event) => { | ||
if (event.target.id !== event.currentTarget.id) { | ||
return; | ||
} | ||
|
||
if (onClose) { | ||
onClose(event, { from: 'backdrop' }); | ||
} | ||
}; | ||
|
||
if (!mounted) { | ||
return null; | ||
} | ||
|
||
return ( | ||
<Portal container={container} disablePortal={disablePortal}> | ||
<View | ||
className={clsx(prefixCls, className)} | ||
ref={handleRef} | ||
catchMove={!disableScrollLock} | ||
{...others} | ||
> | ||
{!hideBackdrop ? ( | ||
<Backdrop | ||
open={open} | ||
onClick={handleBackdropClick} | ||
onEnter={() => setBackDropExited(false)} | ||
onExited={() => setBackDropExited(true)} | ||
{...BackdropProps} | ||
className={clsx( | ||
`${prefixCls}-backdrop`, | ||
BackdropProps?.className, | ||
)} | ||
/> | ||
) : null} | ||
{(open || keepMounted) && children} | ||
</View> | ||
</Portal> | ||
); | ||
}, | ||
); | ||
|
||
Modal.displayName = 'BuiModal'; | ||
Modal.defaultProps = { | ||
open: false, | ||
disablePortal: false, | ||
disableScrollLock: false, | ||
hideBackdrop: false, | ||
}; | ||
|
||
export default Modal; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
@import '~@bifrostui/styles/mixins/index.less'; | ||
|
||
.bui-picker { | ||
--cancel-color: var(--bui-color-fg-default); | ||
--cancel-font-size: var(--bui-title-size-4, 15px); | ||
--confirm-color: var(--bui-color-primary); | ||
--confirm-font-size: var(--bui-title-size-4, 15px); | ||
--title-color: var(--bui-color-fg-default); | ||
--title-font-size: var(--bui-title-size-3, 16px); | ||
--title-font-weight: var(--bui-font-weight-medium, 500); | ||
--panel-container-height: 260px; | ||
--indicator-top: 108px; | ||
--indicator-height: 36px; | ||
--indicator-border-color: var(--bui-color-border-default); | ||
--option-color: var(--bui-color-fg-default); | ||
--option-font-size: var(--bui-title-size-4); | ||
--option-height: 36px; | ||
font-family: var(--bui-font-family); | ||
|
||
.bui-drawer-content { | ||
border-radius: var(--bui-shape-radius-drawer) var(--bui-shape-radius-drawer) | ||
0 0; | ||
} | ||
|
||
&-header { | ||
height: 50px; | ||
display: flex; | ||
align-items: center; | ||
justify-content: space-between; | ||
padding: 0 var(--bui-spacing-lg); | ||
} | ||
|
||
&-cancel { | ||
width: 40px; | ||
height: 100%; | ||
font-size: var(--cancel-font-size); | ||
text-align: center; | ||
line-height: 50px; | ||
color: var(--cancel-color); | ||
} | ||
|
||
&-title { | ||
font-size: var(--title-font-size); | ||
color: var(--title-color); | ||
font-weight: var(--title-font-weight); | ||
} | ||
|
||
&-confirm { | ||
width: 40px; | ||
height: 100%; | ||
font-size: var(--confirm-font-size); | ||
text-align: center; | ||
line-height: 50px; | ||
color: var(--confirm-color); | ||
} | ||
|
||
&-container { | ||
width: 100%; | ||
height: var(--panel-container-height); | ||
display: flex; | ||
} | ||
} |
Oops, something went wrong.