@tedi-design-system/react 17.2.0-rc.1 → 18.0.0-rc.10
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/bundle-stats.html +1 -1
- package/external/@floating-ui/core/dist/floating-ui.core.cjs.js +1 -1
- package/external/@floating-ui/core/dist/floating-ui.core.es.js +275 -271
- package/external/@floating-ui/dom/dist/floating-ui.dom.cjs.js +1 -1
- package/external/@floating-ui/dom/dist/floating-ui.dom.es.js +189 -188
- package/external/@floating-ui/react/dist/floating-ui.react.cjs.js +1 -1
- package/external/@floating-ui/react/dist/floating-ui.react.es.js +1419 -1538
- package/external/@floating-ui/react/dist/floating-ui.react.utils.cjs.js +1 -1
- package/external/@floating-ui/react/dist/floating-ui.react.utils.es.js +348 -81
- package/external/@floating-ui/react-dom/dist/floating-ui.react-dom.cjs.js +1 -1
- package/external/@floating-ui/react-dom/dist/floating-ui.react-dom.es.js +113 -93
- package/external/@floating-ui/utils/dist/floating-ui.utils.cjs.js +1 -1
- package/external/@floating-ui/utils/dist/floating-ui.utils.dom.cjs.js +1 -1
- package/external/@floating-ui/utils/dist/floating-ui.utils.dom.es.js +97 -97
- package/external/@floating-ui/utils/dist/floating-ui.utils.es.js +66 -68
- package/external/lodash-es/_baseUnset.cjs.js +1 -1
- package/external/lodash-es/_baseUnset.es.js +12 -19
- package/external/tabbable/dist/index.esm.cjs.js +1 -1
- package/external/tabbable/dist/index.esm.es.js +72 -63
- package/index.css +1 -1
- package/package.json +4 -4
- package/src/community/components/form/pickers/calendar/calendar.d.ts +6 -0
- package/src/community/components/form/pickers/datepicker/datepicker.d.ts +6 -0
- package/src/community/components/form/pickers/datetimepicker/datetimepicker.d.ts +6 -0
- package/src/community/components/form/pickers/timepicker/timepicker.d.ts +6 -0
- package/src/community/components/modal/modal-closer.d.ts +6 -0
- package/src/community/components/modal/modal-provider.d.ts +6 -0
- package/src/community/components/modal/modal-trigger.d.ts +6 -0
- package/src/community/components/modal/modal.d.ts +6 -0
- package/src/tedi/components/buttons/button-group/button-group.cjs.js +1 -1
- package/src/tedi/components/buttons/button-group/button-group.es.js +4 -4
- package/src/tedi/components/buttons/collapse/collapse.cjs.js +1 -1
- package/src/tedi/components/buttons/collapse/collapse.d.ts +23 -0
- package/src/tedi/components/buttons/collapse/collapse.es.js +62 -59
- package/src/tedi/components/buttons/collapse/collapse.module.scss.cjs.js +1 -1
- package/src/tedi/components/buttons/collapse/collapse.module.scss.es.js +2 -1
- package/src/tedi/components/content/calendar/calendar-grid.cjs.js +1 -1
- package/src/tedi/components/content/calendar/calendar-grid.es.js +7 -6
- package/src/tedi/components/content/calendar/calendar.cjs.js +1 -1
- package/src/tedi/components/content/calendar/calendar.d.ts +9 -1
- package/src/tedi/components/content/calendar/calendar.es.js +72 -71
- package/src/tedi/components/content/calendar/calendar.module.scss.cjs.js +1 -1
- package/src/tedi/components/content/calendar/calendar.module.scss.es.js +3 -2
- package/src/tedi/components/content/calendar/components/calendar-header/calendar-header.cjs.js +1 -1
- package/src/tedi/components/content/calendar/components/calendar-header/calendar-header.es.js +99 -79
- package/src/tedi/components/content/table/index.d.ts +6 -0
- package/src/tedi/components/content/table/table-columns-menu/table-columns-menu.cjs.js +1 -0
- package/src/tedi/components/content/table/table-columns-menu/table-columns-menu.d.ts +15 -0
- package/src/tedi/components/content/table/table-columns-menu/table-columns-menu.es.js +37 -0
- package/src/tedi/components/content/table/table-context.cjs.js +1 -0
- package/src/tedi/components/content/table/table-context.d.ts +3 -0
- package/src/tedi/components/content/table/table-context.es.js +11 -0
- package/src/tedi/components/content/table/table-header-button/table-header-button.cjs.js +1 -0
- package/src/tedi/components/content/table/table-header-button/table-header-button.d.ts +51 -0
- package/src/tedi/components/content/table/table-header-button/table-header-button.es.js +42 -0
- package/src/tedi/components/content/table/table-header-button/table-header-button.module.scss.cjs.js +1 -0
- package/src/tedi/components/content/table/table-header-button/table-header-button.module.scss.es.js +7 -0
- package/src/tedi/components/content/table/table-toolbar/table-toolbar.cjs.js +1 -0
- package/src/tedi/components/content/table/table-toolbar/table-toolbar.d.ts +21 -0
- package/src/tedi/components/content/table/table-toolbar/table-toolbar.es.js +9 -0
- package/src/tedi/components/content/table/table.cjs.js +1 -0
- package/src/tedi/components/content/table/table.d.ts +519 -0
- package/src/tedi/components/content/table/table.es.js +856 -0
- package/src/tedi/components/content/table/table.module.scss.cjs.js +1 -0
- package/src/tedi/components/content/table/table.module.scss.es.js +54 -0
- package/src/tedi/components/content/table/use-table-persistence.cjs.js +1 -0
- package/src/tedi/components/content/table/use-table-persistence.d.ts +13 -0
- package/src/tedi/components/content/table/use-table-persistence.es.js +53 -0
- package/src/tedi/components/filter/filter/filter-group-context.cjs.js +1 -0
- package/src/tedi/components/filter/filter/filter-group-context.d.ts +8 -0
- package/src/tedi/components/filter/filter/filter-group-context.es.js +5 -0
- package/src/tedi/components/filter/filter/filter-group.cjs.js +1 -0
- package/src/tedi/components/filter/filter/filter-group.d.ts +94 -0
- package/src/tedi/components/filter/filter/filter-group.es.js +64 -0
- package/src/tedi/components/filter/filter/filter.cjs.js +1 -0
- package/src/tedi/components/filter/filter/filter.d.ts +98 -0
- package/src/tedi/components/filter/filter/filter.es.js +236 -0
- package/src/tedi/components/filter/filter/filter.module.scss.cjs.js +1 -0
- package/src/tedi/components/filter/filter/filter.module.scss.es.js +21 -0
- package/src/tedi/components/filter/filter/index.d.ts +3 -0
- package/src/tedi/components/form/date-field/date-field-helpers.cjs.js +1 -0
- package/src/tedi/components/form/date-field/date-field-helpers.d.ts +66 -0
- package/src/tedi/components/form/date-field/date-field-helpers.es.js +28 -0
- package/src/tedi/components/form/date-field/date-field.cjs.js +1 -1
- package/src/tedi/components/form/date-field/date-field.d.ts +22 -0
- package/src/tedi/components/form/date-field/date-field.es.js +248 -212
- package/src/tedi/components/form/date-time-field/date-time-field.cjs.js +1 -0
- package/src/tedi/components/form/date-time-field/date-time-field.d.ts +207 -0
- package/src/tedi/components/form/date-time-field/date-time-field.es.js +376 -0
- package/src/tedi/components/form/date-time-field/date-time-field.module.scss.cjs.js +1 -0
- package/src/tedi/components/form/date-time-field/date-time-field.module.scss.es.js +30 -0
- package/src/tedi/components/form/number-field/number-field.cjs.js +1 -1
- package/src/tedi/components/form/number-field/number-field.d.ts +16 -3
- package/src/tedi/components/form/number-field/number-field.es.js +121 -97
- package/src/tedi/components/form/search/search.cjs.js +1 -1
- package/src/tedi/components/form/search/search.es.js +22 -20
- package/src/tedi/components/form/time-field/time-field.cjs.js +1 -1
- package/src/tedi/components/form/time-field/time-field.d.ts +9 -0
- package/src/tedi/components/form/time-field/time-field.es.js +80 -78
- package/src/tedi/components/layout/mobile-nav/components/mobile-nav-toggle/mobile-nav-toggle.cjs.js +1 -0
- package/src/tedi/components/layout/mobile-nav/components/mobile-nav-toggle/mobile-nav-toggle.d.ts +52 -0
- package/src/tedi/components/layout/mobile-nav/components/mobile-nav-toggle/mobile-nav-toggle.es.js +68 -0
- package/src/tedi/components/layout/mobile-nav/components/mobile-nav-toggle/mobile-nav-toggle.module.scss.cjs.js +1 -0
- package/src/tedi/components/layout/mobile-nav/components/mobile-nav-toggle/mobile-nav-toggle.module.scss.es.js +9 -0
- package/src/tedi/components/layout/mobile-nav/index.d.ts +2 -0
- package/src/tedi/components/layout/mobile-nav/mobile-nav.cjs.js +1 -0
- package/src/tedi/components/layout/mobile-nav/mobile-nav.d.ts +20 -0
- package/src/tedi/components/layout/{sidenav/components/sidenav-mobile/sidenav-mobile.es.js → mobile-nav/mobile-nav.es.js} +21 -20
- package/src/tedi/components/layout/sidenav/index.d.ts +2 -2
- package/src/tedi/components/layout/sidenav/sidenav.cjs.js +1 -1
- package/src/tedi/components/layout/sidenav/sidenav.d.ts +2 -11
- package/src/tedi/components/layout/sidenav/sidenav.es.js +27 -27
- package/src/tedi/components/layout/top-nav/components/top-nav-group/top-nav-group.cjs.js +1 -0
- package/src/tedi/components/layout/top-nav/components/top-nav-group/top-nav-group.d.ts +34 -0
- package/src/tedi/components/layout/top-nav/components/top-nav-group/top-nav-group.es.js +33 -0
- package/src/tedi/components/layout/top-nav/components/top-nav-item/top-nav-item.cjs.js +1 -0
- package/src/tedi/components/layout/top-nav/components/top-nav-item/top-nav-item.d.ts +66 -0
- package/src/tedi/components/layout/top-nav/components/top-nav-item/top-nav-item.es.js +101 -0
- package/src/tedi/components/layout/top-nav/components/top-nav-separator/top-nav-separator.cjs.js +1 -0
- package/src/tedi/components/layout/top-nav/components/top-nav-separator/top-nav-separator.d.ts +11 -0
- package/src/tedi/components/layout/top-nav/components/top-nav-separator/top-nav-separator.es.js +9 -0
- package/src/tedi/components/layout/top-nav/components/top-nav-subitem/top-nav-subitem.cjs.js +1 -0
- package/src/tedi/components/layout/top-nav/components/top-nav-subitem/top-nav-subitem.d.ts +28 -0
- package/src/tedi/components/layout/top-nav/components/top-nav-subitem/top-nav-subitem.es.js +30 -0
- package/src/tedi/components/layout/top-nav/index.d.ts +5 -0
- package/src/tedi/components/layout/top-nav/top-nav-context.cjs.js +1 -0
- package/src/tedi/components/layout/top-nav/top-nav-context.d.ts +11 -0
- package/src/tedi/components/layout/top-nav/top-nav-context.es.js +6 -0
- package/src/tedi/components/layout/top-nav/top-nav.cjs.js +1 -0
- package/src/tedi/components/layout/top-nav/top-nav.d.ts +91 -0
- package/src/tedi/components/layout/top-nav/top-nav.es.js +171 -0
- package/src/tedi/components/layout/top-nav/top-nav.module.scss.cjs.js +1 -0
- package/src/tedi/components/layout/top-nav/top-nav.module.scss.es.js +28 -0
- package/src/tedi/components/navigation/pagination/index.d.ts +1 -0
- package/src/tedi/components/navigation/pagination/pagination-mobile-modal/pagination-mobile-modal.cjs.js +1 -0
- package/src/tedi/components/navigation/pagination/pagination-mobile-modal/pagination-mobile-modal.d.ts +36 -0
- package/src/tedi/components/navigation/pagination/pagination-mobile-modal/pagination-mobile-modal.es.js +65 -0
- package/src/tedi/components/navigation/pagination/pagination-mobile-modal/pagination-mobile-modal.module.scss.cjs.js +1 -0
- package/src/tedi/components/navigation/pagination/pagination-mobile-modal/pagination-mobile-modal.module.scss.es.js +13 -0
- package/src/tedi/components/navigation/pagination/pagination.cjs.js +1 -1
- package/src/tedi/components/navigation/pagination/pagination.d.ts +115 -13
- package/src/tedi/components/navigation/pagination/pagination.es.js +244 -96
- package/src/tedi/components/navigation/pagination/pagination.module.scss.cjs.js +1 -1
- package/src/tedi/components/navigation/pagination/pagination.module.scss.es.js +18 -1
- package/src/tedi/components/notifications/alert/alert.cjs.js +1 -1
- package/src/tedi/components/notifications/alert/alert.d.ts +14 -1
- package/src/tedi/components/notifications/alert/alert.es.js +45 -42
- package/src/tedi/components/notifications/alert/alert.module.scss.cjs.js +1 -1
- package/src/tedi/components/notifications/alert/alert.module.scss.es.js +2 -1
- package/src/tedi/components/overlays/dropdown/dropdown.es.js +0 -3
- package/src/tedi/components/overlays/modal/index.d.ts +8 -0
- package/src/tedi/components/overlays/modal/modal-body/modal-body.cjs.js +1 -0
- package/src/tedi/components/overlays/modal/modal-body/modal-body.d.ts +22 -0
- package/src/tedi/components/overlays/modal/modal-body/modal-body.es.js +21 -0
- package/src/tedi/components/overlays/modal/modal-closer/modal-closer.cjs.js +1 -0
- package/src/tedi/components/overlays/modal/modal-closer/modal-closer.d.ts +15 -0
- package/src/tedi/components/overlays/modal/modal-closer/modal-closer.es.js +16 -0
- package/src/tedi/components/overlays/modal/modal-content/modal-content.cjs.js +1 -0
- package/src/tedi/components/overlays/modal/modal-content/modal-content.d.ts +108 -0
- package/src/tedi/components/overlays/modal/modal-content/modal-content.es.js +81 -0
- package/src/tedi/components/overlays/modal/modal-context.cjs.js +1 -0
- package/src/tedi/components/overlays/modal/modal-context.d.ts +59 -0
- package/src/tedi/components/overlays/modal/modal-context.es.js +15 -0
- package/src/tedi/components/overlays/modal/modal-footer/modal-footer.cjs.js +1 -0
- package/src/tedi/components/overlays/modal/modal-footer/modal-footer.d.ts +22 -0
- package/src/tedi/components/overlays/modal/modal-footer/modal-footer.es.js +25 -0
- package/src/tedi/components/overlays/modal/modal-header/modal-header.cjs.js +1 -0
- package/src/tedi/components/overlays/modal/modal-header/modal-header.d.ts +58 -0
- package/src/tedi/components/overlays/modal/modal-header/modal-header.es.js +25 -0
- package/src/tedi/components/overlays/modal/modal-trigger/modal-trigger.cjs.js +1 -0
- package/src/tedi/components/overlays/modal/modal-trigger/modal-trigger.d.ts +13 -0
- package/src/tedi/components/overlays/modal/modal-trigger/modal-trigger.es.js +14 -0
- package/src/tedi/components/overlays/modal/modal.cjs.js +1 -0
- package/src/tedi/components/overlays/modal/modal.d.ts +68 -0
- package/src/tedi/components/overlays/modal/modal.es.js +76 -0
- package/src/tedi/components/overlays/modal/modal.module.scss.cjs.js +1 -0
- package/src/tedi/components/overlays/modal/modal.module.scss.es.js +37 -0
- package/src/tedi/components/overlays/overlay/overlay-content.cjs.js +1 -1
- package/src/tedi/components/overlays/overlay/overlay-content.es.js +35 -32
- package/src/tedi/components/overlays/tooltip/tooltip.cjs.js +1 -1
- package/src/tedi/components/overlays/tooltip/tooltip.es.js +14 -6
- package/src/tedi/helpers/hooks/use-breakpoint.cjs.js +1 -1
- package/src/tedi/helpers/hooks/use-breakpoint.d.ts +7 -0
- package/src/tedi/helpers/hooks/use-breakpoint.es.js +22 -14
- package/src/tedi/helpers/hooks/use-sidenav-state.d.ts +1 -1
- package/src/tedi/index.d.ts +6 -0
- package/src/tedi/providers/label-provider/label-provider.d.ts +5 -0
- package/src/tedi/providers/label-provider/labels-map.cjs.js +1 -1
- package/src/tedi/providers/label-provider/labels-map.d.ts +174 -6
- package/src/tedi/providers/label-provider/labels-map.es.js +234 -57
- package/tedi.cjs.js +1 -1
- package/tedi.es.js +257 -202
- package/src/tedi/components/layout/sidenav/components/sidenav-mobile/sidenav-mobile.cjs.js +0 -1
- package/src/tedi/components/layout/sidenav/components/sidenav-mobile/sidenav-mobile.d.ts +0 -14
- package/src/tedi/components/layout/sidenav/components/sidenav-toggle/sidenav-toggle.cjs.js +0 -1
- package/src/tedi/components/layout/sidenav/components/sidenav-toggle/sidenav-toggle.d.ts +0 -31
- package/src/tedi/components/layout/sidenav/components/sidenav-toggle/sidenav-toggle.es.js +0 -48
- package/src/tedi/components/layout/sidenav/components/sidenav-toggle/sidenav-toggle.module.scss.cjs.js +0 -1
- package/src/tedi/components/layout/sidenav/components/sidenav-toggle/sidenav-toggle.module.scss.es.js +0 -8
|
@@ -36,18 +36,31 @@ export interface NumberFieldProps extends BreakpointSupport<NumberFieldBreakpoin
|
|
|
36
36
|
*/
|
|
37
37
|
value?: number;
|
|
38
38
|
/**
|
|
39
|
-
* Callback fired when the input value changes.
|
|
39
|
+
* Callback fired when the input value changes. Emits `undefined` when the
|
|
40
|
+
* field is cleared so consumers can distinguish *"user explicitly entered
|
|
41
|
+
* zero"* from *"field is empty"* — important for required-field validation
|
|
42
|
+
* and for fields where `0` is a meaningful selection.
|
|
40
43
|
*/
|
|
41
|
-
onChange?: (value: number) => void;
|
|
44
|
+
onChange?: (value: number | undefined) => void;
|
|
42
45
|
/**
|
|
43
46
|
* Specifies the input mode for the field (e.g., numeric or decimal).
|
|
44
|
-
*
|
|
47
|
+
* Defaults to `'decimal'` when `decimalPlaces > 0` or `decimalSeparator === ','`,
|
|
48
|
+
* otherwise numeric.
|
|
45
49
|
*/
|
|
46
50
|
inputMode?: 'numeric' | 'decimal';
|
|
47
51
|
/**
|
|
48
52
|
* Number of decimal places for rounding calculations.
|
|
49
53
|
*/
|
|
50
54
|
decimalPlaces?: number;
|
|
55
|
+
/**
|
|
56
|
+
* Character used as the decimal separator when displaying the value.
|
|
57
|
+
* Both `.` and `,` are always accepted as input regardless of this setting.
|
|
58
|
+
*
|
|
59
|
+
* Defaults are derived from `<LabelProvider locale>`: `en` → `.`, `et` / `ru`
|
|
60
|
+
* → `,`. Pass the prop explicitly to override the locale-derived default for
|
|
61
|
+
* a single field.
|
|
62
|
+
*/
|
|
63
|
+
decimalSeparator?: '.' | ',';
|
|
51
64
|
/**
|
|
52
65
|
* Minimum allowed value. Disables decrementing below this value and restricts manual input.
|
|
53
66
|
*/
|
|
@@ -1,122 +1,146 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import
|
|
3
|
-
import {
|
|
4
|
-
import { Text as
|
|
5
|
-
import { Button as
|
|
6
|
-
import { FeedbackText as
|
|
7
|
-
import { FormLabel as
|
|
1
|
+
import { jsxs as L, jsx as c } from "react/jsx-runtime";
|
|
2
|
+
import _ from "../../../../../external/classnames/index.es.js";
|
|
3
|
+
import { useCallback as D, useRef as W, useState as S, useEffect as se } from "react";
|
|
4
|
+
import { Text as de } from "../../base/typography/text/text.es.js";
|
|
5
|
+
import { Button as oe } from "../../buttons/button/button.es.js";
|
|
6
|
+
import { FeedbackText as ue } from "../feedback-text/feedback-text.es.js";
|
|
7
|
+
import { FormLabel as ce } from "../form-label/form-label.es.js";
|
|
8
8
|
import n from "./number-field.module.scss.es.js";
|
|
9
|
-
import { useBreakpointProps as
|
|
10
|
-
import { useLabels as
|
|
11
|
-
const
|
|
12
|
-
const { getCurrentBreakpointProps:
|
|
13
|
-
id:
|
|
14
|
-
label:
|
|
15
|
-
hideLabel:
|
|
16
|
-
required:
|
|
17
|
-
className:
|
|
18
|
-
size:
|
|
19
|
-
inputMode:
|
|
20
|
-
decimalPlaces:
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
9
|
+
import { useBreakpointProps as me } from "../../../helpers/hooks/use-breakpoint-props.es.js";
|
|
10
|
+
import { useLabels as fe } from "../../../providers/label-provider/use-labels.es.js";
|
|
11
|
+
const pe = (T) => {
|
|
12
|
+
const { getCurrentBreakpointProps: A } = me(T.defaultServerBreakpoint), { getLabel: w, locale: R } = fe(), G = R === "en" ? "." : ",", {
|
|
13
|
+
id: y,
|
|
14
|
+
label: H,
|
|
15
|
+
hideLabel: J,
|
|
16
|
+
required: E,
|
|
17
|
+
className: U,
|
|
18
|
+
size: B,
|
|
19
|
+
inputMode: K,
|
|
20
|
+
decimalPlaces: f,
|
|
21
|
+
decimalSeparator: I = G,
|
|
22
|
+
min: l,
|
|
23
|
+
max: s,
|
|
24
|
+
step: x = 1,
|
|
25
|
+
defaultValue: O,
|
|
26
|
+
value: o,
|
|
26
27
|
onChange: i,
|
|
27
|
-
suffix:
|
|
28
|
-
fullWidth:
|
|
29
|
-
disabled:
|
|
30
|
-
invalid:
|
|
31
|
-
helper:
|
|
32
|
-
input:
|
|
33
|
-
} =
|
|
34
|
-
() =>
|
|
35
|
-
[
|
|
36
|
-
),
|
|
28
|
+
suffix: h,
|
|
29
|
+
fullWidth: Q = !1,
|
|
30
|
+
disabled: p = !1,
|
|
31
|
+
invalid: F = !1,
|
|
32
|
+
helper: r,
|
|
33
|
+
input: b
|
|
34
|
+
} = A(T), X = K ?? (f && f > 0 || I === "," ? "decimal" : "numeric"), m = D(
|
|
35
|
+
(e) => e === void 0 ? "" : I === "," ? String(e).replace(".", ",") : String(e),
|
|
36
|
+
[I]
|
|
37
|
+
), v = W(null), M = W(!1), [$, g] = S(""), [Y, k] = S(O), [Z, N] = S(() => m(o ?? O)), a = i && typeof o < "u" ? o : Y;
|
|
38
|
+
se(() => {
|
|
39
|
+
!M.current && typeof o < "u" && N(m(o));
|
|
40
|
+
}, [o, m]);
|
|
41
|
+
const z = r ? `${y}-helper` : void 0, P = D(
|
|
37
42
|
(e) => {
|
|
38
|
-
|
|
39
|
-
|
|
43
|
+
if (e === void 0)
|
|
44
|
+
return F || (r == null ? void 0 : r.type) === "error";
|
|
45
|
+
const t = l !== void 0 && e < l, d = s !== void 0 && e > s;
|
|
46
|
+
return F || t || d || (r == null ? void 0 : r.type) === "error";
|
|
40
47
|
},
|
|
41
|
-
[
|
|
42
|
-
),
|
|
43
|
-
const t =
|
|
44
|
-
|
|
45
|
-
|
|
48
|
+
[F, r, s, l]
|
|
49
|
+
), j = (e) => Math.min(s ?? 1 / 0, Math.max(l ?? -1 / 0, e)), ee = (e) => {
|
|
50
|
+
const t = w("numberField.quantityUpdated", e);
|
|
51
|
+
g(t), setTimeout(() => {
|
|
52
|
+
g("");
|
|
46
53
|
}, 5e3);
|
|
47
|
-
},
|
|
48
|
-
let t =
|
|
49
|
-
e === "increment" && (t = t +
|
|
50
|
-
},
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
54
|
+
}, q = (e) => f !== void 0 ? parseFloat(e.toFixed(f)) : e, te = (e) => {
|
|
55
|
+
let t = a ?? 0;
|
|
56
|
+
e === "increment" && (t = t + x), e === "decrement" && (t = t - x), t = j(t), t = q(t), ee(t), i == null || i(t), k(t), N(m(t));
|
|
57
|
+
}, ne = ({ currentTarget: { value: e } }) => {
|
|
58
|
+
if (N(e), e === "") {
|
|
59
|
+
a !== void 0 && (i == null || i(void 0), k(void 0));
|
|
60
|
+
return;
|
|
61
|
+
}
|
|
62
|
+
const t = e.replace(",", ".");
|
|
63
|
+
if (!/^-?(\d+(\.\d*)?|\.\d+)$/.test(t))
|
|
64
|
+
return;
|
|
65
|
+
const d = parseFloat(t);
|
|
66
|
+
if (Number.isNaN(d)) return;
|
|
67
|
+
const u = j(d), V = q(u);
|
|
68
|
+
V !== a && (i == null || i(V), k(V));
|
|
69
|
+
}, ie = () => {
|
|
70
|
+
M.current = !0;
|
|
71
|
+
}, re = () => {
|
|
72
|
+
M.current = !1, N(m(a));
|
|
73
|
+
}, C = (e) => {
|
|
74
|
+
const t = a !== void 0 && (e === "increment" ? s !== void 0 && a >= s : l !== void 0 && a <= l), d = _(n["tedi-number-field__button"], n[`tedi-number-field__button--${e}`], {
|
|
75
|
+
[n["tedi-number-field__button--disabled"]]: t || p
|
|
76
|
+
}), u = w(`numberField.${e}`, x);
|
|
77
|
+
return /* @__PURE__ */ c(
|
|
78
|
+
oe,
|
|
58
79
|
{
|
|
59
|
-
"aria-label":
|
|
60
|
-
onClick: () =>
|
|
61
|
-
disabled: t ||
|
|
80
|
+
"aria-label": u,
|
|
81
|
+
onClick: () => te(e),
|
|
82
|
+
disabled: t || p,
|
|
62
83
|
visualType: "secondary",
|
|
63
|
-
className:
|
|
84
|
+
className: d,
|
|
64
85
|
icon: { name: e === "increment" ? "add" : "remove" },
|
|
65
|
-
size:
|
|
86
|
+
size: B === "small" ? "small" : void 0,
|
|
66
87
|
children: e === "increment" ? "+" : "-"
|
|
67
88
|
}
|
|
68
89
|
);
|
|
69
|
-
},
|
|
70
|
-
const e =
|
|
71
|
-
[n["tedi-number-field__input-wrapper--with-suffix"]]:
|
|
72
|
-
[n["tedi-number-field__input-wrapper--full-width"]]:
|
|
73
|
-
}), t =
|
|
74
|
-
return /* @__PURE__ */
|
|
75
|
-
var
|
|
76
|
-
return (
|
|
90
|
+
}, ae = () => {
|
|
91
|
+
const e = _(n["tedi-number-field__input-wrapper"], {
|
|
92
|
+
[n["tedi-number-field__input-wrapper--with-suffix"]]: h,
|
|
93
|
+
[n["tedi-number-field__input-wrapper--full-width"]]: Q
|
|
94
|
+
}), t = _(n["tedi-number-field__input"], b == null ? void 0 : b.className);
|
|
95
|
+
return /* @__PURE__ */ L("div", { className: e, onClick: () => {
|
|
96
|
+
var u;
|
|
97
|
+
return (u = v == null ? void 0 : v.current) == null ? void 0 : u.focus();
|
|
77
98
|
}, children: [
|
|
78
|
-
/* @__PURE__ */
|
|
99
|
+
/* @__PURE__ */ c(
|
|
79
100
|
"input",
|
|
80
101
|
{
|
|
81
|
-
ref:
|
|
82
|
-
id:
|
|
83
|
-
"
|
|
84
|
-
"aria-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
102
|
+
ref: v,
|
|
103
|
+
id: y,
|
|
104
|
+
role: "spinbutton",
|
|
105
|
+
"aria-valuemin": l,
|
|
106
|
+
"aria-valuemax": s,
|
|
107
|
+
"aria-valuenow": a,
|
|
108
|
+
"aria-describedby": z,
|
|
109
|
+
"aria-invalid": P(a) ? "true" : "false",
|
|
110
|
+
type: "text",
|
|
111
|
+
inputMode: X,
|
|
112
|
+
value: Z,
|
|
113
|
+
required: E,
|
|
114
|
+
disabled: p,
|
|
115
|
+
onChange: ne,
|
|
116
|
+
onFocus: ie,
|
|
117
|
+
onBlur: re,
|
|
94
118
|
className: t,
|
|
95
|
-
...
|
|
119
|
+
...b
|
|
96
120
|
}
|
|
97
121
|
),
|
|
98
|
-
|
|
122
|
+
h && /* @__PURE__ */ c(de, { element: "span", modifiers: "small", color: "tertiary", className: n["tedi-number-field__suffix"], children: h })
|
|
99
123
|
] });
|
|
100
|
-
},
|
|
124
|
+
}, le = _(
|
|
101
125
|
n["tedi-number-field"],
|
|
102
|
-
{ [n["tedi-number-field--invalid"]]:
|
|
103
|
-
{ [n["tedi-number-field--disabled"]]:
|
|
104
|
-
{ [n["tedi-number-field--small"]]:
|
|
105
|
-
|
|
126
|
+
{ [n["tedi-number-field--invalid"]]: P(a) },
|
|
127
|
+
{ [n["tedi-number-field--disabled"]]: p },
|
|
128
|
+
{ [n["tedi-number-field--small"]]: B === "small" },
|
|
129
|
+
U
|
|
106
130
|
);
|
|
107
|
-
return /* @__PURE__ */
|
|
108
|
-
/* @__PURE__ */
|
|
109
|
-
/* @__PURE__ */
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
131
|
+
return /* @__PURE__ */ L("div", { "data-name": "number-field", className: U, children: [
|
|
132
|
+
/* @__PURE__ */ c(ce, { id: y, label: H, required: E, hideLabel: J, size: B }),
|
|
133
|
+
/* @__PURE__ */ L("div", { className: le, children: [
|
|
134
|
+
C("decrement"),
|
|
135
|
+
ae(),
|
|
136
|
+
C("increment")
|
|
113
137
|
] }),
|
|
114
|
-
|
|
115
|
-
|
|
138
|
+
r && /* @__PURE__ */ c(ue, { className: n["tedi-number-field__feedback"], ...r, id: z }),
|
|
139
|
+
$ && /* @__PURE__ */ c("div", { "aria-live": "polite", className: "sr-only", children: $ })
|
|
116
140
|
] });
|
|
117
141
|
};
|
|
118
|
-
|
|
142
|
+
pe.displayName = "NumberField";
|
|
119
143
|
export {
|
|
120
|
-
|
|
121
|
-
|
|
144
|
+
pe as NumberField,
|
|
145
|
+
pe as default
|
|
122
146
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const l=require("react/jsx-runtime"),i=require("../../../../../external/classnames/index.cjs.js"),v=require("react"),L=require("../../buttons/button/button.cjs.js"),N=require("../textfield/textfield.cjs.js"),s=require("./search.module.scss.cjs.js"),w=require("../../../providers/label-provider/use-labels.cjs.js"),u=v.forwardRef(({placeholder:c,isClearable:d=!0,searchIcon:n="search",onSearch:a,onChange:o,button:e,ariaLabel:f,className:h,input:x,...t},_)=>{const{getLabel:r}=w.useLabels(),b=j=>{j.key==="Enter"&&(a==null||a(t.value))},m=()=>{a==null||a(t.value)},p={...t,ref:_,inputClassName:i.default(s.default["tedi-search__input"],e&&s.default["tedi-search__input--has-button"],h),placeholder:c,isClearable:d,onKeyDown:b,onChange:o,input:{...x,role:"searchbox"},...e?{}:{icon:n}},q=c||r("search"),y=f??q;return l.jsxs("div",{className:i.default(s.default["tedi-search__wrapper"]),role:"search","aria-label":y,children:[l.jsx(N.TextField,{...p}),e&&l.jsx(L.Button,{...e,onClick:m,className:i.default(s.default["tedi-search__button"],e.className),"aria-label":e.children?void 0:r("search"),children:e.children??r("search")})]})});u.displayName="Search";exports.Search=u;
|
|
@@ -1,40 +1,42 @@
|
|
|
1
|
-
import { jsxs as
|
|
1
|
+
import { jsxs as w, jsx as c } from "react/jsx-runtime";
|
|
2
2
|
import l from "../../../../../external/classnames/index.es.js";
|
|
3
|
-
import { forwardRef as
|
|
4
|
-
import { Button as
|
|
3
|
+
import { forwardRef as L } from "react";
|
|
4
|
+
import { Button as b } from "../../buttons/button/button.es.js";
|
|
5
5
|
import { TextField as k } from "../textfield/textfield.es.js";
|
|
6
6
|
import a from "./search.module.scss.es.js";
|
|
7
7
|
import { useLabels as C } from "../../../providers/label-provider/use-labels.es.js";
|
|
8
|
-
const
|
|
8
|
+
const j = L(
|
|
9
9
|
({
|
|
10
10
|
placeholder: t,
|
|
11
|
-
isClearable:
|
|
12
|
-
searchIcon:
|
|
11
|
+
isClearable: o = !0,
|
|
12
|
+
searchIcon: m = "search",
|
|
13
13
|
onSearch: s,
|
|
14
14
|
onChange: d,
|
|
15
15
|
button: e,
|
|
16
16
|
ariaLabel: p,
|
|
17
17
|
className: n,
|
|
18
|
+
input: f,
|
|
18
19
|
...r
|
|
19
|
-
},
|
|
20
|
-
const { getLabel: i } = C(),
|
|
21
|
-
|
|
20
|
+
}, h) => {
|
|
21
|
+
const { getLabel: i } = C(), u = (v) => {
|
|
22
|
+
v.key === "Enter" && (s == null || s(r.value));
|
|
22
23
|
}, _ = () => {
|
|
23
24
|
s == null || s(r.value);
|
|
24
|
-
},
|
|
25
|
+
}, x = {
|
|
25
26
|
...r,
|
|
26
|
-
ref:
|
|
27
|
+
ref: h,
|
|
27
28
|
inputClassName: l(a["tedi-search__input"], e && a["tedi-search__input--has-button"], n),
|
|
28
29
|
placeholder: t,
|
|
29
|
-
isClearable:
|
|
30
|
-
onKeyDown:
|
|
30
|
+
isClearable: o,
|
|
31
|
+
onKeyDown: u,
|
|
31
32
|
onChange: d,
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
33
|
+
input: { ...f, role: "searchbox" },
|
|
34
|
+
...e ? {} : { icon: m }
|
|
35
|
+
}, N = t || i("search"), y = p ?? N;
|
|
36
|
+
return /* @__PURE__ */ w("div", { className: l(a["tedi-search__wrapper"]), role: "search", "aria-label": y, children: [
|
|
37
|
+
/* @__PURE__ */ c(k, { ...x }),
|
|
36
38
|
e && /* @__PURE__ */ c(
|
|
37
|
-
|
|
39
|
+
b,
|
|
38
40
|
{
|
|
39
41
|
...e,
|
|
40
42
|
onClick: _,
|
|
@@ -46,7 +48,7 @@ const b = w(
|
|
|
46
48
|
] });
|
|
47
49
|
}
|
|
48
50
|
);
|
|
49
|
-
|
|
51
|
+
j.displayName = "Search";
|
|
50
52
|
export {
|
|
51
|
-
|
|
53
|
+
j as Search
|
|
52
54
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const i=require("react/jsx-runtime"),c=require("../../../../../external/@floating-ui/react/dist/floating-ui.react.cjs.js"),T=require("../../../../../external/classnames/index.cjs.js"),m=require("react"),O=require("../textfield/textfield.cjs.js"),se=require("../time-picker/time-picker.cjs.js"),o=require("./time-field.module.scss.cjs.js"),E=require("./time-field-helpers.cjs.js"),oe=require("../../../../../external/@floating-ui/dom/dist/floating-ui.dom.cjs.js"),q=require("../../../../../external/@floating-ui/react-dom/dist/floating-ui.react-dom.cjs.js"),le=require("../../../helpers/hooks/use-breakpoint-props.cjs.js"),k=require("../../overlays/dropdown/dropdown.cjs.js"),S=b=>{const{getCurrentBreakpointProps:V}=le.useBreakpointProps(b.defaultServerBreakpoint),{id:M,label:z,value:u,defaultValue:A,onChange:v,readOnly:C=!1,disabled:l=!1,required:H,placeholder:K,inputProps:t,stepMinutes:G=1,className:I,availableTimes:d}=b,{useNativePicker:J=!1,timePickerTrigger:P="button",showPicker:a=!0,availableTimesVariant:y="grid-buttons"}=V(b),N=u!==void 0,[L,D]=m.useState(u??A??""),g=N?u:L,[F,_]=m.useState(!1),w=P==="input",r=J,Q=c.useFloating({open:F,onOpenChange:_,placement:w?"bottom-start":"bottom-end",middleware:[q.offset(E.TIMEPICKER_OFFSET),q.flip(),q.shift()],whileElementsMounted:oe.autoUpdate}),{refs:j,context:x,x:W,y:X,strategy:Y}=Q,Z=c.useClick(x),$=c.useDismiss(x),ee=c.useRole(x,{role:"listbox"}),R=a&&w&&!C&&!l&&!r,U=c.useInteractions([...R?[Z]:[],$,ee]),p=e=>{const n=e.trim();N||D(n),v==null||v(n)},te=e=>{var h;const n=e.target.value??"";(h=t==null?void 0:t.onBlur)==null||h.call(t,e);const s=E.normalizeTime(n);s!==null&&s!==n&&p(s)};m.useEffect(()=>{u!==void 0&&D(u)},[u]);const f=m.useRef(null);m.useEffect(()=>{var e;(e=f.current)!=null&&e.inner&&j.setReference(f.current.inner)},[j]);const ie=()=>{var n;const e=(n=f.current)==null?void 0:n.input;if(e){if(typeof e.showPicker=="function"){e.showPicker();return}e.focus()}},ne=()=>_(e=>!e),re=()=>{!a||l||(r?ie():P==="button"&&ne())},B={...t,id:M,label:z,value:g,placeholder:K,readOnly:C||!r&&w,disabled:l||(t==null?void 0:t.disabled),icon:"schedule",isClearable:!0,required:H,onIconClick:re,onChange:p,onBlur:te,className:T.default(o.default["tedi-time-field__textfield"],{[o.default["tedi-time-field__icon--disabled"]]:!a||l},{[o.default["tedi-time-field__textfield--disabled"]]:l||(t==null?void 0:t.disabled)},{[o.default["tedi-time-field--native"]]:r}),input:{...t==null?void 0:t.input,...r&&{type:"time"}}};if(!r&&a&&!l&&y==="dropdown"&&!!(d!=null&&d.length)){const e=d.indexOf(g),n=e>=0?e:0;return i.jsxs(k.Dropdown,{width:"trigger",defaultActiveIndex:n,children:[i.jsx(k.Dropdown.Trigger,{children:i.jsx("div",{className:T.default(o.default["tedi-time-field__container"],I,{[o.default["tedi-time-field__container--native"]]:r}),children:i.jsx(O.TextField,{ref:f,...B})})}),i.jsx(k.Dropdown.Content,{children:d.map((s,h)=>i.jsx(k.Dropdown.Item,{index:h,active:s===g,onClick:()=>p(s),children:s},s))})]})}return i.jsxs(i.Fragment,{children:[i.jsx("div",{className:T.default(o.default["tedi-time-field__container"],I),...R?U.getReferenceProps():{},"aria-haspopup":a?"listbox":void 0,tabIndex:-1,children:i.jsx(O.TextField,{ref:f,"aria-expanded":a?F:void 0,...B})}),!r&&a&&!l&&i.jsx(c.FloatingPortal,{children:F&&i.jsx(c.FloatingFocusManager,{context:x,modal:!1,initialFocus:-1,children:i.jsx("div",{ref:j.setFloating,...U.getFloatingProps({style:{position:Y,top:X??0,left:W??0}}),children:i.jsx(se.TimePicker,{value:g,stepMinutes:G,availableTimes:d,onChange:e=>{p(e),d&&_(!1)},gridVariant:y==="grid-radio"?"radio":"button",className:o.default["tedi-time-field__picker-wrapper"]})})})})]})};S.displayName="TimeField";exports.TimeField=S;
|
|
@@ -56,6 +56,15 @@ export interface TimeFieldProps extends BreakpointSupport<TimeFieldBreakpointPro
|
|
|
56
56
|
* @default false
|
|
57
57
|
*/
|
|
58
58
|
readOnly?: boolean;
|
|
59
|
+
/**
|
|
60
|
+
* Disables the input and the picker. Equivalent of `<DateTimeField disabled>`
|
|
61
|
+
* — added so all three field siblings (`DateField`, `TimeField`,
|
|
62
|
+
* `DateTimeField`) share the same form-control idiom for "this field is
|
|
63
|
+
* fully unavailable". Forwards to the underlying `TextField`'s `disabled`
|
|
64
|
+
* attribute and short-circuits the picker open path.
|
|
65
|
+
* @default false
|
|
66
|
+
*/
|
|
67
|
+
disabled?: boolean;
|
|
59
68
|
/**
|
|
60
69
|
* Marks the input as required.
|
|
61
70
|
*/
|