Skip to content

Commit

Permalink
Merge branch 'master' into feat/lx
Browse files Browse the repository at this point in the history
  • Loading branch information
rainyLeo committed Aug 27, 2020
2 parents c2b19ba + fe1d1a9 commit 3fe545f
Show file tree
Hide file tree
Showing 7 changed files with 51 additions and 45 deletions.
3 changes: 3 additions & 0 deletions HISTORY.md
@@ -1,4 +1,7 @@
# History
## 0.10.35
* `feat` add new prop onHeaderSelect for calendarfull

## 0.10.34
* `FIXED` fix i18n form RangeCalendar

Expand Down
2 changes: 1 addition & 1 deletion demo/CalendarDemo.jsx
Expand Up @@ -269,7 +269,7 @@ class Demo extends React.Component {
value={value}
onSelect={this.onSelect}
fullscreen
type="week"
type="month"
locale="zh-cn"
format="yyyy/MM/dd"
scheduleRender={Calendar.fullUtil.generateScheduleContent(events, this.onScheduleClick)}
Expand Down
60 changes: 30 additions & 30 deletions demo/events.js
@@ -1,19 +1,19 @@
const current = +new Date();
export default [
{
start: '2019-05-10 14:00', // 事件开始时间
end: '2019-05-11 16:00', // 事件结束时间
start: "2019-05-10 14:00", // 事件开始时间
end: "2019-05-11 16:00", // 事件结束时间
important: true,
style: {
background: 'lightblue',
color: 'red'
background: "lightblue",
color: "red",
},
// 事件的渲染函数
render: () => <div>事件1</div>,
},
{
start: '2019-05-10 14:00', // 事件开始时间
end: '2019-05-14 16:00', // 事件结束时间
start: "2019-05-10 14:00", // 事件开始时间
end: "2019-05-14 16:00", // 事件结束时间
important: true,
// style: {
// background: '#ddd',
Expand All @@ -27,79 +27,79 @@ export default [
),
},
{
start: '2019-05-10 14:00', // 事件开始时间
end: '2019-05-21 16:00', // 事件结束时间
start: "2019-05-10 14:00", // 事件开始时间
end: "2019-05-21 16:00", // 事件结束时间
important: true,
style: {
background: 'yellow',
color: 'blue'
background: "yellow",
color: "blue",
},
// 事件的渲染函数
render: () => <div>事件3</div>,
},
{
start: '2019-05-30 14:00', // 事件开始时间
end: '2019-06-13 17:00', // 事件结束时间
start: "2019-05-30 14:00", // 事件开始时间
end: "2019-06-13 17:00", // 事件结束时间
important: true,
// 事件的渲染函数
render: () => <div>事件4</div>,
},
{
start: '2019-05-30 14:00', // 事件开始时间
end: '2019-05-30 18:00', // 事件结束时间
start: "2019-05-30 14:00", // 事件开始时间
end: "2019-05-30 18:00", // 事件结束时间
important: true,
// 事件的渲染函数
render: () => <div>事件5</div>,
},
{
start: '2019-05-30 14:00', // 事件开始时间
end: '2019-06-13 21:00', // 事件结束时间
start: "2019-05-30 14:00", // 事件开始时间
end: "2019-06-13 21:00", // 事件结束时间
important: true,
// 事件的渲染函数
render: () => <div>事件8</div>,
},
{
start: '2019-05-01 14:00', // 事件开始时间
end: '2019-06-03 21:00', // 事件结束时间
start: "2019-06-03 14:00", // 事件开始时间
end: "2019-06-03 21:00", // 事件结束时间
important: true,
style: {
background: 'lightblue',
color: 'white'
background: "lightblue",
color: "white",
},
// 事件的渲染函数
render: () => <div>事件9</div>,
},
{
start: '2019-04-29 14:00', // 事件开始时间
end: '2019-04-30 21:00', // 事件结束时间
start: "2019-04-29 14:00", // 事件开始时间
end: "2019-04-30 21:00", // 事件结束时间
important: true,
// 事件的渲染函数
render: () => <div>事件10</div>,
},
{
start: '2019-06-05 06:00', // 事件开始时间
end: '2019-06-06 21:00', // 事件结束时间
start: "2019-06-05 06:00", // 事件开始时间
end: "2019-06-06 21:00", // 事件结束时间
important: true,
// 事件的渲染函数
render: () => <div>事件11</div>,
},
{
start: '2019-06-05 09:00', // 事件开始时间
end: '2019-06-08 21:00', // 事件结束时间
start: "2019-06-05 09:00", // 事件开始时间
end: "2019-06-08 21:00", // 事件结束时间
important: true,
// 事件的渲染函数
render: () => <div>事件12</div>,
},
{
start: '2019-06-05 14:00', // 事件开始时间
end: '2019-06-05 21:00', // 事件结束时间
start: "2019-06-05 14:00", // 事件开始时间
end: "2019-06-05 21:00", // 事件结束时间
important: true,
// 事件的渲染函数
render: () => <div>事件13</div>,
},
{
start: '2019-06-04 01:00', // 事件开始时间
end: '2019-06-04 24:00', // 事件结束时间
start: "2019-06-04 01:00", // 事件开始时间
end: "2019-06-04 24:00", // 事件结束时间
important: true,
// 事件的渲染函数
render: () => <div>14</div>,
Expand Down
6 changes: 3 additions & 3 deletions package.json
@@ -1,8 +1,8 @@
{
"name": "uxcore-calendar",
"version": "0.10.34",
"version": "0.10.37",
"description": "calendar componment for react",
"main": "src/index.js",
"main": "build/index.js",
"scripts": {
"start": "uxcore-tools run start",
"server": "uxcore-tools run server",
Expand Down Expand Up @@ -68,4 +68,4 @@
"uxcore-tag": "^2.2.3",
"uxcore-tooltip": "^0.4.0"
}
}
}
10 changes: 6 additions & 4 deletions src/CalendarFullHeader.jsx
Expand Up @@ -127,8 +127,8 @@ class CalendarHeader extends Component {
}

todayElement() {
const { showToday, locale } = this.props;
const isSuperMini = this.fullHeader ? this.fullHeader.offsetWidth <= 380 : false;
const { showToday, locale, miniOffset } = this.props;
const isSuperMini = this.fullHeader ? this.fullHeader.offsetWidth <= miniOffset : false;
const cls = classnames({
'today-btn': true,
'super-mini': isSuperMini,
Expand Down Expand Up @@ -176,11 +176,11 @@ class CalendarHeader extends Component {
}

renderSwitcher() {
const { showTypeSwitch } = this.props;
const { showTypeSwitch, miniOffset } = this.props;
if (!showTypeSwitch) {
return null;
}
if (this.fullHeader && this.fullHeader.offsetWidth < 380) {
if (this.fullHeader && this.fullHeader.offsetWidth < miniOffset) {
return this.getSelectSwitcher();
}
return this.getExpandedSwitcher();
Expand All @@ -206,6 +206,7 @@ class CalendarHeader extends Component {
CalendarHeader.propTypes = {
yearSelectOffset: PropTypes.number,
yearSelectTotal: PropTypes.number,
miniOffset: PropTypes.number,
onValueChange: PropTypes.func,
typeChange: PropTypes.func,
prefixCls: PropTypes.string,
Expand All @@ -216,6 +217,7 @@ CalendarHeader.propTypes = {
CalendarHeader.defaultProps = {
yearSelectOffset: 10,
yearSelectTotal: 20,
miniOffset: 380,
onValueChange: null,
showToday: true,
type: 'time',
Expand Down
4 changes: 2 additions & 2 deletions src/date/DateTable.jsx
Expand Up @@ -44,12 +44,12 @@ export default class DateTable extends React.Component {
}

render() {
const { prefixCls } = this.props;
const { prefixCls, defaultCellHeight } = this.props;
const fullTableHeight = this.fullTable ? this.fullTable.offsetHeight : 0;
const cellHeight = 0.8 * (fullTableHeight - 32) / 6;
const tableCls = classnames({
[`${prefixCls}-table`]: true,
'super-mini': cellHeight <= 42 && cellHeight > 0,
'super-mini': cellHeight <= (defaultCellHeight || 42) && cellHeight > 0,

});
return (
Expand Down
11 changes: 6 additions & 5 deletions src/style/common/FullCalendar.less
Expand Up @@ -115,6 +115,7 @@
margin-bottom: 3px;
padding: 0;
background: #fff; // color: #fff;
// z-index: 99;

&::before {
display: none;
Expand All @@ -128,7 +129,7 @@
margin-top: 4px;
text-align: center;
cursor: pointer;
color: rgba(31, 56, 88, 0.3)
color: rgba(31, 56, 88, 0.3);
}

.more-icon {
Expand Down Expand Up @@ -244,7 +245,7 @@
&.red-important {
.kuma-calendar-content-wraper {
.kuma-calendar-content-detail {
border-left: 3px solid #F04631;
border-left: 3px solid #f04631;
}
}
}
Expand Down Expand Up @@ -346,7 +347,7 @@
cursor: pointer;
}

>span {
> span {
float: left;
height: 28px;
line-height: 24px;
Expand Down Expand Up @@ -397,7 +398,7 @@
&-cell {
position: relative;
height: 0;
padding-bottom: calc(100%/7);
padding-bottom: calc(100% / 7);
font-family: PingFangSC-Regular;
font-size: 12px;
color: rgba(0, 0, 0, 0.8);
Expand Down Expand Up @@ -494,7 +495,7 @@

.import-event {
display: inline-block;
color: #F04631;
color: #f04631;
font-size: 12px;
vertical-align: top;
}
Expand Down

0 comments on commit 3fe545f

Please sign in to comment.