@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.
Files changed (38) hide show
  1. package/components/button/index.d.ts +1 -1
  2. package/components/button/src/types.d.ts +1 -1
  3. package/components/cascader/index.d.ts +1 -1
  4. package/components/checkbox/index.d.ts +1 -1
  5. package/components/color-picker/index.d.ts +1 -1
  6. package/components/date-picker/index.d.ts +1 -1
  7. package/components/date-picker/src/types.d.ts +1 -1
  8. package/components/form/index.d.ts +1 -1
  9. package/components/form-item/index.d.ts +1 -1
  10. package/components/form-item-renderer/index.d.ts +1 -1
  11. package/components/form-item-renderer-template/index.d.ts +1 -1
  12. package/components/geoinput/index.d.ts +1 -1
  13. package/components/geoinput/src/types.d.ts +1 -1
  14. package/components/geoinput-read/index.d.ts +1 -1
  15. package/components/geoinput-update/index.d.ts +1 -1
  16. package/components/input/index.d.ts +1 -1
  17. package/components/input/src/types.d.ts +1 -1
  18. package/components/input-link/index.d.ts +1 -1
  19. package/components/input-number/index.d.ts +1 -1
  20. package/components/input-number/src/types.d.ts +1 -1
  21. package/components/radio/index.d.ts +1 -1
  22. package/components/radio/src/types.d.ts +1 -1
  23. package/components/select/index.d.ts +1 -1
  24. package/components/select/src/types.d.ts +1 -1
  25. package/components/switch/index.d.ts +1 -1
  26. package/components/switch/src/types.d.ts +1 -1
  27. package/components/templates-default/index.d.ts +1 -1
  28. package/components/templates-default/index.js +1 -9
  29. package/components/templates-default/src/ctx.d.ts +2 -2
  30. package/components/templates-default/src/ctx.js +2 -9
  31. package/components/templates-element-plus/index.d.ts +1 -1
  32. package/components/templates-layout/index.d.ts +1 -1
  33. package/components/templates-mapbox/index.d.ts +1 -1
  34. package/components/upload/index.d.ts +1 -1
  35. package/components/vditor/index.d.ts +1 -1
  36. package/package.json +1 -1
  37. package/shared/rules/index.d.ts +27 -0
  38. package/shared/rules/index.js +16 -0
@@ -1,4 +1,4 @@
1
- import VkfButton from './src/index.vue';
1
+ import VkfButton from './src/index.vue.d';
2
2
  export * as __VkfButton from './src/types';
3
3
  export { VkfButton, };
4
4
  export default VkfButton;
@@ -1,6 +1,6 @@
1
1
  import { Func, VueComponentPropsType } from '@vunk/core';
2
2
  import { BasicSource } from '@vunk/form/shared';
