impact-nova 2.5.16 → 2.6.0-alpha.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +27 -25
- package/dist/components/data/ag-grid-react/ag-grid.types.d.ts +28 -1
- package/dist/components/data/ag-grid-react/cell-renderers/date-display-renderer.d.ts +0 -3
- package/dist/components/data/ag-grid-react/cell-renderers/date-display-renderer.js +31 -38
- package/dist/components/data/ag-grid-react/cell-renderers/input-display-renderer.d.ts +1 -1
- package/dist/components/data/ag-grid-react/chat/chat-capabilities.d.ts +9 -0
- package/dist/components/data/ag-grid-react/chat/chat-capabilities.js +22 -0
- package/dist/components/data/ag-grid-react/chat/chat-column.d.ts +20 -0
- package/dist/components/data/ag-grid-react/chat/chat-column.js +81 -0
- package/dist/components/data/ag-grid-react/chat/chat-composer.d.ts +10 -0
- package/dist/components/data/ag-grid-react/chat/chat-composer.js +352 -0
- package/dist/components/data/ag-grid-react/chat/chat-constants.d.ts +17 -0
- package/dist/components/data/ag-grid-react/chat/chat-constants.js +22 -0
- package/dist/components/data/ag-grid-react/chat/chat-format.d.ts +41 -0
- package/dist/components/data/ag-grid-react/chat/chat-format.js +94 -0
- package/dist/components/data/ag-grid-react/chat/chat-host.d.ts +10 -0
- package/dist/components/data/ag-grid-react/chat/chat-host.js +651 -0
- package/dist/components/data/ag-grid-react/chat/chat-host.types.d.ts +13 -0
- package/dist/components/data/ag-grid-react/chat/chat-html.d.ts +2 -0
- package/dist/components/data/ag-grid-react/chat/chat-html.js +40 -0
- package/dist/components/data/ag-grid-react/chat/chat-identity.d.ts +13 -0
- package/dist/components/data/ag-grid-react/chat/chat-identity.js +24 -0
- package/dist/components/data/ag-grid-react/chat/chat-menu.d.ts +13 -0
- package/dist/components/data/ag-grid-react/chat/chat-menu.js +15 -0
- package/dist/components/data/ag-grid-react/chat/chat-notify.d.ts +17 -0
- package/dist/components/data/ag-grid-react/chat/chat-notify.js +124 -0
- package/dist/components/data/ag-grid-react/chat/chat-persist.d.ts +13 -0
- package/dist/components/data/ag-grid-react/chat/chat-persist.js +34 -0
- package/dist/components/data/ag-grid-react/chat/chat-priority.d.ts +13 -0
- package/dist/components/data/ag-grid-react/chat/chat-priority.js +79 -0
- package/dist/components/data/ag-grid-react/chat/chat-summaries.d.ts +2 -0
- package/dist/components/data/ag-grid-react/chat/chat-summaries.js +24 -0
- package/dist/components/data/ag-grid-react/chat/chat-thread-ui.d.ts +72 -0
- package/dist/components/data/ag-grid-react/chat/chat-thread-ui.js +713 -0
- package/dist/components/data/ag-grid-react/chat/chat-toggle.d.ts +6 -0
- package/dist/components/data/ag-grid-react/chat/chat-toggle.js +25 -0
- package/dist/components/data/ag-grid-react/chat/chat-ui-actions.d.ts +13 -0
- package/dist/components/data/ag-grid-react/chat/chat-ui-actions.js +26 -0
- package/dist/components/data/ag-grid-react/chat/chat-window.d.ts +14 -0
- package/dist/components/data/ag-grid-react/chat/chat-window.js +82 -0
- package/dist/components/data/ag-grid-react/chat/chat-workspace.d.ts +91 -0
- package/dist/components/data/ag-grid-react/chat/chat-workspace.js +555 -0
- package/dist/components/data/ag-grid-react/chat/chat.types.d.ts +319 -0
- package/dist/components/data/ag-grid-react/chat/index.d.ts +6 -0
- package/dist/components/data/ag-grid-react/chat/index.js +24 -0
- package/dist/components/data/ag-grid-react/chat.story-data.d.ts +34 -0
- package/dist/components/data/ag-grid-react/chat.story-sources.d.ts +4 -0
- package/dist/components/data/ag-grid-react/comments/assets/comments-no-results.png.js +4 -0
- package/dist/components/data/ag-grid-react/comments/comment-mode-toggle.d.ts +6 -0
- package/dist/components/data/ag-grid-react/comments/comment-mode-toggle.js +29 -0
- package/dist/components/data/ag-grid-react/comments/comments-actions-menu.d.ts +8 -0
- package/dist/components/data/ag-grid-react/comments/comments-actions-menu.js +18 -0
- package/dist/components/data/ag-grid-react/comments/comments-ag-grid-presence.d.ts +18 -0
- package/dist/components/data/ag-grid-react/comments/comments-ag-grid-presence.js +16 -0
- package/dist/components/data/ag-grid-react/comments/comments-capabilities.d.ts +11 -0
- package/dist/components/data/ag-grid-react/comments/comments-capabilities.js +26 -0
- package/dist/components/data/ag-grid-react/comments/comments-constants.d.ts +12 -0
- package/dist/components/data/ag-grid-react/comments/comments-constants.js +21 -0
- package/dist/components/data/ag-grid-react/comments/comments-format.d.ts +20 -0
- package/dist/components/data/ag-grid-react/comments/comments-format.js +49 -0
- package/dist/components/data/ag-grid-react/comments/comments-generation.d.ts +14 -0
- package/dist/components/data/ag-grid-react/comments/comments-generation.js +18 -0
- package/dist/components/data/ag-grid-react/comments/comments-host.d.ts +10 -0
- package/dist/components/data/ag-grid-react/comments/comments-host.js +343 -0
- package/dist/components/data/ag-grid-react/comments/comments-host.types.d.ts +18 -0
- package/dist/components/data/ag-grid-react/comments/comments-identity.d.ts +7 -0
- package/dist/components/data/ag-grid-react/comments/comments-identity.js +20 -0
- package/dist/components/data/ag-grid-react/comments/comments-menu.d.ts +29 -0
- package/dist/components/data/ag-grid-react/comments/comments-menu.js +35 -0
- package/dist/components/data/ag-grid-react/comments/comments-overlay-anchor.d.ts +22 -0
- package/dist/components/data/ag-grid-react/comments/comments-overlay-anchor.js +98 -0
- package/dist/components/data/ag-grid-react/comments/comments-overlay.d.ts +21 -0
- package/dist/components/data/ag-grid-react/comments/comments-overlay.js +406 -0
- package/dist/components/data/ag-grid-react/comments/comments-panel.d.ts +9 -0
- package/dist/components/data/ag-grid-react/comments/comments-panel.js +272 -0
- package/dist/components/data/ag-grid-react/comments/comments-persist.d.ts +11 -0
- package/dist/components/data/ag-grid-react/comments/comments-persist.js +19 -0
- package/dist/components/data/ag-grid-react/comments/comments-reveal.d.ts +11 -0
- package/dist/components/data/ag-grid-react/comments/comments-reveal.js +31 -0
- package/dist/components/data/ag-grid-react/comments/comments-ui-actions.d.ts +18 -0
- package/dist/components/data/ag-grid-react/comments/comments-ui-actions.js +22 -0
- package/dist/components/data/ag-grid-react/comments/comments-window.d.ts +10 -0
- package/dist/components/data/ag-grid-react/comments/comments-window.js +62 -0
- package/dist/components/data/ag-grid-react/comments/comments.types.d.ts +178 -0
- package/dist/components/data/ag-grid-react/comments/index.d.ts +5 -0
- package/dist/components/data/ag-grid-react/comments/index.js +15 -0
- package/dist/components/data/ag-grid-react/comments-cell-renderers-showcase.d.ts +25 -0
- package/dist/components/data/ag-grid-react/comments.story-data.d.ts +37 -0
- package/dist/components/data/ag-grid-react/comments.story-sources.d.ts +11 -0
- package/dist/components/data/ag-grid-react/grid-cell-address.d.ts +21 -0
- package/dist/components/data/ag-grid-react/grid-cell-address.js +21 -0
- package/dist/components/data/ag-grid-react/grid-row-reveal.d.ts +34 -0
- package/dist/components/data/ag-grid-react/grid-row-reveal.js +33 -0
- package/dist/components/data/ag-grid-react/headers/advanced-filter/advanced-filter-dialog.js +75 -65
- package/dist/components/data/ag-grid-react/headers/advanced-filter/column-filter-section.d.ts +1 -1
- package/dist/components/data/ag-grid-react/headers/advanced-filter/column-filter-section.js +54 -54
- package/dist/components/data/ag-grid-react/headers/components/date-filter-picker.d.ts +1 -1
- package/dist/components/data/ag-grid-react/headers/header-search-input.js +122 -119
- package/dist/components/data/ag-grid-react/headers/utils/date-utils.d.ts +2 -1
- package/dist/components/data/ag-grid-react/headers/utils/date-utils.js +25 -20
- package/dist/components/data/ag-grid-react/headers/utils/filter-utils.d.ts +1 -1
- package/dist/components/data/ag-grid-react/index.d.ts +1 -1
- package/dist/components/data/ag-grid-react/index.js +481 -254
- package/dist/components/data/ag-grid-react/notes/index.d.ts +2 -0
- package/dist/components/data/ag-grid-react/notes/index.js +1 -0
- package/dist/components/data/ag-grid-react/notes/notes-ag-grid-adapter.d.ts +25 -0
- package/dist/components/data/ag-grid-react/notes/notes-ag-grid-adapter.js +32 -0
- package/dist/components/data/ag-grid-react/notes/notes-constants.d.ts +2 -0
- package/dist/components/data/ag-grid-react/notes/notes-constants.js +4 -0
- package/dist/components/data/ag-grid-react/notes/notes.types.d.ts +12 -0
- package/dist/components/data/ag-grid-react/notes.story-sources.d.ts +7 -0
- package/dist/components/data/ag-grid-react/nova-system-column.d.ts +7 -0
- package/dist/components/data/ag-grid-react/nova-system-column.js +18 -0
- package/dist/components/data/ag-grid-react/theme.js +6 -2
- package/dist/components/data/ag-grid-react/value-formatter.types.d.ts +4 -0
- package/dist/components/data/ag-grid-react/value-formatters.d.ts +0 -19
- package/dist/components/data/ag-grid-react/value-formatters.js +88 -90
- package/dist/components/data/data-table/build-column-tree-from-grid.d.ts +0 -1
- package/dist/components/data/data-table/build-column-tree-from-grid.js +49 -53
- package/dist/components/data/data-table/data-table-column-apply.d.ts +0 -2
- package/dist/components/data/data-table/data-table-column-apply.js +73 -84
- package/dist/components/data/data-table/data-table-column-def-pin.js +34 -31
- package/dist/components/data/data-table/data-table-column-list.js +64 -94
- package/dist/components/data/data-table/data-table-column-tree-cache.d.ts +6 -12
- package/dist/components/data/data-table/data-table-column-tree-cache.js +131 -250
- package/dist/components/data/data-table/data-table-context.js +5 -5
- package/dist/components/data/data-table/data-table-sheet-context.js +1 -1
- package/dist/components/data/data-table/data-table-sheet.js +2 -1
- package/dist/components/data/data-table/patch-column-tree-indicators-from-grid.d.ts +0 -5
- package/dist/components/data/data-table/patch-column-tree-indicators-from-grid.js +11 -28
- package/dist/components/data/data-table/use-data-table-column-list-sync.d.ts +0 -10
- package/dist/components/data/data-table/use-data-table-column-list-sync.js +196 -250
- package/dist/components/data/nested-list/components/NestedListContent.d.ts +2 -10
- package/dist/components/data/nested-list/components/NestedListContent.js +138 -253
- package/dist/components/data/nested-list/components/SortableItem.d.ts +1 -2
- package/dist/components/data/nested-list/components/SortableItem.js +60 -62
- package/dist/components/data/nested-list/hooks/useNestedListDragDrop.d.ts +20 -10
- package/dist/components/data/nested-list/hooks/useNestedListDragDrop.js +233 -44
- package/dist/components/data/nested-list/nested-list-constants.d.ts +1 -4
- package/dist/components/data/nested-list/nested-list-constants.js +4 -10
- package/dist/components/data/nested-list/nested-list.js +336 -322
- package/dist/components/data/nested-list/nested-list.types.d.ts +0 -17
- package/dist/components/data-display/calendar/calendar-config.js +22 -21
- package/dist/components/data-display/calendar/calendar-day-button.js +21 -21
- package/dist/components/data-display/calendar/calendar-day-picker-view.js +36 -35
- package/dist/components/data-display/calendar/calendar-fiscal-labels.d.ts +3 -3
- package/dist/components/data-display/calendar/calendar-fiscal-labels.js +50 -62
- package/dist/components/data-display/calendar/calendar.js +138 -137
- package/dist/components/data-display/calendar/fiscal-period-caption-select.js +23 -22
- package/dist/components/data-display/calendar/use-calendar-i18n.d.ts +1 -0
- package/dist/components/data-display/calendar/use-calendar-i18n.js +10 -9
- package/dist/components/data-display/chart/chart.js +72 -72
- package/dist/components/data-display/chart/chart.utils.d.ts +1 -1
- package/dist/components/data-display/chart/chart.utils.js +40 -31
- package/dist/components/feedback/sheet/sheet.js +1 -1
- package/dist/components/feedback/toast/toast.d.ts +1 -1
- package/dist/components/feedback/toast/toast.variants.d.ts +1 -1
- package/dist/components/flows/filter-panel/filter-panel.d.ts +1 -1
- package/dist/components/flows/filter-panel/filter-panel.js +65 -64
- package/dist/components/flows/filter-panel/filter-panel.types.d.ts +1 -0
- package/dist/components/forms/date-picker/date-picker.js +125 -126
- package/dist/components/forms/date-picker/date-range-picker.js +191 -192
- package/dist/components/forms/date-picker/multi-date-picker.js +66 -67
- package/dist/components/forms/date-picker/multi-week-picker.js +82 -83
- package/dist/components/forms/date-picker/use-picker-i18n.d.ts +6 -0
- package/dist/components/forms/date-picker/use-picker-i18n.js +11 -0
- package/dist/components/forms/date-picker/week-picker.js +146 -147
- package/dist/components/forms/date-picker/week-range-picker.js +158 -159
- package/dist/components/ui/local-raster-icons/message3d.webp.js +4 -0
- package/dist/components/ui/local-raster-icons/rasterIcons.d.ts +1 -0
- package/dist/components/ui/local-raster-icons/rasterIcons.js +27 -25
- package/dist/form-react/Fields/WeekRangePicker.js +16 -16
- package/dist/i18n/defaultMessages.d.ts +144 -0
- package/dist/i18n/defaultMessages.js +161 -19
- package/dist/i18n/format/collator.d.ts +1 -0
- package/dist/i18n/format/collator.js +7 -0
- package/dist/i18n/format/date-pattern.d.ts +5 -0
- package/dist/i18n/format/date-pattern.js +20 -0
- package/dist/i18n/format/format-date.d.ts +9 -0
- package/dist/i18n/format/format-date.js +56 -0
- package/dist/i18n/format/format-number.d.ts +20 -0
- package/dist/i18n/format/format-number.js +68 -0
- package/dist/i18n/format/formatter-cache.d.ts +9 -0
- package/dist/i18n/format/formatter-cache.js +66 -0
- package/dist/i18n/format/index.d.ts +6 -0
- package/dist/i18n/format/parse-number.d.ts +6 -0
- package/dist/i18n/format/parse-number.js +53 -0
- package/dist/i18n/getDateFnsLocale.d.ts +5 -4
- package/dist/i18n/getDateFnsLocale.js +46 -16
- package/dist/i18n/i18n.types.d.ts +13 -0
- package/dist/i18n/impact-nova-i18n-context.d.ts +1 -1
- package/dist/i18n/impact-nova-i18n-context.js +33 -25
- package/dist/i18n/impact-nova-i18n-defaults.js +8 -6
- package/dist/i18n/index.d.ts +4 -1
- package/dist/i18n/index.js +41 -16
- package/dist/i18n/locale-config.d.ts +28 -0
- package/dist/i18n/locale-config.js +32 -0
- package/dist/i18n/locales/de.js +142 -0
- package/dist/i18n/locales/es.js +142 -0
- package/dist/i18n/locales/hi.js +142 -0
- package/dist/i18n/locales/kn.js +142 -0
- package/dist/i18n/week-start.d.ts +6 -0
- package/dist/i18n/week-start.js +30 -0
- package/dist/impact-nova-components.css +249 -0
- package/dist/impact-nova-tokens.scss +6 -0
- package/dist/impact-nova.css +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +624 -601
- package/dist/llms/index.js +26 -2
- package/dist/llms/rules/ag-grid.js +1 -1
- package/dist/llms/rules/best-practices.js +1 -1
- package/dist/llms/rules/data-table-chat.js +1 -0
- package/dist/llms/rules/data-table-comments.js +1 -0
- package/dist/llms/rules/data-table-notes.js +1 -0
- package/dist/llms/rules/installation.js +1 -1
- package/dist/llms/rules/migration.js +1 -1
- package/dist/llms/rules/real-world-patterns.js +1 -1
- package/dist/llms/rules/requirements.js +1 -1
- package/dist/llms/rules/troubleshooting.js +1 -1
- package/dist/providers/app-providers.d.ts +3 -1
- package/dist/providers/app-providers.js +22 -11
- package/package.json +13 -1
- package/dist/components/data/data-table/column-picker-authority.d.ts +0 -34
- package/dist/components/data/data-table/column-picker-authority.js +0 -116
- package/dist/components/data/data-table/column-picker-drop-validation.d.ts +0 -7
- package/dist/components/data/data-table/column-picker-drop-validation.js +0 -37
- package/dist/components/data/data-table/data-table-column-list-tree-apply.d.ts +0 -10
- package/dist/components/data/data-table/data-table-column-list-tree-apply.js +0 -79
- package/dist/components/data/data-table/data-table-flat-column-virtual-rows.d.ts +0 -26
- package/dist/components/data/data-table/data-table-flat-column-virtual-rows.js +0 -195
- package/dist/components/data/data-table/data-table-picker-column-eligibility.d.ts +0 -1
- package/dist/components/data/data-table/data-table-picker-column-eligibility.js +0 -7
- package/dist/components/data/data-table/reconcile-column-tree-from-grid.d.ts +0 -12
- package/dist/components/data/data-table/reconcile-column-tree-from-grid.js +0 -12
- package/dist/components/data/nested-list/hooks/useVirtualNestedListDrag.d.ts +0 -24
- package/dist/components/data/nested-list/hooks/useVirtualNestedListDrag.js +0 -128
- package/dist/components/data/nested-list/nested-list-display-utils.d.ts +0 -11
- package/dist/components/data/nested-list/nested-list-display-utils.js +0 -74
- package/dist/components/data/nested-list/nested-list-drop-engine.d.ts +0 -31
- package/dist/components/data/nested-list/nested-list-drop-engine.js +0 -209
- package/dist/components/data/nested-list/nested-list-flat-virtual-handlers.d.ts +0 -26
- package/dist/components/data/nested-list/nested-list-flat-virtual-handlers.js +0 -67
- package/dist/components/data/nested-list/nested-list-item-tree-mutations.d.ts +0 -4
- package/dist/components/data/nested-list/nested-list-item-tree-mutations.js +0 -43
- package/dist/components/data/nested-list/nested-list-lazy-flat-rows.d.ts +0 -3
- package/dist/components/data/nested-list/nested-list-lazy-flat-rows.js +0 -34
- package/dist/components/data/nested-list/nested-list-row-estimates.d.ts +0 -9
- package/dist/components/data/nested-list/nested-list-row-estimates.js +0 -14
- package/dist/components/data/nested-list/nested-list-scroll-anchor.d.ts +0 -36
- package/dist/components/data/nested-list/nested-list-scroll-anchor.js +0 -47
- package/dist/components/data/nested-list/nested-list-virtual-drop.d.ts +0 -59
- package/dist/components/data/nested-list/nested-list-virtual-drop.js +0 -341
- package/dist/lib/hash/fnv1a128.d.ts +0 -16
- package/dist/lib/hash/fnv1a128.js +0 -21
|
@@ -3,128 +3,127 @@ import * as a from "react";
|
|
|
3
3
|
import { Cross as _, CalendarMonth as ee } from "impact-nova-icons";
|
|
4
4
|
import { format as te } from "date-fns";
|
|
5
5
|
import { cn as re } from "../../../lib/utils.js";
|
|
6
|
-
import { Input as
|
|
7
|
-
import { Popover as
|
|
8
|
-
import { Calendar as
|
|
9
|
-
import { Tooltip as
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
14
|
-
import {
|
|
15
|
-
import { fiscalCalendarPassThrough as ye } from "./fiscal-pass-through.js";
|
|
6
|
+
import { Input as ne } from "../input/input.js";
|
|
7
|
+
import { Popover as oe, PopoverAnchor as ae, PopoverContent as ie } from "../../feedback/popover/popover.js";
|
|
8
|
+
import { Calendar as se } from "../../data-display/calendar/calendar.js";
|
|
9
|
+
import { Tooltip as D, TooltipTrigger as P, TooltipContent as C } from "../../feedback/tooltip/tooltip.js";
|
|
10
|
+
import { usePickerI18n as ce } from "./use-picker-i18n.js";
|
|
11
|
+
import { coerceDateArrayApply as le, coerceDateArray as pe } from "./calendar-selection-adapters.js";
|
|
12
|
+
import { usePickerDismissActionsRef as de, usePickerFooterDismissNudge as fe, handlePickerSurfacePointerDown as me } from "./date-input-behavior.js";
|
|
13
|
+
import { buildDateBoundsMatcher as ue } from "../../../lib/date-bounds-matcher.js";
|
|
14
|
+
import { fiscalCalendarPassThrough as he } from "./fiscal-pass-through.js";
|
|
16
15
|
const ge = a.forwardRef(
|
|
17
16
|
({
|
|
18
17
|
value: t,
|
|
19
18
|
onChange: m,
|
|
20
|
-
format:
|
|
21
|
-
placeholder:
|
|
19
|
+
format: k,
|
|
20
|
+
placeholder: x,
|
|
22
21
|
minDate: A,
|
|
23
|
-
maxDate:
|
|
24
|
-
startMonth:
|
|
22
|
+
maxDate: b,
|
|
23
|
+
startMonth: N,
|
|
25
24
|
endMonth: T,
|
|
26
25
|
showFooter: l = !0,
|
|
27
|
-
disabled:
|
|
28
|
-
className:
|
|
29
|
-
calendarKind:
|
|
30
|
-
fiscalMode:
|
|
31
|
-
granularity:
|
|
32
|
-
fiscalMonthPattern:
|
|
33
|
-
fiscalYearStartMonth:
|
|
26
|
+
disabled: n,
|
|
27
|
+
className: M,
|
|
28
|
+
calendarKind: R,
|
|
29
|
+
fiscalMode: S,
|
|
30
|
+
granularity: F,
|
|
31
|
+
fiscalMonthPattern: j,
|
|
32
|
+
fiscalYearStartMonth: I,
|
|
34
33
|
fiscalConfig: O,
|
|
35
34
|
showPresets: w,
|
|
36
35
|
showPeriodBoundaries: E,
|
|
37
|
-
autoNavigateToAvailable:
|
|
36
|
+
autoNavigateToAvailable: L,
|
|
38
37
|
comparison: z,
|
|
39
38
|
onComparisonChange: K,
|
|
40
39
|
...q
|
|
41
|
-
},
|
|
42
|
-
const {
|
|
40
|
+
}, v) => {
|
|
41
|
+
const { dateFnsLocale: B, dateFormat: H, t: i } = ce(k), V = x ?? i("datePicker.selectMultipleDates"), [s, o] = a.useState(!1), u = a.useRef(null), h = de(), { footerFlashKey: $, footerFlashTarget: G, popoverHandlers: J } = fe(l, s, h, u), [p, d] = a.useState(t);
|
|
43
42
|
a.useEffect(() => {
|
|
44
43
|
d(t);
|
|
45
|
-
}, [
|
|
44
|
+
}, [s, t]);
|
|
46
45
|
const Q = (e) => {
|
|
47
|
-
const c =
|
|
46
|
+
const c = pe(e);
|
|
48
47
|
d(c), l || m?.(c);
|
|
49
48
|
}, U = (e) => {
|
|
50
|
-
const c =
|
|
51
|
-
m?.(c),
|
|
49
|
+
const c = le(e, p);
|
|
50
|
+
m?.(c), o(!1);
|
|
52
51
|
}, g = () => {
|
|
53
|
-
d(t),
|
|
54
|
-
},
|
|
55
|
-
d(void 0), m?.(void 0), l ||
|
|
56
|
-
}, W = t && t.length > 0 ? t.length === 1 ? te(t[0],
|
|
52
|
+
d(t), o(!1);
|
|
53
|
+
}, y = () => {
|
|
54
|
+
d(void 0), m?.(void 0), l || o(!1);
|
|
55
|
+
}, W = t && t.length > 0 ? t.length === 1 ? te(t[0], H, { locale: B }) : `${t.length} dates selected` : "", X = a.useCallback(() => {
|
|
57
56
|
const e = p?.length ?? 0, c = t?.length ?? 0;
|
|
58
57
|
return e === c && (p ?? []).every(
|
|
59
58
|
(Y, Z) => Y.getTime() === t?.[Z]?.getTime()
|
|
60
59
|
) ? "dismiss" : e > 0 ? "apply" : "cancel";
|
|
61
60
|
}, [p, t]);
|
|
62
61
|
return a.useLayoutEffect(() => {
|
|
63
|
-
|
|
62
|
+
h.current = {
|
|
64
63
|
onDismiss: g,
|
|
65
64
|
resolveFlash: X
|
|
66
65
|
};
|
|
67
|
-
}), /* @__PURE__ */ f(
|
|
68
|
-
|
|
66
|
+
}), /* @__PURE__ */ f(oe, { open: n ? !1 : s, onOpenChange: (e) => {
|
|
67
|
+
n || !e && l || o(e);
|
|
69
68
|
}, children: [
|
|
70
69
|
/* @__PURE__ */ r(ae, { asChild: !0, children: /* @__PURE__ */ r(
|
|
71
70
|
"div",
|
|
72
71
|
{
|
|
73
72
|
ref: u,
|
|
74
|
-
onPointerDown: (e) =>
|
|
75
|
-
disabled:
|
|
73
|
+
onPointerDown: (e) => me({
|
|
74
|
+
disabled: n,
|
|
76
75
|
event: e,
|
|
77
|
-
onOpen: () =>
|
|
76
|
+
onOpen: () => o(!0),
|
|
78
77
|
focusField: () => u.current?.querySelector("input")?.focus()
|
|
79
78
|
}),
|
|
80
79
|
children: /* @__PURE__ */ r(
|
|
81
|
-
|
|
80
|
+
ne,
|
|
82
81
|
{
|
|
83
|
-
ref:
|
|
82
|
+
ref: v,
|
|
84
83
|
value: W,
|
|
85
84
|
placeholder: V,
|
|
86
85
|
readOnly: !0,
|
|
87
|
-
disabled:
|
|
86
|
+
disabled: n,
|
|
88
87
|
onClick: () => {
|
|
89
|
-
!
|
|
88
|
+
!n && !s && o(!0);
|
|
90
89
|
},
|
|
91
|
-
className: re("cursor-pointer",
|
|
90
|
+
className: re("cursor-pointer", M),
|
|
92
91
|
suffix: /* @__PURE__ */ f("div", { className: "flex items-center gap-1", children: [
|
|
93
|
-
t && t.length > 0 && !
|
|
94
|
-
/* @__PURE__ */ r(
|
|
92
|
+
t && t.length > 0 && !n && /* @__PURE__ */ f(D, { children: [
|
|
93
|
+
/* @__PURE__ */ r(P, { asChild: !0, children: /* @__PURE__ */ r(
|
|
95
94
|
"button",
|
|
96
95
|
{
|
|
97
96
|
type: "button",
|
|
98
97
|
tabIndex: 0,
|
|
99
|
-
"aria-label":
|
|
98
|
+
"aria-label": i("calendar.clear"),
|
|
100
99
|
onClick: (e) => {
|
|
101
|
-
e.stopPropagation(),
|
|
100
|
+
e.stopPropagation(), y();
|
|
102
101
|
},
|
|
103
102
|
className: "inline-flex size-4 items-center justify-center bg-transparent border-none p-0 cursor-pointer",
|
|
104
103
|
children: /* @__PURE__ */ r(_, { className: "size-3 hover:text-content" })
|
|
105
104
|
}
|
|
106
105
|
) }),
|
|
107
|
-
/* @__PURE__ */ r(
|
|
106
|
+
/* @__PURE__ */ r(C, { variant: "tertiary", side: "top", children: i("calendar.clear") })
|
|
108
107
|
] }),
|
|
109
|
-
/* @__PURE__ */ f(
|
|
110
|
-
/* @__PURE__ */ r(
|
|
108
|
+
/* @__PURE__ */ f(D, { children: [
|
|
109
|
+
/* @__PURE__ */ r(P, { asChild: !0, children: /* @__PURE__ */ r(
|
|
111
110
|
"button",
|
|
112
111
|
{
|
|
113
112
|
type: "button",
|
|
114
113
|
tabIndex: 0,
|
|
115
114
|
"data-component": "calendar-trigger",
|
|
116
|
-
"aria-label":
|
|
115
|
+
"aria-label": i("datePicker.selectMultipleDates"),
|
|
117
116
|
onPointerDown: (e) => {
|
|
118
|
-
e.preventDefault(), e.stopPropagation(),
|
|
117
|
+
e.preventDefault(), e.stopPropagation(), n || o(!s);
|
|
119
118
|
},
|
|
120
119
|
onKeyDown: (e) => {
|
|
121
|
-
(e.key === "Enter" || e.key === " ") && (e.preventDefault(), e.stopPropagation(),
|
|
120
|
+
(e.key === "Enter" || e.key === " ") && (e.preventDefault(), e.stopPropagation(), n || o(!s));
|
|
122
121
|
},
|
|
123
122
|
className: "inline-flex items-center justify-center bg-transparent border-none p-0 cursor-pointer",
|
|
124
123
|
children: /* @__PURE__ */ r(ee, { className: "h-4 w-4 text-secondary-foreground" })
|
|
125
124
|
}
|
|
126
125
|
) }),
|
|
127
|
-
/* @__PURE__ */ r(
|
|
126
|
+
/* @__PURE__ */ r(C, { variant: "tertiary", side: "top", children: i("datePicker.selectMultipleDates") })
|
|
128
127
|
] })
|
|
129
128
|
] }),
|
|
130
129
|
...q
|
|
@@ -133,39 +132,39 @@ const ge = a.forwardRef(
|
|
|
133
132
|
}
|
|
134
133
|
) }),
|
|
135
134
|
/* @__PURE__ */ r(
|
|
136
|
-
|
|
135
|
+
ie,
|
|
137
136
|
{
|
|
138
137
|
className: "w-auto p-0",
|
|
139
138
|
align: "start",
|
|
140
|
-
"aria-label":
|
|
139
|
+
"aria-label": i("datePicker.selectMultipleDates"),
|
|
141
140
|
onOpenAutoFocus: (e) => e.preventDefault(),
|
|
142
141
|
...J,
|
|
143
142
|
children: /* @__PURE__ */ r(
|
|
144
|
-
|
|
143
|
+
se,
|
|
145
144
|
{
|
|
146
145
|
mode: "multiple",
|
|
147
146
|
selected: p,
|
|
148
147
|
footerFlashKey: $,
|
|
149
148
|
footerFlashTarget: G,
|
|
150
149
|
onSelect: Q,
|
|
151
|
-
disabled:
|
|
152
|
-
startMonth:
|
|
150
|
+
disabled: ue(A, b),
|
|
151
|
+
startMonth: N,
|
|
153
152
|
endMonth: T,
|
|
154
153
|
showFooter: l,
|
|
155
154
|
onApply: U,
|
|
156
155
|
onCancel: g,
|
|
157
|
-
onClear:
|
|
156
|
+
onClear: y,
|
|
158
157
|
captionLayout: "dropdown",
|
|
159
|
-
...
|
|
160
|
-
calendarKind:
|
|
161
|
-
fiscalMode:
|
|
162
|
-
granularity:
|
|
163
|
-
fiscalMonthPattern:
|
|
164
|
-
fiscalYearStartMonth:
|
|
158
|
+
...he({
|
|
159
|
+
calendarKind: R,
|
|
160
|
+
fiscalMode: S,
|
|
161
|
+
granularity: F,
|
|
162
|
+
fiscalMonthPattern: j,
|
|
163
|
+
fiscalYearStartMonth: I,
|
|
165
164
|
fiscalConfig: O,
|
|
166
165
|
showPresets: w,
|
|
167
166
|
showPeriodBoundaries: E,
|
|
168
|
-
autoNavigateToAvailable:
|
|
167
|
+
autoNavigateToAvailable: L,
|
|
169
168
|
comparison: z,
|
|
170
169
|
onComparisonChange: K
|
|
171
170
|
})
|
|
@@ -1,117 +1,116 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import * as
|
|
1
|
+
import { jsxs as m, jsx as r } from "react/jsx-runtime";
|
|
2
|
+
import * as s from "react";
|
|
3
3
|
import { Cross as ne, CalendarMonth as oe } from "impact-nova-icons";
|
|
4
|
-
import { format as
|
|
4
|
+
import { format as W } from "date-fns";
|
|
5
5
|
import { cn as se } from "../../../lib/utils.js";
|
|
6
|
-
import { Input as
|
|
7
|
-
import { Popover as
|
|
6
|
+
import { Input as ie } from "../input/input.js";
|
|
7
|
+
import { Popover as ae, PopoverAnchor as ce, PopoverContent as le } from "../../feedback/popover/popover.js";
|
|
8
8
|
import { Calendar as pe } from "../../data-display/calendar/calendar.js";
|
|
9
|
-
import { Tooltip as
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
14
|
-
import {
|
|
15
|
-
|
|
16
|
-
const
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
}, De = n.forwardRef(
|
|
9
|
+
import { Tooltip as b, TooltipTrigger as x, TooltipContent as A } from "../../feedback/tooltip/tooltip.js";
|
|
10
|
+
import { usePickerI18n as de } from "./use-picker-i18n.js";
|
|
11
|
+
import { coerceWeekArrayApply as fe, coerceWeekArray as ue } from "./calendar-selection-adapters.js";
|
|
12
|
+
import { usePickerDismissActionsRef as me, usePickerFooterDismissNudge as he, handlePickerSurfacePointerDown as ke } from "./date-input-behavior.js";
|
|
13
|
+
import { buildDateBoundsMatcher as ye } from "../../../lib/date-bounds-matcher.js";
|
|
14
|
+
import { fiscalCalendarPassThrough as ge } from "./fiscal-pass-through.js";
|
|
15
|
+
const Pe = (t, i = "MM/dd/yyyy", a) => {
|
|
16
|
+
const h = W(t.startDate, i, a ? { locale: a } : {}), k = W(t.endDate, i, a ? { locale: a } : {});
|
|
17
|
+
return `${h} - ${k}`;
|
|
18
|
+
}, Ce = s.forwardRef(
|
|
20
19
|
({
|
|
21
20
|
value: t,
|
|
22
|
-
onChange:
|
|
23
|
-
format:
|
|
21
|
+
onChange: i,
|
|
22
|
+
format: a,
|
|
24
23
|
placeholder: h,
|
|
25
|
-
minDate:
|
|
26
|
-
maxDate:
|
|
27
|
-
startMonth:
|
|
24
|
+
minDate: k,
|
|
25
|
+
maxDate: T,
|
|
26
|
+
startMonth: N,
|
|
28
27
|
endMonth: R,
|
|
29
28
|
showFooter: d = !0,
|
|
30
29
|
calendarKind: S,
|
|
31
|
-
fiscalMode:
|
|
30
|
+
fiscalMode: M = "basic",
|
|
32
31
|
granularity: w,
|
|
33
|
-
fiscalMonthPattern:
|
|
34
|
-
fiscalYearStartMonth:
|
|
35
|
-
fiscalConfig:
|
|
36
|
-
weekStartsOn:
|
|
37
|
-
showPresets:
|
|
32
|
+
fiscalMonthPattern: v,
|
|
33
|
+
fiscalYearStartMonth: O = 1,
|
|
34
|
+
fiscalConfig: j,
|
|
35
|
+
weekStartsOn: F,
|
|
36
|
+
showPresets: I,
|
|
38
37
|
showPeriodBoundaries: E,
|
|
39
38
|
autoNavigateToAvailable: K,
|
|
40
|
-
comparison:
|
|
41
|
-
onComparisonChange:
|
|
42
|
-
disabled:
|
|
43
|
-
className:
|
|
44
|
-
...
|
|
45
|
-
},
|
|
46
|
-
const {
|
|
47
|
-
|
|
48
|
-
|
|
39
|
+
comparison: L,
|
|
40
|
+
onComparisonChange: $,
|
|
41
|
+
disabled: n,
|
|
42
|
+
className: z,
|
|
43
|
+
...V
|
|
44
|
+
}, q) => {
|
|
45
|
+
const { dateFnsLocale: B, dateFormat: H, t: c } = de(a), G = h ?? c("datePicker.selectWeeks"), [l, o] = s.useState(!1), y = s.useRef(!1), g = s.useRef(null), P = me(), { footerFlashKey: J, footerFlashTarget: Q, popoverHandlers: U } = he(d, l, P, g), [f, u] = s.useState(t);
|
|
46
|
+
s.useEffect(() => {
|
|
47
|
+
u(t);
|
|
49
48
|
}, [l, t]);
|
|
50
49
|
const X = (e) => {
|
|
51
50
|
const p = ue(e);
|
|
52
|
-
|
|
51
|
+
u(p), d || i?.(p);
|
|
53
52
|
}, Y = (e) => {
|
|
54
|
-
const p =
|
|
55
|
-
|
|
53
|
+
const p = fe(e, f);
|
|
54
|
+
i?.(p), o(!1);
|
|
55
|
+
}, C = () => {
|
|
56
|
+
u(t), o(!1);
|
|
56
57
|
}, D = () => {
|
|
57
|
-
|
|
58
|
-
},
|
|
59
|
-
|
|
60
|
-
},
|
|
61
|
-
o || !e && d || s(e);
|
|
62
|
-
}, ee = n.useCallback(() => {
|
|
58
|
+
u(void 0), i?.(void 0), d || o(!1);
|
|
59
|
+
}, Z = t && t.length > 0 ? t.length === 1 ? Pe(t[0], H, B) : `${t.length} weeks selected` : "", _ = (e) => {
|
|
60
|
+
n || !e && d || o(e);
|
|
61
|
+
}, ee = s.useCallback(() => {
|
|
63
62
|
const e = f?.length ?? 0, p = t?.length ?? 0;
|
|
64
63
|
return e === p && (f ?? []).every(
|
|
65
64
|
(te, re) => te.startDate.getTime() === t?.[re]?.startDate.getTime()
|
|
66
65
|
) ? "dismiss" : e > 0 ? "apply" : "cancel";
|
|
67
66
|
}, [f, t]);
|
|
68
|
-
return
|
|
69
|
-
|
|
70
|
-
onDismiss:
|
|
67
|
+
return s.useLayoutEffect(() => {
|
|
68
|
+
P.current = {
|
|
69
|
+
onDismiss: C,
|
|
71
70
|
resolveFlash: ee
|
|
72
71
|
};
|
|
73
|
-
}), /* @__PURE__ */
|
|
72
|
+
}), /* @__PURE__ */ m(ae, { open: n ? !1 : l, onOpenChange: _, children: [
|
|
74
73
|
/* @__PURE__ */ r(ce, { asChild: !0, children: /* @__PURE__ */ r(
|
|
75
74
|
"div",
|
|
76
75
|
{
|
|
77
76
|
ref: g,
|
|
78
77
|
onPointerDown: (e) => ke({
|
|
79
|
-
disabled:
|
|
78
|
+
disabled: n,
|
|
80
79
|
event: e,
|
|
81
|
-
onOpen: () =>
|
|
80
|
+
onOpen: () => o(!0),
|
|
82
81
|
focusField: () => g.current?.querySelector("input")?.focus()
|
|
83
82
|
}),
|
|
84
83
|
children: /* @__PURE__ */ r(
|
|
85
|
-
|
|
84
|
+
ie,
|
|
86
85
|
{
|
|
87
|
-
ref:
|
|
86
|
+
ref: q,
|
|
88
87
|
value: Z,
|
|
89
88
|
placeholder: G,
|
|
90
89
|
readOnly: !0,
|
|
91
|
-
disabled:
|
|
90
|
+
disabled: n,
|
|
92
91
|
onClick: () => {
|
|
93
|
-
!
|
|
92
|
+
!n && !l && o(!0);
|
|
94
93
|
},
|
|
95
|
-
className: se("cursor-pointer",
|
|
96
|
-
suffix: /* @__PURE__ */
|
|
97
|
-
t && t.length > 0 && !
|
|
98
|
-
/* @__PURE__ */ r(
|
|
94
|
+
className: se("cursor-pointer", z),
|
|
95
|
+
suffix: /* @__PURE__ */ m("div", { className: "flex items-center gap-1", children: [
|
|
96
|
+
t && t.length > 0 && !n && /* @__PURE__ */ m(b, { children: [
|
|
97
|
+
/* @__PURE__ */ r(x, { asChild: !0, children: /* @__PURE__ */ r(
|
|
99
98
|
"button",
|
|
100
99
|
{
|
|
101
100
|
type: "button",
|
|
102
101
|
tabIndex: 0,
|
|
103
102
|
"aria-label": c("calendar.clear"),
|
|
104
103
|
onClick: (e) => {
|
|
105
|
-
e.stopPropagation(),
|
|
104
|
+
e.stopPropagation(), D();
|
|
106
105
|
},
|
|
107
106
|
className: "inline-flex size-4 items-center justify-center bg-transparent border-none p-0 cursor-pointer",
|
|
108
107
|
children: /* @__PURE__ */ r(ne, { className: "size-3 hover:text-content" })
|
|
109
108
|
}
|
|
110
109
|
) }),
|
|
111
|
-
/* @__PURE__ */ r(
|
|
110
|
+
/* @__PURE__ */ r(A, { variant: "tertiary", side: "top", children: c("calendar.clear") })
|
|
112
111
|
] }),
|
|
113
|
-
/* @__PURE__ */
|
|
114
|
-
/* @__PURE__ */ r(
|
|
112
|
+
/* @__PURE__ */ m(b, { children: [
|
|
113
|
+
/* @__PURE__ */ r(x, { asChild: !0, children: /* @__PURE__ */ r(
|
|
115
114
|
"button",
|
|
116
115
|
{
|
|
117
116
|
type: "button",
|
|
@@ -119,19 +118,19 @@ const Ce = (t, a = "MM/dd/yyyy", i) => {
|
|
|
119
118
|
"data-component": "calendar-trigger",
|
|
120
119
|
"aria-label": c("datePicker.selectWeeks"),
|
|
121
120
|
onPointerDown: (e) => {
|
|
122
|
-
e.preventDefault(), e.stopPropagation(),
|
|
121
|
+
e.preventDefault(), e.stopPropagation(), n || o(!l);
|
|
123
122
|
},
|
|
124
123
|
onKeyDown: (e) => {
|
|
125
|
-
(e.key === "Enter" || e.key === " ") && (e.preventDefault(), e.stopPropagation(),
|
|
124
|
+
(e.key === "Enter" || e.key === " ") && (e.preventDefault(), e.stopPropagation(), n || (y.current = !0, o(!l)));
|
|
126
125
|
},
|
|
127
126
|
className: "inline-flex items-center justify-center bg-transparent border-none p-0 cursor-pointer",
|
|
128
127
|
children: /* @__PURE__ */ r(oe, { className: "h-4 w-4 text-secondary-foreground" })
|
|
129
128
|
}
|
|
130
129
|
) }),
|
|
131
|
-
/* @__PURE__ */ r(
|
|
130
|
+
/* @__PURE__ */ r(A, { variant: "tertiary", side: "top", children: c("datePicker.selectWeeks") })
|
|
132
131
|
] })
|
|
133
132
|
] }),
|
|
134
|
-
...
|
|
133
|
+
...V
|
|
135
134
|
}
|
|
136
135
|
)
|
|
137
136
|
}
|
|
@@ -143,7 +142,7 @@ const Ce = (t, a = "MM/dd/yyyy", i) => {
|
|
|
143
142
|
align: "start",
|
|
144
143
|
"aria-label": c("datePicker.selectWeeks"),
|
|
145
144
|
onOpenAutoFocus: (e) => {
|
|
146
|
-
|
|
145
|
+
y.current || e.preventDefault(), y.current = !1;
|
|
147
146
|
},
|
|
148
147
|
...U,
|
|
149
148
|
children: /* @__PURE__ */ r(
|
|
@@ -155,27 +154,27 @@ const Ce = (t, a = "MM/dd/yyyy", i) => {
|
|
|
155
154
|
footerFlashKey: J,
|
|
156
155
|
footerFlashTarget: Q,
|
|
157
156
|
onWeekSelect: X,
|
|
158
|
-
disabled:
|
|
159
|
-
startMonth:
|
|
157
|
+
disabled: ye(k, T),
|
|
158
|
+
startMonth: N,
|
|
160
159
|
endMonth: R,
|
|
161
160
|
showFooter: d,
|
|
162
|
-
...
|
|
161
|
+
...ge({
|
|
163
162
|
calendarKind: S,
|
|
164
|
-
fiscalMode:
|
|
163
|
+
fiscalMode: M,
|
|
165
164
|
granularity: w,
|
|
166
|
-
fiscalMonthPattern:
|
|
167
|
-
fiscalYearStartMonth:
|
|
168
|
-
fiscalConfig:
|
|
169
|
-
weekStartsOn:
|
|
170
|
-
showPresets:
|
|
165
|
+
fiscalMonthPattern: v,
|
|
166
|
+
fiscalYearStartMonth: O,
|
|
167
|
+
fiscalConfig: j,
|
|
168
|
+
weekStartsOn: F,
|
|
169
|
+
showPresets: I,
|
|
171
170
|
showPeriodBoundaries: E,
|
|
172
171
|
autoNavigateToAvailable: K,
|
|
173
|
-
comparison:
|
|
174
|
-
onComparisonChange:
|
|
172
|
+
comparison: L,
|
|
173
|
+
onComparisonChange: $
|
|
175
174
|
}),
|
|
176
175
|
onApply: Y,
|
|
177
|
-
onCancel:
|
|
178
|
-
onClear:
|
|
176
|
+
onCancel: C,
|
|
177
|
+
onClear: D,
|
|
179
178
|
captionLayout: "dropdown"
|
|
180
179
|
}
|
|
181
180
|
)
|
|
@@ -184,7 +183,7 @@ const Ce = (t, a = "MM/dd/yyyy", i) => {
|
|
|
184
183
|
] });
|
|
185
184
|
}
|
|
186
185
|
);
|
|
187
|
-
|
|
186
|
+
Ce.displayName = "MultiWeekPicker";
|
|
188
187
|
export {
|
|
189
|
-
|
|
188
|
+
Ce as MultiWeekPicker
|
|
190
189
|
};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import * as c from "react";
|
|
2
|
+
import { useImpactNovaI18n as m } from "../../../i18n/use-impact-nova-i18n.js";
|
|
3
|
+
import { getDateFnsLocale as n } from "../../../i18n/getDateFnsLocale.js";
|
|
4
|
+
import { getLocalizedDatePattern as s } from "../../../i18n/format/date-pattern.js";
|
|
5
|
+
function u(e) {
|
|
6
|
+
const { dateLocale: t, t: o } = m(), a = c.useMemo(() => n(t), [t]), r = e ?? s(t);
|
|
7
|
+
return { dateLocale: t, dateFnsLocale: a, dateFormat: r, t: o };
|
|
8
|
+
}
|
|
9
|
+
export {
|
|
10
|
+
u as usePickerI18n
|
|
11
|
+
};
|