@12-apps/ui 6.89.1 → 6.90.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/components-catalog.md +1 -1
- package/dist/_internal/components/data-display/Alert/Alert.js +3 -3
- package/dist/_internal/components/data-display/Avatar/Avatar.js +4 -4
- package/dist/_internal/components/data-display/Avatar/Avatar.view.js +2 -2
- package/dist/_internal/components/data-display/CardKit/card-actions-context.js +4 -4
- package/dist/_internal/components/data-display/CardKit/use-remove-confirm.js +5 -5
- package/dist/_internal/components/data-display/Carousel/Carousel.chrome.js +4 -3
- package/dist/_internal/components/data-display/Carousel/Carousel.js +6 -5
- package/dist/_internal/components/data-display/Carousel/Carousel.parts.js +3 -2
- package/dist/_internal/components/data-display/Chart/Chart.js +3 -3
- package/dist/_internal/components/data-display/Chart/SpecChart.js +6 -6
- package/dist/_internal/components/data-display/Chart/chart-renderers.js +2 -2
- package/dist/_internal/components/data-display/Chart/chart-spec.js +2 -2
- package/dist/_internal/components/data-display/DataGrid/DataGrid.js +2 -2
- package/dist/_internal/components/data-display/DataViews/DataViewsGrid.js +48 -23
- package/dist/_internal/components/data-display/DataViews/DataViewsTableBase.js +53 -28
- package/dist/_internal/components/data-display/DataViews/base-list-card-geometry.js +1 -1
- package/dist/_internal/components/data-display/DataViews/base-list-card-layout.js +1 -1
- package/dist/_internal/components/data-display/DataViews/base-list-card.js +3 -3
- package/dist/_internal/components/data-display/DataViews/data-views-bar-controls.js +5 -3
- package/dist/_internal/components/data-display/DataViews/data-views-day-input.js +1 -1
- package/dist/_internal/components/data-display/DataViews/data-views-filter-panel.js +31 -6
- package/dist/_internal/components/data-display/DataViews/data-views-grid-bodies.js +3 -3
- package/dist/_internal/components/data-display/DataViews/data-views-grid-parts.js +47 -22
- package/dist/_internal/components/data-display/DataViews/data-views-inline-bar.js +37 -12
- package/dist/_internal/components/data-display/DataViews/data-views-more-fields.js +32 -7
- package/dist/_internal/components/data-display/DataViews/data-views-more-filters.js +33 -8
- package/dist/_internal/components/data-display/DataViews/data-views-number-input.js +1 -1
- package/dist/_internal/components/data-display/DataViews/data-views-preset-chips.js +10 -3
- package/dist/_internal/components/data-display/DataViews/data-views-range-bounds.js +47 -0
- package/dist/_internal/components/data-display/DataViews/data-views-range-bounds.js.map +1 -0
- package/dist/_internal/components/data-display/DataViews/data-views-range-calendar.js +36 -0
- package/dist/_internal/components/data-display/DataViews/data-views-range-calendar.js.map +1 -0
- package/dist/_internal/components/data-display/DataViews/data-views-range-pill.js +32 -6
- package/dist/_internal/components/data-display/DataViews/data-views-range-summary.js +12 -0
- package/dist/_internal/components/data-display/DataViews/data-views-range-summary.js.map +1 -0
- package/dist/_internal/components/data-display/DataViews/data-views-shell-toolbar.js +3 -3
- package/dist/_internal/components/data-display/DataViews/data-views-still-anchor.js +9 -0
- package/dist/_internal/components/data-display/DataViews/data-views-still-anchor.js.map +1 -0
- package/dist/_internal/components/data-display/DataViews/data-views-table-parts.js +4 -4
- package/dist/_internal/components/data-display/DataViews/data-views-toolbar.js +2 -2
- package/dist/_internal/components/data-display/DayRuler/DayRuler.js +3 -3
- package/dist/_internal/components/data-display/DayRuler/DayRuler.parts.js +2 -2
- package/dist/_internal/components/data-display/DayRuler/DayRuler.styles.js +3 -1
- package/dist/_internal/components/data-display/FleetMap/FleetBody.js +9 -8
- package/dist/_internal/components/data-display/FleetMap/FleetCanvas.js +8 -7
- package/dist/_internal/components/data-display/FleetMap/FleetMap.fixtures.js +2 -1
- package/dist/_internal/components/data-display/FleetMap/FleetMap.fixtures.js.map +1 -1
- package/dist/_internal/components/data-display/FleetMap/FleetMap.js +9 -9
- package/dist/_internal/components/data-display/MapPreview/MapControlBar.js +4 -3
- package/dist/_internal/components/data-display/MapPreview/MapLayers.js +5 -4
- package/dist/_internal/components/data-display/MapPreview/MapMarkers.js +4 -3
- package/dist/_internal/components/data-display/MapPreview/MapPreview.helpers.js +3 -2
- package/dist/_internal/components/data-display/MapPreview/MapPreview.js +7 -6
- package/dist/_internal/components/data-display/index.js +38 -38
- package/dist/_internal/components/feedback/NotificationStatusNotice/NotificationStatusNotice.js +4 -4
- package/dist/_internal/components/feedback/SequenceResolver/SequenceResolver.js +6 -6
- package/dist/_internal/components/feedback/SequenceResolver/SequenceResolver.overview.js +5 -5
- package/dist/_internal/components/feedback/SequenceResolver/SequenceResolver.parts.js +4 -4
- package/dist/_internal/components/feedback/index.js +7 -7
- package/dist/_internal/components/form/Calendar/Calendar.js +5 -5
- package/dist/_internal/components/form/Calendar/CalendarDay.js +1 -1
- package/dist/_internal/components/form/Calendar/CalendarDayCell.js +2 -2
- package/dist/_internal/components/form/Calendar/CalendarMonth.js +3 -3
- package/dist/_internal/components/form/Calendar/CalendarSelectorsMonth.js +4 -4
- package/dist/_internal/components/form/DateRangePicker/DateRangePicker.hooks.js +3 -3
- package/dist/_internal/components/form/DateRangePicker/DateRangePicker.js +10 -10
- package/dist/_internal/components/form/DateRangePicker/DateRangePicker.range.js +2 -2
- package/dist/_internal/components/form/DateRangePicker/DateRangePickerFields.js +3 -3
- package/dist/_internal/components/form/index.js +24 -24
- package/dist/_internal/components/index.js +66 -66
- package/dist/_internal/en-US.data-display.js +2 -1
- package/dist/_internal/pt-BR.data-display.js +2 -1
- package/dist/_internal/user-avatar/user-avatar.js +5 -5
- package/dist/charts.js +11 -11
- package/dist/{chunk-FJ3UZ4RC.js → chunk-2FKWKLSC.js} +5 -3
- package/dist/chunk-2FKWKLSC.js.map +1 -0
- package/dist/{chunk-BO6MT2S2.js → chunk-3HZKUN5J.js} +7 -6
- package/dist/chunk-3HZKUN5J.js.map +1 -0
- package/dist/{chunk-TYXFFNPM.js → chunk-3OTGREQG.js} +10 -10
- package/dist/{chunk-BEHT4IHH.js → chunk-3X2MA47R.js} +2 -2
- package/dist/{chunk-XHIBFBNP.js → chunk-3ZRK3BRN.js} +4 -2
- package/dist/chunk-3ZRK3BRN.js.map +1 -0
- package/dist/{chunk-X5OGIT2F.js → chunk-4L54KUZV.js} +22 -4
- package/dist/chunk-4L54KUZV.js.map +1 -0
- package/dist/{chunk-TRYR424I.js → chunk-6LOWZCH7.js} +15 -1
- package/dist/chunk-6LOWZCH7.js.map +1 -0
- package/dist/{chunk-6WHIJPEF.js → chunk-6PU5P7QT.js} +2 -2
- package/dist/chunk-7CUZTWKW.js +52 -0
- package/dist/chunk-7CUZTWKW.js.map +1 -0
- package/dist/{chunk-JIEVKHOH.js → chunk-7YJYIMWP.js} +7 -7
- package/dist/{chunk-YNZUYZ2O.js → chunk-A3DDEKLV.js} +2 -2
- package/dist/{chunk-KHREN7Y7.js → chunk-ACM3HHZY.js} +2 -2
- package/dist/{chunk-FEKWKWGK.js → chunk-ARGVUTTL.js} +15 -1
- package/dist/chunk-ARGVUTTL.js.map +1 -0
- package/dist/{chunk-DYHOBKPU.js → chunk-BLZDSCIZ.js} +6 -6
- package/dist/{chunk-E2UOEI7N.js → chunk-BV2LOTMC.js} +2 -2
- package/dist/{chunk-O63ZROSY.js → chunk-BZBLPXV7.js} +4 -4
- package/dist/{chunk-OKRITX4S.js → chunk-CJ6XXM4X.js} +4 -4
- package/dist/{chunk-LV6AD6XC.js → chunk-DBI6AMNY.js} +4 -4
- package/dist/{chunk-QRRWLLXW.js → chunk-DSBC6O46.js} +2 -2
- package/dist/{chunk-3YFDGFEK.js → chunk-DVX4HDNP.js} +2 -2
- package/dist/{chunk-CJUK32UH.js → chunk-EEO7M5GU.js} +2 -2
- package/dist/{chunk-7XSCEHGA.js → chunk-EOQ6EKTS.js} +7 -7
- package/dist/{chunk-5RSK5M6M.js → chunk-FI2CQOGC.js} +63 -126
- package/dist/chunk-FI2CQOGC.js.map +1 -0
- package/dist/{chunk-Q2ERGAQO.js → chunk-FYAW5GBF.js} +33 -6
- package/dist/chunk-FYAW5GBF.js.map +1 -0
- package/dist/{chunk-EOJSA2EK.js → chunk-G2PVUPE7.js} +26 -18
- package/dist/chunk-G2PVUPE7.js.map +1 -0
- package/dist/{chunk-AMLHEKSV.js → chunk-HI7JPDD6.js} +5 -5
- package/dist/{chunk-2H6SCVLD.js → chunk-HMEGQKNQ.js} +3 -3
- package/dist/chunk-J2AVWIMM.js +60 -0
- package/dist/chunk-J2AVWIMM.js.map +1 -0
- package/dist/{chunk-7QKIL5YF.js → chunk-J2GDA64N.js} +4 -4
- package/dist/{chunk-BAQ3ITZV.js → chunk-JFD742C3.js} +2 -2
- package/dist/{chunk-OBA75Y5O.js → chunk-JHWEL4NX.js} +61 -33
- package/dist/chunk-JHWEL4NX.js.map +1 -0
- package/dist/{chunk-HQCZT6TO.js → chunk-JVOEVTCZ.js} +5 -5
- package/dist/{chunk-WAO7UQRS.js → chunk-KANCE4MS.js} +3 -3
- package/dist/{chunk-XLU5WFSY.js → chunk-KRBPWTXW.js} +2 -2
- package/dist/{chunk-S6D7NOV7.js → chunk-L6JAALMX.js} +3 -3
- package/dist/{chunk-72HOUWAW.js → chunk-L6YTVXGN.js} +5 -3
- package/dist/{chunk-72HOUWAW.js.map → chunk-L6YTVXGN.js.map} +1 -1
- package/dist/chunk-LZNUBQ5I.js +181 -0
- package/dist/chunk-LZNUBQ5I.js.map +1 -0
- package/dist/{chunk-BECKKDYG.js → chunk-M2M4IDFU.js} +2 -2
- package/dist/{chunk-CSGBHYW6.js → chunk-M5Y42AZ4.js} +2 -2
- package/dist/chunk-MICX23P4.js +122 -0
- package/dist/chunk-MICX23P4.js.map +1 -0
- package/dist/{chunk-5CP5Z3YU.js → chunk-MPWA55CF.js} +4 -4
- package/dist/{chunk-5KK3I42O.js → chunk-NK6O4NE4.js} +13 -10
- package/dist/chunk-NK6O4NE4.js.map +1 -0
- package/dist/{chunk-RCTHCXS6.js → chunk-PJNIJIE6.js} +2 -2
- package/dist/{chunk-6ATXOJVQ.js → chunk-QADTI63U.js} +4 -4
- package/dist/{chunk-MW7P2C2C.js → chunk-QAEO52Z4.js} +2 -2
- package/dist/{chunk-5S5K73I6.js → chunk-QSOCOXVL.js} +3 -3
- package/dist/{chunk-NQCTANF3.js → chunk-QVDEGBME.js} +7 -7
- package/dist/{chunk-BQBEN44R.js → chunk-RDCIST7P.js} +2 -2
- package/dist/{chunk-HUXAIQC5.js → chunk-RZ3P4X2I.js} +2 -2
- package/dist/{chunk-WJMSND5Q.js → chunk-SCXVTNLE.js} +2 -2
- package/dist/{chunk-K6FCSB6T.js → chunk-SK2CTB3O.js} +6 -6
- package/dist/{chunk-QLJU7UUI.js → chunk-T7OIVPCO.js} +38 -3
- package/dist/chunk-T7OIVPCO.js.map +1 -0
- package/dist/{chunk-U2ILXZDG.js → chunk-TB5CRHTF.js} +2 -2
- package/dist/{chunk-SB2SEGR6.js → chunk-TIM4PXWN.js} +3 -3
- package/dist/{chunk-YDIC6LSP.js → chunk-VCQFDQM3.js} +27 -7
- package/dist/chunk-VCQFDQM3.js.map +1 -0
- package/dist/chunk-VIMMEADQ.js +164 -0
- package/dist/chunk-VIMMEADQ.js.map +1 -0
- package/dist/{chunk-6D5AMANO.js → chunk-WH3LUOCQ.js} +2 -2
- package/dist/{chunk-OWRQOYUE.js → chunk-WWR6APJR.js} +2 -2
- package/dist/{chunk-5BVAUUWL.js → chunk-X37NTEVS.js} +2 -2
- package/dist/{chunk-WW3F7DCX.js → chunk-Z2WZDVGG.js} +2 -2
- package/dist/{chunk-EXVCVXFX.js → chunk-ZH6NYB6Y.js} +3 -3
- package/dist/data-display/Alert.js +3 -3
- package/dist/data-display/Avatar.js +4 -4
- package/dist/data-display/CardKit.js +11 -11
- package/dist/data-display/Carousel.js +6 -5
- package/dist/data-display/Chart.js +11 -11
- package/dist/data-display/DataGrid.js +2 -2
- package/dist/data-display/DataViews.js +60 -35
- package/dist/data-display/DayRuler.js +3 -3
- package/dist/data-display/FleetMap.js +9 -9
- package/dist/data-display/MapPreview.js +7 -6
- package/dist/en-US.js +1 -1
- package/dist/feedback/NotificationStatusNotice.js +4 -4
- package/dist/feedback/SequenceResolver.js +6 -6
- package/dist/form/Calendar.js +5 -5
- package/dist/form/DateRangePicker.js +10 -10
- package/dist/locales.js +5 -5
- package/dist/pt-BR.js +1 -1
- package/dist/types/components/data-display/DataViews/data-views-bar-controls.d.ts +15 -1
- package/dist/types/components/data-display/DataViews/data-views-bar-controls.d.ts.map +1 -1
- package/dist/types/components/data-display/DataViews/data-views-copy.d.ts +35 -0
- package/dist/types/components/data-display/DataViews/data-views-copy.d.ts.map +1 -1
- package/dist/types/components/data-display/DataViews/data-views-day-input.d.ts +7 -1
- package/dist/types/components/data-display/DataViews/data-views-day-input.d.ts.map +1 -1
- package/dist/types/components/data-display/DataViews/data-views-more-fields.d.ts.map +1 -1
- package/dist/types/components/data-display/DataViews/data-views-more-filters.d.ts +5 -3
- package/dist/types/components/data-display/DataViews/data-views-more-filters.d.ts.map +1 -1
- package/dist/types/components/data-display/DataViews/data-views-number-input.d.ts +10 -2
- package/dist/types/components/data-display/DataViews/data-views-number-input.d.ts.map +1 -1
- package/dist/types/components/data-display/DataViews/data-views-preset-chips.d.ts +10 -0
- package/dist/types/components/data-display/DataViews/data-views-preset-chips.d.ts.map +1 -1
- package/dist/types/components/data-display/DataViews/data-views-range-bounds.d.ts +35 -0
- package/dist/types/components/data-display/DataViews/data-views-range-bounds.d.ts.map +1 -0
- package/dist/types/components/data-display/DataViews/data-views-range-calendar.d.ts +35 -0
- package/dist/types/components/data-display/DataViews/data-views-range-calendar.d.ts.map +1 -0
- package/dist/types/components/data-display/DataViews/data-views-range-pill.d.ts +2 -11
- package/dist/types/components/data-display/DataViews/data-views-range-pill.d.ts.map +1 -1
- package/dist/types/components/data-display/DataViews/data-views-range-summary.d.ts +21 -0
- package/dist/types/components/data-display/DataViews/data-views-range-summary.d.ts.map +1 -0
- package/dist/types/components/data-display/DataViews/data-views-still-anchor.d.ts +45 -0
- package/dist/types/components/data-display/DataViews/data-views-still-anchor.d.ts.map +1 -0
- package/dist/types/components/data-display/DayRuler/DayRuler.styles.d.ts +6 -1
- package/dist/types/components/data-display/DayRuler/DayRuler.styles.d.ts.map +1 -1
- package/dist/types/components/data-display/LazyImage/LazyImage.hooks.d.ts +1 -1
- package/dist/types/components/form/Calendar/Calendar.d.ts.map +1 -1
- package/dist/types/components/form/Calendar/CalendarDay.d.ts +2 -0
- package/dist/types/components/form/Calendar/CalendarDay.d.ts.map +1 -1
- package/dist/types/components/form/Calendar/CalendarDayCell.d.ts +2 -0
- package/dist/types/components/form/Calendar/CalendarDayCell.d.ts.map +1 -1
- package/dist/types/components/form/Calendar/CalendarMonth.d.ts +5 -0
- package/dist/types/components/form/Calendar/CalendarMonth.d.ts.map +1 -1
- package/dist/types/en-US.data-display.d.ts.map +1 -1
- package/dist/types/pt-BR.data-display.d.ts.map +1 -1
- package/dist/user-avatar.js +5 -5
- package/package.json +1 -1
- package/src/components/data-display/DataViews/RESPONSIVE-BEHAVIOUR.md +59 -0
- package/src/components/data-display/DataViews/data-views-bar-controls.tsx +56 -1
- package/src/components/data-display/DataViews/data-views-copy.ts +36 -0
- package/src/components/data-display/DataViews/data-views-day-input.tsx +9 -1
- package/src/components/data-display/DataViews/data-views-inline-bar.tsx +5 -3
- package/src/components/data-display/DataViews/data-views-more-fields.tsx +1 -0
- package/src/components/data-display/DataViews/data-views-more-filters.tsx +82 -29
- package/src/components/data-display/DataViews/data-views-number-input.tsx +19 -9
- package/src/components/data-display/DataViews/data-views-preset-chips.tsx +165 -16
- package/src/components/data-display/DataViews/data-views-range-bounds.tsx +223 -0
- package/src/components/data-display/DataViews/data-views-range-calendar.tsx +185 -0
- package/src/components/data-display/DataViews/data-views-range-pill.tsx +71 -154
- package/src/components/data-display/DataViews/data-views-range-summary.tsx +66 -0
- package/src/components/data-display/DataViews/data-views-still-anchor.ts +93 -0
- package/src/components/data-display/DayRuler/DayRuler.styles.ts +29 -16
- package/src/components/form/Calendar/Calendar.md +17 -2
- package/src/components/form/Calendar/Calendar.tsx +56 -3
- package/src/components/form/Calendar/CalendarDay.tsx +33 -3
- package/src/components/form/Calendar/CalendarDayCell.tsx +4 -0
- package/src/components/form/Calendar/CalendarMonth.tsx +27 -5
- package/src/en-US.data-display.ts +12 -0
- package/src/pt-BR.data-display.ts +12 -0
- package/dist/chunk-5KK3I42O.js.map +0 -1
- package/dist/chunk-5RSK5M6M.js.map +0 -1
- package/dist/chunk-7D7CJRL7.js +0 -78
- package/dist/chunk-7D7CJRL7.js.map +0 -1
- package/dist/chunk-BO6MT2S2.js.map +0 -1
- package/dist/chunk-EOJSA2EK.js.map +0 -1
- package/dist/chunk-FEKWKWGK.js.map +0 -1
- package/dist/chunk-FJ3UZ4RC.js.map +0 -1
- package/dist/chunk-OBA75Y5O.js.map +0 -1
- package/dist/chunk-Q2ERGAQO.js.map +0 -1
- package/dist/chunk-QLJU7UUI.js.map +0 -1
- package/dist/chunk-TRYR424I.js.map +0 -1
- package/dist/chunk-X5OGIT2F.js.map +0 -1
- package/dist/chunk-XHIBFBNP.js.map +0 -1
- package/dist/chunk-YDIC6LSP.js.map +0 -1
- /package/dist/{chunk-TYXFFNPM.js.map → chunk-3OTGREQG.js.map} +0 -0
- /package/dist/{chunk-BEHT4IHH.js.map → chunk-3X2MA47R.js.map} +0 -0
- /package/dist/{chunk-6WHIJPEF.js.map → chunk-6PU5P7QT.js.map} +0 -0
- /package/dist/{chunk-JIEVKHOH.js.map → chunk-7YJYIMWP.js.map} +0 -0
- /package/dist/{chunk-YNZUYZ2O.js.map → chunk-A3DDEKLV.js.map} +0 -0
- /package/dist/{chunk-KHREN7Y7.js.map → chunk-ACM3HHZY.js.map} +0 -0
- /package/dist/{chunk-DYHOBKPU.js.map → chunk-BLZDSCIZ.js.map} +0 -0
- /package/dist/{chunk-E2UOEI7N.js.map → chunk-BV2LOTMC.js.map} +0 -0
- /package/dist/{chunk-O63ZROSY.js.map → chunk-BZBLPXV7.js.map} +0 -0
- /package/dist/{chunk-OKRITX4S.js.map → chunk-CJ6XXM4X.js.map} +0 -0
- /package/dist/{chunk-LV6AD6XC.js.map → chunk-DBI6AMNY.js.map} +0 -0
- /package/dist/{chunk-QRRWLLXW.js.map → chunk-DSBC6O46.js.map} +0 -0
- /package/dist/{chunk-3YFDGFEK.js.map → chunk-DVX4HDNP.js.map} +0 -0
- /package/dist/{chunk-CJUK32UH.js.map → chunk-EEO7M5GU.js.map} +0 -0
- /package/dist/{chunk-7XSCEHGA.js.map → chunk-EOQ6EKTS.js.map} +0 -0
- /package/dist/{chunk-AMLHEKSV.js.map → chunk-HI7JPDD6.js.map} +0 -0
- /package/dist/{chunk-2H6SCVLD.js.map → chunk-HMEGQKNQ.js.map} +0 -0
- /package/dist/{chunk-7QKIL5YF.js.map → chunk-J2GDA64N.js.map} +0 -0
- /package/dist/{chunk-BAQ3ITZV.js.map → chunk-JFD742C3.js.map} +0 -0
- /package/dist/{chunk-HQCZT6TO.js.map → chunk-JVOEVTCZ.js.map} +0 -0
- /package/dist/{chunk-WAO7UQRS.js.map → chunk-KANCE4MS.js.map} +0 -0
- /package/dist/{chunk-XLU5WFSY.js.map → chunk-KRBPWTXW.js.map} +0 -0
- /package/dist/{chunk-S6D7NOV7.js.map → chunk-L6JAALMX.js.map} +0 -0
- /package/dist/{chunk-BECKKDYG.js.map → chunk-M2M4IDFU.js.map} +0 -0
- /package/dist/{chunk-CSGBHYW6.js.map → chunk-M5Y42AZ4.js.map} +0 -0
- /package/dist/{chunk-5CP5Z3YU.js.map → chunk-MPWA55CF.js.map} +0 -0
- /package/dist/{chunk-RCTHCXS6.js.map → chunk-PJNIJIE6.js.map} +0 -0
- /package/dist/{chunk-6ATXOJVQ.js.map → chunk-QADTI63U.js.map} +0 -0
- /package/dist/{chunk-MW7P2C2C.js.map → chunk-QAEO52Z4.js.map} +0 -0
- /package/dist/{chunk-5S5K73I6.js.map → chunk-QSOCOXVL.js.map} +0 -0
- /package/dist/{chunk-NQCTANF3.js.map → chunk-QVDEGBME.js.map} +0 -0
- /package/dist/{chunk-BQBEN44R.js.map → chunk-RDCIST7P.js.map} +0 -0
- /package/dist/{chunk-HUXAIQC5.js.map → chunk-RZ3P4X2I.js.map} +0 -0
- /package/dist/{chunk-WJMSND5Q.js.map → chunk-SCXVTNLE.js.map} +0 -0
- /package/dist/{chunk-K6FCSB6T.js.map → chunk-SK2CTB3O.js.map} +0 -0
- /package/dist/{chunk-U2ILXZDG.js.map → chunk-TB5CRHTF.js.map} +0 -0
- /package/dist/{chunk-SB2SEGR6.js.map → chunk-TIM4PXWN.js.map} +0 -0
- /package/dist/{chunk-6D5AMANO.js.map → chunk-WH3LUOCQ.js.map} +0 -0
- /package/dist/{chunk-OWRQOYUE.js.map → chunk-WWR6APJR.js.map} +0 -0
- /package/dist/{chunk-5BVAUUWL.js.map → chunk-X37NTEVS.js.map} +0 -0
- /package/dist/{chunk-WW3F7DCX.js.map → chunk-Z2WZDVGG.js.map} +0 -0
- /package/dist/{chunk-EXVCVXFX.js.map → chunk-ZH6NYB6Y.js.map} +0 -0
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import {
|
|
2
2
|
renderChartByType
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-QADTI63U.js";
|
|
4
|
+
import {
|
|
5
|
+
ChartContainer
|
|
6
|
+
} from "./chunk-RIRTW5EU.js";
|
|
4
7
|
import {
|
|
5
8
|
getSizeStyles,
|
|
6
9
|
getVariantStyles,
|
|
7
10
|
plotHeightPx
|
|
8
11
|
} from "./chunk-TCWISGSS.js";
|
|
9
|
-
import {
|
|
10
|
-
ChartContainer
|
|
11
|
-
} from "./chunk-RIRTW5EU.js";
|
|
12
12
|
import {
|
|
13
13
|
muiColor
|
|
14
14
|
} from "./chunk-7ZPUN7TV.js";
|
|
@@ -111,4 +111,4 @@ var Chart = (props) => {
|
|
|
111
111
|
export {
|
|
112
112
|
Chart
|
|
113
113
|
};
|
|
114
|
-
//# sourceMappingURL=chunk-
|
|
114
|
+
//# sourceMappingURL=chunk-HI7JPDD6.js.map
|
|
@@ -2,14 +2,14 @@ import {
|
|
|
2
2
|
Axis,
|
|
3
3
|
Coverage,
|
|
4
4
|
RulerRow
|
|
5
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-ACM3HHZY.js";
|
|
6
6
|
import {
|
|
7
7
|
groupTitleSx,
|
|
8
8
|
rootSx,
|
|
9
9
|
rowSx,
|
|
10
10
|
skeletonNameSx,
|
|
11
11
|
skeletonTrackSx
|
|
12
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-G2PVUPE7.js";
|
|
13
13
|
import {
|
|
14
14
|
handleBlockKey,
|
|
15
15
|
keyCreateSpan
|
|
@@ -117,4 +117,4 @@ function DayRuler(props) {
|
|
|
117
117
|
export {
|
|
118
118
|
DayRuler
|
|
119
119
|
};
|
|
120
|
-
//# sourceMappingURL=chunk-
|
|
120
|
+
//# sourceMappingURL=chunk-HMEGQKNQ.js.map
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import {
|
|
2
|
+
isRangeSet,
|
|
3
|
+
rangeChipLabel
|
|
4
|
+
} from "./chunk-GCZJH4XL.js";
|
|
5
|
+
import {
|
|
6
|
+
useDataViewsCopy
|
|
7
|
+
} from "./chunk-KHG57NAE.js";
|
|
8
|
+
import {
|
|
9
|
+
sxRem
|
|
10
|
+
} from "./chunk-YKCAJ2TN.js";
|
|
11
|
+
|
|
12
|
+
// src/components/data-display/DataViews/data-views-range-summary.tsx
|
|
13
|
+
import Box from "@mui/material/Box/index.js";
|
|
14
|
+
import Button from "@mui/material/Button/index.js";
|
|
15
|
+
import Typography from "@mui/material/Typography/index.js";
|
|
16
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
17
|
+
function RangeSummary({
|
|
18
|
+
field,
|
|
19
|
+
value,
|
|
20
|
+
onClear,
|
|
21
|
+
testId
|
|
22
|
+
}) {
|
|
23
|
+
const copy = useDataViewsCopy();
|
|
24
|
+
const active = isRangeSet(value);
|
|
25
|
+
if (!active && field.kind !== "day") return null;
|
|
26
|
+
return /* @__PURE__ */ jsxs(
|
|
27
|
+
Box,
|
|
28
|
+
{
|
|
29
|
+
"aria-hidden": active ? void 0 : true,
|
|
30
|
+
sx: {
|
|
31
|
+
display: "flex",
|
|
32
|
+
alignItems: "center",
|
|
33
|
+
justifyContent: "space-between",
|
|
34
|
+
gap: 2,
|
|
35
|
+
mt: { xs: 0.5, sm: 1.5 },
|
|
36
|
+
visibility: active ? void 0 : "hidden"
|
|
37
|
+
},
|
|
38
|
+
children: [
|
|
39
|
+
/* @__PURE__ */ jsx(Typography, { component: "span", sx: { fontSize: sxRem(12), color: "text.secondary" }, children: active ? rangeChipLabel(field, value) : field.label }),
|
|
40
|
+
/* @__PURE__ */ jsx(
|
|
41
|
+
Button,
|
|
42
|
+
{
|
|
43
|
+
variant: "text",
|
|
44
|
+
size: "small",
|
|
45
|
+
onClick: active ? onClear : void 0,
|
|
46
|
+
tabIndex: active ? void 0 : -1,
|
|
47
|
+
"data-testid": active ? `${testId}-clear` : void 0,
|
|
48
|
+
sx: { textTransform: "none" },
|
|
49
|
+
children: copy.filters.clear
|
|
50
|
+
}
|
|
51
|
+
)
|
|
52
|
+
]
|
|
53
|
+
}
|
|
54
|
+
);
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
export {
|
|
58
|
+
RangeSummary
|
|
59
|
+
};
|
|
60
|
+
//# sourceMappingURL=chunk-J2AVWIMM.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/components/data-display/DataViews/data-views-range-summary.tsx"],"sourcesContent":["'use client';\n\nimport Box from '@mui/material/Box/index.js';\nimport Button from '@mui/material/Button/index.js';\nimport Typography from '@mui/material/Typography/index.js';\nimport React from 'react';\n\nimport { useDataViewsCopy } from './data-views-copy-context';\nimport { isRangeSet, rangeChipLabel } from './data-views-range-values';\nimport type { RangeFieldConfig, RangeValue } from './data-views-types';\nimport { sxRem } from '../../../tokens/relative';\n\n/**\n * The applied window in words, and \"Limpar\".\n *\n * An inverted window is not an error the merchant must fix before the list\n * responds — it simply matches nothing, and saying so beats an empty grid with\n * no explanation (FUT-668).\n *\n * A DAY filter keeps the row's height while nothing is applied: its first tap\n * on the calendar applies a bound, and a row appearing then grew the popover\n * 26px and moved it 32px up at 320×568, the day under the finger with it\n * (FUT-4144 UI review round 2). The held row is invisible and inert.\n */\nexport function RangeSummary<T extends Record<string, unknown>>({\n field,\n value,\n onClear,\n testId,\n}: {\n field: RangeFieldConfig<T>;\n value: RangeValue;\n onClear: () => void;\n testId: string;\n}): React.JSX.Element | null {\n const copy = useDataViewsCopy();\n const active = isRangeSet(value);\n if (!active && field.kind !== 'day') return null;\n return (\n <Box\n aria-hidden={active ? undefined : true}\n sx={{\n display: 'flex',\n alignItems: 'center',\n justifyContent: 'space-between',\n gap: 2,\n mt: { xs: 0.5, sm: 1.5 },\n visibility: active ? undefined : 'hidden',\n }}\n >\n <Typography component=\"span\" sx={{ fontSize: sxRem(12), color: 'text.secondary' }}>\n {active ? rangeChipLabel(field, value) : field.label}\n </Typography>\n <Button\n variant=\"text\"\n size=\"small\"\n onClick={active ? onClear : undefined}\n tabIndex={active ? undefined : -1}\n data-testid={active ? `${testId}-clear` : undefined}\n sx={{ textTransform: 'none' }}\n >\n {copy.filters.clear}\n </Button>\n </Box>\n );\n}\n"],"mappings":";;;;;;;;;;;;AAEA,OAAO,SAAS;AAChB,OAAO,YAAY;AACnB,OAAO,gBAAgB;AAmCnB,SAWE,KAXF;AAfG,SAAS,aAAgD;AAAA,EAC9D;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF,GAK6B;AAC3B,QAAM,OAAO,iBAAiB;AAC9B,QAAM,SAAS,WAAW,KAAK;AAC/B,MAAI,CAAC,UAAU,MAAM,SAAS,MAAO,QAAO;AAC5C,SACE;AAAA,IAAC;AAAA;AAAA,MACC,eAAa,SAAS,SAAY;AAAA,MAClC,IAAI;AAAA,QACF,SAAS;AAAA,QACT,YAAY;AAAA,QACZ,gBAAgB;AAAA,QAChB,KAAK;AAAA,QACL,IAAI,EAAE,IAAI,KAAK,IAAI,IAAI;AAAA,QACvB,YAAY,SAAS,SAAY;AAAA,MACnC;AAAA,MAEA;AAAA,4BAAC,cAAW,WAAU,QAAO,IAAI,EAAE,UAAU,MAAM,EAAE,GAAG,OAAO,iBAAiB,GAC7E,mBAAS,eAAe,OAAO,KAAK,IAAI,MAAM,OACjD;AAAA,QACA;AAAA,UAAC;AAAA;AAAA,YACC,SAAQ;AAAA,YACR,MAAK;AAAA,YACL,SAAS,SAAS,UAAU;AAAA,YAC5B,UAAU,SAAS,SAAY;AAAA,YAC/B,eAAa,SAAS,GAAG,MAAM,WAAW;AAAA,YAC1C,IAAI,EAAE,eAAe,OAAO;AAAA,YAE3B,eAAK,QAAQ;AAAA;AAAA,QAChB;AAAA;AAAA;AAAA,EACF;AAEJ;","names":[]}
|
|
@@ -3,19 +3,19 @@ import {
|
|
|
3
3
|
} from "./chunk-R26WP22N.js";
|
|
4
4
|
import {
|
|
5
5
|
useDateRangePicker
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-RZ3P4X2I.js";
|
|
7
7
|
import {
|
|
8
8
|
DateRangeQuickList
|
|
9
9
|
} from "./chunk-6KKQHJE7.js";
|
|
10
10
|
import {
|
|
11
11
|
DateRangeFields
|
|
12
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-QSOCOXVL.js";
|
|
13
13
|
import {
|
|
14
14
|
toLocalDay
|
|
15
15
|
} from "./chunk-SUTOAW7I.js";
|
|
16
16
|
import {
|
|
17
17
|
Calendar
|
|
18
|
-
} from "./chunk-
|
|
18
|
+
} from "./chunk-FYAW5GBF.js";
|
|
19
19
|
|
|
20
20
|
// src/components/form/DateRangePicker/DateRangePicker.tsx
|
|
21
21
|
import Box from "@mui/material/Box/index.js";
|
|
@@ -181,4 +181,4 @@ export {
|
|
|
181
181
|
DateRangePicker,
|
|
182
182
|
DateRangePicker_default
|
|
183
183
|
};
|
|
184
|
-
//# sourceMappingURL=chunk-
|
|
184
|
+
//# sourceMappingURL=chunk-J2GDA64N.js.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
FleetCanvas
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-QAEO52Z4.js";
|
|
4
4
|
import {
|
|
5
5
|
FleetRoster
|
|
6
6
|
} from "./chunk-A4B27HYU.js";
|
|
@@ -79,4 +79,4 @@ function FleetBody({
|
|
|
79
79
|
export {
|
|
80
80
|
FleetBody
|
|
81
81
|
};
|
|
82
|
-
//# sourceMappingURL=chunk-
|
|
82
|
+
//# sourceMappingURL=chunk-JFD742C3.js.map
|
|
@@ -2,7 +2,10 @@ import {
|
|
|
2
2
|
MoreGroup,
|
|
3
3
|
MoreQuick,
|
|
4
4
|
fieldClearing
|
|
5
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-3HZKUN5J.js";
|
|
6
|
+
import {
|
|
7
|
+
useStillAnchor
|
|
8
|
+
} from "./chunk-7CUZTWKW.js";
|
|
6
9
|
import {
|
|
7
10
|
useDataViewsCopy
|
|
8
11
|
} from "./chunk-KHG57NAE.js";
|
|
@@ -17,6 +20,7 @@ import {
|
|
|
17
20
|
} from "./chunk-AJBRO76D.js";
|
|
18
21
|
import {
|
|
19
22
|
rem,
|
|
23
|
+
remPx,
|
|
20
24
|
sxRem
|
|
21
25
|
} from "./chunk-YKCAJ2TN.js";
|
|
22
26
|
|
|
@@ -24,7 +28,8 @@ import {
|
|
|
24
28
|
import KeyboardArrowDownRoundedIcon from "@mui/icons-material/KeyboardArrowDownRounded";
|
|
25
29
|
import FilterAltRoundedIcon from "@mui/icons-material/FilterAltRounded";
|
|
26
30
|
import Popover from "@mui/material/Popover/index.js";
|
|
27
|
-
import {
|
|
31
|
+
import { useTheme } from "@mui/material/styles/index.js";
|
|
32
|
+
import useMediaQuery from "@mui/material/useMediaQuery/index.js";
|
|
28
33
|
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
29
34
|
function MoreTrigger({
|
|
30
35
|
count,
|
|
@@ -103,31 +108,40 @@ function MoreHeading() {
|
|
|
103
108
|
}
|
|
104
109
|
function MoreFooter({
|
|
105
110
|
onClearAll,
|
|
106
|
-
testIdPrefix
|
|
111
|
+
testIdPrefix,
|
|
112
|
+
reserved = false
|
|
107
113
|
}) {
|
|
108
114
|
const copy = useDataViewsCopy();
|
|
109
|
-
return /* @__PURE__ */ jsx(
|
|
115
|
+
return /* @__PURE__ */ jsx(
|
|
110
116
|
default2,
|
|
111
117
|
{
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
118
|
+
"aria-hidden": reserved || void 0,
|
|
119
|
+
sx: { px: 1.5, py: 1, borderTop: 1, borderColor: reserved ? "transparent" : "divider", visibility: reserved ? "hidden" : void 0 },
|
|
120
|
+
children: /* @__PURE__ */ jsx(
|
|
121
|
+
default2,
|
|
122
|
+
{
|
|
123
|
+
component: "button",
|
|
124
|
+
type: "button",
|
|
125
|
+
onClick: reserved ? void 0 : onClearAll,
|
|
126
|
+
tabIndex: reserved ? -1 : void 0,
|
|
127
|
+
"data-testid": reserved ? void 0 : `${testIdPrefix}-more-clear-all`,
|
|
128
|
+
sx: {
|
|
129
|
+
width: "100%",
|
|
130
|
+
border: 0,
|
|
131
|
+
p: 0,
|
|
132
|
+
bgcolor: "transparent",
|
|
133
|
+
cursor: "pointer",
|
|
134
|
+
font: "inherit",
|
|
135
|
+
fontSize: sxRem(13),
|
|
136
|
+
textAlign: "left",
|
|
137
|
+
color: "primary.main",
|
|
138
|
+
"&:hover": { textDecoration: "underline" }
|
|
139
|
+
},
|
|
140
|
+
children: copy.filters.clearAll
|
|
141
|
+
}
|
|
142
|
+
)
|
|
129
143
|
}
|
|
130
|
-
)
|
|
144
|
+
);
|
|
131
145
|
}
|
|
132
146
|
function MoreFields({
|
|
133
147
|
fields,
|
|
@@ -137,6 +151,18 @@ function MoreFields({
|
|
|
137
151
|
(field) => field.quick ? /* @__PURE__ */ jsx(MoreQuick, { quick: field.quick, ...rest }, field.id) : /* @__PURE__ */ jsx(MoreGroup, { field, ...rest }, field.id)
|
|
138
152
|
) });
|
|
139
153
|
}
|
|
154
|
+
var COLUMN_SX = { display: "flex", flexDirection: "column" };
|
|
155
|
+
var PAPER_SX = (theme) => ({
|
|
156
|
+
...COLUMN_SX,
|
|
157
|
+
width: rem(theme, 320),
|
|
158
|
+
maxWidth: `calc(100vw - ${rem(theme, 32)})`
|
|
159
|
+
});
|
|
160
|
+
var PHONE_PAPER_SX = (theme) => ({
|
|
161
|
+
...COLUMN_SX,
|
|
162
|
+
width: `calc(100vw - ${rem(theme, 16)})`,
|
|
163
|
+
maxWidth: `calc(100vw - ${rem(theme, 16)})`,
|
|
164
|
+
maxHeight: `calc(100% - ${rem(theme, 16)})`
|
|
165
|
+
});
|
|
140
166
|
function MoreFilters({
|
|
141
167
|
fields,
|
|
142
168
|
onOpenChange,
|
|
@@ -146,8 +172,11 @@ function MoreFilters({
|
|
|
146
172
|
clearKey,
|
|
147
173
|
...rest
|
|
148
174
|
}) {
|
|
149
|
-
const
|
|
175
|
+
const still = useStillAnchor();
|
|
176
|
+
const theme = useTheme();
|
|
177
|
+
const phone = useMediaQuery(theme.breakpoints.down("sm"));
|
|
150
178
|
if (fields.length === 0) return null;
|
|
179
|
+
const holdsDayRange = fields.some((field) => field.range?.kind === "day");
|
|
151
180
|
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
152
181
|
/* @__PURE__ */ jsx(
|
|
153
182
|
MoreTrigger,
|
|
@@ -164,7 +193,7 @@ function MoreFilters({
|
|
|
164
193
|
).length,
|
|
165
194
|
compact,
|
|
166
195
|
onOpen: (element) => {
|
|
167
|
-
|
|
196
|
+
still.open(element);
|
|
168
197
|
onOpenChange?.(true);
|
|
169
198
|
},
|
|
170
199
|
testIdPrefix: rest.testIdPrefix
|
|
@@ -173,18 +202,17 @@ function MoreFilters({
|
|
|
173
202
|
/* @__PURE__ */ jsx(
|
|
174
203
|
Popover,
|
|
175
204
|
{
|
|
176
|
-
|
|
177
|
-
anchorEl: anchor,
|
|
205
|
+
...still.popoverProps,
|
|
178
206
|
onClose: () => {
|
|
179
|
-
|
|
207
|
+
still.close();
|
|
180
208
|
onOpenChange?.(false);
|
|
181
209
|
},
|
|
182
|
-
|
|
183
|
-
slotProps: { paper: {
|
|
184
|
-
children: /* @__PURE__ */ jsxs(default2, { "data-testid": `${rest.testIdPrefix}-more-panel`, children: [
|
|
210
|
+
marginThreshold: phone ? remPx(theme, 8) : void 0,
|
|
211
|
+
slotProps: { paper: { ref: still.paperRef, sx: phone ? PHONE_PAPER_SX : PAPER_SX } },
|
|
212
|
+
children: /* @__PURE__ */ jsxs(default2, { "data-testid": `${rest.testIdPrefix}-more-panel`, sx: { ...COLUMN_SX, flex: "1 1 auto", minHeight: 0 }, children: [
|
|
185
213
|
/* @__PURE__ */ jsx(MoreHeading, {}),
|
|
186
|
-
/* @__PURE__ */ jsx(default2, { sx: {
|
|
187
|
-
anyApplied && /* @__PURE__ */ jsx(MoreFooter, { onClearAll, testIdPrefix: rest.testIdPrefix })
|
|
214
|
+
/* @__PURE__ */ jsx(default2, { sx: { flex: "1 1 auto", minHeight: 0, overflowY: "auto", overflowX: "hidden", p: { xs: 1, sm: 1.5 }, minWidth: 0 }, children: /* @__PURE__ */ jsx(MoreFields, { fields, ...rest }, clearKey) }),
|
|
215
|
+
(anyApplied || holdsDayRange) && /* @__PURE__ */ jsx(MoreFooter, { onClearAll, testIdPrefix: rest.testIdPrefix, reserved: !anyApplied })
|
|
188
216
|
] })
|
|
189
217
|
}
|
|
190
218
|
)
|
|
@@ -194,4 +222,4 @@ function MoreFilters({
|
|
|
194
222
|
export {
|
|
195
223
|
MoreFilters
|
|
196
224
|
};
|
|
197
|
-
//# sourceMappingURL=chunk-
|
|
225
|
+
//# sourceMappingURL=chunk-JHWEL4NX.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/components/data-display/DataViews/data-views-more-filters.tsx"],"sourcesContent":["\"use client\";\n\nimport KeyboardArrowDownRoundedIcon from \"@mui/icons-material/KeyboardArrowDownRounded\";\n// A FUNNEL, not the tune sliders this used to share with \"Exibir\". The two\n// sit a few px apart on the same bar and do unrelated things — one narrows\n// WHICH rows you see, the other changes HOW they are shown — and with one\n// glyph between them the bar offered the operator no way to tell which was\n// which. On a phone, where both are icon-only, they were indistinguishable.\nimport FilterAltRoundedIcon from \"@mui/icons-material/FilterAltRounded\";\nimport Popover from \"@mui/material/Popover/index.js\";\nimport { useTheme, type Theme } from \"@mui/material/styles/index.js\";\nimport useMediaQuery from \"@mui/material/useMediaQuery/index.js\";\n\n\nimport { useDataViewsCopy } from \"./data-views-copy-context\";\nimport { Button } from \"../../form/Button\";\nimport { Box } from \"../../../mui/Box\";\nimport { Text } from \"../../typography/Text\";\n\nimport { fieldClearing, MoreGroup, MoreQuick, type MoreFieldProps } from \"./data-views-more-fields\";\nimport { useStillAnchor } from \"./data-views-still-anchor\";\nimport type { OverflowField } from \"./data-views-overflow\";\nimport { rem, remPx, sxRem } from \"../../../tokens/relative\";\n\n/**\n * \"MAIS\" — the filter overflow: its trigger, its panel and its footer. What\n * goes INSIDE it is `data-views-more-fields`.\n *\n * It holds the fields that had no room on the toolbar. An applied filter is\n * ranked ahead of an idle one for the visible slots but is NOT exempt (see\n * `useFilterOverflow`), so an applied filter can be in here — on a phone, most\n * of them are. That is why the trigger changes tone and counts the applied\n * ones: a filter you cannot see is a filter you forget you set, and the badge\n * is what stops that.\n */\n\ninterface MoreFiltersProps<T extends Record<string, unknown>> extends MoreFieldProps {\n fields: OverflowField<T>[];\n}\n\n/**\n * The trigger, badged with how many fields had no room on the bar — and told\n * apart when some of them are APPLIED.\n *\n * An applied filter can land in here now (it is ranked first, not exempt), so\n * this button is the only thing on screen still saying it exists. A neutral\n * badge reading \"3\" would make \"three filters you have not used\" and \"three\n * filters narrowing this list\" look identical, which is the whole failure the\n * old exemption was written to avoid. So an overflow holding applied filters\n * takes the applied tone and counts them in its own badge.\n */\nfunction MoreTrigger({\n count,\n appliedCount,\n compact,\n onOpen,\n testIdPrefix,\n}: {\n count: number;\n appliedCount: number;\n /** Icon only — the same rung that strips Exibir/Exportar. */\n compact: boolean;\n onOpen: (anchor: HTMLElement) => void;\n testIdPrefix: string;\n}): React.JSX.Element {\n const copy = useDataViewsCopy();\n const applied = appliedCount > 0;\n return (\n <Button\n variant=\"outline\"\n size=\"sm\"\n color=\"neutral\"\n onClick={(event) => onOpen(event.currentTarget as HTMLElement)}\n dataTestId={`${testIdPrefix}-more-filters`}\n aria-label={\n applied\n ? copy.filters.moreFiltersApplied(count, appliedCount)\n : copy.filters.moreFilters(count)\n }\n >\n <Box\n component=\"span\"\n sx={{\n display: \"inline-flex\",\n alignItems: \"center\",\n gap: 0.5,\n color: applied ? \"primary.main\" : undefined,\n }}\n >\n <FilterAltRoundedIcon fontSize=\"small\" />\n {!compact && (\n <Box component=\"span\" sx={{ display: { xs: \"none\", sm: \"inline\" } }}>\n {copy.filters.moreTriggerLabel}\n </Box>\n )}\n <Box\n component=\"span\"\n data-testid={`${testIdPrefix}-more-badge`}\n sx={{\n px: 0.75,\n borderRadius: 5,\n bgcolor: applied ? \"primary.main\" : \"action.selected\",\n color: applied ? \"primary.contrastText\" : undefined,\n fontSize: sxRem(11),\n fontWeight: applied ? 700 : undefined,\n }}\n >\n {applied ? appliedCount : count}\n </Box>\n {!compact && <KeyboardArrowDownRoundedIcon fontSize=\"small\" />}\n </Box>\n </Button>\n );\n}\n\n/** The panel's heading: what these are, and why they are in here. */\nfunction MoreHeading(): React.JSX.Element {\n const copy = useDataViewsCopy();\n return (\n <Box\n sx={{\n display: \"flex\",\n alignItems: \"center\",\n gap: 1,\n px: 1.5,\n py: 1,\n borderBottom: 1,\n borderColor: \"divider\",\n }}\n >\n <Text variant=\"caption\" as=\"span\">\n <Box component=\"span\" sx={{ textTransform: \"uppercase\", letterSpacing: sxRem(0.5), color: \"text.disabled\" }}>\n {copy.filters.moreHeading}\n </Box>\n </Text>\n <Text variant=\"caption\" as=\"span\">\n <Box component=\"span\" sx={{ ml: \"auto\", color: \"text.disabled\" }}>\n {copy.filters.overflowNote}\n </Box>\n </Text>\n </Box>\n );\n}\n\n/**\n * The panel's own way back to the unfiltered list.\n *\n * The bar's \"Limpar\" is the primary one, but it is a control like any other\n * and the ladder can take its label — and on the narrowest rungs this panel is\n * where most of the fields ended up anyway. Clearing everything from inside it\n * saves closing it to reach a button three pixels wide.\n */\nfunction MoreFooter({\n onClearAll,\n testIdPrefix,\n reserved = false,\n}: {\n onClearAll: () => void;\n testIdPrefix: string;\n /**\n * Hold the footer's height with nothing in it. A panel holding a day range\n * keeps the row while nothing is applied, so the first tap on its calendar\n * does not grow the panel by a row and move its top under the finger\n * (FUT-4144 UI review).\n */\n reserved?: boolean;\n}): React.JSX.Element {\n const copy = useDataViewsCopy();\n return (\n <Box\n aria-hidden={reserved || undefined}\n // Held, the row is blank — no rule over it either, or it reads as an\n // empty bordered row.\n sx={{ px: 1.5, py: 1, borderTop: 1, borderColor: reserved ? \"transparent\" : \"divider\", visibility: reserved ? \"hidden\" : undefined }}\n >\n <Box\n component=\"button\"\n type=\"button\"\n onClick={reserved ? undefined : onClearAll}\n tabIndex={reserved ? -1 : undefined}\n data-testid={reserved ? undefined : `${testIdPrefix}-more-clear-all`}\n sx={{\n width: \"100%\",\n border: 0,\n p: 0,\n bgcolor: \"transparent\",\n cursor: \"pointer\",\n font: \"inherit\",\n fontSize: sxRem(13),\n textAlign: \"left\",\n color: \"primary.main\",\n \"&:hover\": { textDecoration: \"underline\" },\n }}\n >\n {copy.filters.clearAll}\n </Box>\n </Box>\n );\n}\n\n/** The panel's body: a shed quick chip as a toggle row, anything else as a labelled group. */\nfunction MoreFields<T extends Record<string, unknown>>({\n fields,\n ...rest\n}: MoreFiltersProps<T>): React.JSX.Element {\n return (\n <>\n {fields.map((field) =>\n field.quick ? (\n <MoreQuick key={field.id} quick={field.quick} {...rest} />\n ) : (\n <MoreGroup key={field.id} field={field} {...rest} />\n ),\n )}\n </>\n );\n}\n\n/**\n * The panel is a column: heading, the fields' scroller, footer. Its height is\n * the screen's, not a fixed 320px — at 390×844 that cap scrolled a day range's\n * month caption and weekday row out of view after the first tap, and a typed\n * day's refusal out of sight of its box (FUT-4144 UI review). MUI moves the\n * panel up when it is taller than the room under its trigger.\n */\nconst COLUMN_SX = { display: \"flex\", flexDirection: \"column\" } as const;\n\n/**\n * 320, not 300: inside 12px of padding a day range's month then has the 280px\n * its seven 40px columns need and its month/year caption one row (FUT-4144).\n */\nconst PAPER_SX = (theme: Theme) => ({\n ...COLUMN_SX,\n width: rem(theme, 320),\n maxWidth: `calc(100vw - ${rem(theme, 32)})`,\n});\n\n/**\n * Below `sm` the panel takes the screen's width less 8px each side, so a day\n * range's calendar gets the 280px its seven 40px columns need (it had 264 at\n * 320 and 276 at 390, so every day was a 34-36px target).\n */\nconst PHONE_PAPER_SX = (theme: Theme) => ({\n ...COLUMN_SX,\n width: `calc(100vw - ${rem(theme, 16)})`,\n maxWidth: `calc(100vw - ${rem(theme, 16)})`,\n maxHeight: `calc(100% - ${rem(theme, 16)})`,\n});\n\n/** Props of {@link MoreFilters}. */\ninterface MoreFiltersPanelProps<T extends Record<string, unknown>> extends MoreFiltersProps<T> {\n /** Changes on every clear-all; the fields here are keyed on it (FUT-4144). */\n clearKey?: number;\n /** Icon only — the same rung that strips Exibir/Exportar. */\n compact?: boolean;\n /** Clears every filter, not just the ones in here. */\n onClearAll: () => void;\n /** Whether anything is applied anywhere — the footer is pointless otherwise. */\n anyApplied: boolean;\n /**\n * So the shell can FREEZE the measured split while this panel is open.\n *\n * Applying a filter in here makes its field active, and an active field\n * takes an inline slot first — so the field being edited was promoted OUT of\n * this panel mid-keystroke, taking the focused input with it. Typing \"12\"\n * got as far as \"1\" and then had nowhere to go.\n */\n onOpenChange?: (open: boolean) => void;\n}\n\n/** The overflow trigger + panel. Renders nothing when everything fits. */\nexport function MoreFilters<T extends Record<string, unknown>>({\n fields,\n onOpenChange,\n onClearAll,\n anyApplied,\n compact = false,\n clearKey,\n ...rest\n}: MoreFiltersPanelProps<T>): React.JSX.Element | null {\n const still = useStillAnchor();\n const theme = useTheme();\n const phone = useMediaQuery(theme.breakpoints.down(\"sm\"));\n if (fields.length === 0) return null;\n const holdsDayRange = fields.some((field) => field.range?.kind === \"day\");\n return (\n <>\n <MoreTrigger\n count={fields.length}\n appliedCount={\n fields.filter(\n (field) =>\n fieldClearing({\n field,\n pills: rest.pills,\n ranges: rest.ranges,\n onTogglePill: rest.onTogglePill,\n onChangeRange: rest.onChangeRange,\n }).applied,\n ).length\n }\n compact={compact}\n onOpen={(element) => {\n still.open(element);\n onOpenChange?.(true);\n }}\n testIdPrefix={rest.testIdPrefix}\n />\n <Popover\n {...still.popoverProps}\n onClose={() => {\n still.close();\n onOpenChange?.(false);\n }}\n // Below `sm`, 8px from the screen's edges instead of 16.\n marginThreshold={phone ? remPx(theme, 8) : undefined}\n slotProps={{ paper: { ref: still.paperRef, sx: phone ? PHONE_PAPER_SX : PAPER_SX } }}\n >\n <Box data-testid={`${rest.testIdPrefix}-more-panel`} sx={{ ...COLUMN_SX, flex: \"1 1 auto\", minHeight: 0 }}>\n <MoreHeading />\n {/* overflowX hidden, not auto: this panel is a fixed width and its\n contents are told to shrink into it. A horizontal scrollbar here\n means something refused to, which is a bug to fix rather than a\n scrollbar to live with. */}\n <Box sx={{ flex: \"1 1 auto\", minHeight: 0, overflowY: \"auto\", overflowX: \"hidden\", p: { xs: 1, sm: 1.5 }, minWidth: 0 }}>\n <MoreFields key={clearKey} fields={fields} {...rest} />\n </Box>\n {(anyApplied || holdsDayRange) && (\n <MoreFooter onClearAll={onClearAll} testIdPrefix={rest.testIdPrefix} reserved={!anyApplied} />\n )}\n </Box>\n </Popover>\n </>\n );\n}\n"],"mappings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
|
|
5
1
|
import {
|
|
6
2
|
getChartSpecRenderer,
|
|
7
3
|
getRegisteredChartSpecTypes
|
|
8
4
|
} from "./chunk-WKUA6P3W.js";
|
|
5
|
+
import {
|
|
6
|
+
chartAxisValueFormatter,
|
|
7
|
+
chartValueFormatter
|
|
8
|
+
} from "./chunk-6GPNZSAE.js";
|
|
9
9
|
|
|
10
10
|
// src/components/data-display/Chart/chart-spec.ts
|
|
11
11
|
var CHART_SEMANTIC_COLORS = [
|
|
@@ -151,4 +151,4 @@ export {
|
|
|
151
151
|
parseChartSpec,
|
|
152
152
|
specToChartProps
|
|
153
153
|
};
|
|
154
|
-
//# sourceMappingURL=chunk-
|
|
154
|
+
//# sourceMappingURL=chunk-JVOEVTCZ.js.map
|
|
@@ -3,14 +3,14 @@ import {
|
|
|
3
3
|
} from "./chunk-YNVTUQ5B.js";
|
|
4
4
|
import {
|
|
5
5
|
DataViewsGrid
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-DSBC6O46.js";
|
|
7
7
|
import {
|
|
8
8
|
viewStateKey
|
|
9
9
|
} from "./chunk-ZOLAYP2D.js";
|
|
10
10
|
import {
|
|
11
11
|
ViewDialogs,
|
|
12
12
|
ViewMutationErrorAlert
|
|
13
|
-
} from "./chunk-
|
|
13
|
+
} from "./chunk-SCXVTNLE.js";
|
|
14
14
|
import {
|
|
15
15
|
useUrlEchoGuard,
|
|
16
16
|
useUrlSyncState
|
|
@@ -166,4 +166,4 @@ function renderViewDialogs(ctl, fields, columns, views, testIdPrefix, onSaved) {
|
|
|
166
166
|
export {
|
|
167
167
|
DataViewsTableBase
|
|
168
168
|
};
|
|
169
|
-
//# sourceMappingURL=chunk-
|
|
169
|
+
//# sourceMappingURL=chunk-KANCE4MS.js.map
|
|
@@ -3,7 +3,7 @@ import {
|
|
|
3
3
|
} from "./chunk-AJ6KFHEE.js";
|
|
4
4
|
import {
|
|
5
5
|
PanelRangeField
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-FI2CQOGC.js";
|
|
7
7
|
import {
|
|
8
8
|
useDataViewsCopy
|
|
9
9
|
} from "./chunk-KHG57NAE.js";
|
|
@@ -157,4 +157,4 @@ export {
|
|
|
157
157
|
GridFilterPanel,
|
|
158
158
|
FilterDialog
|
|
159
159
|
};
|
|
160
|
-
//# sourceMappingURL=chunk-
|
|
160
|
+
//# sourceMappingURL=chunk-KRBPWTXW.js.map
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import {
|
|
2
2
|
SequenceOverviewBody
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-WH3LUOCQ.js";
|
|
4
4
|
import {
|
|
5
5
|
SequenceDoneBody,
|
|
6
6
|
SequenceIntroBody,
|
|
7
7
|
SequenceStepBody
|
|
8
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-RDCIST7P.js";
|
|
9
9
|
import {
|
|
10
10
|
SequenceHeader
|
|
11
11
|
} from "./chunk-JO6D7YGN.js";
|
|
@@ -225,4 +225,4 @@ function SequenceResolver(props) {
|
|
|
225
225
|
export {
|
|
226
226
|
SequenceResolver
|
|
227
227
|
};
|
|
228
|
-
//# sourceMappingURL=chunk-
|
|
228
|
+
//# sourceMappingURL=chunk-L6JAALMX.js.map
|
|
@@ -128,7 +128,8 @@ function DayBoundInput({
|
|
|
128
128
|
error = false,
|
|
129
129
|
describedBy,
|
|
130
130
|
mask,
|
|
131
|
-
invalidMessage
|
|
131
|
+
invalidMessage,
|
|
132
|
+
fill = false
|
|
132
133
|
}) {
|
|
133
134
|
const id = useId();
|
|
134
135
|
const { text, impossible, handleChange, handlePaste, handleBlur } = useDayText(
|
|
@@ -153,7 +154,8 @@ function DayBoundInput({
|
|
|
153
154
|
onBlur: handleBlur,
|
|
154
155
|
InputLabelProps: { shrink: true },
|
|
155
156
|
inputProps: dayInputProps(testId, [impossible ? `${id}-helper-text` : void 0, describedBy]),
|
|
156
|
-
|
|
157
|
+
fullWidth: fill,
|
|
158
|
+
sx: [{ width: fill ? "100%" : sxRem(165) }, fieldTextFieldStyles]
|
|
157
159
|
}
|
|
158
160
|
);
|
|
159
161
|
}
|
|
@@ -166,4 +168,4 @@ export {
|
|
|
166
168
|
isImpossibleDay,
|
|
167
169
|
DayBoundInput
|
|
168
170
|
};
|
|
169
|
-
//# sourceMappingURL=chunk-
|
|
171
|
+
//# sourceMappingURL=chunk-L6YTVXGN.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/components/data-display/DataViews/data-views-day-input.tsx"],"sourcesContent":["'use client';\n\n/**\n * A day bound as a MASKED `dd/mm/aaaa` text field, replacing `<input type=\"date\">`.\n *\n * The native control is three separate segments wearing one box. Typing a date\n * means filling a segment, being jumped to the next, and starting over — and\n * which segment comes first is the BROWSER's locale, not ours, so the same\n * field reads `dd/mm/aaaa` for one merchant and `mm/dd/yyyy` for the next with\n * nothing in our code saying which. There is no way to type a date as one\n * continuous run of digits, which is how people actually type dates.\n *\n * A mask gives that back: eight digits straight through, separators inserted as\n * you go, backspace walking back through them.\n *\n * Measured, driving both controls in Chromium with the same eight keystrokes\n * (`01072026`, one `keydown` at a time):\n *\n * native → field ends EMPTY, no filter applied, 0 requests\n * masked → field reads `01/07/2026`, filter applied, 1 request\n *\n * The native result is the whole complaint: you type a date and nothing lands.\n *\n * The second half of the fix is WHEN the bound is written. A partially-typed\n * year is itself a valid date — `2026` passes through `0002`, `0020`, `0202` on\n * the way — so committing on every keystroke would send the grid off to fetch\n * years nobody meant. A bound is written only once the text is a WHOLE, real\n * date, which is what keeps the run above at one request rather than four.\n */\nimport TextField from '@mui/material/TextField/index.js';\nimport React, { useEffect, useId, useState } from 'react';\nimport { fieldTextFieldStyles } from '../../../tokens/field-height';\nimport { sxRem } from '../../../tokens/relative';\n\n\n/**\n * THE MASK IS THE ORDER, and both halves of this file read it.\n *\n * The placeholder a host supplies (`copy.filters.dayMask` — `dd/mm/aaaa` for\n * pt-BR, `mm/dd/yyyy` for en-US) is not decoration: it tells the reader which\n * segment comes first. Everything below therefore derives the segment order\n * FROM that same string, so the shape on screen and the shape the parser\n * expects cannot disagree.\n *\n * They did disagree, and the failure was silent in the worst direction. The\n * mask/parse pair was hardcoded day-first (the `Br` in the old names was\n * accurate) while the placeholder followed the copy pack — so under `en-US` the\n * field ASKED for `mm/dd/yyyy`, and a reader who typed exactly that got a day\n * of 12 and a month of 31, which is not a date, which commits nothing. No\n * error, no filter, a full list that reads like an answer. The en-US pack's own\n * comment already said the mask \"is the shape that gets a date entered\n * backwards\"; nothing enforced it.\n */\n\n/** What one segment of a mask is, and how many digits it takes. */\ntype DaySegment = 'year' | 'month' | 'day';\nconst SEGMENT_WIDTH: Readonly<Record<DaySegment, number>> = { year: 4, month: 2, day: 2 };\n\n/**\n * The segments a mask asks for, in its own order.\n *\n * Keyed on each token's FIRST letter so one rule covers every spelling a host\n * might use — `aaaa`/`yyyy` for the year, `mm` for the month, `dd`/`tt` for the\n * day. An unreadable mask falls back to day-first rather than throwing: this\n * runs on every keystroke, and a field that renders is recoverable where one\n * that crashes the grid is not.\n */\nfunction segmentsOf(mask: string): readonly DaySegment[] {\n const tokens = mask.split(/[^A-Za-z]+/).filter(Boolean);\n if (tokens.length !== 3) return ['day', 'month', 'year'];\n const segments = tokens.map((token): DaySegment => {\n const head = token.slice(0, 1).toLowerCase();\n if (head === 'y' || head === 'a') return 'year';\n return head === 'm' ? 'month' : 'day';\n });\n // A mask naming the same segment twice describes no date. Fall back rather\n // than build a parser that can never succeed.\n return new Set(segments).size === 3 ? segments : ['day', 'month', 'year'];\n}\n\n/** The separator the mask uses, defaulting to `/`. */\nconst separatorOf = (mask: string): string => mask.replace(/[A-Za-z]/g, '').slice(0, 1) || '/';\n\n/** `AAAA-MM-DD` (the wire) → the mask's own order (what the reader sees). */\nexport function isoToMasked(iso: string, mask: string): string {\n const parts = /^(\\d{4})-(\\d{2})-(\\d{2})$/.exec(iso);\n if (!parts) return '';\n const value: Record<DaySegment, string> = {\n year: parts[1] as string,\n month: parts[2] as string,\n day: parts[3] as string,\n };\n return segmentsOf(mask)\n .map((segment) => value[segment])\n .join(separatorOf(mask));\n}\n\n/**\n * The mask's order → `AAAA-MM-DD`, but ONLY for a day that exists.\n *\n * `31/02/2026` parses fine as three numbers and is not a date, and `Date` would\n * silently roll it into March rather than reject it — so the round trip through\n * UTC is the check: if the month or day comes back changed, the input was not a\n * day.\n */\nexport function maskedToIso(text: string, mask: string): string {\n const segments = segmentsOf(mask);\n const digits = text.replace(/\\D/g, '');\n if (digits.length !== 8) return '';\n const value = {} as Record<DaySegment, string>;\n let cursor = 0;\n for (const segment of segments) {\n value[segment] = digits.slice(cursor, cursor + SEGMENT_WIDTH[segment]);\n cursor += SEGMENT_WIDTH[segment];\n }\n const year = Number(value.year);\n const month = Number(value.month);\n const day = Number(value.day);\n if (year < 1000) return '';\n const probe = new Date(Date.UTC(year, month - 1, day));\n if (probe.getUTCMonth() !== month - 1 || probe.getUTCDate() !== day) return '';\n return `${value.year}-${value.month}-${value.day}`;\n}\n\n/**\n * Digits only, capped at the mask's width, with the separators put back as you\n * type.\n *\n * Deriving the whole string from the digits — rather than editing the text in\n * place — is what makes backspace behave. Four digits of `dd/mm/aaaa` render as\n * `06/08`, not `06/08/`, so deleting the first digit of the year removes the\n * trailing separator with it instead of leaving a dead keystroke that changes\n * nothing.\n */\nexport function maskDate(raw: string, mask: string): string {\n const segments = segmentsOf(mask);\n const separator = separatorOf(mask);\n const digits = raw.replace(/\\D/g, '').slice(0, 8);\n const out: string[] = [];\n let cursor = 0;\n for (const segment of segments) {\n if (cursor >= digits.length) break;\n out.push(digits.slice(cursor, cursor + SEGMENT_WIDTH[segment]));\n cursor += SEGMENT_WIDTH[segment];\n }\n return out.join(separator);\n}\n\n/** A wire day on its own, as a paste or an autofill delivers it: `2026-10-01`. */\nconst ISO_DAY = /^\\s*(\\d{4}-\\d{2}-\\d{2})\\s*$/;\n\n/**\n * What the field shows for whatever arrived — typed, pasted, autofilled.\n *\n * A whole ISO day (`AAAA-MM-DD`) is READ AS THAT DAY and written in the mask's\n * order. Through `maskDate` alone it is eight digits taken day-first, so a\n * pasted `2026-10-01` came out as `20/26/1001` (FUT-4144). Anything else is\n * masked exactly as typing always was, so the typed and pasted forms of one day\n * land on the same text.\n */\nexport function readDayText(raw: string, mask: string): string {\n const iso = ISO_DAY.exec(raw)?.[1];\n const masked = iso ? isoToMasked(iso, mask) : '';\n return masked || maskDate(raw, mask);\n}\n\n/**\n * Whether `text` is a WHOLE day that does not exist — `31/02/2026`. A partial\n * entry is not impossible, only unfinished, and is never flagged.\n */\nexport function isImpossibleDay(text: string, mask: string): boolean {\n return text.replace(/\\D/g, '').length === 8 && maskedToIso(text, mask) === '';\n}\n\n/**\n * What has to land on the `<input>` itself rather than on the `TextField`.\n *\n * Anything `TextField` does not recognise is spread onto its root `FormControl`\n * div. `inputMode` went up there once: the attribute sat on a non-editable\n * wrapper, meant nothing, and the phone went on offering the letter keyboard\n * for a field that only takes digits (the `dd/mm/aaaa` hint under a QWERTY\n * layout). Only the `<input>` this reaches decides which keypad opens — and the\n * same is true of `aria-describedby`, which on the wrapper points at a\n * description no screen reader will read out for the field.\n *\n * `numeric` and not `tel`: both raise a keypad, but the phone one is a dialler\n * with `+ * #` on it — keys that cannot occur in a date. A paste carrying\n * separators still lands, because the MASK is what filters the text; the keypad\n * only narrows what a thumb can reach for.\n *\n * Autofill off for the same reason: the browser's saved-value strip covers the\n * keypad to suggest names and addresses, none of which are a date, and none of\n * which the mask would keep.\n */\nfunction dayInputProps(testId: string, describedBy: readonly (string | undefined)[]) {\n const ids = describedBy.filter(Boolean).join(' ');\n return {\n 'data-testid': testId,\n maxLength: 10,\n inputMode: 'numeric' as const,\n autoComplete: 'off',\n ...(ids ? { 'aria-describedby': ids } : {}),\n };\n}\n\n/** Props of {@link DayBoundInput}. */\ninterface DayBoundInputProps {\n label: string;\n /** The applied bound, `AAAA-MM-DD`, or undefined when this end is open. */\n value: string | undefined;\n onChange: (bound: string | undefined) => void;\n testId: string;\n /**\n * Paint the field as rejected. It only ever writes a real day by itself, so\n * this is for a caller judging the PAIR: a window whose end precedes its\n * start is two valid days and one impossible period, and the field it was\n * typed into is the only place to say which half is being complained about.\n */\n error?: boolean;\n /** Id of the element carrying that complaint, so it is read WITH the field. */\n describedBy?: string;\n /**\n * The day mask, which IS the placeholder — so the expected ORDER is on\n * screen before the first keystroke rather than discovered by getting it\n * wrong. `dd/mm/aaaa` is one locale's order and one locale's letters.\n *\n * A PROP rather than a context read: this field has two callers, and only\n * one of them is inside DataViews. `DateRangePicker` mounts it standalone\n * with its own message table, so a context read here throws for every host\n * of that picker — which is exactly what it did.\n */\n mask: string;\n /**\n * Said under the field when its eight digits name no day (`31/02/2026`); the\n * field is then marked invalid and KEEPS the text on blur, so the reader sees\n * what was refused instead of the old value quietly coming back (FUT-4144).\n *\n * Opt-in, because the field ships no words of its own: without it an\n * impossible day is still never written, and blur still snaps back.\n */\n invalidMessage?: string;\n}\n\n/** What {@link useDayText} hands the field: its text, its verdict and its handlers. */\ninterface DayText {\n text: string;\n impossible: boolean;\n handleChange: (event: React.ChangeEvent<HTMLInputElement>) => void;\n handlePaste: (event: React.ClipboardEvent<HTMLDivElement>) => void;\n handleBlur: () => void;\n}\n\n/** The typed text of one bound, kept apart from the APPLIED bound it may commit. */\nfunction useDayText(\n applied: string,\n mask: string,\n onChange: (bound: string | undefined) => void,\n judgesImpossible: boolean,\n): DayText {\n const [text, setText] = useState(() => isoToMasked(applied, mask));\n const impossible = judgesImpossible && isImpossibleDay(text, mask);\n\n // Emptying clears the bound. A COMPLETE day applies it. A partial (or an\n // impossible) one does NEITHER — it leaves whatever is applied alone, so\n // typing is never fought and a half-typed year never reaches the backend.\n const enter = (next: string) => {\n setText(next);\n if (next === '') return onChange(undefined);\n const iso = maskedToIso(next, mask);\n if (iso) onChange(iso);\n };\n\n // The bound is the APPLIED filter; `text` is what is being typed. Re-sync only\n // when the applied value moved somewhere the text does not already mean — a\n // \"Limpar\", a saved view, the other pill resetting the pair. Without that\n // guard the field's own write bounces straight back mid-edit and resets the\n // caret, which is the native control's worst habit reproduced by hand.\n //\n // \"Already means\" is a REAL day equal to the bound, or an empty field for an\n // open bound. An impossible day parses to `''` too, so a bare comparison let\n // a \"Limpar\" (applied → `''`) keep `31/02/2026` on screen, red, over a filter\n // that had just been cleared.\n useEffect(() => {\n setText((current) => {\n const iso = maskedToIso(current, mask);\n const means = (iso !== '' || current === '') && iso === applied;\n return means ? current : isoToMasked(applied, mask);\n });\n }, [applied, mask]);\n\n return {\n text,\n impossible,\n handleChange: (event) => enter(readDayText(event.target.value, mask)),\n // A pasted ISO day REPLACES the field whatever it held: inserted at the\n // caret into existing digits it would be read as more digits, and the\n // `maxLength` would cut a padded one before `onChange` ever saw it.\n handlePaste: (event) => {\n const pasted = event.clipboardData.getData('text');\n if (!ISO_DAY.test(pasted)) return;\n event.preventDefault();\n enter(readDayText(pasted, mask));\n },\n // Leaving a half-typed date on screen would show a filter the list is not\n // actually using. On blur the field snaps back to what IS applied; a\n // complete date already equals it, so this only ever tidies. An impossible\n // day the field is SAYING is impossible stays, with its message: snapping\n // it back is the silent forgetting FUT-4144 removed.\n handleBlur: () => {\n if (!impossible) setText(isoToMasked(applied, mask));\n },\n };\n}\n\n/**\n * One end of a day window. The BOUND stays `AAAA-MM-DD` — the form the backend's\n * inclusive day comparison already speaks, and the form the chip label reads —\n * so only the typing surface changes.\n */\nexport function DayBoundInput({\n label,\n value,\n onChange,\n testId,\n error = false,\n describedBy,\n mask,\n invalidMessage,\n}: DayBoundInputProps): React.JSX.Element {\n const id = useId();\n const { text, impossible, handleChange, handlePaste, handleBlur } = useDayText(\n value ?? '',\n mask,\n onChange,\n invalidMessage !== undefined,\n );\n\n return (\n <TextField\n size=\"small\"\n type=\"text\"\n id={id}\n label={label}\n error={error || impossible}\n helperText={impossible ? invalidMessage : undefined}\n placeholder={mask}\n value={text}\n onChange={handleChange}\n onPaste={handlePaste}\n onBlur={handleBlur}\n // The placeholder occupies the space an un-shrunk label would render into.\n InputLabelProps={{ shrink: true }}\n inputProps={dayInputProps(testId, [impossible ? `${id}-helper-text` : undefined, describedBy])}\n sx={[{ width: sxRem(165) }, fieldTextFieldStyles]}\n />\n );\n}\n"],"mappings":";;;;;;;;AA6BA,OAAO,eAAe;AACtB,SAAgB,WAAW,OAAO,gBAAgB;AAoT9C;AA1RJ,IAAM,gBAAsD,EAAE,MAAM,GAAG,OAAO,GAAG,KAAK,EAAE;AAWxF,SAAS,WAAW,MAAqC;AACvD,QAAM,SAAS,KAAK,MAAM,YAAY,EAAE,OAAO,OAAO;AACtD,MAAI,OAAO,WAAW,EAAG,QAAO,CAAC,OAAO,SAAS,MAAM;AACvD,QAAM,WAAW,OAAO,IAAI,CAAC,UAAsB;AACjD,UAAM,OAAO,MAAM,MAAM,GAAG,CAAC,EAAE,YAAY;AAC3C,QAAI,SAAS,OAAO,SAAS,IAAK,QAAO;AACzC,WAAO,SAAS,MAAM,UAAU;AAAA,EAClC,CAAC;AAGD,SAAO,IAAI,IAAI,QAAQ,EAAE,SAAS,IAAI,WAAW,CAAC,OAAO,SAAS,MAAM;AAC1E;AAGA,IAAM,cAAc,CAAC,SAAyB,KAAK,QAAQ,aAAa,EAAE,EAAE,MAAM,GAAG,CAAC,KAAK;AAGpF,SAAS,YAAY,KAAa,MAAsB;AAC7D,QAAM,QAAQ,4BAA4B,KAAK,GAAG;AAClD,MAAI,CAAC,MAAO,QAAO;AACnB,QAAM,QAAoC;AAAA,IACxC,MAAM,MAAM,CAAC;AAAA,IACb,OAAO,MAAM,CAAC;AAAA,IACd,KAAK,MAAM,CAAC;AAAA,EACd;AACA,SAAO,WAAW,IAAI,EACnB,IAAI,CAAC,YAAY,MAAM,OAAO,CAAC,EAC/B,KAAK,YAAY,IAAI,CAAC;AAC3B;AAUO,SAAS,YAAY,MAAc,MAAsB;AAC9D,QAAM,WAAW,WAAW,IAAI;AAChC,QAAM,SAAS,KAAK,QAAQ,OAAO,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,CAAC,WAAY,SAAQ,YAAY,SAAS,IAAI,CAAC;AAAA,IACrD;AAAA,EACF;AACF;AAOO,SAAS,cAAc;AAAA,EAC5B;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA,QAAQ;AAAA,EACR;AAAA,EACA;AAAA,EACA;AACF,GAA0C;AACxC,QAAM,KAAK,MAAM;AACjB,QAAM,EAAE,MAAM,YAAY,cAAc,aAAa,WAAW,IAAI;AAAA,IAClE,SAAS;AAAA,IACT;AAAA,IACA;AAAA,IACA,mBAAmB;AAAA,EACrB;AAEA,SACE;AAAA,IAAC;AAAA;AAAA,MACC,MAAK;AAAA,MACL,MAAK;AAAA,MACL;AAAA,MACA;AAAA,MACA,OAAO,SAAS;AAAA,MAChB,YAAY,aAAa,iBAAiB;AAAA,MAC1C,aAAa;AAAA,MACb,OAAO;AAAA,MACP,UAAU;AAAA,MACV,SAAS;AAAA,MACT,QAAQ;AAAA,MAER,iBAAiB,EAAE,QAAQ,KAAK;AAAA,MAChC,YAAY,cAAc,QAAQ,CAAC,aAAa,GAAG,EAAE,iBAAiB,QAAW,WAAW,CAAC;AAAA,MAC7F,IAAI,CAAC,EAAE,OAAO,MAAM,GAAG,EAAE,GAAG,oBAAoB;AAAA;AAAA,EAClD;AAEJ;","names":[]}
|
|
1
|
+
{"version":3,"sources":["../src/components/data-display/DataViews/data-views-day-input.tsx"],"sourcesContent":["'use client';\n\n/**\n * A day bound as a MASKED `dd/mm/aaaa` text field, replacing `<input type=\"date\">`.\n *\n * The native control is three separate segments wearing one box. Typing a date\n * means filling a segment, being jumped to the next, and starting over — and\n * which segment comes first is the BROWSER's locale, not ours, so the same\n * field reads `dd/mm/aaaa` for one merchant and `mm/dd/yyyy` for the next with\n * nothing in our code saying which. There is no way to type a date as one\n * continuous run of digits, which is how people actually type dates.\n *\n * A mask gives that back: eight digits straight through, separators inserted as\n * you go, backspace walking back through them.\n *\n * Measured, driving both controls in Chromium with the same eight keystrokes\n * (`01072026`, one `keydown` at a time):\n *\n * native → field ends EMPTY, no filter applied, 0 requests\n * masked → field reads `01/07/2026`, filter applied, 1 request\n *\n * The native result is the whole complaint: you type a date and nothing lands.\n *\n * The second half of the fix is WHEN the bound is written. A partially-typed\n * year is itself a valid date — `2026` passes through `0002`, `0020`, `0202` on\n * the way — so committing on every keystroke would send the grid off to fetch\n * years nobody meant. A bound is written only once the text is a WHOLE, real\n * date, which is what keeps the run above at one request rather than four.\n */\nimport TextField from '@mui/material/TextField/index.js';\nimport React, { useEffect, useId, useState } from 'react';\nimport { fieldTextFieldStyles } from '../../../tokens/field-height';\nimport { sxRem } from '../../../tokens/relative';\n\n\n/**\n * THE MASK IS THE ORDER, and both halves of this file read it.\n *\n * The placeholder a host supplies (`copy.filters.dayMask` — `dd/mm/aaaa` for\n * pt-BR, `mm/dd/yyyy` for en-US) is not decoration: it tells the reader which\n * segment comes first. Everything below therefore derives the segment order\n * FROM that same string, so the shape on screen and the shape the parser\n * expects cannot disagree.\n *\n * They did disagree, and the failure was silent in the worst direction. The\n * mask/parse pair was hardcoded day-first (the `Br` in the old names was\n * accurate) while the placeholder followed the copy pack — so under `en-US` the\n * field ASKED for `mm/dd/yyyy`, and a reader who typed exactly that got a day\n * of 12 and a month of 31, which is not a date, which commits nothing. No\n * error, no filter, a full list that reads like an answer. The en-US pack's own\n * comment already said the mask \"is the shape that gets a date entered\n * backwards\"; nothing enforced it.\n */\n\n/** What one segment of a mask is, and how many digits it takes. */\ntype DaySegment = 'year' | 'month' | 'day';\nconst SEGMENT_WIDTH: Readonly<Record<DaySegment, number>> = { year: 4, month: 2, day: 2 };\n\n/**\n * The segments a mask asks for, in its own order.\n *\n * Keyed on each token's FIRST letter so one rule covers every spelling a host\n * might use — `aaaa`/`yyyy` for the year, `mm` for the month, `dd`/`tt` for the\n * day. An unreadable mask falls back to day-first rather than throwing: this\n * runs on every keystroke, and a field that renders is recoverable where one\n * that crashes the grid is not.\n */\nfunction segmentsOf(mask: string): readonly DaySegment[] {\n const tokens = mask.split(/[^A-Za-z]+/).filter(Boolean);\n if (tokens.length !== 3) return ['day', 'month', 'year'];\n const segments = tokens.map((token): DaySegment => {\n const head = token.slice(0, 1).toLowerCase();\n if (head === 'y' || head === 'a') return 'year';\n return head === 'm' ? 'month' : 'day';\n });\n // A mask naming the same segment twice describes no date. Fall back rather\n // than build a parser that can never succeed.\n return new Set(segments).size === 3 ? segments : ['day', 'month', 'year'];\n}\n\n/** The separator the mask uses, defaulting to `/`. */\nconst separatorOf = (mask: string): string => mask.replace(/[A-Za-z]/g, '').slice(0, 1) || '/';\n\n/** `AAAA-MM-DD` (the wire) → the mask's own order (what the reader sees). */\nexport function isoToMasked(iso: string, mask: string): string {\n const parts = /^(\\d{4})-(\\d{2})-(\\d{2})$/.exec(iso);\n if (!parts) return '';\n const value: Record<DaySegment, string> = {\n year: parts[1] as string,\n month: parts[2] as string,\n day: parts[3] as string,\n };\n return segmentsOf(mask)\n .map((segment) => value[segment])\n .join(separatorOf(mask));\n}\n\n/**\n * The mask's order → `AAAA-MM-DD`, but ONLY for a day that exists.\n *\n * `31/02/2026` parses fine as three numbers and is not a date, and `Date` would\n * silently roll it into March rather than reject it — so the round trip through\n * UTC is the check: if the month or day comes back changed, the input was not a\n * day.\n */\nexport function maskedToIso(text: string, mask: string): string {\n const segments = segmentsOf(mask);\n const digits = text.replace(/\\D/g, '');\n if (digits.length !== 8) return '';\n const value = {} as Record<DaySegment, string>;\n let cursor = 0;\n for (const segment of segments) {\n value[segment] = digits.slice(cursor, cursor + SEGMENT_WIDTH[segment]);\n cursor += SEGMENT_WIDTH[segment];\n }\n const year = Number(value.year);\n const month = Number(value.month);\n const day = Number(value.day);\n if (year < 1000) return '';\n const probe = new Date(Date.UTC(year, month - 1, day));\n if (probe.getUTCMonth() !== month - 1 || probe.getUTCDate() !== day) return '';\n return `${value.year}-${value.month}-${value.day}`;\n}\n\n/**\n * Digits only, capped at the mask's width, with the separators put back as you\n * type.\n *\n * Deriving the whole string from the digits — rather than editing the text in\n * place — is what makes backspace behave. Four digits of `dd/mm/aaaa` render as\n * `06/08`, not `06/08/`, so deleting the first digit of the year removes the\n * trailing separator with it instead of leaving a dead keystroke that changes\n * nothing.\n */\nexport function maskDate(raw: string, mask: string): string {\n const segments = segmentsOf(mask);\n const separator = separatorOf(mask);\n const digits = raw.replace(/\\D/g, '').slice(0, 8);\n const out: string[] = [];\n let cursor = 0;\n for (const segment of segments) {\n if (cursor >= digits.length) break;\n out.push(digits.slice(cursor, cursor + SEGMENT_WIDTH[segment]));\n cursor += SEGMENT_WIDTH[segment];\n }\n return out.join(separator);\n}\n\n/** A wire day on its own, as a paste or an autofill delivers it: `2026-10-01`. */\nconst ISO_DAY = /^\\s*(\\d{4}-\\d{2}-\\d{2})\\s*$/;\n\n/**\n * What the field shows for whatever arrived — typed, pasted, autofilled.\n *\n * A whole ISO day (`AAAA-MM-DD`) is READ AS THAT DAY and written in the mask's\n * order. Through `maskDate` alone it is eight digits taken day-first, so a\n * pasted `2026-10-01` came out as `20/26/1001` (FUT-4144). Anything else is\n * masked exactly as typing always was, so the typed and pasted forms of one day\n * land on the same text.\n */\nexport function readDayText(raw: string, mask: string): string {\n const iso = ISO_DAY.exec(raw)?.[1];\n const masked = iso ? isoToMasked(iso, mask) : '';\n return masked || maskDate(raw, mask);\n}\n\n/**\n * Whether `text` is a WHOLE day that does not exist — `31/02/2026`. A partial\n * entry is not impossible, only unfinished, and is never flagged.\n */\nexport function isImpossibleDay(text: string, mask: string): boolean {\n return text.replace(/\\D/g, '').length === 8 && maskedToIso(text, mask) === '';\n}\n\n/**\n * What has to land on the `<input>` itself rather than on the `TextField`.\n *\n * Anything `TextField` does not recognise is spread onto its root `FormControl`\n * div. `inputMode` went up there once: the attribute sat on a non-editable\n * wrapper, meant nothing, and the phone went on offering the letter keyboard\n * for a field that only takes digits (the `dd/mm/aaaa` hint under a QWERTY\n * layout). Only the `<input>` this reaches decides which keypad opens — and the\n * same is true of `aria-describedby`, which on the wrapper points at a\n * description no screen reader will read out for the field.\n *\n * `numeric` and not `tel`: both raise a keypad, but the phone one is a dialler\n * with `+ * #` on it — keys that cannot occur in a date. A paste carrying\n * separators still lands, because the MASK is what filters the text; the keypad\n * only narrows what a thumb can reach for.\n *\n * Autofill off for the same reason: the browser's saved-value strip covers the\n * keypad to suggest names and addresses, none of which are a date, and none of\n * which the mask would keep.\n */\nfunction dayInputProps(testId: string, describedBy: readonly (string | undefined)[]) {\n const ids = describedBy.filter(Boolean).join(' ');\n return {\n 'data-testid': testId,\n maxLength: 10,\n inputMode: 'numeric' as const,\n autoComplete: 'off',\n ...(ids ? { 'aria-describedby': ids } : {}),\n };\n}\n\n/** Props of {@link DayBoundInput}. */\ninterface DayBoundInputProps {\n label: string;\n /** The applied bound, `AAAA-MM-DD`, or undefined when this end is open. */\n value: string | undefined;\n onChange: (bound: string | undefined) => void;\n testId: string;\n /**\n * Paint the field as rejected. It only ever writes a real day by itself, so\n * this is for a caller judging the PAIR: a window whose end precedes its\n * start is two valid days and one impossible period, and the field it was\n * typed into is the only place to say which half is being complained about.\n */\n error?: boolean;\n /** Id of the element carrying that complaint, so it is read WITH the field. */\n describedBy?: string;\n /**\n * The day mask, which IS the placeholder — so the expected ORDER is on\n * screen before the first keystroke rather than discovered by getting it\n * wrong. `dd/mm/aaaa` is one locale's order and one locale's letters.\n *\n * A PROP rather than a context read: this field has two callers, and only\n * one of them is inside DataViews. `DateRangePicker` mounts it standalone\n * with its own message table, so a context read here throws for every host\n * of that picker — which is exactly what it did.\n */\n mask: string;\n /**\n * Said under the field when its eight digits name no day (`31/02/2026`); the\n * field is then marked invalid and KEEPS the text on blur, so the reader sees\n * what was refused instead of the old value quietly coming back (FUT-4144).\n *\n * Opt-in, because the field ships no words of its own: without it an\n * impossible day is still never written, and blur still snaps back.\n */\n invalidMessage?: string;\n /**\n * Take the width of the box it sits in rather than its own 165px. Set where\n * the pair stands over the range calendar, so the two boxes span the\n * calendar's width instead of leaving a gap beside them (FUT-4144).\n */\n fill?: boolean;\n}\n\n/** What {@link useDayText} hands the field: its text, its verdict and its handlers. */\ninterface DayText {\n text: string;\n impossible: boolean;\n handleChange: (event: React.ChangeEvent<HTMLInputElement>) => void;\n handlePaste: (event: React.ClipboardEvent<HTMLDivElement>) => void;\n handleBlur: () => void;\n}\n\n/** The typed text of one bound, kept apart from the APPLIED bound it may commit. */\nfunction useDayText(\n applied: string,\n mask: string,\n onChange: (bound: string | undefined) => void,\n judgesImpossible: boolean,\n): DayText {\n const [text, setText] = useState(() => isoToMasked(applied, mask));\n const impossible = judgesImpossible && isImpossibleDay(text, mask);\n\n // Emptying clears the bound. A COMPLETE day applies it. A partial (or an\n // impossible) one does NEITHER — it leaves whatever is applied alone, so\n // typing is never fought and a half-typed year never reaches the backend.\n const enter = (next: string) => {\n setText(next);\n if (next === '') return onChange(undefined);\n const iso = maskedToIso(next, mask);\n if (iso) onChange(iso);\n };\n\n // The bound is the APPLIED filter; `text` is what is being typed. Re-sync only\n // when the applied value moved somewhere the text does not already mean — a\n // \"Limpar\", a saved view, the other pill resetting the pair. Without that\n // guard the field's own write bounces straight back mid-edit and resets the\n // caret, which is the native control's worst habit reproduced by hand.\n //\n // \"Already means\" is a REAL day equal to the bound, or an empty field for an\n // open bound. An impossible day parses to `''` too, so a bare comparison let\n // a \"Limpar\" (applied → `''`) keep `31/02/2026` on screen, red, over a filter\n // that had just been cleared.\n useEffect(() => {\n setText((current) => {\n const iso = maskedToIso(current, mask);\n const means = (iso !== '' || current === '') && iso === applied;\n return means ? current : isoToMasked(applied, mask);\n });\n }, [applied, mask]);\n\n return {\n text,\n impossible,\n handleChange: (event) => enter(readDayText(event.target.value, mask)),\n // A pasted ISO day REPLACES the field whatever it held: inserted at the\n // caret into existing digits it would be read as more digits, and the\n // `maxLength` would cut a padded one before `onChange` ever saw it.\n handlePaste: (event) => {\n const pasted = event.clipboardData.getData('text');\n if (!ISO_DAY.test(pasted)) return;\n event.preventDefault();\n enter(readDayText(pasted, mask));\n },\n // Leaving a half-typed date on screen would show a filter the list is not\n // actually using. On blur the field snaps back to what IS applied; a\n // complete date already equals it, so this only ever tidies. An impossible\n // day the field is SAYING is impossible stays, with its message: snapping\n // it back is the silent forgetting FUT-4144 removed.\n handleBlur: () => {\n if (!impossible) setText(isoToMasked(applied, mask));\n },\n };\n}\n\n/**\n * One end of a day window. The BOUND stays `AAAA-MM-DD` — the form the backend's\n * inclusive day comparison already speaks, and the form the chip label reads —\n * so only the typing surface changes.\n */\nexport function DayBoundInput({\n label,\n value,\n onChange,\n testId,\n error = false,\n describedBy,\n mask,\n invalidMessage,\n fill = false,\n}: DayBoundInputProps): React.JSX.Element {\n const id = useId();\n const { text, impossible, handleChange, handlePaste, handleBlur } = useDayText(\n value ?? '',\n mask,\n onChange,\n invalidMessage !== undefined,\n );\n\n return (\n <TextField\n size=\"small\"\n type=\"text\"\n id={id}\n label={label}\n error={error || impossible}\n helperText={impossible ? invalidMessage : undefined}\n placeholder={mask}\n value={text}\n onChange={handleChange}\n onPaste={handlePaste}\n onBlur={handleBlur}\n // The placeholder occupies the space an un-shrunk label would render into.\n InputLabelProps={{ shrink: true }}\n inputProps={dayInputProps(testId, [impossible ? `${id}-helper-text` : undefined, describedBy])}\n fullWidth={fill}\n sx={[{ width: fill ? '100%' : sxRem(165) }, fieldTextFieldStyles]}\n />\n );\n}\n"],"mappings":";;;;;;;;AA6BA,OAAO,eAAe;AACtB,SAAgB,WAAW,OAAO,gBAAgB;AA2T9C;AAjSJ,IAAM,gBAAsD,EAAE,MAAM,GAAG,OAAO,GAAG,KAAK,EAAE;AAWxF,SAAS,WAAW,MAAqC;AACvD,QAAM,SAAS,KAAK,MAAM,YAAY,EAAE,OAAO,OAAO;AACtD,MAAI,OAAO,WAAW,EAAG,QAAO,CAAC,OAAO,SAAS,MAAM;AACvD,QAAM,WAAW,OAAO,IAAI,CAAC,UAAsB;AACjD,UAAM,OAAO,MAAM,MAAM,GAAG,CAAC,EAAE,YAAY;AAC3C,QAAI,SAAS,OAA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