knt-shared 1.9.2 → 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 (32) 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 +55 -55
  8. package/dist/components/Form/components/ApiCascader.vue.d.ts +2 -2
  9. package/dist/components/Form/components/ApiSelect.vue.d.ts +2 -2
  10. package/dist/components/Image/BasicImage.vue.d.ts +2 -2
  11. package/dist/components/Modal/BasicModal.vue.d.ts +12 -12
  12. package/dist/components/Table/BasicTable.vue.d.ts +5 -5
  13. package/dist/components/Table/components/componentMap.d.ts +55 -55
  14. package/dist/components/Upload/BasicUpload.vue.d.ts +4 -4
  15. package/dist/components/Upload/components/SortableFileItem.vue.d.ts +2 -2
  16. package/dist/components/Upload/components/VideoPreview.vue.d.ts +4 -4
  17. package/dist/components/Upload/components/VideoPreviewModal.vue.d.ts +3 -3
  18. package/dist/components/index.d.ts +1 -0
  19. package/dist/components/index.d.ts.map +1 -1
  20. package/dist/hooks/index.d.ts +2 -0
  21. package/dist/hooks/index.d.ts.map +1 -1
  22. package/dist/hooks/useVersionCheck.d.ts +19 -0
  23. package/dist/hooks/useVersionCheck.d.ts.map +1 -0
  24. package/dist/index.cjs.js +229 -87
  25. package/dist/index.cjs.js.map +1 -1
  26. package/dist/index.esm.js +230 -88
  27. package/dist/index.esm.js.map +1 -1
  28. package/dist/utils/chunkErrorHandler.d.ts +2 -0
  29. package/dist/utils/chunkErrorHandler.d.ts.map +1 -0
  30. package/dist/utils/index.d.ts +1 -0
  31. package/dist/utils/index.d.ts.map +1 -1
  32. 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
@@ -3594,7 +3611,7 @@ const _sfc_main$e = /* @__PURE__ */ defineComponent({
3594
3611
  };
3595
3612
  }
3596
3613
  });
