<wxs module="computed" src="./index.wxs"/>

<van-popup
        bind:click-overlay="onClickOverlay"
        bind:close="onClose"
        class="van-share-sheet"
        close-on-click-overlay="{{ closeOnClickOverlay }}"
        duration="{{ duration }}"
        overlay="{{ overlay }}"
        overlay-style="{{ overlayStyle }}"
        position="bottom"
        root-portal="{{ rootPortal }}"
        round
        safe-area-inset-bottom="{{ safeAreaInsetBottom }}"
        show="{{ show }}"
        z-index="{{ zIndex }}"
>
    <view class="van-share-sheet__header">
        <view class="van-share-sheet__title">
            <slot name="title"/>
        </view>
        <view class="van-share-sheet__title" wx:if="{{ title }}">{{ title }}</view>

        <view class="van-share-sheet__description">
            <slot name="description"/>
        </view>
        <view class="van-share-sheet__description" wx:if="{{ description }}">
            {{ description }}
        </view>
    </view>

    <block wx:if="{{ computed.isMulti(options) }}">
        <options
                bind:select="onSelect"
                options="{{ item }}"
                show-border="{{ index !== 0 }}"
                wx:for="{{ options }}"
                wx:key="index"
        />
    </block>

    <options bind:select="onSelect" options="{{ options }}" wx:else/>

    <button bindtap="onCancel" class="van-share-sheet__cancel" type="button">
        {{ cancelText }}
    </button>
</van-popup>
