@geotab/zenith 3.16.0-beta.1 → 3.16.0-beta.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +17 -10
- package/dist/absolute/absolute.js +1 -1
- package/dist/advancedGroupsFilter/advancedGroupsFilter.js +3 -3
- package/dist/advancedGroupsFilter/advancedGroupsFilterForm.js +2 -2
- package/dist/advancedGroupsFilter/advancedGroupsFilterFormSection.js +7 -7
- package/dist/advancedGroupsFilter/advancedGroupsFilterSectionTooltip.js +1 -1
- package/dist/alertRaw/alertRaw.js +1 -1
- package/dist/banner/bannerMultipLine.js +1 -1
- package/dist/banner/bannerSingleLine.js +1 -1
- package/dist/banner/utils/useSummaryBannerProp.js +1 -1
- package/dist/betaPill/betaPill.js +4 -4
- package/dist/bookmark/bookmark.js +2 -2
- package/dist/bulkEditControl/bulkEditControl.js +5 -5
- package/dist/calendar/calendar.js +30 -30
- package/dist/calendar/calendarUtils.js +6 -6
- package/dist/card/card.js +1 -1
- package/dist/chart/accessibleChart/accessibleChartNarrative.js +13 -13
- package/dist/chart/accessibleChart/accessibleChartTable.js +5 -5
- package/dist/chart/accessibleChart/generatePieNarrative.js +6 -6
- package/dist/chart/barChart.js +1 -1
- package/dist/chart/chart.js +1 -1
- package/dist/chart/chartAxis/chartAxis.js +2 -2
- package/dist/chart/lineChart.js +1 -1
- package/dist/chart/pieChart.js +1 -1
- package/dist/chart/plugins/linePlugin/getInterpolatedValue.d.ts +2 -2
- package/dist/chart/plugins/linePlugin/getInterpolatedValue.js +3 -2
- package/dist/chart/plugins/linePlugin/linePlugin.js +2 -1
- package/dist/chart/utils/getFormattedLabel.js +5 -1
- package/dist/checkbox/checkbox.d.ts +2 -1
- package/dist/checkbox/checkbox.js +2 -2
- package/dist/checkboxListWithAction/checkboxListWithAction.js +5 -4
- package/dist/chip/chip.js +1 -1
- package/dist/columnsSelector/columnsSelector.js +2 -2
- package/dist/columnsSelector/columnsTab/columnsTab.js +1 -1
- package/dist/columnsSelector/columnsTabGroup/columnsTabGroup.js +1 -1
- package/dist/commonHelpers/hooks/useTrapFocus.d.ts +0 -9
- package/dist/commonHelpers/hooks/useTrapFocus.js +14 -66
- package/dist/controlledPopup/controlledPopup.d.ts +1 -1
- package/dist/controlledPopup/controlledPopup.js +17 -3
- package/dist/dataFeed/feedExpandControl/feedExpandControl.js +2 -2
- package/dist/dataGrid/columns/checkboxColumn/checkboxCell.d.ts +2 -1
- package/dist/dataGrid/columns/checkboxColumn/checkboxCell.js +1 -1
- package/dist/dataGrid/columns/checkboxColumn/checkboxColumnWrapper.d.ts +4 -2
- package/dist/dataGrid/columns/checkboxColumn/checkboxColumnWrapper.js +10 -1
- package/dist/dataGrid/columns/checkboxColumn/checkboxHeaderCell.js +1 -1
- package/dist/dataGrid/dataGrid.js +1 -1
- package/dist/dataGrid/emptySearchList/emptySearchList.js +1 -1
- package/dist/dataGrid/entitiesListActions/actions/columnsListButton.js +1 -1
- package/dist/dataGrid/entitiesListActions/actions/fullscreenButton.js +2 -2
- package/dist/dataGrid/row/row.js +3 -2
- package/dist/dataGrid/withFlexibleColumns/components/columnSettings.js +2 -2
- package/dist/dataGrid/withFlexibleColumns/components/columnSettingsSidePanel.js +1 -1
- package/dist/dataGrid/withFlexibleColumns/withFlexibleColumns.js +1 -1
- package/dist/dataGrid/withSelectableRows/components/bulkActions/bulkActions.js +5 -5
- package/dist/dataGrid/withSelectableRows/withSelectableRows.js +77 -16
- package/dist/dataGrid/withSortableColumns/columns/sortableColumnWrapper.js +2 -2
- package/dist/dateInputInner/dateInputInner.js +7 -7
- package/dist/dateInputInner/dateInputInnerControlBlock.js +2 -2
- package/dist/dateInputRaw/dateInputRaw.js +3 -3
- package/dist/dateInputRaw/utils/getLabel.js +2 -2
- package/dist/dateRangeInner/dateRangeInner.js +1 -1
- package/dist/dateRangeRaw/dateRangeRaw.js +10 -10
- package/dist/dateRangeRaw/utils/dateRangeUtils.js +17 -17
- package/dist/dateSelectionWrapper/dateSelectionWrapper.js +4 -4
- package/dist/dialog/dialogContent.js +1 -1
- package/dist/dropdown/dropdownTrigger.d.ts +1 -1
- package/dist/dropdownRaw/dropdownList.js +9 -9
- package/dist/dropdownRaw/dropdownPopup.js +3 -3
- package/dist/dropdownRaw/dropdownRaw.js +249 -3
- package/dist/dropdownRaw/dropdownSearchableTrigger.d.ts +2 -1
- package/dist/dropdownRaw/dropdownSearchableTrigger.js +8 -6
- package/dist/dropdownRaw/dropdownTrigger.d.ts +2 -1
- package/dist/dropdownRaw/dropdownTrigger.js +2 -2
- package/dist/dropdownRaw/types.d.ts +7 -0
- package/dist/favoriteButton/favoriteButton.js +1 -1
- package/dist/fileUpload/components/dropZoneContent.js +4 -4
- package/dist/fileUpload/components/templateDownloadSection.js +1 -1
- package/dist/fileUpload/components/uploadedFilesSection.js +2 -2
- package/dist/fileUpload/fileUpload.js +6 -6
- package/dist/filters/components/filtersContainer.js +3 -3
- package/dist/filters/components/filtersEmptyState.js +2 -2
- package/dist/filters/components/filtersSaveModal.js +5 -5
- package/dist/filters/components/filtersSavedChipComponent.js +11 -11
- package/dist/filters/components/filtersSearchItemData.js +1 -1
- package/dist/filters/components/filtersSearchList.js +9 -9
- package/dist/filters/components/filtersSelect.js +1 -1
- package/dist/filters/components/filtersSelectListItem.js +2 -2
- package/dist/filters/components/filtersSidePanel.js +8 -8
- package/dist/filters/filters.js +4 -3
- package/dist/filtersBar/components/filtersBarPeriodPicker/getRangeOption.js +18 -18
- package/dist/filtersBar/components/resetComponentButton.js +1 -1
- package/dist/filtersBar/filtersBarActions/filtersBarActions.js +4 -4
- package/dist/filtersBar/filtersBarSidePanel/components/filtersBarSidePanelRange/filtersBarSidePanelRange.js +2 -2
- package/dist/filtersBar/filtersBarSidePanel/filtersBarSidePanel.js +5 -5
- package/dist/filtersBar/filtersContainer/filtersContainer.js +2 -2
- package/dist/formField/hooks/useError.js +3 -3
- package/dist/formGroup/components/reviewListToggle/reviewListToggle.js +2 -2
- package/dist/formGroup/hooks/useToggle.js +1 -1
- package/dist/formLayout/hooks/useError.js +3 -3
- package/dist/formLayout/hooks/useFormButtons.js +3 -3
- package/dist/formSection/hooks/useError.js +3 -3
- package/dist/formStepper/components/formStep.js +1 -1
- package/dist/formStepper/formStepper.js +2 -2
- package/dist/formStepperButtons/formStepperButtons.js +4 -4
- package/dist/groupsFilterRaw/groupsFilterAdjustmentState.js +4 -4
- package/dist/groupsFilterRaw/groupsFilterBox.js +3 -3
- package/dist/groupsFilterRaw/groupsFilterCommon.js +2 -2
- package/dist/groupsFilterRaw/groupsFilterCurrentlySelectedState.js +5 -5
- package/dist/groupsFilterRaw/groupsFilterHelper.js +2 -2
- package/dist/groupsFilterRaw/groupsFilterInitialState.js +8 -8
- package/dist/groupsFilterRaw/groupsFilterMenu.js +3 -3
- package/dist/groupsFilterRaw/groupsFilterRaw.js +8 -8
- package/dist/groupsFilterRaw/groupsFilterTrigger.js +2 -2
- package/dist/groupsFilterRaw/groupsHelper.js +22 -22
- package/dist/header/components/collapsedItemsControl/collapsedItemsControl.js +1 -1
- package/dist/header/components/mobileFilterControl/mobileFilterControl.js +1 -1
- package/dist/header/components/mobileSearchControl/mobileSearchControl.js +3 -3
- package/dist/header/headerBack.js +1 -1
- package/dist/index.css +90 -84
- package/dist/index.d.ts +3 -0
- package/dist/index.js +8 -3
- package/dist/lineChart/lineChart.js +1 -1
- package/dist/lineChartMini/lineChartMini.js +1 -1
- package/dist/list/itemData/itemDataInternal.js +2 -2
- package/dist/list/listItem/listItem.js +2 -2
- package/dist/menu/components/menuErrorItem.js +2 -2
- package/dist/mobileSheet/mobileSheet.js +2 -2
- package/dist/modal/modal.js +1 -1
- package/dist/nav/navFooter/navEditFooter/navEditFooter.js +2 -2
- package/dist/nav/navFooter/navFooter.js +1 -1
- package/dist/nav/navFooter/navFooterAction/navFooterAction.js +1 -1
- package/dist/nav/navHeader/navHeader.js +2 -2
- package/dist/nav/navHeader/navHeaderSearch/navHeaderSearch.js +2 -2
- package/dist/nav/navMobileBar/navMobileBar.js +1 -1
- package/dist/notification/notification.js +1 -1
- package/dist/pagination/paginationArrow.js +2 -2
- package/dist/pagination/paginationText/paginationText.js +1 -1
- package/dist/pill/components/pillNonActionable/pillNonActionable.js +1 -1
- package/dist/pillBox/components/pillBoxItem.js +1 -1
- package/dist/pillBox/pillBox.js +3 -3
- package/dist/pillExpandable/pillExpandable.js +1 -1
- package/dist/pillExpandable/pillExpandableAlignments.js +65 -48
- package/dist/progressIndicator/progressIndicator.d.ts +4 -4
- package/dist/progressIndicator/progressIndicator.js +4 -4
- package/dist/rangeRaw/rangeRaw.js +7 -7
- package/dist/rangeRaw/utils/rangeHelper.js +7 -7
- package/dist/searchInputRaw/searchInputRaw.js +2 -2
- package/dist/selectList/selectList.js +2 -2
- package/dist/skeleton/skeleton.js +1 -1
- package/dist/sortControl/sortControl.js +5 -5
- package/dist/stepperRaw/stepperRaw.js +2 -2
- package/dist/summary/summary.js +2 -2
- package/dist/summaryTile/summaryTile.js +1 -1
- package/dist/table/actions/actionsMenu.js +2 -2
- package/dist/table/detailPanel/detailPanel.js +1 -1
- package/dist/table/detailPanel/detailPanelHeader.js +2 -2
- package/dist/table/flexible/columnSettings.js +2 -2
- package/dist/table/flexible/columnsPopup.js +1 -1
- package/dist/table/nested/useNestedRows.js +2 -2
- package/dist/table/selectable/interfaces.d.ts +9 -13
- package/dist/table/selectable/selectableHeader.js +5 -5
- package/dist/table/selectable/useDragSelection.d.ts +10 -0
- package/dist/table/selectable/useDragSelection.js +139 -0
- package/dist/table/selectable/useSelectableRows.d.ts +2 -2
- package/dist/table/selectable/useSelectableRows.js +61 -51
- package/dist/table/selectable/utils/calculateSelectionState.js +0 -35
- package/dist/table/selectable/utils/getDragSelectionRows.d.ts +15 -0
- package/dist/table/selectable/utils/getDragSelectionRows.js +28 -0
- package/dist/table/selectable/utils/getRangeIds.d.ts +2 -0
- package/dist/table/selectable/utils/getRangeIds.js +21 -0
- package/dist/table/selectable/utils/isRowChecked.js +1 -12
- package/dist/table/sortable/mobileSortControl.js +3 -3
- package/dist/table/sortable/sortableHeader.js +2 -2
- package/dist/table/table.d.ts +4 -0
- package/dist/table/table.js +11 -7
- package/dist/tabs/tabs.js +2 -2
- package/dist/tag/tag.d.ts +3 -2
- package/dist/tag/tag.js +3 -2
- package/dist/timePickerRaw/timePickerRaw.js +7 -7
- package/dist/toastRaw/toastRaw.js +1 -1
- package/dist/toggleButtonRaw/toggleButtonRaw.js +2 -2
- package/dist/tooltip/tooltip.js +5 -2
- package/dist/utils/formatDate.js +37 -37
- package/dist/utils/localization/flipAlignment.js +5 -1
- package/dist/utils/localization/getSupportedLanguage.d.ts +1 -1
- package/dist/utils/localization/getSupportedLanguage.js +8 -2
- package/dist/utils/localization/getTextDirection.js +1 -1
- package/dist/utils/localization/languageContext.d.ts +1 -1
- package/dist/utils/localization/translations/{ar.json → ar-001.json} +54 -53
- package/dist/utils/localization/translationsDictionary.js +1 -1
- package/dist/utils/localization/useRTLAlignment.d.ts +6 -0
- package/dist/utils/localization/useRTLAlignment.js +6 -0
- package/esm/absolute/absolute.js +1 -1
- package/esm/advancedGroupsFilter/advancedGroupsFilter.js +3 -3
- package/esm/advancedGroupsFilter/advancedGroupsFilterForm.js +2 -2
- package/esm/advancedGroupsFilter/advancedGroupsFilterFormSection.js +7 -7
- package/esm/advancedGroupsFilter/advancedGroupsFilterSectionTooltip.js +1 -1
- package/esm/alertRaw/alertRaw.js +1 -1
- package/esm/banner/bannerMultipLine.js +1 -1
- package/esm/banner/bannerSingleLine.js +1 -1
- package/esm/banner/utils/useSummaryBannerProp.js +1 -1
- package/esm/betaPill/betaPill.js +4 -4
- package/esm/bookmark/bookmark.js +2 -2
- package/esm/bulkEditControl/bulkEditControl.js +5 -5
- package/esm/calendar/calendar.js +30 -30
- package/esm/calendar/calendarUtils.js +6 -6
- package/esm/card/card.js +1 -1
- package/esm/chart/accessibleChart/accessibleChartNarrative.js +13 -13
- package/esm/chart/accessibleChart/accessibleChartTable.js +5 -5
- package/esm/chart/accessibleChart/generatePieNarrative.js +6 -6
- package/esm/chart/barChart.js +1 -1
- package/esm/chart/chart.js +1 -1
- package/esm/chart/chartAxis/chartAxis.js +2 -2
- package/esm/chart/lineChart.js +1 -1
- package/esm/chart/pieChart.js +1 -1
- package/esm/chart/plugins/linePlugin/getInterpolatedValue.d.ts +2 -2
- package/esm/chart/plugins/linePlugin/getInterpolatedValue.js +3 -2
- package/esm/chart/plugins/linePlugin/linePlugin.js +2 -1
- package/esm/chart/utils/getFormattedLabel.js +5 -1
- package/esm/checkbox/checkbox.d.ts +2 -1
- package/esm/checkbox/checkbox.js +2 -2
- package/esm/checkboxListWithAction/checkboxListWithAction.js +5 -4
- package/esm/chip/chip.js +1 -1
- package/esm/columnsSelector/columnsSelector.js +2 -2
- package/esm/columnsSelector/columnsTab/columnsTab.js +1 -1
- package/esm/columnsSelector/columnsTabGroup/columnsTabGroup.js +1 -1
- package/esm/commonHelpers/hooks/useTrapFocus.d.ts +0 -9
- package/esm/commonHelpers/hooks/useTrapFocus.js +15 -67
- package/esm/controlledPopup/controlledPopup.d.ts +1 -1
- package/esm/controlledPopup/controlledPopup.js +17 -3
- package/esm/dataFeed/feedExpandControl/feedExpandControl.js +2 -2
- package/esm/dataGrid/columns/checkboxColumn/checkboxCell.d.ts +2 -1
- package/esm/dataGrid/columns/checkboxColumn/checkboxCell.js +1 -1
- package/esm/dataGrid/columns/checkboxColumn/checkboxColumnWrapper.d.ts +4 -2
- package/esm/dataGrid/columns/checkboxColumn/checkboxColumnWrapper.js +10 -1
- package/esm/dataGrid/columns/checkboxColumn/checkboxHeaderCell.js +1 -1
- package/esm/dataGrid/dataGrid.js +1 -1
- package/esm/dataGrid/emptySearchList/emptySearchList.js +1 -1
- package/esm/dataGrid/entitiesListActions/actions/columnsListButton.js +1 -1
- package/esm/dataGrid/entitiesListActions/actions/fullscreenButton.js +2 -2
- package/esm/dataGrid/row/row.js +3 -2
- package/esm/dataGrid/withFlexibleColumns/components/columnSettings.js +2 -2
- package/esm/dataGrid/withFlexibleColumns/components/columnSettingsSidePanel.js +1 -1
- package/esm/dataGrid/withFlexibleColumns/withFlexibleColumns.js +1 -1
- package/esm/dataGrid/withSelectableRows/components/bulkActions/bulkActions.js +5 -5
- package/esm/dataGrid/withSelectableRows/withSelectableRows.js +77 -16
- package/esm/dataGrid/withSortableColumns/columns/sortableColumnWrapper.js +2 -2
- package/esm/dateInputInner/dateInputInner.js +7 -7
- package/esm/dateInputInner/dateInputInnerControlBlock.js +2 -2
- package/esm/dateInputRaw/dateInputRaw.js +3 -3
- package/esm/dateInputRaw/utils/getLabel.js +2 -2
- package/esm/dateRangeInner/dateRangeInner.js +1 -1
- package/esm/dateRangeRaw/dateRangeRaw.js +10 -10
- package/esm/dateRangeRaw/utils/dateRangeUtils.js +17 -17
- package/esm/dateSelectionWrapper/dateSelectionWrapper.js +4 -4
- package/esm/dialog/dialogContent.js +1 -1
- package/esm/dropdown/dropdownTrigger.d.ts +1 -1
- package/esm/dropdownRaw/dropdownList.js +9 -9
- package/esm/dropdownRaw/dropdownPopup.js +3 -3
- package/esm/dropdownRaw/dropdownRaw.js +249 -3
- package/esm/dropdownRaw/dropdownSearchableTrigger.d.ts +2 -1
- package/esm/dropdownRaw/dropdownSearchableTrigger.js +8 -6
- package/esm/dropdownRaw/dropdownTrigger.d.ts +2 -1
- package/esm/dropdownRaw/dropdownTrigger.js +2 -2
- package/esm/dropdownRaw/types.d.ts +7 -0
- package/esm/favoriteButton/favoriteButton.js +1 -1
- package/esm/fileUpload/components/dropZoneContent.js +4 -4
- package/esm/fileUpload/components/templateDownloadSection.js +1 -1
- package/esm/fileUpload/components/uploadedFilesSection.js +2 -2
- package/esm/fileUpload/fileUpload.js +6 -6
- package/esm/filters/components/filtersContainer.js +3 -3
- package/esm/filters/components/filtersEmptyState.js +2 -2
- package/esm/filters/components/filtersSaveModal.js +5 -5
- package/esm/filters/components/filtersSavedChipComponent.js +11 -11
- package/esm/filters/components/filtersSearchItemData.js +1 -1
- package/esm/filters/components/filtersSearchList.js +9 -9
- package/esm/filters/components/filtersSelect.js +1 -1
- package/esm/filters/components/filtersSelectListItem.js +2 -2
- package/esm/filters/components/filtersSidePanel.js +8 -8
- package/esm/filters/filters.js +4 -3
- package/esm/filtersBar/components/filtersBarPeriodPicker/getRangeOption.js +18 -18
- package/esm/filtersBar/components/resetComponentButton.js +1 -1
- package/esm/filtersBar/filtersBarActions/filtersBarActions.js +4 -4
- package/esm/filtersBar/filtersBarSidePanel/components/filtersBarSidePanelRange/filtersBarSidePanelRange.js +2 -2
- package/esm/filtersBar/filtersBarSidePanel/filtersBarSidePanel.js +5 -5
- package/esm/filtersBar/filtersContainer/filtersContainer.js +2 -2
- package/esm/formField/hooks/useError.js +3 -3
- package/esm/formGroup/components/reviewListToggle/reviewListToggle.js +2 -2
- package/esm/formGroup/hooks/useToggle.js +1 -1
- package/esm/formLayout/hooks/useError.js +3 -3
- package/esm/formLayout/hooks/useFormButtons.js +3 -3
- package/esm/formSection/hooks/useError.js +3 -3
- package/esm/formStepper/components/formStep.js +1 -1
- package/esm/formStepper/formStepper.js +2 -2
- package/esm/formStepperButtons/formStepperButtons.js +4 -4
- package/esm/groupsFilterRaw/groupsFilterAdjustmentState.js +4 -4
- package/esm/groupsFilterRaw/groupsFilterBox.js +3 -3
- package/esm/groupsFilterRaw/groupsFilterCommon.js +2 -2
- package/esm/groupsFilterRaw/groupsFilterCurrentlySelectedState.js +5 -5
- package/esm/groupsFilterRaw/groupsFilterHelper.js +2 -2
- package/esm/groupsFilterRaw/groupsFilterInitialState.js +8 -8
- package/esm/groupsFilterRaw/groupsFilterMenu.js +3 -3
- package/esm/groupsFilterRaw/groupsFilterRaw.js +8 -8
- package/esm/groupsFilterRaw/groupsFilterTrigger.js +2 -2
- package/esm/groupsFilterRaw/groupsHelper.js +22 -22
- package/esm/header/components/collapsedItemsControl/collapsedItemsControl.js +1 -1
- package/esm/header/components/mobileFilterControl/mobileFilterControl.js +1 -1
- package/esm/header/components/mobileSearchControl/mobileSearchControl.js +3 -3
- package/esm/header/headerBack.js +1 -1
- package/esm/index.d.ts +3 -0
- package/esm/index.js +2 -0
- package/esm/lineChart/lineChart.js +1 -1
- package/esm/lineChartMini/lineChartMini.js +1 -1
- package/esm/list/itemData/itemDataInternal.js +2 -2
- package/esm/list/listItem/listItem.js +2 -2
- package/esm/menu/components/menuErrorItem.js +2 -2
- package/esm/mobileSheet/mobileSheet.js +2 -2
- package/esm/modal/modal.js +1 -1
- package/esm/nav/navFooter/navEditFooter/navEditFooter.js +2 -2
- package/esm/nav/navFooter/navFooter.js +1 -1
- package/esm/nav/navFooter/navFooterAction/navFooterAction.js +1 -1
- package/esm/nav/navHeader/navHeader.js +2 -2
- package/esm/nav/navHeader/navHeaderSearch/navHeaderSearch.js +2 -2
- package/esm/nav/navMobileBar/navMobileBar.js +1 -1
- package/esm/notification/notification.js +1 -1
- package/esm/pagination/paginationArrow.js +2 -2
- package/esm/pagination/paginationText/paginationText.js +1 -1
- package/esm/pill/components/pillNonActionable/pillNonActionable.js +1 -1
- package/esm/pillBox/components/pillBoxItem.js +1 -1
- package/esm/pillBox/pillBox.js +3 -3
- package/esm/pillExpandable/pillExpandable.js +1 -1
- package/esm/pillExpandable/pillExpandableAlignments.js +65 -48
- package/esm/progressIndicator/progressIndicator.d.ts +4 -4
- package/esm/progressIndicator/progressIndicator.js +4 -4
- package/esm/rangeRaw/rangeRaw.js +7 -7
- package/esm/rangeRaw/utils/rangeHelper.js +7 -7
- package/esm/searchInputRaw/searchInputRaw.js +2 -2
- package/esm/selectList/selectList.js +2 -2
- package/esm/skeleton/skeleton.js +1 -1
- package/esm/sortControl/sortControl.js +5 -5
- package/esm/stepperRaw/stepperRaw.js +2 -2
- package/esm/summary/summary.js +2 -2
- package/esm/summaryTile/summaryTile.js +1 -1
- package/esm/table/actions/actionsMenu.js +2 -2
- package/esm/table/detailPanel/detailPanel.js +1 -1
- package/esm/table/detailPanel/detailPanelHeader.js +2 -2
- package/esm/table/flexible/columnSettings.js +2 -2
- package/esm/table/flexible/columnsPopup.js +1 -1
- package/esm/table/nested/useNestedRows.js +2 -2
- package/esm/table/selectable/interfaces.d.ts +9 -13
- package/esm/table/selectable/selectableHeader.js +5 -5
- package/esm/table/selectable/useDragSelection.d.ts +10 -0
- package/esm/table/selectable/useDragSelection.js +135 -0
- package/esm/table/selectable/useSelectableRows.d.ts +2 -2
- package/esm/table/selectable/useSelectableRows.js +61 -51
- package/esm/table/selectable/utils/calculateSelectionState.js +0 -35
- package/esm/table/selectable/utils/getDragSelectionRows.d.ts +15 -0
- package/esm/table/selectable/utils/getDragSelectionRows.js +24 -0
- package/esm/table/selectable/utils/getRangeIds.d.ts +2 -0
- package/esm/table/selectable/utils/getRangeIds.js +17 -0
- package/esm/table/selectable/utils/isRowChecked.js +1 -12
- package/esm/table/sortable/mobileSortControl.js +3 -3
- package/esm/table/sortable/sortableHeader.js +2 -2
- package/esm/table/table.d.ts +4 -0
- package/esm/table/table.js +10 -6
- package/esm/tabs/tabs.js +2 -2
- package/esm/tag/tag.d.ts +3 -2
- package/esm/tag/tag.js +3 -2
- package/esm/timePickerRaw/timePickerRaw.js +7 -7
- package/esm/toastRaw/toastRaw.js +1 -1
- package/esm/toggleButtonRaw/toggleButtonRaw.js +2 -2
- package/esm/tooltip/tooltip.js +5 -2
- package/esm/utils/formatDate.js +37 -37
- package/esm/utils/localization/flipAlignment.js +5 -1
- package/esm/utils/localization/getSupportedLanguage.d.ts +1 -1
- package/esm/utils/localization/getSupportedLanguage.js +8 -2
- package/esm/utils/localization/getTextDirection.js +1 -1
- package/esm/utils/localization/languageContext.d.ts +1 -1
- package/esm/utils/localization/translations/{ar.json → ar-001.json} +54 -53
- package/esm/utils/localization/translationsDictionary.js +1 -1
- package/esm/utils/localization/useRTLAlignment.d.ts +6 -0
- package/esm/utils/localization/useRTLAlignment.js +6 -0
- package/package.json +1 -1
|
@@ -31,7 +31,7 @@ injectString("tr", "Column Settings", "S\xFCtun Ayarlar\u0131");
|
|
|
31
31
|
injectString("zh-Hans", "Column Settings", "\u5217\u8BBE\u7F6E");
|
|
32
32
|
injectString("zh-TW", "Column Settings", "\u6B04\u8A2D\u5B9A");
|
|
33
33
|
injectString("ro-RO", "Column Settings", "Set\u0103ri coloane");
|
|
34
|
-
injectString("ar", "Column Settings", "\u0625\u0639\u062F\u0627\u062F\u0627\u062A \u0627\u0644\u0639\u0645\u0648\u062F");
|
|
34
|
+
injectString("ar-001", "Column Settings", "\u0625\u0639\u062F\u0627\u062F\u0627\u062A \u0627\u0644\u0639\u0645\u0648\u062F");
|
|
35
35
|
injectString("lt-LT", "Column Settings", "Stulpelio nustatymai");
|
|
36
36
|
injectString("lv-LV", "Column Settings", "Kolonnas iestat\u012Bjumi");
|
|
37
37
|
injectString("ka-GE", "Column Settings", "\u10E1\u10D5\u10D4\u10E2\u10D8\u10E1 \u10DE\u10D0\u10E0\u10D0\u10DB\u10D4\u10E2\u10E0\u10D4\u10D1\u10D8");
|
|
@@ -30,7 +30,7 @@ injectString("tr", "Collapse", "Daralt");
|
|
|
30
30
|
injectString("zh-Hans", "Collapse", "\u6298\u53E0");
|
|
31
31
|
injectString("zh-TW", "Collapse", "\u647A\u758A");
|
|
32
32
|
injectString("ro-RO", "Collapse", "Restr\xE2nge\u021Bi");
|
|
33
|
-
injectString("ar", "Collapse", "\u0637\u064A");
|
|
33
|
+
injectString("ar-001", "Collapse", "\u0637\u064A");
|
|
34
34
|
injectString("lt-LT", "Collapse", "Sutraukti");
|
|
35
35
|
injectString("lv-LV", "Collapse", "Sak\u013Caut");
|
|
36
36
|
injectString("ka-GE", "Collapse", "\u10E9\u10D0\u10D9\u10D4\u10EA\u10D5\u10D0");
|
|
@@ -63,7 +63,7 @@ injectString("tr", "Expand", "Geni\u015Flet");
|
|
|
63
63
|
injectString("zh-Hans", "Expand", "\u5C55\u5F00");
|
|
64
64
|
injectString("zh-TW", "Expand", "\u5C55\u958B");
|
|
65
65
|
injectString("ro-RO", "Expand", "Extinde\u021Bi");
|
|
66
|
-
injectString("ar", "Expand", "\u062A\u0648\u0633\u064A\u0639");
|
|
66
|
+
injectString("ar-001", "Expand", "\u062A\u0648\u0633\u064A\u0639");
|
|
67
67
|
injectString("lt-LT", "Expand", "I\u0161pl\u0117sti");
|
|
68
68
|
injectString("lv-LV", "Expand", "Izv\u0113rst");
|
|
69
69
|
injectString("ka-GE", "Expand", "\u10D2\u10D0\u10E8\u10DA\u10D0");
|
|
@@ -5,19 +5,15 @@ export declare enum SelectionState {
|
|
|
5
5
|
None = "none"
|
|
6
6
|
}
|
|
7
7
|
export interface ISelectionValue {
|
|
8
|
-
/**
|
|
9
|
-
* Whether every selectable row across every page is selected.
|
|
10
|
-
*/
|
|
11
8
|
all: boolean;
|
|
12
|
-
/**
|
|
13
|
-
* The meaning of this list depends on `all`:
|
|
14
|
-
* - when `all` is `false`, it is the ids explicitly *included* in the selection.
|
|
15
|
-
* - when `all` is `true`, it is the ids explicitly *excluded* from the otherwise
|
|
16
|
-
* fully-selected set (e.g. rows unchecked after a "select all" across paginated data).
|
|
17
|
-
*
|
|
18
|
-
* This lets `all: true` represent "all except these ids" without needing to know the
|
|
19
|
-
* full id universe (MYG-142234) - unchecking a row while `all` is true only ever adds
|
|
20
|
-
* to this exclusion list; it must never be rebuilt from the currently rendered page.
|
|
21
|
-
*/
|
|
22
9
|
selected: string[];
|
|
23
10
|
}
|
|
11
|
+
/**
|
|
12
|
+
* One checkbox row in the order it is rendered. Expanded nested rows are part of this list,
|
|
13
|
+
* directly after their parent, so a drag or shift-click range can span nesting levels the
|
|
14
|
+
* same way it spans sibling rows.
|
|
15
|
+
*/
|
|
16
|
+
export interface IDragSelectionRow {
|
|
17
|
+
id: string;
|
|
18
|
+
isNested: boolean;
|
|
19
|
+
}
|
|
@@ -33,7 +33,7 @@ injectString("tr", "Select all", "T\xFCm\xFCn\xFC se\xE7");
|
|
|
33
33
|
injectString("zh-Hans", "Select all", "\u5168\u9009");
|
|
34
34
|
injectString("zh-TW", "Select all", "\u5168\u9078");
|
|
35
35
|
injectString("ro-RO", "Select all", "Selecta\u021Bi tot");
|
|
36
|
-
injectString("ar", "Select all", "\u062A\u062D\u062F\u064A\u062F \u0627\u0644\u0643\u0644");
|
|
36
|
+
injectString("ar-001", "Select all", "\u062A\u062D\u062F\u064A\u062F \u0627\u0644\u0643\u0644");
|
|
37
37
|
injectString("lt-LT", "Select all", "Pasirinkti visus");
|
|
38
38
|
injectString("lv-LV", "Select all", "Atlas\u012Bt visus");
|
|
39
39
|
injectString("ka-GE", "Select all", "\u10E7\u10D5\u10D4\u10DA\u10D0\u10E1 \u10D0\u10E0\u10E9\u10D4\u10D5\u10D0");
|
|
@@ -66,7 +66,7 @@ injectString("tr", "Select current page", "Ge\xE7erli sayfay\u0131 se\xE7");
|
|
|
66
66
|
injectString("zh-Hans", "Select current page", "\u9009\u62E9\u5F53\u524D\u9875\u9762");
|
|
67
67
|
injectString("zh-TW", "Select current page", "\u9078\u53D6\u76EE\u524D\u9801\u9762");
|
|
68
68
|
injectString("ro-RO", "Select current page", "Selecta\u021Bi pagina actual\u0103");
|
|
69
|
-
injectString("ar", "Select current page", "\u062A\u062D\u062F\u064A\u062F \u0627\u0644\u0635\u0641\u062D\u0629 \u0627\u0644\u062D\u0627\u0644\u064A\u0629");
|
|
69
|
+
injectString("ar-001", "Select current page", "\u062A\u062D\u062F\u064A\u062F \u0627\u0644\u0635\u0641\u062D\u0629 \u0627\u0644\u062D\u0627\u0644\u064A\u0629");
|
|
70
70
|
injectString("lt-LT", "Select current page", "Pasirinkti dabartin\u012F puslap\u012F");
|
|
71
71
|
injectString("lv-LV", "Select current page", "Atlas\u012Bt pa\u0161reiz\u0113jo lapu");
|
|
72
72
|
injectString("ka-GE", "Select current page", "\u10DB\u10D8\u10DB\u10D3\u10D8\u10DC\u10D0\u10E0\u10D4 \u10D2\u10D5\u10D4\u10E0\u10D3\u10D8\u10E1 \u10D0\u10E0\u10E9\u10D4\u10D5\u10D0");
|
|
@@ -99,7 +99,7 @@ injectString("tr", "Deselect all", "T\xFCm\xFCn\xFCn se\xE7imini iptal et");
|
|
|
99
99
|
injectString("zh-Hans", "Deselect all", "\u53D6\u6D88\u5168\u9009");
|
|
100
100
|
injectString("zh-TW", "Deselect all", "\u53D6\u6D88\u5168\u9078");
|
|
101
101
|
injectString("ro-RO", "Deselect all", "Deselecta\u021Bi tot");
|
|
102
|
-
injectString("ar", "Deselect all", "\u0625\u0644\u063A\u0627\u0621 \u062A\u062D\u062F\u064A\u062F \u0627\u0644\u0643\u0644");
|
|
102
|
+
injectString("ar-001", "Deselect all", "\u0625\u0644\u063A\u0627\u0621 \u062A\u062D\u062F\u064A\u062F \u0627\u0644\u0643\u0644");
|
|
103
103
|
injectString("lt-LT", "Deselect all", "At\u017Eym\u0117ti visus");
|
|
104
104
|
injectString("lv-LV", "Deselect all", "Atcelt visas atlases");
|
|
105
105
|
injectString("ka-GE", "Deselect all", "\u10E7\u10D5\u10D4\u10DA\u10D0\u10E1 \u10DB\u10DD\u10EE\u10E1\u10DC\u10D0");
|
|
@@ -132,7 +132,7 @@ injectString("tr", "Select menu", "Men\xFC se\xE7");
|
|
|
132
132
|
injectString("zh-Hans", "Select menu", "\u9009\u62E9\u83DC\u5355");
|
|
133
133
|
injectString("zh-TW", "Select menu", "\u9078\u64C7\u529F\u80FD\u8868");
|
|
134
134
|
injectString("ro-RO", "Select menu", "Selecta\u021Bi meniul");
|
|
135
|
-
injectString("ar", "Select menu", "\u062A\u062D\u062F\u064A\u062F \u0627\u0644\u0642\u0627\u0626\u0645\u0629");
|
|
135
|
+
injectString("ar-001", "Select menu", "\u062A\u062D\u062F\u064A\u062F \u0627\u0644\u0642\u0627\u0626\u0645\u0629");
|
|
136
136
|
injectString("lt-LT", "Select menu", "Pasirinkti meniu");
|
|
137
137
|
injectString("lv-LV", "Select menu", "Atlas\u012Bt izv\u0113lni");
|
|
138
138
|
injectString("ka-GE", "Select menu", "\u10DB\u10D4\u10DC\u10D8\u10E3\u10E1 \u10D0\u10E0\u10E9\u10D4\u10D5\u10D0");
|
|
@@ -165,7 +165,7 @@ injectString("tr", "Multiple row selection menu", "\xC7oklu s\u0131ra se\xE7imi
|
|
|
165
165
|
injectString("zh-Hans", "Multiple row selection menu", "\u591A\u884C\u9009\u62E9\u83DC\u5355");
|
|
166
166
|
injectString("zh-TW", "Multiple row selection menu", "\u591A\u5217\u9078\u64C7\u9078\u55AE");
|
|
167
167
|
injectString("ro-RO", "Multiple row selection menu", "Meniu de selectare cu mai multe r\xE2nduri");
|
|
168
|
-
injectString("ar", "Multiple row selection menu", "\u0642\u0627\u0626\u0645\u0629 \u0627\u062E\u062A\u064A\u0627\u0631 \u0635\u0641\u0648\u0641 \u0645\u062A\u0639\u062F\u062F\u0629");
|
|
168
|
+
injectString("ar-001", "Multiple row selection menu", "\u0642\u0627\u0626\u0645\u0629 \u0627\u062E\u062A\u064A\u0627\u0631 \u0635\u0641\u0648\u0641 \u0645\u062A\u0639\u062F\u062F\u0629");
|
|
169
169
|
injectString("lt-LT", "Multiple row selection menu", "Keli\u0173 eilu\u010Di\u0173 pasirinkimo meniu");
|
|
170
170
|
injectString("lv-LV", "Multiple row selection menu", "Vair\u0101ku rindu atlases izv\u0113lne");
|
|
171
171
|
injectString("ka-GE", "Multiple row selection menu", "\u10DB\u10E0\u10D0\u10D5\u10D0\u10DA\u10D8 \u10DB\u10EC\u10D9\u10E0\u10D8\u10D5\u10D8\u10E1 \u10D0\u10E0\u10E9\u10D4\u10D5\u10D8\u10E1 \u10DB\u10D4\u10DC\u10D8\u10E3");
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { MouseEvent as ReactMouseEvent, RefObject } from "react";
|
|
2
|
+
import { IDragSelectionRow } from "./interfaces";
|
|
3
|
+
/**
|
|
4
|
+
* @param rows every checkbox row in render order, expanded nested rows included, so ranges can
|
|
5
|
+
* span nesting levels.
|
|
6
|
+
*/
|
|
7
|
+
export declare const useDragSelection: (rows: IDragSelectionRow[], gridRef: RefObject<HTMLElement | null> | undefined, onBatchSelect: (rangeIds: string[], select: boolean, base: Set<string>) => void, getBaseSelection: () => Set<string>, isSelectable: (row: IDragSelectionRow) => boolean, isEnabled: boolean) => {
|
|
8
|
+
onCheckboxMouseDown: (id: string, checked: boolean, e: ReactMouseEvent) => void;
|
|
9
|
+
suppressNextChangeRef: RefObject<boolean>;
|
|
10
|
+
};
|
|
@@ -0,0 +1,135 @@
|
|
|
1
|
+
import { useCallback, useEffect, useRef } from "react";
|
|
2
|
+
import { zen } from "../../utils/zen";
|
|
3
|
+
import { getRangeIds } from "./utils/getRangeIds";
|
|
4
|
+
const DRAG_CLASS = "zen-not-selectable";
|
|
5
|
+
/**
|
|
6
|
+
* @param rows every checkbox row in render order, expanded nested rows included, so ranges can
|
|
7
|
+
* span nesting levels.
|
|
8
|
+
*/
|
|
9
|
+
export const useDragSelection = (rows, gridRef, onBatchSelect, getBaseSelection, isSelectable, isEnabled) => {
|
|
10
|
+
const rowsRef = useRef(rows);
|
|
11
|
+
rowsRef.current = rows;
|
|
12
|
+
const getBaseSelectionRef = useRef(getBaseSelection);
|
|
13
|
+
getBaseSelectionRef.current = getBaseSelection;
|
|
14
|
+
const onBatchSelectRef = useRef(onBatchSelect);
|
|
15
|
+
onBatchSelectRef.current = onBatchSelect;
|
|
16
|
+
const isSelectableRef = useRef(isSelectable);
|
|
17
|
+
isSelectableRef.current = isSelectable;
|
|
18
|
+
const isEnabledRef = useRef(isEnabled);
|
|
19
|
+
isEnabledRef.current = isEnabled;
|
|
20
|
+
const anchorIdRef = useRef(null);
|
|
21
|
+
const anchorSelectRef = useRef(true);
|
|
22
|
+
const baseSelectedRef = useRef(new Set());
|
|
23
|
+
const isDraggingRef = useRef(false);
|
|
24
|
+
const movedRef = useRef(false);
|
|
25
|
+
const lastResultKeyRef = useRef("");
|
|
26
|
+
const lastPointRef = useRef(null);
|
|
27
|
+
const suppressNextChangeRef = useRef(false);
|
|
28
|
+
const attachedGridElementRef = useRef(null);
|
|
29
|
+
const emitRange = useCallback((currentId) => {
|
|
30
|
+
const anchorId = anchorIdRef.current;
|
|
31
|
+
if (anchorId === null) {
|
|
32
|
+
return;
|
|
33
|
+
}
|
|
34
|
+
const range = getRangeIds(rowsRef.current, anchorId, currentId, isSelectableRef.current);
|
|
35
|
+
if (range.length === 0) {
|
|
36
|
+
return;
|
|
37
|
+
}
|
|
38
|
+
const select = anchorSelectRef.current;
|
|
39
|
+
const key = `${select}|${range.join(",")}`;
|
|
40
|
+
if (key === lastResultKeyRef.current) {
|
|
41
|
+
return;
|
|
42
|
+
}
|
|
43
|
+
lastResultKeyRef.current = key;
|
|
44
|
+
onBatchSelectRef.current(range, select, baseSelectedRef.current);
|
|
45
|
+
}, []);
|
|
46
|
+
const extend = useCallback((x, y) => {
|
|
47
|
+
var _a, _b;
|
|
48
|
+
lastPointRef.current = { x, y };
|
|
49
|
+
const row = (_b = (_a = zen.document) === null || _a === void 0 ? void 0 : _a.elementFromPoint(x, y)) === null || _b === void 0 ? void 0 : _b.closest("[data-row-id]");
|
|
50
|
+
const currentId = row === null || row === void 0 ? void 0 : row.getAttribute("data-row-id");
|
|
51
|
+
if (!currentId) {
|
|
52
|
+
return;
|
|
53
|
+
}
|
|
54
|
+
if (currentId !== anchorIdRef.current) {
|
|
55
|
+
movedRef.current = true;
|
|
56
|
+
}
|
|
57
|
+
if (!movedRef.current) {
|
|
58
|
+
return;
|
|
59
|
+
}
|
|
60
|
+
emitRange(currentId);
|
|
61
|
+
}, [emitRange]);
|
|
62
|
+
const onMouseMove = useCallback((e) => {
|
|
63
|
+
extend(e.clientX, e.clientY);
|
|
64
|
+
}, [extend]);
|
|
65
|
+
const onScroll = useCallback(() => {
|
|
66
|
+
const point = lastPointRef.current;
|
|
67
|
+
if (point) {
|
|
68
|
+
extend(point.x, point.y);
|
|
69
|
+
}
|
|
70
|
+
}, [extend]);
|
|
71
|
+
const endDrag = useCallback(() => {
|
|
72
|
+
var _a, _b, _c, _d;
|
|
73
|
+
if (!isDraggingRef.current) {
|
|
74
|
+
return;
|
|
75
|
+
}
|
|
76
|
+
isDraggingRef.current = false;
|
|
77
|
+
if (movedRef.current) {
|
|
78
|
+
suppressNextChangeRef.current = true;
|
|
79
|
+
}
|
|
80
|
+
(_a = zen.document) === null || _a === void 0 ? void 0 : _a.removeEventListener("mousemove", onMouseMove);
|
|
81
|
+
(_b = zen.document) === null || _b === void 0 ? void 0 : _b.removeEventListener("mouseup", endDrag);
|
|
82
|
+
(_c = attachedGridElementRef.current) === null || _c === void 0 ? void 0 : _c.removeEventListener("scroll", onScroll);
|
|
83
|
+
(_d = attachedGridElementRef.current) === null || _d === void 0 ? void 0 : _d.classList.remove(DRAG_CLASS);
|
|
84
|
+
attachedGridElementRef.current = null;
|
|
85
|
+
}, [onMouseMove, onScroll]); // eslint-disable-line react-hooks/exhaustive-deps
|
|
86
|
+
const onCheckboxMouseDown = useCallback((id, checked, e) => {
|
|
87
|
+
var _a, _b, _c, _d, _e;
|
|
88
|
+
// Right-click between drag-end and the trailing click must not clear suppression.
|
|
89
|
+
if (e.button === 0) {
|
|
90
|
+
suppressNextChangeRef.current = false;
|
|
91
|
+
}
|
|
92
|
+
if (!isEnabledRef.current || e.button !== 0) {
|
|
93
|
+
return;
|
|
94
|
+
}
|
|
95
|
+
if (e.shiftKey && anchorIdRef.current !== null) {
|
|
96
|
+
e.preventDefault();
|
|
97
|
+
const anchorId = anchorIdRef.current;
|
|
98
|
+
const anchorInList = rowsRef.current.some(row => row.id === anchorId);
|
|
99
|
+
if (!anchorInList) {
|
|
100
|
+
// The anchor is no longer rendered (e.g. its parent was collapsed, or the list was
|
|
101
|
+
// re-filtered/paginated since). Drop the stale anchor and let the target row's own
|
|
102
|
+
// onChange fire normally, rather than swallowing it as a silent no-op.
|
|
103
|
+
anchorIdRef.current = null;
|
|
104
|
+
return;
|
|
105
|
+
}
|
|
106
|
+
// Gmail-style: every shift-click re-applies the range to the selection captured when
|
|
107
|
+
// the anchor was clicked, so moving the target closer to the anchor deselects the rows
|
|
108
|
+
// that dropped out of the range. Shift-clicking the anchor itself collapses the range
|
|
109
|
+
// to nothing, restoring that captured selection — the anchor included.
|
|
110
|
+
const range = id === anchorId ? [] : getRangeIds(rowsRef.current, anchorId, id, isSelectableRef.current);
|
|
111
|
+
// Suppress even when the range is empty to prevent the anchor from double-toggling
|
|
112
|
+
// on a same-row shift-click.
|
|
113
|
+
suppressNextChangeRef.current = true;
|
|
114
|
+
onBatchSelectRef.current(range, anchorSelectRef.current, baseSelectedRef.current);
|
|
115
|
+
return;
|
|
116
|
+
}
|
|
117
|
+
anchorIdRef.current = id;
|
|
118
|
+
anchorSelectRef.current = !checked;
|
|
119
|
+
baseSelectedRef.current = getBaseSelectionRef.current();
|
|
120
|
+
isDraggingRef.current = true;
|
|
121
|
+
movedRef.current = false;
|
|
122
|
+
lastResultKeyRef.current = "";
|
|
123
|
+
lastPointRef.current = { x: e.clientX, y: e.clientY };
|
|
124
|
+
attachedGridElementRef.current = (_a = gridRef === null || gridRef === void 0 ? void 0 : gridRef.current) !== null && _a !== void 0 ? _a : null;
|
|
125
|
+
(_b = attachedGridElementRef.current) === null || _b === void 0 ? void 0 : _b.classList.add(DRAG_CLASS);
|
|
126
|
+
(_c = zen.document) === null || _c === void 0 ? void 0 : _c.addEventListener("mousemove", onMouseMove);
|
|
127
|
+
(_d = zen.document) === null || _d === void 0 ? void 0 : _d.addEventListener("mouseup", endDrag);
|
|
128
|
+
(_e = attachedGridElementRef.current) === null || _e === void 0 ? void 0 : _e.addEventListener("scroll", onScroll);
|
|
129
|
+
}, [gridRef, onMouseMove, onScroll, endDrag]);
|
|
130
|
+
useEffect(() => {
|
|
131
|
+
anchorIdRef.current = null;
|
|
132
|
+
}, [rows]);
|
|
133
|
+
useEffect(() => endDrag, [endDrag]);
|
|
134
|
+
return { onCheckboxMouseDown, suppressNextChangeRef };
|
|
135
|
+
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ReactNode } from "react";
|
|
1
|
+
import { ReactNode, RefObject } from "react";
|
|
2
2
|
import { IListColumn } from "../table";
|
|
3
3
|
import { ISelectionValue, SelectionState } from "./interfaces";
|
|
4
4
|
import "./selectableColumn.less";
|
|
@@ -33,7 +33,7 @@ export declare const getEmptySelection: () => {
|
|
|
33
33
|
selected: string[];
|
|
34
34
|
};
|
|
35
35
|
export declare const SelectableWrapperName = "Selectable";
|
|
36
|
-
export declare const useSelectableRows: <T extends IRowEntity<N>, N extends IEntityWithId>(columns: IListColumn<T, N>[], entities: T[], isMobile: boolean, selectMode: boolean, setSelectMode: (value: boolean) => void, selectable?: ISelectableRowsOptions<T, N>, isInfinite?: boolean) => {
|
|
36
|
+
export declare const useSelectableRows: <T extends IRowEntity<N>, N extends IEntityWithId>(columns: IListColumn<T, N>[], entities: T[], isMobile: boolean, selectMode: boolean, setSelectMode: (value: boolean) => void, selectable?: ISelectableRowsOptions<T, N>, isInfinite?: boolean, gridRef?: RefObject<HTMLElement | null>, expandedRows?: string[]) => {
|
|
37
37
|
selectableColumns: IListColumn<T, N>[];
|
|
38
38
|
selectableFeedWrapper: (primaryData: ReactNode, secondaryData: ReactNode, entity: T | N, isNested: boolean) => [ReactNode, ReactNode];
|
|
39
39
|
};
|
|
@@ -10,6 +10,8 @@ import { useLanguage } from "../../utils/localization/useLanguage";
|
|
|
10
10
|
import { checkRow } from "./utils/checkRow";
|
|
11
11
|
import { isRowChecked } from "./utils/isRowChecked";
|
|
12
12
|
import { getCurrentPageSelection } from "./utils/getCurrentPageSelection";
|
|
13
|
+
import { useDragSelection } from "./useDragSelection";
|
|
14
|
+
import { getDragSelectionRows } from "./utils/getDragSelectionRows";
|
|
13
15
|
injectString("cs", "Select all", "Vybrat v\u0161e");
|
|
14
16
|
injectString("da-DK", "Select all", "V\xE6lg alle");
|
|
15
17
|
injectString("de", "Select all", "Alle ausw\xE4hlen");
|
|
@@ -36,7 +38,7 @@ injectString("tr", "Select all", "T\xFCm\xFCn\xFC se\xE7");
|
|
|
36
38
|
injectString("zh-Hans", "Select all", "\u5168\u9009");
|
|
37
39
|
injectString("zh-TW", "Select all", "\u5168\u9078");
|
|
38
40
|
injectString("ro-RO", "Select all", "Selecta\u021Bi tot");
|
|
39
|
-
injectString("ar", "Select all", "\u062A\u062D\u062F\u064A\u062F \u0627\u0644\u0643\u0644");
|
|
41
|
+
injectString("ar-001", "Select all", "\u062A\u062D\u062F\u064A\u062F \u0627\u0644\u0643\u0644");
|
|
40
42
|
injectString("lt-LT", "Select all", "Pasirinkti visus");
|
|
41
43
|
injectString("lv-LV", "Select all", "Atlas\u012Bt visus");
|
|
42
44
|
injectString("ka-GE", "Select all", "\u10E7\u10D5\u10D4\u10DA\u10D0\u10E1 \u10D0\u10E0\u10E9\u10D4\u10D5\u10D0");
|
|
@@ -69,7 +71,7 @@ injectString("tr", "Deselect all", "T\xFCm\xFCn\xFCn se\xE7imini iptal et");
|
|
|
69
71
|
injectString("zh-Hans", "Deselect all", "\u53D6\u6D88\u5168\u9009");
|
|
70
72
|
injectString("zh-TW", "Deselect all", "\u53D6\u6D88\u5168\u9078");
|
|
71
73
|
injectString("ro-RO", "Deselect all", "Deselecta\u021Bi tot");
|
|
72
|
-
injectString("ar", "Deselect all", "\u0625\u0644\u063A\u0627\u0621 \u062A\u062D\u062F\u064A\u062F \u0627\u0644\u0643\u0644");
|
|
74
|
+
injectString("ar-001", "Deselect all", "\u0625\u0644\u063A\u0627\u0621 \u062A\u062D\u062F\u064A\u062F \u0627\u0644\u0643\u0644");
|
|
73
75
|
injectString("lt-LT", "Deselect all", "At\u017Eym\u0117ti visus");
|
|
74
76
|
injectString("lv-LV", "Deselect all", "Atcelt visas atlases");
|
|
75
77
|
injectString("ka-GE", "Deselect all", "\u10E7\u10D5\u10D4\u10DA\u10D0\u10E1 \u10DB\u10DD\u10EE\u10E1\u10DC\u10D0");
|
|
@@ -83,7 +85,7 @@ export const getEmptySelection = () => ({
|
|
|
83
85
|
export const SelectableWrapperName = "Selectable";
|
|
84
86
|
// Infinite scroll has no pages, so the header checkbox always means "select all" (never current page).
|
|
85
87
|
const resolveCheckboxEmitsCurrentPage = (isInfinite, checkboxSelectsCurrentPage, turnOffSelectAll) => isInfinite ? false : checkboxSelectsCurrentPage !== null && checkboxSelectsCurrentPage !== void 0 ? checkboxSelectsCurrentPage : turnOffSelectAll;
|
|
86
|
-
export const useSelectableRows = (columns, entities, isMobile, selectMode, setSelectMode, selectable, isInfinite = false) => {
|
|
88
|
+
export const useSelectableRows = (columns, entities, isMobile, selectMode, setSelectMode, selectable, isInfinite = false, gridRef, expandedRows) => {
|
|
87
89
|
var _a;
|
|
88
90
|
const {
|
|
89
91
|
translate
|
|
@@ -133,30 +135,19 @@ export const useSelectableRows = (columns, entities, isMobile, selectMode, setSe
|
|
|
133
135
|
}
|
|
134
136
|
}, [checkboxDisabled, checkboxVisible, entities, selectable, setSelectMode, selectable === null || selectable === void 0 ? void 0 : selectable.strategy]);
|
|
135
137
|
const getNewSelection = useCallback((id, checked) => {
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
// exclusion set - it must never be rebuilt from `entities` (the current page),
|
|
141
|
-
// otherwise every other page's rows would silently fall out of the selection.
|
|
142
|
-
const excluded = new Set(selections);
|
|
143
|
-
checkRow(excluded, selectable, entities, id, !checked);
|
|
144
|
-
return excluded;
|
|
138
|
+
if (state === SelectionState.All) {
|
|
139
|
+
const newSelection = getCurrentPageSelection(entities, selectable);
|
|
140
|
+
checkRow(newSelection, selectable, entities, id, false);
|
|
141
|
+
return newSelection;
|
|
145
142
|
}
|
|
146
143
|
checkRow(selections, selectable, entities, id, checked);
|
|
147
144
|
return selections;
|
|
148
|
-
}, [entities, selectable, selections]);
|
|
145
|
+
}, [state, entities, selectable, selections]);
|
|
149
146
|
const onSelectListener = useCallback((id, checked) => {
|
|
150
147
|
var _a;
|
|
151
|
-
const wasAllSelected = ((_a = selectable === null || selectable === void 0 ? void 0 : selectable.selection) === null || _a === void 0 ? void 0 : _a.all) || false;
|
|
152
148
|
const newSelection = getNewSelection(id, checked);
|
|
153
|
-
const newState = calculateSelectionState(entities, newSelection,
|
|
154
|
-
|
|
155
|
-
// and only record the exclusion - it must not collapse to the current page's ids.
|
|
156
|
-
const newValue = wasAllSelected ? {
|
|
157
|
-
selected: [...newSelection],
|
|
158
|
-
all: true
|
|
159
|
-
} : {
|
|
149
|
+
const newState = calculateSelectionState(entities, newSelection, ((_a = selectable === null || selectable === void 0 ? void 0 : selectable.selection) === null || _a === void 0 ? void 0 : _a.all) || false, checkboxVisible, checkboxDisabled, selectable === null || selectable === void 0 ? void 0 : selectable.strategy);
|
|
150
|
+
const newValue = {
|
|
160
151
|
selected: [...newSelection],
|
|
161
152
|
all: newState === SelectionState.All
|
|
162
153
|
};
|
|
@@ -164,8 +155,49 @@ export const useSelectableRows = (columns, entities, isMobile, selectMode, setSe
|
|
|
164
155
|
selectable === null || selectable === void 0 ? void 0 : selectable.onSelect(newValue);
|
|
165
156
|
setSelectMode(newValue.all || newValue.selected.length > 0);
|
|
166
157
|
}, [checkboxDisabled, checkboxVisible, entities, selectable, setSelectMode, setState, getNewSelection]);
|
|
158
|
+
const onBatchSelect = useCallback((rangeIds, select, base) => {
|
|
159
|
+
var _a;
|
|
160
|
+
const result = new Set(base);
|
|
161
|
+
const limit = selectable === null || selectable === void 0 ? void 0 : selectable.selectionLimit;
|
|
162
|
+
for (const id of rangeIds) {
|
|
163
|
+
if (select && limit !== undefined && result.size >= limit) {
|
|
164
|
+
break;
|
|
165
|
+
}
|
|
166
|
+
checkRow(result, selectable, entities, id, select);
|
|
167
|
+
}
|
|
168
|
+
const newState = calculateSelectionState(entities, result, ((_a = selectable === null || selectable === void 0 ? void 0 : selectable.selection) === null || _a === void 0 ? void 0 : _a.all) || false, checkboxVisible, checkboxDisabled, selectable === null || selectable === void 0 ? void 0 : selectable.strategy);
|
|
169
|
+
const newValue = {
|
|
170
|
+
selected: [...result],
|
|
171
|
+
all: newState === SelectionState.All
|
|
172
|
+
};
|
|
173
|
+
setState(newState);
|
|
174
|
+
selectable === null || selectable === void 0 ? void 0 : selectable.onSelect(newValue);
|
|
175
|
+
setSelectMode(newValue.all || newValue.selected.length > 0);
|
|
176
|
+
}, [entities, selectable, checkboxVisible, checkboxDisabled, setSelectMode]);
|
|
177
|
+
// Deliberately independent of the current selection, so the drag anchor survives the
|
|
178
|
+
// selection changes a drag itself produces.
|
|
179
|
+
const {
|
|
180
|
+
rows: dragRows,
|
|
181
|
+
entityById
|
|
182
|
+
} = useMemo(() => getDragSelectionRows(entities, expandedRows), [entities, expandedRows]);
|
|
183
|
+
const isSelectable = useCallback(row => {
|
|
184
|
+
const entity = entityById.get(row.id);
|
|
185
|
+
return !!entity && checkboxVisible(entity, row.isNested) && !checkboxDisabled(entity, row.isNested);
|
|
186
|
+
}, [entityById, checkboxVisible, checkboxDisabled]);
|
|
187
|
+
const getBaseSelection = useCallback(() => state === SelectionState.All ? getCurrentPageSelection(entities, selectable) : new Set(selections), [state, entities, selectable, selections]);
|
|
188
|
+
const {
|
|
189
|
+
onCheckboxMouseDown,
|
|
190
|
+
suppressNextChangeRef
|
|
191
|
+
} = useDragSelection(dragRows, gridRef, onBatchSelect, getBaseSelection, isSelectable, !!selectable);
|
|
192
|
+
const onCheckboxChange = useCallback((id, checked) => {
|
|
193
|
+
if (suppressNextChangeRef.current) {
|
|
194
|
+
suppressNextChangeRef.current = false;
|
|
195
|
+
return;
|
|
196
|
+
}
|
|
197
|
+
onSelectListener(id, checked);
|
|
198
|
+
}, [onSelectListener, suppressNextChangeRef]);
|
|
167
199
|
const onChangeSelectionState = useCallback(newState => {
|
|
168
|
-
var _a, _b
|
|
200
|
+
var _a, _b;
|
|
169
201
|
if (newState === SelectionState.All) {
|
|
170
202
|
(selectable === null || selectable === void 0 ? void 0 : selectable.onSelect) && selectable.onSelect({
|
|
171
203
|
selected: [],
|
|
@@ -184,11 +216,7 @@ export const useSelectableRows = (columns, entities, isMobile, selectMode, setSe
|
|
|
184
216
|
}
|
|
185
217
|
const newSelections = getCurrentPageSelection(entities, selectable);
|
|
186
218
|
setState(newState);
|
|
187
|
-
|
|
188
|
-
// included ids when `all` is false, excluded ids when `all` is true. Switching to an
|
|
189
|
-
// explicit "select current page" here always leaves `all: false`, so a previous
|
|
190
|
-
// exclusion list must not be reinterpreted as an inclusion list.
|
|
191
|
-
const previousSelections = ((_a = selectable === null || selectable === void 0 ? void 0 : selectable.selection) === null || _a === void 0 ? void 0 : _a.all) ? [] : (_c = (_b = selectable === null || selectable === void 0 ? void 0 : selectable.selection) === null || _b === void 0 ? void 0 : _b.selected) !== null && _c !== void 0 ? _c : [];
|
|
219
|
+
const previousSelections = (_b = (_a = selectable === null || selectable === void 0 ? void 0 : selectable.selection) === null || _a === void 0 ? void 0 : _a.selected) !== null && _b !== void 0 ? _b : [];
|
|
192
220
|
const mergedSelections = new Set([...previousSelections, ...newSelections]);
|
|
193
221
|
const newValue = {
|
|
194
222
|
selected: [...mergedSelections],
|
|
@@ -207,12 +235,7 @@ export const useSelectableRows = (columns, entities, isMobile, selectMode, setSe
|
|
|
207
235
|
}
|
|
208
236
|
return translate("Deselect all");
|
|
209
237
|
}, [selectable, selectableState, state, translate]);
|
|
210
|
-
const isEntityChecked = useCallback(
|
|
211
|
-
// MYG-142234: while `selection.all` is true, `selections` holds excluded ids, and every
|
|
212
|
-
// row must be evaluated through the SelectionState.All (exclusion-aware) branch of
|
|
213
|
-
// isRowChecked - not the per-page `state`, which can be Partial/None for a page that
|
|
214
|
-
// contains some of those exclusions.
|
|
215
|
-
(entity, isNested) => isRowChecked(selections, isAllSelected ? SelectionState.All : state, selectable === null || selectable === void 0 ? void 0 : selectable.strategy, entity, isNested), [selections, isAllSelected, state, selectable === null || selectable === void 0 ? void 0 : selectable.strategy]);
|
|
238
|
+
const isEntityChecked = useCallback((entity, isNested) => isRowChecked(selections, state, selectable === null || selectable === void 0 ? void 0 : selectable.strategy, entity, isNested), [selections, state, selectable === null || selectable === void 0 ? void 0 : selectable.strategy]);
|
|
216
239
|
const hasSelectable = !!selectable;
|
|
217
240
|
const selectableCheckboxSelectsCurrentPage = selectable === null || selectable === void 0 ? void 0 : selectable.checkboxSelectsCurrentPage;
|
|
218
241
|
const selectableTurnOffSelectAll = selectable === null || selectable === void 0 ? void 0 : selectable.turnOffSelectAll;
|
|
@@ -250,7 +273,8 @@ export const useSelectableRows = (columns, entities, isMobile, selectMode, setSe
|
|
|
250
273
|
indeterminate: checked.indeterminate,
|
|
251
274
|
disabled: isDisable,
|
|
252
275
|
label: checkboxTitle(entity),
|
|
253
|
-
onChange:
|
|
276
|
+
onChange: onCheckboxChange,
|
|
277
|
+
onMouseDown: isDisable ? undefined : onCheckboxMouseDown,
|
|
254
278
|
children: _jsx(CheckboxCell.Content, {
|
|
255
279
|
children: value
|
|
256
280
|
})
|
|
@@ -264,30 +288,16 @@ export const useSelectableRows = (columns, entities, isMobile, selectMode, setSe
|
|
|
264
288
|
checked: state === SelectionState.CurrentPage || state === SelectionState.All,
|
|
265
289
|
indeterminate: state === SelectionState.Partial,
|
|
266
290
|
onChange: newValue => {
|
|
267
|
-
var _a, _b
|
|
291
|
+
var _a, _b;
|
|
268
292
|
if (newValue) {
|
|
269
293
|
const newState = checkboxEmitsCurrentPage ? SelectionState.CurrentPage : SelectionState.All;
|
|
270
294
|
setState(newState);
|
|
271
295
|
onChangeSelectionState(newState);
|
|
272
|
-
} else if ((_a = selectable.selection) === null || _a === void 0 ? void 0 : _a.all) {
|
|
273
|
-
// MYG-142234: in exclusion mode, `selected` holds excluded ids. Unchecking
|
|
274
|
-
// the header must add the current page's ids to that exclusion set and
|
|
275
|
-
// keep `all: true` - it must never be treated as an inclusion list, or
|
|
276
|
-
// every other page's selection would be silently wiped out.
|
|
277
|
-
const currentPageIds = getCurrentPageSelection(entities, selectable);
|
|
278
|
-
const newExcluded = new Set([...selectable.selection.selected, ...currentPageIds]);
|
|
279
|
-
const newState = calculateSelectionState(entities, newExcluded, true, checkboxVisible, checkboxDisabled, selectable.strategy);
|
|
280
|
-
setState(newState);
|
|
281
|
-
selectable.onSelect({
|
|
282
|
-
selected: [...newExcluded],
|
|
283
|
-
all: true
|
|
284
|
-
});
|
|
285
|
-
setSelectMode(true);
|
|
286
296
|
} else {
|
|
287
297
|
// Intentionally different from onSelect(None) ("Deselect all" menu item, which clears everything).
|
|
288
298
|
// Unchecking the header checkbox only removes the current page from the selection, preserving other pages.
|
|
289
299
|
const currentPageIds = getCurrentPageSelection(entities, selectable);
|
|
290
|
-
const remaining = ((
|
|
300
|
+
const remaining = ((_b = (_a = selectable.selection) === null || _a === void 0 ? void 0 : _a.selected) !== null && _b !== void 0 ? _b : []).filter(id => !currentPageIds.has(id));
|
|
291
301
|
const newState = remaining.length > 0 ? SelectionState.Partial : SelectionState.None;
|
|
292
302
|
setState(newState);
|
|
293
303
|
selectable.onSelect({
|
|
@@ -310,7 +320,7 @@ export const useSelectableRows = (columns, entities, isMobile, selectMode, setSe
|
|
|
310
320
|
return cell;
|
|
311
321
|
}
|
|
312
322
|
};
|
|
313
|
-
}, [checkboxDisabled, checkboxTitle, checkboxVisible, headerTitle, onChangeSelectionState,
|
|
323
|
+
}, [checkboxDisabled, checkboxTitle, checkboxVisible, headerTitle, onChangeSelectionState, onCheckboxChange, onCheckboxMouseDown, hasSelectable, checkboxEmitsCurrentPage, checkboxInHeaderValue, selectableHeader, selectableTurnOffSelectAll, isInfinite, selectable, selectableState, state, isMobile, checkboxPlaceholder, isEntityChecked, entities, setSelectMode]);
|
|
314
324
|
const selectableFeedWrapper = useCallback((primaryData, secondaryData, entity, isNested) => {
|
|
315
325
|
// eslint-disable-next-line @typescript-eslint/no-unnecessary-condition
|
|
316
326
|
if (!entity) {
|
|
@@ -3,41 +3,6 @@ export const calculateSelectionState = (entities, selections, all, checkboxVisib
|
|
|
3
3
|
if (selections.size === 0) {
|
|
4
4
|
return all ? SelectionState.All : SelectionState.None;
|
|
5
5
|
}
|
|
6
|
-
if (all) {
|
|
7
|
-
// When `all` is true, `selections` holds the ids explicitly excluded from the
|
|
8
|
-
// otherwise-fully-selected set (see ISelectionValue), rather than included ids.
|
|
9
|
-
const isExcluded = (entity) => {
|
|
10
|
-
if (strategy === "nested" && entity.children) {
|
|
11
|
-
if (entity.children.length === 0) {
|
|
12
|
-
return false;
|
|
13
|
-
}
|
|
14
|
-
return entity.children.every(child => {
|
|
15
|
-
if (!checkboxVisible(child)) {
|
|
16
|
-
return true;
|
|
17
|
-
}
|
|
18
|
-
if (checkboxDisabled(child)) {
|
|
19
|
-
return true;
|
|
20
|
-
}
|
|
21
|
-
return selections.has(child.id);
|
|
22
|
-
});
|
|
23
|
-
}
|
|
24
|
-
return selections.has(entity.id);
|
|
25
|
-
};
|
|
26
|
-
const isPartiallyExcluded = (entity) => {
|
|
27
|
-
if (strategy === "nested" && entity.children) {
|
|
28
|
-
return entity.children.some(child => selections.has(child.id));
|
|
29
|
-
}
|
|
30
|
-
return selections.has(entity.id);
|
|
31
|
-
};
|
|
32
|
-
const relevantEntities = entities.filter(entity => checkboxVisible(entity) && !checkboxDisabled(entity));
|
|
33
|
-
if (relevantEntities.length === 0) {
|
|
34
|
-
return SelectionState.All;
|
|
35
|
-
}
|
|
36
|
-
if (relevantEntities.every(entity => !isPartiallyExcluded(entity))) {
|
|
37
|
-
return SelectionState.All;
|
|
38
|
-
}
|
|
39
|
-
return relevantEntities.every(entity => isExcluded(entity)) ? SelectionState.None : SelectionState.Partial;
|
|
40
|
-
}
|
|
41
6
|
return entities.every(entity => {
|
|
42
7
|
if (!checkboxVisible(entity)) {
|
|
43
8
|
return true;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { IEntityWithId } from "../../../commonHelpers/entity";
|
|
2
|
+
import { IRowEntity } from "../../../dataGrid/row/row";
|
|
3
|
+
import { IDragSelectionRow } from "../interfaces";
|
|
4
|
+
export interface IDragSelection<T> {
|
|
5
|
+
/** The rows in render order. */
|
|
6
|
+
rows: IDragSelectionRow[];
|
|
7
|
+
/** Every entity a row can point at, parents and children alike. */
|
|
8
|
+
entityById: Map<string, T>;
|
|
9
|
+
}
|
|
10
|
+
/**
|
|
11
|
+
* Flattens the entities into the rows the grid actually renders: each entity followed by its
|
|
12
|
+
* children while it is expanded. Drag and shift-click ranges walk this list, so they cross
|
|
13
|
+
* nesting levels the way the user sees them on screen.
|
|
14
|
+
*/
|
|
15
|
+
export declare const getDragSelectionRows: <T extends IRowEntity<N>, N extends IEntityWithId>(entities: T[], expandedRows?: string[]) => IDragSelection<T | N>;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Flattens the entities into the rows the grid actually renders: each entity followed by its
|
|
3
|
+
* children while it is expanded. Drag and shift-click ranges walk this list, so they cross
|
|
4
|
+
* nesting levels the way the user sees them on screen.
|
|
5
|
+
*/
|
|
6
|
+
export const getDragSelectionRows = (entities, expandedRows) => {
|
|
7
|
+
const expanded = new Set(expandedRows);
|
|
8
|
+
const rows = [];
|
|
9
|
+
const entityById = new Map();
|
|
10
|
+
entities.forEach(entity => {
|
|
11
|
+
rows.push({ id: entity.id, isNested: false });
|
|
12
|
+
entityById.set(entity.id, entity);
|
|
13
|
+
// Children are always indexed — a collapsed row's children still need to resolve for
|
|
14
|
+
// the selection predicates — but only an expanded row contributes them to the range.
|
|
15
|
+
const isExpanded = expanded.has(entity.id);
|
|
16
|
+
(entity.children || []).forEach(child => {
|
|
17
|
+
entityById.set(child.id, child);
|
|
18
|
+
if (isExpanded) {
|
|
19
|
+
rows.push({ id: child.id, isNested: true });
|
|
20
|
+
}
|
|
21
|
+
});
|
|
22
|
+
});
|
|
23
|
+
return { rows, entityById };
|
|
24
|
+
};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
export const getRangeIds = (rows, fromId, toId, isSelectable) => {
|
|
2
|
+
const fromIdx = rows.findIndex(row => row.id === fromId);
|
|
3
|
+
const toIdx = rows.findIndex(row => row.id === toId);
|
|
4
|
+
if (fromIdx === -1 || toIdx === -1) {
|
|
5
|
+
return [];
|
|
6
|
+
}
|
|
7
|
+
const start = Math.min(fromIdx, toIdx);
|
|
8
|
+
const end = Math.max(fromIdx, toIdx);
|
|
9
|
+
const ids = [];
|
|
10
|
+
for (let i = start; i <= end; i++) {
|
|
11
|
+
const row = rows[i];
|
|
12
|
+
if (isSelectable(row)) {
|
|
13
|
+
ids.push(row.id);
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
return ids;
|
|
17
|
+
};
|
|
@@ -1,18 +1,7 @@
|
|
|
1
1
|
import { SelectionState } from "../interfaces";
|
|
2
2
|
export const isRowChecked = (selections, state, strategy, entity, isNested) => {
|
|
3
3
|
if (state === SelectionState.All) {
|
|
4
|
-
|
|
5
|
-
// explicitly excluded from that selection (see ISelectionValue), not included ids.
|
|
6
|
-
if (isNested) {
|
|
7
|
-
return { indeterminate: false, checked: !selections.has(entity.id) };
|
|
8
|
-
}
|
|
9
|
-
const mainEntity = entity;
|
|
10
|
-
if (strategy === "nested" && mainEntity.children && mainEntity.children.length > 0) {
|
|
11
|
-
const allChildrenChecked = mainEntity.children.every(child => !selections.has(child.id));
|
|
12
|
-
const someChildrenChecked = mainEntity.children.some(child => !selections.has(child.id));
|
|
13
|
-
return { indeterminate: someChildrenChecked && !allChildrenChecked, checked: allChildrenChecked };
|
|
14
|
-
}
|
|
15
|
-
return { indeterminate: false, checked: !selections.has(entity.id) };
|
|
4
|
+
return { indeterminate: false, checked: true };
|
|
16
5
|
}
|
|
17
6
|
if (isNested) {
|
|
18
7
|
return { indeterminate: false, checked: selections.has(entity.id) };
|
|
@@ -34,7 +34,7 @@ injectString("tr", "Sort by Ascending", "Artan s\u0131rada s\u0131rala");
|
|
|
34
34
|
injectString("zh-Hans", "Sort by Ascending", "\u5347\u5E8F\u6392\u5E8F");
|
|
35
35
|
injectString("zh-TW", "Sort by Ascending", "\u5347\u5E8F\u6392\u5E8F");
|
|
36
36
|
injectString("ro-RO", "Sort by Ascending", "Sortare cresc\u0103toare");
|
|
37
|
-
injectString("ar", "Sort by Ascending", "\u062A\u0631\u062A\u064A\u0628 \u062A\u0635\u0627\u0639\u062F\u064A");
|
|
37
|
+
injectString("ar-001", "Sort by Ascending", "\u062A\u0631\u062A\u064A\u0628 \u062A\u0635\u0627\u0639\u062F\u064A");
|
|
38
38
|
injectString("lt-LT", "Sort by Ascending", "R\u016B\u0161iuoti did\u0117jan\u010Dia tvarka");
|
|
39
39
|
injectString("lv-LV", "Sort by Ascending", "K\u0101rtot augo\u0161\u0101 sec\u012Bb\u0101");
|
|
40
40
|
injectString("ka-GE", "Sort by Ascending", "\u10DB\u10D6\u10D0\u10E0\u10D3\u10D8 \u10D3\u10D0\u10EE\u10D0\u10E0\u10D8\u10E1\u10EE\u10D4\u10D1\u10D0");
|
|
@@ -67,7 +67,7 @@ injectString("tr", "Selected", "Se\xE7ildi");
|
|
|
67
67
|
injectString("zh-Hans", "Selected", "\u9009\u4E2D\u7684");
|
|
68
68
|
injectString("zh-TW", "Selected", "\u5DF2\u9078\u53D6");
|
|
69
69
|
injectString("ro-RO", "Selected", "Selec\u021Bie");
|
|
70
|
-
injectString("ar", "Selected", "\u0627\u0644\u0645\u062D\u062F\u062F");
|
|
70
|
+
injectString("ar-001", "Selected", "\u0627\u0644\u0645\u062D\u062F\u062F");
|
|
71
71
|
injectString("lt-LT", "Selected", "Pasirinkta");
|
|
72
72
|
injectString("lv-LV", "Selected", "Atlas\u012Bts");
|
|
73
73
|
injectString("ka-GE", "Selected", "\u10D0\u10E0\u10E9\u10D4\u10E3\u10DA\u10D8");
|
|
@@ -100,7 +100,7 @@ injectString("tr", "Sort by Descending", "Azalan s\u0131rada s\u0131rala");
|
|
|
100
100
|
injectString("zh-Hans", "Sort by Descending", "\u964D\u5E8F\u6392\u5E8F");
|
|
101
101
|
injectString("zh-TW", "Sort by Descending", "\u964D\u5E8F\u6392\u5E8F");
|
|
102
102
|
injectString("ro-RO", "Sort by Descending", "Sortare descresc\u0103toare");
|
|
103
|
-
injectString("ar", "Sort by Descending", "\u062A\u0631\u062A\u064A\u0628 \u062A\u0646\u0627\u0632\u0644\u064A");
|
|
103
|
+
injectString("ar-001", "Sort by Descending", "\u062A\u0631\u062A\u064A\u0628 \u062A\u0646\u0627\u0632\u0644\u064A");
|
|
104
104
|
injectString("lt-LT", "Sort by Descending", "R\u016B\u0161iuoti ma\u017E\u0117jan\u010Dia tvarka");
|
|
105
105
|
injectString("lv-LV", "Sort by Descending", "K\u0101rtot dilsto\u0161\u0101 sec\u012Bb\u0101");
|
|
106
106
|
injectString("ka-GE", "Sort by Descending", "\u10D9\u10DA\u10D4\u10D1\u10D0\u10D3\u10D8 \u10D3\u10D0\u10EE\u10D0\u10E0\u10D8\u10E1\u10EE\u10D4\u10D1\u10D0");
|