@univerjs/design 0.2.6 → 0.2.7
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/lib/cjs/index.js +6 -6
- package/lib/es/index.js +319 -243
- package/lib/index.css +1 -1
- package/lib/types/components/checkbox/Checkbox.d.ts +1 -0
- package/lib/types/components/dialog/Dialog.d.ts +9 -0
- package/lib/types/components/input-number/InputNumber.d.ts +1 -1
- package/lib/types/components/tooltip/Tooltip.d.ts +1 -1
- package/lib/umd/index.js +6 -6
- package/package.json +7 -7
package/lib/es/index.js
CHANGED
|
@@ -650,7 +650,7 @@ const checkbox = "univer-checkbox", checkboxTargetInput = "univer-checkbox-targe
|
|
|
650
650
|
checkboxTarget
|
|
651
651
|
};
|
|
652
652
|
function Checkbox(props) {
|
|
653
|
-
const { children, className, style: style2, checked = !1, indeterminate = !1, value, disabled = !1, onChange } = props, inputRef = useRef(null);
|
|
653
|
+
const { children, className, style: style2, checked = !1, indeterminate = !1, value, disabled = !1, onChange, contentClassName } = props, inputRef = useRef(null);
|
|
654
654
|
function handleChange(e2) {
|
|
655
655
|
var _a3, _b;
|
|
656
656
|
if (e2.stopPropagation(), !(!onChange || disabled))
|
|
@@ -676,7 +676,7 @@ function Checkbox(props) {
|
|
|
676
676
|
disabled,
|
|
677
677
|
onChange: handleChange
|
|
678
678
|
}
|
|
679
|
-
), /* @__PURE__ */ React__default.createElement("span", { className: styles$q.checkboxTargetInner })), /* @__PURE__ */ React__default.createElement("span",
|
|
679
|
+
), /* @__PURE__ */ React__default.createElement("span", { className: styles$q.checkboxTargetInner })), /* @__PURE__ */ React__default.createElement("span", { className: contentClassName }, children));
|
|
680
680
|
}
|
|
681
681
|
__name(Checkbox, "Checkbox");
|
|
682
682
|
const checkboxGroup = "univer-checkbox-group", checkboxGroupDirectionVertical = "univer-checkbox-group-direction-vertical", styles$p = {
|
|
@@ -910,6 +910,7 @@ function _objectWithoutProperties$1(e2, t2) {
|
|
|
910
910
|
return i;
|
|
911
911
|
}
|
|
912
912
|
__name(_objectWithoutProperties$1, "_objectWithoutProperties$1");
|
|
913
|
+
const round = Math.round;
|
|
913
914
|
function splitColorStr(str, parseNum) {
|
|
914
915
|
const match2 = str.replace(/^[^(]*\((.*)/, "$1").replace(/\).*/, "").match(/\d*\.?\d+%?/g) || [], numList = match2.map((item) => parseFloat(item));
|
|
915
916
|
for (let i = 0; i < 3; i += 1)
|
|
@@ -917,67 +918,128 @@ function splitColorStr(str, parseNum) {
|
|
|
917
918
|
return match2[3] ? numList[3] = match2[3].includes("%") ? numList[3] / 100 : numList[3] : numList[3] = 1, numList;
|
|
918
919
|
}
|
|
919
920
|
__name(splitColorStr, "splitColorStr");
|
|
920
|
-
|
|
921
|
-
|
|
921
|
+
const parseHSVorHSL = /* @__PURE__ */ __name((num, _, index2) => index2 === 0 ? num : num / 100, "parseHSVorHSL");
|
|
922
|
+
function limitRange(value, max) {
|
|
923
|
+
const mergedMax = max || 255;
|
|
924
|
+
return value > mergedMax ? mergedMax : value < 0 ? 0 : value;
|
|
922
925
|
}
|
|
923
|
-
__name(
|
|
924
|
-
const
|
|
926
|
+
__name(limitRange, "limitRange");
|
|
927
|
+
const _FastColor = class _FastColor {
|
|
925
928
|
constructor(input2) {
|
|
926
|
-
|
|
927
|
-
|
|
928
|
-
|
|
929
|
+
/**
|
|
930
|
+
* All FastColor objects are valid. So isValid is always true. This property is kept to be compatible with TinyColor.
|
|
931
|
+
*/
|
|
932
|
+
__publicField(this, "isValid");
|
|
933
|
+
/**
|
|
934
|
+
* Red, R in RGB
|
|
935
|
+
*/
|
|
936
|
+
__publicField(this, "r", 0);
|
|
937
|
+
/**
|
|
938
|
+
* Green, G in RGB
|
|
939
|
+
*/
|
|
940
|
+
__publicField(this, "g", 0);
|
|
941
|
+
/**
|
|
942
|
+
* Blue, B in RGB
|
|
943
|
+
*/
|
|
944
|
+
__publicField(this, "b", 0);
|
|
945
|
+
/**
|
|
946
|
+
* Alpha/Opacity, A in RGBA/HSLA
|
|
947
|
+
*/
|
|
948
|
+
__publicField(this, "a", 1);
|
|
949
|
+
// HSV privates
|
|
950
|
+
__publicField(this, "_h");
|
|
951
|
+
__publicField(this, "_s");
|
|
952
|
+
__publicField(this, "_l");
|
|
953
|
+
__publicField(this, "_v");
|
|
954
|
+
// intermediate variables to calculate HSL/HSV
|
|
955
|
+
__publicField(this, "_max");
|
|
956
|
+
__publicField(this, "_min");
|
|
957
|
+
__publicField(this, "_brightness");
|
|
958
|
+
function matchFormat(str) {
|
|
959
|
+
return str[0] in input2 && str[1] in input2 && str[2] in input2;
|
|
960
|
+
}
|
|
961
|
+
if (__name(matchFormat, "matchFormat"), input2) if (typeof input2 == "string") {
|
|
929
962
|
let matchPrefix = function(prefix) {
|
|
930
963
|
return trimStr.startsWith(prefix);
|
|
931
964
|
};
|
|
932
965
|
__name(matchPrefix, "matchPrefix");
|
|
933
966
|
const trimStr = input2.trim();
|
|
934
967
|
/^#?[A-F\d]{3,8}$/i.test(trimStr) ? this.fromHexString(trimStr) : matchPrefix("rgb") ? this.fromRgbString(trimStr) : matchPrefix("hsl") ? this.fromHslString(trimStr) : (matchPrefix("hsv") || matchPrefix("hsb")) && this.fromHsvString(trimStr);
|
|
935
|
-
} else if (
|
|
936
|
-
this.r = input2.r, this.g = input2.g, this.b = input2.b, this.a =
|
|
937
|
-
else if ("
|
|
968
|
+
} else if (input2 instanceof _FastColor)
|
|
969
|
+
this.r = input2.r, this.g = input2.g, this.b = input2.b, this.a = input2.a, this._h = input2._h, this._s = input2._s, this._l = input2._l, this._v = input2._v;
|
|
970
|
+
else if (matchFormat("rgb"))
|
|
971
|
+
this.r = limitRange(input2.r), this.g = limitRange(input2.g), this.b = limitRange(input2.b), this.a = typeof input2.a == "number" ? limitRange(input2.a, 1) : 1;
|
|
972
|
+
else if (matchFormat("hsl"))
|
|
938
973
|
this.fromHsl(input2);
|
|
939
|
-
else if ("
|
|
974
|
+
else if (matchFormat("hsv"))
|
|
940
975
|
this.fromHsv(input2);
|
|
941
976
|
else
|
|
942
977
|
throw new Error("@ant-design/fast-color: unsupported input " + JSON.stringify(input2));
|
|
943
978
|
}
|
|
944
|
-
|
|
945
|
-
|
|
946
|
-
|
|
947
|
-
get h() {
|
|
948
|
-
return this.getHue();
|
|
979
|
+
// ======================= Setter =======================
|
|
980
|
+
setR(value) {
|
|
981
|
+
return this._sc("r", value);
|
|
949
982
|
}
|
|
950
|
-
|
|
951
|
-
|
|
952
|
-
*/
|
|
953
|
-
get s() {
|
|
954
|
-
return this.getSaturation();
|
|
983
|
+
setG(value) {
|
|
984
|
+
return this._sc("g", value);
|
|
955
985
|
}
|
|
956
|
-
|
|
957
|
-
|
|
958
|
-
|
|
959
|
-
|
|
960
|
-
return this.
|
|
986
|
+
setB(value) {
|
|
987
|
+
return this._sc("b", value);
|
|
988
|
+
}
|
|
989
|
+
setA(value) {
|
|
990
|
+
return this._sc("a", value, 1);
|
|
961
991
|
}
|
|
992
|
+
setHue(value) {
|
|
993
|
+
const hsv = this.toHsv();
|
|
994
|
+
return hsv.h = value, this._c(hsv);
|
|
995
|
+
}
|
|
996
|
+
// ======================= Getter =======================
|
|
962
997
|
/**
|
|
963
|
-
*
|
|
998
|
+
* Returns the perceived luminance of a color, from 0-1.
|
|
999
|
+
* @see http://www.w3.org/TR/2008/REC-WCAG20-20081211/#relativeluminancedef
|
|
964
1000
|
*/
|
|
965
|
-
|
|
966
|
-
|
|
1001
|
+
getLuminance() {
|
|
1002
|
+
function adjustGamma(raw) {
|
|
1003
|
+
const val = raw / 255;
|
|
1004
|
+
return val <= 0.03928 ? val / 12.92 : Math.pow((val + 0.055) / 1.055, 2.4);
|
|
1005
|
+
}
|
|
1006
|
+
__name(adjustGamma, "adjustGamma");
|
|
1007
|
+
const R = adjustGamma(this.r), G = adjustGamma(this.g), B = adjustGamma(this.b);
|
|
1008
|
+
return 0.2126 * R + 0.7152 * G + 0.0722 * B;
|
|
967
1009
|
}
|
|
968
|
-
|
|
969
|
-
|
|
1010
|
+
getHue() {
|
|
1011
|
+
if (typeof this._h > "u") {
|
|
1012
|
+
const delta = this.getMax() - this.getMin();
|
|
1013
|
+
delta === 0 ? this._h = 0 : this._h = round(60 * (this.r === this.getMax() ? (this.g - this.b) / delta + (this.g < this.b ? 6 : 0) : this.g === this.getMax() ? (this.b - this.r) / delta + 2 : (this.r - this.g) / delta + 4));
|
|
1014
|
+
}
|
|
1015
|
+
return this._h;
|
|
970
1016
|
}
|
|
971
|
-
|
|
972
|
-
|
|
1017
|
+
getSaturation() {
|
|
1018
|
+
if (typeof this._s > "u") {
|
|
1019
|
+
const delta = this.getMax() - this.getMin();
|
|
1020
|
+
delta === 0 ? this._s = 0 : this._s = delta / this.getMax();
|
|
1021
|
+
}
|
|
1022
|
+
return this._s;
|
|
973
1023
|
}
|
|
974
|
-
|
|
975
|
-
return this.
|
|
1024
|
+
getLightness() {
|
|
1025
|
+
return typeof this._l > "u" && (this._l = (this.getMax() + this.getMin()) / 510), this._l;
|
|
1026
|
+
}
|
|
1027
|
+
getValue() {
|
|
1028
|
+
return typeof this._v > "u" && (this._v = this.getMax() / 255), this._v;
|
|
1029
|
+
}
|
|
1030
|
+
/**
|
|
1031
|
+
* Returns the perceived brightness of the color, from 0-255.
|
|
1032
|
+
* Note: this is not the b of HSB
|
|
1033
|
+
* @see http://www.w3.org/TR/AERT#color-contrast
|
|
1034
|
+
*/
|
|
1035
|
+
getBrightness() {
|
|
1036
|
+
return typeof this._brightness > "u" && (this._brightness = (this.r * 299 + this.g * 587 + this.b * 114) / 1e3), this._brightness;
|
|
976
1037
|
}
|
|
1038
|
+
// ======================== Func ========================
|
|
977
1039
|
darken(amount = 10) {
|
|
978
1040
|
const h2 = this.getHue(), s = this.getSaturation();
|
|
979
1041
|
let l2 = this.getLightness() - amount / 100;
|
|
980
|
-
return l2 < 0 && (l2 = 0),
|
|
1042
|
+
return l2 < 0 && (l2 = 0), this._c({
|
|
981
1043
|
h: h2,
|
|
982
1044
|
s,
|
|
983
1045
|
l: l2,
|
|
@@ -987,13 +1049,26 @@ const parseHSVorHSL = /* @__PURE__ */ __name((num, _, index2) => index2 === 0 ?
|
|
|
987
1049
|
lighten(amount = 10) {
|
|
988
1050
|
const h2 = this.getHue(), s = this.getSaturation();
|
|
989
1051
|
let l2 = this.getLightness() + amount / 100;
|
|
990
|
-
return l2 > 1 && (l2 = 1),
|
|
1052
|
+
return l2 > 1 && (l2 = 1), this._c({
|
|
991
1053
|
h: h2,
|
|
992
1054
|
s,
|
|
993
1055
|
l: l2,
|
|
994
1056
|
a: this.a
|
|
995
1057
|
});
|
|
996
1058
|
}
|
|
1059
|
+
/**
|
|
1060
|
+
* Mix the current color a given amount with another color, from 0 to 100.
|
|
1061
|
+
* 0 means no mixing (return current color).
|
|
1062
|
+
*/
|
|
1063
|
+
mix(input2, amount = 50) {
|
|
1064
|
+
const color = this._c(input2), p2 = amount / 100, calc = /* @__PURE__ */ __name((key) => (color[key] - this[key]) * p2 + this[key], "calc"), rgba = {
|
|
1065
|
+
r: round(calc("r")),
|
|
1066
|
+
g: round(calc("g")),
|
|
1067
|
+
b: round(calc("b")),
|
|
1068
|
+
a: round(calc("a") * 100) / 100
|
|
1069
|
+
};
|
|
1070
|
+
return this._c(rgba);
|
|
1071
|
+
}
|
|
997
1072
|
/**
|
|
998
1073
|
* Mix the color with pure white, from 0 to 100.
|
|
999
1074
|
* Providing 0 will do nothing, providing 100 will always return white.
|
|
@@ -1018,76 +1093,30 @@ const parseHSVorHSL = /* @__PURE__ */ __name((num, _, index2) => index2 === 0 ?
|
|
|
1018
1093
|
a: 1
|
|
1019
1094
|
}, amount);
|
|
1020
1095
|
}
|
|
1021
|
-
|
|
1022
|
-
|
|
1023
|
-
|
|
1024
|
-
|
|
1025
|
-
|
|
1026
|
-
|
|
1027
|
-
|
|
1028
|
-
|
|
1029
|
-
b: (rgb2.b - rgb1.b) * p2 + rgb1.b,
|
|
1030
|
-
a: (rgb2.a - rgb1.a) * p2 + rgb1.a
|
|
1031
|
-
};
|
|
1032
|
-
return new _FastColor(rgba);
|
|
1033
|
-
}
|
|
1034
|
-
getAlpha() {
|
|
1035
|
-
return this.a;
|
|
1036
|
-
}
|
|
1037
|
-
/**
|
|
1038
|
-
* Returns the perceived luminance of a color, from 0-1.
|
|
1039
|
-
* @see http://www.w3.org/TR/2008/REC-WCAG20-20081211/#relativeluminancedef
|
|
1040
|
-
*/
|
|
1041
|
-
getLuminance() {
|
|
1042
|
-
let R, G, B;
|
|
1043
|
-
const RsRGB = this.r / 255, GsRGB = this.g / 255, BsRGB = this.b / 255;
|
|
1044
|
-
return RsRGB <= 0.03928 ? R = RsRGB / 12.92 : R = Math.pow((RsRGB + 0.055) / 1.055, 2.4), GsRGB <= 0.03928 ? G = GsRGB / 12.92 : G = Math.pow((GsRGB + 0.055) / 1.055, 2.4), BsRGB <= 0.03928 ? B = BsRGB / 12.92 : B = Math.pow((BsRGB + 0.055) / 1.055, 2.4), 0.2126 * R + 0.7152 * G + 0.0722 * B;
|
|
1045
|
-
}
|
|
1046
|
-
getHue() {
|
|
1047
|
-
if (typeof this._h > "u") {
|
|
1048
|
-
const delta = this.max - this.min;
|
|
1049
|
-
delta === 0 ? this._h = 0 : this._h = Math.round(60 * (this.r === this.max ? (this.g - this.b) / delta + (this.g < this.b ? 6 : 0) : this.g === this.max ? (this.b - this.r) / delta + 2 : (this.r - this.g) / delta + 4));
|
|
1050
|
-
}
|
|
1051
|
-
return this._h;
|
|
1052
|
-
}
|
|
1053
|
-
getSaturation() {
|
|
1054
|
-
if (typeof this._s > "u") {
|
|
1055
|
-
const delta = this.max - this.min;
|
|
1056
|
-
delta === 0 ? this._s = 0 : this._s = delta / this.max;
|
|
1057
|
-
}
|
|
1058
|
-
return this._s;
|
|
1059
|
-
}
|
|
1060
|
-
getLightness() {
|
|
1061
|
-
return typeof this._l > "u" && (this._l = (this.max + this.min) / 510), this._l;
|
|
1062
|
-
}
|
|
1063
|
-
getValue() {
|
|
1064
|
-
return typeof this._v > "u" && (this._v = this.max / 255), this._v;
|
|
1096
|
+
onBackground(background) {
|
|
1097
|
+
const bg = this._c(background), alpha = this.a + bg.a * (1 - this.a), calc = /* @__PURE__ */ __name((key) => round((this[key] * this.a + bg[key] * bg.a * (1 - this.a)) / alpha), "calc");
|
|
1098
|
+
return this._c({
|
|
1099
|
+
r: calc("r"),
|
|
1100
|
+
g: calc("g"),
|
|
1101
|
+
b: calc("b"),
|
|
1102
|
+
a: alpha
|
|
1103
|
+
});
|
|
1065
1104
|
}
|
|
1105
|
+
// ======================= Status =======================
|
|
1066
1106
|
isDark() {
|
|
1067
1107
|
return this.getBrightness() < 128;
|
|
1068
1108
|
}
|
|
1069
1109
|
isLight() {
|
|
1070
1110
|
return this.getBrightness() >= 128;
|
|
1071
1111
|
}
|
|
1072
|
-
|
|
1073
|
-
|
|
1074
|
-
|
|
1075
|
-
*/
|
|
1076
|
-
getBrightness() {
|
|
1077
|
-
return typeof this._brightness > "u" && (this._brightness = (this.r * 299 + this.g * 587 + this.b * 114) / 1e3), this._brightness;
|
|
1078
|
-
}
|
|
1079
|
-
onBackground(background) {
|
|
1080
|
-
const bg = new _FastColor(background), alpha = this.a + bg.a * (1 - this.a);
|
|
1081
|
-
return new _FastColor({
|
|
1082
|
-
r: Math.round((this.r * this.a + bg.r * bg.a * (1 - this.a)) / alpha),
|
|
1083
|
-
g: Math.round((this.g * this.a + bg.g * bg.a * (1 - this.a)) / alpha),
|
|
1084
|
-
b: Math.round((this.b * this.a + bg.b * bg.a * (1 - this.a)) / alpha),
|
|
1085
|
-
a: alpha
|
|
1086
|
-
});
|
|
1112
|
+
// ======================== MISC ========================
|
|
1113
|
+
equals(other) {
|
|
1114
|
+
return this.r === other.r && this.g === other.g && this.b === other.b && this.a === other.a;
|
|
1087
1115
|
}
|
|
1088
|
-
|
|
1089
|
-
return this.
|
|
1116
|
+
clone() {
|
|
1117
|
+
return this._c(this);
|
|
1090
1118
|
}
|
|
1119
|
+
// ======================= Format =======================
|
|
1091
1120
|
toHexString() {
|
|
1092
1121
|
let hex = "#";
|
|
1093
1122
|
const rHex = (this.r || 0).toString(16);
|
|
@@ -1096,28 +1125,31 @@ const parseHSVorHSL = /* @__PURE__ */ __name((num, _, index2) => index2 === 0 ?
|
|
|
1096
1125
|
hex += gHex.length === 2 ? gHex : "0" + gHex;
|
|
1097
1126
|
const bHex = (this.b || 0).toString(16);
|
|
1098
1127
|
if (hex += bHex.length === 2 ? bHex : "0" + bHex, typeof this.a == "number" && this.a >= 0 && this.a < 1) {
|
|
1099
|
-
const aHex =
|
|
1128
|
+
const aHex = round(this.a * 255).toString(16);
|
|
1100
1129
|
hex += aHex.length === 2 ? aHex : "0" + aHex;
|
|
1101
1130
|
}
|
|
1102
1131
|
return hex;
|
|
1103
1132
|
}
|
|
1133
|
+
/** CSS support color pattern */
|
|
1104
1134
|
toHsl() {
|
|
1105
1135
|
return {
|
|
1106
|
-
h: this.
|
|
1107
|
-
s: this.
|
|
1108
|
-
l: this.
|
|
1136
|
+
h: this.getHue(),
|
|
1137
|
+
s: this.getSaturation(),
|
|
1138
|
+
l: this.getLightness(),
|
|
1109
1139
|
a: this.a
|
|
1110
1140
|
};
|
|
1111
1141
|
}
|
|
1142
|
+
/** CSS support color pattern */
|
|
1112
1143
|
toHslString() {
|
|
1113
|
-
const h2 = this.
|
|
1144
|
+
const h2 = this.getHue(), s = round(this.getSaturation() * 100), l2 = round(this.getLightness() * 100);
|
|
1114
1145
|
return this.a !== 1 ? `hsla(${h2},${s}%,${l2}%,${this.a})` : `hsl(${h2},${s}%,${l2}%)`;
|
|
1115
1146
|
}
|
|
1147
|
+
/** Same as toHsb */
|
|
1116
1148
|
toHsv() {
|
|
1117
1149
|
return {
|
|
1118
|
-
h: this.
|
|
1119
|
-
s: this.
|
|
1120
|
-
v: this.
|
|
1150
|
+
h: this.getHue(),
|
|
1151
|
+
s: this.getSaturation(),
|
|
1152
|
+
v: this.getValue(),
|
|
1121
1153
|
a: this.a
|
|
1122
1154
|
};
|
|
1123
1155
|
}
|
|
@@ -1135,10 +1167,19 @@ const parseHSVorHSL = /* @__PURE__ */ __name((num, _, index2) => index2 === 0 ?
|
|
|
1135
1167
|
toString() {
|
|
1136
1168
|
return this.toRgbString();
|
|
1137
1169
|
}
|
|
1138
|
-
|
|
1170
|
+
// ====================== Privates ======================
|
|
1171
|
+
/** Return a new FastColor object with one channel changed */
|
|
1172
|
+
_sc(rgb, value, max) {
|
|
1173
|
+
const clone = this.clone();
|
|
1174
|
+
return clone[rgb] = limitRange(value, max), clone;
|
|
1175
|
+
}
|
|
1176
|
+
_c(input2) {
|
|
1177
|
+
return new this.constructor(input2);
|
|
1178
|
+
}
|
|
1179
|
+
getMax() {
|
|
1139
1180
|
return typeof this._max > "u" && (this._max = Math.max(this.r, this.g, this.b)), this._max;
|
|
1140
1181
|
}
|
|
1141
|
-
|
|
1182
|
+
getMin() {
|
|
1142
1183
|
return typeof this._min > "u" && (this._min = Math.min(this.r, this.g, this.b)), this._min;
|
|
1143
1184
|
}
|
|
1144
1185
|
fromHexString(trimStr) {
|
|
@@ -1155,13 +1196,14 @@ const parseHSVorHSL = /* @__PURE__ */ __name((num, _, index2) => index2 === 0 ?
|
|
|
1155
1196
|
a
|
|
1156
1197
|
}) {
|
|
1157
1198
|
if (this._h = h2 % 360, this._s = s, this._l = l2, this.a = typeof a == "number" ? a : 1, s <= 0) {
|
|
1158
|
-
const rgb =
|
|
1199
|
+
const rgb = round(l2 * 255);
|
|
1159
1200
|
this.r = rgb, this.g = rgb, this.b = rgb;
|
|
1160
1201
|
}
|
|
1202
|
+
let r = 0, g2 = 0, b2 = 0;
|
|
1161
1203
|
const huePrime = h2 / 60, chroma = (1 - Math.abs(2 * l2 - 1)) * s, secondComponent = chroma * (1 - Math.abs(huePrime % 2 - 1));
|
|
1162
|
-
|
|
1204
|
+
huePrime >= 0 && huePrime < 1 ? (r = chroma, g2 = secondComponent) : huePrime >= 1 && huePrime < 2 ? (r = secondComponent, g2 = chroma) : huePrime >= 2 && huePrime < 3 ? (g2 = chroma, b2 = secondComponent) : huePrime >= 3 && huePrime < 4 ? (g2 = secondComponent, b2 = chroma) : huePrime >= 4 && huePrime < 5 ? (r = secondComponent, b2 = chroma) : huePrime >= 5 && huePrime < 6 && (r = chroma, b2 = secondComponent);
|
|
1163
1205
|
const lightnessModification = l2 - chroma / 2;
|
|
1164
|
-
this.r =
|
|
1206
|
+
this.r = round((r + lightnessModification) * 255), this.g = round((g2 + lightnessModification) * 255), this.b = round((b2 + lightnessModification) * 255);
|
|
1165
1207
|
}
|
|
1166
1208
|
fromHsv({
|
|
1167
1209
|
h: h2,
|
|
@@ -1170,10 +1212,10 @@ const parseHSVorHSL = /* @__PURE__ */ __name((num, _, index2) => index2 === 0 ?
|
|
|
1170
1212
|
a
|
|
1171
1213
|
}) {
|
|
1172
1214
|
this._h = h2 % 360, this._s = s, this._v = v2, this.a = typeof a == "number" ? a : 1;
|
|
1173
|
-
const vv =
|
|
1215
|
+
const vv = round(v2 * 255);
|
|
1174
1216
|
if (this.r = vv, this.g = vv, this.b = vv, s <= 0)
|
|
1175
1217
|
return;
|
|
1176
|
-
const hh = h2 / 60, i = Math.floor(hh), ff = hh - i, p2 =
|
|
1218
|
+
const hh = h2 / 60, i = Math.floor(hh), ff = hh - i, p2 = round(v2 * (1 - s) * 255), q2 = round(v2 * (1 - s * ff) * 255), t2 = round(v2 * (1 - s * (1 - ff)) * 255);
|
|
1177
1219
|
switch (i) {
|
|
1178
1220
|
case 0:
|
|
1179
1221
|
this.g = t2, this.b = p2;
|
|
@@ -1196,8 +1238,8 @@ const parseHSVorHSL = /* @__PURE__ */ __name((num, _, index2) => index2 === 0 ?
|
|
|
1196
1238
|
break;
|
|
1197
1239
|
}
|
|
1198
1240
|
}
|
|
1199
|
-
fromHsvString(
|
|
1200
|
-
const cells = splitColorStr(
|
|
1241
|
+
fromHsvString(trimStr) {
|
|
1242
|
+
const cells = splitColorStr(trimStr, parseHSVorHSL);
|
|
1201
1243
|
this.fromHsv({
|
|
1202
1244
|
h: cells[0],
|
|
1203
1245
|
s: cells[1],
|
|
@@ -1205,8 +1247,8 @@ const parseHSVorHSL = /* @__PURE__ */ __name((num, _, index2) => index2 === 0 ?
|
|
|
1205
1247
|
a: cells[3]
|
|
1206
1248
|
});
|
|
1207
1249
|
}
|
|
1208
|
-
fromHslString(
|
|
1209
|
-
const cells = splitColorStr(
|
|
1250
|
+
fromHslString(trimStr) {
|
|
1251
|
+
const cells = splitColorStr(trimStr, parseHSVorHSL);
|
|
1210
1252
|
this.fromHsl({
|
|
1211
1253
|
h: cells[0],
|
|
1212
1254
|
s: cells[1],
|
|
@@ -1214,10 +1256,10 @@ const parseHSVorHSL = /* @__PURE__ */ __name((num, _, index2) => index2 === 0 ?
|
|
|
1214
1256
|
a: cells[3]
|
|
1215
1257
|
});
|
|
1216
1258
|
}
|
|
1217
|
-
fromRgbString(
|
|
1218
|
-
const cells = splitColorStr(
|
|
1259
|
+
fromRgbString(trimStr) {
|
|
1260
|
+
const cells = splitColorStr(trimStr, (num, txt) => (
|
|
1219
1261
|
// Convert percentage to number. e.g. 50% -> 128
|
|
1220
|
-
txt.includes("%") ?
|
|
1262
|
+
txt.includes("%") ? round(num / 100 * 255) : num
|
|
1221
1263
|
));
|
|
1222
1264
|
this.r = cells[0], this.g = cells[1], this.b = cells[2], this.a = cells[3];
|
|
1223
1265
|
}
|
|
@@ -1279,28 +1321,26 @@ var _excluded$x = ["b"], _excluded2$7 = ["v"], getRoundNumber = /* @__PURE__ */
|
|
|
1279
1321
|
b: bright >= 1 ? 1 : bright,
|
|
1280
1322
|
a: hsb.a
|
|
1281
1323
|
});
|
|
1282
|
-
}, "calculateColor"),
|
|
1283
|
-
var
|
|
1284
|
-
|
|
1285
|
-
|
|
1286
|
-
|
|
1287
|
-
|
|
1288
|
-
|
|
1289
|
-
|
|
1290
|
-
|
|
1291
|
-
|
|
1292
|
-
|
|
1293
|
-
|
|
1294
|
-
|
|
1295
|
-
|
|
1296
|
-
|
|
1297
|
-
|
|
1298
|
-
|
|
1299
|
-
|
|
1300
|
-
y: (1 - hsb.b) * height2 - centerOffsetY
|
|
1301
|
-
};
|
|
1324
|
+
}, "calculateColor"), calcOffset = /* @__PURE__ */ __name(function(color, type2) {
|
|
1325
|
+
var hsb = color.toHsb();
|
|
1326
|
+
switch (type2) {
|
|
1327
|
+
case "hue":
|
|
1328
|
+
return {
|
|
1329
|
+
x: hsb.h / 360 * 100,
|
|
1330
|
+
y: 50
|
|
1331
|
+
};
|
|
1332
|
+
case "alpha":
|
|
1333
|
+
return {
|
|
1334
|
+
x: color.a * 100,
|
|
1335
|
+
y: 50
|
|
1336
|
+
};
|
|
1337
|
+
default:
|
|
1338
|
+
return {
|
|
1339
|
+
x: hsb.s * 100,
|
|
1340
|
+
y: (1 - hsb.b) * 100
|
|
1341
|
+
};
|
|
1302
1342
|
}
|
|
1303
|
-
}, "
|
|
1343
|
+
}, "calcOffset"), classnames = { exports: {} };
|
|
1304
1344
|
/*!
|
|
1305
1345
|
Copyright (c) 2018 Jed Watson.
|
|
1306
1346
|
Licensed under the MIT License (MIT), see
|
|
@@ -1362,36 +1402,31 @@ function getPosition(e2) {
|
|
|
1362
1402
|
}
|
|
1363
1403
|
__name(getPosition, "getPosition");
|
|
1364
1404
|
function useColorDrag(props) {
|
|
1365
|
-
var
|
|
1405
|
+
var targetRef = props.targetRef, containerRef = props.containerRef, direction = props.direction, onDragChange = props.onDragChange, onDragChangeComplete = props.onDragChangeComplete, calculate = props.calculate, color = props.color, disabledDrag = props.disabledDrag, _useState = useState({
|
|
1366
1406
|
x: 0,
|
|
1367
1407
|
y: 0
|
|
1368
|
-
}), _useState2 = _slicedToArray$1(_useState, 2), offsetValue = _useState2[0], setOffsetValue = _useState2[1], mouseMoveRef = useRef(null), mouseUpRef = useRef(null)
|
|
1369
|
-
flag: !1
|
|
1370
|
-
});
|
|
1408
|
+
}), _useState2 = _slicedToArray$1(_useState, 2), offsetValue = _useState2[0], setOffsetValue = _useState2[1], mouseMoveRef = useRef(null), mouseUpRef = useRef(null);
|
|
1371
1409
|
useEffect(function() {
|
|
1372
|
-
|
|
1373
|
-
|
|
1374
|
-
calcOffset && setOffsetValue(calcOffset);
|
|
1375
|
-
}
|
|
1376
|
-
}, [color, containerRef]), useEffect(function() {
|
|
1410
|
+
setOffsetValue(calculate());
|
|
1411
|
+
}, [color]), useEffect(function() {
|
|
1377
1412
|
return function() {
|
|
1378
1413
|
document.removeEventListener("mousemove", mouseMoveRef.current), document.removeEventListener("mouseup", mouseUpRef.current), document.removeEventListener("touchmove", mouseMoveRef.current), document.removeEventListener("touchend", mouseUpRef.current), mouseMoveRef.current = null, mouseUpRef.current = null;
|
|
1379
1414
|
};
|
|
1380
1415
|
}, []);
|
|
1381
1416
|
var updateOffset = /* @__PURE__ */ __name(function(e2) {
|
|
1382
|
-
var _getPosition = getPosition(e2), pageX = _getPosition.pageX, pageY = _getPosition.pageY, _containerRef$current = containerRef.current.getBoundingClientRect(), rectX = _containerRef$current.x, rectY = _containerRef$current.y, width2 = _containerRef$current.width, height2 = _containerRef$current.height, _targetRef$current$ge = targetRef.current.getBoundingClientRect(), targetWidth = _targetRef$current$ge.width, targetHeight = _targetRef$current$ge.height, centerOffsetX = targetWidth / 2, centerOffsetY = targetHeight / 2, offsetX = Math.max(0, Math.min(pageX - rectX, width2)) - centerOffsetX, offsetY = Math.max(0, Math.min(pageY - rectY, height2)) - centerOffsetY,
|
|
1417
|
+
var _getPosition = getPosition(e2), pageX = _getPosition.pageX, pageY = _getPosition.pageY, _containerRef$current = containerRef.current.getBoundingClientRect(), rectX = _containerRef$current.x, rectY = _containerRef$current.y, width2 = _containerRef$current.width, height2 = _containerRef$current.height, _targetRef$current$ge = targetRef.current.getBoundingClientRect(), targetWidth = _targetRef$current$ge.width, targetHeight = _targetRef$current$ge.height, centerOffsetX = targetWidth / 2, centerOffsetY = targetHeight / 2, offsetX = Math.max(0, Math.min(pageX - rectX, width2)) - centerOffsetX, offsetY = Math.max(0, Math.min(pageY - rectY, height2)) - centerOffsetY, calcOffset3 = {
|
|
1383
1418
|
x: offsetX,
|
|
1384
1419
|
y: direction === "x" ? offsetValue.y : offsetY
|
|
1385
1420
|
};
|
|
1386
1421
|
if (targetWidth === 0 && targetHeight === 0 || targetWidth !== targetHeight)
|
|
1387
1422
|
return !1;
|
|
1388
|
-
|
|
1423
|
+
onDragChange == null || onDragChange(calcOffset3);
|
|
1389
1424
|
}, "updateOffset"), onDragMove = /* @__PURE__ */ __name(function(e2) {
|
|
1390
1425
|
e2.preventDefault(), updateOffset(e2);
|
|
1391
1426
|
}, "onDragMove"), onDragStop = /* @__PURE__ */ __name(function(e2) {
|
|
1392
|
-
e2.preventDefault(),
|
|
1427
|
+
e2.preventDefault(), document.removeEventListener("mousemove", mouseMoveRef.current), document.removeEventListener("mouseup", mouseUpRef.current), document.removeEventListener("touchmove", mouseMoveRef.current), document.removeEventListener("touchend", mouseUpRef.current), mouseMoveRef.current = null, mouseUpRef.current = null, onDragChangeComplete == null || onDragChangeComplete();
|
|
1393
1428
|
}, "onDragStop"), onDragStart = /* @__PURE__ */ __name(function(e2) {
|
|
1394
|
-
document.removeEventListener("mousemove", mouseMoveRef.current), document.removeEventListener("mouseup", mouseUpRef.current), !disabledDrag && (updateOffset(e2),
|
|
1429
|
+
document.removeEventListener("mousemove", mouseMoveRef.current), document.removeEventListener("mouseup", mouseUpRef.current), !disabledDrag && (updateOffset(e2), document.addEventListener("mousemove", onDragMove), document.addEventListener("mouseup", onDragStop), document.addEventListener("touchmove", onDragMove), document.addEventListener("touchend", onDragStop), mouseMoveRef.current = onDragMove, mouseUpRef.current = onDragStop);
|
|
1395
1430
|
}, "onDragStart");
|
|
1396
1431
|
return [offsetValue, onDragStart];
|
|
1397
1432
|
}
|
|
@@ -1439,19 +1474,19 @@ function useSafeState(defaultValue) {
|
|
|
1439
1474
|
return __name(safeSetState, "safeSetState"), [value, safeSetState];
|
|
1440
1475
|
}
|
|
1441
1476
|
__name(useSafeState, "useSafeState");
|
|
1442
|
-
function hasValue$
|
|
1477
|
+
function hasValue$1(value) {
|
|
1443
1478
|
return value !== void 0;
|
|
1444
1479
|
}
|
|
1445
|
-
__name(hasValue$
|
|
1480
|
+
__name(hasValue$1, "hasValue$1");
|
|
1446
1481
|
function useMergedState(defaultStateValue, option) {
|
|
1447
1482
|
var _ref = option || {}, defaultValue = _ref.defaultValue, value = _ref.value, onChange = _ref.onChange, postState = _ref.postState, _useState = useSafeState(function() {
|
|
1448
|
-
return hasValue$
|
|
1483
|
+
return hasValue$1(value) ? value : hasValue$1(defaultValue) ? typeof defaultValue == "function" ? defaultValue() : defaultValue : typeof defaultStateValue == "function" ? defaultStateValue() : defaultStateValue;
|
|
1449
1484
|
}), _useState2 = _slicedToArray$1(_useState, 2), innerValue = _useState2[0], setInnerValue = _useState2[1], mergedValue = value !== void 0 ? value : innerValue, postMergedValue = postState ? postState(mergedValue) : mergedValue, onChangeFn = useEvent(onChange), _useState3 = useSafeState([mergedValue]), _useState4 = _slicedToArray$1(_useState3, 2), prevValue = _useState4[0], setPrevValue = _useState4[1];
|
|
1450
1485
|
useLayoutUpdateEffect(function() {
|
|
1451
1486
|
var prev = prevValue[0];
|
|
1452
1487
|
innerValue !== prev && onChangeFn(innerValue, prev);
|
|
1453
1488
|
}, [prevValue]), useLayoutUpdateEffect(function() {
|
|
1454
|
-
hasValue$
|
|
1489
|
+
hasValue$1(value) || setInnerValue(value);
|
|
1455
1490
|
}, [value]);
|
|
1456
1491
|
var triggerChange = useEvent(function(updater, ignoreDestroy) {
|
|
1457
1492
|
setInnerValue(updater, ignoreDestroy), setPrevValue([mergedValue], ignoreDestroy);
|
|
@@ -1662,14 +1697,15 @@ var Handler = /* @__PURE__ */ __name(function(_ref) {
|
|
|
1662
1697
|
}, style2)
|
|
1663
1698
|
}, children);
|
|
1664
1699
|
}, "Palette"), Transform = /* @__PURE__ */ forwardRef(function(props, ref) {
|
|
1665
|
-
var children = props.children,
|
|
1700
|
+
var children = props.children, x = props.x, y = props.y;
|
|
1666
1701
|
return /* @__PURE__ */ React__default.createElement("div", {
|
|
1667
1702
|
ref,
|
|
1668
1703
|
style: {
|
|
1669
1704
|
position: "absolute",
|
|
1670
|
-
left:
|
|
1671
|
-
top:
|
|
1672
|
-
zIndex: 1
|
|
1705
|
+
left: "".concat(x, "%"),
|
|
1706
|
+
top: "".concat(y, "%"),
|
|
1707
|
+
zIndex: 1,
|
|
1708
|
+
transform: "translate(-50%, -50%)"
|
|
1673
1709
|
}
|
|
1674
1710
|
}, children);
|
|
1675
1711
|
}), Picker$1 = /* @__PURE__ */ __name(function(_ref) {
|
|
@@ -1685,8 +1721,8 @@ var Handler = /* @__PURE__ */ __name(function(_ref) {
|
|
|
1685
1721
|
color,
|
|
1686
1722
|
containerRef: pickerRef,
|
|
1687
1723
|
targetRef: transformRef,
|
|
1688
|
-
calculate: /* @__PURE__ */ __name(function(
|
|
1689
|
-
return
|
|
1724
|
+
calculate: /* @__PURE__ */ __name(function() {
|
|
1725
|
+
return calcOffset(color);
|
|
1690
1726
|
}, "calculate"),
|
|
1691
1727
|
onDragChange,
|
|
1692
1728
|
onDragChangeComplete: /* @__PURE__ */ __name(function() {
|
|
@@ -1702,7 +1738,8 @@ var Handler = /* @__PURE__ */ __name(function(_ref) {
|
|
|
1702
1738
|
}, /* @__PURE__ */ React__default.createElement(Palette, {
|
|
1703
1739
|
prefixCls
|
|
1704
1740
|
}, /* @__PURE__ */ React__default.createElement(Transform, {
|
|
1705
|
-
|
|
1741
|
+
x: offset2.x,
|
|
1742
|
+
y: offset2.y,
|
|
1706
1743
|
ref: transformRef
|
|
1707
1744
|
}, /* @__PURE__ */ React__default.createElement(Handler, {
|
|
1708
1745
|
color: color.toRgbString(),
|
|
@@ -1714,24 +1751,18 @@ var Handler = /* @__PURE__ */ __name(function(_ref) {
|
|
|
1714
1751
|
backgroundImage: "linear-gradient(0deg, #000, transparent),linear-gradient(90deg, #fff, hsla(0, 0%, 100%, 0))"
|
|
1715
1752
|
}
|
|
1716
1753
|
})));
|
|
1717
|
-
}, "Picker")
|
|
1718
|
-
|
|
1719
|
-
|
|
1720
|
-
}
|
|
1721
|
-
|
|
1722
|
-
|
|
1723
|
-
|
|
1724
|
-
var mergeState;
|
|
1725
|
-
return hasValue$1(value) ? mergeState = value : hasValue$1(defaultValue) ? mergeState = defaultValue : mergeState = defaultStateValue, generateColor(mergeState);
|
|
1726
|
-
}), _useState2 = _slicedToArray$1(_useState, 2), colorValue = _useState2[0], setColorValue = _useState2[1];
|
|
1727
|
-
return useEffect(function() {
|
|
1728
|
-
value && setColorValue(generateColor(value));
|
|
1729
|
-
}, [value]), [colorValue, setColorValue];
|
|
1754
|
+
}, "Picker"), useColorState = /* @__PURE__ */ __name(function(defaultValue, value) {
|
|
1755
|
+
var _useMergedState = useMergedState(defaultValue, {
|
|
1756
|
+
value
|
|
1757
|
+
}), _useMergedState2 = _slicedToArray$1(_useMergedState, 2), mergedValue = _useMergedState2[0], setValue = _useMergedState2[1], color = useMemo$1(function() {
|
|
1758
|
+
return generateColor(mergedValue);
|
|
1759
|
+
}, [mergedValue]);
|
|
1760
|
+
return [color, setValue];
|
|
1730
1761
|
}, "useColorState"), Gradient = /* @__PURE__ */ __name(function(_ref) {
|
|
1731
1762
|
var colors = _ref.colors, children = _ref.children, _ref$direction = _ref.direction, direction = _ref$direction === void 0 ? "to right" : _ref$direction, type2 = _ref.type, prefixCls = _ref.prefixCls, gradientColors = useMemo$1(function() {
|
|
1732
1763
|
return colors.map(function(color, idx) {
|
|
1733
1764
|
var result = generateColor(color);
|
|
1734
|
-
return type2 === "alpha" && idx === colors.length - 1 && result.
|
|
1765
|
+
return type2 === "alpha" && idx === colors.length - 1 && (result = new Color(result.setA(1))), result.toRgbString();
|
|
1735
1766
|
}).join(",");
|
|
1736
1767
|
}, [colors, type2]);
|
|
1737
1768
|
return /* @__PURE__ */ React__default.createElement("div", {
|
|
@@ -1744,7 +1775,7 @@ var useColorState = /* @__PURE__ */ __name(function(defaultStateValue, option) {
|
|
|
1744
1775
|
}, children);
|
|
1745
1776
|
}, "Gradient"), Slider$1 = /* @__PURE__ */ __name(function(props) {
|
|
1746
1777
|
var prefixCls = props.prefixCls, colors = props.colors, disabled = props.disabled, onChange = props.onChange, onChangeComplete = props.onChangeComplete, color = props.color, type2 = props.type, sliderRef = useRef(), transformRef = useRef(), colorRef = useRef(color), getValue = /* @__PURE__ */ __name(function(c2) {
|
|
1747
|
-
return type2 === "hue" ? c2.getHue() : c2.
|
|
1778
|
+
return type2 === "hue" ? c2.getHue() : c2.a * 100;
|
|
1748
1779
|
}, "getValue"), onDragChange = useEvent(function(offsetValue) {
|
|
1749
1780
|
var calcColor = calculateColor({
|
|
1750
1781
|
offset: offsetValue,
|
|
@@ -1758,8 +1789,8 @@ var useColorState = /* @__PURE__ */ __name(function(defaultStateValue, option) {
|
|
|
1758
1789
|
color,
|
|
1759
1790
|
targetRef: transformRef,
|
|
1760
1791
|
containerRef: sliderRef,
|
|
1761
|
-
calculate: /* @__PURE__ */ __name(function(
|
|
1762
|
-
return
|
|
1792
|
+
calculate: /* @__PURE__ */ __name(function() {
|
|
1793
|
+
return calcOffset(color, type2);
|
|
1763
1794
|
}, "calculate"),
|
|
1764
1795
|
onDragChange,
|
|
1765
1796
|
onDragChangeComplete: /* @__PURE__ */ __name(function() {
|
|
@@ -1767,7 +1798,15 @@ var useColorState = /* @__PURE__ */ __name(function(defaultStateValue, option) {
|
|
|
1767
1798
|
}, "onDragChangeComplete"),
|
|
1768
1799
|
direction: "x",
|
|
1769
1800
|
disabledDrag: disabled
|
|
1770
|
-
}), _useColorDrag2 = _slicedToArray$1(_useColorDrag, 2), offset2 = _useColorDrag2[0], dragStartHandle = _useColorDrag2[1],
|
|
1801
|
+
}), _useColorDrag2 = _slicedToArray$1(_useColorDrag, 2), offset2 = _useColorDrag2[0], dragStartHandle = _useColorDrag2[1], handleColor = React__default.useMemo(function() {
|
|
1802
|
+
if (type2 === "hue") {
|
|
1803
|
+
var hsb = color.toHsb();
|
|
1804
|
+
hsb.s = 1, hsb.b = 1, hsb.a = 1;
|
|
1805
|
+
var lightColor = new Color(hsb);
|
|
1806
|
+
return lightColor;
|
|
1807
|
+
}
|
|
1808
|
+
return color;
|
|
1809
|
+
}, [color, type2]), gradientList = React__default.useMemo(function() {
|
|
1771
1810
|
return colors.map(function(info) {
|
|
1772
1811
|
return "".concat(info.color, " ").concat(info.percent, "%");
|
|
1773
1812
|
});
|
|
@@ -1780,11 +1819,12 @@ var useColorState = /* @__PURE__ */ __name(function(defaultStateValue, option) {
|
|
|
1780
1819
|
}, /* @__PURE__ */ React__default.createElement(Palette, {
|
|
1781
1820
|
prefixCls
|
|
1782
1821
|
}, /* @__PURE__ */ React__default.createElement(Transform, {
|
|
1783
|
-
|
|
1822
|
+
x: offset2.x,
|
|
1823
|
+
y: offset2.y,
|
|
1784
1824
|
ref: transformRef
|
|
1785
1825
|
}, /* @__PURE__ */ React__default.createElement(Handler, {
|
|
1786
1826
|
size: "small",
|
|
1787
|
-
color:
|
|
1827
|
+
color: handleColor.toHexString(),
|
|
1788
1828
|
prefixCls
|
|
1789
1829
|
})), /* @__PURE__ */ React__default.createElement(Gradient, {
|
|
1790
1830
|
colors: gradientList,
|
|
@@ -1820,31 +1860,30 @@ var HUE_COLORS = [{
|
|
|
1820
1860
|
}, {
|
|
1821
1861
|
color: "rgb(255, 0, 0)",
|
|
1822
1862
|
percent: 100
|
|
1823
|
-
}]
|
|
1824
|
-
|
|
1825
|
-
|
|
1826
|
-
value,
|
|
1827
|
-
defaultValue
|
|
1828
|
-
}), _useColorState2 = _slicedToArray$1(_useColorState, 2), colorValue = _useColorState2[0], setColorValue = _useColorState2[1], alphaColor = useMemo$1(function() {
|
|
1829
|
-
var rgb = generateColor(colorValue.toRgbString());
|
|
1830
|
-
return rgb.setAlpha(1), rgb.toRgbString();
|
|
1863
|
+
}], ColorPicker$1 = /* @__PURE__ */ forwardRef(function(props, ref) {
|
|
1864
|
+
var value = props.value, defaultValue = props.defaultValue, _props$prefixCls = props.prefixCls, prefixCls = _props$prefixCls === void 0 ? ColorPickerPrefixCls : _props$prefixCls, onChange = props.onChange, onChangeComplete = props.onChangeComplete, className = props.className, style2 = props.style, panelRender = props.panelRender, _props$disabledAlpha = props.disabledAlpha, disabledAlpha = _props$disabledAlpha === void 0 ? !1 : _props$disabledAlpha, _props$disabled = props.disabled, disabled = _props$disabled === void 0 ? !1 : _props$disabled, components = props.components, _useComponent = useComponent(components), _useComponent2 = _slicedToArray$1(_useComponent, 1), Slider3 = _useComponent2[0], _useColorState = useColorState(defaultValue || defaultColor, value), _useColorState2 = _slicedToArray$1(_useColorState, 2), colorValue = _useColorState2[0], setColorValue = _useColorState2[1], alphaColor = useMemo$1(function() {
|
|
1865
|
+
return colorValue.setA(1).toRgbString();
|
|
1831
1866
|
}, [colorValue]), handleChange = /* @__PURE__ */ __name(function(data, type2) {
|
|
1832
1867
|
value || setColorValue(data), onChange == null || onChange(data, type2);
|
|
1833
|
-
}, "
|
|
1834
|
-
|
|
1835
|
-
|
|
1836
|
-
|
|
1837
|
-
|
|
1838
|
-
|
|
1839
|
-
|
|
1840
|
-
|
|
1841
|
-
|
|
1842
|
-
|
|
1843
|
-
|
|
1868
|
+
}, "handleChange2"), getHueColor = /* @__PURE__ */ __name(function(hue) {
|
|
1869
|
+
return new Color(colorValue.setHue(hue));
|
|
1870
|
+
}, "getHueColor2"), getAlphaColor = /* @__PURE__ */ __name(function(alpha) {
|
|
1871
|
+
return new Color(colorValue.setA(alpha / 100));
|
|
1872
|
+
}, "getAlphaColor2"), onHueChange = /* @__PURE__ */ __name(function(hue) {
|
|
1873
|
+
handleChange(getHueColor(hue), {
|
|
1874
|
+
type: "hue",
|
|
1875
|
+
value: hue
|
|
1876
|
+
});
|
|
1877
|
+
}, "onHueChange2"), onAlphaChange = /* @__PURE__ */ __name(function(alpha) {
|
|
1878
|
+
handleChange(getAlphaColor(alpha), {
|
|
1879
|
+
type: "alpha",
|
|
1880
|
+
value: alpha
|
|
1881
|
+
});
|
|
1882
|
+
}, "onAlphaChange2"), onHueChangeComplete = /* @__PURE__ */ __name(function(hue) {
|
|
1844
1883
|
onChangeComplete && onChangeComplete(getHueColor(hue));
|
|
1845
|
-
}, "
|
|
1884
|
+
}, "onHueChangeComplete2"), onAlphaChangeComplete = /* @__PURE__ */ __name(function(alpha) {
|
|
1846
1885
|
onChangeComplete && onChangeComplete(getAlphaColor(alpha));
|
|
1847
|
-
}, "
|
|
1886
|
+
}, "onAlphaChangeComplete2"), mergeCls = clsx("".concat(prefixCls, "-panel"), className, _defineProperty$b({}, "".concat(prefixCls, "-panel-disabled"), disabled)), sharedSliderProps = {
|
|
1848
1887
|
prefixCls,
|
|
1849
1888
|
disabled,
|
|
1850
1889
|
color: colorValue
|
|
@@ -1860,7 +1899,7 @@ const ColorPicker$1 = /* @__PURE__ */ forwardRef(function(props, ref) {
|
|
|
1860
1899
|
type: "hue",
|
|
1861
1900
|
colors: HUE_COLORS,
|
|
1862
1901
|
min: 0,
|
|
1863
|
-
max:
|
|
1902
|
+
max: 359,
|
|
1864
1903
|
value: colorValue.getHue(),
|
|
1865
1904
|
onChange: onHueChange,
|
|
1866
1905
|
onChangeComplete: onHueChangeComplete
|
|
@@ -1875,7 +1914,7 @@ const ColorPicker$1 = /* @__PURE__ */ forwardRef(function(props, ref) {
|
|
|
1875
1914
|
}],
|
|
1876
1915
|
min: 0,
|
|
1877
1916
|
max: 100,
|
|
1878
|
-
value: colorValue.
|
|
1917
|
+
value: colorValue.a * 100,
|
|
1879
1918
|
onChange: onAlphaChange,
|
|
1880
1919
|
onChangeComplete: onAlphaChangeComplete
|
|
1881
1920
|
}))), /* @__PURE__ */ React__default.createElement(ColorBlock, {
|
|
@@ -1887,7 +1926,8 @@ const ColorPicker$1 = /* @__PURE__ */ forwardRef(function(props, ref) {
|
|
|
1887
1926
|
style: style2,
|
|
1888
1927
|
ref
|
|
1889
1928
|
}, typeof panelRender == "function" ? panelRender(defaultPanel) : defaultPanel);
|
|
1890
|
-
})
|
|
1929
|
+
});
|
|
1930
|
+
const colorPicker = "univer-color-picker", colorPickerHidden = "univer-color-picker-hidden", colorPickerPanel = "univer-color-picker-panel", colorPickerPanelDisabled = "univer-color-picker-panel-disabled", colorPickerSelect = "univer-color-picker-select", colorPickerPalette = "univer-color-picker-palette", colorPickerGradient = "univer-color-picker-gradient", colorPickerSaturation = "univer-color-picker-saturation", colorPickerHandler = "univer-color-picker-handler", colorPickerSlider = "univer-color-picker-slider", colorPickerColorBlocks = "univer-color-picker-color-blocks", colorPickerColorBlock = "univer-color-picker-color-block", colorPickerColorBlockInner = "univer-color-picker-color-block-inner", colorPickerSliderContainer = "univer-color-picker-slider-container", colorPickerSliderGroup = "univer-color-picker-slider-group", colorPickerSliderGroupDisabledAlpha = "univer-color-picker-slider-group-disabled-alpha", styles$o = {
|
|
1891
1931
|
colorPicker,
|
|
1892
1932
|
colorPickerHidden,
|
|
1893
1933
|
colorPickerPanel,
|
|
@@ -4645,14 +4685,17 @@ function Dialog(props) {
|
|
|
4645
4685
|
preservePositionOnDestroy = !1,
|
|
4646
4686
|
footer,
|
|
4647
4687
|
onClose,
|
|
4648
|
-
mask
|
|
4688
|
+
mask,
|
|
4689
|
+
dialogStyles,
|
|
4690
|
+
closable
|
|
4649
4691
|
} = props, [dragDisabled, setDragDisabled] = useState(!1), [positionOffset, setPositionOffset] = useState(null), { mountContainer } = useContext(ConfigContext), TitleIfDraggable = draggable ? /* @__PURE__ */ React__default.createElement(
|
|
4650
4692
|
"div",
|
|
4651
4693
|
{
|
|
4652
4694
|
className: styles$n.dialogTitleContent,
|
|
4653
4695
|
style: {
|
|
4654
4696
|
width: "100%",
|
|
4655
|
-
cursor: "pointer"
|
|
4697
|
+
cursor: "pointer",
|
|
4698
|
+
...dialogStyles == null ? void 0 : dialogStyles.header
|
|
4656
4699
|
},
|
|
4657
4700
|
onMouseOver: /* @__PURE__ */ __name(() => {
|
|
4658
4701
|
dragDisabled && setDragDisabled(!1);
|
|
@@ -4711,7 +4754,9 @@ function Dialog(props) {
|
|
|
4711
4754
|
footer,
|
|
4712
4755
|
mask: needMask,
|
|
4713
4756
|
style: style2,
|
|
4714
|
-
onClose
|
|
4757
|
+
onClose,
|
|
4758
|
+
styles: dialogStyles,
|
|
4759
|
+
closable
|
|
4715
4760
|
},
|
|
4716
4761
|
children
|
|
4717
4762
|
);
|
|
@@ -6730,10 +6775,10 @@ function PanelBody(props) {
|
|
|
6730
6775
|
type: type2
|
|
6731
6776
|
});
|
|
6732
6777
|
col === 0 && (rowStartDate = currentDate, prefixColumn && rowNode.push(prefixColumn(rowStartDate)));
|
|
6733
|
-
var
|
|
6778
|
+
var inRange = !1, rangeStart = !1, rangeEnd = !1;
|
|
6734
6779
|
if (cellSelection && hoverRangeValue) {
|
|
6735
6780
|
var _hoverRangeValue = _slicedToArray$1(hoverRangeValue, 2), hoverStart = _hoverRangeValue[0], hoverEnd = _hoverRangeValue[1];
|
|
6736
|
-
|
|
6781
|
+
inRange = isInRange(generateConfig2, hoverStart, hoverEnd, currentDate), rangeStart = isSame(generateConfig2, locale, currentDate, hoverStart, type2), rangeEnd = isSame(generateConfig2, locale, currentDate, hoverEnd, type2);
|
|
6737
6782
|
}
|
|
6738
6783
|
var title = titleFormat ? formatValue(currentDate, {
|
|
6739
6784
|
locale,
|
|
@@ -6747,7 +6792,7 @@ function PanelBody(props) {
|
|
|
6747
6792
|
title,
|
|
6748
6793
|
className: clsx(cellPrefixCls, _objectSpread2$1(_defineProperty$b(_defineProperty$b(_defineProperty$b(_defineProperty$b(_defineProperty$b(_defineProperty$b({}, "".concat(cellPrefixCls, "-disabled"), disabled), "".concat(cellPrefixCls, "-hover"), (hoverValue || []).some(function(date) {
|
|
6749
6794
|
return isSame(generateConfig2, locale, currentDate, date, type2);
|
|
6750
|
-
})), "".concat(cellPrefixCls, "-in-range"),
|
|
6795
|
+
})), "".concat(cellPrefixCls, "-in-range"), inRange && !rangeStart && !rangeEnd), "".concat(cellPrefixCls, "-range-start"), rangeStart), "".concat(cellPrefixCls, "-range-end"), rangeEnd), "".concat(prefixCls, "-cell-selected"), !hoverRangeValue && // WeekPicker use row instead
|
|
6751
6796
|
type2 !== "week" && matchValues(currentDate)), getCellClassName(currentDate))),
|
|
6752
6797
|
onClick: /* @__PURE__ */ __name(function() {
|
|
6753
6798
|
disabled || onSelect2(currentDate);
|
|
@@ -6862,7 +6907,7 @@ function PanelHeader(props) {
|
|
|
6862
6907
|
}
|
|
6863
6908
|
__name(PanelHeader, "PanelHeader");
|
|
6864
6909
|
function DatePanel$1(props) {
|
|
6865
|
-
var prefixCls = props.prefixCls, _props$panelName = props.panelName, panelName = _props$panelName === void 0 ? "date" : _props$panelName, locale = props.locale, generateConfig2 = props.generateConfig, pickerValue = props.pickerValue, onPickerValueChange = props.onPickerValueChange, onModeChange = props.onModeChange, _props$mode = props.mode, mode = _props$mode === void 0 ? "date" : _props$mode, disabledDate = props.disabledDate, onSelect2 = props.onSelect, onHover = props.onHover, showWeek = props.showWeek, panelPrefixCls = "".concat(prefixCls, "-").concat(panelName, "-panel"), cellPrefixCls = "".concat(prefixCls, "-cell"), isWeek = mode === "week", _useInfo = useInfo(props, mode), _useInfo2 = _slicedToArray$1(_useInfo, 2), info = _useInfo2[0], now = _useInfo2[1], weekFirstDay = generateConfig2.locale.getWeekFirstDay(locale.locale), monthStartDate = generateConfig2.setDate(pickerValue, 1), baseDate = getWeekStartDate(locale.locale, generateConfig2, monthStartDate), month = generateConfig2.getMonth(pickerValue),
|
|
6910
|
+
var prefixCls = props.prefixCls, _props$panelName = props.panelName, panelName = _props$panelName === void 0 ? "date" : _props$panelName, locale = props.locale, generateConfig2 = props.generateConfig, pickerValue = props.pickerValue, onPickerValueChange = props.onPickerValueChange, onModeChange = props.onModeChange, _props$mode = props.mode, mode = _props$mode === void 0 ? "date" : _props$mode, disabledDate = props.disabledDate, onSelect2 = props.onSelect, onHover = props.onHover, showWeek = props.showWeek, panelPrefixCls = "".concat(prefixCls, "-").concat(panelName, "-panel"), cellPrefixCls = "".concat(prefixCls, "-cell"), isWeek = mode === "week", _useInfo = useInfo(props, mode), _useInfo2 = _slicedToArray$1(_useInfo, 2), info = _useInfo2[0], now = _useInfo2[1], weekFirstDay = generateConfig2.locale.getWeekFirstDay(locale.locale), monthStartDate = generateConfig2.setDate(pickerValue, 1), baseDate = getWeekStartDate(locale.locale, generateConfig2, monthStartDate), month = generateConfig2.getMonth(pickerValue), showPrefixColumn = showWeek === void 0 ? isWeek : showWeek, prefixColumn = showPrefixColumn ? function(date) {
|
|
6866
6911
|
var disabled = disabledDate == null ? void 0 : disabledDate(date, {
|
|
6867
6912
|
type: "week"
|
|
6868
6913
|
});
|
|
@@ -7391,8 +7436,8 @@ function YearPanel(props) {
|
|
|
7391
7436
|
}, "getCellText"), getCellClassName = /* @__PURE__ */ __name(function(date) {
|
|
7392
7437
|
return _defineProperty$b({}, "".concat(prefixCls, "-cell-in-view"), isSameYear(generateConfig2, date, startYearDate) || isSameYear(generateConfig2, date, endYearDate) || isInRange(generateConfig2, startYearDate, endYearDate, date));
|
|
7393
7438
|
}, "getCellClassName"), mergedDisabledDate = disabledDate ? function(currentDate, disabledInfo) {
|
|
7394
|
-
var startMonth = generateConfig2.setMonth(currentDate, 0), startDate = generateConfig2.setDate(startMonth, 1), endMonth = generateConfig2.
|
|
7395
|
-
return disabledDate(startDate, disabledInfo) && disabledDate(
|
|
7439
|
+
var startMonth = generateConfig2.setMonth(currentDate, 0), startDate = generateConfig2.setDate(startMonth, 1), endMonth = generateConfig2.addYear(startDate, 1), endDate = generateConfig2.addDate(endMonth, -1);
|
|
7440
|
+
return disabledDate(startDate, disabledInfo) && disabledDate(endDate, disabledInfo);
|
|
7396
7441
|
} : null, yearNode = /* @__PURE__ */ React$6.createElement("button", {
|
|
7397
7442
|
type: "button",
|
|
7398
7443
|
key: "decade",
|
|
@@ -10159,8 +10204,7 @@ const inputNumber = "univer-input-number", inputNumberFocused = "univer-input-nu
|
|
|
10159
10204
|
inputNumberHandlerDown,
|
|
10160
10205
|
inputNumberHandlerDownDisabled,
|
|
10161
10206
|
inputNumberHandlerUpDisabled
|
|
10162
|
-
}
|
|
10163
|
-
function InputNumber(props) {
|
|
10207
|
+
}, InputNumber = forwardRef((props, ref) => {
|
|
10164
10208
|
const {
|
|
10165
10209
|
className,
|
|
10166
10210
|
value,
|
|
@@ -10193,11 +10237,11 @@ function InputNumber(props) {
|
|
|
10193
10237
|
onClick,
|
|
10194
10238
|
onKeyDown: onKeyDown2,
|
|
10195
10239
|
onChange: handleChange,
|
|
10196
|
-
onPressEnter
|
|
10240
|
+
onPressEnter,
|
|
10241
|
+
ref
|
|
10197
10242
|
}
|
|
10198
10243
|
);
|
|
10199
|
-
}
|
|
10200
|
-
__name(InputNumber, "InputNumber");
|
|
10244
|
+
});
|
|
10201
10245
|
function isEqual(obj1, obj2) {
|
|
10202
10246
|
var shallow = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : !1, refSet = /* @__PURE__ */ new Set();
|
|
10203
10247
|
function deepEqual(a, b2) {
|
|
@@ -12480,6 +12524,8 @@ function Scrollbar(props) {
|
|
|
12480
12524
|
const containerRef = useRef(null), contentRef = useRef(null), [thumbHeight, setThumbHeight] = useState(0), [thumbTop, setThumbTop] = useState(0);
|
|
12481
12525
|
useEffect(() => {
|
|
12482
12526
|
function resize() {
|
|
12527
|
+
if (!containerRef.current)
|
|
12528
|
+
return;
|
|
12483
12529
|
const { height: containerHeight } = containerRef.current.parentElement.getBoundingClientRect(), { scrollHeight } = contentRef.current;
|
|
12484
12530
|
setThumbHeight(containerHeight / scrollHeight * 100), containerRef.current.style.height = `${containerHeight}px`;
|
|
12485
12531
|
}
|
|
@@ -13160,9 +13206,9 @@ var _excluded$b = ["id", "prefixCls", "className", "showSearch", "tagRender", "d
|
|
|
13160
13206
|
}, [mergedOpen]), React$6.useEffect(function() {
|
|
13161
13207
|
innerOpen && disabled && setInnerOpen(!1), disabled && !blurRef.current && setMockFocused(!1);
|
|
13162
13208
|
}, [disabled]);
|
|
13163
|
-
var _useLock = useLock(), _useLock2 = _slicedToArray$1(_useLock, 2), getClearLock = _useLock2[0], setClearLock = _useLock2[1], onInternalKeyDown = /* @__PURE__ */ __name(function(event) {
|
|
13164
|
-
var clearLock = getClearLock(),
|
|
13165
|
-
if (
|
|
13209
|
+
var _useLock = useLock(), _useLock2 = _slicedToArray$1(_useLock, 2), getClearLock = _useLock2[0], setClearLock = _useLock2[1], keyLockRef = React$6.useRef(!1), onInternalKeyDown = /* @__PURE__ */ __name(function(event) {
|
|
13210
|
+
var clearLock = getClearLock(), key = event.key, isEnterKey = key === "Enter";
|
|
13211
|
+
if (isEnterKey && (mode !== "combobox" && event.preventDefault(), mergedOpen || onToggleOpen(!0)), setClearLock(!!mergedSearchValue), key === "Backspace" && !clearLock && multiple && !mergedSearchValue && displayValues.length) {
|
|
13166
13212
|
for (var cloneDisplayValues = _toConsumableArray$3(displayValues), removedDisplayValue = null, i = cloneDisplayValues.length - 1; i >= 0; i -= 1) {
|
|
13167
13213
|
var current = cloneDisplayValues[i];
|
|
13168
13214
|
if (!current.disabled) {
|
|
@@ -13177,11 +13223,11 @@ var _excluded$b = ["id", "prefixCls", "className", "showSearch", "tagRender", "d
|
|
|
13177
13223
|
}
|
|
13178
13224
|
for (var _len = arguments.length, rest = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++)
|
|
13179
13225
|
rest[_key - 1] = arguments[_key];
|
|
13180
|
-
if (mergedOpen) {
|
|
13226
|
+
if (mergedOpen && (!isEnterKey || !keyLockRef.current)) {
|
|
13181
13227
|
var _listRef$current2;
|
|
13182
13228
|
(_listRef$current2 = listRef.current) === null || _listRef$current2 === void 0 || _listRef$current2.onKeyDown.apply(_listRef$current2, [event].concat(rest));
|
|
13183
13229
|
}
|
|
13184
|
-
onKeyDown2 == null || onKeyDown2.apply(void 0, [event].concat(rest));
|
|
13230
|
+
isEnterKey && (keyLockRef.current = !0), onKeyDown2 == null || onKeyDown2.apply(void 0, [event].concat(rest));
|
|
13185
13231
|
}, "onInternalKeyDown2"), onInternalKeyUp = /* @__PURE__ */ __name(function(event) {
|
|
13186
13232
|
for (var _len2 = arguments.length, rest = new Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++)
|
|
13187
13233
|
rest[_key2 - 1] = arguments[_key2];
|
|
@@ -13189,7 +13235,7 @@ var _excluded$b = ["id", "prefixCls", "className", "showSearch", "tagRender", "d
|
|
|
13189
13235
|
var _listRef$current3;
|
|
13190
13236
|
(_listRef$current3 = listRef.current) === null || _listRef$current3 === void 0 || _listRef$current3.onKeyUp.apply(_listRef$current3, [event].concat(rest));
|
|
13191
13237
|
}
|
|
13192
|
-
onKeyUp == null || onKeyUp.apply(void 0, [event].concat(rest));
|
|
13238
|
+
event.key === "Enter" && (keyLockRef.current = !1), onKeyUp == null || onKeyUp.apply(void 0, [event].concat(rest));
|
|
13193
13239
|
}, "onInternalKeyUp2"), onSelectorRemove = /* @__PURE__ */ __name(function(val) {
|
|
13194
13240
|
var newValues = displayValues.filter(function(i) {
|
|
13195
13241
|
return i !== val;
|
|
@@ -13571,12 +13617,18 @@ function useMobileTouchMove(inVirtual, listRef, callback) {
|
|
|
13571
13617
|
}, "onTouchMove"), onTouchEnd = /* @__PURE__ */ __name(function() {
|
|
13572
13618
|
touchedRef.current = !1, cleanUpEvents();
|
|
13573
13619
|
}, "onTouchEnd"), onTouchStart = /* @__PURE__ */ __name(function(e2) {
|
|
13574
|
-
cleanUpEvents(), e2.touches.length === 1 && !touchedRef.current && (touchedRef.current = !0, touchXRef.current = Math.ceil(e2.touches[0].pageX), touchYRef.current = Math.ceil(e2.touches[0].pageY), elementRef.current = e2.target, elementRef.current.addEventListener("touchmove", onTouchMove
|
|
13620
|
+
cleanUpEvents(), e2.touches.length === 1 && !touchedRef.current && (touchedRef.current = !0, touchXRef.current = Math.ceil(e2.touches[0].pageX), touchYRef.current = Math.ceil(e2.touches[0].pageY), elementRef.current = e2.target, elementRef.current.addEventListener("touchmove", onTouchMove, {
|
|
13621
|
+
passive: !1
|
|
13622
|
+
}), elementRef.current.addEventListener("touchend", onTouchEnd, {
|
|
13623
|
+
passive: !0
|
|
13624
|
+
}));
|
|
13575
13625
|
}, "onTouchStart");
|
|
13576
13626
|
cleanUpEvents = /* @__PURE__ */ __name(function() {
|
|
13577
13627
|
elementRef.current && (elementRef.current.removeEventListener("touchmove", onTouchMove), elementRef.current.removeEventListener("touchend", onTouchEnd));
|
|
13578
13628
|
}, "cleanUpEvents"), useLayoutEffect$1(function() {
|
|
13579
|
-
return inVirtual && listRef.current.addEventListener("touchstart", onTouchStart
|
|
13629
|
+
return inVirtual && listRef.current.addEventListener("touchstart", onTouchStart, {
|
|
13630
|
+
passive: !0
|
|
13631
|
+
}), function() {
|
|
13580
13632
|
var _listRef$current;
|
|
13581
13633
|
(_listRef$current = listRef.current) === null || _listRef$current === void 0 || _listRef$current.removeEventListener("touchstart", onTouchStart), cleanUpEvents(), clearInterval(intervalRef.current);
|
|
13582
13634
|
};
|
|
@@ -13691,7 +13743,11 @@ var ScrollBar = /* @__PURE__ */ React$6.forwardRef(function(props, ref) {
|
|
|
13691
13743
|
var onScrollbarTouchStart = /* @__PURE__ */ __name(function(e2) {
|
|
13692
13744
|
e2.preventDefault();
|
|
13693
13745
|
}, "onScrollbarTouchStart2"), scrollbarEle = scrollbarRef.current, thumbEle = thumbRef.current;
|
|
13694
|
-
return scrollbarEle.addEventListener("touchstart", onScrollbarTouchStart
|
|
13746
|
+
return scrollbarEle.addEventListener("touchstart", onScrollbarTouchStart, {
|
|
13747
|
+
passive: !1
|
|
13748
|
+
}), thumbEle.addEventListener("touchstart", onThumbMouseDown, {
|
|
13749
|
+
passive: !1
|
|
13750
|
+
}), function() {
|
|
13695
13751
|
scrollbarEle.removeEventListener("touchstart", onScrollbarTouchStart), thumbEle.removeEventListener("touchstart", onThumbMouseDown);
|
|
13696
13752
|
};
|
|
13697
13753
|
}, []);
|
|
@@ -13702,8 +13758,10 @@ var ScrollBar = /* @__PURE__ */ React$6.forwardRef(function(props, ref) {
|
|
|
13702
13758
|
if (dragging) {
|
|
13703
13759
|
var moveRafId, onMouseMove = /* @__PURE__ */ __name(function(e2) {
|
|
13704
13760
|
var _stateRef$current = stateRef.current, stateDragging = _stateRef$current.dragging, statePageY = _stateRef$current.pageY, stateStartTop = _stateRef$current.startTop;
|
|
13705
|
-
|
|
13706
|
-
|
|
13761
|
+
wrapperRaf.cancel(moveRafId);
|
|
13762
|
+
var rect = scrollbarRef.current.getBoundingClientRect(), scale = containerSize / (horizontal ? rect.width : rect.height);
|
|
13763
|
+
if (stateDragging) {
|
|
13764
|
+
var offset2 = (getPageXY(e2, horizontal) - statePageY) * scale, newTop = stateStartTop;
|
|
13707
13765
|
!isLTR && horizontal ? newTop -= offset2 : newTop += offset2;
|
|
13708
13766
|
var tmpEnableScrollRange = enableScrollRangeRef.current, tmpEnableOffsetRange = enableOffsetRangeRef.current, ptg = tmpEnableOffsetRange ? newTop / tmpEnableOffsetRange : 0, newScrollTop = Math.ceil(ptg * tmpEnableScrollRange);
|
|
13709
13767
|
newScrollTop = Math.max(newScrollTop, 0), newScrollTop = Math.min(newScrollTop, tmpEnableScrollRange), moveRafId = wrapperRaf(function() {
|
|
@@ -13713,12 +13771,22 @@ var ScrollBar = /* @__PURE__ */ React$6.forwardRef(function(props, ref) {
|
|
|
13713
13771
|
}, "onMouseMove2"), onMouseUp = /* @__PURE__ */ __name(function() {
|
|
13714
13772
|
setDragging(!1), onStopMove();
|
|
13715
13773
|
}, "onMouseUp2");
|
|
13716
|
-
return window.addEventListener("mousemove", onMouseMove
|
|
13774
|
+
return window.addEventListener("mousemove", onMouseMove, {
|
|
13775
|
+
passive: !0
|
|
13776
|
+
}), window.addEventListener("touchmove", onMouseMove, {
|
|
13777
|
+
passive: !0
|
|
13778
|
+
}), window.addEventListener("mouseup", onMouseUp, {
|
|
13779
|
+
passive: !0
|
|
13780
|
+
}), window.addEventListener("touchend", onMouseUp, {
|
|
13781
|
+
passive: !0
|
|
13782
|
+
}), function() {
|
|
13717
13783
|
window.removeEventListener("mousemove", onMouseMove), window.removeEventListener("touchmove", onMouseMove), window.removeEventListener("mouseup", onMouseUp), window.removeEventListener("touchend", onMouseUp), wrapperRaf.cancel(moveRafId);
|
|
13718
13784
|
};
|
|
13719
13785
|
}
|
|
13720
13786
|
}, [dragging]), React$6.useEffect(function() {
|
|
13721
|
-
delayHidden()
|
|
13787
|
+
return delayHidden(), function() {
|
|
13788
|
+
clearTimeout(visibleTimeoutRef.current);
|
|
13789
|
+
};
|
|
13722
13790
|
}, [scrollOffset]), React$6.useImperativeHandle(ref, function() {
|
|
13723
13791
|
return {
|
|
13724
13792
|
delayHidden
|
|
@@ -13818,8 +13886,8 @@ function RawList(props, ref) {
|
|
|
13818
13886
|
height: height2
|
|
13819
13887
|
}), _React$useState2 = _slicedToArray$1(_React$useState, 2), size = _React$useState2[0], setSize = _React$useState2[1], onHolderResize = /* @__PURE__ */ __name(function(sizeInfo) {
|
|
13820
13888
|
setSize({
|
|
13821
|
-
width: sizeInfo.
|
|
13822
|
-
height: sizeInfo.
|
|
13889
|
+
width: sizeInfo.offsetWidth,
|
|
13890
|
+
height: sizeInfo.offsetHeight
|
|
13823
13891
|
});
|
|
13824
13892
|
}, "onHolderResize"), verticalScrollBarRef = useRef(), horizontalScrollBarRef = useRef(), horizontalScrollBarSpinSize = React$6.useMemo(function() {
|
|
13825
13893
|
return getSpinSize(size.width, scrollWidth);
|
|
@@ -13882,7 +13950,13 @@ function RawList(props, ref) {
|
|
|
13882
13950
|
}
|
|
13883
13951
|
__name(onMozMousePixelScroll, "onMozMousePixelScroll");
|
|
13884
13952
|
var componentEle = componentRef.current;
|
|
13885
|
-
return componentEle.addEventListener("wheel", onRawWheel
|
|
13953
|
+
return componentEle.addEventListener("wheel", onRawWheel, {
|
|
13954
|
+
passive: !1
|
|
13955
|
+
}), componentEle.addEventListener("DOMMouseScroll", onFireFoxScroll, {
|
|
13956
|
+
passive: !0
|
|
13957
|
+
}), componentEle.addEventListener("MozMousePixelScroll", onMozMousePixelScroll, {
|
|
13958
|
+
passive: !1
|
|
13959
|
+
}), function() {
|
|
13886
13960
|
componentEle.removeEventListener("wheel", onRawWheel), componentEle.removeEventListener("DOMMouseScroll", onFireFoxScroll), componentEle.removeEventListener("MozMousePixelScroll", onMozMousePixelScroll);
|
|
13887
13961
|
};
|
|
13888
13962
|
}, [useVirtual]), useLayoutEffect$1(function() {
|
|
@@ -15341,7 +15415,7 @@ const switchWrapper = "univer-switch-wrapper", slider = "univer-slider", styles$
|
|
|
15341
15415
|
return useEffect(() => {
|
|
15342
15416
|
setChecked(defaultChecked);
|
|
15343
15417
|
}, [defaultChecked]), /* @__PURE__ */ React__default.createElement("div", { className: styles$3.switchWrapper }, /* @__PURE__ */ React__default.createElement("label", { className: styles$3.switch }, /* @__PURE__ */ React__default.createElement("input", { type: "checkbox", checked, onChange: handleChange }), /* @__PURE__ */ React__default.createElement("span", { className: styles$3.slider })));
|
|
15344
|
-
}, "Switch"), red50$1 = "#fee7e7", red100$1 = "#fdcece", red200$1 = "#fb9d9d", red300$1 = "#fa7979", red400$1 = "#fe4b4b", red500$1 = "#f30b0b", red600$1 = "#e30909", red700$1 = "#cd0f0f", red800$1 = "#b20000", red900$1 = "#9d0000", orange50$1 = "#fef0e6", orange100$1 = "#fee1cd", orange200$1 = "#fdc49b", orange300$1 = "#fca669", orange400$1 = "#ff8c51", orange500$1 = "#fb8937", orange600$1 = "#f96800", orange700$1 = "#df5d00", orange800$1 = "#cc4f10", orange900$1 = "#b24000", gold50$1 = "#fef6e6", gold100$1 = "#feeecd", gold200$1 = "#fddc9b", gold300$1 = "#fccb69", gold400$1 = "#ffbd37", gold500$1 = "#faad14", gold600$1 = "#e59b07", gold700$1 = "#c68400", gold800$1 = "#a97100", gold900$1 = "#8f5f00", yellow50$1 = "#fefbe6", yellow100$1 = "#fef7cd", yellow200$1 = "#fdf09b", yellow300$1 = "#fce869", yellow400$1 = "#fbe137", yellow500$1 = "#f9d700", yellow600$1 = "#ebc301", yellow700$1 = "#d8b300", yellow800$1 = "#c5a300", yellow900$1 = "#b19401", verdancy50$1 = "#f7fde8", verdancy100$1 = "#effbd0", verdancy200$1 = "#def6a2", verdancy300$1 = "#cef273", verdancy400$1 = "#beee44", verdancy500$1 = "#a4dc16", verdancy600$1 = "#8bbb11", verdancy700$1 = "#7aa017", verdancy800$1 = "#688c0d", verdancy900$1 = "#58770a", green50$1 = "#effce8", green100$1 = "#dff9d2", green200$1 = "#bff3a5", green300$1 = "#9fed78", green400$1 = "#7fe74b", green500$1 = "#59d01e", green600$1 = "#49b811", green700$1 = "#409f11", green800$1 = "#398712", green900$1 = "#317310", jiqing50$1 = "#e5fffb", jiqing100$1 = "#ccfff7", jiqing200$1 = "#a9fff2", jiqing300$1 = "#78fce8", jiqing400$1 = "#2afede", jiqing500$1 = "#10e8c7", jiqing600$1 = "#00d2b2", jiqing700$1 = "#00b298", jiqing800$1 = "#009e87", jiqing900$1 = "#008b76", blue50$1 = "#e4f4fe", blue100$1 = "#d0edff", blue200$1 = "#9fdaff", blue300$1 = "#62c2ff", blue400$1 = "#2daeff", blue500$1 = "#0b9efb", blue600$1 = "#0493ee", blue700$1 = "#0080d2", blue800$1 = "#006cae", blue900$1 = "#005f9a", hyacinth50$1 = "#e8ecfd", hyacinth100$1 = "#d0d9fb", hyacinth200$1 = "#a2b3f6", hyacinth300$1 = "#738df2", hyacinth400$1 = "#3a60f7", hyacinth500$1 = "#274fee", hyacinth600$1 = "#143ee3", hyacinth700$1 = "#012bd2", hyacinth800$1 = "#0025b7", hyacinth900$1 = "#001f9c", purple50$1 = "#f1eafa", purple100$1 = "#e3d5f6", purple200$1 = "#c7abed", purple300$1 = "#aa82e3", purple400$1 = "#9e6de3", purple500$1 = "#894ede", purple600$1 = "#7735d4", purple700$1 = "#6721cb", purple800$1 = "#510eb0", purple900$1 = "#3f0198", magenta50$1 = "#fde8f3", magenta100$1 = "#fbd0e8", magenta200$1 = "#f6a2d0", magenta300$1 = "#f273b9", magenta400$1 = "#f248a6", magenta500$1 = "#e7258f", magenta600$1 = "#d4157e", magenta700$1 = "#c1026b", magenta800$1 = "#a1095c", magenta900$1 = "#8f0550", grey50$1 = "#f5f5f5", grey100$1 = "#ececec", grey200$1 = "#e5e5e5", grey300$1 = "#d8d8d8", grey400$1 = "#bcbcbc", grey500$1 = "#999999", grey600$1 = "#7a7a7a", grey700$1 = "#656565", grey800$1 = "#565656", grey900$1 = "#4b4b4b", colorBlack$1 = "#1e222b", colorWhite$1 = "#ffffff", boxShadowBase$1 = "0 4px 12px rgba(30, 34, 43, 0.08)", boxShadowLg$1 = "0 4px 24px 0 rgba(30, 34, 43, 0.08)", bgColor$1 = "#ececec", bgColorHover$1 = "#d8d8d8", bgColorSecondary$1 = "#ffffff", textColor$1 = "#1e222b", textColorSecondary$1 = "#7a7a7a", textColorSecondaryDarker$1 = "#4b4b4b", textColorTertiary$1 = "#bcbcbc", borderColor$1 = "#e5e5e5", scrollbarColor$1 = "#bcbcbc", scrollbarColorHover$1 = "#999999", scrollbarColorActive$1 = "#7a7a7a", borderRadiusBase$1 = "4px", borderRadiusLg$1 = "8px", borderRadiusXl$1 = "12px", marginXl$1 = "24px", marginLg$1 = "20px", marginBase$1 = "16px", marginSm$1 = "12px", marginXs$1 = "8px", marginXxs$1 = "4px", paddingXl$1 = "20px", paddingLg$1 = "16px", paddingBase$1 = "12px", paddingSm$1 = "8px", paddingXs$1 = "4px", fontSizeXxl$1 = "20px", fontSizeXl$1 = "18px", fontSizeLg$1 = "16px", fontSizeBase$1 = "15px", fontSizeSm$1 = "14px", fontSizeXs$1 = "13px", fontSizeXxs$1 = "12px", breakpointXs$1 = "768px", breakpointSm$1 = "1024px", breakpointBase$1 = "1280px", breakpointLg$1 = "1536px", infoColor$1 = "#2daeff", successColor$1 = "#59d01e", warningColor$1 = "#ffbd37", errorColor$1 = "#fe4b4b", primaryColor$1 = "#274fee", primaryColorHover$1 = "#3a60f7", linkColor$1 = "#0b9efb", loopColor1$1 = "#9e6de3", loopColor2$1 = "#49b811", loopColor3$1 = "#0b9efb", loopColor4$1 = "#ffbd37", loopColor5$1 = "#f273b9", loopColor6$1 = "#00d2b2", loopColor7$1 = "#ff8c51", loopColor8$1 = "#565656", loopColor9$1 = "#274fee", loopColor10$1 = "#fa7979", loopColor11$1 = "#8bbb11", loopColor12$1 = "#d8b300", default_module = {
|
|
15418
|
+
}, "Switch"), red50$1 = "#fee7e7", red100$1 = "#fdcece", red200$1 = "#fb9d9d", red300$1 = "#fa7979", red400$1 = "#fe4b4b", red500$1 = "#f30b0b", red600$1 = "#e30909", red700$1 = "#cd0f0f", red800$1 = "#b20000", red900$1 = "#9d0000", orange50$1 = "#fef0e6", orange100$1 = "#fee1cd", orange200$1 = "#fdc49b", orange300$1 = "#fca669", orange400$1 = "#ff8c51", orange500$1 = "#fb8937", orange600$1 = "#f96800", orange700$1 = "#df5d00", orange800$1 = "#cc4f10", orange900$1 = "#b24000", gold50$1 = "#fef6e6", gold100$1 = "#feeecd", gold200$1 = "#fddc9b", gold300$1 = "#fccb69", gold400$1 = "#ffbd37", gold500$1 = "#faad14", gold600$1 = "#e59b07", gold700$1 = "#c68400", gold800$1 = "#a97100", gold900$1 = "#8f5f00", yellow50$1 = "#fefbe6", yellow100$1 = "#fef7cd", yellow200$1 = "#fdf09b", yellow300$1 = "#fce869", yellow400$1 = "#fbe137", yellow500$1 = "#f9d700", yellow600$1 = "#ebc301", yellow700$1 = "#d8b300", yellow800$1 = "#c5a300", yellow900$1 = "#b19401", verdancy50$1 = "#f7fde8", verdancy100$1 = "#effbd0", verdancy200$1 = "#def6a2", verdancy300$1 = "#cef273", verdancy400$1 = "#beee44", verdancy500$1 = "#a4dc16", verdancy600$1 = "#8bbb11", verdancy700$1 = "#7aa017", verdancy800$1 = "#688c0d", verdancy900$1 = "#58770a", green50$1 = "#effce8", green100$1 = "#dff9d2", green200$1 = "#bff3a5", green300$1 = "#9fed78", green400$1 = "#7fe74b", green500$1 = "#59d01e", green600$1 = "#49b811", green700$1 = "#409f11", green800$1 = "#398712", green900$1 = "#317310", jiqing50$1 = "#e5fffb", jiqing100$1 = "#ccfff7", jiqing200$1 = "#a9fff2", jiqing300$1 = "#78fce8", jiqing400$1 = "#2afede", jiqing500$1 = "#10e8c7", jiqing600$1 = "#00d2b2", jiqing700$1 = "#00b298", jiqing800$1 = "#009e87", jiqing900$1 = "#008b76", blue50$1 = "#e4f4fe", blue100$1 = "#d0edff", blue200$1 = "#9fdaff", blue300$1 = "#62c2ff", blue400$1 = "#2daeff", blue500$1 = "#0b9efb", blue600$1 = "#0493ee", blue700$1 = "#0080d2", blue800$1 = "#006cae", blue900$1 = "#005f9a", hyacinth50$1 = "#e8ecfd", hyacinth100$1 = "#d0d9fb", hyacinth200$1 = "#a2b3f6", hyacinth300$1 = "#738df2", hyacinth400$1 = "#3a60f7", hyacinth500$1 = "#274fee", hyacinth600$1 = "#143ee3", hyacinth700$1 = "#012bd2", hyacinth800$1 = "#0025b7", hyacinth900$1 = "#001f9c", purple50$1 = "#f1eafa", purple100$1 = "#e3d5f6", purple200$1 = "#c7abed", purple300$1 = "#aa82e3", purple400$1 = "#9e6de3", purple500$1 = "#894ede", purple600$1 = "#7735d4", purple700$1 = "#6721cb", purple800$1 = "#510eb0", purple900$1 = "#3f0198", magenta50$1 = "#fde8f3", magenta100$1 = "#fbd0e8", magenta200$1 = "#f6a2d0", magenta300$1 = "#f273b9", magenta400$1 = "#f248a6", magenta500$1 = "#e7258f", magenta600$1 = "#d4157e", magenta700$1 = "#c1026b", magenta800$1 = "#a1095c", magenta900$1 = "#8f0550", grey50$1 = "#f5f5f5", grey100$1 = "#ececec", grey200$1 = "#e5e5e5", grey300$1 = "#d8d8d8", grey400$1 = "#bcbcbc", grey500$1 = "#999999", grey600$1 = "#7a7a7a", grey700$1 = "#656565", grey800$1 = "#565656", grey900$1 = "#4b4b4b", colorBlack$1 = "#1e222b", colorWhite$1 = "#ffffff", boxShadowBase$1 = "0 4px 12px rgba(30, 34, 43, 0.08)", boxShadowLg$1 = "0 4px 24px 0 rgba(30, 34, 43, 0.08)", bgColor$1 = "#ececec", bgColorHover$1 = "#d8d8d8", bgColorSecondary$1 = "#ffffff", bgColorOverlay$1 = "#ffffff", textColor$1 = "#1e222b", textColorSecondary$1 = "#7a7a7a", textColorSecondaryDarker$1 = "#4b4b4b", textColorTertiary$1 = "#bcbcbc", borderColor$1 = "#e5e5e5", scrollbarColor$1 = "#bcbcbc", scrollbarColorHover$1 = "#999999", scrollbarColorActive$1 = "#7a7a7a", borderRadiusBase$1 = "4px", borderRadiusLg$1 = "8px", borderRadiusXl$1 = "12px", marginXl$1 = "24px", marginLg$1 = "20px", marginBase$1 = "16px", marginSm$1 = "12px", marginXs$1 = "8px", marginXxs$1 = "4px", paddingXl$1 = "20px", paddingLg$1 = "16px", paddingBase$1 = "12px", paddingSm$1 = "8px", paddingXs$1 = "4px", fontSizeXxl$1 = "20px", fontSizeXl$1 = "18px", fontSizeLg$1 = "16px", fontSizeBase$1 = "15px", fontSizeSm$1 = "14px", fontSizeXs$1 = "13px", fontSizeXxs$1 = "12px", breakpointXs$1 = "768px", breakpointSm$1 = "1024px", breakpointBase$1 = "1280px", breakpointLg$1 = "1536px", infoColor$1 = "#2daeff", successColor$1 = "#59d01e", warningColor$1 = "#ffbd37", errorColor$1 = "#fe4b4b", primaryColor$1 = "#274fee", primaryColorHover$1 = "#3a60f7", linkColor$1 = "#0b9efb", loopColor1$1 = "#9e6de3", loopColor2$1 = "#49b811", loopColor3$1 = "#0b9efb", loopColor4$1 = "#ffbd37", loopColor5$1 = "#f273b9", loopColor6$1 = "#00d2b2", loopColor7$1 = "#ff8c51", loopColor8$1 = "#565656", loopColor9$1 = "#274fee", loopColor10$1 = "#fa7979", loopColor11$1 = "#8bbb11", loopColor12$1 = "#d8b300", default_module = {
|
|
15345
15419
|
red50: red50$1,
|
|
15346
15420
|
red100: red100$1,
|
|
15347
15421
|
red200: red200$1,
|
|
@@ -15469,6 +15543,7 @@ const switchWrapper = "univer-switch-wrapper", slider = "univer-slider", styles$
|
|
|
15469
15543
|
bgColor: bgColor$1,
|
|
15470
15544
|
bgColorHover: bgColorHover$1,
|
|
15471
15545
|
bgColorSecondary: bgColorSecondary$1,
|
|
15546
|
+
bgColorOverlay: bgColorOverlay$1,
|
|
15472
15547
|
textColor: textColor$1,
|
|
15473
15548
|
textColorSecondary: textColorSecondary$1,
|
|
15474
15549
|
textColorSecondaryDarker: textColorSecondaryDarker$1,
|
|
@@ -15521,7 +15596,7 @@ const switchWrapper = "univer-switch-wrapper", slider = "univer-slider", styles$
|
|
|
15521
15596
|
loopColor10: loopColor10$1,
|
|
15522
15597
|
loopColor11: loopColor11$1,
|
|
15523
15598
|
loopColor12: loopColor12$1
|
|
15524
|
-
}, red50 = "#fee7e7", red100 = "#fdcece", red200 = "#fb9d9d", red300 = "#fa7979", red400 = "#fe4b4b", red500 = "#f30b0b", red600 = "#e30909", red700 = "#cd0f0f", red800 = "#b20000", red900 = "#9d0000", orange50 = "#fef0e6", orange100 = "#fee1cd", orange200 = "#fdc49b", orange300 = "#fca669", orange400 = "#ff8c51", orange500 = "#fb8937", orange600 = "#f96800", orange700 = "#df5d00", orange800 = "#cc4f10", orange900 = "#b24000", gold50 = "#fef6e6", gold100 = "#feeecd", gold200 = "#fddc9b", gold300 = "#fccb69", gold400 = "#ffbd37", gold500 = "#faad14", gold600 = "#e59b07", gold700 = "#c68400", gold800 = "#a97100", gold900 = "#8f5f00", yellow50 = "#fefbe6", yellow100 = "#fef7cd", yellow200 = "#fdf09b", yellow300 = "#fce869", yellow400 = "#fbe137", yellow500 = "#f9d700", yellow600 = "#ebc301", yellow700 = "#d8b300", yellow800 = "#c5a300", yellow900 = "#b19401", verdancy50 = "#f7fde8", verdancy100 = "#effbd0", verdancy200 = "#def6a2", verdancy300 = "#cef273", verdancy400 = "#beee44", verdancy500 = "#a4dc16", verdancy600 = "#8bbb11", verdancy700 = "#7aa017", verdancy800 = "#688c0d", verdancy900 = "#58770a", green50 = "#effce8", green100 = "#dff9d2", green200 = "#bff3a5", green300 = "#9fed78", green400 = "#7fe74b", green500 = "#59d01e", green600 = "#49b811", green700 = "#409f11", green800 = "#398712", green900 = "#317310", jiqing50 = "#e5fffb", jiqing100 = "#ccfff7", jiqing200 = "#a9fff2", jiqing300 = "#78fce8", jiqing400 = "#2afede", jiqing500 = "#10e8c7", jiqing600 = "#00d2b2", jiqing700 = "#00b298", jiqing800 = "#009e87", jiqing900 = "#008b76", blue50 = "#e4f4fe", blue100 = "#d0edff", blue200 = "#9fdaff", blue300 = "#62c2ff", blue400 = "#2daeff", blue500 = "#0b9efb", blue600 = "#0493ee", blue700 = "#0080d2", blue800 = "#006cae", blue900 = "#005f9a", hyacinth50 = "#e8ecfd", hyacinth100 = "#d0d9fb", hyacinth200 = "#a2b3f6", hyacinth300 = "#738df2", hyacinth400 = "#3a60f7", hyacinth500 = "#274fee", hyacinth600 = "#143ee3", hyacinth700 = "#012bd2", hyacinth800 = "#0025b7", hyacinth900 = "#001f9c", purple50 = "#f1eafa", purple100 = "#e3d5f6", purple200 = "#c7abed", purple300 = "#aa82e3", purple400 = "#9e6de3", purple500 = "#894ede", purple600 = "#7735d4", purple700 = "#6721cb", purple800 = "#510eb0", purple900 = "#3f0198", magenta50 = "#fde8f3", magenta100 = "#fbd0e8", magenta200 = "#f6a2d0", magenta300 = "#f273b9", magenta400 = "#f248a6", magenta500 = "#e7258f", magenta600 = "#d4157e", magenta700 = "#c1026b", magenta800 = "#a1095c", magenta900 = "#8f0550", grey50 = "#f5f5f5", grey100 = "#ececec", grey200 = "#e5e5e5", grey300 = "#d8d8d8", grey400 = "#bcbcbc", grey500 = "#999999", grey600 = "#7a7a7a", grey700 = "#656565", grey800 = "#565656", grey900 = "#4b4b4b", colorBlack = "#1e222b", colorWhite = "#ffffff", boxShadowBase = "0 4px 12px rgba(30, 34, 43, 0.08)", boxShadowLg = "0 4px 24px 0 rgba(30, 34, 43, 0.08)", bgColor = "#ececec", bgColorHover = "#d8d8d8", bgColorSecondary = "#ffffff", textColor = "#1e222b", textColorSecondary = "#7a7a7a", textColorSecondaryDarker = "#4b4b4b", textColorTertiary = "#bcbcbc", borderColor = "#e5e5e5", scrollbarColor = "#bcbcbc", scrollbarColorHover = "#999999", scrollbarColorActive = "#7a7a7a", borderRadiusBase = "4px", borderRadiusLg = "8px", borderRadiusXl = "12px", marginXl = "24px", marginLg = "20px", marginBase = "16px", marginSm = "12px", marginXs = "8px", marginXxs = "4px", paddingXl = "20px", paddingLg = "16px", paddingBase = "12px", paddingSm = "8px", paddingXs = "4px", fontSizeXxl = "20px", fontSizeXl = "18px", fontSizeLg = "16px", fontSizeBase = "15px", fontSizeSm = "14px", fontSizeXs = "13px", fontSizeXxs = "12px", breakpointXs = "768px", breakpointSm = "1024px", breakpointBase = "1280px", breakpointLg = "1536px", infoColor = "#2daeff", successColor = "#59d01e", warningColor = "#ffbd37", errorColor = "#fe4b4b", primaryColor = "#409f11", primaryColorHover = "#49b811", linkColor = "#0b9efb", loopColor1 = "#9e6de3", loopColor2 = "#49b811", loopColor3 = "#0b9efb", loopColor4 = "#ffbd37", loopColor5 = "#f273b9", loopColor6 = "#00d2b2", loopColor7 = "#ff8c51", loopColor8 = "#565656", loopColor9 = "#274fee", loopColor10 = "#fa7979", loopColor11 = "#8bbb11", loopColor12 = "#d8b300", green_module = {
|
|
15599
|
+
}, red50 = "#fee7e7", red100 = "#fdcece", red200 = "#fb9d9d", red300 = "#fa7979", red400 = "#fe4b4b", red500 = "#f30b0b", red600 = "#e30909", red700 = "#cd0f0f", red800 = "#b20000", red900 = "#9d0000", orange50 = "#fef0e6", orange100 = "#fee1cd", orange200 = "#fdc49b", orange300 = "#fca669", orange400 = "#ff8c51", orange500 = "#fb8937", orange600 = "#f96800", orange700 = "#df5d00", orange800 = "#cc4f10", orange900 = "#b24000", gold50 = "#fef6e6", gold100 = "#feeecd", gold200 = "#fddc9b", gold300 = "#fccb69", gold400 = "#ffbd37", gold500 = "#faad14", gold600 = "#e59b07", gold700 = "#c68400", gold800 = "#a97100", gold900 = "#8f5f00", yellow50 = "#fefbe6", yellow100 = "#fef7cd", yellow200 = "#fdf09b", yellow300 = "#fce869", yellow400 = "#fbe137", yellow500 = "#f9d700", yellow600 = "#ebc301", yellow700 = "#d8b300", yellow800 = "#c5a300", yellow900 = "#b19401", verdancy50 = "#f7fde8", verdancy100 = "#effbd0", verdancy200 = "#def6a2", verdancy300 = "#cef273", verdancy400 = "#beee44", verdancy500 = "#a4dc16", verdancy600 = "#8bbb11", verdancy700 = "#7aa017", verdancy800 = "#688c0d", verdancy900 = "#58770a", green50 = "#effce8", green100 = "#dff9d2", green200 = "#bff3a5", green300 = "#9fed78", green400 = "#7fe74b", green500 = "#59d01e", green600 = "#49b811", green700 = "#409f11", green800 = "#398712", green900 = "#317310", jiqing50 = "#e5fffb", jiqing100 = "#ccfff7", jiqing200 = "#a9fff2", jiqing300 = "#78fce8", jiqing400 = "#2afede", jiqing500 = "#10e8c7", jiqing600 = "#00d2b2", jiqing700 = "#00b298", jiqing800 = "#009e87", jiqing900 = "#008b76", blue50 = "#e4f4fe", blue100 = "#d0edff", blue200 = "#9fdaff", blue300 = "#62c2ff", blue400 = "#2daeff", blue500 = "#0b9efb", blue600 = "#0493ee", blue700 = "#0080d2", blue800 = "#006cae", blue900 = "#005f9a", hyacinth50 = "#e8ecfd", hyacinth100 = "#d0d9fb", hyacinth200 = "#a2b3f6", hyacinth300 = "#738df2", hyacinth400 = "#3a60f7", hyacinth500 = "#274fee", hyacinth600 = "#143ee3", hyacinth700 = "#012bd2", hyacinth800 = "#0025b7", hyacinth900 = "#001f9c", purple50 = "#f1eafa", purple100 = "#e3d5f6", purple200 = "#c7abed", purple300 = "#aa82e3", purple400 = "#9e6de3", purple500 = "#894ede", purple600 = "#7735d4", purple700 = "#6721cb", purple800 = "#510eb0", purple900 = "#3f0198", magenta50 = "#fde8f3", magenta100 = "#fbd0e8", magenta200 = "#f6a2d0", magenta300 = "#f273b9", magenta400 = "#f248a6", magenta500 = "#e7258f", magenta600 = "#d4157e", magenta700 = "#c1026b", magenta800 = "#a1095c", magenta900 = "#8f0550", grey50 = "#f5f5f5", grey100 = "#ececec", grey200 = "#e5e5e5", grey300 = "#d8d8d8", grey400 = "#bcbcbc", grey500 = "#999999", grey600 = "#7a7a7a", grey700 = "#656565", grey800 = "#565656", grey900 = "#4b4b4b", colorBlack = "#1e222b", colorWhite = "#ffffff", boxShadowBase = "0 4px 12px rgba(30, 34, 43, 0.08)", boxShadowLg = "0 4px 24px 0 rgba(30, 34, 43, 0.08)", bgColor = "#ececec", bgColorHover = "#d8d8d8", bgColorSecondary = "#ffffff", bgColorOverlay = "#ffffff", textColor = "#1e222b", textColorSecondary = "#7a7a7a", textColorSecondaryDarker = "#4b4b4b", textColorTertiary = "#bcbcbc", borderColor = "#e5e5e5", scrollbarColor = "#bcbcbc", scrollbarColorHover = "#999999", scrollbarColorActive = "#7a7a7a", borderRadiusBase = "4px", borderRadiusLg = "8px", borderRadiusXl = "12px", marginXl = "24px", marginLg = "20px", marginBase = "16px", marginSm = "12px", marginXs = "8px", marginXxs = "4px", paddingXl = "20px", paddingLg = "16px", paddingBase = "12px", paddingSm = "8px", paddingXs = "4px", fontSizeXxl = "20px", fontSizeXl = "18px", fontSizeLg = "16px", fontSizeBase = "15px", fontSizeSm = "14px", fontSizeXs = "13px", fontSizeXxs = "12px", breakpointXs = "768px", breakpointSm = "1024px", breakpointBase = "1280px", breakpointLg = "1536px", infoColor = "#2daeff", successColor = "#59d01e", warningColor = "#ffbd37", errorColor = "#fe4b4b", primaryColor = "#409f11", primaryColorHover = "#49b811", linkColor = "#0b9efb", loopColor1 = "#9e6de3", loopColor2 = "#49b811", loopColor3 = "#0b9efb", loopColor4 = "#ffbd37", loopColor5 = "#f273b9", loopColor6 = "#00d2b2", loopColor7 = "#ff8c51", loopColor8 = "#565656", loopColor9 = "#274fee", loopColor10 = "#fa7979", loopColor11 = "#8bbb11", loopColor12 = "#d8b300", green_module = {
|
|
15525
15600
|
red50,
|
|
15526
15601
|
red100,
|
|
15527
15602
|
red200,
|
|
@@ -15649,6 +15724,7 @@ const switchWrapper = "univer-switch-wrapper", slider = "univer-slider", styles$
|
|
|
15649
15724
|
bgColor,
|
|
15650
15725
|
bgColorHover,
|
|
15651
15726
|
bgColorSecondary,
|
|
15727
|
+
bgColorOverlay,
|
|
15652
15728
|
textColor,
|
|
15653
15729
|
textColorSecondary,
|
|
15654
15730
|
textColorSecondaryDarker,
|