@fibrae/semi-foundation 0.2.0 → 0.3.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 +0 -3
- package/dist/anchor/foundation.js +0 -1
- package/dist/audio-player/foundation.d.ts +0 -3
- package/dist/audio-player/foundation.js +0 -1
- package/dist/auto-complete/foundation.d.ts +0 -2
- package/dist/auto-complete/foundation.js +0 -1
- package/dist/avatar/foundation.d.ts +0 -1
- package/dist/avatar/variables.scss +0 -1
- package/dist/backtop/foundation.d.ts +0 -3
- package/dist/backtop/foundation.js +0 -1
- package/dist/base/auto-close-foundation.d.ts +0 -1
- package/dist/base/foundation.d.ts +0 -1
- package/dist/base/list-store.d.ts +0 -1
- package/dist/calendar/event-util.d.ts +0 -10
- package/dist/calendar/event-util.js +0 -10
- package/dist/calendar/foundation.d.ts +1 -6
- package/dist/calendar/foundation.js +1 -5
- package/dist/calendar/month-foundation.d.ts +0 -1
- package/dist/calendar/month-foundation.js +0 -1
- package/dist/carousel/foundation.d.ts +0 -2
- package/dist/cascader/foundation.d.ts +2 -6
- package/dist/cascader/foundation.js +2 -11
- package/dist/cascader/util.d.ts +1 -8
- package/dist/cascader/util.js +1 -8
- package/dist/checkbox/checkbox-foundation.d.ts +1 -5
- package/dist/checkbox/checkbox-foundation.js +0 -2
- package/dist/checkbox/checkbox-group-foundation.d.ts +0 -1
- package/dist/code-highlight/index.d.ts +0 -1
- package/dist/color-picker/color-picker.scss +0 -2
- package/dist/color-picker/interface.d.ts +0 -1
- package/dist/config-provider/responsive-types.d.ts +0 -16
- package/dist/cropper/foundation.d.ts +0 -1
- package/dist/cropper/foundation.js +0 -1
- package/dist/date-picker/_utils/get-default-picker-date.d.ts +0 -3
- package/dist/date-picker/_utils/get-default-picker-date.js +0 -3
- package/dist/date-picker/_utils/get-inset-input-format-token.d.ts +0 -2
- package/dist/date-picker/_utils/get-inset-input-format-token.js +0 -2
- package/dist/date-picker/_utils/get-inset-input-value-from-inset-input-str.d.ts +0 -2
- package/dist/date-picker/_utils/get-inset-input-value-from-inset-input-str.js +0 -2
- package/dist/date-picker/_utils/parser.d.ts +0 -3
- package/dist/date-picker/_utils/parser.js +0 -7
- package/dist/date-picker/_utils/picker-type.d.ts +0 -2
- package/dist/date-picker/_utils/picker-type.js +0 -2
- package/dist/date-picker/_utils/to-callback-args.d.ts +0 -1
- package/dist/date-picker/_utils/to-callback-args.js +0 -1
- package/dist/date-picker/date-picker.scss +0 -3
- package/dist/date-picker/foundation.d.ts +3 -22
- package/dist/date-picker/foundation.js +1 -24
- package/dist/date-picker/input-foundation.d.ts +1 -7
- package/dist/date-picker/input-foundation.js +0 -2
- package/dist/date-picker/month-foundation.d.ts +0 -3
- package/dist/date-picker/month-foundation.js +0 -2
- package/dist/date-picker/months-grid-foundation.d.ts +1 -10
- package/dist/date-picker/months-grid-foundation.js +1 -10
- package/dist/drag-move/foundation.d.ts +0 -1
- package/dist/dropdown/foundation.d.ts +0 -2
- package/dist/dropdown/menu-foundation.d.ts +0 -1
- package/dist/feedback/foundation.d.ts +0 -1
- package/dist/feedback/variables.scss +1 -5
- package/dist/float-button/float-button.css +0 -1
- package/dist/float-button/float-button.scss +0 -2
- package/dist/form/form.scss +0 -12
- package/dist/form/foundation.js +0 -15
- package/dist/form/interface.d.ts +2 -15
- package/dist/form/utils.d.ts +0 -8
- package/dist/form/utils.js +0 -7
- package/dist/form/variables.scss +1 -4
- package/dist/grid/variables.scss +0 -10
- package/dist/highlight/foundation.d.ts +0 -2
- package/dist/highlight/foundation.js +0 -2
- package/dist/hot-keys/foundation.d.ts +0 -1
- package/dist/image/image-foundation.d.ts +0 -2
- package/dist/image/preview-footer-foundation.d.ts +0 -1
- package/dist/image/preview-foundation.d.ts +0 -3
- package/dist/image/preview-image-foundation.d.ts +0 -1
- package/dist/image/preview-inner-foundation.d.ts +0 -1
- package/dist/input/foundation.d.ts +0 -1
- package/dist/input/text-entry-foundation.d.ts +0 -2
- package/dist/input/text-entry-foundation.js +0 -1
- package/dist/input/textarea-foundation.d.ts +0 -1
- package/dist/input-number/caret.d.ts +0 -1
- package/dist/input-number/caret.js +0 -1
- package/dist/input-number/foundation.d.ts +0 -5
- package/dist/input-number/foundation.js +0 -5
- package/dist/json-viewer/foundation.d.ts +0 -2
- package/dist/json-viewer/foundation.js +0 -1
- package/dist/locale/interface.d.ts +0 -3
- package/dist/markdown-render/foundation.d.ts +1 -6
- package/dist/markdown-render/foundation.js +1 -5
- package/dist/navigation/foundation.d.ts +0 -7
- package/dist/navigation/foundation.js +0 -6
- package/dist/navigation/sub-nav-foundation.d.ts +0 -1
- package/dist/notification/notification-list-foundation.d.ts +0 -1
- package/dist/notification/notification-list-foundation.js +0 -1
- package/dist/notification/variables.scss +0 -1
- package/dist/overflow-list/foundation.d.ts +0 -2
- package/dist/overflow-list/foundation.js +0 -1
- package/dist/pagination/foundation.d.ts +0 -2
- package/dist/pincode/foundation.d.ts +1 -4
- package/dist/pincode/foundation.js +1 -4
- package/dist/popconfirm/popconfirm-foundation.d.ts +0 -2
- package/dist/progress/generates.d.ts +1 -4
- package/dist/progress/generates.js +1 -4
- package/dist/progress/utils.d.ts +1 -1
- package/dist/progress/utils.js +1 -1
- package/dist/radio/radio-foundation.d.ts +0 -4
- package/dist/radio/radio-foundation.js +0 -1
- package/dist/radio/radio-group-foundation.d.ts +0 -1
- package/dist/rating/foundation.d.ts +0 -5
- package/dist/rating/foundation.js +0 -3
- package/dist/resizable/group/index.d.ts +0 -4
- package/dist/resizable/group/index.js +0 -4
- package/dist/resizable/resizable.scss +0 -1
- package/dist/resizable/single/index.d.ts +1 -5
- package/dist/resizable/single/index.js +1 -4
- package/dist/scroll-list/item-foundation.d.ts +0 -2
- package/dist/scroll-list/item-foundation.js +0 -1
- package/dist/scroll-list/variables.scss +1 -6
- package/dist/select/foundation.d.ts +0 -1
- package/dist/select/option-foundation.d.ts +2 -3
- package/dist/select/option-foundation.js +0 -1
- package/dist/select/variables.scss +1 -8
- package/dist/side-sheet/side-sheet-foundation.d.ts +1 -6
- package/dist/side-sheet/side-sheet-foundation.js +1 -5
- package/dist/side-sheet/variables.scss +1 -3
- package/dist/slider/foundation.d.ts +1 -12
- package/dist/slider/foundation.js +1 -13
- package/dist/slider/variables.scss +1 -5
- package/dist/spin/foundation.d.ts +0 -2
- package/dist/spin/foundation.js +0 -1
- package/dist/spin/variables.scss +1 -3
- package/dist/switch/foundation.d.ts +0 -1
- package/dist/switch/switch.scss +1 -1
- package/dist/switch/variables.scss +1 -5
- package/dist/table/foundation.d.ts +12 -21
- package/dist/table/foundation.js +51 -15
- package/dist/table/table.scss +0 -1
- package/dist/table/utils.d.ts +0 -8
- package/dist/table/utils.js +0 -13
- package/dist/table/variables.scss +1 -5
- package/dist/tabs/foundation.d.ts +0 -9
- package/dist/tabs/foundation.js +0 -4
- package/dist/tabs/tabs.scss +1 -1
- package/dist/tag/focus.js +0 -1
- package/dist/tag-input/foundation.d.ts +0 -2
- package/dist/tag-input/foundation.js +0 -1
- package/dist/tag-input/tag-input.scss +0 -1
- package/dist/tag-input/utils/tag-focus.d.ts +0 -1
- package/dist/tag-input/utils/tag-focus.js +0 -1
- package/dist/time-picker/combox-foundation.d.ts +3 -11
- package/dist/time-picker/combox-foundation.js +3 -10
- package/dist/time-picker/foundation.d.ts +0 -10
- package/dist/time-picker/foundation.js +0 -9
- package/dist/time-picker/utils/index.d.ts +0 -11
- package/dist/time-picker/utils/index.js +0 -11
- package/dist/tooltip/adjust-position.d.ts +1 -2
- package/dist/tooltip/constants.d.ts +0 -3
- package/dist/tooltip/constants.js +0 -3
- package/dist/tooltip/foundation.d.ts +0 -3
- package/dist/tooltip/foundation.js +0 -2
- package/dist/tooltip/position.scss +0 -1
- package/dist/transfer/foundation.d.ts +0 -4
- package/dist/transfer/foundation.js +0 -1
- package/dist/tree/foundation.d.ts +0 -2
- package/dist/tree/foundation.js +0 -1
- package/dist/tree/shared.d.ts +1 -3
- package/dist/tree/shared.js +0 -2
- package/dist/tree/tree-util.d.ts +0 -5
- package/dist/tree/tree-util.js +0 -5
- package/dist/tree-select/foundation.d.ts +0 -2
- package/dist/tree-select/foundation.js +0 -3
- package/dist/typography/ellipsis.d.ts +1 -3
- package/dist/typography/ellipsis.js +0 -2
- package/dist/typography/typography.scss +0 -1
- package/dist/upload/constants.d.ts +1 -1
- package/dist/upload/foundation.d.ts +0 -6
- package/dist/upload/foundation.js +1 -11
- package/dist/upload/utils.d.ts +0 -5
- package/dist/upload/utils.js +0 -5
- package/dist/user-guide/foundation.d.ts +0 -2
- package/dist/utils/a11y.d.ts +1 -5
- package/dist/utils/a11y.js +1 -4
- package/dist/utils/array.d.ts +0 -6
- package/dist/utils/array.js +0 -6
- package/dist/utils/date-fns-extra.js +1 -5
- package/dist/utils/dom.d.ts +0 -1
- package/dist/utils/dom.js +0 -1
- package/dist/utils/escape-html.js +0 -3
- package/dist/utils/field-sizing.d.ts +0 -2
- package/dist/utils/field-sizing.js +0 -2
- package/dist/utils/focus-handle.d.ts +0 -1
- package/dist/utils/focus-handle.js +0 -1
- package/dist/utils/focus-scope.d.ts +0 -1
- package/dist/utils/focus-scope.js +0 -1
- package/dist/utils/scroll-lock.d.ts +3 -4
- package/dist/utils/scroll-lock.js +3 -4
- package/dist/utils/tween.d.ts +0 -1
- package/dist/utils/tween.js +0 -1
- package/dist/utils/uuid.d.ts +0 -1
- package/dist/utils/uuid.js +0 -1
- package/dist/utils/warning.d.ts +0 -1
- package/dist/utils/warning.js +0 -1
- package/dist/video-player/progress-foundation.d.ts +0 -1
- package/dist/video-player/progress-foundation.js +0 -1
- package/dist/video-player/variables.scss +1 -1
- package/package.json +2 -2
|
@@ -12,7 +12,6 @@ export interface AnchorAdapter<P extends AnchorBaseProps = AnchorBaseProps, S ex
|
|
|
12
12
|
notifyChange: (currentLink: string, previousLink: string) => void;
|
|
13
13
|
notifyClick: (e: E, link: string) => void;
|
|
14
14
|
}
|
|
15
|
-
/** The props the foundation reads */
|
|
16
15
|
export interface AnchorBaseProps {
|
|
17
16
|
defaultAnchor?: string;
|
|
18
17
|
scrollMotion?: boolean;
|
|
@@ -20,7 +19,6 @@ export interface AnchorBaseProps {
|
|
|
20
19
|
offsetTop?: number;
|
|
21
20
|
scrollIntoViewOptions?: Options;
|
|
22
21
|
}
|
|
23
|
-
/** The state the foundation reads */
|
|
24
22
|
export interface AnchorBaseState {
|
|
25
23
|
activeLink: string;
|
|
26
24
|
links: string[];
|
|
@@ -40,7 +38,6 @@ export default class AnchorFoundation<P extends AnchorBaseProps = AnchorBaseProp
|
|
|
40
38
|
/** Runs once the links have registered: listens to the container, applies `defaultAnchor` */
|
|
41
39
|
init(): void;
|
|
42
40
|
destroy(): void;
|
|
43
|
-
/** Rebinds scroll listeners when `getContainer` returns a different node */
|
|
44
41
|
handleContainerChange: () => void;
|
|
45
42
|
syncSlideBar: () => void;
|
|
46
43
|
addLink: (link: string) => void;
|
|
@@ -113,7 +113,6 @@ var AnchorFoundation = class extends BaseFoundation {
|
|
|
113
113
|
this.#throttledScroll.cancel();
|
|
114
114
|
this.#debouncedScrollEnd.cancel();
|
|
115
115
|
}
|
|
116
|
-
/** Rebinds scroll listeners when `getContainer` returns a different node */
|
|
117
116
|
handleContainerChange = () => {
|
|
118
117
|
if (this.adapter.getContainer() !== this.#container) {
|
|
119
118
|
this.#unbind();
|
|
@@ -4,12 +4,10 @@ export type AudioInfo = {
|
|
|
4
4
|
cover?: string;
|
|
5
5
|
src: string;
|
|
6
6
|
};
|
|
7
|
-
/** The props the foundation reads with getProp */
|
|
8
7
|
export interface AudioPlayerBaseProps {
|
|
9
8
|
audioUrl: string | AudioInfo | (AudioInfo | string)[];
|
|
10
9
|
skipDuration?: number;
|
|
11
10
|
}
|
|
12
|
-
/** The state the foundation reads and writes */
|
|
13
11
|
export interface AudioPlayerBaseState {
|
|
14
12
|
isPlaying: boolean;
|
|
15
13
|
currentIndex: number;
|
|
@@ -41,6 +39,5 @@ export default class AudioPlayerFoundation<P extends AudioPlayerBaseProps = Audi
|
|
|
41
39
|
handleSeek: (direction: number) => void;
|
|
42
40
|
handleRefresh: () => void;
|
|
43
41
|
handleVolumeChange: (value: number) => void;
|
|
44
|
-
/** Mutes, or restores half volume when muted */
|
|
45
42
|
handleVolumeSilent: () => void;
|
|
46
43
|
}
|
|
@@ -108,7 +108,6 @@ var AudioPlayerFoundation = class extends BaseFoundation {
|
|
|
108
108
|
audio.volume = volume / 100;
|
|
109
109
|
this.setState({ volume });
|
|
110
110
|
};
|
|
111
|
-
/** Mutes, or restores half volume when muted */
|
|
112
111
|
handleVolumeSilent = () => {
|
|
113
112
|
this.handleVolumeChange(this.getState("volume") === 0 ? 50 : 0);
|
|
114
113
|
};
|
|
@@ -11,7 +11,6 @@ export interface StateOptionItem extends DataItem {
|
|
|
11
11
|
_source?: DataItem | string | number;
|
|
12
12
|
}
|
|
13
13
|
export type AutoCompleteData = ReadonlyArray<DataItem | string | number>;
|
|
14
|
-
/** The props the foundation reads with getProps */
|
|
15
14
|
export interface AutoCompleteBaseProps {
|
|
16
15
|
data?: AutoCompleteData;
|
|
17
16
|
defaultActiveFirstOption?: boolean;
|
|
@@ -23,7 +22,6 @@ export interface AutoCompleteBaseProps {
|
|
|
23
22
|
renderSelectedItem?(this: void, option: DataItem): string;
|
|
24
23
|
value?: string | number;
|
|
25
24
|
}
|
|
26
|
-
/** The state the foundation reads with getStates */
|
|
27
25
|
export interface AutoCompleteBaseState {
|
|
28
26
|
focusIndex: number;
|
|
29
27
|
inputValue?: string | number;
|
|
@@ -29,7 +29,6 @@ var AutoCompleteFoundation = class AutoCompleteFoundation extends BaseFoundation
|
|
|
29
29
|
static #getRenderSelectedItem({ renderSelectedItem }) {
|
|
30
30
|
return renderSelectedItem ?? ((option) => option?.value);
|
|
31
31
|
}
|
|
32
|
-
/** The input text, selection and highlight that `selectedValue` shows */
|
|
33
32
|
static #valueStates(props, selectedValue) {
|
|
34
33
|
if (selectedValue === void 0) return {
|
|
35
34
|
inputValue: "",
|
|
@@ -91,7 +91,6 @@ $width-avatar-bottom_slot_square_extra_large-border: 2px; // extra large 头像
|
|
|
91
91
|
|
|
92
92
|
$color-avatar-top_slot_text: var(--semi-color-bg-0); //顶部 Slot 文字颜色
|
|
93
93
|
|
|
94
|
-
// top slot offset; positions the slot together with the scale below
|
|
95
94
|
$spacing-avatar-top_slot_small-shift: -28px; // small 顶部 slot 偏移量, 和 scale 一起控制 slot 的位置
|
|
96
95
|
$spacing-avatar-top_slot_default-shift: -32px; // default 顶部 slot 偏移量, 和 scale 一起控制 slot 的位置
|
|
97
96
|
$spacing-avatar-top_slot_medium-shift: -30px; // medium 顶部 slot 偏移量, 和 scale 一起控制 slot 的位置
|
|
@@ -1,7 +1,5 @@
|
|
|
1
1
|
import BaseFoundation, { DefaultAdapter } from "../base/foundation.js";
|
|
2
|
-
/** What `target()` returns: the window or a scrollable element */
|
|
3
2
|
export type Target = Window | HTMLElement;
|
|
4
|
-
/** The props the foundation reads */
|
|
5
3
|
export interface BackTopBaseProps {
|
|
6
4
|
target?: () => Target | null;
|
|
7
5
|
visibilityHeight?: number;
|
|
@@ -19,7 +17,6 @@ export default class BackTopFoundation<P extends BackTopBaseProps = BackTopBaseP
|
|
|
19
17
|
/** Children sit inside a native button, so interactive ones would nest; development only */
|
|
20
18
|
static warnInteractiveChildren(button?: Element | null): void;
|
|
21
19
|
init(): void;
|
|
22
|
-
/** Rebinds the scroll listener when `target` returns a different element */
|
|
23
20
|
handleTargetChange: () => void;
|
|
24
21
|
destroy(): void;
|
|
25
22
|
onClick: (e: E) => void;
|
|
@@ -37,7 +37,6 @@ var BackTopFoundation = class extends BaseFoundation {
|
|
|
37
37
|
init() {
|
|
38
38
|
this.#bind();
|
|
39
39
|
}
|
|
40
|
-
/** Rebinds the scroll listener when `target` returns a different element */
|
|
41
40
|
handleTargetChange = () => {
|
|
42
41
|
if (this.getProps().target() !== this.#targetNode) {
|
|
43
42
|
this.#unbind();
|
|
@@ -18,7 +18,6 @@ export interface DefaultAdapter<P = Record<string, any>, S = Record<string, any>
|
|
|
18
18
|
/** The context type an adapter declares; `unknown` for a foundation that does not read context */
|
|
19
19
|
export type ContextOf<T> = T extends DefaultAdapter<any, any, infer C> ? C : never;
|
|
20
20
|
export type HostContext<A> = unknown extends ContextOf<A> ? ([keyof ContextOf<A>] extends [never] ? any : ContextOf<A>) : ContextOf<A>;
|
|
21
|
-
/** The context of a foundation that only reads the reading direction from the enclosing ConfigProvider */
|
|
22
21
|
export interface DirectionContext {
|
|
23
22
|
direction?: 'ltr' | 'rtl';
|
|
24
23
|
}
|
|
@@ -2,14 +2,10 @@ import { EventObject, ParsedRangeEvent } from "./foundation.js";
|
|
|
2
2
|
import { Locale } from "date-fns";
|
|
3
3
|
export declare function checkWeekend(val: Date): boolean;
|
|
4
4
|
export declare function getCurrDate(): Date;
|
|
5
|
-
/** A 0-1 fraction of the day or week row as a CSS percentage, capped at 100% */
|
|
6
5
|
export declare function toPercent(num: number): string;
|
|
7
6
|
export declare function round(value: number): number;
|
|
8
7
|
export declare function getPos(value: Date | number): number;
|
|
9
8
|
export declare function isAllDayEvent(event: EventObject): boolean;
|
|
10
|
-
/**
|
|
11
|
-
* Fills a missing start (end - 1h) or end (start + 1h), clamped to the day.
|
|
12
|
-
*/
|
|
13
9
|
export declare function amendEvent(event: EventObject): EventObject | undefined;
|
|
14
10
|
/** An event every view can lay out: it has a start, and when it has an end, the end is not before it */
|
|
15
11
|
export interface NormalizedEvent extends EventObject {
|
|
@@ -21,7 +17,6 @@ export interface NormalizedEvent extends EventObject {
|
|
|
21
17
|
* 1ms earlier, so it belongs only to the days before that midnight. Works on a copy.
|
|
22
18
|
*/
|
|
23
19
|
export declare function normalizeEvent(event: EventObject): NormalizedEvent | undefined;
|
|
24
|
-
/** The max topInd is the row height */
|
|
25
20
|
export declare function calcRowHeight(events: ParsedRangeEvent[]): number;
|
|
26
21
|
export interface DateObj {
|
|
27
22
|
ind: number;
|
|
@@ -35,11 +30,7 @@ export interface DateObj {
|
|
|
35
30
|
}
|
|
36
31
|
export type weekStartsOnEnum = 0 | 1 | 2 | 3 | 4 | 5 | 6;
|
|
37
32
|
export declare function calcRangeData(value: Date, start: Date, rangeLen: number, mode: string, locale: Locale, weekStartsOn: weekStartsOnEnum, today?: Date | number | null): DateObj[];
|
|
38
|
-
/**
|
|
39
|
-
* The days of a week as { date, dayString, ind, isToday, isWeekend, weekday }; `monthStart` is for month mode
|
|
40
|
-
*/
|
|
41
33
|
export declare function calcWeekData(value: Date, monthStart: Date | null, mode: string, locale: Locale, weekStartsOn: weekStartsOnEnum, today?: Date | number | null): DateObj[];
|
|
42
|
-
/** Splits an all-day event into one event per day it spans */
|
|
43
34
|
export declare function parseAllDayEvent(event: NormalizedEvent, allDay?: boolean): {
|
|
44
35
|
[x: string]: any;
|
|
45
36
|
key: string;
|
|
@@ -56,7 +47,6 @@ export declare function parseEvent(rawEvent: EventObject): {
|
|
|
56
47
|
end?: Date;
|
|
57
48
|
children?: any;
|
|
58
49
|
}[];
|
|
59
|
-
/** Groups events into a map keyed by the date string of `key`, normalized by `func` */
|
|
60
50
|
export declare function convertEventsArrToMap(arr: EventObject[], key: 'start' | 'date', func: (val: Date) => Date): Map<string, EventObject[]>;
|
|
61
51
|
export declare function filterEvents(events: Map<string, EventObject[]>, start: Date, end: Date): Map<string, EventObject[]>;
|
|
62
52
|
export declare function parseRangeAllDayEvent(event: EventObject[], startDate: Date, rangeStart: Date, rangeEnd: Date, parsed: Array<Array<ParsedRangeEvent>>): ParsedRangeEvent[][];
|
|
@@ -22,7 +22,6 @@ function checkWeekend(val) {
|
|
|
22
22
|
function getCurrDate() {
|
|
23
23
|
return /* @__PURE__ */ new Date();
|
|
24
24
|
}
|
|
25
|
-
/** A 0-1 fraction of the day or week row as a CSS percentage, capped at 100% */
|
|
26
25
|
function toPercent(num) {
|
|
27
26
|
return `${num < 1 ? num * 100 : 100}%`;
|
|
28
27
|
}
|
|
@@ -35,9 +34,6 @@ function getPos(value) {
|
|
|
35
34
|
function isAllDayEvent(event) {
|
|
36
35
|
return "allDay" in event && event.allDay;
|
|
37
36
|
}
|
|
38
|
-
/**
|
|
39
|
-
* Fills a missing start (end - 1h) or end (start + 1h), clamped to the day.
|
|
40
|
-
*/
|
|
41
37
|
function amendEvent(event) {
|
|
42
38
|
const { start, end } = event;
|
|
43
39
|
if (!start && !end) {
|
|
@@ -78,7 +74,6 @@ function normalizeEvent(event) {
|
|
|
78
74
|
};
|
|
79
75
|
return amendEvent(event);
|
|
80
76
|
}
|
|
81
|
-
/** The max topInd is the row height */
|
|
82
77
|
function calcRowHeight(events) {
|
|
83
78
|
const topIndArr = events.map((item) => item.topInd);
|
|
84
79
|
return topIndArr.length ? Math.max(...topIndArr) + 1 : 1;
|
|
@@ -106,14 +101,10 @@ function calcRangeData(value, start, rangeLen, mode, locale, weekStartsOn, today
|
|
|
106
101
|
return dateObj;
|
|
107
102
|
});
|
|
108
103
|
}
|
|
109
|
-
/**
|
|
110
|
-
* The days of a week as { date, dayString, ind, isToday, isWeekend, weekday }; `monthStart` is for month mode
|
|
111
|
-
*/
|
|
112
104
|
function calcWeekData(value, monthStart, mode = "week", locale, weekStartsOn, today) {
|
|
113
105
|
const start = startOfWeek(value, { weekStartsOn });
|
|
114
106
|
return calcRangeData(monthStart || value, start, 7, mode, locale, weekStartsOn, today);
|
|
115
107
|
}
|
|
116
|
-
/** Splits an all-day event into one event per day it spans */
|
|
117
108
|
function parseAllDayEvent(event, allDay = true) {
|
|
118
109
|
const { start, end } = event;
|
|
119
110
|
const diff = end ? differenceInCalendarDays(end, start) : 0;
|
|
@@ -128,7 +119,6 @@ function parseEvent(rawEvent) {
|
|
|
128
119
|
if (differenceInHours(end, start) < 24) return [copyEvent(event, startOfDay(start), null, endOfDay(start)), copyEvent(event, startOfDay(end), startOfDay(end))];
|
|
129
120
|
return parseAllDayEvent(event);
|
|
130
121
|
}
|
|
131
|
-
/** Groups events into a map keyed by the date string of `key`, normalized by `func` */
|
|
132
122
|
function convertEventsArrToMap(arr, key, func) {
|
|
133
123
|
return new Map(Object.entries(groupBy(arr, (item) => (func ? func(item[key]) : item[key]).toString())));
|
|
134
124
|
}
|
|
@@ -31,7 +31,6 @@ export interface RangeData {
|
|
|
31
31
|
week: DateObj[];
|
|
32
32
|
}
|
|
33
33
|
export type MonthData = Record<number, DateObj[]>;
|
|
34
|
-
/** The props the foundation reads with getProps */
|
|
35
34
|
export interface CalendarBaseProps {
|
|
36
35
|
displayValue?: Date;
|
|
37
36
|
showCurrTime?: boolean;
|
|
@@ -40,9 +39,6 @@ export interface CalendarAdapter<P extends CalendarBaseProps = CalendarBaseProps
|
|
|
40
39
|
updateCurrPos: (currPos: number) => void;
|
|
41
40
|
setShowCurrTime: (show: boolean) => void;
|
|
42
41
|
}
|
|
43
|
-
/**
|
|
44
|
-
* Static pure layout functions for the views; an instance drives a day column's current time line.
|
|
45
|
-
*/
|
|
46
42
|
export default class CalendarFoundation<P extends CalendarBaseProps = CalendarBaseProps, S extends object = object> extends BaseFoundation<CalendarAdapter<P, S>, P, S> {
|
|
47
43
|
#private;
|
|
48
44
|
static formatCbValue([date, ...time]: [Date, number, number, number] | [Date]): Date;
|
|
@@ -63,9 +59,8 @@ export default class CalendarFoundation<P extends CalendarBaseProps = CalendarBa
|
|
|
63
59
|
* Subscribes to the day changing; returns the unsubscribe function. The caller refreshes once itself on mount.
|
|
64
60
|
*/
|
|
65
61
|
static watchToday(onChange: () => void): () => void;
|
|
66
|
-
/** How many event rows fit in a month cell of this height */
|
|
67
62
|
static getItemLimit(cellHeight: number): number;
|
|
68
|
-
/**
|
|
63
|
+
/** A day's events are a sparse array indexed by row */
|
|
69
64
|
static countHidden(dayEvents: ParsedRangeEvent[] | undefined, itemLimit: number): number;
|
|
70
65
|
/**
|
|
71
66
|
* Once the open card's cell no longer collapses (resize, events changed) its "more" button is gone, and the
|
|
@@ -4,9 +4,6 @@ import { calcRangeData, calcWeekData, collectDailyEvents, convertEventsArrToMap,
|
|
|
4
4
|
import { countBy } from "es-toolkit";
|
|
5
5
|
import { addDays, compareAsc, differenceInCalendarDays, endOfMonth, endOfWeek, format, getWeekOfMonth, getWeeksInMonth, isAfter, isBefore, isSameDay, isSameMonth, isSameWeek, startOfDay, startOfMonth, startOfWeek } from "date-fns";
|
|
6
6
|
// src/calendar/foundation.ts
|
|
7
|
-
/**
|
|
8
|
-
* Static pure layout functions for the views; an instance drives a day column's current time line.
|
|
9
|
-
*/
|
|
10
7
|
var CalendarFoundation = class CalendarFoundation extends BaseFoundation {
|
|
11
8
|
#currTimeTimer;
|
|
12
9
|
static #parseEvents(events) {
|
|
@@ -165,11 +162,10 @@ var CalendarFoundation = class CalendarFoundation extends BaseFoundation {
|
|
|
165
162
|
window.removeEventListener("focus", onChange);
|
|
166
163
|
};
|
|
167
164
|
}
|
|
168
|
-
/** How many event rows fit in a month cell of this height */
|
|
169
165
|
static getItemLimit(cellHeight) {
|
|
170
166
|
return Math.max(0, Math.ceil((cellHeight - numbers.MONTH_CELL_PADDING) / numbers.MONTH_EVENT_HEIGHT));
|
|
171
167
|
}
|
|
172
|
-
/**
|
|
168
|
+
/** A day's events are a sparse array indexed by row */
|
|
173
169
|
static countHidden(dayEvents, itemLimit) {
|
|
174
170
|
return dayEvents?.slice(itemLimit).filter(Boolean).length ?? 0;
|
|
175
171
|
}
|
|
@@ -3,7 +3,6 @@ export interface CalendarMonthAdapter<P extends object = object, S extends objec
|
|
|
3
3
|
notifyClose: (e: any, key: string) => void;
|
|
4
4
|
openCard: (key: string) => void;
|
|
5
5
|
}
|
|
6
|
-
/** Drives the month view's "more" card */
|
|
7
6
|
export default class CalendarMonthFoundation<P extends object = object, S extends object = object> extends BaseFoundation<CalendarMonthAdapter<P, S>, P, S> {
|
|
8
7
|
/** Closes the "more" card from its close button or a mousedown outside */
|
|
9
8
|
closeCard: (e: unknown, key: string) => void;
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import BaseFoundation from "../base/foundation.js";
|
|
2
2
|
// src/calendar/month-foundation.ts
|
|
3
|
-
/** Drives the month view's "more" card */
|
|
4
3
|
var CalendarMonthFoundation = class extends BaseFoundation {
|
|
5
4
|
/** Closes the "more" card from its close button or a mousedown outside */
|
|
6
5
|
closeCard = (e, key) => {
|
|
@@ -12,13 +12,11 @@ export type CarouselAutoPlay = boolean | {
|
|
|
12
12
|
interval?: number;
|
|
13
13
|
hoverToPause?: boolean;
|
|
14
14
|
};
|
|
15
|
-
/** The props the foundation reads */
|
|
16
15
|
export interface CarouselBaseProps {
|
|
17
16
|
activeIndex?: number;
|
|
18
17
|
autoPlay?: CarouselAutoPlay;
|
|
19
18
|
speed?: number;
|
|
20
19
|
}
|
|
21
|
-
/** The state the foundation reads */
|
|
22
20
|
export interface CarouselBaseState {
|
|
23
21
|
activeIndex: number;
|
|
24
22
|
isInit: boolean;
|
|
@@ -133,7 +133,6 @@ export interface BasicCascaderProps {
|
|
|
133
133
|
onBlur?: (e: any) => void;
|
|
134
134
|
onFocus?: (e: any) => void;
|
|
135
135
|
}
|
|
136
|
-
/** The multiple-mode checked sets */
|
|
137
136
|
export interface BasicCheckedState {
|
|
138
137
|
checkedKeys: Set<string>;
|
|
139
138
|
halfCheckedKeys: Set<string>;
|
|
@@ -221,7 +220,6 @@ export default class CascaderFoundation<E = unknown, LE = unknown> extends BaseF
|
|
|
221
220
|
static getRealKeys(value: BasicValue, keyEntities: BasicEntities, props: BasicCascaderProps): string[];
|
|
222
221
|
/** Whether a multiple value holds anything to clear, counting the controlled paths treeData lacks */
|
|
223
222
|
static hasMultipleValue(props: BasicCascaderProps, { checkedKeys, keyEntities }: Pick<BasicCascaderInnerData, 'checkedKeys' | 'keyEntities'>): boolean;
|
|
224
|
-
/** Checked, half checked and merged keys for a list of checked keys */
|
|
225
223
|
static calcCheckedState(keys: string[], keyEntities: BasicEntities, { checkRelation, autoMergeValue, leafOnly }: BasicCascaderProps): BasicCheckedState;
|
|
226
224
|
/**
|
|
227
225
|
* The multiple-mode values that follow props: keyEntities, disabledKeys under disableStrictly, and the checked
|
|
@@ -231,13 +229,11 @@ export default class CascaderFoundation<E = unknown, LE = unknown> extends BaseF
|
|
|
231
229
|
*/
|
|
232
230
|
static deriveMultipleState(props: BasicCascaderProps, state: BasicCascaderInnerData): MultipleView;
|
|
233
231
|
static getInitialState(props: BasicCascaderProps): BasicCascaderInnerData;
|
|
234
|
-
/** The flattened search results while searching, otherwise the top level */
|
|
235
232
|
static getRenderData(props: BasicCascaderProps, state: BasicCascaderInnerData): Array<BasicEntity | BasicData>;
|
|
236
|
-
/** Whether an option opens a column: it has children, or loadData may load some */
|
|
237
233
|
static isBranch(data: BasicCascaderData, loadData: unknown): boolean;
|
|
238
234
|
/**
|
|
239
|
-
*
|
|
240
|
-
*
|
|
235
|
+
* An option that is both active and selected shows only as selected, and in multiple mode selection is the
|
|
236
|
+
* checkbox's, so the row is never marked selected.
|
|
241
237
|
*/
|
|
242
238
|
static getTreeItemState(key: string, sets: Record<'activeKeys' | 'selectedKeys' | 'loadedKeys' | 'loadingKeys' | 'checkedKeys' | 'halfCheckedKeys', Set<string>>, multiple: boolean, expandable: boolean): TreeItemState;
|
|
243
239
|
/** `keyboardKey` while its option is shown; hover or a click elsewhere can close its column */
|
|
@@ -73,7 +73,6 @@ var CascaderFoundation = class CascaderFoundation extends BaseFoundation {
|
|
|
73
73
|
if (props.value === void 0) return [];
|
|
74
74
|
return CascaderFoundation.#valuePaths(props.value, props).filter(({ key }) => key !== void 0 && !keyEntities[key]).map(({ path }) => path);
|
|
75
75
|
}
|
|
76
|
-
/** The states that select `value` from `state`, and the entities with a placeholder for a value treeData lacks */
|
|
77
76
|
static #selectionFor(props, state, value, keyEntities) {
|
|
78
77
|
const { changeOnSelect, onChangeWithObject, keyMaps, loadData, multiple } = props;
|
|
79
78
|
const { activeKeys, loadingKeys, keyEntities: keyEntityState, selectedKeys: selectedKeysState } = state;
|
|
@@ -202,10 +201,6 @@ var CascaderFoundation = class CascaderFoundation extends BaseFoundation {
|
|
|
202
201
|
if (!entity) return;
|
|
203
202
|
return CascaderFoundation.#missingEntities.has(entity) ? entity.path : entity.valuePath;
|
|
204
203
|
}
|
|
205
|
-
/**
|
|
206
|
-
* Filtered keys for the current props: remote mode treats the current treeData nodes as results without
|
|
207
|
-
* matching; local mode matches by filterTreeNode.
|
|
208
|
-
*/
|
|
209
204
|
#calcFilteredKeys(sugInput, keyEntities) {
|
|
210
205
|
if (!sugInput) return [];
|
|
211
206
|
const { treeNodeFilterProp, filterTreeNode, filterLeafOnly, remote, keyMaps } = this.getProps();
|
|
@@ -410,7 +405,6 @@ var CascaderFoundation = class CascaderFoundation extends BaseFoundation {
|
|
|
410
405
|
this.adapter.updateStates({ keyboardKey: key });
|
|
411
406
|
this.adapter.scrollToOption(key, index);
|
|
412
407
|
}
|
|
413
|
-
/** The options of the shown columns in display order, with their index in their column */
|
|
414
408
|
#getShownOptions() {
|
|
415
409
|
const { activeKeys } = this.getStates();
|
|
416
410
|
const topLevel = CascaderFoundation.getRenderData(this.getProps(), this.getStates());
|
|
@@ -506,7 +500,6 @@ var CascaderFoundation = class CascaderFoundation extends BaseFoundation {
|
|
|
506
500
|
static hasMultipleValue(props, { checkedKeys, keyEntities }) {
|
|
507
501
|
return checkedKeys.size > 0 || CascaderFoundation.#missingValuePaths(props, keyEntities).length > 0;
|
|
508
502
|
}
|
|
509
|
-
/** Checked, half checked and merged keys for a list of checked keys */
|
|
510
503
|
static calcCheckedState(keys, keyEntities, { checkRelation, autoMergeValue, leafOnly }) {
|
|
511
504
|
if (checkRelation !== strings.RELATED) return {
|
|
512
505
|
checkedKeys: new Set(keys),
|
|
@@ -602,19 +595,17 @@ var CascaderFoundation = class CascaderFoundation extends BaseFoundation {
|
|
|
602
595
|
}
|
|
603
596
|
return state;
|
|
604
597
|
}
|
|
605
|
-
/** The flattened search results while searching, otherwise the top level */
|
|
606
598
|
static getRenderData(props, state) {
|
|
607
599
|
const { keyEntities, isSearching } = state;
|
|
608
600
|
if (isSearching && Boolean(props.filterTreeNode)) return CascaderFoundation.#getFilteredData(props, state);
|
|
609
601
|
return Object.values(keyEntities).filter((item) => item.parentKey === null && !CascaderFoundation.#missingEntities.has(item)).sort((a, b) => a.ind - b.ind);
|
|
610
602
|
}
|
|
611
|
-
/** Whether an option opens a column: it has children, or loadData may load some */
|
|
612
603
|
static isBranch(data, loadData) {
|
|
613
604
|
return Boolean(data.children?.length) || Boolean(loadData && !data.isLeaf);
|
|
614
605
|
}
|
|
615
606
|
/**
|
|
616
|
-
*
|
|
617
|
-
*
|
|
607
|
+
* An option that is both active and selected shows only as selected, and in multiple mode selection is the
|
|
608
|
+
* checkbox's, so the row is never marked selected.
|
|
618
609
|
*/
|
|
619
610
|
static getTreeItemState(key, sets, multiple, expandable) {
|
|
620
611
|
const active = sets.activeKeys.has(key);
|
package/dist/cascader/util.d.ts
CHANGED
|
@@ -6,11 +6,7 @@ export interface KeyMapProps {
|
|
|
6
6
|
children?: string;
|
|
7
7
|
isLeaf?: string;
|
|
8
8
|
}
|
|
9
|
-
/**
|
|
10
|
-
* @returns whether option matches sugInput; a function filterTreeNode decides with (sugInput, target, option).
|
|
11
|
-
*/
|
|
12
9
|
export declare function filter(sugInput: string, option: BasicCascaderData, filterTreeNode: any, filteredPath?: string[]): any;
|
|
13
|
-
/** One column per level of the active path: the top level, then the children of each active node that has some */
|
|
14
10
|
export declare function getColumns<T extends {
|
|
15
11
|
key: string;
|
|
16
12
|
data: {
|
|
@@ -21,10 +17,7 @@ export declare function getColumns<T extends {
|
|
|
21
17
|
items: T[];
|
|
22
18
|
level: number;
|
|
23
19
|
}[];
|
|
24
|
-
/**
|
|
25
|
-
* The labels of a search result joined by the separator, split into the runs that match the keyword and the rest. Only
|
|
26
|
-
* a string label is matched, as the default filter does; any other label passes through whole.
|
|
27
|
-
*/
|
|
20
|
+
/** Only a string label is matched, as the default filter does; any other label passes through whole */
|
|
28
21
|
export declare function highlightParts<T>(searchText: T[], keyword: string, separator: string): {
|
|
29
22
|
text: string | T;
|
|
30
23
|
match: boolean;
|
package/dist/cascader/util.js
CHANGED
|
@@ -2,9 +2,6 @@ import { VALUE_SPLIT, strings } from "./constants.js";
|
|
|
2
2
|
import { getPosition } from "../tree/tree-util.js";
|
|
3
3
|
import { get } from "es-toolkit/compat";
|
|
4
4
|
// src/cascader/util.ts
|
|
5
|
-
/**
|
|
6
|
-
* @returns whether option matches sugInput; a function filterTreeNode decides with (sugInput, target, option).
|
|
7
|
-
*/
|
|
8
5
|
function filter(sugInput, option, filterTreeNode, filteredPath) {
|
|
9
6
|
if (!filterTreeNode) return true;
|
|
10
7
|
let filterFn = filterTreeNode;
|
|
@@ -18,7 +15,6 @@ function filter(sugInput, option, filterTreeNode, filteredPath) {
|
|
|
18
15
|
} else target = filteredPath.join();
|
|
19
16
|
return filterFn(sugInput, target, option);
|
|
20
17
|
}
|
|
21
|
-
/** One column per level of the active path: the top level, then the children of each active node that has some */
|
|
22
18
|
function getColumns(topLevel, activeKeys) {
|
|
23
19
|
const columns = [];
|
|
24
20
|
let items = topLevel;
|
|
@@ -31,10 +27,7 @@ function getColumns(topLevel, activeKeys) {
|
|
|
31
27
|
}
|
|
32
28
|
return columns;
|
|
33
29
|
}
|
|
34
|
-
/**
|
|
35
|
-
* The labels of a search result joined by the separator, split into the runs that match the keyword and the rest. Only
|
|
36
|
-
* a string label is matched, as the default filter does; any other label passes through whole.
|
|
37
|
-
*/
|
|
30
|
+
/** Only a string label is matched, as the default filter does; any other label passes through whole */
|
|
38
31
|
function highlightParts(searchText, keyword, separator) {
|
|
39
32
|
const parts = [];
|
|
40
33
|
const lowerKeyword = keyword.toLowerCase();
|
|
@@ -13,7 +13,6 @@ export interface BasicCheckboxEvent {
|
|
|
13
13
|
};
|
|
14
14
|
[x: string]: any;
|
|
15
15
|
}
|
|
16
|
-
/** The click that toggles the checkbox: only what the foundation reads or forwards */
|
|
17
16
|
export interface CheckboxSourceEvent {
|
|
18
17
|
stopPropagation: () => void;
|
|
19
18
|
preventDefault: () => void;
|
|
@@ -36,7 +35,6 @@ export interface CheckboxBaseState {
|
|
|
36
35
|
checked: boolean;
|
|
37
36
|
}
|
|
38
37
|
type AriaInvalid = boolean | 'true' | 'false' | 'grammar' | 'spelling';
|
|
39
|
-
/** What a CheckboxGroup hands to the checkboxes inside it */
|
|
40
38
|
export interface CheckboxGroupView {
|
|
41
39
|
value: CheckboxValue[];
|
|
42
40
|
disabled: boolean;
|
|
@@ -46,7 +44,7 @@ export interface CheckboxGroupView {
|
|
|
46
44
|
ariaInvalid?: AriaInvalid;
|
|
47
45
|
ariaErrormessage?: string;
|
|
48
46
|
}
|
|
49
|
-
/**
|
|
47
|
+
/** `checked` is the controlled value */
|
|
50
48
|
export interface CheckboxViewProps {
|
|
51
49
|
checked?: unknown;
|
|
52
50
|
disabled?: boolean;
|
|
@@ -68,9 +66,7 @@ export interface CheckboxView {
|
|
|
68
66
|
}
|
|
69
67
|
export default class CheckboxFoundation<P extends BaseCheckboxProps = BaseCheckboxProps, S extends CheckboxBaseState = CheckboxBaseState> extends BaseFoundation<CheckboxAdapter<P, S>, P, S> {
|
|
70
68
|
#private;
|
|
71
|
-
/** How the checkbox looks and behaves, from its own props or, with a value inside a group, from the group */
|
|
72
69
|
static deriveView(props: CheckboxViewProps, state: CheckboxBaseState, group?: CheckboxGroupView | null): CheckboxView;
|
|
73
|
-
/** Whether a click landed on an interactive element inside the root other than the checkbox's own input */
|
|
74
70
|
static isInnerInteractiveClick(target: Element, root: Element, input?: Element | null): boolean;
|
|
75
71
|
handleChange: (e: CheckboxSourceEvent) => void;
|
|
76
72
|
setChecked: (checked: boolean) => void;
|
|
@@ -15,7 +15,6 @@ var CheckboxFoundation = class extends BaseFoundation {
|
|
|
15
15
|
this.adapter.notifyChange(event);
|
|
16
16
|
this.adapter.notifyGroupChange(event);
|
|
17
17
|
}
|
|
18
|
-
/** How the checkbox looks and behaves, from its own props or, with a value inside a group, from the group */
|
|
19
18
|
static deriveView(props, state, group) {
|
|
20
19
|
if (group && props.value !== void 0) return {
|
|
21
20
|
inGroup: true,
|
|
@@ -39,7 +38,6 @@ var CheckboxFoundation = class extends BaseFoundation {
|
|
|
39
38
|
ariaErrormessage: props["aria-errormessage"]
|
|
40
39
|
};
|
|
41
40
|
}
|
|
42
|
-
/** Whether a click landed on an interactive element inside the root other than the checkbox's own input */
|
|
43
41
|
static isInnerInteractiveClick(target, root, input) {
|
|
44
42
|
const interactive = target.closest(INTERACTIVE_SELECTOR);
|
|
45
43
|
return Boolean(interactive && interactive !== input && root.contains(interactive));
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import BaseFoundation, { DefaultAdapter } from "../base/foundation.js";
|
|
2
2
|
import { BasicCheckboxEvent } from "./checkbox-foundation.js";
|
|
3
3
|
export type CheckboxValue = string | number | boolean;
|
|
4
|
-
/** The props the foundation reads with getProps */
|
|
5
4
|
export interface CheckboxGroupBaseProps {
|
|
6
5
|
defaultValue?: CheckboxValue[];
|
|
7
6
|
value?: CheckboxValue[];
|
|
@@ -7,7 +7,6 @@ export interface CodeHighlightBaseProps {
|
|
|
7
7
|
lineNumber?: boolean;
|
|
8
8
|
/** Grammars this block needs beyond the registered ones, loaded once into the shared highlighter */
|
|
9
9
|
languages?: LanguageInput[];
|
|
10
|
-
/** Overrides the registered themes for this block */
|
|
11
10
|
themes?: CodeHighlightThemes;
|
|
12
11
|
}
|
|
13
12
|
export interface CodeHighlightBaseState {
|
|
@@ -49,7 +49,6 @@ $module: #{$prefix}-colorPicker;
|
|
|
49
49
|
&-alphaSlider {
|
|
50
50
|
position: relative;
|
|
51
51
|
margin-top: $spacing-colorPicker_slider-marginTop;
|
|
52
|
-
// scrolling the page would cancel the pointer mid-drag
|
|
53
52
|
touch-action: none;
|
|
54
53
|
cursor: pointer;
|
|
55
54
|
background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill-opacity=".05"><rect x="8" width="8" height="8"/><rect y="8" width="8" height="8"/></svg>');
|
|
@@ -74,7 +73,6 @@ $module: #{$prefix}-colorPicker;
|
|
|
74
73
|
&-colorSlider {
|
|
75
74
|
position: relative;
|
|
76
75
|
margin-top: $spacing-colorPicker_slider-marginTop;
|
|
77
|
-
// scrolling the page would cancel the pointer mid-drag
|
|
78
76
|
touch-action: none;
|
|
79
77
|
cursor: pointer;
|
|
80
78
|
background: linear-gradient(to right, #f00 0%, #ff0 17%, #0f0 33%, #0ff 50%, #00f 67%, #f0f 83%, #f00 100%);
|
|
@@ -22,7 +22,6 @@ export interface HslColor {
|
|
|
22
22
|
export interface HslaColor extends HslColor {
|
|
23
23
|
a: number;
|
|
24
24
|
}
|
|
25
|
-
/** The text formats of the color input */
|
|
26
25
|
export type ColorFormat = 'hex' | 'rgba' | 'hsva';
|
|
27
26
|
/** The keydown fields the range handlers read; a framework's synthetic event fits */
|
|
28
27
|
export type RangeKeyEvent = Pick<KeyboardEvent, 'key' | 'altKey' | 'ctrlKey' | 'metaKey' | 'preventDefault'>;
|
|
@@ -7,26 +7,10 @@ export interface BreakpointScreens {
|
|
|
7
7
|
xl: boolean;
|
|
8
8
|
xxl: boolean;
|
|
9
9
|
}
|
|
10
|
-
/**
|
|
11
|
-
* Subscribe callback: get all breakpoint matches
|
|
12
|
-
*/
|
|
13
10
|
export type OnBreakpointScreensCallback = (screens: BreakpointScreens) => void;
|
|
14
|
-
/**
|
|
15
|
-
* Subscribe callback: get single breakpoint change
|
|
16
|
-
*/
|
|
17
11
|
export type OnBreakpointChangeCallback = (screen: Breakpoint, match: boolean) => void;
|
|
18
12
|
export interface ResponsiveConfig {
|
|
19
|
-
/**
|
|
20
|
-
* Custom responsive map
|
|
21
|
-
*/
|
|
22
13
|
responsiveMap?: ResponsiveMap;
|
|
23
|
-
/**
|
|
24
|
-
* Subscribe to breakpoint changes. Returns an unsubscribe function.
|
|
25
|
-
*
|
|
26
|
-
* Overloads:
|
|
27
|
-
* - onBreakpoint(callback): callback receives full screens map
|
|
28
|
-
* - onBreakpoint(breakpoints, callback): callback receives (screen, match)
|
|
29
|
-
*/
|
|
30
14
|
onBreakpoint?: {
|
|
31
15
|
(callback: OnBreakpointScreensCallback): () => void;
|
|
32
16
|
(breakpoints: Breakpoint[], callback: OnBreakpointChangeCallback): () => void;
|
|
@@ -383,7 +383,6 @@ var CropperFoundation = class extends BaseFoundation {
|
|
|
383
383
|
else if (dir.includes("r")) dir = dir.replace("r", "l");
|
|
384
384
|
this.#resizeDir = dir;
|
|
385
385
|
}
|
|
386
|
-
/** `point` is in container coordinates */
|
|
387
386
|
#resizeCornerFree = (point) => {
|
|
388
387
|
const { cropperBox } = this.getStates();
|
|
389
388
|
const offsetX = clamp(point.x, ...this.#rangeX);
|
|
@@ -1,7 +1,4 @@
|
|
|
1
1
|
import { Locale } from "date-fns";
|
|
2
|
-
/**
|
|
3
|
-
* get left panel picker date and right panel picker date
|
|
4
|
-
*/
|
|
5
2
|
export default function getDefaultPickerDate({ defaultPickerValue, format, dateFnsLocale: Locale }: GetDefaultPickerValueDateOptions): {
|
|
6
3
|
nowDate: Date;
|
|
7
4
|
nextDate: Date;
|
|
@@ -4,9 +4,6 @@ import isTimestamp from "./is-timestamp.js";
|
|
|
4
4
|
import { compatibleParse } from "./parser.js";
|
|
5
5
|
import { addMonths } from "date-fns";
|
|
6
6
|
// src/date-picker/_utils/get-default-picker-date.ts
|
|
7
|
-
/**
|
|
8
|
-
* get left panel picker date and right panel picker date
|
|
9
|
-
*/
|
|
10
7
|
function getDefaultPickerDate({ defaultPickerValue, format, dateFnsLocale }) {
|
|
11
8
|
let nowDate = Array.isArray(defaultPickerValue) ? defaultPickerValue[0] : defaultPickerValue;
|
|
12
9
|
let nextDate = Array.isArray(defaultPickerValue) ? defaultPickerValue[1] : void 0;
|