fix: 日期范围标题重复

This commit is contained in:
zhangxulong 2023-06-05 11:27:21 +08:00
parent 52d6ba2afe
commit 26b7fd827d
8 changed files with 25 additions and 33 deletions

View File

@ -1677,8 +1677,8 @@
--InputRange-track-onActive-bg: var(--colors-brand-5); --InputRange-track-onActive-bg: var(--colors-brand-5);
--InputRange-handle-height: var(--sizes-size-9); --InputRange-handle-height: var(--sizes-size-9);
--InputRange-handle-width: var(--sizes-size-9); --InputRange-handle-width: var(--sizes-size-9);
--InputRange-handle-mobile-height: var(--sizes-base-11); --InputRange-handle-mobile-height: var(--sizes-base-10);
--InputRange-handle-mobile-width: var(--sizes-base-11); --InputRange-handle-mobile-width: var(--sizes-base-10);
--InputRange-handle-bg: var(--colors-neutral-fill-11); --InputRange-handle-bg: var(--colors-neutral-fill-11);
--InputRange-handle-top-border-color: var(--colors-brand-5); --InputRange-handle-top-border-color: var(--colors-brand-5);
--InputRange-handle-top-border-width: 0.0625rem; --InputRange-handle-top-border-width: 0.0625rem;

View File

@ -396,7 +396,7 @@
align-items: center; align-items: center;
&-popup { &-popup {
height: 80vh; height: px2rem(580px);
&-inner { &-inner {
width: 100%; width: 100%;

View File

@ -161,6 +161,7 @@
margin-top: px2rem(-4px); margin-top: px2rem(-4px);
} }
&-safearea { &-safearea {
height: px2rem(16px); padding-bottom: constant(safe-area-inset-bottom);
padding-bottom: env(safe-area-inset-bottom);
} }
} }

View File

@ -415,6 +415,8 @@
background-color: rgb(250, 250, 250); background-color: rgb(250, 250, 250);
border-radius: var(--borderRadius); border-radius: var(--borderRadius);
position: relative; position: relative;
word-wrap: break-word;
word-break: break-all;
} }
// .#{$ns}Form--quickEdit { // .#{$ns}Form--quickEdit {

View File

