antd-mini
Advanced tools
Comparing version 0.0.20-beta.1 to 0.0.20
@@ -0,1 +1,14 @@ | ||
## 0.0.20 (2022-08-02) | ||
### Features | ||
* 新增ProgressBar组件 | ||
* 新增Tabbar组件 | ||
* 新增BladeView组件 | ||
* 新增CascaderPicker组件 | ||
* 信息输入相关组件(CheckboxGroup, RadioGroup, Picker, DatePicker, RangePicker, Switch, ItemInput, Selector, SearchBar, Filter, Checklist)事件回调增加event类型支持 | ||
* Badge 增加offsetX, offsetY偏移量属性 | ||
### Bugfix | ||
* 修复Container在淘宝牵牛端异常问题 | ||
* Switch阴影效果修复 | ||
## 0.0.19 (2022-07-19) | ||
@@ -2,0 +15,0 @@ |
@@ -25,3 +25,3 @@ /* eslint-disable @typescript-eslint/no-explicit-any */ | ||
*/ | ||
onChange?: (v: V) => void; | ||
onChange?: (v: V, e: Record<string,any>) => void; | ||
} | ||
@@ -37,7 +37,7 @@ export interface IBaseFormItemProps<V = any> extends IBaseFormItemPropsWithOutFocus<V> { | ||
*/ | ||
onFocus?: (v: V) => void; | ||
onFocus?: (v: V, e: Record<string,any>) => void; | ||
/** | ||
* @description 失去焦点时触发回调 | ||
*/ | ||
onBlur?: (v: V) => void; | ||
onBlur?: (v: V, e: Record<string,any>) => void; | ||
} | ||
@@ -44,0 +44,0 @@ export declare type IconType = string; |
@@ -5,5 +5,6 @@ "use strict"; | ||
function fmtEvent(props, e) { | ||
if (e === void 0) { e = {}; } | ||
var dataset = {}; | ||
for (var key in props) { | ||
if ((/data-/gi).test(key)) { | ||
if (/data-/gi.test(key)) { | ||
dataset[key.replace(/data-/gi, '')] = props[key]; | ||
@@ -10,0 +11,0 @@ } |
@@ -11,4 +11,4 @@ import { IBaseProps } from '../_base'; | ||
*/ | ||
type?: 'dot' | 'number' | 'text' | 'bubble'; | ||
/** | ||
type?: 'dot' | 'number' | 'text' | 'bubble'; | ||
/** | ||
* @description 数字内容,超过 99 会自动变成 99+ | ||
@@ -25,4 +25,22 @@ */ | ||
*/ | ||
placement?: 'top-left' | 'top-center' | 'top-right' | 'left' | 'right' | 'bottom-left' | 'bottom-center' | 'bottom-right' ; | ||
position?: | ||
| 'top-left' | ||
| 'top-center' | ||
| 'top-right' | ||
| 'left' | ||
| 'right' | ||
| 'bottom-left' | ||
| 'bottom-center' | ||
| 'bottom-right'; | ||
/** | ||
* @description 水平方向偏移量(字符串类型,需要带上像素单位) | ||
* @default "-50%" | ||
*/ | ||
offsetX?: string; | ||
/** | ||
* @description 垂直方向偏移量(字符串类型,需要带上像素单位) | ||
* @default "-50%" | ||
*/ | ||
offsetY?: number; | ||
/** | ||
* @description 是否有描边 | ||
@@ -29,0 +47,0 @@ * @default false |
@@ -8,2 +8,3 @@ "use strict"; | ||
var form_1 = tslib_1.__importDefault(require("../mixins/form")); | ||
var fmtEvent_1 = tslib_1.__importDefault(require("../_util/fmtEvent")); | ||
Component({ | ||
@@ -59,3 +60,3 @@ props: props_1.CheckboxGroupDefaultProps, | ||
if (this.props.onChange) { | ||
this.props.onChange.call(this, val); | ||
this.props.onChange.call(this, val, (0, fmtEvent_1.default)(this.props)); | ||
} | ||
@@ -62,0 +63,0 @@ }, |
@@ -6,2 +6,3 @@ "use strict"; | ||
var controlled_1 = tslib_1.__importDefault(require("../mixins/controlled")); | ||
var fmtEvent_1 = tslib_1.__importDefault(require("../_util/fmtEvent")); | ||
Component({ | ||
@@ -32,5 +33,5 @@ props: props_1.ChecklistDefaultProps, | ||
} | ||
this.cOnChange(value, items); | ||
this.cOnChange(value, items, (0, fmtEvent_1.default)(this.props)); | ||
} | ||
}, | ||
}); |
@@ -9,2 +9,3 @@ "use strict"; | ||
var util_1 = require("./util"); | ||
var fmtEvent_1 = tslib_1.__importDefault(require("../_util/fmtEvent")); | ||
Component({ | ||
@@ -144,3 +145,3 @@ mixins: [(0, form_1.default)({ trigger: 'onOk' })], | ||
var date_1 = (0, util_1.getDateByValue)(selectedIndex); | ||
onPickerChange(date_1, (0, dayjs_1.default)(date_1).format(format), selectedIndex); | ||
onPickerChange(date_1, (0, dayjs_1.default)(date_1).format(format), selectedIndex, (0, fmtEvent_1.default)(_this.props)); | ||
} | ||
@@ -153,3 +154,3 @@ }); | ||
var date_2 = (0, util_1.getDateByValue)(selectedIndex); | ||
onPickerChange(date_2, (0, dayjs_1.default)(date_2).format(format), selectedIndex); | ||
onPickerChange(date_2, (0, dayjs_1.default)(date_2).format(format), selectedIndex, (0, fmtEvent_1.default)(this.props)); | ||
} | ||
@@ -161,3 +162,3 @@ } | ||
if (onDismiss) { | ||
onDismiss(); | ||
onDismiss((0, fmtEvent_1.default)(this.props)); | ||
} | ||
@@ -171,3 +172,3 @@ }, | ||
if (this.props.onOk) { | ||
this.props.onOk(date, (0, dayjs_1.default)(date).format(format), currentValue); | ||
this.props.onOk(date, (0, dayjs_1.default)(date).format(format), currentValue, (0, fmtEvent_1.default)(this.props)); | ||
} | ||
@@ -188,3 +189,3 @@ }, | ||
if (onTriggerPicker) { | ||
onTriggerPicker(visible); | ||
onTriggerPicker(visible, (0, fmtEvent_1.default)(this.props)); | ||
} | ||
@@ -191,0 +192,0 @@ }, |
@@ -44,3 +44,3 @@ import { IBaseFormItemPropsWithOutFocus } from '../_base'; | ||
*/ | ||
placeholder?: string; | ||
placeholder?: string; | ||
/** | ||
@@ -54,7 +54,12 @@ * @description 是否受控 | ||
*/ | ||
onOk?: (date: PickerValue, dateStr: string, dateArr: number[]) => void; | ||
onOk?: ( | ||
date: PickerValue, | ||
dateStr: string, | ||
dateArr: number[], | ||
e: Record<string, any> | ||
) => void; | ||
/** | ||
* @description 点击取消回调 | ||
*/ | ||
onDismiss?: () => void; | ||
onDismiss?: (e: Record<string, any>) => void; | ||
/** | ||
@@ -66,3 +71,4 @@ * @description 发生滚动即触发, 与 onChange 点击 ok 后触发不同 | ||
dateStr: string, | ||
dateArr: number[] | ||
dateArr: number[], | ||
e: Record<string, any> | ||
) => void; | ||
@@ -83,4 +89,4 @@ /** | ||
*/ | ||
onTriggerPicker?: (visible) => void; | ||
onTriggerPicker?: (visible, e: Record<string, any>) => void; | ||
} | ||
export declare const DatePickerDefaultProps: Partial<IDatePickerProps>; |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
var tslib_1 = require("tslib"); | ||
/* eslint-disable @typescript-eslint/no-explicit-any */ var props_1 = require("./props"); | ||
var context_1 = require("../context"); | ||
var fmtEvent_1 = tslib_1.__importDefault(require("../../_util/fmtEvent")); | ||
Component({ | ||
@@ -27,3 +29,3 @@ props: props_1.FilterItemDefaultProps, | ||
if (show && onOpen) { | ||
onOpen(); | ||
onOpen((0, fmtEvent_1.default)(_this.props)); | ||
} | ||
@@ -60,2 +62,3 @@ }; | ||
return; | ||
var event = (0, fmtEvent_1.default)(this.props); | ||
if (this.props.type === 'multiple') { | ||
@@ -66,3 +69,3 @@ this.setData({ | ||
}); | ||
this.props.onChange(v); | ||
this.props.onChange(v, event); | ||
return; | ||
@@ -75,3 +78,3 @@ } | ||
// 单选 | ||
this.props.onChange(v); | ||
this.props.onChange(v, event); | ||
this.setActive(v.length > 0); | ||
@@ -89,2 +92,3 @@ // 箭头动画 | ||
confirmSelector: function () { | ||
var event = (0, fmtEvent_1.default)(this.props); | ||
// 多选 | ||
@@ -97,3 +101,3 @@ if (typeof this.props.onChange !== 'function') | ||
}); | ||
this.props.onChange(this.data.curValue); | ||
this.props.onChange(this.data.curValue, event); | ||
this.setActive(this.data.curValue.length > 0); | ||
@@ -100,0 +104,0 @@ // 箭头动画 |
@@ -20,7 +20,7 @@ /* eslint-disable @typescript-eslint/no-explicit-any */ | ||
*/ | ||
onChange?: (v: any) => void; | ||
onChange?: (v: any, e: Record<string,any>) => void; | ||
/** | ||
* @description 面板展开是触发,以便用户可以滚动定位 | ||
*/ | ||
onOpen?: () => void; | ||
onOpen?: (e: Record<string,any>) => void; | ||
/** | ||
@@ -27,0 +27,0 @@ * @description type=default type=multiple 有效,为 selector 所需数据 |
{ | ||
"component":true, | ||
"usingComponents": { | ||
"list":"../../List/index" | ||
} | ||
} | ||
"component": true, | ||
"usingComponents": {} | ||
} |
@@ -7,2 +7,3 @@ "use strict"; | ||
var form_1 = tslib_1.__importDefault(require("../mixins/form")); | ||
var fmtEvent_1 = tslib_1.__importDefault(require("../_util/fmtEvent")); | ||
var store_1 = require("../Form/store"); | ||
@@ -32,3 +33,3 @@ Component({ | ||
var value = e.detail.value; | ||
onBlur(value); | ||
onBlur(value, (0, fmtEvent_1.default)(this.props, e)); | ||
} | ||
@@ -42,3 +43,3 @@ }, | ||
var value = e.detail.value; | ||
onConfirm(value); | ||
onConfirm(value, (0, fmtEvent_1.default)(this.props, e)); | ||
} | ||
@@ -52,3 +53,3 @@ }, | ||
var value = e.detail.value; | ||
onFocus(value); | ||
onFocus(value, (0, fmtEvent_1.default)(this.props, e)); | ||
} | ||
@@ -60,3 +61,3 @@ }, | ||
var value = e.detail.value; | ||
this.cOnChange(value); | ||
this.cOnChange(value, (0, fmtEvent_1.default)(this.props, e)); | ||
} | ||
@@ -73,7 +74,7 @@ }, | ||
}, | ||
onClear: function () { | ||
onClear: function (e) { | ||
this.hideClear(); | ||
var _a = this.props, onClear = _a.onClear, controlled = _a.controlled; | ||
if (onClear) { | ||
onClear(''); | ||
onClear('', (0, fmtEvent_1.default)(this.props, e)); | ||
} | ||
@@ -80,0 +81,0 @@ if (!controlled) { |
@@ -34,3 +34,3 @@ "use strict"; | ||
exports.default = (function (propsValue) { | ||
if (propsValue === void 0) { propsValue = "value"; } | ||
if (propsValue === void 0) { propsValue = 'value'; } | ||
return ({ | ||
@@ -56,15 +56,23 @@ data: { | ||
methods: { | ||
cOnChange: function (v, v1) { | ||
cOnChange: function (v) { | ||
var _a, _b; | ||
var args = []; | ||
for (var _i = 1; _i < arguments.length; _i++) { | ||
args[_i - 1] = arguments[_i]; | ||
} | ||
if (!this.props.controlled) { | ||
this.cTrigger(v); | ||
} | ||
(_b = (_a = this.props).onChange) === null || _b === void 0 ? void 0 : _b.call(_a, v, v1); | ||
(_b = (_a = this.props).onChange) === null || _b === void 0 ? void 0 : _b.call.apply(_b, tslib_1.__spreadArray([_a, v], args, false)); | ||
}, | ||
cOnInput: function (v, v1) { | ||
cOnInput: function (v) { | ||
var _a, _b; | ||
var args = []; | ||
for (var _i = 1; _i < arguments.length; _i++) { | ||
args[_i - 1] = arguments[_i]; | ||
} | ||
if (!this.props.controlled) { | ||
this.cTrigger(v); | ||
} | ||
(_b = (_a = this.props).onInput) === null || _b === void 0 ? void 0 : _b.call(_a, v, v1); | ||
(_b = (_a = this.props).onInput) === null || _b === void 0 ? void 0 : _b.call.apply(_b, tslib_1.__spreadArray([_a, v], args, false)); | ||
}, | ||
@@ -71,0 +79,0 @@ }, |
@@ -9,2 +9,3 @@ "use strict"; | ||
var utils_1 = require("./utils"); | ||
var fmtEvent_1 = tslib_1.__importDefault(require("../_util/fmtEvent")); | ||
Component({ | ||
@@ -132,3 +133,3 @@ mixins: [(0, controlled_1.default)(), (0, form_1.default)({ trigger: 'onOk' })], | ||
if (onTriggerPicker) { | ||
onTriggerPicker(visible); | ||
onTriggerPicker(visible, (0, fmtEvent_1.default)(this.props)); | ||
} | ||
@@ -143,3 +144,3 @@ }, | ||
if (onDismiss) { | ||
return onDismiss(); | ||
return onDismiss((0, fmtEvent_1.default)(this.props)); | ||
} | ||
@@ -154,3 +155,3 @@ }, | ||
if (onChange) { | ||
onChange.call(this, matchedValues, matchedColumn); | ||
onChange.call(this, matchedValues, matchedColumn, (0, fmtEvent_1.default)(this.props, e)); | ||
} | ||
@@ -176,3 +177,3 @@ }, | ||
if (!this.props.onBeforeOk) return [3 /*break*/, 2]; | ||
return [4 /*yield*/, this.props.onBeforeOk(matchedValues, matchedColumn)]; | ||
return [4 /*yield*/, this.props.onBeforeOk(matchedValues, matchedColumn, (0, fmtEvent_1.default)(this.props))]; | ||
case 1: | ||
@@ -189,3 +190,3 @@ isContinue = _a.sent(); | ||
if (this.props.onOk) { | ||
this.props.onOk.call(this, matchedValues, matchedColumn); | ||
this.props.onOk.call(this, matchedValues, matchedColumn, (0, fmtEvent_1.default)(this.props)); | ||
} | ||
@@ -192,0 +193,0 @@ return [2 /*return*/]; |
@@ -7,3 +7,3 @@ import { IBaseFormItemPropsWithOutFocus } from '../_base'; | ||
} | ||
export declare type PickerValue = string| number| (string | number)[]; | ||
export declare type PickerValue = string | number | (string | number)[]; | ||
/** | ||
@@ -47,34 +47,38 @@ * @description 选择器,包括一个或多个不同值的可滚动列表,每个值可以在视图的中心以较暗的文本形式显示。当用户激活 **Picker** 后,将会从底部弹出。 | ||
/** | ||
* @description 点击确认回调 | ||
* @description 点击确认前回调 | ||
*/ | ||
onOk?: (value: PickerValue, column: PickerData) => void; | ||
onBeforeOk?: ( | ||
value: PickerValue, | ||
column: PickerData, | ||
e: Record<string, any> | ||
) => boolean; | ||
/** | ||
* @description 点击确认前回调 | ||
* @description 点击确认回调 | ||
*/ | ||
onBeforeOk?: (value: PickerValue, column: PickerData) => boolean; | ||
onOk?: ( | ||
value: PickerValue, | ||
column: PickerData, | ||
e: Record<string, any> | ||
) => void; | ||
/** | ||
* @description 点击取消回调 | ||
*/ | ||
onDismiss?: () => void; | ||
onDismiss?: (e: Record<string, any>) => void; | ||
/** | ||
* @description 发生滚动即触发, 与 onChange 点击 ok 后触发不同 | ||
*/ | ||
onChange?: (value: PickerValue, column:PickerData) => void; | ||
onChange?: ( | ||
value: PickerValue, | ||
column: PickerData, | ||
e: Record<string, any> | ||
) => void; | ||
/** | ||
* @description 选中值的文本显示格式 | ||
*/ | ||
onFormat?: ( | ||
value: PickerValue, | ||
column: PickerValue, | ||
data | ||
) => string; | ||
onFormat?: (value: PickerValue, column: PickerValue, data) => string; | ||
/** | ||
* @description 切换显示隐藏 | ||
*/ | ||
onTriggerPicker?: (visible) => void; | ||
onTriggerPicker?: (visible: boolean, e: Record<string,any>) => void; | ||
} | ||
export declare const PickerDefaultProps: Partial<IPickerProps>; |
@@ -8,2 +8,3 @@ "use strict"; | ||
var form_1 = tslib_1.__importDefault(require("../mixins/form")); | ||
var fmtEvent_1 = tslib_1.__importDefault(require("../_util/fmtEvent")); | ||
Component({ | ||
@@ -21,3 +22,3 @@ props: props_1.RadioGroupDefaultProps, | ||
context_1.componentContext.onUpdate(key, function (v) { | ||
_this.cOnChange(v); | ||
_this.cOnChange(v, (0, fmtEvent_1.default)(_this.props)); | ||
}); | ||
@@ -24,0 +25,0 @@ }, |
@@ -10,2 +10,3 @@ "use strict"; | ||
var util_1 = require("../DatePicker/util"); | ||
var fmtEvent_1 = tslib_1.__importDefault(require("../_util/fmtEvent")); | ||
Component({ | ||
@@ -223,3 +224,3 @@ mixins: [computed_1.default, (0, form_1.default)({ trigger: 'onOk' })], | ||
if (onPickerChange) { | ||
onPickerChange(pickerType, date, (0, dayjs_1.default)(date).format(format), selectedIndex); | ||
onPickerChange(pickerType, date, (0, dayjs_1.default)(date).format(format), selectedIndex, (0, fmtEvent_1.default)(_this.props)); | ||
} | ||
@@ -231,3 +232,3 @@ }); | ||
if (onPickerChange) { | ||
onPickerChange(pickerType, date, (0, dayjs_1.default)(date).format(format), selectedIndex); | ||
onPickerChange(pickerType, date, (0, dayjs_1.default)(date).format(format), selectedIndex, (0, fmtEvent_1.default)(this.props)); | ||
} | ||
@@ -239,3 +240,3 @@ } | ||
if (onDismiss) { | ||
onDismiss(); | ||
onDismiss((0, fmtEvent_1.default)(this.props)); | ||
} | ||
@@ -249,3 +250,3 @@ }, | ||
if (this.props.onOk) { | ||
this.props.onOk(cValue, cValue.map(function (v) { return (0, dayjs_1.default)(v).format(format); }), cValue.map(function (v) { return (0, util_1.getValueByDate)(v, precision); })); | ||
this.props.onOk(cValue, cValue.map(function (v) { return (0, dayjs_1.default)(v).format(format); }), cValue.map(function (v) { return (0, util_1.getValueByDate)(v, precision); }), (0, fmtEvent_1.default)(this.props)); | ||
} | ||
@@ -274,3 +275,3 @@ }, | ||
if (onTriggerPicker) { | ||
onTriggerPicker(visible); | ||
onTriggerPicker(visible, (0, fmtEvent_1.default)(this.props)); | ||
} | ||
@@ -277,0 +278,0 @@ this._visible = visible; |
@@ -44,3 +44,3 @@ import { IBaseFormItemPropsWithOutFocus } from '../_base'; | ||
*/ | ||
placeholder?: string; | ||
placeholder?: string; | ||
/** | ||
@@ -57,3 +57,4 @@ * @description 是否受控 | ||
dateStr: [string, string], | ||
dateArr: [number[], number[]] | ||
dateArr: [number[], number[]], | ||
e: Record<string, any> | ||
) => void; | ||
@@ -63,3 +64,3 @@ /** | ||
*/ | ||
onDismiss?: () => void; | ||
onDismiss?: (e: Record<string, any>) => void; | ||
/** | ||
@@ -72,3 +73,4 @@ * @description 发生滚动即触发, 与 onChange 点击 ok 后触发不同 | ||
dateStr: string, | ||
dateArr: number[] | ||
dateArr: number[], | ||
e: Record<string, any> | ||
) => void; | ||
@@ -93,3 +95,3 @@ /** | ||
*/ | ||
onTriggerPicker?: (visible) => void; | ||
onTriggerPicker?: (visible, e: Record<string, any>) => void; | ||
/** | ||
@@ -96,0 +98,0 @@ * @description 显示连接符 |
@@ -6,2 +6,3 @@ "use strict"; | ||
var controlled_1 = tslib_1.__importDefault(require("../mixins/controlled")); | ||
var fmtEvent_1 = tslib_1.__importDefault(require("../_util/fmtEvent")); | ||
Component({ | ||
@@ -18,3 +19,3 @@ mixins: [(0, controlled_1.default)()], | ||
var value = e.detail.value; | ||
onSubmit(value); | ||
onSubmit(value, (0, fmtEvent_1.default)(this.props, e)); | ||
} | ||
@@ -26,3 +27,3 @@ }, | ||
var value = e.detail.value; | ||
this.cOnInput(value); | ||
this.cOnInput(value, (0, fmtEvent_1.default)(this.props, e)); | ||
} | ||
@@ -33,3 +34,3 @@ }, | ||
if (onClear) { | ||
onClear(''); | ||
onClear('', (0, fmtEvent_1.default)(this.props)); | ||
} | ||
@@ -49,12 +50,12 @@ this.clearcValue(); | ||
if (onCancel) { | ||
onCancel(''); | ||
onCancel('', (0, fmtEvent_1.default)(this.props)); | ||
} | ||
this.clearcValue(); | ||
}, | ||
onBizIconTap: function () { | ||
onBizIconTap: function (e) { | ||
if (typeof this.props.onBizIconTap === 'function') { | ||
this.props.onBizIconTap(); | ||
this.props.onBizIconTap((0, fmtEvent_1.default)(this.props, e)); | ||
} | ||
else if (typeof this.props.onVoiceTap === 'function') { | ||
this.props.onVoiceTap(); | ||
this.props.onVoiceTap((0, fmtEvent_1.default)(this.props, e)); | ||
} | ||
@@ -69,3 +70,3 @@ }, | ||
var value = e.detail.value; | ||
onFocus(value); | ||
onFocus(value, (0, fmtEvent_1.default)(this.props, e)); | ||
} | ||
@@ -80,3 +81,3 @@ }, | ||
var value = e.detail.value; | ||
onBlur(value); | ||
onBlur(value, (0, fmtEvent_1.default)(this.props, e)); | ||
} | ||
@@ -83,0 +84,0 @@ }, |
@@ -75,3 +75,3 @@ import { IBaseFormItemProps } from '../_base'; | ||
*/ | ||
onBizIconTap?: () => void; | ||
onBizIconTap?: (e: Record<string,any>) => void; | ||
@@ -81,7 +81,7 @@ /** | ||
*/ | ||
onCancel?: (v: string) => void; | ||
onCancel?: (v: string, e: Record<string,any>) => void; | ||
/** | ||
* @description 点击删除回调 | ||
*/ | ||
onClear?: (v: string) => void; | ||
onClear?: (v: string, e: Record<string,any>) => void; | ||
@@ -91,3 +91,3 @@ /** | ||
*/ | ||
onInput?: (v: string) => void; | ||
onInput?: (v: string, e: Record<string,any>) => void; | ||
@@ -97,3 +97,3 @@ /** | ||
*/ | ||
onSubmit?: (v: string) => void; | ||
onSubmit?: (v: string, e: Record<string,any>) => void; | ||
@@ -104,5 +104,5 @@ /** | ||
*/ | ||
onVoiceTap?: () => void; | ||
onVoiceTap?: (e: Record<string,any>) => void; | ||
} | ||
export declare const SearchBarDefaultProps: Partial<ISearchBarProps>; |
@@ -7,2 +7,3 @@ "use strict"; | ||
var form_1 = tslib_1.__importDefault(require("../mixins/form")); | ||
var fmtEvent_1 = tslib_1.__importDefault(require("../_util/fmtEvent")); | ||
var getFixedValue = function (value, multiple) { | ||
@@ -27,2 +28,3 @@ var fixedValue = []; | ||
var _a; | ||
var event = (0, fmtEvent_1.default)(this.props); | ||
var _b = e.currentTarget.dataset, disabled = _b.disabled, value = _b.value; | ||
@@ -37,3 +39,3 @@ var _c = this.props, multiple = _c.multiple, items = _c.items, maxSelectedCount = _c.maxSelectedCount, minSelectedCount = _c.minSelectedCount, onSelectMax = _c.onSelectMax, onSelectMin = _c.onSelectMin; | ||
if (onSelectMax) { | ||
onSelectMax(value, items.find(function (v) { return v.value === value; })); | ||
onSelectMax(value, items.find(function (v) { return v.value === value; }), event); | ||
} | ||
@@ -47,3 +49,3 @@ return; | ||
if (onSelectMin) { | ||
onSelectMin(value, items.find(function (v) { return v.value === value; })); | ||
onSelectMin(value, items.find(function (v) { return v.value === value; }), event); | ||
} | ||
@@ -72,3 +74,3 @@ return; | ||
var selectedItems = nextValue_1.map(function (v) { var _a; return (_a = items.filter(function (item) { return item.value === v; })) === null || _a === void 0 ? void 0 : _a[0]; }); | ||
this.cOnChange(nextValue_1, selectedItems); | ||
this.cOnChange(nextValue_1, selectedItems, event); | ||
} | ||
@@ -87,3 +89,3 @@ else { | ||
var selectedItem = ((_a = items.filter(function (item) { return item.value === nextValue_1; })) === null || _a === void 0 ? void 0 : _a[0]) || null; | ||
this.cOnChange(nextValue_1, selectedItem); | ||
this.cOnChange(nextValue_1, selectedItem, event); | ||
} | ||
@@ -90,0 +92,0 @@ } |
@@ -67,8 +67,8 @@ import { IBaseFormItemPropsWithOutFocus } from '../_base'; | ||
*/ | ||
onSelectMax(value: string, item: ISelectorItem): void; | ||
onSelectMax(value: string, item: ISelectorItem, e: Record<string, any>): void; | ||
/** | ||
* @description 触发最小限制 | ||
*/ | ||
onSelectMin(value: string, item: ISelectorItem): void; | ||
onSelectMin(value: string, item: ISelectorItem, e: Record<string, any>): void; | ||
} | ||
export declare const SelectorDefaultProps: Partial<ISelectorProps>; |
@@ -9,2 +9,3 @@ "use strict"; | ||
var form_1 = tslib_1.__importDefault(require("../mixins/form")); | ||
var fmtEvent_1 = tslib_1.__importDefault(require("../_util/fmtEvent")); | ||
Component({ | ||
@@ -61,3 +62,3 @@ mixins: [computed_1.default, (0, controlled_1.default)(), (0, form_1.default)()], | ||
var value = e.detail.value; | ||
(_b = (_a = this.props).onFocus) === null || _b === void 0 ? void 0 : _b.call(_a, value); | ||
(_b = (_a = this.props).onFocus) === null || _b === void 0 ? void 0 : _b.call(_a, value, (0, fmtEvent_1.default)(this.props, e)); | ||
}, | ||
@@ -64,0 +65,0 @@ onBlur: function (e) { |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
var tslib_1 = require("tslib"); | ||
var props_1 = require("./props"); | ||
var fmtEvent_1 = tslib_1.__importDefault(require("../_util/fmtEvent")); | ||
Component({ | ||
@@ -24,7 +26,8 @@ props: props_1.TermsDefaultProps, | ||
if (onChange) { | ||
var event = (0, fmtEvent_1.default)(this.props); | ||
if (_getCurrentField) { | ||
return onChange.call(this.props, v); | ||
return onChange.call(this.props, v, event); | ||
} | ||
else { | ||
return onChange(v); | ||
return onChange(v, event); | ||
} | ||
@@ -35,3 +38,3 @@ } | ||
if (typeof this.props.onMainBtnTap === 'function') { | ||
this.props.onMainBtnTap(); | ||
this.props.onMainBtnTap((0, fmtEvent_1.default)(this.props)); | ||
} | ||
@@ -41,3 +44,3 @@ }, | ||
if (typeof this.props.onSubBtnTap === 'function') { | ||
this.props.onSubBtnTap(); | ||
this.props.onSubBtnTap((0, fmtEvent_1.default)(this.props)); | ||
} | ||
@@ -44,0 +47,0 @@ }, |
@@ -20,3 +20,2 @@ | ||
* @description 说明文本 | ||
* @default 同意《用户授权协议》 | ||
*/ | ||
@@ -26,3 +25,3 @@ term?: string; | ||
* @description 主按钮文本 | ||
* @default 提交 | ||
* @default '提交' | ||
*/ | ||
@@ -34,3 +33,11 @@ mainButtonText?: string; | ||
addonButtonText?: string; | ||
/** | ||
* @description 点击主按钮 | ||
*/ | ||
onMainBtnTap?(e: Record<string,any>): void; | ||
/** | ||
* @description 点击辅助按钮 | ||
*/ | ||
onSubBtnTap?(e: Record<string,any>): void; | ||
} | ||
export declare const TermsDefaultProps: Partial<ITermsProps>; |
{ | ||
"name": "antd-mini", | ||
"version": "0.0.20-beta.1", | ||
"version": "0.0.20", | ||
"scripts": { | ||
@@ -5,0 +5,0 @@ "dev": "minidev dev --no-source-map", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
572769
508
10494