x-essential-lib 0.5.12 → 0.5.13

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.
@@ -1,5 +1,4 @@
1
1
  export * from './color';
2
2
  export * from './microApp';
3
- export * from './permission';
4
3
  export * from './system';
5
4
  export * from './viewStack';
package/dist/index.js CHANGED
@@ -1,9 +1,9 @@
1
1
  (function(){"use strict";try{if(typeof document<"u"){var t=document.createElement("style");t.id="x-essential-lib",t.appendChild(document.createTextNode('.inner-left-enter-active,.inner-right-enter-active{transition:transform .35s ease}.inner-left-enter-from{transform:translate(-100%)}.inner-right-enter-from{transform:translate(100%)}.inner-left-enter-to,.inner-right-enter-to{transform:translate(0)}.x-cont[data-v-f4ad116e]{position:absolute;top:0;left:0;bottom:0;right:0;display:flex;align-items:center;justify-content:center}.lds-spinner[data-v-f4ad116e]{color:official;display:inline-block;position:relative;width:40px;height:40px}.lds-spinner div[data-v-f4ad116e]{transform-origin:20px 20px;animation:lds-spinner-f4ad116e 1.2s linear infinite}.lds-spinner div[data-v-f4ad116e]:after{content:" ";display:block;position:absolute;top:3px;left:18px;width:2px;height:6px;border-radius:5%;background:#9e9e9e}.lds-spinner div[data-v-f4ad116e]:nth-child(1){transform:rotate(0);animation-delay:-1.1s}.lds-spinner div[data-v-f4ad116e]:nth-child(2){transform:rotate(30deg);animation-delay:-1s}.lds-spinner div[data-v-f4ad116e]:nth-child(3){transform:rotate(60deg);animation-delay:-.9s}.lds-spinner div[data-v-f4ad116e]:nth-child(4){transform:rotate(90deg);animation-delay:-.8s}.lds-spinner div[data-v-f4ad116e]:nth-child(5){transform:rotate(120deg);animation-delay:-.7s}.lds-spinner div[data-v-f4ad116e]:nth-child(6){transform:rotate(150deg);animation-delay:-.6s}.lds-spinner div[data-v-f4ad116e]:nth-child(7){transform:rotate(180deg);animation-delay:-.5s}.lds-spinner div[data-v-f4ad116e]:nth-child(8){transform:rotate(210deg);animation-delay:-.4s}.lds-spinner div[data-v-f4ad116e]:nth-child(9){transform:rotate(240deg);animation-delay:-.3s}.lds-spinner div[data-v-f4ad116e]:nth-child(10){transform:rotate(270deg);animation-delay:-.2s}.lds-spinner div[data-v-f4ad116e]:nth-child(11){transform:rotate(300deg);animation-delay:-.1s}.lds-spinner div[data-v-f4ad116e]:nth-child(12){transform:rotate(330deg);animation-delay:0s}@keyframes lds-spinner-f4ad116e{0%{opacity:1}to{opacity:0}}.x-cont[data-v-0ce1c82d]{position:absolute;left:50%;bottom:20px;transform:translate(-50%);z-index:9999}')),document.head.appendChild(t)}}catch(a){console.error("vite-plugin-css-injected-by-js",a)}})();
2
- import { ref as f, watch as N, computed as g, onMounted as R, onBeforeUnmount as O, defineComponent as M, resolveComponent as h, openBlock as q, createBlock as B, unref as z, isRef as G, withKeys as L, withModifiers as K, withCtx as w, createVNode as k, createTextVNode as A, toDisplayString as T, createElementBlock as J, normalizeStyle as ve, pushScopeId as me, popScopeId as he, createElementVNode as m, reactive as we, Fragment as ye, renderList as xe, createCommentVNode as ke } from "vue";
3
- import { useTheme as H, useLocale as Q, useDisplay as be } from "vuetify";
2
+ import { ref as d, watch as N, computed as g, onMounted as R, onBeforeUnmount as O, defineComponent as M, resolveComponent as h, openBlock as q, createBlock as B, unref as z, isRef as G, withKeys as L, withModifiers as K, withCtx as w, createVNode as k, createTextVNode as A, toDisplayString as T, createElementBlock as J, normalizeStyle as ge, pushScopeId as ve, popScopeId as me, createElementVNode as m, reactive as he, Fragment as we, renderList as ye, createCommentVNode as xe } from "vue";
3
+ import { useTheme as H, useLocale as Q, useDisplay as ke } from "vuetify";
4
4
  import { defineStore as le } from "pinia";
5
- import Ce from "axios";
6
- import { useRouter as re, useRoute as De } from "vue-router";
5
+ import be from "axios";
6
+ import { useRouter as re, useRoute as Ce } from "vue-router";
7
7
  /*! js-cookie v3.0.5 | MIT */
