@sybz-components/utils 1.0.19 → 1.0.20

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 CHANGED
@@ -3,7 +3,7 @@
3
3
  require('vue');
4
4
  require('consola');
5
5
  require('es-toolkit');
6
- const format = require('./shared/utils.s3A3s_9I.cjs');
6
+ const format = require('./shared/utils.CpSVN1vj.cjs');
7
7
  require('./confirmSemantic.cjs');
8
8
  require('element-plus');
9
9
  require('axios');
package/dist/base.mjs CHANGED
@@ -1,7 +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.C6JV38T7.mjs';
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.C6u5wfj0.mjs';
5
5
  import './confirmSemantic.mjs';
6
6
  import 'element-plus';
7
7
  import 'axios';
package/dist/format.cjs CHANGED
@@ -1,6 +1,6 @@
1
1
  'use strict';
2
2
 
3
- const format = require('./shared/utils.s3A3s_9I.cjs');
3
+ const format = require('./shared/utils.CpSVN1vj.cjs');
4
4
  require('./is.cjs');
5
5
  require('consola');
6
6
  require('vue');
package/dist/format.mjs CHANGED
@@ -1,4 +1,4 @@
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.C6JV38T7.mjs';
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.C6u5wfj0.mjs';
2
2
  import './is.mjs';
3
3
  import 'consola';
4
4
  import 'vue';
package/dist/http.cjs CHANGED
@@ -1,7 +1,7 @@
1
1
  'use strict';
2
2
 
3
3
  require('axios');
4
- const format = require('./shared/utils.s3A3s_9I.cjs');
4
+ const format = require('./shared/utils.CpSVN1vj.cjs');
5
5
  require('vue');
6
6
  require('consola');
7
7
  require('es-toolkit');
package/dist/http.mjs CHANGED
@@ -1,5 +1,5 @@
1
1
  import 'axios';
2
- export { H as HttpError, G as configureHttp, I as createHttp, J as http } from './shared/utils.C6JV38T7.mjs';
2
+ export { H as HttpError, G as configureHttp, I as createHttp, J as http } from './shared/utils.C6u5wfj0.mjs';
3
3
  import 'vue';
4
4
  import 'consola';
5
5
  import 'es-toolkit';
package/dist/index.cjs CHANGED
@@ -1,6 +1,6 @@
1
1
  'use strict';
2
2
 
3
- const format = require('./shared/utils.s3A3s_9I.cjs');
3
+ const format = require('./shared/utils.CpSVN1vj.cjs');
4
4
  const confirmSemantic = require('./confirmSemantic.cjs');
5
5
  const is = require('./is.cjs');
6
6
  const theme = require('./theme.cjs');
package/dist/index.mjs CHANGED
@@ -1,4 +1,4 @@
1
- export { $ as $toast, H as HttpError, c as clearStorage, a as clone, G as configureHttp, b as configureUtils, d as confirm, e as copy, I as createHttp, 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, J as http, 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.C6JV38T7.mjs';
1
+ export { $ as $toast, H as HttpError, c as clearStorage, a as clone, G as configureHttp, b as configureUtils, d as confirm, e as copy, I as createHttp, 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, J as http, 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.C6u5wfj0.mjs';
2
2
  export { resolveConfirmSemantic } from './confirmSemantic.mjs';
3
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';
4
4
  export { SYBZ_THEME_PREFIX, isSybzTheme, resolveSybzComponentTheme } from './theme.mjs';
@@ -418,7 +418,8 @@ function $toast(message, type = "success", otherParams = {}) {
418
418
  }
419
419
  function showToast(options) {
420
420
  const { theme = utilsConfig.theme, customClass, iconAttrs, handlers, ...messageOptions } = options;
421
- const appComponents = _resolveAppContext(null)?.components;
421
+ const appContext = _resolveAppContext(null);
422
+ const appComponents = appContext?.components;
422
423
  if (typeof messageOptions.icon === "string") {
423
424
  const icon = appComponents?.SIcon ?? appComponents?.["s-icon"];
424
425
  if (icon) {
@@ -445,11 +446,13 @@ function $toast(message, type = "success", otherParams = {}) {
445
446
  customClass !== "el" && theme !== "default" && `s-antd-message--${theme}`,
446
447
  customClass !== "el" && customClass
447
448
  );
448
- ElMessage({
449
+ const resolvedMessageOptions = {
449
450
  ...messageOptions,
450
451
  showClose: options.showClose ?? true,
451
452
  customClass: resolvedCustomClass
452
- });
453
+ };
454
+ if (appContext) ElMessage(resolvedMessageOptions, appContext);
455
+ else ElMessage(resolvedMessageOptions);
453
456
  }
454
457
  if (isToastOptions(message)) {
455
458
  showToast(message);
@@ -1253,7 +1256,7 @@ function getVariable(propertyName, fallback = "") {
1253
1256
  const DEFAULT_BUILD_TIME_FALLBACK = "\u672A\u6CE8\u5165";
1254
1257
  function getUtilsBuildTime(fallback = DEFAULT_BUILD_TIME_FALLBACK) {
1255
1258
  {
1256
- return "2026-11-16 18:13:32";
1259
+ return "2026-11-20 11:05:15";
1257
1260
  }
1258
1261
  }
1259
1262
  function test() {
@@ -424,7 +424,8 @@ function $toast(message, type = "success", otherParams = {}) {
424
424
  }
425
425
  function showToast(options) {
426
426
  const { theme = utilsConfig.theme, customClass, iconAttrs, handlers, ...messageOptions } = options;
427
- const appComponents = _resolveAppContext(null)?.components;
427
+ const appContext = _resolveAppContext(null);
428
+ const appComponents = appContext?.components;
428
429
  if (typeof messageOptions.icon === "string") {
429
430
  const icon = appComponents?.SIcon ?? appComponents?.["s-icon"];
430
431
  if (icon) {
@@ -451,11 +452,13 @@ function $toast(message, type = "success", otherParams = {}) {
451
452
  customClass !== "el" && theme !== "default" && `s-antd-message--${theme}`,
452
453
  customClass !== "el" && customClass
453
454
  );
454
- elementPlus.ElMessage({
455
+ const resolvedMessageOptions = {
455
456
  ...messageOptions,
456
457
  showClose: options.showClose ?? true,
457
458
  customClass: resolvedCustomClass
458
- });
459
+ };
460
+ if (appContext) elementPlus.ElMessage(resolvedMessageOptions, appContext);
461
+ else elementPlus.ElMessage(resolvedMessageOptions);
459
462
  }
460
463
  if (isToastOptions(message)) {
461
464
  showToast(message);
@@ -1259,7 +1262,7 @@ function getVariable(propertyName, fallback = "") {
1259
1262
  const DEFAULT_BUILD_TIME_FALLBACK = "\u672A\u6CE8\u5165";
1260
1263
  function getUtilsBuildTime(fallback = DEFAULT_BUILD_TIME_FALLBACK) {
1261
1264
  {
1262
- return "2026-11-16 18:13:32";
1265
+ return "2026-11-20 11:05:15";
1263
1266
  }
1264
1267
  }
1265
1268
  function test() {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sybz-components/utils",
3
- "version": "1.0.19",
3
+ "version": "1.0.20",
4
4
  "description": "utils of sybz-components",
5
5
  "license": "MIT",
6
6
  "type": "commonjs",