Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

antd-mini

Package Overview
Dependencies
Maintainers
4
Versions
216
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

antd-mini - npm Package Compare versions

Comparing version 0.0.12 to 0.0.13-beta.1

CHANGELOG.md

4

es/Button/props.d.ts

@@ -77,3 +77,7 @@ /* eslint-disable @typescript-eslint/no-explicit-any */

fill?: 'outline' | 'solid' | 'none';
/**
* @description 是否阻止事件冒泡
*/
stopPropagation?: boolean;
}
export declare const ButtonDefaultProps: Partial<IButtonProps>;

3

es/Button/props.js

@@ -15,4 +15,5 @@ "use strict";

_submit: undefined,
fill: 'solid'
fill: 'solid',
stopPropagation: false
};
exports.ButtonDefaultProps = ButtonDefaultProps;

@@ -15,3 +15,5 @@ "use strict";

},
// 阻止事件冒泡
emptyEvent: function () { },
},
});

@@ -8,4 +8,5 @@ "use strict";

var CheckboxDefaultProps = {
disabled: false
disabled: false,
checked: false
};
exports.CheckboxDefaultProps = CheckboxDefaultProps;

@@ -11,4 +11,6 @@ "use strict";

uid: 'CheckboxGroup',
controlled: false
controlled: false,
position: 'vertical',
value: []
};
exports.CheckboxGroupDefaultProps = CheckboxGroupDefaultProps;

@@ -11,8 +11,17 @@ "use strict";

},
deriveDataFromProps: function (nextProps) {
var value = nextProps.value, optionValue = nextProps.optionValue;
if ((0, fast_deep_equal_1.default)(this.props.value, value))
didMount: function () {
var checked = this.getChecked();
this.setData({
checked: checked
});
},
didUpdate: function (prevProps) {
var value = prevProps.value, item = prevProps.item, multiple = prevProps.multiple;
if ((0, fast_deep_equal_1.default)(this.props.value, value) &&
(0, fast_deep_equal_1.default)(this.props.item, item) &&
(0, fast_deep_equal_1.default)(this.props.multiple, multiple))
return;
var checked = this.getChecked();
this.setData({
checked: value.indexOf(optionValue) !== -1 ? true : false
checked: checked
});

@@ -27,17 +36,39 @@ },

});
onChange && onChange.call(this.props, this.getValues(!checked));
var value = this.getValues(!checked);
onChange && onChange.call(this.props, value);
},
getChecked: function () {
var _a = this.props, multiple = _a.multiple, item = _a.item, value = _a.value;
if (!multiple) {
return value === item.value;
}
var valueArr = [];
if (!Array.isArray(value)) {
valueArr = [value];
}
else {
valueArr = value.slice();
}
return valueArr.indexOf(item.value) > -1;
},
getValues: function (checked) {
var _a = this.props, optionValue = _a.optionValue, value = _a.value, multiple = _a.multiple;
var _a = this.props, multiple = _a.multiple, item = _a.item, value = _a.value;
if (!multiple) {
return [optionValue];
return checked ? item.value : '';
}
if (checked && !value.includes(optionValue)) {
return value.concat([optionValue]);
var valueArr = value;
if (!Array.isArray(value)) {
valueArr = [value];
}
else {
return value.filter(function (item) { return item !== optionValue; });
valueArr = value.slice();
}
if (checked && valueArr.indexOf(item.value) === -1) {
return valueArr.concat([item.value]);
}
else {
return valueArr.filter(function (v) { return v !== item.value; });
}
}
},
});
import { IBaseProps } from '../../_base';
import { ChecklistItem } from '../props'

@@ -9,18 +10,2 @@ /**

/**
* @description 当前选项的描述文案
*/
description: string;
/**
* @description 当前选项是否禁用
* @default false
*/
disabled: boolean;
/**
* @description 当前选项的图片
*/
image: string;
/**
* @description 是否支持多选

@@ -31,18 +16,9 @@ * @default false

/**
* @description 当前选项的选项值
* @default ''
*/
optionValue: string | number;
item: ChecklistItem
/**
* @description 当前选项是否只读
* @default false
*/
readOnly: boolean;
/**
* @description 可勾选列表的值
*/
value: Array<string | number>;
value: Array<string | number>| string| number;

