提交
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: [],
|
||||
};
|
35
甲情_甲意/miniprogram/node_modules/antd-mini/less/Radio/index.axml
generated
vendored
Normal file
35
甲情_甲意/miniprogram/node_modules/antd-mini/less/Radio/index.axml
generated
vendored
Normal file
@ -0,0 +1,35 @@
|
||||
<import-sjs
|
||||
from="./index.sjs"
|
||||
name="componentUtils"
|
||||
></import-sjs>
|
||||
<label
|
||||
class="ant-radio-item {{className || ''}}"
|
||||
style="{{style}}"
|
||||
>
|
||||
<view class="ant-radio-item-container">
|
||||
<view class="ant-radio-item-wrap">
|
||||
<radio
|
||||
value="{{value}}"
|
||||
class="ant-radio-item-base"
|
||||
onChange="onChange"
|
||||
checked="{{mixin.value}}"
|
||||
disabled="{{disabled}}"
|
||||
></radio>
|
||||
<view class="ant-radio-item-fake">
|
||||
<view
|
||||
class="ant-radio-item-fake-{{componentUtils.getClassName(mixin.value, disabled)}}"
|
||||
style="{{mixin.value && !disabled && color ? 'background:' + color : ''}}"
|
||||
>
|
||||
<ant-icon
|
||||
a:if="{{mixin.value}}"
|
||||
type="CheckOutline"
|
||||
className="ant-radio-item-fake-{{componentUtils.getClassName(mixin.value, disabled)}}-icon"
|
||||
></ant-icon>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="ant-radio-item-content {{disabled ? 'ant-radio-item-disabled' : ''}}">
|
||||
<slot></slot>
|
||||
</view>
|
||||
</view>
|
||||
</label>
|
1
甲情_甲意/miniprogram/node_modules/antd-mini/less/Radio/index.d.ts
generated
vendored
Normal file
1
甲情_甲意/miniprogram/node_modules/antd-mini/less/Radio/index.d.ts
generated
vendored
Normal file
@ -0,0 +1 @@
|
||||
export {};
|
17
甲情_甲意/miniprogram/node_modules/antd-mini/less/Radio/index.js
generated
vendored
Normal file
17
甲情_甲意/miniprogram/node_modules/antd-mini/less/Radio/index.js
generated
vendored
Normal file
@ -0,0 +1,17 @@
|
||||
import { Component, triggerEvent } from '../_util/simply';
|
||||
import { RadioDefaultProps } from './props';
|
||||
import mixinValue from '../mixins/value';
|
||||
Component(RadioDefaultProps, {
|
||||
onChange: function (e) {
|
||||
var value = e.detail.value;
|
||||
if (!this.isControlled()) {
|
||||
this.update(value);
|
||||
}
|
||||
triggerEvent(this, 'change', value, e);
|
||||
},
|
||||
}, null, [
|
||||
mixinValue({
|
||||
valueKey: 'checked',
|
||||
defaultValueKey: 'defaultChecked',
|
||||
}),
|
||||
]);
|
6
甲情_甲意/miniprogram/node_modules/antd-mini/less/Radio/index.json
generated
vendored
Normal file
6
甲情_甲意/miniprogram/node_modules/antd-mini/less/Radio/index.json
generated
vendored
Normal file
@ -0,0 +1,6 @@
|
||||
{
|
||||
"component": true,
|
||||
"usingComponents": {
|
||||
"ant-icon": "../Icon/index"
|
||||
}
|
||||
}
|
98
甲情_甲意/miniprogram/node_modules/antd-mini/less/Radio/index.less
generated
vendored
Normal file
98
甲情_甲意/miniprogram/node_modules/antd-mini/less/Radio/index.less
generated
vendored
Normal file
@ -0,0 +1,98 @@
|
||||
@import (reference) './variable.less';
|
||||
|
||||
@radioItemPrefix: ant-radio-item;
|
||||
|
||||
.@{radioItemPrefix} {
|
||||
color: @COLOR_TEXT_PRIMARY;
|
||||
margin-right: 16 * @rpx;
|
||||
|
||||
|
||||
&-container {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
&-content {
|
||||
padding-left: 10 * @rpx;
|
||||
text-align: left;
|
||||
}
|
||||
&-wrap {
|
||||
position: relative;
|
||||
width: @radio-size;
|
||||
height: @radio-size;
|
||||
flex: 0 0 @radio-size;
|
||||
}
|
||||
&-base {
|
||||
position: absolute;
|
||||
top: 0;
|
||||
left: 0;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
z-index: 2;
|
||||
opacity: 0;
|
||||
}
|
||||
&-fake {
|
||||
position: absolute;
|
||||
top: 0;
|
||||
left: 0;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
overflow: hidden;
|
||||
pointer-events: none;
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
&-icon {
|
||||
background-color: @COLOR_CARD;
|
||||
border: @radio-border-width solid @radio-border-color;
|
||||
border-radius: @radio-corner-radius;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
&-checkedIcon {
|
||||
border-radius: @radio-corner-radius;
|
||||
background-color: @radio-background-color;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
&-icon {
|
||||
color: @COLOR_WHITE;
|
||||
font-size: 28 * @rpx;
|
||||
}
|
||||
}
|
||||
&-disbaledIcon {
|
||||
box-sizing: border-box;
|
||||
border: @radio-border-width solid @radio-border-color;
|
||||
border-radius: @radio-corner-radius;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
background-color: @radio-disabled-background;
|
||||
}
|
||||
&-disabledCheckedIcon {
|
||||
box-sizing: border-box;
|
||||
border: @radio-border-width solid @radio-border-color;
|
||||
background-color: @radio-disabled-background;
|
||||
border-radius: @radio-corner-radius;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
&-icon {
|
||||
color: @radio-border-color;
|
||||
font-size: 28 * @rpx;
|
||||
}
|
||||
}
|
||||
}
|
||||
&-disabled {
|
||||
opacity: @opacity-disabled;
|
||||
}
|
||||
// .ant-list-item-image-container {
|
||||
// display: flex;
|
||||
// justify-content: center;
|
||||
// align-items: center;
|
||||
// }
|
||||
}
|
24
甲情_甲意/miniprogram/node_modules/antd-mini/less/Radio/index.sjs
generated
vendored
Normal file
24
甲情_甲意/miniprogram/node_modules/antd-mini/less/Radio/index.sjs
generated
vendored
Normal file
@ -0,0 +1,24 @@
|
||||
function getClassName(checked, disabled) {
|
||||
if (!checked && !disabled) {
|
||||
return 'icon';
|
||||
}
|
||||
if (checked && !disabled) {
|
||||
return 'checkedIcon';
|
||||
}
|
||||
if (!checked && disabled) {
|
||||
return 'disbaledIcon';
|
||||
}
|
||||
if (checked && disabled) {
|
||||
return 'disabledCheckedIcon';
|
||||
}
|
||||
}
|
||||
function getChecked(index, options, value) {
|
||||
if (options[index].value === value) {
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
export default {
|
||||
getClassName: getClassName,
|
||||
getChecked: getChecked
|
||||
};
|
16
甲情_甲意/miniprogram/node_modules/antd-mini/less/Radio/props.d.ts
generated
vendored
Normal file
16
甲情_甲意/miniprogram/node_modules/antd-mini/less/Radio/props.d.ts
generated
vendored
Normal file
@ -0,0 +1,16 @@
|
||||
import { IBaseProps } from '../_util/base';
|
||||
export interface IRadioProps extends IBaseProps {
|
||||
/**
|
||||
* @description 组件值,选中时 change 事件会携带的 value。
|
||||
*/
|
||||
value?: string;
|
||||
defaultChecked?: boolean;
|
||||
/**
|
||||
* @description radio 的颜色,同 CSS 色值。
|
||||
*/
|
||||
color?: string;
|
||||
checked?: boolean;
|
||||
disabled?: boolean;
|
||||
onChange?: (checked: boolean, e: any) => void;
|
||||
}
|
||||
export declare const RadioDefaultProps: Partial<IRadioProps>;
|
7
甲情_甲意/miniprogram/node_modules/antd-mini/less/Radio/props.js
generated
vendored
Normal file
7
甲情_甲意/miniprogram/node_modules/antd-mini/less/Radio/props.js
generated
vendored
Normal file
@ -0,0 +1,7 @@
|
||||
export var RadioDefaultProps = {
|
||||
value: null,
|
||||
defaultChecked: null,
|
||||
color: '',
|
||||
checked: null,
|
||||
disabled: false,
|
||||
};
|
21
甲情_甲意/miniprogram/node_modules/antd-mini/less/Radio/variable.less
generated
vendored
Normal file
21
甲情_甲意/miniprogram/node_modules/antd-mini/less/Radio/variable.less
generated
vendored
Normal file
@ -0,0 +1,21 @@
|
||||
@import (reference) '../style/themes/index.less';
|
||||
// header 颜色
|
||||
@radio-header-color: @COLOR_TEXT_ASSIST;
|
||||
|
||||
/* size | 大小 */
|
||||
@radio-size: @icon-size-sm;
|
||||
|
||||
/* corner-radius | 圆角 */
|
||||
@radio-corner-radius: @corner-radius-circle;
|
||||
|
||||
/* border-width | 边框宽度 */
|
||||
@radio-border-width: @border-width-standard;
|
||||
|
||||
/* color | 边框颜色 */
|
||||
@radio-border-color: @COLOR_TEXT_WEAK;
|
||||
|
||||
/* color | check状态背景色 */
|
||||
@radio-background-color: @COLOR_BRAND1;
|
||||
|
||||
/* color | disabled状态背景色 */
|
||||
@radio-disabled-background: @COLOR_GREY_CARD;
|
Reference in New Issue
Block a user