@varlet/ui 3.11.5-alpha.1757700927355 → 3.12.0
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/es/dialog/Dialog.mjs +25 -6
- package/es/dialog/dialog.css +1 -1
- package/es/dialog/props.mjs +4 -0
- package/es/index.bundle.mjs +1 -1
- package/es/index.mjs +1 -1
- package/es/utils/components.mjs +1 -3
- package/es/varlet.css +1 -1
- package/es/varlet.esm.js +1030 -1015
- package/highlight/web-types.en-US.json +37 -1
- package/highlight/web-types.zh-CN.json +37 -1
- package/lib/varlet.cjs.js +30 -10
- package/lib/varlet.css +1 -1
- package/package.json +7 -7
- package/types/dialog.d.ts +8 -0
- package/umd/varlet.js +6 -6
package/es/dialog/Dialog.mjs
CHANGED
|
@@ -16,6 +16,7 @@ var __spreadValues = (a, b) => {
|
|
|
16
16
|
};
|
|
17
17
|
import { defineComponent, ref, watch } from "vue";
|
|
18
18
|
import { call } from "@varlet/shared";
|
|
19
|
+
import { useVModel } from "@varlet/use";
|
|
19
20
|
import VarButton from "../button/index.mjs";
|
|
20
21
|
import { t } from "../locale/index.mjs";
|
|
21
22
|
import { injectLocaleProvider } from "../locale-provider/provide.mjs";
|
|
@@ -111,6 +112,8 @@ function __render__(_ctx, _cache) {
|
|
|
111
112
|
text: "",
|
|
112
113
|
"text-color": _ctx.cancelButtonTextColor,
|
|
113
114
|
color: _ctx.cancelButtonColor,
|
|
115
|
+
loading: _ctx.cancelButtonLoading,
|
|
116
|
+
disabled: _ctx.cancelButtonDisabled,
|
|
114
117
|
onClick: _ctx.cancel
|
|
115
118
|
}, {
|
|
116
119
|
default: _withCtx(() => {
|
|
@@ -125,7 +128,7 @@ function __render__(_ctx, _cache) {
|
|
|
125
128
|
}),
|
|
126
129
|
_: 1
|
|
127
130
|
/* STABLE */
|
|
128
|
-
}, 8, ["class", "text-color", "color", "onClick"])) : _createCommentVNode("v-if", true),
|
|
131
|
+
}, 8, ["class", "text-color", "color", "loading", "disabled", "onClick"])) : _createCommentVNode("v-if", true),
|
|
129
132
|
_ctx.confirmButton ? (_openBlock(), _createBlock(_component_var_button, {
|
|
130
133
|
key: 1,
|
|
131
134
|
class: _normalizeClass(_ctx.classes(_ctx.n("button"), _ctx.n("confirm-button"))),
|
|
@@ -133,6 +136,8 @@ function __render__(_ctx, _cache) {
|
|
|
133
136
|
text: "",
|
|
134
137
|
"text-color": _ctx.confirmButtonTextColor,
|
|
135
138
|
color: _ctx.confirmButtonColor,
|
|
139
|
+
loading: _ctx.confirmButtonLoading,
|
|
140
|
+
disabled: _ctx.confirmButtonDisabled,
|
|
136
141
|
onClick: _ctx.confirm
|
|
137
142
|
}, {
|
|
138
143
|
default: _withCtx(() => {
|
|
@@ -147,7 +152,7 @@ function __render__(_ctx, _cache) {
|
|
|
147
152
|
}),
|
|
148
153
|
_: 1
|
|
149
154
|
/* STABLE */
|
|
150
|
-
}, 8, ["class", "text-color", "color", "onClick"])) : _createCommentVNode("v-if", true)
|
|
155
|
+
}, 8, ["class", "text-color", "color", "loading", "disabled", "onClick"])) : _createCommentVNode("v-if", true)
|
|
151
156
|
],
|
|
152
157
|
2
|
|
153
158
|
/* CLASS */
|
|
@@ -171,9 +176,19 @@ const __sfc__ = defineComponent({
|
|
|
171
176
|
inheritAttrs: false,
|
|
172
177
|
props,
|
|
173
178
|
setup(props2) {
|
|
179
|
+
const { t: pt } = injectLocaleProvider();
|
|
174
180
|
const popupShow = ref(false);
|
|
175
181
|
const popupCloseOnClickOverlay = ref(false);
|
|
176
|
-
const
|
|
182
|
+
const confirmButtonLoading = useVModel(props2, "confirmButtonLoading");
|
|
183
|
+
const cancelButtonLoading = useVModel(props2, "cancelButtonLoading");
|
|
184
|
+
const confirmButtonDisabled = useVModel(props2, "confirmButtonDisabled");
|
|
185
|
+
const cancelButtonDisabled = useVModel(props2, "cancelButtonDisabled");
|
|
186
|
+
const exposedRefs = {
|
|
187
|
+
confirmButtonLoading,
|
|
188
|
+
cancelButtonLoading,
|
|
189
|
+
confirmButtonDisabled,
|
|
190
|
+
cancelButtonDisabled
|
|
191
|
+
};
|
|
177
192
|
watch(
|
|
178
193
|
() => props2.show,
|
|
179
194
|
(newValue) => {
|
|
@@ -202,7 +217,7 @@ const __sfc__ = defineComponent({
|
|
|
202
217
|
return;
|
|
203
218
|
}
|
|
204
219
|
if (onBeforeClose != null) {
|
|
205
|
-
call(onBeforeClose, "close", done);
|
|
220
|
+
call(onBeforeClose, "close", done, exposedRefs);
|
|
206
221
|
return;
|
|
207
222
|
}
|
|
208
223
|
call(props2["onUpdate:show"], false);
|
|
@@ -211,7 +226,7 @@ const __sfc__ = defineComponent({
|
|
|
211
226
|
const { onBeforeClose, onConfirm } = props2;
|
|
212
227
|
call(onConfirm);
|
|
213
228
|
if (onBeforeClose != null) {
|
|
214
|
-
call(onBeforeClose, "confirm", done);
|
|
229
|
+
call(onBeforeClose, "confirm", done, exposedRefs);
|
|
215
230
|
return;
|
|
216
231
|
}
|
|
217
232
|
call(props2["onUpdate:show"], false);
|
|
@@ -220,7 +235,7 @@ const __sfc__ = defineComponent({
|
|
|
220
235
|
const { onBeforeClose, onCancel } = props2;
|
|
221
236
|
call(onCancel);
|
|
222
237
|
if (onBeforeClose != null) {
|
|
223
|
-
call(onBeforeClose, "cancel", done);
|
|
238
|
+
call(onBeforeClose, "cancel", done, exposedRefs);
|
|
224
239
|
return;
|
|
225
240
|
}
|
|
226
241
|
call(props2["onUpdate:show"], false);
|
|
@@ -235,6 +250,10 @@ const __sfc__ = defineComponent({
|
|
|
235
250
|
return {
|
|
236
251
|
popupShow,
|
|
237
252
|
popupCloseOnClickOverlay,
|
|
253
|
+
confirmButtonLoading,
|
|
254
|
+
cancelButtonLoading,
|
|
255
|
+
confirmButtonDisabled,
|
|
256
|
+
cancelButtonDisabled,
|
|
238
257
|
pt,
|
|
239
258
|
t,
|
|
240
259
|
n,
|
package/es/dialog/dialog.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
:root { --dialog-width: 280px; --dialog-border-radius: 3px; --dialog-title-padding: 20px 20px 0; --dialog-message-color: #888; --dialog-message-padding: 12px 20px; --dialog-message-line-height: 24px; --dialog-message-font-size: var(--font-size-md); --dialog-title-font-size: var(--font-size-lg); --dialog-actions-padding: 0 12px 12px; --dialog-button-margin-left: 6px; --dialog-title-color: #555; --dialog-confirm-button-color: var(--color-primary); --dialog-cancel-button-color: var(--color-primary); --dialog-background: var(--color-surface-container-low);}.var-dialog { width: var(--dialog-width); background: var(--dialog-background); transition: 0.25s background-color;}.var-dialog__popup[var-dialog-cover] { background: transparent; border-radius: var(--dialog-border-radius);}.var-dialog__title { font-size: var(--dialog-title-font-size); font-weight: 400; padding: var(--dialog-title-padding); color: var(--dialog-title-color);}.var-dialog__message { padding: var(--dialog-message-padding); color: var(--dialog-message-color); line-height: var(--dialog-message-line-height); font-size: var(--dialog-message-font-size); word-wrap: break-word;}.var-dialog__actions { display: flex; justify-content: flex-end; padding: var(--dialog-actions-padding);}.var-dialog__button[var-dialog-cover] { margin-left: var(--dialog-button-margin-left); background-color: transparent; box-shadow: none;}.var-dialog__button[var-dialog-cover]:active { box-shadow: none;}.var-dialog__confirm-button[var-dialog-cover] { color: var(--dialog-confirm-button-color);}.var-dialog__cancel-button[var-dialog-cover] { color: var(--dialog-cancel-button-color);}
|
|
1
|
+
:root { --dialog-width: 280px; --dialog-border-radius: 3px; --dialog-title-padding: 20px 20px 0; --dialog-message-color: #888; --dialog-message-padding: 12px 20px; --dialog-message-line-height: 24px; --dialog-message-font-size: var(--font-size-md); --dialog-title-font-size: var(--font-size-lg); --dialog-actions-padding: 0 12px 12px; --dialog-button-margin-left: 6px; --dialog-title-color: #555; --dialog-confirm-button-color: var(--color-primary); --dialog-cancel-button-color: var(--color-primary); --dialog-background: var(--color-surface-container-low);}.var-dialog { width: var(--dialog-width); background: var(--dialog-background); transition: 0.25s background-color;}.var-dialog__popup[var-dialog-cover] { background: transparent; border-radius: var(--dialog-border-radius);}.var-dialog__title { font-size: var(--dialog-title-font-size); font-weight: 400; padding: var(--dialog-title-padding); color: var(--dialog-title-color);}.var-dialog__message { padding: var(--dialog-message-padding); color: var(--dialog-message-color); line-height: var(--dialog-message-line-height); font-size: var(--dialog-message-font-size); word-wrap: break-word;}.var-dialog__actions { display: flex; justify-content: flex-end; padding: var(--dialog-actions-padding);}.var-dialog__button[var-dialog-cover] { margin-left: var(--dialog-button-margin-left); background-color: transparent; box-shadow: none;}.var-dialog__button[var-dialog-cover]:active { box-shadow: none;}.var-dialog__confirm-button[var-dialog-cover]:not(.var-button--disabled) { color: var(--dialog-confirm-button-color);}.var-dialog__cancel-button[var-dialog-cover]:not(.var-button--disabled) { color: var(--dialog-cancel-button-color);}
|
package/es/dialog/props.mjs
CHANGED
|
@@ -39,6 +39,10 @@ const props = __spreadValues({
|
|
|
39
39
|
cancelButtonTextColor: String,
|
|
40
40
|
confirmButtonColor: String,
|
|
41
41
|
cancelButtonColor: String,
|
|
42
|
+
confirmButtonLoading: Boolean,
|
|
43
|
+
cancelButtonLoading: Boolean,
|
|
44
|
+
confirmButtonDisabled: Boolean,
|
|
45
|
+
cancelButtonDisabled: Boolean,
|
|
42
46
|
dialogClass: String,
|
|
43
47
|
dialogStyle: Object,
|
|
44
48
|
onBeforeClose: defineListenerProp(),
|
package/es/index.bundle.mjs
CHANGED
|
@@ -283,7 +283,7 @@ import './tooltip/style/index.mjs'
|
|
|
283
283
|
import './uploader/style/index.mjs'
|
|
284
284
|
import './watermark/style/index.mjs'
|
|
285
285
|
|
|
286
|
-
const version = '3.
|
|
286
|
+
const version = '3.12.0'
|
|
287
287
|
|
|
288
288
|
function install(app) {
|
|
289
289
|
ActionSheet.install && app.use(ActionSheet)
|
package/es/index.mjs
CHANGED
|
@@ -188,7 +188,7 @@ export * from './tooltip/index.mjs'
|
|
|
188
188
|
export * from './uploader/index.mjs'
|
|
189
189
|
export * from './watermark/index.mjs'
|
|
190
190
|
|
|
191
|
-
const version = '3.
|
|
191
|
+
const version = '3.12.0'
|
|
192
192
|
|
|
193
193
|
function install(app) {
|
|
194
194
|
ActionSheet.install && app.use(ActionSheet)
|
package/es/utils/components.mjs
CHANGED
|
@@ -123,9 +123,7 @@ function flatFragment(vNodes) {
|
|
|
123
123
|
return;
|
|
124
124
|
}
|
|
125
125
|
if (vNode.type === Fragment && isArray(vNode.children)) {
|
|
126
|
-
vNode.children
|
|
127
|
-
result.push(item);
|
|
128
|
-
});
|
|
126
|
+
result.push(...flatFragment(vNode.children));
|
|
129
127
|
return;
|
|
130
128
|
}
|
|
131
129
|
result.push(vNode);
|