index.axml 2.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495
  1. <import-sjs
  2. from="./index.sjs"
  3. name="_sjs" />
  4. <view
  5. class="ant-picker {{ disabled ? 'ant-picker-disabled' : '' }} {{ className || '' }}"
  6. style="{{ style || '' }}"
  7. onTap="onOpen">
  8. <slot name="prefix" />
  9. <view class="ant-picker-value">
  10. <slot name="content" />
  11. <view
  12. a:if="{{ formatValue }}"
  13. class="ant-picker-value-text">
  14. {{ formatValue }}
  15. </view>
  16. <block a:else>
  17. <view
  18. a:if="{{ placeholder }}"
  19. class="ant-picker-value-placeholder">
  20. {{ placeholder }}
  21. </view>
  22. </block>
  23. </view>
  24. <slot name="suffix" />
  25. </view>
  26. <ant-popup
  27. className="ant-picker-popup {{ popClassName || '' }}"
  28. style="{{ popStyle || '' }}"
  29. position="bottom"
  30. animationType="{{ animationType }}"
  31. destroyOnClose
  32. onClose="onMaskDismiss"
  33. visible="{{ visible }}">
  34. <view class="ant-picker-header">
  35. <view
  36. class="ant-picker-header-item ant-picker-header-cancel"
  37. hover-class="ant-picker-header-item-hover"
  38. hover-start-time="20"
  39. hover-stay-time="50"
  40. onTap="onCancel">
  41. {{ cancelText }}
  42. </view>
  43. <view class="ant-picker-header-item ant-picker-header-title">
  44. <slot name="title">{{ title }}</slot>
  45. </view>
  46. <view
  47. class="ant-picker-header-item ant-picker-header-confirm"
  48. hover-class="ant-picker-header-item-hover"
  49. hover-start-time="20"
  50. hover-stay-time="50"
  51. onTap="onOk">
  52. {{ okText }}
  53. </view>
  54. </view>
  55. <view class="ant-picker-content">
  56. <slot name="content-header" />
  57. <block a:if="{{ columns.length > 0 }}">
  58. <picker-view
  59. class="ant-picker-picker-view"
  60. mask-style="{{ maskStyle || '' }}"
  61. mask-class="{{ maskClassName || '' }}"
  62. indicator-style="{{ indicatorStyle || '' }}"
  63. indicator-class="{{ indicatorClassName || '' }}"
  64. value="{{ selectedIndex }}"
  65. onChange="onChange">
  66. <block
  67. a:for="{{ columns }}"
  68. a:for-index="dataIndex"
  69. a:for-item="dataRoot">
  70. <picker-view-column
  71. a:if="{{ dataIndex < options.length }}"
  72. class="ant-picker-picker-view-column">
  73. <block
  74. a:for="{{ dataRoot }}"
  75. a:for-index="index"
  76. a:for-item="item">
  77. <view class="ant-picker-content-item">
  78. {{ _sjs.getPickerViewLabel(item) }}
  79. </view>
  80. </block>
  81. </picker-view-column>
  82. </block>
  83. </picker-view>
  84. </block>
  85. <block a:else>
  86. <picker-view class="ant-picker-picker-view">
  87. <picker-view-column class="ant-picker-picker-view-column">
  88. <!-- display: inline -->
  89. <text style="color: #ccc">{{ emptyText }}</text>
  90. </picker-view-column>
  91. </picker-view>
  92. </block>
  93. </view>
  94. </ant-popup>