3597
- const BasicUpload = /* @__PURE__ */ _export_sfc(_sfc_main$e, [["__scopeId", "data-v-47c7dc74"]]);
3614
+ const BasicUpload = /* @__PURE__ */ _export_sfc(_sfc_main$f, [["__scopeId", "data-v-47c7dc74"]]);
3598
3615
  function useUpload(props) {
3599
3616
  const uploadRef = ref(null);
3600
3617
  const fileListRef = ref((props == null ? void 0 : props.defaultFileList) || []);
@@ -3740,7 +3757,7 @@ function useApiRequest(options) {
3740
3757
  const data = ref([]);
3741
3758
  const isFirstLoad = ref(true);
3742
3759
  const error = ref(null);
3743
- async function fetch(forceRefresh = false) {
3760
+ async function fetch2(forceRefresh = false) {
3744
3761
  if (!api || typeof api !== "function") {
3745
3762
  console.warn("[useApiRequest] api 必须是一个函数");
3746
3763
  return;
@@ -3792,7 +3809,7 @@ function useApiRequest(options) {
3792
3809
  loading.value = false;
3793
3810
  }
3794
3811
  }
3795
- const debouncedFetch = debounce(fetch, debounceTime);
3812
+ const debouncedFetch = debounce(fetch2, debounceTime);
3796
3813
  let stopParamsWatch = null;
3797
3814
  if (params) {
3798
3815
  stopParamsWatch = watch(
@@ -3806,7 +3823,7 @@ function useApiRequest(options) {
3806
3823
  );
3807
3824
  }
3808
3825
  if (immediate) {
3809
- fetch();
3826
+ fetch2();
3810
3827
  }
3811
3828
  if (immediate) {
3812
3829
  isFirstLoad.value = false;
@@ -3828,9 +3845,9 @@ function useApiRequest(options) {
3828
3845
  /** 是否首次加载 */
3829
3846
  isFirstLoad,
3830
3847
  /** 执行请求 */
3831
- fetch,
3848
+ fetch: fetch2,
3832
3849
  /** 刷新数据(忽略缓存) */
3833
- refresh: () => fetch(true)
3850
+ refresh: () => fetch2(true)
3834
3851
  };
3835
3852
  }
3836
3853
  function clearAllCache() {
@@ -3840,7 +3857,7 @@ function clearApiCache(api, params) {
3840
3857
  const cacheKey = getCacheKey(api, params);
3841
3858
  cacheMap.delete(cacheKey);
3842
3859
  }
3843
- const _sfc_main$d = /* @__PURE__ */ defineComponent({
3860
+ const _sfc_main$e = /* @__PURE__ */ defineComponent({
3844
3861
  __name: "ApiSelect",
3845
3862
  props: {
3846
3863
  modelValue: {},
@@ -3864,7 +3881,7 @@ const _sfc_main$d = /* @__PURE__ */ defineComponent({
3864
3881
  const emit = __emit;
3865
3882
  const state = ref(props.modelValue);
3866
3883
  const rawOptions = ref([]);
3867
- const { loading, data, isFirstLoad, fetch } = useApiRequest({
3884
+ const { loading, data, isFirstLoad, fetch: fetch2 } = useApiRequest({
3868
3885
  api: props.api,
3869
3886
  params: toRef(props, "params"),
3870
3887
  immediate: props.immediate,
@@ -3893,9 +3910,9 @@ const _sfc_main$d = /* @__PURE__ */ defineComponent({
3893
3910
  const handlePopupVisibleChange = async (visible) => {
3894
3911
  if (!visible) return;
3895
3912
  if (props.alwaysLoad) {
3896
- await fetch(true);
3913
+ await fetch2(true);
3897
3914
  } else if (!props.immediate && isFirstLoad.value) {
3898
- await fetch();
3915
+ await fetch2();
3899
3916
  isFirstLoad.value = false;
3900
3917
  }
3901
3918
  };
@@ -3917,7 +3934,7 @@ const _sfc_main$d = /* @__PURE__ */ defineComponent({
3917
3934
  });
3918
3935
  __expose({
3919
3936
  /** 刷新数据 */
3920
- refresh: () => fetch(true),
3937
+ refresh: () => fetch2(true),
3921
3938
  /** 获取选项列表 */
3922
3939
  getOptions: () => computedOptions.value
3923
3940
  });
@@ -3950,7 +3967,7 @@ const _sfc_main$d = /* @__PURE__ */ defineComponent({
3950
3967
  };
3951
3968
  }
3952
3969
  });
3953
- const _sfc_main$c = /* @__PURE__ */ defineComponent({
3970
+ const _sfc_main$d = /* @__PURE__ */ defineComponent({
3954
3971
  __name: "ApiCascader",
3955
3972
  props: {
3956
3973
  modelValue: {},
@@ -3977,7 +3994,7 @@ const _sfc_main$c = /* @__PURE__ */ defineComponent({
3977
3994
  const emit = __emit;
3978
3995
  const state = ref(props.modelValue);
3979
3996
  const rawOptions = ref([]);
3980
- const { loading, data, fetch } = useApiRequest({
3997
+ const { loading, data, fetch: fetch2 } = useApiRequest({
3981
3998
  api: props.api,
3982
3999
  params: toRef(props, "initFetchParams"),
3983
4000
  immediate: props.immediate && !props.enableLoadData,
@@ -4074,11 +4091,11 @@ const _sfc_main$c = /* @__PURE__ */ defineComponent({
4074
4091
  }
4075
4092
  });
4076
4093
  if (props.enableLoadData && props.immediate) {
4077
- fetch();
4094
+ fetch2();
4078
4095
  }
4079
4096
  __expose({
4080
4097
  /** 刷新数据 */
4081
- refresh: () => fetch(true),
4098
+ refresh: () => fetch2(true),
4082
4099
  /** 获取选项列表 */
4083
4100
  getOptions: () => computedOptions.value
4084
4101
  });
@@ -4116,13 +4133,13 @@ const componentMap = {
4116
4133
  Textarea,
4117
4134
  AutoComplete,
4118
4135
  Select,
4119
- ApiSelect: _sfc_main$d,
4136
+ ApiSelect: _sfc_main$e,
4120
4137
  Radio,
4121
4138
  RadioGroup,
4122
4139
  Checkbox,
4123
4140
  CheckboxGroup,
4124
4141
  Cascader,
4125
- ApiCascader: _sfc_main$c,
4142
+ ApiCascader: _sfc_main$d,
4126
4143
  TreeSelect,
4127
4144
  DatePicker,
4128
4145
  TimePicker,
@@ -4728,7 +4745,7 @@ const rendererMap = {
4728
4745
  function getRenderer(component = "Input") {
4729
4746
  return rendererMap[component] || rendererMap.default;
4730
4747
  }
4731
- const _sfc_main$b = /* @__PURE__ */ defineComponent({
4748
+ const _sfc_main$c = /* @__PURE__ */ defineComponent({
4732
4749
  ...{
4733
4750
  name: "BasicReadonlyField",
4734
4751
  inheritAttrs: false
@@ -4837,7 +4854,7 @@ const _sfc_main$b = /* @__PURE__ */ defineComponent({
4837
4854
  };
4838
4855
  }
4839
4856
  });
4840
- 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"]]);
4841
4858
  function useReadonlyField(options) {
4842
4859
  const defaultEmptyText = (options == null ? void 0 : options.defaultEmptyText) || "-";
4843
4860
  const globalLabelMap = (options == null ? void 0 : options.globalLabelMap) || {};
@@ -4949,7 +4966,7 @@ function useReadonlyField(options) {
4949
4966
  clearCache
4950
4967
  };
4951
4968
  }
4952
- const _sfc_main$a = /* @__PURE__ */ defineComponent({
4969
+ const _sfc_main$b = /* @__PURE__ */ defineComponent({
4953
4970
  ...{
4954
4971
  name: "BasicForm",
4955
4972
  inheritAttrs: false
@@ -5758,7 +5775,7 @@ function mergeFormSchemas(...schemas) {
5758
5775
  return schemas.flat();
5759
5776
  }
5760
5777
  const _hoisted_1$8 = { class: "basic-text-ellipsis" };
5761
- const _sfc_main$9 = /* @__PURE__ */ defineComponent({
5778
+ const _sfc_main$a = /* @__PURE__ */ defineComponent({
5762
5779
  __name: "BasicTextEllipsis",
5763
5780
  props: {
5764
5781
  text: { default: "" },
@@ -5871,7 +5888,7 @@ const _sfc_main$9 = /* @__PURE__ */ defineComponent({
5871
5888
  };
5872
5889
  }
5873
5890
  });
5874
- 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"]]);
5875
5892
  function useLocalStorage(key, initialValue) {
5876
5893
  let initialStoredValue;
5877
5894
  try {
@@ -6286,7 +6303,7 @@ const _hoisted_2$5 = {
6286
6303
  key: 2,
6287
6304
  class: "edit-cell-error"
6288
6305
  };
6289
- const _sfc_main$8 = /* @__PURE__ */ defineComponent({
6306
+ const _sfc_main$9 = /* @__PURE__ */ defineComponent({
6290
6307
  ...{
6291
6308
  name: "EditCell"
6292
6309
  },
@@ -6384,7 +6401,7 @@ const _sfc_main$8 = /* @__PURE__ */ defineComponent({
6384
6401
  };
6385
6402
  }
6386
6403
  });
6387
- 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"]]);
6388
6405
  function useEditValidation() {
6389
6406
  const validateField = async (value, column, record) => {
6390
6407
  if (!column.editRule) {
@@ -6813,7 +6830,7 @@ const _hoisted_5$2 = {
6813
6830
  class: "toolbar-right"
6814
6831
  };
6815
6832
  const _hoisted_6$1 = { class: "column-setting" };
6816
- const _sfc_main$7 = /* @__PURE__ */ defineComponent({
6833
+ const _sfc_main$8 = /* @__PURE__ */ defineComponent({
6817
6834
  ...{
6818
6835
  name: "BasicTable"
6819
6836
  },
@@ -7931,7 +7948,7 @@ const _sfc_main$7 = /* @__PURE__ */ defineComponent({
7931
7948
  class: normalizeClass(["basic-table-wrapper", { "is-fullscreen": isFullscreen.value }])
7932
7949
  }, [
7933
7950
  getSearchConfig.value.show ? (openBlock(), createElementBlock("div", _hoisted_1$6, [
7934
- createVNode(unref(_sfc_main$a), mergeProps({
7951
+ createVNode(unref(_sfc_main$b), mergeProps({
7935
7952
  ref_key: "searchFormRef",
7936
7953
  ref: searchFormRef
7937
7954
  }, getSearchFormProps.value, {
@@ -8309,7 +8326,7 @@ const _sfc_main$7 = /* @__PURE__ */ defineComponent({
8309
8326
  };
8310
8327
  }
8311
8328
  });
8312
- 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"]]);
8313
8330
  function useTable(options = {}) {
8314
8331
  const tableRef = ref(null);
8315
8332
  const formRef = ref(null);
@@ -8670,7 +8687,7 @@ function mergeTableColumns(...columns) {
8670
8687
  }
8671
8688
  const _hoisted_1$5 = { style: { "position": "relative", "width": "100%" } };
8672
8689
  const _hoisted_2$3 = { key: 1 };
8673
- const _sfc_main$6 = /* @__PURE__ */ defineComponent({
8690
+ const _sfc_main$7 = /* @__PURE__ */ defineComponent({
8674
8691
  ...{
8675
8692
  name: "BasicModal",
8676
8693
  inheritAttrs: false
@@ -9117,7 +9134,7 @@ const _sfc_main$6 = /* @__PURE__ */ defineComponent({
9117
9134
  };
9118
9135
  }
9119
9136
  });
9120
- 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"]]);
9121
9138
  function useModal(props) {
9122
9139
  const modalRef = ref(null);
9123
9140
  const loadedRef = ref(false);
@@ -9276,7 +9293,7 @@ function useModalInner(callbackFn) {
9276
9293
  ];
9277
9294
  }
9278
9295
  const _hoisted_1$4 = { style: { "position": "relative", "display": "flex", "align-items": "center", "gap": "0.5rem" } };
9279
- const _sfc_main$5 = /* @__PURE__ */ defineComponent({
9296
+ const _sfc_main$6 = /* @__PURE__ */ defineComponent({
9280
9297
  ...{
9281
9298
  name: "BasicDrawer",
9282
9299
  inheritAttrs: false
@@ -9641,7 +9658,7 @@ const _sfc_main$5 = /* @__PURE__ */ defineComponent({
9641
9658
  };
9642
9659
  }
9643
9660
  });
9644
- 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"]]);
9645
9662
  function useDrawer(props) {
9646
9663
  const drawerRef = ref(null);
9647
9664
  const loadedRef = ref(false);
@@ -9810,7 +9827,7 @@ const _hoisted_4$1 = {
9810
9827
  class: "description-extra"
9811
9828
  };
9812
9829
  const _hoisted_5$1 = { key: 1 };
9813
- const _sfc_main$4 = /* @__PURE__ */ defineComponent({
9830
+ const _sfc_main$5 = /* @__PURE__ */ defineComponent({
9814
9831
  ...{
9815
9832
  name: "BasicDescription",
9816
9833
  inheritAttrs: false
@@ -10060,7 +10077,7 @@ const _sfc_main$4 = /* @__PURE__ */ defineComponent({
10060
10077
  };
10061
10078
  }
10062
10079
  });
10063
- 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"]]);
10064
10081
  function useDescription(props) {
10065
10082
  const descriptionRef = ref(null);
10066
10083
  const loadedRef = ref(false);
@@ -10122,7 +10139,7 @@ const _hoisted_7 = {
10122
10139
  key: 0,
10123
10140
  style: { "display": "none" }
10124
10141
  };
10125
- const _sfc_main$3 = /* @__PURE__ */ defineComponent({
10142
+ const _sfc_main$4 = /* @__PURE__ */ defineComponent({
10126
10143
  ...{
10127
10144
  name: "BasicImage"
10128
10145
  },
@@ -10259,7 +10276,7 @@ const _sfc_main$3 = /* @__PURE__ */ defineComponent({
10259
10276
  };
10260
10277
  }
10261
10278
  });
10262
- 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"]]);
10263
10280
  function useImage(options) {
10264
10281
  const imageRef = ref(null);
10265
10282
  const loadedRef = ref(false);
@@ -10312,7 +10329,7 @@ const _hoisted_3 = {
10312
10329
  key: 0,
10313
10330
  class: "knt-spinner__tip"
10314
10331
  };
10315
- const _sfc_main$2 = /* @__PURE__ */ defineComponent({
10332
+ const _sfc_main$3 = /* @__PURE__ */ defineComponent({
10316
10333
  ...{ name: "LoadingSpinner" },
10317
10334
  __name: "LoadingSpinner",
10318
10335
  props: {
@@ -10331,9 +10348,9 @@ const _sfc_main$2 = /* @__PURE__ */ defineComponent({
10331
10348
  };
10332
10349
  }
10333
10350
  });
10334
- 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"]]);
10335
10352
  const _hoisted_1 = { class: "knt-loading-overlay__content" };
10336
- const _sfc_main$1 = /* @__PURE__ */ defineComponent({
10353
+ const _sfc_main$2 = /* @__PURE__ */ defineComponent({
10337
10354
  ...{
10338
10355
  name: "LoadingOverlay",
10339
10356
  inheritAttrs: false
@@ -10374,8 +10391,8 @@ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
10374
10391
  };
10375
10392
  }
10376
10393
  });
10377
- const LoadingOverlay = /* @__PURE__ */ _export_sfc(_sfc_main$1, [["__scopeId", "data-v-b25f4ff8"]]);
10378
- 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({
10379
10396
  ...{
10380
10397
  name: "BasicLoading",
10381
10398
  inheritAttrs: false
@@ -10539,6 +10556,128 @@ function createLoading(options = {}) {
10539
10556
  setTip
10540
10557
  };
10541
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
+ });
10542
10681
  function useDebounce(value, delay = 300) {
10543
10682
  const debouncedValue = ref(value.value);
10544
10683
  let timer = null;
@@ -10583,18 +10722,19 @@ const KntSharedPlugin = {
10583
10722
  }
10584
10723
  };
10585
10724
  export {
10586
- _sfc_main$c as ApiCascader,
10587
- _sfc_main$d as ApiSelect,
10725
+ _sfc_main$d as ApiCascader,
10726
+ _sfc_main$e as ApiSelect,
10588
10727
  BasicDescription,
10589
10728
  BasicDrawer,
10590
- _sfc_main$a as BasicForm,
10729
+ _sfc_main$b as BasicForm,
10591
10730
  BasicImage,
10592
- _sfc_main as BasicLoading,
10731
+ _sfc_main$1 as BasicLoading,
10593
10732
  BasicModal,
10594
10733
  BasicReadonlyField,
10595
10734
  BasicTable,
10596
10735
  BasicTextEllipsis,
10597
10736
  BasicUpload,
10737
+ _sfc_main as CheckUpdate,
10598
10738
  EditCell,
10599
10739
  KntSharedPlugin,
10600
10740
  VideoPreview,
@@ -10672,6 +10812,7 @@ export {
10672
10812
  rgbToHex,
10673
10813
  safeToString,
10674
10814
  setObjToUrlParams,
10815
+ setupChunkErrorHandler,
10675
10816
  throttle,
10676
10817
  transFormUrlPath,
10677
10818
  transformBackUrl,
@@ -10691,6 +10832,7 @@ export {
10691
10832
  useReadonlyField,
10692
10833
  useTable,
10693
10834
  useToggle,
10694
- useUpload
10835
+ useUpload,
10836
+ useVersionCheck
10695
10837
  };
10696
10838
  //# sourceMappingURL=index.esm.js.map