@firerian/fireui 1.0.0 → 1.0.1
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/fireui.cjs +1 -1
- package/dist/fireui.cjs.map +1 -1
- package/dist/fireui.css +1 -1
- package/dist/fireui.es.mjs +10 -9
- package/dist/fireui.es.mjs.map +1 -1
- package/dist/fireui.umd.js +1 -1
- package/dist/fireui.umd.js.map +1 -1
- package/dist/types/index.d.ts +8 -7
- package/package.json +1 -1
- package/src/components/form/form-item.vue +1 -1
- package/src/components/form/form.vue +4 -3
- package/src/components/input/input.vue +1 -1
- package/src/types/form.ts +1 -1
- package/src/utils/useNamespace.ts +1 -1
package/dist/types/index.d.ts
CHANGED
|
@@ -5,6 +5,7 @@ import { ComponentCustomProps } from 'vue';
|
|
|
5
5
|
import { ComponentOptionsBase } from 'vue';
|
|
6
6
|
import { ComponentOptionsMixin } from 'vue';
|
|
7
7
|
import { ComponentProvideOptions } from 'vue';
|
|
8
|
+
import { ComputedRef } from 'vue';
|
|
8
9
|
import { CreateComponentPublicInstanceWithMixins } from 'vue';
|
|
9
10
|
import { DefineComponent } from 'vue';
|
|
10
11
|
import { GlobalComponents } from 'vue';
|
|
@@ -502,10 +503,10 @@ height: string | number;
|
|
|
502
503
|
|
|
503
504
|
export declare const FireForm: {
|
|
504
505
|
new (...args: any[]): CreateComponentPublicInstanceWithMixins<Readonly<FormProps<Record<string, any>>> & Readonly<{
|
|
505
|
-
onSubmit?: ((evt: Event) => any) | undefined;
|
|
506
|
+
onSubmit?: ((evt: Event, valid: boolean) => any) | undefined;
|
|
506
507
|
onReset?: (() => any) | undefined;
|
|
507
508
|
}>, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {} & {
|
|
508
|
-
submit: (evt: Event) => any;
|
|
509
|
+
submit: (evt: Event, valid: boolean) => any;
|
|
509
510
|
reset: () => any;
|
|
510
511
|
}, PublicProps, {
|
|
511
512
|
model: Record<string, any>;
|
|
@@ -522,7 +523,7 @@ export declare const FireForm: {
|
|
|
522
523
|
M: {};
|
|
523
524
|
Defaults: {};
|
|
524
525
|
}, Readonly<FormProps<Record<string, any>>> & Readonly<{
|
|
525
|
-
onSubmit?: ((evt: Event) => any) | undefined;
|
|
526
|
+
onSubmit?: ((evt: Event, valid: boolean) => any) | undefined;
|
|
526
527
|
onReset?: (() => any) | undefined;
|
|
527
528
|
}>, {}, {}, {}, {}, {
|
|
528
529
|
model: Record<string, any>;
|
|
@@ -536,10 +537,10 @@ export declare const FireForm: {
|
|
|
536
537
|
__isTeleport?: never;
|
|
537
538
|
__isSuspense?: never;
|
|
538
539
|
} & ComponentOptionsBase<Readonly<FormProps<Record<string, any>>> & Readonly<{
|
|
539
|
-
onSubmit?: ((evt: Event) => any) | undefined;
|
|
540
|
+
onSubmit?: ((evt: Event, valid: boolean) => any) | undefined;
|
|
540
541
|
onReset?: (() => any) | undefined;
|
|
541
542
|
}>, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {} & {
|
|
542
|
-
submit: (evt: Event) => any;
|
|
543
|
+
submit: (evt: Event, valid: boolean) => any;
|
|
543
544
|
reset: () => any;
|
|
544
545
|
}, string, {
|
|
545
546
|
model: Record<string, any>;
|
|
@@ -932,7 +933,7 @@ export declare interface FormEmits {
|
|
|
932
933
|
/**
|
|
933
934
|
* 表单提交事件
|
|
934
935
|
*/
|
|
935
|
-
(e: 'submit', evt: Event): void;
|
|
936
|
+
(e: 'submit', evt: Event, valid: boolean): void;
|
|
936
937
|
/**
|
|
937
938
|
* 表单重置事件
|
|
938
939
|
*/
|
|
@@ -1575,7 +1576,7 @@ declare type TooltipTrigger_2 = 'hover' | 'click' | 'focus';
|
|
|
1575
1576
|
* @returns BEM 命名空间对象
|
|
1576
1577
|
*/
|
|
1577
1578
|
export declare function useNamespace(block: string): {
|
|
1578
|
-
b: string
|
|
1579
|
+
b: ComputedRef<string>;
|
|
1579
1580
|
e: (element: string) => string;
|
|
1580
1581
|
m: (modifier: string) => string;
|
|
1581
1582
|
em: (element: string, modifier: string) => string;
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<form
|
|
3
3
|
:class="[
|
|
4
|
-
ns.b,
|
|
4
|
+
ns.b.value,
|
|
5
5
|
ns.m(labelPosition),
|
|
6
6
|
{
|
|
7
7
|
[ns.m('inline')]: inline
|
|
@@ -35,8 +35,9 @@ const emit = defineEmits<FormEmits>()
|
|
|
35
35
|
|
|
36
36
|
const formContext = provideForm(props)
|
|
37
37
|
|
|
38
|
-
const handleSubmit = (evt: Event) => {
|
|
39
|
-
|
|
38
|
+
const handleSubmit = async (evt: Event) => {
|
|
39
|
+
const valid = await formContext.form.validate()
|
|
40
|
+
emit('submit', evt, valid)
|
|
40
41
|
}
|
|
41
42
|
|
|
42
43
|
const handleReset = () => {
|
package/src/types/form.ts
CHANGED