@@ -49,0 +25,0 @@ /**

@@ -8,6 +8,5 @@ "use strict";

var ChecklistItemDefaultProps = {
disabled: false,
multiple: false,
readOnly: false
item: {}
};
exports.ChecklistItemDefaultProps = ChecklistItemDefaultProps;
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var tslib_1 = require("tslib");
var props_1 = require("./props");
var controlled_1 = tslib_1.__importDefault(require("../mixins/controlled"));
Component({
props: props_1.ChecklistDefaultProps,
data: {
value: []
},
mixins: [(0, controlled_1.default)()],
didMount: function () {
var defaultValue = this.props.defaultValue;
this.setData({
value: defaultValue
});
},
methods: {
onChange: function (v) {
var onChange = this.props.onChange;
var _a = this.props, multiple = _a.multiple, value = _a.value;
if (multiple && !Array.isArray(value)) {
this.setData({
value: v
cValue: []
});
onChange && onChange.call(this.props, v);
}
},
methods: {
onChange: function (value) {
var _a;
var _b = this.props, multiple = _b.multiple, options = _b.options;
var items = null;
if (multiple && Array.isArray(value)) {
items = value.map(function (v) {
var _a;
return (_a = options.filter(function (o) { return o.value === v; })) === null || _a === void 0 ? void 0 : _a[0];
});
}
else {
items = (_a = options.filter(function (o) { return o.value === value; })) === null || _a === void 0 ? void 0 : _a[0];
}
this.cOnChange(value, items);
}
},
});

@@ -7,7 +7,7 @@ import { IBaseProps } from '../_base';

interface ChecklistItem {
export interface ChecklistItem {
/**
* @description 可勾选项的描述文案
*/
description: string;
description?: string;

@@ -17,3 +17,3 @@ /**

*/
image: string;
image?: string;

@@ -36,3 +36,3 @@ /**

*/
defaultValue: Array<string | number>;
value: Array<string | number> | string | number;

@@ -53,5 +53,5 @@ /**

*/
onChange: (v: Array<string | number>) => void;
onChange: (v: Array<string | number>| string| number, item: ChecklistItem| Array<ChecklistItem>) => void;
}
export declare const ChecklistDefaultProps: Partial<IChecklistProps>;

@@ -8,5 +8,6 @@ "use strict";

var ChecklistDefaultProps = {
defaultValue: [],
multiple: false
value: '',
multiple: false,
options: []
};
exports.ChecklistDefaultProps = ChecklistDefaultProps;
{
"component": "true"
"component": true
}
"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"));
var console_1 = require("../_util/console");
Component({
props: props_1.ContainerDefaultProps,
didMount: function () {
var _a = this.props, onIconTap = _a.onIconTap, icon = _a.icon;
if (!icon && onIconTap) {
console_1.log.error('Container', '未设置 icon 属性值或者值为空,onIconTap 将无效。');
}
},
methods: {
onIconTap: function (e) {
var onIconTap = this.props.onIconTap;
if (onIconTap) {
var event = (0, fmtEvent_1.default)(this.props, e);
return onIconTap(event);
}
},
},
methods: {},
});
{
"component": true,
"usingComponents": {
"icon": "../Icon/index"
"header": "./ContainerHeader"
}
}

@@ -13,14 +13,16 @@ /* eslint-disable @typescript-eslint/no-explicit-any */

/**
* @description 缩略图 url
* @description 标题缩略图 url
*/
image?: string;
titleImage?: string;
/**
* @description 右侧图标
* @description 容器中有几个盒子,最大值 3
* @default 0
*/
icon?: IconType;
multiBox: number;
/**
* @description 右侧图标点击回调
* @description 标题是否在容器内
* @default true
*/
onIconTap?: (event?: any) => void;
headerInBox: boolean;
}
export declare const ContainerDefaultProps: Partial<IContainerProps>;

@@ -7,3 +7,6 @@ "use strict";

exports.ContainerDefaultProps = void 0;
var ContainerDefaultProps = {};
var ContainerDefaultProps = {
multiBox: 0,
headerInBox: true
};
exports.ContainerDefaultProps = ContainerDefaultProps;

@@ -80,3 +80,3 @@ "use strict";

var placeHolderArray = group.getGroupDataVal();
placeHolderArray[this.$id] = label;
placeHolderArray[this.$id] = label.text;
group.setGroupDataVal({ key: 'placeHolderArray', val: placeHolderArray });

@@ -83,0 +83,0 @@ }

