collapse-panel.wxml 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. <wxs src="../common/utils.wxs" module="_" />
  2. <view
  3. style="{{_._style([style, customStyle])}}"
  4. class="class {{classPrefix}} {{classPrefix}}--{{placement}} {{prefix}}-class"
  5. >
  6. <view
  7. class="{{classPrefix}}__title"
  8. aria-role="button"
  9. aria-expanded="{{expanded}}"
  10. aria-disabled="{{ultimateDisabled}}"
  11. bind:tap="onClick"
  12. >
  13. <t-cell
  14. title="{{header}}"
  15. note="{{headerRightContent}}"
  16. bordered
  17. left-icon="{{headerLeftIcon}}"
  18. right-icon="{{ ultimateExpandIcon ? (expanded ? 'chevron-up' : 'chevron-down') : '' }}"
  19. t-class="{{_.cls(classPrefix + '__header', [placement, ['expanded', expanded]])}} {{prefix}}-class-header"
  20. t-class-title="class-title {{ultimateDisabled ? 'class-title--disabled' : ''}}"
  21. t-class-note="class-note {{ultimateDisabled ? 'class-note--disabled' : ''}}"
  22. t-class-right-icon="class-right-icon {{classPrefix}}__arrow--{{placement}} {{ultimateDisabled ? 'class-right-icon--disabled' : ''}}"
  23. t-class-hover="class-header-hover"
  24. >
  25. <slot name="header-left-icon" slot="left-icon" />
  26. <slot name="header" slot="title" />
  27. <slot name="header-right-content" slot="note" />
  28. <slot name="expand-icon" slot="right-icon" />
  29. </t-cell>
  30. </view>
  31. <view class="{{classPrefix}}__wrapper" animation="{{animation}}" aria-hidden="{{expanded ? '' : true}}">
  32. <view
  33. class="{{_.cls(classPrefix + '__content', [['disabled', ultimateDisabled], ['expanded', expanded], placement])}} {{prefix}}-class-content"
  34. >
  35. {{content}}
  36. <slot />
  37. <slot name="content" />
  38. </view>
  39. </view>
  40. </view>