@ -149,10 +149,12 @@
} }
} }
&-drage { &:not(.is-mobile) {
transform: var(--InputRange-handle-onActive-transform); .#{$ns}InputRange-handle-drage {
box-shadow: var(--InputRange-handle-onFocus-boxShadow); transform: var(--InputRange-handle-onActive-transform);
border-width: var(--InputRange-handle-onDrage-border-width); box-shadow: var(--InputRange-handle-onFocus-boxShadow);
border-width: var(--InputRange-handle-onDrage-border-width);
}
} }
.input-range--disabled & { .input-range--disabled & {
@ -338,10 +340,10 @@
&.is-mobile { &.is-mobile {
.#{$ns}InputRange-marks { .#{$ns}InputRange-marks {
div { div {
top: px2rem(4px); top: 0;
&:nth-child(2n) { &:nth-child(2n) {
top: px2rem(-34px); top: px2rem(-30px);
} }
} }
} }

View File

@ -1411,7 +1411,6 @@ export class DateRangePicker extends React.Component<
className={cx(`${ns}DateRangePicker-wrap`, {'is-mobile': mobileUI})} className={cx(`${ns}DateRangePicker-wrap`, {'is-mobile': mobileUI})}
ref={this.calendarRef} ref={this.calendarRef}
> >
{this.renderShortcuts(shortcuts ?? ranges)}
{mobileUI && !embed ? ( {mobileUI && !embed ? (
<div className={cx('PickerColumns-header')}> <div className={cx('PickerColumns-header')}>
{ {
@ -1438,6 +1437,7 @@ export class DateRangePicker extends React.Component<
} }
</div> </div>
) : null} ) : null}
{this.renderShortcuts(shortcuts ?? ranges)}
<div <div
className={cx(`${ns}DateRangePicker-picker-wrap`, { className={cx(`${ns}DateRangePicker-picker-wrap`, {
'is-vertical': embed 'is-vertical': embed
@ -1789,6 +1789,7 @@ export class DateRangePicker extends React.Component<
)} )}
onHide={this.close} onHide={this.close}
header={CalendarMobileTitle} header={CalendarMobileTitle}
showClose={false}
> >
{useCalendarMobile ? calendarMobile : this.renderCalendar()} {useCalendarMobile ? calendarMobile : this.renderCalendar()}
</PopUp> </PopUp>

View File

@ -451,8 +451,6 @@ export class Pagination extends React.Component<
]; ];
} }
console.log('pageButtons-----', pageButtons, activePage);
const go = ( const go = (
<div className={cx('Pagination-inputGroup Pagination-item')} key="go"> <div className={cx('Pagination-inputGroup Pagination-item')} key="go">
{!mobileUI ? ( {!mobileUI ? (

View File

@ -6,11 +6,11 @@ import {autobind, highlight} from 'amis-core';
import merge from 'lodash/merge'; import merge from 'lodash/merge';
// @ts-ignore // @ts-ignore
import {matchSorter} from 'match-sorter'; import {matchSorter} from 'match-sorter';
import {Option, Options, value2array, SelectProps} from './Select'; import {Option, value2array, SelectProps} from './Select';
import VirtualList from './virtual-list'; import VirtualList from './virtual-list';
import Checkbox from './Checkbox'; import Checkbox from './Checkbox';
import Input from './Input'; import Input from './Input';
import {closeIcon, Icon} from './icons'; import {Icon} from './icons';
interface SelectState { interface SelectState {
isFocused: boolean; isFocused: boolean;
@ -47,10 +47,6 @@ export default class SelectMobile extends React.Component<Props, SelectState> {
const {onChange, multiple, simpleValue, valueField, options} = this.props; const {onChange, multiple, simpleValue, valueField, options} = this.props;
let {selection} = this.state; let {selection} = this.state;
if (!multiple && item === undefined) {
console.log('执行了');
}
// 单选是字符串 // 单选是字符串
const selectItem = options.find((option: Option) => const selectItem = options.find((option: Option) =>
multiple multiple
@ -254,36 +250,24 @@ export default class SelectMobile extends React.Component<Props, SelectState> {
const { const {
popOverContainer, popOverContainer,
options, options,
value,
valueField, valueField,
labelField, labelField,
noResultsText, noResultsText,
loadOptions, loadOptions,
creatable,
multiple, multiple,
valuesNoWrap, valuesNoWrap,
classnames: cx, classnames: cx,
popoverClassName,
popOverContainerSelector,
checkAll, checkAll,
checkAllLabel, checkAllLabel,
checkAllBySearch, checkAllBySearch,
searchable, searchable,
createBtnLabel,
disabled, disabled,
searchPromptText, searchPromptText,
editable,
removable,
overlayPlacement,
translate: __, translate: __,
hideSelected, hideSelected,
renderMenu, renderMenu,
mobileClassName,
virtualThreshold = 100, virtualThreshold = 100,
useMobileUI = false,
overlay,
isOpen, isOpen,
highlightedIndex,
onClose, onClose,
getInputProps, getInputProps,
getItemProps, getItemProps,
@ -301,8 +285,12 @@ export default class SelectMobile extends React.Component<Props, SelectState> {
keys: [labelField || 'label', valueField || 'value'] keys: [labelField || 'label', valueField || 'value']
}) })
: options.concat() : options.concat()
).filter((option: Option) => !option.hidden && option.visible !== false); ).filter(
(option: Option) =>
!option.hidden &&
option.visible !== false &&
option[labelField || 'label']
);
const enableVirtualRender = const enableVirtualRender =
filtedOptions.length && filtedOptions.length > virtualThreshold; filtedOptions.length && filtedOptions.length > virtualThreshold;
const selectionValues = selection.map(select => select[valueField]); const selectionValues = selection.map(select => select[valueField]);