@@ -30,3 +30,7 @@ /* eslint-disable @typescript-eslint/no-explicit-any */

onTap?: (event: T) => void;
/**
* @description 是否阻止事件冒泡
*/
stopPropagation?: boolean;
}
export declare const IconDefaultProps: Partial<IIconProps>;

@@ -9,4 +9,5 @@ "use strict";

type: '',
size: 'medium'
size: 'medium',
stopPropagation: false
};
exports.IconDefaultProps = IconDefaultProps;

@@ -50,3 +50,7 @@

onTap?: (event?: any) => void;
/**
* @description 是否阻止事件冒泡
*/
stopPropagation?: boolean;
}
export declare const ListItemDefaultProps: Partial<IListItemProps>;

@@ -10,4 +10,5 @@ "use strict";

disabled: false,
last: false
last: false,
stopPropagation: false
};
exports.ListItemDefaultProps = ListItemDefaultProps;

@@ -13,3 +13,3 @@ "use strict";

className: '',
color: '#999',
color: '#fff',
height: '',

@@ -16,0 +16,0 @@ type: 'spin'

@@ -11,4 +11,5 @@ "use strict";

uid: 'RadioGroup',
position: 'vertical'
position: 'vertical',
value: ''
};
exports.RadioGroupDefaultProps = RadioGroupDefaultProps;

@@ -8,8 +8,11 @@ "use strict";

