qc-ui-lit 0.2.1 → 0.2.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.
@@ -56,7 +56,7 @@ var d = async (e) => {
56
56
  return this;
57
57
  }
58
58
  constructor() {
59
- 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 = () => {
59
+ 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.mapStyle = "", 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 = () => {
60
60
  this.dispatchEvent(new CustomEvent("load", { detail: {
61
61
  map: this.map,
62
62
  AMap: this.AMap
@@ -98,14 +98,16 @@ var d = async (e) => {
98
98
  initAMap() {
99
99
  if (!this.AMap) return;
100
100
  let e = this.querySelector(".a-map-container");
101
- e && (this.map = new this.AMap.Map(e, {
101
+ if (!e) return;
102
+ let t = {
102
103
  resizeEnable: !0,
103
104
  viewMode: this.viewMode,
104
105
  zoom: this.zoom,
105
106
  center: this.center,
106
107
  zooms: this.zooms,
107
108
  animateEnable: this.animateEnable
108
- }), this.addEventListeners());
109
+ };
110
+ this.mapStyle !== "" && (t.mapStyle = this.mapStyle), this.map = new this.AMap.Map(e, t), this.addEventListeners();
109
111
  }
110
112
  addEventListeners() {
111
113
  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));
@@ -121,6 +123,6 @@ var d = async (e) => {
121
123
  </section>`;
122
124
  }
123
125
  };
124
- a([r({ type: String })], f.prototype, "version", void 0), a([r({ type: String })], f.prototype, "key", void 0), a([r({ type: String })], f.prototype, "secret", void 0), a([r({ type: String })], f.prototype, "AMapUrl", void 0), a([r({ type: String })], f.prototype, "AMapLocaUrl", void 0), a([r({ type: Array })], f.prototype, "plugins", void 0), a([r({ type: String })], f.prototype, "viewMode", void 0), a([r({ type: Number })], f.prototype, "zoom", void 0), a([r({ type: Array })], f.prototype, "center", void 0), a([r({ type: Array })], f.prototype, "zooms", void 0), a([r({ type: Boolean })], f.prototype, "animateEnable", void 0), a([i()], f.prototype, "loading", void 0), f = a([n("a-map")], f);
126
+ a([r({ type: String })], f.prototype, "version", void 0), a([r({ type: String })], f.prototype, "key", void 0), a([r({ type: String })], f.prototype, "secret", void 0), a([r({ type: String })], f.prototype, "AMapUrl", void 0), a([r({ type: String })], f.prototype, "AMapLocaUrl", void 0), a([r({ type: Array })], f.prototype, "plugins", void 0), a([r({ type: String })], f.prototype, "viewMode", void 0), a([r({ type: String })], f.prototype, "mapStyle", void 0), a([r({ type: Number })], f.prototype, "zoom", void 0), a([r({ type: Array })], f.prototype, "center", void 0), a([r({ type: Array })], f.prototype, "zooms", void 0), a([r({ type: Boolean })], f.prototype, "animateEnable", void 0), a([i()], f.prototype, "loading", void 0), f = a([n("a-map")], f);
125
127
  //#endregion
126
128
  export { d as n, a as r, f as t };
@@ -12,6 +12,7 @@ export declare class AMap extends LitElement {
12
12
  AMapLocaUrl: string;
13
13
  plugins: Array<string>;
14
14
  viewMode: string;
15
+ mapStyle: string;
15
16
  zoom: number;
16
17
  center: [number, number];
17
18
  zooms: [number, number];
@@ -42,7 +42,8 @@ var e = class e {
42
42
  if (e === "mounth") return t === 1 && n + r + i === 0;
43
43
  }
44
44
  start(t) {
45
- if (t === "mounth") this.date = new Date(this.date.getFullYear(), this.date.getMonth(), 1);
45
+ if (t === "year") this.date = new Date(this.date.getFullYear(), 0, 1);
46
+ else if (t === "mounth") this.date = new Date(this.date.getFullYear(), this.date.getMonth(), 1);
46
47
  else if (t === "week") {
47
48
  let t = this.date.getDay() - 1;
48
49
  this.set({
@@ -19,7 +19,7 @@ export declare class QCDate {
19
19
  constructor(date?: string | number | Date);
20
20
  compute(type: Compute_type, num: number, unit: number): this;
21
21
  is_start(type: 'day' | 'mounth'): boolean | undefined;
22
- start(type: 'day' | 'week' | 'mounth'): this;
22
+ start(type: 'day' | 'week' | 'mounth' | 'year'): this;
23
23
  end(type: 'day' | 'week' | 'mounth'): this;
24
24
  set(options: Set_options | any): this;
25
25
  get(options: (keyof Set_options)[]): number[];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "qc-ui-lit",
3
- "version": "0.2.1",
3
+ "version": "0.2.3",
4
4
  "description": "基于 Lit 的 Web Components 组件库",
5
5
  "author": "",
6
6
  "license": "MIT",