1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798 |
- <import-sjs
- from="./helper.sjs"
- name="helper" />
- <import-sjs
- from="./scroll.sjs"
- name="scroll" />
- <view
- class="ant-calendar {{ className ? className : '' }}"
- style="{{ style }}">
- <view class="ant-calendar-mark">
- <block
- a:for="{{ markItems }}"
- a:for-index="index"
- a:for-item="item">
- <view class="{{ helper.getMarkCellClassName(index, markItems) }}">
- <!-- display: inline -->
- <text>{{ item }}</text>
- </view>
- </block>
- </view>
- <view
- a:if="{{ !!elementSize }}"
- class="ant-calendar-sticky">
- <view class="ant-calendar-sticky-title">
- <slot name="calendarTitle">
- <view class="ant-calendar-title">
- {{ monthList[headerState].title }}
- </view>
- </slot>
- </view>
- </view>
- <scroll-view
- scroll-y="{{ true }}"
- class="ant-calendar-body"
- data-elementsize="{{ elementSize }}"
- data-monthlist="{{ monthList }}"
- onScroll="{{ scroll.handleScroll }}"
- scroll-into-view="{{ scrollIntoViewId }}"
- scroll-with-animation
- scroll-animation-duration="{{ 300 }}"
- ref="handleRef">
- <block
- a:for="{{ monthList }}"
- a:for-index="index"
- a:for-item="currentMonth">
- <view class="ant-calendar-body-container">
- <view class="ant-calendar-title-container">
- <slot name="calendarTitle">
- <view class="ant-calendar-title">{{ currentMonth.title }}</view>
- </slot>
- </view>
- <view class="ant-calendar-cells">
- <block
- a:for="{{ currentMonth.cells }}"
- a:for-index="index"
- a:for-item="item">
- <block>
- <view
- class="{{ helper.getClassName(item, index) }}"
- id="id_{{ item.time }}"
- data-time="{{ item }}"
- onTap="clickCell">
- <view class="ant-calendar-cell-container">
- <view class="ant-calendar-cell-top">
- <!-- display: inline -->
- <text
- a:if="{{ item.top }}"
- class="ant-calendar-cell-top-text {{ item.top.className ? item.top.className : '' }}"
- >{{ item.top.label }}</text
- >
- </view>
- <view class="ant-calendar-cell-center">{{ item.date }}</view>
- <view class="ant-calendar-cell-bottom">
- <slot
- name="cell-bottom"
- cell="{{ item }}">
- <!-- display: inline -->
- <text
- a:if="{{ item.bottom }}"
- class="{{ item.bottom.className }}"
- >{{ item.bottom.label }}</text
- >
- </slot>
- </view>
- </view>
- </view>
- <view
- a:if="{{ index % 7 !== 6 }}"
- class="{{ helper.getSpaceClassName(index, currentMonth.cells) }}" />
- </block>
- </block>
- </view>
- </view>
- </block>
- </scroll-view>
- </view>
|