@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
|
@@ -274,14 +274,14 @@ var CropperFoundation = class extends BaseFoundation {
|
|
|
274
274
|
}
|
|
275
275
|
}
|
|
276
276
|
#readContainerSize() {
|
|
277
|
-
const container = this.
|
|
277
|
+
const container = this.adapter.getContainer();
|
|
278
278
|
return {
|
|
279
279
|
width: container.clientWidth,
|
|
280
280
|
height: container.clientHeight
|
|
281
281
|
};
|
|
282
282
|
}
|
|
283
283
|
#toContainerPoint(clientX, clientY) {
|
|
284
|
-
const container = this.
|
|
284
|
+
const container = this.adapter.getContainer();
|
|
285
285
|
const rect = container.getBoundingClientRect();
|
|
286
286
|
return {
|
|
287
287
|
x: clientX - rect.left - container.clientLeft,
|
|
@@ -518,7 +518,7 @@ var CropperFoundation = class extends BaseFoundation {
|
|
|
518
518
|
destroy() {
|
|
519
519
|
this.#removePreview();
|
|
520
520
|
}
|
|
521
|
-
handleResize() {
|
|
521
|
+
handleResize = () => {
|
|
522
522
|
const { loaded } = this.getStates();
|
|
523
523
|
if (!loaded) return;
|
|
524
524
|
const newContainerData = this.#readContainerSize();
|
|
@@ -538,12 +538,12 @@ var CropperFoundation = class extends BaseFoundation {
|
|
|
538
538
|
imgData: newImgData,
|
|
539
539
|
cropperBox: newCropperBox
|
|
540
540
|
});
|
|
541
|
-
}
|
|
541
|
+
};
|
|
542
542
|
/**
|
|
543
543
|
* Refits the crop box to a changed `aspectRatio`: height stays, width follows, and a box too big for the
|
|
544
544
|
* container shrinks. It stays centered, moved only as far as the container edges require.
|
|
545
545
|
*/
|
|
546
|
-
applyAspectRatio() {
|
|
546
|
+
applyAspectRatio = () => {
|
|
547
547
|
const { aspectRatio } = this.getProps();
|
|
548
548
|
const { cropperBox, loaded } = this.getStates();
|
|
549
549
|
const { width: containerWidth, height: containerHeight } = this.#containerData;
|
|
@@ -566,20 +566,21 @@ var CropperFoundation = class extends BaseFoundation {
|
|
|
566
566
|
y: clamp(cropperBox.centerPoint.y, height / 2, containerHeight - height / 2)
|
|
567
567
|
}
|
|
568
568
|
} });
|
|
569
|
-
}
|
|
570
|
-
handleImageLoad(
|
|
571
|
-
|
|
569
|
+
};
|
|
570
|
+
handleImageLoad = ({ target }) => {
|
|
571
|
+
if (!(target instanceof HTMLImageElement)) return;
|
|
572
|
+
const { naturalWidth, naturalHeight } = target;
|
|
572
573
|
this.#containerData = this.#readContainerSize();
|
|
573
574
|
this.#imgData.originalWidth = naturalWidth;
|
|
574
575
|
this.#imgData.originalHeight = naturalHeight;
|
|
575
576
|
this.#layoutImage();
|
|
576
577
|
this.#renderPreview();
|
|
577
|
-
}
|
|
578
|
+
};
|
|
578
579
|
/**
|
|
579
580
|
* Brings the state to the `rotate` and `zoom` props once the image has loaded; a controlled zoom also undoes
|
|
580
581
|
* wheel zooming the parent does not accept. Turns and scales around the cropper box center.
|
|
581
582
|
*/
|
|
582
|
-
syncRotateAndZoom({ rotate: newRotate, zoom: newZoom } = this.getProps()) {
|
|
583
|
+
syncRotateAndZoom = ({ rotate: newRotate, zoom: newZoom } = this.getProps()) => {
|
|
583
584
|
const { rotate, zoom, imgData, cropperBox, loaded } = this.getStates();
|
|
584
585
|
const rotateChanged = newRotate !== void 0 && !Object.is(newRotate, rotate);
|
|
585
586
|
const zoomChanged = newZoom !== void 0 && !Object.is(newZoom, zoom);
|
|
@@ -620,7 +621,7 @@ var CropperFoundation = class extends BaseFoundation {
|
|
|
620
621
|
}
|
|
621
622
|
}
|
|
622
623
|
});
|
|
623
|
-
}
|
|
624
|
+
};
|
|
624
625
|
handleWheel = (e) => {
|
|
625
626
|
e.preventDefault();
|
|
626
627
|
if (!this.getStates().loaded) return;
|
|
@@ -650,9 +651,9 @@ var CropperFoundation = class extends BaseFoundation {
|
|
|
650
651
|
imgData: newImgDataState,
|
|
651
652
|
zoom: _zoom
|
|
652
653
|
});
|
|
653
|
-
this.
|
|
654
|
+
this.adapter.notifyZoomChange(_zoom);
|
|
654
655
|
};
|
|
655
|
-
updatePreview() {
|
|
656
|
+
updatePreview = () => {
|
|
656
657
|
if (!this.#previewImg) return;
|
|
657
658
|
const { cropperBox, imgData, rotate } = this.getStates();
|
|
658
659
|
const { width, height } = imgData;
|
|
@@ -682,18 +683,19 @@ var CropperFoundation = class extends BaseFoundation {
|
|
|
682
683
|
this.#previewImg.style.transformOrigin = "center";
|
|
683
684
|
this.#previewContainer.style.width = `${previewWidth}px`;
|
|
684
685
|
this.#previewContainer.style.height = `${previewHeight}px`;
|
|
685
|
-
}
|
|
686
|
+
};
|
|
686
687
|
handleCornerPointerDown = (e) => {
|
|
687
688
|
const currentTarget = e.currentTarget;
|
|
688
|
-
if (!currentTarget || isSecondaryPress(e)) return;
|
|
689
|
+
if (!(currentTarget instanceof HTMLElement) || isSecondaryPress(e)) return;
|
|
689
690
|
e.preventDefault();
|
|
690
691
|
currentTarget.setPointerCapture(e.pointerId);
|
|
691
692
|
this.#startCornerResize(currentTarget.dataset.dir);
|
|
692
693
|
};
|
|
693
694
|
handleCropperBoxPointerDown = (e) => {
|
|
694
|
-
if (e.target.dataset.dir) return;
|
|
695
|
-
|
|
696
|
-
|
|
695
|
+
if (e.target instanceof HTMLElement && e.target.dataset.dir) return;
|
|
696
|
+
const { currentTarget } = e;
|
|
697
|
+
if (!(currentTarget instanceof Element) || isSecondaryPress(e)) return;
|
|
698
|
+
currentTarget.setPointerCapture(e.pointerId);
|
|
697
699
|
this.#cropperBoxMoveStart = {
|
|
698
700
|
x: e.clientX,
|
|
699
701
|
y: e.clientY
|
|
@@ -725,20 +727,21 @@ var CropperFoundation = class extends BaseFoundation {
|
|
|
725
727
|
}
|
|
726
728
|
};
|
|
727
729
|
handleMaskPointerDown = (e) => {
|
|
728
|
-
|
|
729
|
-
e.
|
|
730
|
+
const { currentTarget } = e;
|
|
731
|
+
if (!(currentTarget instanceof Element) || currentTarget !== e.target || isSecondaryPress(e)) return;
|
|
732
|
+
currentTarget.setPointerCapture(e.pointerId);
|
|
730
733
|
this.#imgMoveStart = {
|
|
731
734
|
x: e.clientX,
|
|
732
735
|
y: e.clientY
|
|
733
736
|
};
|
|
734
737
|
};
|
|
735
|
-
getCropperCanvas() {
|
|
738
|
+
getCropperCanvas = () => {
|
|
736
739
|
if (!this.getStates().loaded) throw new Error("[Semi] Cropper: getCropperCanvas called before the image loaded");
|
|
737
740
|
const { cropperBox, imgData, rotate, zoom } = this.getStates();
|
|
738
741
|
const { fill } = this.getProps();
|
|
739
742
|
const canvas = document.createElement("canvas");
|
|
740
743
|
const ctx = canvas.getContext("2d");
|
|
741
|
-
const img = this.
|
|
744
|
+
const img = this.adapter.getImg();
|
|
742
745
|
const angle = rotate * Math.PI / 180;
|
|
743
746
|
const sine = Math.abs(Math.sin(angle));
|
|
744
747
|
const cosine = Math.abs(Math.cos(angle));
|
|
@@ -799,6 +802,6 @@ var CropperFoundation = class extends BaseFoundation {
|
|
|
799
802
|
const imgDataResult = ctx.getImageData(realLeft, realTop, realWidth, realHeight);
|
|
800
803
|
ctx2.putImageData(imgDataResult, relativeCropLeft < 0 ? -relativeCropLeft : 0, relativeCropTop < 0 ? -relativeCropTop : 0);
|
|
801
804
|
return canvas2;
|
|
802
|
-
}
|
|
805
|
+
};
|
|
803
806
|
};
|
|
804
807
|
export { CropperFoundation as default };
|
|
@@ -13,7 +13,7 @@ export declare function needConfirm({ type, needConfirm: confirm }: {
|
|
|
13
13
|
needConfirm?: boolean;
|
|
14
14
|
}): boolean;
|
|
15
15
|
/** These types pick in the year and month panel instead of the day grid */
|
|
16
|
-
export declare function isYearOrMonthType(type?: Type): type is "
|
|
16
|
+
export declare function isYearOrMonthType(type?: Type): type is "month" | "year" | "monthRange";
|
|
17
17
|
/** monthRange shows its range in one trigger input; the other range types split it into a start and an end input */
|
|
18
18
|
export declare function isSplitRangeInputs(type?: Type): boolean;
|
|
19
19
|
/** An empty range (cleared) or one with two valid dates; a half-picked range is neither committed nor confirmed */
|
|
@@ -152,7 +152,7 @@ export interface DatePickerFoundationState {
|
|
|
152
152
|
cachedSelectedValue: (Date | null)[];
|
|
153
153
|
prevTimeZone: string | number | null;
|
|
154
154
|
/** `undefined` until a range input is focused or the value is set */
|
|
155
|
-
rangeInputFocus
|
|
155
|
+
rangeInputFocus?: RangeInput | false;
|
|
156
156
|
autofocus: boolean;
|
|
157
157
|
/** value of inset input */
|
|
158
158
|
insetInputValue: InsetInputValue | null;
|
|
@@ -179,7 +179,7 @@ export interface DatePickerAdapter extends DefaultAdapter<DatePickerFoundationPr
|
|
|
179
179
|
setRangeInputFocus: (rangeInputFocus: DatePickerFoundationState['rangeInputFocus']) => void;
|
|
180
180
|
/** focus is in the panel and came from the keyboard (`:focus-visible`), not from a click */
|
|
181
181
|
isKeyboardFocusInPanel: () => boolean;
|
|
182
|
-
isEventTarget: (e:
|
|
182
|
+
isEventTarget: (e: Pick<Event, 'target' | 'currentTarget'>) => boolean;
|
|
183
183
|
updateInsetInputValue: (insetInputValue: InsetInputValue) => void;
|
|
184
184
|
setInsetInputFocus: () => void;
|
|
185
185
|
/** `callback` runs once the trigger renders with the new disabled state */
|
|
@@ -252,52 +252,52 @@ export default class DatePickerFoundation extends BaseFoundation<DatePickerAdapt
|
|
|
252
252
|
*/
|
|
253
253
|
static getInitialState(props: DatePickerFoundationProps): Pick<DatePickerFoundationState, 'value' | 'cachedSelectedValue' | 'rangeInputFocus' | 'inputValue' | 'prevTimeZone'>;
|
|
254
254
|
init(): void;
|
|
255
|
-
initFromProps({ value, timeZone, prevTimeZone }: Pick<DatePickerFoundationProps,
|
|
255
|
+
initFromProps: ({ value, timeZone, prevTimeZone }: Pick<DatePickerFoundationProps, "value" | "timeZone"> & {
|
|
256
256
|
prevTimeZone?: string | number;
|
|
257
|
-
})
|
|
257
|
+
}) => void;
|
|
258
258
|
/** Called for a mousedown outside the trigger and the panel while the panel is shown */
|
|
259
|
-
handleClickOutside(e: MouseEvent)
|
|
259
|
+
handleClickOutside: (e: MouseEvent) => void;
|
|
260
260
|
/** @param e the mousedown outside that closes the panel, passed on to onBlur */
|
|
261
261
|
closePanel(e?: MouseEvent): void;
|
|
262
|
-
open()
|
|
262
|
+
open: () => void;
|
|
263
263
|
/** The controlled `open` turned true: starts what an uncontrolled open would */
|
|
264
|
-
handleControlledOpen()
|
|
265
|
-
handleEscKeyDown()
|
|
266
|
-
close(e?: MouseEvent)
|
|
264
|
+
handleControlledOpen: () => void;
|
|
265
|
+
handleEscKeyDown: () => void;
|
|
266
|
+
close: (e?: MouseEvent) => void;
|
|
267
267
|
/** Closes the panel without a blur or a returned focus, as when a Vue KeepAlive deactivates the host */
|
|
268
|
-
deactivate()
|
|
268
|
+
deactivate: () => void;
|
|
269
269
|
destroy(): void;
|
|
270
|
-
focus(focusType?: RangeInput)
|
|
271
|
-
blur()
|
|
270
|
+
focus: (focusType?: RangeInput) => void;
|
|
271
|
+
blur: () => void;
|
|
272
272
|
/** The controlled `open` turned false: clears what an uncontrolled close would */
|
|
273
|
-
handleControlledClose()
|
|
273
|
+
handleControlledClose: () => void;
|
|
274
274
|
/** Whether the range input other than `currentRangeInput` has been focused since the panel opened */
|
|
275
|
-
hasOtherRangeInputBeenFocused(currentRangeInput: RangeInput)
|
|
276
|
-
handleInputChange(input: string, e:
|
|
275
|
+
hasOtherRangeInputBeenFocused: (currentRangeInput: RangeInput) => boolean;
|
|
276
|
+
handleInputChange: (input: string, e: unknown) => void;
|
|
277
277
|
/**
|
|
278
278
|
* Always updates insetInputValue; inputValue and value are updated only when the text parses to a valid date.
|
|
279
279
|
*/
|
|
280
|
-
handleInsetInputChange({ insetInputStr, format, insetInputValue }: {
|
|
280
|
+
handleInsetInputChange: ({ insetInputStr, format, insetInputValue }: {
|
|
281
281
|
insetInputStr: string;
|
|
282
282
|
format: string;
|
|
283
283
|
insetInputValue: InsetInputValue;
|
|
284
|
-
})
|
|
285
|
-
handleRangeEndTabPress()
|
|
286
|
-
handleInputFocus(e: unknown, range: RangeInput)
|
|
287
|
-
handleSetRangeFocus(rangeInputFocus: RangeInput | false)
|
|
288
|
-
handleInputClear(e:
|
|
289
|
-
handleRangeInputClear(e:
|
|
290
|
-
handleInputComplete(input?: string)
|
|
284
|
+
}) => void;
|
|
285
|
+
handleRangeEndTabPress: () => void;
|
|
286
|
+
handleInputFocus: (e: unknown, range: RangeInput) => void;
|
|
287
|
+
handleSetRangeFocus: (rangeInputFocus: RangeInput | false) => void;
|
|
288
|
+
handleInputClear: (e: unknown) => void;
|
|
289
|
+
handleRangeInputClear: (e: unknown) => void;
|
|
290
|
+
handleInputComplete: (input?: string) => void;
|
|
291
291
|
/**
|
|
292
292
|
* @param options `rangeInputFocus` is the range input the dates were picked for, when the panel has moved
|
|
293
293
|
* the focus on before telling about the change
|
|
294
294
|
*/
|
|
295
|
-
handleSelectedChange(value: Date[], options?: {
|
|
295
|
+
handleSelectedChange: (value: Date[], options?: {
|
|
296
296
|
needCheckFocusRecord?: boolean;
|
|
297
297
|
closePanel?: boolean;
|
|
298
298
|
rangeInputFocus?: RangeInput | false;
|
|
299
|
-
})
|
|
300
|
-
handleYMSelectedChange({ currentMonth, currentYear }?: {
|
|
299
|
+
}) => void;
|
|
300
|
+
handleYMSelectedChange: ({ currentMonth, currentYear }?: {
|
|
301
301
|
currentMonth?: {
|
|
302
302
|
left: number;
|
|
303
303
|
right: number;
|
|
@@ -306,18 +306,18 @@ export default class DatePickerFoundation extends BaseFoundation<DatePickerAdapt
|
|
|
306
306
|
left: number;
|
|
307
307
|
right: number;
|
|
308
308
|
};
|
|
309
|
-
})
|
|
310
|
-
handleConfirm()
|
|
311
|
-
handleCancel()
|
|
312
|
-
handlePresetClick(item: PresetType, e: unknown)
|
|
313
|
-
disabledDisposeDate(date: Date, ...rest: any[])
|
|
314
|
-
disabledDisposeTime(date: Date | Date[], ...rest: any[])
|
|
309
|
+
}) => void;
|
|
310
|
+
handleConfirm: () => void;
|
|
311
|
+
handleCancel: () => void;
|
|
312
|
+
handlePresetClick: (item: PresetType, e: unknown) => void;
|
|
313
|
+
disabledDisposeDate: (date: Date, ...rest: any[]) => boolean;
|
|
314
|
+
disabledDisposeTime: (date: Date | Date[], ...rest: any[]) => ReturnType<DisabledTimeType>;
|
|
315
315
|
/**
|
|
316
316
|
* Opens the panel on trigger click and, for range types, focuses rangeStart when no range input is focused.
|
|
317
317
|
* Non-range triggers are native inputs that already handle focus. isEventTarget tells a click on the input
|
|
318
318
|
* wrapper itself from one bubbled up from a child, which already handled focus.
|
|
319
319
|
*/
|
|
320
|
-
handleTriggerWrapperClick(e:
|
|
320
|
+
handleTriggerWrapperClick(e: Pick<Event, 'target' | 'currentTarget'>): void;
|
|
321
321
|
/**
|
|
322
322
|
* The trigger's click handler. Enter and Space on an inner control of the default trigger (its clear button) click
|
|
323
323
|
* it, and that click must not open the panel too; a pointer click on it still does. A custom trigger skips the
|
|
@@ -325,12 +325,12 @@ export default class DatePickerFoundation extends BaseFoundation<DatePickerAdapt
|
|
|
325
325
|
* control that must not open it stops propagation itself). Keys reach handleTriggerWrapperClick through
|
|
326
326
|
* handleTriggerKeyDown instead, so the check stays out of it.
|
|
327
327
|
*/
|
|
328
|
-
handleTriggerClick(e: Pick<MouseEvent,
|
|
328
|
+
handleTriggerClick: (e: Pick<MouseEvent, "detail" | "target" | "currentTarget">, isCustomTrigger: boolean) => void;
|
|
329
329
|
/**
|
|
330
330
|
* APG combobox: Down Arrow on the closed trigger opens the panel (once it is open, the Popover moves focus into
|
|
331
331
|
* it). A custom trigger that is itself the Tab stop is a button, so Enter and Space open it too.
|
|
332
332
|
*/
|
|
333
|
-
handleTriggerKeyDown(e: Pick<KeyboardEvent,
|
|
334
|
-
handlePanelVisibleChange(visible: boolean)
|
|
333
|
+
handleTriggerKeyDown: (e: Pick<KeyboardEvent, "key" | "preventDefault" | "target" | "currentTarget">, isTriggerButton: boolean) => void;
|
|
334
|
+
handlePanelVisibleChange: (visible: boolean) => void;
|
|
335
335
|
}
|
|
336
336
|
export type { DateInputFoundationProps, RangeInput, Type };
|