8
8
  function W(e) {
9
9
  for (var a = 1; a < arguments.length; a++) {
@@ -13,7 +13,7 @@ function W(e) {
13
13
  }
14
14
  return e;
15
15
  }
16
- var Se = {
16
+ var De = {
17
17
  read: function(e) {
18
18
  return e[0] === '"' && (e = e.slice(1, -1)), e.replace(/(%[\dA-F]{2})+/gi, decodeURIComponent);
19
19
  },
@@ -74,47 +74,47 @@ function X(e, a) {
74
74
  }
75
75
  );
76
76
  }
77
- var E = X(Se, { path: "/" });
78
- function lt(e) {
79
- const a = Ce.create({
77
+ var E = X(De, { path: "/" });
78
+ function rt(e) {
79
+ const a = be.create({
80
80
  timeout: 6e3
81
81
  });
82
82
  return a.defaults.baseURL = e.baseUrl, a.interceptors.request.use(
83
- (t) => Ve(t),
83
+ (t) => Se(t),
84
84
  (t) => {
85
- Re(t, e.onError);
85
+ Ve(t, e.onError);
86
86
  }
87
87
  ), a.interceptors.response.use(
88
- (t) => qe(t),
89
- (t) => Oe(t, e.onError)
88
+ (t) => Re(t),
89
+ (t) => qe(t, e.onError)
90
90
  ), a;
91
91
  }
92
- function Ve(e) {
92
+ function Se(e) {
93
93
  const a = E.get("accessToken") ?? "";
94
94
  return e.headers.Authorization = "Basic " + a, e.headers["Content-Type"] = "application/json", e.data = JSON.stringify(e.data), e;
95
95
  }
96
- function Re(e, a) {
96
+ function Ve(e, a) {
97
97
  console.error(e), a("request timeout");
98
98
  }
99
- function qe(e) {
99
+ function Re(e) {
100
100
  return e.data;
101
101
  }
102
- function Oe(e, a) {
102
+ function qe(e, a) {
103
103
  var o;
104
104
  const t = e.response;
105
105
  if (!t)
106
106
  return Promise.reject(e);
107
- t.status === 401 && Te();
107
+ t.status === 401 && Oe();
108
108
  let l = (o = t.data) == null ? void 0 : o.message;
109
109
  return l || (l = {
110
110
  code: t.status,
111
111
  message: t.statusText
112
112
  }), a(l), Promise.reject(e);
113
113
  }
114
- function Te() {
114
+ function Oe() {
115
115
  E.remove("accessToken"), E.remove("refreshToken"), E.remove("activeOrg"), re().replace({ path: "/passport/login" });
116
116
  }
117
- function je(e) {
117
+ function Te(e) {
118
118
  return { all: e = e || /* @__PURE__ */ new Map(), on: function(a, t) {
119
119
  var l = e.get(a);
120
120
  l ? l.push(t) : e.set(a, [t]);
@@ -130,8 +130,8 @@ function je(e) {
130
130
  });
131
131
  } };
132
132
  }
133
- const s = je();
134
- async function rt(e) {
133
+ const s = Te();
134
+ async function nt(e) {
135
135
  return new Promise((a) => {
136
136
  setTimeout(a, e);
137
137
  });
@@ -150,11 +150,11 @@ function ne() {
150
150
  const e = Date.now();
151
151
  return e - ee > 500 ? (ee = e, !0) : !1;
152
152
  }
153
- let Ie = 0;
153
+ let je = 0;
154
154
  function ce() {
155
- return ++Ie;
155
+ return ++je;
156
156
  }
157
- async function nt(e) {
157
+ async function ct(e) {
158
158
  if (!ne())
159
159
  return;
160
160
  let a = !1, t;
@@ -163,7 +163,7 @@ async function nt(e) {
163
163
  }, o = ce();
164
164
  return s.on("confirmDlgResult" + o, l), s.emit("confirmDlg", { ...e, seq: o }), await Y(() => a), s.off("confirmDlgResult" + o, l), t;
165
165
  }
166
- async function ct(e) {
166
+ async function ut(e) {
167
167
  if (!ne())
168
168
  return;
169
169
  let a = !1, t;
@@ -172,25 +172,44 @@ async function ct(e) {
172
172
  }, o = ce();
173
173
  return s.on("promptDlgResult" + o, l), s.emit("promptDlg", { ...e, seq: o }), await Y(() => a), s.off("promptDlgResult" + o, l), t;
174
174
  }
175
- function ut() {
175
+ function st() {
176
176
  s.emit("openWaitDlg");
177
177
  }
178
- function st() {
178
+ function pt() {
179
179
  s.emit("closeWaitDlg");
180
180
  }
181
- function pt(e, a) {
181
+ var Ie = /* @__PURE__ */ ((e) => (e.list_app_group = "list_app_group", e.create_app_group = "create_app_group", e.delete_app_group = "delete_app_group", e.update_app_group = "update_app_group", e.arrange_app_group = "arrange_app_group", e.list_app = "list_app", e.get_app = "get_app", e.create_app = "create_app", e.delete_app = "delete_app", e.update_app = "update_app", e.list_app_release = "list_app_release", e.get_app_release = "get_app_release", e.create_app_release = "create_app_release", e.delete_app_release = "delete_app_release", e.deploy_app_release = "deploy_app_release", e.open_app_layer = "open_app_layer", e.open_app = "open_app", e.list_calc_space = "list_calc_space", e.get_calc_space = "get_calc_space", e.create_calc_space = "create_calc_space", e.delete_calc_space = "delete_calc_space", e.update_calc_space = "update_calc_space", e.arrange_calc_space = "arrange_calc_space", e.list_func_group = "list_func_group", e.create_func_group = "create_func_group", e.delete_func_group = "delete_func_group", e.update_func_group = "update_func_group", e.arrange_func_group = "arrange_func_group", e.list_func = "list_func", e.get_func = "get_func", e.create_func = "create_func", e.delete_func = "delete_func", e.update_func = "update_func", e.debug_func = "debug_func", e.call_func = "call_func", e.list_func_release = "list_func_release", e.get_func_release = "get_func_release", e.create_func_release = "create_func_release", e.delete_func_release = "delete_func_release", e.deploy_func_release = "deploy_func_release", e.list_flow_group = "list_flow_group", e.create_flow_group = "create_flow_group", e.delete_flow_group = "delete_flow_group", e.update_flow_group = "update_flow_group", e.arrange_flow_group = "arrange_flow_group", e.list_flow = "list_flow", e.get_flow = "get_flow", e.create_flow = "create_flow", e.delete_flow = "delete_flow", e.update_flow = "update_flow", e.call_flow = "call_flow", e.list_flow_release = "list_flow_release", e.get_flow_release = "get_flow_release", e.create_flow_release = "create_flow_release", e.delete_flow_release = "delete_flow_release", e.deploy_flow_release = "deploy_flow_release", e.list_task = "list_task", e.get_task = "get_task", e.create_task = "create_task", e.delete_task = "delete_task", e.update_task = "update_task", e.call_task = "call_task", e.open_calc_layer = "open_calc_layer", e.list_db_space = "list_db_space", e.get_db_space = "get_db_space", e.create_db_space = "create_db_space", e.delete_db_space = "delete_db_space", e.update_db_space = "update_db_space", e.arrange_db_space = "arrange_db_space", e.list_model_group = "list_model_group", e.create_model_group = "create_model_group", e.delete_model_group = "delete_model_group", e.update_model_group = "update_model_group", e.arrange_model_group = "arrange_model_group", e.list_model = "list_model", e.get_model = "get_model", e.create_model = "create_model", e.delete_model = "delete_model", e.update_model = "update_model", e.get_model_data = "get_model_data", e.create_model_data = "create_model_data", e.delete_model_data = "delete_model_data", e.update_model_data = "update_model_data", e.get_graph = "get_graph", e.update_graph = "update_graph", e.list_change = "list_change", e.apply_change = "apply_change", e.open_data_layer = "open_data_layer", e.list_asset_space = "list_asset_space", e.get_asset_space = "get_asset_space", e.create_asset_space = "create_asset_space", e.delete_asset_space = "delete_asset_space", e.update_asset_space = "update_asset_space", e.arrange_asset_space = "arrange_asset_space", e.list_dir = "list_dir", e.create_dir = "create_dir", e.delete_dir = "delete_dir", e.update_dir = "update_dir", e.move_dir = "move_dir", e.list_asset = "list_asset", e.get_asset = "get_asset", e.create_asset = "create_asset", e.delete_asset = "delete_asset", e.update_asset = "update_asset", e.move_asset = "move_asset", e.open_asset_layer = "open_asset_layer", e.list_org_member = "list_org_member", e.add_org_member = "add_org_member", e.remove_org_member = "remove_org_member", e.update_org_member = "update_org_member", e.list_org_role = "list_org_role", e.get_org_role = "get_org_role", e.create_org_role = "create_org_role", e.delete_org_role = "delete_org_role", e.update_org_role = "update_org_role", e.arrange_org_role = "arrange_org_role", e.get_org_structure = "get_org_structure", e.update_org_structure = "update_org_structure", e.filter_model = "filter_model", e))(Ie || {});
182
+ function te(e, a) {
183
+ if (!e)
184
+ return !1;
185
+ let t = e;
186
+ return Object.keys(t).length <= 0 || (a.split("/").forEach((o) => {
187
+ if (Object.keys(t).length <= 0)
188
+ return !0;
189
+ if (t[o])
190
+ t = t[o];
191
+ else
192
+ return !1;
193
+ }), Object.keys(t).length <= 0);
194
+ }
195
+ const _t = d(1), dt = d(), it = d("en"), Ae = d({}), ft = d("");
196
+ function gt(e, a) {
197
+ const t = Ae.value[e];
198
+ return t ? a ? !(!te(t.includes, a) || te(t.excludes, a)) : !0 : !1;
199
+ }
200
+ function vt(e, a) {
182
201
  s.emit("message", { type: "error", text: e, timeout: a });
183
202
  }
184
- function _t(e, a) {
203
+ function mt(e, a) {
185
204
  s.emit("message", { type: "info", text: e, timeout: a });
186
205
  }
187
- function dt(e, a) {
206
+ function ht(e, a) {
188
207
  s.emit("message", { type: "success", text: e, timeout: a });
189
208
  }
190
- function ft(e, a) {
209
+ function wt(e, a) {
191
210
  s.emit("message", { type: "warning", text: e, timeout: a });
192
211
  }
193
- function it(e) {
212
+ function yt(e) {
194
213
  var l, o;
195
214
  if (!window.appAppear) {
196
215
  window.appAppear = !0;
@@ -201,20 +220,6 @@ function it(e) {
201
220
  t.add("app-reset");
202
221
  }, 0));
203
222
  }
204
- var Ae = /* @__PURE__ */ ((e) => (e.list_app_group = "list_app_group", e.create_app_group = "create_app_group", e.delete_app_group = "delete_app_group", e.update_app_group = "update_app_group", e.arrange_app_group = "arrange_app_group", e.list_app = "list_app", e.get_app = "get_app", e.create_app = "create_app", e.delete_app = "delete_app", e.update_app = "update_app", e.list_app_release = "list_app_release", e.get_app_release = "get_app_release", e.create_app_release = "create_app_release", e.delete_app_release = "delete_app_release", e.deploy_app_release = "deploy_app_release", e.open_app_layer = "open_app_layer", e.open_app = "open_app", e.list_calc_space = "list_calc_space", e.get_calc_space = "get_calc_space", e.create_calc_space = "create_calc_space", e.delete_calc_space = "delete_calc_space", e.update_calc_space = "update_calc_space", e.arrange_calc_space = "arrange_calc_space", e.list_func_group = "list_func_group", e.create_func_group = "create_func_group", e.delete_func_group = "delete_func_group", e.update_func_group = "update_func_group", e.arrange_func_group = "arrange_func_group", e.list_func = "list_func", e.get_func = "get_func", e.create_func = "create_func", e.delete_func = "delete_func", e.update_func = "update_func", e.debug_func = "debug_func", e.call_func = "call_func", e.list_func_release = "list_func_release", e.get_func_release = "get_func_release", e.create_func_release = "create_func_release", e.delete_func_release = "delete_func_release", e.deploy_func_release = "deploy_func_release", e.list_flow_group = "list_flow_group", e.create_flow_group = "create_flow_group", e.delete_flow_group = "delete_flow_group", e.update_flow_group = "update_flow_group", e.arrange_flow_group = "arrange_flow_group", e.list_flow = "list_flow", e.get_flow = "get_flow", e.create_flow = "create_flow", e.delete_flow = "delete_flow", e.update_flow = "update_flow", e.call_flow = "call_flow", e.list_flow_release = "list_flow_release", e.get_flow_release = "get_flow_release", e.create_flow_release = "create_flow_release", e.delete_flow_release = "delete_flow_release", e.deploy_flow_release = "deploy_flow_release", e.list_task = "list_task", e.get_task = "get_task", e.create_task = "create_task", e.delete_task = "delete_task", e.update_task = "update_task", e.call_task = "call_task", e.open_calc_layer = "open_calc_layer", e.list_db_space = "list_db_space", e.get_db_space = "get_db_space", e.create_db_space = "create_db_space", e.delete_db_space = "delete_db_space", e.update_db_space = "update_db_space", e.arrange_db_space = "arrange_db_space", e.list_model_group = "list_model_group", e.create_model_group = "create_model_group", e.delete_model_group = "delete_model_group", e.update_model_group = "update_model_group", e.arrange_model_group = "arrange_model_group", e.list_model = "list_model", e.get_model = "get_model", e.create_model = "create_model", e.delete_model = "delete_model", e.update_model = "update_model", e.get_model_data = "get_model_data", e.create_model_data = "create_model_data", e.delete_model_data = "delete_model_data", e.update_model_data = "update_model_data", e.get_graph = "get_graph", e.update_graph = "update_graph", e.list_change = "list_change", e.apply_change = "apply_change", e.open_data_layer = "open_data_layer", e.list_asset_space = "list_asset_space", e.get_asset_space = "get_asset_space", e.create_asset_space = "create_asset_space", e.delete_asset_space = "delete_asset_space", e.update_asset_space = "update_asset_space", e.arrange_asset_space = "arrange_asset_space", e.list_dir = "list_dir", e.create_dir = "create_dir", e.delete_dir = "delete_dir", e.update_dir = "update_dir", e.move_dir = "move_dir", e.list_asset = "list_asset", e.get_asset = "get_asset", e.create_asset = "create_asset", e.delete_asset = "delete_asset", e.update_asset = "update_asset", e.move_asset = "move_asset", e.open_asset_layer = "open_asset_layer", e.list_org_member = "list_org_member", e.add_org_member = "add_org_member", e.remove_org_member = "remove_org_member", e.update_org_member = "update_org_member", e.list_org_role = "list_org_role", e.get_org_role = "get_org_role", e.create_org_role = "create_org_role", e.delete_org_role = "delete_org_role", e.update_org_role = "update_org_role", e.arrange_org_role = "arrange_org_role", e.get_org_structure = "get_org_structure", e.update_org_structure = "update_org_structure", e.filter_model = "filter_model", e))(Ae || {});
205
- function te(e, a) {
206
- if (!e)
207
- return !1;
208
- let t = e;
209
- return Object.keys(t).length <= 0 || (a.split("/").forEach((o) => {
210
- if (Object.keys(t).length <= 0)
211
- return !0;
212
- if (t[o])
213
- t = t[o];
214
- else
215
- return !1;
216
- }), Object.keys(t).length <= 0);
217
- }
218
223
  const Ee = [
219
224
  { path: "/passport/login", level: 0 },
220
225
  { path: "/passport/loginAccount", level: 1 },
@@ -254,7 +259,7 @@ function ae(e) {
254
259
  const t = e.split("/");
255
260
  return console.assert(t.length >= 2), { app: t[1], path: a.path, level: a.level };
256
261
  }
257
- const oe = f("");
262
+ const oe = d("");
258
263
  function V(e, a) {
259
264
  const t = ae(e), l = ae(a), o = t.app === l.app, n = t.path === l.path, r = t.level >= l.level;
260
265
  console.info(
@@ -267,7 +272,7 @@ function Be() {
267
272
  function Me() {
268
273
  return !!E.get("activeOrg");
269
274
  }
270
- function gt(e, a, t) {
275
+ function xt(e, a, t) {
271
276
  const l = Be(), o = Me(), n = F(e.path);
272
277
  if (!n) {
273
278
  t();
@@ -307,10 +312,10 @@ function gt(e, a, t) {
307
312
  else
308
313
  V(e.path, a.path), t();
309
314
  }
310
- const ue = le(
315
+ const Ue = le(
311
316
  "global",
312
317
  () => {
313
- const e = H(), a = f(!0), t = f(1), l = f(), o = f("en"), n = f({}), r = f("");
318
+ const e = H(), a = d(!0), t = d(1), l = d(), o = d("en"), n = d({}), r = d("");
314
319
  return N(
315
320
  l,
316
321
  () => {
@@ -342,8 +347,8 @@ const ue = le(
342
347
  }
343
348
  ]
344
349
  }
345
- ), se = le("viewMgr", () => {
346
- const e = f([]);
350
+ ), ue = le("viewMgr", () => {
351
+ const e = d([]);
347
352
  function a() {
348
353
  return e.value.length <= 0;
349
354
  }
@@ -380,7 +385,7 @@ const ue = le(
380
385
  };
381
386
  });
382
387
  function Z(e, a) {
383
- const t = se(), l = g({
388
+ const t = ue(), l = g({
384
389
  get() {
385
390
  return t.hasView(e);
386
391
  },
@@ -396,10 +401,10 @@ function Z(e, a) {
396
401
  s.off(e, o);
397
402
  }), { open: l };
398
403
  }
399
- const Ue = /* @__PURE__ */ M({
404
+ const $e = /* @__PURE__ */ M({
400
405
  __name: "index",
401
406
  setup(e) {
402
- const a = Q(), { open: t } = Z("confirmDlg"), l = f(""), o = f(""), n = f(), r = f(), c = g(() => {
407
+ const a = Q(), { open: t } = Z("confirmDlg"), l = d(""), o = d(""), n = d(), r = d(), c = g(() => {
403
408
  var p;
404
409
  return ((p = n.value) == null ? void 0 : p.color) ?? "primary";
405
410
  }), u = g(() => {
@@ -421,25 +426,25 @@ const Ue = /* @__PURE__ */ M({
421
426
  }), O(() => {
422
427
  s.off("confirmDlg", j);
423
428
  });
424
- const i = () => {
429
+ const f = () => {
425
430
  t.value = !1, b || (s.emit("confirmDlgResult" + D, !0), b = !0);
426
431
  };
427
432
  return N(t, (p) => {
428
433
  !p && !b && (s.emit("confirmDlgResult" + D, !1), b = !0);
429
434
  }), (p, y) => {
430
- const C = h("v-card-text"), S = h("v-btn"), I = h("v-card-actions"), d = h("v-card"), x = h("v-dialog");
435
+ const C = h("v-card-text"), S = h("v-btn"), I = h("v-card-actions"), i = h("v-card"), x = h("v-dialog");
431
436
  return q(), B(x, {
432
437
  modelValue: z(t),
433
438
  "onUpdate:modelValue": y[1] || (y[1] = (U) => G(t) ? t.value = U : null),
434
439
  onKeydown: [
435
440
  y[2] || (y[2] = L(K((U) => t.value = !1, ["stop", "prevent"]), ["esc"])),
436
- L(K(i, ["stop", "prevent"]), ["enter"])
441
+ L(K(f, ["stop", "prevent"]), ["enter"])
437
442
  ],
438
443
  transition: "dialog-top-transition",
439
444
  "max-width": "600px"
440
445
  }, {
441
446
  default: w(() => [
442
- k(d, { title: l.value }, {
447
+ k(i, { title: l.value }, {
443
448
  default: w(() => [
444
449
  k(C, null, {
445
450
  default: w(() => [
@@ -460,7 +465,7 @@ const Ue = /* @__PURE__ */ M({
460
465
  _: 1
461
466
  }, 8, ["color"]),
462
467
  k(S, {
463
- onClick: i,
468
+ onClick: f,
464
469
  color: _.value,
465
470
  variant: "text"
466
471
  }, {
@@ -480,7 +485,7 @@ const Ue = /* @__PURE__ */ M({
480
485
  }, 8, ["modelValue", "onKeydown"]);
481
486
  };
482
487
  }
483
- }), $e = (e) => (me("data-v-f4ad116e"), e = e(), he(), e), Ke = /* @__PURE__ */ $e(() => /* @__PURE__ */ m("div", { class: "lds-spinner" }, [
488
+ }), Ke = (e) => (ve("data-v-f4ad116e"), e = e(), me(), e), We = /* @__PURE__ */ Ke(() => /* @__PURE__ */ m("div", { class: "lds-spinner" }, [
484
489
  /* @__PURE__ */ m("div"),
485
490
  /* @__PURE__ */ m("div"),
486
491
  /* @__PURE__ */ m("div"),
@@ -493,9 +498,9 @@ const Ue = /* @__PURE__ */ M({
493
498
  /* @__PURE__ */ m("div"),
494
499
  /* @__PURE__ */ m("div"),
495
500
  /* @__PURE__ */ m("div")
496
- ], -1)), We = [
497
- Ke
498
- ], ze = /* @__PURE__ */ M({
501
+ ], -1)), ze = [
502
+ We
503
+ ], Le = /* @__PURE__ */ M({
499
504
  __name: "index",
500
505
  props: {
501
506
  zIndex: {
@@ -510,15 +515,15 @@ const Ue = /* @__PURE__ */ M({
510
515
  }));
511
516
  return (o, n) => (q(), J("div", {
512
517
  class: "x-cont",
513
- style: ve(l.value)
514
- }, We, 4));
518
+ style: ge(l.value)
519
+ }, ze, 4));
515
520
  }
516
- }), pe = (e, a) => {
521
+ }), se = (e, a) => {
517
522
  const t = e.__vccOpts || e;
518
523
  for (const [l, o] of a)
519
524
  t[l] = o;
520
525
  return t;
521
- }, Le = /* @__PURE__ */ pe(ze, [["__scopeId", "data-v-f4ad116e"]]), Fe = /* @__PURE__ */ M({
526
+ }, Fe = /* @__PURE__ */ se(Le, [["__scopeId", "data-v-f4ad116e"]]), Ne = /* @__PURE__ */ M({
522
527
  __name: "item",
523
528
  props: {
524
529
  id: {},
@@ -528,7 +533,7 @@ const Ue = /* @__PURE__ */ M({
528
533
  },
529
534
  emits: ["timeout"],
530
535
  setup(e, { emit: a }) {
531
- const t = e, l = f(!0), o = a;
536
+ const t = e, l = d(!0), o = a;
532
537
  return R(() => {
533
538
  setTimeout(() => {
534
539
  o("timeout", t.id);
@@ -551,10 +556,10 @@ const Ue = /* @__PURE__ */ M({
551
556
  }, null, 8, ["modelValue", "type", "text"]);
552
557
  };
553
558
  }
554
- }), Ne = /* @__PURE__ */ M({
559
+ }), He = /* @__PURE__ */ M({
555
560
  __name: "index",
556
561
  setup(e) {
557
- const a = we({ items: [] });
562
+ const a = he({ items: [] });
558
563
  R(() => {
559
564
  s.on("message", t);
560
565
  }), O(() => {
@@ -578,7 +583,7 @@ const Ue = /* @__PURE__ */ M({
578
583
  }, ["stop"])),
579
584
  class: "x-cont d-flex flex-column-reverse align-center"
580
585
  }, [
581
- (q(!0), J(ye, null, xe(a.items, (_) => (q(), B(Fe, {
586
+ (q(!0), J(we, null, ye(a.items, (_) => (q(), B(Ne, {
582
587
  onTimeout: l,
583
588
  id: _.id,
584
589
  type: _.type,
@@ -588,26 +593,26 @@ const Ue = /* @__PURE__ */ M({
588
593
  }, null, 8, ["id", "type", "text", "timeout"]))), 128))
589
594
  ]));
590
595
  }
591
- }), He = /* @__PURE__ */ pe(Ne, [["__scopeId", "data-v-0ce1c82d"]]), Je = /* @__PURE__ */ M({
596
+ }), Je = /* @__PURE__ */ se(He, [["__scopeId", "data-v-0ce1c82d"]]), Xe = /* @__PURE__ */ M({
592
597
  __name: "index",
593
598
  setup(e) {
594
- const a = Q(), { open: t } = Z("promptDlg"), l = f(""), o = f(""), n = f(), r = f(), c = f(), u = f(""), _ = f(), v = f(), D = g(() => {
595
- var d;
596
- return ((d = _.value) == null ? void 0 : d.color) ?? "primary";
599
+ const a = Q(), { open: t } = Z("promptDlg"), l = d(""), o = d(""), n = d(), r = d(), c = d(), u = d(""), _ = d(), v = d(), D = g(() => {
600
+ var i;
601
+ return ((i = _.value) == null ? void 0 : i.color) ?? "primary";
597
602
  }), b = g(() => {
598
- var d;
599
- return ((d = _.value) == null ? void 0 : d.text) ?? a.t("cancel");
603
+ var i;
604
+ return ((i = _.value) == null ? void 0 : i.text) ?? a.t("cancel");
600
605
  }), j = g(() => {
601
- var d;
602
- return ((d = v.value) == null ? void 0 : d.color) ?? "primary";
603
- }), i = g(() => {
604
- var d;
605
- return ((d = v.value) == null ? void 0 : d.text) ?? a.t("confirm");
606
- }), p = f();
606
+ var i;
607
+ return ((i = v.value) == null ? void 0 : i.color) ?? "primary";
608
+ }), f = g(() => {
609
+ var i;
610
+ return ((i = v.value) == null ? void 0 : i.text) ?? a.t("confirm");
611
+ }), p = d();
607
612
  let y = 0, C = !1;
608
- const S = async (d) => {
613
+ const S = async (i) => {
609
614
  var x;
610
- l.value = d.title, o.value = d.text, n.value = d.label, r.value = d.placeholder, c.value = d.rules, u.value = d.value, _.value = d.cancel, v.value = d.confirm, y = d.seq, C = !1, t.value = !0, await Y(() => p.value !== void 0, 1e3), (x = p.value) == null || x.focus();
615
+ l.value = i.title, o.value = i.text, n.value = i.label, r.value = i.placeholder, c.value = i.rules, u.value = i.value, _.value = i.cancel, v.value = i.confirm, y = i.seq, C = !1, t.value = !0, await Y(() => p.value !== void 0, 1e3), (x = p.value) == null || x.focus();
611
616
  };
612
617
  R(() => {
613
618
  s.on("promptDlg", S);
@@ -617,11 +622,11 @@ const Ue = /* @__PURE__ */ M({
617
622
  const I = () => {
618
623
  t.value = !1, C || (s.emit("promptDlgResult" + y, u.value ?? ""), C = !0);
619
624
  };
620
- return N(t, (d) => {
621
- !d && !C && (s.emit("promptDlgResult" + y, void 0), C = !0);
622
- }), (d, x) => {
623
- const U = h("v-card-text"), _e = h("v-text-field"), de = h("v-form"), P = h("v-btn"), fe = h("v-card-actions"), ie = h("v-card"), ge = h("v-dialog");
624
- return q(), B(ge, {
625
+ return N(t, (i) => {
626
+ !i && !C && (s.emit("promptDlgResult" + y, void 0), C = !0);
627
+ }), (i, x) => {
628
+ const U = h("v-card-text"), pe = h("v-text-field"), _e = h("v-form"), P = h("v-btn"), de = h("v-card-actions"), ie = h("v-card"), fe = h("v-dialog");
629
+ return q(), B(fe, {
625
630
  modelValue: z(t),
626
631
  "onUpdate:modelValue": x[2] || (x[2] = ($) => G(t) ? t.value = $ : null),
627
632
  onKeydown: [
@@ -639,10 +644,10 @@ const Ue = /* @__PURE__ */ M({
639
644
  A(T(o.value), 1)
640
645
  ]),
641
646
  _: 1
642
- })) : ke("", !0),
643
- k(de, { class: "mx-3" }, {
647
+ })) : xe("", !0),
648
+ k(_e, { class: "mx-3" }, {
644
649
  default: w(() => [
645
- k(_e, {
650
+ k(pe, {
646
651
  modelValue: u.value,
647
652
  "onUpdate:modelValue": x[0] || (x[0] = ($) => u.value = $),
648
653
  label: n.value,
@@ -654,7 +659,7 @@ const Ue = /* @__PURE__ */ M({
654
659
  ]),
655
660
  _: 1
656
661
  }),
657
- k(fe, { class: "d-flex justify-end" }, {
662
+ k(de, { class: "d-flex justify-end" }, {
658
663
  default: w(() => [
659
664
  k(P, {
660
665
  onClick: x[1] || (x[1] = ($) => t.value = !1),
@@ -672,7 +677,7 @@ const Ue = /* @__PURE__ */ M({
672
677
  variant: "text"
673
678
  }, {
674
679
  default: w(() => [
675
- A(T(i.value), 1)
680
+ A(T(f.value), 1)
676
681
  ]),
677
682
  _: 1
678
683
  }, 8, ["color"])
@@ -687,7 +692,7 @@ const Ue = /* @__PURE__ */ M({
687
692
  }, 8, ["modelValue", "onKeydown"]);
688
693
  };
689
694
  }
690
- }), Xe = { class: "mx-auto my-auto" }, Ge = { class: "d-flex align-center justify-center w-100 h-100" }, Qe = /* @__PURE__ */ M({
695
+ }), Ge = { class: "mx-auto my-auto" }, Qe = { class: "d-flex align-center justify-center w-100 h-100" }, Ye = /* @__PURE__ */ M({
691
696
  __name: "index",
692
697
  setup(e) {
693
698
  const a = Q(), { open: t } = Z("waitDlg"), l = () => {
@@ -709,14 +714,14 @@ const Ue = /* @__PURE__ */ M({
709
714
  fullscreen: ""
710
715
  }, {
711
716
  default: w(() => [
712
- m("div", Xe, [
717
+ m("div", Ge, [
713
718
  k(c, {
714
719
  width: "300px",
715
720
  height: "80px",
716
721
  loading: ""
717
722
  }, {
718
723
  default: w(() => [
719
- m("div", Ge, [
724
+ m("div", Qe, [
720
725
  m("span", null, T(z(a).t("waitingResponse")), 1)
721
726
  ])
722
727
  ]),
@@ -728,10 +733,10 @@ const Ue = /* @__PURE__ */ M({
728
733
  }, 8, ["modelValue"]);
729
734
  };
730
735
  }
731
- }), Ye = (e) => {
732
- e.component("x-confirm-dlg", Ue), e.component("x-loading", Le), e.component("x-message", He), e.component("x-prompt-dlg", Je), e.component("x-wait-dlg", Qe);
736
+ }), Ze = (e) => {
737
+ e.component("x-confirm-dlg", $e), e.component("x-loading", Fe), e.component("x-message", Je), e.component("x-prompt-dlg", Xe), e.component("x-wait-dlg", Ye);
733
738
  };
734
- function vt() {
739
+ function kt() {
735
740
  const e = H(), a = g(() => e.global.current.value.colors.primary), t = g(() => e.global.current.value.colors.secondary), l = g(() => e.current.value.dark ? "#2e2e2e" : "#bdbdbd"), o = g(() => e.current.value.dark ? "#272727" : "#eeeeee"), n = g(() => e.current.value.dark ? "#1e1e1e" : "#ffffff"), r = g(() => e.current.value.dark ? "#303030" : "#f6f6f6"), c = g(() => e.current.value.dark ? "#ffffff1f" : "#0000001f");
736
741
  return {
737
742
  primaryColor: a,
@@ -743,11 +748,11 @@ function vt() {
743
748
  borderColor: c
744
749
  };
745
750
  }
746
- function Ze(e, a) {
751
+ function Pe(e, a) {
747
752
  return e.post("pullPermission", a);
748
753
  }
749
- function mt(e, a) {
750
- const t = De(), l = re(), o = ue(), n = se(), r = () => {
754
+ function bt(e, a) {
755
+ const t = Ce(), l = re(), o = Ue(), n = ue(), r = () => {
751
756
  o.running = !1;
752
757
  }, c = () => {
753
758
  o.running = !0;
@@ -757,8 +762,8 @@ function mt(e, a) {
757
762
  n.hasView("waitDlg") || n.popView();
758
763
  return;
759
764
  }
760
- const i = F(t.path);
761
- (i == null ? void 0 : i.level) === 0 ? (p = navigator == null ? void 0 : navigator.Backbutton) == null || p.goHome(
765
+ const f = F(t.path);
766
+ (f == null ? void 0 : f.level) === 0 ? (p = navigator == null ? void 0 : navigator.Backbutton) == null || p.goHome(
762
767
  () => {
763
768
  },
764
769
  () => {
@@ -770,16 +775,16 @@ function mt(e, a) {
770
775
  }), O(() => {
771
776
  s.off("pause", r), s.off("resume", c), s.off("backbutton", u);
772
777
  });
773
- const _ = (i) => {
774
- if (i.key === "Escape") {
778
+ const _ = (f) => {
779
+ if (f.key === "Escape") {
775
780
  u();
776
781
  return;
777
782
  }
778
- if (!e && i.ctrlKey && i.altKey && i.code === "KeyD") {
783
+ if (!e && f.ctrlKey && f.altKey && f.code === "KeyD") {
779
784
  o.dark = !o.dark;
780
785
  return;
781
786
  }
782
- if (!e && i.ctrlKey && i.altKey && i.code === "KeyL") {
787
+ if (!e && f.ctrlKey && f.altKey && f.code === "KeyL") {
783
788
  o.locale === "en" ? o.locale = "zhHans" : o.locale = "en";
784
789
  return;
785
790
  }
@@ -793,10 +798,10 @@ function mt(e, a) {
793
798
  const D = async () => {
794
799
  if (!o.running)
795
800
  return;
796
- const i = F(t.path);
797
- if (!(!i || i.requiredState !== "org"))
801
+ const f = F(t.path);
802
+ if (!(!f || f.requiredState !== "org"))
798
803
  try {
799
- const { update: p, permissions: y } = await Ze(a, {
804
+ const { update: p, permissions: y } = await Pe(a, {
800
805
  checksum: o.permissionChecksum
801
806
  });
802
807
  if (!p)
@@ -812,8 +817,8 @@ function mt(e, a) {
812
817
  } catch (p) {
813
818
  console.error(p);
814
819
  }
815
- }, b = async (i) => {
816
- i && await D(), clearTimeout(v), v = setTimeout(async () => {
820
+ }, b = async (f) => {
821
+ f && await D(), clearTimeout(v), v = setTimeout(async () => {
817
822
  await D(), v && b();
818
823
  }, 3e3);
819
824
  }, j = () => {
@@ -825,44 +830,41 @@ function mt(e, a) {
825
830
  j();
826
831
  });
827
832
  }
828
- function ht() {
829
- const e = ue();
830
- function a(t, l) {
831
- const o = e.permissionObjects[t];
832
- return o ? l ? !(!te(o.includes, l) || te(o.excludes, l)) : !0 : !1;
833
- }
834
- return { verifyPermission: a };
835
- }
836
- function wt() {
837
- const e = H(), a = be(), t = g(() => e.current.value.dark), l = g(() => !!window.cordova), o = g(() => a.width.value <= 1280 ? a.width.value + "px" : a.width.value <= 1920 ? 1920 / 2.5 + "px" : 2560 / 2.5 + "px");
833
+ function Ct() {
834
+ const e = H(), a = ke(), t = g(() => e.current.value.dark), l = g(() => !!window.cordova), o = g(() => a.width.value <= 1280 ? a.width.value + "px" : a.width.value <= 1920 ? 1920 / 2.5 + "px" : 2560 / 2.5 + "px");
838
835
  return { dark: t, sysBarAvail: l, compactWidth: o };
839
836
  }
840
- const yt = { install: Ye };
837
+ const Dt = { install: Ze };
841
838
  export {
842
- Ae as Permission,
843
- it as appAppear,
844
- st as closeWaitDlg,
845
- lt as createAxios,
846
- yt as default,
839
+ Ie as Permission,
840
+ yt as appAppear,
841
+ pt as closeWaitDlg,
842
+ rt as createAxios,
843
+ dt as dark,
844
+ Dt as default,
847
845
  s as eventBus,
848
846
  te as isExist,
847
+ it as locale,
848
+ _t as mainActive,
849
849
  F as matchRouteMeta,
850
- pt as messageError,
851
- _t as messageInfo,
852
- dt as messageSuccess,
853
- ft as messageWarning,
854
- gt as onBeforeEach,
855
- nt as openConfirmDlg,
856
- ct as openPromptDlg,
857
- ut as openWaitDlg,
850
+ vt as messageError,
851
+ mt as messageInfo,
852
+ ht as messageSuccess,
853
+ wt as messageWarning,
854
+ xt as onBeforeEach,
855
+ ct as openConfirmDlg,
856
+ ut as openPromptDlg,
857
+ st as openWaitDlg,
858
+ ft as permissionChecksum,
859
+ Ae as permissionObjects,
858
860
  oe as routeTransName,
859
- vt as useColor,
860
- ue as useGlobalStore,
861
- mt as useMicroApp,
862
- ht as usePermission,
863
- wt as useSystem,
864
- se as useViewMgrStore,
861
+ kt as useColor,
862
+ Ue as useGlobalStore,
863
+ bt as useMicroApp,
864
+ Ct as useSystem,
865
+ ue as useViewMgrStore,
865
866
  Z as useViewStack,
866
- rt as waitMs,
867
+ gt as verifyPermission,
868
+ nt as waitMs,
867
869
  Y as waitUtil
868
870
  };
@@ -0,0 +1,7 @@
1
+ import { Permission, PermissionObjects } from './permission';
2
+ export declare const mainActive: import("vue").Ref<0 | 1 | 2 | 3 | 4>;
3
+ export declare const dark: import("vue").Ref<boolean | undefined>;
4
+ export declare const locale: import("vue").Ref<string>;
5
+ export declare const permissionObjects: import("vue").Ref<PermissionObjects>;
6
+ export declare const permissionChecksum: import("vue").Ref<string>;
7
+ export declare function verifyPermission(permission: Permission, instance: string): boolean;
@@ -1,6 +1,7 @@
1
1
  export * from './axios';
2
2
  export * from './core';
3
3
  export * from './dialog';
4
+ export * from './global';
4
5
  export * from './message';
5
6
  export * from './misc';
6
7
  export * from './permission';
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "x-essential-lib",
3
3
  "private": false,
4
- "version": "0.5.12",
4
+ "version": "0.5.13",
5
5
  "type": "module",
6
6
  "module": "dist/index.js",
7
7
  "types": "dist/index.d.ts",