@ostack.tech/ui-kform 0.6.5 → 0.8.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/ostack-ui-kform.css.map +1 -1
- package/dist/ostack-ui-kform.js +87 -60
- package/dist/ostack-ui-kform.js.map +1 -1
- package/dist/types/components/Annexes/AnnexesManager.d.ts +1 -1
- package/dist/types/components/Annexes/AnnexesMenu.d.ts +1 -1
- package/dist/types/components/FileControl/FileControl.d.ts +2 -2
- package/dist/types/components/IssuesPanel/IssuesPanel.d.ts +5 -5
- package/dist/types/components/LoadAction/LoadAction.d.ts +1 -1
- package/dist/types/components/PathLink/PathLink.d.ts +2 -2
- package/dist/types/components/PrintAction/PrintAction.d.ts +1 -1
- package/dist/types/components/SaveAction/SaveAction.d.ts +2 -2
- package/dist/types/components/SubmitAction/SubmitAction.d.ts +3 -3
- package/dist/types/components/TableControl/TableControlAddRowTrigger.d.ts +1 -1
- package/dist/types/components/TableControl/TableControlRemoveRowTrigger.d.ts +1 -1
- package/dist/types/components/ValidateAction/ValidateAction.d.ts +1 -1
- package/dist/types/utils/useRegisterControl.d.ts +1 -0
- package/package.json +4 -4
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sourceRoot":"","sources":["../../../node_modules/@ostack.tech/ui/scss/scss/utils/_animation.scss","../../../node_modules/@ostack.tech/ui/scss/scss/utils/_spinner.scss","../scss/components/Annexes/_Annexes.scss","../scss/components/Annexes/_Annexes-variables.scss","../../../node_modules/@ostack.tech/ui/scss/scss/utils/_breakpoints.scss","../../../node_modules/@ostack.tech/ui/scss/components/Tabs/_Tabs-variables.scss","../../../node_modules/@ostack.tech/ui/scss/scss/_colors.scss","../../../node_modules/@ostack.tech/ui/scss/scss/_base-variables.scss","../scss/components/FileControl/_FileControl.scss","../../../node_modules/@ostack.tech/ui/scss/components/Spinner/_Spinner.scss","../../../node_modules/@ostack.tech/ui/scss/scss/utils/_declare-var.scss","../scss/components/FormApp/_FormApp.scss","../../../node_modules/@ostack.tech/ui/scss/scss/utils/_responsive-values.scss","../../../node_modules/@ostack.tech/ui/scss/scss/utils/_transition.scss","../scss/components/FormPages/_FormPages.scss","../scss/components/FormPages/_FormPages-variables.scss","../../../node_modules/@ostack.tech/ui/scss/scss/placeholders/control/_control-variables.scss","../scss/components/IssueMessages/_IssueMessages.scss","../scss/components/IssuesPanel/_IssuesPanel.scss","../scss/components/IssuesPanel/_IssuesPanel-variables.scss","../scss/components/TopBar/_TopBar.scss"],"names":[],"mappings":";AAcA;EACE;IACE;;EAEF;IACE;;;AAKJ;EACE;IACE;;EAEF;IACE;;;AAQJ;EACE;IACE;IACA;;EAEF;IACE;IACA;;;AAKJ;EACE;IACE;IACA;;EAEF;IACE;IACA;;;AAQJ;EACE;IACE;IACA;;EAEF;IACE;;EAEF;IACE;IACA;;;AAKJ;EACE;IACE;IACA;;EAEF;IACE;;EAEF;IACE;IACA;;;AAQJ;EACE;IACE;IACA;;EAEF;IACE;;EAEF;IACE;IACA;;;AAKJ;EACE;IACE;IACA;;EAEF;IACE;;EAEF;IACE;IACA;;;AC1FJ;EACE;IACE;;;AC7BJ;EAGE;EACA;;AAEA;EACE,WCTwB;EDUxB;EACA;EACA;;AAEA;EACE;;
|
|
1
|
+
{"version":3,"sourceRoot":"","sources":["../../../node_modules/@ostack.tech/ui/scss/scss/utils/_animation.scss","../../../node_modules/@ostack.tech/ui/scss/scss/utils/_spinner.scss","../scss/components/Annexes/_Annexes.scss","../scss/components/Annexes/_Annexes-variables.scss","../../../node_modules/@ostack.tech/ui/scss/scss/utils/_breakpoints.scss","../../../node_modules/@ostack.tech/ui/scss/components/Tabs/_Tabs-variables.scss","../../../node_modules/@ostack.tech/ui/scss/scss/_colors.scss","../../../node_modules/@ostack.tech/ui/scss/scss/_base-variables.scss","../scss/components/FileControl/_FileControl.scss","../../../node_modules/@ostack.tech/ui/scss/components/Spinner/_Spinner.scss","../../../node_modules/@ostack.tech/ui/scss/scss/utils/_declare-var.scss","../scss/components/FormApp/_FormApp.scss","../../../node_modules/@ostack.tech/ui/scss/scss/utils/_responsive-values.scss","../../../node_modules/@ostack.tech/ui/scss/scss/utils/_transition.scss","../scss/components/FormPages/_FormPages.scss","../scss/components/FormPages/_FormPages-variables.scss","../../../node_modules/@ostack.tech/ui/scss/scss/placeholders/control/_control-variables.scss","../scss/components/IssueMessages/_IssueMessages.scss","../scss/components/IssuesPanel/_IssuesPanel.scss","../scss/components/IssuesPanel/_IssuesPanel-variables.scss","../scss/components/TopBar/_TopBar.scss"],"names":[],"mappings":";AAcA;EACE;IACE;;EAEF;IACE;;;AAKJ;EACE;IACE;;EAEF;IACE;;;AAQJ;EACE;IACE;IACA;;EAEF;IACE;IACA;;;AAKJ;EACE;IACE;IACA;;EAEF;IACE;IACA;;;AAQJ;EACE;IACE;IACA;;EAEF;IACE;;EAEF;IACE;IACA;;;AAKJ;EACE;IACE;IACA;;EAEF;IACE;;EAEF;IACE;IACA;;;AAQJ;EACE;IACE;IACA;;EAEF;IACE;;EAEF;IACE;IACA;;;AAKJ;EACE;IACE;IACA;;EAEF;IACE;;EAEF;IACE;IACA;;;AC1FJ;EACE;IACE;;;AC7BJ;EAGE;EACA;;AAEA;EACE,WCTwB;EDUxB;EACA;EACA;;AAEA;EACE;;AEgBF;EFjBA;IAII;;;AAKN;EACE,eGjBkC;EHkBlC;EACA,YGlB+B;;ADuB/B;EFRF;IAMI;;;AAIJ;EACE;EACA;EACA;EACA,QAlCW;;AAqCb;EACE;EACA;;AAGF;EACE,QA3CW;EA4CX;EACA;EACA;;AAEA;EACE,cIvCI;EJwCJ;EACA;EACA;EACA;;AAIJ;EACE;;AAEA;EACE;;AAGF;EACE;;AExBF;EFgBF;IAYI;IACA;IACA;IACA;;;AAIJ;EACE;;AAEA;EACE;EACA;EACA;EACA;EAGA;EACA;EACA;EAEA;;AAIJ;EACE;EACA;;AAGF;EACE;EACA;EACA;EACA;;AAGF;EACE;;AAGF;EACE,aK6Re;EL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ACE;EACA;EACA;EACA;;AAIF;EACE,cCnGuC;;ADsGzC;EACE;EACA,WXwNW;EWvNX,aXuOa;EWtOb,aX0Pe;EWzPf;;AAGF;EAGE,cCnHiC;;ADsHnC;EACE;;AAGF;EACE;EACA;EACA;;AAGF;EACE;EACA,cCxGoC;;AD2GtC;EAEE,WCzG2B;ED0G3B,aCzG6B;;AD4G/B;EACE,YC/G0B;;ADkH5B;EACE,YC5GiC;ED6GjC,SC5G8B;;AD8G9B;EACE;;;AE7LN;EAKE;EACA;EACA;EAEA;EACA;EACA;EAEA;EACA;EAEA;;AAQA;EAEE;EACA;;AAGF;EACE,YACE;;AAKF;EACE,YACE;;AAMN;EACE","file":"ostack-ui-kform.css"}
|
package/dist/ostack-ui-kform.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { jsx, jsxs, Fragment } from "react/jsx-runtime";
|
|
2
2
|
import { usePrefix as usePrefix$1, useControllableState, useLatestValues, combineEventHandlers, LocalizationProvider as LocalizationProvider$1, usePrinting, useConstant, useSpacing, useCssVars, NATIVE_CONTROLS, useResponsiveValues, useCombinedRef, cx, useIsInRoot, warnOnce, usePrintInProgress, PrefixProvider, Root, computed, TabContent, ErrorBoundary, DocumentTitle, Spinner, useToastManager, useStartPrintingTask, Tabs, useErrorReporter, EMPTY_STORE, Field, Feedback, FeedbackList, FeedbackPopover, useMediaBreakpointUp, DropdownMenu, DropdownMenuTrigger, Button, DropdownMenuContent, DropdownMenuRadioGroup, DropdownMenuGroup, DropdownMenuSub, DropdownMenuSubTrigger, DropdownMenuSubContent, DropdownMenuItem, useAlertDialog, DropdownMenuRadioItem, controlStatusToAccent, VisuallyHidden, IconButton, Tab, boolDataAttr, TabList, useIsInTableCell, useDataTableColumnLabel, useOnFieldLabelChange, Checkbox, OptionsGroup, Option, CheckboxGroup, useDateTransformer, DateInput, DateRangeInput, usePrintClassNames, Input, Dialog, Tooltip, DialogTrigger, ControlAddon, Icon, DialogContent, DialogHeader, DialogTitle, DialogBody, Alert, Stack, Popover, PopoverTrigger, PopoverContent, useMeasure, Container, Select, MenuListItem, MenuList, StepContent, Step, StepList, Stepper, CloseButton, useScrollPosition, setBoolDataAttr, Card, CardHeader, CardTitle, CardBody, useIntersectionObserver, useKeyboardShortcut, NumericInput, Link, usePrint, usePrinterDocumentTitle, PrinterTrigger, RadioGroup, Radio, ButtonGroup, AlertDialog, AlertDialogTrigger, AlertDialogContent, AlertDialogHeader, AlertDialogTitle, AlertDialogBody, AlertDialogDescription, AlertDialogFooter, AlertDialogCancel, AlertDialogAction, DataTableCell, DataTableRow, useDataTableApiRef, DataTable, Slot, DataTableContent, DataTablePagination, DataTableRowsPerPage, TextArea, PortalContext } from "@ostack.tech/ui";
|
|
3
3
|
import { AbsolutePath, AbsolutePathFragment, PathMultimap, sliceTable, listableSize, Path, ValidationFailure, nullableSchemaInnerSchema, compareSchemaPaths, PromiseCancellationException, arrayToTable, indexOfTableRowId, isComputedSchema } from "@ostack.tech/kform";
|
|
4
|
-
import { useResolvedPath, equals, useFormController, useForm, FormContext, CurrentPath, useCurrentPath, useFormManager, useFormattedValue, InvalidPathError, AtPathError, useIssuesTracker, useFormContext, useInput, useListableInput, formatTemporalAsString, useTemporalInput, useFileInput, useController, useNumericInput, formatNumericAsString, useFormatter } from "@ostack.tech/kform-react";
|
|
4
|
+
import { useResolvedPath, equals, useFormController, useForm, FormContext, CurrentPath, useCurrentPath, useFormManager, useFormattedValue, InvalidPathError, AtPathError, useIssuesTracker, useFormContext, useInput, useListableInput, formatTemporalAsString, useTemporalInput, useFileInput, toFileList, useController, useNumericInput, formatNumericAsString, useFormatter } from "@ostack.tech/kform-react";
|
|
5
5
|
import { createContext, useContext, useCallback, useMemo, useRef, useEffect, forwardRef, useState, useImperativeHandle, startTransition, Suspense, useDeferredValue, Children, isValidElement, createElement, memo } from "react";
|
|
6
6
|
import { createStore, useStore } from "zustand";
|
|
7
7
|
import { subscribeWithSelector } from "zustand/middleware";
|
|
@@ -150,7 +150,7 @@ function pathSpecificity(path) {
|
|
|
150
150
|
}
|
|
151
151
|
return specificity;
|
|
152
152
|
}
|
|
153
|
-
const INITIAL = Symbol();
|
|
153
|
+
const INITIAL = /* @__PURE__ */ Symbol();
|
|
154
154
|
function useEqualityFn(selector, equalityFn = Object.is) {
|
|
155
155
|
const latest = useRef(INITIAL);
|
|
156
156
|
return (state) => {
|
|
@@ -2283,7 +2283,7 @@ function AnnexesMenuItem({
|
|
|
2283
2283
|
circle: true,
|
|
2284
2284
|
disabled: formIsDisabled,
|
|
2285
2285
|
onClick: handleRemoveButtonClick,
|
|
2286
|
-
"aria-hidden":
|
|
2286
|
+
"aria-hidden": true
|
|
2287
2287
|
}
|
|
2288
2288
|
)
|
|
2289
2289
|
] })
|
|
@@ -2618,14 +2618,13 @@ function useRegisterControl({
|
|
|
2618
2618
|
const { useState: useState2, usePath, useInitialized, useDisplayStatus } = controller;
|
|
2619
2619
|
const path = usePath();
|
|
2620
2620
|
const formIsDisabled = useFormIsDisabled();
|
|
2621
|
-
const displayDisabled = useState2((state) =>
|
|
2621
|
+
const displayDisabled = useState2((state) => state.initialized && !state.exists) || formIsDisabled;
|
|
2622
2622
|
const displayReadOnly = useFormIsReadOnly();
|
|
2623
|
-
const deferredIsValidating = useDeferredValue(
|
|
2624
|
-
useState2((state) => state.validationStatus === "validating")
|
|
2625
|
-
);
|
|
2626
2623
|
const initialized = useInitialized();
|
|
2627
|
-
const displayLoading = !initialized || deferredIsValidating;
|
|
2628
2624
|
const displayStatusToDisplay = useDeferredValue(useDisplayStatus());
|
|
2625
|
+
const displayValidating = useDeferredValue(
|
|
2626
|
+
useState2((state) => state.validationStatus === "validating")
|
|
2627
|
+
);
|
|
2629
2628
|
const issuesToDisplay = useDeferredValue(
|
|
2630
2629
|
useState2((state) => state.touched ? state.issues : [], {
|
|
2631
2630
|
equalityFn: shallow
|
|
@@ -2662,21 +2661,23 @@ function useRegisterControl({
|
|
|
2662
2661
|
);
|
|
2663
2662
|
return useMemo(
|
|
2664
2663
|
() => ({
|
|
2665
|
-
displayLoading: printing ? false :
|
|
2664
|
+
displayLoading: printing ? false : !initialized,
|
|
2666
2665
|
displayDisabled: printing ? false : displayDisabled,
|
|
2667
2666
|
displayReadOnly: printing ? false : displayReadOnly,
|
|
2668
2667
|
displayStatusToDisplay: printing ? void 0 : displayStatusToDisplay,
|
|
2668
|
+
displayValidating: printing ? false : displayValidating,
|
|
2669
2669
|
issuesToDisplay: printing ? [] : issuesToDisplay,
|
|
2670
2670
|
autofocusRef,
|
|
2671
2671
|
handleFocus
|
|
2672
2672
|
}),
|
|
2673
2673
|
[
|
|
2674
2674
|
autofocusRef,
|
|
2675
|
+
displayValidating,
|
|
2675
2676
|
displayDisabled,
|
|
2676
|
-
displayLoading,
|
|
2677
2677
|
displayReadOnly,
|
|
2678
2678
|
displayStatusToDisplay,
|
|
2679
2679
|
handleFocus,
|
|
2680
|
+
initialized,
|
|
2680
2681
|
issuesToDisplay,
|
|
2681
2682
|
printing
|
|
2682
2683
|
]
|
|
@@ -2715,6 +2716,7 @@ const CheckboxControl = forwardRef(function CheckboxControl2({
|
|
|
2715
2716
|
onTouchedStatusChange,
|
|
2716
2717
|
required,
|
|
2717
2718
|
loading,
|
|
2719
|
+
showSpinner,
|
|
2718
2720
|
disabled,
|
|
2719
2721
|
readOnly,
|
|
2720
2722
|
onFocus,
|
|
@@ -2746,6 +2748,7 @@ const CheckboxControl = forwardRef(function CheckboxControl2({
|
|
|
2746
2748
|
displayDisabled,
|
|
2747
2749
|
displayReadOnly,
|
|
2748
2750
|
displayStatusToDisplay,
|
|
2751
|
+
displayValidating,
|
|
2749
2752
|
issuesToDisplay,
|
|
2750
2753
|
autofocusRef,
|
|
2751
2754
|
handleFocus
|
|
@@ -2783,6 +2786,7 @@ const CheckboxControl = forwardRef(function CheckboxControl2({
|
|
|
2783
2786
|
name: inputProps.name,
|
|
2784
2787
|
required: required ?? restrictions.required === true,
|
|
2785
2788
|
loading: displayLoading || loading,
|
|
2789
|
+
showSpinner: displayValidating || showSpinner,
|
|
2786
2790
|
disabled: displayDisabled || disabled,
|
|
2787
2791
|
readOnly: displayReadOnly || readOnly || inputProps.readOnly,
|
|
2788
2792
|
status: displayStatusToControlStatus(displayStatusToDisplay),
|
|
@@ -2861,6 +2865,7 @@ const CheckboxGroupControl = forwardRef(function CheckboxGroupControl2({
|
|
|
2861
2865
|
onTouchedStatusChange,
|
|
2862
2866
|
required,
|
|
2863
2867
|
loading,
|
|
2868
|
+
showSpinner,
|
|
2864
2869
|
disabled,
|
|
2865
2870
|
readOnly,
|
|
2866
2871
|
onFocus,
|
|
@@ -2913,6 +2918,7 @@ const CheckboxGroupControl = forwardRef(function CheckboxGroupControl2({
|
|
|
2913
2918
|
displayDisabled,
|
|
2914
2919
|
displayReadOnly,
|
|
2915
2920
|
displayStatusToDisplay,
|
|
2921
|
+
displayValidating,
|
|
2916
2922
|
issuesToDisplay,
|
|
2917
2923
|
autofocusRef,
|
|
2918
2924
|
handleFocus
|
|
@@ -2954,6 +2960,7 @@ const CheckboxGroupControl = forwardRef(function CheckboxGroupControl2({
|
|
|
2954
2960
|
name: inputProps.name,
|
|
2955
2961
|
required: required ?? restrictions.required === true,
|
|
2956
2962
|
loading: displayLoading || loading,
|
|
2963
|
+
showSpinner: displayValidating || showSpinner,
|
|
2957
2964
|
disabled: displayDisabled || disabled,
|
|
2958
2965
|
readOnly: displayReadOnly || readOnly || inputProps.readOnly,
|
|
2959
2966
|
status: displayStatusToControlStatus(displayStatusToDisplay),
|
|
@@ -3045,6 +3052,7 @@ const DateControl = forwardRef(function DateControl2({
|
|
|
3045
3052
|
minDate,
|
|
3046
3053
|
maxDate,
|
|
3047
3054
|
loading,
|
|
3055
|
+
showSpinner,
|
|
3048
3056
|
disabled,
|
|
3049
3057
|
readOnly,
|
|
3050
3058
|
onFocus,
|
|
@@ -3087,6 +3095,7 @@ const DateControl = forwardRef(function DateControl2({
|
|
|
3087
3095
|
displayDisabled,
|
|
3088
3096
|
displayReadOnly,
|
|
3089
3097
|
displayStatusToDisplay,
|
|
3098
|
+
displayValidating,
|
|
3090
3099
|
issuesToDisplay,
|
|
3091
3100
|
autofocusRef,
|
|
3092
3101
|
handleFocus
|
|
@@ -3130,6 +3139,7 @@ const DateControl = forwardRef(function DateControl2({
|
|
|
3130
3139
|
minDate: minDate ?? minDateRestriction(schema),
|
|
3131
3140
|
maxDate: maxDate ?? maxDateRestriction(schema),
|
|
3132
3141
|
loading: displayLoading || loading,
|
|
3142
|
+
showSpinner: displayValidating || showSpinner,
|
|
3133
3143
|
disabled: displayDisabled || disabled,
|
|
3134
3144
|
readOnly: displayReadOnly || readOnly || inputProps.readOnly,
|
|
3135
3145
|
status: displayStatusToControlStatus(displayStatusToDisplay),
|
|
@@ -3166,8 +3176,10 @@ const DateRangeControl = forwardRef(function DateRangeControl2({
|
|
|
3166
3176
|
required,
|
|
3167
3177
|
minDate,
|
|
3168
3178
|
maxDate,
|
|
3169
|
-
|
|
3170
|
-
|
|
3179
|
+
loading,
|
|
3180
|
+
showSpinners = loading,
|
|
3181
|
+
showStartSpinner = showSpinners,
|
|
3182
|
+
showEndSpinner = showSpinners,
|
|
3171
3183
|
disabled,
|
|
3172
3184
|
readOnly,
|
|
3173
3185
|
startInputProps,
|
|
@@ -3263,6 +3275,7 @@ const DateRangeControl = forwardRef(function DateRangeControl2({
|
|
|
3263
3275
|
displayDisabled: displayStartDisabled,
|
|
3264
3276
|
displayReadOnly: displayStartReadOnly,
|
|
3265
3277
|
displayStatusToDisplay: startDisplayStatusToDisplay,
|
|
3278
|
+
displayValidating: displayStartValidating,
|
|
3266
3279
|
issuesToDisplay: startIssuesToDisplay,
|
|
3267
3280
|
autofocusRef: startAutofocusRef,
|
|
3268
3281
|
handleFocus: handleStartFocus
|
|
@@ -3279,6 +3292,7 @@ const DateRangeControl = forwardRef(function DateRangeControl2({
|
|
|
3279
3292
|
displayDisabled: displayEndDisabled,
|
|
3280
3293
|
displayReadOnly: displayEndReadOnly,
|
|
3281
3294
|
displayStatusToDisplay: endDisplayStatusToDisplay,
|
|
3295
|
+
displayValidating: displayEndValidating,
|
|
3282
3296
|
issuesToDisplay: endIssuesToDisplay,
|
|
3283
3297
|
autofocusRef: endAutofocusRef,
|
|
3284
3298
|
handleFocus: handleEndFocus
|
|
@@ -3330,8 +3344,9 @@ const DateRangeControl = forwardRef(function DateRangeControl2({
|
|
|
3330
3344
|
required: required ?? (startRestrictions.required === true || endRestrictions.required === true),
|
|
3331
3345
|
minDate: minDate ?? minDateRestriction(startSchema),
|
|
3332
3346
|
maxDate: maxDate ?? maxDateRestriction(endSchema),
|
|
3333
|
-
|
|
3334
|
-
|
|
3347
|
+
loading: displayStartLoading || displayEndLoading || loading,
|
|
3348
|
+
showStartSpinner: displayStartValidating || showStartSpinner,
|
|
3349
|
+
showEndSpinner: displayEndValidating || showEndSpinner,
|
|
3335
3350
|
disabled: displayStartDisabled && displayEndDisabled || disabled,
|
|
3336
3351
|
readOnly: displayStartReadOnly && displayEndReadOnly || readOnly || startInputProps?.readOnly && endInputProps?.readOnly,
|
|
3337
3352
|
status: startDisplayStatusToDisplay === "error" || endDisplayStatusToDisplay === "error" ? "invalid" : startDisplayStatusToDisplay === "warning" || endDisplayStatusToDisplay === "warning" ? "warned" : void 0,
|
|
@@ -3402,6 +3417,7 @@ const FileControl = forwardRef(function FileControl2({
|
|
|
3402
3417
|
required,
|
|
3403
3418
|
accept,
|
|
3404
3419
|
loading,
|
|
3420
|
+
showSpinner,
|
|
3405
3421
|
disabled,
|
|
3406
3422
|
readOnly,
|
|
3407
3423
|
showClearButton,
|
|
@@ -3419,17 +3435,17 @@ const FileControl = forwardRef(function FileControl2({
|
|
|
3419
3435
|
downloadFileButtonLabel ??= locale7.FileControl.downloadFileButtonLabel;
|
|
3420
3436
|
fallbackText ??= locale7.FileControl.fallbackText;
|
|
3421
3437
|
const { printHidden } = usePrintClassNames();
|
|
3422
|
-
const
|
|
3438
|
+
const latestFile = useRef(null);
|
|
3423
3439
|
const [file, setFile] = useState(null);
|
|
3424
3440
|
const controller = useFileInput(
|
|
3425
3441
|
path,
|
|
3426
3442
|
{
|
|
3427
3443
|
enabled: !useFormIsLoading(),
|
|
3428
3444
|
formManager,
|
|
3429
|
-
|
|
3430
|
-
setFile(
|
|
3431
|
-
|
|
3432
|
-
return
|
|
3445
|
+
formatFromJsFile: useCallback((fileValue) => {
|
|
3446
|
+
setFile(fileValue);
|
|
3447
|
+
latestFile.current = fileValue;
|
|
3448
|
+
return fileValue;
|
|
3433
3449
|
}, []),
|
|
3434
3450
|
onInitialized,
|
|
3435
3451
|
onFormManagerEvent,
|
|
@@ -3448,6 +3464,7 @@ const FileControl = forwardRef(function FileControl2({
|
|
|
3448
3464
|
displayDisabled,
|
|
3449
3465
|
displayReadOnly,
|
|
3450
3466
|
displayStatusToDisplay,
|
|
3467
|
+
displayValidating,
|
|
3451
3468
|
issuesToDisplay,
|
|
3452
3469
|
autofocusRef,
|
|
3453
3470
|
handleFocus
|
|
@@ -3470,7 +3487,7 @@ const FileControl = forwardRef(function FileControl2({
|
|
|
3470
3487
|
onChange?.(evt);
|
|
3471
3488
|
inputProps.onChange(evt);
|
|
3472
3489
|
} else {
|
|
3473
|
-
evt.target.files =
|
|
3490
|
+
evt.target.files = toFileList(latestFile.current);
|
|
3474
3491
|
}
|
|
3475
3492
|
},
|
|
3476
3493
|
[inputProps, onChange]
|
|
@@ -3507,6 +3524,7 @@ const FileControl = forwardRef(function FileControl2({
|
|
|
3507
3524
|
required: required ?? restrictions.required == true,
|
|
3508
3525
|
accept: accept ?? (Array.isArray(restrictions.acceptedFileTypes) ? restrictions.acceptedFileTypes.join() : void 0),
|
|
3509
3526
|
loading: displayLoading || loading,
|
|
3527
|
+
showSpinner: displayValidating || showSpinner,
|
|
3510
3528
|
disabled: displayDisabled || disabled,
|
|
3511
3529
|
readOnly: displayReadOnly || readOnly || inputProps.readOnly,
|
|
3512
3530
|
showClearButton,
|
|
@@ -4858,7 +4876,7 @@ function IssuesPanelControls({
|
|
|
4858
4876
|
),
|
|
4859
4877
|
children: [
|
|
4860
4878
|
paginationLabel && currentPageIndex !== -1 && /* @__PURE__ */ jsx(VisuallyHidden, { children: paginationLabel(currentPageIndex + 1, nPages) }),
|
|
4861
|
-
/* @__PURE__ */ jsxs("span", { "aria-hidden":
|
|
4879
|
+
/* @__PURE__ */ jsxs("span", { "aria-hidden": true, children: [
|
|
4862
4880
|
currentPageIndex === -1 ? "-" : currentPageIndex + 1,
|
|
4863
4881
|
" / ",
|
|
4864
4882
|
nPages
|
|
@@ -5546,7 +5564,6 @@ function LoadAction({
|
|
|
5546
5564
|
label,
|
|
5547
5565
|
keybinds,
|
|
5548
5566
|
loading,
|
|
5549
|
-
enabledWhenLoading,
|
|
5550
5567
|
disabled,
|
|
5551
5568
|
onClick,
|
|
5552
5569
|
decode,
|
|
@@ -5580,10 +5597,9 @@ function LoadAction({
|
|
|
5580
5597
|
});
|
|
5581
5598
|
const formIsDisabled = useFormIsDisabled();
|
|
5582
5599
|
const formIsLoading = useFormIsLoading();
|
|
5583
|
-
const shouldDisable = disabled || loading && !enabledWhenLoading || formIsDisabled || formIsLoading;
|
|
5584
5600
|
const formAppEl = useFormAppElement();
|
|
5585
5601
|
useKeyboardShortcut(keybinds, () => load(), {
|
|
5586
|
-
enabled: !
|
|
5602
|
+
enabled: !disabled && !loading && !formIsDisabled && !formIsLoading,
|
|
5587
5603
|
target: formAppEl,
|
|
5588
5604
|
preventDefault: true
|
|
5589
5605
|
});
|
|
@@ -5595,9 +5611,8 @@ function LoadAction({
|
|
|
5595
5611
|
icon: faFolderOpen,
|
|
5596
5612
|
...otherProps,
|
|
5597
5613
|
onClick: combineEventHandlers(() => load(), onClick),
|
|
5598
|
-
disabled:
|
|
5614
|
+
disabled: disabled || formIsDisabled,
|
|
5599
5615
|
loading: loading || formIsLoading,
|
|
5600
|
-
enabledWhenLoading,
|
|
5601
5616
|
children: label
|
|
5602
5617
|
}
|
|
5603
5618
|
);
|
|
@@ -5627,6 +5642,7 @@ const NumericControl = forwardRef(function NumericControl2({
|
|
|
5627
5642
|
exclusiveMin,
|
|
5628
5643
|
exclusiveMax,
|
|
5629
5644
|
loading,
|
|
5645
|
+
showSpinner,
|
|
5630
5646
|
disabled,
|
|
5631
5647
|
readOnly,
|
|
5632
5648
|
endAdornment,
|
|
@@ -5656,6 +5672,7 @@ const NumericControl = forwardRef(function NumericControl2({
|
|
|
5656
5672
|
displayDisabled,
|
|
5657
5673
|
displayReadOnly,
|
|
5658
5674
|
displayStatusToDisplay,
|
|
5675
|
+
displayValidating,
|
|
5659
5676
|
issuesToDisplay,
|
|
5660
5677
|
autofocusRef,
|
|
5661
5678
|
handleFocus
|
|
@@ -5711,6 +5728,7 @@ const NumericControl = forwardRef(function NumericControl2({
|
|
|
5711
5728
|
exclusiveMin: exclusiveMin ?? (restrictions.exclusiveMin == null ? void 0 : formatNumericAsString(restrictions.exclusiveMin, schema)),
|
|
5712
5729
|
exclusiveMax: exclusiveMax ?? (restrictions.exclusiveMax == null ? void 0 : formatNumericAsString(restrictions.exclusiveMax, schema)),
|
|
5713
5730
|
loading: displayLoading || loading,
|
|
5731
|
+
showSpinner: displayValidating || showSpinner,
|
|
5714
5732
|
disabled: displayDisabled || disabled,
|
|
5715
5733
|
readOnly: displayReadOnly || readOnly || inputProps.readOnly,
|
|
5716
5734
|
status: displayStatusToControlStatus(displayStatusToDisplay),
|
|
@@ -5732,12 +5750,7 @@ const NumericControl = forwardRef(function NumericControl2({
|
|
|
5732
5750
|
] });
|
|
5733
5751
|
});
|
|
5734
5752
|
const DEFAULT_HREF_BUILDER = (path) => path.toString();
|
|
5735
|
-
|
|
5736
|
-
to,
|
|
5737
|
-
buildHref = DEFAULT_HREF_BUILDER,
|
|
5738
|
-
onClick,
|
|
5739
|
-
...otherProps
|
|
5740
|
-
}) {
|
|
5753
|
+
const PathLink = forwardRef(function PathLink2({ to, buildHref = DEFAULT_HREF_BUILDER, onClick, ...otherProps }, forwardedRef) {
|
|
5741
5754
|
const focus = useFocus();
|
|
5742
5755
|
const path = useResolvedPath(to);
|
|
5743
5756
|
const handleClick = (evt) => {
|
|
@@ -5751,16 +5764,16 @@ function PathLink({
|
|
|
5751
5764
|
...otherProps,
|
|
5752
5765
|
onClick: combineEventHandlers(onClick, handleClick, {
|
|
5753
5766
|
checkDefaultPrevented: true
|
|
5754
|
-
})
|
|
5767
|
+
}),
|
|
5768
|
+
ref: forwardedRef
|
|
5755
5769
|
}
|
|
5756
5770
|
);
|
|
5757
|
-
}
|
|
5771
|
+
});
|
|
5758
5772
|
function PrintAction({
|
|
5759
5773
|
label,
|
|
5760
5774
|
keybinds,
|
|
5761
5775
|
disabled,
|
|
5762
5776
|
loading,
|
|
5763
|
-
enabledWhenLoading,
|
|
5764
5777
|
onClick,
|
|
5765
5778
|
...otherProps
|
|
5766
5779
|
}) {
|
|
@@ -5770,11 +5783,10 @@ function PrintAction({
|
|
|
5770
5783
|
const printInProgress = usePrintInProgress();
|
|
5771
5784
|
const formIsDisabled = useFormIsDisabled();
|
|
5772
5785
|
const formIsLoading = useFormIsLoading();
|
|
5773
|
-
const shouldDisable = disabled || loading && !enabledWhenLoading || formIsDisabled || formIsLoading || printInProgress;
|
|
5774
5786
|
const formAppEl = useFormAppElement();
|
|
5775
5787
|
const formTitle = useFormTitle();
|
|
5776
5788
|
const print = usePrint();
|
|
5777
|
-
const printerHasDocumentTitle =
|
|
5789
|
+
const printerHasDocumentTitle = Boolean(usePrinterDocumentTitle());
|
|
5778
5790
|
const handlePrint = (evt) => {
|
|
5779
5791
|
evt.preventDefault();
|
|
5780
5792
|
void print(
|
|
@@ -5782,7 +5794,7 @@ function PrintAction({
|
|
|
5782
5794
|
);
|
|
5783
5795
|
};
|
|
5784
5796
|
useKeyboardShortcut(keybinds, handlePrint, {
|
|
5785
|
-
enabled: !
|
|
5797
|
+
enabled: !disabled && !loading && !formIsDisabled && !formIsLoading && !printInProgress,
|
|
5786
5798
|
target: formAppEl,
|
|
5787
5799
|
preventDefault: true
|
|
5788
5800
|
});
|
|
@@ -5800,7 +5812,7 @@ function PrintAction({
|
|
|
5800
5812
|
icon: faPrint,
|
|
5801
5813
|
...otherProps,
|
|
5802
5814
|
loading: loading || printInProgress,
|
|
5803
|
-
disabled:
|
|
5815
|
+
disabled: disabled || formIsDisabled || formIsLoading,
|
|
5804
5816
|
children: label
|
|
5805
5817
|
}
|
|
5806
5818
|
)
|
|
@@ -5830,6 +5842,7 @@ const RadioGroupControl = forwardRef(function RadioGroupControl2({
|
|
|
5830
5842
|
onTouchedStatusChange,
|
|
5831
5843
|
required,
|
|
5832
5844
|
loading,
|
|
5845
|
+
showSpinner,
|
|
5833
5846
|
disabled,
|
|
5834
5847
|
readOnly,
|
|
5835
5848
|
showClearButton = false,
|
|
@@ -5887,6 +5900,7 @@ const RadioGroupControl = forwardRef(function RadioGroupControl2({
|
|
|
5887
5900
|
displayDisabled,
|
|
5888
5901
|
displayReadOnly,
|
|
5889
5902
|
displayStatusToDisplay,
|
|
5903
|
+
displayValidating,
|
|
5890
5904
|
issuesToDisplay,
|
|
5891
5905
|
autofocusRef,
|
|
5892
5906
|
handleFocus
|
|
@@ -5930,6 +5944,7 @@ const RadioGroupControl = forwardRef(function RadioGroupControl2({
|
|
|
5930
5944
|
name: inputProps.name,
|
|
5931
5945
|
required: required ?? restrictions.required === true,
|
|
5932
5946
|
loading: displayLoading || loading,
|
|
5947
|
+
showSpinner: displayValidating || showSpinner,
|
|
5933
5948
|
disabled: displayDisabled || disabled,
|
|
5934
5949
|
readOnly: displayReadOnly || readOnly || inputProps.readOnly,
|
|
5935
5950
|
status: displayStatusToControlStatus(displayStatusToDisplay),
|
|
@@ -6109,7 +6124,6 @@ function SaveAction({
|
|
|
6109
6124
|
saveAsLabel,
|
|
6110
6125
|
saveAsKeybinds,
|
|
6111
6126
|
loading,
|
|
6112
|
-
enabledWhenLoading,
|
|
6113
6127
|
disabled,
|
|
6114
6128
|
onClick,
|
|
6115
6129
|
variant = "subtle",
|
|
@@ -6150,15 +6164,15 @@ function SaveAction({
|
|
|
6150
6164
|
});
|
|
6151
6165
|
const formIsSaving = useFormIsSaving();
|
|
6152
6166
|
const formIsLoading = useFormIsLoading();
|
|
6153
|
-
const shouldDisable = disabled || loading && !enabledWhenLoading || formIsSaving || formIsLoading;
|
|
6154
6167
|
const formAppEl = useFormAppElement();
|
|
6168
|
+
const shortcutsEnabled = !disabled && !loading && !formIsSaving && !formIsLoading;
|
|
6155
6169
|
useKeyboardShortcut(keybinds, () => save({ overwrite: !disableOverwrite }), {
|
|
6156
|
-
enabled:
|
|
6170
|
+
enabled: shortcutsEnabled,
|
|
6157
6171
|
target: formAppEl,
|
|
6158
6172
|
preventDefault: true
|
|
6159
6173
|
});
|
|
6160
6174
|
useKeyboardShortcut(saveAsKeybinds, () => save(), {
|
|
6161
|
-
enabled:
|
|
6175
|
+
enabled: shortcutsEnabled,
|
|
6162
6176
|
target: formAppEl,
|
|
6163
6177
|
preventDefault: true
|
|
6164
6178
|
});
|
|
@@ -6174,9 +6188,8 @@ function SaveAction({
|
|
|
6174
6188
|
() => save({ overwrite: !disableOverwrite }),
|
|
6175
6189
|
onClick
|
|
6176
6190
|
),
|
|
6177
|
-
disabled:
|
|
6191
|
+
disabled: disabled || formIsLoading,
|
|
6178
6192
|
loading: loading || formIsSaving,
|
|
6179
|
-
enabledWhenLoading,
|
|
6180
6193
|
children: label
|
|
6181
6194
|
}
|
|
6182
6195
|
);
|
|
@@ -6191,11 +6204,19 @@ function SaveAction({
|
|
|
6191
6204
|
icon: faCaretDown,
|
|
6192
6205
|
...saveOptionsProps,
|
|
6193
6206
|
label: saveOptionsLabel,
|
|
6194
|
-
disabled:
|
|
6207
|
+
disabled: disabled || formIsLoading || saveOptionsProps?.disabled,
|
|
6195
6208
|
style: { minWidth: 20, ...saveOptionsProps?.style }
|
|
6196
6209
|
}
|
|
6197
6210
|
) }),
|
|
6198
|
-
/* @__PURE__ */ jsx(DropdownMenuContent, { align: "end", ...dropdownMenuProps, children: /* @__PURE__ */ jsx(
|
|
6211
|
+
/* @__PURE__ */ jsx(DropdownMenuContent, { align: "end", ...dropdownMenuProps, children: /* @__PURE__ */ jsx(
|
|
6212
|
+
DropdownMenuItem,
|
|
6213
|
+
{
|
|
6214
|
+
onClick: () => save(),
|
|
6215
|
+
disabled: disabled || formIsLoading,
|
|
6216
|
+
loading: loading || formIsSaving,
|
|
6217
|
+
children: saveAsLabel
|
|
6218
|
+
}
|
|
6219
|
+
) })
|
|
6199
6220
|
] })
|
|
6200
6221
|
] }) : saveButton;
|
|
6201
6222
|
}
|
|
@@ -6218,6 +6239,7 @@ const SelectControl = forwardRef(function SelectControl2({
|
|
|
6218
6239
|
onTouchedStatusChange,
|
|
6219
6240
|
required,
|
|
6220
6241
|
loading,
|
|
6242
|
+
showSpinner,
|
|
6221
6243
|
disabled,
|
|
6222
6244
|
readOnly,
|
|
6223
6245
|
showClearButton,
|
|
@@ -6284,6 +6306,7 @@ const SelectControl = forwardRef(function SelectControl2({
|
|
|
6284
6306
|
displayDisabled,
|
|
6285
6307
|
displayReadOnly,
|
|
6286
6308
|
displayStatusToDisplay,
|
|
6309
|
+
displayValidating,
|
|
6287
6310
|
issuesToDisplay,
|
|
6288
6311
|
autofocusRef,
|
|
6289
6312
|
handleFocus
|
|
@@ -6336,6 +6359,7 @@ const SelectControl = forwardRef(function SelectControl2({
|
|
|
6336
6359
|
name: inputProps.name,
|
|
6337
6360
|
required: required ?? restrictions.required === true,
|
|
6338
6361
|
loading: displayLoading || loading,
|
|
6362
|
+
showSpinner: displayValidating || showSpinner,
|
|
6339
6363
|
disabled: displayDisabled || disabled,
|
|
6340
6364
|
readOnly: displayReadOnly || readOnly || inputProps.readOnly,
|
|
6341
6365
|
status: displayStatusToControlStatus(displayStatusToDisplay),
|
|
@@ -6380,6 +6404,7 @@ const SelectMultipleControl = forwardRef(function SelectMultipleControl2({
|
|
|
6380
6404
|
onTouchedStatusChange,
|
|
6381
6405
|
required,
|
|
6382
6406
|
loading,
|
|
6407
|
+
showSpinner,
|
|
6383
6408
|
disabled,
|
|
6384
6409
|
readOnly,
|
|
6385
6410
|
endAdornment,
|
|
@@ -6444,6 +6469,7 @@ const SelectMultipleControl = forwardRef(function SelectMultipleControl2({
|
|
|
6444
6469
|
displayDisabled,
|
|
6445
6470
|
displayReadOnly,
|
|
6446
6471
|
displayStatusToDisplay,
|
|
6472
|
+
displayValidating,
|
|
6447
6473
|
issuesToDisplay,
|
|
6448
6474
|
autofocusRef,
|
|
6449
6475
|
handleFocus
|
|
@@ -6490,6 +6516,7 @@ const SelectMultipleControl = forwardRef(function SelectMultipleControl2({
|
|
|
6490
6516
|
name: inputProps.name,
|
|
6491
6517
|
required: required ?? restrictions.required === true,
|
|
6492
6518
|
loading: displayLoading || loading,
|
|
6519
|
+
showSpinner: displayValidating || showSpinner,
|
|
6493
6520
|
disabled: displayDisabled || disabled,
|
|
6494
6521
|
readOnly: displayReadOnly || readOnly || inputProps.readOnly,
|
|
6495
6522
|
status: displayStatusToControlStatus(displayStatusToDisplay),
|
|
@@ -6527,7 +6554,6 @@ function SubmitAction({
|
|
|
6527
6554
|
keybinds,
|
|
6528
6555
|
confirmWarnings = true,
|
|
6529
6556
|
loading,
|
|
6530
|
-
enabledWhenLoading,
|
|
6531
6557
|
disabled,
|
|
6532
6558
|
onClick,
|
|
6533
6559
|
dialogTitle,
|
|
@@ -6575,7 +6601,6 @@ function SubmitAction({
|
|
|
6575
6601
|
const formIsDisabled = useFormIsDisabled();
|
|
6576
6602
|
const formIsLoading = useFormIsLoading();
|
|
6577
6603
|
const formAppEl = useFormAppElement();
|
|
6578
|
-
const shouldDisable = disabled || loading && !enabledWhenLoading || formIsDisabled || formIsLoading || submitting;
|
|
6579
6604
|
const [submissionInfo, setSubmissionInfo] = useState(null);
|
|
6580
6605
|
const [checkedWarnings, setCheckedWarnings] = useState([]);
|
|
6581
6606
|
const allWarningsChecked = !submissionInfo?.warnings || submissionInfo.warnings.every(
|
|
@@ -6653,7 +6678,7 @@ function SubmitAction({
|
|
|
6653
6678
|
convertExternalIssuesTableRowIndicesToIds
|
|
6654
6679
|
});
|
|
6655
6680
|
useKeyboardShortcut(keybinds, handleAction, {
|
|
6656
|
-
enabled: !
|
|
6681
|
+
enabled: !disabled && !loading && !formIsDisabled && !formIsLoading && !submitting,
|
|
6657
6682
|
target: formAppEl,
|
|
6658
6683
|
preventDefault: true
|
|
6659
6684
|
});
|
|
@@ -6667,9 +6692,8 @@ function SubmitAction({
|
|
|
6667
6692
|
iconPlacement: "end",
|
|
6668
6693
|
...otherProps,
|
|
6669
6694
|
onClick: combineEventHandlers(handleAction, onClick),
|
|
6670
|
-
disabled:
|
|
6695
|
+
disabled: disabled || formIsDisabled || formIsLoading,
|
|
6671
6696
|
loading: loading || submitting,
|
|
6672
|
-
enabledWhenLoading,
|
|
6673
6697
|
children: label
|
|
6674
6698
|
}
|
|
6675
6699
|
) }),
|
|
@@ -7259,6 +7283,7 @@ const TextControl = forwardRef(function TextControl2({
|
|
|
7259
7283
|
maxLength,
|
|
7260
7284
|
pattern,
|
|
7261
7285
|
loading,
|
|
7286
|
+
showSpinner,
|
|
7262
7287
|
disabled,
|
|
7263
7288
|
readOnly,
|
|
7264
7289
|
endAdornment,
|
|
@@ -7294,6 +7319,7 @@ const TextControl = forwardRef(function TextControl2({
|
|
|
7294
7319
|
displayDisabled,
|
|
7295
7320
|
displayReadOnly,
|
|
7296
7321
|
displayStatusToDisplay,
|
|
7322
|
+
displayValidating,
|
|
7297
7323
|
issuesToDisplay,
|
|
7298
7324
|
autofocusRef,
|
|
7299
7325
|
handleFocus
|
|
@@ -7327,6 +7353,7 @@ const TextControl = forwardRef(function TextControl2({
|
|
|
7327
7353
|
maxLength: maxLength ?? (typeof restrictions.maxLength === "number" ? restrictions.maxLength : void 0),
|
|
7328
7354
|
pattern: pattern ?? (typeof restrictions.pattern === "string" ? restrictions.pattern : void 0),
|
|
7329
7355
|
loading: displayLoading || loading,
|
|
7356
|
+
showSpinner: displayValidating || showSpinner,
|
|
7330
7357
|
disabled: displayDisabled || disabled,
|
|
7331
7358
|
readOnly: displayReadOnly || readOnly || inputProps.readOnly,
|
|
7332
7359
|
status: displayStatusToControlStatus(displayStatusToDisplay),
|
|
@@ -7407,7 +7434,6 @@ function ValidateAction({
|
|
|
7407
7434
|
label,
|
|
7408
7435
|
keybinds,
|
|
7409
7436
|
loading,
|
|
7410
|
-
enabledWhenLoading,
|
|
7411
7437
|
disabled,
|
|
7412
7438
|
onClick,
|
|
7413
7439
|
...otherProps
|
|
@@ -7416,14 +7442,15 @@ function ValidateAction({
|
|
|
7416
7442
|
label ??= locale7.ValidateAction.label;
|
|
7417
7443
|
keybinds ??= locale7.ValidateAction.keybinds;
|
|
7418
7444
|
const { validate } = useFormValidator();
|
|
7419
|
-
const { validatingAutomatically, validatingManually
|
|
7420
|
-
const
|
|
7445
|
+
const { validatingAutomatically, validatingManually } = useFormIsValidating();
|
|
7446
|
+
const deferredValidatingAutomatically = useDeferredValue(
|
|
7447
|
+
validatingAutomatically
|
|
7448
|
+
);
|
|
7421
7449
|
const formIsDisabled = useFormIsDisabled();
|
|
7422
7450
|
const formIsLoading = useFormIsLoading();
|
|
7423
|
-
const shouldDisable = disabled || loading && !enabledWhenLoading || formIsDisabled || formIsLoading || validatingManually;
|
|
7424
7451
|
const formAppEl = useFormAppElement();
|
|
7425
7452
|
useKeyboardShortcut(keybinds, validate, {
|
|
7426
|
-
enabled: !
|
|
7453
|
+
enabled: !disabled && !loading && !formIsDisabled && !formIsLoading && !validatingManually,
|
|
7427
7454
|
target: formAppEl,
|
|
7428
7455
|
preventDefault: true
|
|
7429
7456
|
});
|
|
@@ -7435,9 +7462,9 @@ function ValidateAction({
|
|
|
7435
7462
|
vertical: true,
|
|
7436
7463
|
...otherProps,
|
|
7437
7464
|
onClick: combineEventHandlers(validate, onClick),
|
|
7438
|
-
|
|
7439
|
-
|
|
7440
|
-
|
|
7465
|
+
loading: loading || validatingManually,
|
|
7466
|
+
disabled: disabled || formIsDisabled || formIsLoading,
|
|
7467
|
+
showSpinner: deferredValidatingAutomatically,
|
|
7441
7468
|
children: label
|
|
7442
7469
|
}
|
|
7443
7470
|
);
|