tdesign-react 0.31.2-alpha.1 → 0.31.2-alpha.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +1 -1
- package/dist/tdesign.css +498 -0
- package/dist/tdesign.css.map +1 -1
- package/dist/tdesign.js +26543 -20076
- package/dist/tdesign.js.map +1 -1
- package/dist/tdesign.min.css +1 -1
- package/dist/tdesign.min.css.map +1 -1
- package/dist/tdesign.min.js +9 -3
- package/dist/tdesign.min.js.map +1 -1
- package/es/_chunks/{dep-5d29cc59.js → dep-7e7b26b4.js} +1 -1
- package/es/_chunks/{dep-5d29cc59.js.map → dep-7e7b26b4.js.map} +1 -1
- package/es/_common/js/color-picker/cmyk.d.ts +27 -0
- package/es/_common/js/color-picker/color.d.ts +154 -0
- package/es/_common/js/color-picker/gradient.d.ts +22 -0
- package/es/_util/useClickOutside.d.ts +1 -1
- package/es/_util/useClickOutside.js +51 -3
- package/es/_util/useClickOutside.js.map +1 -1
- package/es/_util/useDrag.d.ts +16 -0
- package/es/_util/useDrag.js +74 -0
- package/es/_util/useDrag.js.map +1 -0
- package/es/avatar/AvararGroup.js +1 -1
- package/es/avatar/Avatar.js +1 -1
- package/es/avatar/index.js +1 -1
- package/es/color-picker/ColorPicker.d.ts +4 -0
- package/es/color-picker/ColorPicker.js +241 -0
- package/es/color-picker/ColorPicker.js.map +1 -0
- package/es/color-picker/ColorPickerPanel.d.ts +7 -0
- package/es/color-picker/ColorPickerPanel.js +179 -0
- package/es/color-picker/ColorPickerPanel.js.map +1 -0
- package/es/color-picker/components/panel/alpha.d.ts +4 -0
- package/es/color-picker/components/panel/alpha.js +48 -0
- package/es/color-picker/components/panel/alpha.js.map +1 -0
- package/es/color-picker/components/panel/format/config.d.ts +19 -0
- package/es/color-picker/components/panel/format/config.js +90 -0
- package/es/color-picker/components/panel/format/config.js.map +1 -0
- package/es/color-picker/components/panel/format/index.d.ts +11 -0
- package/es/color-picker/components/panel/format/index.js +197 -0
- package/es/color-picker/components/panel/format/index.js.map +1 -0
- package/es/color-picker/components/panel/format/inputs.d.ts +3 -0
- package/es/color-picker/components/panel/format/inputs.js +223 -0
- package/es/color-picker/components/panel/format/inputs.js.map +1 -0
- package/es/color-picker/components/panel/header.d.ts +14 -0
- package/es/color-picker/components/panel/header.js +100 -0
- package/es/color-picker/components/panel/header.js.map +1 -0
- package/es/color-picker/components/panel/hue.d.ts +4 -0
- package/es/color-picker/components/panel/hue.js +32 -0
- package/es/color-picker/components/panel/hue.js.map +1 -0
- package/es/color-picker/components/panel/index.d.ts +4 -0
- package/es/color-picker/components/panel/index.js +456 -0
- package/es/color-picker/components/panel/index.js.map +1 -0
- package/es/color-picker/components/panel/linear-gradient.d.ts +3 -0
- package/es/color-picker/components/panel/linear-gradient.js +360 -0
- package/es/color-picker/components/panel/linear-gradient.js.map +1 -0
- package/es/color-picker/components/panel/saturation.d.ts +4 -0
- package/es/color-picker/components/panel/saturation.js +124 -0
- package/es/color-picker/components/panel/saturation.js.map +1 -0
- package/es/color-picker/components/panel/slider.d.ts +10 -0
- package/es/color-picker/components/panel/slider.js +106 -0
- package/es/color-picker/components/panel/slider.js.map +1 -0
- package/es/color-picker/components/panel/style/css.d.ts +1 -0
- package/es/color-picker/components/panel/style/css.js +1 -0
- package/es/color-picker/components/panel/style/index.d.ts +1 -0
- package/es/color-picker/components/panel/style/index.js +7 -0
- package/es/color-picker/components/panel/style/index.js.map +1 -0
- package/es/color-picker/components/panel/swatches.d.ts +11 -0
- package/es/color-picker/components/panel/swatches.js +134 -0
- package/es/color-picker/components/panel/swatches.js.map +1 -0
- package/es/color-picker/components/style/css.d.ts +1 -0
- package/es/color-picker/components/style/css.js +1 -0
- package/es/color-picker/components/style/index.d.ts +1 -0
- package/es/color-picker/components/style/index.js +7 -0
- package/es/color-picker/components/style/index.js.map +1 -0
- package/es/color-picker/components/trigger.d.ts +9 -0
- package/es/color-picker/components/trigger.js +125 -0
- package/es/color-picker/components/trigger.js.map +1 -0
- package/es/color-picker/const.d.ts +15 -0
- package/es/color-picker/const.js +22 -0
- package/es/color-picker/const.js.map +1 -0
- package/es/color-picker/hooks/useClassname.d.ts +2 -0
- package/es/color-picker/hooks/useClassname.js +46 -0
- package/es/color-picker/hooks/useClassname.js.map +1 -0
- package/es/color-picker/index.d.ts +10 -0
- package/es/color-picker/index.js +172 -0
- package/es/color-picker/index.js.map +1 -0
- package/es/color-picker/interface.d.ts +23 -0
- package/es/color-picker/interface.js +7 -0
- package/es/color-picker/interface.js.map +1 -0
- package/es/color-picker/style/css.d.ts +1 -0
- package/es/color-picker/style/css.js +1 -0
- package/es/color-picker/style/index.css +497 -0
- package/es/color-picker/style/index.d.ts +1 -0
- package/es/color-picker/style/index.js +7 -0
- package/es/color-picker/style/index.js.map +1 -0
- package/es/color-picker/type.d.ts +109 -0
- package/es/color-picker/type.js +7 -0
- package/es/color-picker/type.js.map +1 -0
- package/es/index.d.ts +1 -0
- package/es/index.js +24 -1
- package/es/index.js.map +1 -1
- package/es/input/Input.js +1 -1
- package/es/input/Input.js.map +1 -1
- package/es/popup/hooks/useTriggerProps.js +28 -0
- package/es/popup/hooks/useTriggerProps.js.map +1 -1
- package/esm/_chunks/{dep-5d29cc59.js → dep-7e7b26b4.js} +1 -1
- package/esm/_chunks/{dep-5d29cc59.js.map → dep-7e7b26b4.js.map} +1 -1
- package/esm/_common/js/color-picker/cmyk.d.ts +27 -0
- package/esm/_common/js/color-picker/color.d.ts +154 -0
- package/esm/_common/js/color-picker/gradient.d.ts +22 -0
- package/esm/_util/useClickOutside.d.ts +1 -1
- package/esm/_util/useClickOutside.js +51 -3
- package/esm/_util/useClickOutside.js.map +1 -1
- package/esm/_util/useDrag.d.ts +16 -0
- package/esm/_util/useDrag.js +74 -0
- package/esm/_util/useDrag.js.map +1 -0
- package/esm/avatar/AvararGroup.js +1 -1
- package/esm/avatar/Avatar.js +1 -1
- package/esm/avatar/index.js +1 -1
- package/esm/color-picker/ColorPicker.d.ts +4 -0
- package/esm/color-picker/ColorPicker.js +250 -0
- package/esm/color-picker/ColorPicker.js.map +1 -0
- package/esm/color-picker/ColorPickerPanel.d.ts +7 -0
- package/esm/color-picker/ColorPickerPanel.js +188 -0
- package/esm/color-picker/ColorPickerPanel.js.map +1 -0
- package/esm/color-picker/components/panel/alpha.d.ts +4 -0
- package/esm/color-picker/components/panel/alpha.js +48 -0
- package/esm/color-picker/components/panel/alpha.js.map +1 -0
- package/esm/color-picker/components/panel/format/config.d.ts +19 -0
- package/esm/color-picker/components/panel/format/config.js +90 -0
- package/esm/color-picker/components/panel/format/config.js.map +1 -0
- package/esm/color-picker/components/panel/format/index.d.ts +11 -0
- package/esm/color-picker/components/panel/format/index.js +205 -0
- package/esm/color-picker/components/panel/format/index.js.map +1 -0
- package/esm/color-picker/components/panel/format/inputs.d.ts +3 -0
- package/esm/color-picker/components/panel/format/inputs.js +226 -0
- package/esm/color-picker/components/panel/format/inputs.js.map +1 -0
- package/esm/color-picker/components/panel/header.d.ts +14 -0
- package/esm/color-picker/components/panel/header.js +100 -0
- package/esm/color-picker/components/panel/header.js.map +1 -0
- package/esm/color-picker/components/panel/hue.d.ts +4 -0
- package/esm/color-picker/components/panel/hue.js +32 -0
- package/esm/color-picker/components/panel/hue.js.map +1 -0
- package/esm/color-picker/components/panel/index.d.ts +4 -0
- package/esm/color-picker/components/panel/index.js +465 -0
- package/esm/color-picker/components/panel/index.js.map +1 -0
- package/esm/color-picker/components/panel/linear-gradient.d.ts +3 -0
- package/esm/color-picker/components/panel/linear-gradient.js +363 -0
- package/esm/color-picker/components/panel/linear-gradient.js.map +1 -0
- package/esm/color-picker/components/panel/saturation.d.ts +4 -0
- package/esm/color-picker/components/panel/saturation.js +124 -0
- package/esm/color-picker/components/panel/saturation.js.map +1 -0
- package/esm/color-picker/components/panel/slider.d.ts +10 -0
- package/esm/color-picker/components/panel/slider.js +106 -0
- package/esm/color-picker/components/panel/slider.js.map +1 -0
- package/esm/color-picker/components/panel/style/css.d.ts +1 -0
- package/esm/color-picker/components/panel/style/index.d.ts +1 -0
- package/esm/color-picker/components/panel/style/index.js +1 -0
- package/esm/color-picker/components/panel/swatches.d.ts +11 -0
- package/esm/color-picker/components/panel/swatches.js +134 -0
- package/esm/color-picker/components/panel/swatches.js.map +1 -0
- package/esm/color-picker/components/style/css.d.ts +1 -0
- package/esm/color-picker/components/style/index.d.ts +1 -0
- package/esm/color-picker/components/style/index.js +1 -0
- package/esm/color-picker/components/trigger.d.ts +9 -0
- package/esm/color-picker/components/trigger.js +125 -0
- package/esm/color-picker/components/trigger.js.map +1 -0
- package/esm/color-picker/const.d.ts +15 -0
- package/esm/color-picker/const.js +22 -0
- package/esm/color-picker/const.js.map +1 -0
- package/esm/color-picker/hooks/useClassname.d.ts +2 -0
- package/esm/color-picker/hooks/useClassname.js +46 -0
- package/esm/color-picker/hooks/useClassname.js.map +1 -0
- package/esm/color-picker/index.d.ts +10 -0
- package/esm/color-picker/index.js +182 -0
- package/esm/color-picker/index.js.map +1 -0
- package/esm/color-picker/interface.d.ts +23 -0
- package/esm/color-picker/interface.js +7 -0
- package/esm/color-picker/interface.js.map +1 -0
- package/esm/color-picker/style/css.d.ts +1 -0
- package/esm/color-picker/style/index.d.ts +1 -0
- package/esm/color-picker/style/index.js +1 -0
- package/esm/color-picker/type.d.ts +109 -0
- package/esm/color-picker/type.js +7 -0
- package/esm/color-picker/type.js.map +1 -0
- package/esm/index.d.ts +1 -0
- package/esm/index.js +25 -1
- package/esm/index.js.map +1 -1
- package/esm/input/Input.js +1 -1
- package/esm/input/Input.js.map +1 -1
- package/esm/popup/hooks/useTriggerProps.js +28 -0
- package/esm/popup/hooks/useTriggerProps.js.map +1 -1
- package/lib/_chunks/{dep-1c7ceac8.js → dep-9d6a55ed.js} +1 -1
- package/lib/_chunks/{dep-1c7ceac8.js.map → dep-9d6a55ed.js.map} +1 -1
- package/lib/_common/js/color-picker/cmyk.d.ts +27 -0
- package/lib/_common/js/color-picker/color.d.ts +154 -0
- package/lib/_common/js/color-picker/gradient.d.ts +22 -0
- package/lib/_util/useClickOutside.d.ts +1 -1
- package/lib/_util/useClickOutside.js +47 -3
- package/lib/_util/useClickOutside.js.map +1 -1
- package/lib/_util/useDrag.d.ts +16 -0
- package/lib/_util/useDrag.js +78 -0
- package/lib/_util/useDrag.js.map +1 -0
- package/lib/avatar/AvararGroup.js +1 -1
- package/lib/avatar/Avatar.js +1 -1
- package/lib/avatar/index.js +1 -1
- package/lib/color-picker/ColorPicker.d.ts +4 -0
- package/lib/color-picker/ColorPicker.js +232 -0
- package/lib/color-picker/ColorPicker.js.map +1 -0
- package/lib/color-picker/ColorPickerPanel.d.ts +7 -0
- package/lib/color-picker/ColorPickerPanel.js +170 -0
- package/lib/color-picker/ColorPickerPanel.js.map +1 -0
- package/lib/color-picker/components/panel/alpha.d.ts +4 -0
- package/lib/color-picker/components/panel/alpha.js +57 -0
- package/lib/color-picker/components/panel/alpha.js.map +1 -0
- package/lib/color-picker/components/panel/format/config.d.ts +19 -0
- package/lib/color-picker/components/panel/format/config.js +95 -0
- package/lib/color-picker/components/panel/format/config.js.map +1 -0
- package/lib/color-picker/components/panel/format/index.d.ts +11 -0
- package/lib/color-picker/components/panel/format/index.js +189 -0
- package/lib/color-picker/components/panel/format/index.js.map +1 -0
- package/lib/color-picker/components/panel/format/inputs.d.ts +3 -0
- package/lib/color-picker/components/panel/format/inputs.js +220 -0
- package/lib/color-picker/components/panel/format/inputs.js.map +1 -0
- package/lib/color-picker/components/panel/header.d.ts +14 -0
- package/lib/color-picker/components/panel/header.js +103 -0
- package/lib/color-picker/components/panel/header.js.map +1 -0
- package/lib/color-picker/components/panel/hue.d.ts +4 -0
- package/lib/color-picker/components/panel/hue.js +40 -0
- package/lib/color-picker/components/panel/hue.js.map +1 -0
- package/lib/color-picker/components/panel/index.d.ts +4 -0
- package/lib/color-picker/components/panel/index.js +448 -0
- package/lib/color-picker/components/panel/index.js.map +1 -0
- package/lib/color-picker/components/panel/linear-gradient.d.ts +3 -0
- package/lib/color-picker/components/panel/linear-gradient.js +358 -0
- package/lib/color-picker/components/panel/linear-gradient.js.map +1 -0
- package/lib/color-picker/components/panel/saturation.d.ts +4 -0
- package/lib/color-picker/components/panel/saturation.js +132 -0
- package/lib/color-picker/components/panel/saturation.js.map +1 -0
- package/lib/color-picker/components/panel/slider.d.ts +10 -0
- package/lib/color-picker/components/panel/slider.js +115 -0
- package/lib/color-picker/components/panel/slider.js.map +1 -0
- package/lib/color-picker/components/panel/style/css.d.ts +1 -0
- package/lib/color-picker/components/panel/style/index.d.ts +1 -0
- package/lib/color-picker/components/panel/swatches.d.ts +11 -0
- package/lib/color-picker/components/panel/swatches.js +139 -0
- package/lib/color-picker/components/panel/swatches.js.map +1 -0
- package/lib/color-picker/components/style/css.d.ts +1 -0
- package/lib/color-picker/components/style/index.d.ts +1 -0
- package/lib/color-picker/components/trigger.d.ts +9 -0
- package/lib/color-picker/components/trigger.js +126 -0
- package/lib/color-picker/components/trigger.js.map +1 -0
- package/lib/color-picker/const.d.ts +15 -0
- package/lib/color-picker/const.js +35 -0
- package/lib/color-picker/const.js.map +1 -0
- package/lib/color-picker/hooks/useClassname.d.ts +2 -0
- package/lib/color-picker/hooks/useClassname.js +46 -0
- package/lib/color-picker/hooks/useClassname.js.map +1 -0
- package/lib/color-picker/index.d.ts +10 -0
- package/lib/color-picker/index.js +160 -0
- package/lib/color-picker/index.js.map +1 -0
- package/lib/color-picker/interface.d.ts +23 -0
- package/lib/color-picker/interface.js +9 -0
- package/lib/color-picker/interface.js.map +1 -0
- package/lib/color-picker/style/css.d.ts +1 -0
- package/lib/color-picker/style/index.d.ts +1 -0
- package/lib/color-picker/type.d.ts +109 -0
- package/lib/color-picker/type.js +9 -0
- package/lib/color-picker/type.js.map +1 -0
- package/lib/index-lib.js +25 -1
- package/lib/index-lib.js.map +1 -1
- package/lib/index.d.ts +1 -0
- package/lib/index.js +25 -1
- package/lib/index.js.map +1 -1
- package/lib/input/Input.js +1 -1
- package/lib/input/Input.js.map +1 -1
- package/lib/popup/hooks/useTriggerProps.js +24 -0
- package/lib/popup/hooks/useTriggerProps.js.map +1 -1
- package/package.json +4 -2
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* tdesign v0.31.1
|
|
3
|
+
* (c) 2022 tdesign
|
|
4
|
+
* @license MIT
|
|
5
|
+
*/
|
|
6
|
+
|
|
7
|
+
import { useRef, useEffect } from 'react';
|
|
8
|
+
|
|
9
|
+
var useDrag = function useDrag(ref, options) {
|
|
10
|
+
var start = options.start,
|
|
11
|
+
end = options.end,
|
|
12
|
+
drag = options.drag;
|
|
13
|
+
var isDraggingRef = useRef(false);
|
|
14
|
+
|
|
15
|
+
var getCoordinate = function getCoordinate(event) {
|
|
16
|
+
try {
|
|
17
|
+
var _ref$current;
|
|
18
|
+
|
|
19
|
+
var rect = (_ref$current = ref.current) === null || _ref$current === void 0 ? void 0 : _ref$current.getBoundingClientRect();
|
|
20
|
+
var left = event.clientX - rect.left;
|
|
21
|
+
var top = event.clientY - rect.top;
|
|
22
|
+
return {
|
|
23
|
+
y: Math.min(Math.max(0, top), rect.height),
|
|
24
|
+
x: Math.min(Math.max(0, left), rect.width)
|
|
25
|
+
};
|
|
26
|
+
} catch (error) {
|
|
27
|
+
return {
|
|
28
|
+
y: null,
|
|
29
|
+
x: null
|
|
30
|
+
};
|
|
31
|
+
}
|
|
32
|
+
};
|
|
33
|
+
|
|
34
|
+
var handlePointerMove = function handlePointerMove(e) {
|
|
35
|
+
if (isDraggingRef.current) drag(getCoordinate(e), e);
|
|
36
|
+
};
|
|
37
|
+
|
|
38
|
+
var handlePointerUp = function handlePointerUp(e) {
|
|
39
|
+
isDraggingRef.current = false;
|
|
40
|
+
end(getCoordinate(e), e);
|
|
41
|
+
window.removeEventListener("mouseup", handlePointerUp);
|
|
42
|
+
window.removeEventListener("mousemove", handlePointerMove);
|
|
43
|
+
};
|
|
44
|
+
|
|
45
|
+
var handlePointerDown = function handlePointerDown(e) {
|
|
46
|
+
isDraggingRef.current = true;
|
|
47
|
+
start(getCoordinate(e), e);
|
|
48
|
+
window.addEventListener("mouseup", handlePointerUp);
|
|
49
|
+
window.addEventListener("mousemove", handlePointerMove);
|
|
50
|
+
};
|
|
51
|
+
|
|
52
|
+
useEffect(function () {
|
|
53
|
+
var element = ref.current;
|
|
54
|
+
|
|
55
|
+
if (element) {
|
|
56
|
+
element.addEventListener("mousedown", handlePointerDown);
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
return function () {
|
|
60
|
+
if (element) {
|
|
61
|
+
element.removeEventListener("mousedown", handlePointerDown);
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
window.removeEventListener("mouseup", handlePointerUp);
|
|
65
|
+
window.removeEventListener("mousemove", handlePointerMove);
|
|
66
|
+
};
|
|
67
|
+
}, []);
|
|
68
|
+
return {
|
|
69
|
+
isDragging: isDraggingRef.current
|
|
70
|
+
};
|
|
71
|
+
};
|
|
72
|
+
|
|
73
|
+
export { useDrag as default };
|
|
74
|
+
//# sourceMappingURL=useDrag.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useDrag.js","sources":["../../src/_util/useDrag.ts"],"sourcesContent":["import { useRef, useEffect } from 'react';\n\nexport interface Coordinate {\n x: number;\n y: number;\n}\n\ninterface DraggableCallback {\n (coordinate: Coordinate, event?: MouseEvent): void;\n}\n\ninterface DraggableProps {\n start?: DraggableCallback;\n drag?: DraggableCallback;\n end?: DraggableCallback;\n}\n\nconst useDrag = (ref, options: DraggableProps) => {\n const { start, end, drag } = options;\n\n const isDraggingRef = useRef(false);\n\n const getCoordinate = (event: MouseEvent) => {\n try {\n const rect = ref.current?.getBoundingClientRect();\n const left = event.clientX - rect.left;\n const top = event.clientY - rect.top;\n return {\n y: Math.min(Math.max(0, top), rect.height),\n x: Math.min(Math.max(0, left), rect.width),\n };\n } catch (error) {\n return {\n y: null,\n x: null,\n };\n }\n };\n\n const handlePointerMove = (e: MouseEvent) => {\n if (isDraggingRef.current) drag(getCoordinate(e), e);\n };\n\n const handlePointerUp = (e: MouseEvent) => {\n isDraggingRef.current = false;\n end(getCoordinate(e), e);\n window.removeEventListener('mouseup', handlePointerUp);\n window.removeEventListener('mousemove', handlePointerMove);\n };\n\n const handlePointerDown = (e: MouseEvent) => {\n isDraggingRef.current = true;\n start(getCoordinate(e), e);\n window.addEventListener('mouseup', handlePointerUp);\n window.addEventListener('mousemove', handlePointerMove);\n };\n\n useEffect(() => {\n const element = ref.current;\n if (element) {\n element.addEventListener('mousedown', handlePointerDown);\n }\n return () => {\n if (element) {\n element.removeEventListener('mousedown', handlePointerDown);\n }\n window.removeEventListener('mouseup', handlePointerUp);\n window.removeEventListener('mousemove', handlePointerMove);\n };\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, []);\n\n return {\n isDragging: isDraggingRef.current,\n };\n};\n\nexport default useDrag;\n"],"names":["useDrag","ref","options","start","end","drag","isDraggingRef","useRef","getCoordinate","event","rect","current","getBoundingClientRect","left","clientX","top","clientY","y","Math","min","max","height","x","width","error","handlePointerMove","e","handlePointerUp","window","removeEventListener","handlePointerDown","addEventListener","useEffect","element","isDragging"],"mappings":";;;;;;;;AACMA,IAAAA,OAAO,GAAG,SAAVA,OAAU,CAACC,GAAD,EAAMC,OAAN,EAAkB;AAChC,EAAA,IAAQC,KAAR,GAA6BD,OAA7B,CAAQC,KAAR;AAAA,MAAeC,GAAf,GAA6BF,OAA7B,CAAeE,GAAf;AAAA,MAAoBC,IAApB,GAA6BH,OAA7B,CAAoBG,IAApB,CAAA;AACA,EAAA,IAAMC,aAAa,GAAGC,MAAM,CAAC,KAAD,CAA5B,CAAA;;AACA,EAAA,IAAMC,aAAa,GAAG,SAAhBA,aAAgB,CAACC,KAAD,EAAW;AAC/B,IAAI,IAAA;AAAA,MAAA,IAAA,YAAA,CAAA;;AACF,MAAMC,IAAAA,IAAI,mBAAGT,GAAG,CAACU,OAAP,MAAG,IAAA,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,WAA3B,EAAwCJ,iBAAxC,CAAA,CAAA;AACD,GALD,CAAA;;AAMA,EAAA,IAAMK,iBAAiB,GAAG,SAApBA,iBAAoB,CAACJ,CAAD,EAAO;AAC/BpB,IAAAA,aAAa,CAACK,OAAd,GAAwB,IAAxB,CAAA;AACAR,IAAAA,KAAK,CAACK,aAAa,CAACkB,CAAD,CAAd,EAAmBA,CAAnB,CAAL,CAAA;AACAE,IAAAA,MAAM,CAACG,gBAAP,CAAwB,SAAxB,EAAmCJ,eAAnC,CAAA,CAAA;AACAC,IAAAA,MAAM,CAACG,gBAAP,CAAwB,WAAxB,EAAqCN,iBAArC,CAAA,CAAA;AACD,GALD,CAAA;;AAMAO,EAAAA,SAAS,CAAC,YAAM;AACd,IAAA,IAAMC,OAAO,GAAGhC,GAAG,CAACU,OAApB,CAAA;;AACA,IAAA,IAAIsB,OAAJ,EAAa;AACXA,MAAAA,OAAO,CAACF,gBAAR,CAAyB,WAAzB,EAAsCD,iBAAtC,CAAA,CAAA;AACD,KAAA;;AACD,IAAA,OAAO,YAAM;AACX,MAAA,IAAIG,OAAJ,EAAa;AACXA,QAAAA,OAAO,CAACJ,mBAAR,CAA4B,WAA5B,EAAyCC,iBAAzC,CAAA,CAAA;AACD,OAAA;;AACDF,MAAAA,MAAM,CAACC,mBAAP,CAA2B,SAA3B,EAAsCF,eAAtC,CAAA,CAAA;AACAC,MAAAA,MAAM,CAACC,mBAAP,CAA2B,WAA3B,EAAwCJ,iBAAxC,CAAA,CAAA;AACD,KAND,CAAA;AAOD,GAZQ,EAYN,EAZM,CAAT,CAAA;AAaA,EAAO,OAAA;AACLS,IAAAA,UAAU,EAAE5B,aAAa,CAACK,OAAAA;AADrB,GAAP,CAAA;AAGD;;;;"}
|
|
@@ -8,7 +8,7 @@ import '../_chunks/dep-1628aaec.js';
|
|
|
8
8
|
import '../_chunks/dep-ea842483.js';
|
|
9
9
|
import 'react';
|
|
10
10
|
import 'classnames';
|
|
11
|
-
export { G as default } from '../_chunks/dep-
|
|
11
|
+
export { G as default } from '../_chunks/dep-7e7b26b4.js';
|
|
12
12
|
import '../popup/Popup.js';
|
|
13
13
|
import '../_util/useConfig.js';
|
|
14
14
|
import './AvatarContext.js';
|
package/esm/avatar/Avatar.js
CHANGED
|
@@ -15,7 +15,7 @@ import '../_util/forwardRefWithStatics.js';
|
|
|
15
15
|
import '../_util/useCommonClassName.js';
|
|
16
16
|
import '../_util/composeRefs.js';
|
|
17
17
|
import './AvatarContext.js';
|
|
18
|
-
export { _ as default } from '../_chunks/dep-
|
|
18
|
+
export { _ as default } from '../_chunks/dep-7e7b26b4.js';
|
|
19
19
|
import '../_chunks/dep-85a9595a.js';
|
|
20
20
|
import '../_chunks/dep-bbad8591.js';
|
|
21
21
|
import '../_chunks/dep-8702aba9.js';
|
package/esm/avatar/index.js
CHANGED
|
@@ -0,0 +1,250 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* tdesign v0.31.1
|
|
3
|
+
* (c) 2022 tdesign
|
|
4
|
+
* @license MIT
|
|
5
|
+
*/
|
|
6
|
+
|
|
7
|
+
import { _ as _defineProperty } from '../_chunks/dep-1628aaec.js';
|
|
8
|
+
import { _ as _slicedToArray } from '../_chunks/dep-aca05d9d.js';
|
|
9
|
+
import { _ as _objectWithoutProperties } from '../_chunks/dep-ea842483.js';
|
|
10
|
+
import React, { useState, useRef } from 'react';
|
|
11
|
+
import { Popup } from '../popup/index.js';
|
|
12
|
+
import useClassname from './hooks/useClassname.js';
|
|
13
|
+
import useDefault from '../_util/useDefault.js';
|
|
14
|
+
import ColorTrigger from './components/trigger.js';
|
|
15
|
+
import ColorPanel from './components/panel/index.js';
|
|
16
|
+
import useClickOutside from '../_util/useClickOutside.js';
|
|
17
|
+
import '../_chunks/dep-85a9595a.js';
|
|
18
|
+
import '../popup/Popup.js';
|
|
19
|
+
import 'react-transition-group';
|
|
20
|
+
import 'classnames';
|
|
21
|
+
import 'react-popper';
|
|
22
|
+
import '../_util/useAnimation.js';
|
|
23
|
+
import '../_util/useConfig.js';
|
|
24
|
+
import '../_chunks/dep-bbad8591.js';
|
|
25
|
+
import '../_chunks/dep-8702aba9.js';
|
|
26
|
+
import '../_chunks/dep-e9e7c24f.js';
|
|
27
|
+
import '../_chunks/dep-c47502ef.js';
|
|
28
|
+
import '../_chunks/dep-3a2f4bdf.js';
|
|
29
|
+
import '../_chunks/dep-d51fd958.js';
|
|
30
|
+
import '../_chunks/dep-db8880c0.js';
|
|
31
|
+
import '../_chunks/dep-8efaaac0.js';
|
|
32
|
+
import '../_chunks/dep-d539b435.js';
|
|
33
|
+
import '../_chunks/dep-2b0021c1.js';
|
|
34
|
+
import '../_chunks/dep-09299e3f.js';
|
|
35
|
+
import '../_chunks/dep-23b2574f.js';
|
|
36
|
+
import '../_chunks/dep-a1403158.js';
|
|
37
|
+
import '../_chunks/dep-c03c5f48.js';
|
|
38
|
+
import '../_chunks/dep-9b67144e.js';
|
|
39
|
+
import '../_chunks/dep-d038aaf3.js';
|
|
40
|
+
import '../_chunks/dep-00728537.js';
|
|
41
|
+
import '../_chunks/dep-32abd81f.js';
|
|
42
|
+
import '../_chunks/dep-f3e5eb4b.js';
|
|
43
|
+
import '../_chunks/dep-ae52f85e.js';
|
|
44
|
+
import '../_chunks/dep-63ed508e.js';
|
|
45
|
+
import '../_chunks/dep-155571ca.js';
|
|
46
|
+
import '../_chunks/dep-81670ae9.js';
|
|
47
|
+
import '../locale/zh_CN.js';
|
|
48
|
+
import '../_common/js/global-config/locale/zh_CN.js';
|
|
49
|
+
import '../config-provider/zh_CN_config.js';
|
|
50
|
+
import '../_util/composeRefs.js';
|
|
51
|
+
import '../common/Portal.js';
|
|
52
|
+
import 'react-dom';
|
|
53
|
+
import '../_util/dom.js';
|
|
54
|
+
import 'raf';
|
|
55
|
+
import '../_chunks/dep-c9e242b1.js';
|
|
56
|
+
import '../_util/easing.js';
|
|
57
|
+
import '../popup/hooks/useTriggerProps.js';
|
|
58
|
+
import '../popup/utils/getTransitionParams.js';
|
|
59
|
+
import '../_util/useMutationObserver.js';
|
|
60
|
+
import '../_chunks/dep-be94af1f.js';
|
|
61
|
+
import '../_chunks/dep-5e457cfd.js';
|
|
62
|
+
import '../_chunks/dep-fd1b4e24.js';
|
|
63
|
+
import '../_util/useWindowSize.js';
|
|
64
|
+
import '../_util/noop.js';
|
|
65
|
+
import '../popup/style/index.js';
|
|
66
|
+
import '../popup/type.js';
|
|
67
|
+
import '../input/index.js';
|
|
68
|
+
import '../input/Input.js';
|
|
69
|
+
import 'tdesign-icons-react';
|
|
70
|
+
import '../_util/forwardRefWithStatics.js';
|
|
71
|
+
import 'hoist-non-react-statics';
|
|
72
|
+
import '../_util/helper.js';
|
|
73
|
+
import '../_chunks/dep-e0790d2e.js';
|
|
74
|
+
import '../_chunks/dep-020d9062.js';
|
|
75
|
+
import '../_chunks/dep-0d23bb2c.js';
|
|
76
|
+
import '../_chunks/dep-db65b23a.js';
|
|
77
|
+
import '../input/InputGroup.js';
|
|
78
|
+
import '../_util/useDefaultValue.js';
|
|
79
|
+
import '../locale/LocalReceiver.js';
|
|
80
|
+
import '../config-provider/index.js';
|
|
81
|
+
import '../config-provider/ConfigProvider.js';
|
|
82
|
+
import '../input/style/index.js';
|
|
83
|
+
import '../input/type.js';
|
|
84
|
+
import '../_common/js/color-picker/color.js';
|
|
85
|
+
import '../_chunks/dep-926c2765.js';
|
|
86
|
+
import 'tinycolor2';
|
|
87
|
+
import '../_common/js/color-picker/cmyk.js';
|
|
88
|
+
import '../_common/js/color-picker/gradient.js';
|
|
89
|
+
import '../_chunks/dep-3cf23cb4.js';
|
|
90
|
+
import '../_util/useCommonClassName.js';
|
|
91
|
+
import './components/panel/header.js';
|
|
92
|
+
import './const.js';
|
|
93
|
+
import '../radio/index.js';
|
|
94
|
+
import '../_chunks/dep-07385e51.js';
|
|
95
|
+
import '../common/Check.js';
|
|
96
|
+
import '../radio/style/index.js';
|
|
97
|
+
import '../radio/type.js';
|
|
98
|
+
import './components/panel/linear-gradient.js';
|
|
99
|
+
import '../_chunks/dep-9926d76f.js';
|
|
100
|
+
import '../_chunks/dep-cdbc448f.js';
|
|
101
|
+
import '../_chunks/dep-d17dffc0.js';
|
|
102
|
+
import '../_chunks/dep-6bf856c2.js';
|
|
103
|
+
import '../_chunks/dep-d820193b.js';
|
|
104
|
+
import '../input-number/index.js';
|
|
105
|
+
import '../input-number/InputNumber.js';
|
|
106
|
+
import '../_util/useUpdateEffect.js';
|
|
107
|
+
import '../_util/useLayoutEffect.js';
|
|
108
|
+
import '../input-number/StepHandler.js';
|
|
109
|
+
import '../button/index.js';
|
|
110
|
+
import '../button/Button.js';
|
|
111
|
+
import '../_util/useRipple.js';
|
|
112
|
+
import '../_util/setStyle.js';
|
|
113
|
+
import '../loading/index.js';
|
|
114
|
+
import '../loading/Loading.js';
|
|
115
|
+
import '../loading/gradient.js';
|
|
116
|
+
import '../_common/js/loading/circle-adapter.js';
|
|
117
|
+
import '../_common/js/utils/set-style.js';
|
|
118
|
+
import '../_common/js/utils/helper.js';
|
|
119
|
+
import '../loading/plugin.js';
|
|
120
|
+
import '../loading/style/index.js';
|
|
121
|
+
import '../loading/type.js';
|
|
122
|
+
import '../button/style/index.js';
|
|
123
|
+
import '../button/type.js';
|
|
124
|
+
import '../input-number/utils/numberUtils.js';
|
|
125
|
+
import '../input-number/style/index.js';
|
|
126
|
+
import '../input-number/type.js';
|
|
127
|
+
import './components/panel/saturation.js';
|
|
128
|
+
import '../_util/useDrag.js';
|
|
129
|
+
import './components/panel/hue.js';
|
|
130
|
+
import './components/panel/slider.js';
|
|
131
|
+
import './components/panel/alpha.js';
|
|
132
|
+
import './components/panel/format/index.js';
|
|
133
|
+
import 'lodash';
|
|
134
|
+
import '../select/index.js';
|
|
135
|
+
import '../select/base/Select.js';
|
|
136
|
+
import '../_chunks/dep-83cb7911.js';
|
|
137
|
+
import '../_chunks/dep-83177e8d.js';
|
|
138
|
+
import '../select/util/helper.js';
|
|
139
|
+
import '../select/base/OptionGroup.js';
|
|
140
|
+
import '../select/base/Option.js';
|
|
141
|
+
import '../_chunks/dep-cf0a5e4d.js';
|
|
142
|
+
import '../common/FakeArrow.js';
|
|
143
|
+
import '../select-input/index.js';
|
|
144
|
+
import '../select-input/SelectInput.js';
|
|
145
|
+
import '../select-input/useSingle.js';
|
|
146
|
+
import '../_chunks/dep-41ddaf4d.js';
|
|
147
|
+
import '../_chunks/dep-3ce0d185.js';
|
|
148
|
+
import '../_chunks/dep-b1d1fc8a.js';
|
|
149
|
+
import '../_chunks/dep-65dde75f.js';
|
|
150
|
+
import '../select-input/useMultiple.js';
|
|
151
|
+
import '../tag-input/index.js';
|
|
152
|
+
import '../tag-input/TagInput.js';
|
|
153
|
+
import '../_util/useDragSorter.js';
|
|
154
|
+
import '../tag-input/useTagScroll.js';
|
|
155
|
+
import '../tag-input/useTagList.js';
|
|
156
|
+
import '../tag/index.js';
|
|
157
|
+
import '../tag/Tag.js';
|
|
158
|
+
import '../tag/CheckTag.js';
|
|
159
|
+
import '../tag/style/index.js';
|
|
160
|
+
import '../tag/type.js';
|
|
161
|
+
import '../tag-input/useHover.js';
|
|
162
|
+
import '../tag-input/style/index.js';
|
|
163
|
+
import '../tag-input/type.js';
|
|
164
|
+
import '../select-input/useOverlayStyle.js';
|
|
165
|
+
import '../select-input/style/index.js';
|
|
166
|
+
import '../select-input/type.js';
|
|
167
|
+
import '../select/base/PopupContent.js';
|
|
168
|
+
import '../select/style/index.js';
|
|
169
|
+
import '../select/type.js';
|
|
170
|
+
import './components/panel/format/inputs.js';
|
|
171
|
+
import './components/panel/format/config.js';
|
|
172
|
+
import './components/panel/swatches.js';
|
|
173
|
+
|
|
174
|
+
var _excluded = ["popupProps", "defaultValue", "disabled", "inputProps", "value", "onChange", "colorModes"];
|
|
175
|
+
|
|
176
|
+
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
177
|
+
|
|
178
|
+
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
179
|
+
|
|
180
|
+
var ColorPicker = function ColorPicker(props) {
|
|
181
|
+
var baseClassName = useClassname();
|
|
182
|
+
|
|
183
|
+
var popupProps = props.popupProps,
|
|
184
|
+
defaultValue = props.defaultValue,
|
|
185
|
+
_props$disabled = props.disabled,
|
|
186
|
+
disabled = _props$disabled === void 0 ? false : _props$disabled,
|
|
187
|
+
inputProps = props.inputProps,
|
|
188
|
+
value = props.value,
|
|
189
|
+
onChange = props.onChange,
|
|
190
|
+
colorModes = props.colorModes,
|
|
191
|
+
rest = _objectWithoutProperties(props, _excluded);
|
|
192
|
+
|
|
193
|
+
var _useState = useState(false),
|
|
194
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
195
|
+
visible = _useState2[0],
|
|
196
|
+
setVisible = _useState2[1];
|
|
197
|
+
|
|
198
|
+
var _useDefault = useDefault(value, defaultValue, onChange),
|
|
199
|
+
_useDefault2 = _slicedToArray(_useDefault, 2),
|
|
200
|
+
innerValue = _useDefault2[0],
|
|
201
|
+
setInnerValue = _useDefault2[1];
|
|
202
|
+
|
|
203
|
+
var triggerRef = useRef();
|
|
204
|
+
var colorPanelRef = useRef();
|
|
205
|
+
|
|
206
|
+
var popProps = _objectSpread(_objectSpread({
|
|
207
|
+
placement: "bottom-left"
|
|
208
|
+
}, popupProps || {}), {}, {
|
|
209
|
+
trigger: "click",
|
|
210
|
+
attach: "body",
|
|
211
|
+
overlayClassName: [baseClassName],
|
|
212
|
+
visible: visible,
|
|
213
|
+
overlayStyle: {
|
|
214
|
+
padding: 0
|
|
215
|
+
}
|
|
216
|
+
});
|
|
217
|
+
|
|
218
|
+
useClickOutside([triggerRef, colorPanelRef], function () {
|
|
219
|
+
setVisible(false);
|
|
220
|
+
}, true);
|
|
221
|
+
return /* @__PURE__ */React.createElement(Popup, _objectSpread(_objectSpread({}, popProps), {}, {
|
|
222
|
+
content: !disabled && /* @__PURE__ */React.createElement(ColorPanel, _objectSpread(_objectSpread({}, rest), {}, {
|
|
223
|
+
disabled: disabled,
|
|
224
|
+
value: innerValue,
|
|
225
|
+
colorModes: colorModes,
|
|
226
|
+
togglePopup: setVisible,
|
|
227
|
+
onChange: function onChange(value2, context) {
|
|
228
|
+
return setInnerValue(value2, context);
|
|
229
|
+
},
|
|
230
|
+
ref: colorPanelRef
|
|
231
|
+
}))
|
|
232
|
+
}), /* @__PURE__ */React.createElement("div", {
|
|
233
|
+
className: "".concat(baseClassName, "__trigger"),
|
|
234
|
+
onClick: function onClick() {
|
|
235
|
+
return setVisible(!visible);
|
|
236
|
+
},
|
|
237
|
+
ref: triggerRef
|
|
238
|
+
}, /* @__PURE__ */React.createElement(ColorTrigger, {
|
|
239
|
+
color: innerValue,
|
|
240
|
+
disabled: disabled,
|
|
241
|
+
inputProps: inputProps,
|
|
242
|
+
onTriggerChange: setInnerValue
|
|
243
|
+
})));
|
|
244
|
+
};
|
|
245
|
+
|
|
246
|
+
ColorPicker.displayName = "ColorPicker";
|
|
247
|
+
var _ColorPicker = /*#__PURE__*/React.memo(ColorPicker);
|
|
248
|
+
|
|
249
|
+
export { _ColorPicker as default };
|
|
250
|
+
//# sourceMappingURL=ColorPicker.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ColorPicker.js","sources":["../../src/color-picker/ColorPicker.tsx"],"sourcesContent":["import React, { useState, useRef } from 'react';\nimport { Popup, PopupProps } from '../popup';\nimport { ColorPickerProps, TdColorContext } from './interface';\nimport useClassname from './hooks/useClassname';\nimport useDefault from '../_util/useDefault';\nimport ColorTrigger from './components/trigger';\nimport ColorPanel from './components/panel/index';\nimport useClickOutside from '../_util/useClickOutside';\n\nconst ColorPicker: React.FC<ColorPickerProps> = (props) => {\n const baseClassName = useClassname();\n const { popupProps, defaultValue, disabled = false, inputProps, value, onChange, colorModes, ...rest } = props;\n\n const [visible, setVisible] = useState(false);\n const [innerValue, setInnerValue] = useDefault(value, defaultValue, onChange);\n const triggerRef = useRef<HTMLDivElement>();\n const colorPanelRef = useRef();\n\n const popProps: PopupProps = {\n placement: 'bottom-left',\n ...((popupProps as PopupProps) || {}),\n trigger: 'click',\n attach: 'body',\n overlayClassName: [baseClassName],\n visible,\n overlayStyle: {\n padding: 0,\n },\n };\n\n useClickOutside(\n [triggerRef, colorPanelRef],\n () => {\n setVisible(false);\n },\n true,\n );\n\n return (\n <Popup\n {...popProps}\n content={\n !disabled && (\n <ColorPanel\n {...rest}\n disabled={disabled}\n value={innerValue}\n colorModes={colorModes}\n togglePopup={setVisible}\n onChange={(value: string, context: TdColorContext) => setInnerValue(value, context)}\n ref={colorPanelRef}\n />\n )\n }\n >\n <div className={`${baseClassName}__trigger`} onClick={() => setVisible(!visible)} ref={triggerRef}>\n <ColorTrigger color={innerValue} disabled={disabled} inputProps={inputProps} onTriggerChange={setInnerValue} />\n </div>\n </Popup>\n );\n};\n\nColorPicker.displayName = 'ColorPicker';\n\nexport default React.memo(ColorPicker);\n"],"names":["ColorPicker","props","baseClassName","useClassname","popupProps","defaultValue","disabled","inputProps","value","onChange","colorModes","rest","useState","visible","setVisible","useDefault","innerValue","setInnerValue","triggerRef","useRef","colorPanelRef","popProps","placement","trigger","attach","overlayClassName","overlayStyle","padding","useClickOutside","React","createElement","Popup","content","ColorPanel","togglePopup","value2","context","ref","className","onClick","ColorTrigger","color","onTriggerChange","displayName","memo"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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;AAP+B,KAAA,CAAA,CAAA;AAFjB,GAAA,CAAA,iBAWJS,KAAK,CAACC,aAAN,CAAoB,KAApB,EAA2B;AAC5CQ,IAAAA,SAAS,EAAKpC,EAAAA,CAAAA,MAAAA,CAAAA,aAAL,EADmC,WAAA,CAAA;AAE5CqC,IAAAA,OAAO,EAAE,SAAA,OAAA,GAAA;AAAA,MAAA,OAAMzB,UAAU,CAAC,CAACD,OAAF,CAAhB,CAAA;AAAA,KAFmC;AAG5CwB,IAAAA,GAAG,EAAEnB,UAAAA;AAHuC,GAA3B,iBAIAW,KAAK,CAACC,aAAN,CAAoBU,YAApB,EAAkC;AACnDC,IAAAA,KAAK,EAAEzB,UAD4C;AAEnDV,IAAAA,QAAQ,EAARA,QAFmD;AAGnDC,IAAAA,UAAU,EAAVA,UAHmD;AAInDmC,IAAAA,eAAe,EAAEzB,aAAAA;AAJkC,GAAlC,CAJA,CAXI,CAAvB,CAAA;AAqBD,CA1CD,CAAA;;AA2CAjB,WAAW,CAAC2C,WAAZ,GAA0B,aAA1B,CAAA;AACA,mBAAA,aAAed,KAAK,CAACe,IAAN,CAAW5C,WAAX,CAAf;;;;"}
|
|
@@ -0,0 +1,188 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* tdesign v0.31.1
|
|
3
|
+
* (c) 2022 tdesign
|
|
4
|
+
* @license MIT
|
|
5
|
+
*/
|
|
6
|
+
|
|
7
|
+
import { _ as _defineProperty } from '../_chunks/dep-1628aaec.js';
|
|
8
|
+
import React from 'react';
|
|
9
|
+
import ColorPanel from './components/panel/index.js';
|
|
10
|
+
import '../_chunks/dep-3cf23cb4.js';
|
|
11
|
+
import '../_chunks/dep-85a9595a.js';
|
|
12
|
+
import '../_chunks/dep-aca05d9d.js';
|
|
13
|
+
import 'classnames';
|
|
14
|
+
import '../_util/useCommonClassName.js';
|
|
15
|
+
import '../_util/useConfig.js';
|
|
16
|
+
import '../_chunks/dep-bbad8591.js';
|
|
17
|
+
import '../_chunks/dep-8702aba9.js';
|
|
18
|
+
import '../_chunks/dep-e9e7c24f.js';
|
|
19
|
+
import '../_chunks/dep-c47502ef.js';
|
|
20
|
+
import '../_chunks/dep-3a2f4bdf.js';
|
|
21
|
+
import '../_chunks/dep-d51fd958.js';
|
|
22
|
+
import '../_chunks/dep-db8880c0.js';
|
|
23
|
+
import '../_chunks/dep-8efaaac0.js';
|
|
24
|
+
import '../_chunks/dep-d539b435.js';
|
|
25
|
+
import '../_chunks/dep-2b0021c1.js';
|
|
26
|
+
import '../_chunks/dep-09299e3f.js';
|
|
27
|
+
import '../_chunks/dep-23b2574f.js';
|
|
28
|
+
import '../_chunks/dep-a1403158.js';
|
|
29
|
+
import '../_chunks/dep-c03c5f48.js';
|
|
30
|
+
import '../_chunks/dep-9b67144e.js';
|
|
31
|
+
import '../_chunks/dep-d038aaf3.js';
|
|
32
|
+
import '../_chunks/dep-00728537.js';
|
|
33
|
+
import '../_chunks/dep-32abd81f.js';
|
|
34
|
+
import '../_chunks/dep-f3e5eb4b.js';
|
|
35
|
+
import '../_chunks/dep-ae52f85e.js';
|
|
36
|
+
import '../_chunks/dep-63ed508e.js';
|
|
37
|
+
import '../_chunks/dep-155571ca.js';
|
|
38
|
+
import '../_chunks/dep-81670ae9.js';
|
|
39
|
+
import '../locale/zh_CN.js';
|
|
40
|
+
import '../_common/js/global-config/locale/zh_CN.js';
|
|
41
|
+
import '../config-provider/zh_CN_config.js';
|
|
42
|
+
import '../_util/useDefault.js';
|
|
43
|
+
import '../_util/noop.js';
|
|
44
|
+
import '../locale/LocalReceiver.js';
|
|
45
|
+
import '../config-provider/index.js';
|
|
46
|
+
import '../config-provider/ConfigProvider.js';
|
|
47
|
+
import './hooks/useClassname.js';
|
|
48
|
+
import './components/panel/header.js';
|
|
49
|
+
import 'tdesign-icons-react';
|
|
50
|
+
import './const.js';
|
|
51
|
+
import '../radio/index.js';
|
|
52
|
+
import '../_chunks/dep-07385e51.js';
|
|
53
|
+
import '../_util/forwardRefWithStatics.js';
|
|
54
|
+
import 'hoist-non-react-statics';
|
|
55
|
+
import '../common/Check.js';
|
|
56
|
+
import '../_chunks/dep-ea842483.js';
|
|
57
|
+
import '../_util/helper.js';
|
|
58
|
+
import '../_chunks/dep-e0790d2e.js';
|
|
59
|
+
import '../_chunks/dep-020d9062.js';
|
|
60
|
+
import '../_chunks/dep-fd1b4e24.js';
|
|
61
|
+
import '../_chunks/dep-0d23bb2c.js';
|
|
62
|
+
import '../_chunks/dep-db65b23a.js';
|
|
63
|
+
import '../_util/useMutationObserver.js';
|
|
64
|
+
import '../_chunks/dep-be94af1f.js';
|
|
65
|
+
import '../_chunks/dep-5e457cfd.js';
|
|
66
|
+
import '../radio/style/index.js';
|
|
67
|
+
import '../radio/type.js';
|
|
68
|
+
import '../_common/js/color-picker/color.js';
|
|
69
|
+
import '../_chunks/dep-926c2765.js';
|
|
70
|
+
import 'tinycolor2';
|
|
71
|
+
import '../_common/js/color-picker/cmyk.js';
|
|
72
|
+
import '../_common/js/color-picker/gradient.js';
|
|
73
|
+
import './components/panel/linear-gradient.js';
|
|
74
|
+
import '../_chunks/dep-9926d76f.js';
|
|
75
|
+
import '../_chunks/dep-cdbc448f.js';
|
|
76
|
+
import '../_chunks/dep-d17dffc0.js';
|
|
77
|
+
import '../_chunks/dep-6bf856c2.js';
|
|
78
|
+
import '../_chunks/dep-d820193b.js';
|
|
79
|
+
import '../input-number/index.js';
|
|
80
|
+
import '../input-number/InputNumber.js';
|
|
81
|
+
import '../_util/useUpdateEffect.js';
|
|
82
|
+
import '../_util/useLayoutEffect.js';
|
|
83
|
+
import '../_util/dom.js';
|
|
84
|
+
import 'raf';
|
|
85
|
+
import '../_chunks/dep-c9e242b1.js';
|
|
86
|
+
import '../_util/easing.js';
|
|
87
|
+
import '../input-number/StepHandler.js';
|
|
88
|
+
import '../button/index.js';
|
|
89
|
+
import '../button/Button.js';
|
|
90
|
+
import '../_util/useRipple.js';
|
|
91
|
+
import '../_util/useAnimation.js';
|
|
92
|
+
import '../_util/setStyle.js';
|
|
93
|
+
import '../loading/index.js';
|
|
94
|
+
import '../loading/Loading.js';
|
|
95
|
+
import '../common/Portal.js';
|
|
96
|
+
import 'react-dom';
|
|
97
|
+
import '../loading/gradient.js';
|
|
98
|
+
import '../_common/js/loading/circle-adapter.js';
|
|
99
|
+
import '../_common/js/utils/set-style.js';
|
|
100
|
+
import '../_common/js/utils/helper.js';
|
|
101
|
+
import '../loading/plugin.js';
|
|
102
|
+
import '../loading/style/index.js';
|
|
103
|
+
import '../loading/type.js';
|
|
104
|
+
import '../button/style/index.js';
|
|
105
|
+
import '../button/type.js';
|
|
106
|
+
import '../input-number/utils/numberUtils.js';
|
|
107
|
+
import '../input/index.js';
|
|
108
|
+
import '../input/Input.js';
|
|
109
|
+
import '../input/InputGroup.js';
|
|
110
|
+
import '../_util/useDefaultValue.js';
|
|
111
|
+
import '../input/style/index.js';
|
|
112
|
+
import '../input/type.js';
|
|
113
|
+
import '../input-number/style/index.js';
|
|
114
|
+
import '../input-number/type.js';
|
|
115
|
+
import './components/panel/saturation.js';
|
|
116
|
+
import '../_util/useDrag.js';
|
|
117
|
+
import './components/panel/hue.js';
|
|
118
|
+
import './components/panel/slider.js';
|
|
119
|
+
import './components/panel/alpha.js';
|
|
120
|
+
import './components/panel/format/index.js';
|
|
121
|
+
import 'lodash';
|
|
122
|
+
import '../select/index.js';
|
|
123
|
+
import '../select/base/Select.js';
|
|
124
|
+
import '../_chunks/dep-83cb7911.js';
|
|
125
|
+
import '../_chunks/dep-83177e8d.js';
|
|
126
|
+
import '../select/util/helper.js';
|
|
127
|
+
import '../select/base/OptionGroup.js';
|
|
128
|
+
import '../select/base/Option.js';
|
|
129
|
+
import '../_chunks/dep-cf0a5e4d.js';
|
|
130
|
+
import '../common/FakeArrow.js';
|
|
131
|
+
import '../select-input/index.js';
|
|
132
|
+
import '../select-input/SelectInput.js';
|
|
133
|
+
import '../popup/index.js';
|
|
134
|
+
import '../popup/Popup.js';
|
|
135
|
+
import 'react-transition-group';
|
|
136
|
+
import 'react-popper';
|
|
137
|
+
import '../_util/composeRefs.js';
|
|
138
|
+
import '../popup/hooks/useTriggerProps.js';
|
|
139
|
+
import '../_util/useClickOutside.js';
|
|
140
|
+
import '../popup/utils/getTransitionParams.js';
|
|
141
|
+
import '../_util/useWindowSize.js';
|
|
142
|
+
import '../popup/style/index.js';
|
|
143
|
+
import '../popup/type.js';
|
|
144
|
+
import '../select-input/useSingle.js';
|
|
145
|
+
import '../_chunks/dep-41ddaf4d.js';
|
|
146
|
+
import '../_chunks/dep-3ce0d185.js';
|
|
147
|
+
import '../_chunks/dep-b1d1fc8a.js';
|
|
148
|
+
import '../_chunks/dep-65dde75f.js';
|
|
149
|
+
import '../select-input/useMultiple.js';
|
|
150
|
+
import '../tag-input/index.js';
|
|
151
|
+
import '../tag-input/TagInput.js';
|
|
152
|
+
import '../_util/useDragSorter.js';
|
|
153
|
+
import '../tag-input/useTagScroll.js';
|
|
154
|
+
import '../tag-input/useTagList.js';
|
|
155
|
+
import '../tag/index.js';
|
|
156
|
+
import '../tag/Tag.js';
|
|
157
|
+
import '../tag/CheckTag.js';
|
|
158
|
+
import '../tag/style/index.js';
|
|
159
|
+
import '../tag/type.js';
|
|
160
|
+
import '../tag-input/useHover.js';
|
|
161
|
+
import '../tag-input/style/index.js';
|
|
162
|
+
import '../tag-input/type.js';
|
|
163
|
+
import '../select-input/useOverlayStyle.js';
|
|
164
|
+
import '../select-input/style/index.js';
|
|
165
|
+
import '../select-input/type.js';
|
|
166
|
+
import '../select/base/PopupContent.js';
|
|
167
|
+
import '../select/style/index.js';
|
|
168
|
+
import '../select/type.js';
|
|
169
|
+
import './components/panel/format/inputs.js';
|
|
170
|
+
import './components/panel/format/config.js';
|
|
171
|
+
import './components/panel/swatches.js';
|
|
172
|
+
|
|
173
|
+
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
174
|
+
|
|
175
|
+
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
176
|
+
|
|
177
|
+
var ColorPickerPanel = function ColorPickerPanel(props) {
|
|
178
|
+
return /* @__PURE__ */React.createElement(ColorPanel, _objectSpread(_objectSpread({}, props), {}, {
|
|
179
|
+
popupProps: null,
|
|
180
|
+
closeBtn: false
|
|
181
|
+
}));
|
|
182
|
+
};
|
|
183
|
+
|
|
184
|
+
ColorPickerPanel.displayName = "ColorPickerPanel";
|
|
185
|
+
var _ColorPickerPanel = /*#__PURE__*/React.memo(ColorPickerPanel);
|
|
186
|
+
|
|
187
|
+
export { _ColorPickerPanel as default };
|
|
188
|
+
//# sourceMappingURL=ColorPickerPanel.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ColorPickerPanel.js","sources":["../../src/color-picker/ColorPickerPanel.tsx"],"sourcesContent":["import React from 'react';\nimport ColorPanel from './components/panel';\nimport { ColorPickerProps } from './interface';\n\nconst ColorPickerPanel = (props: ColorPickerProps) => <ColorPanel {...props} popupProps={null} closeBtn={false} />;\n\nColorPickerPanel.displayName = 'ColorPickerPanel';\n\nexport default React.memo(ColorPickerPanel);\n"],"names":["ColorPickerPanel","props","React","createElement","ColorPanel","popupProps","closeBtn","displayName","memo"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEA,IAAMA,gBAAgB,GAAG,SAAnBA,gBAAmB,CAACC,KAAD,EAAA;AAAA,EAAA,sBAA2BC,KAAK,CAACC,aAAN,CAAoBC,UAApB,kCAC/CH,KAD+C,CAAA,EAAA,EAAA,EAAA;AAElDI,IAAAA,UAAU,EAAE,IAFsC;AAGlDC,IAAAA,QAAQ,EAAE,KAAA;AAHwC,GAA3B,CAAA,CAAA,CAAA;AAAA,CAAzB,CAAA;;AAKAN,gBAAgB,CAACO,WAAjB,GAA+B,kBAA/B,CAAA;AACA,wBAAA,aAAeL,KAAK,CAACM,IAAN,CAAWR,gBAAX,CAAf;;;;"}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* tdesign v0.31.1
|
|
3
|
+
* (c) 2022 tdesign
|
|
4
|
+
* @license MIT
|
|
5
|
+
*/
|
|
6
|
+
|
|
7
|
+
import { _ as _defineProperty } from '../../../_chunks/dep-1628aaec.js';
|
|
8
|
+
import { _ as _objectWithoutProperties } from '../../../_chunks/dep-ea842483.js';
|
|
9
|
+
import React from 'react';
|
|
10
|
+
import classNames from 'classnames';
|
|
11
|
+
import ColorSlider from './slider.js';
|
|
12
|
+
import '../../const.js';
|
|
13
|
+
import '../../../_util/useDrag.js';
|
|
14
|
+
|
|
15
|
+
var _excluded = ["color", "baseClassName", "onChange"];
|
|
16
|
+
|
|
17
|
+
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
18
|
+
|
|
19
|
+
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
20
|
+
|
|
21
|
+
var Alpha = function Alpha(props) {
|
|
22
|
+
var color = props.color,
|
|
23
|
+
baseClassName = props.baseClassName,
|
|
24
|
+
onChange = props.onChange,
|
|
25
|
+
rest = _objectWithoutProperties(props, _excluded);
|
|
26
|
+
|
|
27
|
+
var handleChange = function handleChange(v, isDragEnd) {
|
|
28
|
+
onChange(v / 100, isDragEnd);
|
|
29
|
+
};
|
|
30
|
+
|
|
31
|
+
var railStyle = {
|
|
32
|
+
background: "linear-gradient(to right, rgba(0, 0, 0, 0), ".concat(props.color.rgb, ")")
|
|
33
|
+
};
|
|
34
|
+
return /* @__PURE__ */React.createElement(ColorSlider, _objectSpread({
|
|
35
|
+
baseClassName: baseClassName,
|
|
36
|
+
className: classNames(["".concat(baseClassName, "__alpha"), "".concat(baseClassName, "--bg-alpha")]),
|
|
37
|
+
color: color,
|
|
38
|
+
value: color.alpha * 100,
|
|
39
|
+
onChange: handleChange,
|
|
40
|
+
railStyle: railStyle,
|
|
41
|
+
maxValue: 100
|
|
42
|
+
}, rest));
|
|
43
|
+
};
|
|
44
|
+
|
|
45
|
+
var AlphaSlider = /*#__PURE__*/React.memo(Alpha);
|
|
46
|
+
|
|
47
|
+
export { AlphaSlider as default };
|
|
48
|
+
//# sourceMappingURL=alpha.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"alpha.js","sources":["../../../../src/color-picker/components/panel/alpha.tsx"],"sourcesContent":["import React from 'react';\nimport classNames from 'classnames';\nimport ColorSlider from './slider';\nimport { TdColorBaseProps } from '../../interface';\n\nconst Alpha = (props: TdColorBaseProps) => {\n const { color, baseClassName, onChange, ...rest } = props;\n const handleChange = (v: number, isDragEnd?: boolean) => {\n onChange(v / 100, isDragEnd);\n };\n const railStyle = {\n background: `linear-gradient(to right, rgba(0, 0, 0, 0), ${props.color.rgb})`,\n };\n\n return (\n <ColorSlider\n baseClassName={baseClassName}\n className={classNames([`${baseClassName}__alpha`, `${baseClassName}--bg-alpha`])}\n color={color}\n value={color.alpha * 100}\n onChange={handleChange}\n railStyle={railStyle}\n maxValue={100}\n {...rest}\n />\n );\n};\n\nexport default React.memo(Alpha);\n"],"names":["Alpha","props","color","baseClassName","onChange","rest","handleChange","v","isDragEnd","railStyle","background","rgb","React","createElement","ColorSlider","className","classNames","value","alpha","maxValue","memo"],"mappings":";;;;;;;;;;;;;;;;;;;;AAGA,IAAMA,KAAK,GAAG,SAARA,KAAQ,CAACC,KAAD,EAAW;AACvB,EAAA,IAAQC,KAAR,GAAoDD,KAApD,CAAQC,KAAR;AAAA,MAAeC,aAAf,GAAoDF,KAApD,CAAeE,aAAf;AAAA,MAA8BC,QAA9B,GAAoDH,KAApD,CAA8BG,QAA9B;AAAA,MAA2CC,IAA3C,4BAAoDJ,KAApD,EAAA,SAAA,CAAA,CAAA;;AACA,EAAMK,IAAAA,YAAY,GAAG,SAAfA,YAAe,CAACC,CAAD,EAAIC,SAAJ,EAAkB;AACrCJ,IAAAA,QAAQ,CAACG,CAAC,GAAG,GAAL,EAAUC,SAAV,CAAR,CAAA;AACD,GAFD,CAAA;;AAGA,EAAA,IAAMC,SAAS,GAAG;AAChBC,IAAAA,UAAU,EAAiDT,8CAAAA,CAAAA,MAAAA,CAAAA,KAAK,CAACC,KAAN,CAAYS,GAA7D,EAAA,GAAA,CAAA;AADM,GAAlB,CAAA;AAGA,EAAA,sBAAuBC,KAAK,CAACC,aAAN,CAAoBC,WAApB,EAAA,aAAA,CAAA;AACrBX,IAAAA,aAAa,EAAbA,aADqB;AAErBY,IAAAA,SAAS,EAAEC,UAAU,CAAC,WAAIb,aAAJ,EAAA,SAAA,CAAA,EAAA,EAAA,CAAA,MAAA,CAA+B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