qc-ui-lit 0.0.1 → 0.0.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -16,11 +16,23 @@ export declare class AMap extends LitElement {
16
16
  center: [number, number];
17
17
  zooms: [number, number];
18
18
  animateEnable: boolean;
19
+ loading: boolean;
19
20
  AMap: any;
20
21
  map: any;
22
+ operatingData: {
23
+ timeoutFlag: NodeJS.Timeout | null;
24
+ };
21
25
  protected createRenderRoot(): this;
22
26
  constructor();
27
+ connectedCallback(): Promise<void>;
23
28
  firstUpdated(): Promise<void>;
29
+ disconnectedCallback(): void;
24
30
  initAMap(): void;
31
+ oncomplete: () => void;
32
+ onStartOperating: () => void;
33
+ onEndOperating_timeout: () => void;
34
+ onzoomchange: () => void;
35
+ addEventListeners(): void;
36
+ removeEventListener(): void;
25
37
  render(): import("lit-html").TemplateResult<1>;
26
38
  }
@@ -0,0 +1,16 @@
1
+ import { LitElement } from 'lit';
2
+ declare global {
3
+ interface HTMLElementTagNameMap {
4
+ 'qc-loading': QCLoading;
5
+ }
6
+ }
7
+ export declare class QCLoading extends LitElement {
8
+ loading: boolean;
9
+ classes: {
10
+ 'qc-loading': boolean;
11
+ loading: boolean;
12
+ };
13
+ willUpdate(changedProperties: Map<string, any>): void;
14
+ protected render(): import("lit-html").TemplateResult<1>;
15
+ static styles: import("lit").CSSResult;
16
+ }
@@ -1 +1,2 @@
1
+ export * from './Loading/qc-loading';
1
2
  export * from './AMap/a-map';
