@gct-paas/excel 0.1.3 → 0.1.5
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/dist/AntdIcon-C3RMq2zm.js +1040 -0
- package/dist/{VueVideoPlayer-B8RJGNTv.js → VueVideoPlayer-ZLD8hL4k.js} +2 -2
- package/dist/{agg-design-6IuqtI73.js → agg-design-CeJqg8FA.js} +1 -1
- package/dist/{agg-props-MejKEFS3.js → agg-props-CGmbXrHl.js} +1 -1
- package/dist/{agg-style-BSiu_IYt.js → agg-style-BX2t2CGh.js} +1 -1
- package/dist/{align-editor-tfk5DTJa.js → align-editor-DPdYAGLc.js} +1 -1
- package/dist/{attach-fields-editor-DuBBB0a5.js → attach-fields-editor-O4OIRRpB.js} +2 -3
- package/dist/{barcode-design-9v8E6kVo.js → barcode-design-DURI5-Q5.js} +2 -3
- package/dist/base/index.es.js +181 -181
- package/dist/{base-font-editor-DXO4gdQ6.js → base-font-editor-DuDr0oh2.js} +2 -2
- package/dist/{boolean-design-BUPhr8Uf.js → boolean-design-oQ9w0jT6.js} +2 -3
- package/dist/{boolean-props-DG8zyoUM.js → boolean-props-TVey_bO1.js} +3 -3
- package/dist/{boolean-style-FpaFLB6X.js → boolean-style-ahVosL-1.js} +4 -5
- package/dist/{cell-upload-Su9wnjob.js → cell-upload-bBdpI6ua.js} +2 -2
- package/dist/{date-format-editor-CbbECWXa.js → date-format-editor-uNiiJFmw.js} +2 -3
- package/dist/{date-time-design-gtD8VkTL.js → date-time-design-CuMNyFsU.js} +1 -1
- package/dist/{date-time-props-x5cDoV3t.js → date-time-props-ufCr6G2X.js} +3 -4
- package/dist/{date-time-style-DLhE9q9h.js → date-time-style-DLxfllnf.js} +1 -1
- package/dist/{decimal-design-z2oZaw3i.js → decimal-design-D6FK5-3M.js} +1 -1
- package/dist/{decimal-display-mode-B08WxfSe.js → decimal-display-mode-CbMnQBVa.js} +2 -3
- package/dist/{decimal-props-8FH554Dg.js → decimal-props-D7eRAxEu.js} +6 -5
- package/dist/{decimal-style-B1U-geax.js → decimal-style-CIOLsYek.js} +1 -1
- package/dist/{default-value-editor.vue_vue_type_script_setup_true_name_default-value-editor_lang-BjuOuKER.js → default-value-editor.vue_vue_type_script_setup_true_name_default-value-editor_lang-Dt1QVHQ6.js} +2 -3
- package/dist/{diagonal-design-DA6rVQ0d.js → diagonal-design-Doz_EKCn.js} +2 -2
- package/dist/{document-quick-fillin.vue_vue_type_style_index_0_scoped_a18386ab_lang-rs6NI9l0.js → document-quick-fillin.vue_vue_type_style_index_0_scoped_a18386ab_lang-D66iEl9_.js} +1550 -874
- package/dist/{document-sub-table-action-CfTQbFR6.js → document-sub-table-action-DTmf8djY.js} +2 -2
- package/dist/{double-design-BE1NVkXA.js → double-design-CgvwQhau.js} +1 -1
- package/dist/{double-props-CmFhTl5t.js → double-props-Do3bWECB.js} +4 -4
- package/dist/{double-style-B3zUPrSx.js → double-style--msZlxPG.js} +1 -1
- package/dist/{edit.utils-CXmmCnxE-CPiVjLsA.js → edit.utils-CXmmCnxE-BdPovZCI.js} +1 -1
- package/dist/{enum-design-CLuy-erC.js → enum-design-BdHT6RDE.js} +2 -3
- package/dist/{enum-props-B-Xo79Ev.js → enum-props-D5XXv3x-.js} +4 -5
- package/dist/{enum-style-BNUQk0PW.js → enum-style-DhrY3Nb3.js} +2 -2
- package/dist/excel.css +5068 -5068
- package/dist/{exceljs.min-6SjJb8ko.js → exceljs.min-Q7cd3slm.js} +2 -2
- package/dist/{expression-design-iNK25Lw-.js → expression-design-jkeo9bkU.js} +1 -1
- package/dist/{expression-props-Di7qnQBB.js → expression-props-D7Zk2Lj6.js} +1 -1
- package/dist/{expression-style-C2nPzbvt.js → expression-style-eJ70zjw3.js} +1 -1
- package/dist/{file-design-DGvWpVgB.js → file-design-mp0bI-tQ.js} +1 -1
- package/dist/{file-props-Mr9Usm5W.js → file-props-DfENXSNT.js} +2 -3
- package/dist/{file-style-CxbaWDp-.js → file-style-C2uWZfTL.js} +1 -1
- package/dist/{font-editor-tQ6vcAaI.js → font-editor-BgjVz_IS.js} +3 -3
- package/dist/{form-annotation-controller-Bvw0Tqum.js → form-annotation-controller-NcH3tnGJ.js} +2 -2
- package/dist/{image-design-Bd6LITZu.js → image-design-CRtBjNLy.js} +2 -2
- package/dist/{image-design-DVioYMro.js → image-design-DSbpGyCq.js} +2 -3
- package/dist/{image-props-DJTJ1Dz9.js → image-props-DaF9EaTG.js} +1 -1
- package/dist/{image-style-C6LMREtT.js → image-style-ChKqwGjs.js} +1 -1
- package/dist/{index-NlHiBl2x.js → index-0fm9o8n6.js} +1 -2
- package/dist/{index-BHl4jxdE.js → index-3W4ojOsw.js} +1 -2
- package/dist/{index-BKu3iJlW.js → index-7tuEFT4g.js} +2 -3
- package/dist/{index-CdNcHC4Z.js → index-924ospJT.js} +101 -141
- package/dist/{index-B2KpQKV0.js → index-B5sCWlDl.js} +1 -2
- package/dist/{index-C_zt8qy-.js → index-BIBsEVp6.js} +1 -2
- package/dist/{index-C8QF5XdL.js → index-BLZe6LV2.js} +1 -2
- package/dist/{index-mc9loCb9.js → index-BQlGsxLp.js} +1 -2
- package/dist/{index-DuIhcas9.js → index-BlD4K4x9.js} +1 -2
- package/dist/{index-B__ScMj2.js → index-BomC1N9j.js} +1 -2
- package/dist/{index-DHCu3ETv.js → index-Bp_dDukK.js} +1 -2
- package/dist/{index-Bo735WQG.js → index-C-R-S828.js} +1 -2
- package/dist/{index-j9Py4hbh.js → index-CKWk_Iax.js} +1 -2
- package/dist/{index-Dw7ZToXD.js → index-CLfbQ9Km.js} +1 -2
- package/dist/{index-C0clscii.js → index-Cejm_o4O.js} +1 -2
- package/dist/{index-0qy5-Y9L.js → index-CiCyHGDi.js} +1 -2
- package/dist/{index-BlCF5lMK.js → index-CnSZi6Rb.js} +1 -2
- package/dist/{index-Dpd2Dd4N.js → index-CpFGw3N1.js} +1 -2
- package/dist/{index-NFyuCXad.js → index-CrsYNoBp.js} +1 -2
- package/dist/{index-CsbYG4aV.js → index-Czp4LZY9.js} +1 -2
- package/dist/{index-m7_RhgY4.js → index-DBg_HS_0.js} +2 -3
- package/dist/{index-DLvd5e4P.js → index-DM8guHf_.js} +23 -1053
- package/dist/{index-BBinKvOy.js → index-DP-fe4OH.js} +1 -2
- package/dist/{index-DGoSq-oY.js → index-DSzP8X8O.js} +1 -2
- package/dist/{index-DBAbIwxZ.js → index-D_W1JQG3.js} +1 -2
- package/dist/{index-B1ARoYyx.js → index-DbGPzmbp.js} +2 -3
- package/dist/{index-CgYv7OwC.js → index-DfJnS3jv.js} +1 -2
- package/dist/{index-Dmlcu0Lr.js → index-DjrJwtC-.js} +2 -3
- package/dist/{index-Gbo2wZHI.js → index-GMmRcX1e.js} +2 -3
- package/dist/{index-DqK-PVTg.js → index-I4RvYVZ5.js} +1 -2
- package/dist/{index-BdhDAfPE.js → index-j478qavG.js} +1 -2
- package/dist/{index-64eDxMq_.js → index-qQN-nVT9.js} +1 -2
- package/dist/{index-iJg221as.js → index-uZMZ5Sw0.js} +1 -2
- package/dist/index.es.js +35 -29
- package/dist/{integer-design-B9Lp5hBQ.js → integer-design-D9JByLVX.js} +1 -1
- package/dist/integer-props-DxpV-NTy.js +160 -0
- package/dist/{integer-style-dFRGH8Le.js → integer-style-BDLAdzGV.js} +1 -1
- package/dist/mb-render-JL1sDSy6.js +478 -0
- package/dist/{number-input-ex-b4ufZ0Km.js → number-input-ex-3TUi3vyu.js} +1 -1
- package/dist/{org-props-VtCTqAmn.js → org-props-0IzW6XsJ.js} +2 -3
- package/dist/{org-style-DxE-Lz3h.js → org-style-DdpRlrHO.js} +1 -1
- package/dist/{pagination-design-JJtLgAEi.js → pagination-design-v9j51aeB.js} +2 -3
- package/dist/paper-widget-design-fyF-x54_.js +4 -0
- package/dist/{qrcode-design-Ch1o3wA6.js → qrcode-design-CmeowsPt.js} +1 -1
- package/dist/{ref-autofill-editor-BFSb_gl6.js → ref-autofill-editor--L_WtK7J.js} +2 -3
- package/dist/{ref-props-Cdu2o-sk.js → ref-props-jxfaWPha.js} +3 -4
- package/dist/{ref-style-Dp62tx5p.js → ref-style-CaMOimNG.js} +1 -1
- package/dist/{revo-grid.entry-BnyHDT6o.js → revo-grid.entry-DNrCIdcu.js} +1 -1
- package/dist/{revogr-attribution_7.entry-DUpUhrV1.js → revogr-attribution_7.entry-g7DReToZ.js} +3 -3
- package/dist/{revogr-clipboard_3.entry-82fw5UeH.js → revogr-clipboard_3.entry-vJotBpPb.js} +2 -2
- package/dist/{revogr-data_4.entry-Kfvjfmkw.js → revogr-data_4.entry-CoP8SHrP.js} +2 -2
- package/dist/{revogr-filter-panel.entry-DpD_Noa2.js → revogr-filter-panel.entry-Cl_ZKbCr.js} +1 -1
- package/dist/{select-render-type-editor.vue_vue_type_script_setup_true_lang-DsGpyqp2.js → select-render-type-editor.vue_vue_type_script_setup_true_lang-DWza8j-a.js} +2 -3
- package/dist/{serialnumber-design-dCxPhyNA.js → serialnumber-design-DCbPl9zc.js} +1 -1
- package/dist/shared/index.es.js +30 -29
- package/dist/{signature-design-GOamY3lf.js → signature-design-DJ59c5xR.js} +1 -1
- package/dist/{signature-props-MuXYV3T5.js → signature-props-CfLmfzHT.js} +3 -4
- package/dist/{signature-style-weIWDkZN.js → signature-style-dr1T4Dfx.js} +1 -1
- package/dist/{single-field-drop-BNFdHzHJ.js → single-field-drop-BpgydSeT.js} +2 -2
- package/dist/{size-editor-BZj8kZja.js → size-editor-BSZoEseb.js} +1 -1
- package/dist/src/index.d.ts +4 -1
- package/dist/src/online-form/src/views/designer/hooks/reverse-modeling/index.d.ts +2 -1
- package/dist/src/shared/index.d.ts +1 -0
- package/dist/{text-design-oQp6-LBZ.js → text-design-B1cCBOad.js} +2 -2
- package/dist/{text-design-Denb-SXq.js → text-design-GhDOCEKW.js} +2 -3
- package/dist/{text-props-DOpTFgI4.js → text-props-C87CNZwJ.js} +4 -4
- package/dist/{text-style-BxvSgLR_.js → text-style-lLe-3Jf4.js} +1 -1
- package/dist/{throttle-Cpk1LoGk-Dl3YvY9P.js → throttle-Cpk1LoGk-BjiiSDKG.js} +1 -1
- package/dist/{timediff-design-ysLUnCMM.js → timediff-design-OvKUg4IL.js} +1 -2
- package/dist/{trace-design-DV38DOb_.js → trace-design-DGwi2jEJ.js} +2 -3
- package/dist/{trace-props-BVf4__TH.js → trace-props-BatGqfOz.js} +6 -7
- package/dist/{trace-style-BT-657QB.js → trace-style-DJIQyozK.js} +1 -1
- package/dist/{user-props-Dok53NqT.js → user-props-CwnMl96x.js} +2 -3
- package/dist/{user-style-C5BidVxP.js → user-style-C8ZQPaes.js} +1 -1
- package/dist/{value-editor.vue_vue_type_style_index_0_lang-DCAy89F-.js → value-editor.vue_vue_type_style_index_0_lang-f3d5bm3X.js} +2 -3
- package/dist/{integer-props-BSO1Cwfa.js → version-select-D6Jjs5hL.js} +93 -166
- package/dist/web-render/index.es.js +12 -12
- package/dist/{widget-barcode-Dkql6Uuz.js → widget-barcode-B0QQXeUU.js} +4 -5
- package/dist/{widget-diagonal-I0vD8vIp.js → widget-diagonal-DYSwEOPP.js} +3 -4
- package/dist/{widget-image-BEEAwq9h.js → widget-image-F3Kxsxt8.js} +5 -5
- package/dist/{widget-line-BA7Pco_E.js → widget-line-BAXnpy9r.js} +2 -3
- package/dist/{widget-pagination-CwX2P1_j.js → widget-pagination-Z8i0xx7v.js} +5 -6
- package/dist/{widget-power-C1q4qOsP.js → widget-power-hn2k4-Ug.js} +5 -4
- package/dist/{widget-qrcode-DiVEFdHj.js → widget-qrcode-fftrW5Nj.js} +3 -4
- package/dist/{widget-rangelimit-BsmL-mcZ.js → widget-rangelimit-BDivDS-G.js} +3 -4
- package/dist/{widget-serialnumber-CWo03Wxc.js → widget-serialnumber-1QCmac2g.js} +1 -1
- package/dist/{widget-text-Cg0AHGYz.js → widget-text-B51VrEKQ.js} +5 -5
- package/dist/{widget-timediff-BtMh8N_W.js → widget-timediff-DpN47Ghj.js} +2 -3
- package/package.json +1 -1
- package/dist/index-BKGFjeh6.js +0 -1154
- package/dist/paper-widget-design-B5-4PAz2.js +0 -4
- package/dist/search-DIHOEAeY.js +0 -36
- package/dist/signature-DDUs5vB9.js +0 -9
- package/dist/src/online-form/src/components/device/constant.d.ts +0 -1
- package/dist/src/online-form/src/components/esop/type.d.ts +0 -35
- package/dist/src/online-form/src/components/field-type-editor/editors/boolean-editor.vue.d.ts +0 -13
- package/dist/src/online-form/src/components/field-type-editor/editors/date-editor.vue.d.ts +0 -13
- package/dist/src/online-form/src/components/field-type-editor/editors/enum-editor.vue.d.ts +0 -13
- package/dist/src/online-form/src/components/field-type-editor/editors/index.d.ts +0 -6
- package/dist/src/online-form/src/components/field-type-editor/editors/number-editor.vue.d.ts +0 -13
- package/dist/src/online-form/src/components/field-type-editor/editors/text-editor.vue.d.ts +0 -13
- package/dist/src/online-form/src/components/field-type-editor/field-type-editor.vue.d.ts +0 -17
- package/dist/src/online-form/src/components/field-type-editor/index.d.ts +0 -2
- package/dist/src/online-form/src/components/field-type-editor/logic/index.d.ts +0 -8
- package/dist/src/online-form/src/components/field-type-editor/types/index.d.ts +0 -1
- package/dist/src/online-form/src/components/model-field-select/index.d.ts +0 -4
- package/dist/src/online-form/src/components/model-field-select/logic/index.d.ts +0 -10
- package/dist/src/online-form/src/components/model-field-select/model-field-select.vue.d.ts +0 -16
- package/dist/src/online-form/src/components/model-field-select/types/index.d.ts +0 -32
- package/dist/src/online-form/src/utils/common.d.ts +0 -1
- package/dist/src/online-form/src/views/render/__components__/_common_/rangelimit/rangelimit-modal.vue.d.ts +0 -9
- package/dist/src/online-form/src/views/render/__components__/_common_/rangelimit/rangelimit-shower.vue.d.ts +0 -6
- package/dist/src/online-form/src/views/render/__components__/_common_/rangelimit/use-rangelimit.d.ts +0 -18
- package/dist/src/shared/components/pdf-viewer/useObserver.d.ts +0 -15
- package/dist/src/shared/components/pdf-viewer/useVirtualWindow.d.ts +0 -38
|
@@ -0,0 +1,1040 @@
|
|
|
1
|
+
import { nextTick, h, createVNode } from "vue";
|
|
2
|
+
var SignatureTypeEnum = /* @__PURE__ */ ((SignatureTypeEnum2) => {
|
|
3
|
+
SignatureTypeEnum2["SIGNATURE_ONLY"] = "signature_only";
|
|
4
|
+
SignatureTypeEnum2["SIGNATURE_DATE"] = "signature_date";
|
|
5
|
+
SignatureTypeEnum2["SIGNATURE_DATETIME"] = "signature_datetime";
|
|
6
|
+
return SignatureTypeEnum2;
|
|
7
|
+
})(SignatureTypeEnum || {});
|
|
8
|
+
function bound01(n, max) {
|
|
9
|
+
if (isOnePointZero(n)) {
|
|
10
|
+
n = "100%";
|
|
11
|
+
}
|
|
12
|
+
var isPercent = isPercentage(n);
|
|
13
|
+
n = max === 360 ? n : Math.min(max, Math.max(0, parseFloat(n)));
|
|
14
|
+
if (isPercent) {
|
|
15
|
+
n = parseInt(String(n * max), 10) / 100;
|
|
16
|
+
}
|
|
17
|
+
if (Math.abs(n - max) < 1e-6) {
|
|
18
|
+
return 1;
|
|
19
|
+
}
|
|
20
|
+
if (max === 360) {
|
|
21
|
+
n = (n < 0 ? n % max + max : n % max) / parseFloat(String(max));
|
|
22
|
+
} else {
|
|
23
|
+
n = n % max / parseFloat(String(max));
|
|
24
|
+
}
|
|
25
|
+
return n;
|
|
26
|
+
}
|
|
27
|
+
function isOnePointZero(n) {
|
|
28
|
+
return typeof n === "string" && n.indexOf(".") !== -1 && parseFloat(n) === 1;
|
|
29
|
+
}
|
|
30
|
+
function isPercentage(n) {
|
|
31
|
+
return typeof n === "string" && n.indexOf("%") !== -1;
|
|
32
|
+
}
|
|
33
|
+
function boundAlpha(a) {
|
|
34
|
+
a = parseFloat(a);
|
|
35
|
+
if (isNaN(a) || a < 0 || a > 1) {
|
|
36
|
+
a = 1;
|
|
37
|
+
}
|
|
38
|
+
return a;
|
|
39
|
+
}
|
|
40
|
+
function convertToPercentage(n) {
|
|
41
|
+
if (n <= 1) {
|
|
42
|
+
return "".concat(Number(n) * 100, "%");
|
|
43
|
+
}
|
|
44
|
+
return n;
|
|
45
|
+
}
|
|
46
|
+
function pad2(c) {
|
|
47
|
+
return c.length === 1 ? "0" + c : String(c);
|
|
48
|
+
}
|
|
49
|
+
function rgbToRgb(r, g, b) {
|
|
50
|
+
return {
|
|
51
|
+
r: bound01(r, 255) * 255,
|
|
52
|
+
g: bound01(g, 255) * 255,
|
|
53
|
+
b: bound01(b, 255) * 255
|
|
54
|
+
};
|
|
55
|
+
}
|
|
56
|
+
function hue2rgb(p, q, t) {
|
|
57
|
+
if (t < 0) {
|
|
58
|
+
t += 1;
|
|
59
|
+
}
|
|
60
|
+
if (t > 1) {
|
|
61
|
+
t -= 1;
|
|
62
|
+
}
|
|
63
|
+
if (t < 1 / 6) {
|
|
64
|
+
return p + (q - p) * (6 * t);
|
|
65
|
+
}
|
|
66
|
+
if (t < 1 / 2) {
|
|
67
|
+
return q;
|
|
68
|
+
}
|
|
69
|
+
if (t < 2 / 3) {
|
|
70
|
+
return p + (q - p) * (2 / 3 - t) * 6;
|
|
71
|
+
}
|
|
72
|
+
return p;
|
|
73
|
+
}
|
|
74
|
+
function hslToRgb(h2, s, l) {
|
|
75
|
+
var r;
|
|
76
|
+
var g;
|
|
77
|
+
var b;
|
|
78
|
+
h2 = bound01(h2, 360);
|
|
79
|
+
s = bound01(s, 100);
|
|
80
|
+
l = bound01(l, 100);
|
|
81
|
+
if (s === 0) {
|
|
82
|
+
g = l;
|
|
83
|
+
b = l;
|
|
84
|
+
r = l;
|
|
85
|
+
} else {
|
|
86
|
+
var q = l < 0.5 ? l * (1 + s) : l + s - l * s;
|
|
87
|
+
var p = 2 * l - q;
|
|
88
|
+
r = hue2rgb(p, q, h2 + 1 / 3);
|
|
89
|
+
g = hue2rgb(p, q, h2);
|
|
90
|
+
b = hue2rgb(p, q, h2 - 1 / 3);
|
|
91
|
+
}
|
|
92
|
+
return { r: r * 255, g: g * 255, b: b * 255 };
|
|
93
|
+
}
|
|
94
|
+
function rgbToHsv(r, g, b) {
|
|
95
|
+
r = bound01(r, 255);
|
|
96
|
+
g = bound01(g, 255);
|
|
97
|
+
b = bound01(b, 255);
|
|
98
|
+
var max = Math.max(r, g, b);
|
|
99
|
+
var min = Math.min(r, g, b);
|
|
100
|
+
var h2 = 0;
|
|
101
|
+
var v = max;
|
|
102
|
+
var d = max - min;
|
|
103
|
+
var s = max === 0 ? 0 : d / max;
|
|
104
|
+
if (max === min) {
|
|
105
|
+
h2 = 0;
|
|
106
|
+
} else {
|
|
107
|
+
switch (max) {
|
|
108
|
+
case r:
|
|
109
|
+
h2 = (g - b) / d + (g < b ? 6 : 0);
|
|
110
|
+
break;
|
|
111
|
+
case g:
|
|
112
|
+
h2 = (b - r) / d + 2;
|
|
113
|
+
break;
|
|
114
|
+
case b:
|
|
115
|
+
h2 = (r - g) / d + 4;
|
|
116
|
+
break;
|
|
117
|
+
}
|
|
118
|
+
h2 /= 6;
|
|
119
|
+
}
|
|
120
|
+
return { h: h2, s, v };
|
|
121
|
+
}
|
|
122
|
+
function hsvToRgb(h2, s, v) {
|
|
123
|
+
h2 = bound01(h2, 360) * 6;
|
|
124
|
+
s = bound01(s, 100);
|
|
125
|
+
v = bound01(v, 100);
|
|
126
|
+
var i = Math.floor(h2);
|
|
127
|
+
var f = h2 - i;
|
|
128
|
+
var p = v * (1 - s);
|
|
129
|
+
var q = v * (1 - f * s);
|
|
130
|
+
var t = v * (1 - (1 - f) * s);
|
|
131
|
+
var mod = i % 6;
|
|
132
|
+
var r = [v, q, p, p, t, v][mod];
|
|
133
|
+
var g = [t, v, v, q, p, p][mod];
|
|
134
|
+
var b = [p, p, t, v, v, q][mod];
|
|
135
|
+
return { r: r * 255, g: g * 255, b: b * 255 };
|
|
136
|
+
}
|
|
137
|
+
function rgbToHex(r, g, b, allow3Char) {
|
|
138
|
+
var hex = [
|
|
139
|
+
pad2(Math.round(r).toString(16)),
|
|
140
|
+
pad2(Math.round(g).toString(16)),
|
|
141
|
+
pad2(Math.round(b).toString(16))
|
|
142
|
+
];
|
|
143
|
+
return hex.join("");
|
|
144
|
+
}
|
|
145
|
+
function convertHexToDecimal(h2) {
|
|
146
|
+
return parseIntFromHex(h2) / 255;
|
|
147
|
+
}
|
|
148
|
+
function parseIntFromHex(val) {
|
|
149
|
+
return parseInt(val, 16);
|
|
150
|
+
}
|
|
151
|
+
var names = {
|
|
152
|
+
aliceblue: "#f0f8ff",
|
|
153
|
+
antiquewhite: "#faebd7",
|
|
154
|
+
aqua: "#00ffff",
|
|
155
|
+
aquamarine: "#7fffd4",
|
|
156
|
+
azure: "#f0ffff",
|
|
157
|
+
beige: "#f5f5dc",
|
|
158
|
+
bisque: "#ffe4c4",
|
|
159
|
+
black: "#000000",
|
|
160
|
+
blanchedalmond: "#ffebcd",
|
|
161
|
+
blue: "#0000ff",
|
|
162
|
+
blueviolet: "#8a2be2",
|
|
163
|
+
brown: "#a52a2a",
|
|
164
|
+
burlywood: "#deb887",
|
|
165
|
+
cadetblue: "#5f9ea0",
|
|
166
|
+
chartreuse: "#7fff00",
|
|
167
|
+
chocolate: "#d2691e",
|
|
168
|
+
coral: "#ff7f50",
|
|
169
|
+
cornflowerblue: "#6495ed",
|
|
170
|
+
cornsilk: "#fff8dc",
|
|
171
|
+
crimson: "#dc143c",
|
|
172
|
+
cyan: "#00ffff",
|
|
173
|
+
darkblue: "#00008b",
|
|
174
|
+
darkcyan: "#008b8b",
|
|
175
|
+
darkgoldenrod: "#b8860b",
|
|
176
|
+
darkgray: "#a9a9a9",
|
|
177
|
+
darkgreen: "#006400",
|
|
178
|
+
darkgrey: "#a9a9a9",
|
|
179
|
+
darkkhaki: "#bdb76b",
|
|
180
|
+
darkmagenta: "#8b008b",
|
|
181
|
+
darkolivegreen: "#556b2f",
|
|
182
|
+
darkorange: "#ff8c00",
|
|
183
|
+
darkorchid: "#9932cc",
|
|
184
|
+
darkred: "#8b0000",
|
|
185
|
+
darksalmon: "#e9967a",
|
|
186
|
+
darkseagreen: "#8fbc8f",
|
|
187
|
+
darkslateblue: "#483d8b",
|
|
188
|
+
darkslategray: "#2f4f4f",
|
|
189
|
+
darkslategrey: "#2f4f4f",
|
|
190
|
+
darkturquoise: "#00ced1",
|
|
191
|
+
darkviolet: "#9400d3",
|
|
192
|
+
deeppink: "#ff1493",
|
|
193
|
+
deepskyblue: "#00bfff",
|
|
194
|
+
dimgray: "#696969",
|
|
195
|
+
dimgrey: "#696969",
|
|
196
|
+
dodgerblue: "#1e90ff",
|
|
197
|
+
firebrick: "#b22222",
|
|
198
|
+
floralwhite: "#fffaf0",
|
|
199
|
+
forestgreen: "#228b22",
|
|
200
|
+
fuchsia: "#ff00ff",
|
|
201
|
+
gainsboro: "#dcdcdc",
|
|
202
|
+
ghostwhite: "#f8f8ff",
|
|
203
|
+
goldenrod: "#daa520",
|
|
204
|
+
gold: "#ffd700",
|
|
205
|
+
gray: "#808080",
|
|
206
|
+
green: "#008000",
|
|
207
|
+
greenyellow: "#adff2f",
|
|
208
|
+
grey: "#808080",
|
|
209
|
+
honeydew: "#f0fff0",
|
|
210
|
+
hotpink: "#ff69b4",
|
|
211
|
+
indianred: "#cd5c5c",
|
|
212
|
+
indigo: "#4b0082",
|
|
213
|
+
ivory: "#fffff0",
|
|
214
|
+
khaki: "#f0e68c",
|
|
215
|
+
lavenderblush: "#fff0f5",
|
|
216
|
+
lavender: "#e6e6fa",
|
|
217
|
+
lawngreen: "#7cfc00",
|
|
218
|
+
lemonchiffon: "#fffacd",
|
|
219
|
+
lightblue: "#add8e6",
|
|
220
|
+
lightcoral: "#f08080",
|
|
221
|
+
lightcyan: "#e0ffff",
|
|
222
|
+
lightgoldenrodyellow: "#fafad2",
|
|
223
|
+
lightgray: "#d3d3d3",
|
|
224
|
+
lightgreen: "#90ee90",
|
|
225
|
+
lightgrey: "#d3d3d3",
|
|
226
|
+
lightpink: "#ffb6c1",
|
|
227
|
+
lightsalmon: "#ffa07a",
|
|
228
|
+
lightseagreen: "#20b2aa",
|
|
229
|
+
lightskyblue: "#87cefa",
|
|
230
|
+
lightslategray: "#778899",
|
|
231
|
+
lightslategrey: "#778899",
|
|
232
|
+
lightsteelblue: "#b0c4de",
|
|
233
|
+
lightyellow: "#ffffe0",
|
|
234
|
+
lime: "#00ff00",
|
|
235
|
+
limegreen: "#32cd32",
|
|
236
|
+
linen: "#faf0e6",
|
|
237
|
+
magenta: "#ff00ff",
|
|
238
|
+
maroon: "#800000",
|
|
239
|
+
mediumaquamarine: "#66cdaa",
|
|
240
|
+
mediumblue: "#0000cd",
|
|
241
|
+
mediumorchid: "#ba55d3",
|
|
242
|
+
mediumpurple: "#9370db",
|
|
243
|
+
mediumseagreen: "#3cb371",
|
|
244
|
+
mediumslateblue: "#7b68ee",
|
|
245
|
+
mediumspringgreen: "#00fa9a",
|
|
246
|
+
mediumturquoise: "#48d1cc",
|
|
247
|
+
mediumvioletred: "#c71585",
|
|
248
|
+
midnightblue: "#191970",
|
|
249
|
+
mintcream: "#f5fffa",
|
|
250
|
+
mistyrose: "#ffe4e1",
|
|
251
|
+
moccasin: "#ffe4b5",
|
|
252
|
+
navajowhite: "#ffdead",
|
|
253
|
+
navy: "#000080",
|
|
254
|
+
oldlace: "#fdf5e6",
|
|
255
|
+
olive: "#808000",
|
|
256
|
+
olivedrab: "#6b8e23",
|
|
257
|
+
orange: "#ffa500",
|
|
258
|
+
orangered: "#ff4500",
|
|
259
|
+
orchid: "#da70d6",
|
|
260
|
+
palegoldenrod: "#eee8aa",
|
|
261
|
+
palegreen: "#98fb98",
|
|
262
|
+
paleturquoise: "#afeeee",
|
|
263
|
+
palevioletred: "#db7093",
|
|
264
|
+
papayawhip: "#ffefd5",
|
|
265
|
+
peachpuff: "#ffdab9",
|
|
266
|
+
peru: "#cd853f",
|
|
267
|
+
pink: "#ffc0cb",
|
|
268
|
+
plum: "#dda0dd",
|
|
269
|
+
powderblue: "#b0e0e6",
|
|
270
|
+
purple: "#800080",
|
|
271
|
+
rebeccapurple: "#663399",
|
|
272
|
+
red: "#ff0000",
|
|
273
|
+
rosybrown: "#bc8f8f",
|
|
274
|
+
royalblue: "#4169e1",
|
|
275
|
+
saddlebrown: "#8b4513",
|
|
276
|
+
salmon: "#fa8072",
|
|
277
|
+
sandybrown: "#f4a460",
|
|
278
|
+
seagreen: "#2e8b57",
|
|
279
|
+
seashell: "#fff5ee",
|
|
280
|
+
sienna: "#a0522d",
|
|
281
|
+
silver: "#c0c0c0",
|
|
282
|
+
skyblue: "#87ceeb",
|
|
283
|
+
slateblue: "#6a5acd",
|
|
284
|
+
slategray: "#708090",
|
|
285
|
+
slategrey: "#708090",
|
|
286
|
+
snow: "#fffafa",
|
|
287
|
+
springgreen: "#00ff7f",
|
|
288
|
+
steelblue: "#4682b4",
|
|
289
|
+
tan: "#d2b48c",
|
|
290
|
+
teal: "#008080",
|
|
291
|
+
thistle: "#d8bfd8",
|
|
292
|
+
tomato: "#ff6347",
|
|
293
|
+
turquoise: "#40e0d0",
|
|
294
|
+
violet: "#ee82ee",
|
|
295
|
+
wheat: "#f5deb3",
|
|
296
|
+
white: "#ffffff",
|
|
297
|
+
whitesmoke: "#f5f5f5",
|
|
298
|
+
yellow: "#ffff00",
|
|
299
|
+
yellowgreen: "#9acd32"
|
|
300
|
+
};
|
|
301
|
+
function inputToRGB(color) {
|
|
302
|
+
var rgb = { r: 0, g: 0, b: 0 };
|
|
303
|
+
var a = 1;
|
|
304
|
+
var s = null;
|
|
305
|
+
var v = null;
|
|
306
|
+
var l = null;
|
|
307
|
+
var ok = false;
|
|
308
|
+
var format = false;
|
|
309
|
+
if (typeof color === "string") {
|
|
310
|
+
color = stringInputToObject(color);
|
|
311
|
+
}
|
|
312
|
+
if (typeof color === "object") {
|
|
313
|
+
if (isValidCSSUnit(color.r) && isValidCSSUnit(color.g) && isValidCSSUnit(color.b)) {
|
|
314
|
+
rgb = rgbToRgb(color.r, color.g, color.b);
|
|
315
|
+
ok = true;
|
|
316
|
+
format = String(color.r).substr(-1) === "%" ? "prgb" : "rgb";
|
|
317
|
+
} else if (isValidCSSUnit(color.h) && isValidCSSUnit(color.s) && isValidCSSUnit(color.v)) {
|
|
318
|
+
s = convertToPercentage(color.s);
|
|
319
|
+
v = convertToPercentage(color.v);
|
|
320
|
+
rgb = hsvToRgb(color.h, s, v);
|
|
321
|
+
ok = true;
|
|
322
|
+
format = "hsv";
|
|
323
|
+
} else if (isValidCSSUnit(color.h) && isValidCSSUnit(color.s) && isValidCSSUnit(color.l)) {
|
|
324
|
+
s = convertToPercentage(color.s);
|
|
325
|
+
l = convertToPercentage(color.l);
|
|
326
|
+
rgb = hslToRgb(color.h, s, l);
|
|
327
|
+
ok = true;
|
|
328
|
+
format = "hsl";
|
|
329
|
+
}
|
|
330
|
+
if (Object.prototype.hasOwnProperty.call(color, "a")) {
|
|
331
|
+
a = color.a;
|
|
332
|
+
}
|
|
333
|
+
}
|
|
334
|
+
a = boundAlpha(a);
|
|
335
|
+
return {
|
|
336
|
+
ok,
|
|
337
|
+
format: color.format || format,
|
|
338
|
+
r: Math.min(255, Math.max(rgb.r, 0)),
|
|
339
|
+
g: Math.min(255, Math.max(rgb.g, 0)),
|
|
340
|
+
b: Math.min(255, Math.max(rgb.b, 0)),
|
|
341
|
+
a
|
|
342
|
+
};
|
|
343
|
+
}
|
|
344
|
+
var CSS_INTEGER = "[-\\+]?\\d+%?";
|
|
345
|
+
var CSS_NUMBER = "[-\\+]?\\d*\\.\\d+%?";
|
|
346
|
+
var CSS_UNIT = "(?:".concat(CSS_NUMBER, ")|(?:").concat(CSS_INTEGER, ")");
|
|
347
|
+
var PERMISSIVE_MATCH3 = "[\\s|\\(]+(".concat(CSS_UNIT, ")[,|\\s]+(").concat(CSS_UNIT, ")[,|\\s]+(").concat(CSS_UNIT, ")\\s*\\)?");
|
|
348
|
+
var PERMISSIVE_MATCH4 = "[\\s|\\(]+(".concat(CSS_UNIT, ")[,|\\s]+(").concat(CSS_UNIT, ")[,|\\s]+(").concat(CSS_UNIT, ")[,|\\s]+(").concat(CSS_UNIT, ")\\s*\\)?");
|
|
349
|
+
var matchers = {
|
|
350
|
+
CSS_UNIT: new RegExp(CSS_UNIT),
|
|
351
|
+
rgb: new RegExp("rgb" + PERMISSIVE_MATCH3),
|
|
352
|
+
rgba: new RegExp("rgba" + PERMISSIVE_MATCH4),
|
|
353
|
+
hsl: new RegExp("hsl" + PERMISSIVE_MATCH3),
|
|
354
|
+
hsla: new RegExp("hsla" + PERMISSIVE_MATCH4),
|
|
355
|
+
hsv: new RegExp("hsv" + PERMISSIVE_MATCH3),
|
|
356
|
+
hsva: new RegExp("hsva" + PERMISSIVE_MATCH4),
|
|
357
|
+
hex3: /^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,
|
|
358
|
+
hex6: /^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/,
|
|
359
|
+
hex4: /^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,
|
|
360
|
+
hex8: /^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/
|
|
361
|
+
};
|
|
362
|
+
function stringInputToObject(color) {
|
|
363
|
+
color = color.trim().toLowerCase();
|
|
364
|
+
if (color.length === 0) {
|
|
365
|
+
return false;
|
|
366
|
+
}
|
|
367
|
+
var named = false;
|
|
368
|
+
if (names[color]) {
|
|
369
|
+
color = names[color];
|
|
370
|
+
named = true;
|
|
371
|
+
} else if (color === "transparent") {
|
|
372
|
+
return { r: 0, g: 0, b: 0, a: 0, format: "name" };
|
|
373
|
+
}
|
|
374
|
+
var match = matchers.rgb.exec(color);
|
|
375
|
+
if (match) {
|
|
376
|
+
return { r: match[1], g: match[2], b: match[3] };
|
|
377
|
+
}
|
|
378
|
+
match = matchers.rgba.exec(color);
|
|
379
|
+
if (match) {
|
|
380
|
+
return { r: match[1], g: match[2], b: match[3], a: match[4] };
|
|
381
|
+
}
|
|
382
|
+
match = matchers.hsl.exec(color);
|
|
383
|
+
if (match) {
|
|
384
|
+
return { h: match[1], s: match[2], l: match[3] };
|
|
385
|
+
}
|
|
386
|
+
match = matchers.hsla.exec(color);
|
|
387
|
+
if (match) {
|
|
388
|
+
return { h: match[1], s: match[2], l: match[3], a: match[4] };
|
|
389
|
+
}
|
|
390
|
+
match = matchers.hsv.exec(color);
|
|
391
|
+
if (match) {
|
|
392
|
+
return { h: match[1], s: match[2], v: match[3] };
|
|
393
|
+
}
|
|
394
|
+
match = matchers.hsva.exec(color);
|
|
395
|
+
if (match) {
|
|
396
|
+
return { h: match[1], s: match[2], v: match[3], a: match[4] };
|
|
397
|
+
}
|
|
398
|
+
match = matchers.hex8.exec(color);
|
|
399
|
+
if (match) {
|
|
400
|
+
return {
|
|
401
|
+
r: parseIntFromHex(match[1]),
|
|
402
|
+
g: parseIntFromHex(match[2]),
|
|
403
|
+
b: parseIntFromHex(match[3]),
|
|
404
|
+
a: convertHexToDecimal(match[4]),
|
|
405
|
+
format: named ? "name" : "hex8"
|
|
406
|
+
};
|
|
407
|
+
}
|
|
408
|
+
match = matchers.hex6.exec(color);
|
|
409
|
+
if (match) {
|
|
410
|
+
return {
|
|
411
|
+
r: parseIntFromHex(match[1]),
|
|
412
|
+
g: parseIntFromHex(match[2]),
|
|
413
|
+
b: parseIntFromHex(match[3]),
|
|
414
|
+
format: named ? "name" : "hex"
|
|
415
|
+
};
|
|
416
|
+
}
|
|
417
|
+
match = matchers.hex4.exec(color);
|
|
418
|
+
if (match) {
|
|
419
|
+
return {
|
|
420
|
+
r: parseIntFromHex(match[1] + match[1]),
|
|
421
|
+
g: parseIntFromHex(match[2] + match[2]),
|
|
422
|
+
b: parseIntFromHex(match[3] + match[3]),
|
|
423
|
+
a: convertHexToDecimal(match[4] + match[4]),
|
|
424
|
+
format: named ? "name" : "hex8"
|
|
425
|
+
};
|
|
426
|
+
}
|
|
427
|
+
match = matchers.hex3.exec(color);
|
|
428
|
+
if (match) {
|
|
429
|
+
return {
|
|
430
|
+
r: parseIntFromHex(match[1] + match[1]),
|
|
431
|
+
g: parseIntFromHex(match[2] + match[2]),
|
|
432
|
+
b: parseIntFromHex(match[3] + match[3]),
|
|
433
|
+
format: named ? "name" : "hex"
|
|
434
|
+
};
|
|
435
|
+
}
|
|
436
|
+
return false;
|
|
437
|
+
}
|
|
438
|
+
function isValidCSSUnit(color) {
|
|
439
|
+
return Boolean(matchers.CSS_UNIT.exec(String(color)));
|
|
440
|
+
}
|
|
441
|
+
var hueStep = 2;
|
|
442
|
+
var saturationStep = 0.16;
|
|
443
|
+
var saturationStep2 = 0.05;
|
|
444
|
+
var brightnessStep1 = 0.05;
|
|
445
|
+
var brightnessStep2 = 0.15;
|
|
446
|
+
var lightColorCount = 5;
|
|
447
|
+
var darkColorCount = 4;
|
|
448
|
+
var darkColorMap = [{
|
|
449
|
+
index: 7,
|
|
450
|
+
opacity: 0.15
|
|
451
|
+
}, {
|
|
452
|
+
index: 6,
|
|
453
|
+
opacity: 0.25
|
|
454
|
+
}, {
|
|
455
|
+
index: 5,
|
|
456
|
+
opacity: 0.3
|
|
457
|
+
}, {
|
|
458
|
+
index: 5,
|
|
459
|
+
opacity: 0.45
|
|
460
|
+
}, {
|
|
461
|
+
index: 5,
|
|
462
|
+
opacity: 0.65
|
|
463
|
+
}, {
|
|
464
|
+
index: 5,
|
|
465
|
+
opacity: 0.85
|
|
466
|
+
}, {
|
|
467
|
+
index: 4,
|
|
468
|
+
opacity: 0.9
|
|
469
|
+
}, {
|
|
470
|
+
index: 3,
|
|
471
|
+
opacity: 0.95
|
|
472
|
+
}, {
|
|
473
|
+
index: 2,
|
|
474
|
+
opacity: 0.97
|
|
475
|
+
}, {
|
|
476
|
+
index: 1,
|
|
477
|
+
opacity: 0.98
|
|
478
|
+
}];
|
|
479
|
+
function toHsv(_ref) {
|
|
480
|
+
var r = _ref.r, g = _ref.g, b = _ref.b;
|
|
481
|
+
var hsv = rgbToHsv(r, g, b);
|
|
482
|
+
return {
|
|
483
|
+
h: hsv.h * 360,
|
|
484
|
+
s: hsv.s,
|
|
485
|
+
v: hsv.v
|
|
486
|
+
};
|
|
487
|
+
}
|
|
488
|
+
function toHex(_ref2) {
|
|
489
|
+
var r = _ref2.r, g = _ref2.g, b = _ref2.b;
|
|
490
|
+
return "#".concat(rgbToHex(r, g, b));
|
|
491
|
+
}
|
|
492
|
+
function mix(rgb1, rgb2, amount) {
|
|
493
|
+
var p = amount / 100;
|
|
494
|
+
var rgb = {
|
|
495
|
+
r: (rgb2.r - rgb1.r) * p + rgb1.r,
|
|
496
|
+
g: (rgb2.g - rgb1.g) * p + rgb1.g,
|
|
497
|
+
b: (rgb2.b - rgb1.b) * p + rgb1.b
|
|
498
|
+
};
|
|
499
|
+
return rgb;
|
|
500
|
+
}
|
|
501
|
+
function getHue(hsv, i, light) {
|
|
502
|
+
var hue;
|
|
503
|
+
if (Math.round(hsv.h) >= 60 && Math.round(hsv.h) <= 240) {
|
|
504
|
+
hue = light ? Math.round(hsv.h) - hueStep * i : Math.round(hsv.h) + hueStep * i;
|
|
505
|
+
} else {
|
|
506
|
+
hue = light ? Math.round(hsv.h) + hueStep * i : Math.round(hsv.h) - hueStep * i;
|
|
507
|
+
}
|
|
508
|
+
if (hue < 0) {
|
|
509
|
+
hue += 360;
|
|
510
|
+
} else if (hue >= 360) {
|
|
511
|
+
hue -= 360;
|
|
512
|
+
}
|
|
513
|
+
return hue;
|
|
514
|
+
}
|
|
515
|
+
function getSaturation(hsv, i, light) {
|
|
516
|
+
if (hsv.h === 0 && hsv.s === 0) {
|
|
517
|
+
return hsv.s;
|
|
518
|
+
}
|
|
519
|
+
var saturation;
|
|
520
|
+
if (light) {
|
|
521
|
+
saturation = hsv.s - saturationStep * i;
|
|
522
|
+
} else if (i === darkColorCount) {
|
|
523
|
+
saturation = hsv.s + saturationStep;
|
|
524
|
+
} else {
|
|
525
|
+
saturation = hsv.s + saturationStep2 * i;
|
|
526
|
+
}
|
|
527
|
+
if (saturation > 1) {
|
|
528
|
+
saturation = 1;
|
|
529
|
+
}
|
|
530
|
+
if (light && i === lightColorCount && saturation > 0.1) {
|
|
531
|
+
saturation = 0.1;
|
|
532
|
+
}
|
|
533
|
+
if (saturation < 0.06) {
|
|
534
|
+
saturation = 0.06;
|
|
535
|
+
}
|
|
536
|
+
return Number(saturation.toFixed(2));
|
|
537
|
+
}
|
|
538
|
+
function getValue(hsv, i, light) {
|
|
539
|
+
var value;
|
|
540
|
+
if (light) {
|
|
541
|
+
value = hsv.v + brightnessStep1 * i;
|
|
542
|
+
} else {
|
|
543
|
+
value = hsv.v - brightnessStep2 * i;
|
|
544
|
+
}
|
|
545
|
+
if (value > 1) {
|
|
546
|
+
value = 1;
|
|
547
|
+
}
|
|
548
|
+
return Number(value.toFixed(2));
|
|
549
|
+
}
|
|
550
|
+
function generate$1(color) {
|
|
551
|
+
var opts = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
|
|
552
|
+
var patterns = [];
|
|
553
|
+
var pColor = inputToRGB(color);
|
|
554
|
+
for (var i = lightColorCount; i > 0; i -= 1) {
|
|
555
|
+
var hsv = toHsv(pColor);
|
|
556
|
+
var colorString = toHex(inputToRGB({
|
|
557
|
+
h: getHue(hsv, i, true),
|
|
558
|
+
s: getSaturation(hsv, i, true),
|
|
559
|
+
v: getValue(hsv, i, true)
|
|
560
|
+
}));
|
|
561
|
+
patterns.push(colorString);
|
|
562
|
+
}
|
|
563
|
+
patterns.push(toHex(pColor));
|
|
564
|
+
for (var _i = 1; _i <= darkColorCount; _i += 1) {
|
|
565
|
+
var _hsv = toHsv(pColor);
|
|
566
|
+
var _colorString = toHex(inputToRGB({
|
|
567
|
+
h: getHue(_hsv, _i),
|
|
568
|
+
s: getSaturation(_hsv, _i),
|
|
569
|
+
v: getValue(_hsv, _i)
|
|
570
|
+
}));
|
|
571
|
+
patterns.push(_colorString);
|
|
572
|
+
}
|
|
573
|
+
if (opts.theme === "dark") {
|
|
574
|
+
return darkColorMap.map(function(_ref3) {
|
|
575
|
+
var index = _ref3.index, opacity = _ref3.opacity;
|
|
576
|
+
var darkColorString = toHex(mix(inputToRGB(opts.backgroundColor || "#141414"), inputToRGB(patterns[index]), opacity * 100));
|
|
577
|
+
return darkColorString;
|
|
578
|
+
});
|
|
579
|
+
}
|
|
580
|
+
return patterns;
|
|
581
|
+
}
|
|
582
|
+
var presetPrimaryColors = {
|
|
583
|
+
red: "#F5222D",
|
|
584
|
+
volcano: "#FA541C",
|
|
585
|
+
orange: "#FA8C16",
|
|
586
|
+
gold: "#FAAD14",
|
|
587
|
+
yellow: "#FADB14",
|
|
588
|
+
lime: "#A0D911",
|
|
589
|
+
green: "#52C41A",
|
|
590
|
+
cyan: "#13C2C2",
|
|
591
|
+
blue: "#1890FF",
|
|
592
|
+
geekblue: "#2F54EB",
|
|
593
|
+
purple: "#722ED1",
|
|
594
|
+
magenta: "#EB2F96",
|
|
595
|
+
grey: "#666666"
|
|
596
|
+
};
|
|
597
|
+
var presetPalettes = {};
|
|
598
|
+
var presetDarkPalettes = {};
|
|
599
|
+
Object.keys(presetPrimaryColors).forEach(function(key) {
|
|
600
|
+
presetPalettes[key] = generate$1(presetPrimaryColors[key]);
|
|
601
|
+
presetPalettes[key].primary = presetPalettes[key][5];
|
|
602
|
+
presetDarkPalettes[key] = generate$1(presetPrimaryColors[key], {
|
|
603
|
+
theme: "dark",
|
|
604
|
+
backgroundColor: "#141414"
|
|
605
|
+
});
|
|
606
|
+
presetDarkPalettes[key].primary = presetDarkPalettes[key][5];
|
|
607
|
+
});
|
|
608
|
+
var containers = [];
|
|
609
|
+
var styleElements = [];
|
|
610
|
+
var usage = "insert-css: You need to provide a CSS string. Usage: insertCss(cssString[, options]).";
|
|
611
|
+
function createStyleElement() {
|
|
612
|
+
var styleElement = document.createElement("style");
|
|
613
|
+
styleElement.setAttribute("type", "text/css");
|
|
614
|
+
return styleElement;
|
|
615
|
+
}
|
|
616
|
+
function insertCss(css, options) {
|
|
617
|
+
options = options || {};
|
|
618
|
+
if (css === void 0) {
|
|
619
|
+
throw new Error(usage);
|
|
620
|
+
}
|
|
621
|
+
var position = options.prepend === true ? "prepend" : "append";
|
|
622
|
+
var container = options.container !== void 0 ? options.container : document.querySelector("head");
|
|
623
|
+
var containerId = containers.indexOf(container);
|
|
624
|
+
if (containerId === -1) {
|
|
625
|
+
containerId = containers.push(container) - 1;
|
|
626
|
+
styleElements[containerId] = {};
|
|
627
|
+
}
|
|
628
|
+
var styleElement;
|
|
629
|
+
if (styleElements[containerId] !== void 0 && styleElements[containerId][position] !== void 0) {
|
|
630
|
+
styleElement = styleElements[containerId][position];
|
|
631
|
+
} else {
|
|
632
|
+
styleElement = styleElements[containerId][position] = createStyleElement();
|
|
633
|
+
if (position === "prepend") {
|
|
634
|
+
container.insertBefore(styleElement, container.childNodes[0]);
|
|
635
|
+
} else {
|
|
636
|
+
container.appendChild(styleElement);
|
|
637
|
+
}
|
|
638
|
+
}
|
|
639
|
+
if (css.charCodeAt(0) === 65279) {
|
|
640
|
+
css = css.substr(1, css.length);
|
|
641
|
+
}
|
|
642
|
+
if (styleElement.styleSheet) {
|
|
643
|
+
styleElement.styleSheet.cssText += css;
|
|
644
|
+
} else {
|
|
645
|
+
styleElement.textContent += css;
|
|
646
|
+
}
|
|
647
|
+
return styleElement;
|
|
648
|
+
}
|
|
649
|
+
function _objectSpread$2(target) {
|
|
650
|
+
for (var i = 1; i < arguments.length; i++) {
|
|
651
|
+
var source = arguments[i] != null ? Object(arguments[i]) : {};
|
|
652
|
+
var ownKeys = Object.keys(source);
|
|
653
|
+
if (typeof Object.getOwnPropertySymbols === "function") {
|
|
654
|
+
ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function(sym) {
|
|
655
|
+
return Object.getOwnPropertyDescriptor(source, sym).enumerable;
|
|
656
|
+
}));
|
|
657
|
+
}
|
|
658
|
+
ownKeys.forEach(function(key) {
|
|
659
|
+
_defineProperty$2(target, key, source[key]);
|
|
660
|
+
});
|
|
661
|
+
}
|
|
662
|
+
return target;
|
|
663
|
+
}
|
|
664
|
+
function _defineProperty$2(obj, key, value) {
|
|
665
|
+
if (key in obj) {
|
|
666
|
+
Object.defineProperty(obj, key, { value, enumerable: true, configurable: true, writable: true });
|
|
667
|
+
} else {
|
|
668
|
+
obj[key] = value;
|
|
669
|
+
}
|
|
670
|
+
return obj;
|
|
671
|
+
}
|
|
672
|
+
function warn(valid, message) {
|
|
673
|
+
if (process.env.NODE_ENV !== "production" && !valid && console !== void 0) {
|
|
674
|
+
console.error("Warning: ".concat(message));
|
|
675
|
+
}
|
|
676
|
+
}
|
|
677
|
+
function warning(valid, message) {
|
|
678
|
+
warn(valid, "[@ant-design/icons-vue] ".concat(message));
|
|
679
|
+
}
|
|
680
|
+
function isIconDefinition(target) {
|
|
681
|
+
return typeof target === "object" && typeof target.name === "string" && typeof target.theme === "string" && (typeof target.icon === "object" || typeof target.icon === "function");
|
|
682
|
+
}
|
|
683
|
+
function generate(node, key, rootProps) {
|
|
684
|
+
if (!rootProps) {
|
|
685
|
+
return h(node.tag, _objectSpread$2({
|
|
686
|
+
key
|
|
687
|
+
}, node.attrs), (node.children || []).map(function(child, index) {
|
|
688
|
+
return generate(child, "".concat(key, "-").concat(node.tag, "-").concat(index));
|
|
689
|
+
}));
|
|
690
|
+
}
|
|
691
|
+
return h(node.tag, _objectSpread$2({
|
|
692
|
+
key
|
|
693
|
+
}, rootProps, node.attrs), (node.children || []).map(function(child, index) {
|
|
694
|
+
return generate(child, "".concat(key, "-").concat(node.tag, "-").concat(index));
|
|
695
|
+
}));
|
|
696
|
+
}
|
|
697
|
+
function getSecondaryColor(primaryColor) {
|
|
698
|
+
return generate$1(primaryColor)[0];
|
|
699
|
+
}
|
|
700
|
+
function normalizeTwoToneColors(twoToneColor) {
|
|
701
|
+
if (!twoToneColor) {
|
|
702
|
+
return [];
|
|
703
|
+
}
|
|
704
|
+
return Array.isArray(twoToneColor) ? twoToneColor : [twoToneColor];
|
|
705
|
+
}
|
|
706
|
+
var svgBaseProps = {
|
|
707
|
+
width: "1em",
|
|
708
|
+
height: "1em",
|
|
709
|
+
fill: "currentColor",
|
|
710
|
+
"aria-hidden": "true",
|
|
711
|
+
focusable: "false"
|
|
712
|
+
};
|
|
713
|
+
var iconStyles = "\n.anticon {\n display: inline-block;\n color: inherit;\n font-style: normal;\n line-height: 0;\n text-align: center;\n text-transform: none;\n vertical-align: -0.125em;\n text-rendering: optimizeLegibility;\n -webkit-font-smoothing: antialiased;\n -moz-osx-font-smoothing: grayscale;\n}\n\n.anticon > * {\n line-height: 1;\n}\n\n.anticon svg {\n display: inline-block;\n}\n\n.anticon::before {\n display: none;\n}\n\n.anticon .anticon-icon {\n display: block;\n}\n\n.anticon[tabindex] {\n cursor: pointer;\n}\n\n.anticon-spin::before,\n.anticon-spin {\n display: inline-block;\n -webkit-animation: loadingCircle 1s infinite linear;\n animation: loadingCircle 1s infinite linear;\n}\n\n@-webkit-keyframes loadingCircle {\n 100% {\n -webkit-transform: rotate(360deg);\n transform: rotate(360deg);\n }\n}\n\n@keyframes loadingCircle {\n 100% {\n -webkit-transform: rotate(360deg);\n transform: rotate(360deg);\n }\n}\n";
|
|
714
|
+
var cssInjectedFlag = false;
|
|
715
|
+
var useInsertStyles = function useInsertStyles2() {
|
|
716
|
+
var styleStr = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : iconStyles;
|
|
717
|
+
nextTick(function() {
|
|
718
|
+
if (!cssInjectedFlag) {
|
|
719
|
+
if (typeof window !== "undefined" && window.document && window.document.documentElement) {
|
|
720
|
+
insertCss(styleStr, {
|
|
721
|
+
prepend: true
|
|
722
|
+
});
|
|
723
|
+
}
|
|
724
|
+
cssInjectedFlag = true;
|
|
725
|
+
}
|
|
726
|
+
});
|
|
727
|
+
};
|
|
728
|
+
var _excluded$1 = ["icon", "primaryColor", "secondaryColor"];
|
|
729
|
+
function _objectWithoutProperties$1(source, excluded) {
|
|
730
|
+
if (source == null) return {};
|
|
731
|
+
var target = _objectWithoutPropertiesLoose$1(source, excluded);
|
|
732
|
+
var key, i;
|
|
733
|
+
if (Object.getOwnPropertySymbols) {
|
|
734
|
+
var sourceSymbolKeys = Object.getOwnPropertySymbols(source);
|
|
735
|
+
for (i = 0; i < sourceSymbolKeys.length; i++) {
|
|
736
|
+
key = sourceSymbolKeys[i];
|
|
737
|
+
if (excluded.indexOf(key) >= 0) continue;
|
|
738
|
+
if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue;
|
|
739
|
+
target[key] = source[key];
|
|
740
|
+
}
|
|
741
|
+
}
|
|
742
|
+
return target;
|
|
743
|
+
}
|
|
744
|
+
function _objectWithoutPropertiesLoose$1(source, excluded) {
|
|
745
|
+
if (source == null) return {};
|
|
746
|
+
var target = {};
|
|
747
|
+
var sourceKeys = Object.keys(source);
|
|
748
|
+
var key, i;
|
|
749
|
+
for (i = 0; i < sourceKeys.length; i++) {
|
|
750
|
+
key = sourceKeys[i];
|
|
751
|
+
if (excluded.indexOf(key) >= 0) continue;
|
|
752
|
+
target[key] = source[key];
|
|
753
|
+
}
|
|
754
|
+
return target;
|
|
755
|
+
}
|
|
756
|
+
function _objectSpread$1(target) {
|
|
757
|
+
for (var i = 1; i < arguments.length; i++) {
|
|
758
|
+
var source = arguments[i] != null ? Object(arguments[i]) : {};
|
|
759
|
+
var ownKeys = Object.keys(source);
|
|
760
|
+
if (typeof Object.getOwnPropertySymbols === "function") {
|
|
761
|
+
ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function(sym) {
|
|
762
|
+
return Object.getOwnPropertyDescriptor(source, sym).enumerable;
|
|
763
|
+
}));
|
|
764
|
+
}
|
|
765
|
+
ownKeys.forEach(function(key) {
|
|
766
|
+
_defineProperty$1(target, key, source[key]);
|
|
767
|
+
});
|
|
768
|
+
}
|
|
769
|
+
return target;
|
|
770
|
+
}
|
|
771
|
+
function _defineProperty$1(obj, key, value) {
|
|
772
|
+
if (key in obj) {
|
|
773
|
+
Object.defineProperty(obj, key, { value, enumerable: true, configurable: true, writable: true });
|
|
774
|
+
} else {
|
|
775
|
+
obj[key] = value;
|
|
776
|
+
}
|
|
777
|
+
return obj;
|
|
778
|
+
}
|
|
779
|
+
var twoToneColorPalette = {
|
|
780
|
+
primaryColor: "#333",
|
|
781
|
+
secondaryColor: "#E6E6E6",
|
|
782
|
+
calculated: false
|
|
783
|
+
};
|
|
784
|
+
function setTwoToneColors(_ref) {
|
|
785
|
+
var primaryColor = _ref.primaryColor, secondaryColor = _ref.secondaryColor;
|
|
786
|
+
twoToneColorPalette.primaryColor = primaryColor;
|
|
787
|
+
twoToneColorPalette.secondaryColor = secondaryColor || getSecondaryColor(primaryColor);
|
|
788
|
+
twoToneColorPalette.calculated = !!secondaryColor;
|
|
789
|
+
}
|
|
790
|
+
function getTwoToneColors() {
|
|
791
|
+
return _objectSpread$1({}, twoToneColorPalette);
|
|
792
|
+
}
|
|
793
|
+
var IconBase = function IconBase2(props, context) {
|
|
794
|
+
var _props$context$attrs = _objectSpread$1({}, props, context.attrs), icon = _props$context$attrs.icon, primaryColor = _props$context$attrs.primaryColor, secondaryColor = _props$context$attrs.secondaryColor, restProps = _objectWithoutProperties$1(_props$context$attrs, _excluded$1);
|
|
795
|
+
var colors = twoToneColorPalette;
|
|
796
|
+
if (primaryColor) {
|
|
797
|
+
colors = {
|
|
798
|
+
primaryColor,
|
|
799
|
+
secondaryColor: secondaryColor || getSecondaryColor(primaryColor)
|
|
800
|
+
};
|
|
801
|
+
}
|
|
802
|
+
useInsertStyles();
|
|
803
|
+
warning(isIconDefinition(icon), "icon should be icon definiton, but got ".concat(icon));
|
|
804
|
+
if (!isIconDefinition(icon)) {
|
|
805
|
+
return null;
|
|
806
|
+
}
|
|
807
|
+
var target = icon;
|
|
808
|
+
if (target && typeof target.icon === "function") {
|
|
809
|
+
target = _objectSpread$1({}, target, {
|
|
810
|
+
icon: target.icon(colors.primaryColor, colors.secondaryColor)
|
|
811
|
+
});
|
|
812
|
+
}
|
|
813
|
+
return generate(target.icon, "svg-".concat(target.name), _objectSpread$1({}, restProps, {
|
|
814
|
+
"data-icon": target.name,
|
|
815
|
+
width: "1em",
|
|
816
|
+
height: "1em",
|
|
817
|
+
fill: "currentColor",
|
|
818
|
+
"aria-hidden": "true"
|
|
819
|
+
}));
|
|
820
|
+
};
|
|
821
|
+
IconBase.props = {
|
|
822
|
+
icon: Object,
|
|
823
|
+
primaryColor: String,
|
|
824
|
+
secondaryColor: String,
|
|
825
|
+
focusable: String
|
|
826
|
+
};
|
|
827
|
+
IconBase.inheritAttrs = false;
|
|
828
|
+
IconBase.displayName = "IconBase";
|
|
829
|
+
IconBase.getTwoToneColors = getTwoToneColors;
|
|
830
|
+
IconBase.setTwoToneColors = setTwoToneColors;
|
|
831
|
+
function _slicedToArray$1(arr, i) {
|
|
832
|
+
return _arrayWithHoles$1(arr) || _iterableToArrayLimit$1(arr, i) || _unsupportedIterableToArray$1(arr, i) || _nonIterableRest$1();
|
|
833
|
+
}
|
|
834
|
+
function _nonIterableRest$1() {
|
|
835
|
+
throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
836
|
+
}
|
|
837
|
+
function _unsupportedIterableToArray$1(o, minLen) {
|
|
838
|
+
if (!o) return;
|
|
839
|
+
if (typeof o === "string") return _arrayLikeToArray$1(o, minLen);
|
|
840
|
+
var n = Object.prototype.toString.call(o).slice(8, -1);
|
|
841
|
+
if (n === "Object" && o.constructor) n = o.constructor.name;
|
|
842
|
+
if (n === "Map" || n === "Set") return Array.from(o);
|
|
843
|
+
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray$1(o, minLen);
|
|
844
|
+
}
|
|
845
|
+
function _arrayLikeToArray$1(arr, len) {
|
|
846
|
+
if (len == null || len > arr.length) len = arr.length;
|
|
847
|
+
for (var i = 0, arr2 = new Array(len); i < len; i++) {
|
|
848
|
+
arr2[i] = arr[i];
|
|
849
|
+
}
|
|
850
|
+
return arr2;
|
|
851
|
+
}
|
|
852
|
+
function _iterableToArrayLimit$1(arr, i) {
|
|
853
|
+
var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"];
|
|
854
|
+
if (_i == null) return;
|
|
855
|
+
var _arr = [];
|
|
856
|
+
var _n = true;
|
|
857
|
+
var _d = false;
|
|
858
|
+
var _s, _e;
|
|
859
|
+
try {
|
|
860
|
+
for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) {
|
|
861
|
+
_arr.push(_s.value);
|
|
862
|
+
if (i && _arr.length === i) break;
|
|
863
|
+
}
|
|
864
|
+
} catch (err) {
|
|
865
|
+
_d = true;
|
|
866
|
+
_e = err;
|
|
867
|
+
} finally {
|
|
868
|
+
try {
|
|
869
|
+
if (!_n && _i["return"] != null) _i["return"]();
|
|
870
|
+
} finally {
|
|
871
|
+
if (_d) throw _e;
|
|
872
|
+
}
|
|
873
|
+
}
|
|
874
|
+
return _arr;
|
|
875
|
+
}
|
|
876
|
+
function _arrayWithHoles$1(arr) {
|
|
877
|
+
if (Array.isArray(arr)) return arr;
|
|
878
|
+
}
|
|
879
|
+
function setTwoToneColor(twoToneColor) {
|
|
880
|
+
var _normalizeTwoToneColo = normalizeTwoToneColors(twoToneColor), _normalizeTwoToneColo2 = _slicedToArray$1(_normalizeTwoToneColo, 2), primaryColor = _normalizeTwoToneColo2[0], secondaryColor = _normalizeTwoToneColo2[1];
|
|
881
|
+
return IconBase.setTwoToneColors({
|
|
882
|
+
primaryColor,
|
|
883
|
+
secondaryColor
|
|
884
|
+
});
|
|
885
|
+
}
|
|
886
|
+
function getTwoToneColor() {
|
|
887
|
+
var colors = IconBase.getTwoToneColors();
|
|
888
|
+
if (!colors.calculated) {
|
|
889
|
+
return colors.primaryColor;
|
|
890
|
+
}
|
|
891
|
+
return [colors.primaryColor, colors.secondaryColor];
|
|
892
|
+
}
|
|
893
|
+
var _excluded = ["class", "icon", "spin", "rotate", "tabindex", "twoToneColor", "onClick"];
|
|
894
|
+
function _slicedToArray(arr, i) {
|
|
895
|
+
return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest();
|
|
896
|
+
}
|
|
897
|
+
function _nonIterableRest() {
|
|
898
|
+
throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
899
|
+
}
|
|
900
|
+
function _unsupportedIterableToArray(o, minLen) {
|
|
901
|
+
if (!o) return;
|
|
902
|
+
if (typeof o === "string") return _arrayLikeToArray(o, minLen);
|
|
903
|
+
var n = Object.prototype.toString.call(o).slice(8, -1);
|
|
904
|
+
if (n === "Object" && o.constructor) n = o.constructor.name;
|
|
905
|
+
if (n === "Map" || n === "Set") return Array.from(o);
|
|
906
|
+
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen);
|
|
907
|
+
}
|
|
908
|
+
function _arrayLikeToArray(arr, len) {
|
|
909
|
+
if (len == null || len > arr.length) len = arr.length;
|
|
910
|
+
for (var i = 0, arr2 = new Array(len); i < len; i++) {
|
|
911
|
+
arr2[i] = arr[i];
|
|
912
|
+
}
|
|
913
|
+
return arr2;
|
|
914
|
+
}
|
|
915
|
+
function _iterableToArrayLimit(arr, i) {
|
|
916
|
+
var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"];
|
|
917
|
+
if (_i == null) return;
|
|
918
|
+
var _arr = [];
|
|
919
|
+
var _n = true;
|
|
920
|
+
var _d = false;
|
|
921
|
+
var _s, _e;
|
|
922
|
+
try {
|
|
923
|
+
for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) {
|
|
924
|
+
_arr.push(_s.value);
|
|
925
|
+
if (i && _arr.length === i) break;
|
|
926
|
+
}
|
|
927
|
+
} catch (err) {
|
|
928
|
+
_d = true;
|
|
929
|
+
_e = err;
|
|
930
|
+
} finally {
|
|
931
|
+
try {
|
|
932
|
+
if (!_n && _i["return"] != null) _i["return"]();
|
|
933
|
+
} finally {
|
|
934
|
+
if (_d) throw _e;
|
|
935
|
+
}
|
|
936
|
+
}
|
|
937
|
+
return _arr;
|
|
938
|
+
}
|
|
939
|
+
function _arrayWithHoles(arr) {
|
|
940
|
+
if (Array.isArray(arr)) return arr;
|
|
941
|
+
}
|
|
942
|
+
function _objectSpread(target) {
|
|
943
|
+
for (var i = 1; i < arguments.length; i++) {
|
|
944
|
+
var source = arguments[i] != null ? Object(arguments[i]) : {};
|
|
945
|
+
var ownKeys = Object.keys(source);
|
|
946
|
+
if (typeof Object.getOwnPropertySymbols === "function") {
|
|
947
|
+
ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function(sym) {
|
|
948
|
+
return Object.getOwnPropertyDescriptor(source, sym).enumerable;
|
|
949
|
+
}));
|
|
950
|
+
}
|
|
951
|
+
ownKeys.forEach(function(key) {
|
|
952
|
+
_defineProperty(target, key, source[key]);
|
|
953
|
+
});
|
|
954
|
+
}
|
|
955
|
+
return target;
|
|
956
|
+
}
|
|
957
|
+
function _defineProperty(obj, key, value) {
|
|
958
|
+
if (key in obj) {
|
|
959
|
+
Object.defineProperty(obj, key, { value, enumerable: true, configurable: true, writable: true });
|
|
960
|
+
} else {
|
|
961
|
+
obj[key] = value;
|
|
962
|
+
}
|
|
963
|
+
return obj;
|
|
964
|
+
}
|
|
965
|
+
function _objectWithoutProperties(source, excluded) {
|
|
966
|
+
if (source == null) return {};
|
|
967
|
+
var target = _objectWithoutPropertiesLoose(source, excluded);
|
|
968
|
+
var key, i;
|
|
969
|
+
if (Object.getOwnPropertySymbols) {
|
|
970
|
+
var sourceSymbolKeys = Object.getOwnPropertySymbols(source);
|
|
971
|
+
for (i = 0; i < sourceSymbolKeys.length; i++) {
|
|
972
|
+
key = sourceSymbolKeys[i];
|
|
973
|
+
if (excluded.indexOf(key) >= 0) continue;
|
|
974
|
+
if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue;
|
|
975
|
+
target[key] = source[key];
|
|
976
|
+
}
|
|
977
|
+
}
|
|
978
|
+
return target;
|
|
979
|
+
}
|
|
980
|
+
function _objectWithoutPropertiesLoose(source, excluded) {
|
|
981
|
+
if (source == null) return {};
|
|
982
|
+
var target = {};
|
|
983
|
+
var sourceKeys = Object.keys(source);
|
|
984
|
+
var key, i;
|
|
985
|
+
for (i = 0; i < sourceKeys.length; i++) {
|
|
986
|
+
key = sourceKeys[i];
|
|
987
|
+
if (excluded.indexOf(key) >= 0) continue;
|
|
988
|
+
target[key] = source[key];
|
|
989
|
+
}
|
|
990
|
+
return target;
|
|
991
|
+
}
|
|
992
|
+
setTwoToneColor("#1890ff");
|
|
993
|
+
var Icon = function Icon2(props, context) {
|
|
994
|
+
var _classObj;
|
|
995
|
+
var _props$context$attrs = _objectSpread({}, props, context.attrs), cls = _props$context$attrs["class"], icon = _props$context$attrs.icon, spin = _props$context$attrs.spin, rotate = _props$context$attrs.rotate, tabindex = _props$context$attrs.tabindex, twoToneColor = _props$context$attrs.twoToneColor, onClick = _props$context$attrs.onClick, restProps = _objectWithoutProperties(_props$context$attrs, _excluded);
|
|
996
|
+
var classObj = (_classObj = {
|
|
997
|
+
anticon: true
|
|
998
|
+
}, _defineProperty(_classObj, "anticon-".concat(icon.name), Boolean(icon.name)), _defineProperty(_classObj, cls, cls), _classObj);
|
|
999
|
+
var svgClassString = spin === "" || !!spin || icon.name === "loading" ? "anticon-spin" : "";
|
|
1000
|
+
var iconTabIndex = tabindex;
|
|
1001
|
+
if (iconTabIndex === void 0 && onClick) {
|
|
1002
|
+
iconTabIndex = -1;
|
|
1003
|
+
restProps.tabindex = iconTabIndex;
|
|
1004
|
+
}
|
|
1005
|
+
var svgStyle = rotate ? {
|
|
1006
|
+
msTransform: "rotate(".concat(rotate, "deg)"),
|
|
1007
|
+
transform: "rotate(".concat(rotate, "deg)")
|
|
1008
|
+
} : void 0;
|
|
1009
|
+
var _normalizeTwoToneColo = normalizeTwoToneColors(twoToneColor), _normalizeTwoToneColo2 = _slicedToArray(_normalizeTwoToneColo, 2), primaryColor = _normalizeTwoToneColo2[0], secondaryColor = _normalizeTwoToneColo2[1];
|
|
1010
|
+
return createVNode("span", _objectSpread({
|
|
1011
|
+
"role": "img",
|
|
1012
|
+
"aria-label": icon.name
|
|
1013
|
+
}, restProps, {
|
|
1014
|
+
"onClick": onClick,
|
|
1015
|
+
"class": classObj
|
|
1016
|
+
}), [createVNode(IconBase, {
|
|
1017
|
+
"class": svgClassString,
|
|
1018
|
+
"icon": icon,
|
|
1019
|
+
"primaryColor": primaryColor,
|
|
1020
|
+
"secondaryColor": secondaryColor,
|
|
1021
|
+
"style": svgStyle
|
|
1022
|
+
}, null)]);
|
|
1023
|
+
};
|
|
1024
|
+
Icon.props = {
|
|
1025
|
+
spin: Boolean,
|
|
1026
|
+
rotate: Number,
|
|
1027
|
+
icon: Object,
|
|
1028
|
+
twoToneColor: String
|
|
1029
|
+
};
|
|
1030
|
+
Icon.displayName = "AntdIcon";
|
|
1031
|
+
Icon.inheritAttrs = false;
|
|
1032
|
+
Icon.getTwoToneColor = getTwoToneColor;
|
|
1033
|
+
Icon.setTwoToneColor = setTwoToneColor;
|
|
1034
|
+
export {
|
|
1035
|
+
Icon as I,
|
|
1036
|
+
SignatureTypeEnum as S,
|
|
1037
|
+
svgBaseProps as s,
|
|
1038
|
+
useInsertStyles as u,
|
|
1039
|
+
warning as w
|
|
1040
|
+
};
|