@tendaui/react 1.1.1 → 1.1.2
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/es/_chunks/{dep-D7LanWes.js → dep-4LYjB3c6.js} +3 -18
- package/es/_chunks/dep-4LYjB3c6.js.map +1 -0
- package/es/_chunks/dep-5U9UjDaf.js +345 -0
- package/es/_chunks/dep-5U9UjDaf.js.map +1 -0
- package/es/_chunks/{dep-B7HmDtze.js → dep-B4_O1Vgv.js} +2 -2
- package/es/_chunks/{dep-B7HmDtze.js.map → dep-B4_O1Vgv.js.map} +1 -1
- package/es/_chunks/dep-BP0-apUT.js.map +1 -1
- package/es/_chunks/dep-BRbJGDI9.js +7 -0
- package/es/_chunks/dep-BRbJGDI9.js.map +1 -0
- package/es/_chunks/{dep-EcrDKDlu.js → dep-BYlJzn45.js} +10 -9
- package/es/_chunks/dep-BYlJzn45.js.map +1 -0
- package/es/_chunks/dep-BbeHB7S3.js +116 -0
- package/es/_chunks/dep-BbeHB7S3.js.map +1 -0
- package/es/_chunks/{dep-DB5wmwh1.js → dep-Bjfn7Zv_.js} +2 -2
- package/es/_chunks/{dep-DB5wmwh1.js.map → dep-Bjfn7Zv_.js.map} +1 -1
- package/es/_chunks/{dep-C36au4Ip.js → dep-BuIAffJt.js} +2 -2
- package/es/_chunks/{dep-C36au4Ip.js.map → dep-BuIAffJt.js.map} +1 -1
- package/es/_chunks/{dep-bWaVq_y3.js → dep-ByzdZjUR.js} +2 -2
- package/es/_chunks/dep-ByzdZjUR.js.map +1 -0
- package/es/_chunks/dep-CD_4-1Xb.js +103 -0
- package/es/_chunks/dep-CD_4-1Xb.js.map +1 -0
- package/es/_chunks/{dep-Dk2xX8lh.js → dep-CJCt0IS0.js} +5 -212
- package/es/_chunks/dep-CJCt0IS0.js.map +1 -0
- package/es/_chunks/dep-CMPsNAXF.js +52 -0
- package/es/_chunks/dep-CMPsNAXF.js.map +1 -0
- package/es/_chunks/dep-COy5g3FT.js +512 -0
- package/es/_chunks/dep-COy5g3FT.js.map +1 -0
- package/es/_chunks/{dep-CoIiHOgo.js → dep-CRURwzDj.js} +3 -3
- package/es/_chunks/{dep-CoIiHOgo.js.map → dep-CRURwzDj.js.map} +1 -1
- package/es/_chunks/dep-C_wPqvpm.js +36 -0
- package/es/_chunks/dep-C_wPqvpm.js.map +1 -0
- package/es/_chunks/dep-Ccktr_jk.js +33 -0
- package/es/_chunks/dep-Ccktr_jk.js.map +1 -0
- package/es/_chunks/dep-Chz4ZJCb.js +20 -0
- package/es/_chunks/dep-Chz4ZJCb.js.map +1 -0
- package/es/_chunks/dep-CkmtEv0Y.js +55 -0
- package/es/_chunks/dep-CkmtEv0Y.js.map +1 -0
- package/es/_chunks/dep-DJmE940f.js +764 -0
- package/es/_chunks/dep-DJmE940f.js.map +1 -0
- package/es/_chunks/{dep-DHWwZ2Nj.js → dep-DQ6kXoi8.js} +2 -2
- package/es/_chunks/{dep-DHWwZ2Nj.js.map → dep-DQ6kXoi8.js.map} +1 -1
- package/es/_chunks/{dep-0QH2Ee4R.js → dep-DRwijJcv.js} +5 -5
- package/es/_chunks/dep-DRwijJcv.js.map +1 -0
- package/es/_chunks/dep-DTlQ2dCA.js +46 -0
- package/es/_chunks/dep-DTlQ2dCA.js.map +1 -0
- package/es/_chunks/dep-DURB9x8g.js +170 -0
- package/es/_chunks/dep-DURB9x8g.js.map +1 -0
- package/es/_chunks/{dep-DZ_0EvBk.js → dep-DX65P8M9.js} +4 -45
- package/es/_chunks/dep-DX65P8M9.js.map +1 -0
- package/es/_chunks/{dep-BH5n5r1M.js → dep-DbVHGoUC.js} +2 -2
- package/es/_chunks/dep-DbVHGoUC.js.map +1 -0
- package/es/_chunks/dep-Dlppf0JU.js +214 -0
- package/es/_chunks/dep-Dlppf0JU.js.map +1 -0
- package/es/_chunks/dep-Dr5wkz0z.js +266 -0
- package/es/_chunks/dep-Dr5wkz0z.js.map +1 -0
- package/es/_chunks/dep-DwWrhxkd.js.map +1 -1
- package/es/_chunks/dep-Tshfumgl.js +31 -0
- package/es/_chunks/dep-Tshfumgl.js.map +1 -0
- package/es/_chunks/{dep-u1x3x6MJ.js → dep-gy8uvBaS.js} +2 -2
- package/es/_chunks/{dep-u1x3x6MJ.js.map → dep-gy8uvBaS.js.map} +1 -1
- package/es/_chunks/dep-oUgTcXgm.js +11 -0
- package/es/_chunks/dep-oUgTcXgm.js.map +1 -0
- package/es/_chunks/dep-zOZQ0R9g.js +1181 -0
- package/es/_chunks/dep-zOZQ0R9g.js.map +1 -0
- package/es/alert/Alert.d.ts +7 -0
- package/es/alert/Alert.js +4 -3
- package/es/alert/Alert.js.map +1 -1
- package/es/alert/defaultProps.d.ts +2 -0
- package/es/alert/index.d.ts +5 -0
- package/es/alert/index.js +4 -3
- package/es/alert/index.js.map +1 -1
- package/es/alert/style/css.d.ts +1 -0
- package/es/alert/style/index.d.ts +1 -0
- package/es/alert/type.d.ts +45 -0
- package/es/badge/Badge.d.ts +7 -0
- package/es/badge/Badge.js +3 -2
- package/es/badge/Badge.js.map +1 -1
- package/es/badge/defaultProps.d.ts +2 -0
- package/es/badge/index.d.ts +5 -0
- package/es/badge/index.js +3 -2
- package/es/badge/index.js.map +1 -1
- package/es/badge/style/css.d.ts +1 -0
- package/es/badge/style/index.d.ts +1 -0
- package/es/badge/type.d.ts +50 -0
- package/es/button/Button.d.ts +6 -0
- package/es/button/Button.js +7 -5
- package/es/button/Button.js.map +1 -1
- package/es/button/_example/base.js +171 -0
- package/es/button/_example/base.js.map +1 -0
- package/es/button/_example/icon.js +181 -0
- package/es/button/_example/icon.js.map +1 -0
- package/es/button/defaultProps.d.ts +2 -0
- package/es/button/index.d.ts +5 -0
- package/es/button/index.js +7 -5
- package/es/button/index.js.map +1 -1
- package/es/button/style/css.d.ts +1 -0
- package/es/button/style/index.d.ts +1 -0
- package/es/button/type.d.ts +81 -0
- package/es/checkbox/Checkbox.d.ts +10 -0
- package/es/checkbox/Checkbox.js +5 -4
- package/es/checkbox/Checkbox.js.map +1 -1
- package/es/checkbox/CheckboxGroup.d.ts +14 -0
- package/es/checkbox/CheckboxGroup.js +5 -4
- package/es/checkbox/CheckboxGroup.js.map +1 -1
- package/es/checkbox/defaultProps.d.ts +3 -0
- package/es/checkbox/index.d.ts +11 -0
- package/es/checkbox/index.js +5 -4
- package/es/checkbox/index.js.map +1 -1
- package/es/checkbox/style/css.d.ts +1 -0
- package/es/checkbox/style/index.d.ts +1 -0
- package/es/checkbox/type.d.ts +115 -0
- package/es/color-picker/ColorPickPanel.d.ts +4 -0
- package/es/color-picker/ColorPickPanel.js +44 -0
- package/es/color-picker/ColorPickPanel.js.map +1 -0
- package/es/color-picker/ColorPicker.d.ts +4 -0
- package/es/color-picker/ColorPicker.js +118 -0
- package/es/color-picker/ColorPicker.js.map +1 -0
- package/es/color-picker/components/panel/alpha.d.ts +4 -0
- package/es/color-picker/components/panel/alpha.js +44 -0
- package/es/color-picker/components/panel/alpha.js.map +1 -0
- package/es/color-picker/components/panel/format/index.d.ts +10 -0
- package/es/color-picker/components/panel/format/index.js +128 -0
- package/es/color-picker/components/panel/format/index.js.map +1 -0
- package/es/color-picker/components/panel/format/inputs.d.ts +4 -0
- package/es/color-picker/components/panel/format/inputs.js +147 -0
- package/es/color-picker/components/panel/format/inputs.js.map +1 -0
- package/es/color-picker/components/panel/header.d.ts +13 -0
- package/es/color-picker/components/panel/header.js +60 -0
- package/es/color-picker/components/panel/header.js.map +1 -0
- package/es/color-picker/components/panel/hue.d.ts +4 -0
- package/es/color-picker/components/panel/hue.js +33 -0
- package/es/color-picker/components/panel/hue.js.map +1 -0
- package/es/color-picker/components/panel/index.d.ts +4 -0
- package/es/color-picker/components/panel/index.js +32 -0
- package/es/color-picker/components/panel/index.js.map +1 -0
- package/es/color-picker/components/panel/saturation.d.ts +4 -0
- package/es/color-picker/components/panel/saturation.js +101 -0
- package/es/color-picker/components/panel/saturation.js.map +1 -0
- package/es/color-picker/components/panel/slider.d.ts +11 -0
- package/es/color-picker/components/panel/slider.js +121 -0
- package/es/color-picker/components/panel/slider.js.map +1 -0
- package/es/color-picker/components/panel/swatches.d.ts +11 -0
- package/es/color-picker/components/panel/swatches.js +100 -0
- package/es/color-picker/components/panel/swatches.js.map +1 -0
- package/es/color-picker/components/trigger.d.ts +9 -0
- package/es/color-picker/components/trigger.js +73 -0
- package/es/color-picker/components/trigger.js.map +1 -0
- package/es/color-picker/defaultProps.d.ts +2 -0
- package/es/color-picker/helpers.d.ts +5 -0
- package/es/color-picker/hooks/useClassNames.d.ts +2 -0
- package/es/color-picker/hooks/useStyles.d.ts +14 -0
- package/es/color-picker/index.d.ts +6 -0
- package/es/color-picker/index.js +62 -0
- package/es/color-picker/index.js.map +1 -0
- package/es/color-picker/style/index.css +597 -0
- package/es/color-picker/style/index.d.ts +1 -0
- package/es/color-picker/style/index.js +2 -0
- package/es/color-picker/style/index.js.map +1 -0
- package/es/color-picker/type.d.ts +135 -0
- package/es/color-picker/utils/color-picker/cmyk.d.ts +27 -0
- package/es/color-picker/utils/color-picker/color.d.ts +144 -0
- package/es/color-picker/utils/color-picker/constants.d.ts +30 -0
- package/es/color-picker/utils/color-picker/draggable.d.ts +23 -0
- package/es/color-picker/utils/color-picker/format.d.ts +64 -0
- package/es/color-picker/utils/color-picker/gradient.d.ts +22 -0
- package/es/color-picker/utils/color-picker/index.d.ts +7 -0
- package/es/color-picker/utils/color-picker/index.js +147 -0
- package/es/color-picker/utils/color-picker/index.js.map +1 -0
- package/es/color-picker/utils/color-picker/types.d.ts +28 -0
- package/es/common/Check.d.ts +22 -0
- package/es/common/Check.js +4 -3
- package/es/common/Check.js.map +1 -1
- package/es/common/FakeArrow.d.ts +9 -0
- package/es/common/FakeArrow.js +3 -2
- package/es/common/FakeArrow.js.map +1 -1
- package/es/common/PluginContainer.d.ts +9 -0
- package/es/common/PluginContainer.js +2 -1
- package/es/common/PluginContainer.js.map +1 -1
- package/es/common/Portal.d.ts +16 -0
- package/es/common/Portal.js +6 -3
- package/es/common/Portal.js.map +1 -1
- package/es/common/observe.d.ts +1 -0
- package/es/common.d.ts +81 -0
- package/es/config-provider/ConfigContext.d.ts +13 -0
- package/es/config-provider/ConfigContext.js +5 -16
- package/es/config-provider/ConfigContext.js.map +1 -1
- package/es/config-provider/ConfigProvider.d.ts +25 -0
- package/es/config-provider/ConfigProvider.js +2 -1
- package/es/config-provider/ConfigProvider.js.map +1 -1
- package/es/config-provider/index.d.ts +7 -0
- package/es/config-provider/index.js +2 -1
- package/es/config-provider/index.js.map +1 -1
- package/es/config-provider/type.d.ts +1029 -0
- package/es/dialog/Dialog.d.ts +8 -0
- package/es/dialog/Dialog.js +12 -149
- package/es/dialog/Dialog.js.map +1 -1
- package/es/dialog/DialogCard.d.ts +8 -0
- package/es/dialog/DialogCard.js +9 -7
- package/es/dialog/DialogCard.js.map +1 -1
- package/es/dialog/defaultProps.d.ts +6 -0
- package/es/dialog/hooks/useDialogDrag.d.ts +7 -0
- package/es/dialog/hooks/useDialogEsc.d.ts +3 -0
- package/es/dialog/hooks/useDialogPosition.d.ts +2 -0
- package/es/dialog/hooks/useLockStyle.d.ts +2 -0
- package/es/dialog/index.d.ts +8 -0
- package/es/dialog/index.js +12 -8
- package/es/dialog/index.js.map +1 -1
- package/es/dialog/plugin.d.ts +6 -0
- package/es/dialog/plugin.js +15 -10
- package/es/dialog/plugin.js.map +1 -1
- package/es/dialog/style/css.d.ts +1 -0
- package/es/dialog/style/index.d.ts +1 -0
- package/es/dialog/type.d.ts +227 -0
- package/es/dialog/utils.d.ts +1 -0
- package/es/drawer/Drawer.d.ts +11 -0
- package/es/drawer/Drawer.js +458 -0
- package/es/drawer/Drawer.js.map +1 -0
- package/es/drawer/defaultProps.d.ts +2 -0
- package/es/drawer/hooks/useDrag.d.ts +8 -0
- package/es/drawer/hooks/useLockStyle.d.ts +1 -0
- package/es/drawer/index.d.ts +4 -0
- package/es/drawer/index.js +39 -0
- package/es/drawer/index.js.map +1 -0
- package/es/drawer/style/css.d.ts +1 -0
- package/es/drawer/style/css.js +1 -0
- package/es/drawer/style/index.css +231 -0
- package/es/drawer/style/index.d.ts +1 -0
- package/es/drawer/style/index.js +2 -0
- package/es/drawer/style/index.js.map +1 -0
- package/es/drawer/type.d.ts +199 -0
- package/es/drawer/utils/index.d.ts +23 -0
- package/es/drawer/utils/index.js +46 -0
- package/es/drawer/utils/index.js.map +1 -0
- package/es/fireworks/Fireworks.d.ts +7 -0
- package/es/fireworks/Fireworks.js +139 -0
- package/es/fireworks/Fireworks.js.map +1 -0
- package/es/fireworks/index.d.ts +5 -0
- package/es/fireworks/index.js +16 -0
- package/es/fireworks/index.js.map +1 -0
- package/es/fireworks/style/css.d.ts +1 -0
- package/es/fireworks/style/css.js +2 -0
- package/es/fireworks/style/index.css +121 -0
- package/es/fireworks/style/index.d.ts +1 -0
- package/es/fireworks/style/index.js +2 -0
- package/es/fireworks/style/index.js.map +1 -0
- package/es/fireworks/type.d.ts +69 -0
- package/es/form/Form.d.ts +8 -0
- package/es/form/Form.js +14 -10
- package/es/form/Form.js.map +1 -1
- package/es/form/FormContext.d.ts +59 -0
- package/es/form/FormItem.d.ts +23 -0
- package/es/form/FormItem.js +14 -10
- package/es/form/FormItem.js.map +1 -1
- package/es/form/FormList.d.ts +4 -0
- package/es/form/FormList.js +2 -1
- package/es/form/FormList.js.map +1 -1
- package/es/form/const.d.ts +6 -0
- package/es/form/defaultProps.d.ts +3 -0
- package/es/form/easing.d.ts +2 -0
- package/es/form/formModel.d.ts +37 -0
- package/es/form/hooks/interface.d.ts +16 -0
- package/es/form/hooks/useForm.d.ts +3 -0
- package/es/form/hooks/useFormItemInitialData.d.ts +9 -0
- package/es/form/hooks/useFormItemStyle.d.ts +10 -0
- package/es/form/hooks/useFormItemStyle.js +4 -3
- package/es/form/hooks/useFormItemStyle.js.map +1 -1
- package/es/form/hooks/useInstance.d.ts +16 -0
- package/es/form/hooks/useInstance.js +5 -4
- package/es/form/hooks/useInstance.js.map +1 -1
- package/es/form/hooks/useWatch.d.ts +3 -0
- package/es/form/index.d.ts +7 -0
- package/es/form/index.js +14 -10
- package/es/form/index.js.map +1 -1
- package/es/form/scroll.d.ts +39 -0
- package/es/form/style/css.d.ts +1 -0
- package/es/form/style/index.d.ts +1 -0
- package/es/form/type.d.ts +486 -0
- package/es/form/utils/index.d.ts +5 -0
- package/es/global-config/default-config.d.ts +84 -0
- package/es/global-config/locale/ar_KW.d.ts +239 -0
- package/es/global-config/locale/en_US.d.ts +263 -0
- package/es/global-config/locale/it_IT.d.ts +263 -0
- package/es/global-config/locale/ja_JP.d.ts +263 -0
- package/es/global-config/locale/ko_KR.d.ts +263 -0
- package/es/global-config/locale/ru_RU.d.ts +263 -0
- package/es/global-config/locale/zh_CN.d.ts +263 -0
- package/es/global-config/locale/zh_TW.d.ts +263 -0
- package/es/global-config/mobile/default-config.d.ts +7 -0
- package/es/global-config/mobile/locale/ar_KW.d.ts +98 -0
- package/es/global-config/mobile/locale/en_US.d.ts +99 -0
- package/es/global-config/mobile/locale/it_IT.d.ts +99 -0
- package/es/global-config/mobile/locale/ja_JP.d.ts +99 -0
- package/es/global-config/mobile/locale/ko_KR.d.ts +99 -0
- package/es/global-config/mobile/locale/ru_RU.d.ts +99 -0
- package/es/global-config/mobile/locale/zh_CN.d.ts +99 -0
- package/es/global-config/mobile/locale/zh_TW.d.ts +99 -0
- package/es/global-config/t.d.ts +25 -0
- package/es/hooks/useAttach.d.ts +10 -0
- package/es/hooks/useCommonClassName.d.ts +54 -0
- package/es/hooks/useConfig.d.ts +2 -0
- package/es/hooks/useControlled.d.ts +9 -0
- package/es/hooks/useDeepEffect.d.ts +7 -0
- package/es/hooks/useDefaultProps.d.ts +1 -0
- package/es/hooks/useDomCallback.d.ts +1 -0
- package/es/hooks/useDomRefCallback.d.ts +1 -0
- package/es/hooks/useDragSorter.d.ts +28 -0
- package/es/hooks/useEventCallback.d.ts +9 -0
- package/es/hooks/useGlobalConfig.d.ts +1 -0
- package/es/hooks/useGlobalIcon.d.ts +5 -0
- package/es/hooks/useLastest.d.ts +2 -0
- package/es/hooks/useLayoutEffect.d.ts +3 -0
- package/es/hooks/useMouseEvent.d.ts +25 -0
- package/es/hooks/useMutationObserver.d.ts +4 -0
- package/es/hooks/usePopper.d.ts +19 -0
- package/es/hooks/useResizeObserve.d.ts +1 -0
- package/es/hooks/useRipple.d.ts +0 -0
- package/es/hooks/useSetState.d.ts +7 -0
- package/es/hooks/useVirtualScroll.d.ts +30 -0
- package/es/hooks/useWindowSize.d.ts +6 -0
- package/es/index.d.ts +25 -0
- package/es/index.js +68 -14
- package/es/index.js.map +1 -1
- package/es/input/Input.d.ts +16 -0
- package/es/input/Input.js +5 -5
- package/es/input/Input.js.map +1 -1
- package/es/input/InputGroup.d.ts +10 -0
- package/es/input/defaultProps.d.ts +17 -0
- package/es/input/index.d.ts +6 -0
- package/es/input/index.js +5 -3
- package/es/input/index.js.map +1 -1
- package/es/input/style/css.d.ts +1 -0
- package/es/input/style/index.d.ts +1 -0
- package/es/input/type.d.ts +237 -0
- package/es/input-number/InputNumber.d.ts +17 -0
- package/es/input-number/InputNumber.js +139 -0
- package/es/input-number/InputNumber.js.map +1 -0
- package/es/input-number/defaultProps.d.ts +2 -0
- package/es/input-number/index.d.ts +5 -0
- package/es/input-number/index.js +43 -0
- package/es/input-number/index.js.map +1 -0
- package/es/input-number/style/css.d.ts +1 -0
- package/es/input-number/style/css.js +1 -0
- package/es/input-number/style/index.css +331 -0
- package/es/input-number/style/index.d.ts +1 -0
- package/es/input-number/style/index.js +2 -0
- package/es/input-number/style/index.js.map +1 -0
- package/es/input-number/type.d.ts +156 -0
- package/es/input-number/useInputNumber.d.ts +51 -0
- package/es/input-number/useInputNumber.js +809 -0
- package/es/input-number/useInputNumber.js.map +1 -0
- package/es/ip-input/IPInput.d.ts +5 -0
- package/es/ip-input/IPInput.js +16 -0
- package/es/ip-input/IPInput.js.map +1 -0
- package/es/ip-input/defaultProps.d.ts +2 -0
- package/es/ip-input/index.d.ts +3 -0
- package/es/ip-input/index.js +16 -0
- package/es/ip-input/index.js.map +1 -0
- package/es/ip-input/style/index.css +323 -0
- package/es/ip-input/style/index.d.ts +1 -0
- package/es/ip-input/style/index.js +2 -0
- package/es/ip-input/style/index.js.map +1 -0
- package/es/ip-input/type.d.ts +113 -0
- package/es/ip-input/utils.d.ts +35 -0
- package/es/layout/Aside.d.ts +11 -0
- package/es/layout/Aside.js +41 -0
- package/es/layout/Aside.js.map +1 -0
- package/es/layout/Layout.d.ts +26 -0
- package/es/layout/Layout.js +106 -0
- package/es/layout/Layout.js.map +1 -0
- package/es/layout/defaultProps.d.ts +5 -0
- package/es/layout/index.d.ts +10 -0
- package/es/layout/index.js +19 -0
- package/es/layout/index.js.map +1 -0
- package/es/layout/style/index.css +56 -0
- package/es/layout/style/index.d.ts +1 -0
- package/es/layout/style/index.js +2 -0
- package/es/layout/style/index.js.map +1 -0
- package/es/layout/type.d.ts +38 -0
- package/es/list/List.d.ts +17 -0
- package/es/list/List.js +217 -0
- package/es/list/List.js.map +1 -0
- package/es/list/ListItem.d.ts +15 -0
- package/es/list/ListItem.js +31 -0
- package/es/list/ListItem.js.map +1 -0
- package/es/list/ListItemMeta.d.ts +10 -0
- package/es/list/ListItemMeta.js +45 -0
- package/es/list/ListItemMeta.js.map +1 -0
- package/es/list/defaultProps.d.ts +7 -0
- package/es/list/hooks/useListVirtualScroll.d.ts +24 -0
- package/es/list/index.d.ts +10 -0
- package/es/list/index.js +40 -0
- package/es/list/index.js.map +1 -0
- package/es/list/style/css.d.ts +1 -0
- package/es/list/style/css.js +1 -0
- package/es/list/style/index.css +172 -0
- package/es/list/style/index.d.ts +1 -0
- package/es/list/style/index.js +2 -0
- package/es/list/style/index.js.map +1 -0
- package/es/list/type.d.ts +92 -0
- package/es/loading/Gradient.d.ts +6 -0
- package/es/loading/Gradient.js +4 -3
- package/es/loading/Gradient.js.map +1 -1
- package/es/loading/Loading.d.ts +7 -0
- package/es/loading/Loading.js +7 -5
- package/es/loading/Loading.js.map +1 -1
- package/es/loading/circleAdapter.d.ts +1 -0
- package/es/loading/defaultProps.d.ts +2 -0
- package/es/loading/index.d.ts +5 -0
- package/es/loading/index.js +7 -5
- package/es/loading/index.js.map +1 -1
- package/es/loading/style/css.d.ts +1 -0
- package/es/loading/style/index.d.ts +1 -0
- package/es/loading/type.d.ts +68 -0
- package/es/loading/utils/setStyle.d.ts +7 -0
- package/es/locale/LocalReceiver.d.ts +6 -0
- package/es/locale/ar_KW.d.ts +3 -0
- package/es/locale/en_US.d.ts +3 -0
- package/es/locale/it_IT.d.ts +3 -0
- package/es/locale/ja_JP.d.ts +3 -0
- package/es/locale/ko_KR.d.ts +3 -0
- package/es/locale/ru_RU.d.ts +3 -0
- package/es/locale/zh_CN.d.ts +3 -0
- package/es/locale/zh_TW.d.ts +3 -0
- package/es/myform/index.d.ts +0 -0
- package/es/notification/Notify.d.ts +11 -0
- package/es/notification/NotifyContainer.d.ts +13 -0
- package/es/notification/NotifyContainer.js +3 -2
- package/es/notification/NotifyContainer.js.map +1 -1
- package/es/notification/NotifyContext.d.ts +23 -0
- package/es/notification/NotifyContext.js +3 -2
- package/es/notification/NotifyContext.js.map +1 -1
- package/es/notification/NotifyItem.d.ts +4 -0
- package/es/notification/NotifyItem.js +3 -2
- package/es/notification/NotifyItem.js.map +1 -1
- package/es/notification/index.d.ts +3 -0
- package/es/notification/index.js +3 -2
- package/es/notification/index.js.map +1 -1
- package/es/notification/style/css.d.ts +1 -0
- package/es/notification/style/index.d.ts +1 -0
- package/es/notification/type.d.ts +22 -0
- package/es/popup/Popup.d.ts +21 -0
- package/es/popup/Popup.js +36 -100
- package/es/popup/Popup.js.map +1 -1
- package/es/popup/defaultProps.d.ts +5 -0
- package/es/popup/hooks/useTrigger.d.ts +20 -0
- package/es/popup/index.d.ts +5 -0
- package/es/popup/index.js +8 -4
- package/es/popup/index.js.map +1 -1
- package/es/popup/style/css.d.ts +1 -0
- package/es/popup/style/index.d.ts +1 -0
- package/es/popup/type.d.ts +109 -0
- package/es/portal/Portal.d.ts +16 -0
- package/es/portal/Portal.js +2 -1
- package/es/portal/Portal.js.map +1 -1
- package/es/portal/index.d.ts +1 -0
- package/es/portal/index.js +2 -1
- package/es/portal/index.js.map +1 -1
- package/es/radio/Radio.d.ts +8 -0
- package/es/radio/Radio.js +22 -0
- package/es/radio/Radio.js.map +1 -0
- package/es/radio/RadioGroup.d.ts +14 -0
- package/es/radio/RadioGroup.js +22 -0
- package/es/radio/RadioGroup.js.map +1 -0
- package/es/radio/defaultProps.d.ts +3 -0
- package/es/radio/index.d.ts +10 -0
- package/es/radio/index.js +28 -0
- package/es/radio/index.js.map +1 -0
- package/es/radio/style/css.d.ts +0 -0
- package/es/radio/style/css.js +0 -0
- package/es/radio/style/index.css +333 -0
- package/es/radio/style/index.d.ts +1 -0
- package/es/radio/style/index.js +2 -0
- package/es/radio/style/index.js.map +1 -0
- package/es/radio/type.d.ts +117 -0
- package/es/radio/useKeyboard.d.ts +4 -0
- package/es/select/Option.d.ts +24 -0
- package/es/select/Option.js +3 -2
- package/es/select/Option.js.map +1 -1
- package/es/select/OptionGroup.d.ts +7 -0
- package/es/select/OptionGroup.js +4 -3
- package/es/select/OptionGroup.js.map +1 -1
- package/es/select/PopupContent.d.ts +24 -0
- package/es/select/PopupContent.js +6 -4
- package/es/select/PopupContent.js.map +1 -1
- package/es/select/Select.d.ts +13 -0
- package/es/select/Select.js +21 -12
- package/es/select/Select.js.map +1 -1
- package/es/select/defaultProps.d.ts +4 -0
- package/es/select/hooks/useOptions.d.ts +16 -0
- package/es/select/hooks/usePanelVirtualScroll.d.ts +24 -0
- package/es/select/index.d.ts +8 -0
- package/es/select/index.js +14 -8
- package/es/select/index.js.map +1 -1
- package/es/select/style/css.d.ts +1 -0
- package/es/select/style/index.d.ts +1 -0
- package/es/select/type.d.ts +344 -0
- package/es/select/utils/helper.d.ts +18 -0
- package/es/select-input/SelectInput.d.ts +11 -0
- package/es/select-input/SelectInput.js +10 -5
- package/es/select-input/SelectInput.js.map +1 -1
- package/es/select-input/defaultProps.d.ts +2 -0
- package/es/select-input/hook/useMultiple.d.ts +23 -0
- package/es/select-input/hook/useMultiple.js +7 -4
- package/es/select-input/hook/useMultiple.js.map +1 -1
- package/es/select-input/hook/useOverlayInnerStyle.d.ts +11 -0
- package/es/select-input/hook/useSingle.d.ts +16 -0
- package/es/select-input/hook/useSingle.js +5 -3
- package/es/select-input/hook/useSingle.js.map +1 -1
- package/es/select-input/index.d.ts +5 -0
- package/es/select-input/index.js +10 -5
- package/es/select-input/index.js.map +1 -1
- package/es/select-input/interface.d.ts +17 -0
- package/es/select-input/style/css.d.ts +1 -0
- package/es/select-input/style/index.d.ts +1 -0
- package/es/select-input/type.d.ts +243 -0
- package/es/slider/Slider.d.ts +7 -0
- package/es/slider/Slider.js +668 -0
- package/es/slider/Slider.js.map +1 -0
- package/es/slider/SliderHandleButton.d.ts +11 -0
- package/es/slider/SliderHandleButton.js +48 -0
- package/es/slider/SliderHandleButton.js.map +1 -0
- package/es/slider/defaultProps.d.ts +5 -0
- package/es/slider/index.d.ts +5 -0
- package/es/slider/index.js +46 -0
- package/es/slider/index.js.map +1 -0
- package/es/slider/style/css.d.ts +1 -0
- package/es/slider/style/css.js +1 -0
- package/es/slider/style/index.css +252 -0
- package/es/slider/style/index.d.ts +1 -0
- package/es/slider/style/index.js +2 -0
- package/es/slider/style/index.js.map +1 -0
- package/es/slider/type.d.ts +78 -0
- package/es/space/defaultProps.d.ts +0 -0
- package/es/space/index.d.ts +0 -0
- package/es/space/type.d.ts +0 -0
- package/es/style/index.css +24 -34
- package/es/style/index.d.ts +1 -0
- package/es/switch/Switch.d.ts +9 -0
- package/es/switch/Switch.js +9 -47
- package/es/switch/Switch.js.map +1 -1
- package/es/switch/defaultProps.d.ts +2 -0
- package/es/switch/index.d.ts +4 -0
- package/es/switch/index.js +8 -5
- package/es/switch/index.js.map +1 -1
- package/es/switch/style/css.d.ts +1 -0
- package/es/switch/style/index.d.ts +1 -0
- package/es/switch/type.d.ts +48 -0
- package/es/tab/TabBar.d.ts +9 -0
- package/es/tab/TabBar.js +109 -0
- package/es/tab/TabBar.js.map +1 -0
- package/es/tab/TabNav.d.ts +10 -0
- package/es/tab/TabNav.js +123 -0
- package/es/tab/TabNav.js.map +1 -0
- package/es/tab/TabNavItem.d.ts +15 -0
- package/es/tab/TabNavItem.js +65 -0
- package/es/tab/TabNavItem.js.map +1 -0
- package/es/tab/TabPanel.d.ts +9 -0
- package/es/tab/TabPanel.js +11 -0
- package/es/tab/TabPanel.js.map +1 -0
- package/es/tab/Tabs.d.ts +10 -0
- package/es/tab/Tabs.js +95 -0
- package/es/tab/Tabs.js.map +1 -0
- package/es/tab/defaultProps.d.ts +3 -0
- package/es/tab/index.d.ts +8 -0
- package/es/tab/index.js +31 -0
- package/es/tab/index.js.map +1 -0
- package/es/tab/style/index.css +159 -0
- package/es/tab/style/index.d.ts +1 -0
- package/es/tab/style/index.js +2 -0
- package/es/tab/style/index.js.map +1 -0
- package/es/tab/type.d.ts +130 -0
- package/es/tab/useTabClass.d.ts +8 -0
- package/es/table/Cell.d.ts +18 -0
- package/es/table/Cell.js +73 -0
- package/es/table/Cell.js.map +1 -0
- package/es/table/TBody.d.ts +28 -0
- package/es/table/TBody.js +70 -0
- package/es/table/TBody.js.map +1 -0
- package/es/table/THead.d.ts +10 -0
- package/es/table/THead.js +56 -0
- package/es/table/THead.js.map +1 -0
- package/es/table/TR.d.ts +28 -0
- package/es/table/TR.js +76 -0
- package/es/table/TR.js.map +1 -0
- package/es/table/Table.d.ts +6 -0
- package/es/table/Table.js +98 -0
- package/es/table/Table.js.map +1 -0
- package/es/table/defaultProps.d.ts +2 -0
- package/es/table/hooks/index.d.ts +4 -0
- package/es/table/hooks/index.js +98 -0
- package/es/table/hooks/index.js.map +1 -0
- package/es/table/hooks/useTableClassName.d.ts +26 -0
- package/es/table/hooks/useTableStyle.d.ts +11 -0
- package/es/table/index.d.ts +5 -0
- package/es/table/index.js +22 -0
- package/es/table/index.js.map +1 -0
- package/es/table/style/css.d.ts +1 -0
- package/es/table/style/css.js +1 -0
- package/es/table/style/index.css +139 -0
- package/es/table/style/index.d.ts +1 -0
- package/es/table/style/index.js +2 -0
- package/es/table/style/index.js.map +1 -0
- package/es/table/type.d.ts +195 -0
- package/es/tag/Tag.d.ts +14 -0
- package/es/tag/Tag.js +5 -1182
- package/es/tag/Tag.js.map +1 -1
- package/es/tag/defaultProps.d.ts +7 -0
- package/es/tag/index.d.ts +4 -0
- package/es/tag/index.js +5 -3
- package/es/tag/index.js.map +1 -1
- package/es/tag/style/css.d.ts +1 -0
- package/es/tag/style/index.d.ts +1 -0
- package/es/tag/type.d.ts +169 -0
- package/es/tag-input/TagInput.d.ts +9 -0
- package/es/tag-input/TagInput.js +7 -4
- package/es/tag-input/TagInput.js.map +1 -1
- package/es/tag-input/defaultProps.d.ts +2 -0
- package/es/tag-input/hooks/useHover.d.ts +17 -0
- package/es/tag-input/hooks/useTagList.d.ts +30 -0
- package/es/tag-input/hooks/useTagList.js +5 -3
- package/es/tag-input/hooks/useTagList.js.map +1 -1
- package/es/tag-input/hooks/useTagScroll.d.ts +25 -0
- package/es/tag-input/index.d.ts +5 -0
- package/es/tag-input/index.js +7 -4
- package/es/tag-input/index.js.map +1 -1
- package/es/tag-input/style/css.d.ts +1 -0
- package/es/tag-input/style/index.d.ts +1 -0
- package/es/tag-input/type.d.ts +235 -0
- package/es/tag-input/useTagList.d.ts +30 -0
- package/es/tag-input/useTagList.js +5 -3
- package/es/tag-input/useTagList.js.map +1 -1
- package/es/utils/composeRefs.d.ts +2 -0
- package/es/utils/dom.d.ts +7 -0
- package/es/utils/forwardRefWithStatics.d.ts +2 -0
- package/es/utils/getScrollbarWidth.d.ts +6 -0
- package/es/utils/helper.d.ts +46 -0
- package/es/utils/input-number/large-number.d.ts +85 -0
- package/es/utils/input-number/number.d.ts +81 -0
- package/es/utils/isFragment.d.ts +4 -0
- package/es/utils/listener.d.ts +4 -0
- package/es/utils/log/index.d.ts +2 -0
- package/es/utils/log/index.js +27 -0
- package/es/utils/log/index.js.map +1 -0
- package/es/utils/log/log.d.ts +3 -0
- package/es/utils/log/types.d.ts +8 -0
- package/es/utils/noop.d.ts +2 -0
- package/es/utils/number.d.ts +7 -0
- package/es/utils/parentTNode.d.ts +10 -0
- package/es/utils/parseTNode.d.ts +10 -0
- package/es/utils/react-render.d.ts +16 -0
- package/es/utils/ref.d.ts +1 -0
- package/es/utils/refs.d.ts +13 -0
- package/es/utils/scroll.d.ts +3 -0
- package/es/utils/style.d.ts +4 -0
- package/es/utils/transition.d.ts +20 -0
- package/package.json +60 -59
- package/LICENSE +0 -21
- package/es/_chunks/dep-0QH2Ee4R.js.map +0 -1
- package/es/_chunks/dep-BH5n5r1M.js.map +0 -1
- package/es/_chunks/dep-D7LanWes.js.map +0 -1
- package/es/_chunks/dep-DZ_0EvBk.js.map +0 -1
- package/es/_chunks/dep-Dk2xX8lh.js.map +0 -1
- package/es/_chunks/dep-EcrDKDlu.js.map +0 -1
- package/es/_chunks/dep-bWaVq_y3.js.map +0 -1
|
@@ -0,0 +1,764 @@
|
|
|
1
|
+
import { _ as _slicedToArray } from './dep-CzLhKWCf.js';
|
|
2
|
+
import { a as _classCallCheck, _ as _createClass } from './dep-Chz4ZJCb.js';
|
|
3
|
+
import { _ as _defineProperty } from './dep-Cwish4GD.js';
|
|
4
|
+
import { t as tinycolor } from './dep-zOZQ0R9g.js';
|
|
5
|
+
import { isString, isNull } from 'lodash-es';
|
|
6
|
+
|
|
7
|
+
var rgb2cmyk = function rgb2cmyk(red, green, blue) {
|
|
8
|
+
var computedC = 0;
|
|
9
|
+
var computedM = 0;
|
|
10
|
+
var computedY = 0;
|
|
11
|
+
var computedK = 0;
|
|
12
|
+
var r = parseInt("".concat(red).replace(/\s/g, ""), 10);
|
|
13
|
+
var g = parseInt("".concat(green).replace(/\s/g, ""), 10);
|
|
14
|
+
var b = parseInt("".concat(blue).replace(/\s/g, ""), 10);
|
|
15
|
+
if (r === 0 && g === 0 && b === 0) {
|
|
16
|
+
computedK = 1;
|
|
17
|
+
return [0, 0, 0, 1];
|
|
18
|
+
}
|
|
19
|
+
computedC = 1 - r / 255;
|
|
20
|
+
computedM = 1 - g / 255;
|
|
21
|
+
computedY = 1 - b / 255;
|
|
22
|
+
var minCMY = Math.min(computedC, Math.min(computedM, computedY));
|
|
23
|
+
computedC = (computedC - minCMY) / (1 - minCMY);
|
|
24
|
+
computedM = (computedM - minCMY) / (1 - minCMY);
|
|
25
|
+
computedY = (computedY - minCMY) / (1 - minCMY);
|
|
26
|
+
computedK = minCMY;
|
|
27
|
+
return [computedC, computedM, computedY, computedK];
|
|
28
|
+
};
|
|
29
|
+
var cmyk2rgb = function cmyk2rgb(cyan, magenta, yellow, black) {
|
|
30
|
+
var c = cyan / 100;
|
|
31
|
+
var m = magenta / 100;
|
|
32
|
+
var y = yellow / 100;
|
|
33
|
+
var k = black / 100;
|
|
34
|
+
c = c * (1 - k) + k;
|
|
35
|
+
m = m * (1 - k) + k;
|
|
36
|
+
y = y * (1 - k) + k;
|
|
37
|
+
var r = 1 - c;
|
|
38
|
+
var g = 1 - m;
|
|
39
|
+
var b = 1 - y;
|
|
40
|
+
r = Math.round(255 * r);
|
|
41
|
+
g = Math.round(255 * g);
|
|
42
|
+
b = Math.round(255 * b);
|
|
43
|
+
return {
|
|
44
|
+
r: r,
|
|
45
|
+
g: g,
|
|
46
|
+
b: b
|
|
47
|
+
};
|
|
48
|
+
};
|
|
49
|
+
var REG_CMYK_STRING = /cmyk\((\d+%?),(\d+%?),(\d+%?),(\d+%?)\)/;
|
|
50
|
+
var toNumber = function toNumber(str) {
|
|
51
|
+
return Math.max(0, Math.min(255, parseInt(str, 10)));
|
|
52
|
+
};
|
|
53
|
+
var cmykInputToColor = function cmykInputToColor(input) {
|
|
54
|
+
if (/cmyk/i.test(input)) {
|
|
55
|
+
var str = input.replace(/\s/g, "");
|
|
56
|
+
var match = str.match(REG_CMYK_STRING);
|
|
57
|
+
var c = toNumber(match[1]);
|
|
58
|
+
var m = toNumber(match[2]);
|
|
59
|
+
var y = toNumber(match[3]);
|
|
60
|
+
var k = toNumber(match[4]);
|
|
61
|
+
var _cmyk2rgb = cmyk2rgb(c, m, y, k),
|
|
62
|
+
r = _cmyk2rgb.r,
|
|
63
|
+
g = _cmyk2rgb.g,
|
|
64
|
+
b = _cmyk2rgb.b;
|
|
65
|
+
return "rgb(".concat(r, ", ").concat(g, ", ").concat(b, ")");
|
|
66
|
+
}
|
|
67
|
+
return input;
|
|
68
|
+
};
|
|
69
|
+
|
|
70
|
+
var TD_COLOR_USED_COLORS_MAX_SIZE = 100;
|
|
71
|
+
var COLOR_MODES = {
|
|
72
|
+
monochrome: "singleColor",
|
|
73
|
+
"linear-gradient": "gradientColor"
|
|
74
|
+
};
|
|
75
|
+
var DEFAULT_COLOR = "#001F97";
|
|
76
|
+
var DEFAULT_LINEAR_GRADIENT = "linear-gradient(90deg, rgba(241,29,0,1) 0%, rgba(73,106,220,1) 100%);";
|
|
77
|
+
var DEFAULT_SYSTEM_SWATCH_COLORS = ["#ECF2FE", "#D4E3FC", "#BBD3FB", "#96BBF8", "#699EF5", "#4787F0", "#266FE8", "#0052D9", "#0034B5", "#001F97", "#FDECEE", "#F9D7D9", "#F8B9BE", "#F78D94", "#F36D78", "#E34D59", "#C9353F", "#B11F26", "#951114", "#680506", "#FEF3E6", "#F9E0C7", "#F7C797", "#F2995F", "#ED7B2F", "#D35A21", "#BA431B", "#9E3610", "#842B0B", "#5A1907", "#E8F8F2", "#BCEBDC", "#85DBBE", "#48C79C", "#00A870", "#078D5C", "#067945", "#056334", "#044F2A", "#033017"];
|
|
78
|
+
var FORMATS = ["HEX", "RGB", "HSL", "HSV", "CMYK", "CSS"];
|
|
79
|
+
var ALPHA_FORMAT_MAP = {
|
|
80
|
+
HEX: "HEX8",
|
|
81
|
+
RGB: "RGBA",
|
|
82
|
+
HSL: "HSLA",
|
|
83
|
+
HSV: "HSVA"
|
|
84
|
+
};
|
|
85
|
+
var COLOR_FORMAT_INPUTS = {
|
|
86
|
+
RGB: [{
|
|
87
|
+
key: "r",
|
|
88
|
+
min: 0,
|
|
89
|
+
max: 255,
|
|
90
|
+
type: "inputNumber"
|
|
91
|
+
}, {
|
|
92
|
+
key: "g",
|
|
93
|
+
min: 0,
|
|
94
|
+
max: 255,
|
|
95
|
+
type: "inputNumber"
|
|
96
|
+
}, {
|
|
97
|
+
key: "b",
|
|
98
|
+
min: 0,
|
|
99
|
+
max: 255,
|
|
100
|
+
type: "inputNumber"
|
|
101
|
+
}],
|
|
102
|
+
HSV: [{
|
|
103
|
+
key: "h",
|
|
104
|
+
min: 0,
|
|
105
|
+
max: 360,
|
|
106
|
+
type: "inputNumber"
|
|
107
|
+
}, {
|
|
108
|
+
key: "s",
|
|
109
|
+
min: 0,
|
|
110
|
+
max: 100,
|
|
111
|
+
type: "inputNumber"
|
|
112
|
+
}, {
|
|
113
|
+
key: "v",
|
|
114
|
+
min: 0,
|
|
115
|
+
max: 100,
|
|
116
|
+
type: "inputNumber"
|
|
117
|
+
}],
|
|
118
|
+
HSL: [{
|
|
119
|
+
key: "h",
|
|
120
|
+
min: 0,
|
|
121
|
+
max: 360,
|
|
122
|
+
type: "inputNumber"
|
|
123
|
+
}, {
|
|
124
|
+
key: "s",
|
|
125
|
+
min: 0,
|
|
126
|
+
max: 100,
|
|
127
|
+
type: "inputNumber"
|
|
128
|
+
}, {
|
|
129
|
+
key: "l",
|
|
130
|
+
min: 0,
|
|
131
|
+
max: 100,
|
|
132
|
+
type: "inputNumber"
|
|
133
|
+
}],
|
|
134
|
+
CMYK: [{
|
|
135
|
+
key: "c",
|
|
136
|
+
min: 0,
|
|
137
|
+
max: 255,
|
|
138
|
+
type: "inputNumber"
|
|
139
|
+
}, {
|
|
140
|
+
key: "m",
|
|
141
|
+
min: 0,
|
|
142
|
+
max: 255,
|
|
143
|
+
type: "inputNumber"
|
|
144
|
+
}, {
|
|
145
|
+
key: "y",
|
|
146
|
+
min: 0,
|
|
147
|
+
max: 255,
|
|
148
|
+
type: "inputNumber"
|
|
149
|
+
}, {
|
|
150
|
+
key: "k",
|
|
151
|
+
min: 0,
|
|
152
|
+
max: 255,
|
|
153
|
+
type: "inputNumber"
|
|
154
|
+
}],
|
|
155
|
+
CSS: [{
|
|
156
|
+
key: "css",
|
|
157
|
+
type: "input",
|
|
158
|
+
flex: 3
|
|
159
|
+
}],
|
|
160
|
+
HEX: [{
|
|
161
|
+
key: "hex",
|
|
162
|
+
type: "input",
|
|
163
|
+
flex: 3
|
|
164
|
+
}]
|
|
165
|
+
};
|
|
166
|
+
var SATURATION_PANEL_DEFAULT_WIDTH = 230;
|
|
167
|
+
var SATURATION_PANEL_DEFAULT_HEIGHT = 168;
|
|
168
|
+
var SLIDER_DEFAULT_WIDTH = 186;
|
|
169
|
+
var GRADIENT_SLIDER_DEFAULT_WIDTH = 176;
|
|
170
|
+
|
|
171
|
+
var combineRegExp = function combineRegExp(regexpList, flags) {
|
|
172
|
+
var source = "";
|
|
173
|
+
for (var i = 0; i < regexpList.length; i++) {
|
|
174
|
+
if (isString(regexpList[i])) {
|
|
175
|
+
source += regexpList[i];
|
|
176
|
+
} else {
|
|
177
|
+
source += regexpList[i].source;
|
|
178
|
+
}
|
|
179
|
+
}
|
|
180
|
+
return new RegExp(source, flags);
|
|
181
|
+
};
|
|
182
|
+
var generateRegExp = function generateRegExp() {
|
|
183
|
+
var searchFlags = "gi";
|
|
184
|
+
var rAngle = /(?:[+-]?\d*\.?\d+)(?:deg|grad|rad|turn)/;
|
|
185
|
+
var rSideCornerCapture = /to\s+((?:(?:left|right|top|bottom)(?:\s+(?:top|bottom|left|right))?))/;
|
|
186
|
+
var rComma = /\s*,\s*/;
|
|
187
|
+
var rColorHex = /#(?:[a-f0-9]{6}|[a-f0-9]{3})/;
|
|
188
|
+
var rDigits3 = /\(\s*(?:\d{1,3}\s*,\s*){2}\d{1,3}\s*\)/;
|
|
189
|
+
var rDigits4 = /\(\s*(?:\d{1,3}\s*,\s*){2}\d{1,3}\s*,\s*\d*\.?\d+\)/;
|
|
190
|
+
var rValue = /(?:[+-]?\d*\.?\d+)(?:%|[a-z]+)?/;
|
|
191
|
+
var rKeyword = /[_a-z-][_a-z0-9-]*/;
|
|
192
|
+
var rColor = combineRegExp(["(?:", rColorHex, "|", "(?:rgb|hsl)", rDigits3, "|", "(?:rgba|hsla)", rDigits4, "|", rKeyword, ")"], "");
|
|
193
|
+
var rColorStop = combineRegExp([rColor, "(?:\\s+", rValue, "(?:\\s+", rValue, ")?)?"], "");
|
|
194
|
+
var rColorStopList = combineRegExp(["(?:", rColorStop, rComma, ")*", rColorStop], "");
|
|
195
|
+
var rLineCapture = combineRegExp(["(?:(", rAngle, ")|", rSideCornerCapture, ")"], "");
|
|
196
|
+
var rGradientSearch = combineRegExp(["(?:(", rLineCapture, ")", rComma, ")?(", rColorStopList, ")"], searchFlags);
|
|
197
|
+
var rColorStopSearch = combineRegExp(["\\s*(", rColor, ")", "(?:\\s+", "(", rValue, "))?", "(?:", rComma, "\\s*)?"], searchFlags);
|
|
198
|
+
return {
|
|
199
|
+
gradientSearch: rGradientSearch,
|
|
200
|
+
colorStopSearch: rColorStopSearch
|
|
201
|
+
};
|
|
202
|
+
};
|
|
203
|
+
var parseGradient = function parseGradient(regExpLib, input) {
|
|
204
|
+
var result;
|
|
205
|
+
var matchColorStop;
|
|
206
|
+
var stopResult;
|
|
207
|
+
regExpLib.gradientSearch.lastIndex = 0;
|
|
208
|
+
var matchGradient = regExpLib.gradientSearch.exec(input);
|
|
209
|
+
if (!isNull(matchGradient)) {
|
|
210
|
+
result = {
|
|
211
|
+
original: matchGradient[0],
|
|
212
|
+
colorStopList: []
|
|
213
|
+
};
|
|
214
|
+
if (matchGradient[1]) {
|
|
215
|
+
result.line = matchGradient[1];
|
|
216
|
+
}
|
|
217
|
+
if (matchGradient[2]) {
|
|
218
|
+
result.angle = matchGradient[2];
|
|
219
|
+
}
|
|
220
|
+
if (matchGradient[3]) {
|
|
221
|
+
result.sideCorner = matchGradient[3];
|
|
222
|
+
}
|
|
223
|
+
regExpLib.colorStopSearch.lastIndex = 0;
|
|
224
|
+
matchColorStop = regExpLib.colorStopSearch.exec(matchGradient[4]);
|
|
225
|
+
while (!isNull(matchColorStop)) {
|
|
226
|
+
stopResult = {
|
|
227
|
+
color: matchColorStop[1]
|
|
228
|
+
};
|
|
229
|
+
if (matchColorStop[2]) {
|
|
230
|
+
stopResult.position = matchColorStop[2];
|
|
231
|
+
}
|
|
232
|
+
result.colorStopList.push(stopResult);
|
|
233
|
+
matchColorStop = regExpLib.colorStopSearch.exec(matchGradient[4]);
|
|
234
|
+
}
|
|
235
|
+
}
|
|
236
|
+
return result;
|
|
237
|
+
};
|
|
238
|
+
var REGEXP_LIB = generateRegExp();
|
|
239
|
+
var REG_GRADIENT = /.*gradient\s*\(((?:\([^)]*\)|[^)(]*)*)\)/gim;
|
|
240
|
+
var isGradientColor = function isGradientColor(input) {
|
|
241
|
+
REG_GRADIENT.lastIndex = 0;
|
|
242
|
+
return REG_GRADIENT.exec(input);
|
|
243
|
+
};
|
|
244
|
+
var sideCornerDegreeMap = {
|
|
245
|
+
top: 0,
|
|
246
|
+
right: 90,
|
|
247
|
+
bottom: 180,
|
|
248
|
+
left: 270,
|
|
249
|
+
"top left": 315,
|
|
250
|
+
"left top": 315,
|
|
251
|
+
"top right": 45,
|
|
252
|
+
"right top": 45,
|
|
253
|
+
"bottom left": 225,
|
|
254
|
+
"left bottom": 225,
|
|
255
|
+
"bottom right": 135,
|
|
256
|
+
"right bottom": 135
|
|
257
|
+
};
|
|
258
|
+
var parseGradientString = function parseGradientString(input) {
|
|
259
|
+
var match = isGradientColor(input);
|
|
260
|
+
if (!match) return false;
|
|
261
|
+
var gradientColors = {
|
|
262
|
+
points: [],
|
|
263
|
+
degree: 0
|
|
264
|
+
};
|
|
265
|
+
var result = parseGradient(REGEXP_LIB, match[1]);
|
|
266
|
+
if (result.original.trim() !== match[1].trim()) return false;
|
|
267
|
+
var points = result.colorStopList.map(function (_ref, index, array) {
|
|
268
|
+
var color = _ref.color,
|
|
269
|
+
position = _ref.position;
|
|
270
|
+
var point = /* @__PURE__ */Object.create(null);
|
|
271
|
+
point.color = tinycolor(color).toRgbString();
|
|
272
|
+
var left = parseFloat(position);
|
|
273
|
+
if (Number.isNaN(left)) {
|
|
274
|
+
left = index / (array.length - 1) * 100;
|
|
275
|
+
}
|
|
276
|
+
point.left = left;
|
|
277
|
+
return point;
|
|
278
|
+
});
|
|
279
|
+
gradientColors.points = points;
|
|
280
|
+
var degree = parseInt(result.angle, 10);
|
|
281
|
+
if (Number.isNaN(degree)) {
|
|
282
|
+
degree = sideCornerDegreeMap[result.sideCorner] || 180;
|
|
283
|
+
}
|
|
284
|
+
gradientColors.degree = degree;
|
|
285
|
+
return gradientColors;
|
|
286
|
+
};
|
|
287
|
+
|
|
288
|
+
var _Color;
|
|
289
|
+
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
290
|
+
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
291
|
+
var mathRound = Math.round;
|
|
292
|
+
var hsv2rgba = function hsv2rgba(states) {
|
|
293
|
+
return tinycolor(states).toRgb();
|
|
294
|
+
};
|
|
295
|
+
var hsv2hsva = function hsv2hsva(states) {
|
|
296
|
+
return tinycolor(states).toHsv();
|
|
297
|
+
};
|
|
298
|
+
var hsv2hsla = function hsv2hsla(states) {
|
|
299
|
+
return tinycolor(states).toHsl();
|
|
300
|
+
};
|
|
301
|
+
var gradientColors2string = function gradientColors2string(object) {
|
|
302
|
+
var points = object.points,
|
|
303
|
+
degree = object.degree;
|
|
304
|
+
var colorsStop = points.sort(function (pA, pB) {
|
|
305
|
+
return pA.left - pB.left;
|
|
306
|
+
}).map(function (p) {
|
|
307
|
+
return "".concat(p.color, " ").concat(Math.round(p.left * 100) / 100, "%");
|
|
308
|
+
});
|
|
309
|
+
return "linear-gradient(".concat(degree, "deg,").concat(colorsStop.join(","), ")");
|
|
310
|
+
};
|
|
311
|
+
var getColorWithoutAlpha = function getColorWithoutAlpha(color) {
|
|
312
|
+
return tinycolor(color).setAlpha(1).toHexString();
|
|
313
|
+
};
|
|
314
|
+
var genId = function genId() {
|
|
315
|
+
return (1 + Math.random() * 4294967295).toString(16);
|
|
316
|
+
};
|
|
317
|
+
var genGradientPoint = function genGradientPoint(left, color, id) {
|
|
318
|
+
return {
|
|
319
|
+
id: id || genId(),
|
|
320
|
+
left: left,
|
|
321
|
+
color: color
|
|
322
|
+
};
|
|
323
|
+
};
|
|
324
|
+
var Color = /*#__PURE__*/function () {
|
|
325
|
+
function Color(input) {
|
|
326
|
+
_classCallCheck(this, Color);
|
|
327
|
+
_defineProperty(this, "states", {
|
|
328
|
+
s: 100,
|
|
329
|
+
v: 100,
|
|
330
|
+
h: 100,
|
|
331
|
+
a: 1
|
|
332
|
+
});
|
|
333
|
+
_defineProperty(this, "gradientStates", {
|
|
334
|
+
colors: [],
|
|
335
|
+
degree: 0,
|
|
336
|
+
selectedId: null,
|
|
337
|
+
css: ""
|
|
338
|
+
});
|
|
339
|
+
this.update(input);
|
|
340
|
+
}
|
|
341
|
+
return _createClass(Color, [{
|
|
342
|
+
key: "update",
|
|
343
|
+
value: function update(input) {
|
|
344
|
+
var _this = this;
|
|
345
|
+
if (input === this.originColor) return;
|
|
346
|
+
var gradientColors = parseGradientString(input);
|
|
347
|
+
if (this.isGradient && !gradientColors) {
|
|
348
|
+
var colorHsv = tinycolor(input).toHsv();
|
|
349
|
+
this.states = colorHsv;
|
|
350
|
+
this.updateCurrentGradientColor();
|
|
351
|
+
return;
|
|
352
|
+
}
|
|
353
|
+
this.originColor = input;
|
|
354
|
+
this.isGradient = false;
|
|
355
|
+
var colorInput = input;
|
|
356
|
+
if (gradientColors) {
|
|
357
|
+
var _points$, _this$gradientSelecte;
|
|
358
|
+
this.isGradient = true;
|
|
359
|
+
var object = gradientColors;
|
|
360
|
+
var points = object.points.map(function (c, index) {
|
|
361
|
+
var _this$gradientStates$;
|
|
362
|
+
return genGradientPoint(c.left, c.color, (_this$gradientStates$ = _this.gradientStates.colors[index]) === null || _this$gradientStates$ === void 0 ? void 0 : _this$gradientStates$.id);
|
|
363
|
+
});
|
|
364
|
+
this.gradientStates = {
|
|
365
|
+
colors: points,
|
|
366
|
+
degree: object.degree,
|
|
367
|
+
selectedId: this.gradientStates.selectedId || ((_points$ = points[0]) === null || _points$ === void 0 ? void 0 : _points$.id) || null
|
|
368
|
+
};
|
|
369
|
+
this.gradientStates.css = this.linearGradient;
|
|
370
|
+
colorInput = (_this$gradientSelecte = this.gradientSelectedPoint) === null || _this$gradientSelecte === void 0 ? void 0 : _this$gradientSelecte.color;
|
|
371
|
+
}
|
|
372
|
+
this.updateStates(colorInput);
|
|
373
|
+
}
|
|
374
|
+
}, {
|
|
375
|
+
key: "saturation",
|
|
376
|
+
get: function get() {
|
|
377
|
+
return this.states.s;
|
|
378
|
+
},
|
|
379
|
+
set: function set(value) {
|
|
380
|
+
this.states.s = Math.max(0, Math.min(100, value));
|
|
381
|
+
this.updateCurrentGradientColor();
|
|
382
|
+
}
|
|
383
|
+
}, {
|
|
384
|
+
key: "value",
|
|
385
|
+
get: function get() {
|
|
386
|
+
return this.states.v;
|
|
387
|
+
},
|
|
388
|
+
set: function set(value) {
|
|
389
|
+
this.states.v = Math.max(0, Math.min(100, value));
|
|
390
|
+
this.updateCurrentGradientColor();
|
|
391
|
+
}
|
|
392
|
+
}, {
|
|
393
|
+
key: "hue",
|
|
394
|
+
get: function get() {
|
|
395
|
+
return this.states.h;
|
|
396
|
+
},
|
|
397
|
+
set: function set(value) {
|
|
398
|
+
this.states.h = Math.max(0, Math.min(360, value));
|
|
399
|
+
this.updateCurrentGradientColor();
|
|
400
|
+
}
|
|
401
|
+
}, {
|
|
402
|
+
key: "alpha",
|
|
403
|
+
get: function get() {
|
|
404
|
+
return this.states.a;
|
|
405
|
+
},
|
|
406
|
+
set: function set(value) {
|
|
407
|
+
this.states.a = Math.max(0, Math.min(1, Math.round(value * 100) / 100));
|
|
408
|
+
this.updateCurrentGradientColor();
|
|
409
|
+
}
|
|
410
|
+
}, {
|
|
411
|
+
key: "rgb",
|
|
412
|
+
get: function get() {
|
|
413
|
+
var _hsv2rgba = hsv2rgba(this.states),
|
|
414
|
+
r = _hsv2rgba.r,
|
|
415
|
+
g = _hsv2rgba.g,
|
|
416
|
+
b = _hsv2rgba.b;
|
|
417
|
+
return "rgb(".concat(mathRound(r), ", ").concat(mathRound(g), ", ").concat(mathRound(b), ")");
|
|
418
|
+
}
|
|
419
|
+
}, {
|
|
420
|
+
key: "rgba",
|
|
421
|
+
get: function get() {
|
|
422
|
+
var _hsv2rgba2 = hsv2rgba(this.states),
|
|
423
|
+
r = _hsv2rgba2.r,
|
|
424
|
+
g = _hsv2rgba2.g,
|
|
425
|
+
b = _hsv2rgba2.b,
|
|
426
|
+
a = _hsv2rgba2.a;
|
|
427
|
+
return "rgba(".concat(mathRound(r), ", ").concat(mathRound(g), ", ").concat(mathRound(b), ", ").concat(a, ")");
|
|
428
|
+
}
|
|
429
|
+
}, {
|
|
430
|
+
key: "hsv",
|
|
431
|
+
get: function get() {
|
|
432
|
+
var _this$getHsva = this.getHsva(),
|
|
433
|
+
h = _this$getHsva.h,
|
|
434
|
+
s = _this$getHsva.s,
|
|
435
|
+
v = _this$getHsva.v;
|
|
436
|
+
return "hsv(".concat(h, ", ").concat(s, "%, ").concat(v, "%)");
|
|
437
|
+
}
|
|
438
|
+
}, {
|
|
439
|
+
key: "hsva",
|
|
440
|
+
get: function get() {
|
|
441
|
+
var _this$getHsva2 = this.getHsva(),
|
|
442
|
+
h = _this$getHsva2.h,
|
|
443
|
+
s = _this$getHsva2.s,
|
|
444
|
+
v = _this$getHsva2.v,
|
|
445
|
+
a = _this$getHsva2.a;
|
|
446
|
+
return "hsva(".concat(h, ", ").concat(s, "%, ").concat(v, "%, ").concat(a, ")");
|
|
447
|
+
}
|
|
448
|
+
}, {
|
|
449
|
+
key: "hsl",
|
|
450
|
+
get: function get() {
|
|
451
|
+
var _this$getHsla = this.getHsla(),
|
|
452
|
+
h = _this$getHsla.h,
|
|
453
|
+
s = _this$getHsla.s,
|
|
454
|
+
l = _this$getHsla.l;
|
|
455
|
+
return "hsl(".concat(h, ", ").concat(s, "%, ").concat(l, "%)");
|
|
456
|
+
}
|
|
457
|
+
}, {
|
|
458
|
+
key: "hsla",
|
|
459
|
+
get: function get() {
|
|
460
|
+
var _this$getHsla2 = this.getHsla(),
|
|
461
|
+
h = _this$getHsla2.h,
|
|
462
|
+
s = _this$getHsla2.s,
|
|
463
|
+
l = _this$getHsla2.l,
|
|
464
|
+
a = _this$getHsla2.a;
|
|
465
|
+
return "hsla(".concat(h, ", ").concat(s, "%, ").concat(l, "%, ").concat(a, ")");
|
|
466
|
+
}
|
|
467
|
+
}, {
|
|
468
|
+
key: "hex",
|
|
469
|
+
get: function get() {
|
|
470
|
+
return tinycolor(this.states).toHexString();
|
|
471
|
+
}
|
|
472
|
+
}, {
|
|
473
|
+
key: "hex8",
|
|
474
|
+
get: function get() {
|
|
475
|
+
return tinycolor(this.states).toHex8String();
|
|
476
|
+
}
|
|
477
|
+
}, {
|
|
478
|
+
key: "cmyk",
|
|
479
|
+
get: function get() {
|
|
480
|
+
var _this$getCmyk = this.getCmyk(),
|
|
481
|
+
c = _this$getCmyk.c,
|
|
482
|
+
m = _this$getCmyk.m,
|
|
483
|
+
y = _this$getCmyk.y,
|
|
484
|
+
k = _this$getCmyk.k;
|
|
485
|
+
return "cmyk(".concat(c, ", ").concat(m, ", ").concat(y, ", ").concat(k, ")");
|
|
486
|
+
}
|
|
487
|
+
}, {
|
|
488
|
+
key: "css",
|
|
489
|
+
get: function get() {
|
|
490
|
+
if (this.isGradient) {
|
|
491
|
+
return this.linearGradient;
|
|
492
|
+
}
|
|
493
|
+
return this.rgba;
|
|
494
|
+
}
|
|
495
|
+
}, {
|
|
496
|
+
key: "linearGradient",
|
|
497
|
+
get: function get() {
|
|
498
|
+
var gradientColors = this.gradientColors,
|
|
499
|
+
gradientDegree = this.gradientDegree;
|
|
500
|
+
return gradientColors2string({
|
|
501
|
+
points: gradientColors,
|
|
502
|
+
degree: gradientDegree
|
|
503
|
+
});
|
|
504
|
+
}
|
|
505
|
+
}, {
|
|
506
|
+
key: "gradientColors",
|
|
507
|
+
get: function get() {
|
|
508
|
+
return this.gradientStates.colors;
|
|
509
|
+
},
|
|
510
|
+
set: function set(colors) {
|
|
511
|
+
this.gradientStates.colors = colors;
|
|
512
|
+
this.gradientStates.css = this.linearGradient;
|
|
513
|
+
}
|
|
514
|
+
}, {
|
|
515
|
+
key: "gradientSelectedId",
|
|
516
|
+
get: function get() {
|
|
517
|
+
return this.gradientStates.selectedId;
|
|
518
|
+
},
|
|
519
|
+
set: function set(id) {
|
|
520
|
+
var _this$gradientSelecte2;
|
|
521
|
+
if (id === this.gradientSelectedId) {
|
|
522
|
+
return;
|
|
523
|
+
}
|
|
524
|
+
this.gradientStates.selectedId = id;
|
|
525
|
+
this.updateStates((_this$gradientSelecte2 = this.gradientSelectedPoint) === null || _this$gradientSelecte2 === void 0 ? void 0 : _this$gradientSelecte2.color);
|
|
526
|
+
}
|
|
527
|
+
}, {
|
|
528
|
+
key: "gradientDegree",
|
|
529
|
+
get: function get() {
|
|
530
|
+
return this.gradientStates.degree;
|
|
531
|
+
},
|
|
532
|
+
set: function set(degree) {
|
|
533
|
+
this.gradientStates.degree = Math.max(0, Math.min(360, degree));
|
|
534
|
+
this.gradientStates.css = this.linearGradient;
|
|
535
|
+
}
|
|
536
|
+
}, {
|
|
537
|
+
key: "gradientSelectedPoint",
|
|
538
|
+
get: function get() {
|
|
539
|
+
var gradientColors = this.gradientColors,
|
|
540
|
+
gradientSelectedId = this.gradientSelectedId;
|
|
541
|
+
return gradientColors.find(function (color) {
|
|
542
|
+
return color.id === gradientSelectedId;
|
|
543
|
+
});
|
|
544
|
+
}
|
|
545
|
+
}, {
|
|
546
|
+
key: "getFormatsColorMap",
|
|
547
|
+
value: function getFormatsColorMap() {
|
|
548
|
+
return {
|
|
549
|
+
HEX: this.hex,
|
|
550
|
+
CMYK: this.cmyk,
|
|
551
|
+
RGB: this.rgb,
|
|
552
|
+
RGBA: this.rgba,
|
|
553
|
+
HSL: this.hsl,
|
|
554
|
+
HSLA: this.hsla,
|
|
555
|
+
HSV: this.hsv,
|
|
556
|
+
HSVA: this.hsva,
|
|
557
|
+
CSS: this.css,
|
|
558
|
+
HEX8: this.hex8
|
|
559
|
+
};
|
|
560
|
+
}
|
|
561
|
+
}, {
|
|
562
|
+
key: "getFormattedColor",
|
|
563
|
+
value: function getFormattedColor(format, enableAlpha) {
|
|
564
|
+
if (this.isGradient) return this.linearGradient;
|
|
565
|
+
var finalFormat = enableAlpha && format in ALPHA_FORMAT_MAP ? ALPHA_FORMAT_MAP[format] : format;
|
|
566
|
+
return this.getFormatsColorMap()[finalFormat];
|
|
567
|
+
}
|
|
568
|
+
}, {
|
|
569
|
+
key: "updateCurrentGradientColor",
|
|
570
|
+
value: function updateCurrentGradientColor() {
|
|
571
|
+
var isGradient = this.isGradient,
|
|
572
|
+
gradientColors = this.gradientColors,
|
|
573
|
+
gradientSelectedId = this.gradientSelectedId;
|
|
574
|
+
var length = gradientColors.length;
|
|
575
|
+
var current = this.gradientSelectedPoint;
|
|
576
|
+
if (!isGradient || length === 0 || !current) {
|
|
577
|
+
return false;
|
|
578
|
+
}
|
|
579
|
+
var index = gradientColors.findIndex(function (color) {
|
|
580
|
+
return color.id === gradientSelectedId;
|
|
581
|
+
});
|
|
582
|
+
var newColor = _objectSpread(_objectSpread({}, current), {}, {
|
|
583
|
+
color: this.rgba
|
|
584
|
+
});
|
|
585
|
+
gradientColors.splice(index, 1, newColor);
|
|
586
|
+
this.gradientColors = gradientColors.slice();
|
|
587
|
+
return this;
|
|
588
|
+
}
|
|
589
|
+
}, {
|
|
590
|
+
key: "updateStates",
|
|
591
|
+
value: function updateStates(input) {
|
|
592
|
+
var color = tinycolor(cmykInputToColor(input));
|
|
593
|
+
var hsva = color.toHsv();
|
|
594
|
+
this.states = hsva;
|
|
595
|
+
}
|
|
596
|
+
}, {
|
|
597
|
+
key: "getRgba",
|
|
598
|
+
value: function getRgba() {
|
|
599
|
+
var _hsv2rgba3 = hsv2rgba(this.states),
|
|
600
|
+
r = _hsv2rgba3.r,
|
|
601
|
+
g = _hsv2rgba3.g,
|
|
602
|
+
b = _hsv2rgba3.b,
|
|
603
|
+
a = _hsv2rgba3.a;
|
|
604
|
+
return {
|
|
605
|
+
r: mathRound(r),
|
|
606
|
+
g: mathRound(g),
|
|
607
|
+
b: mathRound(b),
|
|
608
|
+
a: a
|
|
609
|
+
};
|
|
610
|
+
}
|
|
611
|
+
}, {
|
|
612
|
+
key: "getCmyk",
|
|
613
|
+
value: function getCmyk() {
|
|
614
|
+
var _this$getRgba = this.getRgba(),
|
|
615
|
+
r = _this$getRgba.r,
|
|
616
|
+
g = _this$getRgba.g,
|
|
617
|
+
b = _this$getRgba.b;
|
|
618
|
+
var _rgb2cmyk = rgb2cmyk(r, g, b),
|
|
619
|
+
_rgb2cmyk2 = _slicedToArray(_rgb2cmyk, 4),
|
|
620
|
+
c = _rgb2cmyk2[0],
|
|
621
|
+
m = _rgb2cmyk2[1],
|
|
622
|
+
y = _rgb2cmyk2[2],
|
|
623
|
+
k = _rgb2cmyk2[3];
|
|
624
|
+
return {
|
|
625
|
+
c: mathRound(c * 100),
|
|
626
|
+
m: mathRound(m * 100),
|
|
627
|
+
y: mathRound(y * 100),
|
|
628
|
+
k: mathRound(k * 100)
|
|
629
|
+
};
|
|
630
|
+
}
|
|
631
|
+
}, {
|
|
632
|
+
key: "getHsva",
|
|
633
|
+
value: function getHsva() {
|
|
634
|
+
var _hsv2hsva = hsv2hsva(this.states),
|
|
635
|
+
h = _hsv2hsva.h,
|
|
636
|
+
s = _hsv2hsva.s,
|
|
637
|
+
v = _hsv2hsva.v,
|
|
638
|
+
a = _hsv2hsva.a;
|
|
639
|
+
h = mathRound(h);
|
|
640
|
+
s = mathRound(s * 100);
|
|
641
|
+
v = mathRound(v * 100);
|
|
642
|
+
a *= 1;
|
|
643
|
+
return {
|
|
644
|
+
h: h,
|
|
645
|
+
s: s,
|
|
646
|
+
v: v,
|
|
647
|
+
a: a
|
|
648
|
+
};
|
|
649
|
+
}
|
|
650
|
+
}, {
|
|
651
|
+
key: "getHsla",
|
|
652
|
+
value: function getHsla() {
|
|
653
|
+
var _hsv2hsla = hsv2hsla(this.states),
|
|
654
|
+
h = _hsv2hsla.h,
|
|
655
|
+
s = _hsv2hsla.s,
|
|
656
|
+
l = _hsv2hsla.l,
|
|
657
|
+
a = _hsv2hsla.a;
|
|
658
|
+
h = mathRound(h);
|
|
659
|
+
s = mathRound(s * 100);
|
|
660
|
+
l = mathRound(l * 100);
|
|
661
|
+
a *= 1;
|
|
662
|
+
return {
|
|
663
|
+
h: h,
|
|
664
|
+
s: s,
|
|
665
|
+
l: l,
|
|
666
|
+
a: a
|
|
667
|
+
};
|
|
668
|
+
}
|
|
669
|
+
/**
|
|
670
|
+
* 判断输入色是否与当前色相同
|
|
671
|
+
*/
|
|
672
|
+
}, {
|
|
673
|
+
key: "equals",
|
|
674
|
+
value: function equals(color) {
|
|
675
|
+
return tinycolor.equals(this.rgba, color);
|
|
676
|
+
}
|
|
677
|
+
/**
|
|
678
|
+
* 校验输入色是否是一个有效颜色
|
|
679
|
+
* @param color
|
|
680
|
+
* @returns
|
|
681
|
+
*/
|
|
682
|
+
}], [{
|
|
683
|
+
key: "isValid",
|
|
684
|
+
value: function isValid(color) {
|
|
685
|
+
if (parseGradientString(color)) {
|
|
686
|
+
return true;
|
|
687
|
+
}
|
|
688
|
+
return tinycolor(color).isValid();
|
|
689
|
+
}
|
|
690
|
+
/**
|
|
691
|
+
* 对象转颜色字符串
|
|
692
|
+
*/
|
|
693
|
+
}, {
|
|
694
|
+
key: "object2color",
|
|
695
|
+
value: function object2color(object, format) {
|
|
696
|
+
if (format === "CMYK") {
|
|
697
|
+
var c = object.c,
|
|
698
|
+
m = object.m,
|
|
699
|
+
y = object.y,
|
|
700
|
+
k = object.k;
|
|
701
|
+
return "cmyk(".concat(c, ", ").concat(m, ", ").concat(y, ", ").concat(k, ")");
|
|
702
|
+
}
|
|
703
|
+
if (format === "RGB" || format === "RGBA") {
|
|
704
|
+
return tinycolor(object).toRgbString();
|
|
705
|
+
}
|
|
706
|
+
if (format === "HSL" || format === "HSLA") {
|
|
707
|
+
return tinycolor(object).toHslString();
|
|
708
|
+
}
|
|
709
|
+
if (format === "HSV" || format === "HSVA") {
|
|
710
|
+
return tinycolor(object).toHsvString();
|
|
711
|
+
}
|
|
712
|
+
return tinycolor(object).toHexString();
|
|
713
|
+
}
|
|
714
|
+
/**
|
|
715
|
+
* 是否是渐变色
|
|
716
|
+
* @param input
|
|
717
|
+
* @returns
|
|
718
|
+
*/
|
|
719
|
+
}]);
|
|
720
|
+
}();
|
|
721
|
+
_Color = Color;
|
|
722
|
+
_defineProperty(Color, "isGradientColor", function (input) {
|
|
723
|
+
return !!isGradientColor(input);
|
|
724
|
+
});
|
|
725
|
+
/**
|
|
726
|
+
* 比较两个颜色是否相同
|
|
727
|
+
* @param color1
|
|
728
|
+
* @param color2
|
|
729
|
+
* @returns
|
|
730
|
+
*/
|
|
731
|
+
_defineProperty(Color, "compare", function (color1, color2) {
|
|
732
|
+
var isGradientColor1 = _Color.isGradientColor(color1);
|
|
733
|
+
var isGradientColor2 = _Color.isGradientColor(color2);
|
|
734
|
+
if (isGradientColor1 && isGradientColor2) {
|
|
735
|
+
var gradientStr1 = parseGradientString(color1);
|
|
736
|
+
var gradientStr2 = parseGradientString(color2);
|
|
737
|
+
if (!gradientStr1 || !gradientStr2) return false;
|
|
738
|
+
var gradientColor1 = gradientColors2string(gradientStr1);
|
|
739
|
+
var gradientColor2 = gradientColors2string(gradientStr2);
|
|
740
|
+
return gradientColor1 === gradientColor2;
|
|
741
|
+
}
|
|
742
|
+
if (!isGradientColor1 && !isGradientColor2) {
|
|
743
|
+
return tinycolor.equals(color1, color2);
|
|
744
|
+
}
|
|
745
|
+
return false;
|
|
746
|
+
});
|
|
747
|
+
var COLOR_OBJECT_OUTPUT_KEYS = ["alpha", "css", "hex", "hex8", "hsl", "hsla", "hsv", "hsva", "rgb", "rgba", "saturation", "value", "isGradient"];
|
|
748
|
+
var getColorObject = function getColorObject(color) {
|
|
749
|
+
if (!color) {
|
|
750
|
+
return null;
|
|
751
|
+
}
|
|
752
|
+
console.log(color);
|
|
753
|
+
var colorObject = /* @__PURE__ */Object.create(null);
|
|
754
|
+
COLOR_OBJECT_OUTPUT_KEYS.forEach(function (key) {
|
|
755
|
+
colorObject[key] = color[key];
|
|
756
|
+
});
|
|
757
|
+
if (color.isGradient) {
|
|
758
|
+
colorObject.linearGradient = color.linearGradient;
|
|
759
|
+
}
|
|
760
|
+
return colorObject;
|
|
761
|
+
};
|
|
762
|
+
|
|
763
|
+
export { ALPHA_FORMAT_MAP as A, Color as C, DEFAULT_COLOR as D, FORMATS as F, GRADIENT_SLIDER_DEFAULT_WIDTH as G, SATURATION_PANEL_DEFAULT_WIDTH as S, TD_COLOR_USED_COLORS_MAX_SIZE as T, DEFAULT_SYSTEM_SWATCH_COLORS as a, COLOR_FORMAT_INPUTS as b, cmyk2rgb as c, cmykInputToColor as d, gradientColors2string as e, getColorWithoutAlpha as f, getColorObject as g, genId as h, genGradientPoint as i, COLOR_MODES as j, DEFAULT_LINEAR_GRADIENT as k, SATURATION_PANEL_DEFAULT_HEIGHT as l, SLIDER_DEFAULT_WIDTH as m, isGradientColor as n, parseGradientString as p, rgb2cmyk as r };
|
|
764
|
+
//# sourceMappingURL=dep-DJmE940f.js.map
|