@persona/design-system 0.8.1 → 0.9.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/CHANGELOG.md +62 -0
- package/dist/Accordion.d.mts +1 -1
- package/dist/AccordionItem.d.mts +1 -1
- package/dist/{Action-BwYS9qaG.d.mts → Action-DcK0fRrq.d.mts} +3 -3
- package/dist/Action.d.mts +1 -1
- package/dist/AdvancedFilterRuleRow.d.mts +2 -2
- package/dist/AdvancedFilterRulesPopover.d.mts +2 -2
- package/dist/ArrayValueControl.d.mts +1 -1
- package/dist/Attribute.d.mts +3 -3
- package/dist/{Badge-D-5tbZDw.mjs → Badge-DLuyKRCQ.mjs} +2 -2
- package/dist/{Badge-D-5tbZDw.mjs.map → Badge-DLuyKRCQ.mjs.map} +1 -1
- package/dist/BooleanValueControl.d.mts +1 -1
- package/dist/{Breadcrumb-BADja8tn.d.mts → Breadcrumb-CEHEUe8l.d.mts} +1 -1
- package/dist/Breadcrumb.d.mts +1 -1
- package/dist/{Breadcrumbs-CNpM0aXm.mjs → Breadcrumbs-B8aXFPdV.mjs} +8 -8
- package/dist/{Breadcrumbs-CNpM0aXm.mjs.map → Breadcrumbs-B8aXFPdV.mjs.map} +1 -1
- package/dist/{Breadcrumbs-CxP7ktfM.d.mts → Breadcrumbs-BQ-Gj6UV.d.mts} +2 -2
- package/dist/Breadcrumbs.d.mts +1 -1
- package/dist/{Button-CnswHEJ2.d.mts → Button-DKUomFPj.d.mts} +4 -4
- package/dist/Button.d.mts +1 -1
- package/dist/{Calendar-Cke5IlMI.d.mts → Calendar-BvsTQ3e1.d.mts} +1 -1
- package/dist/Calendar.d.mts +1 -1
- package/dist/CalendarBase.d.mts +1 -1
- package/dist/{Card-Dz6jqJuJ.mjs → Card-BXNxWX5C.mjs} +4 -4
- package/dist/{Card-Dz6jqJuJ.mjs.map → Card-BXNxWX5C.mjs.map} +1 -1
- package/dist/{Card-Bp6L08H4.d.mts → Card-DMXDx1W7.d.mts} +3 -3
- package/dist/Card.d.mts +1 -1
- package/dist/CardGrouping.d.mts +38 -0
- package/dist/{CardV2-DEW6mw_o.mjs → CardV2-JPGFAqui.mjs} +9 -9
- package/dist/{CardV2-DEW6mw_o.mjs.map → CardV2-JPGFAqui.mjs.map} +1 -1
- package/dist/{Checkbox-DUXws1Os.d.mts → Checkbox-CVa8WOf2.d.mts} +1 -1
- package/dist/{Checkbox-GibG2pg5.mjs → Checkbox-iSBIpu0l.mjs} +4 -4
- package/dist/{Checkbox-GibG2pg5.mjs.map → Checkbox-iSBIpu0l.mjs.map} +1 -1
- package/dist/Checkbox.d.mts +1 -1
- package/dist/{CheckboxGroupField-DzdOYIjo.d.mts → CheckboxGroupField-BMJwuTpJ.d.mts} +3 -3
- package/dist/CheckboxGroupField.d.mts +1 -1
- package/dist/ChoicesValueControl.d.mts +1 -1
- package/dist/{Combobox-CCDoNF9Y.mjs → Combobox-BkpRqaxB.mjs} +72 -28
- package/dist/Combobox-BkpRqaxB.mjs.map +1 -0
- package/dist/{Combobox-CnxmKUQf.d.mts → Combobox-C2R9eTPr.d.mts} +3 -3
- package/dist/Combobox.d.mts +2 -2
- package/dist/{ComboboxBase-CtNrsPO9.d.mts → ComboboxBase-BghIk4Vk.d.mts} +6 -6
- package/dist/ComboboxBase.d.mts +1 -1
- package/dist/{ComboboxMultiSelect-CMH6iVu4.d.mts → ComboboxMultiSelect-CIOHnhrv.d.mts} +2 -2
- package/dist/ComboboxMultiSelect.d.mts +1 -1
- package/dist/{ComboboxSingleSelect-BLPbLmMY.d.mts → ComboboxSingleSelect-C1JZxli3.d.mts} +5 -4
- package/dist/ComboboxSingleSelect.d.mts +1 -1
- package/dist/{CompactBar-BwKIIlWz.d.mts → CompactBar-DPJAY1NB.d.mts} +3 -3
- package/dist/CompactBar.d.mts +1 -1
- package/dist/{ConfigFormGroup-BQXN2Pgj.mjs → ConfigFormGroup-BBIJsQgy.mjs} +2 -2
- package/dist/{ConfigFormGroup-BQXN2Pgj.mjs.map → ConfigFormGroup-BBIJsQgy.mjs.map} +1 -1
- package/dist/{ControlBar-BJUY6GOX.d.mts → ControlBar-Cg36sjz3.d.mts} +17 -2
- package/dist/ControlBar.d.mts +1 -1
- package/dist/DataTable.d.mts +6 -3
- package/dist/{DateField-BojOHfrv.d.mts → DateField-BXUuqbnb.d.mts} +2 -2
- package/dist/DateField.d.mts +1 -1
- package/dist/{DatePicker-LPIJrc0n.mjs → DatePicker-CjuR6ORz.mjs} +40 -8
- package/dist/DatePicker-CjuR6ORz.mjs.map +1 -0
- package/dist/{DatePicker-BHVx_i_F.d.mts → DatePicker-Cmn1vViU.d.mts} +2 -2
- package/dist/DatePicker.d.mts +1 -1
- package/dist/{DateRangePicker-CelDK_44.d.mts → DateRangePicker-CKhp9Obv.d.mts} +3 -3
- package/dist/DateRangePicker.d.mts +1 -1
- package/dist/DateRangeValueControl.d.mts +2 -2
- package/dist/DateValueControl.d.mts +1 -1
- package/dist/{DropdownButton-i5Dmxiq1.mjs → DropdownButton-CRJDAGjJ.mjs} +3 -3
- package/dist/{DropdownButton-i5Dmxiq1.mjs.map → DropdownButton-CRJDAGjJ.mjs.map} +1 -1
- package/dist/DropdownButton.d.mts +2 -2
- package/dist/{DropdownMenu-j8NWbAvM.mjs → DropdownMenu-C2BHv8Lc.mjs} +2 -2
- package/dist/{DropdownMenu-j8NWbAvM.mjs.map → DropdownMenu-C2BHv8Lc.mjs.map} +1 -1
- package/dist/{DropdownMenu-YtLxcNWt.d.mts → DropdownMenu-CNkQDiJr.d.mts} +2 -2
- package/dist/DropdownMenu.d.mts +1 -1
- package/dist/{ErrorProps-6dRdJ4QQ.d.mts → ErrorProps-oCHtJzEB.d.mts} +1 -1
- package/dist/ErrorProps.d.mts +1 -1
- package/dist/{FieldRegistry-DqO8HiYb.d.mts → FieldRegistry-B7P4wC7y.d.mts} +2 -2
- package/dist/FieldRegistry.d.mts +1 -1
- package/dist/{FilterBar-CpAA2Ozk.d.mts → FilterBar-clWmrKkT.d.mts} +4 -4
- package/dist/FilterBar.d.mts +1 -1
- package/dist/FilterPickerMenu.d.mts +3 -3
- package/dist/FilterPill.d.mts +1 -1
- package/dist/FilterPopover.d.mts +3 -1
- package/dist/FloatValueControl.d.mts +2 -2
- package/dist/{FormControl-B-s6G9mp.d.mts → FormControl-C44o35FL.d.mts} +2 -2
- package/dist/{FormControl-bDxFF0hl.mjs → FormControl-jfjKwUfK.mjs} +4 -4
- package/dist/{FormControl-bDxFF0hl.mjs.map → FormControl-jfjKwUfK.mjs.map} +1 -1
- package/dist/FormControl.d.mts +1 -1
- package/dist/FormControlLabel.d.mts +1 -1
- package/dist/{FormField-DbcqNcx2.mjs → FormField-C3nUzhGT.mjs} +16 -16
- package/dist/{FormField-DbcqNcx2.mjs.map → FormField-C3nUzhGT.mjs.map} +1 -1
- package/dist/{FormField-D3k-f3-f.d.mts → FormField-CXznMtuS.d.mts} +2 -2
- package/dist/FormField.d.mts +1 -1
- package/dist/{Grid-CeH9E5Ai.mjs → Grid-D0mlxk8_.mjs} +1 -1
- package/dist/{Grid-CeH9E5Ai.mjs.map → Grid-D0mlxk8_.mjs.map} +1 -1
- package/dist/{Header-2K49LYkR.d.mts → Header-DvpIsOUN.d.mts} +1 -1
- package/dist/Header.d.mts +1 -1
- package/dist/{HelperTooltip-CTHUM2nC.d.mts → HelperTooltip-C4tgbLYw.d.mts} +2 -2
- package/dist/HelperTooltip.d.mts +1 -1
- package/dist/HighlightedText.d.mts +2 -2
- package/dist/{HoverCopyableField-BARZLhfO.mjs → HoverCopyableField-1_LHm80n.mjs} +6 -6
- package/dist/{HoverCopyableField-BARZLhfO.mjs.map → HoverCopyableField-1_LHm80n.mjs.map} +1 -1
- package/dist/I18nContext-DlvagRAO.d.mts +22 -0
- package/dist/I18nContext.d.mts +2 -0
- package/dist/{IconButton-D5hx405r.d.mts → IconButton-Bt3WyiGq.d.mts} +2 -2
- package/dist/{IconButton-BHFCjvzs.mjs → IconButton-Cqxfmrea.mjs} +3 -3
- package/dist/{IconButton-BHFCjvzs.mjs.map → IconButton-Cqxfmrea.mjs.map} +1 -1
- package/dist/IconButton.d.mts +1 -1
- package/dist/ImageTile.d.mts +1 -1
- package/dist/InlineCombobox.d.mts +1 -1
- package/dist/InlineInput.d.mts +1 -1
- package/dist/{Input-BQbcIiVj.d.mts → Input-CAsOWM0S.d.mts} +3 -3
- package/dist/{Input-BQN97Hzm.mjs → Input-Cg2HxteL.mjs} +4 -4
- package/dist/{Input-BQN97Hzm.mjs.map → Input-Cg2HxteL.mjs.map} +1 -1
- package/dist/Input.d.mts +1 -1
- package/dist/{InputProps-DT1ZReZS.d.mts → InputProps-BU9iiBBz.d.mts} +2 -2
- package/dist/InputProps.d.mts +1 -1
- package/dist/IntegerValueControl.d.mts +2 -2
- package/dist/{Link-Bzm4AL5J.mjs → Link-Cf__H8gD.mjs} +2 -2
- package/dist/{Link-Bzm4AL5J.mjs.map → Link-Cf__H8gD.mjs.map} +1 -1
- package/dist/Link.d.mts +1 -1
- package/dist/{ListBox-CdqRwBvA.d.mts → ListBox--IH6uofo.d.mts} +3 -3
- package/dist/{ListBox-DOqN9DNl.mjs → ListBox-CjNokYs6.mjs} +13 -10
- package/dist/{ListBox-DOqN9DNl.mjs.map → ListBox-CjNokYs6.mjs.map} +1 -1
- package/dist/ListBox.d.mts +1 -1
- package/dist/{ListBoxField-Bl2WLplO.d.mts → ListBoxField-BUKop1Ca.d.mts} +4 -4
- package/dist/ListBoxField.d.mts +1 -1
- package/dist/{LoadingShimmer-Ds7rvIUN.mjs → LoadingShimmer-C73hJqaW.mjs} +1 -1
- package/dist/{LoadingShimmer-Ds7rvIUN.mjs.map → LoadingShimmer-C73hJqaW.mjs.map} +1 -1
- package/dist/LoadingShimmer.d.mts +1 -1
- package/dist/{LogicRow-CwMAn1sh.d.mts → LogicRow-C8Hdl8xB.d.mts} +3 -3
- package/dist/LogicRow.d.mts +1 -1
- package/dist/MaskedInput.d.mts +2 -2
- package/dist/{Menu-CUN9bmc1.d.mts → Menu-BSHJpKyL.d.mts} +3 -3
- package/dist/{Menu-DjW2b3Wk.mjs → Menu-CwKmfxKI.mjs} +2 -2
- package/dist/{Menu-DjW2b3Wk.mjs.map → Menu-CwKmfxKI.mjs.map} +1 -1
- package/dist/Menu.d.mts +1 -1
- package/dist/{Modal-DHLPK65-.mjs → Modal-BBIJVhv2.mjs} +6 -6
- package/dist/{Modal-DHLPK65-.mjs.map → Modal-BBIJVhv2.mjs.map} +1 -1
- package/dist/{Modal-CGXJGrKg.d.mts → Modal-CoUHxtgN.d.mts} +2 -2
- package/dist/Modal.d.mts +1 -1
- package/dist/{PageHeader-eI4RM_uL.mjs → PageHeader-5GyfuGLe.mjs} +3 -3
- package/dist/{PageHeader-eI4RM_uL.mjs.map → PageHeader-5GyfuGLe.mjs.map} +1 -1
- package/dist/PageHeader.d.mts +1 -1
- package/dist/PageLayout-C7ZC7GBA.mjs +132 -0
- package/dist/PageLayout-C7ZC7GBA.mjs.map +1 -0
- package/dist/PageLayout-C7hDmoy_.d.mts +16 -0
- package/dist/PageLayout.d.mts +2 -16
- package/dist/PageLayoutFrame--HlvI4Pp.d.mts +28 -0
- package/dist/PageLayoutFrame.d.mts +2 -28
- package/dist/{PageSelector-kAfYxEky.d.mts → PageSelector-CrUb586l.d.mts} +3 -3
- package/dist/PageSelector.d.mts +1 -1
- package/dist/{Pagination-Bhr7xyd2.d.mts → Pagination-C67fsrxl.d.mts} +2 -2
- package/dist/{Pagination-6BDOn9bX.mjs → Pagination-c4YBCy5d.mjs} +40 -49
- package/dist/Pagination-c4YBCy5d.mjs.map +1 -0
- package/dist/Pagination.d.mts +1 -1
- package/dist/{Pii-DhL1gblz.mjs → Pii-oW_2TUUc.mjs} +2 -2
- package/dist/{Pii-DhL1gblz.mjs.map → Pii-oW_2TUUc.mjs.map} +1 -1
- package/dist/{PillShell-CVJL1k5I.d.mts → PillShell-BkYHghx0.d.mts} +2 -2
- package/dist/PillShell.d.mts +1 -1
- package/dist/{Popover-CbYaWrAy.mjs → Popover-BcII7usF.mjs} +3 -3
- package/dist/{Popover-CbYaWrAy.mjs.map → Popover-BcII7usF.mjs.map} +1 -1
- package/dist/{ProgressIndicator-CYyM6OSx.d.mts → ProgressIndicator-CdhC2LVI.d.mts} +1 -1
- package/dist/{ProgressIndicator-BpF3XLn3.mjs → ProgressIndicator-STyTM0Hq.mjs} +1 -1
- package/dist/{ProgressIndicator-BpF3XLn3.mjs.map → ProgressIndicator-STyTM0Hq.mjs.map} +1 -1
- package/dist/ProgressIndicator.d.mts +1 -1
- package/dist/{PseudoClassProps-BOVN6Etr.d.mts → PseudoClassProps-CverE9Ni.d.mts} +1 -1
- package/dist/PseudoClassProps.d.mts +1 -1
- package/dist/{Radio-DPaX-9LH.mjs → Radio-CHme6WTz.mjs} +2 -2
- package/dist/{Radio-DPaX-9LH.mjs.map → Radio-CHme6WTz.mjs.map} +1 -1
- package/dist/{RadioGroup-C0l0pdEt.d.mts → RadioGroup-CDEfCg-b.d.mts} +1 -1
- package/dist/{RadioGroup-D7f4m2Uc.mjs → RadioGroup-DOLRqHIZ.mjs} +2 -2
- package/dist/{RadioGroup-D7f4m2Uc.mjs.map → RadioGroup-DOLRqHIZ.mjs.map} +1 -1
- package/dist/RadioGroup.d.mts +1 -1
- package/dist/{RangeCalendar-BJn9V3iN.d.mts → RangeCalendar-BOt59kTG.d.mts} +2 -2
- package/dist/RangeCalendar.d.mts +1 -1
- package/dist/RangeCalendarPresets.d.mts +1 -1
- package/dist/{RouterContext-BLrzYlJ_.d.mts → RouterContext-D7HBESqO.d.mts} +2 -2
- package/dist/{RouterContext-CsPnkNdI.mjs → RouterContext-nPSb55p9.mjs} +1 -1
- package/dist/{RouterContext-CsPnkNdI.mjs.map → RouterContext-nPSb55p9.mjs.map} +1 -1
- package/dist/RouterContext.d.mts +1 -1
- package/dist/{RouterLink-BHXjhqps.d.mts → RouterLink-dppNWLgP.d.mts} +2 -2
- package/dist/RouterLink.d.mts +1 -1
- package/dist/RuleEditorFields.d.mts +2 -2
- package/dist/RulesPill.d.mts +1 -1
- package/dist/{SearchInput-Buh8LdIL.d.mts → SearchInput-B7JYHJZI.d.mts} +2 -2
- package/dist/SearchInput.d.mts +1 -1
- package/dist/SectionHeading.d.mts +1 -1
- package/dist/{SegmentedControl-B9qLyIIW.d.mts → SegmentedControl-C_7mTcuL.d.mts} +1 -1
- package/dist/{SegmentedControl-zEvBtVj0.mjs → SegmentedControl-d9tHqWce.mjs} +2 -2
- package/dist/{SegmentedControl-zEvBtVj0.mjs.map → SegmentedControl-d9tHqWce.mjs.map} +1 -1
- package/dist/SegmentedControl.d.mts +1 -1
- package/dist/{Select-BoZuM_e9.mjs → Select-Da6UZicF.mjs} +7 -7
- package/dist/{Select-BoZuM_e9.mjs.map → Select-Da6UZicF.mjs.map} +1 -1
- package/dist/{Select-Cv_9PLOt.d.mts → Select-Ek-A2Cpo.d.mts} +3 -3
- package/dist/Select.d.mts +1 -1
- package/dist/SingleColumnLayout-ByWxiD7d.d.mts +16 -0
- package/dist/SingleColumnLayout.d.mts +2 -16
- package/dist/SmartTextInput.d.mts +9 -9
- package/dist/SmartTextInputField.d.mts +2 -2
- package/dist/SmartTextInputFunctionDialog.d.mts +4 -4
- package/dist/SmartTextInputListbox.d.mts +2 -2
- package/dist/SmartTextInputPopover.d.mts +1 -1
- package/dist/{Spacer-BFOuo0sZ.mjs → Spacer-J_HuhxX2.mjs} +1 -1
- package/dist/{Spacer-BFOuo0sZ.mjs.map → Spacer-J_HuhxX2.mjs.map} +1 -1
- package/dist/{Spinner-CarSRiBF.mjs → Spinner-C4UyK9If.mjs} +1 -1
- package/dist/{Spinner-CarSRiBF.mjs.map → Spinner-C4UyK9If.mjs.map} +1 -1
- package/dist/SplitColumnLayout-DYyJabQ3.d.mts +19 -0
- package/dist/SplitColumnLayout.d.mts +2 -19
- package/dist/{Stack-CEPzs4Pb.mjs → Stack-BkC7FCdF.mjs} +1 -1
- package/dist/{Stack-CEPzs4Pb.mjs.map → Stack-BkC7FCdF.mjs.map} +1 -1
- package/dist/{Stack-XzBzPvSV.d.mts → Stack-D0Dt776K.d.mts} +1 -1
- package/dist/Stack.d.mts +1 -1
- package/dist/{StatusIndicator-bEnMWV_S.mjs → StatusIndicator-akDwBiBW.mjs} +1 -1
- package/dist/{StatusIndicator-bEnMWV_S.mjs.map → StatusIndicator-akDwBiBW.mjs.map} +1 -1
- package/dist/{Sticker-DGfNuxUK.d.mts → Sticker-Cit5EKiU.d.mts} +4 -4
- package/dist/{Sticker-B-fU8lgu.mjs → Sticker-_vmpUMfk.mjs} +3 -3
- package/dist/{Sticker-B-fU8lgu.mjs.map → Sticker-_vmpUMfk.mjs.map} +1 -1
- package/dist/Sticker.d.mts +1 -1
- package/dist/StringValueControl.d.mts +1 -1
- package/dist/Tab.d.mts +1 -1
- package/dist/{TabBar-BSl5v5aa.mjs → TabBar-CmYqreN0.mjs} +6 -9
- package/dist/TabBar-CmYqreN0.mjs.map +1 -0
- package/dist/{Table-B2V5tlfA.d.mts → Table-BtNYI6QX.d.mts} +1 -1
- package/dist/{Table-msXj0glu.mjs → Table-CV8nogHu.mjs} +4 -4
- package/dist/{Table-msXj0glu.mjs.map → Table-CV8nogHu.mjs.map} +1 -1
- package/dist/Table.d.mts +1 -1
- package/dist/{TableBody-SlQe4Jyp.d.mts → TableBody-DQ7pivxP.d.mts} +1 -1
- package/dist/TableBody.d.mts +1 -1
- package/dist/{TableBox-CF1_Fk0j.mjs → TableBox-vCTkOPlC.mjs} +10 -10
- package/dist/{TableBox-CF1_Fk0j.mjs.map → TableBox-vCTkOPlC.mjs.map} +1 -1
- package/dist/TableBox.d.mts +2 -2
- package/dist/{TableBoxCell-BRhGeUnO.d.mts → TableBoxCell-BkJ587Lf.d.mts} +6 -6
- package/dist/TableBoxCell.d.mts +1 -1
- package/dist/{TableBoxField-Cq9M1upV.d.mts → TableBoxField-Dj9Cx9NP.d.mts} +5 -5
- package/dist/TableBoxField.d.mts +1 -1
- package/dist/{TableBoxRow-DZzRYoID.d.mts → TableBoxRow-CpR9Cti1.d.mts} +3 -3
- package/dist/TableBoxRow.d.mts +1 -1
- package/dist/{TableBoxRowActions-4-j3flJq.d.mts → TableBoxRowActions-Bj-LZaI7.d.mts} +2 -2
- package/dist/TableBoxRowActions.d.mts +1 -1
- package/dist/{TableCell-D5Sqb6iO.d.mts → TableCell-DOjW6ADs.d.mts} +2 -2
- package/dist/TableCell.d.mts +1 -1
- package/dist/{TableControls-CqW_nyBY.mjs → TableControls-BtKBTGYR.mjs} +822 -388
- package/dist/TableControls-BtKBTGYR.mjs.map +1 -0
- package/dist/{TableControls-B-LakH-8.d.mts → TableControls-Cw7LDHWj.d.mts} +6 -3
- package/dist/TableControls.d.mts +1 -1
- package/dist/{TableControlsContext-Dh1YVmBM.d.mts → TableControlsContext-DgoZhMpQ.d.mts} +2 -2
- package/dist/TableControlsContext.d.mts +1 -1
- package/dist/{TableHead-BCrVa0BY.d.mts → TableHead-BGUg_aXc.d.mts} +1 -1
- package/dist/TableHead.d.mts +1 -1
- package/dist/{TableHeaderCell-CcEkDozs.d.mts → TableHeaderCell-DcZcMQyR.d.mts} +1 -1
- package/dist/TableHeaderCell.d.mts +1 -1
- package/dist/{TableLayout-Bhj1QBBz.d.mts → TableLayout-CwYQaZlA.d.mts} +1 -1
- package/dist/TableLayout.d.mts +1 -1
- package/dist/{TableRow-Cy1y7b9S.d.mts → TableRow-Dad6_CoD.d.mts} +2 -2
- package/dist/TableRow.d.mts +1 -1
- package/dist/TableTH.d.mts +1 -1
- package/dist/{TableViewConfigurationDropdown-BzygLtGm.d.mts → TableViewConfigurationDropdown-BGuWAarQ.d.mts} +2 -2
- package/dist/TableViewConfigurationDropdown.d.mts +1 -1
- package/dist/{TechnicalSticker-B6T7cHHc.mjs → TechnicalSticker-BhUxOU-L.mjs} +3 -3
- package/dist/{TechnicalSticker-B6T7cHHc.mjs.map → TechnicalSticker-BhUxOU-L.mjs.map} +1 -1
- package/dist/{Text-BdluS7Fy.mjs → Text-CSwFifQF.mjs} +1 -1
- package/dist/{Text-BdluS7Fy.mjs.map → Text-CSwFifQF.mjs.map} +1 -1
- package/dist/{Text-BVGJ-Nlw.d.mts → Text-CUhW_agW.d.mts} +3 -3
- package/dist/Text.d.mts +1 -1
- package/dist/{TextArea-Bzj593VO.d.mts → TextArea-Djd1uT3B.d.mts} +2 -2
- package/dist/{TextArea-C1CmFRiz.mjs → TextArea-J_EscGvm.mjs} +2 -2
- package/dist/{TextArea-C1CmFRiz.mjs.map → TextArea-J_EscGvm.mjs.map} +1 -1
- package/dist/TextArea.d.mts +1 -1
- package/dist/{TextUnderlineTooltip-CgFmtqF_.d.mts → TextUnderlineTooltip-DCVONTD0.d.mts} +2 -2
- package/dist/TextUnderlineTooltip.d.mts +1 -1
- package/dist/Tile.d.mts +1 -1
- package/dist/Toast.d.mts +1 -1
- package/dist/{Toggle-CntyMUPJ.mjs → Toggle-BEOoATjS.mjs} +4 -4
- package/dist/{Toggle-CntyMUPJ.mjs.map → Toggle-BEOoATjS.mjs.map} +1 -1
- package/dist/{Toggle-bSu1xAaq.d.mts → Toggle-EYpW34LO.d.mts} +1 -1
- package/dist/Toggle.d.mts +1 -1
- package/dist/{Tooltip-C0FuZS1C.mjs → Tooltip-B-0VRuKT.mjs} +2 -2
- package/dist/{Tooltip-C0FuZS1C.mjs.map → Tooltip-B-0VRuKT.mjs.map} +1 -1
- package/dist/{Tooltip-Duw4Fz1t.d.mts → Tooltip-DLK9Q2Rg.d.mts} +2 -2
- package/dist/Tooltip.d.mts +1 -1
- package/dist/{TruncatedText-CbTpX_R1.d.mts → TruncatedText-B_u70y6w.d.mts} +1 -1
- package/dist/VersionHistory.d.mts +1 -1
- package/dist/{VersionHistoryItem-D05QYej7.d.mts → VersionHistoryItem-iUabmk_y.d.mts} +1 -1
- package/dist/VersionHistoryItem.d.mts +1 -1
- package/dist/WizardModal.d.mts +2 -2
- package/dist/{accordionTitleTypography-Leehcmb3.d.mts → accordionTitleTypography-C7VVJvlx.d.mts} +2 -2
- package/dist/accordionTitleTypography.d.mts +1 -1
- package/dist/{chainTypes-D8SGRGba.d.mts → chainTypes-DT-9j_sG.d.mts} +4 -4
- package/dist/{codec-Vsztf4fe.d.mts → codec-CGj8cwcj.d.mts} +2 -2
- package/dist/codec.d.mts +1 -1
- package/dist/{color-CrlF3pba.d.mts → color-BOm5A1Si.d.mts} +2 -2
- package/dist/components/Accordion/index.d.mts +1 -1
- package/dist/components/Accordion/index.mjs +2 -2
- package/dist/components/Attribute/index.mjs +4 -4
- package/dist/components/Badge/index.mjs +1 -1
- package/dist/components/Banner/index.mjs +1 -1
- package/dist/components/BottomPanel/index.mjs +3 -3
- package/dist/components/Breadcrumbs/index.d.mts +1 -1
- package/dist/components/Breadcrumbs/index.mjs +1 -1
- package/dist/components/Button/index.d.mts +2 -2
- package/dist/components/Button/index.mjs +1 -1
- package/dist/components/ButtonGroup/index.mjs +2 -2
- package/dist/components/Card/index.d.mts +2 -2
- package/dist/components/Card/index.mjs +1 -1
- package/dist/components/CardV2/index.d.mts +1 -1
- package/dist/components/CardV2/index.mjs +1 -1
- package/dist/components/Checkbox/index.d.mts +1 -1
- package/dist/components/Checkbox/index.mjs +1 -1
- package/dist/components/CodeHighlight/index.mjs +2 -2
- package/dist/components/Combobox/index.d.mts +2 -2
- package/dist/components/Combobox/index.mjs +1 -1
- package/dist/components/ConfigFormGroup/index.mjs +2 -2
- package/dist/components/DataTable/TableControls/index.d.mts +20 -20
- package/dist/components/DataTable/TableControls/index.mjs +1 -1
- package/dist/components/DataTable/index.d.mts +2 -2
- package/dist/components/DataTable/index.mjs +83 -60
- package/dist/components/DataTable/index.mjs.map +1 -1
- package/dist/components/DataTable/types.d.mts +9 -2
- package/dist/components/DatePicker/index.d.mts +5 -5
- package/dist/components/DatePicker/index.mjs +1 -1
- package/dist/components/DropdownButton/index.mjs +1 -1
- package/dist/components/DropdownMenu/index.d.mts +1 -1
- package/dist/components/DropdownMenu/index.mjs +1 -1
- package/dist/components/FloatingPanel/index.mjs +3 -3
- package/dist/components/FormControl/index.d.mts +2 -2
- package/dist/components/FormControl/index.mjs +2 -2
- package/dist/components/FormField/index.d.mts +5 -5
- package/dist/components/FormField/index.mjs +1 -1
- package/dist/components/Grid/index.mjs +1 -1
- package/dist/components/HoverCopyableField/index.mjs +1 -1
- package/dist/components/ImageTile/index.mjs +7 -7
- package/dist/components/Input/index.d.mts +1 -1
- package/dist/components/Input/index.mjs +1 -1
- package/dist/components/Link/index.mjs +1 -1
- package/dist/components/ListBox/index.d.mts +3 -3
- package/dist/components/ListBox/index.mjs +1 -1
- package/dist/components/LoadingShimmer/index.mjs +1 -1
- package/dist/components/MaskedInput/index.mjs +1 -1
- package/dist/components/Menu/index.d.mts +1 -1
- package/dist/components/Menu/index.mjs +1 -1
- package/dist/components/Modal/index.d.mts +1 -1
- package/dist/components/Modal/index.mjs +1 -1
- package/dist/components/PageHeader/index.mjs +1 -1
- package/dist/components/Pagination/index.d.mts +3 -3
- package/dist/components/Pagination/index.mjs +1 -1
- package/dist/components/Pii/index.mjs +1 -1
- package/dist/components/Popover/index.mjs +1 -1
- package/dist/components/ProgressBar/index.mjs +1 -1
- package/dist/components/ProgressIndicator/index.d.mts +1 -1
- package/dist/components/ProgressIndicator/index.mjs +1 -1
- package/dist/components/Radio/index.mjs +1 -1
- package/dist/components/RadioGroup/index.d.mts +1 -1
- package/dist/components/RadioGroup/index.mjs +1 -1
- package/dist/components/RightPanel/index.mjs +4 -4
- package/dist/components/SegmentedControl/index.d.mts +1 -1
- package/dist/components/SegmentedControl/index.mjs +1 -1
- package/dist/components/Select/index.d.mts +1 -1
- package/dist/components/Select/index.mjs +1 -1
- package/dist/components/Slider/index.mjs +1 -1
- package/dist/components/SmartTextInput/index.d.mts +2 -2
- package/dist/components/SmartTextInput/index.mjs +8 -8
- package/dist/components/SmartTextInput/index.mjs.map +1 -1
- package/dist/components/SmartTextInput/parser/method-chain/types.d.mts +1 -1
- package/dist/components/SmartTextInput/parser/smart-text/types.d.mts +2 -2
- package/dist/components/Spacer/index.mjs +1 -1
- package/dist/components/Spinner/index.mjs +1 -1
- package/dist/components/Stack/index.d.mts +1 -1
- package/dist/components/Stack/index.mjs +1 -1
- package/dist/components/StatusIndicator/index.mjs +1 -1
- package/dist/components/Sticker/index.d.mts +1 -1
- package/dist/components/Sticker/index.mjs +1 -1
- package/dist/components/TabBar/index.mjs +1 -1
- package/dist/components/Table/index.d.mts +8 -8
- package/dist/components/Table/index.mjs +1 -1
- package/dist/components/TableBox/index.d.mts +2 -2
- package/dist/components/TableBox/index.mjs +1 -1
- package/dist/components/TechnicalSticker/index.mjs +1 -1
- package/dist/components/Text/index.d.mts +1 -1
- package/dist/components/Text/index.mjs +1 -1
- package/dist/components/TextArea/index.d.mts +1 -1
- package/dist/components/TextArea/index.mjs +1 -1
- package/dist/components/Tile/index.mjs +4 -4
- package/dist/components/Toast/index.mjs +1 -1
- package/dist/components/Toggle/index.d.mts +1 -1
- package/dist/components/Toggle/index.mjs +1 -1
- package/dist/components/Tooltip/index.d.mts +3 -3
- package/dist/components/Tooltip/index.mjs +1 -1
- package/dist/components/VersionHistory/index.d.mts +1 -1
- package/dist/components/VersionHistory/index.mjs +8 -8
- package/dist/compound-expression.d.mts +1 -1
- package/dist/{constants-CQUCM6__.d.mts → constants-CwzbyAdc.d.mts} +1 -1
- package/dist/constants.d.mts +1 -1
- package/dist/{createPath-Bq7wYGt_.d.mts → createPath-C4jIHe68.d.mts} +2 -2
- package/dist/createPath.d.mts +1 -1
- package/dist/{date-filter-D6IfCkwp.mjs → date-filter-B8PKh5vg.mjs} +1 -1
- package/dist/{date-filter-D6IfCkwp.mjs.map → date-filter-B8PKh5vg.mjs.map} +1 -1
- package/dist/{date-range-rule-value-DVhMQP4-.d.mts → date-range-rule-value-BTlHwhVf.d.mts} +2 -2
- package/dist/date-range-rule-value.d.mts +1 -1
- package/dist/{date-rule-intent-BwQ6OTVD.d.mts → date-rule-intent-zdKP-tW_.d.mts} +3 -3
- package/dist/date-rule-intent.d.mts +1 -1
- package/dist/display.d.mts +12 -4
- package/dist/fieldPickerOptions.d.mts +5 -3
- package/dist/{filter-size-context-BjTzcZwZ.d.mts → filter-size-context-D3ZSzFKe.d.mts} +2 -2
- package/dist/filter-size-context.d.mts +1 -1
- package/dist/format-date-value.d.mts +6 -1
- package/dist/formatDateTime-zyRMjfH8.d.mts +30 -0
- package/dist/formatDateTime.d.mts +2 -0
- package/dist/helpers.d.mts +24 -10
- package/dist/i18n-DeJa-arS.mjs +209 -0
- package/dist/i18n-DeJa-arS.mjs.map +1 -0
- package/dist/{index-C-xpEL8b.d.mts → index-B13LwAGD.d.mts} +2 -2
- package/dist/{index-BFIFjR7Q.d.mts → index-B7KIL3U6.d.mts} +2 -2
- package/dist/{index-BhDvrF4l.d.mts → index-DHmZDtDG.d.mts} +3 -3
- package/dist/index-sViox9YW.d.mts +1 -0
- package/dist/index-xAZnxq0d2.d.mts +1 -0
- package/dist/index.d.mts +1 -1
- package/dist/index2.d.mts +1 -1
- package/dist/index3.d.mts +3 -3
- package/dist/index4.d.mts +1 -1
- package/dist/index5.d.mts +15 -15
- package/dist/{input-DpHBIUpP.d.mts → input-DMPo8gRT.d.mts} +3 -3
- package/dist/{inputFields-BVDurw3L.d.mts → inputFields-DHdFgzS2.d.mts} +11 -11
- package/dist/inputFields.d.mts +1 -1
- package/dist/{intersperse-bvY2gibK.mjs → intersperse-DWUGtKug.mjs} +1 -1
- package/dist/{intersperse-bvY2gibK.mjs.map → intersperse-DWUGtKug.mjs.map} +1 -1
- package/dist/{jsonSchema-Bl-qzgrr.d.mts → jsonSchema-6mcLrVG3.d.mts} +1 -1
- package/dist/lib/PDSProvider.d.mts +14 -2
- package/dist/lib/PDSProvider.mjs +15 -8
- package/dist/lib/PDSProvider.mjs.map +1 -1
- package/dist/lib/TruncatedText.d.mts +1 -1
- package/dist/lib/TruncatedTextWithTooltip.d.mts +1 -1
- package/dist/lib/TruncatedTextWithTooltip.mjs +1 -1
- package/dist/lib/chainTypes.d.mts +1 -1
- package/dist/lib/color.d.mts +1 -1
- package/dist/lib/customFunctionSchema.d.mts +1 -1
- package/dist/lib/date-filter/index.d.mts +2 -2
- package/dist/lib/date-filter/index.mjs +1 -1
- package/dist/lib/i18n/index.d.mts +4 -0
- package/dist/lib/i18n/index.mjs +2 -0
- package/dist/lib/jsonSchema.d.mts +1 -1
- package/dist/lib/jsonSchemaType.d.mts +1 -1
- package/dist/lib/message.d.mts +1 -1
- package/dist/lib/methodChain.d.mts +2 -2
- package/dist/lib/methodChain.mjs +1 -1
- package/dist/lib/methodChainNormalize.d.mts +2 -2
- package/dist/lib/methodChainTypes.d.mts +1 -1
- package/dist/lib/objectSchemaTypes.d.mts +1 -1
- package/dist/lib/platformObject.d.mts +1 -1
- package/dist/lib/pseudoClass.d.mts +1 -1
- package/dist/lib/router/adapters/reactRouter.d.mts +1 -1
- package/dist/lib/router/adapters/reactRouter.mjs +1 -1
- package/dist/lib/router/adapters/tanstack.d.mts +1 -1
- package/dist/lib/router/adapters/tanstack.mjs +1 -1
- package/dist/lib/router/index.d.mts +5 -5
- package/dist/lib/router/index.mjs +2 -2
- package/dist/lib/schemaOptions.d.mts +1 -1
- package/dist/lib/schemaOptions.mjs +1 -1
- package/dist/lib/semanticColor.d.mts +1 -1
- package/dist/lib/useChain.d.mts +1 -1
- package/dist/lib/useChain.mjs +1 -1
- package/dist/{listbox-options-BjOkovND.d.mts → listbox-options-yLjqZp4H.d.mts} +3 -3
- package/dist/listbox-options.d.mts +1 -1
- package/dist/{message-w_1-kTDE.d.mts → message-C5n7wFiN.d.mts} +1 -1
- package/dist/{methodChain-B5vZEOff.d.mts → methodChain-BNDytoaD.d.mts} +4 -4
- package/dist/{methodChain-L_h8Z8Bx.mjs → methodChain-xZ1_vhbz.mjs} +1 -1
- package/dist/{methodChain-L_h8Z8Bx.mjs.map → methodChain-xZ1_vhbz.mjs.map} +1 -1
- package/dist/{methodChainTypes-BVkTI8MX.d.mts → methodChainTypes-BuwpPC73.d.mts} +2 -2
- package/dist/mixins/focus.d.mts +1 -1
- package/dist/mixins/hoverable.d.mts +2 -2
- package/dist/mixins/input.d.mts +1 -1
- package/dist/mixins/menuItem.d.mts +2 -2
- package/dist/mixins/scrollbar.d.mts +1 -1
- package/dist/mixins/text.d.mts +1 -1
- package/dist/{operators-BG82-g3M.d.mts → operators-B12UYEsV.d.mts} +18 -11
- package/dist/operators.d.mts +2 -2
- package/dist/{palette-C8tyI81D.d.mts → palette-BCszfY7I.d.mts} +3 -3
- package/dist/palette.d.mts +1 -1
- package/dist/patterns/CardGrouping/index.d.mts +2 -0
- package/dist/patterns/CardGrouping/index.mjs +280 -0
- package/dist/patterns/CardGrouping/index.mjs.map +1 -0
- package/dist/patterns/LayoutLoadingShimmer/index.mjs +5 -5
- package/dist/patterns/PageLayout/index.d.mts +5 -5
- package/dist/patterns/PageLayout/index.mjs +1 -131
- package/dist/patterns/WizardModal/index.mjs +4 -4
- package/dist/reactRouterFallback.d.mts +1 -1
- package/dist/relative-date-label.d.mts +1 -1
- package/dist/{router-7FYDW80v.mjs → router-COrZcVkf.mjs} +2 -2
- package/dist/{router-7FYDW80v.mjs.map → router-COrZcVkf.mjs.map} +1 -1
- package/dist/safe-parse.d.mts +1 -1
- package/dist/{schemaOptions-DGca6x7E.d.mts → schemaOptions-DBOUChxi.d.mts} +3 -3
- package/dist/{semantic-D1661f_6.d.mts → semantic-Duoh2Pxp.d.mts} +1 -1
- package/dist/{semanticColor-Bg0H3RUL.d.mts → semanticColor-BuG977_M.d.mts} +3 -3
- package/dist/strings-DQ3vxBj8.d.mts +149 -0
- package/dist/strings.d.mts +2 -0
- package/dist/{text-Iw9DKpbZ.d.mts → text-B7hx6G99.d.mts} +1 -1
- package/dist/{theme-BB1B6Wkz.d.mts → theme-BKg55Zk1.d.mts} +3 -3
- package/dist/theme.d.mts +1 -1
- package/dist/tone.d.mts +3 -3
- package/dist/tree.d.mts +1 -1
- package/dist/{types-M-rsm1Km.d.mts → types-4wnr5R9P.d.mts} +1 -1
- package/dist/{types-CI2bPi02.d.mts → types-6QeQmbFm.d.mts} +1 -1
- package/dist/{types-DZTbvdpO.d.mts → types-BjMJFNYH.d.mts} +1 -1
- package/dist/{types-Cs6CdZCO.d.mts → types-CEQWndtF.d.mts} +4 -4
- package/dist/{types-Dy3lZv9z.d.mts → types-CM8L7-ij.d.mts} +31 -9
- package/dist/{types-D1DijcJv.d.mts → types-CgKSEQyB.d.mts} +1 -1
- package/dist/{types-DdTu747j.d.mts → types-CwzwClJx.d.mts} +1 -1
- package/dist/{types-BYRTxB0a.d.mts → types-VgGkS4JB.d.mts} +2 -2
- package/dist/{types-B0ilOIfE.d.mts → types-eemD0jxb.d.mts} +2 -2
- package/dist/types.d.mts +1 -1
- package/dist/types2.d.mts +1 -1
- package/dist/types3.d.mts +1 -1
- package/dist/types4.d.mts +2 -2
- package/dist/types5.d.mts +1 -1
- package/dist/types6.d.mts +1 -1
- package/dist/types7.d.mts +1 -1
- package/dist/{url-state-DWA7UFxS.d.mts → url-state-BW1mN6WQ.d.mts} +2 -2
- package/dist/url-state.d.mts +1 -1
- package/dist/{useChain-CEsXE2Bx.d.mts → useChain-BreIP4fW.d.mts} +6 -6
- package/dist/{useChain-CKqYGdx4.mjs → useChain-Cu4KDfFk.mjs} +2 -2
- package/dist/{useChain-CKqYGdx4.mjs.map → useChain-Cu4KDfFk.mjs.map} +1 -1
- package/dist/useChainAtCursor.d.mts +6 -6
- package/dist/useCodeChainFunctionPanel.d.mts +1 -1
- package/dist/useComboboxFooterAction.d.mts +5 -2
- package/dist/{useFilterStateV2-DoJ9lyJx.d.mts → useFilterStateV2-B8VebPBe.d.mts} +5 -4
- package/dist/useFilterStateV2.d.mts +1 -1
- package/dist/{useFormField-BtnAYcHV.d.mts → useFormField-DAwApAKK.d.mts} +2 -2
- package/dist/{useFormField-BAmkdxtA.mjs → useFormField-J0LiPcpm.mjs} +2 -2
- package/dist/{useFormField-BAmkdxtA.mjs.map → useFormField-J0LiPcpm.mjs.map} +1 -1
- package/dist/useFormField.d.mts +1 -1
- package/dist/{useFormGroup-BZayb9fZ.mjs → useFormGroup-CALbrUkl.mjs} +1 -1
- package/dist/{useFormGroup-BZayb9fZ.mjs.map → useFormGroup-CALbrUkl.mjs.map} +1 -1
- package/dist/{useLocationPathname-pLyLOrAi.d.mts → useLocationPathname-BHL0pgiu.d.mts} +1 -1
- package/dist/useLocationPathname.d.mts +1 -1
- package/dist/{useTableBoxDragAndDrop-wjc_LCpC.d.mts → useTableBoxDragAndDrop-Dq30b6yY.d.mts} +1 -1
- package/dist/useTableBoxDragAndDrop.d.mts +1 -1
- package/dist/{useToggle-DUHQjohK.mjs → useToggle-DRzCDqrc.mjs} +1 -1
- package/dist/{useToggle-DUHQjohK.mjs.map → useToggle-DRzCDqrc.mjs.map} +1 -1
- package/dist/useTruncation.d.mts +1 -1
- package/dist/{utilities-DL18UdPs.d.mts → utilities-B2ry7_20.d.mts} +1 -1
- package/dist/utilities.d.mts +1 -1
- package/dist/utils/storybook.mjs +1 -1
- package/dist/utils/testing.d.mts +1 -1
- package/dist/utils.d.mts +1 -1
- package/dist/utils4.d.mts +5 -5
- package/dist/{validation-PeVTwtd-.d.mts → validation-ZHnFPRP6.d.mts} +3 -3
- package/dist/validation.d.mts +1 -1
- package/dist/validation2.d.mts +4 -4
- package/dist/{value-control-resolver-Cx_wXQFv.d.mts → value-control-resolver-D3qzy8Kk.d.mts} +2 -2
- package/dist/value-control-resolver.d.mts +1 -1
- package/dist/variables/effect.d.mts +1 -1
- package/dist/variables/semantic.d.mts +1 -1
- package/llms.txt +2 -1
- package/package.json +7 -3
- package/skills/ui-authoring/COMPONENTS.md +2 -0
- package/skills/ui-authoring/PATTERNS.md +7 -2
- package/skills/ui-authoring/SKILL.md +23 -0
- package/dist/Combobox-CCDoNF9Y.mjs.map +0 -1
- package/dist/DatePicker-LPIJrc0n.mjs.map +0 -1
- package/dist/Pagination-6BDOn9bX.mjs.map +0 -1
- package/dist/TabBar-BSl5v5aa.mjs.map +0 -1
- package/dist/TableControls-CqW_nyBY.mjs.map +0 -1
- package/dist/patterns/PageLayout/index.mjs.map +0 -1
- /package/dist/{index-BCq_fh4A2.d.mts → index-8SLBz2NH.d.mts} +0 -0
- /package/dist/{index-BINnViIh.d.mts → index-B24gUwOx.d.mts} +0 -0
- /package/dist/{index-BMBcfD_R.d.mts → index-B8M0Grl_2.d.mts} +0 -0
- /package/dist/{index-BOn0AAue.d.mts → index-BFnNtGdX.d.mts} +0 -0
- /package/dist/{index-BcsXXrHq.d.mts → index-BTviwbFV.d.mts} +0 -0
- /package/dist/{index-BwXb5CoQ.d.mts → index-BwFl_eS0.d.mts} +0 -0
- /package/dist/{index-C9achTF6.d.mts → index-C3kE54DD.d.mts} +0 -0
- /package/dist/{index-CCKHlTA4.d.mts → index-C6HcjJiY.d.mts} +0 -0
- /package/dist/{index-CFuHCx9T.d.mts → index-CSf15oCd.d.mts} +0 -0
- /package/dist/{index-CWB6exYm.d.mts → index-CX869wwk.d.mts} +0 -0
- /package/dist/{index-CryTAIZM.d.mts → index-CXaDbCtw.d.mts} +0 -0
- /package/dist/{index-CuYZJcK3.d.mts → index-D4DUvwPf.d.mts} +0 -0
- /package/dist/{index-CuheJfs-.d.mts → index-DB7t8whN.d.mts} +0 -0
- /package/dist/{index-D-9tW2r5.d.mts → index-DhiymMxa.d.mts} +0 -0
- /package/dist/{index-D9XihFV1.d.mts → index-DvwPIy8X.d.mts} +0 -0
- /package/dist/{index-Dflz2i1X.d.mts → index-Oio5ygqN.d.mts} +0 -0
- /package/dist/{index-DrK1_jKY.d.mts → index-Wc1llEvP.d.mts} +0 -0
- /package/dist/{index-Iujpc9_6.d.mts → index-bHnO4ZKt.d.mts} +0 -0
- /package/dist/{index-e6k85DKM.d.mts → index-dzI_9J-Z.d.mts} +0 -0
- /package/dist/{index-irNqT1qQ2.d.mts → index-lIMqGGJz.d.mts} +0 -0
- /package/dist/{index-xmouCHX9.d.mts → index-luywJTzJ.d.mts} +0 -0
|
@@ -1,45 +1,50 @@
|
|
|
1
1
|
import { a as styled, n as createGlobalStyle, r as css } from "./styledComponentsInterop-NxwFjeA4.mjs";
|
|
2
|
+
import { c as usePDSLocale, i as formatDateTime, l as usePDSStrings, u as DEFAULT_COMMON_STRINGS } from "./i18n-DeJa-arS.mjs";
|
|
2
3
|
import { TruncatedText } from "./lib/TruncatedText.mjs";
|
|
3
4
|
import { semanticColor, semanticOnly, semanticTokens } from "./lib/semanticColor.mjs";
|
|
4
5
|
import { paragraphMixins } from "./mixins/text.mjs";
|
|
5
|
-
import { t as Card_default } from "./Card-
|
|
6
|
-
import { t as Spacer_default } from "./Spacer-
|
|
7
|
-
import { i as Paragraph, r as Label$1 } from "./Text-
|
|
6
|
+
import { t as Card_default } from "./Card-BXNxWX5C.mjs";
|
|
7
|
+
import { t as Spacer_default } from "./Spacer-J_HuhxX2.mjs";
|
|
8
|
+
import { i as Paragraph, r as Label$1 } from "./Text-CSwFifQF.mjs";
|
|
8
9
|
import "./variables/transitions.mjs";
|
|
9
|
-
import { a as Tooltip } from "./Tooltip-
|
|
10
|
+
import { a as Tooltip } from "./Tooltip-B-0VRuKT.mjs";
|
|
10
11
|
import { transparent, withAlpha } from "./lib/color.mjs";
|
|
11
12
|
import { letPointerDownReachDocument } from "./lib/letPointerDownReachDocument.mjs";
|
|
12
13
|
import { isActive, isDisabled, isFocused, isHovered, isNotDisabled } from "./lib/pseudoClass.mjs";
|
|
14
|
+
import { moveItemByIndex } from "./lib/reorderItems.mjs";
|
|
13
15
|
import { useScrollOverflow } from "./lib/useScrollOverflow.mjs";
|
|
14
16
|
import { Z_INDICES } from "./lib/zindex.mjs";
|
|
15
17
|
import { focusOutline, focusWithinOutline } from "./mixins/focus.mjs";
|
|
16
18
|
import { semanticScrollbar } from "./mixins/scrollbar.mjs";
|
|
17
|
-
import { n as Stack, t as HStack } from "./Stack-
|
|
18
|
-
import { n as
|
|
19
|
-
import {
|
|
20
|
-
import { r as
|
|
19
|
+
import { n as Stack, t as HStack } from "./Stack-BkC7FCdF.mjs";
|
|
20
|
+
import { i as selectedPresetFor, n as parseDateFilterValue, r as resolveDateFilterValue, t as formatDateFilterValue } from "./date-filter-B8PKh5vg.mjs";
|
|
21
|
+
import { n as Button, t as IconButton } from "./IconButton-Cqxfmrea.mjs";
|
|
22
|
+
import { i as TabBar, n as StyledTab, r as Tab } from "./TabBar-CmYqreN0.mjs";
|
|
23
|
+
import { r as InputGroup } from "./Input-Cg2HxteL.mjs";
|
|
21
24
|
import Input_default from "./components/Input/index.mjs";
|
|
22
|
-
import { c as MenuList, s as MenuItem } from "./Menu-
|
|
23
|
-
import { n as DropdownMenu_default } from "./DropdownMenu-
|
|
24
|
-
import { t as Combobox } from "./Combobox-
|
|
25
|
-
import { s as Popover_default } from "./Popover-
|
|
26
|
-
import { i as Modal_default } from "./Modal-
|
|
27
|
-
import { t as Toggle } from "./Toggle-
|
|
28
|
-
import {
|
|
29
|
-
import {
|
|
30
|
-
import {
|
|
31
|
-
import { r as DatePicker, t as DateRangePicker } from "./DatePicker-LPIJrc0n.mjs";
|
|
25
|
+
import { c as MenuList, s as MenuItem } from "./Menu-CwKmfxKI.mjs";
|
|
26
|
+
import { n as DropdownMenu_default } from "./DropdownMenu-C2BHv8Lc.mjs";
|
|
27
|
+
import { t as Combobox } from "./Combobox-BkpRqaxB.mjs";
|
|
28
|
+
import { s as Popover_default } from "./Popover-BcII7usF.mjs";
|
|
29
|
+
import { i as Modal_default } from "./Modal-BBIJVhv2.mjs";
|
|
30
|
+
import { t as Toggle } from "./Toggle-BEOoATjS.mjs";
|
|
31
|
+
import { t as ListBox } from "./ListBox-CjNokYs6.mjs";
|
|
32
|
+
import { m as FormField, o as ComboboxField } from "./FormField-C3nUzhGT.mjs";
|
|
33
|
+
import { r as DatePicker, t as DateRangePicker } from "./DatePicker-CjuR6ORz.mjs";
|
|
32
34
|
import { BorderRadius, Color, Spacing, Typography } from "@persona/design-tokens";
|
|
33
35
|
import { Fragment, createContext, createElement, forwardRef, useCallback, useContext, useEffect, useLayoutEffect, useMemo, useRef, useState } from "react";
|
|
34
36
|
import { Fragment as Fragment$1, jsx, jsxs } from "react/jsx-runtime";
|
|
35
|
-
import {
|
|
37
|
+
import { DateTime, Settings } from "luxon";
|
|
38
|
+
import { CaretDownIcon, CheckIcon, CircleInfoIcon, CirclePlusIcon, CopyIcon, EyeIcon, EyeOffIcon, FilterIcon, MoreIcon, PlusIcon, RotateCcwIcon, SaveIcon, SearchIcon, SettingsIcon, StarIcon, TrashIcon, XIcon } from "@persona/icons";
|
|
36
39
|
import { CaretDownIcon as CaretDownIcon$1, CircleInfoIcon as CircleInfoIcon$1, LockedIcon as LockedIcon$1, MoreIcon as MoreIcon$1, PlusIcon as PlusIcon$1, SearchIcon as SearchIcon$1, XIcon as XIcon$1 } from "@persona/icons/12px";
|
|
37
40
|
import { debounce, isEqual, noop, partition, startCase, union, uniqueId } from "lodash-es";
|
|
38
41
|
import { useId } from "react-aria";
|
|
42
|
+
import { mergeRefs } from "@react-aria/utils";
|
|
39
43
|
import Fuse from "fuse.js";
|
|
40
44
|
import { DragIcon as DragIcon$1 } from "@persona/icons/24px";
|
|
41
|
-
import { DateTime, Settings } from "luxon";
|
|
42
45
|
import * as PopoverPrimitive from "@radix-ui/react-popover";
|
|
46
|
+
import { DndContext, PointerSensor, closestCenter, pointerWithin, useSensor, useSensors } from "@dnd-kit/core";
|
|
47
|
+
import { SortableContext, horizontalListSortingStrategy, useSortable } from "@dnd-kit/sortable";
|
|
43
48
|
import { DragDropContext, Draggable, Droppable } from "@hello-pangea/dnd";
|
|
44
49
|
import { parseAbsolute, parseDate, toCalendarDate, toZoned } from "@internationalized/date";
|
|
45
50
|
import { v4 } from "uuid";
|
|
@@ -96,21 +101,33 @@ const StyledInput = styled(Input_default)`
|
|
|
96
101
|
`;
|
|
97
102
|
const SearchInput = ({ className, title = "Search", handleInput, handleOnFocus = noop, onBlur = noop, id, value, placeholder, dataTest, autoFocus, useClearIcon = false, disabled = false, disabledTooltip, anchorTooltipToCursor = false, size = "md", leftIcon = size === "sm" ? /* @__PURE__ */ jsx(SearchIcon$1, {}) : /* @__PURE__ */ jsx(SearchIcon, {}), flattenDisplay = false, maxLength }) => {
|
|
98
103
|
const [innerValue, setInnerValue] = useState(value);
|
|
104
|
+
const pendingEmissionsRef = useRef([]);
|
|
105
|
+
const emit = useCallback((next) => {
|
|
106
|
+
pendingEmissionsRef.current.push(next);
|
|
107
|
+
handleInput(next);
|
|
108
|
+
}, [handleInput]);
|
|
99
109
|
const handleChange = useCallback(({ target }) => {
|
|
100
110
|
setInnerValue(target.value);
|
|
101
|
-
|
|
102
|
-
}, [
|
|
111
|
+
emit(target.value);
|
|
112
|
+
}, [emit, setInnerValue]);
|
|
103
113
|
useEffect(() => {
|
|
114
|
+
const pending = pendingEmissionsRef.current;
|
|
115
|
+
const pendingIndex = pending.lastIndexOf(value);
|
|
116
|
+
if (pendingIndex >= 0 && pendingIndex < pending.length - 1) {
|
|
117
|
+
pending.splice(0, pendingIndex + 1);
|
|
118
|
+
return;
|
|
119
|
+
}
|
|
120
|
+
pending.length = 0;
|
|
104
121
|
setInnerValue(value);
|
|
105
122
|
}, [value]);
|
|
106
123
|
const inputRef = useRef(null);
|
|
107
124
|
const handleClear = useCallback(() => {
|
|
108
125
|
setInnerValue("");
|
|
109
|
-
|
|
126
|
+
emit("");
|
|
110
127
|
handleOnFocus();
|
|
111
128
|
inputRef.current?.focus();
|
|
112
129
|
}, [
|
|
113
|
-
|
|
130
|
+
emit,
|
|
114
131
|
handleOnFocus,
|
|
115
132
|
inputRef,
|
|
116
133
|
setInnerValue
|
|
@@ -217,6 +234,7 @@ const CompactSearchInput = styled(SearchInput)`
|
|
|
217
234
|
* @see ControlBar.spec.tsx
|
|
218
235
|
*/
|
|
219
236
|
const CompactBar = ({ title, searchProps, showFilters, setShowFilters, filtersId, isLoading, isFilterPanelLoading, propertiesButton, tableActions, "data-tour-target": dataTourTarget, filterPanel }) => {
|
|
237
|
+
const strings = usePDSStrings();
|
|
220
238
|
const autoExpandSearch = !title;
|
|
221
239
|
const [showSearch, setShowSearch] = useState(autoExpandSearch);
|
|
222
240
|
return /* @__PURE__ */ jsxs(Fragment$1, { children: [/* @__PURE__ */ jsxs(DataTableCompactBar, {
|
|
@@ -253,7 +271,7 @@ const CompactBar = ({ title, searchProps, showFilters, setShowFilters, filtersId
|
|
|
253
271
|
variant: "text",
|
|
254
272
|
width: "icon",
|
|
255
273
|
size: "sm",
|
|
256
|
-
"aria-label":
|
|
274
|
+
"aria-label": strings.showSearchBar,
|
|
257
275
|
onClick: () => setShowSearch(true),
|
|
258
276
|
children: /* @__PURE__ */ jsx(SearchIcon, {})
|
|
259
277
|
})),
|
|
@@ -261,7 +279,7 @@ const CompactBar = ({ title, searchProps, showFilters, setShowFilters, filtersId
|
|
|
261
279
|
id: "table-controls__view-tab-filters",
|
|
262
280
|
variant: "text",
|
|
263
281
|
onClick: () => setShowFilters?.(!showFilters),
|
|
264
|
-
"aria-label": showFilters ?
|
|
282
|
+
"aria-label": showFilters ? strings.hideFilters : strings.showFilters,
|
|
265
283
|
"aria-expanded": showFilters,
|
|
266
284
|
"aria-controls": filtersId,
|
|
267
285
|
disabled: isLoading || isFilterPanelLoading,
|
|
@@ -299,7 +317,9 @@ const rectContainsRect = (parent, child) => {
|
|
|
299
317
|
//#region components/DataTable/TableControls/ControlBar.tsx
|
|
300
318
|
const TAB_ID_PREFIX = "table-controls__view-tab_";
|
|
301
319
|
const OVERFLOW_TAB_ID_PREFIX = "table-controls__view-tab-overflow_";
|
|
320
|
+
const ADD_VIEW_BUTTON_ID = "table-controls__view-tab-new";
|
|
302
321
|
const OVERFLOW_WIDTH_SHRINK_THRESHOLD = 16;
|
|
322
|
+
const OVERFLOW_GAP = 8;
|
|
303
323
|
function enterProxiesClick(e) {
|
|
304
324
|
if (e.key === "Enter") e.target.dispatchEvent(new Event("click", { bubbles: true }));
|
|
305
325
|
}
|
|
@@ -313,6 +333,40 @@ const ViewNameInput = styled(Input_default)`
|
|
|
313
333
|
const AddViewButton = styled(IconButton)`
|
|
314
334
|
color: ${({ theme }) => semanticColor(theme, "FgSecondary", theme.color.text.secondary)};
|
|
315
335
|
`;
|
|
336
|
+
const MIN_TAB_WIDTH_FOR_HIDE_BUTTON = 32;
|
|
337
|
+
const HideViewButton = styled(IconButton)`
|
|
338
|
+
position: absolute;
|
|
339
|
+
top: 50%;
|
|
340
|
+
right: 0;
|
|
341
|
+
transform: translateY(-50%);
|
|
342
|
+
opacity: 0;
|
|
343
|
+
color: ${({ theme }) => semanticColor(theme, "FgSecondary", theme.color.text.secondary)};
|
|
344
|
+
background-color: ${({ theme }) => semanticColor(theme, "SurfacePrimary", theme.color.white)};
|
|
345
|
+
box-shadow: -${Spacing[2]} 0 ${Spacing[2]}
|
|
346
|
+
${({ theme }) => semanticColor(theme, "SurfacePrimary", theme.color.white)};
|
|
347
|
+
|
|
348
|
+
/* The icon's own "XIcon" title would otherwise replace the button's "Hide view" tooltip. */
|
|
349
|
+
svg {
|
|
350
|
+
pointer-events: none;
|
|
351
|
+
}
|
|
352
|
+
|
|
353
|
+
/* Without hover, a tap on the tab's edge must not land on the invisible button. */
|
|
354
|
+
@media (hover: none) {
|
|
355
|
+
pointer-events: none;
|
|
356
|
+
}
|
|
357
|
+
`;
|
|
358
|
+
const TabSlot = styled.div`
|
|
359
|
+
position: relative;
|
|
360
|
+
display: inline-flex;
|
|
361
|
+
|
|
362
|
+
&:hover,
|
|
363
|
+
&:has(:focus-visible) {
|
|
364
|
+
${HideViewButton} {
|
|
365
|
+
opacity: 1;
|
|
366
|
+
pointer-events: auto;
|
|
367
|
+
}
|
|
368
|
+
}
|
|
369
|
+
`;
|
|
316
370
|
const LockedTab = styled(Tab)`
|
|
317
371
|
svg {
|
|
318
372
|
height: 12px;
|
|
@@ -349,7 +403,9 @@ const TabOverflowContainer = styled.div`
|
|
|
349
403
|
position: absolute;
|
|
350
404
|
height: 32px;
|
|
351
405
|
`;
|
|
352
|
-
const SavedViewTab = ({ view, selected, tabIdPrefix = TAB_ID_PREFIX, canEditViews, handleNameChange, onDuplicateView, onRequestDeleteView, onSelectView, onResetCurrentView, onSaveView, onSetDefaultView, isViewDirty, showTabContextMenu, setShowTabContextMenu, className, ...rest }) => {
|
|
406
|
+
const SavedViewTab = ({ view, selected, tabIdPrefix = TAB_ID_PREFIX, canEditViews, handleNameChange, onDuplicateView, onRequestDeleteView, onSelectView, onResetCurrentView, onSaveView, onSetDefaultView, onViewHiddenChange, onHideView, onKeyboardMove, isHidden = false, isViewDirty, showTabContextMenu, setShowTabContextMenu, className, ...rest }) => {
|
|
407
|
+
const strings = usePDSStrings();
|
|
408
|
+
const showMenu = selected && (canEditViews || !!onViewHiddenChange);
|
|
353
409
|
const inputRef = useRef(null);
|
|
354
410
|
const lastSubmittedNameRef = useRef(null);
|
|
355
411
|
const submitNameChange = (newName) => {
|
|
@@ -363,12 +419,20 @@ const SavedViewTab = ({ view, selected, tabIdPrefix = TAB_ID_PREFIX, canEditView
|
|
|
363
419
|
"aria-selected": selected,
|
|
364
420
|
role: "tab",
|
|
365
421
|
onClick: !selected ? () => onSelectView?.(view.id) : void 0,
|
|
366
|
-
|
|
422
|
+
onKeyDown: onKeyboardMove ? (e) => {
|
|
423
|
+
if (e.altKey && e.shiftKey && (e.key === "ArrowLeft" || e.key === "ArrowRight")) {
|
|
424
|
+
e.preventDefault();
|
|
425
|
+
e.stopPropagation();
|
|
426
|
+
onKeyboardMove(view.id, e.key === "ArrowLeft" ? -1 : 1);
|
|
427
|
+
}
|
|
428
|
+
} : void 0,
|
|
429
|
+
"aria-keyshortcuts": onKeyboardMove ? "Alt+Shift+ArrowLeft Alt+Shift+ArrowRight" : void 0,
|
|
430
|
+
suffixIcon: showMenu ? /* @__PURE__ */ jsx(MoreIcon, {}) : void 0,
|
|
367
431
|
className,
|
|
368
432
|
...rest,
|
|
369
433
|
children: view.name
|
|
370
434
|
});
|
|
371
|
-
if (
|
|
435
|
+
if (showMenu) return /* @__PURE__ */ jsx(Popover_default, {
|
|
372
436
|
trigger: tab,
|
|
373
437
|
open: showTabContextMenu,
|
|
374
438
|
onOpenChange: (open) => {
|
|
@@ -382,7 +446,7 @@ const SavedViewTab = ({ view, selected, tabIdPrefix = TAB_ID_PREFIX, canEditView
|
|
|
382
446
|
},
|
|
383
447
|
children: /* @__PURE__ */ jsxs(Stack, {
|
|
384
448
|
spacing: Spacing[3],
|
|
385
|
-
children: [/* @__PURE__ */ jsx(ViewNameInput, {
|
|
449
|
+
children: [canEditViews && /* @__PURE__ */ jsx(ViewNameInput, {
|
|
386
450
|
defaultValue: view.name,
|
|
387
451
|
onBlur: (e) => submitNameChange(e.currentTarget.value),
|
|
388
452
|
onKeyDown: (e) => {
|
|
@@ -393,7 +457,7 @@ const SavedViewTab = ({ view, selected, tabIdPrefix = TAB_ID_PREFIX, canEditView
|
|
|
393
457
|
}), /* @__PURE__ */ jsxs(MenuList, {
|
|
394
458
|
padding: Spacing[0],
|
|
395
459
|
children: [
|
|
396
|
-
onDuplicateView && /* @__PURE__ */ jsx(MenuItem, {
|
|
460
|
+
canEditViews && onDuplicateView && /* @__PURE__ */ jsx(MenuItem, {
|
|
397
461
|
id: "table-controls__view__menu-duplicate",
|
|
398
462
|
prefixIcon: /* @__PURE__ */ jsx(CopyIcon, {}),
|
|
399
463
|
onClick: async () => {
|
|
@@ -407,14 +471,14 @@ const SavedViewTab = ({ view, selected, tabIdPrefix = TAB_ID_PREFIX, canEditView
|
|
|
407
471
|
}
|
|
408
472
|
},
|
|
409
473
|
onKeyDown: enterProxiesClick,
|
|
410
|
-
children:
|
|
474
|
+
children: strings.duplicateView
|
|
411
475
|
}),
|
|
412
476
|
canEditViews && onResetCurrentView && /* @__PURE__ */ jsx(MenuItem, {
|
|
413
477
|
id: "table-controls__view__menu-reset",
|
|
414
478
|
prefixIcon: /* @__PURE__ */ jsx(RotateCcwIcon, {}),
|
|
415
479
|
onClick: onResetCurrentView,
|
|
416
480
|
onKeyDown: enterProxiesClick,
|
|
417
|
-
children:
|
|
481
|
+
children: strings.resetView
|
|
418
482
|
}),
|
|
419
483
|
canEditViews && onSaveView && /* @__PURE__ */ jsx(MenuItem, {
|
|
420
484
|
id: "table-controls__view__menu-save",
|
|
@@ -425,9 +489,9 @@ const SavedViewTab = ({ view, selected, tabIdPrefix = TAB_ID_PREFIX, canEditView
|
|
|
425
489
|
setShowTabContextMenu(false);
|
|
426
490
|
},
|
|
427
491
|
onKeyDown: enterProxiesClick,
|
|
428
|
-
children:
|
|
492
|
+
children: strings.saveViewMenuItem
|
|
429
493
|
}),
|
|
430
|
-
onSetDefaultView && /* @__PURE__ */ jsx(MenuItem, {
|
|
494
|
+
canEditViews && onSetDefaultView && /* @__PURE__ */ jsx(MenuItem, {
|
|
431
495
|
id: "table-controls__view__menu-set-default",
|
|
432
496
|
prefixIcon: /* @__PURE__ */ jsx(StarIcon, {}),
|
|
433
497
|
disabled: view.isDefault,
|
|
@@ -436,9 +500,20 @@ const SavedViewTab = ({ view, selected, tabIdPrefix = TAB_ID_PREFIX, canEditView
|
|
|
436
500
|
setShowTabContextMenu(false);
|
|
437
501
|
},
|
|
438
502
|
onKeyDown: enterProxiesClick,
|
|
439
|
-
children: view.isDefault ?
|
|
503
|
+
children: view.isDefault ? strings.alreadyDefaultView : strings.setAsDefaultView
|
|
440
504
|
}),
|
|
441
|
-
|
|
505
|
+
onViewHiddenChange && /* @__PURE__ */ jsx(MenuItem, {
|
|
506
|
+
id: "table-controls__view__menu-toggle-hidden",
|
|
507
|
+
prefixIcon: isHidden ? /* @__PURE__ */ jsx(EyeIcon, {}) : /* @__PURE__ */ jsx(EyeOffIcon, {}),
|
|
508
|
+
onClick: () => {
|
|
509
|
+
setShowTabContextMenu(false);
|
|
510
|
+
if (isHidden) onViewHiddenChange(view.id, false);
|
|
511
|
+
else onHideView?.(view.id);
|
|
512
|
+
},
|
|
513
|
+
onKeyDown: enterProxiesClick,
|
|
514
|
+
children: isHidden ? strings.showView : strings.hideView
|
|
515
|
+
}),
|
|
516
|
+
canEditViews && onRequestDeleteView && /* @__PURE__ */ jsx(MenuItem, {
|
|
442
517
|
id: "table-controls__view__menu-delete",
|
|
443
518
|
prefixIcon: /* @__PURE__ */ jsx(TrashIcon, {}),
|
|
444
519
|
onClick: () => {
|
|
@@ -446,7 +521,7 @@ const SavedViewTab = ({ view, selected, tabIdPrefix = TAB_ID_PREFIX, canEditView
|
|
|
446
521
|
onRequestDeleteView(view);
|
|
447
522
|
},
|
|
448
523
|
onKeyDown: enterProxiesClick,
|
|
449
|
-
children:
|
|
524
|
+
children: strings.delete
|
|
450
525
|
})
|
|
451
526
|
]
|
|
452
527
|
})]
|
|
@@ -454,6 +529,52 @@ const SavedViewTab = ({ view, selected, tabIdPrefix = TAB_ID_PREFIX, canEditView
|
|
|
454
529
|
});
|
|
455
530
|
return tab;
|
|
456
531
|
};
|
|
532
|
+
const SavedViewTabSlot = ({ slotRef, slotStyle, slotListeners, ...props }) => {
|
|
533
|
+
const { view, selected, onViewHiddenChange, onHideView } = props;
|
|
534
|
+
const strings = usePDSStrings();
|
|
535
|
+
const [slotElement, setSlotElement] = useState(null);
|
|
536
|
+
const mergedSlotRef = useMemo(() => mergeRefs(slotRef, setSlotElement), [slotRef]);
|
|
537
|
+
const [isTooNarrowForHideButton, setIsTooNarrowForHideButton] = useState(false);
|
|
538
|
+
useLayoutEffect(() => {
|
|
539
|
+
const tab = slotElement?.querySelector("[role=\"tab\"]");
|
|
540
|
+
if (!tab) return;
|
|
541
|
+
const measure = () => setIsTooNarrowForHideButton(tab.offsetWidth > 0 && tab.offsetWidth < MIN_TAB_WIDTH_FOR_HIDE_BUTTON);
|
|
542
|
+
measure();
|
|
543
|
+
const resizeObserver = new ResizeObserver(measure);
|
|
544
|
+
resizeObserver.observe(tab);
|
|
545
|
+
return () => resizeObserver.disconnect();
|
|
546
|
+
}, [slotElement, selected]);
|
|
547
|
+
return /* @__PURE__ */ jsxs(TabSlot, {
|
|
548
|
+
ref: mergedSlotRef,
|
|
549
|
+
"data-tab-view": true,
|
|
550
|
+
"data-tab-slot": true,
|
|
551
|
+
style: slotStyle,
|
|
552
|
+
...slotListeners,
|
|
553
|
+
children: [/* @__PURE__ */ jsx(SavedViewTab, { ...props }), !selected && onViewHiddenChange && !isTooNarrowForHideButton && /* @__PURE__ */ jsx(HideViewButton, {
|
|
554
|
+
id: `table-controls__view-tab-hide_${view.id}`,
|
|
555
|
+
"aria-label": strings.hideViewNamed(view.name),
|
|
556
|
+
title: strings.hideViewTitle,
|
|
557
|
+
onClick: () => onHideView?.(view.id),
|
|
558
|
+
children: /* @__PURE__ */ jsx(XIcon, {})
|
|
559
|
+
})]
|
|
560
|
+
});
|
|
561
|
+
};
|
|
562
|
+
const SortableSavedViewTab = (props) => {
|
|
563
|
+
const { setNodeRef, listeners, transform, transition, isDragging } = useSortable({ id: props.view.id });
|
|
564
|
+
const slotListeners = useMemo(() => listeners && Object.fromEntries(Object.entries(listeners).map(([eventName, handler]) => [eventName, (event) => {
|
|
565
|
+
if (event.currentTarget.contains(event.target)) handler(event);
|
|
566
|
+
}])), [listeners]);
|
|
567
|
+
return /* @__PURE__ */ jsx(SavedViewTabSlot, {
|
|
568
|
+
...props,
|
|
569
|
+
slotListeners,
|
|
570
|
+
slotRef: setNodeRef,
|
|
571
|
+
slotStyle: {
|
|
572
|
+
transform: transform ? `translate3d(${transform.x}px, 0, 0)` : void 0,
|
|
573
|
+
transition,
|
|
574
|
+
zIndex: isDragging ? 1 : void 0
|
|
575
|
+
}
|
|
576
|
+
});
|
|
577
|
+
};
|
|
457
578
|
/**
|
|
458
579
|
* A tab that is locked and does not support editing or actions.
|
|
459
580
|
*/
|
|
@@ -470,37 +591,46 @@ const LockedViewTab = ({ id, selected, onClick, children, ...props }) => {
|
|
|
470
591
|
const OverflowSavedViewTab = styled(SavedViewTab)`
|
|
471
592
|
margin-left: ${Spacing[2]};
|
|
472
593
|
`;
|
|
473
|
-
const TabOverflow = forwardRef(function TabOverflow({ hiddenViews, currentView: currentViewId, handleAddView,
|
|
594
|
+
const TabOverflow = forwardRef(function TabOverflow({ overflowViews, hiddenViews, currentView: currentViewId, handleAddView, onOpenView, onViewHiddenChange, canEditViews, left, ...rest }, ref) {
|
|
595
|
+
const strings = usePDSStrings();
|
|
474
596
|
const [filter, setFilter] = useState("");
|
|
475
597
|
const [openPopover, setOpenPopover] = useState(false);
|
|
476
|
-
const
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
hiddenViews,
|
|
598
|
+
const menuViews = useMemo(() => [...overflowViews, ...hiddenViews], [overflowViews, hiddenViews]);
|
|
599
|
+
const currentView = useMemo(() => menuViews.find((view) => view.id === currentViewId), [currentViewId, menuViews]);
|
|
600
|
+
const filteredViews = useMemo(() => menuViews.filter((view) => view.name.toLowerCase().includes(filter.toLowerCase()) && view.id !== currentView?.id), [
|
|
601
|
+
menuViews,
|
|
481
602
|
filter,
|
|
482
603
|
currentView
|
|
483
604
|
]);
|
|
605
|
+
const moreCount = menuViews.length - (currentView ? 1 : 0);
|
|
606
|
+
const renderMenuItem = (view) => /* @__PURE__ */ jsx(MenuItem, {
|
|
607
|
+
id: `${OVERFLOW_TAB_ID_PREFIX}${view.id}`,
|
|
608
|
+
onClick: () => {
|
|
609
|
+
onOpenView(view.id);
|
|
610
|
+
setOpenPopover(false);
|
|
611
|
+
},
|
|
612
|
+
onKeyDown: enterProxiesClick,
|
|
613
|
+
children: view.name
|
|
614
|
+
}, view.id);
|
|
484
615
|
return /* @__PURE__ */ jsxs(TabOverflowContainer, {
|
|
485
616
|
ref,
|
|
486
|
-
style:
|
|
487
|
-
if (!lastVisibleViewElement) return;
|
|
488
|
-
return { left: lastVisibleViewElement.offsetLeft + lastVisibleViewElement.offsetWidth + 8 };
|
|
489
|
-
}, [lastVisibleViewElement]),
|
|
617
|
+
style: left != null ? { left } : void 0,
|
|
490
618
|
children: [
|
|
491
619
|
currentView && /* @__PURE__ */ jsx(OverflowSavedViewTab, {
|
|
492
620
|
view: currentView,
|
|
493
621
|
canEditViews,
|
|
494
622
|
selected: true,
|
|
495
623
|
tabIdPrefix: OVERFLOW_TAB_ID_PREFIX,
|
|
624
|
+
onViewHiddenChange,
|
|
625
|
+
isHidden: hiddenViews.some((view) => view.id === currentView.id),
|
|
496
626
|
...rest
|
|
497
627
|
}),
|
|
498
|
-
|
|
499
|
-
trigger: /* @__PURE__ */
|
|
628
|
+
moreCount > 0 && /* @__PURE__ */ jsxs(Popover_default, {
|
|
629
|
+
trigger: /* @__PURE__ */ jsx(Button, {
|
|
500
630
|
variant: "basic",
|
|
501
631
|
size: "sm",
|
|
502
632
|
width: "auto",
|
|
503
|
-
children:
|
|
633
|
+
children: strings.moreViews(moreCount)
|
|
504
634
|
}),
|
|
505
635
|
contentProps: {
|
|
506
636
|
align: "start",
|
|
@@ -514,27 +644,17 @@ const TabOverflow = forwardRef(function TabOverflow({ hiddenViews, currentView:
|
|
|
514
644
|
children: [/* @__PURE__ */ jsx(Input_default, {
|
|
515
645
|
value: filter,
|
|
516
646
|
onChange: (e) => setFilter(e.target.value),
|
|
517
|
-
placeholder:
|
|
647
|
+
placeholder: strings.searchViews
|
|
518
648
|
}), /* @__PURE__ */ jsx(OverflowMenuList, {
|
|
519
649
|
padding: Spacing[0],
|
|
520
|
-
children: filteredViews.map(
|
|
521
|
-
return /* @__PURE__ */ jsx(MenuItem, {
|
|
522
|
-
id: `${OVERFLOW_TAB_ID_PREFIX}${view.id}`,
|
|
523
|
-
onClick: () => {
|
|
524
|
-
onSelectView?.(view.id);
|
|
525
|
-
setOpenPopover(false);
|
|
526
|
-
},
|
|
527
|
-
onKeyDown: enterProxiesClick,
|
|
528
|
-
children: view.name
|
|
529
|
-
}, view.id);
|
|
530
|
-
})
|
|
650
|
+
children: filteredViews.map(renderMenuItem)
|
|
531
651
|
})]
|
|
532
652
|
}),
|
|
533
653
|
canEditViews && handleAddView && /* @__PURE__ */ jsx(AddViewButton, {
|
|
534
654
|
id: `${OVERFLOW_TAB_ID_PREFIX}overflow-new`,
|
|
535
655
|
onClick: handleAddView,
|
|
536
656
|
size: "md",
|
|
537
|
-
"aria-label":
|
|
657
|
+
"aria-label": strings.addNewView,
|
|
538
658
|
children: /* @__PURE__ */ jsx(CirclePlusIcon, {})
|
|
539
659
|
})
|
|
540
660
|
]
|
|
@@ -550,48 +670,60 @@ const ProductTourStyles = createGlobalStyle`
|
|
|
550
670
|
}
|
|
551
671
|
}
|
|
552
672
|
`;
|
|
553
|
-
const ControlBar = ({ presetViews, currentView, onSelectView, views, onAddView, onDuplicateView, onDeleteView, onViewNameChange, onSaveView, onSetDefaultView, isViewDirty, canEditViews, showFilters, setShowFilters, searchProps, filtersId, propertiesButton, tableActions, isLoading, isFilterPanelLoading, showViews, selectedRows = [], bulkActions, onResetCurrentView, onClearSelection, title, "data-tour-target": dataTourTarget, compact, onError, filterPanel }) => {
|
|
673
|
+
const ControlBar = ({ presetViews, currentView, onSelectView, views, hiddenViewIds, onAddView, onDuplicateView, onDeleteView, onViewNameChange, onReorderViews, onViewHiddenChange, onSaveView, onSetDefaultView, isViewDirty, canEditViews, showFilters, setShowFilters, searchProps, filtersId, propertiesButton, tableActions, isLoading, isFilterPanelLoading, showViews, selectedRows = [], bulkActions, onResetCurrentView, onClearSelection, title, "data-tour-target": dataTourTarget, compact, onError, filterPanel }) => {
|
|
674
|
+
const strings = usePDSStrings();
|
|
554
675
|
const tabListRef = useRef(null);
|
|
555
676
|
const tabOverflowRef = useRef(null);
|
|
556
|
-
const [
|
|
677
|
+
const [overflowViews, setOverflowViews] = useState([]);
|
|
557
678
|
const [showTabContextMenu, setShowTabContextMenu] = useState(false);
|
|
558
679
|
const [pendingDeleteView, setPendingDeleteView] = useState(null);
|
|
559
680
|
const previousPendingDeleteViewRef = useRef(null);
|
|
560
681
|
const [isDeletingView, setIsDeletingView] = useState(false);
|
|
561
682
|
const [isAddingView, setIsAddingView] = useState(false);
|
|
562
|
-
const [
|
|
683
|
+
const [overflowLeft, setOverflowLeft] = useState(null);
|
|
563
684
|
const [tabOverflowWidth, setTabOverflowWidth] = useState(null);
|
|
685
|
+
const [isAddViewOverflowing, setIsAddViewOverflowing] = useState(false);
|
|
564
686
|
useEffect(() => {
|
|
565
687
|
const previousPendingDeleteView = previousPendingDeleteViewRef.current;
|
|
566
|
-
if (!pendingDeleteView && previousPendingDeleteView) (document.getElementById(`${OVERFLOW_TAB_ID_PREFIX}${previousPendingDeleteView.id}`) ?? document.getElementById(`${TAB_ID_PREFIX}${previousPendingDeleteView.id}`))?.focus();
|
|
688
|
+
if (!pendingDeleteView && previousPendingDeleteView) (document.getElementById(`${OVERFLOW_TAB_ID_PREFIX}${previousPendingDeleteView.id}`) ?? document.getElementById(`${TAB_ID_PREFIX}${previousPendingDeleteView.id}`))?.focus({ preventScroll: true });
|
|
567
689
|
previousPendingDeleteViewRef.current = pendingDeleteView;
|
|
568
690
|
}, [pendingDeleteView]);
|
|
691
|
+
const [shownViews, hiddenViews] = useMemo(() => {
|
|
692
|
+
const hiddenIds = new Set(hiddenViewIds);
|
|
693
|
+
const allViews = views ?? [];
|
|
694
|
+
return [allViews.filter((view) => !hiddenIds.has(view.id)), allViews.filter((view) => hiddenIds.has(view.id))];
|
|
695
|
+
}, [views, hiddenViewIds]);
|
|
569
696
|
const onResize = useCallback(() => {
|
|
570
697
|
if (!tabListRef.current) return;
|
|
571
698
|
const containerRect = tabListRef.current.getBoundingClientRect();
|
|
572
699
|
const tabListContainer = tabListRef.current;
|
|
573
|
-
const
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
const lastVisibleViewElement = tabElements[firstHiddenIndex - 1];
|
|
582
|
-
if (lastVisibleViewElement) setLastVisibleViewElement(lastVisibleViewElement);
|
|
583
|
-
}
|
|
584
|
-
setHiddenViews((firstHiddenIndex === -1 ? [] : views?.slice(firstHiddenIndex)) || []);
|
|
700
|
+
const firstOverflowIndex = Array.from(tabListContainer.querySelectorAll("[data-tab-view]")).findIndex((el) => !rectContainsRect(containerRect, el.getBoundingClientRect()));
|
|
701
|
+
const nextOverflowViews = firstOverflowIndex === -1 ? [] : shownViews.slice(firstOverflowIndex);
|
|
702
|
+
setOverflowViews((prev) => prev.length === nextOverflowViews.length && prev.every((view, index) => view === nextOverflowViews[index]) ? prev : nextOverflowViews);
|
|
703
|
+
const firstRowElements = Array.from(tabListContainer.children).filter((el) => el instanceof HTMLElement && el !== tabOverflowRef.current && rectContainsRect(containerRect, el.getBoundingClientRect()));
|
|
704
|
+
const anchor = firstRowElements[firstRowElements.length - 1];
|
|
705
|
+
setOverflowLeft(anchor ? anchor.offsetLeft + anchor.offsetWidth + OVERFLOW_GAP : null);
|
|
706
|
+
const addViewButton = tabListContainer.querySelector(`#${ADD_VIEW_BUTTON_ID}`);
|
|
707
|
+
setIsAddViewOverflowing(addViewButton instanceof HTMLElement && !firstRowElements.includes(addViewButton));
|
|
585
708
|
const tabOverflowWidth = tabOverflowRef.current?.getBoundingClientRect().width;
|
|
586
709
|
if (tabOverflowWidth) setTabOverflowWidth((prev) => prev != null && prev > tabOverflowWidth && prev - tabOverflowWidth < OVERFLOW_WIDTH_SHRINK_THRESHOLD ? prev : tabOverflowWidth);
|
|
587
|
-
}, [
|
|
710
|
+
}, [shownViews]);
|
|
588
711
|
useLayoutEffect(() => {
|
|
589
|
-
|
|
712
|
+
const tabList = tabListRef.current;
|
|
713
|
+
if (!showViews || !tabList) return;
|
|
590
714
|
const resizeObserver = new ResizeObserver(() => {
|
|
591
715
|
onResize();
|
|
592
716
|
});
|
|
593
|
-
|
|
717
|
+
const observeTabList = () => {
|
|
718
|
+
resizeObserver.disconnect();
|
|
719
|
+
resizeObserver.observe(tabList);
|
|
720
|
+
Array.from(tabList.children).forEach((child) => resizeObserver.observe(child));
|
|
721
|
+
};
|
|
722
|
+
const mutationObserver = new MutationObserver(observeTabList);
|
|
723
|
+
observeTabList();
|
|
724
|
+
mutationObserver.observe(tabList, { childList: true });
|
|
594
725
|
return () => {
|
|
726
|
+
mutationObserver.disconnect();
|
|
595
727
|
resizeObserver.disconnect();
|
|
596
728
|
};
|
|
597
729
|
}, [onResize, showViews]);
|
|
@@ -600,12 +732,82 @@ const ControlBar = ({ presetViews, currentView, onSelectView, views, onAddView,
|
|
|
600
732
|
}, [
|
|
601
733
|
onResize,
|
|
602
734
|
showViews,
|
|
603
|
-
|
|
735
|
+
shownViews
|
|
604
736
|
]);
|
|
605
|
-
const
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
|
|
737
|
+
const isCurrentViewInOverflow = useMemo(() => !!currentView && [...overflowViews, ...hiddenViews].some((view) => view.id === currentView), [
|
|
738
|
+
currentView,
|
|
739
|
+
overflowViews,
|
|
740
|
+
hiddenViews
|
|
741
|
+
]);
|
|
742
|
+
const sensors = useSensors(useSensor(PointerSensor, { activationConstraint: { distance: 5 } }));
|
|
743
|
+
const dragBoundsRef = useRef(null);
|
|
744
|
+
const handleDragStart = () => {
|
|
745
|
+
const tabList = tabListRef.current;
|
|
746
|
+
if (!tabList) return;
|
|
747
|
+
const tabListRect = tabList.getBoundingClientRect();
|
|
748
|
+
const visibleSlotRects = Array.from(tabList.querySelectorAll("[data-tab-view]")).map((slot) => slot.getBoundingClientRect()).filter((rect) => rectContainsRect(tabListRect, rect));
|
|
749
|
+
dragBoundsRef.current = visibleSlotRects.length > 0 ? {
|
|
750
|
+
left: visibleSlotRects[0].left,
|
|
751
|
+
right: visibleSlotRects[visibleSlotRects.length - 1].right,
|
|
752
|
+
bottom: tabListRect.bottom
|
|
753
|
+
} : null;
|
|
754
|
+
};
|
|
755
|
+
const visibleTabCollision = useCallback((args) => {
|
|
756
|
+
const bounds = dragBoundsRef.current;
|
|
757
|
+
const visibleArgs = {
|
|
758
|
+
...args,
|
|
759
|
+
droppableContainers: args.droppableContainers.filter((container) => {
|
|
760
|
+
const rect = args.droppableRects.get(container.id);
|
|
761
|
+
return bounds == null || rect != null && rect.bottom <= bounds.bottom + 1;
|
|
762
|
+
})
|
|
763
|
+
};
|
|
764
|
+
const pointerCollisions = pointerWithin(visibleArgs);
|
|
765
|
+
return pointerCollisions.length > 0 ? pointerCollisions : closestCenter(visibleArgs);
|
|
766
|
+
}, []);
|
|
767
|
+
const restrictToVisibleSavedTabs = useCallback(({ transform, draggingNodeRect }) => {
|
|
768
|
+
const bounds = dragBoundsRef.current;
|
|
769
|
+
if (!bounds || !draggingNodeRect) return {
|
|
770
|
+
...transform,
|
|
771
|
+
y: 0
|
|
772
|
+
};
|
|
773
|
+
const minX = bounds.left - draggingNodeRect.left;
|
|
774
|
+
const maxX = bounds.right - draggingNodeRect.right;
|
|
775
|
+
return {
|
|
776
|
+
...transform,
|
|
777
|
+
x: Math.min(Math.max(transform.x, minX), maxX),
|
|
778
|
+
y: 0
|
|
779
|
+
};
|
|
780
|
+
}, []);
|
|
781
|
+
const moveView = (viewId, toIndex) => {
|
|
782
|
+
if (!views || !onReorderViews) return;
|
|
783
|
+
const viewIds = views.map((view) => view.id);
|
|
784
|
+
const reordered = moveItemByIndex(viewIds, viewIds.indexOf(viewId), toIndex);
|
|
785
|
+
if (reordered !== viewIds) onReorderViews(reordered);
|
|
786
|
+
};
|
|
787
|
+
const indexOfView = (viewId) => views?.findIndex((view) => view.id === viewId) ?? -1;
|
|
788
|
+
const openViewFromMenu = (viewId) => {
|
|
789
|
+
if (hiddenViews.some((view) => view.id === viewId)) onViewHiddenChange?.(viewId, false);
|
|
790
|
+
moveView(viewId, 0);
|
|
791
|
+
onSelectView?.(viewId);
|
|
792
|
+
};
|
|
793
|
+
const handleDragEnd = ({ active, over }) => {
|
|
794
|
+
if (over) moveView(String(active.id), indexOfView(String(over.id)));
|
|
795
|
+
};
|
|
796
|
+
const hideView = (viewId) => {
|
|
797
|
+
const overflowIds = new Set(overflowViews.map((view) => view.id));
|
|
798
|
+
const visibleViews = shownViews.filter((view) => !overflowIds.has(view.id));
|
|
799
|
+
const index = visibleViews.findIndex((view) => view.id === viewId);
|
|
800
|
+
const isCurrent = viewId === currentView;
|
|
801
|
+
const focusTarget = isCurrent || index === -1 ? void 0 : visibleViews[index + 1] ?? visibleViews[index - 1];
|
|
802
|
+
onViewHiddenChange?.(viewId, true);
|
|
803
|
+
if (isCurrent) onSelectView?.(null);
|
|
804
|
+
document.getElementById(`${TAB_ID_PREFIX}${focusTarget ? focusTarget.id : "default"}`)?.focus({ preventScroll: true });
|
|
805
|
+
};
|
|
806
|
+
const moveViewWithKeyboard = (viewId, direction) => {
|
|
807
|
+
const neighbor = shownViews[shownViews.findIndex((view) => view.id === viewId) + direction];
|
|
808
|
+
if (!neighbor) return;
|
|
809
|
+
moveView(viewId, indexOfView(neighbor.id));
|
|
810
|
+
};
|
|
609
811
|
const handleAddView = async () => {
|
|
610
812
|
try {
|
|
611
813
|
setIsAddingView(true);
|
|
@@ -677,97 +879,115 @@ const ControlBar = ({ presetViews, currentView, onSelectView, views, onAddView,
|
|
|
677
879
|
children: displayLabel
|
|
678
880
|
}, key);
|
|
679
881
|
});
|
|
680
|
-
|
|
681
|
-
|
|
682
|
-
|
|
683
|
-
|
|
684
|
-
|
|
685
|
-
|
|
686
|
-
|
|
687
|
-
|
|
688
|
-
|
|
689
|
-
|
|
690
|
-
|
|
691
|
-
|
|
692
|
-
|
|
693
|
-
|
|
694
|
-
|
|
695
|
-
|
|
696
|
-
|
|
697
|
-
|
|
698
|
-
|
|
699
|
-
|
|
700
|
-
|
|
701
|
-
|
|
702
|
-
|
|
703
|
-
|
|
704
|
-
|
|
705
|
-
|
|
706
|
-
|
|
707
|
-
|
|
708
|
-
|
|
709
|
-
|
|
710
|
-
|
|
711
|
-
|
|
712
|
-
onClick:
|
|
713
|
-
"
|
|
714
|
-
|
|
715
|
-
|
|
716
|
-
|
|
717
|
-
|
|
718
|
-
|
|
719
|
-
|
|
720
|
-
selected,
|
|
721
|
-
onClick: () => onSelectView?.(view.id),
|
|
722
|
-
children: view.name
|
|
723
|
-
}, view.id);
|
|
724
|
-
}),
|
|
725
|
-
views?.map((view) => {
|
|
726
|
-
return /* @__PURE__ */ jsx(SavedViewTab, {
|
|
727
|
-
view,
|
|
728
|
-
canEditViews: canEditViews ?? false,
|
|
729
|
-
handleNameChange,
|
|
730
|
-
onDuplicateView,
|
|
731
|
-
onRequestDeleteView,
|
|
732
|
-
onSelectView,
|
|
733
|
-
onResetCurrentView,
|
|
734
|
-
onSaveView,
|
|
735
|
-
onSetDefaultView,
|
|
736
|
-
isViewDirty: isViewDirty ?? false,
|
|
737
|
-
selected: view.id === currentView,
|
|
738
|
-
showTabContextMenu: showTabContextMenu && !currentViewHidden,
|
|
739
|
-
setShowTabContextMenu,
|
|
740
|
-
"data-tab-view": true
|
|
741
|
-
}, view.id);
|
|
742
|
-
}),
|
|
743
|
-
canEditViews && onAddView && /* @__PURE__ */ jsx(AddViewButton, {
|
|
744
|
-
id: "table-controls__view-tab-new",
|
|
745
|
-
size: "md",
|
|
746
|
-
onClick: handleAddView,
|
|
747
|
-
"aria-label": "Add new view",
|
|
748
|
-
"data-tour-target": "saved-views-add-button",
|
|
749
|
-
children: /* @__PURE__ */ jsx(CirclePlusIcon, {})
|
|
882
|
+
const showViewsBar = title || showViews || canEditViews && onSaveView || tableActions || bulkActions;
|
|
883
|
+
const getSavedViewTabProps = (view) => ({
|
|
884
|
+
view,
|
|
885
|
+
onKeyboardMove: onReorderViews ? moveViewWithKeyboard : void 0,
|
|
886
|
+
onHideView: hideView,
|
|
887
|
+
canEditViews: canEditViews ?? false,
|
|
888
|
+
handleNameChange,
|
|
889
|
+
onDuplicateView,
|
|
890
|
+
onRequestDeleteView,
|
|
891
|
+
onSelectView,
|
|
892
|
+
onResetCurrentView,
|
|
893
|
+
onSaveView,
|
|
894
|
+
onSetDefaultView,
|
|
895
|
+
onViewHiddenChange,
|
|
896
|
+
isViewDirty: isViewDirty ?? false,
|
|
897
|
+
selected: view.id === currentView,
|
|
898
|
+
showTabContextMenu: showTabContextMenu && !isCurrentViewInOverflow,
|
|
899
|
+
setShowTabContextMenu
|
|
900
|
+
});
|
|
901
|
+
const viewsBar = /* @__PURE__ */ jsx(ViewsBar, {
|
|
902
|
+
ref: tabListRef,
|
|
903
|
+
title,
|
|
904
|
+
maxTabChars: 25,
|
|
905
|
+
$isAddingView: isAddingView,
|
|
906
|
+
"data-tour-target": dataTourTarget,
|
|
907
|
+
actions: /* @__PURE__ */ jsxs(HStack, {
|
|
908
|
+
spacing: Spacing[3],
|
|
909
|
+
align: "center",
|
|
910
|
+
style: tabOverflowWidth ? { paddingLeft: `${tabOverflowWidth + 16}px` } : void 0,
|
|
911
|
+
children: [
|
|
912
|
+
canEditViews && onSaveView && /* @__PURE__ */ jsx(Button, {
|
|
913
|
+
id: "table-controls__view-tab-save",
|
|
914
|
+
onClick: onSaveView,
|
|
915
|
+
"aria-label": strings.saveCurrentView,
|
|
916
|
+
disabled: !isViewDirty || isLoading,
|
|
917
|
+
size: "sm",
|
|
918
|
+
variant: "basic",
|
|
919
|
+
width: "auto",
|
|
920
|
+
"data-tour-target": "saved-views-save-button",
|
|
921
|
+
children: strings.saveView
|
|
750
922
|
}),
|
|
751
|
-
|
|
752
|
-
|
|
753
|
-
|
|
754
|
-
currentView,
|
|
755
|
-
onSelectView,
|
|
756
|
-
canEditViews: canEditViews ?? false,
|
|
757
|
-
handleAddView: onAddView ? handleAddView : null,
|
|
758
|
-
handleNameChange,
|
|
759
|
-
onDuplicateView,
|
|
760
|
-
onRequestDeleteView,
|
|
761
|
-
onResetCurrentView,
|
|
762
|
-
onSaveView,
|
|
763
|
-
onSetDefaultView,
|
|
764
|
-
isViewDirty: isViewDirty ?? false,
|
|
765
|
-
showTabContextMenu: showTabContextMenu && currentViewHidden,
|
|
766
|
-
setShowTabContextMenu,
|
|
767
|
-
lastVisibleViewElement
|
|
768
|
-
})
|
|
769
|
-
] })
|
|
923
|
+
bulkActionButtons,
|
|
924
|
+
tableActions
|
|
925
|
+
]
|
|
770
926
|
}),
|
|
927
|
+
children: showViews && /* @__PURE__ */ jsxs(Fragment$1, { children: [
|
|
928
|
+
/* @__PURE__ */ jsx(LockedViewTab, {
|
|
929
|
+
id: `${TAB_ID_PREFIX}default`,
|
|
930
|
+
selected: !currentView,
|
|
931
|
+
onClick: () => onSelectView?.(null),
|
|
932
|
+
"data-tour-target": "saved-views-default-view",
|
|
933
|
+
children: strings.defaultView
|
|
934
|
+
}),
|
|
935
|
+
presetViews?.map((view) => {
|
|
936
|
+
const selected = view.id === currentView;
|
|
937
|
+
return /* @__PURE__ */ jsx(LockedViewTab, {
|
|
938
|
+
id: `${TAB_ID_PREFIX}preset-${view.id}`,
|
|
939
|
+
selected,
|
|
940
|
+
onClick: () => onSelectView?.(view.id),
|
|
941
|
+
children: view.name
|
|
942
|
+
}, view.id);
|
|
943
|
+
}),
|
|
944
|
+
onReorderViews ? /* @__PURE__ */ jsx(SortableContext, {
|
|
945
|
+
items: shownViews.map((view) => view.id),
|
|
946
|
+
strategy: horizontalListSortingStrategy,
|
|
947
|
+
children: shownViews.map((view) => /* @__PURE__ */ jsx(SortableSavedViewTab, { ...getSavedViewTabProps(view) }, view.id))
|
|
948
|
+
}) : shownViews.map((view) => /* @__PURE__ */ jsx(SavedViewTabSlot, { ...getSavedViewTabProps(view) }, view.id)),
|
|
949
|
+
canEditViews && onAddView && /* @__PURE__ */ jsx(AddViewButton, {
|
|
950
|
+
id: ADD_VIEW_BUTTON_ID,
|
|
951
|
+
size: "md",
|
|
952
|
+
onClick: handleAddView,
|
|
953
|
+
"aria-label": strings.addNewView,
|
|
954
|
+
"data-tour-target": "saved-views-add-button",
|
|
955
|
+
children: /* @__PURE__ */ jsx(CirclePlusIcon, {})
|
|
956
|
+
}),
|
|
957
|
+
(overflowViews.length > 0 || hiddenViews.length > 0) && /* @__PURE__ */ jsx(TabOverflow, {
|
|
958
|
+
ref: tabOverflowRef,
|
|
959
|
+
overflowViews,
|
|
960
|
+
hiddenViews,
|
|
961
|
+
currentView,
|
|
962
|
+
onSelectView,
|
|
963
|
+
onOpenView: openViewFromMenu,
|
|
964
|
+
canEditViews: canEditViews ?? false,
|
|
965
|
+
handleAddView: onAddView && isAddViewOverflowing ? handleAddView : null,
|
|
966
|
+
handleNameChange,
|
|
967
|
+
onDuplicateView,
|
|
968
|
+
onRequestDeleteView,
|
|
969
|
+
onResetCurrentView,
|
|
970
|
+
onSaveView,
|
|
971
|
+
onSetDefaultView,
|
|
972
|
+
onViewHiddenChange,
|
|
973
|
+
onHideView: hideView,
|
|
974
|
+
isViewDirty: isViewDirty ?? false,
|
|
975
|
+
showTabContextMenu: showTabContextMenu && isCurrentViewInOverflow,
|
|
976
|
+
setShowTabContextMenu,
|
|
977
|
+
left: overflowLeft
|
|
978
|
+
})
|
|
979
|
+
] })
|
|
980
|
+
});
|
|
981
|
+
return /* @__PURE__ */ jsxs(Fragment$1, { children: [
|
|
982
|
+
/* @__PURE__ */ jsx(ProductTourStyles, {}),
|
|
983
|
+
showViewsBar && (onReorderViews ? /* @__PURE__ */ jsx(DndContext, {
|
|
984
|
+
sensors,
|
|
985
|
+
collisionDetection: visibleTabCollision,
|
|
986
|
+
modifiers: [restrictToVisibleSavedTabs],
|
|
987
|
+
onDragStart: handleDragStart,
|
|
988
|
+
onDragEnd: handleDragEnd,
|
|
989
|
+
children: viewsBar
|
|
990
|
+
}) : viewsBar),
|
|
771
991
|
/* @__PURE__ */ jsxs(HStack, {
|
|
772
992
|
align: "center",
|
|
773
993
|
spacing: Spacing[2],
|
|
@@ -783,7 +1003,7 @@ const ControlBar = ({ presetViews, currentView, onSelectView, views, onAddView,
|
|
|
783
1003
|
id: "table-controls__view-tab-filters",
|
|
784
1004
|
variant: "basic",
|
|
785
1005
|
onClick: () => setShowFilters?.(!showFilters),
|
|
786
|
-
"aria-label": showFilters ?
|
|
1006
|
+
"aria-label": showFilters ? strings.hideFilters : strings.showFilters,
|
|
787
1007
|
"aria-expanded": showFilters,
|
|
788
1008
|
"aria-controls": filtersId,
|
|
789
1009
|
disabled: isLoading || isFilterPanelLoading,
|
|
@@ -805,32 +1025,28 @@ const ControlBar = ({ presetViews, currentView, onSelectView, views, onAddView,
|
|
|
805
1025
|
},
|
|
806
1026
|
isKeyboardDismissDisabled: isDeletingView,
|
|
807
1027
|
contentProps: isDeletingView ? { showCloseButton: false } : void 0,
|
|
808
|
-
title:
|
|
1028
|
+
title: strings.deleteViewTitle,
|
|
809
1029
|
footer: /* @__PURE__ */ jsxs(Fragment$1, { children: [/* @__PURE__ */ jsx(Button, {
|
|
810
1030
|
variant: "basic",
|
|
811
1031
|
width: "auto",
|
|
812
1032
|
disabled: isDeletingView,
|
|
813
1033
|
onClick: () => setPendingDeleteView(null),
|
|
814
|
-
children:
|
|
1034
|
+
children: strings.cancel
|
|
815
1035
|
}), /* @__PURE__ */ jsx(Button, {
|
|
816
1036
|
id: "table-controls__view__delete-confirm",
|
|
817
1037
|
variant: "danger",
|
|
818
1038
|
width: "auto",
|
|
819
1039
|
isPending: isDeletingView,
|
|
820
1040
|
onClick: confirmDeleteView,
|
|
821
|
-
children:
|
|
1041
|
+
children: strings.delete
|
|
822
1042
|
})] }),
|
|
823
|
-
children: /* @__PURE__ */
|
|
824
|
-
"This will permanently delete “",
|
|
825
|
-
pendingDeleteView?.name,
|
|
826
|
-
"”. This action cannot be undone."
|
|
827
|
-
] })
|
|
1043
|
+
children: /* @__PURE__ */ jsx(Paragraph, { children: strings.deleteViewConfirmation(pendingDeleteView?.name ?? "") })
|
|
828
1044
|
})
|
|
829
1045
|
] });
|
|
830
1046
|
};
|
|
831
1047
|
//#endregion
|
|
832
1048
|
//#region components/DataTable/TableControls/TableControls.tsx
|
|
833
|
-
const TableControls = ({ filterPanel, searchProps, defaultShowFilters, showFilters: controlledShowFilters, setShowFilters: controlledSetShowFilters, className, tableActions, propertiesButton, isLoading, isFilterPanelLoading, showViews, canEditViews, onSelectView, views, currentView, onAddView, onViewNameChange, onDuplicateView, onDeleteView, onSaveView, onSetDefaultView, isViewDirty, selectedRows, bulkActions, onClearSelection, title, presetViews, compact, columnConfigurationProps, showFiltersAlways = false, onError, "data-tour-target": dataTourTarget }) => {
|
|
1049
|
+
const TableControls = ({ filterPanel, searchProps, defaultShowFilters, showFilters: controlledShowFilters, setShowFilters: controlledSetShowFilters, className, tableActions, propertiesButton, isLoading, isFilterPanelLoading, showViews, canEditViews, onSelectView, views, hiddenViewIds, currentView, onAddView, onViewNameChange, onReorderViews, onViewHiddenChange, onDuplicateView, onDeleteView, onSaveView, onSetDefaultView, isViewDirty, selectedRows, bulkActions, onClearSelection, title, presetViews, compact, columnConfigurationProps, showFiltersAlways = false, onError, "data-tour-target": dataTourTarget }) => {
|
|
834
1050
|
const filtersId = useId();
|
|
835
1051
|
const [internalShowFilters, internalSetShowFilters] = useState(defaultShowFilters ?? false);
|
|
836
1052
|
const showFilters = controlledShowFilters != null ? controlledShowFilters : internalShowFilters;
|
|
@@ -851,12 +1067,15 @@ const TableControls = ({ filterPanel, searchProps, defaultShowFilters, showFilte
|
|
|
851
1067
|
children: /* @__PURE__ */ jsx(ControlBar, {
|
|
852
1068
|
showViews: compact ? false : showViews,
|
|
853
1069
|
views: compact ? void 0 : views,
|
|
1070
|
+
hiddenViewIds: compact ? void 0 : hiddenViewIds,
|
|
854
1071
|
onSelectView: compact ? void 0 : onSelectView,
|
|
855
1072
|
currentView: compact ? void 0 : currentView,
|
|
856
1073
|
onAddView: compact ? void 0 : onAddView,
|
|
857
1074
|
onDeleteView: compact ? void 0 : onDeleteView,
|
|
858
1075
|
onDuplicateView: compact ? void 0 : onDuplicateView,
|
|
859
1076
|
onViewNameChange: compact ? void 0 : onViewNameChange,
|
|
1077
|
+
onReorderViews: compact ? void 0 : onReorderViews,
|
|
1078
|
+
onViewHiddenChange: compact ? void 0 : onViewHiddenChange,
|
|
860
1079
|
onSaveView: compact ? void 0 : onSaveView,
|
|
861
1080
|
onSetDefaultView: compact ? void 0 : onSetDefaultView,
|
|
862
1081
|
isViewDirty,
|
|
@@ -992,6 +1211,7 @@ const PopoverCard$1 = styled(Card_default)`
|
|
|
992
1211
|
padding: ${Spacing[4]};
|
|
993
1212
|
`;
|
|
994
1213
|
const TriggerIconButton = forwardRef(function TriggerIconButton({ disabled, ...elemProps }, ref) {
|
|
1214
|
+
const strings = usePDSStrings();
|
|
995
1215
|
return /* @__PURE__ */ jsx(Button, {
|
|
996
1216
|
disabled,
|
|
997
1217
|
width: "icon",
|
|
@@ -1000,21 +1220,22 @@ const TriggerIconButton = forwardRef(function TriggerIconButton({ disabled, ...e
|
|
|
1000
1220
|
...elemProps,
|
|
1001
1221
|
ref,
|
|
1002
1222
|
"data-tour-target": "table-properties-button",
|
|
1003
|
-
"aria-label":
|
|
1223
|
+
"aria-label": strings.tableProperties,
|
|
1004
1224
|
children: /* @__PURE__ */ jsx(SettingsIcon, {})
|
|
1005
1225
|
});
|
|
1006
1226
|
});
|
|
1007
1227
|
const TooltipButtonWrapper = styled("div")`
|
|
1008
1228
|
display: inline-block;
|
|
1009
1229
|
`;
|
|
1010
|
-
const TableViewConfigurationDropdown = ({ disabled = false, disabledTooltipMessage
|
|
1230
|
+
const TableViewConfigurationDropdown = ({ disabled = false, disabledTooltipMessage, size = "md", variant = "basic", ...props }) => {
|
|
1231
|
+
const strings = usePDSStrings();
|
|
1011
1232
|
return disabled ? /* @__PURE__ */ jsx(Tooltip, {
|
|
1012
1233
|
trigger: /* @__PURE__ */ jsx(TooltipButtonWrapper, { children: /* @__PURE__ */ jsx(TriggerIconButton, {
|
|
1013
1234
|
disabled: true,
|
|
1014
1235
|
size,
|
|
1015
1236
|
variant
|
|
1016
1237
|
}) }),
|
|
1017
|
-
children: disabledTooltipMessage
|
|
1238
|
+
children: disabledTooltipMessage ?? strings.configureViewPermissionDenied
|
|
1018
1239
|
}) : /* @__PURE__ */ jsxs(Popover_default, { children: [/* @__PURE__ */ jsx(Popover_default.Trigger, {
|
|
1019
1240
|
asChild: true,
|
|
1020
1241
|
children: /* @__PURE__ */ jsx(TriggerIconButton, {
|
|
@@ -1034,6 +1255,7 @@ const TableViewConfigurationDropdown = ({ disabled = false, disabledTooltipMessa
|
|
|
1034
1255
|
})] });
|
|
1035
1256
|
};
|
|
1036
1257
|
const TableViewConfiguration = ({ columnConfiguration, attributeOptions, updateColumnConfiguration, getColumnDisabled, sortByRelevance = false }) => {
|
|
1258
|
+
const strings = usePDSStrings();
|
|
1037
1259
|
const [searchTerm, setSearchTerm] = useState("");
|
|
1038
1260
|
const fuse = useMemo(() => {
|
|
1039
1261
|
return new Fuse(attributeOptions, sortByRelevance ? {
|
|
@@ -1130,7 +1352,7 @@ const TableViewConfiguration = ({ columnConfiguration, attributeOptions, updateC
|
|
|
1130
1352
|
/* @__PURE__ */ jsx(Label$1, {
|
|
1131
1353
|
size: "lg",
|
|
1132
1354
|
weight: "bold",
|
|
1133
|
-
children:
|
|
1355
|
+
children: strings.configureColumns
|
|
1134
1356
|
}),
|
|
1135
1357
|
/* @__PURE__ */ jsx(Spacer_default, { height: 2 }),
|
|
1136
1358
|
/* @__PURE__ */ jsx(SearchContainer, { children: /* @__PURE__ */ jsx(StyledSearchInput, {
|
|
@@ -1138,12 +1360,12 @@ const TableViewConfiguration = ({ columnConfiguration, attributeOptions, updateC
|
|
|
1138
1360
|
value: searchTerm,
|
|
1139
1361
|
handleInput: setSearchTerm,
|
|
1140
1362
|
size: "md",
|
|
1141
|
-
placeholder:
|
|
1363
|
+
placeholder: strings.searchColumns,
|
|
1142
1364
|
dataTest: "checklist-item-panel-item-table__search"
|
|
1143
1365
|
}) }),
|
|
1144
1366
|
/* @__PURE__ */ jsx(Spacer_default, { height: 2 }),
|
|
1145
1367
|
shownDndItemProps.length > 0 || hiddenDndItemProps.length > 0 ? /* @__PURE__ */ jsxs(DndSection, { children: [
|
|
1146
|
-
shownDndItemProps.length > 0 && /* @__PURE__ */ jsxs("div", { children: [/* @__PURE__ */ jsx(Paragraph, { children:
|
|
1368
|
+
shownDndItemProps.length > 0 && /* @__PURE__ */ jsxs("div", { children: [/* @__PURE__ */ jsx(Paragraph, { children: strings.shownColumns }), /* @__PURE__ */ jsx(DragDropContext, {
|
|
1147
1369
|
onDragEnd: handleDragEnd,
|
|
1148
1370
|
children: /* @__PURE__ */ jsx(Droppable, {
|
|
1149
1371
|
droppableId: SHOWN_DROPPABLE_ID,
|
|
@@ -1179,8 +1401,8 @@ const TableViewConfiguration = ({ columnConfiguration, attributeOptions, updateC
|
|
|
1179
1401
|
})
|
|
1180
1402
|
})] }),
|
|
1181
1403
|
/* @__PURE__ */ jsx(Spacer_default, { height: 2 }),
|
|
1182
|
-
hiddenDndItemProps.length > 0 && /* @__PURE__ */ jsxs("div", { children: [/* @__PURE__ */ jsx(Paragraph, { children:
|
|
1183
|
-
] }) : /* @__PURE__ */ jsx("div", { children: /* @__PURE__ */ jsx(Paragraph, { children:
|
|
1404
|
+
hiddenDndItemProps.length > 0 && /* @__PURE__ */ jsxs("div", { children: [/* @__PURE__ */ jsx(Paragraph, { children: strings.hiddenColumns }), hiddenDndItemProps.map((props) => /* @__PURE__ */ jsx(AttributeDnd, { ...props }, props.column.key))] })
|
|
1405
|
+
] }) : /* @__PURE__ */ jsx("div", { children: /* @__PURE__ */ jsx(Paragraph, { children: strings.noMatchingColumns }) })
|
|
1184
1406
|
] });
|
|
1185
1407
|
};
|
|
1186
1408
|
const OverflowText = styled("div")`
|
|
@@ -1189,6 +1411,7 @@ const OverflowText = styled("div")`
|
|
|
1189
1411
|
display: flex;
|
|
1190
1412
|
`;
|
|
1191
1413
|
const AttributeDnd = ({ column, index, isDisabled = false, isToggled, shouldDisableDrag, handleToggle }) => {
|
|
1414
|
+
const strings = usePDSStrings();
|
|
1192
1415
|
return /* @__PURE__ */ jsxs(DndItemWrapper, { children: [
|
|
1193
1416
|
/* @__PURE__ */ jsx(StyledIconDrag, {
|
|
1194
1417
|
$active: true,
|
|
@@ -1203,7 +1426,7 @@ const AttributeDnd = ({ column, index, isDisabled = false, isToggled, shouldDisa
|
|
|
1203
1426
|
value: isToggled,
|
|
1204
1427
|
disabled: isDisabled,
|
|
1205
1428
|
onChange: handleToggle,
|
|
1206
|
-
"aria-label": isToggled ?
|
|
1429
|
+
"aria-label": isToggled ? strings.hideColumn(column.label) : strings.showColumn(column.label)
|
|
1207
1430
|
}) })
|
|
1208
1431
|
] }, `${column.key}-${index}`);
|
|
1209
1432
|
};
|
|
@@ -1331,6 +1554,7 @@ function getOperatorsForType(type) {
|
|
|
1331
1554
|
* field can never surface an operator the host application can't serialize.
|
|
1332
1555
|
*/
|
|
1333
1556
|
function getOperatorsForField(field) {
|
|
1557
|
+
if (field.condition != null) return field.condition.operators.map(({ operator }) => operator);
|
|
1334
1558
|
const { allowedOperators } = field;
|
|
1335
1559
|
if (allowedOperators == null || allowedOperators.length === 0) return getOperatorsForType(field.type);
|
|
1336
1560
|
return allowedOperators;
|
|
@@ -1340,8 +1564,26 @@ function getDefaultOperatorForType(type) {
|
|
|
1340
1564
|
if (list.length === 0) throw new Error(`No operators defined for field type "${type}"`);
|
|
1341
1565
|
return list[0];
|
|
1342
1566
|
}
|
|
1343
|
-
function
|
|
1344
|
-
return
|
|
1567
|
+
function getConditionOperator(field, operator) {
|
|
1568
|
+
return field?.condition?.operators.find((config) => config.operator === operator);
|
|
1569
|
+
}
|
|
1570
|
+
function isValuelessOperator(operator, field) {
|
|
1571
|
+
const config = getConditionOperator(field, operator);
|
|
1572
|
+
return config != null ? config.valueType === "none" : VALUELESS_OPERATORS.has(operator);
|
|
1573
|
+
}
|
|
1574
|
+
function hasCompleteConditionValue(rule, field) {
|
|
1575
|
+
const config = getConditionOperator(field, rule.operator);
|
|
1576
|
+
if (config == null) return false;
|
|
1577
|
+
const { value } = rule;
|
|
1578
|
+
if (config.isComplete != null && !config.isComplete(value)) return false;
|
|
1579
|
+
switch (config.valueType) {
|
|
1580
|
+
case "none": return value === null;
|
|
1581
|
+
case "boolean": return typeof value === "boolean";
|
|
1582
|
+
case "number": return typeof value === "number" && Number.isFinite(value);
|
|
1583
|
+
case "integer": return typeof value === "number" && Number.isSafeInteger(value);
|
|
1584
|
+
case "string": return typeof value === "string" && value.length > 0;
|
|
1585
|
+
case "string_array": return Array.isArray(value) && value.length > 0 && value.every((entry) => typeof entry === "string");
|
|
1586
|
+
}
|
|
1345
1587
|
}
|
|
1346
1588
|
/**
|
|
1347
1589
|
* Whether a rule's value is a date range: a range operator, or a field that is
|
|
@@ -1382,20 +1624,25 @@ function fieldHasMultipleOperators(field) {
|
|
|
1382
1624
|
return getOperatorsForField(field).length > 1;
|
|
1383
1625
|
}
|
|
1384
1626
|
/**
|
|
1385
|
-
* Human-readable operator labels for the operator dropdown and filled pill
|
|
1627
|
+
* Human-readable operator labels for the operator dropdown and filled pill, as keys into the
|
|
1628
|
+
* translatable `CommonStrings` table (English defaults: "is", "is not", "contains", ...).
|
|
1386
1629
|
*/
|
|
1387
|
-
const
|
|
1388
|
-
|
|
1389
|
-
|
|
1390
|
-
|
|
1391
|
-
|
|
1392
|
-
|
|
1393
|
-
|
|
1394
|
-
|
|
1395
|
-
|
|
1396
|
-
|
|
1397
|
-
|
|
1398
|
-
|
|
1630
|
+
const OPERATOR_LABEL_KEYS = {
|
|
1631
|
+
gt: "operatorGreaterThan",
|
|
1632
|
+
gte: "operatorGreaterThanOrEqual",
|
|
1633
|
+
lt: "operatorLessThan",
|
|
1634
|
+
lte: "operatorLessThanOrEqual",
|
|
1635
|
+
is: "operatorIs",
|
|
1636
|
+
is_not: "operatorIsNot",
|
|
1637
|
+
contains: "operatorContains",
|
|
1638
|
+
does_not_contain: "operatorDoesNotContain",
|
|
1639
|
+
is_empty: "operatorIsEmpty",
|
|
1640
|
+
is_not_empty: "operatorIsNotEmpty",
|
|
1641
|
+
is_true: "operatorIsTrue",
|
|
1642
|
+
is_false: "operatorIsFalse",
|
|
1643
|
+
before: "operatorBefore",
|
|
1644
|
+
after: "operatorAfter",
|
|
1645
|
+
between: "operatorBetween"
|
|
1399
1646
|
};
|
|
1400
1647
|
/**
|
|
1401
1648
|
* Field-type-specific label overrides. The operator vocabulary itself
|
|
@@ -1403,18 +1650,21 @@ const OPERATOR_LABELS = {
|
|
|
1403
1650
|
* labels can be more specific where the generic label is ambiguous.
|
|
1404
1651
|
*
|
|
1405
1652
|
* Only present for `(fieldType, operator)` pairs that diverge from the
|
|
1406
|
-
* generic label; everything else falls through to `
|
|
1653
|
+
* generic label; everything else falls through to `OPERATOR_LABEL_KEYS`.
|
|
1407
1654
|
*/
|
|
1408
|
-
const
|
|
1409
|
-
is: "
|
|
1410
|
-
is_not: "
|
|
1655
|
+
const OPERATOR_LABEL_KEYS_BY_TYPE = { multi_choices: {
|
|
1656
|
+
is: "operatorIsAnyOf",
|
|
1657
|
+
is_not: "operatorIsNoneOf"
|
|
1411
1658
|
} };
|
|
1412
|
-
|
|
1413
|
-
|
|
1414
|
-
|
|
1415
|
-
|
|
1416
|
-
|
|
1417
|
-
|
|
1659
|
+
/**
|
|
1660
|
+
* The label for `operator`, specialized for `fieldType` where the generic label is ambiguous.
|
|
1661
|
+
* Pass `strings` from `usePDSStrings()` to translate it; English when omitted.
|
|
1662
|
+
*/
|
|
1663
|
+
function getOperatorLabel(operator, fieldType, strings = DEFAULT_COMMON_STRINGS, field) {
|
|
1664
|
+
const config = getConditionOperator(field, operator);
|
|
1665
|
+
if (config != null) return config.label;
|
|
1666
|
+
const key = fieldType && OPERATOR_LABEL_KEYS_BY_TYPE[fieldType]?.[operator] || OPERATOR_LABEL_KEYS[operator];
|
|
1667
|
+
return key != null ? strings[key] : operator;
|
|
1418
1668
|
}
|
|
1419
1669
|
/**
|
|
1420
1670
|
* Empty-but-present value seeded when a rule switches from a valueless operator
|
|
@@ -1448,7 +1698,16 @@ function emptyDateRange() {
|
|
|
1448
1698
|
* `between`.
|
|
1449
1699
|
*/
|
|
1450
1700
|
function emptyValueForRule(field, operator) {
|
|
1451
|
-
if (isValuelessOperator(operator)) return null;
|
|
1701
|
+
if (isValuelessOperator(operator, field)) return null;
|
|
1702
|
+
const config = getConditionOperator(field, operator);
|
|
1703
|
+
if (config != null) {
|
|
1704
|
+
if (config.defaultValue != null) return config.defaultValue;
|
|
1705
|
+
switch (config.valueType) {
|
|
1706
|
+
case "string_array": return [];
|
|
1707
|
+
case "boolean": return true;
|
|
1708
|
+
default: return "";
|
|
1709
|
+
}
|
|
1710
|
+
}
|
|
1452
1711
|
if (isRangeOperator(operator) || field.type === "date_range") return emptyDateRange();
|
|
1453
1712
|
return emptyValueForFieldType(field.type);
|
|
1454
1713
|
}
|
|
@@ -1459,7 +1718,8 @@ function emptyValueForRule(field, operator) {
|
|
|
1459
1718
|
* the range control can't read it and the wire format would reject it.
|
|
1460
1719
|
*/
|
|
1461
1720
|
function reconcileValueForOperator(field, nextOperator, previousOperator, value) {
|
|
1462
|
-
if (isValuelessOperator(nextOperator)) return null;
|
|
1721
|
+
if (isValuelessOperator(nextOperator, field)) return null;
|
|
1722
|
+
if (field.condition != null) return getConditionOperator(field, nextOperator)?.valueType === getConditionOperator(field, previousOperator)?.valueType ? value ?? emptyValueForRule(field, nextOperator) : emptyValueForRule(field, nextOperator);
|
|
1463
1723
|
if (isRangeOperator(nextOperator) !== isRangeOperator(previousOperator)) return emptyValueForRule(field, nextOperator);
|
|
1464
1724
|
if (field.type === "date" && nextOperator === "is" && typeof value === "string" && TIME_COMPONENT$1.test(value)) return DateTime.fromISO(value).setZone(Settings.defaultZone).toISODate();
|
|
1465
1725
|
if (field.type === "date" && (previousOperator === "before" || previousOperator === "after") && (nextOperator === "before" || nextOperator === "after") && previousOperator !== nextOperator && typeof value === "string" && TIME_COMPONENT$1.test(value)) {
|
|
@@ -1496,10 +1756,15 @@ function resolveDateRangeRuleValue(rule, fieldType) {
|
|
|
1496
1756
|
//#endregion
|
|
1497
1757
|
//#region components/DataTable/TableControls/FiltersV2/format-date-value.ts
|
|
1498
1758
|
const TIME_COMPONENT = /T\d{2}:\d{2}/;
|
|
1499
|
-
|
|
1759
|
+
/**
|
|
1760
|
+
* Display form of a minute-precision filter value ("Oct 5, 2011 2:48 PM"). Date-only values are
|
|
1761
|
+
* returned untouched. Pass the `PDSProvider` locale (`usePDSLocale()`) to follow it; omitted or
|
|
1762
|
+
* en-US keeps the English format.
|
|
1763
|
+
*/
|
|
1764
|
+
function formatDateValueForDisplay(value, locale) {
|
|
1500
1765
|
if (!TIME_COMPONENT.test(value)) return value;
|
|
1501
1766
|
const dateTime = DateTime.fromISO(value).setZone(Settings.defaultZone);
|
|
1502
|
-
return dateTime.isValid ? dateTime
|
|
1767
|
+
return dateTime.isValid ? formatDateTime(dateTime, { locale }) : value;
|
|
1503
1768
|
}
|
|
1504
1769
|
//#endregion
|
|
1505
1770
|
//#region components/DataTable/TableControls/FiltersV2/relative-date-label.ts
|
|
@@ -1518,17 +1783,20 @@ function relativePresetLabel(value, relativeDate) {
|
|
|
1518
1783
|
}
|
|
1519
1784
|
//#endregion
|
|
1520
1785
|
//#region components/DataTable/TableControls/FiltersV2/AdvancedFilterRulesPopover/display.ts
|
|
1521
|
-
function valueDisplayString(value, optionLabels, relativeDate, fieldType) {
|
|
1786
|
+
function valueDisplayString(value, optionLabels, relativeDate, fieldType, { locale, strings = DEFAULT_COMMON_STRINGS } = {}) {
|
|
1522
1787
|
if (value == null) return;
|
|
1523
1788
|
const relativeLabel = relativePresetLabel(value, relativeDate);
|
|
1524
1789
|
if (relativeLabel) return relativeLabel;
|
|
1525
|
-
const display = (raw) => optionLabels?.[raw] ?? (fieldType === "date" || fieldType === "date_range" ? formatDateValueForDisplay(raw) : raw);
|
|
1790
|
+
const display = (raw) => optionLabels?.[raw] ?? (fieldType === "date" || fieldType === "date_range" ? formatDateValueForDisplay(raw, locale) : raw);
|
|
1526
1791
|
if (Array.isArray(value)) {
|
|
1527
1792
|
if (value.length === 0) return;
|
|
1528
1793
|
if (value.length === 1) return display(String(value[0]));
|
|
1529
1794
|
return `${display(String(value[0]))} +${value.length - 1}`;
|
|
1530
1795
|
}
|
|
1531
|
-
if (typeof value === "boolean")
|
|
1796
|
+
if (typeof value === "boolean") {
|
|
1797
|
+
const label = value ? strings.booleanTrue : strings.booleanFalse;
|
|
1798
|
+
return label === (value ? DEFAULT_COMMON_STRINGS.booleanTrue : DEFAULT_COMMON_STRINGS.booleanFalse) ? String(value) : label;
|
|
1799
|
+
}
|
|
1532
1800
|
if (typeof value === "number") return String(value);
|
|
1533
1801
|
if (typeof value === "string") return value.length > 0 ? display(value) : void 0;
|
|
1534
1802
|
if (typeof value === "object") {
|
|
@@ -1538,6 +1806,7 @@ function valueDisplayString(value, optionLabels, relativeDate, fieldType) {
|
|
|
1538
1806
|
}
|
|
1539
1807
|
}
|
|
1540
1808
|
function draftValueFor(field, operator) {
|
|
1809
|
+
if (field.condition != null) return emptyValueForRule(field, operator);
|
|
1541
1810
|
if (isValuelessOperator(operator)) return null;
|
|
1542
1811
|
if (field.type === "boolean") return true;
|
|
1543
1812
|
if (isRangeOperator(operator)) return emptyValueForRule(field, operator);
|
|
@@ -1619,31 +1888,54 @@ function nodeToOptions(node) {
|
|
|
1619
1888
|
* submenu entirely. Omit it (or pass `undefined`) to show every group.
|
|
1620
1889
|
*
|
|
1621
1890
|
* `excludeFieldIds`, when provided, drops those fields from the tree.
|
|
1891
|
+
*
|
|
1892
|
+
* `fieldsLabel` names the custom-field submenu; pass `usePDSStrings().fields` to translate it.
|
|
1622
1893
|
*/
|
|
1623
|
-
function buildFieldPickerOptions(registry, visibleCustomFieldParents, excludeFieldIds) {
|
|
1624
|
-
const systemFields = registry.
|
|
1894
|
+
function buildFieldPickerOptions(registry, visibleCustomFieldParents, excludeFieldIds, fieldsLabel = FIELDS_SUBMENU_LABEL) {
|
|
1895
|
+
const systemFields = registry.all().filter((field) => field.source === "system" || field.pickerGroup != null);
|
|
1625
1896
|
const customGroups = registry.customFieldGroups();
|
|
1626
1897
|
const excluded = excludeFieldIds == null ? null : new Set(excludeFieldIds);
|
|
1627
|
-
const tree =
|
|
1628
|
-
|
|
1629
|
-
|
|
1630
|
-
|
|
1898
|
+
const tree = [];
|
|
1899
|
+
const pickerGroups = /* @__PURE__ */ new Map();
|
|
1900
|
+
for (const field of systemFields) {
|
|
1901
|
+
if (excluded?.has(field.id)) continue;
|
|
1902
|
+
const option = {
|
|
1903
|
+
label: field.label,
|
|
1904
|
+
value: field.id
|
|
1905
|
+
};
|
|
1906
|
+
if (field.pickerGroup == null) {
|
|
1907
|
+
tree.push(option);
|
|
1908
|
+
continue;
|
|
1909
|
+
}
|
|
1910
|
+
const options = pickerGroups.get(field.pickerGroup) ?? [];
|
|
1911
|
+
options.push(option);
|
|
1912
|
+
pickerGroups.set(field.pickerGroup, options);
|
|
1913
|
+
}
|
|
1914
|
+
for (const [label, options] of pickerGroups) tree.push({
|
|
1915
|
+
label,
|
|
1916
|
+
nested: true,
|
|
1917
|
+
options
|
|
1918
|
+
});
|
|
1631
1919
|
const allowedParents = visibleCustomFieldParents == null ? null : new Set(visibleCustomFieldParents);
|
|
1632
1920
|
const customRoot = newNode();
|
|
1633
1921
|
for (const group of customGroups) {
|
|
1634
1922
|
if (allowedParents != null && !allowedParents.has(group.parent)) continue;
|
|
1635
1923
|
const description = group.parent !== "" ? group.parent : void 0;
|
|
1636
1924
|
for (const field of group.fields) {
|
|
1637
|
-
if (
|
|
1925
|
+
if (field.pickerGroup != null || excluded?.has(field.id)) continue;
|
|
1638
1926
|
insertField(customRoot, field, description);
|
|
1639
1927
|
}
|
|
1640
1928
|
}
|
|
1641
1929
|
const customOptions = nodeToOptions(customRoot);
|
|
1642
|
-
if (customOptions.length > 0)
|
|
1643
|
-
|
|
1644
|
-
|
|
1645
|
-
|
|
1646
|
-
|
|
1930
|
+
if (customOptions.length > 0) {
|
|
1931
|
+
const existingGroup = pickerGroups.get(fieldsLabel);
|
|
1932
|
+
if (existingGroup != null) existingGroup.push(...customOptions);
|
|
1933
|
+
else tree.push({
|
|
1934
|
+
label: fieldsLabel,
|
|
1935
|
+
nested: true,
|
|
1936
|
+
options: customOptions
|
|
1937
|
+
});
|
|
1938
|
+
}
|
|
1647
1939
|
return tree;
|
|
1648
1940
|
}
|
|
1649
1941
|
//#endregion
|
|
@@ -1661,68 +1953,97 @@ const StatementFields = styled.div`
|
|
|
1661
1953
|
}
|
|
1662
1954
|
`;
|
|
1663
1955
|
function RuleEditorFields({ registry, dateTimesEnabled, field, groupIndex, ruleIndex, rule, size, operators, operatorConfigurable, onFieldChange, onOperatorChange, onValueChange, renderValueControl }) {
|
|
1956
|
+
const strings = usePDSStrings();
|
|
1664
1957
|
const minutePrecisionValue = field != null && isMinutePrecisionDate(field, rule.operator, dateTimesEnabled);
|
|
1665
|
-
const fieldOptions = useMemo(() => buildFieldPickerOptions(registry), [registry]);
|
|
1958
|
+
const fieldOptions = useMemo(() => buildFieldPickerOptions(registry, void 0, void 0, strings.fields), [registry, strings.fields]);
|
|
1959
|
+
const optionDisabledReason = useCallback((option) => registry.get(option.value)?.disabledReason, [registry]);
|
|
1960
|
+
const operatorOptions = useMemo(() => operators.map((operator) => ({
|
|
1961
|
+
label: getOperatorLabel(operator, field?.type, strings, field),
|
|
1962
|
+
value: operator
|
|
1963
|
+
})), [
|
|
1964
|
+
operators,
|
|
1965
|
+
field,
|
|
1966
|
+
strings
|
|
1967
|
+
]);
|
|
1968
|
+
const handleFieldChange = useCallback((next) => {
|
|
1969
|
+
if (next != null && registry.get(next)?.disabledReason == null) onFieldChange(groupIndex, ruleIndex, next);
|
|
1970
|
+
}, [
|
|
1971
|
+
registry,
|
|
1972
|
+
onFieldChange,
|
|
1973
|
+
groupIndex,
|
|
1974
|
+
ruleIndex
|
|
1975
|
+
]);
|
|
1976
|
+
const handleOperatorChange = useCallback((next) => {
|
|
1977
|
+
if (next != null) onOperatorChange(groupIndex, ruleIndex, next);
|
|
1978
|
+
}, [
|
|
1979
|
+
onOperatorChange,
|
|
1980
|
+
groupIndex,
|
|
1981
|
+
ruleIndex
|
|
1982
|
+
]);
|
|
1983
|
+
const handleValueChange = useCallback((next, relativeDate) => onValueChange(groupIndex, ruleIndex, next, relativeDate), [
|
|
1984
|
+
onValueChange,
|
|
1985
|
+
groupIndex,
|
|
1986
|
+
ruleIndex
|
|
1987
|
+
]);
|
|
1666
1988
|
return /* @__PURE__ */ jsxs(StatementFields, { children: [
|
|
1667
1989
|
/* @__PURE__ */ jsx(ComboboxField, {
|
|
1668
|
-
label:
|
|
1990
|
+
label: strings.field,
|
|
1669
1991
|
labelProps: { size },
|
|
1670
|
-
"aria-label":
|
|
1992
|
+
"aria-label": strings.fieldForRule(ruleIndex + 1, groupIndex + 1),
|
|
1671
1993
|
size,
|
|
1672
1994
|
options: fieldOptions,
|
|
1995
|
+
optionDisabledReason,
|
|
1673
1996
|
value: rule.fieldId,
|
|
1674
|
-
onChange:
|
|
1675
|
-
|
|
1676
|
-
},
|
|
1677
|
-
placeholder: "Select field",
|
|
1997
|
+
onChange: handleFieldChange,
|
|
1998
|
+
placeholder: strings.selectField,
|
|
1678
1999
|
portal: false
|
|
1679
2000
|
}),
|
|
1680
2001
|
operatorConfigurable ? /* @__PURE__ */ jsx(ComboboxField, {
|
|
1681
|
-
label:
|
|
2002
|
+
label: strings.operator,
|
|
1682
2003
|
labelProps: { size },
|
|
1683
|
-
"aria-label":
|
|
2004
|
+
"aria-label": strings.operatorForRule(ruleIndex + 1, groupIndex + 1),
|
|
1684
2005
|
size,
|
|
1685
|
-
options:
|
|
1686
|
-
label: getOperatorLabel(op, field?.type),
|
|
1687
|
-
value: op
|
|
1688
|
-
})),
|
|
2006
|
+
options: operatorOptions,
|
|
1689
2007
|
value: rule.operator,
|
|
1690
|
-
onChange:
|
|
1691
|
-
if (typeof next === "string") onOperatorChange(groupIndex, ruleIndex, next);
|
|
1692
|
-
},
|
|
2008
|
+
onChange: handleOperatorChange,
|
|
1693
2009
|
portal: false
|
|
1694
2010
|
}) : /* @__PURE__ */ jsx(FormField, {
|
|
1695
|
-
label:
|
|
2011
|
+
label: strings.operator,
|
|
1696
2012
|
labelProps: { size },
|
|
1697
2013
|
children: /* @__PURE__ */ jsx(Input_default, {
|
|
1698
2014
|
size,
|
|
1699
|
-
"aria-label":
|
|
1700
|
-
value: getOperatorLabel(rule.operator, field?.type),
|
|
2015
|
+
"aria-label": strings.operatorForRule(ruleIndex + 1, groupIndex + 1),
|
|
2016
|
+
value: getOperatorLabel(rule.operator, field?.type, strings, field),
|
|
1701
2017
|
disabled: true,
|
|
1702
2018
|
readOnly: true
|
|
1703
2019
|
})
|
|
1704
2020
|
}),
|
|
1705
|
-
field && !isValuelessOperator(rule.operator) ? /* @__PURE__ */ jsx(FormField, {
|
|
1706
|
-
label:
|
|
2021
|
+
field && !isValuelessOperator(rule.operator, field) ? /* @__PURE__ */ jsx(FormField, {
|
|
2022
|
+
label: strings.value,
|
|
1707
2023
|
labelProps: { size },
|
|
1708
2024
|
configField: minutePrecisionValue ? false : void 0,
|
|
1709
|
-
children: /* @__PURE__ */ jsx(Fragment$1, { children: renderValueControl(field, rule.operator, rule.value,
|
|
2025
|
+
children: /* @__PURE__ */ jsx(Fragment$1, { children: renderValueControl(field, rule.operator, rule.value, handleValueChange, rule.relativeDate) })
|
|
1710
2026
|
}) : null
|
|
1711
2027
|
] });
|
|
1712
2028
|
}
|
|
1713
2029
|
//#endregion
|
|
1714
2030
|
//#region components/DataTable/TableControls/FiltersV2/AdvancedFilterRulesPopover/AdvancedFilterRuleRow.tsx
|
|
1715
2031
|
function AdvancedFilterRuleRow({ registry, dateTimesEnabled, groupIndex, ruleIndex, rule, size, isOpen, onClose, onDelete, onFieldChange, onOperatorChange, onValueChange, renderValueControl }) {
|
|
2032
|
+
const strings = usePDSStrings();
|
|
2033
|
+
const locale = usePDSLocale();
|
|
1716
2034
|
const field = registry.get(rule.fieldId);
|
|
1717
2035
|
const operators = field ? getOperatorsForField(field) : [];
|
|
1718
2036
|
const operatorConfigurable = field ? fieldHasMultipleOperators(field) : true;
|
|
1719
|
-
const condition = ruleIndex === 0 ?
|
|
2037
|
+
const condition = ruleIndex === 0 ? strings.conditionIf : strings.conditionAnd;
|
|
1720
2038
|
const rowId = `${groupIndex}-${ruleIndex}`;
|
|
1721
|
-
const valueDisplay = isValuelessOperator(rule.operator) ? void 0 : valueDisplayString(rule.value, registry.optionLabelsFor(rule.fieldId), carriesDateRange(rule.operator, field?.type) ? rule.relativeDate : void 0, field?.type
|
|
2039
|
+
const valueDisplay = isValuelessOperator(rule.operator, field) ? void 0 : valueDisplayString(rule.value, registry.optionLabelsFor(rule.fieldId), carriesDateRange(rule.operator, field?.type) ? rule.relativeDate : void 0, field?.type, {
|
|
2040
|
+
locale,
|
|
2041
|
+
strings
|
|
2042
|
+
});
|
|
1722
2043
|
const textValue = [
|
|
1723
2044
|
condition,
|
|
1724
2045
|
field?.label ?? rule.fieldId,
|
|
1725
|
-
getOperatorLabel(rule.operator, field?.type),
|
|
2046
|
+
getOperatorLabel(rule.operator, field?.type, strings, field),
|
|
1726
2047
|
valueDisplay
|
|
1727
2048
|
].filter(Boolean).join(" ");
|
|
1728
2049
|
return /* @__PURE__ */ jsx(ListBox.LogicRow, {
|
|
@@ -1730,7 +2051,7 @@ function AdvancedFilterRuleRow({ registry, dateTimesEnabled, groupIndex, ruleInd
|
|
|
1730
2051
|
condition,
|
|
1731
2052
|
hideCondition: true,
|
|
1732
2053
|
attributeName: field?.label ?? rule.fieldId,
|
|
1733
|
-
operator: getOperatorLabel(rule.operator, field?.type),
|
|
2054
|
+
operator: getOperatorLabel(rule.operator, field?.type, strings, field),
|
|
1734
2055
|
matchLevelName: valueDisplay,
|
|
1735
2056
|
textValue,
|
|
1736
2057
|
size,
|
|
@@ -1738,7 +2059,7 @@ function AdvancedFilterRuleRow({ registry, dateTimesEnabled, groupIndex, ruleInd
|
|
|
1738
2059
|
if (isOpen) onClose();
|
|
1739
2060
|
},
|
|
1740
2061
|
onDelete,
|
|
1741
|
-
dropdownHeadingText:
|
|
2062
|
+
dropdownHeadingText: strings.editStatement(condition),
|
|
1742
2063
|
dropdownFormFields: /* @__PURE__ */ jsx(RuleEditorFields, {
|
|
1743
2064
|
registry,
|
|
1744
2065
|
dateTimesEnabled,
|
|
@@ -1969,6 +2290,7 @@ function groupsForRender(compound) {
|
|
|
1969
2290
|
* row's dropdown popover.
|
|
1970
2291
|
*/
|
|
1971
2292
|
const AdvancedFilterRulesPopover = ({ registry, compound, onChange, trigger, open, onOpenChange, renderValueControl, size, dateTimesEnabled = false }) => {
|
|
2293
|
+
const strings = usePDSStrings();
|
|
1972
2294
|
const resolvedSize = useFilterBarSize(size);
|
|
1973
2295
|
const subtleIconSize = resolvedSize === "sm" ? "xs" : "sm";
|
|
1974
2296
|
const wide = useMemo(() => dateTimesEnabled && registry.all().some((field) => field.timeGranularity === "minute"), [registry, dateTimesEnabled]);
|
|
@@ -1981,11 +2303,11 @@ const AdvancedFilterRulesPopover = ({ registry, compound, onChange, trigger, ope
|
|
|
1981
2303
|
onOpenChange?.(next);
|
|
1982
2304
|
}, [isControlled, onOpenChange]);
|
|
1983
2305
|
const baseId = useMemo(() => uniqueId("advanced-filter-rules__"), []);
|
|
1984
|
-
const fields = registry.all();
|
|
2306
|
+
const fields = useMemo(() => registry.all().filter((field) => field.disabledReason == null), [registry]);
|
|
1985
2307
|
const handleAddOrGroup = useCallback(() => {
|
|
1986
2308
|
const firstField = fields[0];
|
|
1987
2309
|
if (!firstField) return;
|
|
1988
|
-
const operator = registry.reconcileOperator(firstField.id, "is");
|
|
2310
|
+
const operator = firstField.condition != null ? registry.defaultOperatorFor(firstField.id) : registry.reconcileOperator(firstField.id, "is");
|
|
1989
2311
|
const groupIndex = compound.groups.length;
|
|
1990
2312
|
onChange(addRuleToGroup(compound, groupIndex, {
|
|
1991
2313
|
fieldId: firstField.id,
|
|
@@ -2002,7 +2324,7 @@ const AdvancedFilterRulesPopover = ({ registry, compound, onChange, trigger, ope
|
|
|
2002
2324
|
const handleAddRuleToGroup = useCallback((groupIndex) => {
|
|
2003
2325
|
const firstField = fields[0];
|
|
2004
2326
|
if (!firstField) return;
|
|
2005
|
-
const operator = registry.reconcileOperator(firstField.id, "is");
|
|
2327
|
+
const operator = firstField.condition != null ? registry.defaultOperatorFor(firstField.id) : registry.reconcileOperator(firstField.id, "is");
|
|
2006
2328
|
const newRowId = `${groupIndex}-${compound.groups[groupIndex]?.rules.length ?? 0}`;
|
|
2007
2329
|
onChange(addRuleToGroup(compound, groupIndex, {
|
|
2008
2330
|
fieldId: firstField.id,
|
|
@@ -2024,7 +2346,7 @@ const AdvancedFilterRulesPopover = ({ registry, compound, onChange, trigger, ope
|
|
|
2024
2346
|
}, [compound, applyCompoundChange]);
|
|
2025
2347
|
const handleFieldChange = useCallback((groupIndex, ruleIndex, nextFieldId) => {
|
|
2026
2348
|
const field = registry.get(nextFieldId);
|
|
2027
|
-
if (!field) return;
|
|
2349
|
+
if (!field || field.disabledReason != null) return;
|
|
2028
2350
|
const prev = compound.groups[groupIndex]?.rules[ruleIndex];
|
|
2029
2351
|
if (!prev) return;
|
|
2030
2352
|
const operator = registry.reconcileOperator(field.id, prev.operator);
|
|
@@ -2073,7 +2395,7 @@ const AdvancedFilterRulesPopover = ({ registry, compound, onChange, trigger, ope
|
|
|
2073
2395
|
sideOffset: 8,
|
|
2074
2396
|
collisionPadding: 8,
|
|
2075
2397
|
role: "dialog",
|
|
2076
|
-
"aria-label":
|
|
2398
|
+
"aria-label": strings.advancedFilterRules,
|
|
2077
2399
|
id: baseId,
|
|
2078
2400
|
onPointerDownCapture: letPointerDownReachDocument,
|
|
2079
2401
|
ref: popoverContentRef,
|
|
@@ -2082,9 +2404,11 @@ const AdvancedFilterRulesPopover = ({ registry, compound, onChange, trigger, ope
|
|
|
2082
2404
|
if (event.key !== "Enter") return;
|
|
2083
2405
|
if (selectedRowKey != null) {
|
|
2084
2406
|
event.preventDefault();
|
|
2085
|
-
closeSelectedRow();
|
|
2086
2407
|
requestAnimationFrame(() => {
|
|
2087
|
-
|
|
2408
|
+
closeSelectedRow();
|
|
2409
|
+
requestAnimationFrame(() => {
|
|
2410
|
+
popoverContentRef.current?.focus();
|
|
2411
|
+
});
|
|
2088
2412
|
});
|
|
2089
2413
|
return;
|
|
2090
2414
|
}
|
|
@@ -2098,25 +2422,25 @@ const AdvancedFilterRulesPopover = ({ registry, compound, onChange, trigger, ope
|
|
|
2098
2422
|
children: [/* @__PURE__ */ jsx(Header, { children: /* @__PURE__ */ jsx(Paragraph, {
|
|
2099
2423
|
size: resolvedSize,
|
|
2100
2424
|
color: "secondary",
|
|
2101
|
-
children:
|
|
2425
|
+
children: strings.advancedFilterRules
|
|
2102
2426
|
}) }), /* @__PURE__ */ jsxs(Body, { children: [groupsForRender(compound).map((group, groupIndex, renderableGroups) => {
|
|
2103
|
-
const groupTitle = groupIndex === 0 ?
|
|
2427
|
+
const groupTitle = groupIndex === 0 ? strings.conditionIf : strings.conditionOr;
|
|
2104
2428
|
const isSynthetic = group.synthetic;
|
|
2105
2429
|
const isOnlyGroup = renderableGroups.length === 1;
|
|
2106
2430
|
const isEmptyGroup = group.rules.length === 0;
|
|
2107
2431
|
const hideGroupMenu = isOnlyGroup && isEmptyGroup;
|
|
2108
|
-
const deleteGroupLabel = isOnlyGroup && !isEmptyGroup ?
|
|
2432
|
+
const deleteGroupLabel = isOnlyGroup && !isEmptyGroup ? strings.clearAll : strings.deleteGroup;
|
|
2109
2433
|
return /* @__PURE__ */ jsx(Fragment, { children: /* @__PURE__ */ jsxs(GroupCard, {
|
|
2110
2434
|
"data-test": `advanced-filter-rules__group-${groupIndex}`,
|
|
2111
2435
|
role: "group",
|
|
2112
|
-
"aria-label":
|
|
2436
|
+
"aria-label": strings.filterGroup(groupIndex + 1),
|
|
2113
2437
|
children: [/* @__PURE__ */ jsxs(GroupHeader, { children: [/* @__PURE__ */ jsx(GroupTitle, {
|
|
2114
2438
|
$size: resolvedSize,
|
|
2115
2439
|
children: groupTitle
|
|
2116
2440
|
}), /* @__PURE__ */ jsxs(GroupHeaderActions, { children: [hideGroupMenu ? null : /* @__PURE__ */ jsx(GroupActionsMenu, {
|
|
2117
2441
|
trigger: /* @__PURE__ */ jsx(IconButton, {
|
|
2118
2442
|
size: subtleIconSize,
|
|
2119
|
-
"aria-label":
|
|
2443
|
+
"aria-label": strings.moreActionsForFilterGroup(groupIndex + 1),
|
|
2120
2444
|
"data-test": `advanced-filter-rules__group-more-${groupIndex}`,
|
|
2121
2445
|
children: /* @__PURE__ */ jsx(MoreIcon$1, {})
|
|
2122
2446
|
}),
|
|
@@ -2137,17 +2461,18 @@ const AdvancedFilterRulesPopover = ({ registry, compound, onChange, trigger, ope
|
|
|
2137
2461
|
})
|
|
2138
2462
|
}), /* @__PURE__ */ jsx(IconButton, {
|
|
2139
2463
|
size: subtleIconSize,
|
|
2464
|
+
disabled: fields.length === 0,
|
|
2140
2465
|
onClick: () => handleAddRuleToGroup(groupIndex),
|
|
2141
|
-
"aria-label":
|
|
2466
|
+
"aria-label": strings.addRuleToFilterGroup(groupIndex + 1),
|
|
2142
2467
|
"data-test": `advanced-filter-rules__add-rule-${groupIndex}`,
|
|
2143
2468
|
children: /* @__PURE__ */ jsx(PlusIcon$1, {})
|
|
2144
2469
|
})] })] }), group.rules.length === 0 ? /* @__PURE__ */ jsx(Paragraph, {
|
|
2145
2470
|
size: resolvedSize,
|
|
2146
2471
|
color: "secondary",
|
|
2147
2472
|
style: { padding: Spacing[2] },
|
|
2148
|
-
children:
|
|
2473
|
+
children: strings.noRulesYet
|
|
2149
2474
|
}) : /* @__PURE__ */ jsx(RulesListBox, {
|
|
2150
|
-
"aria-label":
|
|
2475
|
+
"aria-label": strings.rulesInGroup(groupIndex + 1),
|
|
2151
2476
|
selectionMode: "single",
|
|
2152
2477
|
size: resolvedSize,
|
|
2153
2478
|
fullWidth: true,
|
|
@@ -2179,8 +2504,9 @@ const AdvancedFilterRulesPopover = ({ registry, compound, onChange, trigger, ope
|
|
|
2179
2504
|
width: "auto",
|
|
2180
2505
|
prefixIcon: /* @__PURE__ */ jsx(PlusIcon, {}),
|
|
2181
2506
|
onClick: handleAddOrGroup,
|
|
2507
|
+
disabled: fields.length === 0,
|
|
2182
2508
|
"data-test": "advanced-filter-rules__add-or-group",
|
|
2183
|
-
children:
|
|
2509
|
+
children: strings.orGroup
|
|
2184
2510
|
}) })] })]
|
|
2185
2511
|
})
|
|
2186
2512
|
}) })]
|
|
@@ -2220,6 +2546,7 @@ const stringValue = (value) => {
|
|
|
2220
2546
|
* scalar?", so we never produce an array-of-values from this control.
|
|
2221
2547
|
*/
|
|
2222
2548
|
const ArrayValueControl = ({ field, operator, value, onChange, onCommit, ariaLabel, layout = "popover" }) => {
|
|
2549
|
+
const strings = usePDSStrings();
|
|
2223
2550
|
const size = useFilterBarSize();
|
|
2224
2551
|
const [localValue, setLocalValue] = useState(() => stringDisplayValue(value));
|
|
2225
2552
|
useEffect(() => {
|
|
@@ -2234,7 +2561,7 @@ const ArrayValueControl = ({ field, operator, value, onChange, onCommit, ariaLab
|
|
|
2234
2561
|
onCommit?.();
|
|
2235
2562
|
}, [onChange, onCommit]);
|
|
2236
2563
|
if (isValuelessOperator(operator)) return null;
|
|
2237
|
-
const label = ariaLabel ??
|
|
2564
|
+
const label = ariaLabel ?? strings.fieldValue(field.label);
|
|
2238
2565
|
if ((field.itemType ?? "string") === "choices") return /* @__PURE__ */ jsx(Combobox, {
|
|
2239
2566
|
"aria-label": label,
|
|
2240
2567
|
options: (field.options ?? []).map((opt) => ({
|
|
@@ -2243,14 +2570,14 @@ const ArrayValueControl = ({ field, operator, value, onChange, onCommit, ariaLab
|
|
|
2243
2570
|
})),
|
|
2244
2571
|
value: stringValue(value),
|
|
2245
2572
|
onChange: handleComboboxChange,
|
|
2246
|
-
placeholder:
|
|
2573
|
+
placeholder: strings.selectAnOptionPlaceholder,
|
|
2247
2574
|
size,
|
|
2248
2575
|
embedded: layout === "popover"
|
|
2249
2576
|
});
|
|
2250
2577
|
return /* @__PURE__ */ jsx(Input_default, {
|
|
2251
2578
|
type: "text",
|
|
2252
2579
|
size,
|
|
2253
|
-
placeholder:
|
|
2580
|
+
placeholder: strings.enterAValue,
|
|
2254
2581
|
"aria-label": label,
|
|
2255
2582
|
value: localValue,
|
|
2256
2583
|
onChange: (e) => handleTextChange(e.target.value)
|
|
@@ -2259,10 +2586,10 @@ const ArrayValueControl = ({ field, operator, value, onChange, onCommit, ariaLab
|
|
|
2259
2586
|
//#endregion
|
|
2260
2587
|
//#region components/DataTable/TableControls/FiltersV2/value-controls/BooleanValueControl/BooleanValueControl.tsx
|
|
2261
2588
|
const OPTIONS = [{
|
|
2262
|
-
|
|
2589
|
+
labelKey: "booleanTrue",
|
|
2263
2590
|
value: true
|
|
2264
2591
|
}, {
|
|
2265
|
-
|
|
2592
|
+
labelKey: "booleanFalse",
|
|
2266
2593
|
value: false
|
|
2267
2594
|
}];
|
|
2268
2595
|
const Row = styled.button`
|
|
@@ -2309,11 +2636,12 @@ const Root = styled.div`
|
|
|
2309
2636
|
* for valueless operators (`is_empty`, `is_not_empty`).
|
|
2310
2637
|
*/
|
|
2311
2638
|
function BooleanValueControl({ operator, value, onChange, ariaLabel }) {
|
|
2639
|
+
const strings = usePDSStrings();
|
|
2312
2640
|
if (isValuelessOperator(operator)) return null;
|
|
2313
2641
|
const selected = typeof value === "boolean" ? value : null;
|
|
2314
2642
|
return /* @__PURE__ */ jsx(Root, {
|
|
2315
2643
|
role: "radiogroup",
|
|
2316
|
-
"aria-label": ariaLabel ??
|
|
2644
|
+
"aria-label": ariaLabel ?? strings.booleanValue,
|
|
2317
2645
|
children: OPTIONS.map((opt) => {
|
|
2318
2646
|
const isSelected = selected === opt.value;
|
|
2319
2647
|
return /* @__PURE__ */ jsxs(Row, {
|
|
@@ -2322,7 +2650,7 @@ function BooleanValueControl({ operator, value, onChange, ariaLabel }) {
|
|
|
2322
2650
|
"aria-checked": isSelected,
|
|
2323
2651
|
$selected: isSelected,
|
|
2324
2652
|
onClick: () => onChange(opt.value),
|
|
2325
|
-
children: [opt.
|
|
2653
|
+
children: [strings[opt.labelKey], isSelected ? /* @__PURE__ */ jsx(CheckIcon, { "aria-hidden": true }) : null]
|
|
2326
2654
|
}, String(opt.value));
|
|
2327
2655
|
})
|
|
2328
2656
|
});
|
|
@@ -2341,6 +2669,7 @@ const EMPTY_VALUES = [];
|
|
|
2341
2669
|
* valueless (e.g. `is_empty`).
|
|
2342
2670
|
*/
|
|
2343
2671
|
function ChoicesValueControl({ field, operator, value, onChange, onCommit, ariaLabel, trigger, layout = "popover", multiple = false }) {
|
|
2672
|
+
const strings = usePDSStrings();
|
|
2344
2673
|
const generatedId = useMemo(() => uniqueId(multiple ? "filter_v2_multi_choices_" : "filter_v2_choices_"), [multiple]);
|
|
2345
2674
|
const size = useFilterBarSize();
|
|
2346
2675
|
const options = field.options ?? EMPTY_OPTIONS;
|
|
@@ -2352,8 +2681,8 @@ function ChoicesValueControl({ field, operator, value, onChange, onCommit, ariaL
|
|
|
2352
2681
|
size,
|
|
2353
2682
|
"aria-label": ariaLabel ?? field.label,
|
|
2354
2683
|
placeholder: field.label,
|
|
2355
|
-
searchPlaceholder:
|
|
2356
|
-
emptyStateMessage:
|
|
2684
|
+
searchPlaceholder: strings.searchPlaceholder,
|
|
2685
|
+
emptyStateMessage: strings.noMatches,
|
|
2357
2686
|
options,
|
|
2358
2687
|
values,
|
|
2359
2688
|
trigger,
|
|
@@ -2407,16 +2736,32 @@ const useDateRange = (value, relativeDate, minuteMode) => {
|
|
|
2407
2736
|
const parsedRelativeDate = parseDateFilterValue(relativeDate);
|
|
2408
2737
|
const parsed = parsedRelativeDate?.kind === "relative" ? parsedRelativeDate : parseDateFilterValue(value);
|
|
2409
2738
|
const resolved = parsed ? resolveDateFilterValue(parsed) : void 0;
|
|
2410
|
-
|
|
2411
|
-
|
|
2412
|
-
|
|
2413
|
-
|
|
2739
|
+
const isRelative = parsed?.kind === "relative";
|
|
2740
|
+
const nowMinuteMillis = minuteMode && isRelative ? DateTime.now().setZone(Settings.defaultZone).set({
|
|
2741
|
+
second: 0,
|
|
2742
|
+
millisecond: 0
|
|
2743
|
+
}).toMillis() : void 0;
|
|
2744
|
+
return useMemo(() => {
|
|
2745
|
+
const startDate = minuteMode ? parseIsoDateTime(resolved?.startDate, "start") : parseIsoDate$1(resolved?.startDate);
|
|
2746
|
+
let endDate = minuteMode ? parseIsoDateTime(resolved?.endDate, "end") : parseIsoDate$1(resolved?.endDate);
|
|
2747
|
+
if (minuteMode && isRelative && endDate && nowMinuteMillis !== void 0) {
|
|
2748
|
+
const now = DateTime.fromMillis(nowMinuteMillis, { zone: Settings.defaultZone });
|
|
2749
|
+
if (endDate.toMillis() > now.toMillis()) endDate = now;
|
|
2750
|
+
}
|
|
2751
|
+
return {
|
|
2752
|
+
startDate,
|
|
2753
|
+
endDate
|
|
2754
|
+
};
|
|
2755
|
+
}, [
|
|
2756
|
+
isRelative,
|
|
2414
2757
|
minuteMode,
|
|
2758
|
+
nowMinuteMillis,
|
|
2415
2759
|
resolved?.startDate,
|
|
2416
2760
|
resolved?.endDate
|
|
2417
2761
|
]);
|
|
2418
2762
|
};
|
|
2419
2763
|
const DateRangeValueControl = ({ field, operator, value, relativeDate, onChange, ariaLabel, hidePresets, portalContainer, visibleMonths, relativeDatesEnabled = false, dateTimesEnabled = false }) => {
|
|
2764
|
+
const strings = usePDSStrings();
|
|
2420
2765
|
const size = useFilterBarSize();
|
|
2421
2766
|
const minuteMode = dateTimesEnabled && field.timeGranularity === "minute";
|
|
2422
2767
|
const dateRange = useDateRange(value, relativeDate, minuteMode);
|
|
@@ -2482,7 +2827,7 @@ const DateRangeValueControl = ({ field, operator, value, relativeDate, onChange,
|
|
|
2482
2827
|
if (isValuelessOperator(operator)) return null;
|
|
2483
2828
|
const hasCompleteRange = dateRange.startDate != null && dateRange.endDate != null;
|
|
2484
2829
|
return /* @__PURE__ */ jsx(DateRangePicker, {
|
|
2485
|
-
"aria-label": ariaLabel ??
|
|
2830
|
+
"aria-label": ariaLabel ?? strings.fieldValue(field.label),
|
|
2486
2831
|
calendarZIndex: Z_INDICES.modalDropdown,
|
|
2487
2832
|
dateRange,
|
|
2488
2833
|
hidePresets,
|
|
@@ -2529,6 +2874,7 @@ const parseIsoDate = (value, field, operator, dateTimesEnabled) => {
|
|
|
2529
2874
|
* and bar both opt in; other date values remain `YYYY-MM-DD`.
|
|
2530
2875
|
*/
|
|
2531
2876
|
const DateValueControl = ({ field, operator, value, onChange, ariaLabel, dateTimesEnabled = false }) => {
|
|
2877
|
+
const strings = usePDSStrings();
|
|
2532
2878
|
const size = useFilterBarSize();
|
|
2533
2879
|
const minuteMode = isMinutePrecisionDate(field, operator, dateTimesEnabled);
|
|
2534
2880
|
const handleChange = useCallback((nextDate) => {
|
|
@@ -2554,7 +2900,7 @@ const DateValueControl = ({ field, operator, value, onChange, ariaLabel, dateTim
|
|
|
2554
2900
|
return /* @__PURE__ */ jsx(DatePicker, {
|
|
2555
2901
|
value: parseIsoDate(value, field, operator, dateTimesEnabled),
|
|
2556
2902
|
size,
|
|
2557
|
-
"aria-label": ariaLabel ??
|
|
2903
|
+
"aria-label": ariaLabel ?? strings.fieldValue(field.label),
|
|
2558
2904
|
onChange: handleChange,
|
|
2559
2905
|
granularity: minuteMode ? "minute" : "day",
|
|
2560
2906
|
useModalZIndex: true
|
|
@@ -2605,9 +2951,10 @@ function numericDisplayValue(value) {
|
|
|
2605
2951
|
* rule actually carries when focus leaves.
|
|
2606
2952
|
*
|
|
2607
2953
|
* `onChange` is debounced (300ms) to avoid committing on every keystroke;
|
|
2608
|
-
* the debounce flushes on blur and on unmount
|
|
2954
|
+
* the debounce flushes on blur or Enter and cancels on unmount.
|
|
2609
2955
|
*/
|
|
2610
2956
|
const FloatValueControl = ({ field, operator, value, onChange, ariaLabel }) => {
|
|
2957
|
+
const strings = usePDSStrings();
|
|
2611
2958
|
const size = useFilterBarSize();
|
|
2612
2959
|
const [localValue, setLocalValue] = useState(() => numericDisplayValue(value));
|
|
2613
2960
|
const isFocusedRef = useRef(false);
|
|
@@ -2632,16 +2979,20 @@ const FloatValueControl = ({ field, operator, value, onChange, ariaLabel }) => {
|
|
|
2632
2979
|
if (!Number.isFinite(parsed)) return;
|
|
2633
2980
|
debouncedOnChange(parsed);
|
|
2634
2981
|
}, [debouncedOnChange]);
|
|
2982
|
+
const handleKeyDown = useCallback((event) => {
|
|
2983
|
+
if (event.key === "Enter" && !event.defaultPrevented && !event.nativeEvent.isComposing) debouncedOnChange.flush();
|
|
2984
|
+
}, [debouncedOnChange]);
|
|
2635
2985
|
if (isValuelessOperator(operator)) return null;
|
|
2636
2986
|
return /* @__PURE__ */ jsx(Input_default, {
|
|
2637
2987
|
type: "number",
|
|
2638
2988
|
size,
|
|
2639
2989
|
step: "any",
|
|
2640
2990
|
inputMode: "decimal",
|
|
2641
|
-
placeholder:
|
|
2642
|
-
"aria-label": ariaLabel ??
|
|
2991
|
+
placeholder: strings.enterANumber,
|
|
2992
|
+
"aria-label": ariaLabel ?? strings.fieldValue(field.label),
|
|
2643
2993
|
value: localValue,
|
|
2644
2994
|
onChange: (e) => handleChange(e.target.value),
|
|
2995
|
+
onKeyDown: handleKeyDown,
|
|
2645
2996
|
onFocus: () => {
|
|
2646
2997
|
isFocusedRef.current = true;
|
|
2647
2998
|
},
|
|
@@ -2676,9 +3027,10 @@ const FloatValueControl = ({ field, operator, value, onChange, ariaLabel }) => {
|
|
|
2676
3027
|
* the user's next keystroke.
|
|
2677
3028
|
*
|
|
2678
3029
|
* `onChange` is debounced (300ms) to avoid committing on every keystroke;
|
|
2679
|
-
* the debounce flushes on blur and on unmount
|
|
3030
|
+
* the debounce flushes on blur or Enter and cancels on unmount.
|
|
2680
3031
|
*/
|
|
2681
3032
|
const IntegerValueControl = ({ field, operator, value, onChange, ariaLabel }) => {
|
|
3033
|
+
const strings = usePDSStrings();
|
|
2682
3034
|
const size = useFilterBarSize();
|
|
2683
3035
|
const [localValue, setLocalValue] = useState(() => numericDisplayValue(value));
|
|
2684
3036
|
const isFocusedRef = useRef(false);
|
|
@@ -2703,16 +3055,20 @@ const IntegerValueControl = ({ field, operator, value, onChange, ariaLabel }) =>
|
|
|
2703
3055
|
if (!Number.isFinite(parsed)) return;
|
|
2704
3056
|
debouncedOnChange(Math.trunc(parsed));
|
|
2705
3057
|
}, [debouncedOnChange]);
|
|
3058
|
+
const handleKeyDown = useCallback((event) => {
|
|
3059
|
+
if (event.key === "Enter" && !event.defaultPrevented && !event.nativeEvent.isComposing) debouncedOnChange.flush();
|
|
3060
|
+
}, [debouncedOnChange]);
|
|
2706
3061
|
if (isValuelessOperator(operator)) return null;
|
|
2707
3062
|
return /* @__PURE__ */ jsx(Input_default, {
|
|
2708
3063
|
type: "number",
|
|
2709
3064
|
size,
|
|
2710
3065
|
step: 1,
|
|
2711
3066
|
inputMode: "numeric",
|
|
2712
|
-
placeholder:
|
|
2713
|
-
"aria-label": ariaLabel ??
|
|
3067
|
+
placeholder: strings.enterANumber,
|
|
3068
|
+
"aria-label": ariaLabel ?? strings.fieldValue(field.label),
|
|
2714
3069
|
value: localValue,
|
|
2715
3070
|
onChange: (e) => handleChange(e.target.value),
|
|
3071
|
+
onKeyDown: handleKeyDown,
|
|
2716
3072
|
onFocus: () => {
|
|
2717
3073
|
isFocusedRef.current = true;
|
|
2718
3074
|
},
|
|
@@ -2755,7 +3111,7 @@ function StringValueControl({ field, operator, value, onChange, ariaLabel, input
|
|
|
2755
3111
|
debouncedOnChange.flush();
|
|
2756
3112
|
},
|
|
2757
3113
|
onKeyDown: (event) => {
|
|
2758
|
-
if (event.key === "Enter") debouncedOnChange.flush();
|
|
3114
|
+
if (event.key === "Enter" && !event.defaultPrevented && !event.nativeEvent.isComposing) debouncedOnChange.flush();
|
|
2759
3115
|
}
|
|
2760
3116
|
});
|
|
2761
3117
|
}
|
|
@@ -2777,8 +3133,27 @@ const RESOLVERS = {
|
|
|
2777
3133
|
array: (opts) => /* @__PURE__ */ jsx(ArrayValueControl, { ...opts })
|
|
2778
3134
|
};
|
|
2779
3135
|
function resolveValueControl(opts, hostResolver) {
|
|
3136
|
+
if (opts.field.condition != null && isValuelessOperator(opts.operator, opts.field)) return null;
|
|
2780
3137
|
const hostControl = hostResolver?.(opts);
|
|
2781
3138
|
if (hostControl != null) return hostControl;
|
|
3139
|
+
const config = getConditionOperator(opts.field, opts.operator);
|
|
3140
|
+
if (config != null) {
|
|
3141
|
+
if (config.valueType === "string_array") return opts.field.options != null ? /* @__PURE__ */ jsx(ChoicesValueControl, {
|
|
3142
|
+
multiple: true,
|
|
3143
|
+
...opts,
|
|
3144
|
+
operator: "is"
|
|
3145
|
+
}) : null;
|
|
3146
|
+
const type = config.valueType === "number" ? "float" : config.valueType;
|
|
3147
|
+
if (type === "none") return null;
|
|
3148
|
+
return RESOLVERS[type]?.({
|
|
3149
|
+
...opts,
|
|
3150
|
+
operator: "is",
|
|
3151
|
+
field: {
|
|
3152
|
+
...opts.field,
|
|
3153
|
+
type
|
|
3154
|
+
}
|
|
3155
|
+
}) ?? null;
|
|
3156
|
+
}
|
|
2782
3157
|
const renderer = RESOLVERS[opts.field.type];
|
|
2783
3158
|
if (!renderer) return null;
|
|
2784
3159
|
return renderer(opts);
|
|
@@ -2806,26 +3181,34 @@ const TriggerWrapper = styled.span`
|
|
|
2806
3181
|
}
|
|
2807
3182
|
`}
|
|
2808
3183
|
`;
|
|
2809
|
-
const FilterPickerMenu = ({ registry, onPickField, triggerLabel
|
|
3184
|
+
const FilterPickerMenu = ({ registry, onPickField, triggerLabel, compact = false, disabled = false, visibleCustomFieldParents, excludeFieldIds, size, ...rest }) => {
|
|
2810
3185
|
const resolvedSize = useFilterBarSize(size);
|
|
2811
|
-
const
|
|
2812
|
-
const
|
|
3186
|
+
const strings = usePDSStrings();
|
|
3187
|
+
const resolvedTriggerLabel = triggerLabel ?? strings.filter;
|
|
3188
|
+
const unfilteredOptions = useMemo(() => buildFieldPickerOptions(registry, visibleCustomFieldParents, void 0, strings.fields), [
|
|
3189
|
+
registry,
|
|
3190
|
+
visibleCustomFieldParents,
|
|
3191
|
+
strings.fields
|
|
3192
|
+
]);
|
|
3193
|
+
const options = useMemo(() => excludeFieldIds == null || excludeFieldIds.length === 0 ? unfilteredOptions : buildFieldPickerOptions(registry, visibleCustomFieldParents, excludeFieldIds, strings.fields), [
|
|
2813
3194
|
registry,
|
|
2814
3195
|
visibleCustomFieldParents,
|
|
2815
3196
|
excludeFieldIds,
|
|
2816
|
-
unfilteredOptions
|
|
3197
|
+
unfilteredOptions,
|
|
3198
|
+
strings.fields
|
|
2817
3199
|
]);
|
|
3200
|
+
const optionDisabledReason = useCallback((option) => registry.get(option.value)?.disabledReason, [registry]);
|
|
2818
3201
|
const handleChange = useCallback((value) => {
|
|
2819
3202
|
if (value == null) return;
|
|
2820
3203
|
const field = registry.get(value);
|
|
2821
|
-
if (!field) return;
|
|
3204
|
+
if (!field || field.disabledReason != null) return;
|
|
2822
3205
|
onPickField(field);
|
|
2823
3206
|
}, [registry, onPickField]);
|
|
2824
3207
|
if (options.length === 0 && unfilteredOptions.length > 0) return null;
|
|
2825
3208
|
const trigger = compact ? /* @__PURE__ */ jsx(IconButton, {
|
|
2826
3209
|
size: resolvedSize,
|
|
2827
3210
|
disabled,
|
|
2828
|
-
"aria-label":
|
|
3211
|
+
"aria-label": resolvedTriggerLabel,
|
|
2829
3212
|
children: /* @__PURE__ */ jsx(CirclePlusIcon, {})
|
|
2830
3213
|
}) : /* @__PURE__ */ jsx(Button, {
|
|
2831
3214
|
variant: "text",
|
|
@@ -2833,17 +3216,18 @@ const FilterPickerMenu = ({ registry, onPickField, triggerLabel = "Filter", comp
|
|
|
2833
3216
|
width: "auto",
|
|
2834
3217
|
prefixIcon: /* @__PURE__ */ jsx(CirclePlusIcon, {}),
|
|
2835
3218
|
disabled,
|
|
2836
|
-
children:
|
|
3219
|
+
children: resolvedTriggerLabel
|
|
2837
3220
|
});
|
|
2838
3221
|
return /* @__PURE__ */ jsx(TriggerWrapper, {
|
|
2839
3222
|
...rest,
|
|
2840
3223
|
$isOpen: false,
|
|
2841
3224
|
children: /* @__PURE__ */ jsx(Combobox, {
|
|
2842
3225
|
options,
|
|
3226
|
+
optionDisabledReason,
|
|
2843
3227
|
value: null,
|
|
2844
3228
|
onChange: handleChange,
|
|
2845
3229
|
size: resolvedSize,
|
|
2846
|
-
"aria-label":
|
|
3230
|
+
"aria-label": strings.filterFieldPicker,
|
|
2847
3231
|
trigger
|
|
2848
3232
|
})
|
|
2849
3233
|
});
|
|
@@ -3072,13 +3456,13 @@ const OverflowTooltipList = styled(Stack).attrs({
|
|
|
3072
3456
|
* `optionLabels` lookup so the pill renders human-readable option labels
|
|
3073
3457
|
* instead of raw option ids. Null / undefined collapses to an empty list.
|
|
3074
3458
|
*/
|
|
3075
|
-
function normalizeValueToDisplay(value, optionLabels, relativeDate, fieldType) {
|
|
3459
|
+
function normalizeValueToDisplay(value, optionLabels, relativeDate, fieldType, strings = DEFAULT_COMMON_STRINGS, locale) {
|
|
3076
3460
|
if (value == null) return [];
|
|
3077
3461
|
const relativeLabel = relativePresetLabel(value, relativeDate);
|
|
3078
3462
|
if (relativeLabel) return [relativeLabel];
|
|
3079
|
-
const lookup = (raw) => optionLabels?.[raw] ?? (fieldType === "date" || fieldType === "date_range" ? formatDateValueForDisplay(raw) : raw);
|
|
3463
|
+
const lookup = (raw) => optionLabels?.[raw] ?? (fieldType === "date" || fieldType === "date_range" ? formatDateValueForDisplay(raw, locale) : raw);
|
|
3080
3464
|
if (Array.isArray(value)) {
|
|
3081
|
-
if (value.length > 0 && Array.isArray(value[0])) return [
|
|
3465
|
+
if (value.length > 0 && Array.isArray(value[0])) return [strings.groupCount(value.length)];
|
|
3082
3466
|
return value.map((entry) => lookup(String(entry)));
|
|
3083
3467
|
}
|
|
3084
3468
|
if (typeof value === "object") {
|
|
@@ -3087,7 +3471,7 @@ function normalizeValueToDisplay(value, optionLabels, relativeDate, fieldType) {
|
|
|
3087
3471
|
const single = startDate || endDate;
|
|
3088
3472
|
return single ? [lookup(single)] : [];
|
|
3089
3473
|
}
|
|
3090
|
-
if (typeof value === "boolean") return [value ?
|
|
3474
|
+
if (typeof value === "boolean") return [value ? strings.booleanTrue : strings.booleanFalse];
|
|
3091
3475
|
if (typeof value === "number") return [String(value)];
|
|
3092
3476
|
return [lookup(value)];
|
|
3093
3477
|
}
|
|
@@ -3097,24 +3481,29 @@ function normalizeValueToDisplay(value, optionLabels, relativeDate, fieldType) {
|
|
|
3097
3481
|
* relying on child text nodes because the chip components don't always read
|
|
3098
3482
|
* cleanly when concatenated by the AT.
|
|
3099
3483
|
*/
|
|
3100
|
-
function buildAccessibleName(field, rule, displayedValues) {
|
|
3484
|
+
function buildAccessibleName(field, rule, displayedValues, strings = DEFAULT_COMMON_STRINGS) {
|
|
3101
3485
|
if (rule == null) return field.label;
|
|
3102
|
-
if (
|
|
3103
|
-
|
|
3104
|
-
|
|
3486
|
+
if (field.condition != null && !hasCompleteConditionValue(rule, field)) return field.label;
|
|
3487
|
+
if (!isValuelessOperator(rule.operator, field) && displayedValues.length === 0) return field.label;
|
|
3488
|
+
const operatorLabel = getOperatorLabel(rule.operator, field.type, strings, field);
|
|
3489
|
+
if (isValuelessOperator(rule.operator, field)) return `${field.label} ${operatorLabel}`;
|
|
3105
3490
|
return `${field.label} ${operatorLabel} ${displayedValues.join(", ")}`;
|
|
3106
3491
|
}
|
|
3107
3492
|
const FilterPill = forwardRef(function FilterPill({ field, rule, onClick, onDismiss, variant = "default", optionLabels, size, ...rest }, ref) {
|
|
3108
3493
|
const reactId = useMemo(() => uniqueId("filter-pill-"), []);
|
|
3109
3494
|
const resolvedSize = useFilterBarSize(size);
|
|
3110
|
-
const
|
|
3495
|
+
const strings = usePDSStrings();
|
|
3496
|
+
const locale = usePDSLocale();
|
|
3497
|
+
const displayedValues = useMemo(() => rule && !isValuelessOperator(rule.operator, field) ? normalizeValueToDisplay(rule.value, optionLabels, carriesDateRange(rule.operator, field?.type) ? rule.relativeDate : void 0, field?.type, strings, locale) : [], [
|
|
3111
3498
|
rule,
|
|
3112
3499
|
optionLabels,
|
|
3113
|
-
field
|
|
3500
|
+
field,
|
|
3501
|
+
strings,
|
|
3502
|
+
locale
|
|
3114
3503
|
]);
|
|
3115
|
-
const accessibleName = buildAccessibleName(field, rule, displayedValues);
|
|
3504
|
+
const accessibleName = buildAccessibleName(field, rule, displayedValues, strings);
|
|
3116
3505
|
const hasRule = rule != null;
|
|
3117
|
-
const isComplete = hasRule && (isValuelessOperator(rule.operator) || displayedValues.length > 0);
|
|
3506
|
+
const isComplete = hasRule && (field.condition != null ? hasCompleteConditionValue(rule, field) : isValuelessOperator(rule.operator, field) || displayedValues.length > 0);
|
|
3118
3507
|
const firstValue = displayedValues[0];
|
|
3119
3508
|
const overflowValues = displayedValues.slice(1);
|
|
3120
3509
|
const overflowTooltipId = `${reactId}-overflow`;
|
|
@@ -3122,15 +3511,15 @@ const FilterPill = forwardRef(function FilterPill({ field, rule, onClick, onDism
|
|
|
3122
3511
|
ref,
|
|
3123
3512
|
variant,
|
|
3124
3513
|
size: resolvedSize,
|
|
3125
|
-
bodyAriaLabel:
|
|
3514
|
+
bodyAriaLabel: strings.editFilter(accessibleName),
|
|
3126
3515
|
onBodyClick: onClick,
|
|
3127
3516
|
onDismiss,
|
|
3128
|
-
dismissAriaLabel:
|
|
3517
|
+
dismissAriaLabel: strings.removeFilter(accessibleName),
|
|
3129
3518
|
...rest,
|
|
3130
3519
|
children: [
|
|
3131
3520
|
/* @__PURE__ */ jsx(FieldLabel, { children: /* @__PURE__ */ jsx(TruncatedText, { children: field.label }) }),
|
|
3132
|
-
isComplete && hasRule && /* @__PURE__ */ jsx(OperatorLabel, { children: getOperatorLabel(rule.operator, field.type) }),
|
|
3133
|
-
isComplete && hasRule && !isValuelessOperator(rule.operator) && firstValue != null && /* @__PURE__ */ jsxs(ValueChipGroup, { children: [/* @__PURE__ */ jsx(ValueChip, {
|
|
3521
|
+
isComplete && hasRule && /* @__PURE__ */ jsx(OperatorLabel, { children: getOperatorLabel(rule.operator, field.type, strings, field) }),
|
|
3522
|
+
isComplete && hasRule && !isValuelessOperator(rule.operator, field) && firstValue != null && /* @__PURE__ */ jsxs(ValueChipGroup, { children: [/* @__PURE__ */ jsx(ValueChip, {
|
|
3134
3523
|
$variant: variant,
|
|
3135
3524
|
$size: resolvedSize,
|
|
3136
3525
|
children: /* @__PURE__ */ jsx(TruncatedText, { children: firstValue })
|
|
@@ -3145,7 +3534,7 @@ const FilterPill = forwardRef(function FilterPill({ field, rule, onClick, onDism
|
|
|
3145
3534
|
hideArrow: true,
|
|
3146
3535
|
children: /* @__PURE__ */ jsx(OverflowTooltipList, {
|
|
3147
3536
|
id: overflowTooltipId,
|
|
3148
|
-
"aria-label":
|
|
3537
|
+
"aria-label": strings.additionalValues,
|
|
3149
3538
|
children: overflowValues.map((entry, index) => /* @__PURE__ */ jsx("li", { children: entry }, `${entry}-${index}`))
|
|
3150
3539
|
})
|
|
3151
3540
|
})] })
|
|
@@ -3154,13 +3543,10 @@ const FilterPill = forwardRef(function FilterPill({ field, rule, onClick, onDism
|
|
|
3154
3543
|
});
|
|
3155
3544
|
//#endregion
|
|
3156
3545
|
//#region components/DataTable/TableControls/FiltersV2/FilterPopover/FilterPopover.tsx
|
|
3157
|
-
/**
|
|
3158
|
-
* Compact value controls fit the minimum width; wider controls can grow
|
|
3159
|
-
* up to 320px without overflowing, or 520px when the popover is `wide`.
|
|
3160
|
-
*/
|
|
3546
|
+
/** Wide controls size to their content while retaining a viewport gutter. */
|
|
3161
3547
|
const POPOVER_MIN_WIDTH = "196px";
|
|
3162
3548
|
const POPOVER_MAX_WIDTH = "320px";
|
|
3163
|
-
const POPOVER_WIDE_MAX_WIDTH =
|
|
3549
|
+
const POPOVER_WIDE_MAX_WIDTH = `calc(100vw - ${Spacing[4]} - ${Spacing[4]})`;
|
|
3164
3550
|
const OperatorMenu = styled(DropdownMenu_default)`
|
|
3165
3551
|
&& {
|
|
3166
3552
|
background-color: ${({ theme }) => semanticColor(theme, "SurfaceElevated", theme.color.background.primary)};
|
|
@@ -3168,7 +3554,7 @@ const OperatorMenu = styled(DropdownMenu_default)`
|
|
|
3168
3554
|
`;
|
|
3169
3555
|
const PopoverPanel = styled(Stack).attrs({ spacing: Spacing[0] })`
|
|
3170
3556
|
min-width: ${POPOVER_MIN_WIDTH};
|
|
3171
|
-
max-width: ${({ $wide }) => $wide ?
|
|
3557
|
+
max-width: ${({ $wide }) => $wide ? "none" : POPOVER_MAX_WIDTH};
|
|
3172
3558
|
/* The design-system Popover.Card already supplies bg, border, shadow,
|
|
3173
3559
|
and 6px corner radius — we just constrain the inner content. */
|
|
3174
3560
|
`;
|
|
@@ -3270,9 +3656,10 @@ const Footer = styled(HStack).attrs({
|
|
|
3270
3656
|
* back through `onChangeOperator` and forwards open/close transitions
|
|
3271
3657
|
* through Radix's controlled props.
|
|
3272
3658
|
*/
|
|
3273
|
-
const FilterPopover = ({ field, operator, onChangeOperator, valueControlSlot, onClose, trigger, open, onOpenChange, size, wide = false }) => {
|
|
3659
|
+
const FilterPopover = ({ field, operator, onChangeOperator, valueControlSlot, onClose, onApply, trigger, open, onOpenChange, size, wide = false }) => {
|
|
3660
|
+
const strings = usePDSStrings();
|
|
3274
3661
|
const resolvedSize = useFilterBarSize(size);
|
|
3275
|
-
const valueless = isValuelessOperator(operator);
|
|
3662
|
+
const valueless = isValuelessOperator(operator, field);
|
|
3276
3663
|
const CaretIcon = resolvedSize === "sm" ? CaretDownIcon$1 : CaretDownIcon;
|
|
3277
3664
|
const InfoIcon = resolvedSize === "sm" ? CircleInfoIcon$1 : CircleInfoIcon;
|
|
3278
3665
|
const showOperatorSelector = fieldHasMultipleOperators(field);
|
|
@@ -3282,6 +3669,7 @@ const FilterPopover = ({ field, operator, onChangeOperator, valueControlSlot, on
|
|
|
3282
3669
|
if (!next) onClose();
|
|
3283
3670
|
}, [onOpenChange, onClose]);
|
|
3284
3671
|
const valueSlotRef = useRef(null);
|
|
3672
|
+
const applyButtonRef = useRef(null);
|
|
3285
3673
|
useEffect(() => {
|
|
3286
3674
|
if (open !== true || valueless) return;
|
|
3287
3675
|
const handle = requestAnimationFrame(() => {
|
|
@@ -3295,16 +3683,19 @@ const FilterPopover = ({ field, operator, onChangeOperator, valueControlSlot, on
|
|
|
3295
3683
|
field.id,
|
|
3296
3684
|
valueless
|
|
3297
3685
|
]);
|
|
3298
|
-
const handleKeyDown = (event) => {
|
|
3299
|
-
if (event.key !== "Enter") return;
|
|
3686
|
+
const handleKeyDown = useCallback((event) => {
|
|
3687
|
+
if (event.key !== "Enter" || event.defaultPrevented || event.nativeEvent.isComposing) return;
|
|
3300
3688
|
const target = event.target;
|
|
3301
3689
|
if (!target || target.tagName !== "INPUT") return;
|
|
3302
3690
|
const input = target;
|
|
3303
|
-
if (input.type === "checkbox" || input.type === "radio") return;
|
|
3304
|
-
if (input.getAttribute("role") === "combobox") return;
|
|
3691
|
+
if (input.type === "checkbox" || input.type === "radio" || input.getAttribute("role") === "combobox") return;
|
|
3305
3692
|
event.preventDefault();
|
|
3693
|
+
if (applyButtonRef.current != null) {
|
|
3694
|
+
applyButtonRef.current.click();
|
|
3695
|
+
return;
|
|
3696
|
+
}
|
|
3306
3697
|
handleOpenChange(false);
|
|
3307
|
-
};
|
|
3698
|
+
}, [handleOpenChange]);
|
|
3308
3699
|
return /* @__PURE__ */ jsxs(Popover_default, {
|
|
3309
3700
|
open,
|
|
3310
3701
|
onOpenChange: handleOpenChange,
|
|
@@ -3316,39 +3707,55 @@ const FilterPopover = ({ field, operator, onChangeOperator, valueControlSlot, on
|
|
|
3316
3707
|
sideOffset: 4,
|
|
3317
3708
|
avoidCollisions: true,
|
|
3318
3709
|
zIndex: Z_INDICES.floatingBar,
|
|
3319
|
-
"aria-label":
|
|
3710
|
+
"aria-label": strings.editFilterFor(field.label),
|
|
3320
3711
|
noPadding: true,
|
|
3712
|
+
style: wide ? {
|
|
3713
|
+
width: "max-content",
|
|
3714
|
+
maxWidth: POPOVER_WIDE_MAX_WIDTH
|
|
3715
|
+
} : void 0,
|
|
3321
3716
|
children: /* @__PURE__ */ jsxs(PopoverPanel, {
|
|
3322
3717
|
$wide: wide,
|
|
3323
3718
|
onKeyDown: handleKeyDown,
|
|
3324
3719
|
children: [/* @__PURE__ */ jsxs(Main, {
|
|
3325
3720
|
$valueless: valueless,
|
|
3326
3721
|
"data-test": "filter-popover__main",
|
|
3327
|
-
children: [
|
|
3328
|
-
|
|
3329
|
-
children: [/* @__PURE__ */ jsx(FieldTypeLabel, {
|
|
3722
|
+
children: [
|
|
3723
|
+
/* @__PURE__ */ jsxs(HeaderRow, {
|
|
3330
3724
|
$size: resolvedSize,
|
|
3331
|
-
children: /* @__PURE__ */ jsx(
|
|
3332
|
-
}), showOperatorSelector ? /* @__PURE__ */ jsx(OperatorMenu, {
|
|
3333
|
-
trigger: /* @__PURE__ */ jsxs(InlineOperatorTrigger, {
|
|
3334
|
-
type: "button",
|
|
3335
|
-
"aria-label": "Operator",
|
|
3725
|
+
children: [/* @__PURE__ */ jsx(FieldTypeLabel, {
|
|
3336
3726
|
$size: resolvedSize,
|
|
3337
|
-
children:
|
|
3338
|
-
}),
|
|
3339
|
-
|
|
3340
|
-
|
|
3341
|
-
|
|
3342
|
-
|
|
3727
|
+
children: /* @__PURE__ */ jsx(TruncatedText, { children: field.label })
|
|
3728
|
+
}), showOperatorSelector ? /* @__PURE__ */ jsx(OperatorMenu, {
|
|
3729
|
+
trigger: /* @__PURE__ */ jsxs(InlineOperatorTrigger, {
|
|
3730
|
+
type: "button",
|
|
3731
|
+
"aria-label": strings.operator,
|
|
3732
|
+
$size: resolvedSize,
|
|
3733
|
+
children: [getOperatorLabel(operator, field.type, strings, field), /* @__PURE__ */ jsx(CaretIcon, { "aria-hidden": "true" })]
|
|
3734
|
+
}),
|
|
3735
|
+
align: "start",
|
|
3736
|
+
portal: true,
|
|
3737
|
+
zIndex: Z_INDICES.layeredDropdown,
|
|
3738
|
+
children: operatorOptions.map((op) => /* @__PURE__ */ jsx(DropdownMenu_default.Item, {
|
|
3739
|
+
size: resolvedSize,
|
|
3740
|
+
onClick: () => onChangeOperator(op),
|
|
3741
|
+
children: getOperatorLabel(op, field.type, strings, field)
|
|
3742
|
+
}, op))
|
|
3743
|
+
}) : /* @__PURE__ */ jsx("span", { children: getOperatorLabel(operator, field.type, strings, field) })]
|
|
3744
|
+
}),
|
|
3745
|
+
!valueless ? /* @__PURE__ */ jsx(ValueSlot, {
|
|
3746
|
+
ref: valueSlotRef,
|
|
3747
|
+
children: valueControlSlot
|
|
3748
|
+
}) : null,
|
|
3749
|
+
onApply != null && /* @__PURE__ */ jsx(PopoverPrimitive.Close, {
|
|
3750
|
+
asChild: true,
|
|
3751
|
+
children: /* @__PURE__ */ jsx(Button, {
|
|
3752
|
+
ref: applyButtonRef,
|
|
3343
3753
|
size: resolvedSize,
|
|
3344
|
-
onClick:
|
|
3345
|
-
children:
|
|
3346
|
-
}
|
|
3347
|
-
})
|
|
3348
|
-
|
|
3349
|
-
ref: valueSlotRef,
|
|
3350
|
-
children: valueControlSlot
|
|
3351
|
-
}) : null]
|
|
3754
|
+
onClick: onApply,
|
|
3755
|
+
children: strings.applyFilter
|
|
3756
|
+
})
|
|
3757
|
+
})
|
|
3758
|
+
]
|
|
3352
3759
|
}), field.source === "custom" && field.parentRecordType != null && /* @__PURE__ */ jsxs(Footer, { children: [/* @__PURE__ */ jsx(InfoIcon, { "aria-hidden": "true" }), /* @__PURE__ */ jsxs(TruncatedText, { children: [
|
|
3353
3760
|
field.label,
|
|
3354
3761
|
" is a field on ",
|
|
@@ -3416,11 +3823,12 @@ const CountChip = styled.span`
|
|
|
3416
3823
|
*/
|
|
3417
3824
|
const RulesPill = forwardRef(function RulesPill({ compound, enabled, onClick, isOpen = false, "aria-label": ariaLabel, "data-test": dataTest, size, ...rest }, ref) {
|
|
3418
3825
|
const resolvedSize = useFilterBarSize(size);
|
|
3826
|
+
const strings = usePDSStrings();
|
|
3419
3827
|
if (!enabled) return null;
|
|
3420
3828
|
const count = countRules(compound);
|
|
3421
3829
|
const hasCount = count > 0;
|
|
3422
3830
|
const variant = isOpen ? "active" : "default";
|
|
3423
|
-
const accessibleName = hasCount ?
|
|
3831
|
+
const accessibleName = hasCount ? strings.rulesWithCount(count) : strings.rules;
|
|
3424
3832
|
return /* @__PURE__ */ jsxs(PillShell, {
|
|
3425
3833
|
ref,
|
|
3426
3834
|
variant,
|
|
@@ -3430,7 +3838,7 @@ const RulesPill = forwardRef(function RulesPill({ compound, enabled, onClick, is
|
|
|
3430
3838
|
"data-test": dataTest ?? "rules-pill__trigger",
|
|
3431
3839
|
"aria-expanded": isOpen,
|
|
3432
3840
|
...rest,
|
|
3433
|
-
children: [/* @__PURE__ */ jsx(Label, { children:
|
|
3841
|
+
children: [/* @__PURE__ */ jsx(Label, { children: strings.rules }), hasCount && /* @__PURE__ */ jsx(CountChip, {
|
|
3434
3842
|
$variant: variant,
|
|
3435
3843
|
$size: resolvedSize,
|
|
3436
3844
|
"data-test": "rules-pill__count",
|
|
@@ -3465,6 +3873,10 @@ function isEmptyState(state) {
|
|
|
3465
3873
|
const OPERATOR_SET = new Set([
|
|
3466
3874
|
"is",
|
|
3467
3875
|
"is_not",
|
|
3876
|
+
"gt",
|
|
3877
|
+
"gte",
|
|
3878
|
+
"lt",
|
|
3879
|
+
"lte",
|
|
3468
3880
|
"contains",
|
|
3469
3881
|
"does_not_contain",
|
|
3470
3882
|
"is_empty",
|
|
@@ -3503,7 +3915,7 @@ function isFilterRule(value) {
|
|
|
3503
3915
|
if (typeof value !== "object" || value == null) return false;
|
|
3504
3916
|
const v = value;
|
|
3505
3917
|
if (typeof v.fieldId !== "string" || v.fieldId.length === 0) return false;
|
|
3506
|
-
if (typeof v.operator !== "string" || !OPERATOR_SET.has(v.operator)) return false;
|
|
3918
|
+
if (typeof v.operator !== "string" || !OPERATOR_SET.has(v.operator) && !/^custom:.+/.test(v.operator)) return false;
|
|
3507
3919
|
if (!isFilterRuleValue(v.value)) return false;
|
|
3508
3920
|
return true;
|
|
3509
3921
|
}
|
|
@@ -3579,7 +3991,7 @@ function pruneToRegistry(state, registry) {
|
|
|
3579
3991
|
*/
|
|
3580
3992
|
function coerceBooleanRule(rule, registry) {
|
|
3581
3993
|
const field = registry.get(rule.fieldId);
|
|
3582
|
-
if (!field || field.type !== "boolean") return rule;
|
|
3994
|
+
if (!field || field.condition != null || field.type !== "boolean") return rule;
|
|
3583
3995
|
if (rule.operator === "is_true") return {
|
|
3584
3996
|
...rule,
|
|
3585
3997
|
operator: "is",
|
|
@@ -3609,9 +4021,16 @@ function coerceBooleanRules(state, registry) {
|
|
|
3609
4021
|
};
|
|
3610
4022
|
}
|
|
3611
4023
|
function isDraftRuleValue(rule, registry) {
|
|
3612
|
-
if (isValuelessOperator(rule.operator)) return false;
|
|
3613
4024
|
const field = registry.get(rule.fieldId);
|
|
3614
4025
|
if (!field) return false;
|
|
4026
|
+
const config = getConditionOperator(field, rule.operator);
|
|
4027
|
+
if (config != null) switch (config.valueType) {
|
|
4028
|
+
case "none":
|
|
4029
|
+
case "boolean": return false;
|
|
4030
|
+
case "string_array": return Array.isArray(rule.value) && rule.value.length === 0;
|
|
4031
|
+
default: return rule.value === "" || rule.value == null;
|
|
4032
|
+
}
|
|
4033
|
+
if (isValuelessOperator(rule.operator)) return false;
|
|
3615
4034
|
if (isRangeOperator(rule.operator)) return !isCompleteDateRange(rule.value);
|
|
3616
4035
|
switch (field.type) {
|
|
3617
4036
|
case "multi_choices":
|
|
@@ -3624,8 +4043,10 @@ function isDraftRuleValue(rule, registry) {
|
|
|
3624
4043
|
}
|
|
3625
4044
|
}
|
|
3626
4045
|
function isRuleAllowed(rule, registry, options = { allowDraftValues: false }) {
|
|
3627
|
-
|
|
4046
|
+
const field = registry.get(rule.fieldId);
|
|
4047
|
+
if (field == null) return false;
|
|
3628
4048
|
if (!registry.operatorsFor(rule.fieldId).includes(rule.operator)) return false;
|
|
4049
|
+
if (field.condition != null) return hasCompleteConditionValue(rule, field) || options.allowDraftValues && isDraftRuleValue(rule, registry);
|
|
3629
4050
|
if (isValuelessOperator(rule.operator)) return rule.value == null;
|
|
3630
4051
|
if (options.allowDraftValues && isDraftRuleValue(rule, registry)) return true;
|
|
3631
4052
|
if (isRangeOperator(rule.operator)) return isCompleteDateRange(rule.value);
|
|
@@ -3652,6 +4073,8 @@ function isRuleAllowed(rule, registry, options = { allowDraftValues: false }) {
|
|
|
3652
4073
|
* does not gate operator vocabulary or registry membership.
|
|
3653
4074
|
*/
|
|
3654
4075
|
function hasCompleteValue(rule, registry) {
|
|
4076
|
+
const field = registry.get(rule.fieldId);
|
|
4077
|
+
if (field?.condition != null) return hasCompleteConditionValue(rule, field);
|
|
3655
4078
|
if (isValuelessOperator(rule.operator)) return rule.value == null;
|
|
3656
4079
|
const { value } = rule;
|
|
3657
4080
|
if (value == null) return false;
|
|
@@ -3755,20 +4178,22 @@ function useFilterStateV2(options) {
|
|
|
3755
4178
|
...prev.all,
|
|
3756
4179
|
topLevelRules: [...prev.all.topLevelRules, added]
|
|
3757
4180
|
},
|
|
3758
|
-
heldIds: isHeldRule(added) ? withId(prev.heldIds, id) : prev.heldIds
|
|
4181
|
+
heldIds: registry.get(rule.fieldId)?.condition != null || isHeldRule(added, registry) ? withId(prev.heldIds, id) : prev.heldIds
|
|
3759
4182
|
}));
|
|
3760
4183
|
return id;
|
|
3761
|
-
}, []),
|
|
3762
|
-
updateTopLevelRule: useCallback((id,
|
|
4184
|
+
}, [registry]),
|
|
4185
|
+
updateTopLevelRule: useCallback((id, update) => {
|
|
3763
4186
|
setInternal((prev) => {
|
|
3764
4187
|
const idx = prev.all.topLevelRules.findIndex((r) => r.id === id);
|
|
3765
|
-
|
|
4188
|
+
const currentRule = prev.all.topLevelRules[idx];
|
|
4189
|
+
if (currentRule == null) return prev;
|
|
4190
|
+
const rule = typeof update === "function" ? update(currentRule) : update;
|
|
3766
4191
|
const topLevelRules = [...prev.all.topLevelRules];
|
|
3767
4192
|
topLevelRules[idx] = {
|
|
3768
4193
|
...rule,
|
|
3769
4194
|
id
|
|
3770
4195
|
};
|
|
3771
|
-
const heldIds = isHeldRule(rule) ? withId(prev.heldIds, id) : withoutId(prev.heldIds, id);
|
|
4196
|
+
const heldIds = isHeldRule(rule, registry) ? withId(prev.heldIds, id) : withoutId(prev.heldIds, id);
|
|
3772
4197
|
return {
|
|
3773
4198
|
all: {
|
|
3774
4199
|
...prev.all,
|
|
@@ -3777,7 +4202,7 @@ function useFilterStateV2(options) {
|
|
|
3777
4202
|
heldIds
|
|
3778
4203
|
};
|
|
3779
4204
|
});
|
|
3780
|
-
}, []),
|
|
4205
|
+
}, [registry]),
|
|
3781
4206
|
removeTopLevelRule: useCallback((id) => {
|
|
3782
4207
|
setInternal((prev) => {
|
|
3783
4208
|
const topLevelRules = prev.all.topLevelRules.filter((r) => r.id !== id);
|
|
@@ -3798,7 +4223,8 @@ function useFilterStateV2(options) {
|
|
|
3798
4223
|
* `''` and `[]` are values a user can choose, and a filter cleared to one is
|
|
3799
4224
|
* still a filter.
|
|
3800
4225
|
*/
|
|
3801
|
-
function isHeldRule(rule) {
|
|
4226
|
+
function isHeldRule(rule, registry) {
|
|
4227
|
+
if (registry.get(rule.fieldId)?.condition != null) return !hasCompleteValue(rule, registry);
|
|
3802
4228
|
return !isValuelessOperator(rule.operator) && rule.value == null;
|
|
3803
4229
|
}
|
|
3804
4230
|
function heldRulesOf(state) {
|
|
@@ -3978,6 +4404,7 @@ function useStableFieldIds(fieldIds) {
|
|
|
3978
4404
|
return stable.current;
|
|
3979
4405
|
}
|
|
3980
4406
|
function FilterBar({ registry, initialState, onChange, advancedRulesEnabled = true, relativeDatesEnabled = false, dateTimesEnabled = false, singleUseFields = false, size = "md", valueControlResolver }) {
|
|
4407
|
+
const strings = usePDSStrings();
|
|
3981
4408
|
const filterState = useFilterStateV2({
|
|
3982
4409
|
registry,
|
|
3983
4410
|
initialState,
|
|
@@ -3991,6 +4418,7 @@ function FilterBar({ registry, initialState, onChange, advancedRulesEnabled = tr
|
|
|
3991
4418
|
onChangeRef.current = onChange;
|
|
3992
4419
|
}, [onChange]);
|
|
3993
4420
|
const { committedState } = filterState;
|
|
4421
|
+
const committedRuleIds = useMemo(() => new Set(committedState.topLevelRules.map((rule) => rule.id)), [committedState.topLevelRules]);
|
|
3994
4422
|
const lastReportedState = useRef(committedState);
|
|
3995
4423
|
useEffect(() => {
|
|
3996
4424
|
if (isEqual(lastReportedState.current, committedState)) return;
|
|
@@ -3999,13 +4427,15 @@ function FilterBar({ registry, initialState, onChange, advancedRulesEnabled = tr
|
|
|
3999
4427
|
}, [committedState]);
|
|
4000
4428
|
const pendingEditRuleIdRef = useRef(null);
|
|
4001
4429
|
const openedViaScrollIntoViewRef = useRef(false);
|
|
4002
|
-
const
|
|
4003
|
-
|
|
4430
|
+
const { addTopLevelRule } = filterState;
|
|
4431
|
+
const handlePickField = useCallback((field) => {
|
|
4432
|
+
const operator = registry.defaultOperatorFor(field.id);
|
|
4433
|
+
pendingEditRuleIdRef.current = addTopLevelRule({
|
|
4004
4434
|
fieldId: field.id,
|
|
4005
|
-
operator
|
|
4006
|
-
value: null
|
|
4435
|
+
operator,
|
|
4436
|
+
value: field.condition != null ? emptyValueForRule(field, operator) : null
|
|
4007
4437
|
});
|
|
4008
|
-
};
|
|
4438
|
+
}, [addTopLevelRule, registry]);
|
|
4009
4439
|
const hasPills = filterState.state.topLevelRules.length > 0;
|
|
4010
4440
|
const excludeFieldIds = useStableFieldIds(singleUseFields ? filterState.state.topLevelRules.map((rule) => rule.fieldId) : void 0);
|
|
4011
4441
|
const pillsScrollRef = useRef(null);
|
|
@@ -4083,7 +4513,7 @@ function FilterBar({ registry, initialState, onChange, advancedRulesEnabled = tr
|
|
|
4083
4513
|
value: { size },
|
|
4084
4514
|
children: /* @__PURE__ */ jsxs(Bar, {
|
|
4085
4515
|
role: "toolbar",
|
|
4086
|
-
"aria-label":
|
|
4516
|
+
"aria-label": strings.filterBar,
|
|
4087
4517
|
children: [filterState.advancedRulesEnabled ? /* @__PURE__ */ jsx(AdvancedFilterRulesPopover, {
|
|
4088
4518
|
registry,
|
|
4089
4519
|
dateTimesEnabled,
|
|
@@ -4153,6 +4583,7 @@ function FilterBar({ registry, initialState, onChange, advancedRulesEnabled = tr
|
|
|
4153
4583
|
dateTimesEnabled
|
|
4154
4584
|
}, valueControlResolver),
|
|
4155
4585
|
onClose: () => setEditingRuleId(null),
|
|
4586
|
+
onApply: field.condition != null && !committedRuleIds.has(rule.id) && hasCompleteValue(rule, registry) ? () => filterState.updateTopLevelRule(rule.id, (currentRule) => currentRule) : void 0,
|
|
4156
4587
|
open: isOpen,
|
|
4157
4588
|
onOpenChange: (open) => setEditingRuleId(open ? rule.id : null),
|
|
4158
4589
|
trigger: /* @__PURE__ */ jsx(FilterPill, {
|
|
@@ -4161,7 +4592,7 @@ function FilterBar({ registry, initialState, onChange, advancedRulesEnabled = tr
|
|
|
4161
4592
|
else pillNodesRef.current.delete(rule.id);
|
|
4162
4593
|
},
|
|
4163
4594
|
field,
|
|
4164
|
-
rule,
|
|
4595
|
+
rule: field.condition != null && !committedRuleIds.has(rule.id) ? null : rule,
|
|
4165
4596
|
variant: isOpen ? "active" : "default",
|
|
4166
4597
|
optionLabels,
|
|
4167
4598
|
onDismiss: () => filterState.removeTopLevelRule(rule.id)
|
|
@@ -4327,7 +4758,10 @@ var FieldRegistry = class {
|
|
|
4327
4758
|
}
|
|
4328
4759
|
/** Default operator for a registered field. Used when creating a new pill. */
|
|
4329
4760
|
defaultOperatorFor(fieldId) {
|
|
4330
|
-
const
|
|
4761
|
+
const field = this.getOrThrow(fieldId);
|
|
4762
|
+
const operators = getOperatorsForField(field);
|
|
4763
|
+
const defaultOperator = field.condition?.defaultOperator ?? operators[0];
|
|
4764
|
+
if (defaultOperator != null && !operators.includes(defaultOperator)) throw new Error(`FieldRegistry: default operator is not available for field "${fieldId}"`);
|
|
4331
4765
|
if (defaultOperator == null) throw new Error(`FieldRegistry: no operators available for field "${fieldId}"`);
|
|
4332
4766
|
return defaultOperator;
|
|
4333
4767
|
}
|
|
@@ -4498,4 +4932,4 @@ function decodeBase64(input) {
|
|
|
4498
4932
|
//#endregion
|
|
4499
4933
|
export { TableControlsProvider as A, getOperatorsForType as C, reconcileValueForOperator as D, isValuelessOperator as E, ControlBar as F, DataTableCompactBar as I, TableViewConfiguration as M, TableViewConfigurationDropdown as N, dateRuleIntent as O, TableControls as P, getOperatorsForField as S, isRangeOperator as T, FILTER_SIZE_TOKENS as _, encodeFilterStateToUrlParam as a, emptyValueForRule as b, FilterBar_default as c, isFilterStateV2 as d, pruneToRegistry as f, resolveValueControl as g, PillShell as h, decodeFilterStateFromUrl as i, useTableControls as j, TableControlsContext as k, useFilterStateV2 as l, isEmptyState as m, applyFilterStateToSearchParams as n, FieldRegistry as o, EMPTY_FILTER_STATE as p, decodeFilterStateFromString as r, buildFieldRegistry as s, FILTER_STATE_URL_PARAM as t, hasCompleteValue as u, useFilterBarSize as v, isCompleteDateRange as w, getDefaultOperatorForType as x, resolveDateRangeRuleValue as y };
|
|
4500
4934
|
|
|
4501
|
-
//# sourceMappingURL=TableControls-
|
|
4935
|
+
//# sourceMappingURL=TableControls-BtKBTGYR.mjs.map
|