提交
This commit is contained in:
70
甲情_甲意/miniprogram/node_modules/antd-mini/less/Radio/RadioGroup/index.axml
generated
vendored
Normal file
70
甲情_甲意/miniprogram/node_modules/antd-mini/less/Radio/RadioGroup/index.axml
generated
vendored
Normal file
@ -0,0 +1,70 @@
|
||||
<import-sjs
|
||||
from="../index.sjs"
|
||||
name="componentUtils"
|
||||
></import-sjs>
|
||||
<list
|
||||
className="ant-radio-group {{className ? className : ''}} ant-radio-group-{{position}}"
|
||||
style="{{style}}"
|
||||
>
|
||||
<radio-group
|
||||
name="{{name}}"
|
||||
value="{{mixin.value}}"
|
||||
>
|
||||
<view class="ant-radio-group-body">
|
||||
<block a:if="{{position === 'vertical'}}">
|
||||
<block
|
||||
a:for="{{options}}"
|
||||
a:for-index="index"
|
||||
a:for-item="item"
|
||||
>
|
||||
<list-item>
|
||||
<radio
|
||||
checked="{{componentUtils.getChecked(index, options, mixin.value)}}"
|
||||
data-index="{{index}}"
|
||||
value="{{item.value}}"
|
||||
disabled="{{disabled || item.disabled}}"
|
||||
color="{{item.color || color}}"
|
||||
onChange="onChange"
|
||||
>
|
||||
<slot
|
||||
name="label"
|
||||
value="{{item}}"
|
||||
index="{{index}}"
|
||||
>
|
||||
<view class="ant-radio-group-item-label-default">
|
||||
{{item.label}}
|
||||
</view>
|
||||
</slot>
|
||||
</radio>
|
||||
</list-item>
|
||||
</block>
|
||||
</block>
|
||||
<block a:else>
|
||||
<block
|
||||
a:for="{{options}}"
|
||||
a:for-index="index"
|
||||
a:for-item="item"
|
||||
>
|
||||
<radio
|
||||
checked="{{componentUtils.getChecked(index, options, mixin.value)}}"
|
||||
data-index="{{index}}"
|
||||
value="{{item.value}}"
|
||||
disabled="{{disabled || item.disabled}}"
|
||||
color="{{item.color || color}}"
|
||||
onChange="onChange"
|
||||
>
|
||||
<slot
|
||||
name="label"
|
||||
value="{{item}}"
|
||||
index="{{index}}"
|
||||
>
|
||||
<view class="ant-radio-group-item-label-default">
|
||||
{{item.label}}
|
||||
</view>
|
||||
</slot>
|
||||
</radio>
|
||||
</block>
|
||||
</block>
|
||||
</view>
|
||||
</radio-group>
|
||||
</list>
|
1
甲情_甲意/miniprogram/node_modules/antd-mini/less/Radio/RadioGroup/index.d.ts
generated
vendored
Normal file
1
甲情_甲意/miniprogram/node_modules/antd-mini/less/Radio/RadioGroup/index.d.ts
generated
vendored
Normal file
@ -0,0 +1 @@
|
||||
export {};
|
16
甲情_甲意/miniprogram/node_modules/antd-mini/less/Radio/RadioGroup/index.js
generated
vendored
Normal file
16
甲情_甲意/miniprogram/node_modules/antd-mini/less/Radio/RadioGroup/index.js
generated
vendored
Normal file
@ -0,0 +1,16 @@
|
||||
import { Component, triggerEvent, getValueFromProps } from '../../_util/simply';
|
||||
import { RadioGroupDefaultProps } from './props';
|
||||
import mixinValue from '../../mixins/value';
|
||||
Component(RadioGroupDefaultProps, {
|
||||
onChange: function (_, e) {
|
||||
var event;
|
||||
event = e;
|
||||
var index = event.currentTarget.dataset.index;
|
||||
var options = getValueFromProps(this, 'options');
|
||||
var value = options[index].value;
|
||||
if (!this.isControlled()) {
|
||||
this.update(value);
|
||||
}
|
||||
triggerEvent(this, 'change', value, event);
|
||||
},
|
||||
}, null, [mixinValue()]);
|
8
甲情_甲意/miniprogram/node_modules/antd-mini/less/Radio/RadioGroup/index.json
generated
vendored
Normal file
8
甲情_甲意/miniprogram/node_modules/antd-mini/less/Radio/RadioGroup/index.json
generated
vendored
Normal file
@ -0,0 +1,8 @@
|
||||
{
|
||||
"component": true,
|
||||
"usingComponents": {
|
||||
"list": "../../List/index",
|
||||
"list-item": "../../List/ListItem/index",
|
||||
"radio": "../index"
|
||||
}
|
||||
}
|
50
甲情_甲意/miniprogram/node_modules/antd-mini/less/Radio/RadioGroup/index.less
generated
vendored
Normal file
50
甲情_甲意/miniprogram/node_modules/antd-mini/less/Radio/RadioGroup/index.less
generated
vendored
Normal file
@ -0,0 +1,50 @@
|
||||
@import (reference) '../variable.less';
|
||||
|
||||
@radioGroupPrefix: ant-radio-group;
|
||||
|
||||
.@{radioGroupPrefix} {
|
||||
&-horizontal {
|
||||
.@{radioGroupPrefix}-body {
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
justify-content: flex-start;
|
||||
|
||||
.ant-list-item-line {
|
||||
padding-right: 0;
|
||||
}
|
||||
|
||||
.ant-radio-item {
|
||||
flex-flow: 0;
|
||||
}
|
||||
|
||||
.ant-list-item-line::after {
|
||||
display: none;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
&-header:empty,
|
||||
&-footer:empty {
|
||||
display: none;
|
||||
}
|
||||
|
||||
&-header,
|
||||
&-footer {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
padding: @v-spacing-standard @v-spacing-large;
|
||||
line-height: 1.4;
|
||||
font-size: 30 * @rpx;
|
||||
color: @radio-header-color;
|
||||
}
|
||||
|
||||
&-body {
|
||||
position: relative;
|
||||
overflow: hidden;
|
||||
.ant-radio-item-content {
|
||||
.ant-radio-group-item-label-default:not(:nth-child(1)) {
|
||||
display: none;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
17
甲情_甲意/miniprogram/node_modules/antd-mini/less/Radio/RadioGroup/props.d.ts
generated
vendored
Normal file
17
甲情_甲意/miniprogram/node_modules/antd-mini/less/Radio/RadioGroup/props.d.ts
generated
vendored
Normal file
@ -0,0 +1,17 @@
|
||||
import { IBaseProps } from '../../_util/base';
|
||||
export interface IRadioGroupProps extends IBaseProps {
|
||||
value: string;
|
||||
defaultValue: string;
|
||||
name: string;
|
||||
disabled?: boolean;
|
||||
color: string;
|
||||
position: 'horizontal' | 'vertical';
|
||||
onChange?: (value: string, e: any) => void;
|
||||
options: {
|
||||
label?: string;
|
||||
value?: string;
|
||||
disabled?: boolean;
|
||||
color?: string;
|
||||
}[];
|
||||
}
|
||||
export declare const RadioGroupDefaultProps: Partial<IRadioGroupProps>;
|
9
甲情_甲意/miniprogram/node_modules/antd-mini/less/Radio/RadioGroup/props.js
generated
vendored
Normal file
9
甲情_甲意/miniprogram/node_modules/antd-mini/less/Radio/RadioGroup/props.js
generated
vendored
Normal file
@ -0,0 +1,9 @@
|
||||
export var RadioGroupDefaultProps = {
|
||||
value: null,
|
||||
defaultValue: null,
|
||||
name: '',
|
||||
disabled: false,
|
||||
color: '',
|
||||
position: 'vertical',
|
||||
options: [],
|
||||
};
|
Reference in New Issue
Block a user