@vinicunca/taman-ui 0.1.1 → 0.1.2
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/components/auth/index.mjs +1 -2
- package/dist/components/back-to-top/index.mjs +1 -2
- package/dist/components/button/taman-button-check-group.mjs +1 -1
- package/dist/components/button/taman-button-check-group.types.d.ts +5 -6
- package/dist/components/button/taman-button-check-group.vue.d.ts +1 -1
- package/dist/components/descriptions/taman-description.types.d.ts +12 -13
- package/dist/components/file-upload/index.mjs +1 -2
- package/dist/components/file-upload/taman-file-upload.mjs +1 -0
- package/dist/components/file-upload/taman-file-upload.types.d.ts +2 -3
- package/dist/components/full-screen/index.mjs +1 -2
- package/dist/components/icon/index.mjs +1 -2
- package/dist/components/input/password-strength.d.ts +5 -6
- package/dist/components/input/taman-input-currency.types.d.ts +2 -3
- package/dist/components/input-date/index.mjs +1 -2
- package/dist/components/input-date/taman-input-date.types.d.ts +5 -6
- package/dist/components/loading/index.mjs +1 -2
- package/dist/components/loading/types.d.ts +3 -4
- package/dist/components/logo/index.mjs +1 -2
- package/dist/components/render-content/index.mjs +1 -2
- package/dist/components/scrollbar/index.mjs +1 -2
- package/dist/components/scrollbar/scrollbar.vue.d.ts +2 -2
- package/dist/form/components/form-field-array.types.d.ts +2 -3
- package/dist/form/form-render/index.mjs +1 -2
- package/dist/form/form.api.d.ts +2 -2
- package/dist/form/form.api.mjs +2 -0
- package/dist/form/form.built-ins.d.ts +3 -4
- package/dist/form/form.built-ins.mjs +1 -0
- package/dist/form/form.codec.d.ts +7 -7
- package/dist/form/form.config.d.ts +2 -3
- package/dist/form/form.empty-value.d.ts +2 -3
- package/dist/form/form.types.d.ts +48 -48
- package/dist/form/form.use-taman-form.d.ts +3 -3
- package/dist/layout/components/taman-core-layout-sidebar.mjs +15 -13
- package/dist/layout/index.mjs +1 -2
- package/dist/layout/taman-core-layout.mjs +1 -1
- package/dist/menu/components/normal-menu/index.mjs +1 -2
- package/dist/menu/components/normal-menu/normal-menu.vue.d.ts +1 -1
- package/dist/popup/alert/alert-builder.d.ts +5 -6
- package/dist/popup/alert/alert.d.ts +7 -8
- package/dist/popup/alert/alert.vue.d.ts +1 -1
- package/dist/popup/alert/alert2.mjs +1 -1
- package/dist/popup/dialog/dialog.api.d.ts +2 -3
- package/dist/popup/dialog/dialog.api.mjs +2 -0
- package/dist/popup/dialog/dialog.types.d.ts +6 -6
- package/dist/popup/dialog/dialog.vue.d.ts +12 -12
- package/dist/popup/dialog/use-taman-dialog.d.ts +4 -4
- package/dist/popup/drawer/drawer.api.d.ts +2 -3
- package/dist/popup/drawer/drawer.api.mjs +1 -0
- package/dist/popup/drawer/drawer.types.d.ts +8 -8
- package/dist/popup/drawer/drawer.vue.d.ts +14 -14
- package/dist/popup/drawer/use-taman-drawer.d.ts +4 -4
- package/dist/tabs/components/index.mjs +1 -2
- package/dist/tabs/components/taman-tabs.mjs +1 -1
- package/dist/tabs/components/widgets/tool-more.mjs +1 -1
- package/dist/tabs/components/widgets/tool-refresh.mjs +1 -1
- package/dist/tabs/components/widgets/tool-screen.mjs +1 -1
- package/dist/tabs/strict-context-menu.d.ts +2 -2
- package/dist/tabs/tabs.types.d.ts +4 -5
- package/dist/tabs/taman-tabs-view.mjs +2 -2
- package/dist/ui/alert-dialog/alert-dialog-action.vue.d.ts +2 -2
- package/dist/ui/alert-dialog/alert-dialog-cancel.vue.d.ts +2 -2
- package/dist/ui/alert-dialog/alert-dialog-content.mjs +1 -1
- package/dist/ui/alert-dialog/alert-dialog-content.vue.d.ts +2 -2
- package/dist/ui/alert-dialog/alert-dialog-description.vue.d.ts +2 -2
- package/dist/ui/alert-dialog/alert-dialog-overlay.mjs +1 -1
- package/dist/ui/alert-dialog/alert-dialog-root.vue.d.ts +2 -2
- package/dist/ui/alert-dialog/alert-dialog-title.vue.d.ts +2 -2
- package/dist/ui/alert-dialog/alert-dialog-trigger.vue.d.ts +2 -2
- package/dist/ui/dialog/dialog-close.vue.d.ts +2 -2
- package/dist/ui/dialog/dialog-content.mjs +1 -1
- package/dist/ui/dialog/dialog-content.vue.d.ts +3 -3
- package/dist/ui/dialog/dialog-description.vue.d.ts +2 -2
- package/dist/ui/dialog/dialog-footer.mjs +1 -1
- package/dist/ui/dialog/dialog-overlay.mjs +1 -1
- package/dist/ui/dialog/dialog-overlay.vue.d.ts +1 -1
- package/dist/ui/dialog/dialog-root.vue.d.ts +2 -2
- package/dist/ui/dialog/dialog-title.vue.d.ts +2 -2
- package/dist/ui/dialog/dialog-trigger.vue.d.ts +2 -2
- package/dist/ui/form/form-control.vue.d.ts +2 -2
- package/dist/ui/form/form-field.vue.d.ts +1 -1
- package/dist/ui/form/form-label.vue.d.ts +2 -2
- package/dist/ui/form/injection-keys.d.ts +4 -5
- package/dist/ui/label/index.mjs +1 -2
- package/dist/ui/label/label.mjs +1 -1
- package/dist/ui/label/label.vue.d.ts +2 -2
- package/dist/ui/scroll-area/scroll-area.vue.d.ts +2 -2
- package/dist/ui/scroll-area/scroll-bar.vue.d.ts +1 -1
- package/dist/ui/sheet/sheet-close.vue.d.ts +2 -2
- package/dist/ui/sheet/sheet-content.mjs +1 -1
- package/dist/ui/sheet/sheet-content.vue.d.ts +3 -3
- package/dist/ui/sheet/sheet-description.vue.d.ts +2 -2
- package/dist/ui/sheet/sheet-root.vue.d.ts +2 -2
- package/dist/ui/sheet/sheet-title.vue.d.ts +2 -2
- package/dist/ui/sheet/sheet.variants.d.ts +17 -18
- package/dist/ui/sheet/sheet.variants.mjs +3 -2
- package/dist/unocss/content.d.ts +2 -3
- package/dist/unocss/index.mjs +1 -2
- package/package.json +11 -10
|
@@ -6,32 +6,32 @@ import { AnyFieldApi } from "@tanstack/vue-form";
|
|
|
6
6
|
import { MaybeComputedRef } from "@vinicunca/taman-core/typings";
|
|
7
7
|
import { ButtonProps } from "pohon-ui";
|
|
8
8
|
//#region src/form/form.types.d.ts
|
|
9
|
-
type FormValues = Record<string, any>;
|
|
10
|
-
type FormValuePatch<T> = T extends ((...args: Array<any>) => unknown) | Date | ReadonlyArray<unknown> ? T : T extends object ? { [K in keyof T]?: FormValuePatch<T[K]>; } : T;
|
|
11
|
-
interface FormCodec<TFormValues extends FormValues = FormValues, TSubmitValues extends FormValues = TFormValues> {
|
|
9
|
+
export type FormValues = Record<string, any>;
|
|
10
|
+
export type FormValuePatch<T> = T extends ((...args: Array<any>) => unknown) | Date | ReadonlyArray<unknown> ? T : T extends object ? { [K in keyof T]?: FormValuePatch<T[K]>; } : T;
|
|
11
|
+
export interface FormCodec<TFormValues extends FormValues = FormValues, TSubmitValues extends FormValues = TFormValues> {
|
|
12
12
|
decode: (values: Readonly<TSubmitValues>) => TFormValues;
|
|
13
13
|
encode: (values: Readonly<TFormValues>) => TSubmitValues;
|
|
14
14
|
}
|
|
15
|
-
type FormFieldName<TValues extends FormValues = FormValues> = Extract<keyof TValues, string> | (Record<never, never> & string);
|
|
16
|
-
type FormFieldValue<TValues extends FormValues, TFieldName extends string> = TFieldName extends keyof TValues ? TValues[TFieldName] : unknown;
|
|
17
|
-
type FormBaseComponentType = BuiltInFormComponentType | (Record<never, never> & string);
|
|
15
|
+
export type FormFieldName<TValues extends FormValues = FormValues> = Extract<keyof TValues, string> | (Record<never, never> & string);
|
|
16
|
+
export type FormFieldValue<TValues extends FormValues, TFieldName extends string> = TFieldName extends keyof TValues ? TValues[TFieldName] : unknown;
|
|
17
|
+
export type FormBaseComponentType = BuiltInFormComponentType | (Record<never, never> & string);
|
|
18
18
|
type Breakpoints = '2xl:' | '3xl:' | '' | 'lg:' | 'md:' | 'sm:' | 'xl:';
|
|
19
19
|
type GridCols = 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13;
|
|
20
20
|
type WrapperClassType = `${Breakpoints}grid-cols-${GridCols}` | (Record<never, never> & string);
|
|
21
|
-
type FormItemClassType = `${Breakpoints}cols-end-${'auto' | GridCols}` | `${Breakpoints}cols-span-${'auto' | 'full' | GridCols}` | `${Breakpoints}cols-start-${'auto' | GridCols}` | (Record<never, never> & string) | WrapperClassType;
|
|
22
|
-
interface FormFieldOptions {
|
|
21
|
+
export type FormItemClassType = `${Breakpoints}cols-end-${'auto' | GridCols}` | `${Breakpoints}cols-span-${'auto' | 'full' | GridCols}` | `${Breakpoints}cols-start-${'auto' | GridCols}` | (Record<never, never> & string) | WrapperClassType;
|
|
22
|
+
export interface FormFieldOptions {
|
|
23
23
|
asyncDebounceMs?: number;
|
|
24
24
|
validators?: NonNullable<AnyFieldApi['options']['validators']>;
|
|
25
25
|
validateOn?: ReadonlyArray<FormValidationTrigger>;
|
|
26
26
|
}
|
|
27
|
-
type FormValidationTrigger = 'blur' | 'change';
|
|
28
|
-
interface FormShape {
|
|
27
|
+
export type FormValidationTrigger = 'blur' | 'change';
|
|
28
|
+
export interface FormShape {
|
|
29
29
|
default?: any;
|
|
30
30
|
fieldName: string;
|
|
31
31
|
required?: boolean;
|
|
32
32
|
rules?: ZodType;
|
|
33
33
|
}
|
|
34
|
-
interface FormRuntimeField<TValue = unknown> {
|
|
34
|
+
export interface FormRuntimeField<TValue = unknown> {
|
|
35
35
|
handleBlur: () => void;
|
|
36
36
|
handleChange: (value: TValue) => void;
|
|
37
37
|
setErrorMap: (errorMap: Record<string, unknown>) => void;
|
|
@@ -46,7 +46,7 @@ interface FormRuntimeField<TValue = unknown> {
|
|
|
46
46
|
value: TValue;
|
|
47
47
|
};
|
|
48
48
|
}
|
|
49
|
-
interface FormComponentField<TValue = unknown, TFieldName extends string = string> {
|
|
49
|
+
export interface FormComponentField<TValue = unknown, TFieldName extends string = string> {
|
|
50
50
|
'modelValue': TValue;
|
|
51
51
|
'name': TFieldName;
|
|
52
52
|
'onBlur': () => void;
|
|
@@ -54,35 +54,35 @@ interface FormComponentField<TValue = unknown, TFieldName extends string = strin
|
|
|
54
54
|
'onInput': (value: TValue) => void;
|
|
55
55
|
'onUpdate:modelValue': (value: TValue) => void;
|
|
56
56
|
}
|
|
57
|
-
type MaybeComponentPropKey = 'options' | 'placeholder' | 'title' | keyof HtmlHTMLAttributes | (Record<never, never> & string);
|
|
58
|
-
type MaybeComponentProps = { [K in MaybeComponentPropKey]?: any; };
|
|
59
|
-
interface FormMeta {
|
|
57
|
+
export type MaybeComponentPropKey = 'options' | 'placeholder' | 'title' | keyof HtmlHTMLAttributes | (Record<never, never> & string);
|
|
58
|
+
export type MaybeComponentProps = { [K in MaybeComponentPropKey]?: any; };
|
|
59
|
+
export interface FormMeta {
|
|
60
60
|
dirty: boolean;
|
|
61
61
|
submitting: boolean;
|
|
62
62
|
valid: boolean;
|
|
63
63
|
validating: boolean;
|
|
64
64
|
}
|
|
65
|
-
interface FormRuntimeState<TValues extends FormValues = FormValues> {
|
|
65
|
+
export interface FormRuntimeState<TValues extends FormValues = FormValues> {
|
|
66
66
|
errors: Record<string, string>;
|
|
67
67
|
meta: FormMeta;
|
|
68
68
|
values: TValues;
|
|
69
69
|
}
|
|
70
|
-
interface FormValidationResult {
|
|
70
|
+
export interface FormValidationResult {
|
|
71
71
|
errors: Record<string, string>;
|
|
72
72
|
valid: boolean;
|
|
73
73
|
}
|
|
74
|
-
interface FormValueSnapshot<TFormValues extends FormValues = FormValues, TSubmitValues extends FormValues = TFormValues> {
|
|
74
|
+
export interface FormValueSnapshot<TFormValues extends FormValues = FormValues, TSubmitValues extends FormValues = TFormValues> {
|
|
75
75
|
rawValues: Readonly<TFormValues>;
|
|
76
76
|
values: TSubmitValues;
|
|
77
77
|
}
|
|
78
|
-
interface FormResetState<TValues extends FormValues = FormValues> {
|
|
78
|
+
export interface FormResetState<TValues extends FormValues = FormValues> {
|
|
79
79
|
values?: Partial<TValues>;
|
|
80
80
|
}
|
|
81
|
-
interface FormResetOptions {
|
|
81
|
+
export interface FormResetOptions {
|
|
82
82
|
force?: boolean;
|
|
83
83
|
keepDefaultValues?: boolean;
|
|
84
84
|
}
|
|
85
|
-
interface FormActions<TValues extends FormValues = FormValues> {
|
|
85
|
+
export interface FormActions<TValues extends FormValues = FormValues> {
|
|
86
86
|
clearValidation: (fieldNames?: FormFieldName<TValues> | Array<FormFieldName<TValues>>) => void;
|
|
87
87
|
readonly errors: Record<string, string>;
|
|
88
88
|
readonly fieldComponent: Component;
|
|
@@ -110,14 +110,14 @@ interface FormActions<TValues extends FormValues = FormValues> {
|
|
|
110
110
|
}
|
|
111
111
|
type ReservedFormSlotName = 'default' | 'expand-after' | 'expand-before' | 'reset-before' | 'submit-before';
|
|
112
112
|
type FormKnownFieldName<TValues extends FormValues> = string extends Extract<keyof TValues, string> ? never : Exclude<Extract<keyof TValues, string>, ReservedFormSlotName>;
|
|
113
|
-
interface TamanFormActionSlotProps<TValues extends FormValues = FormValues, T extends FormBaseComponentType = FormBaseComponentType, P extends Record<string, any> = Record<never, never>, TSubmitValues extends FormValues = TValues> {
|
|
113
|
+
export interface TamanFormActionSlotProps<TValues extends FormValues = FormValues, T extends FormBaseComponentType = FormBaseComponentType, P extends Record<string, any> = Record<never, never>, TSubmitValues extends FormValues = TValues> {
|
|
114
114
|
formApi: ExtendedFormApi<TValues, T, P, TSubmitValues>;
|
|
115
115
|
values: TValues;
|
|
116
116
|
}
|
|
117
|
-
interface TamanFormDefaultSlotProps<TValues extends FormValues = FormValues, T extends FormBaseComponentType = FormBaseComponentType, P extends Record<string, any> = Record<never, never>, TSubmitValues extends FormValues = TValues> extends TamanFormActionSlotProps<TValues, T, P, TSubmitValues> {
|
|
117
|
+
export interface TamanFormDefaultSlotProps<TValues extends FormValues = FormValues, T extends FormBaseComponentType = FormBaseComponentType, P extends Record<string, any> = Record<never, never>, TSubmitValues extends FormValues = TValues> extends TamanFormActionSlotProps<TValues, T, P, TSubmitValues> {
|
|
118
118
|
shapes: Array<FormShape>;
|
|
119
119
|
}
|
|
120
|
-
interface TamanFormFieldSlotProps<TValues extends FormValues = FormValues, TFieldName extends FormFieldName<TValues> = FormFieldName<TValues>, T extends FormBaseComponentType = FormBaseComponentType, P extends Record<string, any> = Record<never, never>, TSubmitValues extends FormValues = TValues> extends TamanFormActionSlotProps<TValues, T, P, TSubmitValues> {
|
|
120
|
+
export interface TamanFormFieldSlotProps<TValues extends FormValues = FormValues, TFieldName extends FormFieldName<TValues> = FormFieldName<TValues>, T extends FormBaseComponentType = FormBaseComponentType, P extends Record<string, any> = Record<never, never>, TSubmitValues extends FormValues = TValues> extends TamanFormActionSlotProps<TValues, T, P, TSubmitValues> {
|
|
121
121
|
componentField: FormComponentField<FormFieldValue<TValues, TFieldName>, TFieldName>;
|
|
122
122
|
componentProps: TamanFormResolvedComponentProps<FormFieldValue<TValues, TFieldName>, TFieldName>;
|
|
123
123
|
disabled: boolean;
|
|
@@ -131,25 +131,25 @@ interface TamanFormFieldSlotProps<TValues extends FormValues = FormValues, TFiel
|
|
|
131
131
|
modelValue: FormFieldValue<TValues, TFieldName>;
|
|
132
132
|
name: TFieldName;
|
|
133
133
|
}
|
|
134
|
-
type TamanFormResolvedComponentProps<TValue = unknown, TFieldName extends string = string> = MaybeComponentProps & {
|
|
134
|
+
export type TamanFormResolvedComponentProps<TValue = unknown, TFieldName extends string = string> = MaybeComponentProps & {
|
|
135
135
|
'disabled': boolean;
|
|
136
136
|
'modelValue'?: TValue;
|
|
137
137
|
'name': TFieldName;
|
|
138
138
|
'onUpdate:modelValue'?: (value: TValue) => void;
|
|
139
139
|
};
|
|
140
140
|
type TamanFormFieldSlots<TValues extends FormValues, T extends FormBaseComponentType, P extends Record<string, any>, TSubmitValues extends FormValues> = string extends Extract<keyof TValues, string> ? Record<string, ((props: TamanFormFieldSlotProps<TValues, FormFieldName<TValues>, T, P, TSubmitValues>) => any) | undefined> : { [TFieldName in FormKnownFieldName<TValues>]?: (props: TamanFormFieldSlotProps<TValues, TFieldName, T, P, TSubmitValues>) => any; };
|
|
141
|
-
type TamanFormSlots<TValues extends FormValues = FormValues, T extends FormBaseComponentType = FormBaseComponentType, P extends Record<string, any> = Record<never, never>, TSubmitValues extends FormValues = TValues> = TamanFormFieldSlots<TValues, T, P, TSubmitValues> & {
|
|
141
|
+
export type TamanFormSlots<TValues extends FormValues = FormValues, T extends FormBaseComponentType = FormBaseComponentType, P extends Record<string, any> = Record<never, never>, TSubmitValues extends FormValues = TValues> = TamanFormFieldSlots<TValues, T, P, TSubmitValues> & {
|
|
142
142
|
'default'?: (props: TamanFormDefaultSlotProps<TValues, T, P, TSubmitValues>) => any;
|
|
143
143
|
'expand-after'?: (props: TamanFormActionSlotProps<TValues, T, P, TSubmitValues>) => any;
|
|
144
144
|
'expand-before'?: (props: TamanFormActionSlotProps<TValues, T, P, TSubmitValues>) => any;
|
|
145
145
|
'reset-before'?: (props: TamanFormActionSlotProps<TValues, T, P, TSubmitValues>) => any;
|
|
146
146
|
'submit-before'?: (props: TamanFormActionSlotProps<TValues, T, P, TSubmitValues>) => any;
|
|
147
147
|
};
|
|
148
|
-
type TamanFormComponent<TValues extends FormValues = FormValues, T extends FormBaseComponentType = FormBaseComponentType, P extends Record<string, any> = Record<never, never>, TSubmitValues extends FormValues = TValues> = new () => {
|
|
148
|
+
export type TamanFormComponent<TValues extends FormValues = FormValues, T extends FormBaseComponentType = FormBaseComponentType, P extends Record<string, any> = Record<never, never>, TSubmitValues extends FormValues = TValues> = new () => {
|
|
149
149
|
$props: TamanFormProps<T, P, TValues, TSubmitValues>;
|
|
150
150
|
$slots: TamanFormSlots<TValues, T, P, TSubmitValues>;
|
|
151
151
|
};
|
|
152
|
-
interface FormSchemaContext<TValues extends FormValues = FormValues> {
|
|
152
|
+
export interface FormSchemaContext<TValues extends FormValues = FormValues> {
|
|
153
153
|
arrayField?: string;
|
|
154
154
|
fieldName?: string;
|
|
155
155
|
originalFieldName?: string;
|
|
@@ -158,19 +158,19 @@ interface FormSchemaContext<TValues extends FormValues = FormValues> {
|
|
|
158
158
|
rowIndex?: number;
|
|
159
159
|
rowPath?: string;
|
|
160
160
|
}
|
|
161
|
-
type FormCustomRenderType = (() => Component | string) | string;
|
|
161
|
+
export type FormCustomRenderType = (() => Component | string) | string;
|
|
162
162
|
type CustomParamsRenderType<TValues extends FormValues = FormValues> = ((ctx: FormSchemaContext<TValues>) => Component | string) | string;
|
|
163
|
-
type FormSchemaRuleType = 'required' | 'selectRequired' | null | (Record<never, never> & string) | ZodType;
|
|
163
|
+
export type FormSchemaRuleType = 'required' | 'selectRequired' | null | (Record<never, never> & string) | ZodType;
|
|
164
164
|
interface FormItemDependenciesBase {
|
|
165
165
|
triggerFields: Array<string>;
|
|
166
166
|
}
|
|
167
|
-
interface FormDependenciesResolveContext<TValues extends FormValues = FormValues> {
|
|
167
|
+
export interface FormDependenciesResolveContext<TValues extends FormValues = FormValues> {
|
|
168
168
|
actions: FormActions<TValues>;
|
|
169
169
|
controller: ExtendedFormApi<TValues>;
|
|
170
170
|
schema: FormSchemaContext<TValues>;
|
|
171
171
|
values: Readonly<TValues>;
|
|
172
172
|
}
|
|
173
|
-
interface FormDependenciesResolvedState {
|
|
173
|
+
export interface FormDependenciesResolvedState {
|
|
174
174
|
componentProps?: MaybeComponentProps;
|
|
175
175
|
disabled?: boolean;
|
|
176
176
|
help?: FormCustomRenderType;
|
|
@@ -180,12 +180,12 @@ interface FormDependenciesResolvedState {
|
|
|
180
180
|
rules?: FormSchemaRuleType;
|
|
181
181
|
show?: boolean;
|
|
182
182
|
}
|
|
183
|
-
interface FormItemDependenciesResolve<TValues extends FormValues = FormValues> extends FormItemDependenciesBase {
|
|
183
|
+
export interface FormItemDependenciesResolve<TValues extends FormValues = FormValues> extends FormItemDependenciesBase {
|
|
184
184
|
resolve: (context: FormDependenciesResolveContext<TValues>) => FormDependenciesResolvedState | PromiseLike<FormDependenciesResolvedState | undefined> | undefined;
|
|
185
185
|
}
|
|
186
|
-
type FormItemDependencies<TValues extends FormValues = FormValues> = FormItemDependenciesResolve<TValues>;
|
|
186
|
+
export type FormItemDependencies<TValues extends FormValues = FormValues> = FormItemDependenciesResolve<TValues>;
|
|
187
187
|
type ComponentProps<TValues extends FormValues = FormValues> = ((ctx: FormSchemaContext<TValues>) => MaybeComponentProps) | MaybeComponentProps;
|
|
188
|
-
interface FormCommonConfig<TValues extends FormValues = FormValues> {
|
|
188
|
+
export interface FormCommonConfig<TValues extends FormValues = FormValues> {
|
|
189
189
|
collapsible?: boolean;
|
|
190
190
|
componentProps?: ComponentProps<TValues>;
|
|
191
191
|
controlClass?: string;
|
|
@@ -230,7 +230,7 @@ type FormArraySchema<T extends FormBaseComponentType, P extends Record<string, a
|
|
|
230
230
|
componentProps?: ComponentProps<TValues>;
|
|
231
231
|
type: 'array';
|
|
232
232
|
} & FormSchemaBody<TValues>;
|
|
233
|
-
interface FormGroupSchema<T extends FormBaseComponentType = FormBaseComponentType, P extends Record<string, any> = Record<never, never>, TValues extends FormValues = FormValues> {
|
|
233
|
+
export interface FormGroupSchema<T extends FormBaseComponentType = FormBaseComponentType, P extends Record<string, any> = Record<never, never>, TValues extends FormValues = FormValues> {
|
|
234
234
|
children: Array<FormFieldSchema<T, P, TValues>>;
|
|
235
235
|
collapsed?: boolean;
|
|
236
236
|
collapsible?: boolean;
|
|
@@ -245,9 +245,9 @@ interface FormGroupSchema<T extends FormBaseComponentType = FormBaseComponentTyp
|
|
|
245
245
|
type: 'group';
|
|
246
246
|
wrapperClass?: WrapperClassType;
|
|
247
247
|
}
|
|
248
|
-
type FormFieldSchema<T extends FormBaseComponentType = FormBaseComponentType, P extends Record<string, any> = Record<never, never>, TValues extends FormValues = FormValues> = FormArraySchema<T, P, TValues> | FormSchemaDiscriminated<T, P, TValues> | FormSchemaFallback<T, P, TValues>;
|
|
249
|
-
type FormSchema<T extends FormBaseComponentType = FormBaseComponentType, P extends Record<string, any> = Record<never, never>, TValues extends FormValues = FormValues> = FormFieldSchema<T, P, TValues> | FormGroupSchema<T, P, TValues>;
|
|
250
|
-
interface TamanFormFieldArrayProps<T extends FormBaseComponentType = FormBaseComponentType, P extends Record<string, any> = Record<never, never>, TValues extends FormValues = FormValues> {
|
|
248
|
+
export type FormFieldSchema<T extends FormBaseComponentType = FormBaseComponentType, P extends Record<string, any> = Record<never, never>, TValues extends FormValues = FormValues> = FormArraySchema<T, P, TValues> | FormSchemaDiscriminated<T, P, TValues> | FormSchemaFallback<T, P, TValues>;
|
|
249
|
+
export type FormSchema<T extends FormBaseComponentType = FormBaseComponentType, P extends Record<string, any> = Record<never, never>, TValues extends FormValues = FormValues> = FormFieldSchema<T, P, TValues> | FormGroupSchema<T, P, TValues>;
|
|
250
|
+
export interface TamanFormFieldArrayProps<T extends FormBaseComponentType = FormBaseComponentType, P extends Record<string, any> = Record<never, never>, TValues extends FormValues = FormValues> {
|
|
251
251
|
actionText?: string;
|
|
252
252
|
addButtonText?: string;
|
|
253
253
|
commonConfig?: FormCommonConfig<TValues>;
|
|
@@ -261,9 +261,9 @@ interface TamanFormFieldArrayProps<T extends FormBaseComponentType = FormBaseCom
|
|
|
261
261
|
schema?: Array<FormFieldSchema<T, P, TValues>>;
|
|
262
262
|
showIndex?: boolean;
|
|
263
263
|
}
|
|
264
|
-
type FormHandleSubmitFn<TFormValues extends FormValues = FormValues, TSubmitValues extends FormValues = TFormValues> = (values: NoInfer<TSubmitValues>, rawValues: Readonly<TFormValues>) => Promise<void> | void;
|
|
265
|
-
type FormHandleResetFn<TSubmitValues extends FormValues = FormValues> = (values: TSubmitValues) => Promise<void> | void;
|
|
266
|
-
interface FormRenderProps<T extends FormBaseComponentType = FormBaseComponentType, P extends Record<string, any> = Record<never, never>, TValues extends FormValues = FormValues> {
|
|
264
|
+
export type FormHandleSubmitFn<TFormValues extends FormValues = FormValues, TSubmitValues extends FormValues = TFormValues> = (values: NoInfer<TSubmitValues>, rawValues: Readonly<TFormValues>) => Promise<void> | void;
|
|
265
|
+
export type FormHandleResetFn<TSubmitValues extends FormValues = FormValues> = (values: TSubmitValues) => Promise<void> | void;
|
|
266
|
+
export interface FormRenderProps<T extends FormBaseComponentType = FormBaseComponentType, P extends Record<string, any> = Record<never, never>, TValues extends FormValues = FormValues> {
|
|
267
267
|
collapsed?: boolean;
|
|
268
268
|
collapseTriggerResize?: boolean;
|
|
269
269
|
commonConfig?: FormCommonConfig<TValues>;
|
|
@@ -278,7 +278,7 @@ interface ActionButtonOptions extends ButtonProps {
|
|
|
278
278
|
content?: MaybeComputedRef<string>;
|
|
279
279
|
show?: boolean;
|
|
280
280
|
}
|
|
281
|
-
interface TamanFormProps<T extends FormBaseComponentType = FormBaseComponentType, P extends Record<string, any> = Record<never, never>, TValues extends FormValues = FormValues, TSubmitValues extends FormValues = TValues> extends Omit<FormRenderProps<T, P, TValues>, 'componentMap' | 'form'> {
|
|
281
|
+
export interface TamanFormProps<T extends FormBaseComponentType = FormBaseComponentType, P extends Record<string, any> = Record<never, never>, TValues extends FormValues = FormValues, TSubmitValues extends FormValues = TValues> extends Omit<FormRenderProps<T, P, TValues>, 'componentMap' | 'form'> {
|
|
282
282
|
actionButtonsReverse?: boolean;
|
|
283
283
|
actionLayout?: 'inline' | 'newLine' | 'rowEnd';
|
|
284
284
|
actionPosition?: 'center' | 'left' | 'right';
|
|
@@ -296,13 +296,13 @@ interface TamanFormProps<T extends FormBaseComponentType = FormBaseComponentType
|
|
|
296
296
|
submitOnChange?: boolean;
|
|
297
297
|
submitOnEnter?: boolean;
|
|
298
298
|
}
|
|
299
|
-
type ExtendedFormApi<TValues extends FormValues = FormValues, T extends FormBaseComponentType = FormBaseComponentType, P extends Record<string, any> = Record<never, never>, TSubmitValues extends FormValues = TValues> = FormApi<TValues, T, P, TSubmitValues> & {
|
|
299
|
+
export type ExtendedFormApi<TValues extends FormValues = FormValues, T extends FormBaseComponentType = FormBaseComponentType, P extends Record<string, any> = Record<never, never>, TSubmitValues extends FormValues = TValues> = FormApi<TValues, T, P, TSubmitValues> & {
|
|
300
300
|
useStore: <TResult = NoInfer<TamanFormProps<T, P, TValues, TSubmitValues>>>(selector?: (state: NoInfer<TamanFormProps<T, P, TValues, TSubmitValues>>) => TResult) => Readonly<Ref<TResult>>;
|
|
301
301
|
};
|
|
302
|
-
interface TamanFormAdapterOptions {
|
|
302
|
+
export interface TamanFormAdapterOptions {
|
|
303
303
|
rules?: Partial<Record<string, FormRuleValidator>>;
|
|
304
304
|
}
|
|
305
|
-
interface FormRuleContext {
|
|
305
|
+
export interface FormRuleContext {
|
|
306
306
|
field: {
|
|
307
307
|
label?: string;
|
|
308
308
|
name: string;
|
|
@@ -310,6 +310,6 @@ interface FormRuleContext {
|
|
|
310
310
|
label?: string;
|
|
311
311
|
name: string;
|
|
312
312
|
}
|
|
313
|
-
type FormRuleValidator = (value: any, params: any, context: FormRuleContext) => boolean | string;
|
|
313
|
+
export type FormRuleValidator = (value: any, params: any, context: FormRuleContext) => boolean | string;
|
|
314
314
|
//#endregion
|
|
315
|
-
export {
|
|
315
|
+
export type { BuiltInFormComponentPropsMap, BuiltInFormComponentType };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { ExtendedFormApi, FormBaseComponentType, FormValues, TamanFormComponent, TamanFormProps } from "./form.types.js";
|
|
2
2
|
//#region src/form/form.use-taman-form.d.ts
|
|
3
3
|
type UseTamanFormReturn<TValues extends FormValues, T extends FormBaseComponentType, P extends Record<string, any>, TSubmitValues extends FormValues = TValues> = readonly [TamanFormComponent<TValues, T, P, TSubmitValues>, ExtendedFormApi<TValues, T, P, TSubmitValues>];
|
|
4
|
-
declare function useTamanForm<T extends FormBaseComponentType = FormBaseComponentType, P extends Record<string, any> = Record<never, never>>(options: TamanFormProps<T, P>): UseTamanFormReturn<FormValues, T, P>;
|
|
5
|
-
declare function useTamanForm<TValues extends FormValues, T extends FormBaseComponentType = FormBaseComponentType, P extends Record<string, any> = Record<never, never>, TSubmitValues extends FormValues = TValues>(options: TamanFormProps<T, P, TValues, TSubmitValues>): UseTamanFormReturn<TValues, T, P, TSubmitValues>;
|
|
4
|
+
export declare function useTamanForm<T extends FormBaseComponentType = FormBaseComponentType, P extends Record<string, any> = Record<never, never>>(options: TamanFormProps<T, P>): UseTamanFormReturn<FormValues, T, P>;
|
|
5
|
+
export declare function useTamanForm<TValues extends FormValues, T extends FormBaseComponentType = FormBaseComponentType, P extends Record<string, any> = Record<never, never>, TSubmitValues extends FormValues = TValues>(options: TamanFormProps<T, P, TValues, TSubmitValues>): UseTamanFormReturn<TValues, T, P, TSubmitValues>;
|
|
6
6
|
//#endregion
|
|
7
|
-
export {
|
|
7
|
+
export {};
|
|
@@ -3,7 +3,7 @@ import "../../index.mjs";
|
|
|
3
3
|
import { useSidebarDrag } from "../composables/use-sidebar-drag.mjs";
|
|
4
4
|
import _sfc_main$2 from "./taman-core-button-collapse.mjs";
|
|
5
5
|
import _sfc_main$3 from "./taman-core-button-fixed.mjs";
|
|
6
|
-
import { Fragment, Transition, computed, createBlock, createCommentVNode, createElementBlock, createElementVNode, createVNode, defineComponent, mergeModels, normalizeClass, normalizeStyle, onUnmounted, openBlock, renderSlot, shallowRef, unref, useModel, useSlots,
|
|
6
|
+
import { Fragment, Transition, computed, createBlock, createCommentVNode, createElementBlock, createElementVNode, createVNode, defineComponent, mergeModels, normalizeClass, normalizeStyle, onUnmounted, openBlock, renderSlot, shallowRef, unref, useModel, useSlots, withCtx } from "vue";
|
|
7
7
|
import { useScrollLock } from "@vueuse/core";
|
|
8
8
|
//#region src/layout/components/taman-core-layout-sidebar.vue
|
|
9
9
|
const _hoisted_1 = ["inert"];
|
|
@@ -102,23 +102,29 @@ const _sfc_main = /*@__PURE__*/ defineComponent({
|
|
|
102
102
|
const currentWidth = Number.parseFloat(getMenuWidthValue(false));
|
|
103
103
|
return { right: `${Math.max(0, sidebarVisualWidth.value - currentWidth)}px` };
|
|
104
104
|
});
|
|
105
|
+
/**
|
|
106
|
+
* Panel visibility and reserved width must share this condition: when they diverge the panel
|
|
107
|
+
* floats over the content (taman-core-layout offsets the header by extraVisible only).
|
|
108
|
+
* fixedExtra and expandOnHover are bound to the same preference by taman-core-layout, but as a
|
|
109
|
+
* public component API callers may pass only one of them.
|
|
110
|
+
*/
|
|
111
|
+
const extraPanelExpanded = computed(() => props.isSidebarMixed && props.show && !collapse.value && !!extraVisible.value && (props.fixedExtra || expandOnHover.value || expandOnHovering.value));
|
|
105
112
|
const style = computed(() => {
|
|
106
|
-
const {
|
|
113
|
+
const { marginTop, paddingTop, zIndex } = props;
|
|
107
114
|
return {
|
|
108
115
|
...calcMenuWidthStyle(),
|
|
109
116
|
height: `calc(100% - ${marginTop}px)`,
|
|
110
117
|
marginTop: `${marginTop}px`,
|
|
111
118
|
paddingTop: `${paddingTop}px`,
|
|
112
119
|
zIndex,
|
|
113
|
-
...
|
|
120
|
+
...extraPanelExpanded.value ? { transition: "none" } : {}
|
|
114
121
|
};
|
|
115
122
|
});
|
|
116
123
|
const extraStyle = computed(() => {
|
|
117
|
-
const { extraWidth,
|
|
118
|
-
const shouldShow = (extraVisible.value || expandOnHover.value || expandOnHovering.value) && show && !collapse.value;
|
|
124
|
+
const { extraWidth, width, zIndex } = props;
|
|
119
125
|
return {
|
|
120
126
|
left: `${width}px`,
|
|
121
|
-
width:
|
|
127
|
+
width: extraPanelExpanded.value ? `${extraWidth}px` : 0,
|
|
122
128
|
zIndex
|
|
123
129
|
};
|
|
124
130
|
});
|
|
@@ -157,13 +163,9 @@ const _sfc_main = /*@__PURE__*/ defineComponent({
|
|
|
157
163
|
const collapseStyle = computed(() => {
|
|
158
164
|
return { height: `${props.collapseHeight}px` };
|
|
159
165
|
});
|
|
160
|
-
watchEffect(() => {
|
|
161
|
-
extraVisible.value = props.fixedExtra ? true : extraVisible.value;
|
|
162
|
-
});
|
|
163
166
|
function getMenuWidthValue(isHiddenDom) {
|
|
164
|
-
const { collapseWidth, extraWidth, mixedWidth,
|
|
165
|
-
|
|
166
|
-
let widthValue = width === 0 ? "0px" : `${width + (showExtra ? extraWidth : 0)}px`;
|
|
167
|
+
const { collapseWidth, extraWidth, mixedWidth, isSidebarMixed, width } = props;
|
|
168
|
+
let widthValue = width === 0 ? "0px" : `${width + (extraPanelExpanded.value ? extraWidth : 0)}px`;
|
|
167
169
|
if (isHiddenDom && expandOnHovering.value && !expandOnHover.value) widthValue = isSidebarMixed ? `${mixedWidth}px` : `${collapseWidth}px`;
|
|
168
170
|
return widthValue;
|
|
169
171
|
}
|
|
@@ -292,7 +294,7 @@ const _sfc_main = /*@__PURE__*/ defineComponent({
|
|
|
292
294
|
], 6),
|
|
293
295
|
__props.isSidebarMixed ? (openBlock(), createElementBlock("div", {
|
|
294
296
|
key: 0,
|
|
295
|
-
class: normalizeClass([[__props.themeSub, { "border-l":
|
|
297
|
+
class: normalizeClass([[__props.themeSub, { "border-l": extraPanelExpanded.value }], "border-r border-border bg-background-sidebar h-full transition-[left,width]-300 ease-out top-0 fixed overflow-hidden"]),
|
|
296
298
|
style: normalizeStyle(extraStyle.value)
|
|
297
299
|
}, [
|
|
298
300
|
__props.isSidebarMixed && expandOnHover.value ? (openBlock(), createBlock(_sfc_main$2, {
|
package/dist/layout/index.mjs
CHANGED
|
@@ -1,2 +1 @@
|
|
|
1
|
-
|
|
2
|
-
export { _sfc_main as TamanCoreLayout };
|
|
1
|
+
export { default as TamanCoreLayout } from "./taman-core-layout.mjs";
|
|
@@ -234,7 +234,7 @@ const _sfc_main = /*@__PURE__*/ defineComponent({
|
|
|
234
234
|
let width = "100%";
|
|
235
235
|
let sidebarAndExtraWidth = "unset";
|
|
236
236
|
if (headerFixed.value && currentLayout.value !== "header-nav" && currentLayout.value !== "mixed-nav" && currentLayout.value !== "header-sidebar-nav" && showSidebar.value && !props.isMobile) {
|
|
237
|
-
if ((isSidebarMixedNav.value || isHeaderMixedNav.value) && sidebarExpandOnHover.value && sidebarExtraVisible.value) {
|
|
237
|
+
if ((isSidebarMixedNav.value || isHeaderMixedNav.value) && sidebarExpandOnHover.value && sidebarExtraVisible.value && !activeSidebarCollapse.value) {
|
|
238
238
|
sidebarAndExtraWidth = `${props.sidebarMixedWidth + (sidebarExtraCollapse.value ? props.sidebarExtraCollapsedWidth : props.sidebarWidth)}px`;
|
|
239
239
|
width = `calc(100% - ${sidebarAndExtraWidth})`;
|
|
240
240
|
} else {
|
|
@@ -1,2 +1 @@
|
|
|
1
|
-
|
|
2
|
-
export { _sfc_main as NormalMenu };
|
|
1
|
+
export { default as NormalMenu } from "./normal-menu.mjs";
|
|
@@ -9,7 +9,7 @@ declare const __VLS_export: import("vue").DefineComponent<Props, {}, {}, {}, {},
|
|
|
9
9
|
onSelect?: ((args_0: TamanMenuRecordRaw) => any) | undefined;
|
|
10
10
|
onEnter?: ((args_0: TamanMenuRecordRaw) => any) | undefined;
|
|
11
11
|
}>, {
|
|
12
|
-
menus:
|
|
12
|
+
menus: TamanMenuRecordRaw[];
|
|
13
13
|
collapse: boolean;
|
|
14
14
|
theme: "dark" | "light";
|
|
15
15
|
activePath: string;
|
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
import { AlertPromptProps, TamanAlertProps } from "./alert.js";
|
|
2
2
|
//#region src/popup/alert/alert-builder.d.ts
|
|
3
|
-
declare function tamanAlert(options: TamanAlertProps): Promise<void>;
|
|
4
|
-
declare function tamanConfirm(options: TamanAlertProps): Promise<void>;
|
|
5
|
-
declare function tamanPrompt<T = any>(options: AlertPromptProps<T>): Promise<T | undefined>;
|
|
6
|
-
declare function clearAllAlerts(): void;
|
|
7
|
-
//#endregion
|
|
8
|
-
export { clearAllAlerts, tamanAlert, tamanConfirm, tamanPrompt };
|
|
3
|
+
export declare function tamanAlert(options: TamanAlertProps): Promise<void>;
|
|
4
|
+
export declare function tamanConfirm(options: TamanAlertProps): Promise<void>;
|
|
5
|
+
export declare function tamanPrompt<T = any>(options: AlertPromptProps<T>): Promise<T | undefined>;
|
|
6
|
+
export declare function clearAllAlerts(): void;
|
|
7
|
+
//#endregion
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { Component, VNode, VNodeArrayChildren } from "vue";
|
|
2
2
|
import { Recordable } from "@vinicunca/taman-core/typings";
|
|
3
3
|
//#region src/popup/alert/alert.d.ts
|
|
4
|
-
type IconType = 'error' | 'info' | 'question' | 'success' | 'warning';
|
|
5
|
-
interface AlertBeforeCloseScope {
|
|
4
|
+
export type IconType = 'error' | 'info' | 'question' | 'success' | 'warning';
|
|
5
|
+
export interface AlertBeforeCloseScope {
|
|
6
6
|
isConfirm: boolean;
|
|
7
7
|
}
|
|
8
|
-
interface TamanAlertProps {
|
|
8
|
+
export interface TamanAlertProps {
|
|
9
9
|
beforeClose?: (scope: AlertBeforeCloseScope) => boolean | Promise<boolean | undefined> | undefined;
|
|
10
10
|
bordered?: boolean;
|
|
11
11
|
buttonAlign?: 'center' | 'end' | 'start';
|
|
@@ -23,7 +23,7 @@ interface TamanAlertProps {
|
|
|
23
23
|
showCancel?: boolean;
|
|
24
24
|
title?: string;
|
|
25
25
|
}
|
|
26
|
-
type AlertPromptProps<T = any> = {
|
|
26
|
+
export type AlertPromptProps<T = any> = {
|
|
27
27
|
beforeClose?: (scope: {
|
|
28
28
|
isConfirm: boolean;
|
|
29
29
|
value: T | undefined;
|
|
@@ -34,10 +34,9 @@ type AlertPromptProps<T = any> = {
|
|
|
34
34
|
defaultValue?: T;
|
|
35
35
|
modelPropName?: string;
|
|
36
36
|
} & Omit<TamanAlertProps, 'beforeClose'>;
|
|
37
|
-
interface AlertContext {
|
|
37
|
+
export interface AlertContext {
|
|
38
38
|
doCancel: () => void;
|
|
39
39
|
doConfirm: () => void;
|
|
40
40
|
}
|
|
41
|
-
declare function useAlertContext(): AlertContext;
|
|
42
|
-
//#endregion
|
|
43
|
-
export { AlertBeforeCloseScope, AlertContext, AlertPromptProps, IconType, TamanAlertProps, useAlertContext };
|
|
41
|
+
export declare function useAlertContext(): AlertContext;
|
|
42
|
+
//#endregion
|
|
@@ -18,7 +18,7 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_PublicProps, {},
|
|
|
18
18
|
}>, {
|
|
19
19
|
bordered: boolean;
|
|
20
20
|
centered: boolean;
|
|
21
|
-
buttonAlign: "
|
|
21
|
+
buttonAlign: "end" | "center" | "start";
|
|
22
22
|
escapeKeyClose: boolean;
|
|
23
23
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
24
24
|
declare const _default: typeof __VLS_export;
|
|
@@ -155,7 +155,7 @@ const _sfc_main = /*@__PURE__*/ defineComponent({
|
|
|
155
155
|
centered: __props.centered,
|
|
156
156
|
"overlay-blur": __props.overlayBlur,
|
|
157
157
|
"z-index": unref(zIndex),
|
|
158
|
-
class: normalizeClass(["flex flex-col max-h-[80%] inset-x-0 sm:
|
|
158
|
+
class: normalizeClass(["flex flex-col max-h-[80%] inset-x-0 sm:rounded-$taman-radius sm:max-w-[80%] sm:w-130", [__props.containerClass, {
|
|
159
159
|
"border border-border": __props.bordered,
|
|
160
160
|
"shadow-3xl": !__props.bordered
|
|
161
161
|
}]]),
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { DialogApiOptions, DialogState } from "./dialog.types.js";
|
|
2
2
|
import { Store } from "@vinicunca/taman-core/store";
|
|
3
3
|
//#region src/popup/dialog/dialog.api.d.ts
|
|
4
|
-
declare class DialogApi<TData = unknown> {
|
|
4
|
+
export declare class DialogApi<TData = unknown> {
|
|
5
5
|
sharedData: Record<'payload', TData | undefined>;
|
|
6
6
|
store: Store<DialogState>;
|
|
7
7
|
private api;
|
|
@@ -19,5 +19,4 @@ declare class DialogApi<TData = unknown> {
|
|
|
19
19
|
setState(stateOrFn: ((prev: DialogState) => Partial<DialogState>) | Partial<DialogState>): this;
|
|
20
20
|
unlock(): this;
|
|
21
21
|
}
|
|
22
|
-
//#endregion
|
|
23
|
-
export { DialogApi };
|
|
22
|
+
//#endregion
|
|
@@ -2,9 +2,11 @@ import { bindMethods, isFunction } from "@vinicunca/taman-core/utils";
|
|
|
2
2
|
import { Store } from "@vinicunca/taman-core/store";
|
|
3
3
|
//#region src/popup/dialog/dialog.api.ts
|
|
4
4
|
var DialogApi = class {
|
|
5
|
+
/** Shared data */
|
|
5
6
|
sharedData = { payload: void 0 };
|
|
6
7
|
store;
|
|
7
8
|
api;
|
|
9
|
+
/** private prevState!: DialogState; */
|
|
8
10
|
state;
|
|
9
11
|
constructor(options = {}) {
|
|
10
12
|
const { connectedComponent: _, onBeforeClose, onCancel, onClosed, onConfirm, onOpenChange, onOpened, ...storeState } = options;
|
|
@@ -2,7 +2,7 @@ import { DialogApi } from "./dialog.api.js";
|
|
|
2
2
|
import { Component, HTMLAttributes, Ref } from "vue";
|
|
3
3
|
import { MaybePromise } from "@vinicunca/taman-core/typings";
|
|
4
4
|
//#region src/popup/dialog/dialog.types.d.ts
|
|
5
|
-
interface DialogProps {
|
|
5
|
+
export interface DialogProps {
|
|
6
6
|
animationType?: 'scale' | 'slide';
|
|
7
7
|
appendToMain?: boolean;
|
|
8
8
|
bordered?: boolean;
|
|
@@ -37,17 +37,17 @@ interface DialogProps {
|
|
|
37
37
|
titleTooltip?: string;
|
|
38
38
|
zIndex?: number;
|
|
39
39
|
}
|
|
40
|
-
interface DialogState extends DialogProps {
|
|
40
|
+
export interface DialogState extends DialogProps {
|
|
41
41
|
isOpen?: boolean;
|
|
42
42
|
}
|
|
43
|
-
type ExtendedDialogApi<TData = unknown> = DialogApi<TData> & {
|
|
43
|
+
export type ExtendedDialogApi<TData = unknown> = DialogApi<TData> & {
|
|
44
44
|
useStore: <T = NoInfer<DialogState>>(selector?: (state: NoInfer<DialogState>) => T) => Readonly<Ref<T>>;
|
|
45
45
|
};
|
|
46
46
|
type DialogComponentInstance<TComponent extends Component> = TComponent extends (abstract new (...args: Array<any>) => infer TInstance) ? TInstance : never;
|
|
47
|
-
type InferDialogData<TComponent extends Component> = [DialogComponentInstance<TComponent>] extends [never] ? unknown : DialogComponentInstance<TComponent> extends {
|
|
47
|
+
export type InferDialogData<TComponent extends Component> = [DialogComponentInstance<TComponent>] extends [never] ? unknown : DialogComponentInstance<TComponent> extends {
|
|
48
48
|
dialogApi: ExtendedDialogApi<infer TData>;
|
|
49
49
|
} ? TData : unknown;
|
|
50
|
-
interface DialogApiOptions<TConnectedComponent extends Component = Component> extends DialogState {
|
|
50
|
+
export interface DialogApiOptions<TConnectedComponent extends Component = Component> extends DialogState {
|
|
51
51
|
connectedComponent?: TConnectedComponent;
|
|
52
52
|
onBeforeClose?: () => MaybePromise<boolean | undefined>;
|
|
53
53
|
onCancel?: () => void;
|
|
@@ -57,4 +57,4 @@ interface DialogApiOptions<TConnectedComponent extends Component = Component> ex
|
|
|
57
57
|
onOpened?: () => void;
|
|
58
58
|
}
|
|
59
59
|
//#endregion
|
|
60
|
-
export {
|
|
60
|
+
export {};
|
|
@@ -5,29 +5,29 @@ interface Props extends DialogProps {
|
|
|
5
5
|
closeDisabled?: boolean;
|
|
6
6
|
closeClass?: string;
|
|
7
7
|
}
|
|
8
|
-
declare var
|
|
8
|
+
declare var __VLS_36: {}, __VLS_38: {}, __VLS_57: {}, __VLS_59: {}, __VLS_97: {}, __VLS_110: {}, __VLS_112: {}, __VLS_122: {}, __VLS_124: {}, __VLS_134: {}, __VLS_136: {};
|
|
9
9
|
type __VLS_Slots = {} & {
|
|
10
|
-
title?: (props: typeof
|
|
10
|
+
title?: (props: typeof __VLS_36) => any;
|
|
11
11
|
} & {
|
|
12
|
-
titleTooltip?: (props: typeof
|
|
12
|
+
titleTooltip?: (props: typeof __VLS_38) => any;
|
|
13
13
|
} & {
|
|
14
|
-
description?: (props: typeof
|
|
14
|
+
description?: (props: typeof __VLS_57) => any;
|
|
15
15
|
} & {
|
|
16
|
-
extra?: (props: typeof
|
|
16
|
+
extra?: (props: typeof __VLS_59) => any;
|
|
17
17
|
} & {
|
|
18
|
-
default?: (props: typeof
|
|
18
|
+
default?: (props: typeof __VLS_97) => any;
|
|
19
19
|
} & {
|
|
20
|
-
'leading-footer'?: (props: typeof
|
|
20
|
+
'leading-footer'?: (props: typeof __VLS_110) => any;
|
|
21
21
|
} & {
|
|
22
|
-
footer?: (props: typeof
|
|
22
|
+
footer?: (props: typeof __VLS_112) => any;
|
|
23
23
|
} & {
|
|
24
|
-
cancelText?: (props: typeof
|
|
24
|
+
cancelText?: (props: typeof __VLS_122) => any;
|
|
25
25
|
} & {
|
|
26
|
-
'center-footer'?: (props: typeof
|
|
26
|
+
'center-footer'?: (props: typeof __VLS_124) => any;
|
|
27
27
|
} & {
|
|
28
|
-
confirmText?: (props: typeof
|
|
28
|
+
confirmText?: (props: typeof __VLS_134) => any;
|
|
29
29
|
} & {
|
|
30
|
-
'trailing-footer'?: (props: typeof
|
|
30
|
+
'trailing-footer'?: (props: typeof __VLS_136) => any;
|
|
31
31
|
};
|
|
32
32
|
declare const __VLS_base: import("vue").DefineComponent<Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<Props> & Readonly<{}>, {
|
|
33
33
|
appendToMain: boolean;
|
|
@@ -6,8 +6,8 @@ interface DialogDataNotProvided {
|
|
|
6
6
|
readonly [DIALOG_DATA_NOT_PROVIDED]: true;
|
|
7
7
|
}
|
|
8
8
|
type ResolvedDialogData<TData, TConnectedComponent extends Component> = TData extends DialogDataNotProvided ? InferDialogData<TConnectedComponent> : TData;
|
|
9
|
-
declare function setDefaultDialogProps(props: Partial<DialogProps>): void;
|
|
10
|
-
declare function useTamanDialog<TData = DialogDataNotProvided, TConnectedComponent extends Component = Component>(options?: DialogApiOptions<TConnectedComponent>): readonly [import("vue").DefineSetupFnComponent<DialogProps, {}, {}, DialogProps & {}, import("vue").PublicProps>, ExtendedDialogApi<ResolvedDialogData<TData, TConnectedComponent>>];
|
|
11
|
-
declare function createTamanDialog<TData = unknown>(): <TConnectedComponent extends Component = Component>(options?: DialogApiOptions<TConnectedComponent>) => readonly [import("vue").DefineSetupFnComponent<DialogProps, {}, {}, DialogProps & {}, import("vue").PublicProps>, ExtendedDialogApi<ResolvedDialogData<TData, TConnectedComponent>>];
|
|
9
|
+
export declare function setDefaultDialogProps(props: Partial<DialogProps>): void;
|
|
10
|
+
export declare function useTamanDialog<TData = DialogDataNotProvided, TConnectedComponent extends Component = Component>(options?: DialogApiOptions<TConnectedComponent>): readonly [import("vue").DefineSetupFnComponent<DialogProps, {}, {}, DialogProps & {}, import("vue").PublicProps>, ExtendedDialogApi<ResolvedDialogData<TData, TConnectedComponent>>];
|
|
11
|
+
export declare function createTamanDialog<TData = unknown>(): <TConnectedComponent extends Component = Component>(options?: DialogApiOptions<TConnectedComponent>) => readonly [import("vue").DefineSetupFnComponent<DialogProps, {}, {}, DialogProps & {}, import("vue").PublicProps>, ExtendedDialogApi<ResolvedDialogData<TData, TConnectedComponent>>];
|
|
12
12
|
//#endregion
|
|
13
|
-
export {
|
|
13
|
+
export {};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { DrawerApiOptions, DrawerState } from "./drawer.types.js";
|
|
2
2
|
import { Store } from "@vinicunca/taman-core/store";
|
|
3
3
|
//#region src/popup/drawer/drawer.api.d.ts
|
|
4
|
-
declare class DrawerApi<TData = unknown> {
|
|
4
|
+
export declare class DrawerApi<TData = unknown> {
|
|
5
5
|
sharedData: Record<'payload', TData | undefined>;
|
|
6
6
|
store: Store<DrawerState>;
|
|
7
7
|
private api;
|
|
@@ -19,5 +19,4 @@ declare class DrawerApi<TData = unknown> {
|
|
|
19
19
|
setState(stateOrFn: ((prev: DrawerState) => Partial<DrawerState>) | Partial<DrawerState>): this;
|
|
20
20
|
unlock(): this;
|
|
21
21
|
}
|
|
22
|
-
//#endregion
|
|
23
|
-
export { DrawerApi };
|
|
22
|
+
//#endregion
|