@tcn/ui 0.2.0 → 0.3.1
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/Color-ASIRERSW-B4GaVKuQ.js +990 -0
- package/dist/Color-ASIRERSW-B4GaVKuQ.js.map +1 -0
- package/dist/WithTooltip-IO6J4KBT-B1oq93K5.js +1485 -0
- package/dist/WithTooltip-IO6J4KBT-B1oq93K5.js.map +1 -0
- package/dist/actions/__docs__/components/gallery.d.ts +8 -0
- package/dist/actions/__docs__/components/gallery.d.ts.map +1 -0
- package/dist/actions/__docs__/components/gallery.js +20 -0
- package/dist/actions/__docs__/components/gallery.js.map +1 -0
- package/dist/actions/__docs__/components/showcase.d.ts +27 -0
- package/dist/actions/__docs__/components/showcase.d.ts.map +1 -0
- package/dist/actions/__docs__/components/showcase.js +15 -0
- package/dist/actions/__docs__/components/showcase.js.map +1 -0
- package/dist/actions/button/base_button/base_button.d.ts +2 -0
- package/dist/actions/button/base_button/base_button.d.ts.map +1 -1
- package/dist/actions/button/base_button/base_button.js +18 -16
- package/dist/actions/button/base_button/base_button.js.map +1 -1
- package/dist/actions/button/button/button.js +6 -6
- package/dist/actions/button/button_group/button_group.js +1 -1
- package/dist/actions/button/select_group/select_group.js +13 -13
- package/dist/actions/button/select_group/single_select_group.js +6 -6
- package/dist/actions/button/slim_button/slim_button.js +2 -2
- package/dist/actions/types.d.ts +2 -0
- package/dist/actions/types.d.ts.map +1 -0
- package/dist/actions/types.js +2 -0
- package/dist/actions/types.js.map +1 -0
- package/dist/divider.module-FptFV0PX.js +5 -0
- package/dist/divider.module-FptFV0PX.js.map +1 -0
- package/dist/feedback/loading/loading.js +12 -12
- package/dist/feedback/loading/loading.js.map +1 -1
- package/dist/feedback/progress/progress_bar.js +1 -1
- package/dist/form/field/common/field_control/field_control.js +8 -8
- package/dist/form/field/common/status_input/status_input.js +6 -6
- package/dist/form/field/field.js +6 -6
- package/dist/form/field/h_field/h_field.js +11 -11
- package/dist/form/field/v_field/v_field.js +10 -10
- package/dist/form/field_set/field_set.js +3 -3
- package/dist/formatter-QJ4M4OGQ-DaIl2Wi_.js +6 -0
- package/dist/formatter-QJ4M4OGQ-DaIl2Wi_.js.map +1 -0
- package/dist/frame.css +1 -0
- package/dist/gallery.css +1 -0
- package/dist/inputs/checkbox/checkbox.js +11 -11
- package/dist/inputs/color_input/color_input.js +1 -1
- package/dist/inputs/color_input/color_input.js.map +1 -1
- package/dist/inputs/color_input/color_picker.js +6 -6
- package/dist/inputs/combo_box/combo_box.js +17 -17
- package/dist/inputs/date_picker/date_picker.js +19 -19
- package/dist/inputs/date_picker/date_picker_body.js +2 -2
- package/dist/inputs/date_picker/date_picker_input.js +20 -20
- package/dist/inputs/date_picker/date_picker_input.js.map +1 -1
- package/dist/inputs/date_picker/date_picker_year_input.js +1 -1
- package/dist/inputs/date_picker/date_picker_year_input.js.map +1 -1
- package/dist/inputs/date_picker/date_picker_year_selector.js +1 -1
- package/dist/inputs/input/input.js +5 -5
- package/dist/inputs/mask_input/key_capture_input.js +8 -8
- package/dist/inputs/mask_input/mask_input.js +5 -5
- package/dist/inputs/multi_combo_box/multi_combo_box.js +17 -17
- package/dist/inputs/multiselect/multiselect.js +14 -14
- package/dist/inputs/multiselect/multiselect_row.js +8 -8
- package/dist/inputs/phone_number_input/phone_number_input.js +12 -12
- package/dist/inputs/radio/radio.js +10 -10
- package/dist/inputs/radio/radio_row.js +3 -3
- package/dist/inputs/select/select.js +15 -15
- package/dist/inputs/slider/slider.js +11 -11
- package/dist/inputs/suggestions/suggestion_list.js +2 -2
- package/dist/inputs/suggestions/suggestion_list.js.map +1 -1
- package/dist/inputs/switch/switch.js +5 -5
- package/dist/inputs/textarea/textarea.js +7 -7
- package/dist/inputs/unit_input/unit_input.js +5 -5
- package/dist/layouts/body/h_body.js +7 -7
- package/dist/layouts/body/v_body.js +6 -6
- package/dist/layouts/column/column.js +17 -17
- package/dist/layouts/divider/divider.js +24 -23
- package/dist/layouts/divider/divider.js.map +1 -1
- package/dist/layouts/footer/footer.js +7 -7
- package/dist/layouts/grid/grid.js +24 -24
- package/dist/layouts/header/header.js +2 -2
- package/dist/layouts/index.d.ts +6 -5
- package/dist/layouts/index.d.ts.map +1 -1
- package/dist/layouts/index.js +28 -26
- package/dist/layouts/index.js.map +1 -1
- package/dist/layouts/list/item.js +2 -2
- package/dist/layouts/list/list.js +7 -7
- package/dist/layouts/list/section_header.js +6 -6
- package/dist/layouts/scaffold/scaffold.d.ts +9 -0
- package/dist/layouts/scaffold/scaffold.d.ts.map +1 -0
- package/dist/layouts/scaffold/scaffold.js +55 -0
- package/dist/layouts/scaffold/scaffold.js.map +1 -0
- package/dist/layouts/sidebar_end/sidebar_end.js +14 -14
- package/dist/layouts/sidebar_start/sidebar_start.js +10 -10
- package/dist/layouts/utility_bar/utility_bar.js +10 -10
- package/dist/modal.css +1 -1
- package/dist/overlay/frame/frame.d.ts.map +1 -1
- package/dist/overlay/frame/frame.js +22 -5
- package/dist/overlay/frame/frame.js.map +1 -1
- package/dist/overlay/index.d.ts +9 -2
- package/dist/overlay/index.d.ts.map +1 -1
- package/dist/overlay/index.js +22 -10
- package/dist/overlay/index.js.map +1 -1
- package/dist/overlay/menu/menu.d.ts +1 -1
- package/dist/overlay/menu/menu.d.ts.map +1 -1
- package/dist/overlay/menu/menu.js +36 -36
- package/dist/overlay/menu/menu.js.map +1 -1
- package/dist/overlay/popper/base/base_popper.d.ts +11 -0
- package/dist/overlay/popper/base/base_popper.d.ts.map +1 -0
- package/dist/overlay/popper/base/base_popper.js +27 -0
- package/dist/overlay/popper/base/base_popper.js.map +1 -0
- package/dist/overlay/popper/base/dismissal_decorator.d.ts +16 -0
- package/dist/overlay/popper/base/dismissal_decorator.d.ts.map +1 -0
- package/dist/overlay/popper/base/dismissal_decorator.js +69 -0
- package/dist/overlay/popper/base/dismissal_decorator.js.map +1 -0
- package/dist/overlay/popper/context_popper.d.ts +11 -0
- package/dist/overlay/popper/context_popper.d.ts.map +1 -0
- package/dist/overlay/popper/context_popper.js +33 -0
- package/dist/overlay/popper/context_popper.js.map +1 -0
- package/dist/overlay/popper/element_popper.d.ts +7 -0
- package/dist/overlay/popper/element_popper.d.ts.map +1 -0
- package/dist/overlay/popper/element_popper.js +33 -0
- package/dist/overlay/popper/element_popper.js.map +1 -0
- package/dist/overlay/popper/hooks/use_context_trigger.d.ts +7 -0
- package/dist/overlay/popper/hooks/use_context_trigger.d.ts.map +1 -0
- package/dist/overlay/popper/hooks/use_context_trigger.js +31 -0
- package/dist/overlay/popper/hooks/use_context_trigger.js.map +1 -0
- package/dist/overlay/popper/hooks/use_hover_trigger.d.ts +6 -0
- package/dist/overlay/popper/hooks/use_hover_trigger.d.ts.map +1 -0
- package/dist/overlay/popper/hooks/use_hover_trigger.js +17 -0
- package/dist/overlay/popper/hooks/use_hover_trigger.js.map +1 -0
- package/dist/overlay/popper/hooks/use_restore_focus.d.ts +2 -0
- package/dist/overlay/popper/hooks/use_restore_focus.d.ts.map +1 -0
- package/dist/overlay/popper/hooks/use_restore_focus.js +18 -0
- package/dist/overlay/popper/hooks/use_restore_focus.js.map +1 -0
- package/dist/overlay/popper/legacy/popper.d.ts.map +1 -0
- package/dist/overlay/popper/{popper.js → legacy/popper.js} +6 -6
- package/dist/overlay/popper/legacy/popper.js.map +1 -0
- package/dist/overlay/popper/preview_popper.d.ts +7 -0
- package/dist/overlay/popper/preview_popper.d.ts.map +1 -0
- package/dist/overlay/popper/preview_popper.js +46 -0
- package/dist/overlay/popper/preview_popper.js.map +1 -0
- package/dist/overlay/portal/portal_platform_context.js +4 -4
- package/dist/overlay/tethered/element_tethered.d.ts +8 -0
- package/dist/overlay/tethered/element_tethered.d.ts.map +1 -0
- package/dist/overlay/tethered/element_tethered.js +33 -0
- package/dist/overlay/tethered/element_tethered.js.map +1 -0
- package/dist/overlay/tethered/hooks/calculate_position.d.ts +19 -0
- package/dist/overlay/tethered/hooks/calculate_position.d.ts.map +1 -0
- package/dist/overlay/tethered/hooks/calculate_position.js +43 -0
- package/dist/overlay/tethered/hooks/calculate_position.js.map +1 -0
- package/dist/overlay/tethered/hooks/useTether.d.ts +19 -0
- package/dist/overlay/tethered/hooks/useTether.d.ts.map +1 -0
- package/dist/overlay/tethered/hooks/useTether.js +61 -0
- package/dist/overlay/tethered/hooks/useTether.js.map +1 -0
- package/dist/overlay/tethered/tethered.d.ts +20 -0
- package/dist/overlay/tethered/tethered.d.ts.map +1 -0
- package/dist/overlay/tethered/tethered.js +59 -0
- package/dist/overlay/tethered/tethered.js.map +1 -0
- package/dist/overlay/tethered/types.d.ts +3 -0
- package/dist/overlay/tethered/types.d.ts.map +1 -0
- package/dist/overlay/tethered/types.js +2 -0
- package/dist/overlay/tethered/types.js.map +1 -0
- package/dist/popper.css +1 -1
- package/dist/scaffold.css +1 -0
- package/dist/showcase-WfP6kBEb.js +58401 -0
- package/dist/showcase-WfP6kBEb.js.map +1 -0
- package/dist/showcase.css +1 -0
- package/dist/stacks/box/box.js +24 -24
- package/dist/stacks/h_collapsible_box.js +3 -3
- package/dist/stacks/h_stack.js +41 -41
- package/dist/stacks/spacer.js +11 -11
- package/dist/stacks/story_components/circle.js +10 -10
- package/dist/stacks/story_components/picture_placeholder.js +9 -9
- package/dist/stacks/story_components/rect.js +7 -7
- package/dist/stacks/story_components/style_box.js +4 -4
- package/dist/stacks/utils/use_is_collapsed.js +6 -6
- package/dist/stacks/v_collapsible_box.js +3 -3
- package/dist/stacks/v_stack.js +42 -42
- package/dist/stacks/z_stack.js +39 -39
- package/dist/surfaces/alert/alert.js +4 -4
- package/dist/surfaces/card/card.d.ts +2 -2
- package/dist/surfaces/card/card.d.ts.map +1 -1
- package/dist/surfaces/card/card.js +7 -7
- package/dist/surfaces/card/card.js.map +1 -1
- package/dist/surfaces/confirm/confirm.js +9 -9
- package/dist/surfaces/drawers/drawer_start/drawer_start.js +2 -2
- package/dist/surfaces/drawers/drawer_top/drawer_top.js +2 -2
- package/dist/surfaces/index.d.ts +2 -0
- package/dist/surfaces/index.d.ts.map +1 -1
- package/dist/surfaces/index.js +22 -18
- package/dist/surfaces/index.js.map +1 -1
- package/dist/surfaces/modal/modal.d.ts +3 -3
- package/dist/surfaces/modal/modal.d.ts.map +1 -1
- package/dist/surfaces/modal/modal.js +14 -14
- package/dist/surfaces/modal/modal.js.map +1 -1
- package/dist/surfaces/page/h_page.js +7 -7
- package/dist/surfaces/page/v_page.js +5 -5
- package/dist/surfaces/panel/h_panel.js +29 -30
- package/dist/surfaces/panel/h_panel.js.map +1 -1
- package/dist/surfaces/panel/v_panel.d.ts +3 -7
- package/dist/surfaces/panel/v_panel.d.ts.map +1 -1
- package/dist/surfaces/panel/v_panel.js +12 -54
- package/dist/surfaces/panel/v_panel.js.map +1 -1
- package/dist/surfaces/pop_confirm/pop_confirm.d.ts +5 -0
- package/dist/surfaces/pop_confirm/pop_confirm.d.ts.map +1 -0
- package/dist/surfaces/pop_confirm/pop_confirm.js +37 -0
- package/dist/surfaces/pop_confirm/pop_confirm.js.map +1 -0
- package/dist/surfaces/popconfirm/pop_confirm.d.ts +5 -0
- package/dist/surfaces/popconfirm/pop_confirm.d.ts.map +1 -0
- package/dist/surfaces/popconfirm/pop_confirm.js +13 -0
- package/dist/surfaces/popconfirm/pop_confirm.js.map +1 -0
- package/dist/surfaces/popover/popover.d.ts +1 -1
- package/dist/surfaces/popover/popover.d.ts.map +1 -1
- package/dist/surfaces/popover/popover.js +1 -1
- package/dist/surfaces/popover/popover.js.map +1 -1
- package/dist/surfaces/tooltip/tooltip.d.ts +10 -0
- package/dist/surfaces/tooltip/tooltip.d.ts.map +1 -0
- package/dist/surfaces/tooltip/tooltip.js +38 -0
- package/dist/surfaces/tooltip/tooltip.js.map +1 -0
- package/dist/surfaces/window/window.d.ts +3 -3
- package/dist/surfaces/window/window.d.ts.map +1 -1
- package/dist/surfaces/window/window.js +15 -13
- package/dist/surfaces/window/window.js.map +1 -1
- package/dist/syntaxhighlighter-IQDEPFLK-BX_eF8__.js +3777 -0
- package/dist/syntaxhighlighter-IQDEPFLK-BX_eF8__.js.map +1 -0
- package/dist/tethered.css +1 -0
- package/dist/themes/themes/ergo/ergo_theme.js +177 -206
- package/dist/themes/themes/ergo/ergo_theme.js.map +1 -1
- package/dist/tokens/badge/badge.js +9 -9
- package/dist/tokens/bubble/bubble.js +8 -8
- package/dist/tokens/chip/chip.js +3 -3
- package/dist/tooltip.css +1 -1
- package/dist/utility_bar.css +1 -1
- package/dist/utils/click_away_listener.d.ts +1 -0
- package/dist/utils/click_away_listener.d.ts.map +1 -1
- package/dist/utils/click_away_listener.js +12 -11
- package/dist/utils/click_away_listener.js.map +1 -1
- package/dist/utils/dnd/draggable/draggable.js +4 -4
- package/dist/utils/dnd/handle.js +8 -8
- package/dist/utils/focus_redirect.js +5 -5
- package/dist/utils/hooks/make_context_hook.js +4 -4
- package/dist/utils/hooks/use_media_query.js +2 -2
- package/dist/utils/hooks/use_media_query.js.map +1 -1
- package/dist/utils/index.d.ts +6 -5
- package/dist/utils/index.d.ts.map +1 -1
- package/dist/utils/index.js +26 -23
- package/dist/utils/index.js.map +1 -1
- package/dist/utils/mouse_leave_region.d.ts +8 -0
- package/dist/utils/mouse_leave_region.d.ts.map +1 -0
- package/dist/utils/mouse_leave_region.js +26 -0
- package/dist/utils/mouse_leave_region.js.map +1 -0
- package/dist/utils/types/dimensions.d.ts +11 -1
- package/dist/utils/types/dimensions.d.ts.map +1 -1
- package/package.json +3 -3
- package/src/actions/__docs__/actions.mdx +131 -0
- package/src/actions/__docs__/actions.stories.tsx +309 -0
- package/src/actions/__docs__/components/gallery.module.css +6 -0
- package/src/actions/__docs__/components/gallery.tsx +28 -0
- package/src/actions/__docs__/components/showcase.module.css +55 -0
- package/src/actions/__docs__/components/showcase.tsx +121 -0
- package/src/actions/button/base_button/base_button.tsx +5 -1
- package/src/actions/types.ts +6 -0
- package/src/inputs/color_input/color_input.tsx +1 -1
- package/src/inputs/date_picker/date_picker_input.tsx +1 -1
- package/src/inputs/date_picker/date_picker_year_input.tsx +1 -1
- package/src/inputs/suggestions/suggestion_list.tsx +1 -1
- package/src/layouts/index.ts +7 -5
- package/src/layouts/scaffold/scaffold.module.css +5 -0
- package/src/layouts/scaffold/scaffold.tsx +60 -0
- package/src/layouts/utility_bar/utility_bar.module.css +0 -3
- package/src/overlay/frame/frame.module.css +5 -0
- package/src/overlay/frame/frame.stories.tsx +1 -1
- package/src/overlay/frame/frame.tsx +19 -3
- package/src/overlay/index.ts +29 -2
- package/src/overlay/menu/menu.tsx +1 -1
- package/src/overlay/popper/__stories__/base_args.ts +75 -0
- package/src/overlay/popper/__stories__/context_popper.stories.tsx +77 -0
- package/src/overlay/popper/__stories__/element_popper.stories.tsx +80 -0
- package/src/overlay/popper/__stories__/preview_popper.stories.tsx +73 -0
- package/src/overlay/popper/base/base_popper.tsx +55 -0
- package/src/overlay/popper/base/dismissal_decorator.tsx +80 -0
- package/src/overlay/popper/context_popper.tsx +43 -0
- package/src/overlay/popper/element_popper.tsx +42 -0
- package/src/overlay/popper/hooks/use_context_trigger.ts +50 -0
- package/src/overlay/popper/hooks/use_hover_trigger.ts +24 -0
- package/src/overlay/popper/hooks/use_restore_focus.ts +16 -0
- package/src/overlay/popper/{popper.stories.tsx → legacy/popper.stories.tsx} +11 -5
- package/src/overlay/popper/{popper.tsx → legacy/popper.tsx} +3 -2
- package/src/overlay/popper/preview_popper.tsx +54 -0
- package/src/overlay/tethered/__stories__/element/element_tethered.stories.tsx +57 -0
- package/src/overlay/tethered/__stories__/element/element_tethered_stories.module.css +14 -0
- package/src/overlay/tethered/__stories__/shared/base_story_config.ts +52 -0
- package/src/overlay/tethered/__stories__/shared/components/sb_point.module.css +20 -0
- package/src/overlay/tethered/__stories__/shared/components/sb_point.tsx +34 -0
- package/src/overlay/tethered/__stories__/shared/components/sb_reference_points.tsx +54 -0
- package/src/overlay/tethered/__stories__/tethered/tethered.stories.tsx +90 -0
- package/src/overlay/tethered/__stories__/tethered/tethered_stories.module.css +25 -0
- package/src/overlay/tethered/element_tethered.tsx +62 -0
- package/src/overlay/tethered/hooks/calculate_position.ts +110 -0
- package/src/overlay/tethered/hooks/useTether.ts +85 -0
- package/src/overlay/tethered/tethered.module.css +8 -0
- package/src/overlay/tethered/tethered.tsx +72 -0
- package/src/overlay/tethered/types.ts +2 -0
- package/src/stacks/h_stack.stories.tsx +2 -2
- package/src/stacks/v_stack.stories.tsx +2 -2
- package/src/surfaces/card/card.stories.tsx +64 -0
- package/src/surfaces/card/card.tsx +4 -4
- package/src/surfaces/card/card_stories.module.css +13 -0
- package/src/surfaces/index.ts +2 -0
- package/src/surfaces/modal/__stories__/modal.stories.tsx +12 -1
- package/src/surfaces/modal/modal.module.css +2 -2
- package/src/surfaces/modal/modal.tsx +14 -12
- package/src/surfaces/panel/__stories__/panel.stories.tsx +1 -1
- package/src/surfaces/panel/v_panel.tsx +8 -53
- package/src/surfaces/pop_confirm/pop_confirm.stories.tsx +70 -0
- package/src/surfaces/pop_confirm/pop_confirm.tsx +30 -0
- package/src/surfaces/popconfirm/pop_confirm.tsx +18 -0
- package/src/surfaces/popover/popover.tsx +1 -1
- package/src/surfaces/tooltip/tooltip.stories.tsx +54 -0
- package/src/surfaces/tooltip/tooltip.tsx +59 -0
- package/src/surfaces/window/window.stories.tsx +15 -1
- package/src/surfaces/window/window.tsx +16 -12
- package/src/themes/themes/ergo/__stories__/components/tone_picker/sb_tone_picker.tsx +7 -9
- package/src/themes/themes/ergo/__stories__/material.stories.tsx +2 -6
- package/src/themes/themes/ergo/__stories__/sb_materials.module.css +29 -21
- package/src/themes/themes/ergo/ergo_theme.css +177 -206
- package/src/utils/click_away_listener.tsx +1 -1
- package/src/utils/index.ts +7 -5
- package/src/utils/mouse_leave_region.tsx +38 -0
- package/src/utils/types/dimensions.ts +13 -1
- package/tsconfig.json +3 -0
- package/dist/overlay/popper/popper.d.ts.map +0 -1
- package/dist/overlay/popper/popper.js.map +0 -1
- package/dist/overlay/tooltip/tooltip.d.ts +0 -7
- package/dist/overlay/tooltip/tooltip.d.ts.map +0 -1
- package/dist/overlay/tooltip/tooltip.js +0 -20
- package/dist/overlay/tooltip/tooltip.js.map +0 -1
- package/dist/panel.module-DwGKncon.js +0 -5
- package/dist/panel.module-DwGKncon.js.map +0 -1
- package/src/overlay/tooltip/tooltip.stories.tsx +0 -22
- package/src/overlay/tooltip/tooltip.tsx +0 -24
- /package/dist/{panel.css → h_panel.css} +0 -0
- /package/dist/overlay/popper/{popper.d.ts → legacy/popper.d.ts} +0 -0
- /package/src/overlay/popper/{popper.module.css → legacy/popper.module.css} +0 -0
- /package/src/{overlay → surfaces}/tooltip/tooltip.module.css +0 -0
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import "../../utils/focus_redirect.js";
|
|
1
|
+
import { jsxs as w, Fragment as D, jsx as S } from "react/jsx-runtime";
|
|
3
2
|
import "../../utils/click_away_listener.js";
|
|
3
|
+
import "../../utils/focus_redirect.js";
|
|
4
4
|
import "../../utils/scroll_away_listener.js";
|
|
5
|
-
import
|
|
6
|
-
import { useForkRef as
|
|
5
|
+
import L, { useRef as s, useState as x } from "react";
|
|
6
|
+
import { useForkRef as N } from "../../utils/hooks/use_fork_ref.js";
|
|
7
7
|
import "../../utils/hooks/use_resize_observer.js";
|
|
8
|
-
import { clsx as
|
|
9
|
-
import { SuggestionList as
|
|
10
|
-
import { Input as
|
|
11
|
-
const ee =
|
|
8
|
+
import { clsx as V } from "clsx";
|
|
9
|
+
import { SuggestionList as z } from "../suggestions/suggestion_list.js";
|
|
10
|
+
import { Input as G } from "../input/input.js";
|
|
11
|
+
const ee = L.forwardRef(function({
|
|
12
12
|
onOptionSelect: a,
|
|
13
13
|
children: C = [],
|
|
14
14
|
onKeyDown: o,
|
|
@@ -21,18 +21,18 @@ const ee = N.forwardRef(function({
|
|
|
21
21
|
onMouseUp: g,
|
|
22
22
|
...i
|
|
23
23
|
}, y) {
|
|
24
|
-
const A = s(!1), d = s(c), n = s(!1), [E, F] = x(null), f = s(null), [h, R] = x(!1), T =
|
|
24
|
+
const A = s(!1), d = s(c), n = s(!1), [E, F] = x(null), f = s(null), [h, R] = x(!1), T = N(y, f);
|
|
25
25
|
function l() {
|
|
26
26
|
R(!0);
|
|
27
27
|
}
|
|
28
28
|
function r() {
|
|
29
29
|
n.current = !1, R(!1);
|
|
30
30
|
}
|
|
31
|
-
function I(e, t,
|
|
31
|
+
function I(e, t, q) {
|
|
32
32
|
n.current = !0;
|
|
33
33
|
const u = f.current;
|
|
34
34
|
requestAnimationFrame(() => {
|
|
35
|
-
u != null && (u.value = e, u.focus(), u.setSelectionRange(t,
|
|
35
|
+
u != null && (u.value = e, u.focus(), u.setSelectionRange(t, q));
|
|
36
36
|
}), i.onChange && i.onChange(e), r();
|
|
37
37
|
}
|
|
38
38
|
function M(e) {
|
|
@@ -53,25 +53,25 @@ const ee = N.forwardRef(function({
|
|
|
53
53
|
function U(e) {
|
|
54
54
|
F(e.currentTarget), A.current = document.activeElement === e.currentTarget, p && p(e);
|
|
55
55
|
}
|
|
56
|
-
function
|
|
56
|
+
function _(e) {
|
|
57
57
|
n.current && (n.current = !1, r()), l(), g && g(e);
|
|
58
58
|
}
|
|
59
|
-
return /* @__PURE__ */ D
|
|
59
|
+
return /* @__PURE__ */ w(D, { children: [
|
|
60
60
|
/* @__PURE__ */ S(
|
|
61
|
-
|
|
61
|
+
G,
|
|
62
62
|
{
|
|
63
63
|
ref: T,
|
|
64
|
-
className:
|
|
64
|
+
className: V(b, "combo-box-input"),
|
|
65
65
|
...i,
|
|
66
66
|
value: c,
|
|
67
67
|
onKeyDown: j,
|
|
68
68
|
onKeyUp: B,
|
|
69
69
|
onMouseDown: U,
|
|
70
|
-
onMouseUp:
|
|
70
|
+
onMouseUp: _
|
|
71
71
|
}
|
|
72
72
|
),
|
|
73
73
|
h && /* @__PURE__ */ S(
|
|
74
|
-
|
|
74
|
+
z,
|
|
75
75
|
{
|
|
76
76
|
anchorElement: E,
|
|
77
77
|
onClose: I,
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import { jsxs as l, jsx as n, Fragment as T } from "react/jsx-runtime";
|
|
2
|
-
import { useSignalValue as y, useSignalValueEffect as
|
|
3
|
-
import "../../utils/focus_redirect.js";
|
|
2
|
+
import { useSignalValue as y, useSignalValueEffect as _ } from "@tcn/state";
|
|
4
3
|
import "../../utils/click_away_listener.js";
|
|
4
|
+
import "../../utils/focus_redirect.js";
|
|
5
5
|
import "../../utils/scroll_away_listener.js";
|
|
6
|
-
import Y, { useState as
|
|
6
|
+
import Y, { useState as B, useRef as L, useLayoutEffect as r } from "react";
|
|
7
7
|
import { useResizeObserver as O } from "../../utils/hooks/use_resize_observer.js";
|
|
8
8
|
import { HStack as U } from "../../stacks/h_stack.js";
|
|
9
|
-
import { Spacer as
|
|
9
|
+
import { Spacer as R } from "../../stacks/spacer.js";
|
|
10
10
|
import { VStack as u } from "../../stacks/v_stack.js";
|
|
11
|
-
import { clsx as
|
|
11
|
+
import { clsx as V } from "clsx";
|
|
12
12
|
import { DatePickerBody as $ } from "./date_picker_body.js";
|
|
13
13
|
import { DatePickerHeader as q } from "./date_picker_header.js";
|
|
14
14
|
import { DatePickerPresenter as E } from "./date_picker_presenter.js";
|
|
@@ -22,22 +22,22 @@ import '../../date_picker.css';const J = "_date-picker_0a0d8e4", K = "_date-pick
|
|
|
22
22
|
min: g = null,
|
|
23
23
|
max: b = null,
|
|
24
24
|
minVisibleTimeInMilliseconds: m,
|
|
25
|
-
maxVisibleTimeInMilliseconds:
|
|
26
|
-
disabledDates:
|
|
25
|
+
maxVisibleTimeInMilliseconds: f,
|
|
26
|
+
disabledDates: p,
|
|
27
27
|
countryCode: D = "en-US",
|
|
28
28
|
renderActions: P,
|
|
29
29
|
onTimeSelected: S,
|
|
30
30
|
timeIntervalInMinutes: d
|
|
31
31
|
}, H) {
|
|
32
|
-
const [F, I] =
|
|
32
|
+
const [F, I] = B(0), M = L(!1), j = O((t, o) => {
|
|
33
33
|
I(o);
|
|
34
|
-
}), [e] =
|
|
34
|
+
}), [e] = B(() => {
|
|
35
35
|
const t = /* @__PURE__ */ new Date(), o = i == null ? t.getFullYear() : i.getFullYear(), c = i == null ? t.getMonth() : i.getMonth();
|
|
36
36
|
return new E(i, o, c, s);
|
|
37
37
|
}), a = y(e.stateBroadcast), z = y(e.valueBroadcast), N = a.error;
|
|
38
|
-
return
|
|
38
|
+
return _((t) => {
|
|
39
39
|
N !== t && x && x(t);
|
|
40
|
-
}, e.errorBroadcast),
|
|
40
|
+
}, e.errorBroadcast), _((t) => {
|
|
41
41
|
M.current ? k && k(t) : M.current = !0;
|
|
42
42
|
}, e.valueBroadcast), r(() => {
|
|
43
43
|
e.initialize();
|
|
@@ -48,12 +48,12 @@ import '../../date_picker.css';const J = "_date-picker_0a0d8e4", K = "_date-pick
|
|
|
48
48
|
}, [e, g]), r(() => {
|
|
49
49
|
e.setMaxDate(b);
|
|
50
50
|
}, [e, b]), r(() => {
|
|
51
|
-
|
|
52
|
-
}, [e,
|
|
51
|
+
p == null ? e.setDisabledDates([]) : e.setDisabledDates(p);
|
|
52
|
+
}, [e, p]), r(() => {
|
|
53
53
|
typeof m == "number" && e.setMinVisibleTime(m);
|
|
54
54
|
}, [e, m]), r(() => {
|
|
55
|
-
typeof
|
|
56
|
-
}, [e,
|
|
55
|
+
typeof f == "number" && e.setMaxVisibleTime(f);
|
|
56
|
+
}, [e, f]), r(() => {
|
|
57
57
|
typeof d == "number" && e.setTimeIntervalInMinutes(d);
|
|
58
58
|
}, [e, d]), r(() => {
|
|
59
59
|
e.selectDate(i);
|
|
@@ -63,7 +63,7 @@ import '../../date_picker.css';const J = "_date-picker_0a0d8e4", K = "_date-pick
|
|
|
63
63
|
ref: H,
|
|
64
64
|
width: "auto",
|
|
65
65
|
height: "auto",
|
|
66
|
-
className:
|
|
66
|
+
className: V(w["date-picker"], "date-picker"),
|
|
67
67
|
tabIndex: 0,
|
|
68
68
|
children: [
|
|
69
69
|
/* @__PURE__ */ l(
|
|
@@ -73,7 +73,7 @@ import '../../date_picker.css';const J = "_date-picker_0a0d8e4", K = "_date-pick
|
|
|
73
73
|
inline: !0,
|
|
74
74
|
height: "auto",
|
|
75
75
|
width: "auto",
|
|
76
|
-
className:
|
|
76
|
+
className: V(w["date-picker-box"], "date-picker-box"),
|
|
77
77
|
"data-is-disabled": h,
|
|
78
78
|
children: [
|
|
79
79
|
/* @__PURE__ */ l(u, { height: "auto", children: [
|
|
@@ -81,12 +81,12 @@ import '../../date_picker.css';const J = "_date-picker_0a0d8e4", K = "_date-pick
|
|
|
81
81
|
/* @__PURE__ */ n($, { countryCode: D, presenter: e })
|
|
82
82
|
] }),
|
|
83
83
|
P && /* @__PURE__ */ n(u, { paddingInline: "8px", children: P(e) }),
|
|
84
|
-
/* @__PURE__ */ n(
|
|
84
|
+
/* @__PURE__ */ n(R, { height: "8px" })
|
|
85
85
|
]
|
|
86
86
|
}
|
|
87
87
|
),
|
|
88
88
|
s && /* @__PURE__ */ l(T, { children: [
|
|
89
|
-
/* @__PURE__ */ n(
|
|
89
|
+
/* @__PURE__ */ n(R, { width: "8px" }),
|
|
90
90
|
/* @__PURE__ */ n(
|
|
91
91
|
G,
|
|
92
92
|
{
|
|
@@ -7,7 +7,7 @@ import { Spacer as c } from "../../stacks/spacer.js";
|
|
|
7
7
|
import { VStack as d } from "../../stacks/v_stack.js";
|
|
8
8
|
import { DatePickerDate as g } from "./date_picker_date.js";
|
|
9
9
|
import { DatePickerDay as k } from "./date_picker_day.js";
|
|
10
|
-
function
|
|
10
|
+
function j({ presenter: o, countryCode: p }) {
|
|
11
11
|
const { visibleDates: i } = n(o.stateBroadcast), a = [];
|
|
12
12
|
for (let t = 0; t < i.length; t += 7)
|
|
13
13
|
a.push(i.slice(t, t + 7));
|
|
@@ -21,6 +21,6 @@ function V({ presenter: o, countryCode: p }) {
|
|
|
21
21
|
] });
|
|
22
22
|
}
|
|
23
23
|
export {
|
|
24
|
-
|
|
24
|
+
j as DatePickerBody
|
|
25
25
|
};
|
|
26
26
|
//# sourceMappingURL=date_picker_body.js.map
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { jsxs as
|
|
1
|
+
import { jsxs as u, Fragment as q, jsx as o } from "react/jsx-runtime";
|
|
2
2
|
import B, { useState as L, useRef as M, useCallback as V, useMemo as W, useLayoutEffect as Z } from "react";
|
|
3
3
|
import { ZStack as G } from "../../stacks/z_stack.js";
|
|
4
|
-
import { Popper as H } from "../../overlay/popper/popper.js";
|
|
5
|
-
import { clsx as
|
|
4
|
+
import { Popper as H } from "../../overlay/popper/legacy/popper.js";
|
|
5
|
+
import { clsx as m } from "clsx";
|
|
6
6
|
import "../../actions/button/base_button/base_button.js";
|
|
7
7
|
import "../../actions/button/button_group/button_group.js";
|
|
8
8
|
import "../../actions/button/slim_button/slim_button.js";
|
|
@@ -10,8 +10,8 @@ import { Button as J } from "../../actions/button/button/button.js";
|
|
|
10
10
|
import "../../actions/button/select_group/select_group.js";
|
|
11
11
|
import "../../actions/button/select_group/single_select_group.js";
|
|
12
12
|
import { DatePicker as Q } from "./date_picker.js";
|
|
13
|
-
import { FocusRedirect as T } from "../../utils/focus_redirect.js";
|
|
14
13
|
import "../../utils/click_away_listener.js";
|
|
14
|
+
import { FocusRedirect as T } from "../../utils/focus_redirect.js";
|
|
15
15
|
import "../../utils/scroll_away_listener.js";
|
|
16
16
|
import "../../utils/hooks/use_resize_observer.js";
|
|
17
17
|
import '../../date_picker_input.css';const U = "_button_f404820", X = "_popover_708f951", f = { button: U, popover: X }, ht = B.forwardRef(
|
|
@@ -33,17 +33,17 @@ import '../../date_picker_input.css';const U = "_button_f404820", X = "_popover_
|
|
|
33
33
|
countryCode: s,
|
|
34
34
|
renderActions: S,
|
|
35
35
|
onTimeSelected: w,
|
|
36
|
-
...
|
|
37
|
-
},
|
|
38
|
-
const [n, a] = L(null),
|
|
36
|
+
..._
|
|
37
|
+
}, b) => {
|
|
38
|
+
const [n, a] = L(null), v = n != null, i = M(null), p = V((t) => t.closest(".suggestion-list") != null, []), C = W(() => {
|
|
39
39
|
const t = {
|
|
40
40
|
year: "numeric",
|
|
41
41
|
month: "short",
|
|
42
42
|
day: "numeric"
|
|
43
43
|
};
|
|
44
44
|
return r && (t.hour = "numeric", t.minute = "2-digit", t.hour12 = !0), new Intl.DateTimeFormat(s, t);
|
|
45
|
-
}, [s, r]),
|
|
46
|
-
function
|
|
45
|
+
}, [s, r]), F = c != null ? C.format(c) : R;
|
|
46
|
+
function P(t) {
|
|
47
47
|
a(t.currentTarget);
|
|
48
48
|
}
|
|
49
49
|
function e() {
|
|
@@ -54,7 +54,7 @@ import '../../date_picker_input.css';const U = "_button_f404820", X = "_popover_
|
|
|
54
54
|
n != null && i.current && i.current.focus();
|
|
55
55
|
});
|
|
56
56
|
}, [n]);
|
|
57
|
-
function
|
|
57
|
+
function O(t) {
|
|
58
58
|
t.key === "Escape" && e();
|
|
59
59
|
}
|
|
60
60
|
function I() {
|
|
@@ -67,20 +67,20 @@ import '../../date_picker_input.css';const U = "_button_f404820", X = "_popover_
|
|
|
67
67
|
function j(t, z, K) {
|
|
68
68
|
w?.(t, z, K), e();
|
|
69
69
|
}
|
|
70
|
-
return /* @__PURE__ */
|
|
70
|
+
return /* @__PURE__ */ u(q, { children: [
|
|
71
71
|
/* @__PURE__ */ o(
|
|
72
72
|
J,
|
|
73
73
|
{
|
|
74
|
-
ref:
|
|
75
|
-
className:
|
|
74
|
+
ref: b,
|
|
75
|
+
className: m(f.button, "select"),
|
|
76
76
|
hAlign: "start",
|
|
77
77
|
disabled: l,
|
|
78
78
|
hierarchy: A,
|
|
79
|
-
onClick:
|
|
79
|
+
onClick: P,
|
|
80
80
|
width: y,
|
|
81
81
|
maxWidth: D,
|
|
82
|
-
...
|
|
83
|
-
children: /* @__PURE__ */ o("span", { className: "ellipsis", children:
|
|
82
|
+
..._,
|
|
83
|
+
children: /* @__PURE__ */ o("span", { className: "ellipsis", children: F })
|
|
84
84
|
}
|
|
85
85
|
),
|
|
86
86
|
/* @__PURE__ */ o(
|
|
@@ -95,16 +95,16 @@ import '../../date_picker_input.css';const U = "_button_f404820", X = "_popover_
|
|
|
95
95
|
horizontalAnchor: "start",
|
|
96
96
|
verticalOrigin: "top",
|
|
97
97
|
horizontalOrigin: "start",
|
|
98
|
-
open:
|
|
98
|
+
open: v,
|
|
99
99
|
isClickAwayException: p,
|
|
100
100
|
isScrollAwayException: p,
|
|
101
101
|
restoreFocus: !0,
|
|
102
|
-
children: /* @__PURE__ */
|
|
102
|
+
children: /* @__PURE__ */ u(
|
|
103
103
|
G,
|
|
104
104
|
{
|
|
105
105
|
padding: "8px",
|
|
106
|
-
className:
|
|
107
|
-
onKeyDown:
|
|
106
|
+
className: m(f.popover, "date-picker-popover"),
|
|
107
|
+
onKeyDown: O,
|
|
108
108
|
children: [
|
|
109
109
|
/* @__PURE__ */ o(
|
|
110
110
|
Q,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"date_picker_input.js","sources":["../../../src/inputs/date_picker/date_picker_input.tsx"],"sourcesContent":["import React, { useCallback, useLayoutEffect, useMemo, useRef, useState } from 'react';\nimport { Hierarchy } from '../../utils/index.js';\nimport { ZStack } from '../../stacks/z_stack.js';\nimport { Popper } from '../../overlay/popper/popper.js';\nimport { clsx } from 'clsx';\nimport { HTMLAttributes } from 'react';\nimport { Button } from '../../actions/index.js';\nimport { DatePicker } from './date_picker.js';\nimport { DatePickerPresenter } from './date_picker_presenter.js';\nimport { FocusRedirect } from '../../utils/index.js';\nimport styles from './date_picker_input.module.css';\n\nexport interface DatePickerInputProps\n extends Omit<HTMLAttributes<HTMLButtonElement>, 'onChange' | 'onError'> {\n value?: Date | null;\n disabled?: boolean;\n onChange?: (date: Date | null) => void;\n onError?: (error: string | null) => void;\n width?: string;\n maxWidth?: string;\n minWidth?: string;\n showTime?: boolean;\n timeIntervalInMinutes?: number;\n disabledDates?: Date[] | undefined;\n countryCode?: string;\n renderActions?: (datePickerPresenter: DatePickerPresenter) => React.ReactNode;\n min?: Date;\n max?: Date;\n hierarchy?: Hierarchy;\n selectDateMessage?: string;\n onTimeSelected?: (hour: number, minutes: number, seconds: number) => void;\n}\n\nexport const DatePickerInput = React.forwardRef<HTMLButtonElement, DatePickerInputProps>(\n (\n {\n value = new Date(),\n onChange,\n onError,\n min = new Date('01/01/1924'),\n max = new Date('01/01/2124'),\n disabled,\n width = '100%',\n maxWidth,\n minWidth,\n showTime = false,\n timeIntervalInMinutes = 15,\n hierarchy = 'secondary',\n disabledDates,\n selectDateMessage = 'Select Date',\n countryCode,\n renderActions,\n onTimeSelected,\n ...props\n }: DatePickerInputProps,\n ref: React.Ref<HTMLButtonElement>\n ) => {\n const [anchorElement, setAnchorElement] = useState<HTMLButtonElement | null>(null);\n const isOpen = anchorElement != null;\n const pickerRef = useRef<HTMLDivElement | null>(null);\n\n const isException = useCallback((target: HTMLElement) => {\n return target.closest('.suggestion-list') != null;\n }, []);\n\n const formatter = useMemo(() => {\n const formatOptions: Intl.DateTimeFormatOptions = {\n year: 'numeric',\n month: 'short',\n day: 'numeric',\n };\n\n if (showTime) {\n formatOptions.hour = 'numeric';\n formatOptions.minute = '2-digit';\n formatOptions.hour12 = true;\n }\n\n return new Intl.DateTimeFormat(countryCode, formatOptions);\n }, [countryCode, showTime]);\n\n const formattedDate = value != null ? formatter.format(value) : selectDateMessage;\n\n function openPicker(e: React.MouseEvent<HTMLButtonElement>) {\n setAnchorElement(e.currentTarget);\n }\n\n function closePicker() {\n setAnchorElement(null);\n }\n\n useLayoutEffect(() => {\n requestAnimationFrame(() => {\n if (anchorElement != null) {\n pickerRef.current && pickerRef.current.focus();\n }\n });\n }, [anchorElement]);\n\n function processKeyInput(event: React.KeyboardEvent) {\n if (event.key === 'Escape') {\n closePicker();\n }\n }\n\n function handleRedirect() {\n const picker = pickerRef.current;\n\n if (picker != null) {\n picker.focus();\n }\n }\n\n function dateSelected(date: Date | null) {\n onChange?.(date);\n !showTime && closePicker();\n }\n\n function timeSelected(hour: number, minutes: number, seconds: number) {\n onTimeSelected?.(hour, minutes, seconds);\n closePicker();\n }\n\n return (\n <>\n <Button\n ref={ref}\n className={clsx(styles.button, 'select')}\n hAlign=\"start\"\n disabled={disabled}\n hierarchy={hierarchy}\n onClick={openPicker}\n width={width}\n maxWidth={maxWidth}\n {...props}\n >\n <span className=\"ellipsis\">{formattedDate}</span>\n </Button>\n <Popper\n anchorElement={anchorElement}\n disableClickAway\n veil\n onVeilClick={closePicker}\n onClose={closePicker}\n verticalAnchor=\"bottom\"\n horizontalAnchor=\"start\"\n verticalOrigin=\"top\"\n horizontalOrigin=\"start\"\n open={isOpen}\n isClickAwayException={isException}\n isScrollAwayException={isException}\n restoreFocus\n >\n <ZStack\n padding=\"8px\"\n className={clsx(styles.popover, 'date-picker-popover')}\n onKeyDown={processKeyInput}\n >\n <DatePicker\n ref={pickerRef}\n value={value}\n onChange={dateSelected}\n min={min}\n max={max}\n showTime={showTime}\n onError={onError}\n disabled={disabled}\n disabledDates={disabledDates}\n countryCode={countryCode}\n renderActions={renderActions}\n onTimeSelected={timeSelected}\n timeIntervalInMinutes={timeIntervalInMinutes}\n />\n <FocusRedirect onRedirect={handleRedirect} />\n </ZStack>\n </Popper>\n </>\n );\n }\n);\n"],"names":["DatePickerInput","React","value","onChange","onError","min","max","disabled","width","maxWidth","minWidth","showTime","timeIntervalInMinutes","hierarchy","disabledDates","selectDateMessage","countryCode","renderActions","onTimeSelected","props","ref","anchorElement","setAnchorElement","useState","isOpen","pickerRef","useRef","isException","useCallback","target","formatter","useMemo","formatOptions","formattedDate","openPicker","e","closePicker","useLayoutEffect","processKeyInput","event","handleRedirect","picker","dateSelected","date","timeSelected","hour","minutes","seconds","jsxs","Fragment","jsx","Button","clsx","styles","Popper","ZStack","DatePicker","FocusRedirect"],"mappings":";;;;;;;;;;;;;;;;oFAiCaA,KAAkBC,EAAM;AAAA,EACnC,CACE;AAAA,IACE,OAAAC,wBAAY,KAAA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AY;AAAA,kBAACM;AAAA,kBAAA;AAAA,oBACC,KAAK/B;AAAA,oBACL,OAAAvB;AAAA,oBACA,UAAUwC;AAAA,oBACV,KAAArC;AAAA,oBACA,KAAAC;AAAA,oBACA,UAAAK;AAAA,oBACA,SAAAP;AAAA,oBACA,UAAAG;AAAA,oBACA,eAAAO;AAAA,oBACA,aAAAE;AAAA,oBACA,eAAAC;AAAA,oBACA,gBAAgB2B;AAAA,oBAChB,uBAAAhC;AAAA,kBAAA;AAAA,gBAAA;AAAA,gBAEF,gBAAAsC,EAACO,GAAA,EAAc,YAAYjB,EAAA,CAAgB;AAAA,cAAA;AAAA,YAAA;AAAA,UAAA;AAAA,QAC7C;AAAA,MAAA;AAAA,IACF,GACF;AAAA,EAEJ;AACF;"}
|
|
1
|
+
{"version":3,"file":"date_picker_input.js","sources":["../../../src/inputs/date_picker/date_picker_input.tsx"],"sourcesContent":["import React, { useCallback, useLayoutEffect, useMemo, useRef, useState } from 'react';\nimport { Hierarchy } from '../../utils/index.js';\nimport { ZStack } from '../../stacks/z_stack.js';\nimport { Popper } from '../../overlay/popper/legacy/popper.js';\nimport { clsx } from 'clsx';\nimport { HTMLAttributes } from 'react';\nimport { Button } from '../../actions/index.js';\nimport { DatePicker } from './date_picker.js';\nimport { DatePickerPresenter } from './date_picker_presenter.js';\nimport { FocusRedirect } from '../../utils/index.js';\nimport styles from './date_picker_input.module.css';\n\nexport interface DatePickerInputProps\n extends Omit<HTMLAttributes<HTMLButtonElement>, 'onChange' | 'onError'> {\n value?: Date | null;\n disabled?: boolean;\n onChange?: (date: Date | null) => void;\n onError?: (error: string | null) => void;\n width?: string;\n maxWidth?: string;\n minWidth?: string;\n showTime?: boolean;\n timeIntervalInMinutes?: number;\n disabledDates?: Date[] | undefined;\n countryCode?: string;\n renderActions?: (datePickerPresenter: DatePickerPresenter) => React.ReactNode;\n min?: Date;\n max?: Date;\n hierarchy?: Hierarchy;\n selectDateMessage?: string;\n onTimeSelected?: (hour: number, minutes: number, seconds: number) => void;\n}\n\nexport const DatePickerInput = React.forwardRef<HTMLButtonElement, DatePickerInputProps>(\n (\n {\n value = new Date(),\n onChange,\n onError,\n min = new Date('01/01/1924'),\n max = new Date('01/01/2124'),\n disabled,\n width = '100%',\n maxWidth,\n minWidth,\n showTime = false,\n timeIntervalInMinutes = 15,\n hierarchy = 'secondary',\n disabledDates,\n selectDateMessage = 'Select Date',\n countryCode,\n renderActions,\n onTimeSelected,\n ...props\n }: DatePickerInputProps,\n ref: React.Ref<HTMLButtonElement>\n ) => {\n const [anchorElement, setAnchorElement] = useState<HTMLButtonElement | null>(null);\n const isOpen = anchorElement != null;\n const pickerRef = useRef<HTMLDivElement | null>(null);\n\n const isException = useCallback((target: HTMLElement) => {\n return target.closest('.suggestion-list') != null;\n }, []);\n\n const formatter = useMemo(() => {\n const formatOptions: Intl.DateTimeFormatOptions = {\n year: 'numeric',\n month: 'short',\n day: 'numeric',\n };\n\n if (showTime) {\n formatOptions.hour = 'numeric';\n formatOptions.minute = '2-digit';\n formatOptions.hour12 = true;\n }\n\n return new Intl.DateTimeFormat(countryCode, formatOptions);\n }, [countryCode, showTime]);\n\n const formattedDate = value != null ? formatter.format(value) : selectDateMessage;\n\n function openPicker(e: React.MouseEvent<HTMLButtonElement>) {\n setAnchorElement(e.currentTarget);\n }\n\n function closePicker() {\n setAnchorElement(null);\n }\n\n useLayoutEffect(() => {\n requestAnimationFrame(() => {\n if (anchorElement != null) {\n pickerRef.current && pickerRef.current.focus();\n }\n });\n }, [anchorElement]);\n\n function processKeyInput(event: React.KeyboardEvent) {\n if (event.key === 'Escape') {\n closePicker();\n }\n }\n\n function handleRedirect() {\n const picker = pickerRef.current;\n\n if (picker != null) {\n picker.focus();\n }\n }\n\n function dateSelected(date: Date | null) {\n onChange?.(date);\n !showTime && closePicker();\n }\n\n function timeSelected(hour: number, minutes: number, seconds: number) {\n onTimeSelected?.(hour, minutes, seconds);\n closePicker();\n }\n\n return (\n <>\n <Button\n ref={ref}\n className={clsx(styles.button, 'select')}\n hAlign=\"start\"\n disabled={disabled}\n hierarchy={hierarchy}\n onClick={openPicker}\n width={width}\n maxWidth={maxWidth}\n {...props}\n >\n <span className=\"ellipsis\">{formattedDate}</span>\n </Button>\n <Popper\n anchorElement={anchorElement}\n disableClickAway\n veil\n onVeilClick={closePicker}\n onClose={closePicker}\n verticalAnchor=\"bottom\"\n horizontalAnchor=\"start\"\n verticalOrigin=\"top\"\n horizontalOrigin=\"start\"\n open={isOpen}\n isClickAwayException={isException}\n isScrollAwayException={isException}\n restoreFocus\n >\n <ZStack\n padding=\"8px\"\n className={clsx(styles.popover, 'date-picker-popover')}\n onKeyDown={processKeyInput}\n >\n <DatePicker\n ref={pickerRef}\n value={value}\n onChange={dateSelected}\n min={min}\n max={max}\n showTime={showTime}\n onError={onError}\n disabled={disabled}\n disabledDates={disabledDates}\n countryCode={countryCode}\n renderActions={renderActions}\n onTimeSelected={timeSelected}\n timeIntervalInMinutes={timeIntervalInMinutes}\n />\n <FocusRedirect onRedirect={handleRedirect} />\n </ZStack>\n </Popper>\n </>\n );\n }\n);\n"],"names":["DatePickerInput","React","value","onChange","onError","min","max","disabled","width","maxWidth","minWidth","showTime","timeIntervalInMinutes","hierarchy","disabledDates","selectDateMessage","countryCode","renderActions","onTimeSelected","props","ref","anchorElement","setAnchorElement","useState","isOpen","pickerRef","useRef","isException","useCallback","target","formatter","useMemo","formatOptions","formattedDate","openPicker","e","closePicker","useLayoutEffect","processKeyInput","event","handleRedirect","picker","dateSelected","date","timeSelected","hour","minutes","seconds","jsxs","Fragment","jsx","Button","clsx","styles","Popper","ZStack","DatePicker","FocusRedirect"],"mappings":";;;;;;;;;;;;;;;;oFAiCaA,KAAkBC,EAAM;AAAA,EACnC,CACE;AAAA,IACE,OAAAC,wBAAY,KAAA;AAAA,IACZ,UAAAC;AAAA,IACA,SAAAC;AAAA,IACA,KAAAC,IAAM,oBAAI,KAAK,YAAY;AAAA,IAC3B,KAAAC,IAAM,oBAAI,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,oBACA,KAAAC;AAAA,oBACA,UAAAK;AAAA,oBACA,SAAAP;AAAA,oBACA,UAAAG;AAAA,oBACA,eAAAO;AAAA,oBACA,aAAAE;AAAA,oBACA,eAAAC;AAAA,oBACA,gBAAgB2B;AAAA,oBAChB,uBAAAhC;AAAA,kBAAA;AAAA,gBAAA;AAAA,gBAEF,gBAAAsC,EAACO,GAAA,EAAc,YAAYjB,EAAA,CAAgB;AAAA,cAAA;AAAA,YAAA;AAAA,UAAA;AAAA,QAC7C;AAAA,MAAA;AAAA,IACF,GACF;AAAA,EAEJ;AACF;"}
|
|
@@ -7,7 +7,7 @@ import "../../actions/button/select_group/select_group.js";
|
|
|
7
7
|
import "../../actions/button/select_group/single_select_group.js";
|
|
8
8
|
import { clsx as d } from "clsx";
|
|
9
9
|
import { useState as n } from "react";
|
|
10
|
-
import { Popper as y } from "../../overlay/popper/popper.js";
|
|
10
|
+
import { Popper as y } from "../../overlay/popper/legacy/popper.js";
|
|
11
11
|
import { DatePickerYearSelector as g } from "./date_picker_year_selector.js";
|
|
12
12
|
import { useSignalValue as b } from "@tcn/state";
|
|
13
13
|
import '../../date_picker_year_input.css';const k = "_year-select_eb568a7", s = { "year-select": k };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"date_picker_year_input.js","sources":["../../../src/inputs/date_picker/date_picker_year_input.tsx"],"sourcesContent":["import { Button } from '../../actions/index.js';\nimport { clsx } from 'clsx';\nimport styles from './date_picker_year_input.module.css';\nimport { useState } from 'react';\nimport { Popper } from '../../overlay/popper/popper.js';\nimport { DatePickerPresenter } from './date_picker_presenter.js';\nimport { DatePickerYearSelector } from './date_picker_year_selector.js';\nimport { useSignalValue } from '@tcn/state';\n\nexport interface DatePickerYearInputProps {\n presenter: DatePickerPresenter;\n}\n\nexport function DatePickerYearInput({ presenter }: DatePickerYearInputProps) {\n const { visibleYear } = useSignalValue(presenter.stateBroadcast);\n const [buttonRef, setButtonRef] = useState<HTMLButtonElement | null>(null);\n const [isOpen, setIsOpen] = useState(false);\n\n function close() {\n setIsOpen(false);\n }\n\n function open(event: React.MouseEvent<HTMLButtonElement>) {\n setButtonRef(event.currentTarget);\n setIsOpen(true);\n }\n\n return (\n <>\n <Button\n hierarchy=\"tertiary\"\n className={clsx('date-picker-year-select', styles['year-select'])}\n width=\"auto\"\n hAlign=\"start\"\n onClick={open}\n >\n <span className={styles.selectedLabel}>{visibleYear}</span>\n </Button>\n <Popper\n anchorElement={buttonRef}\n horizontalAnchor=\"center\"\n horizontalOrigin=\"center\"\n onClose={close}\n open={isOpen}\n restoreFocus\n >\n <DatePickerYearSelector presenter={presenter} onClose={close} />\n </Popper>\n </>\n );\n}\n"],"names":["DatePickerYearInput","presenter","visibleYear","useSignalValue","buttonRef","setButtonRef","useState","isOpen","setIsOpen","close","open","event","jsxs","Fragment","jsx","Button","clsx","styles","Popper","DatePickerYearSelector"],"mappings":";;;;;;;;;;;;;AAaO,SAASA,EAAoB,EAAE,WAAAC,KAAuC;AAC3E,QAAM,EAAE,aAAAC,EAAA,IAAgBC,EAAeF,EAAU,cAAc,GACzD,CAACG,GAAWC,CAAY,IAAIC,EAAmC,IAAI,GACnE,CAACC,GAAQC,CAAS,IAAIF,EAAS,EAAK;AAE1C,WAASG,IAAQ;AACf,IAAAD,EAAU,EAAK;AAAA,EACjB;AAEA,WAASE,EAAKC,GAA4C;AACxD,IAAAN,EAAaM,EAAM,aAAa,GAChCH,EAAU,EAAI;AAAA,EAChB;AAEA,SACE,gBAAAI,EAAAC,GAAA,EACE,UAAA;AAAA,IAAA,gBAAAC;AAAA,MAACC;AAAA,MAAA;AAAA,QACC,WAAU;AAAA,QACV,WAAWC,EAAK,2BAA2BC,EAAO,aAAa,CAAC;AAAA,QAChE,OAAM;AAAA,QACN,QAAO;AAAA,QACP,SAASP;AAAA,QAET,UAAA,gBAAAI,EAAC,QAAA,EAAK,WAAWG,EAAO,eAAgB,UAAAf,EAAA,CAAY;AAAA,MAAA;AAAA,IAAA;AAAA,IAEtD,gBAAAY;AAAA,MAACI;AAAA,MAAA;AAAA,QACC,eAAed;AAAA,QACf,kBAAiB;AAAA,QACjB,kBAAiB;AAAA,QACjB,SAASK;AAAA,QACT,MAAMF;AAAA,QACN,cAAY;AAAA,QAEZ,UAAA,gBAAAO,EAACK,GAAA,EAAuB,WAAAlB,GAAsB,SAASQ,EAAA,CAAO;AAAA,MAAA;AAAA,IAAA;AAAA,EAChE,GACF;AAEJ;"}
|
|
1
|
+
{"version":3,"file":"date_picker_year_input.js","sources":["../../../src/inputs/date_picker/date_picker_year_input.tsx"],"sourcesContent":["import { Button } from '../../actions/index.js';\nimport { clsx } from 'clsx';\nimport styles from './date_picker_year_input.module.css';\nimport { useState } from 'react';\nimport { Popper } from '../../overlay/popper/legacy/popper.js';\nimport { DatePickerPresenter } from './date_picker_presenter.js';\nimport { DatePickerYearSelector } from './date_picker_year_selector.js';\nimport { useSignalValue } from '@tcn/state';\n\nexport interface DatePickerYearInputProps {\n presenter: DatePickerPresenter;\n}\n\nexport function DatePickerYearInput({ presenter }: DatePickerYearInputProps) {\n const { visibleYear } = useSignalValue(presenter.stateBroadcast);\n const [buttonRef, setButtonRef] = useState<HTMLButtonElement | null>(null);\n const [isOpen, setIsOpen] = useState(false);\n\n function close() {\n setIsOpen(false);\n }\n\n function open(event: React.MouseEvent<HTMLButtonElement>) {\n setButtonRef(event.currentTarget);\n setIsOpen(true);\n }\n\n return (\n <>\n <Button\n hierarchy=\"tertiary\"\n className={clsx('date-picker-year-select', styles['year-select'])}\n width=\"auto\"\n hAlign=\"start\"\n onClick={open}\n >\n <span className={styles.selectedLabel}>{visibleYear}</span>\n </Button>\n <Popper\n anchorElement={buttonRef}\n horizontalAnchor=\"center\"\n horizontalOrigin=\"center\"\n onClose={close}\n open={isOpen}\n restoreFocus\n >\n <DatePickerYearSelector presenter={presenter} onClose={close} />\n </Popper>\n </>\n );\n}\n"],"names":["DatePickerYearInput","presenter","visibleYear","useSignalValue","buttonRef","setButtonRef","useState","isOpen","setIsOpen","close","open","event","jsxs","Fragment","jsx","Button","clsx","styles","Popper","DatePickerYearSelector"],"mappings":";;;;;;;;;;;;;AAaO,SAASA,EAAoB,EAAE,WAAAC,KAAuC;AAC3E,QAAM,EAAE,aAAAC,EAAA,IAAgBC,EAAeF,EAAU,cAAc,GACzD,CAACG,GAAWC,CAAY,IAAIC,EAAmC,IAAI,GACnE,CAACC,GAAQC,CAAS,IAAIF,EAAS,EAAK;AAE1C,WAASG,IAAQ;AACf,IAAAD,EAAU,EAAK;AAAA,EACjB;AAEA,WAASE,EAAKC,GAA4C;AACxD,IAAAN,EAAaM,EAAM,aAAa,GAChCH,EAAU,EAAI;AAAA,EAChB;AAEA,SACE,gBAAAI,EAAAC,GAAA,EACE,UAAA;AAAA,IAAA,gBAAAC;AAAA,MAACC;AAAA,MAAA;AAAA,QACC,WAAU;AAAA,QACV,WAAWC,EAAK,2BAA2BC,EAAO,aAAa,CAAC;AAAA,QAChE,OAAM;AAAA,QACN,QAAO;AAAA,QACP,SAASP;AAAA,QAET,UAAA,gBAAAI,EAAC,QAAA,EAAK,WAAWG,EAAO,eAAgB,UAAAf,EAAA,CAAY;AAAA,MAAA;AAAA,IAAA;AAAA,IAEtD,gBAAAY;AAAA,MAACI;AAAA,MAAA;AAAA,QACC,eAAed;AAAA,QACf,kBAAiB;AAAA,QACjB,kBAAiB;AAAA,QACjB,SAASK;AAAA,QACT,MAAMF;AAAA,QACN,cAAY;AAAA,QAEZ,UAAA,gBAAAO,EAACK,GAAA,EAAuB,WAAAlB,GAAsB,SAASQ,EAAA,CAAO;AAAA,MAAA;AAAA,IAAA;AAAA,EAChE,GACF;AAEJ;"}
|
|
@@ -20,8 +20,8 @@ import "../../footnote.module-DEyFuqOr.js";
|
|
|
20
20
|
import { Headline as M } from "../../typography/headline/headline.js";
|
|
21
21
|
import "../../subheadline.module-C-v7zMkQ.js";
|
|
22
22
|
import "../../typography/title/title.js";
|
|
23
|
-
import { FocusRedirect as T } from "../../utils/focus_redirect.js";
|
|
24
23
|
import "../../utils/click_away_listener.js";
|
|
24
|
+
import { FocusRedirect as T } from "../../utils/focus_redirect.js";
|
|
25
25
|
import "../../utils/scroll_away_listener.js";
|
|
26
26
|
import "../../utils/hooks/use_resize_observer.js";
|
|
27
27
|
import '../../date_picker_year_selector.css';const q = "_date-picker-year-selector_ab05e1f", A = "_date-picker-year-button_fded757", Y = { "date-picker-year-selector": q, "date-picker-year-button": A };
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { jsx as d } from "react/jsx-runtime";
|
|
2
|
-
import { clsx as
|
|
3
|
-
import
|
|
4
|
-
import '../../input.css';const c = "_input_a16553f", m = { input: c },
|
|
2
|
+
import { clsx as f } from "clsx";
|
|
3
|
+
import o from "react";
|
|
4
|
+
import '../../input.css';const c = "_input_a16553f", m = { input: c }, y = o.forwardRef(function({ type: i = "text", style: s, className: n, width: r, height: l, onChange: a, ...t }, u) {
|
|
5
5
|
return /* @__PURE__ */ d(
|
|
6
6
|
"input",
|
|
7
7
|
{
|
|
8
|
-
className:
|
|
8
|
+
className: f(m.input, n, "input"),
|
|
9
9
|
type: i,
|
|
10
10
|
ref: u,
|
|
11
11
|
"data-is-disabled": t.disabled || !1,
|
|
@@ -19,6 +19,6 @@ import '../../input.css';const c = "_input_a16553f", m = { input: c }, I = f.for
|
|
|
19
19
|
);
|
|
20
20
|
});
|
|
21
21
|
export {
|
|
22
|
-
|
|
22
|
+
y as Input
|
|
23
23
|
};
|
|
24
24
|
//# sourceMappingURL=input.js.map
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import { jsx as L } from "react/jsx-runtime";
|
|
2
|
-
import "../../utils/focus_redirect.js";
|
|
3
2
|
import "../../utils/click_away_listener.js";
|
|
3
|
+
import "../../utils/focus_redirect.js";
|
|
4
4
|
import "../../utils/scroll_away_listener.js";
|
|
5
|
-
import
|
|
6
|
-
import { useForkRef as
|
|
5
|
+
import _, { useRef as e } from "react";
|
|
6
|
+
import { useForkRef as j } from "../../utils/hooks/use_fork_ref.js";
|
|
7
7
|
import "../../utils/hooks/use_resize_observer.js";
|
|
8
|
-
import { Input as
|
|
9
|
-
const
|
|
10
|
-
const p = e(0), c = e(0), r = e(0), u = e(0), x = e(0), o = e(0), i = e(null), P =
|
|
8
|
+
import { Input as B } from "../input/input.js";
|
|
9
|
+
const N = _.forwardRef(function({ onKeyCapture: n, onKeyDown: m, onInput: d, ...E }, v) {
|
|
10
|
+
const p = e(0), c = e(0), r = e(0), u = e(0), x = e(0), o = e(0), i = e(null), P = j(v, i);
|
|
11
11
|
function g(f) {
|
|
12
12
|
const t = i.current;
|
|
13
13
|
t != null && (p.current = t.value.length, c.current = t.selectionStart == null ? 0 : t.selectionStart, r.current = t.selectionEnd == null ? 0 : t.selectionEnd, o.current = r.current, u.current = Math.min(
|
|
@@ -71,9 +71,9 @@ const O = j.forwardRef(function({ onKeyCapture: n, onKeyDown: m, onInput: d, ...
|
|
|
71
71
|
}
|
|
72
72
|
d && d(f);
|
|
73
73
|
}
|
|
74
|
-
return /* @__PURE__ */ L(
|
|
74
|
+
return /* @__PURE__ */ L(B, { ref: P, onKeyDown: g, onInput: I, ...E });
|
|
75
75
|
});
|
|
76
76
|
export {
|
|
77
|
-
|
|
77
|
+
N as KeyCaptureInput
|
|
78
78
|
};
|
|
79
79
|
//# sourceMappingURL=key_capture_input.js.map
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import { jsx as V } from "react/jsx-runtime";
|
|
2
2
|
import { useSignalValue as B } from "@tcn/state";
|
|
3
|
-
import "../../utils/focus_redirect.js";
|
|
4
3
|
import "../../utils/click_away_listener.js";
|
|
4
|
+
import "../../utils/focus_redirect.js";
|
|
5
5
|
import "../../utils/scroll_away_listener.js";
|
|
6
6
|
import A, { useRef as I, useState as j, useLayoutEffect as p } from "react";
|
|
7
7
|
import { useForkRef as K } from "../../utils/hooks/use_fork_ref.js";
|
|
8
8
|
import "../../utils/hooks/use_resize_observer.js";
|
|
9
|
-
import { KeyCaptureInput as
|
|
10
|
-
import { MaskPresenter as
|
|
9
|
+
import { KeyCaptureInput as _ } from "./key_capture_input.js";
|
|
10
|
+
import { MaskPresenter as F } from "./mask_presenter.js";
|
|
11
11
|
const Y = A.forwardRef(
|
|
12
12
|
function({
|
|
13
13
|
value: m = "",
|
|
@@ -21,7 +21,7 @@ const Y = A.forwardRef(
|
|
|
21
21
|
prepareCopyValue: y = (i) => i,
|
|
22
22
|
...C
|
|
23
23
|
}, E) {
|
|
24
|
-
const i = Array.isArray(c) ? c : [c], f = I(null), D = K(E, f), [e] = j(() => new
|
|
24
|
+
const i = Array.isArray(c) ? c : [c], f = I(null), D = K(E, f), [e] = j(() => new F(i)), P = B(e.valueBroadcast);
|
|
25
25
|
B(e.maskConfigsBroadcast);
|
|
26
26
|
function T(t, s, n, o, l, r) {
|
|
27
27
|
switch (n != null ? e.setSelection(n.start, n.end) : e.forceMoveCursorTo(o), s) {
|
|
@@ -103,7 +103,7 @@ const Y = A.forwardRef(
|
|
|
103
103
|
document.removeEventListener("selectionchange", l), document.removeEventListener("mousedown", n), document.removeEventListener("keydown", o);
|
|
104
104
|
};
|
|
105
105
|
}, [e]), /* @__PURE__ */ V(
|
|
106
|
-
|
|
106
|
+
_,
|
|
107
107
|
{
|
|
108
108
|
value: P,
|
|
109
109
|
ref: D,
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { jsx as t, jsxs as h, Fragment as C } from "react/jsx-runtime";
|
|
2
|
-
import O, { useState as
|
|
2
|
+
import O, { useState as _ } from "react";
|
|
3
3
|
import { ComboBox as v } from "../combo_box/combo_box.js";
|
|
4
|
-
import { MultiselectInlineValues as
|
|
5
|
-
import { MultiselectValues as
|
|
6
|
-
import { makeAvailableOptions as
|
|
7
|
-
import { Option as
|
|
8
|
-
import { clsx as
|
|
9
|
-
import { VStack as
|
|
4
|
+
import { MultiselectInlineValues as N } from "../multiselect/multiselect_inline_values.js";
|
|
5
|
+
import { MultiselectValues as R } from "../multiselect/multiselect_values.js";
|
|
6
|
+
import { makeAvailableOptions as T } from "../options/utils.js";
|
|
7
|
+
import { Option as g } from "../options/option.js";
|
|
8
|
+
import { clsx as j } from "clsx";
|
|
9
|
+
import { VStack as k } from "../../stacks/v_stack.js";
|
|
10
10
|
import '../../multi_combo_box.css';const E = "_multi-combo-box-container_9528df3", F = { "multi-combo-box-container": E }, P = O.forwardRef(function({
|
|
11
11
|
value: e = [],
|
|
12
12
|
children: M,
|
|
@@ -19,11 +19,11 @@ import '../../multi_combo_box.css';const E = "_multi-combo-box-container_9528df3
|
|
|
19
19
|
inputProps: m,
|
|
20
20
|
...y
|
|
21
21
|
}, S) {
|
|
22
|
-
const [f, l] =
|
|
22
|
+
const [f, l] = _(""), u = O.Children.toArray(
|
|
23
23
|
M
|
|
24
|
-
),
|
|
25
|
-
const i =
|
|
26
|
-
return i ?? /* @__PURE__ */ t(
|
|
24
|
+
), p = T(u, e), d = e.map((o) => {
|
|
25
|
+
const i = u.find((a) => a.props.value === o);
|
|
26
|
+
return i ?? /* @__PURE__ */ t(g, { value: o, label: o, children: o });
|
|
27
27
|
});
|
|
28
28
|
function x(o) {
|
|
29
29
|
if (e.indexOf(o.props.value) > -1) {
|
|
@@ -49,11 +49,11 @@ import '../../multi_combo_box.css';const E = "_multi-combo-box-container_9528df3
|
|
|
49
49
|
noOptionMatchedMessage: "Press Enter To Add",
|
|
50
50
|
placeholder: "Type to Add",
|
|
51
51
|
...m,
|
|
52
|
-
children:
|
|
52
|
+
children: p
|
|
53
53
|
}
|
|
54
54
|
),
|
|
55
55
|
/* @__PURE__ */ t(
|
|
56
|
-
|
|
56
|
+
N,
|
|
57
57
|
{
|
|
58
58
|
values: d,
|
|
59
59
|
disabled: n,
|
|
@@ -61,11 +61,11 @@ import '../../multi_combo_box.css';const E = "_multi-combo-box-container_9528df3
|
|
|
61
61
|
}
|
|
62
62
|
)
|
|
63
63
|
] }) : /* @__PURE__ */ h(
|
|
64
|
-
|
|
64
|
+
k,
|
|
65
65
|
{
|
|
66
66
|
ref: S,
|
|
67
67
|
...y,
|
|
68
|
-
className:
|
|
68
|
+
className: j(F["multi-combo-box-container"], A),
|
|
69
69
|
children: [
|
|
70
70
|
/* @__PURE__ */ t(
|
|
71
71
|
v,
|
|
@@ -79,11 +79,11 @@ import '../../multi_combo_box.css';const E = "_multi-combo-box-container_9528df3
|
|
|
79
79
|
noOptionMatchedMessage: "No Options Matched",
|
|
80
80
|
placeholder: "Type to Search or Add",
|
|
81
81
|
...m,
|
|
82
|
-
children:
|
|
82
|
+
children: p
|
|
83
83
|
}
|
|
84
84
|
),
|
|
85
85
|
/* @__PURE__ */ t(
|
|
86
|
-
|
|
86
|
+
R,
|
|
87
87
|
{
|
|
88
88
|
values: d,
|
|
89
89
|
onRemove: x,
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import { jsxs as v, Fragment as
|
|
2
|
-
import A, { useRef as V, useLayoutEffect as
|
|
3
|
-
import { Spacer as
|
|
4
|
-
import { VStack as
|
|
5
|
-
import { MultiselectInlineValues as
|
|
6
|
-
import { MultiselectValues as
|
|
1
|
+
import { jsxs as v, Fragment as w, jsx as l } from "react/jsx-runtime";
|
|
2
|
+
import A, { useRef as V, useLayoutEffect as j } from "react";
|
|
3
|
+
import { Spacer as q } from "../../stacks/spacer.js";
|
|
4
|
+
import { VStack as C } from "../../stacks/v_stack.js";
|
|
5
|
+
import { MultiselectInlineValues as E } from "./multiselect_inline_values.js";
|
|
6
|
+
import { MultiselectValues as N } from "./multiselect_values.js";
|
|
7
7
|
import { makeAvailableOptions as g, makeValuesAsOptions as I } from "../options/utils.js";
|
|
8
8
|
import { Select as S } from "../select/select.js";
|
|
9
|
-
import "../../utils/focus_redirect.js";
|
|
10
9
|
import "../../utils/click_away_listener.js";
|
|
10
|
+
import "../../utils/focus_redirect.js";
|
|
11
11
|
import "../../utils/scroll_away_listener.js";
|
|
12
12
|
import { useForkRef as L } from "../../utils/hooks/use_fork_ref.js";
|
|
13
13
|
import "../../utils/hooks/use_resize_observer.js";
|
|
@@ -26,7 +26,7 @@ import '../../multiselect.css';const $ = "_multiselect-container_009951a", z = {
|
|
|
26
26
|
const r = V(null), F = L(m, r), c = e[e.length - 1] || null, O = V(null), f = A.Children.toArray(
|
|
27
27
|
x
|
|
28
28
|
), p = g(f, e), d = I(f, e);
|
|
29
|
-
|
|
29
|
+
j(() => {
|
|
30
30
|
const t = O.current;
|
|
31
31
|
c != null && t != null && (t.querySelector(`[data-value='${c}']`)?.focus(), requestAnimationFrame(() => {
|
|
32
32
|
r.current && r.current.focus();
|
|
@@ -37,11 +37,11 @@ import '../../multiselect.css';const $ = "_multiselect-container_009951a", z = {
|
|
|
37
37
|
}
|
|
38
38
|
function R(t) {
|
|
39
39
|
if (e.indexOf(t.props.value) > -1) {
|
|
40
|
-
const M = e.filter((
|
|
40
|
+
const M = e.filter((_) => _ !== t.props.value);
|
|
41
41
|
n && n(M);
|
|
42
42
|
}
|
|
43
43
|
}
|
|
44
|
-
return y ? /* @__PURE__ */ v(
|
|
44
|
+
return y ? /* @__PURE__ */ v(w, { children: [
|
|
45
45
|
/* @__PURE__ */ l(
|
|
46
46
|
S,
|
|
47
47
|
{
|
|
@@ -55,9 +55,9 @@ import '../../multiselect.css';const $ = "_multiselect-container_009951a", z = {
|
|
|
55
55
|
children: p
|
|
56
56
|
}
|
|
57
57
|
),
|
|
58
|
-
/* @__PURE__ */ l(
|
|
58
|
+
/* @__PURE__ */ l(q, { width: "8px" }),
|
|
59
59
|
/* @__PURE__ */ l(
|
|
60
|
-
|
|
60
|
+
E,
|
|
61
61
|
{
|
|
62
62
|
values: d,
|
|
63
63
|
onRemove: R,
|
|
@@ -65,7 +65,7 @@ import '../../multiselect.css';const $ = "_multiselect-container_009951a", z = {
|
|
|
65
65
|
}
|
|
66
66
|
)
|
|
67
67
|
] }) : /* @__PURE__ */ v(
|
|
68
|
-
|
|
68
|
+
C,
|
|
69
69
|
{
|
|
70
70
|
width: s,
|
|
71
71
|
minWidth: i,
|
|
@@ -88,7 +88,7 @@ import '../../multiselect.css';const $ = "_multiselect-container_009951a", z = {
|
|
|
88
88
|
}
|
|
89
89
|
),
|
|
90
90
|
/* @__PURE__ */ l(
|
|
91
|
-
|
|
91
|
+
N,
|
|
92
92
|
{
|
|
93
93
|
disabled: o,
|
|
94
94
|
values: d,
|