@fibrae/semi-foundation 0.6.0 → 0.7.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/base/index.d.ts +2 -1
- package/dist/base/index.js +2 -1
- package/dist/base/overlay-session.d.ts +16 -0
- package/dist/base/overlay-session.js +36 -0
- package/dist/components/audio-player/foundation.js +1 -1
- package/dist/components/auto-complete/constants.d.ts +3 -1
- package/dist/components/auto-complete/foundation.d.ts +1 -1
- package/dist/components/auto-complete/foundation.js +15 -16
- package/dist/components/badge/constants.d.ts +3 -1
- package/dist/components/button/constants.d.ts +3 -1
- package/dist/components/card/constants.d.ts +3 -1
- package/dist/components/cascader/constants.d.ts +2 -0
- package/dist/components/cascader/foundation.d.ts +2 -4
- package/dist/components/cascader/foundation.js +4 -1
- package/dist/components/color-picker/foundation.d.ts +2 -0
- package/dist/components/color-picker/foundation.js +5 -0
- package/dist/components/cropper/constants.d.ts +2 -0
- package/dist/components/date-picker/_utils/index.d.ts +1 -2
- package/dist/components/date-picker/_utils/index.js +1 -2
- package/dist/components/date-picker/_utils/is-timestamp.js +1 -1
- package/dist/components/date-picker/_utils/parse-value.js +1 -1
- package/dist/components/date-picker/_utils/picker-type.js +1 -1
- package/dist/components/date-picker/constants.d.ts +2 -0
- package/dist/components/date-picker/foundation.d.ts +3 -4
- package/dist/components/date-picker/foundation.js +8 -3
- package/dist/components/date-picker/input-foundation.d.ts +1 -0
- package/dist/components/date-picker/input-foundation.js +1 -1
- package/dist/components/date-picker/month-foundation.d.ts +1 -1
- package/dist/components/date-picker/month-foundation.js +1 -0
- package/dist/components/date-picker/months-grid-foundation.d.ts +1 -1
- package/dist/components/date-picker/months-grid-foundation.js +1 -1
- package/dist/components/descriptions/constants.d.ts +3 -1
- package/dist/components/dropdown/constants.d.ts +2 -0
- package/dist/components/dropdown/menu-foundation.d.ts +1 -1
- package/dist/components/empty/constants.d.ts +3 -1
- package/dist/components/feedback/constants.d.ts +3 -1
- package/dist/components/highlight/constants.d.ts +3 -1
- package/dist/components/image/constants.d.ts +5 -1
- package/dist/components/image/preview-inner-foundation.js +6 -15
- package/dist/components/input/constants.d.ts +5 -1
- package/dist/components/input-number/constants.d.ts +3 -1
- package/dist/components/modal/constants.d.ts +3 -1
- package/dist/components/modal/modal-content-foundation.d.ts +3 -3
- package/dist/components/modal/modal-content-foundation.js +5 -3
- package/dist/components/modal/modal-foundation.d.ts +0 -2
- package/dist/components/modal/modal-foundation.js +6 -16
- package/dist/components/navigation/constants.d.ts +4 -0
- package/dist/components/overflow-list/constants.d.ts +2 -0
- package/dist/components/pagination/foundation.d.ts +1 -1
- package/dist/components/popconfirm/constants.d.ts +3 -1
- package/dist/components/popover/constants.d.ts +2 -0
- package/dist/components/radio/constants.d.ts +3 -1
- package/dist/components/scroll-list/item-foundation.js +1 -0
- package/dist/components/select/constants.d.ts +2 -0
- package/dist/components/select/foundation.d.ts +1 -4
- package/dist/components/select/foundation.js +31 -56
- package/dist/components/select/select.css +3 -3
- package/dist/components/select/select.scss +8 -3
- package/dist/components/side-sheet/constants.d.ts +2 -0
- package/dist/components/side-sheet/side-sheet-foundation.d.ts +6 -4
- package/dist/components/side-sheet/side-sheet-foundation.js +33 -23
- package/dist/components/slider/constants.d.ts +3 -1
- package/dist/components/slider/foundation.d.ts +7 -7
- package/dist/components/slider/foundation.js +9 -6
- package/dist/components/spin/constants.d.ts +3 -1
- package/dist/components/table/constants.d.ts +2 -0
- package/dist/components/tabs/constants.d.ts +2 -0
- package/dist/components/tabs/foundation.js +19 -60
- package/dist/components/time-picker/combobox-options.js +1 -1
- package/dist/components/time-picker/constants.d.ts +2 -0
- package/dist/components/time-picker/foundation.d.ts +3 -1
- package/dist/components/time-picker/foundation.js +7 -1
- package/dist/components/tooltip/constants.d.ts +2 -0
- package/dist/components/tooltip/foundation.d.ts +13 -15
- package/dist/components/tooltip/foundation.js +54 -15
- package/dist/components/tree/constants.d.ts +2 -0
- package/dist/components/tree/foundation.d.ts +17 -3
- package/dist/components/tree/foundation.js +37 -2
- package/dist/components/tree/shared.d.ts +37 -0
- package/dist/components/tree/shared.js +42 -1
- package/dist/components/tree-select/constants.d.ts +2 -0
- package/dist/components/tree-select/foundation.d.ts +15 -10
- package/dist/components/tree-select/foundation.js +44 -7
- package/dist/components/upload/constants.d.ts +4 -2
- package/dist/components/upload/utils.d.ts +5 -0
- package/dist/components/upload/utils.js +8 -2
- package/dist/components/video-player/foundation.js +1 -1
- package/dist/components/video-player/utils.d.ts +0 -2
- package/dist/components/video-player/utils.js +1 -14
- package/dist/locale/interface.d.ts +2 -0
- package/dist/locale/source/en_US.js +1 -0
- package/dist/locale/source/zh_CN.js +1 -0
- package/dist/utils/a11y.d.ts +9 -0
- package/dist/utils/a11y.js +19 -1
- package/dist/utils/date-fns-extra.d.ts +1 -0
- package/dist/utils/date-fns-extra.js +4 -1
- package/dist/utils/index.d.ts +3 -2
- package/dist/utils/index.js +3 -2
- package/dist/utils/media.d.ts +2 -0
- package/dist/utils/media.js +15 -0
- package/package.json +2 -2
- package/dist/components/date-picker/_utils/is-valid-date.d.ts +0 -1
- package/dist/components/date-picker/_utils/is-valid-date.js +0 -5
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
export declare function isValidDate(date: any): boolean;
|
|
1
2
|
/**
|
|
2
3
|
* The Intl time zone for a Semi time zone value: an offset in hours or a GMT±HH:MM string becomes the fixed ±HH:MM
|
|
3
4
|
* offset Intl accepts, which never shifts for DST; any other string is used as is, normally an IANA name
|
|
@@ -2,6 +2,9 @@ import { TZDate, tzOffset } from "@date-fns/tz";
|
|
|
2
2
|
import { parseISO, toDate } from "date-fns";
|
|
3
3
|
// src/utils/date-fns-extra.ts
|
|
4
4
|
const GMTStringReg = /[-+]\d{2}:\d{2}/;
|
|
5
|
+
function isValidDate(date) {
|
|
6
|
+
return date && Object.prototype.toString.call(date) === "[object Date]" && !isNaN(date);
|
|
7
|
+
}
|
|
5
8
|
/**
|
|
6
9
|
* The Intl time zone for a Semi time zone value: an offset in hours or a GMT±HH:MM string becomes the fixed ±HH:MM
|
|
7
10
|
* offset Intl accepts, which never shifts for DST; any other string is used as is, normally an IANA name
|
|
@@ -103,4 +106,4 @@ function zonedTimeToUtc(date, timeZone) {
|
|
|
103
106
|
if (!ianaTimeZone && typeof date === "string" && !/(Z|[+-]\d{2}(:?\d{2})?)$/.test(date)) return dateValue;
|
|
104
107
|
return new Date(wallTimeToInstant(wallTimeAsUtc(dateValue), ianaTimeZone));
|
|
105
108
|
}
|
|
106
|
-
export { isValidTimezoneIANAString, toIANA, utcToZonedTime, zonedTimeToUtc };
|
|
109
|
+
export { isValidDate, isValidTimezoneIANAString, toIANA, utcToZonedTime, zonedTimeToUtc };
|
package/dist/utils/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ListNavigationOptions, Typeahead, crossesFocusBoundary, getEnabledStepIndex, getListTargetIndex, handlePrevent, isAriaKey, isInnerControl, isInnerControlActivation, isInnerControlKey, isNativeInputKey, isTextEditor, joinIds, namedRole, setFocusToFirstItem, setFocusToItem, setFocusToLastItem, stopButtonActivationKeys, warnIfDialogUnnamed } from "./a11y.js";
|
|
1
|
+
import { ListNavigationOptions, Typeahead, crossesFocusBoundary, getEnabledStepIndex, getListTargetIndex, getOptionId, handlePrevent, isAriaKey, isBrowserChord, isInnerControl, isInnerControlActivation, isInnerControlKey, isNativeInputKey, isTextEditor, joinIds, namedRole, revealOption, setFocusToFirstItem, setFocusToItem, setFocusToLastItem, stopButtonActivationKeys, warnIfDialogUnnamed } from "./a11y.js";
|
|
2
2
|
import { pinAnimatedHeight } from "./animated-height.js";
|
|
3
3
|
import Announcer, { ANNOUNCE_DELAY, ANNOUNCE_HOLD } from "./announcer.js";
|
|
4
4
|
import arrayMove from "./array-move.js";
|
|
@@ -19,6 +19,7 @@ import isPromise from "./is-promise.js";
|
|
|
19
19
|
import isValidTimeZone from "./is-valid-time-zone.js";
|
|
20
20
|
import { ENTER_KEY, ESC_KEY, isComposing } from "./key-code.js";
|
|
21
21
|
import { KEEP_INTERACTIVE_ATTRIBUTE, Layer, POPUP_ID_ATTRIBUTE, POPUP_SELECTOR, containsWithPopups, getPopupTrigger, openLayer, popupTriggerSelector, popupTriggers } from "./layer.js";
|
|
22
|
+
import { ignoreExpectedMediaErrors } from "./media.js";
|
|
22
23
|
import { get, has, isEmpty, remove, set } from "./object.js";
|
|
23
24
|
import { isSecondaryPress } from "./pointer.js";
|
|
24
25
|
import { lockBodyScroll } from "./scroll-lock.js";
|
|
@@ -28,4 +29,4 @@ import { Easing, TweenOptions, easeInOutCubic, linear, tween } from "./tween.js"
|
|
|
28
29
|
import { ArrayElement, Size } from "./type.js";
|
|
29
30
|
import { createId } from "./uuid.js";
|
|
30
31
|
import warning, { isDev } from "./warning.js";
|
|
31
|
-
export { ANNOUNCE_DELAY, ANNOUNCE_HOLD, Announcer, ArrayElement, CopiedTimer, ENTER_KEY, ESC_KEY, Easing, Event as EventEmitter, KEEP_INTERACTIVE_ATTRIBUTE, Layer, ListNavigationOptions, POPUP_ID_ATTRIBUTE, POPUP_SELECTOR, RegisterMediaQueryOption, Size, TweenOptions, Typeahead, addClass, arrayMove, assertClient, centerInScroller, containsWithPopups, copyText, coversPage, createId, crossesFocusBoundary, defaultPopupContainer, differenceUnique, easeInOutCubic, escapeHtmlInMarkdown, findFocusAfter, fitInputWidth, fitTextareaHeight, focusWithoutRing, get, getDataAttr, getEnabledStepIndex, getListTargetIndex, getPopupTrigger, handlePrevent, handoverFocus, has, isAriaKey, isComposing, isDev, isEmpty, isEnterPress, isEventInside, isHTMLElement, isInnerControl, isInnerControlActivation, isInnerControlKey, isNativeInputKey, isObject, isPromise, isSecondaryPress, isTextEditor, isValidTimeZone, joinIds, linear, lockBodyScroll, namedRole, noop, onFontsLoaded, openLayer, pinAnimatedHeight, popupTriggerSelector, popupTriggers, registerMediaQuery, remove, removeClass, resolvePopupContainer, scrollIntoViewWithin, set, setFocusToFirstItem, setFocusToItem, setFocusToLastItem, shallowEqualObjects, stopButtonActivationKeys, supportsFieldSizing, supportsFocusVisibleOption, supportsScrollContainerOption, toCssLength, tween, warnIfDialogUnnamed, warning, withOrderSort };
|
|
32
|
+
export { ANNOUNCE_DELAY, ANNOUNCE_HOLD, Announcer, ArrayElement, CopiedTimer, ENTER_KEY, ESC_KEY, Easing, Event as EventEmitter, KEEP_INTERACTIVE_ATTRIBUTE, Layer, ListNavigationOptions, POPUP_ID_ATTRIBUTE, POPUP_SELECTOR, RegisterMediaQueryOption, Size, TweenOptions, Typeahead, addClass, arrayMove, assertClient, centerInScroller, containsWithPopups, copyText, coversPage, createId, crossesFocusBoundary, defaultPopupContainer, differenceUnique, easeInOutCubic, escapeHtmlInMarkdown, findFocusAfter, fitInputWidth, fitTextareaHeight, focusWithoutRing, get, getDataAttr, getEnabledStepIndex, getListTargetIndex, getOptionId, getPopupTrigger, handlePrevent, handoverFocus, has, ignoreExpectedMediaErrors, isAriaKey, isBrowserChord, isComposing, isDev, isEmpty, isEnterPress, isEventInside, isHTMLElement, isInnerControl, isInnerControlActivation, isInnerControlKey, isNativeInputKey, isObject, isPromise, isSecondaryPress, isTextEditor, isValidTimeZone, joinIds, linear, lockBodyScroll, namedRole, noop, onFontsLoaded, openLayer, pinAnimatedHeight, popupTriggerSelector, popupTriggers, registerMediaQuery, remove, removeClass, resolvePopupContainer, revealOption, scrollIntoViewWithin, set, setFocusToFirstItem, setFocusToItem, setFocusToLastItem, shallowEqualObjects, stopButtonActivationKeys, supportsFieldSizing, supportsFocusVisibleOption, supportsScrollContainerOption, toCssLength, tween, warnIfDialogUnnamed, warning, withOrderSort };
|
package/dist/utils/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Typeahead, crossesFocusBoundary, getEnabledStepIndex, getListTargetIndex, handlePrevent, isAriaKey, isInnerControl, isInnerControlActivation, isInnerControlKey, isNativeInputKey, isTextEditor, joinIds, namedRole, setFocusToFirstItem, setFocusToItem, setFocusToLastItem, stopButtonActivationKeys, warnIfDialogUnnamed } from "./a11y.js";
|
|
1
|
+
import { Typeahead, crossesFocusBoundary, getEnabledStepIndex, getListTargetIndex, getOptionId, handlePrevent, isAriaKey, isBrowserChord, isInnerControl, isInnerControlActivation, isInnerControlKey, isNativeInputKey, isTextEditor, joinIds, namedRole, revealOption, setFocusToFirstItem, setFocusToItem, setFocusToLastItem, stopButtonActivationKeys, warnIfDialogUnnamed } from "./a11y.js";
|
|
2
2
|
import { pinAnimatedHeight } from "./animated-height.js";
|
|
3
3
|
import Announcer, { ANNOUNCE_DELAY, ANNOUNCE_HOLD } from "./announcer.js";
|
|
4
4
|
import arrayMove from "./array-move.js";
|
|
@@ -19,6 +19,7 @@ import isPromise from "./is-promise.js";
|
|
|
19
19
|
import isValidTimeZone from "./is-valid-time-zone.js";
|
|
20
20
|
import { ENTER_KEY, ESC_KEY, isComposing } from "./key-code.js";
|
|
21
21
|
import { KEEP_INTERACTIVE_ATTRIBUTE, POPUP_ID_ATTRIBUTE, POPUP_SELECTOR, containsWithPopups, getPopupTrigger, openLayer, popupTriggerSelector, popupTriggers } from "./layer.js";
|
|
22
|
+
import { ignoreExpectedMediaErrors } from "./media.js";
|
|
22
23
|
import { get, has, isEmpty, remove, set } from "./object.js";
|
|
23
24
|
import { isSecondaryPress } from "./pointer.js";
|
|
24
25
|
import { lockBodyScroll } from "./scroll-lock.js";
|
|
@@ -27,4 +28,4 @@ import { focusWithoutRing, scrollIntoViewWithin, supportsFocusVisibleOption, sup
|
|
|
27
28
|
import { easeInOutCubic, linear, tween } from "./tween.js";
|
|
28
29
|
import { createId } from "./uuid.js";
|
|
29
30
|
import warning, { isDev } from "./warning.js";
|
|
30
|
-
export { ANNOUNCE_DELAY, ANNOUNCE_HOLD, Announcer, CopiedTimer, ENTER_KEY, ESC_KEY, Event as EventEmitter, KEEP_INTERACTIVE_ATTRIBUTE, POPUP_ID_ATTRIBUTE, POPUP_SELECTOR, Typeahead, addClass, arrayMove, assertClient, centerInScroller, containsWithPopups, copyText, coversPage, createId, crossesFocusBoundary, defaultPopupContainer, differenceUnique, easeInOutCubic, escapeHtmlInMarkdown, findFocusAfter, fitInputWidth, fitTextareaHeight, focusWithoutRing, get, getDataAttr, getEnabledStepIndex, getListTargetIndex, getPopupTrigger, handlePrevent, handoverFocus, has, isAriaKey, isComposing, isDev, isEmpty, isEnterPress, isEventInside, isHTMLElement, isInnerControl, isInnerControlActivation, isInnerControlKey, isNativeInputKey, isObject, isPromise, isSecondaryPress, isTextEditor, isValidTimeZone, joinIds, linear, lockBodyScroll, namedRole, noop, onFontsLoaded, openLayer, pinAnimatedHeight, popupTriggerSelector, popupTriggers, registerMediaQuery, remove, removeClass, resolvePopupContainer, scrollIntoViewWithin, set, setFocusToFirstItem, setFocusToItem, setFocusToLastItem, shallowEqualObjects, stopButtonActivationKeys, supportsFieldSizing, supportsFocusVisibleOption, supportsScrollContainerOption, toCssLength, tween, warnIfDialogUnnamed, warning, withOrderSort };
|
|
31
|
+
export { ANNOUNCE_DELAY, ANNOUNCE_HOLD, Announcer, CopiedTimer, ENTER_KEY, ESC_KEY, Event as EventEmitter, KEEP_INTERACTIVE_ATTRIBUTE, POPUP_ID_ATTRIBUTE, POPUP_SELECTOR, Typeahead, addClass, arrayMove, assertClient, centerInScroller, containsWithPopups, copyText, coversPage, createId, crossesFocusBoundary, defaultPopupContainer, differenceUnique, easeInOutCubic, escapeHtmlInMarkdown, findFocusAfter, fitInputWidth, fitTextareaHeight, focusWithoutRing, get, getDataAttr, getEnabledStepIndex, getListTargetIndex, getOptionId, getPopupTrigger, handlePrevent, handoverFocus, has, ignoreExpectedMediaErrors, isAriaKey, isBrowserChord, isComposing, isDev, isEmpty, isEnterPress, isEventInside, isHTMLElement, isInnerControl, isInnerControlActivation, isInnerControlKey, isNativeInputKey, isObject, isPromise, isSecondaryPress, isTextEditor, isValidTimeZone, joinIds, linear, lockBodyScroll, namedRole, noop, onFontsLoaded, openLayer, pinAnimatedHeight, popupTriggerSelector, popupTriggers, registerMediaQuery, remove, removeClass, resolvePopupContainer, revealOption, scrollIntoViewWithin, set, setFocusToFirstItem, setFocusToItem, setFocusToLastItem, shallowEqualObjects, stopButtonActivationKeys, supportsFieldSizing, supportsFocusVisibleOption, supportsScrollContainerOption, toCssLength, tween, warnIfDialogUnnamed, warning, withOrderSort };
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
// src/utils/media.ts
|
|
2
|
+
const EXPECTED_MEDIA_ERRORS = /* @__PURE__ */ new Set([
|
|
3
|
+
"AbortError",
|
|
4
|
+
"NotAllowedError",
|
|
5
|
+
"InvalidStateError",
|
|
6
|
+
"NotSupportedError"
|
|
7
|
+
]);
|
|
8
|
+
/** Drops the rejections a media request is expected to meet in normal use; any other rejection stays a rejection. */
|
|
9
|
+
function ignoreExpectedMediaErrors(request) {
|
|
10
|
+
return request.then(() => void 0, (error) => {
|
|
11
|
+
if (error instanceof DOMException && EXPECTED_MEDIA_ERRORS.has(error.name)) return;
|
|
12
|
+
throw error;
|
|
13
|
+
});
|
|
14
|
+
}
|
|
15
|
+
export { ignoreExpectedMediaErrors };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fibrae/semi-foundation",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.7.0",
|
|
4
4
|
"description": "",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"homepage": "https://semi-design-next.pages.dev",
|
|
@@ -28,7 +28,7 @@
|
|
|
28
28
|
"dependencies": {
|
|
29
29
|
"@date-fns/tz": "^1.5.0",
|
|
30
30
|
"@dnd-kit/dom": "~0.5.3",
|
|
31
|
-
"@fibrae/semi-json-viewer-core": "0.
|
|
31
|
+
"@fibrae/semi-json-viewer-core": "0.7.0",
|
|
32
32
|
"@mdx-js/mdx": "^3.1.1",
|
|
33
33
|
"@shikijs/core": "^4.6.0",
|
|
34
34
|
"clsx": "^2.1.1",
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export default function isValidDate(date: any): boolean;
|