package/dist/index.css CHANGED
@@ -1 +1 @@
1
- #a-map{width:100%;height:100%;position:relative}#a-map .a-map-container{background-color:#0ff;width:100%;height:100%}.amap-logo,.amap-copyright{display:none!important}
1
+ #a-map{width:100%;height:100%;position:relative}#a-map .a-map-container{width:100%;height:100%}.amap-logo,.amap-copyright{display:none!important}
package/dist/qc-ui-lit.js CHANGED
@@ -1,81 +1,39 @@
1
- //#region src/tools/loadAMap/loadAMap.ts
2
- var e, t = {
3
- version: "2.0",
4
- key: "94af010abe03a5b2a2f98e6739a11d0c",
5
- secret: "031abe8352fc9fa9ac8d14a86a5ec1cf"
6
- };
7
- function n() {
8
- return new Promise((t) => {
9
- let n = document.createElement("script");
10
- n.innerHTML = `
11
- window._AMapSecurityConfig = {
12
- securityJsCode: '${e.secret}',
13
- };`, document.head.appendChild(n), t(null);
14
- });
15
- }
16
- function r() {
17
- let t = `${e.url}?v=${e.version}&key=${e.key}&plugin=${e.plugins.join(",")}`;
18
- return new Promise((e, n) => {
19
- let r = document.createElement("script");
20
- r.async = !1, r.src = t, r.onerror = n, r.onload = e, document.head.appendChild(r);
21
- });
22
- }
23
- function i() {
24
- let t = `${e.locaUrl}?v=${e.version}&key=${e.key}&plugin=${e.plugins.join(",")}`;
25
- return new Promise((e, n) => {
26
- let r = document.createElement("script");
27
- r.async = !1, r.src = t, r.onerror = n, r.onload = e, document.head.appendChild(r);
28
- });
29
- }
30
- var a = async (a) => {
31
- e = {
32
- ...a,
33
- key: a.key || t.key,
34
- secret: a.secret || t.secret,
35
- plugins: a.plugins || []
36
- };
37
- try {
38
- let e = window;
39
- if (await n(), await r(), await i(), e.AMap) a.onLoad && a.onLoad();
40
- else throw Error("AMap not loaded");
41
- } catch (e) {
42
- a.onError && a.onError(e);
43
- }
44
- }, o = (e) => (t, n) => {
45
- n === void 0 ? customElements.define(e, t) : n.addInitializer(() => {
46
- customElements.define(e, t);
47
- });
48
- }, s = globalThis, c = s.ShadowRoot && (s.ShadyCSS === void 0 || s.ShadyCSS.nativeShadow) && "adoptedStyleSheets" in Document.prototype && "replace" in CSSStyleSheet.prototype, l = Symbol(), u = /* @__PURE__ */ new WeakMap(), d = class {
49
- constructor(e, t, n) {
50
- if (this._$cssResult$ = !0, n !== l) throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");
1
+ //#region node_modules/@lit/reactive-element/css-tag.js
2
+ var e = globalThis, t = e.ShadowRoot && (e.ShadyCSS === void 0 || e.ShadyCSS.nativeShadow) && "adoptedStyleSheets" in Document.prototype && "replace" in CSSStyleSheet.prototype, n = Symbol(), r = /* @__PURE__ */ new WeakMap(), i = class {
3
+ constructor(e, t, r) {
4
+ if (this._$cssResult$ = !0, r !== n) throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");
51
5
  this.cssText = e, this.t = t;
52
6
  }
53
7
  get styleSheet() {
54
- let e = this.o, t = this.t;
55
- if (c && e === void 0) {
56
- let n = t !== void 0 && t.length === 1;
57
- n && (e = u.get(t)), e === void 0 && ((this.o = e = new CSSStyleSheet()).replaceSync(this.cssText), n && u.set(t, e));
8
+ let e = this.o, n = this.t;
9
+ if (t && e === void 0) {
10
+ let t = n !== void 0 && n.length === 1;
11
+ t && (e = r.get(n)), e === void 0 && ((this.o = e = new CSSStyleSheet()).replaceSync(this.cssText), t && r.set(n, e));
58
12
  }
59
13
  return e;
60
14
  }
61
15
  toString() {
62
16
  return this.cssText;
63
17
  }
64
- }, ee = (e) => new d(typeof e == "string" ? e : e + "", void 0, l), te = (e, t) => {
65
- if (c) e.adoptedStyleSheets = t.map((e) => e instanceof CSSStyleSheet ? e : e.styleSheet);
66
- else for (let n of t) {
67
- let t = document.createElement("style"), r = s.litNonce;
68
- r !== void 0 && t.setAttribute("nonce", r), t.textContent = n.cssText, e.appendChild(t);
69
- }
70
- }, f = c ? (e) => e : (e) => e instanceof CSSStyleSheet ? ((e) => {
18
+ }, a = (e) => new i(typeof e == "string" ? e : e + "", void 0, n), o = (e, ...t) => new i(e.length === 1 ? e[0] : t.reduce((t, n, r) => t + ((e) => {
19
+ if (!0 === e._$cssResult$) return e.cssText;
20
+ if (typeof e == "number") return e;
21
+ throw Error("Value passed to 'css' function must be a 'css' function result: " + e + ". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.");
22
+ })(n) + e[r + 1], e[0]), e, n), s = (n, r) => {
23
+ if (t) n.adoptedStyleSheets = r.map((e) => e instanceof CSSStyleSheet ? e : e.styleSheet);
24
+ else for (let t of r) {
25
+ let r = document.createElement("style"), i = e.litNonce;
26
+ i !== void 0 && r.setAttribute("nonce", i), r.textContent = t.cssText, n.appendChild(r);
27
+ }
28
+ }, c = t ? (e) => e : (e) => e instanceof CSSStyleSheet ? ((e) => {
71
29
  let t = "";
72
30
  for (let n of e.cssRules) t += n.cssText;
73
- return ee(t);
74
- })(e) : e, { is: ne, defineProperty: re, getOwnPropertyDescriptor: ie, getOwnPropertyNames: ae, getOwnPropertySymbols: oe, getPrototypeOf: se } = Object, p = globalThis, m = p.trustedTypes, ce = m ? m.emptyScript : "", le = p.reactiveElementPolyfillSupport, h = (e, t) => e, g = {
31
+ return a(t);
32
+ })(e) : e, { is: l, defineProperty: u, getOwnPropertyDescriptor: d, getOwnPropertyNames: ee, getOwnPropertySymbols: te, getPrototypeOf: ne } = Object, f = globalThis, p = f.trustedTypes, re = p ? p.emptyScript : "", ie = f.reactiveElementPolyfillSupport, m = (e, t) => e, h = {
75
33
  toAttribute(e, t) {
76
34
  switch (t) {
77
35
  case Boolean:
78
- e = e ? ce : null;
36
+ e = e ? re : null;
79
37
  break;
80
38
  case Object:
81
39
  case Array: e = e == null ? e : JSON.stringify(e);
@@ -100,30 +58,30 @@ var a = async (a) => {
100
58
  }
101
59
  return n;
102
60
  }
103
- }, _ = (e, t) => !ne(e, t), v = {
61
+ }, g = (e, t) => !l(e, t), _ = {
104
62
  attribute: !0,
105
63
  type: String,
106
- converter: g,
64
+ converter: h,
107
65
  reflect: !1,
108
66
  useDefault: !1,
109
- hasChanged: _
67
+ hasChanged: g
110
68
  };
111
- Symbol.metadata ??= Symbol("metadata"), p.litPropertyMetadata ??= /* @__PURE__ */ new WeakMap();
112
- var y = class extends HTMLElement {
69
+ Symbol.metadata ??= Symbol("metadata"), f.litPropertyMetadata ??= /* @__PURE__ */ new WeakMap();
70
+ var v = class extends HTMLElement {
113
71
  static addInitializer(e) {
114
72
  this._$Ei(), (this.l ??= []).push(e);
115
73
  }
116
74
  static get observedAttributes() {
117
75
  return this.finalize(), this._$Eh && [...this._$Eh.keys()];
118
76
  }
119
- static createProperty(e, t = v) {
77
+ static createProperty(e, t = _) {
120
78
  if (t.state && (t.attribute = !1), this._$Ei(), this.prototype.hasOwnProperty(e) && ((t = Object.create(t)).wrapped = !0), this.elementProperties.set(e, t), !t.noAccessor) {
121
79
  let n = Symbol(), r = this.getPropertyDescriptor(e, n, t);
122
- r !== void 0 && re(this.prototype, e, r);
80
+ r !== void 0 && u(this.prototype, e, r);
123
81
  }
124
82
  }
125
83
  static getPropertyDescriptor(e, t, n) {
126
- let { get: r, set: i } = ie(this.prototype, e) ?? {
84
+ let { get: r, set: i } = d(this.prototype, e) ?? {
127
85
  get() {
128
86
  return this[t];
129
87
  },
@@ -142,17 +100,17 @@ var y = class extends HTMLElement {
142
100
  };
143
101
  }
144
102
  static getPropertyOptions(e) {
145
- return this.elementProperties.get(e) ?? v;
103
+ return this.elementProperties.get(e) ?? _;
146
104
  }
147
105
  static _$Ei() {
148
- if (this.hasOwnProperty(h("elementProperties"))) return;
149
- let e = se(this);
106
+ if (this.hasOwnProperty(m("elementProperties"))) return;
107
+ let e = ne(this);
150
108
  e.finalize(), e.l !== void 0 && (this.l = [...e.l]), this.elementProperties = new Map(e.elementProperties);
151
109
  }
152
110
  static finalize() {
153
- if (this.hasOwnProperty(h("finalized"))) return;
154
- if (this.finalized = !0, this._$Ei(), this.hasOwnProperty(h("properties"))) {
155
- let e = this.properties, t = [...ae(e), ...oe(e)];
111
+ if (this.hasOwnProperty(m("finalized"))) return;
112
+ if (this.finalized = !0, this._$Ei(), this.hasOwnProperty(m("properties"))) {
113
+ let e = this.properties, t = [...ee(e), ...te(e)];
156
114
  for (let n of t) this.createProperty(n, e[n]);
157
115
  }
158
116
  let e = this[Symbol.metadata];
@@ -171,8 +129,8 @@ var y = class extends HTMLElement {
171
129
  let t = [];
172
130
  if (Array.isArray(e)) {
173
131
  let n = new Set(e.flat(Infinity).reverse());
174
- for (let e of n) t.unshift(f(e));
175
- } else e !== void 0 && t.push(f(e));
132
+ for (let e of n) t.unshift(c(e));
133
+ } else e !== void 0 && t.push(c(e));
176
134
  return t;
177
135
  }
178
136
  static _$Eu(e, t) {
@@ -198,7 +156,7 @@ var y = class extends HTMLElement {
198
156
  }
199
157
  createRenderRoot() {
200
158
  let e = this.shadowRoot ?? this.attachShadow(this.constructor.shadowRootOptions);
201
- return te(e, this.constructor.elementStyles), e;
159
+ return s(e, this.constructor.elementStyles), e;
202
160
  }
203
161
  connectedCallback() {
204
162
  this.renderRoot ??= this.createRenderRoot(), this.enableUpdating(!0), this._$EO?.forEach((e) => e.hostConnected?.());
@@ -213,14 +171,14 @@ var y = class extends HTMLElement {
213
171
  _$ET(e, t) {
214
172
  let n = this.constructor.elementProperties.get(e), r = this.constructor._$Eu(e, n);
215
173
  if (r !== void 0 && !0 === n.reflect) {
216
- let i = (n.converter?.toAttribute === void 0 ? g : n.converter).toAttribute(t, n.type);
174
+ let i = (n.converter?.toAttribute === void 0 ? h : n.converter).toAttribute(t, n.type);
217
175
  this._$Em = e, i == null ? this.removeAttribute(r) : this.setAttribute(r, i), this._$Em = null;
218
176
  }
219
177
  }
220
178
  _$AK(e, t) {
221
179
  let n = this.constructor, r = n._$Eh.get(e);
222
180
  if (r !== void 0 && this._$Em !== r) {
223
- let e = n.getPropertyOptions(r), i = typeof e.converter == "function" ? { fromAttribute: e.converter } : e.converter?.fromAttribute === void 0 ? g : e.converter;
181
+ let e = n.getPropertyOptions(r), i = typeof e.converter == "function" ? { fromAttribute: e.converter } : e.converter?.fromAttribute === void 0 ? h : e.converter;
224
182
  this._$Em = r;
225
183
  let a = i.fromAttribute(t, e.type);
226
184
  this[r] = a ?? this._$Ej?.get(r) ?? a, this._$Em = null;
@@ -229,7 +187,7 @@ var y = class extends HTMLElement {
229
187
  requestUpdate(e, t, n, r = !1, i) {
230
188
  if (e !== void 0) {
231
189
  let a = this.constructor;
232
- if (!1 === r && (i = this[e]), n ??= a.getPropertyOptions(e), !((n.hasChanged ?? _)(i, t) || n.useDefault && n.reflect && i === this._$Ej?.get(e) && !this.hasAttribute(a._$Eu(e, n)))) return;
190
+ if (!1 === r && (i = this[e]), n ??= a.getPropertyOptions(e), !((n.hasChanged ?? g)(i, t) || n.useDefault && n.reflect && i === this._$Ej?.get(e) && !this.hasAttribute(a._$Eu(e, n)))) return;
233
191
  this.C(e, t, n);
234
192
  }
235
193
  !1 === this.isUpdatePending && (this._$ES = this._$EP());
@@ -293,124 +251,87 @@ var y = class extends HTMLElement {
293
251
  updated(e) {}
294
252
  firstUpdated(e) {}
295
253
  };
296
- y.elementStyles = [], y.shadowRootOptions = { mode: "open" }, y[h("elementProperties")] = /* @__PURE__ */ new Map(), y[h("finalized")] = /* @__PURE__ */ new Map(), le?.({ ReactiveElement: y }), (p.reactiveElementVersions ??= []).push("2.1.2");
297
- //#endregion
298
- //#region node_modules/@lit/reactive-element/decorators/property.js
299
- var b = {
300
- attribute: !0,
301
- type: String,
302
- converter: g,
303
- reflect: !1,
304
- hasChanged: _
305
- }, ue = (e = b, t, n) => {
306
- let { kind: r, metadata: i } = n, a = globalThis.litPropertyMetadata.get(i);
307
- if (a === void 0 && globalThis.litPropertyMetadata.set(i, a = /* @__PURE__ */ new Map()), r === "setter" && ((e = Object.create(e)).wrapped = !0), a.set(n.name, e), r === "accessor") {
308
- let { name: r } = n;
309
- return {
310
- set(n) {
311
- let i = t.get.call(this);
312
- t.set.call(this, n), this.requestUpdate(r, i, e, !0, n);
313
- },
314
- init(t) {
315
- return t !== void 0 && this.C(r, void 0, e, t), t;
316
- }
317
- };
318
- }
319
- if (r === "setter") {
320
- let { name: r } = n;
321
- return function(n) {
322
- let i = this[r];
323
- t.call(this, n), this.requestUpdate(r, i, e, !0, n);
324
- };
325
- }
326
- throw Error("Unsupported decorator location: " + r);
327
- };
328
- function x(e) {
329
- return (t, n) => typeof n == "object" ? ue(e, t, n) : ((e, t, n) => {
330
- let r = t.hasOwnProperty(n);
331
- return t.constructor.createProperty(n, e), r ? Object.getOwnPropertyDescriptor(t, n) : void 0;
332
- })(e, t, n);
333
- }
254
+ v.elementStyles = [], v.shadowRootOptions = { mode: "open" }, v[m("elementProperties")] = /* @__PURE__ */ new Map(), v[m("finalized")] = /* @__PURE__ */ new Map(), ie?.({ ReactiveElement: v }), (f.reactiveElementVersions ??= []).push("2.1.2");
334
255
  //#endregion
335
256
  //#region node_modules/lit-html/lit-html.js
336
- var S = globalThis, C = (e) => e, w = S.trustedTypes, T = w ? w.createPolicy("lit-html", { createHTML: (e) => e }) : void 0, E = "$lit$", D = `lit$${Math.random().toFixed(9).slice(2)}$`, O = "?" + D, de = `<${O}>`, k = document, A = () => k.createComment(""), j = (e) => e === null || typeof e != "object" && typeof e != "function", M = Array.isArray, fe = (e) => M(e) || typeof e?.[Symbol.iterator] == "function", N = "[ \n\f\r]", P = /<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g, F = /-->/g, I = />/g, L = RegExp(`>|${N}(?:([^\\s"'>=/]+)(${N}*=${N}*(?:[^ \t\n\f\r"'\`<>=]|("|')|))|$)`, "g"), R = /'/g, z = /"/g, B = /^(?:script|style|textarea|title)$/i, pe = ((e) => (t, ...n) => ({
257
+ var y = globalThis, b = (e) => e, x = y.trustedTypes, S = x ? x.createPolicy("lit-html", { createHTML: (e) => e }) : void 0, C = "$lit$", w = `lit$${Math.random().toFixed(9).slice(2)}$`, T = "?" + w, ae = `<${T}>`, E = document, D = () => E.createComment(""), O = (e) => e === null || typeof e != "object" && typeof e != "function", k = Array.isArray, oe = (e) => k(e) || typeof e?.[Symbol.iterator] == "function", A = "[ \n\f\r]", j = /<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g, se = /-->/g, ce = />/g, M = RegExp(`>|${A}(?:([^\\s"'>=/]+)(${A}*=${A}*(?:[^ \t\n\f\r"'\`<>=]|("|')|))|$)`, "g"), le = /'/g, N = /"/g, P = /^(?:script|style|textarea|title)$/i, F = ((e) => (t, ...n) => ({
337
258
  _$litType$: e,
338
259
  strings: t,
339
260
  values: n
340
- }))(1), V = Symbol.for("lit-noChange"), H = Symbol.for("lit-nothing"), U = /* @__PURE__ */ new WeakMap(), W = k.createTreeWalker(k, 129);
341
- function G(e, t) {
342
- if (!M(e) || !e.hasOwnProperty("raw")) throw Error("invalid template strings array");
343
- return T === void 0 ? t : T.createHTML(t);
261
+ }))(1), I = Symbol.for("lit-noChange"), L = Symbol.for("lit-nothing"), R = /* @__PURE__ */ new WeakMap(), z = E.createTreeWalker(E, 129);
262
+ function B(e, t) {
263
+ if (!k(e) || !e.hasOwnProperty("raw")) throw Error("invalid template strings array");
264
+ return S === void 0 ? t : S.createHTML(t);
344
265
  }
345
- var me = (e, t) => {
346
- let n = e.length - 1, r = [], i, a = t === 2 ? "<svg>" : t === 3 ? "<math>" : "", o = P;
266
+ var ue = (e, t) => {
267
+ let n = e.length - 1, r = [], i, a = t === 2 ? "<svg>" : t === 3 ? "<math>" : "", o = j;
347
268
  for (let t = 0; t < n; t++) {
348
269
  let n = e[t], s, c, l = -1, u = 0;
349
- for (; u < n.length && (o.lastIndex = u, c = o.exec(n), c !== null);) u = o.lastIndex, o === P ? c[1] === "!--" ? o = F : c[1] === void 0 ? c[2] === void 0 ? c[3] !== void 0 && (o = L) : (B.test(c[2]) && (i = RegExp("</" + c[2], "g")), o = L) : o = I : o === L ? c[0] === ">" ? (o = i ?? P, l = -1) : c[1] === void 0 ? l = -2 : (l = o.lastIndex - c[2].length, s = c[1], o = c[3] === void 0 ? L : c[3] === "\"" ? z : R) : o === z || o === R ? o = L : o === F || o === I ? o = P : (o = L, i = void 0);
350
- let d = o === L && e[t + 1].startsWith("/>") ? " " : "";
351
- a += o === P ? n + de : l >= 0 ? (r.push(s), n.slice(0, l) + E + n.slice(l) + D + d) : n + D + (l === -2 ? t : d);
270
+ for (; u < n.length && (o.lastIndex = u, c = o.exec(n), c !== null);) u = o.lastIndex, o === j ? c[1] === "!--" ? o = se : c[1] === void 0 ? c[2] === void 0 ? c[3] !== void 0 && (o = M) : (P.test(c[2]) && (i = RegExp("</" + c[2], "g")), o = M) : o = ce : o === M ? c[0] === ">" ? (o = i ?? j, l = -1) : c[1] === void 0 ? l = -2 : (l = o.lastIndex - c[2].length, s = c[1], o = c[3] === void 0 ? M : c[3] === "\"" ? N : le) : o === N || o === le ? o = M : o === se || o === ce ? o = j : (o = M, i = void 0);
271
+ let d = o === M && e[t + 1].startsWith("/>") ? " " : "";
272
+ a += o === j ? n + ae : l >= 0 ? (r.push(s), n.slice(0, l) + C + n.slice(l) + w + d) : n + w + (l === -2 ? t : d);
352
273
  }
353
- return [G(e, a + (e[n] || "<?>") + (t === 2 ? "</svg>" : t === 3 ? "</math>" : "")), r];
354
- }, K = class e {
274
+ return [B(e, a + (e[n] || "<?>") + (t === 2 ? "</svg>" : t === 3 ? "</math>" : "")), r];
275
+ }, V = class e {
355
276
  constructor({ strings: t, _$litType$: n }, r) {
356
277
  let i;
357
278
  this.parts = [];
358
- let a = 0, o = 0, s = t.length - 1, c = this.parts, [l, u] = me(t, n);
359
- if (this.el = e.createElement(l, r), W.currentNode = this.el.content, n === 2 || n === 3) {
279
+ let a = 0, o = 0, s = t.length - 1, c = this.parts, [l, u] = ue(t, n);
280
+ if (this.el = e.createElement(l, r), z.currentNode = this.el.content, n === 2 || n === 3) {
360
281
  let e = this.el.content.firstChild;
361
282
  e.replaceWith(...e.childNodes);
362
283
  }
363
- for (; (i = W.nextNode()) !== null && c.length < s;) {
284
+ for (; (i = z.nextNode()) !== null && c.length < s;) {
364
285
  if (i.nodeType === 1) {
365
- if (i.hasAttributes()) for (let e of i.getAttributeNames()) if (e.endsWith(E)) {
366
- let t = u[o++], n = i.getAttribute(e).split(D), r = /([.?@])?(.*)/.exec(t);
286
+ if (i.hasAttributes()) for (let e of i.getAttributeNames()) if (e.endsWith(C)) {
287
+ let t = u[o++], n = i.getAttribute(e).split(w), r = /([.?@])?(.*)/.exec(t);
367
288
  c.push({
368
289
  type: 1,
369
290
  index: a,
370
291
  name: r[2],
371
292
  strings: n,
372
- ctor: r[1] === "." ? ge : r[1] === "?" ? _e : r[1] === "@" ? ve : Y
293
+ ctor: r[1] === "." ? fe : r[1] === "?" ? pe : r[1] === "@" ? me : W
373
294
  }), i.removeAttribute(e);
374
- } else e.startsWith(D) && (c.push({
295
+ } else e.startsWith(w) && (c.push({
375
296
  type: 6,
376
297
  index: a
377
298
  }), i.removeAttribute(e));
378
- if (B.test(i.tagName)) {
379
- let e = i.textContent.split(D), t = e.length - 1;
299
+ if (P.test(i.tagName)) {
300
+ let e = i.textContent.split(w), t = e.length - 1;
380
301
  if (t > 0) {
381
- i.textContent = w ? w.emptyScript : "";
382
- for (let n = 0; n < t; n++) i.append(e[n], A()), W.nextNode(), c.push({
302
+ i.textContent = x ? x.emptyScript : "";
303
+ for (let n = 0; n < t; n++) i.append(e[n], D()), z.nextNode(), c.push({
383
304
  type: 2,
384
305
  index: ++a
385
306
  });
386
- i.append(e[t], A());
307
+ i.append(e[t], D());
387
308
  }
388
309
  }
389
- } else if (i.nodeType === 8) if (i.data === O) c.push({
310
+ } else if (i.nodeType === 8) if (i.data === T) c.push({
390
311
  type: 2,
391
312
  index: a
392
313
  });
393
314
  else {
394
315
  let e = -1;
395
- for (; (e = i.data.indexOf(D, e + 1)) !== -1;) c.push({
316
+ for (; (e = i.data.indexOf(w, e + 1)) !== -1;) c.push({
396
317
  type: 7,
397
318
  index: a
398
- }), e += D.length - 1;
319
+ }), e += w.length - 1;
399
320
  }
400
321
  a++;
401
322
  }
402
323
  }
403
324
  static createElement(e, t) {
404
- let n = k.createElement("template");
325
+ let n = E.createElement("template");
405
326
  return n.innerHTML = e, n;
406
327
  }
407
328
  };
408
- function q(e, t, n = e, r) {
409
- if (t === V) return t;
410
- let i = r === void 0 ? n._$Cl : n._$Co?.[r], a = j(t) ? void 0 : t._$litDirective$;
411
- return i?.constructor !== a && (i?._$AO?.(!1), a === void 0 ? i = void 0 : (i = new a(e), i._$AT(e, n, r)), r === void 0 ? n._$Cl = i : (n._$Co ??= [])[r] = i), i !== void 0 && (t = q(e, i._$AS(e, t.values), i, r)), t;
329
+ function H(e, t, n = e, r) {
330
+ if (t === I) return t;
331
+ let i = r === void 0 ? n._$Cl : n._$Co?.[r], a = O(t) ? void 0 : t._$litDirective$;
332
+ return i?.constructor !== a && (i?._$AO?.(!1), a === void 0 ? i = void 0 : (i = new a(e), i._$AT(e, n, r)), r === void 0 ? n._$Cl = i : (n._$Co ??= [])[r] = i), i !== void 0 && (t = H(e, i._$AS(e, t.values), i, r)), t;
412
333
  }
413
- var he = class {
334
+ var de = class {
414
335
  constructor(e, t) {
415
336
  this._$AV = [], this._$AN = void 0, this._$AD = e, this._$AM = t;
416
337
  }
@@ -421,28 +342,28 @@ var he = class {
421
342
  return this._$AM._$AU;
422
343
  }
423
344
  u(e) {
424
- let { el: { content: t }, parts: n } = this._$AD, r = (e?.creationScope ?? k).importNode(t, !0);
425
- W.currentNode = r;
426
- let i = W.nextNode(), a = 0, o = 0, s = n[0];
345
+ let { el: { content: t }, parts: n } = this._$AD, r = (e?.creationScope ?? E).importNode(t, !0);
346
+ z.currentNode = r;
347
+ let i = z.nextNode(), a = 0, o = 0, s = n[0];
427
348
  for (; s !== void 0;) {
428
349
  if (a === s.index) {
429
350
  let t;
430
- s.type === 2 ? t = new J(i, i.nextSibling, this, e) : s.type === 1 ? t = new s.ctor(i, s.name, s.strings, this, e) : s.type === 6 && (t = new ye(i, this, e)), this._$AV.push(t), s = n[++o];
351
+ s.type === 2 ? t = new U(i, i.nextSibling, this, e) : s.type === 1 ? t = new s.ctor(i, s.name, s.strings, this, e) : s.type === 6 && (t = new he(i, this, e)), this._$AV.push(t), s = n[++o];
431
352
  }
432
- a !== s?.index && (i = W.nextNode(), a++);
353
+ a !== s?.index && (i = z.nextNode(), a++);
433
354
  }
434
- return W.currentNode = k, r;
355
+ return z.currentNode = E, r;
435
356
  }
436
357
  p(e) {
437
358
  let t = 0;
438
359
  for (let n of this._$AV) n !== void 0 && (n.strings === void 0 ? n._$AI(e[t]) : (n._$AI(e, n, t), t += n.strings.length - 2)), t++;
439
360
  }
440
- }, J = class e {
361
+ }, U = class e {
441
362
  get _$AU() {
442
363
  return this._$AM?._$AU ?? this._$Cv;
443
364
  }
444
365
  constructor(e, t, n, r) {
445
- this.type = 2, this._$AH = H, this._$AN = void 0, this._$AA = e, this._$AB = t, this._$AM = n, this.options = r, this._$Cv = r?.isConnected ?? !0;
366
+ this.type = 2, this._$AH = L, this._$AN = void 0, this._$AA = e, this._$AB = t, this._$AM = n, this.options = r, this._$Cv = r?.isConnected ?? !0;
446
367
  }
447
368
  get parentNode() {
448
369
  let e = this._$AA.parentNode, t = this._$AM;
@@ -455,7 +376,7 @@ var he = class {
455
376
  return this._$AB;
456
377
  }
457
378
  _$AI(e, t = this) {
458
- e = q(this, e, t), j(e) ? e === H || e == null || e === "" ? (this._$AH !== H && this._$AR(), this._$AH = H) : e !== this._$AH && e !== V && this._(e) : e._$litType$ === void 0 ? e.nodeType === void 0 ? fe(e) ? this.k(e) : this._(e) : this.T(e) : this.$(e);
379
+ e = H(this, e, t), O(e) ? e === L || e == null || e === "" ? (this._$AH !== L && this._$AR(), this._$AH = L) : e !== this._$AH && e !== I && this._(e) : e._$litType$ === void 0 ? e.nodeType === void 0 ? oe(e) ? this.k(e) : this._(e) : this.T(e) : this.$(e);
459
380
  }
460
381
  O(e) {
461
382
  return this._$AA.parentNode.insertBefore(e, this._$AB);
@@ -464,36 +385,36 @@ var he = class {
464
385
  this._$AH !== e && (this._$AR(), this._$AH = this.O(e));
465
386
  }
466
387
  _(e) {
467
- this._$AH !== H && j(this._$AH) ? this._$AA.nextSibling.data = e : this.T(k.createTextNode(e)), this._$AH = e;
388
+ this._$AH !== L && O(this._$AH) ? this._$AA.nextSibling.data = e : this.T(E.createTextNode(e)), this._$AH = e;
468
389
  }
469
390
  $(e) {
470
- let { values: t, _$litType$: n } = e, r = typeof n == "number" ? this._$AC(e) : (n.el === void 0 && (n.el = K.createElement(G(n.h, n.h[0]), this.options)), n);
391
+ let { values: t, _$litType$: n } = e, r = typeof n == "number" ? this._$AC(e) : (n.el === void 0 && (n.el = V.createElement(B(n.h, n.h[0]), this.options)), n);
471
392
  if (this._$AH?._$AD === r) this._$AH.p(t);
472
393
  else {
473
- let e = new he(r, this), n = e.u(this.options);
394
+ let e = new de(r, this), n = e.u(this.options);
474
395
  e.p(t), this.T(n), this._$AH = e;
475
396
  }
476
397
  }
477
398
  _$AC(e) {
478
- let t = U.get(e.strings);
479
- return t === void 0 && U.set(e.strings, t = new K(e)), t;
399
+ let t = R.get(e.strings);
400
+ return t === void 0 && R.set(e.strings, t = new V(e)), t;
480
401
  }
481
402
  k(t) {
482
- M(this._$AH) || (this._$AH = [], this._$AR());
403
+ k(this._$AH) || (this._$AH = [], this._$AR());
483
404
  let n = this._$AH, r, i = 0;
484
- for (let a of t) i === n.length ? n.push(r = new e(this.O(A()), this.O(A()), this, this.options)) : r = n[i], r._$AI(a), i++;
405
+ for (let a of t) i === n.length ? n.push(r = new e(this.O(D()), this.O(D()), this, this.options)) : r = n[i], r._$AI(a), i++;
485
406
  i < n.length && (this._$AR(r && r._$AB.nextSibling, i), n.length = i);
486
407
  }
487
408
  _$AR(e = this._$AA.nextSibling, t) {
488
409
  for (this._$AP?.(!1, !0, t); e !== this._$AB;) {
489
- let t = C(e).nextSibling;
490
- C(e).remove(), e = t;
410
+ let t = b(e).nextSibling;
411
+ b(e).remove(), e = t;
491
412
  }
492
413
  }
493
414
  setConnected(e) {
494
415
  this._$AM === void 0 && (this._$Cv = e, this._$AP?.(e));
495
416
  }
496
- }, Y = class {
417
+ }, W = class {
497
418
  get tagName() {
498
419
  return this.element.tagName;
499
420
  }
@@ -501,47 +422,47 @@ var he = class {
501
422
  return this._$AM._$AU;
502
423
  }
503
424
  constructor(e, t, n, r, i) {
504
- this.type = 1, this._$AH = H, this._$AN = void 0, this.element = e, this.name = t, this._$AM = r, this.options = i, n.length > 2 || n[0] !== "" || n[1] !== "" ? (this._$AH = Array(n.length - 1).fill(/* @__PURE__ */ new String()), this.strings = n) : this._$AH = H;
425
+ this.type = 1, this._$AH = L, this._$AN = void 0, this.element = e, this.name = t, this._$AM = r, this.options = i, n.length > 2 || n[0] !== "" || n[1] !== "" ? (this._$AH = Array(n.length - 1).fill(/* @__PURE__ */ new String()), this.strings = n) : this._$AH = L;
505
426
  }
506
427
  _$AI(e, t = this, n, r) {
507
428
  let i = this.strings, a = !1;
508
- if (i === void 0) e = q(this, e, t, 0), a = !j(e) || e !== this._$AH && e !== V, a && (this._$AH = e);
429
+ if (i === void 0) e = H(this, e, t, 0), a = !O(e) || e !== this._$AH && e !== I, a && (this._$AH = e);
509
430
  else {
510
431
  let r = e, o, s;
511
- for (e = i[0], o = 0; o < i.length - 1; o++) s = q(this, r[n + o], t, o), s === V && (s = this._$AH[o]), a ||= !j(s) || s !== this._$AH[o], s === H ? e = H : e !== H && (e += (s ?? "") + i[o + 1]), this._$AH[o] = s;
432
+ for (e = i[0], o = 0; o < i.length - 1; o++) s = H(this, r[n + o], t, o), s === I && (s = this._$AH[o]), a ||= !O(s) || s !== this._$AH[o], s === L ? e = L : e !== L && (e += (s ?? "") + i[o + 1]), this._$AH[o] = s;
512
433
  }
513
434
  a && !r && this.j(e);
514
435
  }
515
436
  j(e) {
516
- e === H ? this.element.removeAttribute(this.name) : this.element.setAttribute(this.name, e ?? "");
437
+ e === L ? this.element.removeAttribute(this.name) : this.element.setAttribute(this.name, e ?? "");
517
438
  }
518
- }, ge = class extends Y {
439
+ }, fe = class extends W {
519
440
  constructor() {
520
441
  super(...arguments), this.type = 3;
521
442
  }
522
443
  j(e) {
523
- this.element[this.name] = e === H ? void 0 : e;
444
+ this.element[this.name] = e === L ? void 0 : e;
524
445
  }
525
- }, _e = class extends Y {
446
+ }, pe = class extends W {
526
447
  constructor() {
527
448
  super(...arguments), this.type = 4;
528
449
  }
529
450
  j(e) {
530
- this.element.toggleAttribute(this.name, !!e && e !== H);
451
+ this.element.toggleAttribute(this.name, !!e && e !== L);
531
452
  }
532
- }, ve = class extends Y {
453
+ }, me = class extends W {
533
454
  constructor(e, t, n, r, i) {
534
455
  super(e, t, n, r, i), this.type = 5;
535
456
  }
536
457
  _$AI(e, t = this) {
537
- if ((e = q(this, e, t, 0) ?? H) === V) return;
538
- let n = this._$AH, r = e === H && n !== H || e.capture !== n.capture || e.once !== n.once || e.passive !== n.passive, i = e !== H && (n === H || r);
458
+ if ((e = H(this, e, t, 0) ?? L) === I) return;
459
+ let n = this._$AH, r = e === L && n !== L || e.capture !== n.capture || e.once !== n.once || e.passive !== n.passive, i = e !== L && (n === L || r);
539
460
  r && this.element.removeEventListener(this.name, this, n), i && this.element.addEventListener(this.name, this, e), this._$AH = e;
540
461
  }
541
462
  handleEvent(e) {
542
463
  typeof this._$AH == "function" ? this._$AH.call(this.options?.host ?? this.element, e) : this._$AH.handleEvent(e);
543
464
  }
544
- }, ye = class {
465
+ }, he = class {
545
466
  constructor(e, t, n) {
546
467
  this.element = e, this.type = 6, this._$AN = void 0, this._$AM = t, this.options = n;
547
468
  }
@@ -549,18 +470,18 @@ var he = class {
549
470
  return this._$AM._$AU;
550
471
  }
551
472
  _$AI(e) {
552
- q(this, e);
473
+ H(this, e);
553
474
  }
554
- }, be = S.litHtmlPolyfillSupport;
555
- be?.(K, J), (S.litHtmlVersions ??= []).push("3.3.2");
556
- var xe = (e, t, n) => {
475
+ }, ge = y.litHtmlPolyfillSupport;
476
+ ge?.(V, U), (y.litHtmlVersions ??= []).push("3.3.2");
477
+ var _e = (e, t, n) => {
557
478
  let r = n?.renderBefore ?? t, i = r._$litPart$;
558
479
  if (i === void 0) {
559
480
  let e = n?.renderBefore ?? null;
560
- r._$litPart$ = i = new J(t.insertBefore(A(), e), e, void 0, n ?? {});
481
+ r._$litPart$ = i = new U(t.insertBefore(D(), e), e, void 0, n ?? {});
561
482
  }
562
483
  return i._$AI(e), i;
563
- }, X = globalThis, Z = class extends y {
484
+ }, G = globalThis, K = class extends v {
564
485
  constructor() {
565
486
  super(...arguments), this.renderOptions = { host: this }, this._$Do = void 0;
566
487
  }
@@ -570,7 +491,7 @@ var xe = (e, t, n) => {
570
491
  }
571
492
  update(e) {
572
493
  let t = this.render();
573
- this.hasUpdated || (this.renderOptions.isConnected = this.isConnected), super.update(e), this._$Do = xe(t, this.renderRoot, this.renderOptions);
494
+ this.hasUpdated || (this.renderOptions.isConnected = this.isConnected), super.update(e), this._$Do = _e(t, this.renderRoot, this.renderOptions);
574
495
  }
575
496
  connectedCallback() {
576
497
  super.connectedCallback(), this._$Do?.setConnected(!0);
@@ -579,31 +500,286 @@ var xe = (e, t, n) => {
579
500
  super.disconnectedCallback(), this._$Do?.setConnected(!1);
580
501
  }
581
502
  render() {
582
- return V;
503
+ return I;
504
+ }
505
+ };
506
+ K._$litElement$ = !0, K.finalized = !0, G.litElementHydrateSupport?.({ LitElement: K });
507
+ var ve = G.litElementPolyfillSupport;
508
+ ve?.({ LitElement: K }), (G.litElementVersions ??= []).push("4.2.2");
509
+ //#endregion
510
+ //#region node_modules/@lit/reactive-element/decorators/custom-element.js
511
+ var q = (e) => (t, n) => {
512
+ n === void 0 ? customElements.define(e, t) : n.addInitializer(() => {
513
+ customElements.define(e, t);
514
+ });
515
+ }, ye = {
516
+ attribute: !0,
517
+ type: String,
518
+ converter: h,
519
+ reflect: !1,
520
+ hasChanged: g
521
+ }, be = (e = ye, t, n) => {
522
+ let { kind: r, metadata: i } = n, a = globalThis.litPropertyMetadata.get(i);
523
+ if (a === void 0 && globalThis.litPropertyMetadata.set(i, a = /* @__PURE__ */ new Map()), r === "setter" && ((e = Object.create(e)).wrapped = !0), a.set(n.name, e), r === "accessor") {
524
+ let { name: r } = n;
525
+ return {
526
+ set(n) {
527
+ let i = t.get.call(this);
528
+ t.set.call(this, n), this.requestUpdate(r, i, e, !0, n);
529
+ },
530
+ init(t) {
531
+ return t !== void 0 && this.C(r, void 0, e, t), t;
532
+ }
533
+ };
583
534
  }
535
+ if (r === "setter") {
536
+ let { name: r } = n;
537
+ return function(n) {
538
+ let i = this[r];
539
+ t.call(this, n), this.requestUpdate(r, i, e, !0, n);
540
+ };
541
+ }
542
+ throw Error("Unsupported decorator location: " + r);
584
543
  };
585
- Z._$litElement$ = !0, Z.finalized = !0, X.litElementHydrateSupport?.({ LitElement: Z });
586
- var Se = X.litElementPolyfillSupport;
587
- Se?.({ LitElement: Z }), (X.litElementVersions ??= []).push("4.2.2");
544
+ function J(e) {
545
+ return (t, n) => typeof n == "object" ? be(e, t, n) : ((e, t, n) => {
546
+ let r = t.hasOwnProperty(n);
547
+ return t.constructor.createProperty(n, e), r ? Object.getOwnPropertyDescriptor(t, n) : void 0;
548
+ })(e, t, n);
549
+ }
550
+ //#endregion
551
+ //#region node_modules/@lit/reactive-element/decorators/state.js
552
+ function Y(e) {
553
+ return J({
554
+ ...e,
555
+ state: !0,
556
+ attribute: !1
557
+ });
558
+ }
559
+ //#endregion
560
+ //#region node_modules/lit-html/directive.js
561
+ var xe = {
562
+ ATTRIBUTE: 1,
563
+ CHILD: 2,
564
+ PROPERTY: 3,
565
+ BOOLEAN_ATTRIBUTE: 4,
566
+ EVENT: 5,
567
+ ELEMENT: 6
568
+ }, Se = (e) => (...t) => ({
569
+ _$litDirective$: e,
570
+ values: t
571
+ }), Ce = class {
572
+ constructor(e) {}
573
+ get _$AU() {
574
+ return this._$AM._$AU;
575
+ }
576
+ _$AT(e, t, n) {
577
+ this._$Ct = e, this._$AM = t, this._$Ci = n;
578
+ }
579
+ _$AS(e, t) {
580
+ return this.update(e, t);
581
+ }
582
+ update(e, t) {
583
+ return this.render(...t);
584
+ }
585
+ }, we = Se(class extends Ce {
586
+ constructor(e) {
587
+ if (super(e), e.type !== xe.ATTRIBUTE || e.name !== "class" || e.strings?.length > 2) throw Error("`classMap()` can only be used in the `class` attribute and must be the only part in the attribute.");
588
+ }
589
+ render(e) {
590
+ return " " + Object.keys(e).filter((t) => e[t]).join(" ") + " ";
591
+ }
592
+ update(e, [t]) {
593
+ if (this.st === void 0) {
594
+ this.st = /* @__PURE__ */ new Set(), e.strings !== void 0 && (this.nt = new Set(e.strings.join(" ").split(/\s/).filter((e) => e !== "")));
595
+ for (let e in t) t[e] && !this.nt?.has(e) && this.st.add(e);
596
+ return this.render(t);
597
+ }
598
+ let n = e.element.classList;
599
+ for (let e of this.st) e in t || (n.remove(e), this.st.delete(e));
600
+ for (let e in t) {
601
+ let r = !!t[e];
602
+ r === this.st.has(e) || this.nt?.has(e) || (r ? (n.add(e), this.st.add(e)) : (n.remove(e), this.st.delete(e)));
603
+ }
604
+ return I;
605
+ }
606
+ });
588
607
  //#endregion
589
608
  //#region \0@oxc-project+runtime@0.126.0/helpers/decorate.js
590
- function Q(e, t, n, r) {
609
+ function X(e, t, n, r) {
591
610
  var i = arguments.length, a = i < 3 ? t : r === null ? r = Object.getOwnPropertyDescriptor(t, n) : r, o;
592
611
  if (typeof Reflect == "object" && typeof Reflect.decorate == "function") a = Reflect.decorate(e, t, n, r);
593
612
  else for (var s = e.length - 1; s >= 0; s--) (o = e[s]) && (a = (i < 3 ? o(a) : i > 3 ? o(t, n, a) : o(t, n)) || a);
594
613
  return i > 3 && a && Object.defineProperty(t, n, a), a;
595
614
  }
596
615
  //#endregion
597
- //#region src/components/AMap/a-map.ts
598
- var $ = class extends Z {
616
+ //#region src/components/Loading/qc-loading.ts
617
+ var Z = class extends K {
618
+ constructor(...e) {
619
+ super(...e), this.loading = !0, this.classes = {
620
+ "qc-loading": !0,
621
+ loading: !0
622
+ };
623
+ }
624
+ willUpdate(e) {
625
+ e.has("loading") && (this.classes.loading = this.loading);
626
+ }
627
+ render() {
628
+ return F`<section id="qc-loading" class=${we(this.classes)}>
629
+ <slot></slot>
630
+ <div class="qc-loading-mask">
631
+ <div class="qc-loading-spinner">
632
+ <div class="qc-loading-spinner-cirlce cirlce1"></div>
633
+ <div class="qc-loading-spinner-cirlce cirlce2"></div>
634
+ <div class="qc-loading-spinner-cirlce cirlce3"></div>
635
+ <div class="qc-loading-spinner-cirlce cirlce4"></div>
636
+ </div>
637
+ </div>
638
+ </section>`;
639
+ }
640
+ static {
641
+ this.styles = o`
642
+ .qc-loading {
643
+ width: 100%;
644
+ height: 100%;
645
+ position: relative;
646
+ }
647
+ .qc-loading-mask {
648
+ content: '';
649
+ display: none;
650
+ width: 100%;
651
+ height: 100%;
652
+ background: rgba(255, 255, 255, 0.8);
653
+ position: absolute;
654
+ top: 0;
655
+ left: 0;
656
+ justify-content: center;
657
+ align-items: center;
658
+ }
659
+ .qc-loading-mask {
660
+ display: none;
661
+ }
662
+ .qc-loading-spinner {
663
+ width: 6%;
664
+ aspect-ratio: 1 / 1; /* 保持正方形 */
665
+ position: relative;
666
+ animation: route 1s linear infinite;
667
+ transform: rotate(90deg);
668
+ }
669
+ .loading .qc-loading-mask {
670
+ display: flex;
671
+ }
672
+ .qc-loading-spinner-cirlce {
673
+ position: absolute;
674
+ width: 60%;
675
+ height: 60%;
676
+ border-radius: 50%;
677
+ background-color: #1677ff;
678
+ transform: translate(-50%, -50%);
679
+ animation: hidden 1s linear infinite alternate;
680
+ opacity: 0.3;
681
+ }
682
+ .cirlce1 {
683
+ top: 0;
684
+ left: 0;
685
+ }
686
+ .cirlce2 {
687
+ top: 0;
688
+ left: 100%;
689
+ animation-delay: 0.25s;
690
+ }
691
+ .cirlce3 {
692
+ top: 100%;
693
+ left: 100%;
694
+ animation-delay: 0.5s;
695
+ }
696
+ .cirlce4 {
697
+ top: 100%;
698
+ left: 0;
699
+ animation-delay: 0.75s;
700
+ }
701
+ @keyframes route {
702
+ to {
703
+ transform: rotate(450deg);
704
+ }
705
+ }
706
+ @keyframes hidden {
707
+ to {
708
+ opacity: 1;
709
+ }
710
+ }
711
+ `;
712
+ }
713
+ };
714
+ X([J({ type: Boolean })], Z.prototype, "loading", void 0), X([Y()], Z.prototype, "classes", void 0), Z = X([q("qc-loading")], Z);
715
+ //#endregion
716
+ //#region src/tools/loadAMap/loadAMap.ts
717
+ var Q, Te = {
718
+ version: "2.0",
719
+ key: "94af010abe03a5b2a2f98e6739a11d0c",
720
+ secret: "031abe8352fc9fa9ac8d14a86a5ec1cf"
721
+ };
722
+ function Ee() {
723
+ return new Promise((e) => {
724
+ let t = document.createElement("script");
725
+ t.innerHTML = `
726
+ window._AMapSecurityConfig = {
727
+ securityJsCode: '${Q.secret}',
728
+ };`, document.head.appendChild(t), e(null);
729
+ });
730
+ }
731
+ function De() {
732
+ let e = `${Q.url}?v=${Q.version}&key=${Q.key}&plugin=${Q.plugins.join(",")}`;
733
+ return new Promise((t, n) => {
734
+ let r = document.createElement("script");
735
+ r.async = !1, r.src = e, r.onerror = n, r.onload = t, document.head.appendChild(r);
736
+ });
737
+ }
738
+ function Oe() {
739
+ let e = `${Q.locaUrl}?v=${Q.version}&key=${Q.key}&plugin=${Q.plugins.join(",")}`;
740
+ return new Promise((t, n) => {
741
+ let r = document.createElement("script");
742
+ r.async = !1, r.src = e, r.onerror = n, r.onload = t, document.head.appendChild(r);
743
+ });
744
+ }
745
+ var ke = async (e) => {
746
+ Q = {
747
+ ...e,
748
+ key: e.key || Te.key,
749
+ secret: e.secret || Te.secret,
750
+ plugins: e.plugins || []
751
+ };
752
+ try {
753
+ let t = window;
754
+ if (t.AMap && e.onLoad && e.onLoad(t.AMap), await Ee(), await De(), await Oe(), t.AMap) e.onLoad && e.onLoad(t.AMap);
755
+ else throw Error("AMap not loaded");
756
+ } catch (t) {
757
+ e.onError && e.onError(t);
758
+ }
759
+ }, $ = class extends K {
599
760
  createRenderRoot() {
600
761
  return this;
601
762
  }
602
763
  constructor() {
603
- super(), this.version = "2.0", this.key = "94af010abe03a5b2a2f98e6739a11d0c", this.secret = "031abe8352fc9fa9ac8d14a86a5ec1cf", this.AMapUrl = "https://webapi.amap.com/maps", this.AMapLocaUrl = "https://webapi.amap.com/loca", this.plugins = [], this.viewMode = "2D", this.zoom = 10, this.center = [116.397428, 39.90923], this.zooms = [3, 18], this.animateEnable = !0;
764
+ super(), this.version = "2.0", this.key = "94af010abe03a5b2a2f98e6739a11d0c", this.secret = "031abe8352fc9fa9ac8d14a86a5ec1cf", this.AMapUrl = "https://webapi.amap.com/maps", this.AMapLocaUrl = "https://webapi.amap.com/loca", this.plugins = [], this.viewMode = "2D", this.zoom = 10, this.center = [116.397428, 39.90923], this.zooms = [3, 18], this.animateEnable = !0, this.loading = !0, this.operatingData = { timeoutFlag: null }, this.oncomplete = () => {
765
+ this.dispatchEvent(new CustomEvent("load", { detail: {
766
+ map: this.map,
767
+ AMap: this.AMap
768
+ } })), this.dispatchEvent(new CustomEvent("zoomChange", { detail: { zoom: this.map.getZoom() } })), setTimeout(() => {
769
+ this.loading = !1;
770
+ }, 100);
771
+ }, this.onStartOperating = () => {
772
+ this.dispatchEvent(new CustomEvent("startOperating"));
773
+ }, this.onEndOperating_timeout = () => {
774
+ this.operatingData.timeoutFlag && (clearTimeout(this.operatingData.timeoutFlag), this.operatingData.timeoutFlag = null), this.operatingData.timeoutFlag = setTimeout(() => {
775
+ this.dispatchEvent(new CustomEvent("endOperating")), this.operatingData.timeoutFlag = null;
776
+ }, 400);
777
+ }, this.onzoomchange = () => {
778
+ this.dispatchEvent(new CustomEvent("zoomChange", { detail: { zoom: this.map.getZoom() } }));
779
+ };
604
780
  }
605
- async firstUpdated() {
606
- await a({
781
+ async connectedCallback() {
782
+ super.connectedCallback(), await ke({
607
783
  key: this.key,
608
784
  secret: this.secret,
609
785
  version: this.version,
@@ -614,11 +790,18 @@ var $ = class extends Z {
614
790
  this.AMap = window.AMap, this.initAMap();
615
791
  },
616
792
  onError: (e) => {
617
- console.error("AMap load error", e);
793
+ console.error("AMap load error", e), this.loading = !1;
618
794
  }
619
795
  });
620
796
  }
797
+ async firstUpdated() {
798
+ this.initAMap();
799
+ }
800
+ disconnectedCallback() {
801
+ super.disconnectedCallback(), this.removeEventListener(), this.operatingData.timeoutFlag && (clearTimeout(this.operatingData.timeoutFlag), this.operatingData.timeoutFlag = null), this.map &&= (this.map.destroy(), null);
802
+ }
621
803
  initAMap() {
804
+ if (!this.AMap) return;
622
805
  let e = this.querySelector(".a-map-container");
623
806
  e && (this.map = new this.AMap.Map(e, {
624
807
  resizeEnable: !0,
@@ -627,15 +810,25 @@ var $ = class extends Z {
627
810
  center: this.center,
628
811
  zooms: this.zooms,
629
812
  animateEnable: this.animateEnable
630
- }), this.dispatchEvent(new CustomEvent("load", { detail: {
813
+ }), this.addEventListeners(), this.dispatchEvent(new CustomEvent("load", { detail: {
631
814
  map: this.map,
632
815
  AMap: this.AMap
633
816
  } })));
634
817
  }
818
+ addEventListeners() {
819
+ this.map && (this.map.on("complete", this.oncomplete), this.map.on("zoomstart", this.onStartOperating), this.map.on("zoomend", this.onEndOperating_timeout), this.map.on("zoomchange", this.onzoomchange), this.map.on("mousedown", this.onStartOperating), this.map.on("mouseup", this.onEndOperating_timeout), this.map.on("touchstart", this.onStartOperating), this.map.on("touchend", this.onEndOperating_timeout));
820
+ }
821
+ removeEventListener() {
822
+ this.map && (this.map.off("complete", this.oncomplete), this.map.off("zoomstart", this.onStartOperating), this.map.off("zoomend", this.onEndOperating_timeout), this.map.off("zoomchange", this.onzoomchange), this.map.off("mousedown", this.onStartOperating), this.map.off("mouseup", this.onEndOperating_timeout), this.map.off("touchstart", this.onStartOperating), this.map.off("touchend", this.onEndOperating_timeout));
823
+ }
635
824
  render() {
636
- return pe` <section id="a-map"><div class="a-map-container"></div></section>`;
825
+ return F`<section id="a-map">
826
+ <qc-loading .loading=${this.loading}>
827
+ <div class="a-map-container"></div>
828
+ </qc-loading>
829
+ </section>`;
637
830
  }
638
831
  };
639
- Q([x({ type: String })], $.prototype, "version", void 0), Q([x({ type: String })], $.prototype, "key", void 0), Q([x({ type: String })], $.prototype, "secret", void 0), Q([x({ type: String })], $.prototype, "AMapUrl", void 0), Q([x({ type: String })], $.prototype, "AMapLocaUrl", void 0), Q([x({ type: Array })], $.prototype, "plugins", void 0), Q([x({ type: String })], $.prototype, "viewMode", void 0), Q([x({ type: Number })], $.prototype, "zoom", void 0), Q([x({ type: Array })], $.prototype, "center", void 0), Q([x({ type: Array })], $.prototype, "zooms", void 0), Q([x({ type: Boolean })], $.prototype, "animateEnable", void 0), $ = Q([o("a-map")], $);
832
+ X([J({ type: String })], $.prototype, "version", void 0), X([J({ type: String })], $.prototype, "key", void 0), X([J({ type: String })], $.prototype, "secret", void 0), X([J({ type: String })], $.prototype, "AMapUrl", void 0), X([J({ type: String })], $.prototype, "AMapLocaUrl", void 0), X([J({ type: Array })], $.prototype, "plugins", void 0), X([J({ type: String })], $.prototype, "viewMode", void 0), X([J({ type: Number })], $.prototype, "zoom", void 0), X([J({ type: Array })], $.prototype, "center", void 0), X([J({ type: Array })], $.prototype, "zooms", void 0), X([J({ type: Boolean })], $.prototype, "animateEnable", void 0), X([Y()], $.prototype, "loading", void 0), $ = X([q("a-map")], $);
640
833
  //#endregion
641
- export { $ as AMap, a as loadAMap };
834
+ export { $ as AMap, Z as QCLoading, ke as loadAMap };
@@ -0,0 +1,6 @@
1
+ declare const QCEvent: {
2
+ emit(eventName: string, data: any): void;
3
+ on(eventName: string, callback: any): void;
4
+ off(eventName: string, callback: any): void;
5
+ };
6
+ export default QCEvent;
@@ -5,7 +5,7 @@ export type Options = {
5
5
  url: string;
6
6
  locaUrl: string;
7
7
  plugins: string[];
8
- onLoad?: Function;
8
+ onLoad?: (_Amap: any) => void;
9
9
  onError?: Function;
10
10
  };
11
11
  export declare const loadAMap: (options: Options) => Promise<void>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "qc-ui-lit",
3
- "version": "0.0.1",
3
+ "version": "0.0.3",
4
4
  "description": "基于 Lit 的 Web Components 组件库",
5
5
  "author": "",
6
6
  "license": "MIT",