magtool 1.1.6 → 1.1.8

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.
package/README.md CHANGED
@@ -1,2 +1,72 @@
1
1
  # magtool
2
- 1.1.3 css
2
+ 1.1.3 css
3
+
4
+ 1.1.6 scss/var.scss
5
+
6
+ 1.1.7 store.options
7
+
8
+ 1.1.8
9
+
10
+ $c info/error/warn/success/log
11
+ $loadImg
12
+ $loadVideo
13
+ $download
14
+
15
+ ```
16
+ {
17
+ type: '', // img|csv|table=no config fetch|excel/video=with config fetch
18
+ url: '',
19
+ name: 'download',
20
+ data: '', // csv data
21
+ }
22
+ ```
23
+
24
+ $pc paramsCount
25
+
26
+ $sc
27
+
28
+ $copy app
29
+
30
+ $getType
31
+
32
+ filter1 Array => {data, index}
33
+
34
+ toFixedNumber Number => toFixed(v) => Number()
35
+
36
+ $db $debounce
37
+
38
+ $pm $promise
39
+
40
+ $fa app (v, n)
41
+
42
+ $toUpperCamel app
43
+
44
+ $fd
45
+
46
+ $egc echart gradient color ({color})
47
+
48
+ $elc echart linear color ({color})
49
+
50
+ $rn random number (max, min=0)
51
+
52
+ $rc $randomColor app random color {alpha, name}
53
+
54
+ ```
55
+ names:
56
+ "blue",
57
+ "red",
58
+ "orange",
59
+ "green",
60
+ "pink",
61
+ "yellow",
62
+ "purple",
63
+ "primary",
64
+ "dark",
65
+ alpha:
66
+ "", 1, 3, 5, 7
67
+ ```
68
+
69
+ $getLang
70
+
71
+ $m $moment
72
+
package/dist/index.js CHANGED
@@ -1,21 +1,23 @@
1
- import _ from "moment";
2
- import { c as i } from "./cps.js";
3
- import { d as m } from "./util.js";
4
- import { d as a } from "./directive.js";
5
- import { p as n } from "./store.js";
1
+ import o from "moment";
2
+ import { c as m } from "./cps.js";
3
+ import { d as a } from "./util.js";
4
+ import { d as n } from "./directive.js";
5
+ import { p } from "./store.js";
6
6
  /* empty css */
7
- const w = (o, t) => {
8
- if (o.use(m).use(a), t.storeChips)
7
+ const u = (_, r) => {
8
+ _.use(a).use(n);
9
+ let e;
10
+ if (r.storeChips)
9
11
  try {
10
- const { store: e, pinia: s } = n(t.storeChips);
11
- o.provide("store", e).use(s);
12
+ const { store: t, pinia: i } = p(r.storeChips);
13
+ e = t, _.provide("store", t).use(i);
12
14
  } catch {
13
15
  throw new Error(
14
16
  "piniaStore error, storeChips must be an Object source from import.meta.globa"
15
17
  );
16
18
  }
17
- const r = localStorage.getItem("lang");
18
- return r && r.includes("cn") && _.locale("zh-cn", {
19
+ const s = localStorage.getItem("lang");
20
+ return s && s.includes("cn") && o.locale("zh-cn", {
19
21
  months: "一月_二月_三月_四月_五月_六月_七月_八月_九月_十月_十一月_十二月".split(
20
22
  "_"
21
23
  ),
@@ -25,11 +27,11 @@ const w = (o, t) => {
25
27
  weekdays: "星期日_星期一_星期二_星期三_星期四_星期五_星期六".split("_"),
26
28
  weekdaysShort: "周日_周一_周二_周三_周四_周五_周六".split("_"),
27
29
  weekdaysMin: "日_一_二_三_四_五_六".split("_")
28
- }), window.$m = _, window.$moment = _, {
29
- composition: i,
30
- store
30
+ }), window.$m = o, window.$moment = o, {
31
+ composition: m,
32
+ store: e
31
33
  };
32
34
  };
33
35
  export {
34
- w as default
36
+ u as default
35
37
  };
package/dist/util.js CHANGED
@@ -43,7 +43,7 @@ const N = (i) => {
43
43
  };
44
44
  }, window.$egc = (e = {}) => {
45
45
  let { i: r = 0, color: o } = e;
46
- const t = window.global.config.color;
46
+ const t = window.config.color;
47
47
  o = o || t[r];
48
48
  const n = o + "FF";
49
49
  return {
@@ -207,13 +207,13 @@ const N = (i) => {
207
207
  style: "background-color:#f6fffc; color:#20c997;"
208
208
  }
209
209
  }, l = (e = "info", r) => {
210
- e === "success" && (e = "info"), console[e](
210
+ console.info(
211
211
  `%c ${e.toUpperCase()} %c┆${r}┆`,
212
212
  `${y[e].tag}`,
213
213
  `${y[e].style}`
214
214
  );
215
215
  };
216
- window.$console = {
216
+ window.$c = {
217
217
  info: (...e) => {
218
218
  l("info", e);
219
219
  },
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "magtool",
3
3
  "packageManager": "yarn@4.4.1",
4
- "version": "1.1.6",
4
+ "version": "1.1.8",
5
5
  "author": "magxl",
6
6
  "main": "./dist/index.js",
7
7
  "module": "./dist/index.js",