@fibrae/semi-foundation 0.1.1 → 0.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/anchor/foundation.d.ts +1 -1
- package/dist/anchor/foundation.js +21 -21
- package/dist/audio-player/foundation.d.ts +10 -10
- package/dist/audio-player/foundation.js +19 -19
- package/dist/auto-complete/foundation.d.ts +12 -12
- package/dist/auto-complete/foundation.js +51 -51
- package/dist/avatar/foundation.d.ts +5 -5
- package/dist/avatar/foundation.js +16 -16
- package/dist/backtop/foundation.d.ts +2 -2
- package/dist/backtop/foundation.js +7 -7
- package/dist/banner/foundation.d.ts +1 -1
- package/dist/banner/foundation.js +4 -4
- package/dist/base/auto-close-foundation.d.ts +8 -8
- package/dist/base/auto-close-foundation.js +15 -15
- package/dist/base/foundation.d.ts +4 -3
- package/dist/base/foundation.js +12 -11
- package/dist/breadcrumb/foundation.d.ts +5 -5
- package/dist/breadcrumb/foundation.js +9 -10
- package/dist/breadcrumb/item-foundation.d.ts +3 -3
- package/dist/breadcrumb/item-foundation.js +6 -6
- package/dist/calendar/event-util.js +1 -1
- package/dist/calendar/foundation.js +4 -4
- package/dist/calendar/month-foundation.d.ts +2 -2
- package/dist/calendar/month-foundation.js +6 -6
- package/dist/carousel/foundation.d.ts +17 -17
- package/dist/carousel/foundation.js +51 -51
- package/dist/cascader/foundation.d.ts +34 -26
- package/dist/cascader/foundation.js +143 -121
- package/dist/checkbox/checkbox-foundation.d.ts +2 -2
- package/dist/checkbox/checkbox-foundation.js +15 -15
- package/dist/checkbox/checkbox-group-foundation.d.ts +2 -2
- package/dist/checkbox/checkbox-group-foundation.js +8 -8
- package/dist/code-highlight/index.d.ts +1 -1
- package/dist/code-highlight/index.js +3 -3
- package/dist/collapse/foundation.d.ts +2 -2
- package/dist/collapse/foundation.js +7 -7
- package/dist/collapsible/foundation.d.ts +3 -3
- package/dist/collapsible/foundation.js +8 -8
- package/dist/color-picker/alpha-slider-foundation.d.ts +2 -4
- package/dist/color-picker/alpha-slider-foundation.js +10 -10
- package/dist/color-picker/color-choose-area-foundation.d.ts +2 -5
- package/dist/color-picker/color-choose-area-foundation.js +14 -14
- package/dist/color-picker/color-slider-foundation.d.ts +2 -4
- package/dist/color-picker/color-slider-foundation.js +10 -10
- package/dist/color-picker/data-part-foundation.d.ts +5 -5
- package/dist/color-picker/data-part-foundation.js +11 -11
- package/dist/color-picker/foundation.d.ts +4 -4
- package/dist/color-picker/foundation.js +10 -10
- package/dist/config-provider/breakpoint-observer.d.ts +3 -3
- package/dist/config-provider/breakpoint-observer.js +6 -6
- package/dist/cropper/foundation.d.ts +15 -15
- package/dist/cropper/foundation.js +26 -23
- package/dist/date-picker/_utils/picker-type.d.ts +1 -1
- package/dist/date-picker/foundation.d.ts +36 -36
- package/dist/date-picker/foundation.js +125 -129
- package/dist/date-picker/input-foundation.d.ts +9 -9
- package/dist/date-picker/input-foundation.js +28 -28
- package/dist/date-picker/months-grid-foundation.d.ts +16 -16
- package/dist/date-picker/months-grid-foundation.js +64 -65
- package/dist/date-picker/year-and-month-foundation.d.ts +3 -3
- package/dist/date-picker/year-and-month-foundation.js +11 -11
- package/dist/drag-move/foundation.d.ts +2 -2
- package/dist/drag-move/foundation.js +15 -13
- package/dist/dropdown/foundation.d.ts +8 -5
- package/dist/dropdown/foundation.js +32 -28
- package/dist/dropdown/menu-foundation.d.ts +1 -1
- package/dist/dropdown/menu-foundation.js +11 -11
- package/dist/feedback/foundation.d.ts +9 -9
- package/dist/feedback/foundation.js +33 -33
- package/dist/form/form-api-proxy.d.ts +8 -7
- package/dist/form/form-api-proxy.js +25 -25
- package/dist/form/foundation.d.ts +5 -5
- package/dist/form/foundation.js +60 -61
- package/dist/highlight/foundation.js +1 -1
- package/dist/hot-keys/foundation.d.ts +2 -2
- package/dist/hot-keys/foundation.js +5 -5
- package/dist/image/image-foundation.d.ts +4 -4
- package/dist/image/image-foundation.js +10 -10
- package/dist/image/preview-footer-foundation.d.ts +3 -3
- package/dist/image/preview-footer-foundation.js +10 -10
- package/dist/image/preview-foundation.js +7 -6
- package/dist/image/preview-image-foundation.d.ts +6 -8
- package/dist/image/preview-image-foundation.js +14 -14
- package/dist/image/preview-inner-foundation.d.ts +9 -9
- package/dist/image/preview-inner-foundation.js +38 -38
- package/dist/input/foundation.d.ts +10 -10
- package/dist/input/foundation.js +47 -49
- package/dist/input/text-entry-foundation.d.ts +3 -3
- package/dist/input/text-entry-foundation.js +14 -14
- package/dist/input/textarea-foundation.d.ts +7 -7
- package/dist/input/textarea-foundation.js +36 -36
- package/dist/input-number/foundation.d.ts +16 -14
- package/dist/input-number/foundation.js +54 -53
- package/dist/json-viewer/foundation.d.ts +8 -8
- package/dist/json-viewer/foundation.js +23 -23
- package/dist/lottie/foundation.d.ts +1 -1
- package/dist/lottie/foundation.js +4 -4
- package/dist/markdown-render/foundation.d.ts +1 -1
- package/dist/markdown-render/foundation.js +4 -4
- package/dist/modal/modal-content-foundation.d.ts +7 -7
- package/dist/modal/modal-content-foundation.js +20 -20
- package/dist/modal/modal-foundation.d.ts +6 -6
- package/dist/modal/modal-foundation.js +24 -24
- package/dist/navigation/foundation.d.ts +1 -1
- package/dist/navigation/foundation.js +14 -14
- package/dist/navigation/item-foundation.d.ts +1 -1
- package/dist/navigation/item-foundation.js +8 -8
- package/dist/navigation/sub-nav-foundation.d.ts +3 -3
- package/dist/navigation/sub-nav-foundation.js +17 -17
- package/dist/notification/notification-list-foundation.d.ts +7 -7
- package/dist/notification/notification-list-foundation.js +12 -12
- package/dist/overflow-list/foundation.d.ts +4 -4
- package/dist/overflow-list/foundation.js +18 -18
- package/dist/pagination/foundation.d.ts +8 -8
- package/dist/pagination/foundation.js +28 -28
- package/dist/pincode/foundation.d.ts +5 -5
- package/dist/pincode/foundation.js +22 -22
- package/dist/popconfirm/popconfirm-foundation.d.ts +7 -7
- package/dist/popconfirm/popconfirm-foundation.js +26 -26
- package/dist/radio/radio-foundation.d.ts +5 -5
- package/dist/radio/radio-foundation.js +15 -15
- package/dist/radio/radio-group-foundation.d.ts +2 -2
- package/dist/radio/radio-group-foundation.js +9 -9
- package/dist/rating/foundation.d.ts +10 -10
- package/dist/rating/foundation.js +35 -35
- package/dist/resizable/group/index.d.ts +6 -6
- package/dist/resizable/group/index.js +40 -40
- package/dist/resizable/single/index.d.ts +2 -2
- package/dist/resizable/single/index.js +9 -9
- package/dist/scroll-list/item-foundation.d.ts +7 -7
- package/dist/scroll-list/item-foundation.js +35 -35
- package/dist/select/foundation.d.ts +42 -56
- package/dist/select/foundation.js +214 -279
- package/dist/select/option-foundation.d.ts +23 -27
- package/dist/select/option-foundation.js +10 -18
- package/dist/side-sheet/side-sheet-foundation.d.ts +6 -6
- package/dist/side-sheet/side-sheet-foundation.js +22 -22
- package/dist/slider/foundation.d.ts +16 -16
- package/dist/slider/foundation.js +46 -46
- package/dist/sortable/accessibility.d.ts +1 -1
- package/dist/sortable/accessibility.js +2 -2
- package/dist/spin/foundation.d.ts +2 -2
- package/dist/spin/foundation.js +6 -6
- package/dist/steps/utils.d.ts +1 -1
- package/dist/switch/foundation.d.ts +2 -2
- package/dist/switch/foundation.js +7 -7
- package/dist/table/foundation.d.ts +14 -14
- package/dist/table/foundation.js +93 -93
- package/dist/table/utils.d.ts +2 -2
- package/dist/tabs/foundation.d.ts +5 -5
- package/dist/tabs/foundation.js +17 -17
- package/dist/tag-input/foundation.d.ts +11 -11
- package/dist/tag-input/foundation.js +52 -52
- package/dist/time-picker/foundation.d.ts +13 -13
- package/dist/time-picker/foundation.js +39 -39
- package/dist/time-picker/input-foundation.d.ts +4 -4
- package/dist/time-picker/input-foundation.js +13 -13
- package/dist/toast/toast-list-foundation.d.ts +7 -7
- package/dist/toast/toast-list-foundation.js +14 -14
- package/dist/tooltip/foundation.d.ts +9 -9
- package/dist/tooltip/foundation.js +67 -61
- package/dist/transfer/foundation.d.ts +22 -9
- package/dist/transfer/foundation.js +38 -23
- package/dist/tree/foundation.d.ts +14 -14
- package/dist/tree/foundation.js +61 -61
- package/dist/tree/shared.d.ts +1 -1
- package/dist/tree-select/foundation.d.ts +26 -20
- package/dist/tree-select/foundation.js +91 -83
- package/dist/typography/ellipsis.d.ts +4 -4
- package/dist/typography/ellipsis.js +8 -8
- package/dist/typography/format-numeral.d.ts +1 -1
- package/dist/typography/format-numeral.js +2 -2
- package/dist/upload/constants.d.ts +1 -1
- package/dist/upload/foundation.d.ts +17 -17
- package/dist/upload/foundation.js +92 -92
- package/dist/upload/utils.d.ts +3 -3
- package/dist/upload/utils.js +6 -6
- package/dist/user-guide/foundation.d.ts +3 -3
- package/dist/user-guide/foundation.js +19 -19
- package/dist/utils/a11y.d.ts +1 -1
- package/dist/utils/announcer.d.ts +2 -2
- package/dist/utils/announcer.js +4 -4
- package/dist/utils/focus-handle.d.ts +1 -1
- package/dist/utils/focus-handle.js +1 -2
- package/dist/utils/focus-scope.d.ts +5 -5
- package/dist/utils/focus-scope.js +10 -10
- package/dist/utils/is-promise.d.ts +1 -1
- package/dist/utils/release-holder.d.ts +2 -2
- package/dist/utils/release-holder.js +4 -4
- package/dist/video-player/foundation.d.ts +15 -15
- package/dist/video-player/foundation.js +89 -89
- package/dist/video-player/progress-foundation.d.ts +2 -2
- package/dist/video-player/progress-foundation.js +12 -12
- package/package.json +2 -2
|
@@ -16,6 +16,6 @@ export interface CheckboxGroupAdapter<P extends CheckboxGroupBaseProps = Checkbo
|
|
|
16
16
|
export default class CheckboxGroupFoundation<P extends CheckboxGroupBaseProps = CheckboxGroupBaseProps, S extends CheckboxGroupBaseState = CheckboxGroupBaseState> extends BaseFoundation<CheckboxGroupAdapter<P, S>, P, S> {
|
|
17
17
|
static deriveValue(props: CheckboxGroupBaseProps, state: CheckboxGroupBaseState): CheckboxValue[];
|
|
18
18
|
init(): void;
|
|
19
|
-
handleChange(evt: BasicCheckboxEvent)
|
|
20
|
-
handlePropValueChange(newPropValue: unknown)
|
|
19
|
+
handleChange: (evt: BasicCheckboxEvent) => void;
|
|
20
|
+
handlePropValueChange: (newPropValue: unknown) => void;
|
|
21
21
|
}
|
|
@@ -10,19 +10,19 @@ var CheckboxGroupFoundation = class CheckboxGroupFoundation extends BaseFoundati
|
|
|
10
10
|
if (typeof defaultValue !== "undefined" && !Array.isArray(defaultValue)) warning(true, "Warning: [Semi CheckboxGroup] defaultValue should be an Array");
|
|
11
11
|
if (typeof value !== "undefined" && !Array.isArray(value)) warning(true, "Warning: [Semi CheckboxGroup] value should be an Array");
|
|
12
12
|
}
|
|
13
|
-
handleChange(evt) {
|
|
13
|
+
handleChange = (evt) => {
|
|
14
14
|
const prevValue = CheckboxGroupFoundation.deriveValue(this.getProps(), this.getStates());
|
|
15
15
|
const { checked, value } = evt.target;
|
|
16
16
|
const newValue = checked ? [...prevValue, value] : prevValue.filter((item) => item !== value);
|
|
17
|
-
if (!this.
|
|
18
|
-
this.
|
|
19
|
-
}
|
|
20
|
-
handlePropValueChange(newPropValue) {
|
|
21
|
-
if (Array.isArray(newPropValue)) this.
|
|
17
|
+
if (!this.isControlledComponent()) this.adapter.updateGroupValue(newValue);
|
|
18
|
+
this.adapter.notifyChange(newValue);
|
|
19
|
+
};
|
|
20
|
+
handlePropValueChange = (newPropValue) => {
|
|
21
|
+
if (Array.isArray(newPropValue)) this.adapter.updateGroupValue(newPropValue);
|
|
22
22
|
else {
|
|
23
|
-
if (typeof newPropValue === "undefined") this.
|
|
23
|
+
if (typeof newPropValue === "undefined") this.adapter.updateGroupValue([]);
|
|
24
24
|
warning(true, "Warning: [Semi CheckboxGroup] value should be an Array");
|
|
25
25
|
}
|
|
26
|
-
}
|
|
26
|
+
};
|
|
27
27
|
};
|
|
28
28
|
export { CheckboxGroupFoundation as default };
|
|
@@ -21,5 +21,5 @@ export interface CodeHighlightAdapter<P extends CodeHighlightBaseProps = CodeHig
|
|
|
21
21
|
export default class CodeHighlightFoundation<P extends CodeHighlightBaseProps = CodeHighlightBaseProps, S extends CodeHighlightBaseState = CodeHighlightBaseState> extends BaseFoundation<CodeHighlightAdapter<P, S>, P, S> {
|
|
22
22
|
#private;
|
|
23
23
|
destroy(): void;
|
|
24
|
-
highlightCode()
|
|
24
|
+
highlightCode: () => Promise<void>;
|
|
25
25
|
}
|
|
@@ -5,7 +5,7 @@ var CodeHighlightFoundation = class extends BaseFoundation {
|
|
|
5
5
|
destroy() {
|
|
6
6
|
this.#requestId++;
|
|
7
7
|
}
|
|
8
|
-
async
|
|
8
|
+
highlightCode = async () => {
|
|
9
9
|
const { code = "", language, languages, themes } = this.getProps();
|
|
10
10
|
const requestId = ++this.#requestId;
|
|
11
11
|
const { highlight } = await import("./highlighter.js");
|
|
@@ -13,7 +13,7 @@ var CodeHighlightFoundation = class extends BaseFoundation {
|
|
|
13
13
|
languages,
|
|
14
14
|
themes
|
|
15
15
|
});
|
|
16
|
-
if (requestId === this.#requestId) this.
|
|
17
|
-
}
|
|
16
|
+
if (requestId === this.#requestId) this.adapter.setHtml(html, code);
|
|
17
|
+
};
|
|
18
18
|
};
|
|
19
19
|
export { CodeHighlightFoundation as default };
|
|
@@ -42,6 +42,6 @@ export default class CollapseFoundation<E = unknown> extends BaseFoundation<Coll
|
|
|
42
42
|
lazyRender: boolean;
|
|
43
43
|
everOpened: boolean;
|
|
44
44
|
}): boolean;
|
|
45
|
-
syncActiveKey(activeKey: CollapseProps[
|
|
46
|
-
handleChange(newKey: string, e: E)
|
|
45
|
+
syncActiveKey: (activeKey: CollapseProps["activeKey"]) => void;
|
|
46
|
+
handleChange: (newKey: string, e: E) => void;
|
|
47
47
|
}
|
|
@@ -25,20 +25,20 @@ var CollapseFoundation = class CollapseFoundation extends BaseFoundation {
|
|
|
25
25
|
static isContentMounted({ hasBody, active, keepDOM, lazyRender, everOpened }) {
|
|
26
26
|
return hasBody && (active || keepDOM && (!lazyRender || everOpened));
|
|
27
27
|
}
|
|
28
|
-
syncActiveKey(activeKey) {
|
|
28
|
+
syncActiveKey = (activeKey) => {
|
|
29
29
|
if (activeKey !== void 0) {
|
|
30
30
|
const newSet = toSet(activeKey);
|
|
31
|
-
if (!isEqual(newSet, this.getStates().activeSet)) this.
|
|
31
|
+
if (!isEqual(newSet, this.getStates().activeSet)) this.adapter.setActiveSet(newSet);
|
|
32
32
|
}
|
|
33
|
-
}
|
|
34
|
-
handleChange(newKey, e) {
|
|
33
|
+
};
|
|
34
|
+
handleChange = (newKey, e) => {
|
|
35
35
|
const { activeKey, accordion } = this.getProps();
|
|
36
36
|
let newSet = new Set(CollapseFoundation.deriveActiveSet(this.getProps(), this.getStates()));
|
|
37
37
|
if (newSet.has(newKey)) newSet.delete(newKey);
|
|
38
38
|
else if (accordion) newSet = /* @__PURE__ */ new Set([newKey]);
|
|
39
39
|
else newSet.add(newKey);
|
|
40
|
-
this.
|
|
41
|
-
if (typeof activeKey === "undefined") this.
|
|
42
|
-
}
|
|
40
|
+
this.adapter.notifyChange([...newSet.values()], e);
|
|
41
|
+
if (typeof activeKey === "undefined") this.adapter.setActiveSet(newSet);
|
|
42
|
+
};
|
|
43
43
|
};
|
|
44
44
|
export { CollapseFoundation as default };
|
|
@@ -56,13 +56,13 @@ export default class CollapsibleFoundation<P extends CollapsibleBaseProps = Coll
|
|
|
56
56
|
* height animates between measured lengths instead and its end stands in for the transitionend. Removable, with
|
|
57
57
|
* the max-height rule of collapsible.scss, once Firefox and Safari support calc-size().
|
|
58
58
|
*/
|
|
59
|
-
handleOpenChange()
|
|
59
|
+
handleOpenChange: () => void;
|
|
60
60
|
/**
|
|
61
61
|
* `isSelf`: the event comes from the wrapper, not bubbling from the content. Only `height` is awaited: toggling
|
|
62
62
|
* `isOpen` always transitions it, even when `fade` also animates `opacity`.
|
|
63
63
|
*/
|
|
64
|
-
handleTransitionEnd({ isSelf, propertyName }: {
|
|
64
|
+
handleTransitionEnd: ({ isSelf, propertyName }: {
|
|
65
65
|
isSelf: boolean;
|
|
66
66
|
propertyName: string;
|
|
67
|
-
})
|
|
67
|
+
}) => void;
|
|
68
68
|
}
|
|
@@ -75,9 +75,9 @@ var CollapsibleFoundation = class CollapsibleFoundation extends BaseFoundation {
|
|
|
75
75
|
* height animates between measured lengths instead and its end stands in for the transitionend. Removable, with
|
|
76
76
|
* the max-height rule of collapsible.scss, once Firefox and Safari support calc-size().
|
|
77
77
|
*/
|
|
78
|
-
handleOpenChange() {
|
|
78
|
+
handleOpenChange = () => {
|
|
79
79
|
const { isOpen, duration, collapseHeight, collapseHeightAdaptive } = this.getProps();
|
|
80
|
-
const wrapper = this.
|
|
80
|
+
const wrapper = this.adapter.getWrapper();
|
|
81
81
|
if (!wrapper || !CollapsibleFoundation.hasMotion(this.getProps()) || CSS.supports("height", "calc-size(auto, size)")) return;
|
|
82
82
|
const current = this.#heightAnimation && this.#heightAnimation.playState !== "finished" ? wrapper.offsetHeight : void 0;
|
|
83
83
|
this.#heightAnimation?.cancel();
|
|
@@ -108,16 +108,16 @@ var CollapsibleFoundation = class CollapsibleFoundation extends BaseFoundation {
|
|
|
108
108
|
});
|
|
109
109
|
}
|
|
110
110
|
}, () => void 0);
|
|
111
|
-
}
|
|
111
|
+
};
|
|
112
112
|
/**
|
|
113
113
|
* `isSelf`: the event comes from the wrapper, not bubbling from the content. Only `height` is awaited: toggling
|
|
114
114
|
* `isOpen` always transitions it, even when `fade` also animates `opacity`.
|
|
115
115
|
*/
|
|
116
|
-
handleTransitionEnd({ isSelf, propertyName }) {
|
|
116
|
+
handleTransitionEnd = ({ isSelf, propertyName }) => {
|
|
117
117
|
if (!isSelf || propertyName !== "height") return;
|
|
118
|
-
if (!this.getProp("isOpen")) this.
|
|
119
|
-
this.
|
|
120
|
-
this.
|
|
121
|
-
}
|
|
118
|
+
if (!this.getProp("isOpen")) this.adapter.setVisible(false);
|
|
119
|
+
this.adapter.setIsTransitioning(false);
|
|
120
|
+
this.adapter.notifyMotionEnd();
|
|
121
|
+
};
|
|
122
122
|
};
|
|
123
123
|
export { CollapsibleFoundation as default };
|
|
@@ -15,15 +15,13 @@ export interface AlphaSliderAdapter<P extends AlphaSliderBaseProps = AlphaSlider
|
|
|
15
15
|
getDOM: () => HTMLDivElement;
|
|
16
16
|
}
|
|
17
17
|
export default class AlphaSliderFoundation<P extends AlphaSliderBaseProps = AlphaSliderBaseProps, S extends AlphaSliderBaseState = AlphaSliderBaseState> extends BaseFoundation<AlphaSliderAdapter<P, S>, P, S> {
|
|
18
|
+
#private;
|
|
18
19
|
constructor(adapter: AlphaSliderAdapter<P, S>);
|
|
19
20
|
/** Captures the pointer from the press, so moves and release arrive outside the slider too */
|
|
20
21
|
handlePointerDown: (e: DragPointerEvent) => void;
|
|
21
22
|
handlePointerMove: (e: DragPointerEvent) => void;
|
|
22
23
|
/** Follows pointerup and pointercancel; also fires when the slider leaves the page mid-drag */
|
|
23
24
|
handleLostPointerCapture: () => void;
|
|
24
|
-
setValue(percent: number)
|
|
25
|
+
setValue: (percent: number) => void;
|
|
25
26
|
handleKeyDown: (e: RangeKeyEvent) => void;
|
|
26
|
-
pickByPointer: (e: {
|
|
27
|
-
clientX: number;
|
|
28
|
-
}) => void;
|
|
29
27
|
}
|
|
@@ -7,23 +7,29 @@ var AlphaSliderFoundation = class extends BaseFoundation {
|
|
|
7
7
|
constructor(adapter) {
|
|
8
8
|
super({ ...adapter });
|
|
9
9
|
}
|
|
10
|
+
#pickByPointer(e) {
|
|
11
|
+
const rect = this.adapter.getDOM()?.getBoundingClientRect();
|
|
12
|
+
if (!rect) return;
|
|
13
|
+
const { width, foundation } = this.getProps();
|
|
14
|
+
foundation.handleAlphaChangeByHandle({ a: Number(clamp((e.clientX - rect.x) / width, 0, 1).toFixed(2)) });
|
|
15
|
+
}
|
|
10
16
|
/** Captures the pointer from the press, so moves and release arrive outside the slider too */
|
|
11
17
|
handlePointerDown = (e) => {
|
|
12
18
|
if (isSecondaryPress(e)) return;
|
|
13
19
|
e.currentTarget.setPointerCapture(e.pointerId);
|
|
14
20
|
this.setState({ isHandleGrabbing: true });
|
|
15
|
-
this
|
|
21
|
+
this.#pickByPointer(e);
|
|
16
22
|
};
|
|
17
23
|
handlePointerMove = (e) => {
|
|
18
|
-
if (this.getState("isHandleGrabbing")) this
|
|
24
|
+
if (this.getState("isHandleGrabbing")) this.#pickByPointer(e);
|
|
19
25
|
};
|
|
20
26
|
/** Follows pointerup and pointercancel; also fires when the slider leaves the page mid-drag */
|
|
21
27
|
handleLostPointerCapture = () => {
|
|
22
28
|
this.setState({ isHandleGrabbing: false });
|
|
23
29
|
};
|
|
24
|
-
setValue(percent) {
|
|
30
|
+
setValue = (percent) => {
|
|
25
31
|
this.getProps().foundation.handleAlphaChangeByHandle({ a: percent / 100 });
|
|
26
|
-
}
|
|
32
|
+
};
|
|
27
33
|
handleKeyDown = (e) => {
|
|
28
34
|
if (e.altKey || e.ctrlKey || e.metaKey) return;
|
|
29
35
|
const percent = ColorPickerFoundation.getValueByKey(e.key, this.getProps().hsva.a * 100, 100);
|
|
@@ -31,11 +37,5 @@ var AlphaSliderFoundation = class extends BaseFoundation {
|
|
|
31
37
|
e.preventDefault();
|
|
32
38
|
this.setValue(percent);
|
|
33
39
|
};
|
|
34
|
-
pickByPointer = (e) => {
|
|
35
|
-
const rect = this._adapter.getDOM()?.getBoundingClientRect();
|
|
36
|
-
if (!rect) return;
|
|
37
|
-
const { width, foundation } = this.getProps();
|
|
38
|
-
foundation.handleAlphaChangeByHandle({ a: Number(clamp((e.clientX - rect.x) / width, 0, 1).toFixed(2)) });
|
|
39
|
-
};
|
|
40
40
|
};
|
|
41
41
|
export { AlphaSliderFoundation as default };
|
|
@@ -21,16 +21,13 @@ export interface ColorChooseAreaAdapter<P extends ColorChooseAreaBaseProps = Col
|
|
|
21
21
|
}) => void;
|
|
22
22
|
}
|
|
23
23
|
export default class ColorChooseAreaFoundation<P extends ColorChooseAreaBaseProps = ColorChooseAreaBaseProps, S extends ColorChooseAreaBaseState = ColorChooseAreaBaseState> extends BaseFoundation<ColorChooseAreaAdapter<P, S>, P, S> {
|
|
24
|
+
#private;
|
|
24
25
|
constructor(adapter: ColorChooseAreaAdapter<P, S>);
|
|
25
|
-
setValue(axis:
|
|
26
|
+
setValue: (axis: "s" | "v", value: number) => void;
|
|
26
27
|
handleKeyDown: (focusedAxis: "s" | "v", e: RangeKeyEvent) => void;
|
|
27
28
|
/** Captures the pointer from the press; positions outside pick the nearest edge or corner */
|
|
28
29
|
handlePointerDown: (e: DragPointerEvent) => void;
|
|
29
30
|
handlePointerMove: (e: DragPointerEvent) => void;
|
|
30
31
|
/** Follows pointerup and pointercancel; also fires when the area leaves the page mid-drag */
|
|
31
32
|
handleLostPointerCapture: () => void;
|
|
32
|
-
pickByPointer: (e: {
|
|
33
|
-
clientX: number;
|
|
34
|
-
clientY: number;
|
|
35
|
-
}) => void;
|
|
36
33
|
}
|
|
@@ -7,14 +7,23 @@ var ColorChooseAreaFoundation = class extends BaseFoundation {
|
|
|
7
7
|
constructor(adapter) {
|
|
8
8
|
super({ ...adapter });
|
|
9
9
|
}
|
|
10
|
-
|
|
10
|
+
#pickByPointer(e) {
|
|
11
|
+
const rect = this.adapter.getDOM()?.getBoundingClientRect();
|
|
12
|
+
if (!rect) return;
|
|
13
|
+
const { width, height } = this.getProps();
|
|
14
|
+
this.adapter.notifyChange({
|
|
15
|
+
s: Math.round(clamp((e.clientX - rect.x) / width, 0, 1) * 100),
|
|
16
|
+
v: Math.round(100 - clamp((e.clientY - rect.y) / height, 0, 1) * 100)
|
|
17
|
+
});
|
|
18
|
+
}
|
|
19
|
+
setValue = (axis, value) => {
|
|
11
20
|
const { hsva } = this.getProps();
|
|
12
|
-
this.
|
|
21
|
+
this.adapter.notifyChange({
|
|
13
22
|
s: hsva.s,
|
|
14
23
|
v: hsva.v,
|
|
15
24
|
[axis]: value
|
|
16
25
|
});
|
|
17
|
-
}
|
|
26
|
+
};
|
|
18
27
|
handleKeyDown = (focusedAxis, e) => {
|
|
19
28
|
if (e.altKey || e.ctrlKey || e.metaKey) return;
|
|
20
29
|
let axis = focusedAxis;
|
|
@@ -35,23 +44,14 @@ var ColorChooseAreaFoundation = class extends BaseFoundation {
|
|
|
35
44
|
if (isSecondaryPress(e)) return;
|
|
36
45
|
e.currentTarget.setPointerCapture(e.pointerId);
|
|
37
46
|
this.setState({ isHandleGrabbing: true });
|
|
38
|
-
this
|
|
47
|
+
this.#pickByPointer(e);
|
|
39
48
|
};
|
|
40
49
|
handlePointerMove = (e) => {
|
|
41
|
-
if (this.getState("isHandleGrabbing")) this
|
|
50
|
+
if (this.getState("isHandleGrabbing")) this.#pickByPointer(e);
|
|
42
51
|
};
|
|
43
52
|
/** Follows pointerup and pointercancel; also fires when the area leaves the page mid-drag */
|
|
44
53
|
handleLostPointerCapture = () => {
|
|
45
54
|
this.setState({ isHandleGrabbing: false });
|
|
46
55
|
};
|
|
47
|
-
pickByPointer = (e) => {
|
|
48
|
-
const rect = this._adapter.getDOM()?.getBoundingClientRect();
|
|
49
|
-
if (!rect) return;
|
|
50
|
-
const { width, height } = this.getProps();
|
|
51
|
-
this._adapter.notifyChange({
|
|
52
|
-
s: Math.round(clamp((e.clientX - rect.x) / width, 0, 1) * 100),
|
|
53
|
-
v: Math.round(100 - clamp((e.clientY - rect.y) / height, 0, 1) * 100)
|
|
54
|
-
});
|
|
55
|
-
};
|
|
56
56
|
};
|
|
57
57
|
export { ColorChooseAreaFoundation as default };
|
|
@@ -15,15 +15,13 @@ export interface ColorSliderAdapter<P extends ColorSliderBaseProps = ColorSlider
|
|
|
15
15
|
getDOM: () => HTMLDivElement;
|
|
16
16
|
}
|
|
17
17
|
export default class ColorSliderFoundation<P extends ColorSliderBaseProps = ColorSliderBaseProps, S extends ColorSliderBaseState = ColorSliderBaseState> extends BaseFoundation<ColorSliderAdapter<P, S>, P, S> {
|
|
18
|
+
#private;
|
|
18
19
|
constructor(adapter: ColorSliderAdapter<P, S>);
|
|
19
20
|
/** Captures the pointer from the press, so moves and release arrive outside the slider too */
|
|
20
21
|
handlePointerDown: (e: DragPointerEvent) => void;
|
|
21
22
|
handlePointerMove: (e: DragPointerEvent) => void;
|
|
22
23
|
/** Follows pointerup and pointercancel; also fires when the slider leaves the page mid-drag */
|
|
23
24
|
handleLostPointerCapture: () => void;
|
|
24
|
-
setValue(h: number)
|
|
25
|
+
setValue: (h: number) => void;
|
|
25
26
|
handleKeyDown: (e: RangeKeyEvent) => void;
|
|
26
|
-
pickByPointer: (e: {
|
|
27
|
-
clientX: number;
|
|
28
|
-
}) => void;
|
|
29
27
|
}
|
|
@@ -7,23 +7,29 @@ var ColorSliderFoundation = class extends BaseFoundation {
|
|
|
7
7
|
constructor(adapter) {
|
|
8
8
|
super({ ...adapter });
|
|
9
9
|
}
|
|
10
|
+
#pickByPointer(e) {
|
|
11
|
+
const rect = this.adapter.getDOM()?.getBoundingClientRect();
|
|
12
|
+
if (!rect) return;
|
|
13
|
+
const { width, foundation } = this.getProps();
|
|
14
|
+
foundation.handleColorChangeByHandle({ h: Math.round(clamp((e.clientX - rect.x) / width, 0, 1) * 360) });
|
|
15
|
+
}
|
|
10
16
|
/** Captures the pointer from the press, so moves and release arrive outside the slider too */
|
|
11
17
|
handlePointerDown = (e) => {
|
|
12
18
|
if (isSecondaryPress(e)) return;
|
|
13
19
|
e.currentTarget.setPointerCapture(e.pointerId);
|
|
14
20
|
this.setState({ isHandleGrabbing: true });
|
|
15
|
-
this
|
|
21
|
+
this.#pickByPointer(e);
|
|
16
22
|
};
|
|
17
23
|
handlePointerMove = (e) => {
|
|
18
|
-
if (this.getState("isHandleGrabbing")) this
|
|
24
|
+
if (this.getState("isHandleGrabbing")) this.#pickByPointer(e);
|
|
19
25
|
};
|
|
20
26
|
/** Follows pointerup and pointercancel; also fires when the slider leaves the page mid-drag */
|
|
21
27
|
handleLostPointerCapture = () => {
|
|
22
28
|
this.setState({ isHandleGrabbing: false });
|
|
23
29
|
};
|
|
24
|
-
setValue(h) {
|
|
30
|
+
setValue = (h) => {
|
|
25
31
|
this.getProps().foundation.handleColorChangeByHandle({ h });
|
|
26
|
-
}
|
|
32
|
+
};
|
|
27
33
|
handleKeyDown = (e) => {
|
|
28
34
|
if (e.altKey || e.ctrlKey || e.metaKey) return;
|
|
29
35
|
const h = ColorPickerFoundation.getValueByKey(e.key, this.getProps().hue, 360);
|
|
@@ -31,11 +37,5 @@ var ColorSliderFoundation = class extends BaseFoundation {
|
|
|
31
37
|
e.preventDefault();
|
|
32
38
|
this.setValue(h);
|
|
33
39
|
};
|
|
34
|
-
pickByPointer = (e) => {
|
|
35
|
-
const rect = this._adapter.getDOM()?.getBoundingClientRect();
|
|
36
|
-
if (!rect) return;
|
|
37
|
-
const { width, foundation } = this.getProps();
|
|
38
|
-
foundation.handleColorChangeByHandle({ h: Math.round(clamp((e.clientX - rect.x) / width, 0, 1) * 360) });
|
|
39
|
-
};
|
|
40
40
|
};
|
|
41
41
|
export { ColorSliderFoundation as default };
|
|
@@ -18,11 +18,11 @@ export default class DataPartFoundation<P extends DataPartBaseProps = DataPartBa
|
|
|
18
18
|
#private;
|
|
19
19
|
constructor(adapter: DataPartAdapter<P, S>);
|
|
20
20
|
static getInputValue(currentColor: ColorValue, format: ColorFormat): string;
|
|
21
|
-
syncInputValue()
|
|
21
|
+
syncInputValue: () => void;
|
|
22
22
|
/** Whether the text box already says `color`, so it must not overwrite what is being typed */
|
|
23
|
-
isInputValueOf(color: ColorValue)
|
|
24
|
-
getValueByInputValue(value: string)
|
|
23
|
+
isInputValueOf: (color: ColorValue) => boolean;
|
|
24
|
+
getValueByInputValue: (value: string) => string | false | RgbaColor | HsvaColor;
|
|
25
25
|
handlePickValueWithStraw: () => Promise<void>;
|
|
26
|
-
handleInputValueChange(value: string)
|
|
27
|
-
handleFormatChange(format: ColorFormat)
|
|
26
|
+
handleInputValueChange: (value: string) => void;
|
|
27
|
+
handleFormatChange: (format: ColorFormat) => void;
|
|
28
28
|
}
|
|
@@ -23,17 +23,17 @@ var DataPartFoundation = class DataPartFoundation extends BaseFoundation {
|
|
|
23
23
|
else if (format === "hsva") return `${hsva.h},${hsva.s},${hsva.v}`;
|
|
24
24
|
else return hex.slice(0, 7);
|
|
25
25
|
}
|
|
26
|
-
syncInputValue() {
|
|
26
|
+
syncInputValue = () => {
|
|
27
27
|
this.setState({ inputValue: DataPartFoundation.getInputValue(this.getProp("currentColor"), this.getState("format")) });
|
|
28
|
-
}
|
|
28
|
+
};
|
|
29
29
|
/** Whether the text box already says `color`, so it must not overwrite what is being typed */
|
|
30
|
-
isInputValueOf(color) {
|
|
30
|
+
isInputValueOf = (color) => {
|
|
31
31
|
const { format, inputValue } = this.getStates();
|
|
32
32
|
const parsed = this.getValueByInputValue(inputValue);
|
|
33
33
|
if (!parsed || format === "hex" && !inputValue.startsWith("#")) return false;
|
|
34
34
|
return isEqual(ColorPickerFoundation.getColorValue(parsed, format, Boolean(this.getProp("alpha"))), color);
|
|
35
|
-
}
|
|
36
|
-
getValueByInputValue(value) {
|
|
35
|
+
};
|
|
36
|
+
getValueByInputValue = (value) => {
|
|
37
37
|
const { format } = this.getStates();
|
|
38
38
|
if (format === "rgba" || format === "hsva") {
|
|
39
39
|
const parsed = format === "rgba" ? split(value, "rgba") : split(value, "hsva");
|
|
@@ -48,7 +48,7 @@ var DataPartFoundation = class DataPartFoundation extends BaseFoundation {
|
|
|
48
48
|
if (/^#[0-9a-f]{8}$/i.test(value)) return value;
|
|
49
49
|
}
|
|
50
50
|
return false;
|
|
51
|
-
}
|
|
51
|
+
};
|
|
52
52
|
handlePickValueWithStraw = async () => {
|
|
53
53
|
const colorPickerFoundation = this.getProps().foundation;
|
|
54
54
|
if (!window.EyeDropper) return;
|
|
@@ -63,14 +63,14 @@ var DataPartFoundation = class DataPartFoundation extends BaseFoundation {
|
|
|
63
63
|
if (!(e instanceof DOMException && e.name === "AbortError")) throw e;
|
|
64
64
|
}
|
|
65
65
|
};
|
|
66
|
-
handleInputValueChange(value) {
|
|
67
|
-
this.
|
|
68
|
-
}
|
|
69
|
-
handleFormatChange(format) {
|
|
66
|
+
handleInputValueChange = (value) => {
|
|
67
|
+
this.adapter.setState({ inputValue: value });
|
|
68
|
+
};
|
|
69
|
+
handleFormatChange = (format) => {
|
|
70
70
|
this.setState({
|
|
71
71
|
format,
|
|
72
72
|
inputValue: DataPartFoundation.getInputValue(this.getProp("currentColor"), format)
|
|
73
73
|
});
|
|
74
|
-
}
|
|
74
|
+
};
|
|
75
75
|
};
|
|
76
76
|
export { DataPartFoundation as default };
|
|
@@ -45,11 +45,11 @@ export default class ColorPickerFoundation<P extends ColorPickerProps = ColorPic
|
|
|
45
45
|
*/
|
|
46
46
|
static getValueByKey(key: string, value: number, max: number): number;
|
|
47
47
|
/** After a controlled `value` is dropped, the uncontrolled state restarts from `defaultValue` */
|
|
48
|
-
resetToDefault()
|
|
49
|
-
handleChange(color: HsvaColor | RgbaColor | string, format: ColorFormat)
|
|
50
|
-
handleAlphaChangeByHandle(newAlpha: {
|
|
48
|
+
resetToDefault: () => void;
|
|
49
|
+
handleChange: (color: HsvaColor | RgbaColor | string, format: ColorFormat) => void;
|
|
50
|
+
handleAlphaChangeByHandle: (newAlpha: {
|
|
51
51
|
a: number;
|
|
52
|
-
})
|
|
52
|
+
}) => void;
|
|
53
53
|
handleColorChangeByHandle(newHue: {
|
|
54
54
|
h: number;
|
|
55
55
|
}): void;
|
|
@@ -8,8 +8,8 @@ var ColorPickerFoundation = class ColorPickerFoundation extends BaseFoundation {
|
|
|
8
8
|
super({ ...adapter });
|
|
9
9
|
}
|
|
10
10
|
#commit(color) {
|
|
11
|
-
this.
|
|
12
|
-
if (!this.
|
|
11
|
+
this.adapter.notifyChange(color);
|
|
12
|
+
if (!this.isControlledComponent("value")) this.adapter.setState({ currentColor: color });
|
|
13
13
|
}
|
|
14
14
|
handleChangeH(currentColor, newH) {
|
|
15
15
|
const hsva = {
|
|
@@ -38,7 +38,7 @@ var ColorPickerFoundation = class ColorPickerFoundation extends BaseFoundation {
|
|
|
38
38
|
});
|
|
39
39
|
}
|
|
40
40
|
getCurrentColor() {
|
|
41
|
-
return this.
|
|
41
|
+
return this.isControlledComponent("value") ? this.getProp("value") ?? this.getProp("defaultValue") : this.getState("currentColor");
|
|
42
42
|
}
|
|
43
43
|
/** The full color of a value given in `format`; without alpha support the opacity is dropped */
|
|
44
44
|
static getColorValue(color, format, alpha) {
|
|
@@ -133,15 +133,15 @@ var ColorPickerFoundation = class ColorPickerFoundation extends BaseFoundation {
|
|
|
133
133
|
}
|
|
134
134
|
}
|
|
135
135
|
/** After a controlled `value` is dropped, the uncontrolled state restarts from `defaultValue` */
|
|
136
|
-
resetToDefault() {
|
|
137
|
-
this.
|
|
138
|
-
}
|
|
139
|
-
handleChange(color, format) {
|
|
136
|
+
resetToDefault = () => {
|
|
137
|
+
this.adapter.setState({ currentColor: this.getProp("defaultValue") });
|
|
138
|
+
};
|
|
139
|
+
handleChange = (color, format) => {
|
|
140
140
|
this.#commit(ColorPickerFoundation.getColorValue(color, format, Boolean(this.getProp("alpha"))));
|
|
141
|
-
}
|
|
142
|
-
handleAlphaChangeByHandle(newAlpha) {
|
|
141
|
+
};
|
|
142
|
+
handleAlphaChangeByHandle = (newAlpha) => {
|
|
143
143
|
this.handleChangeA(this.getCurrentColor(), newAlpha.a);
|
|
144
|
-
}
|
|
144
|
+
};
|
|
145
145
|
handleColorChangeByHandle(newHue) {
|
|
146
146
|
this.handleChangeH(this.getCurrentColor(), newHue.h);
|
|
147
147
|
}
|
|
@@ -13,9 +13,9 @@ export interface ObserveProps {
|
|
|
13
13
|
export default class BreakpointObserver {
|
|
14
14
|
#private;
|
|
15
15
|
constructor(props: ObserveProps, render: (screens: BreakpointScreens) => void);
|
|
16
|
-
sync(props: ObserveProps)
|
|
17
|
-
commit()
|
|
18
|
-
destroy()
|
|
16
|
+
sync: (props: ObserveProps) => void;
|
|
17
|
+
commit: () => void;
|
|
18
|
+
destroy: () => void;
|
|
19
19
|
subscribe: {
|
|
20
20
|
(callback: OnBreakpointScreensCallback): () => void;
|
|
21
21
|
(breakpoints: Breakpoint[], callback: OnBreakpointChangeCallback): () => void;
|
|
@@ -81,10 +81,10 @@ var BreakpointObserver = class {
|
|
|
81
81
|
if (!breakpoints || breakpoints.includes(screen)) callback(screen, matches);
|
|
82
82
|
});
|
|
83
83
|
}
|
|
84
|
-
sync(props) {
|
|
84
|
+
sync = (props) => {
|
|
85
85
|
this.#props = props;
|
|
86
|
-
}
|
|
87
|
-
commit() {
|
|
86
|
+
};
|
|
87
|
+
commit = () => {
|
|
88
88
|
const prev = this.#committed;
|
|
89
89
|
const props = this.#props;
|
|
90
90
|
const prevScreens = this.#screens;
|
|
@@ -103,12 +103,12 @@ var BreakpointObserver = class {
|
|
|
103
103
|
for (const screen of changed) if (!breakpoints || breakpoints.includes(screen)) callback(screen, screens[screen]);
|
|
104
104
|
});
|
|
105
105
|
}
|
|
106
|
-
}
|
|
107
|
-
destroy() {
|
|
106
|
+
};
|
|
107
|
+
destroy = () => {
|
|
108
108
|
this.#unregister();
|
|
109
109
|
this.#screensListeners.clear();
|
|
110
110
|
this.#changeListeners.clear();
|
|
111
|
-
}
|
|
111
|
+
};
|
|
112
112
|
subscribe = (arg1, arg2) => {
|
|
113
113
|
if (typeof arg1 === "function") {
|
|
114
114
|
this.#screensListeners.add(arg1);
|
|
@@ -51,41 +51,41 @@ export interface CropperState {
|
|
|
51
51
|
}
|
|
52
52
|
export default class CropperFoundation extends BaseFoundation<CropperAdapter<CropperFoundationProps>, CropperFoundationProps, CropperState> {
|
|
53
53
|
#private;
|
|
54
|
-
handleCornerPointerMove: (e:
|
|
54
|
+
handleCornerPointerMove: (e: Pick<PointerEvent, "clientX" | "clientY" | "preventDefault">) => void;
|
|
55
55
|
/** Follows pointerup and pointercancel; also fires when the corner leaves the page mid-drag */
|
|
56
56
|
handleCornerLostPointerCapture: () => void;
|
|
57
|
-
handleCropperBoxPointerMove: ({ clientX, clientY }:
|
|
57
|
+
handleCropperBoxPointerMove: ({ clientX, clientY }: Pick<PointerEvent, "clientX" | "clientY">) => void;
|
|
58
58
|
handleCropperBoxLostPointerCapture: () => void;
|
|
59
|
-
handleMaskPointerMove: ({ clientX, clientY }:
|
|
59
|
+
handleMaskPointerMove: ({ clientX, clientY }: Pick<PointerEvent, "clientX" | "clientY">) => void;
|
|
60
60
|
handleMaskLostPointerCapture: () => void;
|
|
61
61
|
init(): void;
|
|
62
62
|
destroy(): void;
|
|
63
|
-
handleResize()
|
|
63
|
+
handleResize: () => void;
|
|
64
64
|
/**
|
|
65
65
|
* Refits the crop box to a changed `aspectRatio`: height stays, width follows, and a box too big for the
|
|
66
66
|
* container shrinks. It stays centered, moved only as far as the container edges require.
|
|
67
67
|
*/
|
|
68
|
-
applyAspectRatio()
|
|
69
|
-
handleImageLoad(
|
|
68
|
+
applyAspectRatio: () => void;
|
|
69
|
+
handleImageLoad: ({ target }: Pick<Event, "target">) => void;
|
|
70
70
|
/**
|
|
71
71
|
* Brings the state to the `rotate` and `zoom` props once the image has loaded; a controlled zoom also undoes
|
|
72
72
|
* wheel zooming the parent does not accept. Turns and scales around the cropper box center.
|
|
73
73
|
*/
|
|
74
|
-
syncRotateAndZoom({ rotate: newRotate, zoom: newZoom }?: {
|
|
74
|
+
syncRotateAndZoom: ({ rotate: newRotate, zoom: newZoom }?: {
|
|
75
75
|
rotate?: number;
|
|
76
76
|
zoom?: number;
|
|
77
|
-
})
|
|
78
|
-
handleWheel: (e:
|
|
79
|
-
updatePreview()
|
|
80
|
-
handleCornerPointerDown: (e:
|
|
81
|
-
handleCropperBoxPointerDown: (e:
|
|
77
|
+
}) => void;
|
|
78
|
+
handleWheel: (e: Pick<WheelEvent, "clientX" | "clientY" | "deltaY" | "preventDefault">) => void;
|
|
79
|
+
updatePreview: () => void;
|
|
80
|
+
handleCornerPointerDown: (e: Pick<PointerEvent, "button" | "currentTarget" | "pointerId" | "preventDefault">) => void;
|
|
81
|
+
handleCropperBoxPointerDown: (e: Pick<PointerEvent, "button" | "clientX" | "clientY" | "currentTarget" | "pointerId" | "target">) => void;
|
|
82
82
|
/**
|
|
83
83
|
* Moves the box with the arrow keys by KEYBOARD_STEP px; Shift moves the bottom right corner instead, through
|
|
84
84
|
* the drag path, so the box keeps to the container and the aspect ratio. Only with resize handles shown, as
|
|
85
85
|
* with a pointer.
|
|
86
86
|
*/
|
|
87
|
-
handleCropperBoxKeyDown: (e:
|
|
88
|
-
handleMaskPointerDown: (e:
|
|
89
|
-
getCropperCanvas()
|
|
87
|
+
handleCropperBoxKeyDown: (e: Pick<KeyboardEvent, "altKey" | "ctrlKey" | "key" | "metaKey" | "preventDefault" | "shiftKey">) => void;
|
|
88
|
+
handleMaskPointerDown: (e: Pick<PointerEvent, "button" | "clientX" | "clientY" | "currentTarget" | "pointerId" | "target">) => void;
|
|
89
|
+
getCropperCanvas: () => HTMLCanvasElement;
|
|
90
90
|
}
|
|
91
91
|
export {};
|