cosey 0.5.8 → 0.5.10

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.
@@ -312,6 +312,7 @@ declare const _Table: {
312
312
  setScrollLeft: (left?: number) => void;
313
313
  columns: import("element-plus").TableColumnCtx<any>[];
314
314
  updateKeyChildren: (key: string, data: any[]) => void;
315
+ resetForm: () => void;
315
316
  }, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, import("vue").PublicProps, {
316
317
  tableLayout: "auto" | "fixed";
317
318
  border: boolean;
@@ -653,6 +654,7 @@ declare const _Table: {
653
654
  setScrollLeft: (left?: number) => void;
654
655
  columns: import("element-plus").TableColumnCtx<any>[];
655
656
  updateKeyChildren: (key: string, data: any[]) => void;
657
+ resetForm: () => void;
656
658
  }, {}, {}, {}, {
657
659
  tableLayout: "auto" | "fixed";
658
660
  border: boolean;
@@ -852,6 +854,7 @@ declare const _Table: {
852
854
  setScrollLeft: (left?: number) => void;
853
855
  columns: import("element-plus").TableColumnCtx<any>[];
854
856
  updateKeyChildren: (key: string, data: any[]) => void;
857
+ resetForm: () => void;
855
858
  }, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, {
856
859
  tableLayout: "auto" | "fixed";
857
860
  border: boolean;
@@ -1,4 +1,4 @@
1
- import { defineComponent, ref, reactive, computed, onBeforeMount, unref, createBlock, openBlock, resolveDynamicComponent, withModifiers } from 'vue';
1
+ import { defineComponent, ref, reactive, computed, onBeforeMount, unref, createBlock, openBlock, resolveDynamicComponent } from 'vue';
2
2
  import { tableQueryProps, omittedTableQueryProps, tableQueryExposeKeys } from './table-query.js';
3
3
  import { reactiveOmit } from '@vueuse/core';
4
4
  import { cloneDeep } from 'lodash-es';
@@ -47,11 +47,17 @@ var stdin_default = /* @__PURE__ */defineComponent({
47
47
  ...formQueryProps,
48
48
  ref: formQueryRef,
49
49
  model: unref(formModel),
50
- onKeyup: withModifiers(event => {
50
+ onKeyup: event => {
51
51
  if (event.key === "Enter") {
52
+ event.preventDefault();
52
53
  onEnter();
53
54
  }
54
- }, ["prevent"])
55
+ },
56
+ onKeydown: event => {
57
+ if (event.key === "Enter") {
58
+ event.preventDefault();
59
+ }
60
+ }
55
61
  }, () => {
56
62
  return props.schemes.map(item => {
57
63
  const {
@@ -190,6 +190,7 @@ export type TableExpose = TableCustomExpose & TableQueryExpose & {
190
190
  setScrollLeft: (left?: number) => void;
191
191
  columns: TableColumnCtx<any>[];
192
192
  updateKeyChildren: (key: string, data: any[]) => void;
193
+ resetForm: () => void;
193
194
  };
194
195
  export declare const tableExposeKeys: string[];
195
196
  export declare const defaultTableConfig: {
@@ -111,6 +111,7 @@ const tableExposeKeys = [
111
111
  ...tableQueryExposeKeys,
112
112
  "reset",
113
113
  "submit",
114
+ "resetForm",
114
115
  "reload",
115
116
  "expandAll",
116
117
  "collapseAll",
@@ -172,6 +172,7 @@ declare const __VLS_component: import("vue").DefineComponent<import("vue").Extra
172
172
  setScrollLeft: (left?: number) => void;
173
173
  columns: TableColumnCtx<any>[];
174
174
  updateKeyChildren: (key: string, data: any[]) => void;
175
+ resetForm: () => void;
175
176
  }, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
176
177
  api: {
177
178
  type: import("vue").PropType<(...args: any[]) => Promise<any> | any>;
@@ -356,6 +356,11 @@ var stdin_default = /* @__PURE__ */defineComponent({
356
356
  return onReset();
357
357
  }
358
358
  };
359
+ const resetForm = () => {
360
+ if (props.formProps) {
361
+ return tableQueryRef.value?.reset();
362
+ }
363
+ };
359
364
  const statsColumns = computed(() => unref(props.statsColumns));
360
365
  const statsData = computed(() => unref(props.statsData));
361
366
  const isStatsVisible = computed(() => statsColumns.value && statsColumns.value.length > 0);
@@ -372,7 +377,8 @@ var stdin_default = /* @__PURE__ */defineComponent({
372
377
  getRootEl,
373
378
  getPagination,
374
379
  submit,
375
- reset
380
+ reset,
381
+ resetForm
376
382
  }, () => tableQueryRef.value);
377
383
  watch(() => props.getExpose, () => {
378
384
  props.getExpose?.(expose);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "cosey",
3
- "version": "0.5.8",
3
+ "version": "0.5.10",
4
4
  "description": "基于 Vue3 + vite 的后台管理系统框架",
5
5
  "type": "module",
6
6
  "main": "index.js",