@vunk/form 1.1.4 → 1.1.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/components/button/index.d.ts +1 -1
- package/components/button/src/types.d.ts +1 -1
- package/components/cascader/index.d.ts +1 -1
- package/components/checkbox/index.d.ts +1 -1
- package/components/color-picker/index.d.ts +1 -1
- package/components/date-picker/index.d.ts +1 -1
- package/components/date-picker/src/types.d.ts +1 -1
- package/components/form/index.d.ts +1 -1
- package/components/form-item/index.d.ts +1 -1
- package/components/form-item-renderer/index.d.ts +1 -1
- package/components/form-item-renderer-template/index.d.ts +1 -1
- package/components/geoinput/index.d.ts +1 -1
- package/components/geoinput/src/types.d.ts +1 -1
- package/components/geoinput-read/index.d.ts +1 -1
- package/components/geoinput-update/index.d.ts +1 -1
- package/components/input/index.d.ts +1 -1
- package/components/input/src/types.d.ts +1 -1
- package/components/input-link/index.d.ts +1 -1
- package/components/input-number/index.d.ts +1 -1
- package/components/input-number/src/types.d.ts +1 -1
- package/components/radio/index.d.ts +1 -1
- package/components/radio/src/types.d.ts +1 -1
- package/components/select/index.d.ts +1 -1
- package/components/select/src/types.d.ts +1 -1
- package/components/switch/index.d.ts +1 -1
- package/components/switch/src/types.d.ts +1 -1
- package/components/templates-default/index.d.ts +1 -1
- package/components/templates-default/index.js +1 -9
- package/components/templates-default/src/ctx.d.ts +2 -2
- package/components/templates-default/src/ctx.js +2 -9
- package/components/templates-element-plus/index.d.ts +1 -1
- package/components/templates-layout/index.d.ts +1 -1
- package/components/templates-mapbox/index.d.ts +1 -1
- package/components/upload/index.d.ts +1 -1
- package/components/vditor/index.d.ts +1 -1
- package/package.json +1 -1
- package/shared/rules/index.d.ts +27 -0
- package/shared/rules/index.js +16 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { Func, VueComponentPropsType } from '@vunk/core';
|
|
2
2
|
import { BasicSource } from '@vunk/form/shared';
|
|
3
|
-
import VkfDatePicker from './index.vue';
|
|
3
|
+
import VkfDatePicker from './index.vue.d';
|
|
4
4
|
export declare type DatePickerSlots = {
|
|
5
5
|
default?: Func;
|
|
6
6
|
'range-separator'?: Func;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import VkfFormItemRendererTemplate from './src/index.vue';
|
|
1
|
+
import VkfFormItemRendererTemplate from './src/index.vue.d';
|
|
2
2
|
export * as __VkfFormItemRendererTemplate from './src/types';
|
|
3
3
|
export { VkfFormItemRendererTemplate, };
|
|
4
4
|
export default VkfFormItemRendererTemplate;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { AnyFunc, VueComponentPropsType } from '@vunk/core';
|
|
2
|
-
import VkfGeoinput from './index.vue';
|
|
2
|
+
import VkfGeoinput from './index.vue.d';
|
|
3
3
|
import { BasicSource } from '@vunk/form/shared';
|
|
4
4
|
export declare type EditType = 'point' | 'polygon' | 'line_string' | 'trash';
|
|
5
5
|
export declare type Slots = {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { BasicSource } from '@vunk/form/shared';
|
|
2
2
|
import { VueComponentPropsType } from '@vunk/core';
|
|
3
|
-
import VkfInputNumber from './index.vue';
|
|
3
|
+
import VkfInputNumber from './index.vue.d';
|
|
4
4
|
export interface Source<P extends string = string> extends VueComponentPropsType<typeof VkfInputNumber>, BasicSource {
|
|
5
5
|
prop: P;
|
|
6
6
|
templateType: 'VkfInputNumber';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { BasicSource } from '@vunk/form/shared';
|
|
2
2
|
import { VueComponentPropsType } from '@vunk/core';
|
|
3
|
-
import VkfRadio from './index.vue';
|
|
3
|
+
import VkfRadio from './index.vue.d';
|
|
4
4
|
export interface Source<P extends string = string> extends VueComponentPropsType<typeof VkfRadio>, BasicSource {
|
|
5
5
|
prop: P;
|
|
6
6
|
templateType: 'VkfRadio';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { BasicSource } from '@vunk/form/shared';
|
|
2
2
|
import { VueComponentPropsType } from '@vunk/core';
|
|
3
|
-
import VkfSwitch from './index.vue';
|
|
3
|
+
import VkfSwitch from './index.vue.d';
|
|
4
4
|
export interface Source<P extends string = string> extends VueComponentPropsType<typeof VkfSwitch>, BasicSource {
|
|
5
5
|
prop: P;
|
|
6
6
|
templateType: 'VkfSwitch';
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { defaultIntoUndefined } from '@vunk/core';
|
|
1
2
|
import { defineComponent, resolveComponent, openBlock, createElementBlock, Fragment, createVNode, withCtx, createBlock, normalizeProps, mergeProps, createCommentVNode, resolveDynamicComponent } from 'vue';
|
|
2
3
|
import { VkfFormItemRendererTemplate } from '@vunk/form/components/form-item-renderer-template';
|
|
3
4
|
import { VkfInput } from '@vunk/form/components/input';
|
|
@@ -15,15 +16,6 @@ import { VkfButton } from '@vunk/form/components/button';
|
|
|
15
16
|
import { VkfCascader } from '@vunk/form/components/cascader';
|
|
16
17
|
import { VkfInputLink } from '@vunk/form/components/input-link';
|
|
17
18
|
|
|
18
|
-
const defaultIntoUndefined = (currentData, currentK, nextK) => {
|
|
19
|
-
if (nextK === void 0)
|
|
20
|
-
return;
|
|
21
|
-
if (typeof nextK === "number") {
|
|
22
|
-
currentData[currentK] = [];
|
|
23
|
-
} else {
|
|
24
|
-
currentData[currentK] = {};
|
|
25
|
-
}
|
|
26
|
-
};
|
|
27
19
|
const createIntoUndefined = () => defaultIntoUndefined;
|
|
28
20
|
const props = {
|
|
29
21
|
data: {
|
|
@@ -9,11 +9,11 @@ export declare const props: {
|
|
|
9
9
|
type: PropType<(arg: {
|
|
10
10
|
raw: any;
|
|
11
11
|
data: Record<string, any>;
|
|
12
|
-
}) => import("@vunk/core
|
|
12
|
+
}) => import("@vunk/core").IntoUndefined>;
|
|
13
13
|
default: (arg: {
|
|
14
14
|
raw: any;
|
|
15
15
|
data: Record<string, any>;
|
|
16
|
-
}) => import("@vunk/core
|
|
16
|
+
}) => import("@vunk/core").IntoUndefined;
|
|
17
17
|
};
|
|
18
18
|
};
|
|
19
19
|
export declare const emits: {
|
|
@@ -1,12 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
return;
|
|
4
|
-
if (typeof nextK === "number") {
|
|
5
|
-
currentData[currentK] = [];
|
|
6
|
-
} else {
|
|
7
|
-
currentData[currentK] = {};
|
|
8
|
-
}
|
|
9
|
-
};
|
|
1
|
+
import { defaultIntoUndefined } from '@vunk/core';
|
|
2
|
+
|
|
10
3
|
const createIntoUndefined = () => defaultIntoUndefined;
|
|
11
4
|
const props = {
|
|
12
5
|
data: {
|
package/package.json
CHANGED
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
export declare const PATTERN: {
|
|
2
|
+
/**
|
|
3
|
+
* 由数字、26个英文字母或者下划线以及中文组成的字符串
|
|
4
|
+
*/
|
|
5
|
+
normal: RegExp;
|
|
6
|
+
/**
|
|
7
|
+
* 只能由数字或字母组成, 且不能以数字开头
|
|
8
|
+
*/
|
|
9
|
+
code: RegExp;
|
|
10
|
+
/**
|
|
11
|
+
* 只能由字母、数字或特殊字符组成,且长度在8到16之间
|
|
12
|
+
*/
|
|
13
|
+
password: RegExp;
|
|
14
|
+
/**
|
|
15
|
+
* 要求密码必须同时包含至少一个小写字母、一个大写字母和一个数字,且长度在8到16之间。
|
|
16
|
+
*/
|
|
17
|
+
strictPassword: RegExp;
|
|
18
|
+
/**
|
|
19
|
+
* 正确的手机号码
|
|
20
|
+
*/
|
|
21
|
+
phone: RegExp;
|
|
22
|
+
};
|
|
23
|
+
export declare const PATTERN_OPTIONS: {
|
|
24
|
+
label: string;
|
|
25
|
+
value: RegExp;
|
|
26
|
+
title: string;
|
|
27
|
+
}[];
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
const PATTERN = {
|
|
2
|
+
normal: /^[\u4e00-\u9fa5_a-zA-Z0-9]+$/,
|
|
3
|
+
code: /^[a-zA-Z][a-zA-Z0-9]*$/,
|
|
4
|
+
password: /^[a-zA-Z0-9~!@#$%^&*()_+|<>?:{}\.]{8,16}$/,
|
|
5
|
+
strictPassword: /^(?=.*[a-z])(?=.*[A-Z])(?=.*\d)[^]{8,16}$/,
|
|
6
|
+
phone: /^1[3456789]\d{9}$/
|
|
7
|
+
};
|
|
8
|
+
const PATTERN_OPTIONS = [
|
|
9
|
+
{ label: "\u6B63\u5E38", value: PATTERN.normal, title: "\u7531\u6570\u5B57\u300126\u4E2A\u82F1\u6587\u5B57\u6BCD\u6216\u8005\u4E0B\u5212\u7EBF\u4EE5\u53CA\u4E2D\u6587\u7EC4\u6210\u7684\u5B57\u7B26\u4E32" },
|
|
10
|
+
{ label: "\u5BC6\u7801", value: PATTERN.password, title: "\u53EA\u80FD\u7531\u5B57\u6BCD\u3001\u6570\u5B57\u6216\u7279\u6B8A\u5B57\u7B26\u7EC4\u6210\uFF0C\u4E14\u957F\u5EA6\u57288\u523016\u4E4B\u95F4" },
|
|
11
|
+
{ label: "\u4E25\u683C\u5BC6\u7801", value: PATTERN.strictPassword, title: "\u8981\u6C42\u5BC6\u7801\u5FC5\u987B\u540C\u65F6\u5305\u542B\u81F3\u5C11\u4E00\u4E2A\u5C0F\u5199\u5B57\u6BCD\u3001\u4E00\u4E2A\u5927\u5199\u5B57\u6BCD\u548C\u4E00\u4E2A\u6570\u5B57\uFF0C\u4E14\u957F\u5EA6\u57288\u523016\u4E4B\u95F4" },
|
|
12
|
+
{ label: "\u624B\u673A\u53F7", value: PATTERN.phone, title: "\u6B63\u786E\u7684\u624B\u673A\u53F7\u7801" },
|
|
13
|
+
{ label: "\u7F16\u7801", value: PATTERN.code, title: "\u53EA\u80FD\u7531\u6570\u5B57\u6216\u5B57\u6BCD\u7EC4\u6210, \u4E14\u4E0D\u80FD\u4EE5\u6570\u5B57\u5F00\u5934" }
|
|
14
|
+
];
|
|
15
|
+
|
|
16
|
+
export { PATTERN, PATTERN_OPTIONS };
|