@sybz-components/utils 1.0.9 → 1.0.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.
- package/dist/base.cjs +2 -1
- package/dist/base.d.cts +3 -4
- package/dist/base.d.mts +3 -4
- package/dist/base.d.ts +3 -4
- package/dist/base.mjs +2 -1
- package/dist/confirmSemantic.cjs +27 -0
- package/dist/confirmSemantic.d.cts +29 -0
- package/dist/confirmSemantic.d.mts +29 -0
- package/dist/confirmSemantic.d.ts +29 -0
- package/dist/confirmSemantic.mjs +25 -0
- package/dist/format.cjs +2 -1
- package/dist/format.mjs +2 -1
- package/dist/index.cjs +3 -1
- package/dist/index.d.cts +2 -1
- package/dist/index.d.mts +2 -1
- package/dist/index.d.ts +2 -1
- package/dist/index.mjs +2 -1
- package/dist/shared/{utils.Co6HoBFm.mjs → utils.JIlaBPw3.mjs} +12 -6
- package/dist/shared/{utils.Y29JLBLz.cjs → utils.V4Kpqes0.cjs} +12 -6
- package/package.json +1 -1
package/dist/base.cjs
CHANGED
|
@@ -3,7 +3,8 @@
|
|
|
3
3
|
require('vue');
|
|
4
4
|
require('consola');
|
|
5
5
|
require('es-toolkit');
|
|
6
|
-
const format = require('./shared/utils.
|
|
6
|
+
const format = require('./shared/utils.V4Kpqes0.cjs');
|
|
7
|
+
require('./confirmSemantic.cjs');
|
|
7
8
|
require('element-plus');
|
|
8
9
|
require('./is.cjs');
|
|
9
10
|
|
package/dist/base.d.cts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import * as vue from 'vue';
|
|
2
2
|
import { VNode, AppContext, Ref } from 'vue';
|
|
3
|
+
import { ConfirmVariant, ConfirmTarget } from './confirmSemantic.cjs';
|
|
3
4
|
import { MessageOptions, ElMessageBoxOptions, ElMessageBox } from 'element-plus';
|
|
4
5
|
|
|
5
6
|
type Func<Args extends any[] = any[], Return = any> = (...args: Args) => Return;
|
|
@@ -126,9 +127,7 @@ interface CopyOptions extends ToastOptions {
|
|
|
126
127
|
}
|
|
127
128
|
type WidthInput = string | number | Ref<string | number>;
|
|
128
129
|
type ConfirmMessage = string | VNode | (() => VNode);
|
|
129
|
-
type ConfirmVariant = 'default' | 'delete' | 'warning';
|
|
130
130
|
type ConfirmTheme = UtilsTheme;
|
|
131
|
-
type ConfirmTarget = string | number;
|
|
132
131
|
interface ConfirmCustomOptions {
|
|
133
132
|
/**
|
|
134
133
|
* 确认框语义样式。
|
|
@@ -643,5 +642,5 @@ declare function getUtilsBuildTime(fallback?: string): string;
|
|
|
643
642
|
*/
|
|
644
643
|
declare function test(): string;
|
|
645
644
|
|
|
646
|
-
export { $toast, clearStorage, clone, configureUtils, confirm, copy, debounce, delay, getStorage, getType, getUtilsBuildTime, getVariable, isEmpty, log, merge, mockValue, processWidth, random, setStorage, test, throttle, toLine, tryCatch, validate, validateForm, validateOnSubmit };
|
|
647
|
-
export type { ConfirmCustomOptions, ConfirmMessage, ConfirmOptions,
|
|
645
|
+
export { $toast, ConfirmTarget, ConfirmVariant, clearStorage, clone, configureUtils, confirm, copy, debounce, delay, getStorage, getType, getUtilsBuildTime, getVariable, isEmpty, log, merge, mockValue, processWidth, random, setStorage, test, throttle, toLine, tryCatch, validate, validateForm, validateOnSubmit };
|
|
646
|
+
export type { ConfirmCustomOptions, ConfirmMessage, ConfirmOptions, ConfirmTheme, SybzUtilsConfig, ToastOptions, UtilsTheme };
|
package/dist/base.d.mts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import * as vue from 'vue';
|
|
2
2
|
import { VNode, AppContext, Ref } from 'vue';
|
|
3
|
+
import { ConfirmVariant, ConfirmTarget } from './confirmSemantic.mjs';
|
|
3
4
|
import { MessageOptions, ElMessageBoxOptions, ElMessageBox } from 'element-plus';
|
|
4
5
|
|
|
5
6
|
type Func<Args extends any[] = any[], Return = any> = (...args: Args) => Return;
|
|
@@ -126,9 +127,7 @@ interface CopyOptions extends ToastOptions {
|
|
|
126
127
|
}
|
|
127
128
|
type WidthInput = string | number | Ref<string | number>;
|
|
128
129
|
type ConfirmMessage = string | VNode | (() => VNode);
|
|
129
|
-
type ConfirmVariant = 'default' | 'delete' | 'warning';
|
|
130
130
|
type ConfirmTheme = UtilsTheme;
|
|
131
|
-
type ConfirmTarget = string | number;
|
|
132
131
|
interface ConfirmCustomOptions {
|
|
133
132
|
/**
|
|
134
133
|
* 确认框语义样式。
|
|
@@ -643,5 +642,5 @@ declare function getUtilsBuildTime(fallback?: string): string;
|
|
|
643
642
|
*/
|
|
644
643
|
declare function test(): string;
|
|
645
644
|
|
|
646
|
-
export { $toast, clearStorage, clone, configureUtils, confirm, copy, debounce, delay, getStorage, getType, getUtilsBuildTime, getVariable, isEmpty, log, merge, mockValue, processWidth, random, setStorage, test, throttle, toLine, tryCatch, validate, validateForm, validateOnSubmit };
|
|
647
|
-
export type { ConfirmCustomOptions, ConfirmMessage, ConfirmOptions,
|
|
645
|
+
export { $toast, ConfirmTarget, ConfirmVariant, clearStorage, clone, configureUtils, confirm, copy, debounce, delay, getStorage, getType, getUtilsBuildTime, getVariable, isEmpty, log, merge, mockValue, processWidth, random, setStorage, test, throttle, toLine, tryCatch, validate, validateForm, validateOnSubmit };
|
|
646
|
+
export type { ConfirmCustomOptions, ConfirmMessage, ConfirmOptions, ConfirmTheme, SybzUtilsConfig, ToastOptions, UtilsTheme };
|
package/dist/base.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import * as vue from 'vue';
|
|
2
2
|
import { VNode, AppContext, Ref } from 'vue';
|
|
3
|
+
import { ConfirmVariant, ConfirmTarget } from './confirmSemantic.js';
|
|
3
4
|
import { MessageOptions, ElMessageBoxOptions, ElMessageBox } from 'element-plus';
|
|
4
5
|
|
|
5
6
|
type Func<Args extends any[] = any[], Return = any> = (...args: Args) => Return;
|
|
@@ -126,9 +127,7 @@ interface CopyOptions extends ToastOptions {
|
|
|
126
127
|
}
|
|
127
128
|
type WidthInput = string | number | Ref<string | number>;
|
|
128
129
|
type ConfirmMessage = string | VNode | (() => VNode);
|
|
129
|
-
type ConfirmVariant = 'default' | 'delete' | 'warning';
|
|
130
130
|
type ConfirmTheme = UtilsTheme;
|
|
131
|
-
type ConfirmTarget = string | number;
|
|
132
131
|
interface ConfirmCustomOptions {
|
|
133
132
|
/**
|
|
134
133
|
* 确认框语义样式。
|
|
@@ -643,5 +642,5 @@ declare function getUtilsBuildTime(fallback?: string): string;
|
|
|
643
642
|
*/
|
|
644
643
|
declare function test(): string;
|
|
645
644
|
|
|
646
|
-
export { $toast, clearStorage, clone, configureUtils, confirm, copy, debounce, delay, getStorage, getType, getUtilsBuildTime, getVariable, isEmpty, log, merge, mockValue, processWidth, random, setStorage, test, throttle, toLine, tryCatch, validate, validateForm, validateOnSubmit };
|
|
647
|
-
export type { ConfirmCustomOptions, ConfirmMessage, ConfirmOptions,
|
|
645
|
+
export { $toast, ConfirmTarget, ConfirmVariant, clearStorage, clone, configureUtils, confirm, copy, debounce, delay, getStorage, getType, getUtilsBuildTime, getVariable, isEmpty, log, merge, mockValue, processWidth, random, setStorage, test, throttle, toLine, tryCatch, validate, validateForm, validateOnSubmit };
|
|
646
|
+
export type { ConfirmCustomOptions, ConfirmMessage, ConfirmOptions, ConfirmTheme, SybzUtilsConfig, ToastOptions, UtilsTheme };
|
package/dist/base.mjs
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import 'vue';
|
|
2
2
|
import 'consola';
|
|
3
3
|
import 'es-toolkit';
|
|
4
|
-
export { $ as $toast, c as clearStorage, a as clone, b as configureUtils, d as confirm, e as copy, f as debounce, g as delay, h as getStorage, i as getType, j as getUtilsBuildTime, k as getVariable, l as isEmpty, m as log, n as merge, o as mockValue, p as processWidth, r as random, s as setStorage, t as test, q as throttle, u as toLine, v as tryCatch, w as validate, x as validateForm, y as validateOnSubmit } from './shared/utils.
|
|
4
|
+
export { $ as $toast, c as clearStorage, a as clone, b as configureUtils, d as confirm, e as copy, f as debounce, g as delay, h as getStorage, i as getType, j as getUtilsBuildTime, k as getVariable, l as isEmpty, m as log, n as merge, o as mockValue, p as processWidth, r as random, s as setStorage, t as test, q as throttle, u as toLine, v as tryCatch, w as validate, x as validateForm, y as validateOnSubmit } from './shared/utils.JIlaBPw3.mjs';
|
|
5
|
+
import './confirmSemantic.mjs';
|
|
5
6
|
import 'element-plus';
|
|
6
7
|
import './is.mjs';
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
function resolveConfirmSemantic(options = {}) {
|
|
4
|
+
const variant = options.variant ?? "default";
|
|
5
|
+
const hasTarget = options.target !== void 0;
|
|
6
|
+
const title = options.title ?? (variant === "delete" ? "\u5220\u9664\u786E\u8BA4" : variant === "warning" ? "\u8B66\u544A" : "\u63D0\u793A");
|
|
7
|
+
const confirmButtonText = options.confirmButtonText ?? (variant === "delete" ? "\u5220\u9664" : "\u786E\u5B9A");
|
|
8
|
+
const confirmButtonType = options.confirmButtonType ?? (variant === "delete" ? "danger" : variant === "warning" ? "warning" : "primary");
|
|
9
|
+
const defaultMessage = variant === "delete" ? hasTarget ? `\u786E\u8BA4\u8981\u5220\u9664${String(options.target)}\u5417\uFF1F\u5220\u9664\u540E\u4E0D\u53EF\u6062\u590D\u3002` : "\u5220\u9664\u540E\u6570\u636E\u5C06\u65E0\u6CD5\u6062\u590D\uFF0C\u786E\u5B9A\u7EE7\u7EED\u5417\uFF1F" : "";
|
|
10
|
+
const theme = options.theme ?? "default";
|
|
11
|
+
return {
|
|
12
|
+
variant,
|
|
13
|
+
target: options.target,
|
|
14
|
+
hasTarget,
|
|
15
|
+
title,
|
|
16
|
+
confirmButtonText,
|
|
17
|
+
confirmButtonType,
|
|
18
|
+
defaultMessage,
|
|
19
|
+
classNames: [
|
|
20
|
+
"s-confirm-semantic",
|
|
21
|
+
`s-confirm-semantic--${variant}`,
|
|
22
|
+
theme !== "default" ? `s-confirm-semantic--${theme}` : ""
|
|
23
|
+
].filter(Boolean)
|
|
24
|
+
};
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
exports.resolveConfirmSemantic = resolveConfirmSemantic;
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
type ConfirmVariant = 'default' | 'delete' | 'warning';
|
|
2
|
+
type ConfirmTarget = string | number;
|
|
3
|
+
type ConfirmSemanticTheme = 'default' | 'chenghua' | 'shijingshan';
|
|
4
|
+
type ConfirmSemanticButtonType = 'default' | 'primary' | 'success' | 'warning' | 'info' | 'danger' | 'text' | '';
|
|
5
|
+
interface ConfirmSemanticOptions {
|
|
6
|
+
variant?: ConfirmVariant;
|
|
7
|
+
target?: ConfirmTarget;
|
|
8
|
+
theme?: ConfirmSemanticTheme;
|
|
9
|
+
title?: string;
|
|
10
|
+
confirmButtonText?: string;
|
|
11
|
+
confirmButtonType?: ConfirmSemanticButtonType;
|
|
12
|
+
}
|
|
13
|
+
interface ConfirmSemanticResult {
|
|
14
|
+
variant: ConfirmVariant;
|
|
15
|
+
target?: ConfirmTarget;
|
|
16
|
+
hasTarget: boolean;
|
|
17
|
+
title: string;
|
|
18
|
+
confirmButtonText: string;
|
|
19
|
+
confirmButtonType: ConfirmSemanticButtonType;
|
|
20
|
+
defaultMessage: string;
|
|
21
|
+
classNames: string[];
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* 统一解析 confirm、s-dialog 和 s-popconfirm 的确认语义。
|
|
25
|
+
*/
|
|
26
|
+
declare function resolveConfirmSemantic(options?: ConfirmSemanticOptions): ConfirmSemanticResult;
|
|
27
|
+
|
|
28
|
+
export { resolveConfirmSemantic };
|
|
29
|
+
export type { ConfirmSemanticButtonType, ConfirmSemanticOptions, ConfirmSemanticResult, ConfirmSemanticTheme, ConfirmTarget, ConfirmVariant };
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
type ConfirmVariant = 'default' | 'delete' | 'warning';
|
|
2
|
+
type ConfirmTarget = string | number;
|
|
3
|
+
type ConfirmSemanticTheme = 'default' | 'chenghua' | 'shijingshan';
|
|
4
|
+
type ConfirmSemanticButtonType = 'default' | 'primary' | 'success' | 'warning' | 'info' | 'danger' | 'text' | '';
|
|
5
|
+
interface ConfirmSemanticOptions {
|
|
6
|
+
variant?: ConfirmVariant;
|
|
7
|
+
target?: ConfirmTarget;
|
|
8
|
+
theme?: ConfirmSemanticTheme;
|
|
9
|
+
title?: string;
|
|
10
|
+
confirmButtonText?: string;
|
|
11
|
+
confirmButtonType?: ConfirmSemanticButtonType;
|
|
12
|
+
}
|
|
13
|
+
interface ConfirmSemanticResult {
|
|
14
|
+
variant: ConfirmVariant;
|
|
15
|
+
target?: ConfirmTarget;
|
|
16
|
+
hasTarget: boolean;
|
|
17
|
+
title: string;
|
|
18
|
+
confirmButtonText: string;
|
|
19
|
+
confirmButtonType: ConfirmSemanticButtonType;
|
|
20
|
+
defaultMessage: string;
|
|
21
|
+
classNames: string[];
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* 统一解析 confirm、s-dialog 和 s-popconfirm 的确认语义。
|
|
25
|
+
*/
|
|
26
|
+
declare function resolveConfirmSemantic(options?: ConfirmSemanticOptions): ConfirmSemanticResult;
|
|
27
|
+
|
|
28
|
+
export { resolveConfirmSemantic };
|
|
29
|
+
export type { ConfirmSemanticButtonType, ConfirmSemanticOptions, ConfirmSemanticResult, ConfirmSemanticTheme, ConfirmTarget, ConfirmVariant };
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
type ConfirmVariant = 'default' | 'delete' | 'warning';
|
|
2
|
+
type ConfirmTarget = string | number;
|
|
3
|
+
type ConfirmSemanticTheme = 'default' | 'chenghua' | 'shijingshan';
|
|
4
|
+
type ConfirmSemanticButtonType = 'default' | 'primary' | 'success' | 'warning' | 'info' | 'danger' | 'text' | '';
|
|
5
|
+
interface ConfirmSemanticOptions {
|
|
6
|
+
variant?: ConfirmVariant;
|
|
7
|
+
target?: ConfirmTarget;
|
|
8
|
+
theme?: ConfirmSemanticTheme;
|
|
9
|
+
title?: string;
|
|
10
|
+
confirmButtonText?: string;
|
|
11
|
+
confirmButtonType?: ConfirmSemanticButtonType;
|
|
12
|
+
}
|
|
13
|
+
interface ConfirmSemanticResult {
|
|
14
|
+
variant: ConfirmVariant;
|
|
15
|
+
target?: ConfirmTarget;
|
|
16
|
+
hasTarget: boolean;
|
|
17
|
+
title: string;
|
|
18
|
+
confirmButtonText: string;
|
|
19
|
+
confirmButtonType: ConfirmSemanticButtonType;
|
|
20
|
+
defaultMessage: string;
|
|
21
|
+
classNames: string[];
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* 统一解析 confirm、s-dialog 和 s-popconfirm 的确认语义。
|
|
25
|
+
*/
|
|
26
|
+
declare function resolveConfirmSemantic(options?: ConfirmSemanticOptions): ConfirmSemanticResult;
|
|
27
|
+
|
|
28
|
+
export { resolveConfirmSemantic };
|
|
29
|
+
export type { ConfirmSemanticButtonType, ConfirmSemanticOptions, ConfirmSemanticResult, ConfirmSemanticTheme, ConfirmTarget, ConfirmVariant };
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
function resolveConfirmSemantic(options = {}) {
|
|
2
|
+
const variant = options.variant ?? "default";
|
|
3
|
+
const hasTarget = options.target !== void 0;
|
|
4
|
+
const title = options.title ?? (variant === "delete" ? "\u5220\u9664\u786E\u8BA4" : variant === "warning" ? "\u8B66\u544A" : "\u63D0\u793A");
|
|
5
|
+
const confirmButtonText = options.confirmButtonText ?? (variant === "delete" ? "\u5220\u9664" : "\u786E\u5B9A");
|
|
6
|
+
const confirmButtonType = options.confirmButtonType ?? (variant === "delete" ? "danger" : variant === "warning" ? "warning" : "primary");
|
|
7
|
+
const defaultMessage = variant === "delete" ? hasTarget ? `\u786E\u8BA4\u8981\u5220\u9664${String(options.target)}\u5417\uFF1F\u5220\u9664\u540E\u4E0D\u53EF\u6062\u590D\u3002` : "\u5220\u9664\u540E\u6570\u636E\u5C06\u65E0\u6CD5\u6062\u590D\uFF0C\u786E\u5B9A\u7EE7\u7EED\u5417\uFF1F" : "";
|
|
8
|
+
const theme = options.theme ?? "default";
|
|
9
|
+
return {
|
|
10
|
+
variant,
|
|
11
|
+
target: options.target,
|
|
12
|
+
hasTarget,
|
|
13
|
+
title,
|
|
14
|
+
confirmButtonText,
|
|
15
|
+
confirmButtonType,
|
|
16
|
+
defaultMessage,
|
|
17
|
+
classNames: [
|
|
18
|
+
"s-confirm-semantic",
|
|
19
|
+
`s-confirm-semantic--${variant}`,
|
|
20
|
+
theme !== "default" ? `s-confirm-semantic--${theme}` : ""
|
|
21
|
+
].filter(Boolean)
|
|
22
|
+
};
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
export { resolveConfirmSemantic };
|
package/dist/format.cjs
CHANGED
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
const format = require('./shared/utils.
|
|
3
|
+
const format = require('./shared/utils.V4Kpqes0.cjs');
|
|
4
4
|
require('./is.cjs');
|
|
5
5
|
require('consola');
|
|
6
6
|
require('vue');
|
|
7
7
|
require('es-toolkit');
|
|
8
|
+
require('./confirmSemantic.cjs');
|
|
8
9
|
require('element-plus');
|
|
9
10
|
|
|
10
11
|
|
package/dist/format.mjs
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
export { z as formatBytes, A as formatBytesConvert, B as formatDurationTime, C as formatTextToHtml, D as formatThousands, E as formatTime, F as formatToFixed } from './shared/utils.
|
|
1
|
+
export { z as formatBytes, A as formatBytesConvert, B as formatDurationTime, C as formatTextToHtml, D as formatThousands, E as formatTime, F as formatToFixed } from './shared/utils.JIlaBPw3.mjs';
|
|
2
2
|
import './is.mjs';
|
|
3
3
|
import 'consola';
|
|
4
4
|
import 'vue';
|
|
5
5
|
import 'es-toolkit';
|
|
6
|
+
import './confirmSemantic.mjs';
|
|
6
7
|
import 'element-plus';
|
package/dist/index.cjs
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
const format = require('./shared/utils.
|
|
3
|
+
const format = require('./shared/utils.V4Kpqes0.cjs');
|
|
4
|
+
const confirmSemantic = require('./confirmSemantic.cjs');
|
|
4
5
|
const is = require('./is.cjs');
|
|
5
6
|
require('vue');
|
|
6
7
|
require('consola');
|
|
@@ -42,6 +43,7 @@ exports.tryCatch = format.tryCatch;
|
|
|
42
43
|
exports.validate = format.validate;
|
|
43
44
|
exports.validateForm = format.validateForm;
|
|
44
45
|
exports.validateOnSubmit = format.validateOnSubmit;
|
|
46
|
+
exports.resolveConfirmSemantic = confirmSemantic.resolveConfirmSemantic;
|
|
45
47
|
exports.isArray = is.isArray;
|
|
46
48
|
exports.isBoolean = is.isBoolean;
|
|
47
49
|
exports.isComponent = is.isComponent;
|
package/dist/index.d.cts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
export { $toast, ConfirmCustomOptions, ConfirmMessage, ConfirmOptions,
|
|
1
|
+
export { $toast, ConfirmCustomOptions, ConfirmMessage, ConfirmOptions, ConfirmTheme, SybzUtilsConfig, ToastOptions, UtilsTheme, clearStorage, clone, configureUtils, confirm, copy, debounce, delay, getStorage, getType, getUtilsBuildTime, getVariable, isEmpty, log, merge, mockValue, processWidth, random, setStorage, test, throttle, toLine, tryCatch, validate, validateForm, validateOnSubmit } from './base.cjs';
|
|
2
|
+
export { ConfirmSemanticButtonType, ConfirmSemanticOptions, ConfirmSemanticResult, ConfirmSemanticTheme, ConfirmTarget, ConfirmVariant, resolveConfirmSemantic } from './confirmSemantic.cjs';
|
|
2
3
|
export { isArray, isBoolean, isComponent, isDate, isEmptyObject, isFunction, isIOS, isMap, isNumber, isObject, isPlainObject, isPromise, isRegExp, isSVGElement, isSet, isString, isStringNumber, isSymbol, isUrl, objectToString, toRawType, toTypeString } from './is.cjs';
|
|
3
4
|
export { FormatBytesConvertOptions, FormatBytesOptions, FormatTimeFallback, FormatTimeInput, FormatToFixedOptions, formatBytes, formatBytesConvert, formatDurationTime, formatTextToHtml, formatThousands, formatTime, formatToFixed } from './format.cjs';
|
|
4
5
|
import 'vue';
|
package/dist/index.d.mts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
export { $toast, ConfirmCustomOptions, ConfirmMessage, ConfirmOptions,
|
|
1
|
+
export { $toast, ConfirmCustomOptions, ConfirmMessage, ConfirmOptions, ConfirmTheme, SybzUtilsConfig, ToastOptions, UtilsTheme, clearStorage, clone, configureUtils, confirm, copy, debounce, delay, getStorage, getType, getUtilsBuildTime, getVariable, isEmpty, log, merge, mockValue, processWidth, random, setStorage, test, throttle, toLine, tryCatch, validate, validateForm, validateOnSubmit } from './base.mjs';
|
|
2
|
+
export { ConfirmSemanticButtonType, ConfirmSemanticOptions, ConfirmSemanticResult, ConfirmSemanticTheme, ConfirmTarget, ConfirmVariant, resolveConfirmSemantic } from './confirmSemantic.mjs';
|
|
2
3
|
export { isArray, isBoolean, isComponent, isDate, isEmptyObject, isFunction, isIOS, isMap, isNumber, isObject, isPlainObject, isPromise, isRegExp, isSVGElement, isSet, isString, isStringNumber, isSymbol, isUrl, objectToString, toRawType, toTypeString } from './is.mjs';
|
|
3
4
|
export { FormatBytesConvertOptions, FormatBytesOptions, FormatTimeFallback, FormatTimeInput, FormatToFixedOptions, formatBytes, formatBytesConvert, formatDurationTime, formatTextToHtml, formatThousands, formatTime, formatToFixed } from './format.mjs';
|
|
4
5
|
import 'vue';
|
package/dist/index.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
export { $toast, ConfirmCustomOptions, ConfirmMessage, ConfirmOptions,
|
|
1
|
+
export { $toast, ConfirmCustomOptions, ConfirmMessage, ConfirmOptions, ConfirmTheme, SybzUtilsConfig, ToastOptions, UtilsTheme, clearStorage, clone, configureUtils, confirm, copy, debounce, delay, getStorage, getType, getUtilsBuildTime, getVariable, isEmpty, log, merge, mockValue, processWidth, random, setStorage, test, throttle, toLine, tryCatch, validate, validateForm, validateOnSubmit } from './base.js';
|
|
2
|
+
export { ConfirmSemanticButtonType, ConfirmSemanticOptions, ConfirmSemanticResult, ConfirmSemanticTheme, ConfirmTarget, ConfirmVariant, resolveConfirmSemantic } from './confirmSemantic.js';
|
|
2
3
|
export { isArray, isBoolean, isComponent, isDate, isEmptyObject, isFunction, isIOS, isMap, isNumber, isObject, isPlainObject, isPromise, isRegExp, isSVGElement, isSet, isString, isStringNumber, isSymbol, isUrl, objectToString, toRawType, toTypeString } from './is.js';
|
|
3
4
|
export { FormatBytesConvertOptions, FormatBytesOptions, FormatTimeFallback, FormatTimeInput, FormatToFixedOptions, formatBytes, formatBytesConvert, formatDurationTime, formatTextToHtml, formatThousands, formatTime, formatToFixed } from './format.js';
|
|
4
5
|
import 'vue';
|
package/dist/index.mjs
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
export { $ as $toast, c as clearStorage, a as clone, b as configureUtils, d as confirm, e as copy, f as debounce, g as delay, z as formatBytes, A as formatBytesConvert, B as formatDurationTime, C as formatTextToHtml, D as formatThousands, E as formatTime, F as formatToFixed, h as getStorage, i as getType, j as getUtilsBuildTime, k as getVariable, l as isEmpty, m as log, n as merge, o as mockValue, p as processWidth, r as random, s as setStorage, t as test, q as throttle, u as toLine, v as tryCatch, w as validate, x as validateForm, y as validateOnSubmit } from './shared/utils.
|
|
1
|
+
export { $ as $toast, c as clearStorage, a as clone, b as configureUtils, d as confirm, e as copy, f as debounce, g as delay, z as formatBytes, A as formatBytesConvert, B as formatDurationTime, C as formatTextToHtml, D as formatThousands, E as formatTime, F as formatToFixed, h as getStorage, i as getType, j as getUtilsBuildTime, k as getVariable, l as isEmpty, m as log, n as merge, o as mockValue, p as processWidth, r as random, s as setStorage, t as test, q as throttle, u as toLine, v as tryCatch, w as validate, x as validateForm, y as validateOnSubmit } from './shared/utils.JIlaBPw3.mjs';
|
|
2
|
+
export { resolveConfirmSemantic } from './confirmSemantic.mjs';
|
|
2
3
|
export { isArray, isBoolean, isComponent, isDate, isEmptyObject, isFunction, isIOS, isMap, isNumber, isObject, isPlainObject, isPromise, isRegExp, isSVGElement, isSet, isString, isStringNumber, isSymbol, isUrl, objectToString, toRawType, toTypeString } from './is.mjs';
|
|
3
4
|
import 'vue';
|
|
4
5
|
import 'consola';
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { isRef, unref, isVNode, toRaw } from 'vue';
|
|
2
2
|
import { consola } from 'consola';
|
|
3
3
|
import { cloneDeep } from 'es-toolkit';
|
|
4
|
+
import { resolveConfirmSemantic } from '../confirmSemantic.mjs';
|
|
4
5
|
import { ElMessageBox, ElMessage } from 'element-plus';
|
|
5
6
|
import { isStringNumber, isNumber } from '../is.mjs';
|
|
6
7
|
|
|
@@ -961,20 +962,25 @@ function confirm(messageOrOptions, optionsOrAppContext = null, appContext = null
|
|
|
961
962
|
...messageBoxOptions
|
|
962
963
|
} = options;
|
|
963
964
|
const inputMessage = typeof message === "function" ? message() : message;
|
|
964
|
-
const
|
|
965
|
+
const semantic = resolveConfirmSemantic({
|
|
966
|
+
variant,
|
|
967
|
+
target,
|
|
968
|
+
theme,
|
|
969
|
+
title: typeof messageBoxOptions.title === "string" ? messageBoxOptions.title : void 0,
|
|
970
|
+
confirmButtonText: messageBoxOptions.confirmButtonText
|
|
971
|
+
});
|
|
972
|
+
const resolvedMessage = variant === "delete" && semantic.hasTarget && !inputMessage ? `\u786E\u8BA4\u8981\u5220\u9664<code type="danger">${_escapeHtml(semantic.target)}</code>\u5417\uFF1F\u5220\u9664\u540E\u4E0D\u53EF\u6062\u590D\u3002` : variant === "delete" && !inputMessage ? semantic.defaultMessage : inputMessage;
|
|
965
973
|
const resolvedAppendTo = _resolveAppendTarget(appendTo);
|
|
966
974
|
const resolvedAppContext = _resolveAppContext(optionAppContext || argumentAppContext);
|
|
967
975
|
const isChenghuaTheme = theme === "chenghua";
|
|
968
976
|
const isShijingshanTheme = theme === "shijingshan";
|
|
969
|
-
const variantOptions = variant === "delete" ? { title: "\u5220\u9664\u786E\u8BA4", confirmButtonText: "\u5220\u9664" } : variant === "warning" ? { title: "\u8B66\u544A" } : {};
|
|
970
977
|
const mergeOptions = {
|
|
971
|
-
title:
|
|
978
|
+
title: semantic.title,
|
|
972
979
|
draggable: true,
|
|
973
980
|
showCancelButton: true,
|
|
974
981
|
cancelButtonText: "\u53D6\u6D88",
|
|
975
|
-
confirmButtonText:
|
|
982
|
+
confirmButtonText: semantic.confirmButtonText,
|
|
976
983
|
dangerouslyUseHTMLString: true,
|
|
977
|
-
...variantOptions,
|
|
978
984
|
...messageBoxOptions,
|
|
979
985
|
appendTo: resolvedAppendTo,
|
|
980
986
|
appContext: resolvedAppContext,
|
|
@@ -1064,7 +1070,7 @@ function getVariable(propertyName, fallback = "") {
|
|
|
1064
1070
|
const DEFAULT_BUILD_TIME_FALLBACK = "\u672A\u6CE8\u5165";
|
|
1065
1071
|
function getUtilsBuildTime(fallback = DEFAULT_BUILD_TIME_FALLBACK) {
|
|
1066
1072
|
{
|
|
1067
|
-
return "2026-
|
|
1073
|
+
return "2026-09-03 15:20:19";
|
|
1068
1074
|
}
|
|
1069
1075
|
}
|
|
1070
1076
|
function test() {
|
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
const vue = require('vue');
|
|
4
4
|
const consola = require('consola');
|
|
5
5
|
const esToolkit = require('es-toolkit');
|
|
6
|
+
const confirmSemantic = require('../confirmSemantic.cjs');
|
|
6
7
|
const elementPlus = require('element-plus');
|
|
7
8
|
const is = require('../is.cjs');
|
|
8
9
|
|
|
@@ -963,20 +964,25 @@ function confirm(messageOrOptions, optionsOrAppContext = null, appContext = null
|
|
|
963
964
|
...messageBoxOptions
|
|
964
965
|
} = options;
|
|
965
966
|
const inputMessage = typeof message === "function" ? message() : message;
|
|
966
|
-
const
|
|
967
|
+
const semantic = confirmSemantic.resolveConfirmSemantic({
|
|
968
|
+
variant,
|
|
969
|
+
target,
|
|
970
|
+
theme,
|
|
971
|
+
title: typeof messageBoxOptions.title === "string" ? messageBoxOptions.title : void 0,
|
|
972
|
+
confirmButtonText: messageBoxOptions.confirmButtonText
|
|
973
|
+
});
|
|
974
|
+
const resolvedMessage = variant === "delete" && semantic.hasTarget && !inputMessage ? `\u786E\u8BA4\u8981\u5220\u9664<code type="danger">${_escapeHtml(semantic.target)}</code>\u5417\uFF1F\u5220\u9664\u540E\u4E0D\u53EF\u6062\u590D\u3002` : variant === "delete" && !inputMessage ? semantic.defaultMessage : inputMessage;
|
|
967
975
|
const resolvedAppendTo = _resolveAppendTarget(appendTo);
|
|
968
976
|
const resolvedAppContext = _resolveAppContext(optionAppContext || argumentAppContext);
|
|
969
977
|
const isChenghuaTheme = theme === "chenghua";
|
|
970
978
|
const isShijingshanTheme = theme === "shijingshan";
|
|
971
|
-
const variantOptions = variant === "delete" ? { title: "\u5220\u9664\u786E\u8BA4", confirmButtonText: "\u5220\u9664" } : variant === "warning" ? { title: "\u8B66\u544A" } : {};
|
|
972
979
|
const mergeOptions = {
|
|
973
|
-
title:
|
|
980
|
+
title: semantic.title,
|
|
974
981
|
draggable: true,
|
|
975
982
|
showCancelButton: true,
|
|
976
983
|
cancelButtonText: "\u53D6\u6D88",
|
|
977
|
-
confirmButtonText:
|
|
984
|
+
confirmButtonText: semantic.confirmButtonText,
|
|
978
985
|
dangerouslyUseHTMLString: true,
|
|
979
|
-
...variantOptions,
|
|
980
986
|
...messageBoxOptions,
|
|
981
987
|
appendTo: resolvedAppendTo,
|
|
982
988
|
appContext: resolvedAppContext,
|
|
@@ -1066,7 +1072,7 @@ function getVariable(propertyName, fallback = "") {
|
|
|
1066
1072
|
const DEFAULT_BUILD_TIME_FALLBACK = "\u672A\u6CE8\u5165";
|
|
1067
1073
|
function getUtilsBuildTime(fallback = DEFAULT_BUILD_TIME_FALLBACK) {
|
|
1068
1074
|
{
|
|
1069
|
-
return "2026-
|
|
1075
|
+
return "2026-09-03 15:20:19";
|
|
1070
1076
|
}
|
|
1071
1077
|
}
|
|
1072
1078
|
function test() {
|