sprintify-ui 0.8.20 → 0.8.22
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/sprintify-ui.es.js +10 -7
- package/dist/types/components/BaseAppDialogs.vue.d.ts +10 -1
- package/dist/types/components/BaseDialog.vue.d.ts +1 -1
- package/dist/types/components/BaseTextareaAutoresize.vue.d.ts +2 -2
- package/dist/types/types/index.d.ts +4 -2
- package/package.json +1 -1
- package/src/components/BaseAppDialogs.vue +4 -3
- package/src/components/BaseDialog.vue +3 -2
- package/src/stores/dialogs.ts +1 -0
- package/src/types/index.ts +4 -2
package/dist/sprintify-ui.es.js
CHANGED
|
@@ -7186,7 +7186,7 @@ const Gx = {
|
|
|
7186
7186
|
(d = o.value) == null || d.focus();
|
|
7187
7187
|
return;
|
|
7188
7188
|
}
|
|
7189
|
-
r("confirm", l);
|
|
7189
|
+
r("confirm", l.value);
|
|
7190
7190
|
}
|
|
7191
7191
|
return (c, d) => (I(), K("div", Qx, [
|
|
7192
7192
|
j("div", Zx, [
|
|
@@ -7228,7 +7228,7 @@ const Gx = {
|
|
|
7228
7228
|
]),
|
|
7229
7229
|
_(a) ? (I(), Ee(Sr, {
|
|
7230
7230
|
key: 0,
|
|
7231
|
-
class: "mt-5",
|
|
7231
|
+
class: "mt-5 w-full",
|
|
7232
7232
|
label: _(a).label,
|
|
7233
7233
|
size: _(a).size,
|
|
7234
7234
|
required: _(a).required
|
|
@@ -7242,7 +7242,8 @@ const Gx = {
|
|
|
7242
7242
|
"onUpdate:modelValue": d[0] || (d[0] = (f) => gr(l) ? l.value = f : null),
|
|
7243
7243
|
name: "input",
|
|
7244
7244
|
placeholder: _(a).placeholder,
|
|
7245
|
-
class: "w-full"
|
|
7245
|
+
class: "w-full",
|
|
7246
|
+
"tw-input": "w-full"
|
|
7246
7247
|
}, null, 8, ["modelValue", "placeholder"])) : (I(), Ee(ir, {
|
|
7247
7248
|
key: 1,
|
|
7248
7249
|
ref_key: "inputRef",
|
|
@@ -7304,6 +7305,7 @@ const Gx = {
|
|
|
7304
7305
|
confirmText: n.confirmText ?? ze("sui.confirm"),
|
|
7305
7306
|
cancelText: n.cancelText ?? ze("sui.cancel"),
|
|
7306
7307
|
closeOnOutsideClick: n.closeOnOutsideClick ?? !0,
|
|
7308
|
+
input: n.input ?? !1,
|
|
7307
7309
|
onConfirm: n.onConfirm ?? function() {
|
|
7308
7310
|
},
|
|
7309
7311
|
onCancel: n.onCancel ?? function() {
|
|
@@ -7843,8 +7845,8 @@ const iE = {
|
|
|
7843
7845
|
__name: "BaseAppDialogs",
|
|
7844
7846
|
setup(n, { expose: t }) {
|
|
7845
7847
|
const e = Id(), r = N(() => e.dialogs);
|
|
7846
|
-
function i(d) {
|
|
7847
|
-
d.onConfirm(), l(d);
|
|
7848
|
+
function i(d, f) {
|
|
7849
|
+
d.onConfirm(f), l(d);
|
|
7848
7850
|
}
|
|
7849
7851
|
function o(d) {
|
|
7850
7852
|
d.onCancel(), l(d);
|
|
@@ -7914,10 +7916,11 @@ const iE = {
|
|
|
7914
7916
|
message: h.message,
|
|
7915
7917
|
"confirm-text": h.confirmText,
|
|
7916
7918
|
html: h.html,
|
|
7919
|
+
input: h.input,
|
|
7917
7920
|
"cancel-text": h.cancelText,
|
|
7918
7921
|
onCancel: (p) => o(h),
|
|
7919
|
-
onConfirm: (p) => i(h)
|
|
7920
|
-
}, null, 8, ["class", "color", "title", "message", "confirm-text", "html", "cancel-text", "onCancel", "onConfirm"])
|
|
7922
|
+
onConfirm: (p) => i(h, p)
|
|
7923
|
+
}, null, 8, ["class", "color", "title", "message", "confirm-text", "html", "input", "cancel-text", "onCancel", "onConfirm"])
|
|
7921
7924
|
])
|
|
7922
7925
|
]))), 128))
|
|
7923
7926
|
]),
|
|
@@ -5,10 +5,19 @@ declare const _default: import("vue").DefineComponent<{}, {
|
|
|
5
5
|
title: string;
|
|
6
6
|
message: string;
|
|
7
7
|
html: boolean;
|
|
8
|
+
input: false | {
|
|
9
|
+
label?: string | undefined;
|
|
10
|
+
placeholder?: string | undefined;
|
|
11
|
+
name?: string | undefined;
|
|
12
|
+
type?: string | undefined;
|
|
13
|
+
size?: "xs" | "sm" | "md" | "lg" | "xl" | undefined;
|
|
14
|
+
required?: boolean | undefined;
|
|
15
|
+
disabled?: boolean | undefined;
|
|
16
|
+
};
|
|
8
17
|
confirmText: string;
|
|
9
18
|
cancelText: string;
|
|
10
19
|
closeOnOutsideClick: boolean;
|
|
11
|
-
onConfirm: () => void;
|
|
20
|
+
onConfirm: (input?: string | undefined) => void;
|
|
12
21
|
onCancel: () => void;
|
|
13
22
|
}[]>;
|
|
14
23
|
}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{}>>, {}, {}>;
|
|
@@ -68,9 +68,9 @@ declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<{
|
|
|
68
68
|
title: string;
|
|
69
69
|
message: string;
|
|
70
70
|
html: boolean;
|
|
71
|
+
input: boolean | InputConfigProps;
|
|
71
72
|
confirmText: string;
|
|
72
73
|
cancelText: string;
|
|
73
|
-
input: boolean | InputConfigProps;
|
|
74
74
|
}, {}>, {
|
|
75
75
|
default?(_: {}): any;
|
|
76
76
|
}>;
|
|
@@ -54,10 +54,10 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
54
54
|
focus: typeof focus;
|
|
55
55
|
blur: typeof blur;
|
|
56
56
|
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
57
|
+
input: (...args: any[]) => void;
|
|
57
58
|
focus: (...args: any[]) => void;
|
|
58
59
|
"update:modelValue": (...args: any[]) => void;
|
|
59
60
|
submit: (...args: any[]) => void;
|
|
60
|
-
input: (...args: any[]) => void;
|
|
61
61
|
}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
|
|
62
62
|
modelValue: {
|
|
63
63
|
default: string;
|
|
@@ -110,8 +110,8 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
110
110
|
}>> & {
|
|
111
111
|
"onUpdate:modelValue"?: ((...args: any[]) => any) | undefined;
|
|
112
112
|
onFocus?: ((...args: any[]) => any) | undefined;
|
|
113
|
-
onSubmit?: ((...args: any[]) => any) | undefined;
|
|
114
113
|
onInput?: ((...args: any[]) => any) | undefined;
|
|
114
|
+
onSubmit?: ((...args: any[]) => any) | undefined;
|
|
115
115
|
}, {
|
|
116
116
|
required: boolean;
|
|
117
117
|
modelValue: string | null;
|
|
@@ -121,10 +121,11 @@ export interface DialogOptions {
|
|
|
121
121
|
title: string;
|
|
122
122
|
message: string;
|
|
123
123
|
html?: boolean;
|
|
124
|
+
input?: InputConfigProps | false;
|
|
124
125
|
confirmText?: string;
|
|
125
126
|
cancelText?: string;
|
|
126
127
|
closeOnOutsideClick?: boolean;
|
|
127
|
-
onConfirm?: () => void;
|
|
128
|
+
onConfirm?: (input?: string) => void;
|
|
128
129
|
onCancel?: () => void;
|
|
129
130
|
}
|
|
130
131
|
export interface Dialog {
|
|
@@ -133,10 +134,11 @@ export interface Dialog {
|
|
|
133
134
|
title: string;
|
|
134
135
|
message: string;
|
|
135
136
|
html: boolean;
|
|
137
|
+
input: InputConfigProps | false;
|
|
136
138
|
confirmText: string;
|
|
137
139
|
cancelText: string;
|
|
138
140
|
closeOnOutsideClick: boolean;
|
|
139
|
-
onConfirm: () => void;
|
|
141
|
+
onConfirm: (input?: string) => void;
|
|
140
142
|
onCancel: () => void;
|
|
141
143
|
}
|
|
142
144
|
/**
|
package/package.json
CHANGED
|
@@ -48,9 +48,10 @@
|
|
|
48
48
|
:message="dialog.message"
|
|
49
49
|
:confirm-text="dialog.confirmText"
|
|
50
50
|
:html="dialog.html"
|
|
51
|
+
:input="dialog.input"
|
|
51
52
|
:cancel-text="dialog.cancelText"
|
|
52
53
|
@cancel="cancel(dialog)"
|
|
53
|
-
@confirm="confirm(dialog)"
|
|
54
|
+
@confirm="event => confirm(dialog, event)"
|
|
54
55
|
/>
|
|
55
56
|
</div>
|
|
56
57
|
</div>
|
|
@@ -70,8 +71,8 @@ const dialogs = computed(() => {
|
|
|
70
71
|
return dialogStore.dialogs;
|
|
71
72
|
});
|
|
72
73
|
|
|
73
|
-
function confirm(dialog: Dialog) {
|
|
74
|
-
dialog.onConfirm();
|
|
74
|
+
function confirm(dialog: Dialog, input?: string) {
|
|
75
|
+
dialog.onConfirm(input);
|
|
75
76
|
remove(dialog);
|
|
76
77
|
}
|
|
77
78
|
|
|
@@ -57,7 +57,7 @@
|
|
|
57
57
|
|
|
58
58
|
<BaseField
|
|
59
59
|
v-if="inputConfig"
|
|
60
|
-
class="mt-5"
|
|
60
|
+
class="mt-5 w-full"
|
|
61
61
|
:label="inputConfig.label"
|
|
62
62
|
:size="inputConfig.size"
|
|
63
63
|
:required="inputConfig.required"
|
|
@@ -69,6 +69,7 @@
|
|
|
69
69
|
name="input"
|
|
70
70
|
:placeholder="inputConfig.placeholder"
|
|
71
71
|
class="w-full"
|
|
72
|
+
tw-input="w-full"
|
|
72
73
|
/>
|
|
73
74
|
<BaseInput
|
|
74
75
|
v-else
|
|
@@ -197,7 +198,7 @@ function confirm() {
|
|
|
197
198
|
return;
|
|
198
199
|
}
|
|
199
200
|
|
|
200
|
-
emit('confirm', input);
|
|
201
|
+
emit('confirm', input.value);
|
|
201
202
|
}
|
|
202
203
|
|
|
203
204
|
</script>
|
package/src/stores/dialogs.ts
CHANGED
|
@@ -21,6 +21,7 @@ export const useDialogsStore = defineStore('dialogs', {
|
|
|
21
21
|
confirmText: options.confirmText ?? t('sui.confirm'),
|
|
22
22
|
cancelText: options.cancelText ?? t('sui.cancel'),
|
|
23
23
|
closeOnOutsideClick: options.closeOnOutsideClick ?? true,
|
|
24
|
+
input: options.input ?? false,
|
|
24
25
|
onConfirm:
|
|
25
26
|
options.onConfirm ??
|
|
26
27
|
function () {
|
package/src/types/index.ts
CHANGED
|
@@ -153,10 +153,11 @@ export interface DialogOptions {
|
|
|
153
153
|
title: string;
|
|
154
154
|
message: string;
|
|
155
155
|
html?: boolean;
|
|
156
|
+
input?: InputConfigProps | false;
|
|
156
157
|
confirmText?: string;
|
|
157
158
|
cancelText?: string;
|
|
158
159
|
closeOnOutsideClick?: boolean;
|
|
159
|
-
onConfirm?: () => void;
|
|
160
|
+
onConfirm?: (input?: string) => void;
|
|
160
161
|
onCancel?: () => void;
|
|
161
162
|
}
|
|
162
163
|
|
|
@@ -166,10 +167,11 @@ export interface Dialog {
|
|
|
166
167
|
title: string;
|
|
167
168
|
message: string;
|
|
168
169
|
html: boolean;
|
|
170
|
+
input: InputConfigProps | false;
|
|
169
171
|
confirmText: string;
|
|
170
172
|
cancelText: string;
|
|
171
173
|
closeOnOutsideClick: boolean;
|
|
172
|
-
onConfirm: () => void;
|
|
174
|
+
onConfirm: (input?: string) => void;
|
|
173
175
|
onCancel: () => void;
|
|
174
176
|
}
|
|
175
177
|
|