vxe-pc-ui 4.16.21 → 4.16.22
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/all.esm.js +316 -66
- package/dist/style.css +1 -1
- package/dist/style.min.css +1 -1
- package/es/color-picker/index.js +14 -0
- package/es/color-picker/src/color-picker.js +40 -28
- package/es/color-picker/src/util.js +252 -36
- package/es/date-picker/src/date-picker.js +2 -1
- package/es/date-range-picker/src/date-range-picker.js +2 -1
- package/es/icon/style.css +1 -1
- package/es/select/src/select.js +2 -1
- package/es/style.css +1 -1
- package/es/style.min.css +1 -1
- package/es/ui/index.js +1 -1
- package/es/ui/src/log.js +1 -1
- package/lib/color-picker/index.js +14 -0
- package/lib/color-picker/index.min.js +1 -1
- package/lib/color-picker/src/color-picker.js +38 -27
- package/lib/color-picker/src/color-picker.min.js +1 -1
- package/lib/color-picker/src/util.js +272 -49
- package/lib/color-picker/src/util.min.js +1 -1
- package/lib/date-picker/src/date-picker.js +2 -1
- package/lib/date-picker/src/date-picker.min.js +1 -1
- package/lib/date-range-picker/src/date-range-picker.js +2 -1
- package/lib/date-range-picker/src/date-range-picker.min.js +1 -1
- package/lib/icon/style/style.css +1 -1
- package/lib/icon/style/style.min.css +1 -1
- package/lib/index.umd.js +324 -80
- package/lib/index.umd.min.js +1 -1
- package/lib/select/src/select.js +2 -1
- package/lib/select/src/select.min.js +1 -1
- package/lib/style.css +1 -1
- package/lib/style.min.css +1 -1
- package/lib/ui/index.js +1 -1
- package/lib/ui/index.min.js +1 -1
- package/lib/ui/src/log.js +1 -1
- package/lib/ui/src/log.min.js +1 -1
- package/package.json +1 -1
- package/packages/color-picker/index.ts +15 -0
- package/packages/color-picker/src/color-picker.ts +40 -29
- package/packages/color-picker/src/util.ts +267 -42
- package/packages/date-picker/src/date-picker.ts +3 -2
- package/packages/date-range-picker/src/date-range-picker.ts +3 -2
- package/packages/select/src/select.ts +3 -2
- package/types/components/color-picker.d.ts +93 -0
- package/types/components/grid.d.ts +6 -0
- package/types/components/table.d.ts +2 -2
- package/types/ui/index.d.ts +2 -0
- /package/es/icon/{iconfont.1784868322028.ttf → iconfont.1784893283450.ttf} +0 -0
- /package/es/icon/{iconfont.1784868322028.woff → iconfont.1784893283450.woff} +0 -0
- /package/es/icon/{iconfont.1784868322028.woff2 → iconfont.1784893283450.woff2} +0 -0
- /package/es/{iconfont.1784868322028.ttf → iconfont.1784893283450.ttf} +0 -0
- /package/es/{iconfont.1784868322028.woff → iconfont.1784893283450.woff} +0 -0
- /package/es/{iconfont.1784868322028.woff2 → iconfont.1784893283450.woff2} +0 -0
- /package/lib/icon/style/{iconfont.1784868322028.ttf → iconfont.1784893283450.ttf} +0 -0
- /package/lib/icon/style/{iconfont.1784868322028.woff → iconfont.1784893283450.woff} +0 -0
- /package/lib/icon/style/{iconfont.1784868322028.woff2 → iconfont.1784893283450.woff2} +0 -0
- /package/lib/{iconfont.1784868322028.ttf → iconfont.1784893283450.ttf} +0 -0
- /package/lib/{iconfont.1784868322028.woff → iconfont.1784893283450.woff} +0 -0
- /package/lib/{iconfont.1784868322028.woff2 → iconfont.1784893283450.woff2} +0 -0
package/lib/index.umd.js
CHANGED
|
@@ -4657,7 +4657,7 @@ function checkDynamic() {
|
|
|
4657
4657
|
const {
|
|
4658
4658
|
log: log_log
|
|
4659
4659
|
} = VxeUI;
|
|
4660
|
-
const uiVersion = `ui v${"4.16.
|
|
4660
|
+
const uiVersion = `ui v${"4.16.22"}`;
|
|
4661
4661
|
function createComponentLog(name) {
|
|
4662
4662
|
const tableVersion = VxeUI.tableVersion ? `table v${VxeUI.tableVersion}` : '';
|
|
4663
4663
|
const ganttVersion = VxeUI.ganttVersion ? `gantt v${VxeUI.ganttVersion}` : '';
|
|
@@ -4675,7 +4675,7 @@ const errLog = log_log.create('error', uiVersion);
|
|
|
4675
4675
|
|
|
4676
4676
|
|
|
4677
4677
|
|
|
4678
|
-
const ui_version = "4.16.
|
|
4678
|
+
const ui_version = "4.16.22";
|
|
4679
4679
|
VxeUI.uiVersion = ui_version;
|
|
4680
4680
|
VxeUI.dynamicApp = dynamicApp;
|
|
4681
4681
|
function config(options) {
|
|
@@ -20840,13 +20840,150 @@ const hexAlphaNumMaps = {};
|
|
|
20840
20840
|
});
|
|
20841
20841
|
const rgbRE = /^rgb(a?)\((\d{1,3})[,\s]+(\d{1,3})[,\s]+(\d{1,3})([,//\s]+([0-9.]{1,4})(%?))?\)$/;
|
|
20842
20842
|
function hasRgb(value) {
|
|
20843
|
-
return value && rgbRE.test(value);
|
|
20843
|
+
return !!(value && rgbRE.test(value));
|
|
20844
20844
|
}
|
|
20845
20845
|
const hexRE = /^(#?)([0-9A-Fa-f]{6})([0-9A-Fa-f]{2})?$/;
|
|
20846
20846
|
function hasHex(value) {
|
|
20847
|
-
return value && hexRE.test(value);
|
|
20847
|
+
return !!(value && hexRE.test(value));
|
|
20848
20848
|
}
|
|
20849
|
-
function
|
|
20849
|
+
function toRgb(value) {
|
|
20850
|
+
if (value) {
|
|
20851
|
+
if (hexRE.test(value)) {
|
|
20852
|
+
return hexToRgb(value);
|
|
20853
|
+
}
|
|
20854
|
+
return parseRgbVal(value);
|
|
20855
|
+
}
|
|
20856
|
+
return null;
|
|
20857
|
+
}
|
|
20858
|
+
function toRgbString(value) {
|
|
20859
|
+
const rgbRest = toRgb(value);
|
|
20860
|
+
if (rgbRest) {
|
|
20861
|
+
return rgbRest.label;
|
|
20862
|
+
}
|
|
20863
|
+
return '';
|
|
20864
|
+
}
|
|
20865
|
+
function toHex(value) {
|
|
20866
|
+
if (value) {
|
|
20867
|
+
if (rgbRE.test(value)) {
|
|
20868
|
+
return rgbValToHex(value);
|
|
20869
|
+
}
|
|
20870
|
+
return parseHexVal(value);
|
|
20871
|
+
}
|
|
20872
|
+
return null;
|
|
20873
|
+
}
|
|
20874
|
+
function toHexString(value) {
|
|
20875
|
+
const hexRest = toHex(value);
|
|
20876
|
+
if (hexRest) {
|
|
20877
|
+
return hexRest.label;
|
|
20878
|
+
}
|
|
20879
|
+
return '';
|
|
20880
|
+
}
|
|
20881
|
+
function toHsl(value) {
|
|
20882
|
+
const rgbRest = toRgb(value);
|
|
20883
|
+
if (rgbRest) {
|
|
20884
|
+
const hslRest = rgbToHsl(rgbRest);
|
|
20885
|
+
if (hslRest) {
|
|
20886
|
+
const rest = {
|
|
20887
|
+
value,
|
|
20888
|
+
type: 'hsl',
|
|
20889
|
+
...hslRest
|
|
20890
|
+
};
|
|
20891
|
+
return rest;
|
|
20892
|
+
}
|
|
20893
|
+
}
|
|
20894
|
+
return null;
|
|
20895
|
+
}
|
|
20896
|
+
function toHsv(value) {
|
|
20897
|
+
const rgbRest = toRgb(value);
|
|
20898
|
+
if (rgbRest) {
|
|
20899
|
+
const hslRest = rgbToHsv(rgbRest);
|
|
20900
|
+
if (hslRest) {
|
|
20901
|
+
const rest = {
|
|
20902
|
+
value,
|
|
20903
|
+
type: 'hsv',
|
|
20904
|
+
...hslRest
|
|
20905
|
+
};
|
|
20906
|
+
return rest;
|
|
20907
|
+
}
|
|
20908
|
+
}
|
|
20909
|
+
return null;
|
|
20910
|
+
}
|
|
20911
|
+
function parseColor(val, format) {
|
|
20912
|
+
if (val) {
|
|
20913
|
+
if (format === 'hex') {
|
|
20914
|
+
return toHex(val);
|
|
20915
|
+
}
|
|
20916
|
+
if (format === 'hsl') {
|
|
20917
|
+
return toHsl(val);
|
|
20918
|
+
}
|
|
20919
|
+
if (format === 'hsv') {
|
|
20920
|
+
return toHsv(val);
|
|
20921
|
+
}
|
|
20922
|
+
return toRgb(val);
|
|
20923
|
+
}
|
|
20924
|
+
return null;
|
|
20925
|
+
}
|
|
20926
|
+
function handleNumClamp(val) {
|
|
20927
|
+
return Math.min(1, Math.max(0, val));
|
|
20928
|
+
}
|
|
20929
|
+
function createLightenDarken(isAdd) {
|
|
20930
|
+
return function (val, ratio) {
|
|
20931
|
+
const colorRest = parseColor(val);
|
|
20932
|
+
const hslRest = toHsl(val);
|
|
20933
|
+
if (colorRest && hslRest) {
|
|
20934
|
+
ratio = ratio === 0 ? 0 : ratio || 10;
|
|
20935
|
+
hslRest.l += (isAdd ? ratio : -ratio) / 100;
|
|
20936
|
+
hslRest.l = handleNumClamp(hslRest.l);
|
|
20937
|
+
const rgbRest = hslToRgb(hslRest);
|
|
20938
|
+
if (rgbRest) {
|
|
20939
|
+
if (colorRest?.type === 'hex') {
|
|
20940
|
+
return rgbToHexVal(rgbRest.r, rgbRest.g, rgbRest.b, hslRest.a);
|
|
20941
|
+
}
|
|
20942
|
+
return toValRgb(rgbRest.r, rgbRest.g, rgbRest.b, hslRest.a);
|
|
20943
|
+
}
|
|
20944
|
+
}
|
|
20945
|
+
return val;
|
|
20946
|
+
};
|
|
20947
|
+
}
|
|
20948
|
+
const lighten = createLightenDarken(1);
|
|
20949
|
+
const darken = createLightenDarken(0);
|
|
20950
|
+
function parseHexVal(value) {
|
|
20951
|
+
if (value) {
|
|
20952
|
+
const hexRest = value.match(hexRE);
|
|
20953
|
+
if (hexRest) {
|
|
20954
|
+
const rest = {
|
|
20955
|
+
value,
|
|
20956
|
+
label: value,
|
|
20957
|
+
type: 'hex',
|
|
20958
|
+
hex: value,
|
|
20959
|
+
hexV: hexRest[2],
|
|
20960
|
+
hexA: hexRest[3] || '',
|
|
20961
|
+
a: (hexRest[3] ? hexAlphaKeyMaps[hexRest[3].toUpperCase()] : 1) || 1
|
|
20962
|
+
};
|
|
20963
|
+
return rest;
|
|
20964
|
+
}
|
|
20965
|
+
}
|
|
20966
|
+
return null;
|
|
20967
|
+
}
|
|
20968
|
+
function parseRgbVal(value) {
|
|
20969
|
+
if (value) {
|
|
20970
|
+
const rgbRest = value.match(rgbRE);
|
|
20971
|
+
if (rgbRest) {
|
|
20972
|
+
const rest = {
|
|
20973
|
+
value,
|
|
20974
|
+
label: value,
|
|
20975
|
+
type: rgbRest[6] ? 'rgba' : 'rgb',
|
|
20976
|
+
r: parseInt(rgbRest[2]),
|
|
20977
|
+
g: parseInt(rgbRest[3]),
|
|
20978
|
+
b: parseInt(rgbRest[4]),
|
|
20979
|
+
a: rgbRest[7] ? parseInt(rgbRest[6]) / 100 : rgbRest[6] ? parseFloat(rgbRest[6]) : 1
|
|
20980
|
+
};
|
|
20981
|
+
return rest;
|
|
20982
|
+
}
|
|
20983
|
+
}
|
|
20984
|
+
return null;
|
|
20985
|
+
}
|
|
20986
|
+
function parseValColor(value) {
|
|
20850
20987
|
const rest = {
|
|
20851
20988
|
value: '',
|
|
20852
20989
|
type: '',
|
|
@@ -20859,60 +20996,45 @@ function parseColor(value) {
|
|
|
20859
20996
|
a: 1
|
|
20860
20997
|
};
|
|
20861
20998
|
if (value) {
|
|
20862
|
-
|
|
20863
|
-
|
|
20864
|
-
|
|
20865
|
-
rest
|
|
20866
|
-
rest.hex = value;
|
|
20867
|
-
rest.hexV = hexRest[2];
|
|
20868
|
-
rest.hexA = hexRest[3] || '';
|
|
20869
|
-
rest.a = (hexRest[3] ? hexAlphaKeyMaps[hexRest[3].toUpperCase()] : 1) || 1;
|
|
20870
|
-
}
|
|
20871
|
-
const rgbRest = value.match(rgbRE);
|
|
20872
|
-
if (rgbRest) {
|
|
20873
|
-
rest.value = value;
|
|
20874
|
-
rest.type = rgbRest[6] ? 'rgba' : 'rgb';
|
|
20875
|
-
rest.r = parseInt(rgbRest[2]);
|
|
20876
|
-
rest.g = parseInt(rgbRest[3]);
|
|
20877
|
-
rest.b = parseInt(rgbRest[4]);
|
|
20878
|
-
rest.a = rgbRest[7] ? parseInt(rgbRest[6]) / 100 : rgbRest[6] ? parseFloat(rgbRest[6]) : 1;
|
|
20999
|
+
if (hexRE.test(value)) {
|
|
21000
|
+
return Object.assign(rest, parseHexVal(value));
|
|
21001
|
+
} else if (rgbRE.test(value)) {
|
|
21002
|
+
return Object.assign(rest, parseRgbVal(value));
|
|
20879
21003
|
}
|
|
20880
21004
|
}
|
|
20881
21005
|
return rest;
|
|
20882
21006
|
}
|
|
20883
21007
|
function updateColorAlpha(value, alpha = 1) {
|
|
20884
|
-
const colorRest =
|
|
20885
|
-
|
|
20886
|
-
|
|
20887
|
-
|
|
20888
|
-
|
|
20889
|
-
|
|
20890
|
-
|
|
20891
|
-
|
|
20892
|
-
|
|
20893
|
-
return toRgb(r, g, b, alpha);
|
|
20894
|
-
}
|
|
20895
|
-
if (type === 'hex') {
|
|
20896
|
-
return `#${hexV}${alpha === 1 ? '' : hexAlphaNumMaps[alpha] || ''}`;
|
|
21008
|
+
const colorRest = parseValColor(value);
|
|
21009
|
+
if (colorRest) {
|
|
21010
|
+
const {
|
|
21011
|
+
type
|
|
21012
|
+
} = colorRest;
|
|
21013
|
+
if (type === 'hex') {
|
|
21014
|
+
return `#${colorRest.hexV}${alpha === 1 ? '' : hexAlphaNumMaps[alpha] || ''}`;
|
|
21015
|
+
}
|
|
21016
|
+
return toValRgb(colorRest.r, colorRest.g, colorRest.b, alpha);
|
|
20897
21017
|
}
|
|
20898
21018
|
return '';
|
|
20899
21019
|
}
|
|
20900
|
-
function
|
|
20901
|
-
if (external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().eqNull(a)) {
|
|
21020
|
+
function toValRgb(r, g, b, a) {
|
|
21021
|
+
if (external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().eqNull(a) || a === 1) {
|
|
20902
21022
|
return `rgb(${r},${g},${b})`;
|
|
20903
21023
|
}
|
|
20904
21024
|
return `rgba(${r},${g},${b},${a})`;
|
|
20905
21025
|
}
|
|
20906
|
-
function
|
|
20907
|
-
|
|
20908
|
-
|
|
21026
|
+
function rgbValToHex(value) {
|
|
21027
|
+
const rgbRest = parseRgbVal(value);
|
|
21028
|
+
if (rgbRest) {
|
|
21029
|
+
const hexVal = rgbToHexVal(rgbRest.r, rgbRest.g, rgbRest.b, rgbRest.a);
|
|
21030
|
+
if (hexVal) {
|
|
21031
|
+
return parseHexVal(hexVal);
|
|
21032
|
+
}
|
|
20909
21033
|
}
|
|
20910
|
-
|
|
20911
|
-
|
|
20912
|
-
|
|
20913
|
-
|
|
20914
|
-
a = 1
|
|
20915
|
-
} = rgbRest;
|
|
21034
|
+
return null;
|
|
21035
|
+
}
|
|
21036
|
+
function rgbToHexVal(r, g, b, a) {
|
|
21037
|
+
a = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isNumber(a) ? a : 1;
|
|
20916
21038
|
const hexR = r.toString(16).padStart(2, '0');
|
|
20917
21039
|
const hexG = g.toString(16).padStart(2, '0');
|
|
20918
21040
|
const hexB = b.toString(16).padStart(2, '0');
|
|
@@ -20963,6 +21085,93 @@ function rgbToHsv(rgbRest) {
|
|
|
20963
21085
|
v: external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().round(val, 2)
|
|
20964
21086
|
};
|
|
20965
21087
|
}
|
|
21088
|
+
function rgbToHsl(rgbRest) {
|
|
21089
|
+
if (!rgbRest) {
|
|
21090
|
+
return null;
|
|
21091
|
+
}
|
|
21092
|
+
const {
|
|
21093
|
+
r,
|
|
21094
|
+
g,
|
|
21095
|
+
b,
|
|
21096
|
+
a
|
|
21097
|
+
} = rgbRest;
|
|
21098
|
+
const rNorm = r / 255;
|
|
21099
|
+
const gNorm = g / 255;
|
|
21100
|
+
const bNorm = b / 255;
|
|
21101
|
+
const max = Math.max(rNorm, gNorm, bNorm);
|
|
21102
|
+
const min = Math.min(rNorm, gNorm, bNorm);
|
|
21103
|
+
const delta = max - min;
|
|
21104
|
+
let h = 0;
|
|
21105
|
+
let s = 0;
|
|
21106
|
+
const l = (max + min) / 2;
|
|
21107
|
+
if (delta !== 0) {
|
|
21108
|
+
s = l > 0.5 ? delta / (2 - max - min) : delta / (max + min);
|
|
21109
|
+
if (max === rNorm) {
|
|
21110
|
+
h = (gNorm - bNorm) / delta % 6;
|
|
21111
|
+
} else if (max === gNorm) {
|
|
21112
|
+
h = (bNorm - rNorm) / delta + 2;
|
|
21113
|
+
} else {
|
|
21114
|
+
h = (rNorm - gNorm) / delta + 4;
|
|
21115
|
+
}
|
|
21116
|
+
h *= 60;
|
|
21117
|
+
if (h < 0) {
|
|
21118
|
+
h += 360;
|
|
21119
|
+
}
|
|
21120
|
+
}
|
|
21121
|
+
return {
|
|
21122
|
+
h,
|
|
21123
|
+
s,
|
|
21124
|
+
l,
|
|
21125
|
+
a: external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isNumber(a) ? a : 1
|
|
21126
|
+
};
|
|
21127
|
+
}
|
|
21128
|
+
function hslToRgb(slRest) {
|
|
21129
|
+
if (!slRest) {
|
|
21130
|
+
return null;
|
|
21131
|
+
}
|
|
21132
|
+
let {
|
|
21133
|
+
h,
|
|
21134
|
+
s,
|
|
21135
|
+
l
|
|
21136
|
+
} = slRest;
|
|
21137
|
+
const sNorm = s;
|
|
21138
|
+
const lNorm = l;
|
|
21139
|
+
h = (h % 360 + 360) % 360;
|
|
21140
|
+
const c = (1 - Math.abs(2 * lNorm - 1)) * sNorm;
|
|
21141
|
+
const x = c * (1 - Math.abs(h / 60 % 2 - 1));
|
|
21142
|
+
const m = lNorm - c / 2;
|
|
21143
|
+
let r, g, b;
|
|
21144
|
+
if (h >= 0 && h < 60) {
|
|
21145
|
+
r = c;
|
|
21146
|
+
g = x;
|
|
21147
|
+
b = 0;
|
|
21148
|
+
} else if (h >= 60 && h < 120) {
|
|
21149
|
+
r = x;
|
|
21150
|
+
g = c;
|
|
21151
|
+
b = 0;
|
|
21152
|
+
} else if (h >= 120 && h < 180) {
|
|
21153
|
+
r = 0;
|
|
21154
|
+
g = c;
|
|
21155
|
+
b = x;
|
|
21156
|
+
} else if (h >= 180 && h < 240) {
|
|
21157
|
+
r = 0;
|
|
21158
|
+
g = x;
|
|
21159
|
+
b = c;
|
|
21160
|
+
} else if (h >= 240 && h < 300) {
|
|
21161
|
+
r = x;
|
|
21162
|
+
g = 0;
|
|
21163
|
+
b = c;
|
|
21164
|
+
} else {
|
|
21165
|
+
r = c;
|
|
21166
|
+
g = 0;
|
|
21167
|
+
b = x;
|
|
21168
|
+
}
|
|
21169
|
+
return {
|
|
21170
|
+
r: Math.round((r + m) * 255),
|
|
21171
|
+
g: Math.round((g + m) * 255),
|
|
21172
|
+
b: Math.round((b + m) * 255)
|
|
21173
|
+
};
|
|
21174
|
+
}
|
|
20966
21175
|
function hsvToRgb(h, s, v) {
|
|
20967
21176
|
let r = 0;
|
|
20968
21177
|
let g = 0;
|
|
@@ -21021,11 +21230,18 @@ function hexToRgb(str) {
|
|
|
21021
21230
|
if (str) {
|
|
21022
21231
|
const rests = str.match(/^(#?)([0-9A-Fa-f]{2})([0-9A-Fa-f]{2})([0-9A-Fa-f]{2})([0-9A-Fa-f]{2})?$/);
|
|
21023
21232
|
if (rests) {
|
|
21233
|
+
const r = parseInt(rests[2], 16);
|
|
21234
|
+
const g = parseInt(rests[3], 16);
|
|
21235
|
+
const b = parseInt(rests[4], 16);
|
|
21236
|
+
const a = (rests[5] ? hexAlphaKeyMaps[rests[5].toUpperCase()] : 1) || 1;
|
|
21024
21237
|
return {
|
|
21025
|
-
|
|
21026
|
-
|
|
21027
|
-
|
|
21028
|
-
|
|
21238
|
+
value: str,
|
|
21239
|
+
label: toValRgb(r, g, b, rests[5] ? a : null),
|
|
21240
|
+
type: rests[5] ? 'rgba' : 'rgb',
|
|
21241
|
+
r,
|
|
21242
|
+
g,
|
|
21243
|
+
b,
|
|
21244
|
+
a
|
|
21029
21245
|
};
|
|
21030
21246
|
}
|
|
21031
21247
|
}
|
|
@@ -22250,6 +22466,7 @@ const NumberInput = VxeNumberInput;
|
|
|
22250
22466
|
const $xeModal = (0,external_commonjs_vue_commonjs2_vue_root_Vue_.inject)('$xeModal', null);
|
|
22251
22467
|
const $xeDrawer = (0,external_commonjs_vue_commonjs2_vue_root_Vue_.inject)('$xeDrawer', null);
|
|
22252
22468
|
const $xeTable = (0,external_commonjs_vue_commonjs2_vue_root_Vue_.inject)('$xeTable', null);
|
|
22469
|
+
const $xeCard = (0,external_commonjs_vue_commonjs2_vue_root_Vue_.inject)('$xeCard', null);
|
|
22253
22470
|
const $xeForm = (0,external_commonjs_vue_commonjs2_vue_root_Vue_.inject)('$xeForm', null);
|
|
22254
22471
|
const formItemInfo = (0,external_commonjs_vue_commonjs2_vue_root_Vue_.inject)('xeFormItemInfo', null);
|
|
22255
22472
|
const WinEyeDropper = typeof window !== 'undefined' ? window.EyeDropper : null;
|
|
@@ -22327,7 +22544,7 @@ const NumberInput = VxeNumberInput;
|
|
|
22327
22544
|
if (external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isBoolean(globalTransfer)) {
|
|
22328
22545
|
return globalTransfer;
|
|
22329
22546
|
}
|
|
22330
|
-
if ($xeTable || $xeModal || $xeDrawer || $xeForm) {
|
|
22547
|
+
if ($xeTable || $xeModal || $xeDrawer || $xeCard || $xeForm) {
|
|
22331
22548
|
return true;
|
|
22332
22549
|
}
|
|
22333
22550
|
}
|
|
@@ -22409,31 +22626,41 @@ const NumberInput = VxeNumberInput;
|
|
|
22409
22626
|
const isRgb = computeIsRgb.value;
|
|
22410
22627
|
const hueSliderEl = refHueSliderElem.value;
|
|
22411
22628
|
const alphaSliderEl = refAlphaSliderElem.value;
|
|
22412
|
-
const colorRest =
|
|
22413
|
-
reactData.hexValue =
|
|
22414
|
-
reactData.rValue =
|
|
22415
|
-
reactData.gValue =
|
|
22416
|
-
reactData.bValue =
|
|
22417
|
-
reactData.aValue =
|
|
22418
|
-
if (colorRest
|
|
22419
|
-
if (
|
|
22420
|
-
|
|
22421
|
-
const rgbRest = hexToRgb(colorRest.hex);
|
|
22422
|
-
if (rgbRest) {
|
|
22423
|
-
reactData.rValue = rgbRest.r;
|
|
22424
|
-
reactData.gValue = rgbRest.g;
|
|
22425
|
-
reactData.bValue = rgbRest.b;
|
|
22426
|
-
reactData.aValue = rgbRest.a;
|
|
22427
|
-
}
|
|
22428
|
-
}
|
|
22629
|
+
const colorRest = parseValColor(selectColor);
|
|
22630
|
+
reactData.hexValue = '';
|
|
22631
|
+
reactData.rValue = 0;
|
|
22632
|
+
reactData.gValue = 0;
|
|
22633
|
+
reactData.bValue = 0;
|
|
22634
|
+
reactData.aValue = 1;
|
|
22635
|
+
if (colorRest) {
|
|
22636
|
+
if (colorRest.type === 'hex') {
|
|
22637
|
+
reactData.hexValue = colorRest.hex;
|
|
22429
22638
|
} else {
|
|
22430
|
-
|
|
22431
|
-
|
|
22639
|
+
reactData.rValue = colorRest.r;
|
|
22640
|
+
reactData.gValue = colorRest.g;
|
|
22641
|
+
reactData.bValue = colorRest.b;
|
|
22642
|
+
reactData.aValue = colorRest.a;
|
|
22643
|
+
}
|
|
22644
|
+
if (colorRest.value) {
|
|
22645
|
+
if (isRgb) {
|
|
22646
|
+
if (colorRest.type === 'hex') {
|
|
22647
|
+
const rgbRest = hexToRgb(colorRest.hex);
|
|
22648
|
+
if (rgbRest) {
|
|
22649
|
+
reactData.rValue = rgbRest.r;
|
|
22650
|
+
reactData.gValue = rgbRest.g;
|
|
22651
|
+
reactData.bValue = rgbRest.b;
|
|
22652
|
+
reactData.aValue = rgbRest.a;
|
|
22653
|
+
}
|
|
22654
|
+
}
|
|
22655
|
+
} else {
|
|
22656
|
+
if (colorRest.type !== 'hex') {
|
|
22657
|
+
reactData.hexValue = rgbToHexVal(colorRest.r, colorRest.g, colorRest.b, colorRest.a);
|
|
22658
|
+
}
|
|
22432
22659
|
}
|
|
22433
22660
|
}
|
|
22434
22661
|
}
|
|
22435
22662
|
if (isAniVisible) {
|
|
22436
|
-
const hsvRest = colorRest.type === 'hex' ? hexToHsv(colorRest.hex) : rgbToHsv(colorRest);
|
|
22663
|
+
const hsvRest = colorRest ? colorRest.type === 'hex' ? hexToHsv(colorRest.hex) : rgbToHsv(colorRest) : null;
|
|
22437
22664
|
const colorPanelEl = refColorPanelElem.value;
|
|
22438
22665
|
if (hsvRest) {
|
|
22439
22666
|
if (colorPanelEl) {
|
|
@@ -22446,7 +22673,7 @@ const NumberInput = VxeNumberInput;
|
|
|
22446
22673
|
}
|
|
22447
22674
|
}
|
|
22448
22675
|
if (alphaSliderEl) {
|
|
22449
|
-
handleAlphaColor(alphaSliderEl.clientWidth *
|
|
22676
|
+
handleAlphaColor(alphaSliderEl.clientWidth * reactData.aValue);
|
|
22450
22677
|
}
|
|
22451
22678
|
}
|
|
22452
22679
|
};
|
|
@@ -22624,7 +22851,7 @@ const NumberInput = VxeNumberInput;
|
|
|
22624
22851
|
gNum = itemNum - offsetNum;
|
|
22625
22852
|
break;
|
|
22626
22853
|
}
|
|
22627
|
-
reactData.panelColor =
|
|
22854
|
+
reactData.panelColor = toValRgb(rNum, gNum, bNum);
|
|
22628
22855
|
hueSliderBtnEl.style.left = toCssUnit(offsetLeft);
|
|
22629
22856
|
}
|
|
22630
22857
|
};
|
|
@@ -22701,7 +22928,7 @@ const NumberInput = VxeNumberInput;
|
|
|
22701
22928
|
bValue,
|
|
22702
22929
|
aValue
|
|
22703
22930
|
} = reactData;
|
|
22704
|
-
reactData.selectColor =
|
|
22931
|
+
reactData.selectColor = toValRgb(rValue, gValue, bValue, aValue);
|
|
22705
22932
|
updateModelColor();
|
|
22706
22933
|
};
|
|
22707
22934
|
const handleInputAlphaEvent = () => {
|
|
@@ -22760,12 +22987,12 @@ const NumberInput = VxeNumberInput;
|
|
|
22760
22987
|
const colorPanelRect = colorPanelEl.getBoundingClientRect();
|
|
22761
22988
|
const offsetTop = Math.min(clientHeight, Math.max(0, clientY - colorPanelRect.y));
|
|
22762
22989
|
const offsetLeft = Math.min(clientWidth, Math.max(0, clientX - colorPanelRect.x));
|
|
22763
|
-
const colorRest =
|
|
22990
|
+
const colorRest = parseValColor(panelColor);
|
|
22764
22991
|
if (colorRest) {
|
|
22765
22992
|
const hsvRest = colorRest.type === 'hex' ? hexToHsv(colorRest.hex) : rgbToHsv(colorRest);
|
|
22766
22993
|
if (hsvRest) {
|
|
22767
22994
|
const ragRest = hsvToRgb(hsvRest.h, offsetLeft / clientWidth, 1 - offsetTop / clientHeight);
|
|
22768
|
-
reactData.selectColor =
|
|
22995
|
+
reactData.selectColor = toValRgb(ragRest.r, ragRest.g, ragRest.b, showAlpha ? aValue : null);
|
|
22769
22996
|
updateModelColor();
|
|
22770
22997
|
}
|
|
22771
22998
|
}
|
|
@@ -23067,7 +23294,7 @@ const NumberInput = VxeNumberInput;
|
|
|
23067
23294
|
reactData.hexValue = val;
|
|
23068
23295
|
},
|
|
23069
23296
|
onChange() {
|
|
23070
|
-
const colorRest =
|
|
23297
|
+
const colorRest = parseValColor(reactData.hexValue);
|
|
23071
23298
|
if (colorRest) {
|
|
23072
23299
|
if (colorRest.value) {
|
|
23073
23300
|
reactData.selectColor = colorRest.value;
|
|
@@ -23221,6 +23448,7 @@ const NumberInput = VxeNumberInput;
|
|
|
23221
23448
|
|
|
23222
23449
|
|
|
23223
23450
|
|
|
23451
|
+
|
|
23224
23452
|
const VxeColorPicker = Object.assign({}, color_picker, {
|
|
23225
23453
|
install(app) {
|
|
23226
23454
|
app.component(color_picker.name, color_picker);
|
|
@@ -23228,6 +23456,19 @@ const VxeColorPicker = Object.assign({}, color_picker, {
|
|
|
23228
23456
|
});
|
|
23229
23457
|
dynamicApp.use(VxeColorPicker);
|
|
23230
23458
|
VxeUI.component(color_picker);
|
|
23459
|
+
VxeUI.color = {
|
|
23460
|
+
parseColor: parseColor,
|
|
23461
|
+
hasRgb: hasRgb,
|
|
23462
|
+
hasHex: hasHex,
|
|
23463
|
+
toRgb: toRgb,
|
|
23464
|
+
toRgbString: toRgbString,
|
|
23465
|
+
toHex: toHex,
|
|
23466
|
+
toHexString: toHexString,
|
|
23467
|
+
toHsl: toHsl,
|
|
23468
|
+
toHsv: toHsv,
|
|
23469
|
+
lighten: lighten,
|
|
23470
|
+
darken: darken
|
|
23471
|
+
};
|
|
23231
23472
|
const ColorPicker = VxeColorPicker;
|
|
23232
23473
|
/* harmony default export */ var packages_color_picker = (VxeColorPicker);
|
|
23233
23474
|
;// ./packages/context-menu/src/context-menu.ts
|
|
@@ -26602,6 +26843,7 @@ function date_picker_createInternalData() {
|
|
|
26602
26843
|
const $xeModal = (0,external_commonjs_vue_commonjs2_vue_root_Vue_.inject)('$xeModal', null);
|
|
26603
26844
|
const $xeDrawer = (0,external_commonjs_vue_commonjs2_vue_root_Vue_.inject)('$xeDrawer', null);
|
|
26604
26845
|
const $xeTable = (0,external_commonjs_vue_commonjs2_vue_root_Vue_.inject)('$xeTable', null);
|
|
26846
|
+
const $xeCard = (0,external_commonjs_vue_commonjs2_vue_root_Vue_.inject)('$xeCard', null);
|
|
26605
26847
|
const $xeForm = (0,external_commonjs_vue_commonjs2_vue_root_Vue_.inject)('$xeForm', null);
|
|
26606
26848
|
const formItemInfo = (0,external_commonjs_vue_commonjs2_vue_root_Vue_.inject)('xeFormItemInfo', null);
|
|
26607
26849
|
const xID = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().uniqueId();
|
|
@@ -26640,7 +26882,7 @@ function date_picker_createInternalData() {
|
|
|
26640
26882
|
if (external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isBoolean(globalTransfer)) {
|
|
26641
26883
|
return globalTransfer;
|
|
26642
26884
|
}
|
|
26643
|
-
if ($xeTable || $xeModal || $xeDrawer || $xeForm) {
|
|
26885
|
+
if ($xeTable || $xeModal || $xeDrawer || $xeCard || $xeForm) {
|
|
26644
26886
|
return true;
|
|
26645
26887
|
}
|
|
26646
26888
|
}
|
|
@@ -28364,6 +28606,7 @@ function date_range_picker_createInternalData() {
|
|
|
28364
28606
|
const $xeModal = (0,external_commonjs_vue_commonjs2_vue_root_Vue_.inject)('$xeModal', null);
|
|
28365
28607
|
const $xeDrawer = (0,external_commonjs_vue_commonjs2_vue_root_Vue_.inject)('$xeDrawer', null);
|
|
28366
28608
|
const $xeTable = (0,external_commonjs_vue_commonjs2_vue_root_Vue_.inject)('$xeTable', null);
|
|
28609
|
+
const $xeCard = (0,external_commonjs_vue_commonjs2_vue_root_Vue_.inject)('$xeCard', null);
|
|
28367
28610
|
const $xeForm = (0,external_commonjs_vue_commonjs2_vue_root_Vue_.inject)('$xeForm', null);
|
|
28368
28611
|
const formItemInfo = (0,external_commonjs_vue_commonjs2_vue_root_Vue_.inject)('xeFormItemInfo', null);
|
|
28369
28612
|
const xID = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().uniqueId();
|
|
@@ -28404,7 +28647,7 @@ function date_range_picker_createInternalData() {
|
|
|
28404
28647
|
if (external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isBoolean(globalTransfer)) {
|
|
28405
28648
|
return globalTransfer;
|
|
28406
28649
|
}
|
|
28407
|
-
if ($xeTable || $xeModal || $xeDrawer || $xeForm) {
|
|
28650
|
+
if ($xeTable || $xeModal || $xeDrawer || $xeCard || $xeForm) {
|
|
28408
28651
|
return true;
|
|
28409
28652
|
}
|
|
28410
28653
|
}
|
|
@@ -39280,6 +39523,7 @@ function select_createInternalData() {
|
|
|
39280
39523
|
const $xeModal = (0,external_commonjs_vue_commonjs2_vue_root_Vue_.inject)('$xeModal', null);
|
|
39281
39524
|
const $xeDrawer = (0,external_commonjs_vue_commonjs2_vue_root_Vue_.inject)('$xeDrawer', null);
|
|
39282
39525
|
const $xeTable = (0,external_commonjs_vue_commonjs2_vue_root_Vue_.inject)('$xeTable', null);
|
|
39526
|
+
const $xeCard = (0,external_commonjs_vue_commonjs2_vue_root_Vue_.inject)('$xeCard', null);
|
|
39283
39527
|
const $xeForm = (0,external_commonjs_vue_commonjs2_vue_root_Vue_.inject)('$xeForm', null);
|
|
39284
39528
|
const formItemInfo = (0,external_commonjs_vue_commonjs2_vue_root_Vue_.inject)('xeFormItemInfo', null);
|
|
39285
39529
|
const xID = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().uniqueId();
|
|
@@ -39342,7 +39586,7 @@ function select_createInternalData() {
|
|
|
39342
39586
|
if (external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isBoolean(globalTransfer)) {
|
|
39343
39587
|
return globalTransfer;
|
|
39344
39588
|
}
|
|
39345
|
-
if ($xeTable || $xeModal || $xeDrawer || $xeForm) {
|
|
39589
|
+
if ($xeTable || $xeModal || $xeDrawer || $xeCard || $xeForm) {
|
|
39346
39590
|
return true;
|
|
39347
39591
|
}
|
|
39348
39592
|
}
|