Skip to content
This repository has been archived by the owner on Mar 15, 2018. It is now read-only.

Commit

Permalink
构建工具由 FIS3 改为 webpack2
Browse files Browse the repository at this point in the history
  • Loading branch information
xxapp committed Jun 6, 2017
1 parent 90ac5b4 commit bbaf74e
Show file tree
Hide file tree
Showing 61 changed files with 912 additions and 1,059 deletions.
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,5 @@ Temporary Items
!.vscode/tasks.json
!.vscode/launch.json

output/*
dist/*
bin/*
3 changes: 2 additions & 1 deletion components/ms-calendar/index.ts
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
import './ms-calendar';
import './ms-calendar';
import './ms-calendar.scss';
34 changes: 16 additions & 18 deletions components/ms-calendar/ms-calendar-year-view.html
Original file line number Diff line number Diff line change
@@ -1,18 +1,16 @@
<template>
<div class="ane-calendar">
<table class="ane-calendar-year-view">
<tbody>
<tr :for="(i, row) in @table">
<td class="ane-calendar-cell"
:class="[
(@isSelected(cell) ? 'ane-calendar-selected-day' : ''),
(@view > 1 && (i + j === 0 || i * j === 6) ? 'ane-calendar-prev-month-cell' : '')
]"
:for="(j, cell) in row">
<div class="ane-calendar-date" :click="@handleCellClick(cell)">{{cell.label}}</div>
</td>
</tr>
</tbody>
</table>
</div>
</template>
<div class="ane-calendar">
<table class="ane-calendar-year-view">
<tbody>
<tr :for="(i, row) in @table">
<td class="ane-calendar-cell"
:class="[
(@isSelected(cell) ? 'ane-calendar-selected-day' : ''),
(@view > 1 && (i + j === 0 || i * j === 6) ? 'ane-calendar-prev-month-cell' : '')
]"
:for="(j, cell) in row">
<div class="ane-calendar-date" :click="@handleCellClick(cell)">{{cell.label}}</div>
</td>
</tr>
</tbody>
</table>
</div>
2 changes: 1 addition & 1 deletion components/ms-calendar/ms-calendar-year-view.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import * as moment from 'moment';
const monthTable = [];

avalon.component('ms-calendar-year-view', {
template: __inline('./ms-calendar-year-view.html'),
template: require('./ms-calendar-year-view.html'),
defaults: {
table: [],
// 0-月视图,1-年视图,2-十年视图,3-百年视图
Expand Down
128 changes: 22 additions & 106 deletions components/ms-calendar/ms-calendar.html
Original file line number Diff line number Diff line change
@@ -1,108 +1,24 @@
<template>
<div class="ane-calendar">
<div class="row" ms-if="@showHeader">
<div class="col-md-2 col-md-offset-4">
<ms-select :widget="{value:[@currentYear],options:@currentYearOptions,onChange:@handleYearChange}"></ms-select>
</div>
<div class="col-md-2">
<ms-select :widget="{value:[@currentMonth],options:@monthOptions,onChange:@handleMonthChange}"></ms-select>
</div>
<div class="ane-calendar">
<div class="row" ms-if="@showHeader">
<div class="col-md-2 col-md-offset-4">
<ms-select :widget="{value:[@currentYear],options:@currentYearOptions,onChange:@handleYearChange}"></ms-select>
</div>
<div class="col-md-2">
<ms-select :widget="{value:[@currentMonth],options:@monthOptions,onChange:@handleMonthChange}"></ms-select>
</div>
<table>
<thead>
<tr>
<th class="ane-calendar-column-header" :for="day in @weekdays">{{day}}</th>
</tr>
</thead>
<tbody>
<tr :for="week in @table">
<td class="ane-calendar-cell" :class="el.className" :for="el in week">
<div class="ane-calendar-date" :click="@handleDateClick(el) | stop">{{el.date}}</div>
</td>
</tr>
</tbody>
</table>
</div>
</template>
<style lang="scss">
@import '../../styles/index';
$calendar-prefix-cls: #{$ane-prefix}-calendar;

.#{$calendar-prefix-cls} {
table {
width: 100%;
max-width: 100%;
}

&-column-header {
line-height: 18px;
width: 33px;
padding: 6px 0;
text-align: center;
}
&-cell {
padding: 4px 0;
}
&-prev-month-cell &-date, &-next-month-cell &-date {
color: $calendar-disabled-date-color;
}
&-today &-date {
border-color: $brand-primary;
font-weight: 700;
color: $brand-primary;
}
&-selected-day &-date {
background: $brand-primary;
color: #fff;
border: 1px solid transparent;

&:hover {
background: $brand-primary;
}
}
&-disabled-cell &-date {
cursor: not-allowed;
color: $calendar-disabled-date-color;
background: $calendar-disabled-date-bg;
border-radius: 0;
width: auto;
border: 1px solid transparent;

&:hover {
background: $calendar-disabled-date-bg;
}
}
&-date {
display: block;
margin: 0 auto;
color: $text-color;
border-radius: 2px;
width: 20px;
height: 20px;
line-height: 18px;
border: 1px solid transparent;
padding: 0;
background: transparent;
text-align: center;
cursor: pointer;

&:hover {
background: $item-hover-bg;
}
}

&-year-view {
table-layout: fixed;
text-align: center;
}
&-year-view &-cell {
padding: 20px 0;
}
&-year-view &-date {
width: auto;
display: inline-block;
padding: 0 6px;
white-space: nowrap;
}
}
</style>
<table>
<thead>
<tr>
<th class="ane-calendar-column-header" :for="day in @weekdays">{{day}}</th>
</tr>
</thead>
<tbody>
<tr :for="week in @table">
<td class="ane-calendar-cell" :class="el.className" :for="el in week">
<div class="ane-calendar-date" :click="@handleDateClick(el) | stop">{{el.date}}</div>
</td>
</tr>
</tbody>
</table>
</div>
80 changes: 80 additions & 0 deletions components/ms-calendar/ms-calendar.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
@import '../../styles/index';
$calendar-prefix-cls: #{$ane-prefix}-calendar;

.#{$calendar-prefix-cls} {
table {
width: 100%;
max-width: 100%;
}

&-column-header {
line-height: 18px;
width: 33px;
padding: 6px 0;
text-align: center;
}
&-cell {
padding: 4px 0;
}
&-prev-month-cell &-date, &-next-month-cell &-date {
color: $calendar-disabled-date-color;
}
&-today &-date {
border-color: $brand-primary;
font-weight: 700;
color: $brand-primary;
}
&-selected-day &-date {
background: $brand-primary;
color: #fff;
border: 1px solid transparent;

&:hover {
background: $brand-primary;
}
}
&-disabled-cell &-date {
cursor: not-allowed;
color: $calendar-disabled-date-color;
background: $calendar-disabled-date-bg;
border-radius: 0;
width: auto;
border: 1px solid transparent;

&:hover {
background: $calendar-disabled-date-bg;
}
}
&-date {
display: block;
margin: 0 auto;
color: $text-color;
border-radius: 2px;
width: 20px;
height: 20px;
line-height: 18px;
border: 1px solid transparent;
padding: 0;
background: transparent;
text-align: center;
cursor: pointer;

&:hover {
background: $item-hover-bg;
}
}

&-year-view {
table-layout: fixed;
text-align: center;
}
&-year-view &-cell {
padding: 20px 0;
}
&-year-view &-date {
width: auto;
display: inline-block;
padding: 0 6px;
white-space: nowrap;
}
}
6 changes: 3 additions & 3 deletions components/ms-calendar/ms-calendar.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
import * as avalon from 'avalon2';
import * as moment from 'moment';
import 'moment/locale/zh-cn';
//import 'moment/locale/zh-cn';
import '../ms-select';
import './ms-calendar-year-view';
moment.locale('zh-cn');
//moment.locale('zh-cn');

avalon.component('ms-calendar', {
template: __inline('./ms-calendar.html'),
template: require('./ms-calendar.html'),
defaults: {
value: '',
$value: null,
Expand Down
3 changes: 2 additions & 1 deletion components/ms-checkbox/index.ts
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
import './ms-checkbox';
import './ms-checkbox-group';
import './ms-checkbox-group';
import './ms-checkbox.scss';
2 changes: 1 addition & 1 deletion components/ms-checkbox/ms-checkbox-group.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import './ms-checkbox';

controlComponent.extend({
displayName: 'ms-checkbox-group',
template: __inline('./ms-checkbox-group.html'),
template: require('./ms-checkbox-group.html'),
defaults: {
value: [],
disabled: false,
Expand Down
Loading

0 comments on commit bbaf74e

Please sign in to comment.