@web-utils/component 3.3.15 → 3.3.16
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/address-input/index.mjs +1 -3
- package/affix/index.mjs +4 -6
- package/aside-menu/index.mjs +8 -10
- package/avatar/index.mjs +1 -3
- package/awesome-button/index.mjs +20 -22
- package/capsule-tab/index.mjs +4 -6
- package/card/index.mjs +4 -6
- package/carousel/index.mjs +1 -3
- package/chat/index.mjs +2 -4
- package/chunk-file-uploader/index.mjs +1 -3
- package/chunks/{FormTemp.BO_zCjBT.mjs → FormTemp.Cf9d5N_a.mjs} +7 -9
- package/chunks/_plugin-vue2_normalizer.CeySl7Fu.mjs +10 -0
- package/chunks/{dataformat.J6EgqBfr.mjs → dataformat.skVZSF57.mjs} +1 -1
- package/chunks/{dic.6ODiMBAw.mjs → dic.28d_-7EJ.mjs} +1 -1
- package/chunks/{event.ChkcZtyR.mjs → event.m1ZDHbkO.mjs} +2 -2
- package/chunks/{init.BbPaCwke.mjs → init.DBM2D2IY.mjs} +2 -2
- package/chunks/json-beautifier.vs8mCOxd.mjs +124 -0
- package/chunks/{util.ThVOTZAO.mjs → util.B_LEdJSZ.mjs} +55 -55
- package/code-mirror-editor/index.mjs +1 -3
- package/color-picker/index.mjs +4 -6
- package/comment/index.mjs +1 -3
- package/confirm-button/index.mjs +5 -7
- package/confirmable/index.mjs +5 -7
- package/context-menu/index.mjs +1 -3
- package/count-up/index.mjs +4 -6
- package/custom-scrollbar/index.mjs +1 -3
- package/data-box/index.mjs +5 -7
- package/data-card/index.mjs +4 -6
- package/data-cardtext/index.mjs +1 -3
- package/data-display/index.mjs +6 -8
- package/data-icons/index.mjs +4 -6
- package/data-imgtext/index.mjs +6 -8
- package/data-operatext/index.mjs +3 -5
- package/data-panel/index.mjs +5 -7
- package/data-pay/index.mjs +7 -9
- package/data-price/index.mjs +3 -5
- package/data-progress/index.mjs +1 -3
- package/data-rotate/index.mjs +3 -5
- package/data-table-picker/index.mjs +1 -3
- package/data-tabs/index.mjs +3 -5
- package/dialog-form/index.mjs +2 -4
- package/dynamic-table/index.mjs +1 -3
- package/e-charts/index.mjs +1 -3
- package/easy-popup/index.mjs +7 -9
- package/editable-progress/index.mjs +6 -8
- package/editable-tree/index.mjs +1 -3
- package/egd-collapse/index.mjs +4 -6
- package/egd-collapse-item/index.mjs +1 -3
- package/element-dialog/index.mjs +5 -7
- package/empty-view/index.mjs +3 -5
- package/error-view/index.mjs +3 -5
- package/flex-column/index.mjs +4 -6
- package/flex-item/index.mjs +1 -3
- package/flex-row/index.mjs +4 -6
- package/flex-scroller/index.mjs +6 -8
- package/flow/index.mjs +2 -4
- package/flow-designer/index.mjs +123 -155
- package/flow-node/index.mjs +8 -10
- package/flow-viewer/index.mjs +1 -3
- package/form-button/index.mjs +5 -7
- package/form-cascader/index.mjs +1 -3
- package/form-checkbox-group/index.mjs +4 -6
- package/form-date-picker/index.mjs +1 -3
- package/form-holder/index.mjs +11 -13
- package/form-input/index.mjs +5 -7
- package/form-input-email/index.mjs +6 -8
- package/form-input-id-card/index.mjs +13 -15
- package/form-input-number/index.mjs +5 -7
- package/form-input-phone-number/index.mjs +9 -11
- package/form-input-tag/index.mjs +6 -8
- package/form-input-time/index.mjs +7 -9
- package/form-item-config-provider/index.mjs +4 -6
- package/form-radio-group/index.mjs +22 -24
- package/form-select/index.mjs +17 -19
- package/form-switch/index.mjs +5 -7
- package/form-textarea/index.mjs +1 -3
- package/form-view/index.mjs +1 -3
- package/fy-array/index.mjs +4 -6
- package/fy-article/index.mjs +4 -6
- package/fy-cascader/index.mjs +2 -4
- package/fy-checkbox/index.mjs +12 -14
- package/fy-code/index.mjs +6 -8
- package/fy-curd/index.mjs +6 -32
- package/fy-date/index.mjs +6 -8
- package/fy-draggable/index.mjs +2 -4
- package/fy-dynamic/index.mjs +3 -5
- package/fy-empty/index.mjs +2 -4
- package/fy-form/index.mjs +6 -12
- package/fy-form-design/index.mjs +95 -151
- package/fy-form-design/style.css +1 -1
- package/fy-input/index.mjs +5 -7
- package/fy-input-color/index.mjs +9 -11
- package/fy-input-icon/index.mjs +3 -5
- package/fy-input-map/index.mjs +2 -4
- package/fy-input-number/index.mjs +5 -7
- package/fy-input-table/index.mjs +2 -4
- package/fy-input-tree/index.mjs +2 -4
- package/fy-progress/index.mjs +3 -5
- package/fy-radio/index.mjs +4 -6
- package/fy-rate/index.mjs +5 -7
- package/fy-select/index.mjs +4 -6
- package/fy-slider/index.mjs +7 -9
- package/fy-switch/index.mjs +3 -5
- package/fy-tabs/index.mjs +5 -7
- package/fy-time/index.mjs +5 -7
- package/fy-title/index.mjs +5 -7
- package/fy-tree/index.mjs +2 -4
- package/fy-u-editor/index.mjs +2 -4
- package/fy-upload/index.mjs +3 -5
- package/guide-steps/index.mjs +1 -3
- package/highlight-j-s/index.mjs +8 -10
- package/icon-card/index.mjs +4 -6
- package/icon-temp/index.mjs +6 -8
- package/iframe-window/index.mjs +6 -8
- package/image-cropper/index.mjs +5 -7
- package/image-preview/index.mjs +2 -4
- package/image-viewer/index.mjs +4 -6
- package/input-number/index.mjs +1 -3
- package/input-number-range/index.mjs +11 -13
- package/keep-view-alive/index.mjs +12 -14
- package/keyboard/index.mjs +1 -3
- package/license/index.mjs +19 -21
- package/loading-view/index.mjs +3 -5
- package/login/index.mjs +2 -4
- package/monaco-editor/index.mjs +2 -4
- package/name-avatar/index.mjs +4 -6
- package/nav-bar/index.mjs +3 -5
- package/not-implement/index.mjs +3 -5
- package/notice/index.mjs +1 -3
- package/package.json +8 -8
- package/page/index.mjs +6 -8
- package/page-header/index.mjs +4 -6
- package/page-index/index.mjs +17 -19
- package/page-index-top/index.mjs +11 -13
- package/page-skeleton/index.mjs +6 -8
- package/page-skeleton-new/index.mjs +1 -3
- package/pageable-table/index.mjs +8 -10
- package/pageable-view/index.mjs +24 -26
- package/photo-swipe/index.mjs +7 -9
- package/present-view/index.mjs +1 -3
- package/queue/index.mjs +4 -6
- package/record-video/index.mjs +4 -6
- package/resize-observer/index.mjs +4 -6
- package/search/index.mjs +6 -8
- package/search-popover/index.mjs +2 -4
- package/sign/index.mjs +2 -4
- package/sign-panel/index.mjs +5 -7
- package/skeleton/index.mjs +5 -7
- package/split-pane/index.mjs +1 -5
- package/stateful/index.mjs +4 -6
- package/static-pageable-table/index.mjs +8 -10
- package/swiper/index.mjs +4 -6
- package/tab/index.mjs +1 -3
- package/tab-item/index.mjs +1 -3
- package/table-column/index.mjs +1 -3
- package/table-view/index.mjs +1 -3
- package/tag-render/index.mjs +16 -18
- package/text-ellipsis/index.mjs +6 -8
- package/tinymce-editor/index.mjs +1 -5
- package/toolbar-button/index.mjs +8 -10
- package/verify/index.mjs +8 -10
- package/vue-cron/index.mjs +1 -3
- package/vue-qr-code/index.mjs +9 -11
- package/vue-quill-editor/index.mjs +1 -3
- package/vue-tags-input/index.mjs +12 -14
- package/vue-tree-select/index.mjs +1 -27
- package/vue-video-player/index.mjs +1 -3
- package/watermark/index.mjs +14 -16
- package/web-types.json +1 -1
- package/x-input-tag/index.mjs +8 -10
- package/chunks/_plugin-vue2_normalizer.YT9tSeEj.mjs +0 -32
- package/chunks/json-beautifier.CvdU9XNm.mjs +0 -126
|
@@ -13,7 +13,7 @@ var Z = (e, t, s) => t in e ? Ce(e, t, { enumerable: !0, configurable: !0, writa
|
|
|
13
13
|
import xe, { h as r } from "vue";
|
|
14
14
|
import { noop as Re, identity as $e, last as ee, once as Ie, debounce as Ae } from "lodash-es";
|
|
15
15
|
import { isPromise as le } from "@web-utils/core";
|
|
16
|
-
import { n as m } from "../chunks/_plugin-vue2_normalizer.
|
|
16
|
+
import { n as m } from "../chunks/_plugin-vue2_normalizer.CeySl7Fu.mjs";
|
|
17
17
|
const O = process.env.NODE_ENV === "production" ? (
|
|
18
18
|
/* istanbul ignore next */
|
|
19
19
|
Re
|
|
@@ -1447,8 +1447,6 @@ var it = /* @__PURE__ */ m(
|
|
|
1447
1447
|
nt,
|
|
1448
1448
|
!1,
|
|
1449
1449
|
null,
|
|
1450
|
-
null,
|
|
1451
|
-
null,
|
|
1452
1450
|
null
|
|
1453
1451
|
);
|
|
1454
1452
|
const rt = it.exports;
|
|
@@ -1701,8 +1699,6 @@ var St = /* @__PURE__ */ m(
|
|
|
1701
1699
|
gt,
|
|
1702
1700
|
!1,
|
|
1703
1701
|
null,
|
|
1704
|
-
null,
|
|
1705
|
-
null,
|
|
1706
1702
|
null
|
|
1707
1703
|
);
|
|
1708
1704
|
const ve = St.exports, vt = {
|
|
@@ -1727,8 +1723,6 @@ var yt = /* @__PURE__ */ m(
|
|
|
1727
1723
|
Ot,
|
|
1728
1724
|
!1,
|
|
1729
1725
|
null,
|
|
1730
|
-
null,
|
|
1731
|
-
null,
|
|
1732
1726
|
null
|
|
1733
1727
|
);
|
|
1734
1728
|
const _e = yt.exports, Nt = {
|
|
@@ -1764,8 +1758,6 @@ var wt = /* @__PURE__ */ m(
|
|
|
1764
1758
|
bt,
|
|
1765
1759
|
!1,
|
|
1766
1760
|
null,
|
|
1767
|
-
null,
|
|
1768
|
-
null,
|
|
1769
1761
|
null
|
|
1770
1762
|
);
|
|
1771
1763
|
const Ct = wt.exports, Lt = {
|
|
@@ -1780,8 +1772,6 @@ var Mt = function() {
|
|
|
1780
1772
|
Tt,
|
|
1781
1773
|
!1,
|
|
1782
1774
|
null,
|
|
1783
|
-
null,
|
|
1784
|
-
null,
|
|
1785
1775
|
null
|
|
1786
1776
|
);
|
|
1787
1777
|
const Oe = Dt.exports, xt = {
|
|
@@ -1833,8 +1823,6 @@ var It = /* @__PURE__ */ m(
|
|
|
1833
1823
|
$t,
|
|
1834
1824
|
!1,
|
|
1835
1825
|
null,
|
|
1836
|
-
null,
|
|
1837
|
-
null,
|
|
1838
1826
|
null
|
|
1839
1827
|
);
|
|
1840
1828
|
const At = It.exports, Vt = {
|
|
@@ -1890,8 +1878,6 @@ var Ft = /* @__PURE__ */ m(
|
|
|
1890
1878
|
zt,
|
|
1891
1879
|
!1,
|
|
1892
1880
|
null,
|
|
1893
|
-
null,
|
|
1894
|
-
null,
|
|
1895
1881
|
null
|
|
1896
1882
|
);
|
|
1897
1883
|
const kt = Ft.exports, Ht = {
|
|
@@ -1906,8 +1892,6 @@ var Pt = function() {
|
|
|
1906
1892
|
Wt,
|
|
1907
1893
|
!1,
|
|
1908
1894
|
null,
|
|
1909
|
-
null,
|
|
1910
|
-
null,
|
|
1911
1895
|
null
|
|
1912
1896
|
);
|
|
1913
1897
|
const ye = jt.exports, Qt = {
|
|
@@ -2023,8 +2007,6 @@ var Ut = /* @__PURE__ */ m(
|
|
|
2023
2007
|
qt,
|
|
2024
2008
|
!1,
|
|
2025
2009
|
null,
|
|
2026
|
-
null,
|
|
2027
|
-
null,
|
|
2028
2010
|
null
|
|
2029
2011
|
);
|
|
2030
2012
|
const Yt = Ut.exports, Xt = {
|
|
@@ -2062,8 +2044,6 @@ var Zt = /* @__PURE__ */ m(
|
|
|
2062
2044
|
Jt,
|
|
2063
2045
|
!1,
|
|
2064
2046
|
null,
|
|
2065
|
-
null,
|
|
2066
|
-
null,
|
|
2067
2047
|
null
|
|
2068
2048
|
);
|
|
2069
2049
|
const _ = Zt.exports;
|
|
@@ -2313,8 +2293,6 @@ var ss = /* @__PURE__ */ m(
|
|
|
2313
2293
|
ts,
|
|
2314
2294
|
!1,
|
|
2315
2295
|
null,
|
|
2316
|
-
null,
|
|
2317
|
-
null,
|
|
2318
2296
|
null
|
|
2319
2297
|
);
|
|
2320
2298
|
const ns = ss.exports, is = {
|
|
@@ -2555,8 +2533,6 @@ var as = /* @__PURE__ */ m(
|
|
|
2555
2533
|
ls,
|
|
2556
2534
|
!1,
|
|
2557
2535
|
null,
|
|
2558
|
-
null,
|
|
2559
|
-
null,
|
|
2560
2536
|
null
|
|
2561
2537
|
);
|
|
2562
2538
|
const Ee = as.exports, cs = {
|
|
@@ -2679,8 +2655,6 @@ var ps = /* @__PURE__ */ m(
|
|
|
2679
2655
|
ds,
|
|
2680
2656
|
!1,
|
|
2681
2657
|
null,
|
|
2682
|
-
null,
|
|
2683
|
-
null,
|
|
2684
2658
|
null
|
|
2685
2659
|
);
|
|
2686
2660
|
const fs = ps.exports, Os = {
|
|
@@ -29,7 +29,7 @@ import "video.js/dist/video-js.min.css";
|
|
|
29
29
|
import y from "video.js";
|
|
30
30
|
import g from "video.js/dist/lang/zh-CN.json";
|
|
31
31
|
import { defaults as b } from "lodash-es";
|
|
32
|
-
import { n as O } from "../chunks/_plugin-vue2_normalizer.
|
|
32
|
+
import { n as O } from "../chunks/_plugin-vue2_normalizer.CeySl7Fu.mjs";
|
|
33
33
|
y.addLanguage("zh", g);
|
|
34
34
|
const _ = ["loadeddata", "canplay", "canplaythrough", "play", "pause", "waiting", "playing", "ended", "error"], $ = {
|
|
35
35
|
name: "VueVideoPlayer",
|
|
@@ -160,8 +160,6 @@ var A = function() {
|
|
|
160
160
|
x,
|
|
161
161
|
!1,
|
|
162
162
|
null,
|
|
163
|
-
null,
|
|
164
|
-
null,
|
|
165
163
|
null
|
|
166
164
|
);
|
|
167
165
|
const w = T.exports;
|
package/watermark/index.mjs
CHANGED
|
@@ -2,16 +2,16 @@ var d = Object.defineProperty, g = Object.defineProperties;
|
|
|
2
2
|
var y = Object.getOwnPropertyDescriptors;
|
|
3
3
|
var s = Object.getOwnPropertySymbols;
|
|
4
4
|
var _ = Object.prototype.hasOwnProperty, x = Object.prototype.propertyIsEnumerable;
|
|
5
|
-
var c = (
|
|
5
|
+
var c = (a, t, e) => t in a ? d(a, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : a[t] = e, o = (a, t) => {
|
|
6
6
|
for (var e in t || (t = {}))
|
|
7
|
-
_.call(t, e) && c(
|
|
7
|
+
_.call(t, e) && c(a, e, t[e]);
|
|
8
8
|
if (s)
|
|
9
9
|
for (var e of s(t))
|
|
10
|
-
x.call(t, e) && c(
|
|
11
|
-
return
|
|
12
|
-
}, u = (
|
|
10
|
+
x.call(t, e) && c(a, e, t[e]);
|
|
11
|
+
return a;
|
|
12
|
+
}, u = (a, t) => g(a, y(t));
|
|
13
13
|
import { g as b } from "../chunks/index.DwCBGcYk.mjs";
|
|
14
|
-
import { n as S } from "../chunks/_plugin-vue2_normalizer.
|
|
14
|
+
import { n as S } from "../chunks/_plugin-vue2_normalizer.CeySl7Fu.mjs";
|
|
15
15
|
const k = {
|
|
16
16
|
name: "Watermark",
|
|
17
17
|
functional: !0,
|
|
@@ -59,14 +59,14 @@ const k = {
|
|
|
59
59
|
default: "rgba(0,0,0,0)"
|
|
60
60
|
}
|
|
61
61
|
},
|
|
62
|
-
render(
|
|
63
|
-
const
|
|
64
|
-
|
|
65
|
-
const
|
|
66
|
-
return
|
|
67
|
-
class: b(
|
|
68
|
-
style: u(o(o({},
|
|
69
|
-
background: `url(${
|
|
62
|
+
render(a, { props: { width: t, height: e, text: f, backgroundColor: i, rotate: p, color: m }, data: r }) {
|
|
63
|
+
const n = document.createElement("canvas");
|
|
64
|
+
n.width = t, n.height = e;
|
|
65
|
+
const l = n.getContext("2d");
|
|
66
|
+
return l.font = "15px Verdana", l.fillStyle = i, l.fillRect(0, 0, t, e), l.translate(t / 2, e / 2), l.rotate(p * Math.PI / 180), l.fillStyle = m, l.textAlign = "center", l.textBaseline = "middle", l.fillText(f, 0, 0), a("div", {
|
|
67
|
+
class: b(r.class, `watermark ${r.staticClass || ""}`),
|
|
68
|
+
style: u(o(o({}, r.style || {}), r.staticStyle || {}), {
|
|
69
|
+
background: `url(${n.toDataURL("image/png")}) left top repeat`
|
|
70
70
|
})
|
|
71
71
|
});
|
|
72
72
|
}
|
|
@@ -77,8 +77,6 @@ var N = /* @__PURE__ */ S(
|
|
|
77
77
|
v,
|
|
78
78
|
!1,
|
|
79
79
|
null,
|
|
80
|
-
null,
|
|
81
|
-
null,
|
|
82
80
|
null
|
|
83
81
|
);
|
|
84
82
|
const $ = N.exports;
|
package/web-types.json
CHANGED
package/x-input-tag/index.mjs
CHANGED
|
@@ -10,23 +10,23 @@ var h = (a, t, e) => t in a ? g(a, t, { enumerable: !0, configurable: !0, writab
|
|
|
10
10
|
v.call(t, e) && h(a, e, t[e]);
|
|
11
11
|
return a;
|
|
12
12
|
}, m = (a, t) => f(a, b(t));
|
|
13
|
-
var
|
|
13
|
+
var u = (a, t, e) => new Promise((s, n) => {
|
|
14
14
|
var o = (i) => {
|
|
15
15
|
try {
|
|
16
16
|
l(e.next(i));
|
|
17
|
-
} catch (
|
|
18
|
-
n(
|
|
17
|
+
} catch (r) {
|
|
18
|
+
n(r);
|
|
19
19
|
}
|
|
20
20
|
}, c = (i) => {
|
|
21
21
|
try {
|
|
22
22
|
l(e.throw(i));
|
|
23
|
-
} catch (
|
|
24
|
-
n(
|
|
23
|
+
} catch (r) {
|
|
24
|
+
n(r);
|
|
25
25
|
}
|
|
26
26
|
}, l = (i) => i.done ? s(i.value) : Promise.resolve(i.value).then(o, c);
|
|
27
27
|
l((e = e.apply(a, t)).next());
|
|
28
28
|
});
|
|
29
|
-
import { n as y } from "../chunks/_plugin-vue2_normalizer.
|
|
29
|
+
import { n as y } from "../chunks/_plugin-vue2_normalizer.CeySl7Fu.mjs";
|
|
30
30
|
const V = {
|
|
31
31
|
name: "XInputTag",
|
|
32
32
|
inject: {
|
|
@@ -85,7 +85,7 @@ const V = {
|
|
|
85
85
|
},
|
|
86
86
|
methods: {
|
|
87
87
|
showInput() {
|
|
88
|
-
return
|
|
88
|
+
return u(this, null, function* () {
|
|
89
89
|
this.inputVisible = !0, yield this.$nextTick(), this.$refs.saveTagInput.$refs.input.focus();
|
|
90
90
|
});
|
|
91
91
|
},
|
|
@@ -94,7 +94,7 @@ const V = {
|
|
|
94
94
|
this.$emit("input", this.arrayMode ? t : t.map((e) => e.name || e).join(this.separator));
|
|
95
95
|
},
|
|
96
96
|
handleInputConfirm() {
|
|
97
|
-
return
|
|
97
|
+
return u(this, null, function* () {
|
|
98
98
|
var t;
|
|
99
99
|
if (this.tags.length >= this.maxTag) {
|
|
100
100
|
this.$message.warning({ message: "标签已达上限,请删除一些标签再添加!", showClose: !0 }), this.inputVisible = !1, this.inputValue = "";
|
|
@@ -131,8 +131,6 @@ var w = function() {
|
|
|
131
131
|
x,
|
|
132
132
|
!1,
|
|
133
133
|
null,
|
|
134
|
-
null,
|
|
135
|
-
null,
|
|
136
134
|
null
|
|
137
135
|
);
|
|
138
136
|
const k = C.exports;
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
function v(r, a, d, h, i, t, f, u) {
|
|
2
|
-
var e = typeof r == "function" ? r.options : r;
|
|
3
|
-
a && (e.render = a, e.staticRenderFns = d, e._compiled = !0), h && (e.functional = !0), t && (e._scopeId = "data-v-" + t);
|
|
4
|
-
var o;
|
|
5
|
-
if (f ? (o = function(n) {
|
|
6
|
-
n = n || // cached call
|
|
7
|
-
this.$vnode && this.$vnode.ssrContext || // stateful
|
|
8
|
-
this.parent && this.parent.$vnode && this.parent.$vnode.ssrContext, !n && typeof __VUE_SSR_CONTEXT__ != "undefined" && (n = __VUE_SSR_CONTEXT__), i && i.call(this, n), n && n._registeredComponents && n._registeredComponents.add(f);
|
|
9
|
-
}, e._ssrRegister = o) : i && (o = u ? function() {
|
|
10
|
-
i.call(
|
|
11
|
-
this,
|
|
12
|
-
(e.functional ? this.parent : this).$root.$options.shadowRoot
|
|
13
|
-
);
|
|
14
|
-
} : i), o)
|
|
15
|
-
if (e.functional) {
|
|
16
|
-
e._injectStyles = o;
|
|
17
|
-
var l = e.render;
|
|
18
|
-
e.render = function(p, _) {
|
|
19
|
-
return o.call(_), l(p, _);
|
|
20
|
-
};
|
|
21
|
-
} else {
|
|
22
|
-
var s = e.beforeCreate;
|
|
23
|
-
e.beforeCreate = s ? [].concat(s, o) : [o];
|
|
24
|
-
}
|
|
25
|
-
return {
|
|
26
|
-
exports: r,
|
|
27
|
-
options: e
|
|
28
|
-
};
|
|
29
|
-
}
|
|
30
|
-
export {
|
|
31
|
-
v as n
|
|
32
|
-
};
|
|
@@ -1,126 +0,0 @@
|
|
|
1
|
-
const p = /[\\"\x00-\x1f\x7f-\x9f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g, O = /^[a-zA-Z_$][0-9a-zA-Z_$]*$/;
|
|
2
|
-
let s, y;
|
|
3
|
-
const N = {
|
|
4
|
-
// table of character substitutions
|
|
5
|
-
"\b": "\\b",
|
|
6
|
-
" ": "\\t",
|
|
7
|
-
"\n": "\\n",
|
|
8
|
-
"\f": "\\f",
|
|
9
|
-
"\r": "\\r",
|
|
10
|
-
'"': '\\"',
|
|
11
|
-
"'": "\\'",
|
|
12
|
-
"\\": "\\\\"
|
|
13
|
-
};
|
|
14
|
-
let h;
|
|
15
|
-
function x(f, n = {}) {
|
|
16
|
-
const e = n.space || 2, t = n.dropQuotesOnKeys !== !1, r = n.dropQuotesOnNumbers || !1, l = n.inlineShortArrays || !1, u = n.inlineShortArraysDepth || 1, a = n.quoteType || "single", c = n.minify || !1;
|
|
17
|
-
r && S(f);
|
|
18
|
-
let o = d(f, null, c ? void 0 : e, t, a);
|
|
19
|
-
if (l && !c) {
|
|
20
|
-
let i = j(o);
|
|
21
|
-
if (u > 1)
|
|
22
|
-
for (let m = 1; m < u && (o = i, i = j(o), i !== o); m++)
|
|
23
|
-
;
|
|
24
|
-
o = i;
|
|
25
|
-
}
|
|
26
|
-
return o;
|
|
27
|
-
}
|
|
28
|
-
function S(f) {
|
|
29
|
-
if (!$(f))
|
|
30
|
-
return;
|
|
31
|
-
const n = Object.keys(f);
|
|
32
|
-
n && n.forEach(function(e) {
|
|
33
|
-
const t = f[e];
|
|
34
|
-
if (typeof t == "string") {
|
|
35
|
-
const r = t - 0;
|
|
36
|
-
f[e] = isNaN(r) ? t : r;
|
|
37
|
-
} else
|
|
38
|
-
($(t) || Array.isArray(t)) && S(t);
|
|
39
|
-
});
|
|
40
|
-
}
|
|
41
|
-
function $(f) {
|
|
42
|
-
return f && typeof f == "object";
|
|
43
|
-
}
|
|
44
|
-
function j(f, n) {
|
|
45
|
-
if (n || (n = 80), typeof n != "number" || n < 20)
|
|
46
|
-
throw Error(`Invalid width '${n}'. Expecting number equal or larger than 20.`);
|
|
47
|
-
const e = f.split(`
|
|
48
|
-
`);
|
|
49
|
-
let t = 0, r = null, l = [];
|
|
50
|
-
for (; t < e.length; ) {
|
|
51
|
-
const u = !!e[t].match(/\[/), a = !!e[t].match(/\],?/);
|
|
52
|
-
if (u && !a)
|
|
53
|
-
l = [e[t]], r = t;
|
|
54
|
-
else if (a && !u && r) {
|
|
55
|
-
l.push((e[t] || "").trim());
|
|
56
|
-
const c = l.join(" ");
|
|
57
|
-
c.length < n && (e.splice(r, t - r + 1, c), t = r), r = null, l = [];
|
|
58
|
-
} else
|
|
59
|
-
r && l.push((e[t] || "").trim());
|
|
60
|
-
t += 1;
|
|
61
|
-
}
|
|
62
|
-
return e.join(`
|
|
63
|
-
`);
|
|
64
|
-
}
|
|
65
|
-
function d(f, n, e, t, r) {
|
|
66
|
-
let l;
|
|
67
|
-
if (s = "", y = "", typeof e == "number")
|
|
68
|
-
for (l = 0; l < e; l += 1)
|
|
69
|
-
y += " ";
|
|
70
|
-
else
|
|
71
|
-
typeof e == "string" && (y = e);
|
|
72
|
-
if (h = n, n && typeof n != "function" && (typeof n != "object" || typeof n.length != "number"))
|
|
73
|
-
throw new Error("JSON.stringify");
|
|
74
|
-
return b("", { "": f }, t, r);
|
|
75
|
-
}
|
|
76
|
-
function b(f, n, e, t) {
|
|
77
|
-
let r, l, u, a;
|
|
78
|
-
const c = s;
|
|
79
|
-
let o, i = n[f];
|
|
80
|
-
switch (i && typeof i == "object" && typeof i.toJSON == "function" && (i = i.toJSON(f)), typeof h == "function" && (i = h.call(n, f, i)), typeof i) {
|
|
81
|
-
case "function":
|
|
82
|
-
return i;
|
|
83
|
-
case "string":
|
|
84
|
-
return g(i, t);
|
|
85
|
-
case "number":
|
|
86
|
-
return isFinite(i) ? String(i) : "null";
|
|
87
|
-
case "boolean":
|
|
88
|
-
case "null":
|
|
89
|
-
return String(i);
|
|
90
|
-
case "object":
|
|
91
|
-
if (!i)
|
|
92
|
-
return "null";
|
|
93
|
-
if (s += y, o = [], Object.prototype.toString.apply(i) === "[object Array]") {
|
|
94
|
-
for (a = i.length, r = 0; r < a; r += 1)
|
|
95
|
-
o[r] = b(r, i, e, t) || "null";
|
|
96
|
-
return u = o.length === 0 ? "[]" : s ? `[
|
|
97
|
-
${s}${o.join(`,
|
|
98
|
-
${s}`)}
|
|
99
|
-
${c}]` : `[${o.join(",")}]`, s = c, u;
|
|
100
|
-
}
|
|
101
|
-
if (h && typeof h == "object")
|
|
102
|
-
for (a = h.length, r = 0; r < a; r += 1)
|
|
103
|
-
typeof h[r] == "string" && (l = h[r], u = b(l, i, e, t), u && o.push((e ? A(l, t) : g(l, t)) + (s ? ": " : ":") + u));
|
|
104
|
-
else
|
|
105
|
-
for (l in i)
|
|
106
|
-
Object.prototype.hasOwnProperty.call(i, l) && (u = b(l, i, e, t), u && o.push((e ? A(l, t) : g(l, t)) + (s ? ": " : ":") + u));
|
|
107
|
-
return u = o.length === 0 ? "{}" : s ? `{
|
|
108
|
-
${s}${o.join(`,
|
|
109
|
-
${s}`)}
|
|
110
|
-
${c}}` : `{${o.join(",")}}`, s = c, u;
|
|
111
|
-
}
|
|
112
|
-
}
|
|
113
|
-
function g(f, n) {
|
|
114
|
-
p.lastIndex = 0;
|
|
115
|
-
let e = '"';
|
|
116
|
-
return n === "single" && (e = "'"), p.test(f) ? e + f.replace(p, function(t) {
|
|
117
|
-
const r = N[t];
|
|
118
|
-
return typeof r == "string" ? r : `\\u${`0000${t.charCodeAt(0).toString(16)}`.slice(-4)}`;
|
|
119
|
-
}) + e : e + f + e;
|
|
120
|
-
}
|
|
121
|
-
function A(f, n) {
|
|
122
|
-
return O.test(f) ? f : g(f, n);
|
|
123
|
-
}
|
|
124
|
-
export {
|
|
125
|
-
x as c
|
|
126
|
-
};
|