@whitesev/pops 1.7.2 → 1.7.3

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.
@@ -3708,6 +3708,49 @@ System.register('pops', [], (function (exports) {
3708
3708
 
3709
3709
  var SVG_arrowLeft = "<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 1024 1024\">\r\n\t<path\r\n\t\td=\"M609.408 149.376 277.76 489.6a32 32 0 0 0 0 44.672l331.648 340.352a29.12 29.12 0 0 0 41.728 0 30.592 30.592 0 0 0 0-42.752L339.264 511.936l311.872-319.872a30.592 30.592 0 0 0 0-42.688 29.12 29.12 0 0 0-41.728 0z\"></path>\r\n</svg>\r\n";
3710
3710
 
3711
+ const GlobalConfig = {
3712
+ config: {},
3713
+ /**
3714
+ * 为所有弹窗设置全局属性
3715
+ */
3716
+ setGlobalConfig(config) {
3717
+ Reflect.ownKeys(config).forEach((keyName) => {
3718
+ Reflect.set(GlobalConfig.config, keyName, Reflect.get(config, keyName));
3719
+ });
3720
+ },
3721
+ /**
3722
+ * 获取全局配置
3723
+ */
3724
+ getGlobalConfig() {
3725
+ let result = {};
3726
+ let style = GlobalConfig.config.style == null
3727
+ ? ""
3728
+ : typeof GlobalConfig.config.style === "function"
3729
+ ? GlobalConfig.config.style()
3730
+ : GlobalConfig.config.style;
3731
+ if (typeof style === "string") {
3732
+ result.style = style;
3733
+ }
3734
+ let zIndex = GlobalConfig.config.zIndex == null
3735
+ ? ""
3736
+ : typeof GlobalConfig.config.zIndex === "function"
3737
+ ? GlobalConfig.config.zIndex()
3738
+ : GlobalConfig.config.zIndex;
3739
+ if (typeof zIndex === "string") {
3740
+ let newIndex = (zIndex = parseInt(zIndex));
3741
+ if (!isNaN(newIndex)) {
3742
+ result.zIndex = newIndex;
3743
+ }
3744
+ }
3745
+ else {
3746
+ if (!isNaN(zIndex)) {
3747
+ result.zIndex = zIndex;
3748
+ }
3749
+ }
3750
+ return result;
3751
+ },
3752
+ };
3753
+
3711
3754
  const PopsElementHandler = {
3712
3755
  /**
3713
3756
  * 获取遮罩层HTML
@@ -4514,6 +4557,7 @@ System.register('pops', [], (function (exports) {
4514
4557
  pops.config.cssText.alertCSS,
4515
4558
  ]);
4516
4559
  let config = PopsAlertConfig();
4560
+ config = popsUtils.assign(config, GlobalConfig.getGlobalConfig());
4517
4561
  config = popsUtils.assign(config, details);
4518
4562
  let guid = popsUtils.getRandomGUID();
4519
4563
  // 设置当前类型
@@ -4703,6 +4747,7 @@ System.register('pops', [], (function (exports) {
4703
4747
  pops.config.cssText.confirmCSS,
4704
4748
  ]);
4705
4749
  let config = PopsConfirmConfig();
4750
+ config = popsUtils.assign(config, GlobalConfig.getGlobalConfig());
4706
4751
  config = popsUtils.assign(config, details);
4707
4752
  let guid = popsUtils.getRandomGUID();
4708
4753
  // 设置当前类型
@@ -4902,6 +4947,7 @@ System.register('pops', [], (function (exports) {
4902
4947
  pops.config.cssText.promptCSS,
4903
4948
  ]);
4904
4949
  let config = PopsPromptConfig();
4950
+ config = popsUtils.assign(config, GlobalConfig.getGlobalConfig());
4905
4951
  config = popsUtils.assign(config, details);
4906
4952
  let guid = popsUtils.getRandomGUID();
4907
4953
  const PopsType = "prompt";
@@ -5034,6 +5080,7 @@ System.register('pops', [], (function (exports) {
5034
5080
  class PopsLoading {
5035
5081
  constructor(details) {
5036
5082
  let config = PopsLoadingConfig();
5083
+ config = popsUtils.assign(config, GlobalConfig.getGlobalConfig());
5037
5084
  config = popsUtils.assign(config, details);
5038
5085
  let guid = popsUtils.getRandomGUID();
5039
5086
  const PopsType = "loading";
@@ -5168,6 +5215,7 @@ System.register('pops', [], (function (exports) {
5168
5215
  pops.config.cssText.iframeCSS,
5169
5216
  ]);
5170
5217
  let config = PopsIframeConfig();
5218
+ config = popsUtils.assign(config, GlobalConfig.getGlobalConfig());
5171
5219
  config = popsUtils.assign(config, details);
5172
5220
  if (config.url == null) {
5173
5221
  throw "config.url不能为空";
@@ -5420,6 +5468,7 @@ System.register('pops', [], (function (exports) {
5420
5468
  pops.config.cssText.tooltipCSS,
5421
5469
  ]);
5422
5470
  let config = PopsTooltipConfig();
5471
+ config = popsUtils.assign(config, GlobalConfig.getGlobalConfig());
5423
5472
  config = popsUtils.assign(config, details);
5424
5473
  if (!(config.target instanceof HTMLElement)) {
5425
5474
  throw "config.target 必须是HTMLElement类型";
@@ -5760,6 +5809,7 @@ System.register('pops', [], (function (exports) {
5760
5809
  pops.config.cssText.drawerCSS,
5761
5810
  ]);
5762
5811
  let config = PopsDrawerConfig();
5812
+ config = popsUtils.assign(config, GlobalConfig.getGlobalConfig());
5763
5813
  config = popsUtils.assign(config, details);
5764
5814
  let guid = popsUtils.getRandomGUID();
5765
5815
  const PopsType = "drawer";
@@ -6098,6 +6148,8 @@ System.register('pops', [], (function (exports) {
6098
6148
  pops.config.cssText.folderCSS,
6099
6149
  ]);
6100
6150
  let config = PopsFolderConfig();
6151
+ config = popsUtils.assign(config, GlobalConfig.getGlobalConfig());
6152
+ config = popsUtils.assign(config, details);
6101
6153
  /* 办公几件套 */
6102
6154
  Folder_ICON.docx = Folder_ICON.doc;
6103
6155
  Folder_ICON.rtf = Folder_ICON.doc;
@@ -6151,7 +6203,6 @@ System.register('pops', [], (function (exports) {
6151
6203
  androidIconList.forEach((keyName) => {
6152
6204
  Folder_ICON[keyName] = Folder_ICON.apk;
6153
6205
  });
6154
- config = popsUtils.assign(config, details);
6155
6206
  if (details?.folder) {
6156
6207
  config.folder = details.folder;
6157
6208
  }
@@ -9634,6 +9685,7 @@ System.register('pops', [], (function (exports) {
9634
9685
  pops.config.cssText.panelCSS,
9635
9686
  ]);
9636
9687
  let config = PopsPanelConfig();
9688
+ config = popsUtils.assign(config, GlobalConfig.getGlobalConfig());
9637
9689
  config = popsUtils.assign(config, details);
9638
9690
  if (details && Array.isArray(details.content)) {
9639
9691
  config.content = details.content;
@@ -9871,6 +9923,7 @@ System.register('pops', [], (function (exports) {
9871
9923
  pops.config.cssText.rightClickMenu,
9872
9924
  ]);
9873
9925
  let config = rightClickMenuConfig();
9926
+ config = popsUtils.assign(config, GlobalConfig.getGlobalConfig());
9874
9927
  config = popsUtils.assign(config, details);
9875
9928
  if (config.target == null) {
9876
9929
  throw "config.target 不能为空";
@@ -10348,6 +10401,7 @@ System.register('pops', [], (function (exports) {
10348
10401
  pops.config.cssText.common,
10349
10402
  ]);
10350
10403
  let config = searchSuggestionConfig();
10404
+ config = popsUtils.assign(config, GlobalConfig.getGlobalConfig());
10351
10405
  config = popsUtils.assign(config, details);
10352
10406
  if (config.target == null) {
10353
10407
  throw new TypeError("config.target 不能为空");
@@ -11024,6 +11078,10 @@ System.register('pops', [], (function (exports) {
11024
11078
  isPhone(userAgent = PopsCore.globalThis.navigator.userAgent) {
11025
11079
  return Boolean(/(iPhone|iPad|iPod|iOS|Android)/i.test(userAgent));
11026
11080
  }
11081
+ /**
11082
+ * 为所有弹窗设置全局属性
11083
+ */
11084
+ GlobalConfig = GlobalConfig;
11027
11085
  /**
11028
11086
  * 普通信息框
11029
11087
  * @param details 配置