impact-nova 2.6.0-alpha.0 → 2.6.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 +25 -27
- package/dist/components/data/ag-grid-react/ag-grid.types.d.ts +3 -28
- package/dist/components/data/ag-grid-react/cell-renderers/date-display-renderer.d.ts +3 -0
- package/dist/components/data/ag-grid-react/cell-renderers/date-display-renderer.js +38 -31
- package/dist/components/data/ag-grid-react/cell-renderers/input-display-renderer.d.ts +1 -1
- package/dist/components/data/ag-grid-react/headers/advanced-filter/advanced-filter-dialog.js +65 -75
- 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/components/header-info.d.ts +9 -3
- package/dist/components/data/ag-grid-react/headers/components/header-info.js +69 -61
- package/dist/components/data/ag-grid-react/headers/components/info-modal.js +8 -8
- package/dist/components/data/ag-grid-react/headers/header-search-input.js +119 -122
- package/dist/components/data/ag-grid-react/headers/utils/date-utils.d.ts +1 -2
- package/dist/components/data/ag-grid-react/headers/utils/date-utils.js +20 -25
- 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 +254 -481
- package/dist/components/data/ag-grid-react/theme.js +2 -6
- package/dist/components/data/ag-grid-react/value-formatter.types.d.ts +0 -4
- package/dist/components/data/ag-grid-react/value-formatters.d.ts +19 -0
- package/dist/components/data/ag-grid-react/value-formatters.js +90 -88
- package/dist/components/data/data-table/build-column-tree-from-grid.d.ts +2 -0
- package/dist/components/data/data-table/build-column-tree-from-grid.js +64 -58
- package/dist/components/data/data-table/column-picker-authority.d.ts +35 -0
- package/dist/components/data/data-table/column-picker-authority.js +118 -0
- package/dist/components/data/data-table/column-picker-drop-validation.d.ts +7 -0
- package/dist/components/data/data-table/column-picker-drop-validation.js +37 -0
- package/dist/components/data/data-table/column-savability.d.ts +3 -0
- package/dist/components/data/data-table/column-savability.js +10 -0
- package/dist/components/data/data-table/data-table-column-apply.d.ts +2 -0
- package/dist/components/data/data-table/data-table-column-apply.js +84 -73
- package/dist/components/data/data-table/data-table-column-def-pin.js +31 -34
- package/dist/components/data/data-table/data-table-column-list-tree-apply.d.ts +10 -0
- package/dist/components/data/data-table/data-table-column-list-tree-apply.js +79 -0
- package/dist/components/data/data-table/data-table-column-list.js +122 -64
- package/dist/components/data/data-table/data-table-column-tree-cache.d.ts +12 -6
- package/dist/components/data/data-table/data-table-column-tree-cache.js +250 -131
- package/dist/components/data/data-table/data-table-context.js +5 -5
- package/dist/components/data/data-table/data-table-flat-column-virtual-rows.d.ts +27 -0
- package/dist/components/data/data-table/data-table-flat-column-virtual-rows.js +196 -0
- package/dist/components/data/data-table/data-table-picker-column-eligibility.d.ts +1 -0
- package/dist/components/data/data-table/data-table-picker-column-eligibility.js +7 -0
- package/dist/components/data/data-table/data-table-sheet-context.js +1 -1
- package/dist/components/data/data-table/data-table-sheet.js +1 -2
- package/dist/components/data/data-table/index.d.ts +2 -0
- package/dist/components/data/data-table/index.js +32 -28
- package/dist/components/data/data-table/patch-column-tree-indicators-from-grid.d.ts +5 -0
- package/dist/components/data/data-table/patch-column-tree-indicators-from-grid.js +28 -10
- package/dist/components/data/data-table/reconcile-column-tree-from-grid.d.ts +12 -0
- package/dist/components/data/data-table/reconcile-column-tree-from-grid.js +12 -0
- package/dist/components/data/data-table/use-data-table-column-list-sync.d.ts +10 -0
- package/dist/components/data/data-table/use-data-table-column-list-sync.js +250 -196
- package/dist/components/data/nested-list/components/NestedListContent.d.ts +10 -2
- package/dist/components/data/nested-list/components/NestedListContent.js +253 -138
- package/dist/components/data/nested-list/components/SortableItem.d.ts +2 -1
- package/dist/components/data/nested-list/components/SortableItem.js +62 -60
- package/dist/components/data/nested-list/hooks/useNestedListDragDrop.d.ts +10 -20
- package/dist/components/data/nested-list/hooks/useNestedListDragDrop.js +44 -233
- package/dist/components/data/nested-list/hooks/useVirtualNestedListDrag.d.ts +24 -0
- package/dist/components/data/nested-list/hooks/useVirtualNestedListDrag.js +128 -0
- package/dist/components/data/nested-list/nested-list-constants.d.ts +4 -1
- package/dist/components/data/nested-list/nested-list-constants.js +10 -4
- package/dist/components/data/nested-list/nested-list-display-utils.d.ts +11 -0
- package/dist/components/data/nested-list/nested-list-display-utils.js +74 -0
- package/dist/components/data/nested-list/nested-list-drop-engine.d.ts +31 -0
- package/dist/components/data/nested-list/nested-list-drop-engine.js +209 -0
- package/dist/components/data/nested-list/nested-list-flat-virtual-handlers.d.ts +26 -0
- package/dist/components/data/nested-list/nested-list-flat-virtual-handlers.js +67 -0
- package/dist/components/data/nested-list/nested-list-item-tree-mutations.d.ts +4 -0
- package/dist/components/data/nested-list/nested-list-item-tree-mutations.js +43 -0
- package/dist/components/data/nested-list/nested-list-lazy-flat-rows.d.ts +3 -0
- package/dist/components/data/nested-list/nested-list-lazy-flat-rows.js +34 -0
- package/dist/components/data/nested-list/nested-list-row-estimates.d.ts +9 -0
- package/dist/components/data/nested-list/nested-list-row-estimates.js +14 -0
- package/dist/components/data/nested-list/nested-list-scroll-anchor.d.ts +36 -0
- package/dist/components/data/nested-list/nested-list-scroll-anchor.js +47 -0
- package/dist/components/data/nested-list/nested-list-virtual-drop.d.ts +59 -0
- package/dist/components/data/nested-list/nested-list-virtual-drop.js +341 -0
- package/dist/components/data/nested-list/nested-list.js +322 -336
- package/dist/components/data/nested-list/nested-list.types.d.ts +17 -0
- package/dist/components/data-display/calendar/calendar-available-view.d.ts +6 -2
- package/dist/components/data-display/calendar/calendar-available-view.js +18 -19
- package/dist/components/data-display/calendar/calendar-config.js +21 -22
- package/dist/components/data-display/calendar/calendar-day-button.js +21 -21
- package/dist/components/data-display/calendar/calendar-day-picker-view.js +35 -36
- package/dist/components/data-display/calendar/calendar-fiscal-labels.d.ts +3 -3
- package/dist/components/data-display/calendar/calendar-fiscal-labels.js +62 -50
- package/dist/components/data-display/calendar/calendar-quarter-utils.js +12 -12
- package/dist/components/data-display/calendar/calendar-week-utils.d.ts +6 -0
- package/dist/components/data-display/calendar/calendar-week-utils.js +33 -33
- package/dist/components/data-display/calendar/calendar-year-panes.js +68 -58
- package/dist/components/data-display/calendar/calendar-year-utils.d.ts +13 -0
- package/dist/components/data-display/calendar/calendar-year-utils.js +59 -50
- package/dist/components/data-display/calendar/calendar.js +156 -153
- package/dist/components/data-display/calendar/fiscal-period-caption-select.js +22 -23
- package/dist/components/data-display/calendar/use-calendar-i18n.d.ts +0 -1
- package/dist/components/data-display/calendar/use-calendar-i18n.js +9 -10
- 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 +31 -40
- 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 +64 -65
- package/dist/components/flows/filter-panel/filter-panel.types.d.ts +0 -1
- package/dist/components/flows/guidance/guidance-layer.js +34 -31
- package/dist/components/flows/guidance/hooks/useGuidanceOverlayGeometry.js +29 -20
- package/dist/components/flows/guidance/renderers/announcement-renderer.d.ts +1 -1
- package/dist/components/flows/guidance/renderers/announcement-renderer.js +74 -28
- package/dist/components/flows/guidance/renderers/guidance-action-tap-icon.d.ts +5 -0
- package/dist/components/flows/guidance/renderers/guidance-action-tap-icon.js +68 -0
- package/dist/components/flows/guidance/renderers/guidance-announcement-surface.d.ts +5 -0
- package/dist/components/flows/guidance/renderers/guidance-announcement-surface.js +76 -0
- package/dist/components/flows/guidance/renderers/guidance-card-shared.d.ts +43 -2
- package/dist/components/flows/guidance/renderers/guidance-card-shared.js +322 -99
- package/dist/components/flows/guidance/renderers/guidance-renderer-shared.d.ts +3 -0
- package/dist/components/flows/guidance/renderers/guidance-renderer-shared.js +189 -148
- package/dist/components/flows/guidance/renderers/guidance-shortcut-display.d.ts +9 -0
- package/dist/components/flows/guidance/renderers/guidance-shortcut-display.js +36 -0
- package/dist/components/flows/guidance/renderers/guidance-tour-overlay.d.ts +2 -1
- package/dist/components/flows/guidance/renderers/guidance-tour-overlay.js +152 -89
- package/dist/components/forms/date-picker/date-picker.js +126 -125
- package/dist/components/forms/date-picker/date-range-picker.js +192 -191
- package/dist/components/forms/date-picker/fiscal-pass-through.d.ts +6 -6
- package/dist/components/forms/date-picker/fiscal-pass-through.js +7 -3
- package/dist/components/forms/date-picker/multi-date-picker.js +67 -66
- package/dist/components/forms/date-picker/multi-quarter-picker.js +87 -87
- package/dist/components/forms/date-picker/multi-week-picker.js +83 -82
- package/dist/components/forms/date-picker/multi-year-picker.js +81 -81
- package/dist/components/forms/date-picker/quarter-range-picker.js +84 -84
- package/dist/components/forms/date-picker/week-picker.js +175 -174
- package/dist/components/forms/date-picker/week-range-picker.js +214 -213
- package/dist/components/forms/date-picker/year-range-picker.js +79 -79
- package/dist/components/ui/local-raster-icons/rasterIcons.d.ts +0 -1
- package/dist/components/ui/local-raster-icons/rasterIcons.js +25 -27
- package/dist/form-react/Fields/ChipsField.js +49 -48
- package/dist/form-react/Fields/DateRangeField.js +25 -25
- package/dist/form-react/Fields/MonthRangeField.js +57 -57
- package/dist/form-react/Fields/MultiMonthPickerField.js +28 -26
- package/dist/form-react/Fields/MultiWeekPickerField.js +41 -38
- package/dist/form-react/Fields/MultiYearPickerField.js +45 -45
- package/dist/form-react/Fields/SelectField.js +24 -26
- package/dist/form-react/Fields/TextFieldWithBackendValidation.js +27 -26
- package/dist/form-react/Fields/WeekRangePicker.js +18 -16
- package/dist/form-react/Fields/YearPickerField.js +27 -27
- package/dist/form-react/Fields/YearRangePickerField.js +29 -29
- package/dist/form-react/fields.d.ts +3 -0
- package/dist/form-react/fields.js +35 -29
- package/dist/form-react/types/fields.types.d.ts +39 -0
- package/dist/form-react/utils/date.utils.d.ts +52 -2
- package/dist/form-react/utils/date.utils.js +198 -62
- package/dist/i18n/defaultMessages.d.ts +5 -143
- package/dist/i18n/defaultMessages.js +25 -163
- package/dist/i18n/getDateFnsLocale.d.ts +4 -5
- package/dist/i18n/getDateFnsLocale.js +16 -46
- package/dist/i18n/i18n.types.d.ts +0 -13
- package/dist/i18n/impact-nova-i18n-context.d.ts +1 -1
- package/dist/i18n/impact-nova-i18n-context.js +25 -33
- package/dist/i18n/impact-nova-i18n-defaults.js +6 -8
- package/dist/i18n/index.d.ts +1 -4
- package/dist/i18n/index.js +16 -41
- package/dist/i18n/locales/de.js +3 -141
- package/dist/i18n/locales/es.js +3 -141
- package/dist/i18n/locales/hi.js +3 -141
- package/dist/i18n/locales/kn.js +3 -141
- package/dist/impact-nova-components.css +0 -249
- package/dist/impact-nova-tokens.scss +22 -6
- package/dist/impact-nova.css +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +603 -622
- package/dist/lib/fiscal-calendar/index.d.ts +2 -2
- package/dist/lib/fiscal-calendar/index.js +26 -24
- package/dist/lib/fiscal-calendar/week-selection.d.ts +5 -0
- package/dist/lib/fiscal-calendar/week-selection.js +56 -49
- package/dist/lib/guidance/engine/guidance-engine.d.ts +9 -0
- package/dist/lib/guidance/engine/guidance-engine.js +127 -65
- package/dist/lib/guidance/engine/manifest-validator.js +37 -30
- package/dist/lib/guidance/targets/target-resolver.d.ts +1 -1
- package/dist/lib/guidance/targets/target-resolver.js +32 -30
- package/dist/lib/guidance/types/guidance.types.d.ts +41 -0
- package/dist/lib/hash/fnv1a128.d.ts +16 -0
- package/dist/lib/hash/fnv1a128.js +21 -0
- package/dist/llms/index.js +2 -26
- package/dist/llms/rules/ag-grid.js +1 -1
- package/dist/llms/rules/best-practices.js +1 -1
- 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 +1 -3
- package/dist/providers/app-providers.js +11 -22
- package/package.json +2 -13
- package/dist/components/data/ag-grid-react/chat/chat-capabilities.d.ts +0 -9
- package/dist/components/data/ag-grid-react/chat/chat-capabilities.js +0 -22
- package/dist/components/data/ag-grid-react/chat/chat-column.d.ts +0 -20
- package/dist/components/data/ag-grid-react/chat/chat-column.js +0 -81
- package/dist/components/data/ag-grid-react/chat/chat-composer.d.ts +0 -10
- package/dist/components/data/ag-grid-react/chat/chat-composer.js +0 -352
- package/dist/components/data/ag-grid-react/chat/chat-constants.d.ts +0 -17
- package/dist/components/data/ag-grid-react/chat/chat-constants.js +0 -22
- package/dist/components/data/ag-grid-react/chat/chat-format.d.ts +0 -41
- package/dist/components/data/ag-grid-react/chat/chat-format.js +0 -94
- package/dist/components/data/ag-grid-react/chat/chat-host.d.ts +0 -10
- package/dist/components/data/ag-grid-react/chat/chat-host.js +0 -651
- package/dist/components/data/ag-grid-react/chat/chat-host.types.d.ts +0 -13
- package/dist/components/data/ag-grid-react/chat/chat-html.d.ts +0 -2
- package/dist/components/data/ag-grid-react/chat/chat-html.js +0 -40
- package/dist/components/data/ag-grid-react/chat/chat-identity.d.ts +0 -13
- package/dist/components/data/ag-grid-react/chat/chat-identity.js +0 -24
- package/dist/components/data/ag-grid-react/chat/chat-menu.d.ts +0 -13
- package/dist/components/data/ag-grid-react/chat/chat-menu.js +0 -15
- package/dist/components/data/ag-grid-react/chat/chat-notify.d.ts +0 -17
- package/dist/components/data/ag-grid-react/chat/chat-notify.js +0 -124
- package/dist/components/data/ag-grid-react/chat/chat-persist.d.ts +0 -13
- package/dist/components/data/ag-grid-react/chat/chat-persist.js +0 -34
- package/dist/components/data/ag-grid-react/chat/chat-priority.d.ts +0 -13
- package/dist/components/data/ag-grid-react/chat/chat-priority.js +0 -79
- package/dist/components/data/ag-grid-react/chat/chat-summaries.d.ts +0 -2
- package/dist/components/data/ag-grid-react/chat/chat-summaries.js +0 -24
- package/dist/components/data/ag-grid-react/chat/chat-thread-ui.d.ts +0 -72
- package/dist/components/data/ag-grid-react/chat/chat-thread-ui.js +0 -713
- package/dist/components/data/ag-grid-react/chat/chat-toggle.d.ts +0 -6
- package/dist/components/data/ag-grid-react/chat/chat-toggle.js +0 -25
- package/dist/components/data/ag-grid-react/chat/chat-ui-actions.d.ts +0 -13
- package/dist/components/data/ag-grid-react/chat/chat-ui-actions.js +0 -26
- package/dist/components/data/ag-grid-react/chat/chat-window.d.ts +0 -14
- package/dist/components/data/ag-grid-react/chat/chat-window.js +0 -82
- package/dist/components/data/ag-grid-react/chat/chat-workspace.d.ts +0 -91
- package/dist/components/data/ag-grid-react/chat/chat-workspace.js +0 -555
- package/dist/components/data/ag-grid-react/chat/chat.types.d.ts +0 -319
- package/dist/components/data/ag-grid-react/chat/index.d.ts +0 -6
- package/dist/components/data/ag-grid-react/chat/index.js +0 -24
- package/dist/components/data/ag-grid-react/chat.story-data.d.ts +0 -34
- package/dist/components/data/ag-grid-react/chat.story-sources.d.ts +0 -4
- package/dist/components/data/ag-grid-react/comments/assets/comments-no-results.png.js +0 -4
- package/dist/components/data/ag-grid-react/comments/comment-mode-toggle.d.ts +0 -6
- package/dist/components/data/ag-grid-react/comments/comment-mode-toggle.js +0 -29
- package/dist/components/data/ag-grid-react/comments/comments-actions-menu.d.ts +0 -8
- package/dist/components/data/ag-grid-react/comments/comments-actions-menu.js +0 -18
- package/dist/components/data/ag-grid-react/comments/comments-ag-grid-presence.d.ts +0 -18
- package/dist/components/data/ag-grid-react/comments/comments-ag-grid-presence.js +0 -16
- package/dist/components/data/ag-grid-react/comments/comments-capabilities.d.ts +0 -11
- package/dist/components/data/ag-grid-react/comments/comments-capabilities.js +0 -26
- package/dist/components/data/ag-grid-react/comments/comments-constants.d.ts +0 -12
- package/dist/components/data/ag-grid-react/comments/comments-constants.js +0 -21
- package/dist/components/data/ag-grid-react/comments/comments-format.d.ts +0 -20
- package/dist/components/data/ag-grid-react/comments/comments-format.js +0 -49
- package/dist/components/data/ag-grid-react/comments/comments-generation.d.ts +0 -14
- package/dist/components/data/ag-grid-react/comments/comments-generation.js +0 -18
- package/dist/components/data/ag-grid-react/comments/comments-host.d.ts +0 -10
- package/dist/components/data/ag-grid-react/comments/comments-host.js +0 -343
- package/dist/components/data/ag-grid-react/comments/comments-host.types.d.ts +0 -18
- package/dist/components/data/ag-grid-react/comments/comments-identity.d.ts +0 -7
- package/dist/components/data/ag-grid-react/comments/comments-identity.js +0 -20
- package/dist/components/data/ag-grid-react/comments/comments-menu.d.ts +0 -29
- package/dist/components/data/ag-grid-react/comments/comments-menu.js +0 -35
- package/dist/components/data/ag-grid-react/comments/comments-overlay-anchor.d.ts +0 -22
- package/dist/components/data/ag-grid-react/comments/comments-overlay-anchor.js +0 -98
- package/dist/components/data/ag-grid-react/comments/comments-overlay.d.ts +0 -21
- package/dist/components/data/ag-grid-react/comments/comments-overlay.js +0 -406
- package/dist/components/data/ag-grid-react/comments/comments-panel.d.ts +0 -9
- package/dist/components/data/ag-grid-react/comments/comments-panel.js +0 -272
- package/dist/components/data/ag-grid-react/comments/comments-persist.d.ts +0 -11
- package/dist/components/data/ag-grid-react/comments/comments-persist.js +0 -19
- package/dist/components/data/ag-grid-react/comments/comments-reveal.d.ts +0 -11
- package/dist/components/data/ag-grid-react/comments/comments-reveal.js +0 -31
- package/dist/components/data/ag-grid-react/comments/comments-ui-actions.d.ts +0 -18
- package/dist/components/data/ag-grid-react/comments/comments-ui-actions.js +0 -22
- package/dist/components/data/ag-grid-react/comments/comments-window.d.ts +0 -10
- package/dist/components/data/ag-grid-react/comments/comments-window.js +0 -62
- package/dist/components/data/ag-grid-react/comments/comments.types.d.ts +0 -178
- package/dist/components/data/ag-grid-react/comments/index.d.ts +0 -5
- package/dist/components/data/ag-grid-react/comments/index.js +0 -15
- package/dist/components/data/ag-grid-react/comments-cell-renderers-showcase.d.ts +0 -25
- package/dist/components/data/ag-grid-react/comments.story-data.d.ts +0 -37
- package/dist/components/data/ag-grid-react/comments.story-sources.d.ts +0 -11
- package/dist/components/data/ag-grid-react/grid-cell-address.d.ts +0 -21
- package/dist/components/data/ag-grid-react/grid-cell-address.js +0 -21
- package/dist/components/data/ag-grid-react/grid-row-reveal.d.ts +0 -34
- package/dist/components/data/ag-grid-react/grid-row-reveal.js +0 -33
- package/dist/components/data/ag-grid-react/notes/index.d.ts +0 -2
- package/dist/components/data/ag-grid-react/notes/index.js +0 -1
- package/dist/components/data/ag-grid-react/notes/notes-ag-grid-adapter.d.ts +0 -25
- package/dist/components/data/ag-grid-react/notes/notes-ag-grid-adapter.js +0 -32
- package/dist/components/data/ag-grid-react/notes/notes-constants.d.ts +0 -2
- package/dist/components/data/ag-grid-react/notes/notes-constants.js +0 -4
- package/dist/components/data/ag-grid-react/notes/notes.types.d.ts +0 -12
- package/dist/components/data/ag-grid-react/notes.story-sources.d.ts +0 -7
- package/dist/components/data/ag-grid-react/nova-system-column.d.ts +0 -7
- package/dist/components/data/ag-grid-react/nova-system-column.js +0 -18
- package/dist/components/forms/date-picker/use-picker-i18n.d.ts +0 -6
- package/dist/components/forms/date-picker/use-picker-i18n.js +0 -11
- package/dist/components/ui/local-raster-icons/message3d.webp.js +0 -4
- package/dist/i18n/format/collator.d.ts +0 -1
- package/dist/i18n/format/collator.js +0 -7
- package/dist/i18n/format/date-pattern.d.ts +0 -5
- package/dist/i18n/format/date-pattern.js +0 -20
- package/dist/i18n/format/format-date.d.ts +0 -9
- package/dist/i18n/format/format-date.js +0 -56
- package/dist/i18n/format/format-number.d.ts +0 -20
- package/dist/i18n/format/format-number.js +0 -68
- package/dist/i18n/format/formatter-cache.d.ts +0 -9
- package/dist/i18n/format/formatter-cache.js +0 -66
- package/dist/i18n/format/index.d.ts +0 -6
- package/dist/i18n/format/parse-number.d.ts +0 -6
- package/dist/i18n/format/parse-number.js +0 -53
- package/dist/i18n/locale-config.d.ts +0 -28
- package/dist/i18n/locale-config.js +0 -32
- package/dist/i18n/week-start.d.ts +0 -6
- package/dist/i18n/week-start.js +0 -30
- package/dist/llms/rules/data-table-chat.js +0 -1
- package/dist/llms/rules/data-table-comments.js +0 -1
- package/dist/llms/rules/data-table-notes.js +0 -1
|
@@ -1,72 +1,72 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import { Controller as
|
|
3
|
-
import { MonthRangePicker as
|
|
4
|
-
import { getFieldTestId as
|
|
5
|
-
import {
|
|
6
|
-
const
|
|
7
|
-
if (
|
|
8
|
-
const [
|
|
9
|
-
return { year: parseInt(
|
|
1
|
+
import { jsx as i } from "react/jsx-runtime";
|
|
2
|
+
import { Controller as F } from "react-hook-form";
|
|
3
|
+
import { MonthRangePicker as b } from "../../components/forms/date-picker/month-range-picker.js";
|
|
4
|
+
import { getFieldTestId as w } from "../utils/fieldTestIds.js";
|
|
5
|
+
import { resolveMonthRangeMinMax as I } from "../utils/date.utils.js";
|
|
6
|
+
const D = (r) => {
|
|
7
|
+
if (r.includes("/")) {
|
|
8
|
+
const [a, l] = r.split("/");
|
|
9
|
+
return { year: parseInt(l, 10), month: parseInt(a, 10) - 1 };
|
|
10
10
|
}
|
|
11
|
-
const [
|
|
12
|
-
return { year: parseInt(
|
|
13
|
-
},
|
|
14
|
-
field:
|
|
15
|
-
validationRules:
|
|
16
|
-
isDisabled:
|
|
17
|
-
formHelpers:
|
|
11
|
+
const [n, s] = r.split("-");
|
|
12
|
+
return { year: parseInt(n, 10), month: parseInt(s, 10) - 1 };
|
|
13
|
+
}, K = ({
|
|
14
|
+
field: r,
|
|
15
|
+
validationRules: n,
|
|
16
|
+
isDisabled: s,
|
|
17
|
+
formHelpers: a
|
|
18
18
|
}) => {
|
|
19
|
-
const
|
|
20
|
-
if (!
|
|
21
|
-
const y =
|
|
22
|
-
return /* @__PURE__ */
|
|
23
|
-
|
|
19
|
+
const l = a.form.control, e = r.fieldType === "month_range" ? r : null;
|
|
20
|
+
if (!e) return null;
|
|
21
|
+
const y = e.displayFormat || "MM/YYYY", { minDate: u, maxDate: c, startMonth: v, endMonth: $ } = I(e);
|
|
22
|
+
return /* @__PURE__ */ i(
|
|
23
|
+
F,
|
|
24
24
|
{
|
|
25
|
-
name:
|
|
26
|
-
control:
|
|
27
|
-
defaultValue:
|
|
28
|
-
rules:
|
|
29
|
-
render: ({ field: d, fieldState:
|
|
30
|
-
const
|
|
31
|
-
return /* @__PURE__ */
|
|
32
|
-
|
|
25
|
+
name: r.id,
|
|
26
|
+
control: l,
|
|
27
|
+
defaultValue: e.defaultRange ? { start: e.defaultRange.start || null, end: e.defaultRange.end || null } : void 0,
|
|
28
|
+
rules: n,
|
|
29
|
+
render: ({ field: d, fieldState: p }) => {
|
|
30
|
+
const M = !!p.error, o = d.value, h = o?.start ? D(o.start) : null, S = o?.end ? D(o.end) : null, x = h && S;
|
|
31
|
+
return /* @__PURE__ */ i("div", { "data-testid": w(r.id), children: /* @__PURE__ */ i(
|
|
32
|
+
b,
|
|
33
33
|
{
|
|
34
|
-
label:
|
|
34
|
+
label: r.label,
|
|
35
35
|
displayFormat: y,
|
|
36
|
-
...
|
|
36
|
+
...x && {
|
|
37
37
|
value: {
|
|
38
|
-
from:
|
|
39
|
-
to:
|
|
38
|
+
from: h,
|
|
39
|
+
to: S
|
|
40
40
|
}
|
|
41
41
|
},
|
|
42
|
-
onChange: (
|
|
43
|
-
if (!
|
|
44
|
-
const
|
|
45
|
-
d.onChange(
|
|
42
|
+
onChange: (t) => {
|
|
43
|
+
if (!t?.from || !t?.to) {
|
|
44
|
+
const g = { start: null, end: null };
|
|
45
|
+
d.onChange(g), a.setValue(r.id, g);
|
|
46
46
|
return;
|
|
47
47
|
}
|
|
48
|
-
const
|
|
49
|
-
start:
|
|
50
|
-
end:
|
|
48
|
+
const Y = t.from.start ? `${t.from.start.getFullYear()}-${String(t.from.start.getMonth() + 1).padStart(2, "0")}-${String(t.from.start.getDate()).padStart(2, "0")}` : `${t.from.year}-${String(t.from.month + 1).padStart(2, "0")}-01`, m = t.to.end ? t.to.end.getDate() : new Date(t.to.year, t.to.month + 1, 0).getDate(), T = t.to.end ? `${t.to.end.getFullYear()}-${String(t.to.end.getMonth() + 1).padStart(2, "0")}-${String(m).padStart(2, "0")}` : `${t.to.year}-${String(t.to.month + 1).padStart(2, "0")}-${String(m).padStart(2, "0")}`, f = {
|
|
49
|
+
start: Y,
|
|
50
|
+
end: T
|
|
51
51
|
};
|
|
52
|
-
d.onChange(
|
|
52
|
+
d.onChange(f), a.setValue(r.id, f);
|
|
53
53
|
},
|
|
54
|
-
placeholder:
|
|
55
|
-
minDate:
|
|
56
|
-
maxDate:
|
|
57
|
-
startMonth:
|
|
58
|
-
endMonth:
|
|
59
|
-
required:
|
|
60
|
-
disabled:
|
|
61
|
-
error:
|
|
62
|
-
helperText:
|
|
54
|
+
placeholder: r.placeholder,
|
|
55
|
+
minDate: u,
|
|
56
|
+
maxDate: c,
|
|
57
|
+
startMonth: v ?? u,
|
|
58
|
+
endMonth: $ ?? c,
|
|
59
|
+
required: r.isRequired,
|
|
60
|
+
disabled: s,
|
|
61
|
+
error: M,
|
|
62
|
+
helperText: M ? p.error?.message : r.helpText,
|
|
63
63
|
showFooter: !0,
|
|
64
|
-
calendarKind:
|
|
65
|
-
fiscalMode:
|
|
66
|
-
fiscalYearStartMonth:
|
|
67
|
-
fiscalMonthPattern:
|
|
68
|
-
showPresets:
|
|
69
|
-
autoNavigateToAvailable:
|
|
64
|
+
calendarKind: e.calendarKind,
|
|
65
|
+
fiscalMode: e.fiscalMode,
|
|
66
|
+
fiscalYearStartMonth: e.fiscalYearStartMonth,
|
|
67
|
+
fiscalMonthPattern: e.fiscalMonthPattern,
|
|
68
|
+
showPresets: e.showPresets,
|
|
69
|
+
autoNavigateToAvailable: e.autoNavigateToAvailable
|
|
70
70
|
}
|
|
71
71
|
) });
|
|
72
72
|
}
|
|
@@ -74,5 +74,5 @@ const w = (a) => {
|
|
|
74
74
|
);
|
|
75
75
|
};
|
|
76
76
|
export {
|
|
77
|
-
|
|
77
|
+
K as MonthRangeField
|
|
78
78
|
};
|
|
@@ -1,47 +1,49 @@
|
|
|
1
1
|
import { jsx as o } from "react/jsx-runtime";
|
|
2
|
-
import { Controller as
|
|
3
|
-
import { MultiMonthPicker as
|
|
4
|
-
import { getFieldTestId as
|
|
5
|
-
import {
|
|
6
|
-
const
|
|
2
|
+
import { Controller as v } from "react-hook-form";
|
|
3
|
+
import { MultiMonthPicker as g } from "../../components/forms/date-picker/multi-month-picker.js";
|
|
4
|
+
import { getFieldTestId as x } from "../utils/fieldTestIds.js";
|
|
5
|
+
import { resolveMonthRangeMinMax as T } from "../utils/date.utils.js";
|
|
6
|
+
const q = ({
|
|
7
7
|
field: r,
|
|
8
|
-
validationRules:
|
|
8
|
+
validationRules: i,
|
|
9
9
|
isDisabled: u,
|
|
10
|
-
formHelpers:
|
|
10
|
+
formHelpers: m
|
|
11
11
|
}) => {
|
|
12
|
-
const s =
|
|
13
|
-
|
|
14
|
-
|
|
12
|
+
const s = m.form.control, e = r.fieldType === "multi_month_picker" ? r : null;
|
|
13
|
+
if (!e) return null;
|
|
14
|
+
const { minDate: h, maxDate: c, startMonth: d, endMonth: p } = T(e);
|
|
15
|
+
return /* @__PURE__ */ o(
|
|
16
|
+
v,
|
|
15
17
|
{
|
|
16
18
|
name: r.id,
|
|
17
19
|
control: s,
|
|
18
|
-
rules:
|
|
19
|
-
render: ({ field:
|
|
20
|
-
const
|
|
21
|
-
return /* @__PURE__ */ o("div", { "data-testid":
|
|
22
|
-
|
|
20
|
+
rules: i,
|
|
21
|
+
render: ({ field: t, fieldState: n }) => {
|
|
22
|
+
const a = !!n.error, l = t.value;
|
|
23
|
+
return /* @__PURE__ */ o("div", { "data-testid": x(r.id), children: /* @__PURE__ */ o(
|
|
24
|
+
g,
|
|
23
25
|
{
|
|
24
26
|
label: r.label,
|
|
25
|
-
value: Array.isArray(
|
|
26
|
-
onChange: (
|
|
27
|
-
|
|
27
|
+
value: Array.isArray(l) ? l : void 0,
|
|
28
|
+
onChange: (M) => {
|
|
29
|
+
t.onChange(M ?? []);
|
|
28
30
|
},
|
|
29
31
|
placeholder: r.placeholder,
|
|
30
32
|
required: r.isRequired,
|
|
31
33
|
disabled: u,
|
|
32
|
-
error:
|
|
33
|
-
helperText:
|
|
34
|
-
minDate:
|
|
35
|
-
maxDate:
|
|
36
|
-
startMonth:
|
|
37
|
-
endMonth:
|
|
34
|
+
error: a,
|
|
35
|
+
helperText: a ? n.error?.message : r.helpText,
|
|
36
|
+
minDate: h,
|
|
37
|
+
maxDate: c,
|
|
38
|
+
startMonth: d,
|
|
39
|
+
endMonth: p,
|
|
38
40
|
autoNavigateToAvailable: e.autoNavigateToAvailable
|
|
39
41
|
}
|
|
40
42
|
) });
|
|
41
43
|
}
|
|
42
44
|
}
|
|
43
|
-
)
|
|
45
|
+
);
|
|
44
46
|
};
|
|
45
47
|
export {
|
|
46
|
-
|
|
48
|
+
q as MultiMonthPickerField
|
|
47
49
|
};
|
|
@@ -1,55 +1,58 @@
|
|
|
1
1
|
import { jsx as a } from "react/jsx-runtime";
|
|
2
|
-
import { Controller as
|
|
2
|
+
import { Controller as f } from "react-hook-form";
|
|
3
3
|
import { MultiWeekPicker as p } from "../../components/forms/date-picker/multi-week-picker.js";
|
|
4
|
-
import { fiscalCalendarPassThrough as
|
|
5
|
-
import { getFieldTestId as
|
|
6
|
-
import {
|
|
7
|
-
const
|
|
8
|
-
field:
|
|
9
|
-
validationRules:
|
|
10
|
-
isDisabled:
|
|
4
|
+
import { fiscalCalendarPassThrough as g } from "../../components/forms/date-picker/fiscal-pass-through.js";
|
|
5
|
+
import { getFieldTestId as k } from "../utils/fieldTestIds.js";
|
|
6
|
+
import { resolveWeekRangeMinMax as M } from "../utils/date.utils.js";
|
|
7
|
+
const b = ({
|
|
8
|
+
field: r,
|
|
9
|
+
validationRules: l,
|
|
10
|
+
isDisabled: s,
|
|
11
11
|
formHelpers: c
|
|
12
12
|
}) => {
|
|
13
|
-
const
|
|
14
|
-
|
|
15
|
-
|
|
13
|
+
const u = c.form.control, e = r.fieldType === "multi_week_picker" ? r : null;
|
|
14
|
+
if (!e) return null;
|
|
15
|
+
const { minDate: d, maxDate: m } = M(e);
|
|
16
|
+
return /* @__PURE__ */ a(
|
|
17
|
+
f,
|
|
16
18
|
{
|
|
17
|
-
name:
|
|
18
|
-
control:
|
|
19
|
-
rules:
|
|
20
|
-
render: ({ field:
|
|
21
|
-
const i = !!
|
|
22
|
-
return /* @__PURE__ */ a("div", { "data-testid":
|
|
19
|
+
name: r.id,
|
|
20
|
+
control: u,
|
|
21
|
+
rules: l,
|
|
22
|
+
render: ({ field: o, fieldState: t }) => {
|
|
23
|
+
const i = !!t.error, n = o.value;
|
|
24
|
+
return /* @__PURE__ */ a("div", { "data-testid": k(r.id), children: /* @__PURE__ */ a(
|
|
23
25
|
p,
|
|
24
26
|
{
|
|
25
|
-
label:
|
|
26
|
-
value: Array.isArray(
|
|
27
|
-
onChange: (
|
|
28
|
-
|
|
27
|
+
label: r.label,
|
|
28
|
+
value: Array.isArray(n) ? n : void 0,
|
|
29
|
+
onChange: (h) => {
|
|
30
|
+
o.onChange(h ?? []);
|
|
29
31
|
},
|
|
30
|
-
placeholder:
|
|
31
|
-
required:
|
|
32
|
-
disabled:
|
|
32
|
+
placeholder: r.placeholder,
|
|
33
|
+
required: r.isRequired,
|
|
34
|
+
disabled: s,
|
|
33
35
|
error: i,
|
|
34
|
-
helperText: i ?
|
|
35
|
-
minDate:
|
|
36
|
-
maxDate:
|
|
37
|
-
...
|
|
38
|
-
calendarKind:
|
|
39
|
-
fiscalMode:
|
|
40
|
-
granularity:
|
|
41
|
-
fiscalMonthPattern:
|
|
42
|
-
fiscalYearStartMonth:
|
|
43
|
-
weekStartsOn:
|
|
44
|
-
|
|
45
|
-
|
|
36
|
+
helperText: i ? t.error?.message : r.helpText,
|
|
37
|
+
minDate: d,
|
|
38
|
+
maxDate: m,
|
|
39
|
+
...g({
|
|
40
|
+
calendarKind: e.calendarKind,
|
|
41
|
+
fiscalMode: e.fiscalMode,
|
|
42
|
+
granularity: e.granularity,
|
|
43
|
+
fiscalMonthPattern: e.fiscalMonthPattern,
|
|
44
|
+
fiscalYearStartMonth: e.fiscalYearStartMonth,
|
|
45
|
+
weekStartsOn: e.weekStartsOn,
|
|
46
|
+
fiscalConfig: e.fiscalConfig,
|
|
47
|
+
showPeriodBoundaries: e.showPeriodBoundaries,
|
|
48
|
+
autoNavigateToAvailable: e.autoNavigateToAvailable
|
|
46
49
|
})
|
|
47
50
|
}
|
|
48
51
|
) });
|
|
49
52
|
}
|
|
50
53
|
}
|
|
51
|
-
)
|
|
54
|
+
);
|
|
52
55
|
};
|
|
53
56
|
export {
|
|
54
|
-
|
|
57
|
+
b as MultiWeekPickerField
|
|
55
58
|
};
|
|
@@ -1,52 +1,52 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import { Controller as
|
|
3
|
-
import { MultiYearPicker as
|
|
4
|
-
import { getFieldTestId as
|
|
5
|
-
import {
|
|
6
|
-
const
|
|
7
|
-
field:
|
|
8
|
-
validationRules:
|
|
9
|
-
isDisabled:
|
|
10
|
-
formHelpers:
|
|
1
|
+
import { jsx as o } from "react/jsx-runtime";
|
|
2
|
+
import { Controller as v } from "react-hook-form";
|
|
3
|
+
import { MultiYearPicker as P } from "../../components/forms/date-picker/multi-year-picker.js";
|
|
4
|
+
import { getFieldTestId as Y } from "../utils/fieldTestIds.js";
|
|
5
|
+
import { resolveYearRangeMinMax as g } from "../utils/date.utils.js";
|
|
6
|
+
const T = ({
|
|
7
|
+
field: e,
|
|
8
|
+
validationRules: u,
|
|
9
|
+
isDisabled: c,
|
|
10
|
+
formHelpers: a
|
|
11
11
|
}) => {
|
|
12
|
-
const
|
|
13
|
-
if (!
|
|
14
|
-
const
|
|
15
|
-
return /* @__PURE__ */
|
|
16
|
-
|
|
12
|
+
const r = e.fieldType === "multi_year_picker" ? e : null;
|
|
13
|
+
if (!r) return null;
|
|
14
|
+
const { minDate: h, maxDate: d, startMonth: m, endMonth: p } = g(r), M = a.form.control, w = r.defaultValue?.map((t) => ({ year: t }));
|
|
15
|
+
return /* @__PURE__ */ o(
|
|
16
|
+
v,
|
|
17
17
|
{
|
|
18
|
-
name:
|
|
19
|
-
control:
|
|
20
|
-
defaultValue:
|
|
21
|
-
rules:
|
|
22
|
-
render: ({ field:
|
|
23
|
-
const
|
|
24
|
-
return /* @__PURE__ */
|
|
25
|
-
|
|
18
|
+
name: e.id,
|
|
19
|
+
control: M,
|
|
20
|
+
defaultValue: w,
|
|
21
|
+
rules: u,
|
|
22
|
+
render: ({ field: t, fieldState: n }) => {
|
|
23
|
+
const l = !!n.error, s = t.value, f = Array.isArray(s) ? s : void 0;
|
|
24
|
+
return /* @__PURE__ */ o("div", { "data-testid": Y(e.id), children: /* @__PURE__ */ o(
|
|
25
|
+
P,
|
|
26
26
|
{
|
|
27
|
-
label:
|
|
28
|
-
value:
|
|
27
|
+
label: e.label,
|
|
28
|
+
value: f,
|
|
29
29
|
onChange: (i) => {
|
|
30
|
-
|
|
30
|
+
t.onChange(i ?? null), a.setValue(e.id, i ?? null);
|
|
31
31
|
},
|
|
32
|
-
placeholder:
|
|
33
|
-
minDate:
|
|
34
|
-
maxDate:
|
|
35
|
-
startMonth:
|
|
36
|
-
endMonth:
|
|
37
|
-
required:
|
|
38
|
-
disabled:
|
|
39
|
-
error:
|
|
40
|
-
helperText:
|
|
41
|
-
showFooter:
|
|
42
|
-
showIntervalCaption:
|
|
43
|
-
calendarKind:
|
|
44
|
-
fiscalMode:
|
|
45
|
-
fiscalYearStartMonth:
|
|
46
|
-
fiscalMonthPattern:
|
|
47
|
-
weekStartsOn:
|
|
48
|
-
showPresets:
|
|
49
|
-
...
|
|
32
|
+
placeholder: e.placeholder,
|
|
33
|
+
minDate: h,
|
|
34
|
+
maxDate: d,
|
|
35
|
+
startMonth: m,
|
|
36
|
+
endMonth: p,
|
|
37
|
+
required: e.isRequired,
|
|
38
|
+
disabled: c,
|
|
39
|
+
error: l,
|
|
40
|
+
helperText: l ? n.error?.message : e.helpText,
|
|
41
|
+
showFooter: r.showFooter,
|
|
42
|
+
showIntervalCaption: r.showIntervalCaption,
|
|
43
|
+
calendarKind: r.calendarKind,
|
|
44
|
+
fiscalMode: r.fiscalMode,
|
|
45
|
+
fiscalYearStartMonth: r.fiscalYearStartMonth,
|
|
46
|
+
fiscalMonthPattern: r.fiscalMonthPattern,
|
|
47
|
+
weekStartsOn: r.weekStartsOn,
|
|
48
|
+
showPresets: r.showPresets,
|
|
49
|
+
...r.componentProps
|
|
50
50
|
}
|
|
51
51
|
) });
|
|
52
52
|
}
|
|
@@ -54,5 +54,5 @@ const g = ({
|
|
|
54
54
|
);
|
|
55
55
|
};
|
|
56
56
|
export {
|
|
57
|
-
|
|
57
|
+
T as MultiYearPickerField
|
|
58
58
|
};
|
|
@@ -1,47 +1,46 @@
|
|
|
1
1
|
import { jsx as c } from "react/jsx-runtime";
|
|
2
2
|
import { useState as A } from "react";
|
|
3
|
-
import { Controller as
|
|
4
|
-
import { Select as
|
|
3
|
+
import { Controller as f } from "react-hook-form";
|
|
4
|
+
import { Select as M } from "../../components/forms/select/select.js";
|
|
5
5
|
import { useSelectOptions as x } from "../hooks/useSelectOptions.js";
|
|
6
|
-
import { getFieldTestId as
|
|
7
|
-
|
|
8
|
-
const $ = ({
|
|
6
|
+
import { getFieldTestId as T } from "../utils/fieldTestIds.js";
|
|
7
|
+
const L = ({
|
|
9
8
|
field: e,
|
|
10
9
|
validationRules: p,
|
|
11
|
-
isDisabled:
|
|
12
|
-
formHelpers:
|
|
13
|
-
supportedValues:
|
|
10
|
+
isDisabled: u,
|
|
11
|
+
formHelpers: n,
|
|
12
|
+
supportedValues: d
|
|
14
13
|
}) => {
|
|
15
|
-
const t = e.fieldType === "select" ? e : null, [
|
|
14
|
+
const t = e.fieldType === "select" ? e : null, [m, i] = A(!1), S = n.form.control, h = d?.[e.id], { options: g, isLoading: b, error: O, refetch: C } = x({
|
|
16
15
|
apiConfig: t?.apiConfig,
|
|
17
|
-
formHelpers:
|
|
16
|
+
formHelpers: n,
|
|
18
17
|
initialOptions: t?.options,
|
|
19
18
|
id: e.id,
|
|
20
|
-
isEnabled:
|
|
19
|
+
isEnabled: m,
|
|
21
20
|
getSelectOptionsName: t?.getSelectOptionsName,
|
|
22
21
|
fieldSupportedValues: h,
|
|
23
22
|
cascadingDependency: e.cascadingDependency
|
|
24
23
|
});
|
|
25
24
|
return t ? /* @__PURE__ */ c(
|
|
26
|
-
|
|
25
|
+
f,
|
|
27
26
|
{
|
|
28
27
|
name: e.id,
|
|
29
28
|
control: S,
|
|
30
29
|
rules: p,
|
|
31
30
|
render: ({ field: o, fieldState: l }) => {
|
|
32
|
-
const
|
|
31
|
+
const s = !!l.error, a = o.value, y = t?.isMultiSelect ? a ?? [] : a?.[0] ?? null;
|
|
33
32
|
return /* @__PURE__ */ c(
|
|
34
|
-
|
|
33
|
+
M,
|
|
35
34
|
{
|
|
36
35
|
id: e.id,
|
|
37
36
|
label: e.label,
|
|
38
37
|
placeholder: e?.placeholder,
|
|
39
38
|
required: e.isRequired,
|
|
40
39
|
isReadOnly: e.isFieldReadonly,
|
|
41
|
-
disabled:
|
|
40
|
+
disabled: u,
|
|
42
41
|
options: g,
|
|
43
42
|
maxSelectableOptions: t?.maxSelectLimit,
|
|
44
|
-
value:
|
|
43
|
+
value: y,
|
|
45
44
|
onChange: (r) => {
|
|
46
45
|
t?.isMultiSelect ? o.onChange(
|
|
47
46
|
Array.isArray(r) ? r : []
|
|
@@ -54,22 +53,21 @@ const $ = ({
|
|
|
54
53
|
multiple: t?.isMultiSelect,
|
|
55
54
|
isSelectAllEnabled: !t?.disableSelectAll,
|
|
56
55
|
labelOrientation: t?.labelOrientation || "top",
|
|
57
|
-
error:
|
|
58
|
-
helperText:
|
|
56
|
+
error: s,
|
|
57
|
+
helperText: s ? l.error?.message : e.helpText,
|
|
59
58
|
ignoreAccents: !0,
|
|
60
59
|
isLoading: b,
|
|
61
|
-
fetchError:
|
|
62
|
-
onRefetch:
|
|
63
|
-
onMenuOpen: () =>
|
|
64
|
-
onMenuClose: () =>
|
|
65
|
-
"data-testid":
|
|
66
|
-
}
|
|
67
|
-
C
|
|
60
|
+
fetchError: O,
|
|
61
|
+
onRefetch: C,
|
|
62
|
+
onMenuOpen: () => i(!0),
|
|
63
|
+
onMenuClose: () => i(!1),
|
|
64
|
+
"data-testid": T(e.id)
|
|
65
|
+
}
|
|
68
66
|
);
|
|
69
67
|
}
|
|
70
68
|
}
|
|
71
69
|
) : null;
|
|
72
70
|
};
|
|
73
71
|
export {
|
|
74
|
-
|
|
72
|
+
L as SelectField
|
|
75
73
|
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { jsx as m, jsxs as
|
|
2
|
-
import { useRef as p, useState as
|
|
1
|
+
import { jsx as m, jsxs as v } from "react/jsx-runtime";
|
|
2
|
+
import { useRef as p, useState as T } from "react";
|
|
3
3
|
import { Controller as k } from "react-hook-form";
|
|
4
4
|
import { SmartInput as I } from "../../components/forms/smart-input/smart-input.js";
|
|
5
5
|
const B = ({
|
|
@@ -8,35 +8,35 @@ const B = ({
|
|
|
8
8
|
isDisabled: x,
|
|
9
9
|
formHelpers: t
|
|
10
10
|
}) => {
|
|
11
|
-
const i = e.fieldType === "text_with_backend_validation" ? e : null, o = p(!1), l = p(null), [h, f] =
|
|
11
|
+
const i = e.fieldType === "text_with_backend_validation" ? e : null, o = p(!1), l = p(null), [h, f] = T(!1), C = async (n) => {
|
|
12
12
|
if (i?.validationConfig?.omitValidation?.includes(
|
|
13
13
|
e.id
|
|
14
14
|
)) {
|
|
15
15
|
o.current = !1, l.current = null, await t.form.trigger(e.id);
|
|
16
16
|
return;
|
|
17
17
|
}
|
|
18
|
-
if (!(!
|
|
18
|
+
if (!(!n || n.trim() === "")) {
|
|
19
19
|
f(!0);
|
|
20
20
|
try {
|
|
21
|
-
const
|
|
21
|
+
const r = e.handlerName ? t.formContext?.functions?.[e.handlerName] : void 0;
|
|
22
22
|
let a;
|
|
23
|
-
if (
|
|
24
|
-
const
|
|
23
|
+
if (r) {
|
|
24
|
+
const s = i?.validationConfig?.fieldValuesToIncludeInApiRequest || [], d = s.length > 0 ? s.reduce(
|
|
25
25
|
(u, c) => (u[c] = t.form.getValues(c), u),
|
|
26
26
|
{}
|
|
27
27
|
) : {};
|
|
28
|
-
a = await
|
|
28
|
+
a = await r({
|
|
29
29
|
formHelpers: t,
|
|
30
30
|
fieldId: e.id,
|
|
31
|
-
newValue:
|
|
31
|
+
newValue: n,
|
|
32
32
|
oldValue: t.getPreviousFieldValue(e.id),
|
|
33
|
-
payload: { includedFieldValues:
|
|
33
|
+
payload: { includedFieldValues: d }
|
|
34
34
|
});
|
|
35
35
|
} else {
|
|
36
36
|
if (!i?.validationConfig)
|
|
37
37
|
throw new Error("Validation config is required");
|
|
38
|
-
const
|
|
39
|
-
(
|
|
38
|
+
const s = i.validationConfig.method || "POST", d = i.validationConfig.fieldValuesToIncludeInApiRequest || [], u = d.length > 0 ? d.reduce(
|
|
39
|
+
(w, V) => (w[V] = t.form.getValues(V), w),
|
|
40
40
|
{}
|
|
41
41
|
) : {}, c = i.validationConfig.apiEndpoint;
|
|
42
42
|
if (!c)
|
|
@@ -45,8 +45,8 @@ const B = ({
|
|
|
45
45
|
{
|
|
46
46
|
formHelpers: t,
|
|
47
47
|
apiEndpoint: c,
|
|
48
|
-
value:
|
|
49
|
-
method:
|
|
48
|
+
value: n,
|
|
49
|
+
method: s,
|
|
50
50
|
fieldValuesToIncludeInApiRequest: u
|
|
51
51
|
}
|
|
52
52
|
), !a)
|
|
@@ -55,10 +55,10 @@ const B = ({
|
|
|
55
55
|
);
|
|
56
56
|
}
|
|
57
57
|
a?.is_valid ? (o.current = !1, l.current = null, await t.form.trigger(e.id)) : (o.current = !0, l.current = a?.message?.trim() || `This ${e.label} is already taken`, await t.form.trigger(e.id));
|
|
58
|
-
} catch (
|
|
59
|
-
o.current = !0, l.current =
|
|
58
|
+
} catch (r) {
|
|
59
|
+
o.current = !0, l.current = r instanceof Error ? r.message : `This ${e.label} is already taken`, await t.form.trigger(e.id), t.formContext?.transport?.showFormErrorToast?.({
|
|
60
60
|
title: "Error",
|
|
61
|
-
description:
|
|
61
|
+
description: r instanceof Error ? r.message : "Something went wrong"
|
|
62
62
|
});
|
|
63
63
|
} finally {
|
|
64
64
|
f(!1);
|
|
@@ -77,34 +77,35 @@ const B = ({
|
|
|
77
77
|
backendValidation: () => o.current ? l.current || "Validation pending" : !0
|
|
78
78
|
}
|
|
79
79
|
},
|
|
80
|
-
render: ({ field:
|
|
81
|
-
const a = !!
|
|
82
|
-
return /* @__PURE__ */
|
|
80
|
+
render: ({ field: n, fieldState: r }) => {
|
|
81
|
+
const a = !!r.error && r.error.message !== "Validation pending", s = n.value, d = a && !h ? r.error?.message : void 0;
|
|
82
|
+
return /* @__PURE__ */ v("div", { className: "w-full min-w-0", children: [
|
|
83
83
|
/* @__PURE__ */ m(
|
|
84
84
|
I,
|
|
85
85
|
{
|
|
86
86
|
label: e.label,
|
|
87
87
|
type: "text",
|
|
88
|
-
value:
|
|
88
|
+
value: s ?? void 0,
|
|
89
89
|
onChange: (u) => {
|
|
90
|
-
u ? (o.current = !0, l.current = null) : (o.current = !1, l.current = null),
|
|
90
|
+
u ? (o.current = !0, l.current = null) : (o.current = !1, l.current = null), n.onChange(u);
|
|
91
91
|
},
|
|
92
92
|
onBlur: () => {
|
|
93
|
-
|
|
93
|
+
n.onBlur(), C(s ?? "");
|
|
94
94
|
},
|
|
95
95
|
placeholder: e.placeholder,
|
|
96
96
|
required: e.isRequired,
|
|
97
97
|
disabled: x,
|
|
98
98
|
error: a && !h,
|
|
99
|
-
helperText: h ? "Validating…" : a ? void 0 : e.helpText
|
|
99
|
+
helperText: h ? "Validating…" : a ? void 0 : e.helpText,
|
|
100
|
+
allowSpecialCharacters: i.allowSpecialCharacters
|
|
100
101
|
}
|
|
101
102
|
),
|
|
102
|
-
|
|
103
|
+
d ? /* @__PURE__ */ m(
|
|
103
104
|
"p",
|
|
104
105
|
{
|
|
105
106
|
className: "mt-2 text-sm leading-snug text-[#DC2626] break-words",
|
|
106
107
|
role: "alert",
|
|
107
|
-
children:
|
|
108
|
+
children: d
|
|
108
109
|
}
|
|
109
110
|
) : null
|
|
110
111
|
] });
|