@vrojs/element-plus 0.0.4 → 0.0.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/dist/index.js CHANGED
@@ -1,95 +1,97 @@
1
- import { default as e } from "./locale/lang/zh-cn.js";
2
- import { localeContextKey as p, useLocale as l } from "./locale/useLocale.js";
3
- import { datePickerValueFormat as a } from "./utils/datePickerValueFormat.js";
4
- import { parseType as x } from "@vrojs/base";
5
- import { VroElCheckboxGroup as i } from "./vro-el-checkbox-group/index.js";
6
- import { VroElConfigProvider as V } from "./vro-el-config-provider/index.js";
7
- import { VroElFileUpload as c } from "./vro-el-file-upload/index.js";
8
- import { VroElIcon as F } from "./vro-el-icon/index.js";
9
- import { VroElImage as d } from "./vro-el-image/index.js";
10
- import { VroElImageUpload as P } from "./vro-el-image-upload/index.js";
11
- import { VroElRadioGroup as I } from "./vro-el-radio-group/index.js";
12
- import { VroElSchemaFilter as C } from "./vro-el-schema-filter/index.js";
13
- import { VroElSchemaForm as D } from "./vro-el-schema-form/index.js";
14
- import { VroElSchemaFormDialog as T } from "./vro-el-schema-form-dialog/index.js";
15
- import { VroElSelect as G } from "./vro-el-select/index.js";
16
- import { VroElSkeleton as b } from "./vro-el-skeleton/index.js";
17
- import { VroElTags as R } from "./vro-el-tags/index.js";
18
- import { VroElTree as j } from "./vro-el-tree/index.js";
19
- import { VroElWithConfig as z } from "./vro-el-with-config/index.js";
20
- import { vroElCheckboxGroupProps as M } from "./vro-el-checkbox-group/types.js";
21
- import { vroElConfigProviderProps as q } from "./vro-el-config-provider/types.js";
22
- import { vroElFileUploadProps as B } from "./vro-el-file-upload/types.js";
23
- import { getVroElFileUploadOptions as J, setVroElFileUploadOptions as Q } from "./vro-el-file-upload/utils.js";
24
- import { vroElIconProps as Y } from "./vro-el-icon/types.js";
25
- import { vroElImageProps as _ } from "./vro-el-image/types.js";
26
- import { getVroElImageOptions as oo, setVroElImageOptions as ro } from "./vro-el-image/utils.js";
27
- import { vroElImageUploadProps as mo } from "./vro-el-image-upload/types.js";
28
- import { getVroElImageUploadOptions as lo, setVroElImageUploadOptions as to } from "./vro-el-image-upload/utils.js";
29
- import { vroElRadioGroupProps as fo } from "./vro-el-radio-group/types.js";
30
- import { vroElSchemaFilterProps as Eo } from "./vro-el-schema-filter/types.js";
31
- import { defineVroElSchemaFormCreateField as so } from "./vro-el-schema-form/defineVroElSchemaFormCreateField.js";
32
- import { defineVroElSchemaFormFieldTrigger as go } from "./vro-el-schema-form/defineVroElSchemaFormFieldTrigger.js";
33
- import { vroElSchemaFormProps as no } from "./vro-el-schema-form/types.js";
34
- import { useVroElSchemaForm as ho } from "./vro-el-schema-form/useVroElSchemaForm.js";
35
- import { vroElSchemaFormFieldManager as Po } from "./vro-el-schema-form/vroElSchemaFormFieldManager.js";
36
- import { showVroElSchemaFormDialog as Io } from "./vro-el-schema-form-dialog/function-call.js";
37
- import { useVroElSchemaFormDialogInstance as Co, vroElSchemaFormDialogInjectionKey as Uo } from "./vro-el-schema-form-dialog/injection.js";
38
- import { vroElSchemaFormDialogProps as Oo } from "./vro-el-schema-form-dialog/types.js";
39
- import { useVroElSchemaFormDialog as ko } from "./vro-el-schema-form-dialog/useVroElSchemaFormDialog.js";
40
- import { vroElSelectProps as yo } from "./vro-el-select/types.js";
41
- import { vroElSkeletonProps as Ko } from "./vro-el-skeleton/types.js";
42
- import { vroElTagsProps as Wo } from "./vro-el-tags/types.js";
43
- import { vroElTreeProps as wo } from "./vro-el-tree/types.js";
44
- import { vroElWithConfigProps as Lo } from "./vro-el-with-config/types.js";
1
+ import { default as e } from "./locale/lang/en.js";
2
+ import { default as p } from "./locale/lang/zh-cn.js";
3
+ import { localeContextKey as t, useLocale as a } from "./locale/useLocale.js";
4
+ import { datePickerValueFormat as x } from "./utils/datePickerValueFormat.js";
5
+ import { parseType as i } from "@vrojs/base";
6
+ import { VroElCheckboxGroup as V } from "./vro-el-checkbox-group/index.js";
7
+ import { VroElConfigProvider as c } from "./vro-el-config-provider/index.js";
8
+ import { VroElFileUpload as F } from "./vro-el-file-upload/index.js";
9
+ import { VroElIcon as h } from "./vro-el-icon/index.js";
10
+ import { VroElImage as P } from "./vro-el-image/index.js";
11
+ import { VroElImageUpload as I } from "./vro-el-image-upload/index.js";
12
+ import { VroElRadioGroup as C } from "./vro-el-radio-group/index.js";
13
+ import { VroElSchemaFilter as D } from "./vro-el-schema-filter/index.js";
14
+ import { VroElSchemaForm as T } from "./vro-el-schema-form/index.js";
15
+ import { VroElSchemaFormDialog as G } from "./vro-el-schema-form-dialog/index.js";
16
+ import { VroElSelect as b } from "./vro-el-select/index.js";
17
+ import { VroElSkeleton as R } from "./vro-el-skeleton/index.js";
18
+ import { VroElTags as j } from "./vro-el-tags/index.js";
19
+ import { VroElTree as z } from "./vro-el-tree/index.js";
20
+ import { VroElWithConfig as M } from "./vro-el-with-config/index.js";
21
+ import { vroElCheckboxGroupProps as q } from "./vro-el-checkbox-group/types.js";
22
+ import { vroElConfigProviderProps as B } from "./vro-el-config-provider/types.js";
23
+ import { vroElFileUploadProps as J } from "./vro-el-file-upload/types.js";
24
+ import { getVroElFileUploadOptions as X, setVroElFileUploadOptions as Y } from "./vro-el-file-upload/utils.js";
25
+ import { vroElIconProps as _ } from "./vro-el-icon/types.js";
26
+ import { vroElImageProps as oo } from "./vro-el-image/types.js";
27
+ import { getVroElImageOptions as eo, setVroElImageOptions as mo } from "./vro-el-image/utils.js";
28
+ import { vroElImageUploadProps as lo } from "./vro-el-image-upload/types.js";
29
+ import { getVroElImageUploadOptions as ao, setVroElImageUploadOptions as fo } from "./vro-el-image-upload/utils.js";
30
+ import { vroElRadioGroupProps as Eo } from "./vro-el-radio-group/types.js";
31
+ import { vroElSchemaFilterProps as so } from "./vro-el-schema-filter/types.js";
32
+ import { defineVroElSchemaFormCreateField as go } from "./vro-el-schema-form/defineVroElSchemaFormCreateField.js";
33
+ import { defineVroElSchemaFormFieldTrigger as no } from "./vro-el-schema-form/defineVroElSchemaFormFieldTrigger.js";
34
+ import { vroElSchemaFormProps as ho } from "./vro-el-schema-form/types.js";
35
+ import { useVroElSchemaForm as Po } from "./vro-el-schema-form/useVroElSchemaForm.js";
36
+ import { vroElSchemaFormFieldManager as Io } from "./vro-el-schema-form/vroElSchemaFormFieldManager.js";
37
+ import { showVroElSchemaFormDialog as Co } from "./vro-el-schema-form-dialog/function-call.js";
38
+ import { useVroElSchemaFormDialogInstance as Do, vroElSchemaFormDialogInjectionKey as Oo } from "./vro-el-schema-form-dialog/injection.js";
39
+ import { vroElSchemaFormDialogProps as ko } from "./vro-el-schema-form-dialog/types.js";
40
+ import { useVroElSchemaFormDialog as yo } from "./vro-el-schema-form-dialog/useVroElSchemaFormDialog.js";
41
+ import { vroElSelectProps as Ko } from "./vro-el-select/types.js";
42
+ import { vroElSkeletonProps as Wo } from "./vro-el-skeleton/types.js";
43
+ import { vroElTagsProps as wo } from "./vro-el-tags/types.js";
44
+ import { vroElTreeProps as Lo } from "./vro-el-tree/types.js";
45
+ import { vroElWithConfigProps as No } from "./vro-el-with-config/types.js";
45
46
  export {
46
- i as VroElCheckboxGroup,
47
- V as VroElConfigProvider,
48
- c as VroElFileUpload,
49
- F as VroElIcon,
50
- d as VroElImage,
51
- P as VroElImageUpload,
52
- I as VroElRadioGroup,
53
- C as VroElSchemaFilter,
54
- D as VroElSchemaForm,
55
- T as VroElSchemaFormDialog,
56
- G as VroElSelect,
57
- b as VroElSkeleton,
58
- R as VroElTags,
59
- j as VroElTree,
60
- z as VroElWithConfig,
61
- a as datePickerValueFormat,
62
- so as defineVroElSchemaFormCreateField,
63
- go as defineVroElSchemaFormFieldTrigger,
64
- J as getVroElFileUploadOptions,
65
- oo as getVroElImageOptions,
66
- lo as getVroElImageUploadOptions,
67
- p as localeContextKey,
68
- x as parseType,
69
- Q as setVroElFileUploadOptions,
70
- ro as setVroElImageOptions,
71
- to as setVroElImageUploadOptions,
72
- Io as showVroElSchemaFormDialog,
73
- l as useLocale,
74
- ho as useVroElSchemaForm,
75
- ko as useVroElSchemaFormDialog,
76
- Co as useVroElSchemaFormDialogInstance,
77
- M as vroElCheckboxGroupProps,
78
- q as vroElConfigProviderProps,
79
- B as vroElFileUploadProps,
80
- Y as vroElIconProps,
81
- _ as vroElImageProps,
82
- mo as vroElImageUploadProps,
83
- fo as vroElRadioGroupProps,
84
- Eo as vroElSchemaFilterProps,
85
- Uo as vroElSchemaFormDialogInjectionKey,
86
- Oo as vroElSchemaFormDialogProps,
87
- Po as vroElSchemaFormFieldManager,
88
- no as vroElSchemaFormProps,
89
- yo as vroElSelectProps,
90
- Ko as vroElSkeletonProps,
91
- Wo as vroElTagsProps,
92
- wo as vroElTreeProps,
93
- Lo as vroElWithConfigProps,
94
- e as zhCN
47
+ V as VroElCheckboxGroup,
48
+ c as VroElConfigProvider,
49
+ F as VroElFileUpload,
50
+ h as VroElIcon,
51
+ P as VroElImage,
52
+ I as VroElImageUpload,
53
+ C as VroElRadioGroup,
54
+ D as VroElSchemaFilter,
55
+ T as VroElSchemaForm,
56
+ G as VroElSchemaFormDialog,
57
+ b as VroElSelect,
58
+ R as VroElSkeleton,
59
+ j as VroElTags,
60
+ z as VroElTree,
61
+ M as VroElWithConfig,
62
+ x as datePickerValueFormat,
63
+ go as defineVroElSchemaFormCreateField,
64
+ no as defineVroElSchemaFormFieldTrigger,
65
+ e as en,
66
+ X as getVroElFileUploadOptions,
67
+ eo as getVroElImageOptions,
68
+ ao as getVroElImageUploadOptions,
69
+ t as localeContextKey,
70
+ i as parseType,
71
+ Y as setVroElFileUploadOptions,
72
+ mo as setVroElImageOptions,
73
+ fo as setVroElImageUploadOptions,
74
+ Co as showVroElSchemaFormDialog,
75
+ a as useLocale,
76
+ Po as useVroElSchemaForm,
77
+ yo as useVroElSchemaFormDialog,
78
+ Do as useVroElSchemaFormDialogInstance,
79
+ q as vroElCheckboxGroupProps,
80
+ B as vroElConfigProviderProps,
81
+ J as vroElFileUploadProps,
82
+ _ as vroElIconProps,
83
+ oo as vroElImageProps,
84
+ lo as vroElImageUploadProps,
85
+ Eo as vroElRadioGroupProps,
86
+ so as vroElSchemaFilterProps,
87
+ Oo as vroElSchemaFormDialogInjectionKey,
88
+ ko as vroElSchemaFormDialogProps,
89
+ Io as vroElSchemaFormFieldManager,
90
+ ho as vroElSchemaFormProps,
91
+ Ko as vroElSelectProps,
92
+ Wo as vroElSkeletonProps,
93
+ wo as vroElTagsProps,
94
+ Lo as vroElTreeProps,
95
+ No as vroElWithConfigProps,
96
+ p as zhCN
95
97
  };
