@splunk/react-ui 5.0.0-beta.2 → 5.0.0-beta.4
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/Accordion.js +185 -243
- package/Animation.js +2 -2
- package/Button.js +4 -4
- package/ButtonGroup.js +10 -11
- package/ButtonSimple.js +48 -42
- package/CHANGELOG.md +26 -0
- package/CHANGELOG.v5.mdx +81 -0
- package/Calendar.js +352 -469
- package/Card.js +178 -321
- package/Chip.js +154 -296
- package/Clickable.js +30 -30
- package/Code.js +64 -49
- package/Color.js +546 -462
- package/ComboBox.js +575 -767
- package/Date.js +144 -136
- package/Divider.js +29 -26
- package/DualListbox.js +441 -444
- package/File.js +707 -981
- package/FormRows.js +260 -286
- package/Image.js +124 -251
- package/JSONTree.js +129 -129
- package/Layout.d.ts +2 -0
- package/Link.js +12 -12
- package/MIGRATION.mdx +22 -1
- package/MIGRATION.v5.mdx +12 -1
- package/Menu.js +76 -76
- package/Message.js +77 -100
- package/MessageBar.js +141 -251
- package/Modal.js +42 -40
- package/ModalLayer.js +12 -12
- package/Multiselect.js +1989 -2362
- package/NonInteractiveCheckbox.js +30 -118
- package/Number.js +75 -73
- package/Popover.js +348 -350
- package/Progress.js +1 -1
- package/RadioBar.js +136 -136
- package/Resize.js +62 -65
- package/Scroll.js +2 -2
- package/Select.js +281 -283
- package/SidePanel.js +53 -55
- package/Slider.js +370 -364
- package/SlidingPanels.js +100 -102
- package/SplitButton.js +170 -343
- package/StaticContent.js +15 -13
- package/StepBar.js +61 -60
- package/Switch.js +150 -164
- package/TabBar.js +544 -417
- package/Table.js +1711 -1540
- package/Text.js +28 -26
- package/TextArea.js +26 -26
- package/Tooltip.js +416 -562
- package/TransitionOpen.js +179 -158
- package/Tree.d.ts +2 -0
- package/WaitSpinner.js +1 -1
- package/package.json +7 -9
- package/types/src/Accordion/Accordion.d.ts +14 -21
- package/types/src/Accordion/AccordionContext.d.ts +0 -1
- package/types/src/Animation/Animation.d.ts +2 -3
- package/types/src/AnimationToggle/docs/examples/Provider.d.ts +2 -2
- package/types/src/AnimationToggle/docs/examples/ToggleComponent.d.ts +2 -2
- package/types/src/AnimationToggle/useAnimationToggle.d.ts +1 -1
- package/types/src/Button/Button.d.ts +2 -2
- package/types/src/ButtonGroup/ButtonGroupContext.d.ts +0 -1
- package/types/src/ButtonSimple/ButtonSimple.d.ts +1 -3
- package/types/src/ButtonSimple/mixin.d.ts +1 -1
- package/types/src/Calendar/Calendar.d.ts +2 -2
- package/types/src/Calendar/{DateTable.d.ts → DateGrid.d.ts} +9 -9
- package/types/src/Calendar/Day.d.ts +8 -4
- package/types/src/Card/Card.d.ts +27 -14
- package/types/src/CardLayout/CardLayoutContext.d.ts +0 -1
- package/types/src/CardLayout/docs/examples/Interactive.d.ts +2 -2
- package/types/src/Clickable/Clickable.d.ts +1 -1
- package/types/src/CollapsiblePanel/SingleOpenPanelGroupContext.d.ts +0 -1
- package/types/src/Color/Color.d.ts +3 -3
- package/types/src/Color/ColorInput.d.ts +27 -0
- package/types/src/Color/Palette.d.ts +11 -18
- package/types/src/Color/Swatch.d.ts +3 -1
- package/types/src/ComboBox/ComboBox.d.ts +46 -50
- package/types/src/ComboBox/Option.d.ts +34 -18
- package/types/src/ControlGroup/docs/examples/CustomizedLabelTarget.d.ts +2 -2
- package/types/src/Date/Date.d.ts +3 -2
- package/types/src/Date/docs/examples/Controlled.d.ts +2 -2
- package/types/src/Date/docs/examples/HighlightToday.d.ts +2 -2
- package/types/src/DefinitionList/DefinitionListContext.d.ts +0 -1
- package/types/src/Divider/Divider.d.ts +14 -6
- package/types/src/Divider/docs/examples/Appearance.d.ts +3 -0
- package/types/src/DualListbox/DualListbox.d.ts +5 -1
- package/types/src/File/File.d.ts +6 -6
- package/types/src/File/FileContext.d.ts +0 -1
- package/types/src/File/Item.d.ts +11 -3
- package/types/src/File/ItemIcon.d.ts +7 -0
- package/types/src/File/docs/examples/Disabled.d.ts +2 -2
- package/types/src/File/docs/examples/DropAnywhere.d.ts +2 -2
- package/types/src/File/docs/examples/Multi.d.ts +2 -2
- package/types/src/File/docs/examples/Single.d.ts +2 -2
- package/types/src/FormRows/FormRows.d.ts +8 -8
- package/types/src/FormRows/FormRowsContext.d.ts +1 -2
- package/types/src/FormRows/Row.d.ts +2 -2
- package/types/src/FormRows/RowInternal.d.ts +1 -1
- package/types/src/FormRows/SortableRow.d.ts +3 -3
- package/types/src/FormRows/docs/examples/Basic.d.ts +2 -2
- package/types/src/FormRows/docs/examples/Header.d.ts +2 -2
- package/types/src/FormRows/docs/examples/Menu.d.ts +2 -2
- package/types/src/FormRows/docs/examples/ReorderOnly.d.ts +2 -2
- package/types/src/Image/Image.d.ts +1 -4
- package/types/src/JSONTree/docs/examples/Events.d.ts +2 -2
- package/types/src/Layout/Layout.d.ts +1 -0
- package/types/src/Link/icons/External.d.ts +1 -2
- package/types/src/Menu/Divider.d.ts +1 -1
- package/types/src/Menu/MenuContext.d.ts +0 -1
- package/types/src/MessageBar/MessageBar.d.ts +5 -1
- package/types/src/Modal/ModalContext.d.ts +0 -1
- package/types/src/Multiselect/Compact.d.ts +49 -21
- package/types/src/Multiselect/Multiselect.d.ts +73 -30
- package/types/src/Multiselect/Normal.d.ts +46 -57
- package/types/src/Multiselect/Option.d.ts +42 -18
- package/types/src/Multiselect/docs/examples/Children.d.ts +2 -2
- package/types/src/Multiselect/docs/examples/Controlled.d.ts +2 -2
- package/types/src/Multiselect/docs/examples/CustomizeSelected.d.ts +2 -2
- package/types/src/Multiselect/docs/examples/Disabled.d.ts +2 -2
- package/types/src/Multiselect/docs/examples/Error.d.ts +2 -2
- package/types/src/Multiselect/docs/examples/Fetching.d.ts +2 -2
- package/types/src/Multiselect/docs/examples/LoadMoreOnScrollBottom.d.ts +2 -2
- package/types/src/Multiselect/docs/examples/NewValues.d.ts +2 -2
- package/types/src/Multiselect/docs/examples/TabInput.d.ts +2 -2
- package/types/src/NonInteractiveCheckbox/NonInteractiveCheckbox.d.ts +9 -8
- package/types/src/Number/Number.d.ts +1 -0
- package/types/src/Number/docs/examples/Basic.d.ts +2 -2
- package/types/src/Number/docs/examples/Limits.d.ts +2 -2
- package/types/src/Number/docs/examples/Locale.d.ts +2 -2
- package/types/src/Popover/Popover.d.ts +1 -1
- package/types/src/Popover/PopoverMenuContext.d.ts +0 -1
- package/types/src/RadioBar/RadioBar.d.ts +1 -1
- package/types/src/RadioBar/RadioBarContext.d.ts +0 -1
- package/types/src/RadioList/RadioListContext.d.ts +0 -1
- package/types/src/Scroll/Inner.d.ts +1 -1
- package/types/src/Scroll/docs/examples/Controlled.d.ts +2 -2
- package/types/src/Search/Search.d.ts +2 -2
- package/types/src/Select/SelectBase.d.ts +2 -2
- package/types/src/SidePanel/SidePanel.d.ts +8 -3
- package/types/src/Slider/Slider.d.ts +1 -1
- package/types/src/Slider/docs/examples/Controlled.d.ts +2 -2
- package/types/src/Slider/docs/examples/CustomLabels.d.ts +2 -2
- package/types/src/Slider/getStepMarksBackground.d.ts +8 -0
- package/types/src/SlidingPanels/Panel.d.ts +2 -2
- package/types/src/SlidingPanels/SlidingPanels.d.ts +2 -2
- package/types/src/SlidingPanels/docs/examples/Basic.d.ts +2 -2
- package/types/src/SlidingPanels/docs/examples/Dropdown.d.ts +2 -2
- package/types/src/SplitButton/Item.d.ts +34 -20
- package/types/src/SplitButton/SplitButton.d.ts +4 -1
- package/types/src/StaticContent/StaticContent.d.ts +3 -1
- package/types/src/StepBar/Step.d.ts +1 -1
- package/types/src/StepBar/StepBar.d.ts +1 -1
- package/types/src/StepBar/StepBarContext.d.ts +0 -1
- package/types/src/Switch/Switch.d.ts +1 -9
- package/types/src/Switch/docs/examples/Basic.d.ts +2 -2
- package/types/src/Switch/docs/examples/Disabled.d.ts +2 -2
- package/types/src/TabBar/Tab.d.ts +12 -5
- package/types/src/TabBar/TabBar.d.ts +4 -3
- package/types/src/TabBar/TabBarContext.d.ts +7 -2
- package/types/src/Table/Head.d.ts +4 -15
- package/types/src/Table/HeadCell.d.ts +23 -25
- package/types/src/Table/HeadDropdownCell.d.ts +23 -26
- package/types/src/Table/HeadInner.d.ts +4 -10
- package/types/src/Table/Row.d.ts +6 -6
- package/types/src/Table/Table.d.ts +3 -8
- package/types/src/Table/TableContext.d.ts +0 -1
- package/types/src/Table/Toggle.d.ts +1 -1
- package/types/src/Text/Text.d.ts +5 -1
- package/types/src/Tooltip/Tooltip.d.ts +26 -58
- package/types/src/Tooltip/docs/examples/Controlled.d.ts +2 -2
- package/types/src/TransitionOpen/TransitionOpen.d.ts +6 -1
- package/types/src/Tree/TreeContext.d.ts +0 -1
- package/types/src/useForceUpdate/useForceUpdate.d.ts +0 -1
- package/types/src/useResizeObserver/useResizeObserver.d.ts +2 -1
- package/types/src/utils/types.d.ts +2 -3
- package/useResizeObserver.js +26 -19
- package/types/src/File/Icon.d.ts +0 -3
- package/types/src/File/IconCloud.d.ts +0 -3
- package/types/src/File/PaperClip.d.ts +0 -3
- package/types/src/File/Retry.d.ts +0 -2
- package/types/src/File/Trash.d.ts +0 -3
- package/types/src/FormRows/icons/FormRowsPlusIcon.d.ts +0 -3
- package/types/src/Image/icons/Cross.d.ts +0 -3
- package/types/src/Multiselect/docs/examples/CompactSelectAll.d.ts +0 -3
- package/types/src/Table/docs/examples/prisma/DockedHeaderScrollbar.d.ts +0 -3
- package/types/src/Tooltip/InfoIcon.d.ts +0 -4
|
@@ -24,11 +24,11 @@
|
|
|
24
24
|
/******/ (() => {
|
|
25
25
|
/******/ // define getter functions for harmony exports
|
|
26
26
|
/******/ e.d = (r, t) => {
|
|
27
|
-
/******/ for (var
|
|
28
|
-
/******/ if (e.o(t,
|
|
29
|
-
/******/ Object.defineProperty(r,
|
|
27
|
+
/******/ for (var o in t) {
|
|
28
|
+
/******/ if (e.o(t, o) && !e.o(r, o)) {
|
|
29
|
+
/******/ Object.defineProperty(r, o, {
|
|
30
30
|
enumerable: true,
|
|
31
|
-
get: t[
|
|
31
|
+
get: t[o]
|
|
32
32
|
});
|
|
33
33
|
/******/ }
|
|
34
34
|
/******/ }
|
|
@@ -61,129 +61,41 @@
|
|
|
61
61
|
e.r(r);
|
|
62
62
|
// EXPORTS
|
|
63
63
|
e.d(r, {
|
|
64
|
-
default: () => /* reexport */
|
|
64
|
+
default: () => /* reexport */ i
|
|
65
65
|
});
|
|
66
66
|
// CONCATENATED MODULE: external "react"
|
|
67
67
|
const t = require("react");
|
|
68
|
-
var
|
|
68
|
+
var o = e.n(t);
|
|
69
69
|
// CONCATENATED MODULE: external "prop-types"
|
|
70
|
-
const
|
|
71
|
-
var
|
|
72
|
-
// CONCATENATED MODULE: external "
|
|
73
|
-
const l = require("
|
|
74
|
-
var
|
|
75
|
-
// CONCATENATED MODULE: external "@splunk/react-icons/CheckBox"
|
|
76
|
-
const c = require("@splunk/react-icons/CheckBox");
|
|
77
|
-
var s = e.n(c);
|
|
78
|
-
// CONCATENATED MODULE: external "@splunk/react-icons/CheckBoxCompleted"
|
|
79
|
-
const d = require("@splunk/react-icons/CheckBoxCompleted");
|
|
80
|
-
var u = e.n(d);
|
|
81
|
-
// CONCATENATED MODULE: external "@splunk/react-icons/CheckBoxIndeterminate"
|
|
82
|
-
const v = require("@splunk/react-icons/CheckBoxIndeterminate");
|
|
83
|
-
var p = e.n(v);
|
|
84
|
-
// CONCATENATED MODULE: external "@splunk/themes"
|
|
85
|
-
const b = require("@splunk/themes");
|
|
86
|
-
// CONCATENATED MODULE: ./src/NonInteractiveCheckbox/NonInteractiveCheckboxStyles.ts
|
|
87
|
-
var m = "20px";
|
|
88
|
-
var f = (0, l.css)([ "width:", ";height:", ";" ], m, m);
|
|
89
|
-
var y = (0, l.css)([ "transform:translateY(-2px);clip-path:inset(0% round ", ");" ], b.variables.borderRadius);
|
|
90
|
-
var h = i().div.withConfig({
|
|
91
|
-
displayName: "NonInteractiveCheckboxStyles__StyledCheckBoxWrapper",
|
|
92
|
-
componentId: "sc-1mawanc-0"
|
|
93
|
-
})([ "", " position:relative;flex-shrink:0;max-height:", ";" ], b.mixins.reset("inline-block"), m);
|
|
94
|
-
var C = i()(s()).withConfig({
|
|
95
|
-
displayName: "NonInteractiveCheckboxStyles__StyledCheckboxEmpty",
|
|
96
|
-
componentId: "sc-1mawanc-1"
|
|
97
|
-
})([ "", " ", " color:", ";", "" ], f, y, b.variables.interactiveColorBorder, (function(e) {
|
|
98
|
-
var r = e.$disabled;
|
|
99
|
-
return !!r && (0, l.css)([ "color:", ";" ], b.variables.interactiveColorBorderDisabled);
|
|
100
|
-
}));
|
|
101
|
-
var x = i()(s()).withConfig({
|
|
102
|
-
displayName: "NonInteractiveCheckboxStyles__StyledCheckBoxBackground",
|
|
103
|
-
componentId: "sc-1mawanc-2"
|
|
104
|
-
})([ "", " ", " color:", ";", "" ], f, y, b.variables.interactiveColorAccent, (function(e) {
|
|
105
|
-
var r = e.$disabled;
|
|
106
|
-
return !!r && (0, l.css)([ "color:", ";" ], b.variables.neutral100);
|
|
107
|
-
}));
|
|
108
|
-
var k = i()(u()).withConfig({
|
|
109
|
-
displayName: "NonInteractiveCheckboxStyles__StyledCheckBoxCompleted",
|
|
110
|
-
componentId: "sc-1mawanc-3"
|
|
111
|
-
})([ "", " position:absolute;left:0;top:0;color:", ";", "" ], f, b.variables.contentColorInverted, (function(e) {
|
|
112
|
-
var r = e.$disabled;
|
|
113
|
-
return !!r && (0, l.css)([ "color:", ";" ], b.variables.contentColorDisabled);
|
|
114
|
-
}));
|
|
115
|
-
var w = k.withComponent(p());
|
|
70
|
+
const a = require("prop-types");
|
|
71
|
+
var n = e.n(a);
|
|
72
|
+
// CONCATENATED MODULE: external "@splunk/react-ui/Switch"
|
|
73
|
+
const l = require("@splunk/react-ui/Switch");
|
|
74
|
+
var c = e.n(l);
|
|
116
75
|
// CONCATENATED MODULE: ./src/NonInteractiveCheckbox/NonInteractiveCheckbox.tsx
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
if (Object.getOwnPropertySymbols) {
|
|
121
|
-
var a = Object.getOwnPropertySymbols(e);
|
|
122
|
-
for (n = 0; n < a.length; n++) {
|
|
123
|
-
t = a[n], r.includes(t) || {}.propertyIsEnumerable.call(e, t) && (o[t] = e[t]);
|
|
124
|
-
}
|
|
125
|
-
}
|
|
126
|
-
return o;
|
|
127
|
-
}
|
|
128
|
-
function S(e, r) {
|
|
129
|
-
if (null == e) return {};
|
|
130
|
-
var t = {};
|
|
131
|
-
for (var n in e) {
|
|
132
|
-
if ({}.hasOwnProperty.call(e, n)) {
|
|
133
|
-
if (r.includes(n)) continue;
|
|
134
|
-
t[n] = e[n];
|
|
135
|
-
}
|
|
136
|
-
}
|
|
137
|
-
return t;
|
|
138
|
-
}
|
|
139
|
-
var B = {
|
|
140
|
-
disabled: a().oneOfType([ a().bool, a().oneOf([ "dimmed" ]) ]),
|
|
141
|
-
selected: a().oneOfType([ a().bool, a().oneOf([ "some" ]) ])
|
|
76
|
+
var s = {
|
|
77
|
+
disabled: n().bool,
|
|
78
|
+
selected: n().oneOfType([ n().bool, n().oneOf([ "some" ]) ])
|
|
142
79
|
};
|
|
143
80
|
/**
|
|
144
|
-
* NonInteractiveCheckbox is a private component that
|
|
145
|
-
*
|
|
81
|
+
* NonInteractiveCheckbox is a private component that replaced our internal usage of Switch's interactive={false}
|
|
82
|
+
* for components like Menu.Item, Table.Toggle, etc. (SUI-6757)
|
|
146
83
|
*
|
|
147
|
-
*/ function
|
|
148
|
-
var
|
|
149
|
-
// The SVG icon has built-in internal spacing, creating a slight visual discrepancy compared to the Switch component.
|
|
150
|
-
// Adjusting the viewBox helps align the checkbox icon visually with the Switch for a consistent appearance.
|
|
151
|
-
var l = "3 3 18 18";
|
|
152
|
-
var i = "4 4 16 16";
|
|
153
|
-
var c = (0, t.useCallback)((function() {
|
|
154
|
-
if (o === true) {
|
|
155
|
-
|
|
156
|
-
return n().createElement(n().Fragment, null, n().createElement(x, {
|
|
157
|
-
viewBox: l,
|
|
158
|
-
variant: "filled",
|
|
159
|
-
$disabled: r
|
|
160
|
-
}), n().createElement(k, {
|
|
161
|
-
viewBox: i,
|
|
162
|
-
$disabled: r
|
|
163
|
-
}));
|
|
164
|
-
}
|
|
165
|
-
if (o === "some") {
|
|
166
|
-
|
|
167
|
-
return n().createElement(n().Fragment, null, n().createElement(x, {
|
|
168
|
-
viewBox: l,
|
|
169
|
-
variant: "filled",
|
|
170
|
-
$disabled: r
|
|
171
|
-
}), n().createElement(w, {
|
|
172
|
-
viewBox: i,
|
|
173
|
-
$disabled: r
|
|
174
|
-
}));
|
|
175
|
-
}
|
|
176
|
-
|
|
177
|
-
return n().createElement(C, {
|
|
178
|
-
viewBox: l,
|
|
179
|
-
$disabled: r
|
|
180
|
-
});
|
|
181
|
-
}), [ o, r ]);
|
|
84
|
+
*/ var d = function e(r) {
|
|
85
|
+
var t = r.className, a = r.disabled, n = r.selected;
|
|
182
86
|
|
|
183
|
-
return
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
87
|
+
return o().createElement(c(), {
|
|
88
|
+
appearance: "checkbox",
|
|
89
|
+
className: t,
|
|
90
|
+
"data-test": "non-interactive-checkbox",
|
|
91
|
+
disabled: a,
|
|
92
|
+
role: "presentation",
|
|
93
|
+
selected: n,
|
|
94
|
+
tabIndex: -1
|
|
95
|
+
});
|
|
96
|
+
};
|
|
97
|
+
d.propTypes = s;
|
|
98
|
+
/* harmony default export */ const i = d;
|
|
187
99
|
// CONCATENATED MODULE: ./src/NonInteractiveCheckbox/index.ts
|
|
188
100
|
module.exports = r;
|
|
189
101
|
/******/})();
|
package/Number.js
CHANGED
|
@@ -77,8 +77,8 @@
|
|
|
77
77
|
// CONCATENATED MODULE: external "@splunk/ui-utils/keyboard"
|
|
78
78
|
const c = require("@splunk/ui-utils/keyboard");
|
|
79
79
|
// CONCATENATED MODULE: external "@splunk/react-ui/useControlled"
|
|
80
|
-
const
|
|
81
|
-
var
|
|
80
|
+
const s = require("@splunk/react-ui/useControlled");
|
|
81
|
+
var d = e.n(s);
|
|
82
82
|
// CONCATENATED MODULE: external "@splunk/react-ui/usePrevious"
|
|
83
83
|
const f = require("@splunk/react-ui/usePrevious");
|
|
84
84
|
var v = e.n(f);
|
|
@@ -104,14 +104,14 @@
|
|
|
104
104
|
const x = require("@splunk/themes");
|
|
105
105
|
// CONCATENATED MODULE: ./src/Number/NumberStyles.ts
|
|
106
106
|
var E = "24px";
|
|
107
|
-
var
|
|
107
|
+
var B = m()(C()).withConfig({
|
|
108
108
|
displayName: "NumberStyles__StyledText",
|
|
109
109
|
componentId: "sc-2ekj9s-0"
|
|
110
110
|
})([ "&[data-inline]{width:180px;}", "" ], (function(e) {
|
|
111
111
|
var r = e.$startAdornment;
|
|
112
112
|
return r ? (0, p.css)([ "padding-inline-start:0;" ]) : (0, p.css)([ "padding-inline-end:0;" ]);
|
|
113
113
|
}));
|
|
114
|
-
var
|
|
114
|
+
var D = m().div.withConfig({
|
|
115
115
|
displayName: "NumberStyles__StyledControls",
|
|
116
116
|
componentId: "sc-2ekj9s-1"
|
|
117
117
|
})([ "width:", ";height:100%;", "" ], E, (function(e) {
|
|
@@ -124,27 +124,27 @@
|
|
|
124
124
|
} else {
|
|
125
125
|
a = x.variables.interactiveColorBorder;
|
|
126
126
|
}
|
|
127
|
-
return (0, p.css)([ "", "" ], r ? (0, p.css)([ "border-inline-end:
|
|
128
|
-
p.css)([ "border-inline-start:
|
|
127
|
+
return (0, p.css)([ "", "" ], r ? (0, p.css)([ "border-inline-end:", " solid ", ";" ], x.variables.inputBorderWidth, a) : (0,
|
|
128
|
+
p.css)([ "border-inline-start:", " solid ", ";" ], x.variables.inputBorderWidth, a));
|
|
129
129
|
}));
|
|
130
|
-
var
|
|
131
|
-
var
|
|
130
|
+
var A = (0, p.css)([ "height:12px;width:12px;" ]);
|
|
131
|
+
var N = m()(k()).withConfig({
|
|
132
132
|
displayName: "NumberStyles__StyledChevronDown",
|
|
133
133
|
componentId: "sc-2ekj9s-2"
|
|
134
|
-
})([ "", ";" ],
|
|
135
|
-
var
|
|
134
|
+
})([ "", ";" ], A);
|
|
135
|
+
var P = m()(j()).withConfig({
|
|
136
136
|
displayName: "NumberStyles__StyledChevronUp",
|
|
137
137
|
componentId: "sc-2ekj9s-3"
|
|
138
|
-
})([ "", ";" ],
|
|
139
|
-
var
|
|
140
|
-
var
|
|
138
|
+
})([ "", ";" ], A);
|
|
139
|
+
var T = (0, p.css)([ "display:flex;align-items:center;justify-content:center;font-size:inherit;min-width:0;min-height:0;color:", ";height:calc(50% - 0.5px);width:100%;&:hover:not([disabled]){background-color:", ";}&:active:not([disabled]){background-color:", ";box-shadow:", ";}" ], x.variables.contentColorActive, x.variables.actionColorBackgroundSecondaryHover, x.variables.actionColorBackgroundSecondary, x.variables.focusShadowInset);
|
|
140
|
+
var _ = m()(y()).withConfig({
|
|
141
141
|
displayName: "NumberStyles__StyledDecrementButton",
|
|
142
142
|
componentId: "sc-2ekj9s-4"
|
|
143
|
-
})([ "", ";border-top-left-radius:0;border-top-right-radius:0;" ],
|
|
143
|
+
})([ "", ";border-top-left-radius:0;border-top-right-radius:0;" ], T);
|
|
144
144
|
var I = m()(y()).withConfig({
|
|
145
145
|
displayName: "NumberStyles__StyledIncrementButton",
|
|
146
146
|
componentId: "sc-2ekj9s-5"
|
|
147
|
-
})([ "", ";border-bottom-left-radius:0;border-bottom-right-radius:0;" ],
|
|
147
|
+
})([ "", ";border-bottom-left-radius:0;border-bottom-right-radius:0;" ], T);
|
|
148
148
|
var q = m()(g()).withConfig({
|
|
149
149
|
displayName: "NumberStyles__StyledDivider",
|
|
150
150
|
componentId: "sc-2ekj9s-6"
|
|
@@ -231,7 +231,7 @@
|
|
|
231
231
|
* @param ref - The React callback or object ref. Can be `null` or `undefined`.
|
|
232
232
|
* @param current - The new value of the ref.
|
|
233
233
|
*/
|
|
234
|
-
function
|
|
234
|
+
function W(e, r) {
|
|
235
235
|
if (e) {
|
|
236
236
|
if (typeof e === "function") {
|
|
237
237
|
e(r);
|
|
@@ -244,16 +244,16 @@
|
|
|
244
244
|
}
|
|
245
245
|
}
|
|
246
246
|
// CONCATENATED MODULE: ./src/Number/Number.tsx
|
|
247
|
-
function
|
|
247
|
+
function H(e) {
|
|
248
248
|
"@babel/helpers - typeof";
|
|
249
|
-
return
|
|
249
|
+
return H = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(e) {
|
|
250
250
|
return typeof e;
|
|
251
251
|
} : function(e) {
|
|
252
252
|
return e && "function" == typeof Symbol && e.constructor === Symbol && e !== Symbol.prototype ? "symbol" : typeof e;
|
|
253
|
-
},
|
|
253
|
+
}, H(e);
|
|
254
254
|
}
|
|
255
|
-
function
|
|
256
|
-
return
|
|
255
|
+
function G() {
|
|
256
|
+
return G = Object.assign ? Object.assign.bind() : function(e) {
|
|
257
257
|
for (var r = 1; r < arguments.length; r++) {
|
|
258
258
|
var n = arguments[r];
|
|
259
259
|
for (var t in n) {
|
|
@@ -261,9 +261,9 @@
|
|
|
261
261
|
}
|
|
262
262
|
}
|
|
263
263
|
return e;
|
|
264
|
-
},
|
|
264
|
+
}, G.apply(null, arguments);
|
|
265
265
|
}
|
|
266
|
-
function
|
|
266
|
+
function J(e, r) {
|
|
267
267
|
var n = Object.keys(e);
|
|
268
268
|
if (Object.getOwnPropertySymbols) {
|
|
269
269
|
var t = Object.getOwnPropertySymbols(e);
|
|
@@ -273,18 +273,18 @@
|
|
|
273
273
|
}
|
|
274
274
|
return n;
|
|
275
275
|
}
|
|
276
|
-
function
|
|
276
|
+
function L(e) {
|
|
277
277
|
for (var r = 1; r < arguments.length; r++) {
|
|
278
278
|
var n = null != arguments[r] ? arguments[r] : {};
|
|
279
|
-
r % 2 ?
|
|
280
|
-
|
|
281
|
-
})) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(n)) :
|
|
279
|
+
r % 2 ? J(Object(n), !0).forEach((function(r) {
|
|
280
|
+
Q(e, r, n[r]);
|
|
281
|
+
})) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(n)) : J(Object(n)).forEach((function(r) {
|
|
282
282
|
Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(n, r));
|
|
283
283
|
}));
|
|
284
284
|
}
|
|
285
285
|
return e;
|
|
286
286
|
}
|
|
287
|
-
function
|
|
287
|
+
function Q(e, r, n) {
|
|
288
288
|
return (r = X(r)) in e ? Object.defineProperty(e, r, {
|
|
289
289
|
value: n,
|
|
290
290
|
enumerable: !0,
|
|
@@ -294,14 +294,14 @@
|
|
|
294
294
|
}
|
|
295
295
|
function X(e) {
|
|
296
296
|
var r = Y(e, "string");
|
|
297
|
-
return "symbol" ==
|
|
297
|
+
return "symbol" == H(r) ? r : r + "";
|
|
298
298
|
}
|
|
299
299
|
function Y(e, r) {
|
|
300
|
-
if ("object" !=
|
|
300
|
+
if ("object" != H(e) || !e) return e;
|
|
301
301
|
var n = e[Symbol.toPrimitive];
|
|
302
302
|
if (void 0 !== n) {
|
|
303
303
|
var t = n.call(e, r || "default");
|
|
304
|
-
if ("object" !=
|
|
304
|
+
if ("object" != H(t)) return t;
|
|
305
305
|
throw new TypeError("@@toPrimitive must return a primitive value.");
|
|
306
306
|
}
|
|
307
307
|
return ("string" === r ? String : Number)(e);
|
|
@@ -407,28 +407,29 @@
|
|
|
407
407
|
value: o().number
|
|
408
408
|
};
|
|
409
409
|
function ue(e) {
|
|
410
|
-
var r = e.append, a = e.defaultValue, o = e.describedBy, i = e.disabled,
|
|
410
|
+
var r = e.append, a = e.defaultValue, o = e.describedBy, i = e.disabled, s = e.elementRef, f = e.error, p = e.hideStepButtons, m = e.inline, b = e.inputRef, y = e.locale, h = y === void 0 ? "en-US" : y, g = e.max, S = e.min, C = e.name, w = e.onBlur, k = e.onChange, O = e.onKeyDown, j = e.onKeyUp, x = e.prepend, E = e.roundTo, A = E === void 0 ? 5 : E, T = e.step, $ = T === void 0 ? 1 : T, K = e.endAdornment, H = e.startAdornment, J = e.value, Q = oe(e, [ "append", "defaultValue", "describedBy", "disabled", "elementRef", "error", "hideStepButtons", "inline", "inputRef", "locale", "max", "min", "name", "onBlur", "onChange", "onKeyDown", "onKeyUp", "prepend", "roundTo", "step", "endAdornment", "startAdornment", "value" ]);
|
|
411
411
|
// @docs-props-type NumberPropsBase
|
|
412
|
-
var X =
|
|
412
|
+
var X = d()({
|
|
413
413
|
componentName: "Number",
|
|
414
414
|
/* eslint-disable-next-line prefer-rest-params */
|
|
415
415
|
componentProps: arguments[0]
|
|
416
416
|
});
|
|
417
|
-
var Y = X ?
|
|
417
|
+
var Y = X ? J : a;
|
|
418
418
|
// stringValue stores the current contents of the input text box - it might be out of range, invalid, ...
|
|
419
419
|
var ee = (0, n.useState)(F(Y, h)), re = Z(ee, 2), ne = re[0], te = re[1];
|
|
420
420
|
var ae = (0, n.useState)(Y), ie = Z(ae, 2), le = ie[0], ue = ie[1];
|
|
421
|
-
var ce = v()(
|
|
422
|
-
var
|
|
423
|
-
var
|
|
424
|
-
|
|
425
|
-
|
|
421
|
+
var ce = v()(J);
|
|
422
|
+
var se = (0, n.useRef)(null);
|
|
423
|
+
var de = (0, n.useCallback)((function(e) {
|
|
424
|
+
W(se, e);
|
|
425
|
+
W(b, e);
|
|
426
426
|
}), [ b ]);
|
|
427
427
|
var fe = (0, n.useCallback)((function(e, r) {
|
|
428
428
|
if (r !== le || !X) {
|
|
429
429
|
k === null || k === void 0 ? void 0 : k(e, {
|
|
430
430
|
value: r,
|
|
431
|
-
name: C
|
|
431
|
+
name: C,
|
|
432
|
+
reason: "stepButton"
|
|
432
433
|
});
|
|
433
434
|
}
|
|
434
435
|
if (!X) {
|
|
@@ -442,7 +443,7 @@
|
|
|
442
443
|
locale: h,
|
|
443
444
|
min: S,
|
|
444
445
|
max: g,
|
|
445
|
-
roundTo:
|
|
446
|
+
roundTo: A
|
|
446
447
|
});
|
|
447
448
|
var t;
|
|
448
449
|
// increment appropriate number
|
|
@@ -464,22 +465,22 @@
|
|
|
464
465
|
val: t,
|
|
465
466
|
min: S,
|
|
466
467
|
max: g,
|
|
467
|
-
roundTo:
|
|
468
|
+
roundTo: A
|
|
468
469
|
}));
|
|
469
|
-
}), [ a, fe, h, g, S,
|
|
470
|
+
}), [ a, fe, h, g, S, A, $, ne ]);
|
|
470
471
|
var pe = (0, n.useCallback)((function(e, r) {
|
|
471
472
|
var n = R({
|
|
472
473
|
val: parseFloat(r.value),
|
|
473
474
|
min: S,
|
|
474
475
|
max: g,
|
|
475
|
-
roundTo:
|
|
476
|
+
roundTo: A
|
|
476
477
|
});
|
|
477
478
|
var t = F(n, h);
|
|
478
479
|
te(t);
|
|
479
|
-
w === null || w === void 0 ? void 0 : w(e,
|
|
480
|
+
w === null || w === void 0 ? void 0 : w(e, L(L({}, r), {}, {
|
|
480
481
|
value: t
|
|
481
482
|
}));
|
|
482
|
-
}), [ h, g, S, w,
|
|
483
|
+
}), [ h, g, S, w, A ]);
|
|
483
484
|
var me = (0, n.useCallback)((function(e, r) {
|
|
484
485
|
var n = r.value;
|
|
485
486
|
var t = U({
|
|
@@ -487,19 +488,20 @@
|
|
|
487
488
|
locale: h,
|
|
488
489
|
min: S,
|
|
489
490
|
max: g,
|
|
490
|
-
roundTo:
|
|
491
|
+
roundTo: A
|
|
491
492
|
});
|
|
492
493
|
if (le !== t || !X) {
|
|
493
494
|
k === null || k === void 0 ? void 0 : k(e, {
|
|
494
495
|
value: t,
|
|
495
|
-
name: C
|
|
496
|
+
name: C,
|
|
497
|
+
reason: "input"
|
|
496
498
|
});
|
|
497
499
|
}
|
|
498
500
|
te(n);
|
|
499
501
|
if (!X) {
|
|
500
502
|
ue(t);
|
|
501
503
|
}
|
|
502
|
-
}), [ X, h, g, S, C, k,
|
|
504
|
+
}), [ X, h, g, S, C, k, A, le ]);
|
|
503
505
|
var be = (0, n.useCallback)((function(e) {
|
|
504
506
|
if (!e.metaKey && !e.ctrlKey && !e.altKey && (0, c.addsCharacter)(e.nativeEvent) !== false) {
|
|
505
507
|
// only allow numbers, negative and decimals
|
|
@@ -516,7 +518,7 @@
|
|
|
516
518
|
// if decimal is not allowed or there is already one, prevent input
|
|
517
519
|
if ((0, c.isDecimal)(e.nativeEvent, {
|
|
518
520
|
locale: h
|
|
519
|
-
}) && (
|
|
521
|
+
}) && (A <= 0 || ne.indexOf(M(h)) >= 0)) {
|
|
520
522
|
e.preventDefault();
|
|
521
523
|
}
|
|
522
524
|
}
|
|
@@ -529,21 +531,21 @@
|
|
|
529
531
|
e.preventDefault();
|
|
530
532
|
}
|
|
531
533
|
O === null || O === void 0 ? void 0 : O(e);
|
|
532
|
-
}), [ ve, h, S, O,
|
|
534
|
+
}), [ ve, h, S, O, A, $, ne ]);
|
|
533
535
|
var ye = (0, n.useCallback)((function(e) {
|
|
534
536
|
var r;
|
|
535
|
-
if ((0, c.keycode)(e.nativeEvent) === "enter" && (
|
|
536
|
-
var n =
|
|
537
|
+
if ((0, c.keycode)(e.nativeEvent) === "enter" && (se === null || se === void 0 ? void 0 : (r = se.current) === null || r === void 0 ? void 0 : r.value)) {
|
|
538
|
+
var n = se.current.value;
|
|
537
539
|
var t = R({
|
|
538
540
|
val: parseFloat(n),
|
|
539
541
|
min: S,
|
|
540
542
|
max: g,
|
|
541
|
-
roundTo:
|
|
543
|
+
roundTo: A
|
|
542
544
|
});
|
|
543
545
|
te(F(t, h));
|
|
544
546
|
}
|
|
545
547
|
j === null || j === void 0 ? void 0 : j(e);
|
|
546
|
-
}), [ h, g, S, j,
|
|
548
|
+
}), [ h, g, S, j, A ]);
|
|
547
549
|
var he = (0, n.useCallback)((function(e) {
|
|
548
550
|
ve(e, $);
|
|
549
551
|
}), [ ve, $ ]);
|
|
@@ -555,13 +557,13 @@
|
|
|
555
557
|
}), [ r, x ]);
|
|
556
558
|
(0, n.useEffect)((function() {
|
|
557
559
|
// if value prop passed, keep local valueNumeric up to date with value prop
|
|
558
|
-
if (
|
|
559
|
-
ue(
|
|
560
|
+
if (J || J === 0) {
|
|
561
|
+
ue(J);
|
|
560
562
|
}
|
|
561
|
-
}), [
|
|
563
|
+
}), [ J ]);
|
|
562
564
|
(0, n.useEffect)((function() {
|
|
563
565
|
// This useEffect has multiple dependencies, but we only want to run this code if the `value` prop has changed.
|
|
564
|
-
if (
|
|
566
|
+
if (J !== ce) {
|
|
565
567
|
// on value (number) prop change compare the new value to the number version of stringValue (state)
|
|
566
568
|
// This is because we pass in the number version of stringValue to the onChange handler
|
|
567
569
|
// Thus if these values match we want to ignore the update as that is the current value based on stringValue
|
|
@@ -570,13 +572,13 @@
|
|
|
570
572
|
locale: h,
|
|
571
573
|
min: S,
|
|
572
574
|
max: g,
|
|
573
|
-
roundTo:
|
|
575
|
+
roundTo: A
|
|
574
576
|
});
|
|
575
|
-
if (e !==
|
|
576
|
-
te(F(
|
|
577
|
+
if (e !== J && X) {
|
|
578
|
+
te(F(J, h));
|
|
577
579
|
}
|
|
578
580
|
}
|
|
579
|
-
}), [ X, h, g, S, ce,
|
|
581
|
+
}), [ X, h, g, S, ce, A, J, ne ]);
|
|
580
582
|
var Se = {
|
|
581
583
|
append: r,
|
|
582
584
|
prepend: !r,
|
|
@@ -593,41 +595,41 @@
|
|
|
593
595
|
min: S
|
|
594
596
|
});
|
|
595
597
|
var ke = r && !x;
|
|
596
|
-
var Oe = t().createElement(
|
|
598
|
+
var Oe = t().createElement(D, {
|
|
597
599
|
$isAppend: ke,
|
|
598
600
|
$disabled: i,
|
|
599
601
|
$error: f
|
|
600
|
-
}, t().createElement(I,
|
|
602
|
+
}, t().createElement(I, G({
|
|
601
603
|
"aria-label": (0, u._)("Increment"),
|
|
602
604
|
"data-test": "increment",
|
|
603
605
|
disabled: i || Ce,
|
|
604
606
|
onClick: he
|
|
605
|
-
}, Se), t().createElement(
|
|
607
|
+
}, Se), t().createElement(P, null)), t().createElement(q, {
|
|
606
608
|
$disabled: i,
|
|
607
609
|
$error: f
|
|
608
|
-
}), t().createElement(
|
|
610
|
+
}), t().createElement(_, G({
|
|
609
611
|
"aria-label": (0, u._)("Decrement"),
|
|
610
612
|
"data-test": "decrement",
|
|
611
613
|
disabled: i || we,
|
|
612
614
|
onClick: ge
|
|
613
|
-
}, Se), t().createElement(
|
|
615
|
+
}, Se), t().createElement(N, null)));
|
|
614
616
|
var je = ke && !p && Oe;
|
|
615
617
|
var xe = !ke && !p && Oe;
|
|
616
|
-
var Ee =
|
|
618
|
+
var Ee = H || je;
|
|
617
619
|
|
|
618
|
-
return t().createElement(
|
|
620
|
+
return t().createElement(B, G({
|
|
619
621
|
autoCapitalize: "off",
|
|
620
622
|
autoComplete: "off",
|
|
621
623
|
autoCorrect: "off",
|
|
622
624
|
"data-test": "number",
|
|
623
|
-
elementRef:
|
|
624
|
-
inputRef:
|
|
625
|
+
elementRef: s,
|
|
626
|
+
inputRef: de,
|
|
625
627
|
disabled: i,
|
|
626
628
|
name: C,
|
|
627
629
|
describedBy: o,
|
|
628
630
|
append: r,
|
|
629
631
|
prepend: x
|
|
630
|
-
},
|
|
632
|
+
}, Q, {
|
|
631
633
|
spellCheck: false,
|
|
632
634
|
inline: m,
|
|
633
635
|
onBlur: pe,
|