lw-cdp-ui 1.4.47 → 1.4.48

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.
@@ -22814,31 +22814,29 @@ function hy(e) {
22814
22814
  console.error("Service worker 注册失败:", a);
22815
22815
  },
22816
22816
  onRegistered(a) {
22817
- console.log("Service Worker 注册成功");
22818
- },
22819
- onNeedRefresh() {
22820
- console.log("检测到新版本..."), n();
22821
- const a = t == null ? void 0 : t.querySelector("#status-text");
22822
- a && (a.textContent = "正在准备下载更新...");
22823
- let o = 0;
22824
- const i = setInterval(() => {
22825
- if (o += Math.random() * 0.1, o < 1) {
22826
- const l = t == null ? void 0 : t.querySelector("#update-progress"), s = t == null ? void 0 : t.querySelector("#status-text");
22827
- l && (l.style.width = `${Math.round(o * 100)}%`), s && (s.textContent = `项目有更新迭代,正在下载新版本-${Math.round(o * 100)}%`);
22828
- } else {
22829
- clearInterval(i);
22830
- const l = t == null ? void 0 : t.querySelector("#progress-body"), s = t == null ? void 0 : t.querySelector("#update-button"), u = t == null ? void 0 : t.querySelector("#status-text");
22831
- s && u && (l.style.display = "none", u.textContent = "新版本已准备就绪!", s.style.display = "inline-block", s.addEventListener("click", () => {
22817
+ console.log("Service Worker 注册成功222", a), a.update().then(() => {
22818
+ if (console.log("已检查更新"), console.log(a.installing), console.log(a.waiting), a != null && a.installing) {
22819
+ console.log("检测到新版本..."), n();
22820
+ const o = t == null ? void 0 : t.querySelector("#status-text");
22821
+ o && (o.textContent = "正在准备下载更新...");
22822
+ let i = 0;
22823
+ setInterval(() => {
22824
+ i += Math.random() * 0.1;
22825
+ const l = t == null ? void 0 : t.querySelector("#update-progress"), s = t == null ? void 0 : t.querySelector("#status-text");
22826
+ l && (l.style.width = `${Math.round(i * 100)}%`), s && (s.textContent = `项目有更新迭代,正在下载新版本-${Math.round(i * 100)}%`);
22827
+ }, 200);
22828
+ }
22829
+ if (a != null && a.waiting) {
22830
+ console.log("新版本已下载..."), n();
22831
+ const o = t == null ? void 0 : t.querySelector("#progress-body"), i = t == null ? void 0 : t.querySelector("#update-button"), l = t == null ? void 0 : t.querySelector("#status-text");
22832
+ i && l && (o.style.display = "none", l.textContent = "新版本已准备就绪!", i.style.display = "inline-block", i.addEventListener("click", () => {
22832
22833
  r(!0);
22833
22834
  }));
22834
22835
  }
22835
- }, 200);
22836
+ });
22836
22837
  },
22837
- onDownloadProgress({ progress: a }) {
22838
- if (console.log("下载中..."), t) {
22839
- const o = t.querySelector("#update-progress"), i = t.querySelector("#status-text");
22840
- o && (o.style.width = `${Math.round(a * 100)}%`), i && (i.textContent = `正在下载新版本...${Math.round(a * 100)}%`);
22841
- }
22838
+ onNeedRefresh() {
22839
+ console.log("下载完成...");
22842
22840
  },
22843
22841
  onOfflineReady() {
22844
22842
  console.log("应用已准备好离线工作。");
@@ -33,4 +33,4 @@
33
33
  </div>
34
34
  <button id="update-button" style="margin-left: 10px; background: white; color: #42b983; border: none; padding: 5px 10px; border-radius: 4px; cursor: pointer; display: none;">立即更新</button>
35
35
  </div>
36
- `,document.body.appendChild(n)),n),a=t({onRegisterError(r){console.error("Service worker 注册失败:",r)},onRegistered(r){console.log("Service Worker 注册成功")},onNeedRefresh(){console.log("检测到新版本..."),o();const r=n==null?void 0:n.querySelector("#status-text");r&&(r.textContent="正在准备下载更新...");let l=0;const i=setInterval(()=>{if(l+=Math.random()*.1,l<1){const s=n==null?void 0:n.querySelector("#update-progress"),c=n==null?void 0:n.querySelector("#status-text");s&&(s.style.width=`${Math.round(l*100)}%`),c&&(c.textContent=`项目有更新迭代,正在下载新版本-${Math.round(l*100)}%`)}else{clearInterval(i);const s=n==null?void 0:n.querySelector("#progress-body"),c=n==null?void 0:n.querySelector("#update-button"),h=n==null?void 0:n.querySelector("#status-text");c&&h&&(s.style.display="none",h.textContent="新版本已准备就绪!",c.style.display="inline-block",c.addEventListener("click",()=>{a(!0)}))}},200)},onDownloadProgress({progress:r}){if(console.log("下载中..."),n){const l=n.querySelector("#update-progress"),i=n.querySelector("#status-text");l&&(l.style.width=`${Math.round(r*100)}%`),i&&(i.textContent=`正在下载新版本...${Math.round(r*100)}%`)}},onOfflineReady(){console.log("应用已准备好离线工作。")}})}function iC(t,n={}){if(n)for(const o in n)n.hasOwnProperty(o)&&(t.config.globalProperties[`$${o.toUpperCase()}`]=n[o]);t.directive("copy",t4),t.directive("auth",n4),t.component("lwLayout",Ka),t.component("lwLayoutInit",Wa),t.component("lwLogin",$a),t.component("lwSearch",wn),t.component("lwSvgIcon",el),t.component("lwTable",bn),t.component("lwForm",tl),t.component("lwFormMini",ol),t.component("lwUpload",ct),t.component("lwIconSelect",rl),t.component("lwTableSelect",al),t.component("lwTableForm",ll),t.component("lwFormView",sl),t.component("lwFormJson",il),t.component("lwCronSelect",cl),t.component("lwFlow",Ld),t.component("lwBiChart",Nd),t.component("lwBiChartItem",Gd),t.component("lwBiChartPage",Hd),t.component("lwTour",Kd)}const sC={install:iC,uiI18n:Qt,registerServiceWorker:Wd};$.default=sC,$.lwBiChart=Nd,$.lwBiChartItem=Gd,$.lwBiChartPage=Hd,$.lwCronSelect=cl,$.lwFlow=Ld,$.lwForm=tl,$.lwFormJson=il,$.lwFormMini=ol,$.lwFormView=sl,$.lwIconSelect=rl,$.lwLayout=Ka,$.lwLayoutInit=Wa,$.lwLogin=$a,$.lwSearch=wn,$.lwSvgIcon=el,$.lwTable=bn,$.lwTableForm=ll,$.lwTableSelect=al,$.lwTour=Kd,$.lwUpload=ct,$.registerServiceWorker=Wd,$.uiI18n=Qt,Object.defineProperties($,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
36
+ `,document.body.appendChild(n)),n),a=t({onRegisterError(r){console.error("Service worker 注册失败:",r)},onRegistered(r){console.log("Service Worker 注册成功222",r),r.update().then(()=>{if(console.log("已检查更新"),console.log(r.installing),console.log(r.waiting),r!=null&&r.installing){console.log("检测到新版本..."),o();const l=n==null?void 0:n.querySelector("#status-text");l&&(l.textContent="正在准备下载更新...");let i=0;setInterval(()=>{i+=Math.random()*.1;const s=n==null?void 0:n.querySelector("#update-progress"),c=n==null?void 0:n.querySelector("#status-text");s&&(s.style.width=`${Math.round(i*100)}%`),c&&(c.textContent=`项目有更新迭代,正在下载新版本-${Math.round(i*100)}%`)},200)}if(r!=null&&r.waiting){console.log("新版本已下载..."),o();const l=n==null?void 0:n.querySelector("#progress-body"),i=n==null?void 0:n.querySelector("#update-button"),s=n==null?void 0:n.querySelector("#status-text");i&&s&&(l.style.display="none",s.textContent="新版本已准备就绪!",i.style.display="inline-block",i.addEventListener("click",()=>{a(!0)}))}})},onNeedRefresh(){console.log("下载完成...")},onOfflineReady(){console.log("应用已准备好离线工作。")}})}function iC(t,n={}){if(n)for(const o in n)n.hasOwnProperty(o)&&(t.config.globalProperties[`$${o.toUpperCase()}`]=n[o]);t.directive("copy",t4),t.directive("auth",n4),t.component("lwLayout",Ka),t.component("lwLayoutInit",Wa),t.component("lwLogin",$a),t.component("lwSearch",wn),t.component("lwSvgIcon",el),t.component("lwTable",bn),t.component("lwForm",tl),t.component("lwFormMini",ol),t.component("lwUpload",ct),t.component("lwIconSelect",rl),t.component("lwTableSelect",al),t.component("lwTableForm",ll),t.component("lwFormView",sl),t.component("lwFormJson",il),t.component("lwCronSelect",cl),t.component("lwFlow",Ld),t.component("lwBiChart",Nd),t.component("lwBiChartItem",Gd),t.component("lwBiChartPage",Hd),t.component("lwTour",Kd)}const sC={install:iC,uiI18n:Qt,registerServiceWorker:Wd};$.default=sC,$.lwBiChart=Nd,$.lwBiChartItem=Gd,$.lwBiChartPage=Hd,$.lwCronSelect=cl,$.lwFlow=Ld,$.lwForm=tl,$.lwFormJson=il,$.lwFormMini=ol,$.lwFormView=sl,$.lwIconSelect=rl,$.lwLayout=Ka,$.lwLayoutInit=Wa,$.lwLogin=$a,$.lwSearch=wn,$.lwSvgIcon=el,$.lwTable=bn,$.lwTableForm=ll,$.lwTableSelect=al,$.lwTour=Kd,$.lwUpload=ct,$.registerServiceWorker=Wd,$.uiI18n=Qt,Object.defineProperties($,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "lw-cdp-ui",
3
- "version": "1.4.47",
3
+ "version": "1.4.48",
4
4
  "type": "module",
5
5
  "license": "UNLICENSED",
6
6
  "main": "dist/lw-cdp-ui.umd.js",