@gct-paas/excel 0.1.47 → 0.1.48-beta.0
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 +3 -4
- package/dist/{BaseComponent-CD_dAL9D.js → BaseComponent-CuX5xLFK.js} +4 -3
- package/dist/{VueVideoPlayer-DQQlv_cp.js → VueVideoPlayer-CBBB12Hj.js} +2 -2
- package/dist/{align-editor-DchzBHaC.js → align-editor-Df9gS31T.js} +1 -1
- package/dist/{barcode-design-BBW5cG3v.js → barcode-design-B34-4xJ9.js} +3 -2
- package/dist/base/index.es.js +517 -222
- package/dist/{diagonal-design-CawGqmc7.js → diagonal-design-D0HXMI8w.js} +3 -2
- package/dist/{dynamic-table-action-Dw7AIthU.js → dynamic-table-action-9sxv3gW5.js} +452 -322
- package/dist/{dynamic-table-action.vue_vue_type_style_index_0_scoped_53d7e66c_lang-DEjLEs33.js → dynamic-table-action.vue_vue_type_style_index_0_scoped_8710052f_lang-YSIO0k9J.js} +2296 -593
- package/dist/{edit.utils-CXmmCnxE-B7lpVZjb.js → edit.utils-CXmmCnxE-0uJiCs33.js} +1 -1
- package/dist/excel.css +611 -723
- package/dist/{exceljs.min-DDPQIUli.js → exceljs.min-Doeyz39_.js} +2 -2
- package/dist/{font-editor-n8zk8Vt2.js → font-editor-B8A9tDhO.js} +3 -3
- package/dist/{image-design-D4mIDz9K.js → image-design-CVyCbbef.js} +3 -8
- package/dist/{index-DfFakGrF.js → index-7VROqGqR.js} +3 -2
- package/dist/{index-1klMDz7G.js → index-B3hu8heh.js} +3 -2
- package/dist/{index-C4t8sSlN.js → index-B7Yt5TSq.js} +2 -1
- package/dist/{index-B0u6FHDq.js → index-BLJdXkdZ.js} +5 -4
- package/dist/{index-TZy8JxSW.js → index-BOO2K9Vu.js} +4 -3
- package/dist/{index-DUztXGMj.js → index-Bb3Ugl3c.js} +3 -2
- package/dist/{index-Dh0_kanw.js → index-Bj2qRb0q.js} +2 -1
- package/dist/{index-BZ7bC20P.js → index-BwyHByzZ.js} +2 -1
- package/dist/{index-Do-QyvWW.js → index-CDObWZ7G.js} +3 -2
- package/dist/{index-Bm8wYtHB.js → index-CGU3uK4z.js} +2 -1
- package/dist/{index-BW95iBc7.js → index-CMmaJ4Ss.js} +3 -2
- package/dist/{index-CYSJt1Zc.js → index-CNmwpU3G.js} +7 -3
- package/dist/{index-BMsHMGap.js → index-CS1tP-l0.js} +3 -2
- package/dist/{index-4p1VXlOx.js → index-Cn_bmfoD.js} +2 -1
- package/dist/{index-C-NpFAft.js → index-CzztJ4fH.js} +4 -3
- package/dist/{index-CXnuud67.js → index-D0VBKmKt.js} +3 -2
- package/dist/{index-DiWzNeZJ.js → index-DA7GAWZ1.js} +4 -3
- package/dist/{index-Boy8--Ns.js → index-DKKIL32g.js} +3 -2
- package/dist/{index-DPf5_q0T.js → index-DMVIENZW.js} +4 -3
- package/dist/{index-r9t3crs-.js → index-DU4dWvY6.js} +2 -1
- package/dist/{index-BcHwRIXW.js → index-D_hAd0MQ.js} +4 -3
- package/dist/{index-Ch88zDje.js → index-DuuvFB0e.js} +3 -2
- package/dist/{index-CI6Hl1Ns.js → index-FCg2Jzvu.js} +2 -1
- package/dist/{index-r0yHBje3.js → index-PSQkEXxq.js} +3 -2
- package/dist/{index-CAc9drK5.js → index-R95URjcc.js} +2 -1
- package/dist/{index-gHOlYnAA.js → index-RG23XjoT.js} +2 -1
- package/dist/{index-S8Dj5ycu.js → index-TeozNhWH.js} +3 -2
- package/dist/{index--MetH_r4.js → index-Uy8bXkuC.js} +4 -3
- package/dist/{index-DiPWQwMU.js → index-VrLq9hAc.js} +8987 -3728
- package/dist/{index-DvMu7-8y.js → index-XE84LVO7.js} +2 -1
- package/dist/{index-CmjTSiUa.js → index-dUCz8OdV.js} +3 -2
- package/dist/{index-DgybKcgI.js → index-hDsTasdu.js} +3 -2
- package/dist/{index-H4f-e99t.js → index-ucaRXWE8.js} +3 -2
- package/dist/{index-BWoOPv6-.js → index-vEZ4Yr2u.js} +3 -2
- package/dist/index.es.js +52 -46
- package/dist/{online-form-model-select.vue_vue_type_script_setup_true_name_online-form-model-select_lang-DDJetWQU.js → online-form-model-select.vue_vue_type_script_setup_true_name_online-form-model-select_lang-ApLSXGFP.js} +27 -3
- package/dist/{pagination-design-lckCQWcK.js → pagination-design-B5DxwV5F.js} +3 -2
- package/dist/paper-widget-design-A55mbwYv.js +4 -0
- package/dist/{print-runtime-instance-Dckul2Bk.js → print-runtime-instance-BDM-anCd.js} +1 -1
- package/dist/{print-snapshot-renderer-lub7u9sp.js → print-snapshot-renderer-kB1Bw7A_.js} +3 -3
- package/dist/{qrcode-design-M0HzGVjM.js → qrcode-design-bN48s3rk.js} +1 -1
- package/dist/{revo-grid.entry-Dr4S1tgO.js → revo-grid.entry-BXEGtAbW.js} +1 -1
- package/dist/{revogr-attribution_7.entry-27u9hxgM.js → revogr-attribution_7.entry-CImeTxBl.js} +3 -3
- package/dist/{revogr-clipboard_3.entry-DxjljgJl.js → revogr-clipboard_3.entry-DqcrJ6zB.js} +2 -2
- package/dist/{revogr-data_4.entry-CnSalg4D.js → revogr-data_4.entry-Ccdsy3nO.js} +2 -2
- package/dist/{revogr-filter-panel.entry-CSsekbYc.js → revogr-filter-panel.entry-B2xM2jvB.js} +1 -1
- package/dist/seal-design-B3FBumLr.js +4 -0
- package/dist/{serialnumber-design-DUiLiTSj.js → serialnumber-design-BGTOIn2S.js} +1 -1
- package/dist/shared/index.es.js +29 -28
- package/dist/{single-field-drop-CF_r0dCX.js → single-field-drop-b2b71HAk.js} +2 -3
- package/dist/{size-editor-DNMqRicI.js → size-editor-DtX2f2CF.js} +1 -1
- package/dist/src/adapter/adapter.d.ts +1 -1
- package/dist/src/adapter/index.d.ts +2 -0
- package/dist/src/{nocode-web-render/src/render/sub-table/common → adapter/web}/inventory-scan-columns.d.ts +1 -1
- package/dist/src/{nocode-web-render/src/render/sub-table/material-balance/mb-web-render.d.ts → adapter/web/material-balance-render.d.ts} +1 -1
- package/dist/src/{nocode-web-render/src/render/sub-table/material-balance → adapter/web}/material-consume-modal.vue.d.ts +1 -1
- package/dist/src/adapter/web/material-consume-render.d.ts +25 -0
- package/dist/src/{nocode-web-render/src/render/common → adapter/web}/open-util.d.ts +1 -1
- package/dist/src/{nocode-web-render/src/render/sub-table/stocktake/stocktake-web-render.d.ts → adapter/web/stocktake-render.d.ts} +2 -2
- package/dist/src/{nocode-web-render/src/render/sub-table/common → adapter/web}/sub-table-render.d.ts +2 -5
- package/dist/src/domain/document-business/business/product-release/profile.d.ts +2 -0
- package/dist/src/domain/document-business/business/product-release/service.d.ts +2 -0
- package/dist/src/domain/document-business/index.d.ts +2 -0
- package/dist/src/domain/document-business/registry.d.ts +2 -0
- package/dist/src/domain/document-business/runtime/field-query-runtime.d.ts +4 -0
- package/dist/src/domain/document-business/types.d.ts +24 -0
- package/dist/src/domain/field/number/product-release-qty-manifest.d.ts +2 -0
- package/dist/src/domain/field/query-filter.d.ts +15 -0
- package/dist/src/domain/table/business/material/material-substitution/profile/field-keys.d.ts +37 -1
- package/dist/src/domain/table/business/material/material-substitution/runtime/row-change-handlers.d.ts +7 -0
- package/dist/src/domain/table/business/material/material-substitution/runtime/select-loaders.d.ts +12 -0
- package/dist/src/domain/table/business/sterilize/entrust-steril-batch-list/profile/field-keys.d.ts +2 -0
- package/dist/src/domain/table/business/warehouse/shared/autofill-source-labels.d.ts +19 -0
- package/dist/src/domain/table/design/autofill-expander.d.ts +2 -0
- package/dist/src/domain/table/design/hooks/on-field-attach.d.ts +6 -0
- package/dist/src/domain/table/index.d.ts +1 -1
- package/dist/src/domain/table/types.d.ts +2 -0
- package/dist/src/index.d.ts +8 -0
- package/dist/src/nocode-base/src/components/document-sub-table-action/dynamic-table-action.vue.d.ts +0 -2
- package/dist/src/nocode-base/src/components/document-sub-table-action/sub-table-action.vue.d.ts +0 -3
- package/dist/src/nocode-base/src/components/document-sub-table-action/type.d.ts +0 -4
- package/dist/src/nocode-base/src/components/material-consume/types.d.ts +1 -5
- package/dist/src/nocode-base/src/core/sub-table/profile-driven-sub-table-core.d.ts +4 -4
- package/dist/src/nocode-base/src/core/sub-table/sub-table-core.d.ts +1 -4
- package/dist/src/nocode-base/src/core/sub-table/utils/sterilize/field-keys.d.ts +1 -2
- package/dist/src/nocode-base/src/hooks/formula-params-cache.d.ts +15 -0
- package/dist/src/nocode-base/src/hooks/inspection-module-qty.d.ts +4 -0
- package/dist/src/nocode-base/src/hooks/material-consume/material-consume-table-controller.d.ts +0 -6
- package/dist/src/nocode-base/src/hooks/material-consume/mc-render.d.ts +1 -28
- package/dist/src/nocode-base/src/hooks/render-page/initial-value-data-sources.d.ts +3 -0
- package/dist/src/nocode-base/src/hooks/render-page/initialize-runtime.d.ts +9 -8
- package/dist/src/nocode-base/src/hooks/render-page/runtime-data-sources.d.ts +51 -0
- package/dist/src/nocode-base/src/hooks/render-page/sterilization-date.d.ts +3 -0
- package/dist/src/nocode-base/src/hooks/render-page/types.d.ts +7 -1
- package/dist/src/nocode-base/src/hooks/useCalcFunction.d.ts +8 -2
- package/dist/src/nocode-base/src/hooks/useRenderPageFactory.d.ts +55 -6
- package/dist/src/nocode-base/src/hooks/useRuntimeInstanceServices.d.ts +24 -0
- package/dist/src/nocode-base/src/interface/ref-loader.d.ts +12 -1
- package/dist/src/nocode-base/src/interface/render.d.ts +2 -1
- package/dist/src/nocode-base/src/interface/transform.d.ts +3 -0
- package/dist/src/nocode-base/src/runtime/conversions/v1-runtime.d.ts +1 -1
- package/dist/src/nocode-base/src/runtime/designer-default-values.d.ts +23 -0
- package/dist/src/nocode-base/src/runtime/runtime-default-value-validation.d.ts +23 -0
- package/dist/src/nocode-base/src/runtime/runtime-field-initializer.d.ts +1 -0
- package/dist/src/nocode-base/src/runtime/runtime-field-state.d.ts +5 -2
- package/dist/src/nocode-base/src/runtime/runtime-instance-registry.d.ts +8 -5
- package/dist/src/nocode-base/src/types/common/base.d.ts +8 -2
- package/dist/src/nocode-base/src/types/render/mc-render.d.ts +2 -15
- package/dist/src/nocode-base/src/types/render/sub-table-render.d.ts +0 -10
- package/dist/src/online-form/src/components/device/device-select.vue.d.ts +1 -1
- package/dist/src/online-form/src/views/__cell_widgets__/common/default-value-rdo-editor/base-vxe-table.vue.d.ts +1 -1
- package/dist/src/online-form/src/views/__cell_widgets__/common/default-value-rdo-editor/default-value-rdo-editor.vue.d.ts +4 -4
- package/dist/src/online-form/src/views/__cell_widgets__/common/default-value-rdo-editor/rdo-table-dropdown.vue.d.ts +3 -3
- package/dist/src/online-form/src/views/designer/constants/index.d.ts +1 -0
- package/dist/src/online-form/src/views/designer/hooks/useAllSpreadSheets.d.ts +144 -0
- package/dist/src/online-form/src/views/designer/hooks/useSpreadSheet.d.ts +87 -4
- package/dist/src/online-form/src/views/designer/modules/panel/panel-rule-config/message-rule-config/rule-modal.vue.d.ts +32 -0
- package/dist/src/{nocode-web-render/src/render/parse-rule → online-form/src/views/designer/modules/panel/sub-table/comps}/add-rule-btn.vue.d.ts +1 -1
- package/dist/src/online-form/src/views/designer/modules/panel/sub-table/comps/use-dynamic-sub-table-panel.d.ts +6 -0
- package/dist/src/online-form/src/views/designer/modules/panel/sub-table/panel-check-table/select-check-ds-modal.vue.d.ts +3 -3
- package/dist/src/online-form/src/views/designer/types/index.d.ts +12 -1
- package/dist/src/online-form/src/views/designer/utils/placed-fields.d.ts +9 -0
- package/dist/src/online-form/src/views/designer/utils/template-placed-fields.d.ts +7 -0
- package/dist/src/online-form/src/views/render/__components__/_field_/_base_/cell/cell-auto-complete.vue.d.ts +2 -2
- package/dist/src/online-form/src/views/render/__components__/_field_/_base_/cell/cell-date-picker.vue.d.ts +2 -2
- package/dist/src/online-form/src/views/render/__components__/_field_/_base_/cell/cell-media.vue.d.ts +1 -1
- package/dist/src/online-form/src/views/render/__components__/_field_/_base_/cell/cell-text-input.vue.d.ts +2 -2
- package/dist/src/online-form/src/views/render/__components__/_field_/_base_/cell/cell-textarea.vue.d.ts +2 -2
- package/dist/src/online-form/src/views/render/__components__/_field_/seal/component/seal-floating-field.vue.d.ts +0 -1
- package/dist/src/online-form/src/views/render/__components__/_field_/seal/component/seal-runtime-layer.vue.d.ts +0 -1
- package/dist/src/online-form/src/views/render/__components__/_field_/seal/component/use-seal-stamp.d.ts +1 -4
- package/dist/src/online-form/src/views/render/__components__/_field_/seal/index.d.ts +1 -0
- package/dist/src/online-form/src/views/render/__components__/_field_/trace/common/base-vxe-table.vue.d.ts +1 -1
- package/dist/src/shared/components/ColorPicker/src/ColorPicker.vue.d.ts +1 -1
- package/dist/src/shared/components/DoubleInput/double-input.vue.d.ts +162 -2
- package/dist/src/shared/components/LimitedNumberInput/limited-number-input.vue.d.ts +41 -0
- package/dist/src/shared/components/LimitedNumberInput/number-input-rules.d.ts +16 -0
- package/dist/src/shared/components/Signature/logic/index.d.ts +14 -0
- package/dist/src/shared/enum/field-type.d.ts +8 -3
- package/dist/src/{nocode-web-render/src → shared}/hooks/useWebUpload.d.ts +1 -1
- package/dist/src/shared/index.d.ts +1 -0
- package/dist/src/shared/types/index.d.ts +1 -0
- package/dist/src/shared/types/upload.d.ts +11 -0
- package/dist/src/shared/utils/withRequestCache.d.ts +27 -0
- package/dist/{sub-table-factory-D-GcNTOB.js → sub-table-factory-DoEvzrVN.js} +276 -89
- package/dist/{text-design-BfZf4B27.js → text-design-BQVBFcI0.js} +3 -2
- package/dist/{throttle-Cpk1LoGk-B4SDzSMU.js → throttle-Cpk1LoGk-DR_8z9qq.js} +1 -1
- package/dist/{timediff-design-BeO94tLR.js → timediff-design-DioTJEvx.js} +2 -1
- package/dist/{trace-like-wrapper-Xc4cr21n.js → trace-like-wrapper-CjxBkfYK.js} +3 -2
- package/dist/{value-editor.vue_vue_type_style_index_0_lang-CMpVHBLK.js → value-editor.vue_vue_type_style_index_0_lang-DpfdcyX_.js} +3 -2
- package/dist/{widget-barcode-CrfBj8iv.js → widget-barcode-CEn3AYG0.js} +5 -4
- package/dist/{widget-diagonal-C3Nho_Um.js → widget-diagonal-DbOhaNpW.js} +4 -4
- package/dist/{widget-image-CjsL9QW8.js → widget-image-BGP2w2mj.js} +5 -7
- package/dist/{widget-line-BtvpVv_s.js → widget-line-CkSPcw5A.js} +3 -2
- package/dist/{widget-pagination-DAUQo2nI.js → widget-pagination-BH0VtWHT.js} +6 -5
- package/dist/{widget-power-yUHZ4Hoc.js → widget-power-DuTIvdpR.js} +4 -4
- package/dist/{widget-qrcode-DJtT9NaM.js → widget-qrcode-CJJjPnwn.js} +4 -3
- package/dist/{widget-rangelimit-BhadVdCu.js → widget-rangelimit-828JH1wm.js} +3 -4
- package/dist/{widget-serialnumber-WMHB8nl6.js → widget-serialnumber-CIjY3I-t.js} +1 -1
- package/dist/{widget-text-C4dD9JF3.js → widget-text-C_Ja4yWN.js} +5 -5
- package/dist/{widget-timediff-C9d8_3hY.js → widget-timediff-CjmATkLS.js} +3 -2
- package/package.json +2 -6
- package/dist/AntdIcon-DCIaV352.js +0 -1108
- package/dist/index-_Ec5LAW9.js +0 -4353
- package/dist/mb-render-sgVmAe6_.js +0 -276
- package/dist/paper-widget-design-Nd5VjI7n.js +0 -4
- package/dist/seal-design-kuAsmNq1.js +0 -4
- package/dist/src/nocode-web-render/src/components/print-fill-background-selector.vue.d.ts +0 -2
- package/dist/src/nocode-web-render/src/hooks/index.d.ts +0 -2
- package/dist/src/nocode-web-render/src/hooks/userFormPrint.d.ts +0 -15
- package/dist/src/nocode-web-render/src/index.d.ts +0 -6
- package/dist/src/nocode-web-render/src/logic/index.d.ts +0 -1
- package/dist/src/nocode-web-render/src/render/common/index.d.ts +0 -2
- package/dist/src/nocode-web-render/src/render/common/modal-manager.d.ts +0 -20
- package/dist/src/nocode-web-render/src/render/index.d.ts +0 -10
- package/dist/src/nocode-web-render/src/render/parse-rule/index.d.ts +0 -3
- package/dist/src/nocode-web-render/src/render/parse-rule/parse-rule-modal.vue.d.ts +0 -15
- package/dist/src/nocode-web-render/src/render/sub-table/allocate/allocate-web-render.d.ts +0 -4
- package/dist/src/nocode-web-render/src/render/sub-table/allocate/index.d.ts +0 -1
- package/dist/src/nocode-web-render/src/render/sub-table/common/multi-rows-modal.vue.d.ts +0 -15
- package/dist/src/nocode-web-render/src/render/sub-table/common/scan-modal.vue.d.ts +0 -19
- package/dist/src/nocode-web-render/src/render/sub-table/index.d.ts +0 -3
- package/dist/src/nocode-web-render/src/render/sub-table/material-balance/index.d.ts +0 -1
- package/dist/src/nocode-web-render/src/render/sub-table/material-consume/bom-modal.vue.d.ts +0 -11
- package/dist/src/nocode-web-render/src/render/sub-table/material-consume/index.d.ts +0 -4
- package/dist/src/nocode-web-render/src/render/sub-table/material-consume/mc-web-render.d.ts +0 -42
- package/dist/src/nocode-web-render/src/render/sub-table/stocktake/index.d.ts +0 -2
- package/dist/src/nocode-web-render/src/types/hooks/index.d.ts +0 -1
- package/dist/src/nocode-web-render/src/types/index.d.ts +0 -1
- package/dist/web-render/index.d.ts +0 -1
- package/dist/web-render/index.es.js +0 -595
- /package/dist/src/{nocode-web-render/src/adapter/index.d.ts → adapter/web/setup.d.ts} +0 -0
- /package/dist/src/{nocode-web-render/src/logic/utils.d.ts → adapter/web/upload.d.ts} +0 -0
|
@@ -1,1108 +0,0 @@
|
|
|
1
|
-
import { nextTick, h, createVNode } from "vue";
|
|
2
|
-
const defaultNamespace = "gct";
|
|
3
|
-
const statePrefix = "is-";
|
|
4
|
-
function _bem(namespace, block, blockSuffix, element, modifier) {
|
|
5
|
-
let cls = `${namespace}-${block}`;
|
|
6
|
-
if (blockSuffix) {
|
|
7
|
-
cls += `-${blockSuffix}`;
|
|
8
|
-
}
|
|
9
|
-
if (element) {
|
|
10
|
-
cls += `__${element}`;
|
|
11
|
-
}
|
|
12
|
-
if (modifier) {
|
|
13
|
-
cls += `--${modifier}`;
|
|
14
|
-
}
|
|
15
|
-
return cls;
|
|
16
|
-
}
|
|
17
|
-
class Namespace {
|
|
18
|
-
constructor(block, namespace) {
|
|
19
|
-
this.block = block;
|
|
20
|
-
this.namespace = namespace || defaultNamespace;
|
|
21
|
-
}
|
|
22
|
-
block;
|
|
23
|
-
namespace;
|
|
24
|
-
b(blockSuffix = "") {
|
|
25
|
-
return _bem(this.namespace, this.block, blockSuffix, "", "");
|
|
26
|
-
}
|
|
27
|
-
e(element) {
|
|
28
|
-
return element ? _bem(this.namespace, this.block, "", element, "") : "";
|
|
29
|
-
}
|
|
30
|
-
m(modifier) {
|
|
31
|
-
return modifier ? _bem(this.namespace, this.block, "", "", modifier) : "";
|
|
32
|
-
}
|
|
33
|
-
be(blockSuffix, element) {
|
|
34
|
-
return blockSuffix && element ? _bem(this.namespace, this.block, blockSuffix, element, "") : "";
|
|
35
|
-
}
|
|
36
|
-
em(element, modifier) {
|
|
37
|
-
return element && modifier ? _bem(this.namespace, this.block, "", element, modifier) : "";
|
|
38
|
-
}
|
|
39
|
-
bm(blockSuffix, modifier) {
|
|
40
|
-
return blockSuffix && modifier ? _bem(this.namespace, this.block, blockSuffix, "", modifier) : "";
|
|
41
|
-
}
|
|
42
|
-
bem(blockSuffix, element, modifier) {
|
|
43
|
-
return blockSuffix && element && modifier ? _bem(this.namespace, this.block, blockSuffix, element, modifier) : "";
|
|
44
|
-
}
|
|
45
|
-
is(name, state) {
|
|
46
|
-
return name && state ? `${statePrefix}${name}` : "";
|
|
47
|
-
}
|
|
48
|
-
cssVar(object) {
|
|
49
|
-
const styles = {};
|
|
50
|
-
for (const key in object) {
|
|
51
|
-
if (object[key]) {
|
|
52
|
-
styles[this.cssVarName(key)] = object[key];
|
|
53
|
-
}
|
|
54
|
-
}
|
|
55
|
-
return styles;
|
|
56
|
-
}
|
|
57
|
-
cssVarBlock(object) {
|
|
58
|
-
const styles = {};
|
|
59
|
-
for (const key in object) {
|
|
60
|
-
if (object[key]) {
|
|
61
|
-
styles[this.cssVarBlockName(key)] = object[key];
|
|
62
|
-
}
|
|
63
|
-
}
|
|
64
|
-
return styles;
|
|
65
|
-
}
|
|
66
|
-
cssVarName(name) {
|
|
67
|
-
return `--${this.namespace}-${name}`;
|
|
68
|
-
}
|
|
69
|
-
cssVarBlockName(name) {
|
|
70
|
-
return `--${this.namespace}-${this.block}-${name}`;
|
|
71
|
-
}
|
|
72
|
-
}
|
|
73
|
-
function useNamespace(block) {
|
|
74
|
-
return new Namespace(block, "gct");
|
|
75
|
-
}
|
|
76
|
-
function bound01(n, max) {
|
|
77
|
-
if (isOnePointZero(n)) {
|
|
78
|
-
n = "100%";
|
|
79
|
-
}
|
|
80
|
-
var isPercent = isPercentage(n);
|
|
81
|
-
n = max === 360 ? n : Math.min(max, Math.max(0, parseFloat(n)));
|
|
82
|
-
if (isPercent) {
|
|
83
|
-
n = parseInt(String(n * max), 10) / 100;
|
|
84
|
-
}
|
|
85
|
-
if (Math.abs(n - max) < 1e-6) {
|
|
86
|
-
return 1;
|
|
87
|
-
}
|
|
88
|
-
if (max === 360) {
|
|
89
|
-
n = (n < 0 ? n % max + max : n % max) / parseFloat(String(max));
|
|
90
|
-
} else {
|
|
91
|
-
n = n % max / parseFloat(String(max));
|
|
92
|
-
}
|
|
93
|
-
return n;
|
|
94
|
-
}
|
|
95
|
-
function isOnePointZero(n) {
|
|
96
|
-
return typeof n === "string" && n.indexOf(".") !== -1 && parseFloat(n) === 1;
|
|
97
|
-
}
|
|
98
|
-
function isPercentage(n) {
|
|
99
|
-
return typeof n === "string" && n.indexOf("%") !== -1;
|
|
100
|
-
}
|
|
101
|
-
function boundAlpha(a) {
|
|
102
|
-
a = parseFloat(a);
|
|
103
|
-
if (isNaN(a) || a < 0 || a > 1) {
|
|
104
|
-
a = 1;
|
|
105
|
-
}
|
|
106
|
-
return a;
|
|
107
|
-
}
|
|
108
|
-
function convertToPercentage(n) {
|
|
109
|
-
if (n <= 1) {
|
|
110
|
-
return "".concat(Number(n) * 100, "%");
|
|
111
|
-
}
|
|
112
|
-
return n;
|
|
113
|
-
}
|
|
114
|
-
function pad2(c) {
|
|
115
|
-
return c.length === 1 ? "0" + c : String(c);
|
|
116
|
-
}
|
|
117
|
-
function rgbToRgb(r, g, b) {
|
|
118
|
-
return {
|
|
119
|
-
r: bound01(r, 255) * 255,
|
|
120
|
-
g: bound01(g, 255) * 255,
|
|
121
|
-
b: bound01(b, 255) * 255
|
|
122
|
-
};
|
|
123
|
-
}
|
|
124
|
-
function hue2rgb(p, q, t) {
|
|
125
|
-
if (t < 0) {
|
|
126
|
-
t += 1;
|
|
127
|
-
}
|
|
128
|
-
if (t > 1) {
|
|
129
|
-
t -= 1;
|
|
130
|
-
}
|
|
131
|
-
if (t < 1 / 6) {
|
|
132
|
-
return p + (q - p) * (6 * t);
|
|
133
|
-
}
|
|
134
|
-
if (t < 1 / 2) {
|
|
135
|
-
return q;
|
|
136
|
-
}
|
|
137
|
-
if (t < 2 / 3) {
|
|
138
|
-
return p + (q - p) * (2 / 3 - t) * 6;
|
|
139
|
-
}
|
|
140
|
-
return p;
|
|
141
|
-
}
|
|
142
|
-
function hslToRgb(h2, s, l) {
|
|
143
|
-
var r;
|
|
144
|
-
var g;
|
|
145
|
-
var b;
|
|
146
|
-
h2 = bound01(h2, 360);
|
|
147
|
-
s = bound01(s, 100);
|
|
148
|
-
l = bound01(l, 100);
|
|
149
|
-
if (s === 0) {
|
|
150
|
-
g = l;
|
|
151
|
-
b = l;
|
|
152
|
-
r = l;
|
|
153
|
-
} else {
|
|
154
|
-
var q = l < 0.5 ? l * (1 + s) : l + s - l * s;
|
|
155
|
-
var p = 2 * l - q;
|
|
156
|
-
r = hue2rgb(p, q, h2 + 1 / 3);
|
|
157
|
-
g = hue2rgb(p, q, h2);
|
|
158
|
-
b = hue2rgb(p, q, h2 - 1 / 3);
|
|
159
|
-
}
|
|
160
|
-
return { r: r * 255, g: g * 255, b: b * 255 };
|
|
161
|
-
}
|
|
162
|
-
function rgbToHsv(r, g, b) {
|
|
163
|
-
r = bound01(r, 255);
|
|
164
|
-
g = bound01(g, 255);
|
|
165
|
-
b = bound01(b, 255);
|
|
166
|
-
var max = Math.max(r, g, b);
|
|
167
|
-
var min = Math.min(r, g, b);
|
|
168
|
-
var h2 = 0;
|
|
169
|
-
var v = max;
|
|
170
|
-
var d = max - min;
|
|
171
|
-
var s = max === 0 ? 0 : d / max;
|
|
172
|
-
if (max === min) {
|
|
173
|
-
h2 = 0;
|
|
174
|
-
} else {
|
|
175
|
-
switch (max) {
|
|
176
|
-
case r:
|
|
177
|
-
h2 = (g - b) / d + (g < b ? 6 : 0);
|
|
178
|
-
break;
|
|
179
|
-
case g:
|
|
180
|
-
h2 = (b - r) / d + 2;
|
|
181
|
-
break;
|
|
182
|
-
case b:
|
|
183
|
-
h2 = (r - g) / d + 4;
|
|
184
|
-
break;
|
|
185
|
-
}
|
|
186
|
-
h2 /= 6;
|
|
187
|
-
}
|
|
188
|
-
return { h: h2, s, v };
|
|
189
|
-
}
|
|
190
|
-
function hsvToRgb(h2, s, v) {
|
|
191
|
-
h2 = bound01(h2, 360) * 6;
|
|
192
|
-
s = bound01(s, 100);
|
|
193
|
-
v = bound01(v, 100);
|
|
194
|
-
var i = Math.floor(h2);
|
|
195
|
-
var f = h2 - i;
|
|
196
|
-
var p = v * (1 - s);
|
|
197
|
-
var q = v * (1 - f * s);
|
|
198
|
-
var t = v * (1 - (1 - f) * s);
|
|
199
|
-
var mod = i % 6;
|
|
200
|
-
var r = [v, q, p, p, t, v][mod];
|
|
201
|
-
var g = [t, v, v, q, p, p][mod];
|
|
202
|
-
var b = [p, p, t, v, v, q][mod];
|
|
203
|
-
return { r: r * 255, g: g * 255, b: b * 255 };
|
|
204
|
-
}
|
|
205
|
-
function rgbToHex(r, g, b, allow3Char) {
|
|
206
|
-
var hex = [
|
|
207
|
-
pad2(Math.round(r).toString(16)),
|
|
208
|
-
pad2(Math.round(g).toString(16)),
|
|
209
|
-
pad2(Math.round(b).toString(16))
|
|
210
|
-
];
|
|
211
|
-
return hex.join("");
|
|
212
|
-
}
|
|
213
|
-
function convertHexToDecimal(h2) {
|
|
214
|
-
return parseIntFromHex(h2) / 255;
|
|
215
|
-
}
|
|
216
|
-
function parseIntFromHex(val) {
|
|
217
|
-
return parseInt(val, 16);
|
|
218
|
-
}
|
|
219
|
-
var names = {
|
|
220
|
-
aliceblue: "#f0f8ff",
|
|
221
|
-
antiquewhite: "#faebd7",
|
|
222
|
-
aqua: "#00ffff",
|
|
223
|
-
aquamarine: "#7fffd4",
|
|
224
|
-
azure: "#f0ffff",
|
|
225
|
-
beige: "#f5f5dc",
|
|
226
|
-
bisque: "#ffe4c4",
|
|
227
|
-
black: "#000000",
|
|
228
|
-
blanchedalmond: "#ffebcd",
|
|
229
|
-
blue: "#0000ff",
|
|
230
|
-
blueviolet: "#8a2be2",
|
|
231
|
-
brown: "#a52a2a",
|
|
232
|
-
burlywood: "#deb887",
|
|
233
|
-
cadetblue: "#5f9ea0",
|
|
234
|
-
chartreuse: "#7fff00",
|
|
235
|
-
chocolate: "#d2691e",
|
|
236
|
-
coral: "#ff7f50",
|
|
237
|
-
cornflowerblue: "#6495ed",
|
|
238
|
-
cornsilk: "#fff8dc",
|
|
239
|
-
crimson: "#dc143c",
|
|
240
|
-
cyan: "#00ffff",
|
|
241
|
-
darkblue: "#00008b",
|
|
242
|
-
darkcyan: "#008b8b",
|
|
243
|
-
darkgoldenrod: "#b8860b",
|
|
244
|
-
darkgray: "#a9a9a9",
|
|
245
|
-
darkgreen: "#006400",
|
|
246
|
-
darkgrey: "#a9a9a9",
|
|
247
|
-
darkkhaki: "#bdb76b",
|
|
248
|
-
darkmagenta: "#8b008b",
|
|
249
|
-
darkolivegreen: "#556b2f",
|
|
250
|
-
darkorange: "#ff8c00",
|
|
251
|
-
darkorchid: "#9932cc",
|
|
252
|
-
darkred: "#8b0000",
|
|
253
|
-
darksalmon: "#e9967a",
|
|
254
|
-
darkseagreen: "#8fbc8f",
|
|
255
|
-
darkslateblue: "#483d8b",
|
|
256
|
-
darkslategray: "#2f4f4f",
|
|
257
|
-
darkslategrey: "#2f4f4f",
|
|
258
|
-
darkturquoise: "#00ced1",
|
|
259
|
-
darkviolet: "#9400d3",
|
|
260
|
-
deeppink: "#ff1493",
|
|
261
|
-
deepskyblue: "#00bfff",
|
|
262
|
-
dimgray: "#696969",
|
|
263
|
-
dimgrey: "#696969",
|
|
264
|
-
dodgerblue: "#1e90ff",
|
|
265
|
-
firebrick: "#b22222",
|
|
266
|
-
floralwhite: "#fffaf0",
|
|
267
|
-
forestgreen: "#228b22",
|
|
268
|
-
fuchsia: "#ff00ff",
|
|
269
|
-
gainsboro: "#dcdcdc",
|
|
270
|
-
ghostwhite: "#f8f8ff",
|
|
271
|
-
goldenrod: "#daa520",
|
|
272
|
-
gold: "#ffd700",
|
|
273
|
-
gray: "#808080",
|
|
274
|
-
green: "#008000",
|
|
275
|
-
greenyellow: "#adff2f",
|
|
276
|
-
grey: "#808080",
|
|
277
|
-
honeydew: "#f0fff0",
|
|
278
|
-
hotpink: "#ff69b4",
|
|
279
|
-
indianred: "#cd5c5c",
|
|
280
|
-
indigo: "#4b0082",
|
|
281
|
-
ivory: "#fffff0",
|
|
282
|
-
khaki: "#f0e68c",
|
|
283
|
-
lavenderblush: "#fff0f5",
|
|
284
|
-
lavender: "#e6e6fa",
|
|
285
|
-
lawngreen: "#7cfc00",
|
|
286
|
-
lemonchiffon: "#fffacd",
|
|
287
|
-
lightblue: "#add8e6",
|
|
288
|
-
lightcoral: "#f08080",
|
|
289
|
-
lightcyan: "#e0ffff",
|
|
290
|
-
lightgoldenrodyellow: "#fafad2",
|
|
291
|
-
lightgray: "#d3d3d3",
|
|
292
|
-
lightgreen: "#90ee90",
|
|
293
|
-
lightgrey: "#d3d3d3",
|
|
294
|
-
lightpink: "#ffb6c1",
|
|
295
|
-
lightsalmon: "#ffa07a",
|
|
296
|
-
lightseagreen: "#20b2aa",
|
|
297
|
-
lightskyblue: "#87cefa",
|
|
298
|
-
lightslategray: "#778899",
|
|
299
|
-
lightslategrey: "#778899",
|
|
300
|
-
lightsteelblue: "#b0c4de",
|
|
301
|
-
lightyellow: "#ffffe0",
|
|
302
|
-
lime: "#00ff00",
|
|
303
|
-
limegreen: "#32cd32",
|
|
304
|
-
linen: "#faf0e6",
|
|
305
|
-
magenta: "#ff00ff",
|
|
306
|
-
maroon: "#800000",
|
|
307
|
-
mediumaquamarine: "#66cdaa",
|
|
308
|
-
mediumblue: "#0000cd",
|
|
309
|
-
mediumorchid: "#ba55d3",
|
|
310
|
-
mediumpurple: "#9370db",
|
|
311
|
-
mediumseagreen: "#3cb371",
|
|
312
|
-
mediumslateblue: "#7b68ee",
|
|
313
|
-
mediumspringgreen: "#00fa9a",
|
|
314
|
-
mediumturquoise: "#48d1cc",
|
|
315
|
-
mediumvioletred: "#c71585",
|
|
316
|
-
midnightblue: "#191970",
|
|
317
|
-
mintcream: "#f5fffa",
|
|
318
|
-
mistyrose: "#ffe4e1",
|
|
319
|
-
moccasin: "#ffe4b5",
|
|
320
|
-
navajowhite: "#ffdead",
|
|
321
|
-
navy: "#000080",
|
|
322
|
-
oldlace: "#fdf5e6",
|
|
323
|
-
olive: "#808000",
|
|
324
|
-
olivedrab: "#6b8e23",
|
|
325
|
-
orange: "#ffa500",
|
|
326
|
-
orangered: "#ff4500",
|
|
327
|
-
orchid: "#da70d6",
|
|
328
|
-
palegoldenrod: "#eee8aa",
|
|
329
|
-
palegreen: "#98fb98",
|
|
330
|
-
paleturquoise: "#afeeee",
|
|
331
|
-
palevioletred: "#db7093",
|
|
332
|
-
papayawhip: "#ffefd5",
|
|
333
|
-
peachpuff: "#ffdab9",
|
|
334
|
-
peru: "#cd853f",
|
|
335
|
-
pink: "#ffc0cb",
|
|
336
|
-
plum: "#dda0dd",
|
|
337
|
-
powderblue: "#b0e0e6",
|
|
338
|
-
purple: "#800080",
|
|
339
|
-
rebeccapurple: "#663399",
|
|
340
|
-
red: "#ff0000",
|
|
341
|
-
rosybrown: "#bc8f8f",
|
|
342
|
-
royalblue: "#4169e1",
|
|
343
|
-
saddlebrown: "#8b4513",
|
|
344
|
-
salmon: "#fa8072",
|
|
345
|
-
sandybrown: "#f4a460",
|
|
346
|
-
seagreen: "#2e8b57",
|
|
347
|
-
seashell: "#fff5ee",
|
|
348
|
-
sienna: "#a0522d",
|
|
349
|
-
silver: "#c0c0c0",
|
|
350
|
-
skyblue: "#87ceeb",
|
|
351
|
-
slateblue: "#6a5acd",
|
|
352
|
-
slategray: "#708090",
|
|
353
|
-
slategrey: "#708090",
|
|
354
|
-
snow: "#fffafa",
|
|
355
|
-
springgreen: "#00ff7f",
|
|
356
|
-
steelblue: "#4682b4",
|
|
357
|
-
tan: "#d2b48c",
|
|
358
|
-
teal: "#008080",
|
|
359
|
-
thistle: "#d8bfd8",
|
|
360
|
-
tomato: "#ff6347",
|
|
361
|
-
turquoise: "#40e0d0",
|
|
362
|
-
violet: "#ee82ee",
|
|
363
|
-
wheat: "#f5deb3",
|
|
364
|
-
white: "#ffffff",
|
|
365
|
-
whitesmoke: "#f5f5f5",
|
|
366
|
-
yellow: "#ffff00",
|
|
367
|
-
yellowgreen: "#9acd32"
|
|
368
|
-
};
|
|
369
|
-
function inputToRGB(color) {
|
|
370
|
-
var rgb = { r: 0, g: 0, b: 0 };
|
|
371
|
-
var a = 1;
|
|
372
|
-
var s = null;
|
|
373
|
-
var v = null;
|
|
374
|
-
var l = null;
|
|
375
|
-
var ok = false;
|
|
376
|
-
var format = false;
|
|
377
|
-
if (typeof color === "string") {
|
|
378
|
-
color = stringInputToObject(color);
|
|
379
|
-
}
|
|
380
|
-
if (typeof color === "object") {
|
|
381
|
-
if (isValidCSSUnit(color.r) && isValidCSSUnit(color.g) && isValidCSSUnit(color.b)) {
|
|
382
|
-
rgb = rgbToRgb(color.r, color.g, color.b);
|
|
383
|
-
ok = true;
|
|
384
|
-
format = String(color.r).substr(-1) === "%" ? "prgb" : "rgb";
|
|
385
|
-
} else if (isValidCSSUnit(color.h) && isValidCSSUnit(color.s) && isValidCSSUnit(color.v)) {
|
|
386
|
-
s = convertToPercentage(color.s);
|
|
387
|
-
v = convertToPercentage(color.v);
|
|
388
|
-
rgb = hsvToRgb(color.h, s, v);
|
|
389
|
-
ok = true;
|
|
390
|
-
format = "hsv";
|
|
391
|
-
} else if (isValidCSSUnit(color.h) && isValidCSSUnit(color.s) && isValidCSSUnit(color.l)) {
|
|
392
|
-
s = convertToPercentage(color.s);
|
|
393
|
-
l = convertToPercentage(color.l);
|
|
394
|
-
rgb = hslToRgb(color.h, s, l);
|
|
395
|
-
ok = true;
|
|
396
|
-
format = "hsl";
|
|
397
|
-
}
|
|
398
|
-
if (Object.prototype.hasOwnProperty.call(color, "a")) {
|
|
399
|
-
a = color.a;
|
|
400
|
-
}
|
|
401
|
-
}
|
|
402
|
-
a = boundAlpha(a);
|
|
403
|
-
return {
|
|
404
|
-
ok,
|
|
405
|
-
format: color.format || format,
|
|
406
|
-
r: Math.min(255, Math.max(rgb.r, 0)),
|
|
407
|
-
g: Math.min(255, Math.max(rgb.g, 0)),
|
|
408
|
-
b: Math.min(255, Math.max(rgb.b, 0)),
|
|
409
|
-
a
|
|
410
|
-
};
|
|
411
|
-
}
|
|
412
|
-
var CSS_INTEGER = "[-\\+]?\\d+%?";
|
|
413
|
-
var CSS_NUMBER = "[-\\+]?\\d*\\.\\d+%?";
|
|
414
|
-
var CSS_UNIT = "(?:".concat(CSS_NUMBER, ")|(?:").concat(CSS_INTEGER, ")");
|
|
415
|
-
var PERMISSIVE_MATCH3 = "[\\s|\\(]+(".concat(CSS_UNIT, ")[,|\\s]+(").concat(CSS_UNIT, ")[,|\\s]+(").concat(CSS_UNIT, ")\\s*\\)?");
|
|
416
|
-
var PERMISSIVE_MATCH4 = "[\\s|\\(]+(".concat(CSS_UNIT, ")[,|\\s]+(").concat(CSS_UNIT, ")[,|\\s]+(").concat(CSS_UNIT, ")[,|\\s]+(").concat(CSS_UNIT, ")\\s*\\)?");
|
|
417
|
-
var matchers = {
|
|
418
|
-
CSS_UNIT: new RegExp(CSS_UNIT),
|
|
419
|
-
rgb: new RegExp("rgb" + PERMISSIVE_MATCH3),
|
|
420
|
-
rgba: new RegExp("rgba" + PERMISSIVE_MATCH4),
|
|
421
|
-
hsl: new RegExp("hsl" + PERMISSIVE_MATCH3),
|
|
422
|
-
hsla: new RegExp("hsla" + PERMISSIVE_MATCH4),
|
|
423
|
-
hsv: new RegExp("hsv" + PERMISSIVE_MATCH3),
|
|
424
|
-
hsva: new RegExp("hsva" + PERMISSIVE_MATCH4),
|
|
425
|
-
hex3: /^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,
|
|
426
|
-
hex6: /^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/,
|
|
427
|
-
hex4: /^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,
|
|
428
|
-
hex8: /^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/
|
|
429
|
-
};
|
|
430
|
-
function stringInputToObject(color) {
|
|
431
|
-
color = color.trim().toLowerCase();
|
|
432
|
-
if (color.length === 0) {
|
|
433
|
-
return false;
|
|
434
|
-
}
|
|
435
|
-
var named = false;
|
|
436
|
-
if (names[color]) {
|
|
437
|
-
color = names[color];
|
|
438
|
-
named = true;
|
|
439
|
-
} else if (color === "transparent") {
|
|
440
|
-
return { r: 0, g: 0, b: 0, a: 0, format: "name" };
|
|
441
|
-
}
|
|
442
|
-
var match = matchers.rgb.exec(color);
|
|
443
|
-
if (match) {
|
|
444
|
-
return { r: match[1], g: match[2], b: match[3] };
|
|
445
|
-
}
|
|
446
|
-
match = matchers.rgba.exec(color);
|
|
447
|
-
if (match) {
|
|
448
|
-
return { r: match[1], g: match[2], b: match[3], a: match[4] };
|
|
449
|
-
}
|
|
450
|
-
match = matchers.hsl.exec(color);
|
|
451
|
-
if (match) {
|
|
452
|
-
return { h: match[1], s: match[2], l: match[3] };
|
|
453
|
-
}
|
|
454
|
-
match = matchers.hsla.exec(color);
|
|
455
|
-
if (match) {
|
|
456
|
-
return { h: match[1], s: match[2], l: match[3], a: match[4] };
|
|
457
|
-
}
|
|
458
|
-
match = matchers.hsv.exec(color);
|
|
459
|
-
if (match) {
|
|
460
|
-
return { h: match[1], s: match[2], v: match[3] };
|
|
461
|
-
}
|
|
462
|
-
match = matchers.hsva.exec(color);
|
|
463
|
-
if (match) {
|
|
464
|
-
return { h: match[1], s: match[2], v: match[3], a: match[4] };
|
|
465
|
-
}
|
|
466
|
-
match = matchers.hex8.exec(color);
|
|
467
|
-
if (match) {
|
|
468
|
-
return {
|
|
469
|
-
r: parseIntFromHex(match[1]),
|
|
470
|
-
g: parseIntFromHex(match[2]),
|
|
471
|
-
b: parseIntFromHex(match[3]),
|
|
472
|
-
a: convertHexToDecimal(match[4]),
|
|
473
|
-
format: named ? "name" : "hex8"
|
|
474
|
-
};
|
|
475
|
-
}
|
|
476
|
-
match = matchers.hex6.exec(color);
|
|
477
|
-
if (match) {
|
|
478
|
-
return {
|
|
479
|
-
r: parseIntFromHex(match[1]),
|
|
480
|
-
g: parseIntFromHex(match[2]),
|
|
481
|
-
b: parseIntFromHex(match[3]),
|
|
482
|
-
format: named ? "name" : "hex"
|
|
483
|
-
};
|
|
484
|
-
}
|
|
485
|
-
match = matchers.hex4.exec(color);
|
|
486
|
-
if (match) {
|
|
487
|
-
return {
|
|
488
|
-
r: parseIntFromHex(match[1] + match[1]),
|
|
489
|
-
g: parseIntFromHex(match[2] + match[2]),
|
|
490
|
-
b: parseIntFromHex(match[3] + match[3]),
|
|
491
|
-
a: convertHexToDecimal(match[4] + match[4]),
|
|
492
|
-
format: named ? "name" : "hex8"
|
|
493
|
-
};
|
|
494
|
-
}
|
|
495
|
-
match = matchers.hex3.exec(color);
|
|
496
|
-
if (match) {
|
|
497
|
-
return {
|
|
498
|
-
r: parseIntFromHex(match[1] + match[1]),
|
|
499
|
-
g: parseIntFromHex(match[2] + match[2]),
|
|
500
|
-
b: parseIntFromHex(match[3] + match[3]),
|
|
501
|
-
format: named ? "name" : "hex"
|
|
502
|
-
};
|
|
503
|
-
}
|
|
504
|
-
return false;
|
|
505
|
-
}
|
|
506
|
-
function isValidCSSUnit(color) {
|
|
507
|
-
return Boolean(matchers.CSS_UNIT.exec(String(color)));
|
|
508
|
-
}
|
|
509
|
-
var hueStep = 2;
|
|
510
|
-
var saturationStep = 0.16;
|
|
511
|
-
var saturationStep2 = 0.05;
|
|
512
|
-
var brightnessStep1 = 0.05;
|
|
513
|
-
var brightnessStep2 = 0.15;
|
|
514
|
-
var lightColorCount = 5;
|
|
515
|
-
var darkColorCount = 4;
|
|
516
|
-
var darkColorMap = [{
|
|
517
|
-
index: 7,
|
|
518
|
-
opacity: 0.15
|
|
519
|
-
}, {
|
|
520
|
-
index: 6,
|
|
521
|
-
opacity: 0.25
|
|
522
|
-
}, {
|
|
523
|
-
index: 5,
|
|
524
|
-
opacity: 0.3
|
|
525
|
-
}, {
|
|
526
|
-
index: 5,
|
|
527
|
-
opacity: 0.45
|
|
528
|
-
}, {
|
|
529
|
-
index: 5,
|
|
530
|
-
opacity: 0.65
|
|
531
|
-
}, {
|
|
532
|
-
index: 5,
|
|
533
|
-
opacity: 0.85
|
|
534
|
-
}, {
|
|
535
|
-
index: 4,
|
|
536
|
-
opacity: 0.9
|
|
537
|
-
}, {
|
|
538
|
-
index: 3,
|
|
539
|
-
opacity: 0.95
|
|
540
|
-
}, {
|
|
541
|
-
index: 2,
|
|
542
|
-
opacity: 0.97
|
|
543
|
-
}, {
|
|
544
|
-
index: 1,
|
|
545
|
-
opacity: 0.98
|
|
546
|
-
}];
|
|
547
|
-
function toHsv(_ref) {
|
|
548
|
-
var r = _ref.r, g = _ref.g, b = _ref.b;
|
|
549
|
-
var hsv = rgbToHsv(r, g, b);
|
|
550
|
-
return {
|
|
551
|
-
h: hsv.h * 360,
|
|
552
|
-
s: hsv.s,
|
|
553
|
-
v: hsv.v
|
|
554
|
-
};
|
|
555
|
-
}
|
|
556
|
-
function toHex(_ref2) {
|
|
557
|
-
var r = _ref2.r, g = _ref2.g, b = _ref2.b;
|
|
558
|
-
return "#".concat(rgbToHex(r, g, b));
|
|
559
|
-
}
|
|
560
|
-
function mix(rgb1, rgb2, amount) {
|
|
561
|
-
var p = amount / 100;
|
|
562
|
-
var rgb = {
|
|
563
|
-
r: (rgb2.r - rgb1.r) * p + rgb1.r,
|
|
564
|
-
g: (rgb2.g - rgb1.g) * p + rgb1.g,
|
|
565
|
-
b: (rgb2.b - rgb1.b) * p + rgb1.b
|
|
566
|
-
};
|
|
567
|
-
return rgb;
|
|
568
|
-
}
|
|
569
|
-
function getHue(hsv, i, light) {
|
|
570
|
-
var hue;
|
|
571
|
-
if (Math.round(hsv.h) >= 60 && Math.round(hsv.h) <= 240) {
|
|
572
|
-
hue = light ? Math.round(hsv.h) - hueStep * i : Math.round(hsv.h) + hueStep * i;
|
|
573
|
-
} else {
|
|
574
|
-
hue = light ? Math.round(hsv.h) + hueStep * i : Math.round(hsv.h) - hueStep * i;
|
|
575
|
-
}
|
|
576
|
-
if (hue < 0) {
|
|
577
|
-
hue += 360;
|
|
578
|
-
} else if (hue >= 360) {
|
|
579
|
-
hue -= 360;
|
|
580
|
-
}
|
|
581
|
-
return hue;
|
|
582
|
-
}
|
|
583
|
-
function getSaturation(hsv, i, light) {
|
|
584
|
-
if (hsv.h === 0 && hsv.s === 0) {
|
|
585
|
-
return hsv.s;
|
|
586
|
-
}
|
|
587
|
-
var saturation;
|
|
588
|
-
if (light) {
|
|
589
|
-
saturation = hsv.s - saturationStep * i;
|
|
590
|
-
} else if (i === darkColorCount) {
|
|
591
|
-
saturation = hsv.s + saturationStep;
|
|
592
|
-
} else {
|
|
593
|
-
saturation = hsv.s + saturationStep2 * i;
|
|
594
|
-
}
|
|
595
|
-
if (saturation > 1) {
|
|
596
|
-
saturation = 1;
|
|
597
|
-
}
|
|
598
|
-
if (light && i === lightColorCount && saturation > 0.1) {
|
|
599
|
-
saturation = 0.1;
|
|
600
|
-
}
|
|
601
|
-
if (saturation < 0.06) {
|
|
602
|
-
saturation = 0.06;
|
|
603
|
-
}
|
|
604
|
-
return Number(saturation.toFixed(2));
|
|
605
|
-
}
|
|
606
|
-
function getValue(hsv, i, light) {
|
|
607
|
-
var value;
|
|
608
|
-
if (light) {
|
|
609
|
-
value = hsv.v + brightnessStep1 * i;
|
|
610
|
-
} else {
|
|
611
|
-
value = hsv.v - brightnessStep2 * i;
|
|
612
|
-
}
|
|
613
|
-
if (value > 1) {
|
|
614
|
-
value = 1;
|
|
615
|
-
}
|
|
616
|
-
return Number(value.toFixed(2));
|
|
617
|
-
}
|
|
618
|
-
function generate$1(color) {
|
|
619
|
-
var opts = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
|
|
620
|
-
var patterns = [];
|
|
621
|
-
var pColor = inputToRGB(color);
|
|
622
|
-
for (var i = lightColorCount; i > 0; i -= 1) {
|
|
623
|
-
var hsv = toHsv(pColor);
|
|
624
|
-
var colorString = toHex(inputToRGB({
|
|
625
|
-
h: getHue(hsv, i, true),
|
|
626
|
-
s: getSaturation(hsv, i, true),
|
|
627
|
-
v: getValue(hsv, i, true)
|
|
628
|
-
}));
|
|
629
|
-
patterns.push(colorString);
|
|
630
|
-
}
|
|
631
|
-
patterns.push(toHex(pColor));
|
|
632
|
-
for (var _i = 1; _i <= darkColorCount; _i += 1) {
|
|
633
|
-
var _hsv = toHsv(pColor);
|
|
634
|
-
var _colorString = toHex(inputToRGB({
|
|
635
|
-
h: getHue(_hsv, _i),
|
|
636
|
-
s: getSaturation(_hsv, _i),
|
|
637
|
-
v: getValue(_hsv, _i)
|
|
638
|
-
}));
|
|
639
|
-
patterns.push(_colorString);
|
|
640
|
-
}
|
|
641
|
-
if (opts.theme === "dark") {
|
|
642
|
-
return darkColorMap.map(function(_ref3) {
|
|
643
|
-
var index = _ref3.index, opacity = _ref3.opacity;
|
|
644
|
-
var darkColorString = toHex(mix(inputToRGB(opts.backgroundColor || "#141414"), inputToRGB(patterns[index]), opacity * 100));
|
|
645
|
-
return darkColorString;
|
|
646
|
-
});
|
|
647
|
-
}
|
|
648
|
-
return patterns;
|
|
649
|
-
}
|
|
650
|
-
var presetPrimaryColors = {
|
|
651
|
-
red: "#F5222D",
|
|
652
|
-
volcano: "#FA541C",
|
|
653
|
-
orange: "#FA8C16",
|
|
654
|
-
gold: "#FAAD14",
|
|
655
|
-
yellow: "#FADB14",
|
|
656
|
-
lime: "#A0D911",
|
|
657
|
-
green: "#52C41A",
|
|
658
|
-
cyan: "#13C2C2",
|
|
659
|
-
blue: "#1890FF",
|
|
660
|
-
geekblue: "#2F54EB",
|
|
661
|
-
purple: "#722ED1",
|
|
662
|
-
magenta: "#EB2F96",
|
|
663
|
-
grey: "#666666"
|
|
664
|
-
};
|
|
665
|
-
var presetPalettes = {};
|
|
666
|
-
var presetDarkPalettes = {};
|
|
667
|
-
Object.keys(presetPrimaryColors).forEach(function(key) {
|
|
668
|
-
presetPalettes[key] = generate$1(presetPrimaryColors[key]);
|
|
669
|
-
presetPalettes[key].primary = presetPalettes[key][5];
|
|
670
|
-
presetDarkPalettes[key] = generate$1(presetPrimaryColors[key], {
|
|
671
|
-
theme: "dark",
|
|
672
|
-
backgroundColor: "#141414"
|
|
673
|
-
});
|
|
674
|
-
presetDarkPalettes[key].primary = presetDarkPalettes[key][5];
|
|
675
|
-
});
|
|
676
|
-
var containers = [];
|
|
677
|
-
var styleElements = [];
|
|
678
|
-
var usage = "insert-css: You need to provide a CSS string. Usage: insertCss(cssString[, options]).";
|
|
679
|
-
function createStyleElement() {
|
|
680
|
-
var styleElement = document.createElement("style");
|
|
681
|
-
styleElement.setAttribute("type", "text/css");
|
|
682
|
-
return styleElement;
|
|
683
|
-
}
|
|
684
|
-
function insertCss(css, options) {
|
|
685
|
-
options = options || {};
|
|
686
|
-
if (css === void 0) {
|
|
687
|
-
throw new Error(usage);
|
|
688
|
-
}
|
|
689
|
-
var position = options.prepend === true ? "prepend" : "append";
|
|
690
|
-
var container = options.container !== void 0 ? options.container : document.querySelector("head");
|
|
691
|
-
var containerId = containers.indexOf(container);
|
|
692
|
-
if (containerId === -1) {
|
|
693
|
-
containerId = containers.push(container) - 1;
|
|
694
|
-
styleElements[containerId] = {};
|
|
695
|
-
}
|
|
696
|
-
var styleElement;
|
|
697
|
-
if (styleElements[containerId] !== void 0 && styleElements[containerId][position] !== void 0) {
|
|
698
|
-
styleElement = styleElements[containerId][position];
|
|
699
|
-
} else {
|
|
700
|
-
styleElement = styleElements[containerId][position] = createStyleElement();
|
|
701
|
-
if (position === "prepend") {
|
|
702
|
-
container.insertBefore(styleElement, container.childNodes[0]);
|
|
703
|
-
} else {
|
|
704
|
-
container.appendChild(styleElement);
|
|
705
|
-
}
|
|
706
|
-
}
|
|
707
|
-
if (css.charCodeAt(0) === 65279) {
|
|
708
|
-
css = css.substr(1, css.length);
|
|
709
|
-
}
|
|
710
|
-
if (styleElement.styleSheet) {
|
|
711
|
-
styleElement.styleSheet.cssText += css;
|
|
712
|
-
} else {
|
|
713
|
-
styleElement.textContent += css;
|
|
714
|
-
}
|
|
715
|
-
return styleElement;
|
|
716
|
-
}
|
|
717
|
-
function _objectSpread$2(target) {
|
|
718
|
-
for (var i = 1; i < arguments.length; i++) {
|
|
719
|
-
var source = arguments[i] != null ? Object(arguments[i]) : {};
|
|
720
|
-
var ownKeys = Object.keys(source);
|
|
721
|
-
if (typeof Object.getOwnPropertySymbols === "function") {
|
|
722
|
-
ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function(sym) {
|
|
723
|
-
return Object.getOwnPropertyDescriptor(source, sym).enumerable;
|
|
724
|
-
}));
|
|
725
|
-
}
|
|
726
|
-
ownKeys.forEach(function(key) {
|
|
727
|
-
_defineProperty$2(target, key, source[key]);
|
|
728
|
-
});
|
|
729
|
-
}
|
|
730
|
-
return target;
|
|
731
|
-
}
|
|
732
|
-
function _defineProperty$2(obj, key, value) {
|
|
733
|
-
if (key in obj) {
|
|
734
|
-
Object.defineProperty(obj, key, { value, enumerable: true, configurable: true, writable: true });
|
|
735
|
-
} else {
|
|
736
|
-
obj[key] = value;
|
|
737
|
-
}
|
|
738
|
-
return obj;
|
|
739
|
-
}
|
|
740
|
-
function warn(valid, message) {
|
|
741
|
-
if (process.env.NODE_ENV !== "production" && !valid && console !== void 0) {
|
|
742
|
-
console.error("Warning: ".concat(message));
|
|
743
|
-
}
|
|
744
|
-
}
|
|
745
|
-
function warning(valid, message) {
|
|
746
|
-
warn(valid, "[@ant-design/icons-vue] ".concat(message));
|
|
747
|
-
}
|
|
748
|
-
function isIconDefinition(target) {
|
|
749
|
-
return typeof target === "object" && typeof target.name === "string" && typeof target.theme === "string" && (typeof target.icon === "object" || typeof target.icon === "function");
|
|
750
|
-
}
|
|
751
|
-
function generate(node, key, rootProps) {
|
|
752
|
-
if (!rootProps) {
|
|
753
|
-
return h(node.tag, _objectSpread$2({
|
|
754
|
-
key
|
|
755
|
-
}, node.attrs), (node.children || []).map(function(child, index) {
|
|
756
|
-
return generate(child, "".concat(key, "-").concat(node.tag, "-").concat(index));
|
|
757
|
-
}));
|
|
758
|
-
}
|
|
759
|
-
return h(node.tag, _objectSpread$2({
|
|
760
|
-
key
|
|
761
|
-
}, rootProps, node.attrs), (node.children || []).map(function(child, index) {
|
|
762
|
-
return generate(child, "".concat(key, "-").concat(node.tag, "-").concat(index));
|
|
763
|
-
}));
|
|
764
|
-
}
|
|
765
|
-
function getSecondaryColor(primaryColor) {
|
|
766
|
-
return generate$1(primaryColor)[0];
|
|
767
|
-
}
|
|
768
|
-
function normalizeTwoToneColors(twoToneColor) {
|
|
769
|
-
if (!twoToneColor) {
|
|
770
|
-
return [];
|
|
771
|
-
}
|
|
772
|
-
return Array.isArray(twoToneColor) ? twoToneColor : [twoToneColor];
|
|
773
|
-
}
|
|
774
|
-
var svgBaseProps = {
|
|
775
|
-
width: "1em",
|
|
776
|
-
height: "1em",
|
|
777
|
-
fill: "currentColor",
|
|
778
|
-
"aria-hidden": "true",
|
|
779
|
-
focusable: "false"
|
|
780
|
-
};
|
|
781
|
-
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";
|
|
782
|
-
var cssInjectedFlag = false;
|
|
783
|
-
var useInsertStyles = function useInsertStyles2() {
|
|
784
|
-
var styleStr = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : iconStyles;
|
|
785
|
-
nextTick(function() {
|
|
786
|
-
if (!cssInjectedFlag) {
|
|
787
|
-
if (typeof window !== "undefined" && window.document && window.document.documentElement) {
|
|
788
|
-
insertCss(styleStr, {
|
|
789
|
-
prepend: true
|
|
790
|
-
});
|
|
791
|
-
}
|
|
792
|
-
cssInjectedFlag = true;
|
|
793
|
-
}
|
|
794
|
-
});
|
|
795
|
-
};
|
|
796
|
-
var _excluded$1 = ["icon", "primaryColor", "secondaryColor"];
|
|
797
|
-
function _objectWithoutProperties$1(source, excluded) {
|
|
798
|
-
if (source == null) return {};
|
|
799
|
-
var target = _objectWithoutPropertiesLoose$1(source, excluded);
|
|
800
|
-
var key, i;
|
|
801
|
-
if (Object.getOwnPropertySymbols) {
|
|
802
|
-
var sourceSymbolKeys = Object.getOwnPropertySymbols(source);
|
|
803
|
-
for (i = 0; i < sourceSymbolKeys.length; i++) {
|
|
804
|
-
key = sourceSymbolKeys[i];
|
|
805
|
-
if (excluded.indexOf(key) >= 0) continue;
|
|
806
|
-
if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue;
|
|
807
|
-
target[key] = source[key];
|
|
808
|
-
}
|
|
809
|
-
}
|
|
810
|
-
return target;
|
|
811
|
-
}
|
|
812
|
-
function _objectWithoutPropertiesLoose$1(source, excluded) {
|
|
813
|
-
if (source == null) return {};
|
|
814
|
-
var target = {};
|
|
815
|
-
var sourceKeys = Object.keys(source);
|
|
816
|
-
var key, i;
|
|
817
|
-
for (i = 0; i < sourceKeys.length; i++) {
|
|
818
|
-
key = sourceKeys[i];
|
|
819
|
-
if (excluded.indexOf(key) >= 0) continue;
|
|
820
|
-
target[key] = source[key];
|
|
821
|
-
}
|
|
822
|
-
return target;
|
|
823
|
-
}
|
|
824
|
-
function _objectSpread$1(target) {
|
|
825
|
-
for (var i = 1; i < arguments.length; i++) {
|
|
826
|
-
var source = arguments[i] != null ? Object(arguments[i]) : {};
|
|
827
|
-
var ownKeys = Object.keys(source);
|
|
828
|
-
if (typeof Object.getOwnPropertySymbols === "function") {
|
|
829
|
-
ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function(sym) {
|
|
830
|
-
return Object.getOwnPropertyDescriptor(source, sym).enumerable;
|
|
831
|
-
}));
|
|
832
|
-
}
|
|
833
|
-
ownKeys.forEach(function(key) {
|
|
834
|
-
_defineProperty$1(target, key, source[key]);
|
|
835
|
-
});
|
|
836
|
-
}
|
|
837
|
-
return target;
|
|
838
|
-
}
|
|
839
|
-
function _defineProperty$1(obj, key, value) {
|
|
840
|
-
if (key in obj) {
|
|
841
|
-
Object.defineProperty(obj, key, { value, enumerable: true, configurable: true, writable: true });
|
|
842
|
-
} else {
|
|
843
|
-
obj[key] = value;
|
|
844
|
-
}
|
|
845
|
-
return obj;
|
|
846
|
-
}
|
|
847
|
-
var twoToneColorPalette = {
|
|
848
|
-
primaryColor: "#333",
|
|
849
|
-
secondaryColor: "#E6E6E6",
|
|
850
|
-
calculated: false
|
|
851
|
-
};
|
|
852
|
-
function setTwoToneColors(_ref) {
|
|
853
|
-
var primaryColor = _ref.primaryColor, secondaryColor = _ref.secondaryColor;
|
|
854
|
-
twoToneColorPalette.primaryColor = primaryColor;
|
|
855
|
-
twoToneColorPalette.secondaryColor = secondaryColor || getSecondaryColor(primaryColor);
|
|
856
|
-
twoToneColorPalette.calculated = !!secondaryColor;
|
|
857
|
-
}
|
|
858
|
-
function getTwoToneColors() {
|
|
859
|
-
return _objectSpread$1({}, twoToneColorPalette);
|
|
860
|
-
}
|
|
861
|
-
var IconBase = function IconBase2(props, context) {
|
|
862
|
-
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);
|
|
863
|
-
var colors = twoToneColorPalette;
|
|
864
|
-
if (primaryColor) {
|
|
865
|
-
colors = {
|
|
866
|
-
primaryColor,
|
|
867
|
-
secondaryColor: secondaryColor || getSecondaryColor(primaryColor)
|
|
868
|
-
};
|
|
869
|
-
}
|
|
870
|
-
useInsertStyles();
|
|
871
|
-
warning(isIconDefinition(icon), "icon should be icon definiton, but got ".concat(icon));
|
|
872
|
-
if (!isIconDefinition(icon)) {
|
|
873
|
-
return null;
|
|
874
|
-
}
|
|
875
|
-
var target = icon;
|
|
876
|
-
if (target && typeof target.icon === "function") {
|
|
877
|
-
target = _objectSpread$1({}, target, {
|
|
878
|
-
icon: target.icon(colors.primaryColor, colors.secondaryColor)
|
|
879
|
-
});
|
|
880
|
-
}
|
|
881
|
-
return generate(target.icon, "svg-".concat(target.name), _objectSpread$1({}, restProps, {
|
|
882
|
-
"data-icon": target.name,
|
|
883
|
-
width: "1em",
|
|
884
|
-
height: "1em",
|
|
885
|
-
fill: "currentColor",
|
|
886
|
-
"aria-hidden": "true"
|
|
887
|
-
}));
|
|
888
|
-
};
|
|
889
|
-
IconBase.props = {
|
|
890
|
-
icon: Object,
|
|
891
|
-
primaryColor: String,
|
|
892
|
-
secondaryColor: String,
|
|
893
|
-
focusable: String
|
|
894
|
-
};
|
|
895
|
-
IconBase.inheritAttrs = false;
|
|
896
|
-
IconBase.displayName = "IconBase";
|
|
897
|
-
IconBase.getTwoToneColors = getTwoToneColors;
|
|
898
|
-
IconBase.setTwoToneColors = setTwoToneColors;
|
|
899
|
-
function _slicedToArray$1(arr, i) {
|
|
900
|
-
return _arrayWithHoles$1(arr) || _iterableToArrayLimit$1(arr, i) || _unsupportedIterableToArray$1(arr, i) || _nonIterableRest$1();
|
|
901
|
-
}
|
|
902
|
-
function _nonIterableRest$1() {
|
|
903
|
-
throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
904
|
-
}
|
|
905
|
-
function _unsupportedIterableToArray$1(o, minLen) {
|
|
906
|
-
if (!o) return;
|
|
907
|
-
if (typeof o === "string") return _arrayLikeToArray$1(o, minLen);
|
|
908
|
-
var n = Object.prototype.toString.call(o).slice(8, -1);
|
|
909
|
-
if (n === "Object" && o.constructor) n = o.constructor.name;
|
|
910
|
-
if (n === "Map" || n === "Set") return Array.from(o);
|
|
911
|
-
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray$1(o, minLen);
|
|
912
|
-
}
|
|
913
|
-
function _arrayLikeToArray$1(arr, len) {
|
|
914
|
-
if (len == null || len > arr.length) len = arr.length;
|
|
915
|
-
for (var i = 0, arr2 = new Array(len); i < len; i++) {
|
|
916
|
-
arr2[i] = arr[i];
|
|
917
|
-
}
|
|
918
|
-
return arr2;
|
|
919
|
-
}
|
|
920
|
-
function _iterableToArrayLimit$1(arr, i) {
|
|
921
|
-
var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"];
|
|
922
|
-
if (_i == null) return;
|
|
923
|
-
var _arr = [];
|
|
924
|
-
var _n = true;
|
|
925
|
-
var _d = false;
|
|
926
|
-
var _s, _e;
|
|
927
|
-
try {
|
|
928
|
-
for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) {
|
|
929
|
-
_arr.push(_s.value);
|
|
930
|
-
if (i && _arr.length === i) break;
|
|
931
|
-
}
|
|
932
|
-
} catch (err) {
|
|
933
|
-
_d = true;
|
|
934
|
-
_e = err;
|
|
935
|
-
} finally {
|
|
936
|
-
try {
|
|
937
|
-
if (!_n && _i["return"] != null) _i["return"]();
|
|
938
|
-
} finally {
|
|
939
|
-
if (_d) throw _e;
|
|
940
|
-
}
|
|
941
|
-
}
|
|
942
|
-
return _arr;
|
|
943
|
-
}
|
|
944
|
-
function _arrayWithHoles$1(arr) {
|
|
945
|
-
if (Array.isArray(arr)) return arr;
|
|
946
|
-
}
|
|
947
|
-
function setTwoToneColor(twoToneColor) {
|
|
948
|
-
var _normalizeTwoToneColo = normalizeTwoToneColors(twoToneColor), _normalizeTwoToneColo2 = _slicedToArray$1(_normalizeTwoToneColo, 2), primaryColor = _normalizeTwoToneColo2[0], secondaryColor = _normalizeTwoToneColo2[1];
|
|
949
|
-
return IconBase.setTwoToneColors({
|
|
950
|
-
primaryColor,
|
|
951
|
-
secondaryColor
|
|
952
|
-
});
|
|
953
|
-
}
|
|
954
|
-
function getTwoToneColor() {
|
|
955
|
-
var colors = IconBase.getTwoToneColors();
|
|
956
|
-
if (!colors.calculated) {
|
|
957
|
-
return colors.primaryColor;
|
|
958
|
-
}
|
|
959
|
-
return [colors.primaryColor, colors.secondaryColor];
|
|
960
|
-
}
|
|
961
|
-
var _excluded = ["class", "icon", "spin", "rotate", "tabindex", "twoToneColor", "onClick"];
|
|
962
|
-
function _slicedToArray(arr, i) {
|
|
963
|
-
return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest();
|
|
964
|
-
}
|
|
965
|
-
function _nonIterableRest() {
|
|
966
|
-
throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
967
|
-
}
|
|
968
|
-
function _unsupportedIterableToArray(o, minLen) {
|
|
969
|
-
if (!o) return;
|
|
970
|
-
if (typeof o === "string") return _arrayLikeToArray(o, minLen);
|
|
971
|
-
var n = Object.prototype.toString.call(o).slice(8, -1);
|
|
972
|
-
if (n === "Object" && o.constructor) n = o.constructor.name;
|
|
973
|
-
if (n === "Map" || n === "Set") return Array.from(o);
|
|
974
|
-
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen);
|
|
975
|
-
}
|
|
976
|
-
function _arrayLikeToArray(arr, len) {
|
|
977
|
-
if (len == null || len > arr.length) len = arr.length;
|
|
978
|
-
for (var i = 0, arr2 = new Array(len); i < len; i++) {
|
|
979
|
-
arr2[i] = arr[i];
|
|
980
|
-
}
|
|
981
|
-
return arr2;
|
|
982
|
-
}
|
|
983
|
-
function _iterableToArrayLimit(arr, i) {
|
|
984
|
-
var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"];
|
|
985
|
-
if (_i == null) return;
|
|
986
|
-
var _arr = [];
|
|
987
|
-
var _n = true;
|
|
988
|
-
var _d = false;
|
|
989
|
-
var _s, _e;
|
|
990
|
-
try {
|
|
991
|
-
for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) {
|
|
992
|
-
_arr.push(_s.value);
|
|
993
|
-
if (i && _arr.length === i) break;
|
|
994
|
-
}
|
|
995
|
-
} catch (err) {
|
|
996
|
-
_d = true;
|
|
997
|
-
_e = err;
|
|
998
|
-
} finally {
|
|
999
|
-
try {
|
|
1000
|
-
if (!_n && _i["return"] != null) _i["return"]();
|
|
1001
|
-
} finally {
|
|
1002
|
-
if (_d) throw _e;
|
|
1003
|
-
}
|
|
1004
|
-
}
|
|
1005
|
-
return _arr;
|
|
1006
|
-
}
|
|
1007
|
-
function _arrayWithHoles(arr) {
|
|
1008
|
-
if (Array.isArray(arr)) return arr;
|
|
1009
|
-
}
|
|
1010
|
-
function _objectSpread(target) {
|
|
1011
|
-
for (var i = 1; i < arguments.length; i++) {
|
|
1012
|
-
var source = arguments[i] != null ? Object(arguments[i]) : {};
|
|
1013
|
-
var ownKeys = Object.keys(source);
|
|
1014
|
-
if (typeof Object.getOwnPropertySymbols === "function") {
|
|
1015
|
-
ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function(sym) {
|
|
1016
|
-
return Object.getOwnPropertyDescriptor(source, sym).enumerable;
|
|
1017
|
-
}));
|
|
1018
|
-
}
|
|
1019
|
-
ownKeys.forEach(function(key) {
|
|
1020
|
-
_defineProperty(target, key, source[key]);
|
|
1021
|
-
});
|
|
1022
|
-
}
|
|
1023
|
-
return target;
|
|
1024
|
-
}
|
|
1025
|
-
function _defineProperty(obj, key, value) {
|
|
1026
|
-
if (key in obj) {
|
|
1027
|
-
Object.defineProperty(obj, key, { value, enumerable: true, configurable: true, writable: true });
|
|
1028
|
-
} else {
|
|
1029
|
-
obj[key] = value;
|
|
1030
|
-
}
|
|
1031
|
-
return obj;
|
|
1032
|
-
}
|
|
1033
|
-
function _objectWithoutProperties(source, excluded) {
|
|
1034
|
-
if (source == null) return {};
|
|
1035
|
-
var target = _objectWithoutPropertiesLoose(source, excluded);
|
|
1036
|
-
var key, i;
|
|
1037
|
-
if (Object.getOwnPropertySymbols) {
|
|
1038
|
-
var sourceSymbolKeys = Object.getOwnPropertySymbols(source);
|
|
1039
|
-
for (i = 0; i < sourceSymbolKeys.length; i++) {
|
|
1040
|
-
key = sourceSymbolKeys[i];
|
|
1041
|
-
if (excluded.indexOf(key) >= 0) continue;
|
|
1042
|
-
if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue;
|
|
1043
|
-
target[key] = source[key];
|
|
1044
|
-
}
|
|
1045
|
-
}
|
|
1046
|
-
return target;
|
|
1047
|
-
}
|
|
1048
|
-
function _objectWithoutPropertiesLoose(source, excluded) {
|
|
1049
|
-
if (source == null) return {};
|
|
1050
|
-
var target = {};
|
|
1051
|
-
var sourceKeys = Object.keys(source);
|
|
1052
|
-
var key, i;
|
|
1053
|
-
for (i = 0; i < sourceKeys.length; i++) {
|
|
1054
|
-
key = sourceKeys[i];
|
|
1055
|
-
if (excluded.indexOf(key) >= 0) continue;
|
|
1056
|
-
target[key] = source[key];
|
|
1057
|
-
}
|
|
1058
|
-
return target;
|
|
1059
|
-
}
|
|
1060
|
-
setTwoToneColor("#1890ff");
|
|
1061
|
-
var Icon = function Icon2(props, context) {
|
|
1062
|
-
var _classObj;
|
|
1063
|
-
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);
|
|
1064
|
-
var classObj = (_classObj = {
|
|
1065
|
-
anticon: true
|
|
1066
|
-
}, _defineProperty(_classObj, "anticon-".concat(icon.name), Boolean(icon.name)), _defineProperty(_classObj, cls, cls), _classObj);
|
|
1067
|
-
var svgClassString = spin === "" || !!spin || icon.name === "loading" ? "anticon-spin" : "";
|
|
1068
|
-
var iconTabIndex = tabindex;
|
|
1069
|
-
if (iconTabIndex === void 0 && onClick) {
|
|
1070
|
-
iconTabIndex = -1;
|
|
1071
|
-
restProps.tabindex = iconTabIndex;
|
|
1072
|
-
}
|
|
1073
|
-
var svgStyle = rotate ? {
|
|
1074
|
-
msTransform: "rotate(".concat(rotate, "deg)"),
|
|
1075
|
-
transform: "rotate(".concat(rotate, "deg)")
|
|
1076
|
-
} : void 0;
|
|
1077
|
-
var _normalizeTwoToneColo = normalizeTwoToneColors(twoToneColor), _normalizeTwoToneColo2 = _slicedToArray(_normalizeTwoToneColo, 2), primaryColor = _normalizeTwoToneColo2[0], secondaryColor = _normalizeTwoToneColo2[1];
|
|
1078
|
-
return createVNode("span", _objectSpread({
|
|
1079
|
-
"role": "img",
|
|
1080
|
-
"aria-label": icon.name
|
|
1081
|
-
}, restProps, {
|
|
1082
|
-
"onClick": onClick,
|
|
1083
|
-
"class": classObj
|
|
1084
|
-
}), [createVNode(IconBase, {
|
|
1085
|
-
"class": svgClassString,
|
|
1086
|
-
"icon": icon,
|
|
1087
|
-
"primaryColor": primaryColor,
|
|
1088
|
-
"secondaryColor": secondaryColor,
|
|
1089
|
-
"style": svgStyle
|
|
1090
|
-
}, null)]);
|
|
1091
|
-
};
|
|
1092
|
-
Icon.props = {
|
|
1093
|
-
spin: Boolean,
|
|
1094
|
-
rotate: Number,
|
|
1095
|
-
icon: Object,
|
|
1096
|
-
twoToneColor: String
|
|
1097
|
-
};
|
|
1098
|
-
Icon.displayName = "AntdIcon";
|
|
1099
|
-
Icon.inheritAttrs = false;
|
|
1100
|
-
Icon.getTwoToneColor = getTwoToneColor;
|
|
1101
|
-
Icon.setTwoToneColor = setTwoToneColor;
|
|
1102
|
-
export {
|
|
1103
|
-
Icon as I,
|
|
1104
|
-
useNamespace as a,
|
|
1105
|
-
svgBaseProps as s,
|
|
1106
|
-
useInsertStyles as u,
|
|
1107
|
-
warning as w
|
|
1108
|
-
};
|