@payfit/unity-components 1.1.0 → 1.2.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/esm/adapters/standardSchemaAdapter.d.ts +7 -0
- package/dist/esm/adapters/standardSchemaAdapter.js +20 -0
- package/dist/esm/adapters/zodAdapter.d.ts +13 -0
- package/dist/esm/adapters/zodAdapter.js +74 -0
- package/dist/esm/components/action-bar/ActionBar.js +62 -64
- package/dist/esm/components/actionable/Actionable.d.ts +50 -3
- package/dist/esm/components/actionable/Actionable.js +49 -39
- package/dist/esm/components/app-menu/parts/AppMenuFooter.js +63 -63
- package/dist/esm/components/autocomplete/parts/AutocompleteClearButton.js +5 -5
- package/dist/esm/components/bottom-sheet/parts/BottomSheetDragIndicator.js +30 -31
- package/dist/esm/components/checkbox-field/CheckboxField.d.ts +2 -2
- package/dist/esm/components/checkbox-field/CheckboxField.js +18 -17
- package/dist/esm/components/checkbox-group-field/CheckboxGroupField.d.ts +2 -2
- package/dist/esm/components/checkbox-group-field/CheckboxGroupField.js +4 -1
- package/dist/esm/components/code/Code.d.ts +37 -0
- package/dist/esm/components/code/Code.js +39 -0
- package/dist/esm/components/code/copyToClipboard.d.ts +1 -0
- package/dist/esm/components/code/copyToClipboard.js +10 -0
- package/dist/esm/components/collapsible/Collapsible.d.ts +1 -1
- package/dist/esm/components/collapsible/Collapsible.js +14 -13
- package/dist/esm/components/collapsible/parts/CollapsibleTitle.js +7 -7
- package/dist/esm/components/data-table/DataTable.d.ts +76 -10
- package/dist/esm/components/data-table/DataTable.js +81 -78
- package/dist/esm/components/data-table/parts/ColumnSortHeader.js +13 -13
- package/dist/esm/components/data-table/parts/DataTableBulkActions.js +20 -20
- package/dist/esm/components/date-calendar/DateCalendar.js +52 -52
- package/dist/esm/components/date-calendar/parts/DateSegmentSelect.js +30 -33
- package/dist/esm/components/date-picker/DatePicker.js +64 -64
- package/dist/esm/components/date-picker/parts/DateInput.js +33 -33
- package/dist/esm/components/date-picker-field/DatePickerField.d.ts +2 -2
- package/dist/esm/components/dialog/parts/DialogActions/DialogButton.js +12 -12
- package/dist/esm/components/error-state/ErrorState.d.ts +196 -0
- package/dist/esm/components/error-state/ErrorState.js +153 -0
- package/dist/esm/components/error-state/initConfig.d.ts +16 -0
- package/dist/esm/components/error-state/initConfig.js +149 -0
- package/dist/esm/components/error-state/parts/Collapsible.d.ts +59 -0
- package/dist/esm/components/error-state/parts/Collapsible.js +67 -0
- package/dist/esm/components/form/Form.d.ts +15 -9
- package/dist/esm/components/form/Form.js +53 -50
- package/dist/esm/components/form-field/FormField.js +24 -23
- package/dist/esm/components/form-field/utils/isFieldRequired.d.ts +4 -4
- package/dist/esm/components/form-field/utils/isFieldRequired.js +5 -20
- package/dist/esm/components/funnel-layout/FunnelLayout.d.ts +1 -1
- package/dist/esm/components/funnel-layout/FunnelLayout.js +61 -110
- package/dist/esm/components/funnel-layout/parts/FunnelPage.js +8 -9
- package/dist/esm/components/funnel-layout/parts/FunnelPageActions.js +24 -24
- package/dist/esm/components/funnel-layout/parts/FunnelPageFooter.js +6 -7
- package/dist/esm/components/funnel-layout/parts/FunnelPageHeader.d.ts +2 -2
- package/dist/esm/components/funnel-layout/parts/FunnelSidebar.d.ts +2 -2
- package/dist/esm/components/funnel-layout/parts/FunnelSidebar.js +9 -10
- package/dist/esm/components/funnel-layout/parts/FunnelTopBar.js +0 -1
- package/dist/esm/components/input/Input.js +28 -28
- package/dist/esm/components/label/Label.js +19 -19
- package/dist/esm/components/multi-select/MultiSelect.js +94 -94
- package/dist/esm/components/multi-select/hooks/use-multiselection-state.js +32 -32
- package/dist/esm/components/multi-select/parts/MultiSelectButton.js +38 -38
- package/dist/esm/components/multi-select/parts/MultiSelectPopover.js +16 -16
- package/dist/esm/components/multi-select-field/MultiSelectField.d.ts +2 -2
- package/dist/esm/components/multi-select-field/MultiSelectField.js +53 -53
- package/dist/esm/components/nav/parts/NavGroup.js +21 -21
- package/dist/esm/components/number-field/NumberField.d.ts +3 -3
- package/dist/esm/components/number-input/NumberInput.js +58 -58
- package/dist/esm/components/pagination/Pagination.js +97 -101
- package/dist/esm/components/pagination/parts/PaginationJumpDialog.js +39 -40
- package/dist/esm/components/popover/parts/PopoverHeader.js +8 -8
- package/dist/esm/components/radio-button-group/parts/RadioButton.js +11 -11
- package/dist/esm/components/select-field/SelectField.d.ts +2 -2
- package/dist/esm/components/select-field/SelectField.js +4 -1
- package/dist/esm/components/selectable-button-group/SelectableButtonGroup.js +22 -23
- package/dist/esm/components/selectable-button-group-field/SelectableButtonGroupField.d.ts +2 -2
- package/dist/esm/components/side-panel/parts/SidePanelDragIndicator.js +30 -31
- package/dist/esm/components/skip-links/SkipLinks.js +50 -43
- package/dist/esm/components/table/Table.js +79 -76
- package/dist/esm/components/table/parts/TableBody.js +6 -6
- package/dist/esm/components/table/parts/TableCell.js +25 -25
- package/dist/esm/components/table/parts/TableColumnHeader.js +38 -38
- package/dist/esm/components/table/parts/TablePagination.js +61 -59
- package/dist/esm/components/table/parts/TableRow.js +16 -16
- package/dist/esm/components/tabs/parts/TabList.js +50 -54
- package/dist/esm/components/task-menu/parts/Content.js +24 -24
- package/dist/esm/components/task-menu/parts/Header.js +24 -24
- package/dist/esm/components/task-menu/parts/SubTask.js +74 -74
- package/dist/esm/components/task-menu/parts/Task.js +69 -69
- package/dist/esm/components/task-menu/parts/TaskGroup.js +45 -45
- package/dist/esm/components/text-area/TextArea.js +30 -31
- package/dist/esm/components/text-field/TextField.d.ts +2 -2
- package/dist/esm/components/toggle-switch-field/ToggleSwitchField.d.ts +2 -2
- package/dist/esm/components/toggle-switch-field/ToggleSwitchField.js +4 -1
- package/dist/esm/components/toggle-switch-group/ToggleSwitchGroup.js +74 -74
- package/dist/esm/components/toggle-switch-group-field/ToggleSwitchGroupField.d.ts +2 -2
- package/dist/esm/components/toggle-switch-group-field/ToggleSwitchGroupField.js +36 -32
- package/dist/esm/hooks/use-form.d.ts +5 -5
- package/dist/esm/hooks/use-form.types.d.ts +2 -2
- package/dist/esm/hooks/use-resizable.js +13 -14
- package/dist/esm/index.d.ts +1 -0
- package/dist/esm/index.js +22 -19
- package/dist/esm/types/schema.d.ts +8 -0
- package/dist/esm/utils/createSchemaAdapter.d.ts +7 -0
- package/dist/esm/utils/createSchemaAdapter.js +13 -0
- package/dist/esm/utils/platform.js +2 -3
- package/i18n/en-GB.json +16 -0
- package/i18n/es-ES.json +16 -0
- package/i18n/fr-FR.json +16 -0
- package/package.json +25 -19
|
@@ -1,82 +1,82 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import { forwardRef as
|
|
3
|
-
import { uyTv as
|
|
4
|
-
import { useFormContext as
|
|
5
|
-
import { FormField as
|
|
6
|
-
import { FormControl as
|
|
7
|
-
import { FormFeedbackText as
|
|
8
|
-
import { FormHelperText as
|
|
9
|
-
import { FormLabel as
|
|
1
|
+
import { jsxs as C, jsx as t } from "react/jsx-runtime";
|
|
2
|
+
import { forwardRef as P } from "react";
|
|
3
|
+
import { uyTv as M } from "@payfit/unity-themes";
|
|
4
|
+
import { useFormContext as T } from "react-hook-form";
|
|
5
|
+
import { FormField as k } from "../form-field/FormField.js";
|
|
6
|
+
import { FormControl as g } from "../form-field/parts/FormControl.js";
|
|
7
|
+
import { FormFeedbackText as B } from "../form-field/parts/FormFeedbackText.js";
|
|
8
|
+
import { FormHelperText as L } from "../form-field/parts/FormHelperText.js";
|
|
9
|
+
import { FormLabel as R } from "../form-field/parts/FormLabel.js";
|
|
10
10
|
import { MultiSelect as u } from "../multi-select/MultiSelect.js";
|
|
11
|
-
const
|
|
11
|
+
const j = M({
|
|
12
12
|
base: "uy:flex uy:flex-col uy:gap-100"
|
|
13
13
|
});
|
|
14
|
-
function
|
|
15
|
-
const { control:
|
|
16
|
-
name:
|
|
17
|
-
label:
|
|
18
|
-
helperText:
|
|
19
|
-
feedbackText:
|
|
20
|
-
contextualLink:
|
|
21
|
-
isRequired:
|
|
22
|
-
isInvalid:
|
|
23
|
-
isLoading:
|
|
24
|
-
isDisabled:
|
|
25
|
-
isReadOnly:
|
|
26
|
-
requiredVariant:
|
|
27
|
-
children:
|
|
28
|
-
onClearButtonPress:
|
|
14
|
+
function q(e, l) {
|
|
15
|
+
const { control: r, setValue: d } = T(), {
|
|
16
|
+
name: i,
|
|
17
|
+
label: f,
|
|
18
|
+
helperText: o,
|
|
19
|
+
feedbackText: x,
|
|
20
|
+
contextualLink: F,
|
|
21
|
+
isRequired: b,
|
|
22
|
+
isInvalid: h,
|
|
23
|
+
isLoading: n,
|
|
24
|
+
isDisabled: m,
|
|
25
|
+
isReadOnly: a,
|
|
26
|
+
requiredVariant: p,
|
|
27
|
+
children: s,
|
|
28
|
+
onClearButtonPress: S,
|
|
29
29
|
...y
|
|
30
30
|
} = e, I = {
|
|
31
|
-
isRequired:
|
|
32
|
-
isInvalid:
|
|
33
|
-
isLoading:
|
|
34
|
-
isDisabled:
|
|
35
|
-
isReadOnly:
|
|
36
|
-
}, V = "items" in e && "getItemValue" in e,
|
|
31
|
+
isRequired: b,
|
|
32
|
+
isInvalid: h,
|
|
33
|
+
isLoading: n,
|
|
34
|
+
isDisabled: m,
|
|
35
|
+
isReadOnly: a
|
|
36
|
+
}, V = "items" in e && "getItemValue" in e, c = {
|
|
37
37
|
onClearButtonPress: () => {
|
|
38
|
-
|
|
38
|
+
d(i, /* @__PURE__ */ new Set()), S?.();
|
|
39
39
|
},
|
|
40
40
|
placeholder: e.placeholder,
|
|
41
41
|
isSearchable: e.isSearchable,
|
|
42
42
|
maxVisibleItems: e.maxVisibleItems,
|
|
43
|
-
isDisabled:
|
|
44
|
-
isReadOnly:
|
|
45
|
-
isLoading:
|
|
43
|
+
isDisabled: m,
|
|
44
|
+
isReadOnly: a,
|
|
45
|
+
isLoading: n,
|
|
46
46
|
renderValue: e.renderValue
|
|
47
47
|
};
|
|
48
|
-
return /* @__PURE__ */
|
|
49
|
-
|
|
48
|
+
return /* @__PURE__ */ C(
|
|
49
|
+
k,
|
|
50
50
|
{
|
|
51
|
-
control:
|
|
52
|
-
name:
|
|
53
|
-
className:
|
|
51
|
+
control: r,
|
|
52
|
+
name: i,
|
|
53
|
+
className: j(),
|
|
54
54
|
...I,
|
|
55
55
|
children: [
|
|
56
|
-
/* @__PURE__ */ t(
|
|
57
|
-
|
|
58
|
-
/* @__PURE__ */ t(
|
|
56
|
+
/* @__PURE__ */ t(R, { requiredVariant: p, children: f }),
|
|
57
|
+
o && /* @__PURE__ */ t(L, { children: o }),
|
|
58
|
+
/* @__PURE__ */ t(g, { children: V ? (
|
|
59
59
|
// @ts-expect-error - Type system cannot fully express this but it works correctly at runtime
|
|
60
60
|
/* @__PURE__ */ t(
|
|
61
61
|
u,
|
|
62
62
|
{
|
|
63
63
|
...y,
|
|
64
|
-
...
|
|
65
|
-
ref:
|
|
66
|
-
children:
|
|
64
|
+
...c,
|
|
65
|
+
ref: l,
|
|
66
|
+
children: s
|
|
67
67
|
}
|
|
68
68
|
)
|
|
69
|
-
) : /* @__PURE__ */ t(u, { ...
|
|
70
|
-
/* @__PURE__ */ t(
|
|
71
|
-
|
|
69
|
+
) : /* @__PURE__ */ t(u, { ...c, ref: l, children: s }) }),
|
|
70
|
+
/* @__PURE__ */ t(B, { children: x }),
|
|
71
|
+
F
|
|
72
72
|
]
|
|
73
73
|
}
|
|
74
74
|
);
|
|
75
75
|
}
|
|
76
|
-
const
|
|
77
|
-
return
|
|
76
|
+
const v = P(function(l, r) {
|
|
77
|
+
return q(l, r);
|
|
78
78
|
});
|
|
79
|
-
|
|
79
|
+
v.displayName = "MultiSelectField";
|
|
80
80
|
export {
|
|
81
|
-
|
|
81
|
+
v as MultiSelectField
|
|
82
82
|
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import
|
|
1
|
+
import { jsxs as o, jsx as n } from "react/jsx-runtime";
|
|
2
|
+
import r, { useState as G, useCallback as j } from "react";
|
|
3
3
|
import { uyTv as B } from "@payfit/unity-themes";
|
|
4
4
|
import { Button as D } from "react-aria-components";
|
|
5
5
|
import _ from "../../../hooks/use-id.js";
|
|
@@ -32,40 +32,40 @@ const z = B({
|
|
|
32
32
|
function H({
|
|
33
33
|
children: y,
|
|
34
34
|
label: p,
|
|
35
|
-
prefix:
|
|
35
|
+
prefix: s,
|
|
36
36
|
suffix: m,
|
|
37
37
|
defaultExpanded: f = !1,
|
|
38
38
|
isExpanded: l,
|
|
39
|
-
onToggle:
|
|
39
|
+
onToggle: i,
|
|
40
40
|
...x
|
|
41
41
|
}) {
|
|
42
|
-
const u = _(), [h, b] = G(f),
|
|
43
|
-
|
|
44
|
-
}, [
|
|
45
|
-
base:
|
|
46
|
-
prefix:
|
|
47
|
-
label:
|
|
48
|
-
suffix:
|
|
42
|
+
const u = _(), [h, b] = G(f), a = l !== void 0, e = a ? l : h, v = j(() => {
|
|
43
|
+
a || b((t) => !t), i?.(!e);
|
|
44
|
+
}, [a, e, i]), g = r.Children.map(y, (t) => r.isValidElement(t) ? r.cloneElement(t, { isDisabled: !e, level: 1 }) : t), c = `${u}-toggle`, d = `${u}-content`, {
|
|
45
|
+
base: N,
|
|
46
|
+
prefix: I,
|
|
47
|
+
label: E,
|
|
48
|
+
suffix: S,
|
|
49
49
|
content: w,
|
|
50
50
|
contentWrapper: C,
|
|
51
51
|
caret: W
|
|
52
52
|
} = z({ level: 0, expanded: e });
|
|
53
|
-
return /* @__PURE__ */
|
|
54
|
-
/* @__PURE__ */
|
|
53
|
+
return /* @__PURE__ */ o("li", { className: "uy:flex uy:flex-col uy:gap-50", children: [
|
|
54
|
+
/* @__PURE__ */ o(
|
|
55
55
|
D,
|
|
56
56
|
{
|
|
57
57
|
id: c,
|
|
58
|
-
className:
|
|
58
|
+
className: N({ className: "uy:w-full" }),
|
|
59
59
|
onPress: v,
|
|
60
60
|
"aria-expanded": e,
|
|
61
61
|
"aria-controls": d,
|
|
62
62
|
...x,
|
|
63
63
|
children: [
|
|
64
|
-
|
|
65
|
-
/* @__PURE__ */
|
|
66
|
-
/* @__PURE__ */
|
|
64
|
+
s && /* @__PURE__ */ n("span", { className: I(), children: s({ isExpanded: e }) }),
|
|
65
|
+
/* @__PURE__ */ n("span", { className: E(), children: p }),
|
|
66
|
+
/* @__PURE__ */ o("span", { className: S(), role: "presentation", children: [
|
|
67
67
|
m,
|
|
68
|
-
/* @__PURE__ */
|
|
68
|
+
/* @__PURE__ */ n(
|
|
69
69
|
$,
|
|
70
70
|
{
|
|
71
71
|
src: "CaretDownOutlined",
|
|
@@ -79,19 +79,19 @@ function H({
|
|
|
79
79
|
]
|
|
80
80
|
}
|
|
81
81
|
),
|
|
82
|
-
/* @__PURE__ */
|
|
82
|
+
/* @__PURE__ */ n(
|
|
83
83
|
"div",
|
|
84
84
|
{
|
|
85
85
|
className: C(),
|
|
86
86
|
style: { maxHeight: e ? 1e3 : 0 },
|
|
87
|
-
children: /* @__PURE__ */
|
|
87
|
+
children: /* @__PURE__ */ n(
|
|
88
88
|
"ul",
|
|
89
89
|
{
|
|
90
90
|
id: d,
|
|
91
91
|
className: w(),
|
|
92
92
|
"aria-labelledby": c,
|
|
93
93
|
"aria-hidden": !e,
|
|
94
|
-
children:
|
|
94
|
+
children: g
|
|
95
95
|
}
|
|
96
96
|
)
|
|
97
97
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
+
import { StandardSchemaV1 } from '@standard-schema/spec';
|
|
1
2
|
import { ForwardedRef, JSX, ReactNode } from 'react';
|
|
2
3
|
import { FieldPath, FieldValues } from 'react-hook-form';
|
|
3
|
-
import { infer as ZodInfer } from 'zod';
|
|
4
4
|
import { Schema } from '../../hooks/use-form.types.js';
|
|
5
5
|
import { LabelProps } from '../label/Label.js';
|
|
6
6
|
import { NumberProps } from '../number-input/NumberInput.js';
|
|
@@ -17,7 +17,7 @@ export interface NumberFieldProps<TFieldValues extends FieldValues = FieldValues
|
|
|
17
17
|
/** A contextual link to display below the text field. */
|
|
18
18
|
contextualLink?: ReactNode;
|
|
19
19
|
}
|
|
20
|
-
type NumberFieldComponent = (<TSchema extends Schema>(props: NumberFieldProps<
|
|
20
|
+
type NumberFieldComponent = (<TSchema extends Schema>(props: NumberFieldProps<StandardSchemaV1.InferOutput<TSchema>> & {
|
|
21
21
|
ref?: ForwardedRef<HTMLInputElement>;
|
|
22
22
|
}) => JSX.Element) & {
|
|
23
23
|
displayName?: string;
|
|
@@ -39,7 +39,7 @@ type NumberFieldComponent = (<TSchema extends Schema>(props: NumberFieldProps<Zo
|
|
|
39
39
|
* />
|
|
40
40
|
* ```
|
|
41
41
|
* @template TSchema - The Zod schema type for form validation
|
|
42
|
-
* @param {NumberFieldProps<
|
|
42
|
+
* @param {NumberFieldProps<StandardSchemaV1.InferOutput<TSchema>>} props - The props for the NumberField component
|
|
43
43
|
* @param {ForwardedRef<HTMLInputElement>} ref - Ref forwarded to the underlying input element
|
|
44
44
|
* @returns {JSX.Element} A NumberField component
|
|
45
45
|
*/
|
|
@@ -1,32 +1,32 @@
|
|
|
1
1
|
import { jsxs as t, jsx as e } from "react/jsx-runtime";
|
|
2
|
-
import { forwardRef as
|
|
3
|
-
import { uyTv as
|
|
4
|
-
import { NumberField as
|
|
5
|
-
import { Icon as
|
|
2
|
+
import { forwardRef as k } from "react";
|
|
3
|
+
import { uyTv as z } from "@payfit/unity-themes";
|
|
4
|
+
import { NumberField as F, Group as G, Input as T } from "react-aria-components";
|
|
5
|
+
import { Icon as W } from "../icon/Icon.js";
|
|
6
6
|
import "@payfit/unity-icons";
|
|
7
|
-
import { useIntl as
|
|
8
|
-
import { CircularIconButton as
|
|
9
|
-
import { Spinner as
|
|
10
|
-
const
|
|
7
|
+
import { useIntl as q } from "react-intl";
|
|
8
|
+
import { CircularIconButton as i } from "../icon-button/CircularIconButton.js";
|
|
9
|
+
import { Spinner as A } from "../spinner/Spinner.js";
|
|
10
|
+
const H = z({
|
|
11
11
|
slots: {
|
|
12
12
|
base: [
|
|
13
|
-
"uy:group uy:flex uy:h-500 uy:border uy:border-solid uy:rounded-
|
|
13
|
+
"uy:group uy:flex uy:h-500 uy:border uy:border-solid uy:rounded-75",
|
|
14
14
|
"uy:focus-within:outline-none uy:focus-within:ring-2 uy:focus-within:ring-utility-focus-ring uy:focus-within:ring-offset-2",
|
|
15
15
|
"uy:active:border-border-form-active"
|
|
16
16
|
],
|
|
17
17
|
wrapper: [
|
|
18
|
-
"uy:flex uy:gap-50 uy:flex-grow uy:flex-nowrap uy:pt-100 uy:pb-100 uy:pl-150 uy:pr-150 uy:rounded-
|
|
18
|
+
"uy:flex uy:gap-50 uy:flex-grow uy:flex-nowrap uy:pt-100 uy:pb-100 uy:pl-150 uy:pr-150 uy:rounded-75 uy:max-w-full uy:justify-between uy:items-center"
|
|
19
19
|
],
|
|
20
20
|
input: [
|
|
21
21
|
"uy:w-full uy:flex-1 uy:outline-none uy:typography-body uy:min-w-0 uy:max-w-full",
|
|
22
22
|
"uy:placeholder:text-content-neutral-lowest"
|
|
23
23
|
],
|
|
24
24
|
prefix: [
|
|
25
|
-
"uy:flex-grow-0 uy:content-center uy:pt-100 uy:pb-100 uy:pl-150 uy:pr-150 uy:border-r uy:border-solid uy:rounded-l-
|
|
25
|
+
"uy:flex-grow-0 uy:content-center uy:pt-100 uy:pb-100 uy:pl-150 uy:pr-150 uy:border-r uy:border-solid uy:rounded-l-75",
|
|
26
26
|
"uy:active:border-border-form-active"
|
|
27
27
|
],
|
|
28
28
|
suffix: [
|
|
29
|
-
"uy:flex-grow-0 uy:content-center uy:pt-100 uy:pb-100 uy:pl-150 uy:pr-150 uy:border-l uy:border-solid uy:rounded-r-
|
|
29
|
+
"uy:flex-grow-0 uy:content-center uy:pt-100 uy:pb-100 uy:pl-150 uy:pr-150 uy:border-l uy:border-solid uy:rounded-r-75",
|
|
30
30
|
"uy:active:border-border-form-active"
|
|
31
31
|
],
|
|
32
32
|
state: [
|
|
@@ -81,62 +81,62 @@ const K = T({
|
|
|
81
81
|
}
|
|
82
82
|
}
|
|
83
83
|
}
|
|
84
|
-
}),
|
|
84
|
+
}), J = k(
|
|
85
85
|
({
|
|
86
|
-
withControls:
|
|
86
|
+
withControls: s = !1,
|
|
87
87
|
defaultValue: u,
|
|
88
|
-
formatOptions:
|
|
89
|
-
isDisabled:
|
|
90
|
-
isInvalid:
|
|
88
|
+
formatOptions: p,
|
|
89
|
+
isDisabled: b,
|
|
90
|
+
isInvalid: f,
|
|
91
91
|
isLoading: a,
|
|
92
92
|
isReadOnly: d,
|
|
93
|
-
isRequired:
|
|
93
|
+
isRequired: g,
|
|
94
94
|
maxValue: n,
|
|
95
|
-
minValue:
|
|
96
|
-
prefix:
|
|
97
|
-
onBlur:
|
|
98
|
-
onChange:
|
|
99
|
-
onClearButtonPress:
|
|
95
|
+
minValue: l,
|
|
96
|
+
prefix: y,
|
|
97
|
+
onBlur: x,
|
|
98
|
+
onChange: w,
|
|
99
|
+
onClearButtonPress: v,
|
|
100
100
|
step: h,
|
|
101
|
-
suffix:
|
|
101
|
+
suffix: m,
|
|
102
102
|
value: r,
|
|
103
103
|
...N
|
|
104
|
-
},
|
|
104
|
+
}, c) => {
|
|
105
105
|
const {
|
|
106
106
|
base: M,
|
|
107
107
|
wrapper: I,
|
|
108
|
-
input:
|
|
109
|
-
prefix:
|
|
110
|
-
suffix:
|
|
111
|
-
state:
|
|
112
|
-
controls:
|
|
113
|
-
} =
|
|
108
|
+
input: C,
|
|
109
|
+
prefix: j,
|
|
110
|
+
suffix: E,
|
|
111
|
+
state: O,
|
|
112
|
+
controls: S
|
|
113
|
+
} = H({ isReadOnly: d }), o = q(), B = r !== void 0 && !isNaN(r), D = u !== void 0 && !isNaN(u), P = (B || D) && !s && !a && !d && !b;
|
|
114
114
|
return /* @__PURE__ */ t(
|
|
115
|
-
|
|
115
|
+
F,
|
|
116
116
|
{
|
|
117
|
-
ref:
|
|
117
|
+
ref: c,
|
|
118
118
|
className: M(),
|
|
119
119
|
value: r,
|
|
120
120
|
defaultValue: u,
|
|
121
|
-
minValue:
|
|
121
|
+
minValue: l,
|
|
122
122
|
maxValue: n,
|
|
123
123
|
step: h,
|
|
124
|
-
isDisabled:
|
|
124
|
+
isDisabled: b,
|
|
125
125
|
isReadOnly: d,
|
|
126
|
-
isInvalid:
|
|
127
|
-
isRequired:
|
|
126
|
+
isInvalid: f,
|
|
127
|
+
isRequired: g,
|
|
128
128
|
"aria-busy": a,
|
|
129
|
-
onChange:
|
|
130
|
-
formatOptions:
|
|
131
|
-
onBlur:
|
|
129
|
+
onChange: w,
|
|
130
|
+
formatOptions: p,
|
|
131
|
+
onBlur: x,
|
|
132
132
|
...N,
|
|
133
133
|
children: [
|
|
134
|
-
|
|
135
|
-
/* @__PURE__ */ t(
|
|
136
|
-
/* @__PURE__ */ e(
|
|
137
|
-
/* @__PURE__ */ t("div", { className:
|
|
134
|
+
y ? /* @__PURE__ */ e("span", { className: j(), children: y }) : null,
|
|
135
|
+
/* @__PURE__ */ t(G, { className: I(), children: [
|
|
136
|
+
/* @__PURE__ */ e(T, { ref: c, className: C() }),
|
|
137
|
+
/* @__PURE__ */ t("div", { className: O(), children: [
|
|
138
138
|
a && /* @__PURE__ */ e(
|
|
139
|
-
|
|
139
|
+
A,
|
|
140
140
|
{
|
|
141
141
|
color: "inherit",
|
|
142
142
|
size: "small",
|
|
@@ -146,8 +146,8 @@ const K = T({
|
|
|
146
146
|
})
|
|
147
147
|
}
|
|
148
148
|
),
|
|
149
|
-
|
|
150
|
-
|
|
149
|
+
f && /* @__PURE__ */ e(
|
|
150
|
+
W,
|
|
151
151
|
{
|
|
152
152
|
src: "WarningCircleOutlined",
|
|
153
153
|
color: "content.form.invalid",
|
|
@@ -157,8 +157,8 @@ const K = T({
|
|
|
157
157
|
})
|
|
158
158
|
}
|
|
159
159
|
),
|
|
160
|
-
|
|
161
|
-
|
|
160
|
+
P && /* @__PURE__ */ e(
|
|
161
|
+
i,
|
|
162
162
|
{
|
|
163
163
|
title: o.formatMessage({
|
|
164
164
|
id: "unity:component:common:clear:title",
|
|
@@ -167,19 +167,19 @@ const K = T({
|
|
|
167
167
|
className: "uy:text-content-neutral-enabled",
|
|
168
168
|
icon: "CloseOutlined",
|
|
169
169
|
onPress: () => {
|
|
170
|
-
|
|
170
|
+
v?.();
|
|
171
171
|
}
|
|
172
172
|
}
|
|
173
173
|
)
|
|
174
174
|
] }),
|
|
175
|
-
|
|
175
|
+
s && /* @__PURE__ */ t("div", { className: S(), children: [
|
|
176
176
|
/* @__PURE__ */ e(
|
|
177
|
-
|
|
177
|
+
i,
|
|
178
178
|
{
|
|
179
179
|
asElement: "button",
|
|
180
180
|
icon: "MinusOutlined",
|
|
181
181
|
slot: "decrement",
|
|
182
|
-
isDisabled:
|
|
182
|
+
isDisabled: l !== void 0 && r === l,
|
|
183
183
|
title: o.formatMessage({
|
|
184
184
|
id: "unity:component:form-field:number-input:decrement:title",
|
|
185
185
|
defaultMessage: "decrement"
|
|
@@ -187,7 +187,7 @@ const K = T({
|
|
|
187
187
|
}
|
|
188
188
|
),
|
|
189
189
|
/* @__PURE__ */ e(
|
|
190
|
-
|
|
190
|
+
i,
|
|
191
191
|
{
|
|
192
192
|
asElement: "button",
|
|
193
193
|
icon: "PlusOutlined",
|
|
@@ -201,14 +201,14 @@ const K = T({
|
|
|
201
201
|
)
|
|
202
202
|
] })
|
|
203
203
|
] }),
|
|
204
|
-
|
|
204
|
+
m ? /* @__PURE__ */ e("span", { className: E(), children: m }) : null
|
|
205
205
|
]
|
|
206
206
|
}
|
|
207
207
|
);
|
|
208
208
|
}
|
|
209
209
|
);
|
|
210
|
-
|
|
210
|
+
J.displayName = "NumberInput";
|
|
211
211
|
export {
|
|
212
|
-
|
|
213
|
-
|
|
212
|
+
J as NumberInput,
|
|
213
|
+
H as numberInput
|
|
214
214
|
};
|