var getFixedValue = function (value, multiple) {
var fixedValue;
if (multiple) {
var fixedValue = [];
if (value === null) {
fixedValue = [];
}
else if (multiple && Array.isArray(value)) {
fixedValue = value;
}
else {
fixedValue = value === null || value === void 0 ? void 0 : value.slice(0, 1);
else if (!Array.isArray(value)) {
fixedValue = [value];
}

@@ -24,6 +27,7 @@ return fixedValue;

onChange: function (e) {
var _a = e.currentTarget.dataset, disabled = _a.disabled, value = _a.value, text = _a.text;
var _b = this.props, multiple = _b.multiple, items = _b.items;
var _a;
var _b = e.currentTarget.dataset, disabled = _b.disabled, value = _b.value;
var _c = this.props, multiple = _c.multiple, items = _c.items;
if (!disabled && !this.props.disabled) {
var nextValue = void 0;
var nextValue_1;
var fixedValue = getFixedValue(this.data.cValue, multiple);

@@ -33,3 +37,3 @@ if (multiple) {

if ((fixedValue === null || fixedValue === void 0 ? void 0 : fixedValue.indexOf(value)) !== -1) {
nextValue = fixedValue === null || fixedValue === void 0 ? void 0 : fixedValue.filter(function (item) {
nextValue_1 = fixedValue === null || fixedValue === void 0 ? void 0 : fixedValue.filter(function (item) {
return item !== value;

@@ -40,3 +44,3 @@ });

// 之前未选中,增加
nextValue = tslib_1.__spreadArray(tslib_1.__spreadArray([], fixedValue, true), [value], false);
nextValue_1 = tslib_1.__spreadArray(tslib_1.__spreadArray([], fixedValue, true), [value], false);
}

@@ -47,4 +51,5 @@ // 将 value 重新按 options 排序

};
nextValue = sortValue(nextValue);
this.cOnChange(nextValue);
nextValue_1 = sortValue(nextValue_1);
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);
}

@@ -56,9 +61,10 @@ else {

if ((fixedValue === null || fixedValue === void 0 ? void 0 : fixedValue[0]) === value) {
nextValue = '';
nextValue_1 = '';
}
else {
// 选中
nextValue = value;
nextValue_1 = value;
}
this.cOnChange(nextValue, text);
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);
}

@@ -65,0 +71,0 @@ }

@@ -10,4 +10,5 @@ "use strict";

multiple: false,
disabled: false
disabled: false,
value: ''
};
exports.SelectorDefaultProps = SelectorDefaultProps;

@@ -258,2 +258,8 @@ "use strict";

},
handleAnimationEnd: function (e) {
var onAnimationEnd = this.props.onAnimationEnd;
if (typeof onAnimationEnd === "function") {
onAnimationEnd(e);
}
},
appearLeft: function () {

@@ -260,0 +266,0 @@ this.setData({

@@ -13,3 +13,40 @@

uid: string;
/**
* @description 自动以指定滑块的高度为整个容器的高度
* @default 'current'
*/
adjustHeight: 'first' | 'current' | 'highest' | 'none';
/**
* @description swiper-item 可见时的 class
* @default ''
*/
activeClass: string;
/**
* @description 前边距,单位 px,1.9.0 暂时只支持水平方向。
* @default '0px'
*/
previousMargin: string;
/**
* @description 后边距,单位 px,1.9.0 暂时只支持水平方向。
* @default '0px'
*/
nextMargin: string;
/**
* @description 切换缓动动画类型。
* @default 'default'
*/
easingFunction: string;
/**
* @description 当 swiper-item 个数大于等于 2,关闭 circular 并且开启 previous-margin 或 next-margin 时,可以指定这个边距是否应用到第一个、最后一个元素。
* @default false
*/
snapToEdge: boolean;
/**
* @description 类型,basis(基础),capsule(胶囊),mixin(混合)

@@ -19,2 +56,3 @@ * @default "basis"

type?: 'basis' | 'capsule' | 'mixin';
/**

@@ -25,7 +63,4 @@ * @description 当前激活的索引

index?: number;
/**
* @description tab 切换时的回调
*/
onChange?: (index: number) => void;
/**
* @description 是否有过渡动画

@@ -35,2 +70,3 @@ * @default false

animation?: boolean;
/**

@@ -41,2 +77,3 @@ * @description 是否支持手势切换

swipeable?: boolean;
/**

@@ -47,2 +84,3 @@ * @description 是否支持吸顶

sticky?: boolean;
/**

@@ -53,13 +91,4 @@ * @description 吸顶高度

stickyTop?: boolean;
/**
* @description 内部 swiper 组件的 onTouchStart 事件(仅在基础库 2.x 版本生效)
* @default 0
*/
onTouchStart?: (e:any) => void;
/**
* @description 内部 swiper 组件的 onTouchStart 事件(仅在基础库 2.x 版本下生效)
* @default 0
*/
onTransition?: (e:any) => void;
/**
* @description 是否自定义实现"轮播",详见 fallback demo

@@ -69,2 +98,3 @@ * @default 0

fallback?: boolean;
/**

@@ -75,2 +105,3 @@ * @description 用户左右滑动手势生效的滑动角度。角度根据 touchstart 事件和首次 touchmove 事件的坐标计算得出。数值越小越对用户的滑动方向准确度要求越高

touchAngle?: number;
/**

@@ -80,3 +111,4 @@ * @description 用户左右滑动手势触发切换的阈值,当滑动距离超过阈值时进行 `swiper-item` 切换

*/
swipeRatio?: number
swipeRatio?: number;
/**

@@ -86,4 +118,26 @@ * @description 用户左右滑动手势对应的滑动距离,数值越小则需要用户手势相同位移下 `swiper-item` 位移越小

*/
swipeSpeed?: number
swipeSpeed?: number;
/**
* @description tab 切换时的回调
*/
onChange?: (index: number) => void;
/**
* @description 内部 swiper 组件的 onTouchStart 事件(仅在基础库 2.x 版本生效)
* @default 0
*/
onTouchStart?: (e: any) => void;
/**
* @description 内部 swiper 组件的 onTransition 事件(仅在基础库 2.x 版本下生效)
* @default 0
*/
onTransition?: (e: any) => void;
/**
* @description 内部 swiper 组件的 onAnimationEnd 事件(仅在基础库 1.50.0 以上版本生效)
*/
onAnimationEnd?: (e: any) => void;
}
export declare const TabsDefaultProps: Partial<ITabsProps>;

@@ -9,2 +9,3 @@ "use strict";

type: 'basis',
adjustHeight: 'current',
index: 0,

@@ -20,4 +21,9 @@ animation: false,

onGetRef: function onGetRef() {},
uid: 'tabs'
uid: 'tabs',
activeClass: '',
previousMargin: '0px',
nextMargin: '0px',
easingFunction: 'default',
snapToEdge: false
};
exports.TabsDefaultProps = TabsDefaultProps;
{
"name": "antd-mini",
"version": "0.0.12",
"version": "0.0.13-beta.1",
"scripts": {
"dev": "minidev dev --less --typescript --no-source-map",
"dev": "minidev dev --no-source-map",
"dev:site": "dumi dev",

@@ -7,0 +7,0 @@ "build": "npm run build:component && npm run build:site",

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

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

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

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

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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc