knt-shared 1.9.1 → 1.10.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.
Files changed (38) hide show
  1. package/dist/components/CheckUpdate/index.d.ts +2 -0
  2. package/dist/components/CheckUpdate/index.d.ts.map +1 -0
  3. package/dist/components/CheckUpdate/index.vue.d.ts +60 -0
  4. package/dist/components/CheckUpdate/index.vue.d.ts.map +1 -0
  5. package/dist/components/Drawer/BasicDrawer.vue.d.ts +11 -11
  6. package/dist/components/Form/BasicForm.vue.d.ts +1 -1
  7. package/dist/components/Form/componentMap.d.ts +85 -55
  8. package/dist/components/Form/componentMap.d.ts.map +1 -1
  9. package/dist/components/Form/components/ApiCascader.vue.d.ts +2 -2
  10. package/dist/components/Form/components/ApiSelect.vue.d.ts +2 -2
  11. package/dist/components/Image/BasicImage.vue.d.ts +2 -2
  12. package/dist/components/Modal/BasicModal.vue.d.ts +12 -12
  13. package/dist/components/Table/BasicTable.vue.d.ts +5 -5
  14. package/dist/components/Table/components/componentMap.d.ts +85 -55
  15. package/dist/components/Table/components/componentMap.d.ts.map +1 -1
  16. package/dist/components/Upload/BasicUpload.vue.d.ts +10 -4
  17. package/dist/components/Upload/BasicUpload.vue.d.ts.map +1 -1
  18. package/dist/components/Upload/components/SortableFileItem.vue.d.ts +2 -2
  19. package/dist/components/Upload/components/VideoPreview.vue.d.ts +4 -4
  20. package/dist/components/Upload/components/VideoPreviewModal.vue.d.ts +3 -3
  21. package/dist/components/Upload/types.d.ts +4 -0
  22. package/dist/components/Upload/types.d.ts.map +1 -1
  23. package/dist/components/index.d.ts +1 -0
  24. package/dist/components/index.d.ts.map +1 -1
  25. package/dist/hooks/index.d.ts +2 -0
  26. package/dist/hooks/index.d.ts.map +1 -1
  27. package/dist/hooks/useVersionCheck.d.ts +19 -0
  28. package/dist/hooks/useVersionCheck.d.ts.map +1 -0
  29. package/dist/index.cjs.js +236 -92
  30. package/dist/index.cjs.js.map +1 -1
  31. package/dist/index.esm.js +237 -93
  32. package/dist/index.esm.js.map +1 -1
  33. package/dist/style.css +32 -32
  34. package/dist/utils/chunkErrorHandler.d.ts +2 -0
  35. package/dist/utils/chunkErrorHandler.d.ts.map +1 -0
  36. package/dist/utils/index.d.ts +1 -0
  37. package/dist/utils/index.d.ts.map +1 -1
  38. package/package.json +1 -1
package/dist/index.esm.js CHANGED
@@ -22,7 +22,7 @@ var _export_sfc$1 = (sfc, props) => {
22
22
  }
23
23
  return sfc;
24
24
  };
25
- const _sfc_main$z = defineComponent({
25
+ const _sfc_main$A = defineComponent({
26
26
  name: "IconPlus",
27
27
  props: {
28
28
  size: {
@@ -92,7 +92,7 @@ function _sfc_render$g(_ctx, _cache, $props, $setup, $data, $options) {
92
92
  createElementVNode("path", { d: "M5 24h38M24 5v38" }, null, -1)
93
93
  ]), 14, _hoisted_1$u);
94
94
  }
95
- var _IconPlus = /* @__PURE__ */ _export_sfc$1(_sfc_main$z, [["render", _sfc_render$g]]);
95
+ var _IconPlus = /* @__PURE__ */ _export_sfc$1(_sfc_main$A, [["render", _sfc_render$g]]);
96
96
  const IconPlus = Object.assign(_IconPlus, {
97
97
  install: (app, options) => {
98
98
  var _a;
@@ -100,7 +100,7 @@ const IconPlus = Object.assign(_IconPlus, {
100
100
  app.component(iconPrefix + _IconPlus.name, _IconPlus);
101
101
  }
102
102
  });
103
- const _sfc_main$y = defineComponent({
103
+ const _sfc_main$z = defineComponent({
104
104
  name: "IconQuestionCircle",
105
105
  props: {
106
106
  size: {
@@ -171,7 +171,7 @@ function _sfc_render$f(_ctx, _cache, $props, $setup, $data, $options) {
171
171
  createElementVNode("path", { d: "M24.006 31v4.008m0-6.008L24 28c0-3 3-4 4.78-6.402C30.558 19.195 28.288 15 23.987 15c-4.014 0-5.382 2.548-5.388 4.514v.465" }, null, -1)
172
172
  ]), 14, _hoisted_1$t);
173
173
  }
174
- var _IconQuestionCircle = /* @__PURE__ */ _export_sfc$1(_sfc_main$y, [["render", _sfc_render$f]]);
174
+ var _IconQuestionCircle = /* @__PURE__ */ _export_sfc$1(_sfc_main$z, [["render", _sfc_render$f]]);
175
175
  const IconQuestionCircle = Object.assign(_IconQuestionCircle, {
176
176
  install: (app, options) => {
177
177
  var _a;
@@ -179,7 +179,7 @@ const IconQuestionCircle = Object.assign(_IconQuestionCircle, {
179
179
  app.component(iconPrefix + _IconQuestionCircle.name, _IconQuestionCircle);
180
180
  }
181
181
  });
182
- const _sfc_main$x = defineComponent({
182
+ const _sfc_main$y = defineComponent({
183
183
  name: "IconEye",
184
184
  props: {
185
185
  size: {
@@ -253,7 +253,7 @@ function _sfc_render$e(_ctx, _cache, $props, $setup, $data, $options) {
253
253
  createElementVNode("path", { d: "M29 24a5 5 0 1 1-10 0 5 5 0 0 1 10 0Z" }, null, -1)
254
254
  ]), 14, _hoisted_1$s);
255
255
  }
256
- var _IconEye = /* @__PURE__ */ _export_sfc$1(_sfc_main$x, [["render", _sfc_render$e]]);
256
+ var _IconEye = /* @__PURE__ */ _export_sfc$1(_sfc_main$y, [["render", _sfc_render$e]]);
257
257
  const IconEye = Object.assign(_IconEye, {
258
258
  install: (app, options) => {
259
259
  var _a;
@@ -261,7 +261,7 @@ const IconEye = Object.assign(_IconEye, {
261
261
  app.component(iconPrefix + _IconEye.name, _IconEye);
262
262
  }
263
263
  });
264
- const _sfc_main$w = defineComponent({
264
+ const _sfc_main$x = defineComponent({
265
265
  name: "IconMore",
266
266
  props: {
267
267
  size: {
@@ -336,7 +336,7 @@ function _sfc_render$d(_ctx, _cache, $props, $setup, $data, $options) {
336
336
  createElementVNode("path", { d: "M38 25v-2h2v2h-2ZM23 25v-2h2v2h-2ZM8 25v-2h2v2H8Z" }, null, -1)
337
337
  ]), 14, _hoisted_1$r);
338
338
  }
339
- var _IconMore = /* @__PURE__ */ _export_sfc$1(_sfc_main$w, [["render", _sfc_render$d]]);
339
+ var _IconMore = /* @__PURE__ */ _export_sfc$1(_sfc_main$x, [["render", _sfc_render$d]]);
340
340
  const IconMore = Object.assign(_IconMore, {
341
341
  install: (app, options) => {
342
342
  var _a;
@@ -344,7 +344,7 @@ const IconMore = Object.assign(_IconMore, {
344
344
  app.component(iconPrefix + _IconMore.name, _IconMore);
345
345
  }
346
346
  });
347
- const _sfc_main$v = defineComponent({
347
+ const _sfc_main$w = defineComponent({
348
348
  name: "IconRefresh",
349
349
  props: {
350
350
  size: {
@@ -414,7 +414,7 @@ function _sfc_render$c(_ctx, _cache, $props, $setup, $data, $options) {
414
414
  createElementVNode("path", { d: "M38.837 18C36.463 12.136 30.715 8 24 8 15.163 8 8 15.163 8 24s7.163 16 16 16c7.455 0 13.72-5.1 15.496-12M40 8v10H30" }, null, -1)
415
415
  ]), 14, _hoisted_1$q);
416
416
  }
417
- var _IconRefresh = /* @__PURE__ */ _export_sfc$1(_sfc_main$v, [["render", _sfc_render$c]]);
417
+ var _IconRefresh = /* @__PURE__ */ _export_sfc$1(_sfc_main$w, [["render", _sfc_render$c]]);
418
418
  const IconRefresh = Object.assign(_IconRefresh, {
419
419
  install: (app, options) => {
420
420
  var _a;
@@ -422,7 +422,7 @@ const IconRefresh = Object.assign(_IconRefresh, {
422
422
  app.component(iconPrefix + _IconRefresh.name, _IconRefresh);
423
423
  }
424
424
  });
425
- const _sfc_main$u = defineComponent({
425
+ const _sfc_main$v = defineComponent({
426
426
  name: "IconSearch",
427
427
  props: {
428
428
  size: {
@@ -492,7 +492,7 @@ function _sfc_render$b(_ctx, _cache, $props, $setup, $data, $options) {
492
492
  createElementVNode("path", { d: "M33.072 33.071c6.248-6.248 6.248-16.379 0-22.627-6.249-6.249-16.38-6.249-22.628 0-6.248 6.248-6.248 16.379 0 22.627 6.248 6.248 16.38 6.248 22.628 0Zm0 0 8.485 8.485" }, null, -1)
493
493
  ]), 14, _hoisted_1$p);
494
494
  }
495
- var _IconSearch = /* @__PURE__ */ _export_sfc$1(_sfc_main$u, [["render", _sfc_render$b]]);
495
+ var _IconSearch = /* @__PURE__ */ _export_sfc$1(_sfc_main$v, [["render", _sfc_render$b]]);
496
496
  const IconSearch = Object.assign(_IconSearch, {
497
497
  install: (app, options) => {
498
498
  var _a;
@@ -500,7 +500,7 @@ const IconSearch = Object.assign(_IconSearch, {
500
500
  app.component(iconPrefix + _IconSearch.name, _IconSearch);
501
501
  }
502
502
  });
503
- const _sfc_main$t = defineComponent({
503
+ const _sfc_main$u = defineComponent({
504
504
  name: "IconSettings",
505
505
  props: {
506
506
  size: {
@@ -571,7 +571,7 @@ function _sfc_render$a(_ctx, _cache, $props, $setup, $data, $options) {
571
571
  createElementVNode("path", { d: "M30 24a6 6 0 1 1-12 0 6 6 0 0 1 12 0Z" }, null, -1)
572
572
  ]), 14, _hoisted_1$o);
573
573
  }
574
- var _IconSettings = /* @__PURE__ */ _export_sfc$1(_sfc_main$t, [["render", _sfc_render$a]]);
574
+ var _IconSettings = /* @__PURE__ */ _export_sfc$1(_sfc_main$u, [["render", _sfc_render$a]]);
575
575
  const IconSettings = Object.assign(_IconSettings, {
576
576
  install: (app, options) => {
577
577
  var _a;
@@ -579,7 +579,7 @@ const IconSettings = Object.assign(_IconSettings, {
579
579
  app.component(iconPrefix + _IconSettings.name, _IconSettings);
580
580
  }
581
581
  });
582
- const _sfc_main$s = defineComponent({
582
+ const _sfc_main$t = defineComponent({
583
583
  name: "IconUpload",
584
584
  props: {
585
585
  size: {
@@ -649,7 +649,7 @@ function _sfc_render$9(_ctx, _cache, $props, $setup, $data, $options) {
649
649
  createElementVNode("path", { d: "M14.93 17.071 24.001 8l9.071 9.071m-9.07 16.071v-25M40 35v6H8v-6" }, null, -1)
650
650
  ]), 14, _hoisted_1$n);
651
651
  }
652
- var _IconUpload = /* @__PURE__ */ _export_sfc$1(_sfc_main$s, [["render", _sfc_render$9]]);
652
+ var _IconUpload = /* @__PURE__ */ _export_sfc$1(_sfc_main$t, [["render", _sfc_render$9]]);
653
653
  const IconUpload = Object.assign(_IconUpload, {
654
654
  install: (app, options) => {
655
655
  var _a;
@@ -657,7 +657,7 @@ const IconUpload = Object.assign(_IconUpload, {
657
657
  app.component(iconPrefix + _IconUpload.name, _IconUpload);
658
658
  }
659
659
  });
660
- const _sfc_main$r = defineComponent({
660
+ const _sfc_main$s = defineComponent({
661
661
  name: "IconDelete",
662
662
  props: {
663
663
  size: {
@@ -727,7 +727,7 @@ function _sfc_render$8(_ctx, _cache, $props, $setup, $data, $options) {
727
727
  createElementVNode("path", { d: "M5 11h5.5m0 0v29a1 1 0 0 0 1 1h25a1 1 0 0 0 1-1V11m-27 0H16m21.5 0H43m-5.5 0H32m-16 0V7h16v4m-16 0h16M20 18v15m8-15v15" }, null, -1)
728
728
  ]), 14, _hoisted_1$m);
729
729
  }
730
- var _IconDelete = /* @__PURE__ */ _export_sfc$1(_sfc_main$r, [["render", _sfc_render$8]]);
730
+ var _IconDelete = /* @__PURE__ */ _export_sfc$1(_sfc_main$s, [["render", _sfc_render$8]]);
731
731
  const IconDelete = Object.assign(_IconDelete, {
732
732
  install: (app, options) => {
733
733
  var _a;
@@ -735,7 +735,7 @@ const IconDelete = Object.assign(_IconDelete, {
735
735
  app.component(iconPrefix + _IconDelete.name, _IconDelete);
736
736
  }
737
737
  });
738
- const _sfc_main$q = defineComponent({
738
+ const _sfc_main$r = defineComponent({
739
739
  name: "IconLineHeight",
740
740
  props: {
741
741
  size: {
@@ -811,7 +811,7 @@ function _sfc_render$7(_ctx, _cache, $props, $setup, $data, $options) {
811
811
  createElementVNode("path", { d: "M39 13h2l-2-3.5-2 3.5h2Zm0 0v22m0 0h2l-2 3.5-2-3.5h2Z" }, null, -1)
812
812
  ]), 14, _hoisted_1$l);
813
813
  }
814
- var _IconLineHeight = /* @__PURE__ */ _export_sfc$1(_sfc_main$q, [["render", _sfc_render$7]]);
814
+ var _IconLineHeight = /* @__PURE__ */ _export_sfc$1(_sfc_main$r, [["render", _sfc_render$7]]);
815
815
  const IconLineHeight = Object.assign(_IconLineHeight, {
816
816
  install: (app, options) => {
817
817
  var _a;
@@ -819,7 +819,7 @@ const IconLineHeight = Object.assign(_IconLineHeight, {
819
819
  app.component(iconPrefix + _IconLineHeight.name, _IconLineHeight);
820
820
  }
821
821
  });
822
- const _sfc_main$p = defineComponent({
822
+ const _sfc_main$q = defineComponent({
823
823
  name: "IconFullscreenExit",
824
824
  props: {
825
825
  size: {
@@ -889,7 +889,7 @@ function _sfc_render$6(_ctx, _cache, $props, $setup, $data, $options) {
889
889
  createElementVNode("path", { d: "M35 6v8a1 1 0 0 0 1 1h8M13 6v8a1 1 0 0 1-1 1H4m31 27v-8a1 1 0 0 1 1-1h8m-31 9v-8a1 1 0 0 0-1-1H4" }, null, -1)
890
890
  ]), 14, _hoisted_1$k);
891
891
  }
892
- var _IconFullscreenExit = /* @__PURE__ */ _export_sfc$1(_sfc_main$p, [["render", _sfc_render$6]]);
892
+ var _IconFullscreenExit = /* @__PURE__ */ _export_sfc$1(_sfc_main$q, [["render", _sfc_render$6]]);
893
893
  const IconFullscreenExit = Object.assign(_IconFullscreenExit, {
894
894
  install: (app, options) => {
895
895
  var _a;
@@ -897,7 +897,7 @@ const IconFullscreenExit = Object.assign(_IconFullscreenExit, {
897
897
  app.component(iconPrefix + _IconFullscreenExit.name, _IconFullscreenExit);
898
898
  }
899
899
  });
900
- const _sfc_main$o = defineComponent({
900
+ const _sfc_main$p = defineComponent({
901
901
  name: "IconFullscreen",
902
902
  props: {
903
903
  size: {
@@ -967,7 +967,7 @@ function _sfc_render$5(_ctx, _cache, $props, $setup, $data, $options) {
967
967
  createElementVNode("path", { d: "M42 17V9a1 1 0 0 0-1-1h-8M6 17V9a1 1 0 0 1 1-1h8m27 23v8a1 1 0 0 1-1 1h-8M6 31v8a1 1 0 0 0 1 1h8" }, null, -1)
968
968
  ]), 14, _hoisted_1$j);
969
969
  }
970
- var _IconFullscreen = /* @__PURE__ */ _export_sfc$1(_sfc_main$o, [["render", _sfc_render$5]]);
970
+ var _IconFullscreen = /* @__PURE__ */ _export_sfc$1(_sfc_main$p, [["render", _sfc_render$5]]);
971
971
  const IconFullscreen = Object.assign(_IconFullscreen, {
972
972
  install: (app, options) => {
973
973
  var _a;
@@ -975,7 +975,7 @@ const IconFullscreen = Object.assign(_IconFullscreen, {
975
975
  app.component(iconPrefix + _IconFullscreen.name, _IconFullscreen);
976
976
  }
977
977
  });
978
- const _sfc_main$n = defineComponent({
978
+ const _sfc_main$o = defineComponent({
979
979
  name: "IconMute",
980
980
  props: {
981
981
  size: {
@@ -1045,7 +1045,7 @@ function _sfc_render$4(_ctx, _cache, $props, $setup, $data, $options) {
1045
1045
  createElementVNode("path", { d: "m19 11.5 4.833-4.35a.1.1 0 0 1 .167.075V17m-14-1H7.1a.1.1 0 0 0-.1.1v15.8a.1.1 0 0 0 .1.1H14l9.833 8.85a.1.1 0 0 0 .167-.075V31m6.071-14.071C32.535 19.393 34 23 32.799 26m2.929-14.728C41.508 17.052 42.5 25 39.123 32M6.5 6.5l35 35" }, null, -1)
1046
1046
  ]), 14, _hoisted_1$i);
1047
1047
  }
1048
- var _IconMute = /* @__PURE__ */ _export_sfc$1(_sfc_main$n, [["render", _sfc_render$4]]);
1048
+ var _IconMute = /* @__PURE__ */ _export_sfc$1(_sfc_main$o, [["render", _sfc_render$4]]);
1049
1049
  const IconMute = Object.assign(_IconMute, {
1050
1050
  install: (app, options) => {
1051
1051
  var _a;
@@ -1053,7 +1053,7 @@ const IconMute = Object.assign(_IconMute, {
1053
1053
  app.component(iconPrefix + _IconMute.name, _IconMute);
1054
1054
  }
1055
1055
  });
1056
- const _sfc_main$m = defineComponent({
1056
+ const _sfc_main$n = defineComponent({
1057
1057
  name: "IconPause",
1058
1058
  props: {
1059
1059
  size: {
@@ -1128,7 +1128,7 @@ function _sfc_render$3(_ctx, _cache, $props, $setup, $data, $options) {
1128
1128
  }, null, -1)
1129
1129
  ]), 14, _hoisted_1$h);
1130
1130
  }
1131
- var _IconPause = /* @__PURE__ */ _export_sfc$1(_sfc_main$m, [["render", _sfc_render$3]]);
1131
+ var _IconPause = /* @__PURE__ */ _export_sfc$1(_sfc_main$n, [["render", _sfc_render$3]]);
1132
1132
  const IconPause = Object.assign(_IconPause, {
1133
1133
  install: (app, options) => {
1134
1134
  var _a;
@@ -1136,7 +1136,7 @@ const IconPause = Object.assign(_IconPause, {
1136
1136
  app.component(iconPrefix + _IconPause.name, _IconPause);
1137
1137
  }
1138
1138
  });
1139
- const _sfc_main$l = defineComponent({
1139
+ const _sfc_main$m = defineComponent({
1140
1140
  name: "IconPlayArrow",
1141
1141
  props: {
1142
1142
  size: {
@@ -1206,7 +1206,7 @@ function _sfc_render$2(_ctx, _cache, $props, $setup, $data, $options) {
1206
1206
  createElementVNode("path", { d: "M12.533 7.965A1 1 0 0 0 11 8.81v30.377a1 1 0 0 0 1.533.846L36.656 24.84a1 1 0 0 0 0-1.692L12.533 7.965Z" }, null, -1)
1207
1207
  ]), 14, _hoisted_1$g);
1208
1208
  }
1209
- var _IconPlayArrow = /* @__PURE__ */ _export_sfc$1(_sfc_main$l, [["render", _sfc_render$2]]);
1209
+ var _IconPlayArrow = /* @__PURE__ */ _export_sfc$1(_sfc_main$m, [["render", _sfc_render$2]]);
1210
1210
  const IconPlayArrow = Object.assign(_IconPlayArrow, {
1211
1211
  install: (app, options) => {
1212
1212
  var _a;
@@ -1214,7 +1214,7 @@ const IconPlayArrow = Object.assign(_IconPlayArrow, {
1214
1214
  app.component(iconPrefix + _IconPlayArrow.name, _IconPlayArrow);
1215
1215
  }
1216
1216
  });
1217
- const _sfc_main$k = defineComponent({
1217
+ const _sfc_main$l = defineComponent({
1218
1218
  name: "IconSound",
1219
1219
  props: {
1220
1220
  size: {
@@ -1285,7 +1285,7 @@ function _sfc_render$1(_ctx, _cache, $props, $setup, $data, $options) {
1285
1285
  createElementVNode("path", { d: "M31.071 16.929c3.905 3.905 3.905 10.237 0 14.142M36.727 11.272c7.03 7.03 7.03 18.426 0 25.456" }, null, -1)
1286
1286
  ]), 14, _hoisted_1$f);
1287
1287
  }
1288
- var _IconSound = /* @__PURE__ */ _export_sfc$1(_sfc_main$k, [["render", _sfc_render$1]]);
1288
+ var _IconSound = /* @__PURE__ */ _export_sfc$1(_sfc_main$l, [["render", _sfc_render$1]]);
1289
1289
  const IconSound = Object.assign(_IconSound, {
1290
1290
  install: (app, options) => {
1291
1291
  var _a;
@@ -1293,7 +1293,7 @@ const IconSound = Object.assign(_IconSound, {
1293
1293
  app.component(iconPrefix + _IconSound.name, _IconSound);
1294
1294
  }
1295
1295
  });
1296
- const _sfc_main$j = defineComponent({
1296
+ const _sfc_main$k = defineComponent({
1297
1297
  name: "IconLoading",
1298
1298
  props: {
1299
1299
  size: {
@@ -1363,7 +1363,7 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
1363
1363
  createElementVNode("path", { d: "M42 24c0 9.941-8.059 18-18 18S6 33.941 6 24 14.059 6 24 6" }, null, -1)
1364
1364
  ]), 14, _hoisted_1$e);
1365
1365
  }
1366
- var _IconLoading = /* @__PURE__ */ _export_sfc$1(_sfc_main$j, [["render", _sfc_render]]);
1366
+ var _IconLoading = /* @__PURE__ */ _export_sfc$1(_sfc_main$k, [["render", _sfc_render]]);
1367
1367
  const IconLoading = Object.assign(_IconLoading, {
1368
1368
  install: (app, options) => {
1369
1369
  var _a;
@@ -2196,6 +2196,23 @@ function subtractLight(color, amount) {
2196
2196
  const c = cc < 0 ? 0 : cc;
2197
2197
  return c.toString(16).length > 1 ? c.toString(16) : `0${c.toString(16)}`;
2198
2198
  }
2199
+ const RELOAD_KEY = "vite_chunk_reload_at";
2200
+ const COOLDOWN_MS = 1e4;
2201
+ function isChunkLoadError(error) {
2202
+ var _a, _b;
2203
+ return ((_a = error == null ? void 0 : error.message) == null ? void 0 : _a.includes("Failed to fetch dynamically imported module")) || ((_b = error == null ? void 0 : error.message) == null ? void 0 : _b.includes("Importing a module script failed")) || (error == null ? void 0 : error.name) === "ChunkLoadError";
2204
+ }
2205
+ function setupChunkErrorHandler() {
2206
+ window.addEventListener("unhandledrejection", (event) => {
2207
+ if (!isChunkLoadError(event.reason)) return;
2208
+ const lastReloadAt = Number(sessionStorage.getItem(RELOAD_KEY) || 0);
2209
+ const now = Date.now();
2210
+ if (now - lastReloadAt > COOLDOWN_MS) {
2211
+ sessionStorage.setItem(RELOAD_KEY, String(now));
2212
+ window.location.reload();
2213
+ }
2214
+ });
2215
+ }
2199
2216
  const _hoisted_1$d = ["draggable"];
2200
2217
  const _hoisted_2$9 = ["src", "alt"];
2201
2218
  const _hoisted_3$7 = {
@@ -2211,7 +2228,7 @@ const _hoisted_6$4 = {
2211
2228
  key: 3,
2212
2229
  class: "error-tip"
2213
2230
  };
2214
- const _sfc_main$i = /* @__PURE__ */ defineComponent({
2231
+ const _sfc_main$j = /* @__PURE__ */ defineComponent({
2215
2232
  ...{
2216
2233
  name: "SortableFileItem"
2217
2234
  },
@@ -2322,9 +2339,9 @@ const _export_sfc = (sfc, props) => {
2322
2339
  }
2323
2340
  return target;
2324
2341
  };
2325
- const SortableFileItem = /* @__PURE__ */ _export_sfc(_sfc_main$i, [["__scopeId", "data-v-07a9ff47"]]);
2342
+ const SortableFileItem = /* @__PURE__ */ _export_sfc(_sfc_main$j, [["__scopeId", "data-v-07a9ff47"]]);
2326
2343
  const _hoisted_1$c = { class: "sortable-file-list" };
2327
- const _sfc_main$h = /* @__PURE__ */ defineComponent({
2344
+ const _sfc_main$i = /* @__PURE__ */ defineComponent({
2328
2345
  ...{
2329
2346
  name: "SortableFileList"
2330
2347
  },
@@ -2409,7 +2426,7 @@ const _sfc_main$h = /* @__PURE__ */ defineComponent({
2409
2426
  };
2410
2427
  }
2411
2428
  });
2412
- const SortableFileList = /* @__PURE__ */ _export_sfc(_sfc_main$h, [["__scopeId", "data-v-1ede8f45"]]);
2429
+ const SortableFileList = /* @__PURE__ */ _export_sfc(_sfc_main$i, [["__scopeId", "data-v-1ede8f45"]]);
2413
2430
  const _hoisted_1$b = ["src", "autoplay", "loop", "muted", "preload"];
2414
2431
  const _hoisted_2$8 = {
2415
2432
  key: 0,
@@ -2427,7 +2444,7 @@ const _hoisted_8$1 = { class: "volume-slider-container" };
2427
2444
  const _hoisted_9 = { class: "time-display" };
2428
2445
  const _hoisted_10 = { class: "controls-right" };
2429
2446
  const _hoisted_11 = { class: "control-button" };
2430
- const _sfc_main$g = /* @__PURE__ */ defineComponent({
2447
+ const _sfc_main$h = /* @__PURE__ */ defineComponent({
2431
2448
  ...{
2432
2449
  name: "VideoPreview"
2433
2450
  },
@@ -2773,11 +2790,11 @@ const _sfc_main$g = /* @__PURE__ */ defineComponent({
2773
2790
  };
2774
2791
  }
2775
2792
  });
2776
- const VideoPreview = /* @__PURE__ */ _export_sfc(_sfc_main$g, [["__scopeId", "data-v-b982f870"]]);
2793
+ const VideoPreview = /* @__PURE__ */ _export_sfc(_sfc_main$h, [["__scopeId", "data-v-b982f870"]]);
2777
2794
  const _hoisted_1$a = { class: "video-modal-title" };
2778
2795
  const _hoisted_2$7 = { class: "file-name" };
2779
2796
  const _hoisted_3$5 = { class: "video-modal-content" };
2780
- const _sfc_main$f = /* @__PURE__ */ defineComponent({
2797
+ const _sfc_main$g = /* @__PURE__ */ defineComponent({
2781
2798
  ...{
2782
2799
  name: "VideoPreviewModal"
2783
2800
  },
@@ -2848,7 +2865,7 @@ const _sfc_main$f = /* @__PURE__ */ defineComponent({
2848
2865
  };
2849
2866
  }
2850
2867
  });
2851
- const VideoPreviewModal = /* @__PURE__ */ _export_sfc(_sfc_main$f, [["__scopeId", "data-v-cac8e63e"]]);
2868
+ const VideoPreviewModal = /* @__PURE__ */ _export_sfc(_sfc_main$g, [["__scopeId", "data-v-cac8e63e"]]);
2852
2869
  const _hoisted_1$9 = { class: "basic-upload" };
2853
2870
  const _hoisted_2$6 = {
2854
2871
  key: 0,
@@ -2875,7 +2892,7 @@ const _hoisted_8 = {
2875
2892
  key: 5,
2876
2893
  class: "inline-video-preview"
2877
2894
  };
2878
- const _sfc_main$e = /* @__PURE__ */ defineComponent({
2895
+ const _sfc_main$f = /* @__PURE__ */ defineComponent({
2879
2896
  ...{
2880
2897
  name: "BasicUpload",
2881
2898
  inheritAttrs: false
@@ -2932,12 +2949,14 @@ const _sfc_main$e = /* @__PURE__ */ defineComponent({
2932
2949
  preload: "metadata"
2933
2950
  }) },
2934
2951
  emptyText: { default: "-" },
2935
- showEmptyState: { type: Boolean, default: true }
2952
+ showEmptyState: { type: Boolean, default: true },
2953
+ showErrorMessage: { type: Boolean, default: true },
2954
+ showSuccessMessage: { type: Boolean, default: true }
2936
2955
  },
2937
2956
  emits: ["register", "update:modelValue", "change", "success", "handleSuccess", "error", "handlError", "progress", "remove", "preview", "exceed", "sortChange"],
2938
2957
  setup(__props, { expose: __expose, emit: __emit }) {
2939
2958
  useCssVars((_ctx) => ({
2940
- "f72d42ee": cardSizeValue.value
2959
+ "fa001152": cardSizeValue.value
2941
2960
  }));
2942
2961
  const MAX_SIZE_UNIT_BYTES = {
2943
2962
  B: 1,
@@ -3171,7 +3190,7 @@ const _sfc_main$e = /* @__PURE__ */ defineComponent({
3171
3190
  if (code !== 200) {
3172
3191
  const errorMsg = message ? `上传失败: ${message}` : "上传失败";
3173
3192
  onError(new Error(errorMsg));
3174
- Message.error(errorMsg);
3193
+ if (propsData.showErrorMessage) Message.error(errorMsg);
3175
3194
  return;
3176
3195
  }
3177
3196
  const extractedUrl = extractUrlFromResponse(response);
@@ -3179,14 +3198,14 @@ const _sfc_main$e = /* @__PURE__ */ defineComponent({
3179
3198
  if (!extractedUrl) {
3180
3199
  logger.warn("响应中未找到 URL 字段,可能导致上传状态异常");
3181
3200
  }
3182
- Message.success(`${fileItem.name} 上传成功`);
3201
+ if (propsData.showSuccessMessage) Message.success(`${fileItem.name} 上传成功`);
3183
3202
  onSuccess(normalizedResponse);
3184
3203
  } catch (error) {
3185
3204
  onSuccess({ data: xhr.responseText });
3186
3205
  }
3187
3206
  } else {
3188
3207
  const errorMsg = `上传失败: HTTP ${xhr.status}`;
3189
- Message.error(errorMsg);
3208
+ if (propsData.showErrorMessage) Message.error(errorMsg);
3190
3209
  onError(new Error(errorMsg));
3191
3210
  }
3192
3211
  });
@@ -3592,7 +3611,7 @@ const _sfc_main$e = /* @__PURE__ */ defineComponent({
3592
3611
  };
3593
3612
  }
3594
3613
  });
3595
- const BasicUpload = /* @__PURE__ */ _export_sfc(_sfc_main$e, [["__scopeId", "data-v-13e8439f"]]);
3614
+ const BasicUpload = /* @__PURE__ */ _export_sfc(_sfc_main$f, [["__scopeId", "data-v-47c7dc74"]]);
3596
3615
  function useUpload(props) {
3597
3616
  const uploadRef = ref(null);
3598
3617
  const fileListRef = ref((props == null ? void 0 : props.defaultFileList) || []);
@@ -3738,7 +3757,7 @@ function useApiRequest(options) {
3738
3757
  const data = ref([]);
3739
3758
  const isFirstLoad = ref(true);
3740
3759
  const error = ref(null);
3741
- async function fetch(forceRefresh = false) {
3760
+ async function fetch2(forceRefresh = false) {
3742
3761
  if (!api || typeof api !== "function") {
3743
3762
  console.warn("[useApiRequest] api 必须是一个函数");
3744
3763
  return;
@@ -3790,7 +3809,7 @@ function useApiRequest(options) {
3790
3809
  loading.value = false;
3791
3810
  }
3792
3811
  }
3793
- const debouncedFetch = debounce(fetch, debounceTime);
3812
+ const debouncedFetch = debounce(fetch2, debounceTime);
3794
3813
  let stopParamsWatch = null;
3795
3814
  if (params) {
3796
3815
  stopParamsWatch = watch(
@@ -3804,7 +3823,7 @@ function useApiRequest(options) {
3804
3823
  );
3805
3824
  }
3806
3825
  if (immediate) {
3807
- fetch();
3826
+ fetch2();
3808
3827
  }
3809
3828
  if (immediate) {
3810
3829
  isFirstLoad.value = false;
@@ -3826,9 +3845,9 @@ function useApiRequest(options) {
3826
3845
  /** 是否首次加载 */
3827
3846
  isFirstLoad,
3828
3847
  /** 执行请求 */
3829
- fetch,
3848
+ fetch: fetch2,
3830
3849
  /** 刷新数据(忽略缓存) */
3831
- refresh: () => fetch(true)
3850
+ refresh: () => fetch2(true)
3832
3851
  };
3833
3852
  }
3834
3853
  function clearAllCache() {
@@ -3838,7 +3857,7 @@ function clearApiCache(api, params) {
3838
3857
  const cacheKey = getCacheKey(api, params);
3839
3858
  cacheMap.delete(cacheKey);
3840
3859
  }
3841
- const _sfc_main$d = /* @__PURE__ */ defineComponent({
3860
+ const _sfc_main$e = /* @__PURE__ */ defineComponent({
3842
3861
  __name: "ApiSelect",
3843
3862
  props: {
3844
3863
  modelValue: {},
@@ -3862,7 +3881,7 @@ const _sfc_main$d = /* @__PURE__ */ defineComponent({
3862
3881
  const emit = __emit;
3863
3882
  const state = ref(props.modelValue);
3864
3883
  const rawOptions = ref([]);
3865
- const { loading, data, isFirstLoad, fetch } = useApiRequest({
3884
+ const { loading, data, isFirstLoad, fetch: fetch2 } = useApiRequest({
3866
3885
  api: props.api,
3867
3886
  params: toRef(props, "params"),
3868
3887
  immediate: props.immediate,
@@ -3891,9 +3910,9 @@ const _sfc_main$d = /* @__PURE__ */ defineComponent({
3891
3910
  const handlePopupVisibleChange = async (visible) => {
3892
3911
  if (!visible) return;
3893
3912
  if (props.alwaysLoad) {
3894
- await fetch(true);
3913
+ await fetch2(true);
3895
3914
  } else if (!props.immediate && isFirstLoad.value) {
3896
- await fetch();
3915
+ await fetch2();
3897
3916
  isFirstLoad.value = false;
3898
3917
  }
3899
3918
  };
@@ -3915,7 +3934,7 @@ const _sfc_main$d = /* @__PURE__ */ defineComponent({
3915
3934
  });
3916
3935
  __expose({
3917
3936
  /** 刷新数据 */
3918
- refresh: () => fetch(true),
3937
+ refresh: () => fetch2(true),
3919
3938
  /** 获取选项列表 */
3920
3939
  getOptions: () => computedOptions.value
3921
3940
  });
@@ -3948,7 +3967,7 @@ const _sfc_main$d = /* @__PURE__ */ defineComponent({
3948
3967
  };
3949
3968
  }
3950
3969
  });
3951
- const _sfc_main$c = /* @__PURE__ */ defineComponent({
3970
+ const _sfc_main$d = /* @__PURE__ */ defineComponent({
3952
3971
  __name: "ApiCascader",
3953
3972
  props: {
3954
3973
  modelValue: {},
@@ -3975,7 +3994,7 @@ const _sfc_main$c = /* @__PURE__ */ defineComponent({
3975
3994
  const emit = __emit;
3976
3995
  const state = ref(props.modelValue);
3977
3996
  const rawOptions = ref([]);
3978
- const { loading, data, fetch } = useApiRequest({
3997
+ const { loading, data, fetch: fetch2 } = useApiRequest({
3979
3998
  api: props.api,
3980
3999
  params: toRef(props, "initFetchParams"),
3981
4000
  immediate: props.immediate && !props.enableLoadData,
@@ -4072,11 +4091,11 @@ const _sfc_main$c = /* @__PURE__ */ defineComponent({
4072
4091
  }
4073
4092
  });
4074
4093
  if (props.enableLoadData && props.immediate) {
4075
- fetch();
4094
+ fetch2();
4076
4095
  }
4077
4096
  __expose({
4078
4097
  /** 刷新数据 */
4079
- refresh: () => fetch(true),
4098
+ refresh: () => fetch2(true),
4080
4099
  /** 获取选项列表 */
4081
4100
  getOptions: () => computedOptions.value
4082
4101
  });
@@ -4114,13 +4133,13 @@ const componentMap = {
4114
4133
  Textarea,
4115
4134
  AutoComplete,
4116
4135
  Select,
4117
- ApiSelect: _sfc_main$d,
4136
+ ApiSelect: _sfc_main$e,
4118
4137
  Radio,
4119
4138
  RadioGroup,
4120
4139
  Checkbox,
4121
4140
  CheckboxGroup,
4122
4141
  Cascader,
4123
- ApiCascader: _sfc_main$c,
4142
+ ApiCascader: _sfc_main$d,
4124
4143
  TreeSelect,
4125
4144
  DatePicker,
4126
4145
  TimePicker,
@@ -4726,7 +4745,7 @@ const rendererMap = {
4726
4745
  function getRenderer(component = "Input") {
4727
4746
  return rendererMap[component] || rendererMap.default;
4728
4747
  }
4729
- const _sfc_main$b = /* @__PURE__ */ defineComponent({
4748
+ const _sfc_main$c = /* @__PURE__ */ defineComponent({
4730
4749
  ...{
4731
4750
  name: "BasicReadonlyField",
4732
4751
  inheritAttrs: false
@@ -4835,7 +4854,7 @@ const _sfc_main$b = /* @__PURE__ */ defineComponent({
4835
4854
  };
4836
4855
  }
4837
4856
  });
4838
- const BasicReadonlyField = /* @__PURE__ */ _export_sfc(_sfc_main$b, [["__scopeId", "data-v-3d2d24e0"]]);
4857
+ const BasicReadonlyField = /* @__PURE__ */ _export_sfc(_sfc_main$c, [["__scopeId", "data-v-3d2d24e0"]]);
4839
4858
  function useReadonlyField(options) {
4840
4859
  const defaultEmptyText = (options == null ? void 0 : options.defaultEmptyText) || "-";
4841
4860
  const globalLabelMap = (options == null ? void 0 : options.globalLabelMap) || {};
@@ -4947,7 +4966,7 @@ function useReadonlyField(options) {
4947
4966
  clearCache
4948
4967
  };
4949
4968
  }
4950
- const _sfc_main$a = /* @__PURE__ */ defineComponent({
4969
+ const _sfc_main$b = /* @__PURE__ */ defineComponent({
4951
4970
  ...{
4952
4971
  name: "BasicForm",
4953
4972
  inheritAttrs: false
@@ -5756,7 +5775,7 @@ function mergeFormSchemas(...schemas) {
5756
5775
  return schemas.flat();
5757
5776
  }
5758
5777
  const _hoisted_1$8 = { class: "basic-text-ellipsis" };
5759
- const _sfc_main$9 = /* @__PURE__ */ defineComponent({
5778
+ const _sfc_main$a = /* @__PURE__ */ defineComponent({
5760
5779
  __name: "BasicTextEllipsis",
5761
5780
  props: {
5762
5781
  text: { default: "" },
@@ -5869,7 +5888,7 @@ const _sfc_main$9 = /* @__PURE__ */ defineComponent({
5869
5888
  };
5870
5889
  }
5871
5890
  });
5872
- const BasicTextEllipsis = /* @__PURE__ */ _export_sfc(_sfc_main$9, [["__scopeId", "data-v-305f9842"]]);
5891
+ const BasicTextEllipsis = /* @__PURE__ */ _export_sfc(_sfc_main$a, [["__scopeId", "data-v-305f9842"]]);
5873
5892
  function useLocalStorage(key, initialValue) {
5874
5893
  let initialStoredValue;
5875
5894
  try {
@@ -6284,7 +6303,7 @@ const _hoisted_2$5 = {
6284
6303
  key: 2,
6285
6304
  class: "edit-cell-error"
6286
6305
  };
6287
- const _sfc_main$8 = /* @__PURE__ */ defineComponent({
6306
+ const _sfc_main$9 = /* @__PURE__ */ defineComponent({
6288
6307
  ...{
6289
6308
  name: "EditCell"
6290
6309
  },
@@ -6382,7 +6401,7 @@ const _sfc_main$8 = /* @__PURE__ */ defineComponent({
6382
6401
  };
6383
6402
  }
6384
6403
  });
6385
- const EditCell = /* @__PURE__ */ _export_sfc(_sfc_main$8, [["__scopeId", "data-v-52761074"]]);
6404
+ const EditCell = /* @__PURE__ */ _export_sfc(_sfc_main$9, [["__scopeId", "data-v-52761074"]]);
6386
6405
  function useEditValidation() {
6387
6406
  const validateField = async (value, column, record) => {
6388
6407
  if (!column.editRule) {
@@ -6811,7 +6830,7 @@ const _hoisted_5$2 = {
6811
6830
  class: "toolbar-right"
6812
6831
  };
6813
6832
  const _hoisted_6$1 = { class: "column-setting" };
6814
- const _sfc_main$7 = /* @__PURE__ */ defineComponent({
6833
+ const _sfc_main$8 = /* @__PURE__ */ defineComponent({
6815
6834
  ...{
6816
6835
  name: "BasicTable"
6817
6836
  },
@@ -7929,7 +7948,7 @@ const _sfc_main$7 = /* @__PURE__ */ defineComponent({
7929
7948
  class: normalizeClass(["basic-table-wrapper", { "is-fullscreen": isFullscreen.value }])
7930
7949
  }, [
7931
7950
  getSearchConfig.value.show ? (openBlock(), createElementBlock("div", _hoisted_1$6, [
7932
- createVNode(unref(_sfc_main$a), mergeProps({
7951
+ createVNode(unref(_sfc_main$b), mergeProps({
7933
7952
  ref_key: "searchFormRef",
7934
7953
  ref: searchFormRef
7935
7954
  }, getSearchFormProps.value, {
@@ -8307,7 +8326,7 @@ const _sfc_main$7 = /* @__PURE__ */ defineComponent({
8307
8326
  };
8308
8327
  }
8309
8328
  });
8310
- const BasicTable = /* @__PURE__ */ _export_sfc(_sfc_main$7, [["__scopeId", "data-v-b3a2e402"]]);
8329
+ const BasicTable = /* @__PURE__ */ _export_sfc(_sfc_main$8, [["__scopeId", "data-v-b3a2e402"]]);
8311
8330
  function useTable(options = {}) {
8312
8331
  const tableRef = ref(null);
8313
8332
  const formRef = ref(null);
@@ -8668,7 +8687,7 @@ function mergeTableColumns(...columns) {
8668
8687
  }
8669
8688
  const _hoisted_1$5 = { style: { "position": "relative", "width": "100%" } };
8670
8689
  const _hoisted_2$3 = { key: 1 };
8671
- const _sfc_main$6 = /* @__PURE__ */ defineComponent({
8690
+ const _sfc_main$7 = /* @__PURE__ */ defineComponent({
8672
8691
  ...{
8673
8692
  name: "BasicModal",
8674
8693
  inheritAttrs: false
@@ -9115,7 +9134,7 @@ const _sfc_main$6 = /* @__PURE__ */ defineComponent({
9115
9134
  };
9116
9135
  }
9117
9136
  });
9118
- const BasicModal = /* @__PURE__ */ _export_sfc(_sfc_main$6, [["__scopeId", "data-v-e4400cf8"]]);
9137
+ const BasicModal = /* @__PURE__ */ _export_sfc(_sfc_main$7, [["__scopeId", "data-v-e4400cf8"]]);
9119
9138
  function useModal(props) {
9120
9139
  const modalRef = ref(null);
9121
9140
  const loadedRef = ref(false);
@@ -9274,7 +9293,7 @@ function useModalInner(callbackFn) {
9274
9293
  ];
9275
9294
  }
9276
9295
  const _hoisted_1$4 = { style: { "position": "relative", "display": "flex", "align-items": "center", "gap": "0.5rem" } };
9277
- const _sfc_main$5 = /* @__PURE__ */ defineComponent({
9296
+ const _sfc_main$6 = /* @__PURE__ */ defineComponent({
9278
9297
  ...{
9279
9298
  name: "BasicDrawer",
9280
9299
  inheritAttrs: false
@@ -9639,7 +9658,7 @@ const _sfc_main$5 = /* @__PURE__ */ defineComponent({
9639
9658
  };
9640
9659
  }
9641
9660
  });
9642
- const BasicDrawer = /* @__PURE__ */ _export_sfc(_sfc_main$5, [["__scopeId", "data-v-83e4752e"]]);
9661
+ const BasicDrawer = /* @__PURE__ */ _export_sfc(_sfc_main$6, [["__scopeId", "data-v-83e4752e"]]);
9643
9662
  function useDrawer(props) {
9644
9663
  const drawerRef = ref(null);
9645
9664
  const loadedRef = ref(false);
@@ -9808,7 +9827,7 @@ const _hoisted_4$1 = {
9808
9827
  class: "description-extra"
9809
9828
  };
9810
9829
  const _hoisted_5$1 = { key: 1 };
9811
- const _sfc_main$4 = /* @__PURE__ */ defineComponent({
9830
+ const _sfc_main$5 = /* @__PURE__ */ defineComponent({
9812
9831
  ...{
9813
9832
  name: "BasicDescription",
9814
9833
  inheritAttrs: false
@@ -10058,7 +10077,7 @@ const _sfc_main$4 = /* @__PURE__ */ defineComponent({
10058
10077
  };
10059
10078
  }
10060
10079
  });
10061
- const BasicDescription = /* @__PURE__ */ _export_sfc(_sfc_main$4, [["__scopeId", "data-v-93ccbd39"]]);
10080
+ const BasicDescription = /* @__PURE__ */ _export_sfc(_sfc_main$5, [["__scopeId", "data-v-93ccbd39"]]);
10062
10081
  function useDescription(props) {
10063
10082
  const descriptionRef = ref(null);
10064
10083
  const loadedRef = ref(false);
@@ -10120,7 +10139,7 @@ const _hoisted_7 = {
10120
10139
  key: 0,
10121
10140
  style: { "display": "none" }
10122
10141
  };
10123
- const _sfc_main$3 = /* @__PURE__ */ defineComponent({
10142
+ const _sfc_main$4 = /* @__PURE__ */ defineComponent({
10124
10143
  ...{
10125
10144
  name: "BasicImage"
10126
10145
  },
@@ -10257,7 +10276,7 @@ const _sfc_main$3 = /* @__PURE__ */ defineComponent({
10257
10276
  };
10258
10277
  }
10259
10278
  });
10260
- const BasicImage = /* @__PURE__ */ _export_sfc(_sfc_main$3, [["__scopeId", "data-v-04c54d5a"]]);
10279
+ const BasicImage = /* @__PURE__ */ _export_sfc(_sfc_main$4, [["__scopeId", "data-v-04c54d5a"]]);
10261
10280
  function useImage(options) {
10262
10281
  const imageRef = ref(null);
10263
10282
  const loadedRef = ref(false);
@@ -10310,7 +10329,7 @@ const _hoisted_3 = {
10310
10329
  key: 0,
10311
10330
  class: "knt-spinner__tip"
10312
10331
  };
10313
- const _sfc_main$2 = /* @__PURE__ */ defineComponent({
10332
+ const _sfc_main$3 = /* @__PURE__ */ defineComponent({
10314
10333
  ...{ name: "LoadingSpinner" },
10315
10334
  __name: "LoadingSpinner",
10316
10335
  props: {
@@ -10329,9 +10348,9 @@ const _sfc_main$2 = /* @__PURE__ */ defineComponent({
10329
10348
  };
10330
10349
  }
10331
10350
  });
10332
- const LoadingSpinner = /* @__PURE__ */ _export_sfc(_sfc_main$2, [["__scopeId", "data-v-8cd97aae"]]);
10351
+ const LoadingSpinner = /* @__PURE__ */ _export_sfc(_sfc_main$3, [["__scopeId", "data-v-8cd97aae"]]);
10333
10352
  const _hoisted_1 = { class: "knt-loading-overlay__content" };
10334
- const _sfc_main$1 = /* @__PURE__ */ defineComponent({
10353
+ const _sfc_main$2 = /* @__PURE__ */ defineComponent({
10335
10354
  ...{
10336
10355
  name: "LoadingOverlay",
10337
10356
  inheritAttrs: false
@@ -10372,8 +10391,8 @@ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
10372
10391
  };
10373
10392
  }
10374
10393
  });
10375
- const LoadingOverlay = /* @__PURE__ */ _export_sfc(_sfc_main$1, [["__scopeId", "data-v-b25f4ff8"]]);
10376
- const _sfc_main = /* @__PURE__ */ defineComponent({
10394
+ const LoadingOverlay = /* @__PURE__ */ _export_sfc(_sfc_main$2, [["__scopeId", "data-v-b25f4ff8"]]);
10395
+ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
10377
10396
  ...{
10378
10397
  name: "BasicLoading",
10379
10398
  inheritAttrs: false
@@ -10537,6 +10556,128 @@ function createLoading(options = {}) {
10537
10556
  setTip
10538
10557
  };
10539
10558
  }
10559
+ function useVersionCheck(options = {}) {
10560
+ const {
10561
+ enabled = true,
10562
+ versionUrl = "/version.json",
10563
+ checkInterval = 10 * 60 * 1e3,
10564
+ sessionKey = "app_current_version"
10565
+ } = options;
10566
+ const hasNewVersion = ref(false);
10567
+ let currentVersion = "";
10568
+ let pendingRemoteVersion = "";
10569
+ let isFirstCheck = true;
10570
+ let modalShown = false;
10571
+ let timer = null;
10572
+ let onUpdateCallback = null;
10573
+ let visibilityHandler = null;
10574
+ async function fetchRemoteVersion() {
10575
+ try {
10576
+ const res = await fetch(`${versionUrl}?t=${Date.now()}`, { cache: "no-store" });
10577
+ if (!res.ok) return null;
10578
+ const data = await res.json();
10579
+ return data.version ?? null;
10580
+ } catch {
10581
+ return null;
10582
+ }
10583
+ }
10584
+ function syncLocalVersion(version) {
10585
+ currentVersion = version;
10586
+ sessionStorage.setItem(sessionKey, version);
10587
+ }
10588
+ async function checkVersion() {
10589
+ if (!enabled) return;
10590
+ const remoteVersion = await fetchRemoteVersion();
10591
+ if (!remoteVersion) return;
10592
+ if (isFirstCheck) {
10593
+ isFirstCheck = false;
10594
+ syncLocalVersion(remoteVersion);
10595
+ return;
10596
+ }
10597
+ if (remoteVersion !== currentVersion) {
10598
+ pendingRemoteVersion = remoteVersion;
10599
+ onUpdateCallback == null ? void 0 : onUpdateCallback();
10600
+ }
10601
+ }
10602
+ function start() {
10603
+ if (!enabled) return;
10604
+ currentVersion = sessionStorage.getItem(sessionKey) || "";
10605
+ checkVersion();
10606
+ if (!timer) {
10607
+ timer = setInterval(checkVersion, checkInterval);
10608
+ }
10609
+ if (!visibilityHandler) {
10610
+ visibilityHandler = () => {
10611
+ if (document.visibilityState === "visible") checkVersion();
10612
+ };
10613
+ document.addEventListener("visibilitychange", visibilityHandler);
10614
+ }
10615
+ onUpdateCallback = () => {
10616
+ if (modalShown) return;
10617
+ modalShown = true;
10618
+ hasNewVersion.value = true;
10619
+ };
10620
+ }
10621
+ function stop() {
10622
+ if (timer) {
10623
+ clearInterval(timer);
10624
+ timer = null;
10625
+ }
10626
+ if (visibilityHandler) {
10627
+ document.removeEventListener("visibilitychange", visibilityHandler);
10628
+ visibilityHandler = null;
10629
+ }
10630
+ modalShown = false;
10631
+ hasNewVersion.value = false;
10632
+ onUpdateCallback = null;
10633
+ }
10634
+ function applyUpdate() {
10635
+ const version = pendingRemoteVersion || currentVersion;
10636
+ if (version) syncLocalVersion(version);
10637
+ window.location.reload();
10638
+ }
10639
+ function dismissUpdate() {
10640
+ modalShown = false;
10641
+ hasNewVersion.value = false;
10642
+ }
10643
+ return { hasNewVersion, start, stop, checkVersion, applyUpdate, dismissUpdate };
10644
+ }
10645
+ const _sfc_main = /* @__PURE__ */ defineComponent({
10646
+ __name: "index",
10647
+ props: {
10648
+ enabled: { type: Boolean, default: true },
10649
+ title: { default: "页面超时" },
10650
+ content: { default: "页面已超时,请刷新后正常使用" },
10651
+ okText: { default: "立即刷新" },
10652
+ cancelText: { default: "稍后再说" }
10653
+ },
10654
+ setup(__props) {
10655
+ const props = __props;
10656
+ const { hasNewVersion, start, stop, applyUpdate, dismissUpdate } = useVersionCheck({
10657
+ enabled: props.enabled
10658
+ });
10659
+ onMounted(() => start());
10660
+ onUnmounted(() => stop());
10661
+ watch(hasNewVersion, (val) => {
10662
+ if (!val) return;
10663
+ Modal.confirm({
10664
+ title: props.title,
10665
+ content: () => h(
10666
+ "div",
10667
+ { style: "text-align: center; font-weight: bold; font-size: 16px" },
10668
+ props.content
10669
+ ),
10670
+ okText: props.okText,
10671
+ cancelText: props.cancelText,
10672
+ onCancel: () => dismissUpdate(),
10673
+ onOk: () => applyUpdate()
10674
+ });
10675
+ });
10676
+ return (_ctx, _cache) => {
10677
+ return openBlock(), createElementBlock("div");
10678
+ };
10679
+ }
10680
+ });
10540
10681
  function useDebounce(value, delay = 300) {
10541
10682
  const debouncedValue = ref(value.value);
10542
10683
  let timer = null;
@@ -10581,18 +10722,19 @@ const KntSharedPlugin = {
10581
10722
  }
10582
10723
  };
10583
10724
  export {
10584
- _sfc_main$c as ApiCascader,
10585
- _sfc_main$d as ApiSelect,
10725
+ _sfc_main$d as ApiCascader,
10726
+ _sfc_main$e as ApiSelect,
10586
10727
  BasicDescription,
10587
10728
  BasicDrawer,
10588
- _sfc_main$a as BasicForm,
10729
+ _sfc_main$b as BasicForm,
10589
10730
  BasicImage,
10590
- _sfc_main as BasicLoading,
10731
+ _sfc_main$1 as BasicLoading,
10591
10732
  BasicModal,
10592
10733
  BasicReadonlyField,
10593
10734
  BasicTable,
10594
10735
  BasicTextEllipsis,
10595
10736
  BasicUpload,
10737
+ _sfc_main as CheckUpdate,
10596
10738
  EditCell,
10597
10739
  KntSharedPlugin,
10598
10740
  VideoPreview,
@@ -10670,6 +10812,7 @@ export {
10670
10812
  rgbToHex,
10671
10813
  safeToString,
10672
10814
  setObjToUrlParams,
10815
+ setupChunkErrorHandler,
10673
10816
  throttle,
10674
10817
  transFormUrlPath,
10675
10818
  transformBackUrl,
@@ -10689,6 +10832,7 @@ export {
10689
10832
  useReadonlyField,
10690
10833
  useTable,
10691
10834
  useToggle,
10692
- useUpload
10835
+ useUpload,
10836
+ useVersionCheck
10693
10837
  };
10694
10838
  //# sourceMappingURL=index.esm.js.map