3
- import VkfButton from './index.vue';
3
+ import VkfButton from './index.vue.d';
4
4
  export interface ButtonSlots {
5
5
  loading: Func;
6
6
  icon: Func;
@@ -1,4 +1,4 @@
1
- import VkfCascader from './src/index.vue';
1
+ import VkfCascader from './src/index.vue.d';
2
2
  export * as __VkfCascader from './src/types';
3
3
  export { VkfCascader, };
4
4
  export default VkfCascader;
@@ -1,4 +1,4 @@
1
- import VkfCheckbox from './src/index.vue';
1
+ import VkfCheckbox from './src/index.vue.d';
2
2
  export * as __VkfCheckbox from './src/types';
3
3
  export { VkfCheckbox, };
4
4
  export default VkfCheckbox;
@@ -1,4 +1,4 @@
1
- import VkfColorPicker from './src/index.vue';
1
+ import VkfColorPicker from './src/index.vue.d';
2
2
  export * as __VkfColorPicker from './src/types';
3
3
  export { VkfColorPicker, };
4
4
  export default VkfColorPicker;
@@ -1,4 +1,4 @@
1
- import VkfDatePicker from './src/index.vue';
1
+ import VkfDatePicker from './src/index.vue.d';
2
2
  export * as __VkfDatePicker from './src/types';
3
3
  export { VkfDatePicker, };
4
4
  export default VkfDatePicker;
@@ -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 VkfForm from './src/index.vue';
1
+ import VkfForm from './src/index.vue.d';
2
2
  export * as __VkfForm from './src/types';
3
3
  export * as _VkfFormCtx from './src/ctx';
4
4
  export { VkfForm, };
@@ -1,4 +1,4 @@
1
- import VkfFormItem from './src/index.vue';
1
+ import VkfFormItem from './src/index.vue.d';
2
2
  export * as __VkfFormItem from './src/types';
3
3
  export * as _VkfFormItemCtx from './src/ctx';
4
4
  export { VkfFormItem, };
@@ -1,4 +1,4 @@
1
- import VkfFormItemRenderer from './src/index.vue';
1
+ import VkfFormItemRenderer from './src/index.vue.d';
2
2
  export * as __VkfFormItemRenderer from './src/types';
3
3
  export * from './src/symbols';
4
4
  export { VkfFormItemRenderer, };
@@ -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,4 +1,4 @@
1
- import VkfGeoinput from './src/index.vue';
1
+ import VkfGeoinput from './src/index.vue.d';
2
2
  export * as __VkfGeoinput from './src/types';
3
3
  export { VkfGeoinput, };
4
4
  export default VkfGeoinput;
@@ -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,4 +1,4 @@
1
- import VkfGeoinputRead from './src/index.vue';
1
+ import VkfGeoinputRead from './src/index.vue.d';
2
2
  export * as __VkfGeoinputRead from './src/types';
3
3
  export * as _VkfGeoinputReadCtx from './src/ctx';
4
4
  export { VkfGeoinputRead, };
@@ -1,4 +1,4 @@
1
- import VkfGeoinputUpdate from './src/index.vue';
1
+ import VkfGeoinputUpdate from './src/index.vue.d';
2
2
  export * as __VkfGeoinputUpdate from './src/types';
3
3
  export * as _VkfGeoinputUpdateCtx from './src/ctx';
4
4
  export { VkfGeoinputUpdate, };
@@ -1,4 +1,4 @@
1
- import VkfInput from './src/index.vue';
1
+ import VkfInput from './src/index.vue.d';
2
2
  export * as __VkfInput from './src/types';
3
3
  export * as _VkfInputCtx from './src/ctx';
4
4
  export { VkfInput, };
@@ -1,6 +1,6 @@
1
1
  import type { Func, VueComponentPropsType } from '@vunk/core';
2
2
  import { BasicSource } from '@vunk/form/shared';
3
- import VkfInput from './index.vue';
3
+ import VkfInput from './index.vue.d';
4
4
  export declare type InputSlots = {
5
5
  prefix?: Func;
6
6
  suffix?: Func;
@@ -1,4 +1,4 @@
1
- import VkfInputLink from './src/index.vue';
1
+ import VkfInputLink from './src/index.vue.d';
2
2
  export * as __VkfInputLink from './src/types';
3
3
  export { VkfInputLink, };
4
4
  export default VkfInputLink;
@@ -1,4 +1,4 @@
1
- import VkfInputNumber from './src/index.vue';
1
+ import VkfInputNumber from './src/index.vue.d';
2
2
  export * as __VkfInputNumber from './src/types';
3
3
  export { VkfInputNumber, };
4
4
  export default VkfInputNumber;
@@ -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,4 +1,4 @@
1
- import VkfRadio from './src/index.vue';
1
+ import VkfRadio from './src/index.vue.d';
2
2
  export * as __VkfRadio from './src/types';
3
3
  export { VkfRadio, };
4
4
  export default VkfRadio;
@@ -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,4 +1,4 @@
1
- import VkfSelect from './src/index.vue';
1
+ import VkfSelect from './src/index.vue.d';
2
2
  export * as __VkfSelect from './src/types';
3
3
  export { VkfSelect, };
4
4
  export default VkfSelect;
@@ -1,6 +1,6 @@
1
1
  import type { Func, VueComponentPropsType } from '@vunk/core';
2
2
  import { BasicSource } from '@vunk/form/shared';
3
- import VkfSelect from './index.vue';
3
+ import VkfSelect from './index.vue.d';
4
4
  export declare type SelectSlots = {
5
5
  prefix?: Func;
6
6
  empty?: Func;
@@ -1,4 +1,4 @@
1
- import VkfSwitch from './src/index.vue';
1
+ import VkfSwitch from './src/index.vue.d';
2
2
  export * as __VkfSwitch from './src/types';
3
3
  export { VkfSwitch, };
4
4
  export default VkfSwitch;
@@ -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,4 +1,4 @@
1
- import VkfTemplatesDefault from './src/index.vue';
1
+ import VkfTemplatesDefault from './src/index.vue.d';
2
2
  export * as __VkfTemplatesDefault from './src/types';
3
3
  export { VkfTemplatesDefault, };
4
4
  export default VkfTemplatesDefault;
@@ -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/shared/types").IntoUndefined>;
12
+ }) => import("@vunk/core").IntoUndefined>;
13
13
  default: (arg: {
14
14
  raw: any;
15
15
  data: Record<string, any>;
16
- }) => import("@vunk/core/shared/types").IntoUndefined;
16
+ }) => import("@vunk/core").IntoUndefined;
17
17
  };
18
18
  };
19
19
  export declare const emits: {
@@ -1,12 +1,5 @@
1
- const defaultIntoUndefined = (currentData, currentK, nextK) => {
2
- if (nextK === void 0)
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: {
@@ -1,4 +1,4 @@
1
- import VkfTemplatesElementPlus from './src/index.vue';
1
+ import VkfTemplatesElementPlus from './src/index.vue.d';
2
2
  export * as __VkfTemplatesElementPlus from './src/types';
3
3
  export { VkfTemplatesElementPlus, };
4
4
  export default VkfTemplatesElementPlus;
@@ -1,4 +1,4 @@
1
- import VkfTemplatesLayout from './src/index.vue';
1
+ import VkfTemplatesLayout from './src/index.vue.d';
2
2
  export * as __VkfTemplatesLayout from './src/types';
3
3
  export { VkfTemplatesLayout, };
4
4
  export default VkfTemplatesLayout;
@@ -1,4 +1,4 @@
1
- import VkfTemplatesMapbox from './src/index.vue';
1
+ import VkfTemplatesMapbox from './src/index.vue.d';
2
2
  export * as __VkfTemplatesMapbox from './src/types';
3
3
  export { VkfTemplatesMapbox, };
4
4
  export default VkfTemplatesMapbox;
@@ -1,4 +1,4 @@
1
- import VkfUpload from './src/index.vue';
1
+ import VkfUpload from './src/index.vue.d';
2
2
  export * as __VkfUpload from './src/types';
3
3
  export * as _VkfUploadCtx from './src/ctx';
4
4
  export { VkfUpload, };
@@ -1,4 +1,4 @@
1
- import VkfVditor from './src/index.vue';
1
+ import VkfVditor from './src/index.vue.d';
2
2
  export * as __VkfVditor from './src/types';
3
3
  export { VkfVditor, };
4
4
  export default VkfVditor;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vunk/form",
3
- "version": "1.1.4",
3
+ "version": "1.1.6",
4
4
  "description": "",
5
5
  "main": "index.esm.js",
6
6
  "scripts": {
@@ -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 };