style: format vc-calendar

pull/666/head
tangjinzhou 2019-02-13 22:12:00 +08:00
parent 4df4424570
commit 1d80cec3d7
11 changed files with 51 additions and 56 deletions

View File

@ -39,14 +39,15 @@
} }
} }
.@{prefixClass}-decade-panel-prev-century-btn, .@{prefixClass}-decade-panel-next-century-btn { .@{prefixClass}-decade-panel-prev-century-btn,
.@{prefixClass}-decade-panel-next-century-btn {
position: absolute; position: absolute;
top: 0; top: 0;
} }
.@{prefixClass}-decade-panel-next-century-btn { .@{prefixClass}-decade-panel-next-century-btn {
&:after { &:after {
content: '»' content: '»';
} }
} }
@ -54,7 +55,7 @@
user-select: none; user-select: none;
left: 0; left: 0;
&:after { &:after {
content: '«' content: '«';
} }
} }
@ -111,7 +112,8 @@
} }
} }
.@{prefixClass}-decade-panel-last-century-cell, .@{prefixClass}-decade-panel-next-century-cell { .@{prefixClass}-decade-panel-last-century-cell,
.@{prefixClass}-decade-panel-next-century-cell {
.@{prefixClass}-decade-panel-decade { .@{prefixClass}-decade-panel-decade {
user-select: none; user-select: none;
-webkit-user-select: none; -webkit-user-select: none;

View File

@ -43,14 +43,15 @@
} }
} }
.@{prefixClass}-month-panel-prev-year-btn, .@{prefixClass}-month-panel-next-year-btn { .@{prefixClass}-month-panel-prev-year-btn,
.@{prefixClass}-month-panel-next-year-btn {
position: absolute; position: absolute;
top: 0; top: 0;
} }
.@{prefixClass}-month-panel-next-year-btn { .@{prefixClass}-month-panel-next-year-btn {
&:after { &:after {
content: '»' content: '»';
} }
} }
@ -59,7 +60,7 @@
left: 0; left: 0;
&:after { &:after {
content: '«' content: '«';
} }
} }
@ -96,8 +97,6 @@
.@{prefixClass}-month-panel-cell { .@{prefixClass}-month-panel-cell {
text-align: center; text-align: center;
.@{prefixClass}-month-panel-month { .@{prefixClass}-month-panel-month {
display: block; display: block;
width: 46px; width: 46px;

View File

@ -43,14 +43,15 @@
} }
} }
.@{prefixClass}-year-panel-prev-decade-btn, .@{prefixClass}-year-panel-next-decade-btn { .@{prefixClass}-year-panel-prev-decade-btn,
.@{prefixClass}-year-panel-next-decade-btn {
position: absolute; position: absolute;
top: 0; top: 0;
} }
.@{prefixClass}-year-panel-next-decade-btn { .@{prefixClass}-year-panel-next-decade-btn {
&:after { &:after {
content: '»' content: '»';
} }
} }
@ -59,7 +60,7 @@
left: 0; left: 0;
&:after { &:after {
content: '«' content: '«';
} }
} }
@ -125,7 +126,8 @@
} }
} }
.@{prefixClass}-year-panel-last-decade-cell, .@{prefixClass}-year-panel-next-decade-cell { .@{prefixClass}-year-panel-last-decade-cell,
.@{prefixClass}-year-panel-next-decade-cell {
.@{prefixClass}-year-panel-year { .@{prefixClass}-year-panel-year {
user-select: none; user-select: none;
-webkit-user-select: none; -webkit-user-select: none;

View File

@ -273,7 +273,8 @@ const Calendar = {
if (props.renderSidebar) { if (props.renderSidebar) {
children.push(props.renderSidebar()); children.push(props.renderSidebar());
} }
children.push(<div class={`${prefixCls}-panel`} key="panel"> children.push(
<div class={`${prefixCls}-panel`} key="panel">
{dateInputElement} {dateInputElement}
<div tabIndex={props.focusablePanel ? 0 : undefined} class={`${prefixCls}-date-panel`}> <div tabIndex={props.focusablePanel ? 0 : undefined} class={`${prefixCls}-date-panel`}>
<CalendarHeader <CalendarHeader
@ -328,7 +329,8 @@ const Calendar = {
onCloseTimePicker={this.closeTimePicker} onCloseTimePicker={this.closeTimePicker}
/> />
</div> </div>
</div>); </div>,
);
return this.renderRoot({ return this.renderRoot({
children, children,

View File

@ -52,10 +52,7 @@ const DateInput = {
!this.invalid && !this.invalid &&
!(cachedSelectionStart === 0 && cachedSelectionEnd === 0) !(cachedSelectionStart === 0 && cachedSelectionEnd === 0)
) { ) {
dateInputInstance.setSelectionRange( dateInputInstance.setSelectionRange(cachedSelectionStart, cachedSelectionEnd);
cachedSelectionStart,
cachedSelectionEnd,
);
} }
}); });
}, },
@ -167,12 +164,14 @@ const DateInput = {
<div class={`${prefixCls}-input-wrap`}> <div class={`${prefixCls}-input-wrap`}>
<div class={`${prefixCls}-date-input-wrap`}> <div class={`${prefixCls}-date-input-wrap`}>
<input <input
{...{directives: [ {...{
directives: [
{ {
name: 'ant-ref', name: 'ant-ref',
value: this.saveDateInput, value: this.saveDateInput,
}, },
]}} ],
}}
class={`${prefixCls}-input ${invalidClass}`} class={`${prefixCls}-input ${invalidClass}`}
value={str} value={str}
disabled={disabled} disabled={disabled}

View File

@ -120,10 +120,7 @@ export default {
<tbody class={`${prefixCls}-tbody`}>{decadesEls}</tbody> <tbody class={`${prefixCls}-tbody`}>{decadesEls}</tbody>
</table> </table>
</div> </div>
{footer && ( {footer && <div class={`${prefixCls}-footer`}>{footer}</div>}
<div class={`${prefixCls}-footer`}>
{footer}
</div>)}
</div> </div>
); );
}, },

View File

@ -116,10 +116,7 @@ const MonthPanel = {
prefixCls={prefixCls} prefixCls={prefixCls}
/> />
</div> </div>
{footer && ( {footer && <div class={`${prefixCls}-footer`}>{footer}</div>}
<div class={`${prefixCls}-footer`}>
{footer}
</div>)}
</div> </div>
</div> </div>
); );

View File

@ -137,10 +137,7 @@ export default {
<tbody class={`${prefixCls}-tbody`}>{yeasEls}</tbody> <tbody class={`${prefixCls}-tbody`}>{yeasEls}</tbody>
</table> </table>
</div> </div>
{footer && ( {footer && <div class={`${prefixCls}-footer`}>{footer}</div>}
<div class={`${prefixCls}-footer`}>
{footer}
</div>)}
</div> </div>
</div> </div>
); );