@jobber/components 9.3.0 → 9.5.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/Autocomplete/index.cjs +0 -1
- package/dist/Autocomplete/index.mjs +0 -1
- package/dist/Card/index.cjs +7 -7
- package/dist/Card/index.mjs +7 -7
- package/dist/Chip/index.cjs +0 -1
- package/dist/Chip/index.mjs +0 -1
- package/dist/Chips/InternalChipDismissible/hooks/index.cjs +0 -1
- package/dist/Chips/InternalChipDismissible/hooks/index.mjs +0 -1
- package/dist/Chips/InternalChipDismissible/index.cjs +0 -1
- package/dist/Chips/InternalChipDismissible/index.mjs +0 -1
- package/dist/Chips/index.cjs +0 -1
- package/dist/Chips/index.mjs +0 -1
- package/dist/ComboboxChipRemove-cjs.js +181 -184
- package/dist/ComboboxChipRemove-es.js +4 -7
- package/dist/ConfirmationModal/index.cjs +0 -1
- package/dist/ConfirmationModal/index.mjs +0 -1
- package/dist/DataDump/DataDump.d.ts +1 -1
- package/dist/DataDump/DataDump.messages.d.ts +6 -0
- package/dist/DataDump/index.cjs +9 -9
- package/dist/DataDump/index.mjs +9 -9
- package/dist/DataDump-cjs.js +11 -1
- package/dist/DataDump-es.js +11 -1
- package/dist/DataList/components/DataListActions/index.cjs +0 -1
- package/dist/DataList/components/DataListActions/index.mjs +0 -1
- package/dist/DataList/components/DataListBulkActions/index.cjs +0 -1
- package/dist/DataList/components/DataListBulkActions/index.mjs +0 -1
- package/dist/DataList/components/DataListFilters/components/DataListSort/index.cjs +0 -1
- package/dist/DataList/components/DataListFilters/components/DataListSort/index.mjs +0 -1
- package/dist/DataList/components/DataListFilters/index.cjs +0 -1
- package/dist/DataList/components/DataListFilters/index.mjs +0 -1
- package/dist/DataList/components/DataListHeader/index.cjs +0 -1
- package/dist/DataList/components/DataListHeader/index.mjs +0 -1
- package/dist/DataList/components/DataListItem/index.cjs +0 -1
- package/dist/DataList/components/DataListItem/index.mjs +0 -1
- package/dist/DataList/components/DataListItemActions/index.cjs +0 -1
- package/dist/DataList/components/DataListItemActions/index.mjs +0 -1
- package/dist/DataList/components/DataListItemActionsOverflow/index.cjs +0 -1
- package/dist/DataList/components/DataListItemActionsOverflow/index.mjs +0 -1
- package/dist/DataList/components/DataListItems/index.cjs +0 -1
- package/dist/DataList/components/DataListItems/index.mjs +0 -1
- package/dist/DataList/components/DataListLayout/index.cjs +0 -1
- package/dist/DataList/components/DataListLayout/index.mjs +0 -1
- package/dist/DataList/components/DataListLayoutActions/index.cjs +0 -1
- package/dist/DataList/components/DataListLayoutActions/index.mjs +0 -1
- package/dist/DataList/index.cjs +0 -1
- package/dist/DataList/index.mjs +0 -1
- package/dist/DataTable/DataTable.messages.d.ts +22 -0
- package/dist/DataTable/index.cjs +2 -2
- package/dist/DataTable/index.mjs +2 -2
- package/dist/DataTable-cjs.js +34 -5
- package/dist/DataTable-es.js +34 -5
- package/dist/DatePicker/index.cjs +0 -2
- package/dist/DatePicker/index.mjs +0 -2
- package/dist/DatePicker-cjs.js +19 -18
- package/dist/DatePicker-es.js +2 -1
- package/dist/Dialog/index.cjs +11 -6
- package/dist/Dialog/index.mjs +11 -6
- package/dist/DrawerDescription-cjs.js +7 -8
- package/dist/DrawerDescription-es.js +1 -2
- package/dist/DrawerTitle-cjs.js +4 -4
- package/dist/DrawerTitle-es.js +1 -1
- package/dist/FeatureSwitch/FeatureSwitch.messages.d.ts +10 -0
- package/dist/FeatureSwitch/index.cjs +2 -0
- package/dist/FeatureSwitch/index.mjs +2 -0
- package/dist/FeatureSwitch-cjs.js +15 -2
- package/dist/FeatureSwitch-es.js +15 -2
- package/dist/FieldDescription-cjs.js +49 -49
- package/dist/FieldDescription-es.js +2 -2
- package/dist/FilterPicker/components/FilterPickerActivator/index.cjs +0 -1
- package/dist/FilterPicker/components/FilterPickerActivator/index.mjs +0 -1
- package/dist/FilterPicker/components/FilterPickerContent/index.cjs +0 -1
- package/dist/FilterPicker/components/FilterPickerContent/index.mjs +0 -1
- package/dist/FilterPicker/components/FilterPickerTrigger/index.cjs +0 -1
- package/dist/FilterPicker/components/FilterPickerTrigger/index.mjs +0 -1
- package/dist/FilterPicker/index.cjs +0 -1
- package/dist/FilterPicker/index.mjs +0 -1
- package/dist/FormatFile/FormatFile.messages.d.ts +18 -0
- package/dist/FormatFile/index.cjs +2 -3
- package/dist/FormatFile/index.mjs +2 -3
- package/dist/FormatFile-cjs.js +24 -2
- package/dist/FormatFile-es.js +24 -2
- package/dist/Gallery/index.cjs +0 -1
- package/dist/Gallery/index.mjs +0 -1
- package/dist/HelperText-cjs.js +3 -2
- package/dist/HelperText-es.js +3 -2
- package/dist/InputDate/index.cjs +0 -2
- package/dist/InputDate/index.mjs +0 -2
- package/dist/InputNumber/InputNumber.d.ts +75 -5
- package/dist/InputNumber/index.cjs +27 -3
- package/dist/InputNumber/index.d.ts +2 -2
- package/dist/InputNumber/index.mjs +27 -3
- package/dist/{primitives/InputNumberExperimental → InputNumber}/types.d.ts +48 -35
- package/dist/InputNumber-cjs.js +267 -4986
- package/dist/InputNumber-es.js +268 -4987
- package/dist/LightBox/index.cjs +0 -1
- package/dist/LightBox/index.mjs +0 -1
- package/dist/Menu/index.cjs +7 -7
- package/dist/Menu/index.mjs +7 -7
- package/dist/Menu-cjs.js +5 -1
- package/dist/Menu-es.js +5 -2
- package/dist/MenuSubmenuTrigger-cjs.js +142 -143
- package/dist/MenuSubmenuTrigger-es.js +5 -6
- package/dist/Modal/index.cjs +0 -1
- package/dist/Modal/index.mjs +0 -1
- package/dist/NumberFieldInput-cjs.js +63 -63
- package/dist/NumberFieldInput-es.js +5 -5
- package/dist/Page/index.cjs +18 -19
- package/dist/Page/index.mjs +18 -19
- package/dist/Page-cjs.js +6 -3
- package/dist/Page-es.js +6 -3
- package/dist/Popover/index.cjs +0 -1
- package/dist/Popover/index.mjs +0 -1
- package/dist/ProgressBar/ProgressBar.messages.d.ts +6 -0
- package/dist/ProgressBar/index.cjs +2 -0
- package/dist/ProgressBar/index.mjs +2 -0
- package/dist/ProgressBar-cjs.js +13 -1
- package/dist/ProgressBar-es.js +13 -1
- package/dist/ScrollAreaViewport-cjs.js +119 -121
- package/dist/ScrollAreaViewport-es.js +3 -5
- package/dist/Select/index.cjs +3 -9
- package/dist/Select/index.mjs +3 -9
- package/dist/SelectGroupLabel-cjs.js +117 -107
- package/dist/SelectGroupLabel-es.js +20 -12
- package/dist/Toast/Toast.messages.d.ts +6 -0
- package/dist/Toast/index.cjs +3 -1
- package/dist/Toast/index.mjs +3 -1
- package/dist/Toast/showToast.d.ts +12 -1
- package/dist/Tooltip/index.cjs +0 -1
- package/dist/Tooltip/index.mjs +0 -1
- package/dist/dialogReturnFocus-cjs.js +4 -1
- package/dist/dialogReturnFocus-es.js +4 -1
- package/dist/docs/DataDump/DataDump.md +1 -1
- package/dist/docs/InputNumber/InputNumber.md +564 -56
- package/dist/docs/Page/Page.md +1 -1
- package/dist/docs/index.md +0 -1
- package/dist/floating-ui.react-cjs.js +34 -35
- package/dist/floating-ui.react-dom-cjs.js +64 -65
- package/dist/floating-ui.react-dom-es.js +1 -2
- package/dist/floating-ui.react-es.js +1 -2
- package/dist/floating-ui.utils-cjs.js +183 -0
- package/dist/floating-ui.utils-es.js +165 -1
- package/dist/index.cjs +10 -15
- package/dist/index.mjs +10 -15
- package/dist/primitives/BottomSheet/index.cjs +2 -5
- package/dist/primitives/BottomSheet/index.mjs +2 -5
- package/dist/primitives/ComboboxPrimitive/index.cjs +3 -7
- package/dist/primitives/ComboboxPrimitive/index.mjs +3 -7
- package/dist/primitives/HelperText/HelperText.d.ts +4 -1
- package/dist/primitives/HelperText/index.cjs +1 -1
- package/dist/primitives/HelperText/index.mjs +1 -1
- package/dist/primitives/SelectPrimitive/index.cjs +3 -9
- package/dist/primitives/SelectPrimitive/index.mjs +3 -9
- package/dist/primitives/index.cjs +2 -16
- package/dist/primitives/index.d.ts +0 -2
- package/dist/primitives/index.mjs +2 -15
- package/dist/scrollEdges-cjs.js +6 -2
- package/dist/scrollEdges-es.js +5 -2
- package/dist/sharedHelpers/i18n/renderWithLocale.d.ts +11 -0
- package/dist/showToast-cjs.js +20 -6
- package/dist/showToast-es.js +20 -6
- package/dist/styles.css +573 -902
- package/dist/unstyledPrimitives/index.cjs +105 -111
- package/dist/unstyledPrimitives/index.mjs +5 -11
- package/dist/useCompositeListItem-cjs.js +516 -90
- package/dist/useCompositeListItem-es.js +407 -6
- package/dist/useLabel-cjs.js +10 -10
- package/dist/useLabel-es.js +3 -3
- package/dist/useRenderElement-es.js +1 -1
- package/dist/useScrollLock-cjs.js +1332 -203
- package/dist/useScrollLock-es.js +1068 -5
- package/dist/utils/meta/meta.json +12 -0
- package/package.json +2 -3
- package/dist/InputNumber/InputNumber.types.d.ts +0 -20
- package/dist/InputNumberExperimental-cjs.js +0 -277
- package/dist/InputNumberExperimental-es.js +0 -275
- package/dist/clamp-cjs.js +0 -7
- package/dist/clamp-es.js +0 -5
- package/dist/clsx-cjs.js +0 -5
- package/dist/clsx-es.js +0 -3
- package/dist/docs/InputNumberExperimental/InputNumberExperimental.md +0 -578
- package/dist/floating-ui.utils.dom-cjs.js +0 -185
- package/dist/floating-ui.utils.dom-es.js +0 -165
- package/dist/isElementDisabled-cjs.js +0 -40
- package/dist/isElementDisabled-es.js +0 -18
- package/dist/primitives/InputNumberExperimental/InputNumberExperimental.d.ts +0 -77
- package/dist/primitives/InputNumberExperimental/index.cjs +0 -30
- package/dist/primitives/InputNumberExperimental/index.d.ts +0 -2
- package/dist/primitives/InputNumberExperimental/index.mjs +0 -24
- package/dist/resolveAriaLabelledBy-cjs.js +0 -200
- package/dist/resolveAriaLabelledBy-es.js +0 -166
- package/dist/useButton-cjs.js +0 -1164
- package/dist/useButton-es.js +0 -1071
- package/dist/useLabelableId-cjs.js +0 -278
- package/dist/useLabelableId-es.js +0 -247
|
@@ -1,12 +1,11 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
import { a as useRefWithInit, f as formatErrorMessage, u as useRenderElement, m as mergeProps,
|
|
3
|
-
import {
|
|
4
|
-
import { W as isMouseLikePointerType, h as useTimeout, B as addEventListener, g as getTarget, d as createChangeEventDetails, X as triggerFocus, p as activeElement, o as ownerDocument, q as contains, Y as mac, Z as triggerPress, _ as escapeKey, L as useOnMount, T as Timeout, b as useStableCallback, a as useIsoLayoutEffect, $ as triggerHover, m as useValueAsRef, t as transitionStatusMapping, V as itemPress, c as useButton, u as useBaseUiId, f as useOpenChangeComplete, Q as outsidePress, a0 as useAnimationsFinished, a1 as siblingOpen, z as useControlled, k as useTransitionStatus, l as useId, v as focusOut, r as listNavigation, i as imperativeAction, a2 as useCompositeRootContext, R as cancelOpen, S as SafeReact } from './useButton-es.js';
|
|
2
|
+
import { a as useRefWithInit, f as formatErrorMessage, u as useRenderElement, m as mergeProps, b as useMergedRefs, E as EMPTY_OBJECT, c as EMPTY_ARRAY, w as warn } from './useRenderElement-es.js';
|
|
3
|
+
import { aw as isMouseLikePointerType, k as useTimeout, ax as mergeCleanups, s as addEventListener, g as getTarget, ay as isTypeableElement, az as matchesFocusVisible, aA as isTargetInsideEnabledTrigger, d as createChangeEventDetails, aB as triggerFocus, aC as createAttribute, D as activeElement, o as ownerDocument, _ as contains, aD as mac, a6 as webkit, aE as triggerPress, aF as escapeKey, H as useOnMount, T as Timeout, ae as useFloatingTree, ab as useFloatingParentNodeId, b as useStableCallback, a as useIsoLayoutEffect, aG as isInteractiveElement, aH as getNodeChildren, aI as triggerHover, q as useValueAsRef, p as popupStateMapping, t as transitionStatusMapping, a9 as itemPress, c as useButton, u as useBaseUiId, f as useOpenChangeComplete, X as outsidePress, i as FloatingFocusManager, a0 as FloatingPortal, aJ as useAnimationsFinished, aK as POPUP_COLLISION_AVOIDANCE, a1 as InternalBackdrop, a2 as inertValue, aL as FloatingNode, a3 as DROPDOWN_COLLISION_AVOIDANCE, aM as siblingOpen, n as useControlled, m as useTransitionStatus, N as createSelector, aN as ReactStore, ad as PopupTriggerMap, aO as FloatingTreeStore, aP as fastComponent, aQ as useInitialOpenSync, aa as useId, aR as useFloatingNodeId, O as useOpenInteractionType, aS as useImplicitActiveTrigger, aT as useOpenStateTransitions, aU as attachPreventUnmountOnClose, aV as setPopupOpenState, W as focusOut, aj as listNavigation, aW as useSyncedFloatingRootContext, j as imperativeAction, R as useDismiss, a4 as useDirection, aX as TYPEAHEAD_RESET_MS, F as FOCUSABLE_POPUP_PROPS, aY as usePopupInteractionProps, aZ as FloatingTree, a_ as useCompositeRootContext, a$ as getTabbableBeforeElement, b0 as isOutsideEvent, b1 as getTabbableAfterElement, b2 as getNextTabbable, b3 as fastComponentRef, b4 as useTriggerDataForwarding, $ as cancelOpen, Q as useClick, Y as pressableTriggerOpenStateMapping, b5 as FocusGuard, b6 as PATIENT_CLICK_THRESHOLD, b7 as useTriggerRegistration, S as SafeReact, b8 as triggerOpenStateMapping } from './useScrollLock-es.js';
|
|
5
4
|
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
6
|
-
import {
|
|
7
|
-
import { u as useToolbarRootContext,
|
|
5
|
+
import { z as useCompositeListItem, y as getDisabledMountTransitionStyles, v as useAnchorPositioning, B as adaptiveOrigin, t as useAnchoredPopupScrollLock, w as usePositioner, C as CompositeList, j as useListNavigation, k as useTypeahead, o as getPseudoElementBounds } from './useCompositeListItem-es.js';
|
|
6
|
+
import { u as useToolbarRootContext, l as isElementDisabled } from './SelectGroupLabel-es.js';
|
|
8
7
|
import { C as COMPOSITE_KEYS } from './scrollEdges-es.js';
|
|
9
|
-
import {
|
|
8
|
+
import { K as getWindow, b as isElement, i as isHTMLElement, d as isLastTraversableNode, e as getParentNode } from './floating-ui.utils-es.js';
|
|
10
9
|
import { p as popupStoreSelectors, n as createInitialPopupStoreState } from './ScrollAreaViewport-es.js';
|
|
11
10
|
import * as ReactDOM from 'react-dom';
|
|
12
11
|
|
package/dist/Modal/index.cjs
CHANGED
|
@@ -21,7 +21,6 @@ require('react-router-dom');
|
|
|
21
21
|
require('../Icon-cjs.js');
|
|
22
22
|
require('@jobber/design');
|
|
23
23
|
require('../_commonjsHelpers-cjs.js');
|
|
24
|
-
require('../floating-ui.utils.dom-cjs.js');
|
|
25
24
|
require('../floating-ui.utils-cjs.js');
|
|
26
25
|
require('react/jsx-runtime');
|
|
27
26
|
require('../floating-ui.react-dom-cjs.js');
|
package/dist/Modal/index.mjs
CHANGED
|
@@ -19,7 +19,6 @@ import 'react-router-dom';
|
|
|
19
19
|
import '../Icon-es.js';
|
|
20
20
|
import '@jobber/design';
|
|
21
21
|
import '../_commonjsHelpers-es.js';
|
|
22
|
-
import '../floating-ui.utils.dom-es.js';
|
|
23
22
|
import '../floating-ui.utils-es.js';
|
|
24
23
|
import 'react/jsx-runtime';
|
|
25
24
|
import '../floating-ui.react-dom-es.js';
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
3
|
var React = require('react');
|
|
4
|
-
var
|
|
4
|
+
var useScrollLock = require('./useScrollLock-cjs.js');
|
|
5
5
|
var useRenderElement = require('./useRenderElement-cjs.js');
|
|
6
|
-
var
|
|
6
|
+
var useCompositeListItem = require('./useCompositeListItem-cjs.js');
|
|
7
7
|
var jsxRuntime = require('react/jsx-runtime');
|
|
8
|
-
var
|
|
8
|
+
var floatingUi_utils = require('./floating-ui.utils-cjs.js');
|
|
9
9
|
var stringifyLocale = require('./stringifyLocale-cjs.js');
|
|
10
|
-
var
|
|
10
|
+
var scrollEdges = require('./scrollEdges-cjs.js');
|
|
11
11
|
|
|
12
12
|
function _interopNamespaceDefault(e) {
|
|
13
13
|
var n = Object.create(null);
|
|
@@ -72,7 +72,7 @@ function useNumberFieldRootContext() {
|
|
|
72
72
|
const stateAttributesMapping = {
|
|
73
73
|
inputValue: () => null,
|
|
74
74
|
value: () => null,
|
|
75
|
-
...
|
|
75
|
+
...useCompositeListItem.fieldValidityMapping
|
|
76
76
|
};
|
|
77
77
|
|
|
78
78
|
const HAN_NUMERALS = ['零', '〇', '一', '二', '三', '四', '五', '六', '七', '八', '九'];
|
|
@@ -398,7 +398,7 @@ function toValidatedNumber(value, {
|
|
|
398
398
|
// `min: 0.6`) is pulled in range first, then clamp again after rounding in case rounding
|
|
399
399
|
// nudges it back out. Both passes are needed for non-integer bounds.
|
|
400
400
|
if (shouldClamp) {
|
|
401
|
-
nextValue =
|
|
401
|
+
nextValue = scrollEdges.clamp(nextValue, minWithDefault, maxWithDefault);
|
|
402
402
|
}
|
|
403
403
|
|
|
404
404
|
// Non-stepping values — parsed input (typing, paste, blur) and externally-supplied controlled
|
|
@@ -410,7 +410,7 @@ function toValidatedNumber(value, {
|
|
|
410
410
|
return nextValue;
|
|
411
411
|
}
|
|
412
412
|
const roundedValue = removeFloatingPointErrors(nextValue, format);
|
|
413
|
-
return shouldClamp ?
|
|
413
|
+
return shouldClamp ? scrollEdges.clamp(roundedValue, minWithDefault, maxWithDefault) : roundedValue;
|
|
414
414
|
}
|
|
415
415
|
|
|
416
416
|
const NumberFieldRoot = /*#__PURE__*/React__namespace.forwardRef(function NumberFieldRoot(componentProps, forwardedRef) {
|
|
@@ -450,10 +450,10 @@ const NumberFieldRoot = /*#__PURE__*/React__namespace.forwardRef(function Number
|
|
|
450
450
|
name: fieldName,
|
|
451
451
|
state: fieldState,
|
|
452
452
|
validation
|
|
453
|
-
} =
|
|
453
|
+
} = useCompositeListItem.useFieldRootContext();
|
|
454
454
|
const {
|
|
455
455
|
clearErrors
|
|
456
|
-
} =
|
|
456
|
+
} = useCompositeListItem.useFormContext();
|
|
457
457
|
const disabled = fieldDisabled || disabledProp;
|
|
458
458
|
const name = fieldName ?? nameProp;
|
|
459
459
|
const step = stepProp === 'any' ? 1 : stepProp;
|
|
@@ -464,24 +464,24 @@ const NumberFieldRoot = /*#__PURE__*/React__namespace.forwardRef(function Number
|
|
|
464
464
|
const formatStyle = format?.style;
|
|
465
465
|
const inputRef = React__namespace.useRef(null);
|
|
466
466
|
const hiddenInputRef = useRenderElement.useMergedRefs(inputRefProp, validation.inputRef);
|
|
467
|
-
const id =
|
|
467
|
+
const id = useCompositeListItem.useLabelableId({
|
|
468
468
|
id: idProp
|
|
469
469
|
});
|
|
470
|
-
const [valueUnwrapped, setValueUnwrapped] =
|
|
470
|
+
const [valueUnwrapped, setValueUnwrapped] = useScrollLock.useControlled({
|
|
471
471
|
controlled: valueProp,
|
|
472
472
|
default: defaultValue,
|
|
473
473
|
name: 'NumberField',
|
|
474
474
|
state: 'value'
|
|
475
475
|
});
|
|
476
476
|
const value = valueUnwrapped ?? null;
|
|
477
|
-
const valueRef =
|
|
478
|
-
|
|
477
|
+
const valueRef = useScrollLock.useValueAsRef(value);
|
|
478
|
+
useScrollLock.useIsoLayoutEffect(() => {
|
|
479
479
|
setFilled(value !== null);
|
|
480
480
|
}, [setFilled, value]);
|
|
481
481
|
const forceRender = useForcedRerendering();
|
|
482
|
-
const formatOptionsRef =
|
|
482
|
+
const formatOptionsRef = useScrollLock.useValueAsRef(format);
|
|
483
483
|
const hasPendingCommitRef = React__namespace.useRef(false);
|
|
484
|
-
const onValueCommitted =
|
|
484
|
+
const onValueCommitted = useScrollLock.useStableCallback((nextValue, eventDetails) => {
|
|
485
485
|
hasPendingCommitRef.current = false;
|
|
486
486
|
onValueCommittedProp?.(nextValue, eventDetails);
|
|
487
487
|
});
|
|
@@ -494,7 +494,7 @@ const NumberFieldRoot = /*#__PURE__*/React__namespace.forwardRef(function Number
|
|
|
494
494
|
// can still see the value prior to hydration, even if it's not formatted correctly.
|
|
495
495
|
const [inputValue, setInputValue] = React__namespace.useState(() => formatNumber(value, locale, format));
|
|
496
496
|
const [inputMode, setInputMode] = React__namespace.useState('numeric');
|
|
497
|
-
const getAllowedNonNumericKeys =
|
|
497
|
+
const getAllowedNonNumericKeys = useScrollLock.useStableCallback(() => {
|
|
498
498
|
const {
|
|
499
499
|
decimal,
|
|
500
500
|
group,
|
|
@@ -540,7 +540,7 @@ const NumberFieldRoot = /*#__PURE__*/React__namespace.forwardRef(function Number
|
|
|
540
540
|
}
|
|
541
541
|
return keys;
|
|
542
542
|
});
|
|
543
|
-
const getStepAmount =
|
|
543
|
+
const getStepAmount = useScrollLock.useStableCallback(event => {
|
|
544
544
|
if (event?.altKey) {
|
|
545
545
|
return smallStep;
|
|
546
546
|
}
|
|
@@ -549,13 +549,13 @@ const NumberFieldRoot = /*#__PURE__*/React__namespace.forwardRef(function Number
|
|
|
549
549
|
}
|
|
550
550
|
return step;
|
|
551
551
|
});
|
|
552
|
-
const setValue =
|
|
552
|
+
const setValue = useScrollLock.useStableCallback((unvalidatedValue, details) => {
|
|
553
553
|
const eventWithOptionalKeyState = details.event;
|
|
554
554
|
const dir = details.direction;
|
|
555
555
|
|
|
556
556
|
// Direct text entry (typing, pasting, clearing, autofill) behaves natively; step-based
|
|
557
557
|
// interactions (keyboard arrows, buttons, wheel, scrub) do not.
|
|
558
|
-
const isInputReason = details.reason ===
|
|
558
|
+
const isInputReason = details.reason === useScrollLock.inputChange || details.reason === useScrollLock.inputClear || details.reason === useScrollLock.inputBlur || details.reason === useScrollLock.inputPaste || details.reason === useScrollLock.none;
|
|
559
559
|
|
|
560
560
|
// Only allow out-of-range values for direct text entry. Step-based interactions still clamp.
|
|
561
561
|
const shouldClampValue = !allowOutOfRange || !isInputReason;
|
|
@@ -598,7 +598,7 @@ const NumberFieldRoot = /*#__PURE__*/React__namespace.forwardRef(function Number
|
|
|
598
598
|
forceRender();
|
|
599
599
|
return shouldFireChange;
|
|
600
600
|
});
|
|
601
|
-
const incrementValue =
|
|
601
|
+
const incrementValue = useScrollLock.useStableCallback((amount, {
|
|
602
602
|
direction,
|
|
603
603
|
currentValue,
|
|
604
604
|
event,
|
|
@@ -610,9 +610,9 @@ const NumberFieldRoot = /*#__PURE__*/React__namespace.forwardRef(function Number
|
|
|
610
610
|
// Seed an empty field with 0; `setValue` clamps it to the in-range value nearest 0
|
|
611
611
|
// (e.g. `max` for a negative range). No `direction`: the seed isn't a step, so it must
|
|
612
612
|
// not be directionally snapped.
|
|
613
|
-
return setValue(0,
|
|
613
|
+
return setValue(0, useScrollLock.createChangeEventDetails(reason, nativeEvent));
|
|
614
614
|
}
|
|
615
|
-
return setValue(prevValue + amount * direction,
|
|
615
|
+
return setValue(prevValue + amount * direction, useScrollLock.createChangeEventDetails(reason, nativeEvent, undefined, {
|
|
616
616
|
direction
|
|
617
617
|
}));
|
|
618
618
|
});
|
|
@@ -627,7 +627,7 @@ const NumberFieldRoot = /*#__PURE__*/React__namespace.forwardRef(function Number
|
|
|
627
627
|
// ESLint is disabled because it needs to run even if the parsed value hasn't changed, since the
|
|
628
628
|
// value still can be formatted differently.
|
|
629
629
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
630
|
-
|
|
630
|
+
useScrollLock.useIsoLayoutEffect(function syncFormattedInputValueOnValueChange() {
|
|
631
631
|
// This ensures the value is only updated on blur rather than every keystroke, but still
|
|
632
632
|
// allows the input value to be updated when the value is changed externally.
|
|
633
633
|
if (!allowInputSyncRef.current) {
|
|
@@ -638,8 +638,8 @@ const NumberFieldRoot = /*#__PURE__*/React__namespace.forwardRef(function Number
|
|
|
638
638
|
setInputValue(nextInputValue);
|
|
639
639
|
}
|
|
640
640
|
});
|
|
641
|
-
|
|
642
|
-
if (!
|
|
641
|
+
useScrollLock.useIsoLayoutEffect(function setDynamicInputModeForIOS() {
|
|
642
|
+
if (!useScrollLock.ios) {
|
|
643
643
|
return;
|
|
644
644
|
}
|
|
645
645
|
|
|
@@ -664,7 +664,7 @@ const NumberFieldRoot = /*#__PURE__*/React__namespace.forwardRef(function Number
|
|
|
664
664
|
function handleWheel(event) {
|
|
665
665
|
if (
|
|
666
666
|
// Allow pinch-zooming.
|
|
667
|
-
event.ctrlKey ||
|
|
667
|
+
event.ctrlKey || useScrollLock.activeElement(useScrollLock.ownerDocument(inputRef.current)) !== inputRef.current) {
|
|
668
668
|
return;
|
|
669
669
|
}
|
|
670
670
|
|
|
@@ -681,10 +681,10 @@ const NumberFieldRoot = /*#__PURE__*/React__namespace.forwardRef(function Number
|
|
|
681
681
|
reason: 'wheel'
|
|
682
682
|
});
|
|
683
683
|
if (changed) {
|
|
684
|
-
onValueCommitted(lastChangedValueRef.current ?? valueRef.current,
|
|
684
|
+
onValueCommitted(lastChangedValueRef.current ?? valueRef.current, useScrollLock.createGenericEventDetails(useScrollLock.wheel, event));
|
|
685
685
|
}
|
|
686
686
|
}
|
|
687
|
-
return
|
|
687
|
+
return useScrollLock.addEventListener(element, 'wheel', handleWheel);
|
|
688
688
|
}, [allowWheelScrub, incrementValue, disabled, readOnly, getStepAmount, onValueCommitted, lastChangedValueRef, valueRef]);
|
|
689
689
|
const state = React__namespace.useMemo(() => ({
|
|
690
690
|
...fieldState,
|
|
@@ -749,7 +749,7 @@ const NumberFieldRoot = /*#__PURE__*/React__namespace.forwardRef(function Number
|
|
|
749
749
|
// Handle browser autofill.
|
|
750
750
|
const nextValue = event.currentTarget.valueAsNumber;
|
|
751
751
|
const parsedValue = Number.isNaN(nextValue) ? null : nextValue;
|
|
752
|
-
const details =
|
|
752
|
+
const details = useScrollLock.createChangeEventDetails(useScrollLock.none, event.nativeEvent);
|
|
753
753
|
|
|
754
754
|
// `setValue` updates the dirty flag from the stored (clamped) value, so validate with
|
|
755
755
|
// that same value rather than the raw autofilled one.
|
|
@@ -774,7 +774,7 @@ const NumberFieldRoot = /*#__PURE__*/React__namespace.forwardRef(function Number
|
|
|
774
774
|
required: required,
|
|
775
775
|
"aria-hidden": true,
|
|
776
776
|
tabIndex: -1,
|
|
777
|
-
style: name ?
|
|
777
|
+
style: name ? useScrollLock.visuallyHiddenInput : useScrollLock.visuallyHidden,
|
|
778
778
|
suppressHydrationWarning: true
|
|
779
779
|
})]
|
|
780
780
|
});
|
|
@@ -811,7 +811,7 @@ const NumberFieldGroup = /*#__PURE__*/React__namespace.forwardRef(function Numbe
|
|
|
811
811
|
if (process.env.NODE_ENV !== "production") NumberFieldGroup.displayName = "NumberFieldGroup";
|
|
812
812
|
|
|
813
813
|
const EMPTY = 0;
|
|
814
|
-
class Interval extends
|
|
814
|
+
class Interval extends useScrollLock.Timeout {
|
|
815
815
|
static create() {
|
|
816
816
|
return new Interval();
|
|
817
817
|
}
|
|
@@ -838,7 +838,7 @@ class Interval extends useButton.Timeout {
|
|
|
838
838
|
*/
|
|
839
839
|
function useInterval() {
|
|
840
840
|
const timeout = useRenderElement.useRefWithInit(Interval.create).current;
|
|
841
|
-
|
|
841
|
+
useScrollLock.useOnMount(timeout.disposeEffect);
|
|
842
842
|
return timeout;
|
|
843
843
|
}
|
|
844
844
|
|
|
@@ -871,9 +871,9 @@ function usePressAndHold(params) {
|
|
|
871
871
|
scrollDistance = DEFAULT_SCROLL_DISTANCE,
|
|
872
872
|
elementRef
|
|
873
873
|
} = params;
|
|
874
|
-
const startTickTimeout =
|
|
874
|
+
const startTickTimeout = useScrollLock.useTimeout();
|
|
875
875
|
const tickInterval = useInterval();
|
|
876
|
-
const intentionalTouchCheckTimeout =
|
|
876
|
+
const intentionalTouchCheckTimeout = useScrollLock.useTimeout();
|
|
877
877
|
const isPressedRef = React__namespace.useRef(false);
|
|
878
878
|
const movesAfterTouchRef = React__namespace.useRef(0);
|
|
879
879
|
const downCoordsRef = React__namespace.useRef({
|
|
@@ -885,7 +885,7 @@ function usePressAndHold(params) {
|
|
|
885
885
|
const pointerTypeRef = React__namespace.useRef('');
|
|
886
886
|
const unsubscribeFromGlobalContextMenuRef = React__namespace.useRef(useRenderElement.NOOP);
|
|
887
887
|
const unsubscribeFromGlobalPointerUpRef = React__namespace.useRef(useRenderElement.NOOP);
|
|
888
|
-
const stopAutoChange =
|
|
888
|
+
const stopAutoChange = useScrollLock.useStableCallback(() => {
|
|
889
889
|
intentionalTouchCheckTimeout.clear();
|
|
890
890
|
startTickTimeout.clear();
|
|
891
891
|
tickInterval.clear();
|
|
@@ -898,21 +898,21 @@ function usePressAndHold(params) {
|
|
|
898
898
|
if (!element) {
|
|
899
899
|
return;
|
|
900
900
|
}
|
|
901
|
-
const win =
|
|
901
|
+
const win = floatingUi_utils.getWindow(element);
|
|
902
902
|
function handleContextMenu(event) {
|
|
903
903
|
event.preventDefault();
|
|
904
904
|
}
|
|
905
905
|
|
|
906
906
|
// A global context menu listener is necessary to prevent the context menu from
|
|
907
907
|
// appearing when the touch is slightly outside of the element's hit area.
|
|
908
|
-
unsubscribeFromGlobalContextMenuRef.current =
|
|
908
|
+
unsubscribeFromGlobalContextMenuRef.current = useScrollLock.addEventListener(win, 'contextmenu', handleContextMenu);
|
|
909
909
|
|
|
910
910
|
// The release listener stays registered through `stopAutoChange` so a hold that auto-stops at
|
|
911
911
|
// a boundary (a repeat tick returning `false`) still fires `onStop` on release. Replace any
|
|
912
912
|
// existing one first so a mouseleave/mouseenter cycle during a hold doesn't stack listeners
|
|
913
913
|
// (which would otherwise fire `onStop` more than once on release).
|
|
914
914
|
unsubscribeFromGlobalPointerUpRef.current();
|
|
915
|
-
unsubscribeFromGlobalPointerUpRef.current =
|
|
915
|
+
unsubscribeFromGlobalPointerUpRef.current = useScrollLock.addEventListener(win, 'pointerup', event => {
|
|
916
916
|
isPressedRef.current = false;
|
|
917
917
|
stopAutoChange();
|
|
918
918
|
onStop?.(event);
|
|
@@ -1022,7 +1022,7 @@ function usePressAndHold(params) {
|
|
|
1022
1022
|
stopAutoChange();
|
|
1023
1023
|
}
|
|
1024
1024
|
};
|
|
1025
|
-
const shouldSkipClick =
|
|
1025
|
+
const shouldSkipClick = useScrollLock.useStableCallback(event => {
|
|
1026
1026
|
if (event.defaultPrevented) {
|
|
1027
1027
|
return true;
|
|
1028
1028
|
}
|
|
@@ -1063,7 +1063,7 @@ function useNumberFieldButton(params) {
|
|
|
1063
1063
|
lastChangedValueRef,
|
|
1064
1064
|
onValueCommitted
|
|
1065
1065
|
} = params;
|
|
1066
|
-
const pressReason = isIncrement ?
|
|
1066
|
+
const pressReason = isIncrement ? useScrollLock.incrementPress : useScrollLock.decrementPress;
|
|
1067
1067
|
function commitValue(nativeEvent) {
|
|
1068
1068
|
const shouldCommitInputValue = !allowInputSyncRef.current;
|
|
1069
1069
|
allowInputSyncRef.current = true;
|
|
@@ -1082,7 +1082,7 @@ function useNumberFieldButton(params) {
|
|
|
1082
1082
|
// Sync the dirty typed value with no direction so it isn't directionally snapped
|
|
1083
1083
|
// (`snapOnStep`) before the real increment/decrement runs, which would otherwise emit a
|
|
1084
1084
|
// spurious intermediate value.
|
|
1085
|
-
const details =
|
|
1085
|
+
const details = useScrollLock.createChangeEventDetails(pressReason, nativeEvent);
|
|
1086
1086
|
setValue(parsedValue, details);
|
|
1087
1087
|
|
|
1088
1088
|
// Only sync the ref base when the commit wasn't canceled, so a subsequent increment in the
|
|
@@ -1113,7 +1113,7 @@ function useNumberFieldButton(params) {
|
|
|
1113
1113
|
// `onStop` fires on every release; fall back to the current value when no tick changed it.
|
|
1114
1114
|
// Step interactions never commit `null`, so the `??` can't mask a legitimate null commit.
|
|
1115
1115
|
const committed = lastChangedValueRef.current ?? valueRef.current;
|
|
1116
|
-
onValueCommitted(committed,
|
|
1116
|
+
onValueCommitted(committed, useScrollLock.createGenericEventDetails(pressReason, nativeEvent));
|
|
1117
1117
|
}
|
|
1118
1118
|
});
|
|
1119
1119
|
const props = {
|
|
@@ -1141,7 +1141,7 @@ function useNumberFieldButton(params) {
|
|
|
1141
1141
|
});
|
|
1142
1142
|
const committed = lastChangedValueRef.current ?? valueRef.current;
|
|
1143
1143
|
if (committed !== prev) {
|
|
1144
|
-
onValueCommitted(committed,
|
|
1144
|
+
onValueCommitted(committed, useScrollLock.createGenericEventDetails(pressReason, event.nativeEvent));
|
|
1145
1145
|
}
|
|
1146
1146
|
},
|
|
1147
1147
|
onPointerDown(event) {
|
|
@@ -1220,7 +1220,7 @@ function useNumberFieldStepperButton(componentProps, forwardedRef, isIncrement)
|
|
|
1220
1220
|
const {
|
|
1221
1221
|
getButtonProps,
|
|
1222
1222
|
buttonRef
|
|
1223
|
-
} =
|
|
1223
|
+
} = useScrollLock.useButton({
|
|
1224
1224
|
// Read-only steppers are exposed as unavailable through button disabled semantics, while
|
|
1225
1225
|
// `data-readonly` (from `state`) is preserved for styling. `aria-readonly` isn't valid on the
|
|
1226
1226
|
// `button` role, so it's intentionally not set.
|
|
@@ -1306,7 +1306,7 @@ const NumberFieldInput = /*#__PURE__*/React__namespace.forwardRef(function Numbe
|
|
|
1306
1306
|
} = useNumberFieldRootContext();
|
|
1307
1307
|
const {
|
|
1308
1308
|
clearErrors
|
|
1309
|
-
} =
|
|
1309
|
+
} = useCompositeListItem.useFormContext();
|
|
1310
1310
|
const {
|
|
1311
1311
|
validationMode,
|
|
1312
1312
|
setTouched,
|
|
@@ -1314,25 +1314,25 @@ const NumberFieldInput = /*#__PURE__*/React__namespace.forwardRef(function Numbe
|
|
|
1314
1314
|
invalid,
|
|
1315
1315
|
shouldValidateOnChange,
|
|
1316
1316
|
validation
|
|
1317
|
-
} =
|
|
1317
|
+
} = useCompositeListItem.useFieldRootContext();
|
|
1318
1318
|
const {
|
|
1319
1319
|
labelId
|
|
1320
|
-
} =
|
|
1320
|
+
} = useCompositeListItem.useLabelableContext();
|
|
1321
1321
|
const hasTouchedInputRef = React__namespace.useRef(false);
|
|
1322
1322
|
const blockRevalidationRef = React__namespace.useRef(false);
|
|
1323
1323
|
const pendingCaretRef = React__namespace.useRef(null);
|
|
1324
|
-
|
|
1324
|
+
useCompositeListItem.useRegisterFieldControl(inputRef, id, value, undefined, !disabled, nameProp);
|
|
1325
1325
|
|
|
1326
1326
|
// After a paste splices text into the controlled value, the browser would otherwise drop the
|
|
1327
1327
|
// caret at the end of the new value. Restore it just after the inserted text.
|
|
1328
|
-
|
|
1328
|
+
useScrollLock.useIsoLayoutEffect(() => {
|
|
1329
1329
|
if (pendingCaretRef.current != null) {
|
|
1330
1330
|
const caret = pendingCaretRef.current;
|
|
1331
1331
|
pendingCaretRef.current = null;
|
|
1332
1332
|
inputRef.current?.setSelectionRange(caret, caret);
|
|
1333
1333
|
}
|
|
1334
1334
|
});
|
|
1335
|
-
|
|
1335
|
+
useScrollLock.useValueChanged(value, () => {
|
|
1336
1336
|
clearErrors(name);
|
|
1337
1337
|
if (blockRevalidationRef.current && !shouldValidateOnChange()) {
|
|
1338
1338
|
blockRevalidationRef.current = false;
|
|
@@ -1387,7 +1387,7 @@ const NumberFieldInput = /*#__PURE__*/React__namespace.forwardRef(function Numbe
|
|
|
1387
1387
|
const hadPendingProgrammaticChange = hasPendingCommitRef.current;
|
|
1388
1388
|
allowInputSyncRef.current = true;
|
|
1389
1389
|
if (inputValue.trim() === '') {
|
|
1390
|
-
const clearDetails =
|
|
1390
|
+
const clearDetails = useScrollLock.createChangeEventDetails(useScrollLock.inputClear, event.nativeEvent);
|
|
1391
1391
|
setValue(null, clearDetails);
|
|
1392
1392
|
// Respect a canceled clear, mirroring the non-empty blur path below.
|
|
1393
1393
|
if (clearDetails.isCanceled) {
|
|
@@ -1399,7 +1399,7 @@ const NumberFieldInput = /*#__PURE__*/React__namespace.forwardRef(function Numbe
|
|
|
1399
1399
|
// Don't report a commit when blurring an already-empty field that the user never
|
|
1400
1400
|
// interacted with: nothing was cleared and no programmatic change is pending.
|
|
1401
1401
|
if (hadManualInput || hadPendingProgrammaticChange || value !== null) {
|
|
1402
|
-
onValueCommitted(null,
|
|
1402
|
+
onValueCommitted(null, useScrollLock.createGenericEventDetails(useScrollLock.inputClear, event.nativeEvent));
|
|
1403
1403
|
}
|
|
1404
1404
|
return;
|
|
1405
1405
|
}
|
|
@@ -1424,14 +1424,14 @@ const NumberFieldInput = /*#__PURE__*/React__namespace.forwardRef(function Numbe
|
|
|
1424
1424
|
} else {
|
|
1425
1425
|
committed = parsedValue;
|
|
1426
1426
|
}
|
|
1427
|
-
const nextEventDetails =
|
|
1427
|
+
const nextEventDetails = useScrollLock.createGenericEventDetails(useScrollLock.inputBlur, event.nativeEvent);
|
|
1428
1428
|
const shouldUpdateValue = value !== committed;
|
|
1429
1429
|
const shouldCommit = hadManualInput || shouldUpdateValue || hadPendingProgrammaticChange;
|
|
1430
1430
|
|
|
1431
1431
|
// Use the stored value after `setValue` clamps it.
|
|
1432
1432
|
let committedValue = committed;
|
|
1433
1433
|
if (shouldUpdateValue) {
|
|
1434
|
-
const changeDetails =
|
|
1434
|
+
const changeDetails = useScrollLock.createChangeEventDetails(useScrollLock.inputBlur, event.nativeEvent);
|
|
1435
1435
|
blockRevalidationRef.current = true;
|
|
1436
1436
|
setValue(committed, changeDetails);
|
|
1437
1437
|
if (changeDetails.isCanceled) {
|
|
@@ -1467,7 +1467,7 @@ const NumberFieldInput = /*#__PURE__*/React__namespace.forwardRef(function Numbe
|
|
|
1467
1467
|
const targetValue = event.currentTarget.value;
|
|
1468
1468
|
if (targetValue.trim() === '') {
|
|
1469
1469
|
setInputValue(targetValue);
|
|
1470
|
-
setValue(null,
|
|
1470
|
+
setValue(null, useScrollLock.createChangeEventDetails(useScrollLock.inputClear, event.nativeEvent));
|
|
1471
1471
|
return;
|
|
1472
1472
|
}
|
|
1473
1473
|
|
|
@@ -1482,7 +1482,7 @@ const NumberFieldInput = /*#__PURE__*/React__namespace.forwardRef(function Numbe
|
|
|
1482
1482
|
const parsedValue = parseNumber(targetValue, locale, formatOptionsRef.current);
|
|
1483
1483
|
setInputValue(targetValue);
|
|
1484
1484
|
if (parsedValue !== null) {
|
|
1485
|
-
setValue(parsedValue,
|
|
1485
|
+
setValue(parsedValue, useScrollLock.createChangeEventDetails(useScrollLock.inputChange, event.nativeEvent));
|
|
1486
1486
|
}
|
|
1487
1487
|
},
|
|
1488
1488
|
onKeyDown(event) {
|
|
@@ -1555,8 +1555,8 @@ const NumberFieldInput = /*#__PURE__*/React__namespace.forwardRef(function Numbe
|
|
|
1555
1555
|
const amount = getStepAmount(event);
|
|
1556
1556
|
|
|
1557
1557
|
// Prevent insertion of text or caret from moving.
|
|
1558
|
-
|
|
1559
|
-
const commitDetails =
|
|
1558
|
+
useScrollLock.stopEvent(event);
|
|
1559
|
+
const commitDetails = useScrollLock.createGenericEventDetails(useScrollLock.keyboard, nativeEvent);
|
|
1560
1560
|
let changed = false;
|
|
1561
1561
|
if (event.key === 'ArrowUp' || event.key === 'ArrowDown') {
|
|
1562
1562
|
allowInputSyncRef.current = true;
|
|
@@ -1571,14 +1571,14 @@ const NumberFieldInput = /*#__PURE__*/React__namespace.forwardRef(function Numbe
|
|
|
1571
1571
|
direction: event.key === 'ArrowUp' ? 1 : -1,
|
|
1572
1572
|
currentValue,
|
|
1573
1573
|
event: nativeEvent,
|
|
1574
|
-
reason:
|
|
1574
|
+
reason: useScrollLock.keyboard
|
|
1575
1575
|
});
|
|
1576
1576
|
} else if (willSetHome) {
|
|
1577
1577
|
allowInputSyncRef.current = true;
|
|
1578
|
-
changed = setValue(min,
|
|
1578
|
+
changed = setValue(min, useScrollLock.createChangeEventDetails(useScrollLock.keyboard, nativeEvent));
|
|
1579
1579
|
} else if (willSetEnd) {
|
|
1580
1580
|
allowInputSyncRef.current = true;
|
|
1581
|
-
changed = setValue(max,
|
|
1581
|
+
changed = setValue(max, useScrollLock.createChangeEventDetails(useScrollLock.keyboard, nativeEvent));
|
|
1582
1582
|
}
|
|
1583
1583
|
if (changed) {
|
|
1584
1584
|
onValueCommitted(lastChangedValueRef.current ?? valueRef.current, commitDetails);
|
|
@@ -1593,7 +1593,7 @@ const NumberFieldInput = /*#__PURE__*/React__namespace.forwardRef(function Numbe
|
|
|
1593
1593
|
pastedData = event.clipboardData?.getData('text/plain') ?? '';
|
|
1594
1594
|
} catch {
|
|
1595
1595
|
if (process.env.NODE_ENV !== 'production') {
|
|
1596
|
-
const ownerStackMessage =
|
|
1596
|
+
const ownerStackMessage = useScrollLock.SafeReact.captureOwnerStack?.() || '';
|
|
1597
1597
|
useRenderElement.warn('<NumberField.Input> could not read clipboard text during paste handling.', ownerStackMessage);
|
|
1598
1598
|
}
|
|
1599
1599
|
return;
|
|
@@ -1612,7 +1612,7 @@ const NumberFieldInput = /*#__PURE__*/React__namespace.forwardRef(function Numbe
|
|
|
1612
1612
|
if (parsedValue !== null) {
|
|
1613
1613
|
allowInputSyncRef.current = false;
|
|
1614
1614
|
pendingCaretRef.current = selectionStart + pastedData.length;
|
|
1615
|
-
setValue(parsedValue,
|
|
1615
|
+
setValue(parsedValue, useScrollLock.createChangeEventDetails(useScrollLock.inputPaste, event.nativeEvent));
|
|
1616
1616
|
setInputValue(nextText);
|
|
1617
1617
|
}
|
|
1618
1618
|
}
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
import {
|
|
3
|
-
import { f as formatErrorMessage,
|
|
4
|
-
import { f as fieldValidityMapping, b as useFieldRootContext, a as useFormContext, c as useLabelableId, u as useLabelableContext, d as useRegisterFieldControl } from './
|
|
2
|
+
import { n as useControlled, q as useValueAsRef, a as useIsoLayoutEffect, b as useStableCallback, r as ios, s as addEventListener, d as createChangeEventDetails, v as none, w as visuallyHiddenInput, x as visuallyHidden, y as inputChange, z as inputClear, A as inputBlur, B as inputPaste, D as activeElement, o as ownerDocument, E as createGenericEventDetails, G as wheel, H as useOnMount, T as Timeout, k as useTimeout, I as incrementPress, J as decrementPress, c as useButton, K as useValueChanged, L as stopEvent, M as keyboard, S as SafeReact } from './useScrollLock-es.js';
|
|
3
|
+
import { f as formatErrorMessage, b as useMergedRefs, u as useRenderElement, a as useRefWithInit, N as NOOP, w as warn } from './useRenderElement-es.js';
|
|
4
|
+
import { f as fieldValidityMapping, b as useFieldRootContext, a as useFormContext, c as useLabelableId, u as useLabelableContext, d as useRegisterFieldControl } from './useCompositeListItem-es.js';
|
|
5
5
|
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
6
|
-
import {
|
|
6
|
+
import { K as getWindow } from './floating-ui.utils-es.js';
|
|
7
7
|
import { s as stringifyLocale } from './stringifyLocale-es.js';
|
|
8
|
-
import { c as clamp } from './
|
|
8
|
+
import { c as clamp } from './scrollEdges-es.js';
|
|
9
9
|
|
|
10
10
|
/**
|
|
11
11
|
* Returns a function that forces a rerender.
|
package/dist/Page/index.cjs
CHANGED
|
@@ -5,43 +5,42 @@ require('../tslib.es6-cjs.js');
|
|
|
5
5
|
require('react');
|
|
6
6
|
require('classnames');
|
|
7
7
|
require('@jobber/hooks');
|
|
8
|
-
require('../Heading-cjs.js');
|
|
9
|
-
require('../Typography-cjs.js');
|
|
10
|
-
require('../Text-cjs.js');
|
|
11
|
-
require('../Content-cjs.js');
|
|
12
|
-
require('../Markdown-cjs.js');
|
|
13
|
-
require('../Emphasis-cjs.js');
|
|
14
|
-
require('react/jsx-runtime');
|
|
15
|
-
require('../_commonjsHelpers-cjs.js');
|
|
16
|
-
require('../Button-cjs.js');
|
|
17
|
-
require('react-router-dom');
|
|
18
|
-
require('../Icon-cjs.js');
|
|
19
|
-
require('@jobber/design');
|
|
20
8
|
require('../Menu-cjs.js');
|
|
21
9
|
require('framer-motion');
|
|
22
10
|
require('../floating-ui.react-cjs.js');
|
|
23
|
-
require('../floating-ui.utils.dom-cjs.js');
|
|
24
11
|
require('../floating-ui.utils-cjs.js');
|
|
12
|
+
require('react/jsx-runtime');
|
|
25
13
|
require('react-dom');
|
|
26
14
|
require('../floating-ui.react-dom-cjs.js');
|
|
27
15
|
require('../useAtlantisI18n-cjs.js');
|
|
28
16
|
require('../AtlantisContext-cjs.js');
|
|
17
|
+
require('../Button-cjs.js');
|
|
18
|
+
require('react-router-dom');
|
|
19
|
+
require('../Icon-cjs.js');
|
|
20
|
+
require('@jobber/design');
|
|
21
|
+
require('../Typography-cjs.js');
|
|
29
22
|
require('../useFormFieldFocus-cjs.js');
|
|
30
23
|
require('../maxHeight-cjs.js');
|
|
31
24
|
require('../useRenderElement-cjs.js');
|
|
32
25
|
require('../buttonRenderAdapter-cjs.js');
|
|
26
|
+
require('../OverlaySeparator-cjs.js');
|
|
27
|
+
require('../Separator-cjs.js');
|
|
33
28
|
require('../BottomSheet-cjs.js');
|
|
34
29
|
require('../ScrollAreaViewport-cjs.js');
|
|
35
30
|
require('../useScrollLock-cjs.js');
|
|
36
|
-
require('../useButton-cjs.js');
|
|
37
31
|
require('../scrollEdges-cjs.js');
|
|
38
|
-
require('../
|
|
39
|
-
require('../
|
|
40
|
-
require('../
|
|
32
|
+
require('../HelperText-cjs.js');
|
|
33
|
+
require('../Text-cjs.js');
|
|
34
|
+
require('../SelectPrimitive-cjs.js');
|
|
35
|
+
require('../SelectGroupLabel-cjs.js');
|
|
36
|
+
require('../useCompositeListItem-cjs.js');
|
|
41
37
|
require('../DrawerTitle-cjs.js');
|
|
42
38
|
require('../MenuSubmenuTrigger-cjs.js');
|
|
43
|
-
require('../
|
|
44
|
-
require('../
|
|
39
|
+
require('../Heading-cjs.js');
|
|
40
|
+
require('../Content-cjs.js');
|
|
41
|
+
require('../Markdown-cjs.js');
|
|
42
|
+
require('../Emphasis-cjs.js');
|
|
43
|
+
require('../_commonjsHelpers-cjs.js');
|
|
45
44
|
require('../filterDataAttributes-cjs.js');
|
|
46
45
|
|
|
47
46
|
|
package/dist/Page/index.mjs
CHANGED
|
@@ -3,41 +3,40 @@ import '../tslib.es6-es.js';
|
|
|
3
3
|
import 'react';
|
|
4
4
|
import 'classnames';
|
|
5
5
|
import '@jobber/hooks';
|
|
6
|
-
import '../Heading-es.js';
|
|
7
|
-
import '../Typography-es.js';
|
|
8
|
-
import '../Text-es.js';
|
|
9
|
-
import '../Content-es.js';
|
|
10
|
-
import '../Markdown-es.js';
|
|
11
|
-
import '../Emphasis-es.js';
|
|
12
|
-
import 'react/jsx-runtime';
|
|
13
|
-
import '../_commonjsHelpers-es.js';
|
|
14
|
-
import '../Button-es.js';
|
|
15
|
-
import 'react-router-dom';
|
|
16
|
-
import '../Icon-es.js';
|
|
17
|
-
import '@jobber/design';
|
|
18
6
|
import '../Menu-es.js';
|
|
19
7
|
import 'framer-motion';
|
|
20
8
|
import '../floating-ui.react-es.js';
|
|
21
|
-
import '../floating-ui.utils.dom-es.js';
|
|
22
9
|
import '../floating-ui.utils-es.js';
|
|
10
|
+
import 'react/jsx-runtime';
|
|
23
11
|
import 'react-dom';
|
|
24
12
|
import '../floating-ui.react-dom-es.js';
|
|
25
13
|
import '../useAtlantisI18n-es.js';
|
|
26
14
|
import '../AtlantisContext-es.js';
|
|
15
|
+
import '../Button-es.js';
|
|
16
|
+
import 'react-router-dom';
|
|
17
|
+
import '../Icon-es.js';
|
|
18
|
+
import '@jobber/design';
|
|
19
|
+
import '../Typography-es.js';
|
|
27
20
|
import '../useFormFieldFocus-es.js';
|
|
28
21
|
import '../maxHeight-es.js';
|
|
29
22
|
import '../useRenderElement-es.js';
|
|
30
23
|
import '../buttonRenderAdapter-es.js';
|
|
24
|
+
import '../OverlaySeparator-es.js';
|
|
25
|
+
import '../Separator-es.js';
|
|
31
26
|
import '../BottomSheet-es.js';
|
|
32
27
|
import '../ScrollAreaViewport-es.js';
|
|
33
28
|
import '../useScrollLock-es.js';
|
|
34
|
-
import '../useButton-es.js';
|
|
35
29
|
import '../scrollEdges-es.js';
|
|
36
|
-
import '../
|
|
37
|
-
import '../
|
|
38
|
-
import '../
|
|
30
|
+
import '../HelperText-es.js';
|
|
31
|
+
import '../Text-es.js';
|
|
32
|
+
import '../SelectPrimitive-es.js';
|
|
33
|
+
import '../SelectGroupLabel-es.js';
|
|
34
|
+
import '../useCompositeListItem-es.js';
|
|
39
35
|
import '../DrawerTitle-es.js';
|
|
40
36
|
import '../MenuSubmenuTrigger-es.js';
|
|
41
|
-
import '../
|
|
42
|
-
import '../
|
|
37
|
+
import '../Heading-es.js';
|
|
38
|
+
import '../Content-es.js';
|
|
39
|
+
import '../Markdown-es.js';
|
|
40
|
+
import '../Emphasis-es.js';
|
|
41
|
+
import '../_commonjsHelpers-es.js';
|
|
43
42
|
import '../filterDataAttributes-es.js';
|