@@ -1,3 +1,4 @@
1
+ export { default as en } from './lang/en';
1
2
  export { default as zhCN } from './lang/zh-cn';
2
3
  export * from './types';
3
4
  export * from './useLocale';
@@ -1,7 +1,9 @@
1
- import { default as t } from "./lang/zh-cn.js";
2
- import { localeContextKey as l, useLocale as r } from "./useLocale.js";
1
+ import { default as t } from "./lang/en.js";
2
+ import { default as r } from "./lang/zh-cn.js";
3
+ import { localeContextKey as l, useLocale as x } from "./useLocale.js";
3
4
  export {
5
+ t as en,
4
6
  l as localeContextKey,
5
- r as useLocale,
6
- t as zhCN
7
+ x as useLocale,
8
+ r as zhCN
7
9
  };
@@ -0,0 +1,46 @@
1
+ declare const _default: {
2
+ name: string;
3
+ el: {
4
+ table: {
5
+ refresh: string;
6
+ };
7
+ skeleton: {
8
+ loadingDescription: string;
9
+ emptyDescription: string;
10
+ emptyBtnText: string;
11
+ errorTitle: string;
12
+ errorBtnText: string;
13
+ };
14
+ fileUpload: {
15
+ btnText: string;
16
+ };
17
+ imageUpload: {
18
+ compressText: string;
19
+ };
20
+ tags: {
21
+ addText: string;
22
+ };
23
+ schemaForm: {
24
+ ElInput: {
25
+ placeholder: string;
26
+ };
27
+ ElSelect: {
28
+ placeholder: string;
29
+ };
30
+ ElDatePicker: {
31
+ placeholder: string;
32
+ startPlaceholder: string;
33
+ endPlaceholder: string;
34
+ };
35
+ };
36
+ schemaFilter: {
37
+ searchText: string;
38
+ resetText: string;
39
+ };
40
+ schemaFormDialog: {
41
+ cancelText: string;
42
+ confirmText: string;
43
+ };
44
+ };
45
+ };
46
+ export default _default;
@@ -0,0 +1,48 @@
1
+ const e = {
2
+ name: "en",
3
+ el: {
4
+ table: {
5
+ refresh: "Refresh"
6
+ },
7
+ skeleton: {
8
+ loadingDescription: "Loading data...",
9
+ emptyDescription: "No data",
10
+ emptyBtnText: "Refresh",
11
+ errorTitle: "Oops! Something went wrong.",
12
+ errorBtnText: "Refresh"
13
+ },
14
+ fileUpload: {
15
+ btnText: "Upload"
16
+ },
17
+ imageUpload: {
18
+ compressText: "Compress image"
19
+ },
20
+ tags: {
21
+ addText: "Add"
22
+ },
23
+ schemaForm: {
24
+ ElInput: {
25
+ placeholder: "Please enter"
26
+ },
27
+ ElSelect: {
28
+ placeholder: "Please select"
29
+ },
30
+ ElDatePicker: {
31
+ placeholder: "Please select",
32
+ startPlaceholder: "Start date",
33
+ endPlaceholder: "End date"
34
+ }
35
+ },
36
+ schemaFilter: {
37
+ searchText: "Search",
38
+ resetText: "Reset"
39
+ },
40
+ schemaFormDialog: {
41
+ cancelText: "Cancel",
42
+ confirmText: "Confirm"
43
+ }
44
+ }
45
+ };
46
+ export {
47
+ e as default
48
+ };
@@ -3,7 +3,6 @@ declare const _default: {
3
3
  el: {
4
4
  table: {
5
5
  refresh: string;
6
- description: string;
7
6
  };
8
7
  skeleton: {
9
8
  loadingDescription: string;
@@ -2,8 +2,7 @@ const e = {
2
2
  name: "zh-cn",
3
3
  el: {
4
4
  table: {
5
- refresh: "刷新",
6
- description: "当前颜色 {color},按 Enter 键选择新颜色"
5
+ refresh: "刷新"
7
6
  },
8
7
  skeleton: {
9
8
  loadingDescription: "正在加载数据...",
@@ -7,7 +7,6 @@ export declare function useLocale(): {
7
7
  el: {
8
8
  table: {
9
9
  refresh: string;
10
- description: string;
11
10
  };
12
11
  skeleton: {
13
12
  loadingDescription: string;
@@ -2,30 +2,27 @@ import p from "@daysnap/banana";
2
2
  import { isFunction as v } from "@daysnap/utils";
3
3
  import { useAsyncTask as d } from "@vrojs/use";
4
4
  import { reactive as g, ref as h } from "vue";
5
- function V(t, e, n = {}) {
6
- const { instanceRef: i, source: a, ...s } = n, o = g(v(t) ? t() : t), r = i ?? h(), { loading: c, trigger: m, error: u, data: f } = d(
7
- async () => {
8
- if (!r.value)
9
- return;
10
- try {
11
- await r.value.validate();
12
- } catch {
13
- throw "";
14
- }
15
- const l = await r.value.extractValues();
16
- await e?.(l);
17
- },
18
- { throwError: !0, ...s }
19
- );
5
+ function x(r, e, n = {}) {
6
+ const { instanceRef: i, source: a, ...s } = n, o = g(v(r) ? r() : r), t = i ?? h(), { loading: c, trigger: m, error: u, data: f } = d(async () => {
7
+ if (!t.value)
8
+ return;
9
+ try {
10
+ await t.value.validate();
11
+ } catch {
12
+ throw "";
13
+ }
14
+ const l = await t.value.extractValues();
15
+ await e?.(l);
16
+ }, s);
20
17
  return a && p.assignment(a, o), {
21
18
  data: f,
22
19
  error: u,
23
20
  schema: o,
24
- refVroElSchemaForm: r,
21
+ refVroElSchemaForm: t,
25
22
  loading: c,
26
23
  trigger: m
27
24
  };
28
25
  }
29
26
  export {
30
- V as useVroElSchemaForm
27
+ x as useVroElSchemaForm
31
28
  };
@@ -1,112 +1,114 @@
1
- import { defineComponent as z, computed as S, ref as F, watchEffect as A, useTemplateRef as I, createBlock as P, openBlock as h, unref as u, mergeProps as m, withCtx as c, createVNode as B, createElementBlock as G, renderSlot as E, Fragment as H, renderList as _, createSlots as O, resolveDynamicComponent as J } from "vue";
1
+ import { defineComponent as z, computed as I, ref as F, watchEffect as A, useTemplateRef as O, createBlock as P, openBlock as g, unref as u, mergeProps as c, withCtx as i, createVNode as j, createElementBlock as G, renderSlot as E, Fragment as H, renderList as _, createSlots as B, resolveDynamicComponent as J } from "vue";
2
2
  import Q from "@daysnap/banana";
3
- import { isFunction as p, isString as R, filterEmptyValue as W } from "@daysnap/utils";
4
- import { getSlotEntries as j } from "@vrojs/base";
3
+ import { isFunction as d, isString as R, filterEmptyValue as W } from "@daysnap/utils";
4
+ import { getSlotEntries as D } from "@vrojs/base";
5
5
  import { ElForm as X, ElRow as Y, ElCol as Z, ElFormItem as k } from "element-plus";
6
6
  import { useLocale as ee } from "../locale/useLocale.js";
7
7
  import { datePickerValueFormat as re } from "../utils/datePickerValueFormat.js";
8
8
  import { defineVroElSchemaFormFieldTrigger as ae } from "./defineVroElSchemaFormFieldTrigger.js";
9
9
  import { vroElSchemaFormProps as oe } from "./types.js";
10
10
  import { vroElSchemaFormFieldManager as te } from "./vroElSchemaFormFieldManager.js";
11
- const ve = /* @__PURE__ */ z({
11
+ const he = /* @__PURE__ */ z({
12
12
  name: "VroElSchemaForm",
13
13
  __name: "vro-el-schema-form",
14
14
  props: oe,
15
15
  emits: ["change-field", "input-field"],
16
- setup(D, { expose: $, emit: x }) {
17
- const C = x, l = D, y = S(() => ({
16
+ setup($, { expose: x, emit: y }) {
17
+ const C = y, s = $, K = I(() => ({
18
18
  validateOnRuleChange: !1,
19
- ...l.formProps
20
- })), { locale: K } = ee(), i = F({}), V = F({}), d = F({});
19
+ ...s.formProps
20
+ })), { locale: L } = ee(), V = F({}), b = F({}), h = F({});
21
21
  A(() => {
22
- const { schema: e } = l;
23
- d.value = {}, Object.entries(e).forEach(([t, r]) => {
24
- let { hidden: a, value: o, rules: s, is: n } = r;
25
- p(a) && (a = a(o, r, e)), n || (a = !0), a || (V.value[t] = o, d.value[t] = r), p(i) && (i.value = i(o, r, e)), i.value[t] = s;
26
- });
22
+ const { schema: e } = s;
23
+ h.value = {};
24
+ const t = {}, r = {};
25
+ Object.entries(e).forEach(([o, a]) => {
26
+ let { hidden: l, value: n, rules: m, is: p } = a;
27
+ d(l) && (l = l(n, a, e)), p || (l = !0), l || (r[o] = n, h.value[o] = a), d(m) && (m = m(n, a, e)), t[o] = m;
28
+ }), Object.assign(b.value, r), Object.assign(V.value, t);
27
29
  });
28
- const b = S(() => Object.entries(d.value).reduce((e, [t, r]) => {
29
- let { props: a = {}, is: o, options: s, labelKey: n, valueKey: q } = r;
30
- if (R(o)) {
31
- const g = te.get(o);
32
- if (g) {
33
- let w = {};
34
- R(o) && (w = K.value.el.schemaForm[o]), o === "ElDatePicker" && (a.valueFormat = re[a?.type ?? "date"]), o = g.is, a = Object.assign(
30
+ const w = I(() => Object.entries(h.value).reduce((e, [t, r]) => {
31
+ let { props: o = {}, is: a, options: l, labelKey: n, valueKey: m } = r;
32
+ if (R(a)) {
33
+ const p = te.get(a);
34
+ if (p) {
35
+ let S = {};
36
+ R(a) && (S = L.value.el.schemaForm[a]), a === "ElDatePicker" && (o.valueFormat = re[o?.type ?? "date"]), a = p.is, o = Object.assign(
35
37
  {},
36
- g.props,
37
- w,
38
- W({ options: s, labelKey: n, valueKey: q }),
39
- a
40
- ), a.disabled && (a.placeholder = "-", o === "ElDatePicker" && (a.startPlaceholder = "-", a.endPlaceholder = "-"));
38
+ p.props,
39
+ S,
40
+ W({ options: l, labelKey: n, valueKey: m }),
41
+ o
42
+ ), o.disabled && (o.placeholder = "-", a === "ElDatePicker" && (o.startPlaceholder = "-", o.endPlaceholder = "-"));
41
43
  }
42
44
  }
43
- return e[t] = { is: o, props: a }, e;
44
- }, {})), L = async (e, t) => {
45
- C("change-field", { key: e, value: t }), await l.schema[e]?.onChange?.(t, l.schema[e], l.schema);
45
+ return e[t] = { is: a, props: o }, e;
46
+ }, {})), M = async (e, t) => {
47
+ C("change-field", { key: e, value: t }), await s.schema[e]?.onChange?.(t, s.schema[e], s.schema);
46
48
  }, T = async (e, t) => {
47
- C("input-field", { key: e, value: t }), await l.schema[e]?.onInput?.(t, l.schema[e], l.schema);
48
- }, v = I("refComponents"), f = I("refForm"), U = async () => {
49
- const e = v.value?.filter((t) => p(t.validate)) ?? [];
49
+ C("input-field", { key: e, value: t }), await s.schema[e]?.onInput?.(t, s.schema[e], s.schema);
50
+ }, v = O("refComponents"), f = O("refForm"), U = async () => {
51
+ const e = v.value?.filter((t) => d(t.validate)) ?? [];
50
52
  await Promise.all([f.value, ...e].map((t) => t?.validate()));
51
- }, M = async () => {
52
- const e = v.value?.filter((r) => p(r.extractValues)) ?? [], t = await Promise.all(
53
+ }, N = async () => {
54
+ const e = v.value?.filter((r) => d(r.extractValues)) ?? [], t = await Promise.all(
53
55
  e.map((r) => r.extractValues())
54
56
  );
55
- return t.push(Q.extract(l.schema)), t.filter(Boolean).reduce((r, a) => ({ ...r, ...a }), {});
56
- }, N = ae(async (e) => {
57
- const t = v.value?.filter((r) => p(r.trigger)) ?? [];
57
+ return t.push(Q.extract(s.schema)), t.filter(Boolean).reduce((r, o) => ({ ...r, ...o }), {});
58
+ }, q = ae(async (e) => {
59
+ const t = v.value?.filter((r) => d(r.trigger)) ?? [];
58
60
  await Promise.all(t.map((r) => r.trigger(e)));
59
61
  });
60
- return $({
62
+ return x({
61
63
  get form() {
62
64
  return f.value;
63
65
  },
64
66
  validate: U,
65
67
  resetFields: () => f.value?.resetFields(),
66
- trigger: N,
67
- extractValues: M,
68
+ trigger: q,
69
+ extractValues: N,
68
70
  validateField: async (e) => f.value?.validateField(e)
69
- }), (e, t) => (h(), P(u(X), m(y.value, {
71
+ }), (e, t) => (g(), P(u(X), c(K.value, {
70
72
  ref_key: "refForm",
71
73
  ref: f,
72
74
  class: "vro-el-schema-form",
73
- model: V.value,
74
- rules: i.value
75
+ model: b.value,
76
+ rules: V.value
75
77
  }), {
76
- default: c(() => [
77
- B(u(Y), m({ gutter: 16 }, e.rowProps), {
78
- default: c(() => [
79
- (h(!0), G(H, null, _(d.value, (r, a) => (h(), P(u(Z), m({ key: a }, { ref_for: !0 }, { ...e.colProps, ...r.colProps }), {
80
- default: c(() => [
81
- B(u(k), m({
78
+ default: i(() => [
79
+ j(u(Y), c({ gutter: 16 }, e.rowProps), {
80
+ default: i(() => [
81
+ (g(!0), G(H, null, _(h.value, (r, o) => (g(), P(u(Z), c({ key: o }, { ref_for: !0 }, { ...e.colProps, ...r.colProps }), {
82
+ default: i(() => [
83
+ j(u(k), c({
82
84
  label: r.label,
83
- prop: a
84
- }, { ref_for: !0 }, { ...e.formItemProps, ...r.formItemProps }), O({
85
- default: c(() => [
86
- (h(), P(J(b.value?.[a]?.is), m({
85
+ prop: o
86
+ }, { ref_for: !0 }, { ...e.formItemProps, ...r.formItemProps }), B({
87
+ default: i(() => [
88
+ (g(), P(J(w.value?.[o]?.is), c({
87
89
  modelValue: r.value,
88
- "onUpdate:modelValue": (o) => r.value = o
89
- }, { ref_for: !0 }, b.value?.[a]?.props, {
90
+ "onUpdate:modelValue": (a) => r.value = a
91
+ }, { ref_for: !0 }, w.value?.[o]?.props, {
90
92
  ref_for: !0,
91
93
  ref_key: "refComponents",
92
94
  ref: v,
93
- onChange: (o) => L(a, o),
94
- onInput: (o) => T(a, o)
95
- }), O({ _: 2 }, [
96
- _(u(j)(r.slots), ({ source: o, target: s }) => ({
97
- name: s,
98
- fn: c((n) => [
99
- E(e.$slots, o, m({ ref_for: !0 }, n ?? {}, { item: r }))
95
+ onChange: (a) => M(o, a),
96
+ onInput: (a) => T(o, a)
97
+ }), B({ _: 2 }, [
98
+ _(u(D)(r.slots), ({ source: a, target: l }) => ({
99
+ name: l,
100
+ fn: i((n) => [
101
+ E(e.$slots, a, c({ ref_for: !0 }, n ?? {}, { item: r }))
100
102
  ])
101
103
  }))
102
104
  ]), 1040, ["modelValue", "onUpdate:modelValue", "onChange", "onInput"]))
103
105
  ]),
104
106
  _: 2
105
107
  }, [
106
- _(u(j)(r.itemSlots), ({ source: o, target: s }) => ({
107
- name: s,
108
- fn: c((n) => [
109
- E(e.$slots, o, m({ ref_for: !0 }, n ?? {}, { item: r }))
108
+ _(u(D)(r.itemSlots), ({ source: a, target: l }) => ({
109
+ name: l,
110
+ fn: i((n) => [
111
+ E(e.$slots, a, c({ ref_for: !0 }, n ?? {}, { item: r }))
110
112
  ])
111
113
  }))
112
114
  ]), 1040, ["label", "prop"])
@@ -123,5 +125,5 @@ const ve = /* @__PURE__ */ z({
123
125
  }
124
126
  });
125
127
  export {
126
- ve as default
128
+ he as default
127
129
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vrojs/element-plus",
3
- "version": "0.0.4",
3
+ "version": "0.0.6",
4
4
  "description": "vrojs ui",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
@@ -10,8 +10,9 @@
10
10
  "dist"
11
11
  ],
12
12
  "sideEffects": [
13
- "dist/**/style/*",
14
- "dist/**/*.css"
13
+ "src/**/style/*",
14
+ "src/**/*.css",
15
+ "src/**/*.scss"
15
16
  ],
16
17
  "keywords": [
17
18
  "vro",
@@ -24,7 +25,11 @@
24
25
  "license": "MIT",
25
26
  "publishConfig": {
26
27
  "access": "public",
27
- "registry": "https://registry.npmjs.org/"
28
+ "registry": "https://registry.npmjs.org/",
29
+ "sideEffects": [
30
+ "dist/**/style/*",
31
+ "dist/**/*.css"
32
+ ]
28
33
  },
29
34
  "dependencies": {
30
35
  "copy-to-clipboard": "^3.3.3",