@fibrae/semi-foundation 0.1.1 → 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 +1 -4
- package/dist/anchor/foundation.js +21 -22
- package/dist/audio-player/foundation.d.ts +10 -13
- package/dist/audio-player/foundation.js +19 -20
- package/dist/auto-complete/foundation.d.ts +12 -14
- package/dist/auto-complete/foundation.js +51 -52
- package/dist/avatar/foundation.d.ts +5 -6
- package/dist/avatar/foundation.js +16 -16
- package/dist/avatar/variables.scss +0 -1
- package/dist/backtop/foundation.d.ts +2 -5
- package/dist/backtop/foundation.js +7 -8
- package/dist/banner/foundation.d.ts +1 -1
- package/dist/banner/foundation.js +4 -4
- package/dist/base/auto-close-foundation.d.ts +8 -9
- package/dist/base/auto-close-foundation.js +15 -15
- package/dist/base/foundation.d.ts +4 -4
- package/dist/base/foundation.js +12 -11
- package/dist/base/list-store.d.ts +0 -1
- 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.d.ts +0 -10
- package/dist/calendar/event-util.js +1 -11
- package/dist/calendar/foundation.d.ts +1 -6
- package/dist/calendar/foundation.js +5 -9
- package/dist/calendar/month-foundation.d.ts +2 -3
- package/dist/calendar/month-foundation.js +6 -7
- package/dist/carousel/foundation.d.ts +17 -19
- package/dist/carousel/foundation.js +51 -51
- package/dist/cascader/foundation.d.ts +36 -32
- package/dist/cascader/foundation.js +145 -132
- package/dist/cascader/util.d.ts +1 -8
- package/dist/cascader/util.js +1 -8
- package/dist/checkbox/checkbox-foundation.d.ts +3 -7
- package/dist/checkbox/checkbox-foundation.js +15 -17
- package/dist/checkbox/checkbox-group-foundation.d.ts +2 -3
- package/dist/checkbox/checkbox-group-foundation.js +8 -8
- package/dist/code-highlight/index.d.ts +1 -2
- 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-picker.scss +0 -2
- 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/color-picker/interface.d.ts +0 -1
- package/dist/config-provider/breakpoint-observer.d.ts +3 -3
- package/dist/config-provider/breakpoint-observer.js +6 -6
- package/dist/config-provider/responsive-types.d.ts +0 -16
- package/dist/cropper/foundation.d.ts +15 -16
- package/dist/cropper/foundation.js +26 -24
- 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 +1 -3
- 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 +39 -58
- package/dist/date-picker/foundation.js +126 -153
- package/dist/date-picker/input-foundation.d.ts +10 -16
- package/dist/date-picker/input-foundation.js +28 -30
- 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 +17 -26
- package/dist/date-picker/months-grid-foundation.js +65 -75
- 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 -3
- package/dist/drag-move/foundation.js +15 -13
- package/dist/dropdown/foundation.d.ts +8 -7
- package/dist/dropdown/foundation.js +32 -28
- package/dist/dropdown/menu-foundation.d.ts +1 -2
- package/dist/dropdown/menu-foundation.js +11 -11
- package/dist/feedback/foundation.d.ts +9 -10
- package/dist/feedback/foundation.js +33 -33
- 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-api-proxy.d.ts +8 -7
- package/dist/form/form-api-proxy.js +25 -25
- package/dist/form/form.scss +0 -12
- package/dist/form/foundation.d.ts +5 -5
- package/dist/form/foundation.js +60 -76
- 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 +1 -3
- package/dist/hot-keys/foundation.d.ts +2 -3
- package/dist/hot-keys/foundation.js +5 -5
- package/dist/image/image-foundation.d.ts +4 -6
- package/dist/image/image-foundation.js +10 -10
- package/dist/image/preview-footer-foundation.d.ts +3 -4
- package/dist/image/preview-footer-foundation.js +10 -10
- package/dist/image/preview-foundation.d.ts +0 -3
- package/dist/image/preview-foundation.js +7 -6
- package/dist/image/preview-image-foundation.d.ts +6 -9
- package/dist/image/preview-image-foundation.js +14 -14
- package/dist/image/preview-inner-foundation.d.ts +9 -10
- package/dist/image/preview-inner-foundation.js +38 -38
- package/dist/input/foundation.d.ts +10 -11
- package/dist/input/foundation.js +47 -49
- package/dist/input/text-entry-foundation.d.ts +3 -5
- package/dist/input/text-entry-foundation.js +14 -15
- package/dist/input/textarea-foundation.d.ts +7 -8
- package/dist/input/textarea-foundation.js +36 -36
- package/dist/input-number/caret.d.ts +0 -1
- package/dist/input-number/caret.js +0 -1
- package/dist/input-number/foundation.d.ts +16 -19
- package/dist/input-number/foundation.js +54 -58
- package/dist/json-viewer/foundation.d.ts +8 -10
- package/dist/json-viewer/foundation.js +23 -24
- package/dist/locale/interface.d.ts +0 -3
- package/dist/lottie/foundation.d.ts +1 -1
- package/dist/lottie/foundation.js +4 -4
- package/dist/markdown-render/foundation.d.ts +2 -7
- package/dist/markdown-render/foundation.js +5 -9
- 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 -8
- package/dist/navigation/foundation.js +14 -20
- 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 -4
- package/dist/navigation/sub-nav-foundation.js +17 -17
- package/dist/notification/notification-list-foundation.d.ts +7 -8
- package/dist/notification/notification-list-foundation.js +12 -13
- package/dist/notification/variables.scss +0 -1
- package/dist/overflow-list/foundation.d.ts +4 -6
- package/dist/overflow-list/foundation.js +18 -19
- package/dist/pagination/foundation.d.ts +8 -10
- package/dist/pagination/foundation.js +28 -28
- package/dist/pincode/foundation.d.ts +6 -9
- package/dist/pincode/foundation.js +23 -26
- package/dist/popconfirm/popconfirm-foundation.d.ts +7 -9
- package/dist/popconfirm/popconfirm-foundation.js +26 -26
- 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 +5 -9
- package/dist/radio/radio-foundation.js +15 -16
- package/dist/radio/radio-group-foundation.d.ts +2 -3
- package/dist/radio/radio-group-foundation.js +9 -9
- package/dist/rating/foundation.d.ts +10 -15
- package/dist/rating/foundation.js +35 -38
- package/dist/resizable/group/index.d.ts +6 -10
- package/dist/resizable/group/index.js +40 -44
- package/dist/resizable/resizable.scss +0 -1
- package/dist/resizable/single/index.d.ts +3 -7
- package/dist/resizable/single/index.js +10 -13
- package/dist/scroll-list/item-foundation.d.ts +7 -9
- package/dist/scroll-list/item-foundation.js +35 -36
- package/dist/scroll-list/variables.scss +1 -6
- package/dist/select/foundation.d.ts +42 -57
- package/dist/select/foundation.js +214 -279
- package/dist/select/option-foundation.d.ts +23 -28
- package/dist/select/option-foundation.js +10 -19
- package/dist/select/variables.scss +1 -8
- package/dist/side-sheet/side-sheet-foundation.d.ts +7 -12
- package/dist/side-sheet/side-sheet-foundation.js +23 -27
- package/dist/side-sheet/variables.scss +1 -3
- package/dist/slider/foundation.d.ts +17 -28
- package/dist/slider/foundation.js +47 -59
- package/dist/slider/variables.scss +1 -5
- package/dist/sortable/accessibility.d.ts +1 -1
- package/dist/sortable/accessibility.js +2 -2
- package/dist/spin/foundation.d.ts +2 -4
- package/dist/spin/foundation.js +6 -7
- package/dist/spin/variables.scss +1 -3
- package/dist/steps/utils.d.ts +1 -1
- package/dist/switch/foundation.d.ts +2 -3
- package/dist/switch/foundation.js +7 -7
- package/dist/switch/switch.scss +1 -1
- package/dist/switch/variables.scss +1 -5
- package/dist/table/foundation.d.ts +24 -33
- package/dist/table/foundation.js +144 -108
- package/dist/table/table.scss +0 -1
- package/dist/table/utils.d.ts +2 -10
- package/dist/table/utils.js +0 -13
- package/dist/table/variables.scss +1 -5
- package/dist/tabs/foundation.d.ts +5 -14
- package/dist/tabs/foundation.js +17 -21
- package/dist/tabs/tabs.scss +1 -1
- package/dist/tag/focus.js +0 -1
- package/dist/tag-input/foundation.d.ts +11 -13
- package/dist/tag-input/foundation.js +52 -53
- 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 +13 -23
- package/dist/time-picker/foundation.js +39 -48
- package/dist/time-picker/input-foundation.d.ts +4 -4
- package/dist/time-picker/input-foundation.js +13 -13
- package/dist/time-picker/utils/index.d.ts +0 -11
- package/dist/time-picker/utils/index.js +0 -11
- package/dist/toast/toast-list-foundation.d.ts +7 -7
- package/dist/toast/toast-list-foundation.js +14 -14
- 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 +9 -12
- package/dist/tooltip/foundation.js +67 -63
- package/dist/tooltip/position.scss +0 -1
- package/dist/transfer/foundation.d.ts +22 -13
- package/dist/transfer/foundation.js +38 -24
- package/dist/tree/foundation.d.ts +14 -16
- package/dist/tree/foundation.js +61 -62
- package/dist/tree/shared.d.ts +2 -4
- 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 +26 -22
- package/dist/tree-select/foundation.js +91 -86
- package/dist/typography/ellipsis.d.ts +5 -7
- package/dist/typography/ellipsis.js +8 -10
- package/dist/typography/format-numeral.d.ts +1 -1
- package/dist/typography/format-numeral.js +2 -2
- package/dist/typography/typography.scss +0 -1
- package/dist/upload/constants.d.ts +1 -1
- package/dist/upload/foundation.d.ts +17 -23
- package/dist/upload/foundation.js +93 -103
- package/dist/upload/utils.d.ts +3 -8
- package/dist/upload/utils.js +6 -11
- package/dist/user-guide/foundation.d.ts +3 -5
- package/dist/user-guide/foundation.js +19 -19
- package/dist/utils/a11y.d.ts +2 -6
- package/dist/utils/a11y.js +1 -4
- package/dist/utils/announcer.d.ts +2 -2
- package/dist/utils/announcer.js +4 -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 +1 -2
- package/dist/utils/focus-handle.js +1 -3
- package/dist/utils/focus-scope.d.ts +5 -6
- package/dist/utils/focus-scope.js +10 -11
- 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/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/foundation.d.ts +15 -15
- package/dist/video-player/foundation.js +89 -89
- package/dist/video-player/progress-foundation.d.ts +2 -3
- package/dist/video-player/progress-foundation.js +12 -13
- package/dist/video-player/variables.scss +1 -1
- package/package.json +2 -2
package/dist/utils/a11y.js
CHANGED
|
@@ -147,10 +147,7 @@ var Typeahead = class {
|
|
|
147
147
|
return -1;
|
|
148
148
|
}
|
|
149
149
|
};
|
|
150
|
-
/**
|
|
151
|
-
* Development-only: warns when a dialog has no accessible name, which screen readers would announce as just
|
|
152
|
-
* "dialog". The name comes from `aria-label` or from the element `aria-labelledby` points at (usually the title).
|
|
153
|
-
*/
|
|
150
|
+
/** Development-only: warns when a dialog has no accessible name, which screen readers would announce as just "dialog" */
|
|
154
151
|
function warnIfDialogUnnamed(dialog, component) {
|
|
155
152
|
if (!isDev() || !dialog) return;
|
|
156
153
|
const labelledBy = dialog.getAttribute("aria-labelledby");
|
|
@@ -30,6 +30,6 @@ export default class Announcer {
|
|
|
30
30
|
* `read` runs at write time, when the message elements are in the document. Messages queued together are read as one;
|
|
31
31
|
* a later call with the same `key` replaces the earlier one, so an in-place update is announced once.
|
|
32
32
|
*/
|
|
33
|
-
announce(key: string, read: () => string)
|
|
34
|
-
dispose()
|
|
33
|
+
announce: (key: string, read: () => string) => void;
|
|
34
|
+
dispose: () => void;
|
|
35
35
|
}
|
package/dist/utils/announcer.js
CHANGED
|
@@ -36,7 +36,7 @@ var Announcer = class {
|
|
|
36
36
|
* `read` runs at write time, when the message elements are in the document. Messages queued together are read as one;
|
|
37
37
|
* a later call with the same `key` replaces the earlier one, so an in-place update is announced once.
|
|
38
38
|
*/
|
|
39
|
-
announce(key, read) {
|
|
39
|
+
announce = (key, read) => {
|
|
40
40
|
this.#pending.set(key, read);
|
|
41
41
|
clearTimeout(this.#timer);
|
|
42
42
|
this.#timer = setTimeout(() => {
|
|
@@ -45,10 +45,10 @@ var Announcer = class {
|
|
|
45
45
|
this.#write(text);
|
|
46
46
|
this.#timer = setTimeout(() => this.#write(""), ANNOUNCE_HOLD);
|
|
47
47
|
}, 100);
|
|
48
|
-
}
|
|
49
|
-
dispose() {
|
|
48
|
+
};
|
|
49
|
+
dispose = () => {
|
|
50
50
|
clearTimeout(this.#timer);
|
|
51
51
|
this.#pending.clear();
|
|
52
|
-
}
|
|
52
|
+
};
|
|
53
53
|
};
|
|
54
54
|
export { ANNOUNCE_DELAY, ANNOUNCE_HOLD, Announcer as default, isAlertType, pickFreshAnnouncements, readNoticeText };
|
package/dist/utils/array.d.ts
CHANGED
|
@@ -1,10 +1,4 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* A new array of the unique items of source that are not in removed
|
|
3
|
-
*
|
|
4
|
-
* differenceUnique(['a', 'b', 'c', 'a', 'b', 'c'], ['a', 'c']) => ['b']
|
|
5
|
-
*/
|
|
6
1
|
export declare function differenceUnique<T>(source: T[], removed: T[]): T[];
|
|
7
2
|
type CompareFn<T> = (a: T, b: T, sortOrder: 'ascend' | 'descend') => number;
|
|
8
|
-
/** Wraps a compare function so that `descend` flips its sign */
|
|
9
3
|
export declare function withOrderSort<T = any>(fn: CompareFn<T>, order?: 'ascend' | 'descend'): (a: T, b: T) => number;
|
|
10
4
|
export {};
|
package/dist/utils/array.js
CHANGED
|
@@ -1,14 +1,8 @@
|
|
|
1
1
|
import { difference, uniq } from "es-toolkit";
|
|
2
2
|
// src/utils/array.ts
|
|
3
|
-
/**
|
|
4
|
-
* A new array of the unique items of source that are not in removed
|
|
5
|
-
*
|
|
6
|
-
* differenceUnique(['a', 'b', 'c', 'a', 'b', 'c'], ['a', 'c']) => ['b']
|
|
7
|
-
*/
|
|
8
3
|
function differenceUnique(source, removed) {
|
|
9
4
|
return difference(uniq(source), removed);
|
|
10
5
|
}
|
|
11
|
-
/** Wraps a compare function so that `descend` flips its sign */
|
|
12
6
|
function withOrderSort(fn, order = "ascend") {
|
|
13
7
|
switch (order) {
|
|
14
8
|
case "descend": return (a, b) => {
|
|
@@ -29,10 +29,7 @@ function isValidTimezoneIANAString(timeZoneString) {
|
|
|
29
29
|
}
|
|
30
30
|
const MILLISECONDS_IN_MINUTE = 6e4;
|
|
31
31
|
const MILLISECONDS_IN_DAY = 864e5;
|
|
32
|
-
/**
|
|
33
|
-
* UTC offset of `timeZone` (IANA name or ±HH[:MM]) at the instant `time` in milliseconds, positive east of UTC. No
|
|
34
|
-
* zone or Z means UTC; an unknown zone gives NaN.
|
|
35
|
-
*/
|
|
32
|
+
/** UTC offset of `timeZone` (IANA name or ±HH[:MM]) at the instant `time` in milliseconds, positive east of UTC */
|
|
36
33
|
function zoneOffset(timeZone, time) {
|
|
37
34
|
if (!timeZone || timeZone === "Z") return 0;
|
|
38
35
|
if (!isValidTimezoneIANAString(timeZone)) return NaN;
|
|
@@ -48,7 +45,6 @@ function wallTimeToInstant(wallTime, timeZone) {
|
|
|
48
45
|
const offsetAfter = zoneOffset(timeZone, wallTime + MILLISECONDS_IN_DAY);
|
|
49
46
|
return [wallTime - Math.max(offsetBefore, offsetAfter), wallTime - Math.min(offsetBefore, offsetAfter)].find((time) => time + zoneOffset(timeZone, time) === wallTime) ?? wallTime - offsetBefore;
|
|
50
47
|
}
|
|
51
|
-
/** Wall-clock fields of a system-local Date read as UTC */
|
|
52
48
|
function wallTimeAsUtc(date) {
|
|
53
49
|
const utc = /* @__PURE__ */ new Date(0);
|
|
54
50
|
utc.setUTCFullYear(date.getFullYear(), date.getMonth(), date.getDate());
|
package/dist/utils/dom.d.ts
CHANGED
|
@@ -11,7 +11,6 @@ export interface RegisterMediaQueryOption {
|
|
|
11
11
|
unmatch?: (e: MediaQueryList | MediaQueryListEvent) => void;
|
|
12
12
|
callInInit?: boolean;
|
|
13
13
|
}
|
|
14
|
-
/** Returns the function that removes the listener */
|
|
15
14
|
export declare function registerMediaQuery(media: string, { match, unmatch, callInInit }: RegisterMediaQueryOption): () => void;
|
|
16
15
|
/**
|
|
17
16
|
* Whether an overlay rendered through `getPopupContainer` covers the page: no container, or one that resolves to body.
|
package/dist/utils/dom.js
CHANGED
|
@@ -11,7 +11,6 @@ function isEventInside(e, ...nodes) {
|
|
|
11
11
|
const path = e.composedPath();
|
|
12
12
|
return nodes.some((node) => node != null && path.includes(node));
|
|
13
13
|
}
|
|
14
|
-
/** Returns the function that removes the listener */
|
|
15
14
|
function registerMediaQuery(media, { match, unmatch, callInInit = true }) {
|
|
16
15
|
if (typeof window !== "undefined") {
|
|
17
16
|
const mediaQueryList = window.matchMedia(media);
|
|
@@ -29,9 +29,6 @@ function escapeHtmlInMarkdown(text) {
|
|
|
29
29
|
}
|
|
30
30
|
return result.join("\n");
|
|
31
31
|
}
|
|
32
|
-
/**
|
|
33
|
-
* Escape `<` to `<` in a single line, but preserve content inside inline code spans.
|
|
34
|
-
*/
|
|
35
32
|
function escapeAngleBracketsOutsideInlineCode(line) {
|
|
36
33
|
const parts = [];
|
|
37
34
|
let i = 0;
|
|
@@ -9,7 +9,5 @@ export declare function supportsFieldSizing(): boolean;
|
|
|
9
9
|
* min-block-size and max-block-size clamp the height.
|
|
10
10
|
*/
|
|
11
11
|
export declare function fitTextareaHeight(textarea: HTMLTextAreaElement): number;
|
|
12
|
-
/** Sets the input's inline width to fit its value, or its placeholder while empty. */
|
|
13
12
|
export declare function fitInputWidth(input: HTMLInputElement): number;
|
|
14
|
-
/** Calls `refit` when web fonts finish loading, which changes text metrics after the first measurement. */
|
|
15
13
|
export declare function onFontsLoaded(refit: () => void, signal: AbortSignal): void;
|
|
@@ -20,7 +20,6 @@ function fitTextareaHeight(textarea) {
|
|
|
20
20
|
textarea.scrollTop = scrollTop;
|
|
21
21
|
return height;
|
|
22
22
|
}
|
|
23
|
-
/** Sets the input's inline width to fit its value, or its placeholder while empty. */
|
|
24
23
|
function fitInputWidth(input) {
|
|
25
24
|
const style = getComputedStyle(input);
|
|
26
25
|
const mirror = document.createElement("span");
|
|
@@ -45,7 +44,6 @@ function fitInputWidth(input) {
|
|
|
45
44
|
input.style.width = `${width}px`;
|
|
46
45
|
return width;
|
|
47
46
|
}
|
|
48
|
-
/** Calls `refit` when web fonts finish loading, which changes text metrics after the first measurement. */
|
|
49
47
|
function onFontsLoaded(refit, signal) {
|
|
50
48
|
document.fonts.addEventListener("loadingdone", refit, { signal });
|
|
51
49
|
}
|
|
@@ -23,7 +23,6 @@ export default class FocusTrapHandle {
|
|
|
23
23
|
static shouldRestoreFocus(container: HTMLElement | null | undefined, modal: boolean): boolean;
|
|
24
24
|
/** Whether focus is inside `container` and was moved there by the keyboard, so closing it should hand focus back */
|
|
25
25
|
static isFocusVisibleWithin(container?: HTMLElement | null): boolean;
|
|
26
|
-
/** Focuses the first focusable element in `container`, or the container itself when it holds none */
|
|
27
26
|
static focusFirstOrSelf(container?: HTMLElement | null, options?: FocusOptions): void;
|
|
28
27
|
/** The first focusable element marked autofocus; neither the browser nor Vue focuses one that is inserted later */
|
|
29
28
|
static findAutofocus(container: HTMLElement): FocusableElement | undefined;
|
|
@@ -31,7 +30,7 @@ export default class FocusTrapHandle {
|
|
|
31
30
|
* Where a dialog puts focus on open when nothing inside has it: the element focused on the first open, the
|
|
32
31
|
* autofocus element when `autofocus` is set, the footer button named by `initialFocus`, else the first focusable.
|
|
33
32
|
*/
|
|
34
|
-
static pickInitialFocus(dialog: HTMLElement,
|
|
33
|
+
static pickInitialFocus(dialog: HTMLElement, { remembered, footer, initialFocus, autofocus }: {
|
|
35
34
|
remembered?: HTMLElement | null;
|
|
36
35
|
footer?: Element | null;
|
|
37
36
|
initialFocus?: string;
|
|
@@ -63,7 +63,6 @@ var FocusTrapHandle = class FocusTrapHandle {
|
|
|
63
63
|
const active = FocusTrapHandle.getActiveElement(container);
|
|
64
64
|
return Boolean(container && active && container.contains(active) && active.matches(":focus-visible"));
|
|
65
65
|
}
|
|
66
|
-
/** Focuses the first focusable element in `container`, or the container itself when it holds none */
|
|
67
66
|
static focusFirstOrSelf(container, options) {
|
|
68
67
|
(container ? FocusTrapHandle.getFocusableElements(container)[0] ?? container : void 0)?.focus(options);
|
|
69
68
|
}
|
|
@@ -75,8 +74,7 @@ var FocusTrapHandle = class FocusTrapHandle {
|
|
|
75
74
|
* Where a dialog puts focus on open when nothing inside has it: the element focused on the first open, the
|
|
76
75
|
* autofocus element when `autofocus` is set, the footer button named by `initialFocus`, else the first focusable.
|
|
77
76
|
*/
|
|
78
|
-
static pickInitialFocus(dialog,
|
|
79
|
-
const { remembered, footer, initialFocus, autofocus } = options;
|
|
77
|
+
static pickInitialFocus(dialog, { remembered, footer, initialFocus, autofocus }) {
|
|
80
78
|
const button = initialFocus ? footer?.querySelector(`[data-type="${initialFocus}"]`) : null;
|
|
81
79
|
return (remembered?.isConnected ? remembered : null) ?? (autofocus ? FocusTrapHandle.findAutofocus(dialog) : null) ?? button ?? FocusTrapHandle.getFocusableElements(dialog)[0];
|
|
82
80
|
}
|
|
@@ -7,19 +7,18 @@
|
|
|
7
7
|
export default class FocusScope {
|
|
8
8
|
#private;
|
|
9
9
|
/** Remembers the focused element to return to; a re-activation finds the focus already inside and keeps the first */
|
|
10
|
-
record()
|
|
10
|
+
record: () => void;
|
|
11
11
|
/** Traps Tab in `container` and focuses it, unless an element inside already took focus */
|
|
12
12
|
activate(container: HTMLElement, preventScroll?: boolean): void;
|
|
13
13
|
/** Focuses `container` without trapping Tab, for a non-modal overlay; an element inside may already have focus */
|
|
14
14
|
enter(container: HTMLElement, preventScroll?: boolean): void;
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
deactivate(): void;
|
|
15
|
+
engage: (container: HTMLElement, modal: boolean, preventScroll?: boolean) => void;
|
|
16
|
+
deactivate: () => void;
|
|
18
17
|
/** Focuses the recorded element again; call it after the inert around the overlay is released */
|
|
19
|
-
restore(preventScroll?: boolean)
|
|
18
|
+
restore: (preventScroll?: boolean) => void;
|
|
20
19
|
/**
|
|
21
20
|
* `restore` unless the user moved focus out of a non-modal `container` (see `FocusTrapHandle.shouldRestoreFocus`).
|
|
22
21
|
* `container` is passed in rather than read from `enter`, which may not have run for this close.
|
|
23
22
|
*/
|
|
24
|
-
restoreIfAllowed(container: HTMLElement | null | undefined, modal: boolean, preventScroll?: boolean)
|
|
23
|
+
restoreIfAllowed: (container: HTMLElement | null | undefined, modal: boolean, preventScroll?: boolean) => void;
|
|
25
24
|
}
|
|
@@ -35,13 +35,13 @@ var FocusScope = class {
|
|
|
35
35
|
#previous = null;
|
|
36
36
|
#fallbacks = [];
|
|
37
37
|
/** Remembers the focused element to return to; a re-activation finds the focus already inside and keeps the first */
|
|
38
|
-
record() {
|
|
38
|
+
record = () => {
|
|
39
39
|
const active = FocusTrapHandle.getDeepActiveElement();
|
|
40
40
|
if (!this.#container?.contains(FocusTrapHandle.getActiveElement(this.#container))) {
|
|
41
41
|
this.#previous = active;
|
|
42
42
|
this.#fallbacks = popupTriggers(active);
|
|
43
43
|
}
|
|
44
|
-
}
|
|
44
|
+
};
|
|
45
45
|
/** Traps Tab in `container` and focuses it, unless an element inside already took focus */
|
|
46
46
|
activate(container, preventScroll) {
|
|
47
47
|
this.#trap?.destroy();
|
|
@@ -54,25 +54,24 @@ var FocusScope = class {
|
|
|
54
54
|
if (!container.contains(FocusTrapHandle.getActiveElement(container))) container.focus({ preventScroll });
|
|
55
55
|
if (!container.contains(FocusTrapHandle.getActiveElement(container))) FocusTrapHandle.getFocusableElements(container)[0]?.focus({ preventScroll });
|
|
56
56
|
}
|
|
57
|
-
|
|
58
|
-
engage(container, modal, preventScroll) {
|
|
57
|
+
engage = (container, modal, preventScroll) => {
|
|
59
58
|
if (modal) this.activate(container, preventScroll);
|
|
60
59
|
else this.enter(container, preventScroll);
|
|
61
|
-
}
|
|
62
|
-
deactivate() {
|
|
60
|
+
};
|
|
61
|
+
deactivate = () => {
|
|
63
62
|
this.#trap?.destroy();
|
|
64
63
|
this.#trap = null;
|
|
65
|
-
}
|
|
64
|
+
};
|
|
66
65
|
/** Focuses the recorded element again; call it after the inert around the overlay is released */
|
|
67
|
-
restore(preventScroll) {
|
|
66
|
+
restore = (preventScroll) => {
|
|
68
67
|
[this.#previous, ...this.#fallbacks].find(canTakeFocus)?.focus({ preventScroll });
|
|
69
|
-
}
|
|
68
|
+
};
|
|
70
69
|
/**
|
|
71
70
|
* `restore` unless the user moved focus out of a non-modal `container` (see `FocusTrapHandle.shouldRestoreFocus`).
|
|
72
71
|
* `container` is passed in rather than read from `enter`, which may not have run for this close.
|
|
73
72
|
*/
|
|
74
|
-
restoreIfAllowed(container, modal, preventScroll) {
|
|
73
|
+
restoreIfAllowed = (container, modal, preventScroll) => {
|
|
75
74
|
if (FocusTrapHandle.shouldRestoreFocus(container, modal)) this.restore(preventScroll);
|
|
76
|
-
}
|
|
75
|
+
};
|
|
77
76
|
};
|
|
78
77
|
export { FocusScope as default };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export default function isPromise(value:
|
|
1
|
+
export default function isPromise(value: unknown): value is PromiseLike<unknown>;
|
|
@@ -5,14 +5,14 @@
|
|
|
5
5
|
*/
|
|
6
6
|
var ReleaseHolder = class {
|
|
7
7
|
#release = null;
|
|
8
|
-
hold(acquire) {
|
|
8
|
+
hold = (acquire) => {
|
|
9
9
|
this.release();
|
|
10
10
|
this.#release = acquire();
|
|
11
|
-
}
|
|
12
|
-
release() {
|
|
11
|
+
};
|
|
12
|
+
release = () => {
|
|
13
13
|
const release = this.#release;
|
|
14
14
|
this.#release = null;
|
|
15
15
|
release?.();
|
|
16
|
-
}
|
|
16
|
+
};
|
|
17
17
|
};
|
|
18
18
|
export { ReleaseHolder as default };
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
3
|
-
*
|
|
4
|
-
*
|
|
5
|
-
* the body's own margin and any width set by the page's stylesheet.
|
|
2
|
+
* Locks are counted, so stacked overlays release the page only when the last one closes. The body's end padding grows
|
|
3
|
+
* by the scrollbar width, so the page does not shift sideways when its scrollbar disappears; padding rather than width
|
|
4
|
+
* keeps the body's own margin and any width set by the page's stylesheet.
|
|
6
5
|
*/
|
|
7
6
|
export declare function lockBodyScroll(): () => void;
|
|
@@ -2,10 +2,9 @@
|
|
|
2
2
|
let lockCount = 0;
|
|
3
3
|
let restore = null;
|
|
4
4
|
/**
|
|
5
|
-
*
|
|
6
|
-
*
|
|
7
|
-
*
|
|
8
|
-
* the body's own margin and any width set by the page's stylesheet.
|
|
5
|
+
* Locks are counted, so stacked overlays release the page only when the last one closes. The body's end padding grows
|
|
6
|
+
* by the scrollbar width, so the page does not shift sideways when its scrollbar disappears; padding rather than width
|
|
7
|
+
* keeps the body's own margin and any width set by the page's stylesheet.
|
|
9
8
|
*/
|
|
10
9
|
function lockBodyScroll() {
|
|
11
10
|
if (lockCount === 0) {
|
package/dist/utils/tween.d.ts
CHANGED
|
@@ -10,5 +10,4 @@ export interface TweenOptions {
|
|
|
10
10
|
onFrame: (value: number) => void;
|
|
11
11
|
onEnd?: () => void;
|
|
12
12
|
}
|
|
13
|
-
/** Animates a number from `from` to `to` once per frame; returns a function that cancels it */
|
|
14
13
|
export declare function tween({ from, to, duration, easing, onFrame, onEnd }: TweenOptions): () => void;
|
package/dist/utils/tween.js
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
// src/utils/tween.ts
|
|
2
2
|
const linear = (t) => t;
|
|
3
3
|
const easeInOutCubic = (t) => t < .5 ? 4 * t ** 3 : 1 - (-2 * t + 2) ** 3 / 2;
|
|
4
|
-
/** Animates a number from `from` to `to` once per frame; returns a function that cancels it */
|
|
5
4
|
function tween({ from, to, duration, easing = linear, onFrame, onEnd }) {
|
|
6
5
|
let start;
|
|
7
6
|
let frame = requestAnimationFrame(function step(now) {
|
package/dist/utils/uuid.d.ts
CHANGED
package/dist/utils/uuid.js
CHANGED
package/dist/utils/warning.d.ts
CHANGED
package/dist/utils/warning.js
CHANGED
|
@@ -7,7 +7,6 @@
|
|
|
7
7
|
function isDev() {
|
|
8
8
|
return process.env.NODE_ENV !== "production";
|
|
9
9
|
}
|
|
10
|
-
/** Prints `info` as a development-time warning when `flag` holds; production builds print nothing */
|
|
11
10
|
function warning(flag, info) {
|
|
12
11
|
if (flag && isDev()) console.warn(`Warning: ${info}`);
|
|
13
12
|
}
|
|
@@ -55,39 +55,39 @@ export default class VideoPlayerFoundation<P extends VideoPlayerBaseProps = Vide
|
|
|
55
55
|
protected checkFullScreen(): boolean;
|
|
56
56
|
init(): void;
|
|
57
57
|
destroy(): void;
|
|
58
|
-
handleTimeChange(value: number)
|
|
59
|
-
handleTimeUpdate()
|
|
60
|
-
handleDurationChange()
|
|
61
|
-
handleError()
|
|
58
|
+
handleTimeChange: (value: number) => void;
|
|
59
|
+
handleTimeUpdate: () => void;
|
|
60
|
+
handleDurationChange: () => void;
|
|
61
|
+
handleError: () => void;
|
|
62
62
|
handleLoadStart: () => void;
|
|
63
|
-
handlePlayOrPause()
|
|
63
|
+
handlePlayOrPause: () => void;
|
|
64
64
|
handlePlay(): void;
|
|
65
65
|
handlePause(): void;
|
|
66
66
|
handleVideoPlay: () => void;
|
|
67
67
|
handleVideoPause: () => void;
|
|
68
68
|
handleCanPlay: () => void;
|
|
69
|
-
handleWaiting(locale: VideoPlayerNotificationLocale)
|
|
70
|
-
handleStalled(locale: VideoPlayerNotificationLocale)
|
|
69
|
+
handleWaiting: (locale: VideoPlayerNotificationLocale) => void;
|
|
70
|
+
handleStalled: (locale: VideoPlayerNotificationLocale) => void;
|
|
71
71
|
handleProgress: () => void;
|
|
72
72
|
handleEnded: () => void;
|
|
73
73
|
/** From the user (the slider); init applies the initial volume without notifying */
|
|
74
|
-
handleVolumeChange(value: number)
|
|
74
|
+
handleVolumeChange: (value: number) => void;
|
|
75
75
|
/** Mutes, or unmutes to the volume before muting; to half volume when that was 0 */
|
|
76
76
|
handleVolumeSilent: () => void;
|
|
77
77
|
handleFullscreen: () => void;
|
|
78
|
-
handleRateChange(rate: {
|
|
78
|
+
handleRateChange: (rate: {
|
|
79
79
|
label: string;
|
|
80
80
|
value: number;
|
|
81
|
-
}, locale: VideoPlayerNotificationLocale)
|
|
82
|
-
handleQualityChange(quality: {
|
|
81
|
+
}, locale: VideoPlayerNotificationLocale) => void;
|
|
82
|
+
handleQualityChange: (quality: {
|
|
83
83
|
label: string;
|
|
84
84
|
value: string;
|
|
85
|
-
}, locale: VideoPlayerNotificationLocale)
|
|
86
|
-
handleRouteChange(route: {
|
|
85
|
+
}, locale: VideoPlayerNotificationLocale) => void;
|
|
86
|
+
handleRouteChange: (route: {
|
|
87
87
|
label: string;
|
|
88
88
|
value: string;
|
|
89
|
-
}, locale: VideoPlayerNotificationLocale)
|
|
90
|
-
handleMirror(locale: VideoPlayerNotificationLocale)
|
|
89
|
+
}, locale: VideoPlayerNotificationLocale) => void;
|
|
90
|
+
handleMirror: (locale: VideoPlayerNotificationLocale) => void;
|
|
91
91
|
handlePictureInPicture: () => void;
|
|
92
92
|
handleMouseEnterWrapper: () => void;
|
|
93
93
|
handleMouseLeaveWrapper: () => void;
|