@vrojs/element-plus 0.0.8 → 0.0.9

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.
@@ -116,6 +116,7 @@ export type VroElSchemaFormCustomSchemaField = VroElSchemaFormSchemaFieldBase &
116
116
  is?: VroElSchemaFormRawComponent;
117
117
  };
118
118
  export type VroElSchemaFormSchemaField = VroElSchemaFormMappedSchemaField | VroElSchemaFormCustomSchemaField;
119
+ export type VroElSchemaFormSchemaBase = Record<string, VroElSchemaFormSchemaFieldBase>;
119
120
  export type VroElSchemaFormSchema = Record<string, VroElSchemaFormSchemaField>;
120
121
  export type VroElSchemaFormFormProps = Partial<Omit<FormProps, 'model' | 'rules'>>;
121
122
  export interface VroElSchemaFormFieldEvent {
@@ -1,15 +1,18 @@
1
1
  import { UseAsyncTaskOptions } from '@vrojs/use';
2
2
  import { Ref } from 'vue';
3
3
  import { VroElSchemaFormInstance } from '.';
4
- import { VroElSchemaFormSchema } from './types';
4
+ import { VroElSchemaFormSchema, VroElSchemaFormSchemaBase, VroElSchemaFormSchemaFieldBase } from './types';
5
5
  export interface UseVroElSchemaFormOptions extends Pick<UseAsyncTaskOptions<any>, 'throwError' | 'onError'> {
6
6
  source?: Record<string, any>;
7
7
  instanceRef?: Ref<VroElSchemaFormInstance | undefined>;
8
8
  }
9
- export declare function useVroElSchemaForm<T extends Record<string, any> = Record<string, any>>(rawSchema: (() => VroElSchemaFormSchema) | VroElSchemaFormSchema, task?: (data: T) => Promise<void>, options?: UseVroElSchemaFormOptions): {
10
- data: Ref<Awaited<T> | undefined, Awaited<T> | undefined>;
9
+ export type UseVroElSchemaFormSchema<TSchema extends VroElSchemaFormSchema> = {
10
+ [K in keyof TSchema]: VroElSchemaFormSchemaFieldBase;
11
+ };
12
+ export declare function useVroElSchemaForm<D extends Record<string, any> = any, T extends VroElSchemaFormSchema = VroElSchemaFormSchemaBase>(rawSchema: (() => T) | T, task?: (data: D) => Promise<void>, options?: UseVroElSchemaFormOptions): {
13
+ data: Ref<Awaited<D> | undefined, Awaited<D> | undefined>;
11
14
  error: Ref<unknown, unknown>;
12
- schema: VroElSchemaFormSchema;
15
+ schema: import('vue').Reactive<UseVroElSchemaFormSchema<T>>;
13
16
  schemaFormRef: Ref<({
14
17
  $: import('vue').ComponentInternalInstance;
15
18
  $data: {};
@@ -896,5 +899,5 @@ export declare function useVroElSchemaForm<T extends Record<string, any> = Recor
896
899
  $slots: Readonly<import('./types').VroElSchemaFormSlots> & import('./types').VroElSchemaFormSlots;
897
900
  }) | undefined>;
898
901
  loading: Ref<boolean, boolean>;
899
- trigger: () => Promise<T | undefined>;
902
+ trigger: () => Promise<D | undefined>;
900
903
  };
@@ -3,7 +3,9 @@ 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
5
  function R(r, n, s = {}) {
6
- const { instanceRef: i, source: a, ...c } = s, e = g(v(r) ? r() : r), t = i ?? h(), { loading: m, trigger: u, error: f, data: l } = d(async () => {
6
+ const { instanceRef: i, source: a, ...c } = s, e = g(
7
+ v(r) ? r() : r
8
+ ), t = i ?? h(), { loading: m, trigger: u, error: f, data: l } = d(async () => {
7
9
  if (!t.value)
8
10
  return;
9
11
  try {
@@ -1,9 +1,7 @@
1
- import { VroElSchemaFormSchema, VroElSchemaFormSchemaField } from '../vro-el-schema-form';
1
+ import { VroElSchemaFormSchema } from '../vro-el-schema-form';
2
2
  import { VroElTableRequest } from './types';
3
3
  import { UseVroElTableOptions, UseVroElTableRawColumns, useVroElTable } from './useVroElTable';
4
4
  export interface CreateUseVroElTable<Row extends Record<string, any> = any> {
5
- <R extends VroElSchemaFormSchema, S extends VroElSchemaFormSchema = {
6
- [P in keyof R]: VroElSchemaFormSchemaField;
7
- }>(rowSchema: (() => R) | R, rawColumns: UseVroElTableRawColumns<Row>, request: VroElTableRequest<Row>, options?: UseVroElTableOptions<Row>): ReturnType<typeof useVroElTable<Row, R, S>>;
5
+ <R extends VroElSchemaFormSchema>(rowSchema: (() => R) | R, rawColumns: UseVroElTableRawColumns<Row>, request: VroElTableRequest<Row>, options?: UseVroElTableOptions<Row>): ReturnType<typeof useVroElTable<Row, R>>;
8
6
  }
9
7
  export declare function createUseVroElTable<Row extends Record<string, any> = any>(): CreateUseVroElTable<Row>;
@@ -1,6 +1,6 @@
1
1
  import { UseAsyncTaskOptions } from '@vrojs/use';
2
2
  import { Ref } from 'vue';
3
- import { VroElSchemaFormSchema, VroElSchemaFormSchemaField } from '../vro-el-schema-form';
3
+ import { VroElSchemaFormSchema, VroElSchemaFormSchemaFieldBase } from '../vro-el-schema-form';
4
4
  import { VroElTableColumnGroupColumns } from '../vro-el-table-column-group';
5
5
  import { VroElTableRequest } from './types';
6
6
  export interface UseVroElTableOptions<Row extends Record<string, any> = any> extends Pick<UseAsyncTaskOptions<any>, 'activated' | 'immediate' | 'throwError' | 'onError'> {
@@ -13,12 +13,13 @@ export type UseVroElTableAsyncTaskParams = {
13
13
  query?: Record<string, any>;
14
14
  } | number;
15
15
  export type UseVroElTableRawColumns<T extends Record<string, any> = any> = (() => VroElTableColumnGroupColumns<T>) | VroElTableColumnGroupColumns<T>;
16
- export declare function useVroElTable<Row extends Record<string, any> = any, R extends VroElSchemaFormSchema = VroElSchemaFormSchema, S extends VroElSchemaFormSchema = {
17
- [P in keyof R]: VroElSchemaFormSchemaField;
18
- }>(rowSchema: (() => R) | R, rawColumns: UseVroElTableRawColumns<Row>, request: VroElTableRequest<Row>, options?: UseVroElTableOptions<Row>): {
16
+ export type UseVroElTableSchema<T extends VroElSchemaFormSchema> = {
17
+ [P in keyof T]: VroElSchemaFormSchemaFieldBase;
18
+ };
19
+ export declare function useVroElTable<Row extends Record<string, any> = any, R extends VroElSchemaFormSchema = VroElSchemaFormSchema>(rowSchema: (() => R) | R, rawColumns: UseVroElTableRawColumns<Row>, request: VroElTableRequest<Row>, options?: UseVroElTableOptions<Row>): {
19
20
  tableProps: import('vue').ComputedRef<{
20
21
  filterProps: {
21
- schema: import('vue').Reactive<S>;
22
+ schema: import('vue').Reactive<UseVroElTableSchema<R>>;
22
23
  };
23
24
  loading: boolean;
24
25
  columns: import('vue').Reactive<VroElTableColumnGroupColumns<Row>>;
@@ -30,7 +31,7 @@ export declare function useVroElTable<Row extends Record<string, any> = any, R e
30
31
  };
31
32
  }>;
32
33
  query: Ref<Record<string, any>, Record<string, any>>;
33
- schema: import('vue').Reactive<S>;
34
+ schema: import('vue').Reactive<UseVroElTableSchema<R>>;
34
35
  columns: import('vue').Reactive<VroElTableColumnGroupColumns<Row>>;
35
36
  trigger: (params?: UseVroElTableAsyncTaskParams) => Promise<Row[]>;
36
37
  data: Ref<Row[], Row[]>;
@@ -4,7 +4,9 @@ import { useAsyncTask as T } from "@vrojs/use";
4
4
  import { reactive as a, ref as V, computed as k } from "vue";
5
5
  import "../vro-el-table-column-group/index.js";
6
6
  function Q(r, o, f, y = {}) {
7
- const { query: P, ...m } = y, i = a(p(r) ? r() : r), u = a(p(o) ? o() : o), n = P ?? V(z(q.extract(i), !0)), t = a({
7
+ const { query: P, ...m } = y, i = a(
8
+ p(r) ? r() : r
9
+ ), u = a(p(o) ? o() : o), n = P ?? V(z(q.extract(i), !0)), t = a({
8
10
  currentPage: 1,
9
11
  pageSize: 10,
10
12
  total: 0
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vrojs/element-plus",
3
- "version": "0.0.8",
3
+ "version": "0.0.9",
4
4
  "description": "vrojs ui",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",