This commit is contained in:
Ling53666
2025-08-18 09:11:51 +08:00
commit 02554225da
2516 changed files with 133155 additions and 0 deletions

View File

@ -0,0 +1,32 @@
<import-sjs
from="./index.sjs"
name="divider"
></import-sjs>
<view
a:if="{{direction === 'horizontal'}}"
class="ant-divider ant-divider-horizontal {{className || ''}}"
style="{{style || ''}}"
>
<view
class="ant-divider-horizontal-left"
style="flex: {{divider.getLineWidthFlex(textPosition, text)[0]}};{{lineHeight ? 'border-bottom-width:' + lineHeight + 'px;' : ''}}{{lineType ? 'border-bottom-style:' + lineType + ';' : ''}}{{lineColor ? 'border-bottom-color:' + lineColor + ';' : ''}}"
></view>
<slot name="text">
<view
a:if="{{text}}"
class="ant-divider-horizontal-text {{textClassName || ''}}"
style="{{textStyle || ''}}"
>
{{text}}
</view>
</slot>
<view
class="ant-divider-horizontal-right"
style="flex: {{divider.getLineWidthFlex(textPosition, text)[1]}};{{lineHeight ? 'border-bottom-width:' + lineHeight + 'px;' : ''}}{{lineType ? 'border-bottom-style:' + lineType + ';' : ''}}{{lineColor ? 'border-bottom-color:' + lineColor + ';' : ''}}"
></view>
</view>
<view
a:if="{{direction === 'vertical'}}"
class="ant-divider ant-divider-vertical {{className || ''}}"
style="{{style || ''}};{{lineWidth ? 'border-right-width:' + lineWidth + 'px;' : ''}}{{lineType ? 'border-right-style:' + lineType + ';' : ''}}{{lineColor ? 'border-right-color:' + lineColor + ';' : ''}}"
></view>

View File

@ -0,0 +1 @@
export {};

View File

@ -0,0 +1,3 @@
import { Component } from '../_util/simply';
import { DividerFunctionalProps } from './props';
Component(DividerFunctionalProps);

View File

@ -0,0 +1,5 @@
{
"component": true,
"usingComponents": {
}
}

View File

@ -0,0 +1,29 @@
@import (reference) './variable.less';
@import '../style/mixins/hairline.less';
@dividerPrefix: ant-divider;
.@{dividerPrefix}-horizontal {
display: flex;
flex-direction: row;
flex-wrap: wrap;
align-items: center;
padding: @v-spacing-standard 0;
&-text {
font-size: @font-size-subtitle;
color: @COLOR_TEXT_PRIMARY;
margin: 0 32 * @rpx;
}
&-left,
&-right {
border-bottom: @border-width-standard solid @COLOR_BORDER;
}
}
.@{dividerPrefix}-vertical {
margin: 0 16 * @rpx;
height: 32 * @rpx;
border-right: @border-width-standard solid @COLOR_BORDER;
}

View File

@ -0,0 +1,15 @@
var getLineWidthFlex = function getLineWidthFlex(textPosition, text) {
if (!text) {
return [1, 0];
}
if (textPosition === 'left') {
return [1, 5];
}
if (textPosition === 'right') {
return [5, 1];
}
return [1, 1];
};
export default {
getLineWidthFlex: getLineWidthFlex
};

View File

@ -0,0 +1,14 @@
import { IBaseProps } from '../_util/base';
export interface IDividerProps extends IBaseProps {
lineColor: string;
lineHeight: number;
lineType: 'solid' | 'dashed' | 'dotted';
lineWidth: number;
text: string;
textStyle: string;
textClassName: string;
textPosition: 'left' | 'center' | 'right';
direction: 'horizontal' | 'vertical';
}
export declare const DividerDefaultProps: Partial<IDividerProps>;
export declare const DividerFunctionalProps: Partial<IDividerProps>;

View File

@ -0,0 +1,16 @@
export var DividerDefaultProps = {
textPosition: 'center',
direction: 'horizontal',
lineType: 'solid',
};
export var DividerFunctionalProps = {
lineColor: '',
lineHeight: 0,
lineType: 'solid',
lineWidth: 0,
text: '',
textStyle: '',
textClassName: '',
textPosition: 'center',
direction: 'horizontal',
};

View File

@ -0,0 +1 @@
@import (reference) '../style/themes/index.less';