@geotab/zenith 3.16.0 → 3.17.0-beta.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +67 -1
- package/README.md.baseline +1 -0
- package/dist/absolute/absolute.js +5 -1
- package/dist/button/button.d.ts +2 -1
- package/dist/button/button.js +22 -5
- package/dist/checkboxListWithAction/checkboxListWithAction.d.ts +2 -0
- package/dist/checkboxListWithAction/checkboxListWithAction.js +1 -1
- package/dist/commonHelpers/ShowMoreCell.d.ts +5 -0
- package/dist/commonHelpers/ShowMoreCell.js +66 -0
- package/dist/commonHelpers/getAriaAttributes.js +6 -9
- package/dist/commonHelpers/getNonAriaProps.d.ts +11 -0
- package/dist/commonHelpers/getNonAriaProps.js +19 -0
- package/dist/commonHelpers/hooks/useScroll.d.ts +1 -1
- package/dist/commonHelpers/hooks/useScroll.js +6 -6
- package/dist/commonHelpers/isAriaProp.d.ts +9 -0
- package/dist/commonHelpers/isAriaProp.js +13 -0
- package/dist/commonHelpers/showMoreRow.d.ts +28 -0
- package/dist/commonHelpers/showMoreRow.js +29 -0
- package/dist/commonHelpers/tabsKeyboard.d.ts +1 -1
- package/dist/commonHelpers/tabsKeyboard.js +15 -1
- package/dist/commonStyles/colors/colors.less +18 -0
- package/dist/dataFeed/dataFeedColumnsItems.js +3 -1
- 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/dataGrid.d.ts +5 -1
- package/dist/dataGrid/dataGrid.js +39 -2
- package/dist/dataGrid/lazyLoadingEnd/lazyLoadingEnd.d.ts +3 -0
- package/dist/dataGrid/lazyLoadingEnd/lazyLoadingEnd.js +54 -0
- package/dist/dataGrid/row/row.js +20 -2
- package/dist/dataGrid/withSelectableRows/components/bulkActions/bulkActions.d.ts +3 -1
- package/dist/dataGrid/withSelectableRows/components/bulkActions/bulkActions.js +39 -4
- package/dist/dataGrid/withSelectableRows/withSelectableRows.js +73 -12
- package/dist/dropdown/dropdownTrigger.d.ts +1 -1
- package/dist/dropdownRaw/dropdownHelper.d.ts +12 -0
- package/dist/dropdownRaw/dropdownHelper.js +32 -11
- package/dist/dropdownRaw/dropdownRaw.js +36 -8
- package/dist/dropdownRaw/dropdownSearchableTrigger.d.ts +2 -1
- package/dist/dropdownRaw/dropdownSearchableTrigger.js +13 -6
- package/dist/dropdownRaw/dropdownTrigger.d.ts +2 -1
- package/dist/dropdownRaw/dropdownTrigger.js +2 -2
- package/dist/dropdownRaw/stateReducer/stateReducer.d.ts +8 -0
- package/dist/dropdownRaw/stateReducer/stateReducer.js +5 -2
- package/dist/dropdownRaw/types.d.ts +36 -0
- package/dist/filterButton/filterButton.d.ts +1 -1
- package/dist/formGroup/hooks/rowHooks/useLabelClasses.js +8 -2
- package/dist/formLayout/utils/applyLayoutPosition/applyLayoutPosition.d.ts +2 -1
- package/dist/formLayout/utils/applyLayoutPosition/applyLayoutPosition.js +37 -90
- package/dist/header/components/collapsedItemsControl/collapsedItemsControl.d.ts +1 -1
- package/dist/header/components/collapsedItemsControl/collapsedItemsControl.js +6 -2
- package/dist/header/headerButton.d.ts +3 -1
- package/dist/header/headerButton.js +4 -2
- package/dist/header/headerMenu.d.ts +2 -0
- package/dist/header/headerMenu.js +1 -1
- package/dist/index.css +319 -68
- package/dist/index.d.ts +3 -1
- package/dist/index.js +9 -3
- package/dist/menu/components/menuButton.d.ts +3 -1
- package/dist/menu/components/menuButton.js +66 -47
- package/dist/menu/components/menuItem.js +4 -4
- package/dist/miniTabs/miniTabs.js +4 -2
- package/dist/pageHeader/pageHeaderButton.d.ts +1 -1
- package/dist/pageHeader/pageHeaderButton.js +4 -2
- package/dist/pagination/pagination.d.ts +19 -4
- package/dist/pagination/pagination.js +21 -1
- package/dist/pagination/paginationText/paginationText.d.ts +7 -1
- package/dist/pagination/paginationText/paginationText.js +6 -3
- package/dist/pillExpandable/pillContent.d.ts +3 -2
- package/dist/pillExpandable/pillContent.js +2 -2
- package/dist/pillExpandable/pillExpandable.js +20 -5
- package/dist/pillExpandable/pillExpandablePopoverContent.d.ts +3 -2
- package/dist/pillExpandable/pillExpandablePopoverContent.js +1 -1
- package/dist/pillExpandable/pillExpandableSimple.d.ts +3 -1
- package/dist/pillExpandable/pillExpandableSimple.js +19 -9
- package/dist/selectList/selectList.js +1 -0
- package/dist/selectList/selectListItem.d.ts +10 -1
- package/dist/selectList/selectListItem.js +12 -9
- package/dist/table/children/tablePagination.d.ts +1 -1
- package/dist/table/children/useTableChildren.d.ts +4 -2
- package/dist/table/children/useTableChildren.js +64 -16
- package/dist/table/nested/nestedData.d.ts +29 -1
- package/dist/table/nested/nestedData.js +45 -4
- package/dist/table/nested/useNestedRows.js +18 -22
- package/dist/table/nested/useShowMore.d.ts +41 -0
- package/dist/table/nested/useShowMore.js +56 -0
- package/dist/table/selectable/interfaces.d.ts +17 -0
- package/dist/table/selectable/useDragSelection.d.ts +10 -0
- package/dist/table/selectable/useDragSelection.js +145 -0
- package/dist/table/selectable/useSelectableRows.d.ts +5 -2
- package/dist/table/selectable/useSelectableRows.js +131 -36
- package/dist/table/selectable/utils/calculateSelectionState.d.ts +1 -1
- package/dist/table/selectable/utils/calculateSelectionState.js +43 -7
- package/dist/table/selectable/utils/checkRow.js +4 -2
- package/dist/table/selectable/utils/getCurrentPageSelection.js +9 -5
- 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.d.ts +1 -1
- package/dist/table/selectable/utils/isRowChecked.js +40 -7
- package/dist/table/table.d.ts +1 -2
- package/dist/table/table.js +58 -31
- package/dist/tabs/tabs.d.ts +1 -0
- package/dist/tabs/tabs.js +50 -17
- package/dist/textInputRaw/textInputRaw.js +3 -2
- package/dist/tooltip/tooltip.d.ts +2 -0
- package/dist/tooltip/tooltip.js +19 -7
- package/dist/utils/localization/translations/ar-001.json +1 -0
- package/dist/utils/localization/translations/bg-BG.json +1 -0
- package/dist/utils/localization/translations/cs.json +1 -0
- package/dist/utils/localization/translations/da-DK.json +1 -0
- package/dist/utils/localization/translations/de.json +1 -0
- package/dist/utils/localization/translations/el-GR.json +1 -0
- package/dist/utils/localization/translations/en.json +4 -0
- package/dist/utils/localization/translations/es.json +1 -0
- package/dist/utils/localization/translations/et-EE.json +1 -0
- package/dist/utils/localization/translations/fi-FI.json +1 -0
- package/dist/utils/localization/translations/fr-FR.json +1 -0
- package/dist/utils/localization/translations/fr.json +1 -0
- package/dist/utils/localization/translations/hu-HU.json +1 -0
- package/dist/utils/localization/translations/id.json +1 -0
- package/dist/utils/localization/translations/it.json +1 -0
- package/dist/utils/localization/translations/ja.json +1 -0
- package/dist/utils/localization/translations/ka-GE.json +1 -0
- package/dist/utils/localization/translations/ko-KR.json +1 -0
- package/dist/utils/localization/translations/lt-LT.json +1 -0
- package/dist/utils/localization/translations/lv-LV.json +1 -0
- package/dist/utils/localization/translations/ms.json +1 -0
- package/dist/utils/localization/translations/nb-NO.json +1 -0
- package/dist/utils/localization/translations/nl.json +1 -0
- package/dist/utils/localization/translations/pl.json +1 -0
- package/dist/utils/localization/translations/pt-BR.json +1 -0
- package/dist/utils/localization/translations/pt-PT.json +1 -0
- package/dist/utils/localization/translations/ro-RO.json +1 -0
- package/dist/utils/localization/translations/sk-SK.json +1 -0
- package/dist/utils/localization/translations/sv.json +1 -0
- package/dist/utils/localization/translations/th.json +1 -0
- package/dist/utils/localization/translations/tr.json +1 -0
- package/dist/utils/localization/translations/zh-Hans.json +1 -0
- package/dist/utils/localization/translations/zh-TW.json +1 -0
- package/dist/waiting/waiting.js +95 -1
- package/esm/absolute/absolute.js +5 -1
- package/esm/button/button.d.ts +2 -1
- package/esm/button/button.js +22 -5
- package/esm/checkboxListWithAction/checkboxListWithAction.d.ts +2 -0
- package/esm/checkboxListWithAction/checkboxListWithAction.js +1 -1
- package/esm/commonHelpers/ShowMoreCell.d.ts +5 -0
- package/esm/commonHelpers/ShowMoreCell.js +57 -0
- package/esm/commonHelpers/getAriaAttributes.js +6 -9
- package/esm/commonHelpers/getNonAriaProps.d.ts +11 -0
- package/esm/commonHelpers/getNonAriaProps.js +15 -0
- package/esm/commonHelpers/hooks/useScroll.d.ts +1 -1
- package/esm/commonHelpers/hooks/useScroll.js +6 -6
- package/esm/commonHelpers/isAriaProp.d.ts +9 -0
- package/esm/commonHelpers/isAriaProp.js +9 -0
- package/esm/commonHelpers/showMoreRow.d.ts +28 -0
- package/esm/commonHelpers/showMoreRow.js +22 -0
- package/esm/commonHelpers/tabsKeyboard.d.ts +1 -1
- package/esm/commonHelpers/tabsKeyboard.js +15 -1
- package/esm/commonStyles/colors/colorsConstant.js +11 -11
- package/esm/dataFeed/dataFeedColumnsItems.js +3 -1
- 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/dataGrid.d.ts +5 -1
- package/esm/dataGrid/dataGrid.js +38 -2
- package/esm/dataGrid/lazyLoadingEnd/lazyLoadingEnd.d.ts +3 -0
- package/esm/dataGrid/lazyLoadingEnd/lazyLoadingEnd.js +45 -0
- package/esm/dataGrid/row/row.js +20 -2
- package/esm/dataGrid/withSelectableRows/components/bulkActions/bulkActions.d.ts +3 -1
- package/esm/dataGrid/withSelectableRows/components/bulkActions/bulkActions.js +39 -4
- package/esm/dataGrid/withSelectableRows/withSelectableRows.js +73 -12
- package/esm/dropdown/dropdownTrigger.d.ts +1 -1
- package/esm/dropdownRaw/dropdownHelper.d.ts +12 -0
- package/esm/dropdownRaw/dropdownHelper.js +30 -10
- package/esm/dropdownRaw/dropdownRaw.js +37 -9
- package/esm/dropdownRaw/dropdownSearchableTrigger.d.ts +2 -1
- package/esm/dropdownRaw/dropdownSearchableTrigger.js +13 -6
- package/esm/dropdownRaw/dropdownTrigger.d.ts +2 -1
- package/esm/dropdownRaw/dropdownTrigger.js +2 -2
- package/esm/dropdownRaw/stateReducer/stateReducer.d.ts +8 -0
- package/esm/dropdownRaw/stateReducer/stateReducer.js +5 -2
- package/esm/dropdownRaw/types.d.ts +36 -0
- package/esm/filterButton/filterButton.d.ts +1 -1
- package/esm/formGroup/hooks/rowHooks/useLabelClasses.js +8 -2
- package/esm/formLayout/utils/applyLayoutPosition/applyLayoutPosition.d.ts +2 -1
- package/esm/formLayout/utils/applyLayoutPosition/applyLayoutPosition.js +37 -90
- package/esm/header/components/collapsedItemsControl/collapsedItemsControl.d.ts +1 -1
- package/esm/header/components/collapsedItemsControl/collapsedItemsControl.js +6 -2
- package/esm/header/headerButton.d.ts +3 -1
- package/esm/header/headerButton.js +4 -2
- package/esm/header/headerMenu.d.ts +2 -0
- package/esm/header/headerMenu.js +1 -1
- package/esm/index.d.ts +3 -1
- package/esm/index.js +3 -1
- package/esm/menu/components/menuButton.d.ts +3 -1
- package/esm/menu/components/menuButton.js +66 -47
- package/esm/menu/components/menuItem.js +4 -4
- package/esm/miniTabs/miniTabs.js +4 -2
- package/esm/pageHeader/pageHeaderButton.d.ts +1 -1
- package/esm/pageHeader/pageHeaderButton.js +4 -2
- package/esm/pagination/pagination.d.ts +19 -4
- package/esm/pagination/pagination.js +21 -1
- package/esm/pagination/paginationText/paginationText.d.ts +7 -1
- package/esm/pagination/paginationText/paginationText.js +6 -3
- package/esm/pillExpandable/pillContent.d.ts +3 -2
- package/esm/pillExpandable/pillContent.js +2 -2
- package/esm/pillExpandable/pillExpandable.js +20 -5
- package/esm/pillExpandable/pillExpandablePopoverContent.d.ts +3 -2
- package/esm/pillExpandable/pillExpandablePopoverContent.js +1 -1
- package/esm/pillExpandable/pillExpandableSimple.d.ts +3 -1
- package/esm/pillExpandable/pillExpandableSimple.js +20 -10
- package/esm/selectList/selectList.js +1 -0
- package/esm/selectList/selectListItem.d.ts +10 -1
- package/esm/selectList/selectListItem.js +12 -9
- package/esm/table/children/tablePagination.d.ts +1 -1
- package/esm/table/children/useTableChildren.d.ts +4 -2
- package/esm/table/children/useTableChildren.js +64 -16
- package/esm/table/nested/nestedData.d.ts +29 -1
- package/esm/table/nested/nestedData.js +44 -3
- package/esm/table/nested/useNestedRows.js +18 -22
- package/esm/table/nested/useShowMore.d.ts +41 -0
- package/esm/table/nested/useShowMore.js +52 -0
- package/esm/table/selectable/interfaces.d.ts +17 -0
- package/esm/table/selectable/useDragSelection.d.ts +10 -0
- package/esm/table/selectable/useDragSelection.js +141 -0
- package/esm/table/selectable/useSelectableRows.d.ts +5 -2
- package/esm/table/selectable/useSelectableRows.js +129 -35
- package/esm/table/selectable/utils/calculateSelectionState.d.ts +1 -1
- package/esm/table/selectable/utils/calculateSelectionState.js +43 -7
- package/esm/table/selectable/utils/checkRow.js +4 -2
- package/esm/table/selectable/utils/getCurrentPageSelection.js +9 -5
- 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.d.ts +1 -1
- package/esm/table/selectable/utils/isRowChecked.js +40 -7
- package/esm/table/table.d.ts +1 -2
- package/esm/table/table.js +43 -16
- package/esm/tabs/tabs.d.ts +1 -0
- package/esm/tabs/tabs.js +50 -17
- package/esm/textInputRaw/textInputRaw.js +3 -2
- package/esm/tooltip/tooltip.d.ts +2 -0
- package/esm/tooltip/tooltip.js +19 -7
- package/esm/utils/localization/translations/ar-001.json +1 -0
- package/esm/utils/localization/translations/bg-BG.json +1 -0
- package/esm/utils/localization/translations/cs.json +1 -0
- package/esm/utils/localization/translations/da-DK.json +1 -0
- package/esm/utils/localization/translations/de.json +1 -0
- package/esm/utils/localization/translations/el-GR.json +1 -0
- package/esm/utils/localization/translations/en.json +4 -0
- package/esm/utils/localization/translations/es.json +1 -0
- package/esm/utils/localization/translations/et-EE.json +1 -0
- package/esm/utils/localization/translations/fi-FI.json +1 -0
- package/esm/utils/localization/translations/fr-FR.json +1 -0
- package/esm/utils/localization/translations/fr.json +1 -0
- package/esm/utils/localization/translations/hu-HU.json +1 -0
- package/esm/utils/localization/translations/id.json +1 -0
- package/esm/utils/localization/translations/it.json +1 -0
- package/esm/utils/localization/translations/ja.json +1 -0
- package/esm/utils/localization/translations/ka-GE.json +1 -0
- package/esm/utils/localization/translations/ko-KR.json +1 -0
- package/esm/utils/localization/translations/lt-LT.json +1 -0
- package/esm/utils/localization/translations/lv-LV.json +1 -0
- package/esm/utils/localization/translations/ms.json +1 -0
- package/esm/utils/localization/translations/nb-NO.json +1 -0
- package/esm/utils/localization/translations/nl.json +1 -0
- package/esm/utils/localization/translations/pl.json +1 -0
- package/esm/utils/localization/translations/pt-BR.json +1 -0
- package/esm/utils/localization/translations/pt-PT.json +1 -0
- package/esm/utils/localization/translations/ro-RO.json +1 -0
- package/esm/utils/localization/translations/sk-SK.json +1 -0
- package/esm/utils/localization/translations/sv.json +1 -0
- package/esm/utils/localization/translations/th.json +1 -0
- package/esm/utils/localization/translations/tr.json +1 -0
- package/esm/utils/localization/translations/zh-Hans.json +1 -0
- package/esm/utils/localization/translations/zh-TW.json +1 -0
- package/esm/waiting/waiting.js +96 -2
- package/package.json +18 -6
package/dist/index.d.ts
CHANGED
|
@@ -736,6 +736,7 @@ export { PageLayout } from "./pageLayout/pageLayout";
|
|
|
736
736
|
export { type IPagination, Pagination } from "./pagination/pagination";
|
|
737
737
|
export { PaginationType } from "./pagination/paginationType";
|
|
738
738
|
export { Pill } from "./pill/pill";
|
|
739
|
+
export { DEFAULT_MAX_PILLS, type IPillData, type IPillBox, PillBox } from "./pillBox/pillBox";
|
|
739
740
|
export { type IPillExpandableAction, type IBaseData, type IPromisedBaseData, type TPopoverSize, type IPillExpandable, PillExpandable } from "./pillExpandable/pillExpandable";
|
|
740
741
|
export { type IPopup, Popup } from "./popup/popup";
|
|
741
742
|
export { type IPrimaryIcon, PrimaryIcon } from "./primaryIcon/primaryIcon";
|
|
@@ -762,8 +763,9 @@ export { type ISummaryTileBar, SummaryTileBar, SummaryTileBarDisplayName } from
|
|
|
762
763
|
export { type ITab, type ITabBar, TabBar } from "./tabBar/tabBar";
|
|
763
764
|
export { type ITabBarContent, TabBarContent } from "./tabBar/tabBarContent";
|
|
764
765
|
export { type ITableDetailPanel } from "./table/children/tableDetailPanel";
|
|
765
|
-
export { NestedData } from "./table/nested/nestedData";
|
|
766
|
+
export { DEFAULT_SHOW_MORE_CAP, type IShowMoreOptions, NestedData } from "./table/nested/nestedData";
|
|
766
767
|
export { useNestedRows } from "./table/nested/useNestedRows";
|
|
768
|
+
export { type IUseShowMoreConfig, useShowMore } from "./table/nested/useShowMore";
|
|
767
769
|
export { type IListColumn, type TFeedResult, type IFeedExpandable, type ITable, type IListColumnWrapper, Table, getEmptySelection, ColumnSortDirection, getSortableValue, ActionsColumn, MainColumn, CheckboxColumn, ActionLinkColumn } from "./table/table";
|
|
768
770
|
export { type ITabElement, type ITabs, TabsDisplayName, Tabs } from "./tabs/tabs";
|
|
769
771
|
export { type TTagColor, type ITag } from "./tag/tag";
|
package/dist/index.js
CHANGED
|
@@ -16,9 +16,9 @@ exports.IconPinLocation2 = exports.IconPinLocation = exports.IconPinFilled = exp
|
|
|
16
16
|
exports.IconSettings8 = exports.IconSettings7 = exports.IconSettings6 = exports.IconSettings4 = exports.IconSettings3 = exports.IconSettings2 = exports.IconSettings1 = exports.IconServer3 = exports.IconServer2 = exports.IconServer = exports.IconSend = exports.IconSecuredLines = exports.IconSecured = exports.IconSeatbelt = exports.IconSearchPage = exports.IconSearchLines = exports.IconSearchDocument = exports.IconSearch = exports.IconSdCard = exports.IconRuler = exports.IconRoute = exports.IconRotateRepeat2 = exports.IconRotateRepeat = exports.IconRotateCounterclockwise = exports.IconRotateClockwise = exports.IconResizeSmall = exports.IconResizeBig = exports.IconRepeat2 = exports.IconRepeat = exports.IconRemovePeople = exports.IconRefrigeration = exports.IconRedo2 = exports.IconRedo = exports.IconRecord = exports.IconReceipt = exports.IconRadar = exports.IconQuestion = exports.IconPuzzle = exports.IconPullRequest = exports.IconProcessor = exports.IconPrinter = exports.IconPound = exports.IconPotato = exports.IconPlusSquare = exports.IconPlusLines = exports.IconPlusFile = exports.IconPlusCircle = exports.IconPlus = exports.IconPlay = exports.IconPinLocation3 = void 0;
|
|
17
17
|
exports.IconUsb = exports.IconUpload = exports.IconUnlocked = exports.IconUndock = exports.IconUndo2 = exports.IconUndo = exports.IconUnderline = exports.IconUmbrella = exports.IconTruck = exports.IconTrendNeutral = exports.IconTrailer = exports.IconToggleSmall = exports.IconToggleLarge = exports.IconThumbsUp = exports.IconThumbsDown = exports.IconThermometer = exports.IconThermograph = exports.IconTextSize = exports.IconTelevision2 = exports.IconTelevision = exports.IconTarget3 = exports.IconTarget2 = exports.IconTarget = exports.IconTachographTimeCard = exports.IconTachograph = exports.IconTable = exports.IconSupport = exports.IconSun = exports.IconStrikeThrough = exports.IconStore = exports.IconStorage = exports.IconStopwatch = exports.IconStarFilled = exports.IconStarAi = exports.IconStar = exports.IconSquare = exports.IconSpeaker = exports.IconSortVertical = exports.IconSortHorizontal = exports.IconSort2Vertical = exports.IconSort2Horizontal = exports.IconSmiley = exports.IconSign = exports.IconSidebar = exports.IconShield4 = exports.IconShield3 = exports.IconShield2 = exports.IconShield = exports.IconShare3 = exports.IconShare = void 0;
|
|
18
18
|
exports.ListItem = exports.List = exports.ItemData = exports.ItemCompact = exports.LineChartMini = exports.getDefaultDatasetStyle = exports.htmlLegendPlugin = exports.LEGEND_PLUGIN_ID = exports.LineChart = exports.useLayoutSize = exports.LayoutFullScreenProvider = exports.useLayoutFullScreen = exports.LayoutFullScreenElementProvider = exports.useLayoutFullScreenElement = exports.Layout = exports.ImageTapToUpload = exports.ImageNothingFound = exports.ImageNoMatchingAssets = exports.ImageLooking = exports.ImageCloudUpload = exports.ImageAdjustFilter = exports.IconZoom2 = exports.IconZoom = exports.IconZone = exports.IconYen = exports.IconWrite = exports.IconWrench = exports.IconWorld = exports.IconWorkday = exports.IconWifi2 = exports.IconWifi = exports.IconWhisper = exports.IconWebcam = exports.IconWatch2 = exports.IconWatch = exports.IconWarning = exports.IconWallet1 = exports.IconWallet = exports.IconVolumeOn = exports.IconVolumeOff = exports.IconVolumeMinimum = exports.IconVolumeHalf = exports.IconVolumeFull = exports.IconVolumeDown = exports.IconVoice = exports.IconVisitPage = exports.IconVideoReplay = exports.IconVideo2 = exports.IconVideo = exports.IconUsbHub = void 0;
|
|
19
|
-
exports.
|
|
20
|
-
exports.
|
|
21
|
-
exports.Waiting = exports.UserFormatProvider = exports.useDrive = exports.ThemeProvider = exports.ThemeDrive = exports.ThemeDark = exports.useLanguage = exports.useDirection = exports.injectString = exports.dictionaries = void 0;
|
|
19
|
+
exports.SidePanel = exports.CUSTOM_POPUP_COMPONENT_CLASSNAME = exports.SidePanelCloseReason = exports.isChildPopup = exports.SelectField = exports.Select = exports.SearchInput = exports.Range = exports.RadioGroup = exports.Radio = exports.getProgressIndicatorPercent = exports.getProgressIndicatorValue = exports.ProgressIndicatorType = exports.ProgressBar = exports.ProgreesBarSize = exports.ProgressBarType = exports.PrimaryIcon = exports.Popup = exports.PillExpandable = exports.PillBox = exports.DEFAULT_MAX_PILLS = exports.Pill = exports.PaginationType = exports.Pagination = exports.PageLayout = exports.PageContentLayout = exports.PageHeaderMenu = exports.PageHeaderMenuDisplayName = exports.PageHeaderButton = exports.PageHeaderButtonDisplayName = exports.PageHeader = exports.PageHeaderDisplayName = exports.Notification = exports.getPredefinedFocusableItem = exports.DialogContentNew = exports.Modal = exports.MODAL_SCROLL_LOCK_CLASS = exports.MobileSheet = exports.MiniTabs = exports.MiniTabsSize = exports.isLink = exports.isButton = exports.findPrevFocusable = exports.findNextFocusable = exports.findLastFocusable = exports.findFirstFocusable = exports.Menu = exports.ControlledMenu = exports.isDragNotClick = exports.changeOrder = void 0;
|
|
20
|
+
exports.useExperimentalFeature = exports.EXPERIMENTAL_FLAGS = exports.ZenithExperimentalProvider = exports.AbortablePromise = exports.getTrendIndicatorDirection = exports.Tooltip = exports.removeArrowClasses = exports.calculateArrowPosition = exports.ToggleButtonRaw = exports.ToggleButton = exports.Toast = exports.useToast = exports.TimePicker = exports.TextareaRaw = exports.Textarea = exports.TextInputRaw = exports.TextInput = exports.TextIconButton = exports.ButtonIconPosition = exports.Tabs = exports.TabsDisplayName = exports.ActionLinkColumn = exports.CheckboxColumn = exports.MainColumn = exports.ActionsColumn = exports.getSortableValue = exports.ColumnSortDirection = exports.getEmptySelection = exports.Table = exports.useShowMore = exports.useNestedRows = exports.NestedData = exports.DEFAULT_SHOW_MORE_CAP = exports.TabBarContent = exports.TabBar = exports.SummaryTileBarDisplayName = exports.SummaryTileBar = exports.getTypeClassName = exports.SummaryTileTrigger = exports.SummaryTile = exports.SummaryTileDisplayName = exports.SummaryTileSize = exports.SummaryTileType = exports.Summary = exports.Summaries = exports.Stepper = exports.SortControl = exports.SortDirections = exports.Skeleton = exports.LazyContent = void 0;
|
|
21
|
+
exports.Waiting = exports.UserFormatProvider = exports.useDrive = exports.ThemeProvider = exports.ThemeDrive = exports.ThemeDark = exports.useLanguage = exports.useDirection = exports.injectString = exports.dictionaries = exports.LanguageProvider = exports.getFirstFocusableItem = exports.getNewFocusableItem = exports.HeaderButtonsProvider = void 0;
|
|
22
22
|
/* eslint-disable max-len */
|
|
23
23
|
var absolute_1 = require("./absolute/absolute");
|
|
24
24
|
Object.defineProperty(exports, "Absolute", { enumerable: true, get: function () { return absolute_1.Absolute; } });
|
|
@@ -1572,6 +1572,9 @@ var paginationType_1 = require("./pagination/paginationType");
|
|
|
1572
1572
|
Object.defineProperty(exports, "PaginationType", { enumerable: true, get: function () { return paginationType_1.PaginationType; } });
|
|
1573
1573
|
var pill_1 = require("./pill/pill");
|
|
1574
1574
|
Object.defineProperty(exports, "Pill", { enumerable: true, get: function () { return pill_1.Pill; } });
|
|
1575
|
+
var pillBox_1 = require("./pillBox/pillBox");
|
|
1576
|
+
Object.defineProperty(exports, "DEFAULT_MAX_PILLS", { enumerable: true, get: function () { return pillBox_1.DEFAULT_MAX_PILLS; } });
|
|
1577
|
+
Object.defineProperty(exports, "PillBox", { enumerable: true, get: function () { return pillBox_1.PillBox; } });
|
|
1575
1578
|
var pillExpandable_1 = require("./pillExpandable/pillExpandable");
|
|
1576
1579
|
Object.defineProperty(exports, "PillExpandable", { enumerable: true, get: function () { return pillExpandable_1.PillExpandable; } });
|
|
1577
1580
|
var popup_1 = require("./popup/popup");
|
|
@@ -1634,9 +1637,12 @@ Object.defineProperty(exports, "TabBar", { enumerable: true, get: function () {
|
|
|
1634
1637
|
var tabBarContent_1 = require("./tabBar/tabBarContent");
|
|
1635
1638
|
Object.defineProperty(exports, "TabBarContent", { enumerable: true, get: function () { return tabBarContent_1.TabBarContent; } });
|
|
1636
1639
|
var nestedData_1 = require("./table/nested/nestedData");
|
|
1640
|
+
Object.defineProperty(exports, "DEFAULT_SHOW_MORE_CAP", { enumerable: true, get: function () { return nestedData_1.DEFAULT_SHOW_MORE_CAP; } });
|
|
1637
1641
|
Object.defineProperty(exports, "NestedData", { enumerable: true, get: function () { return nestedData_1.NestedData; } });
|
|
1638
1642
|
var useNestedRows_1 = require("./table/nested/useNestedRows");
|
|
1639
1643
|
Object.defineProperty(exports, "useNestedRows", { enumerable: true, get: function () { return useNestedRows_1.useNestedRows; } });
|
|
1644
|
+
var useShowMore_1 = require("./table/nested/useShowMore");
|
|
1645
|
+
Object.defineProperty(exports, "useShowMore", { enumerable: true, get: function () { return useShowMore_1.useShowMore; } });
|
|
1640
1646
|
var table_1 = require("./table/table");
|
|
1641
1647
|
Object.defineProperty(exports, "Table", { enumerable: true, get: function () { return table_1.Table; } });
|
|
1642
1648
|
Object.defineProperty(exports, "getEmptySelection", { enumerable: true, get: function () { return table_1.getEmptySelection; } });
|
|
@@ -9,6 +9,8 @@ interface IMenuButtonInternal {
|
|
|
9
9
|
export interface IMenuButton extends IZenIdComponentProps {
|
|
10
10
|
name: string;
|
|
11
11
|
icon?: FC<IIcon>;
|
|
12
|
+
iconOpen?: boolean;
|
|
13
|
+
destructive?: boolean;
|
|
12
14
|
disabled?: boolean;
|
|
13
15
|
link?: string;
|
|
14
16
|
target?: string;
|
|
@@ -18,5 +20,5 @@ export interface IMenuButton extends IZenIdComponentProps {
|
|
|
18
20
|
ref?: RefObject<HTMLButtonElement | null>;
|
|
19
21
|
dataAnalyticsId?: string;
|
|
20
22
|
}
|
|
21
|
-
export declare const MenuButton: ({ id, onClick, hasChildren, disabled, icon, name, link, target, rel, className, active, ref, dataAnalyticsId }: IMenuButton & IMenuButtonInternal) => import("react/jsx-runtime").JSX.Element;
|
|
23
|
+
export declare const MenuButton: ({ id, onClick, hasChildren, disabled, icon, iconOpen, destructive, name, link, target, rel, className, active, ref, dataAnalyticsId }: IMenuButton & IMenuButtonInternal) => import("react/jsx-runtime").JSX.Element;
|
|
22
24
|
export {};
|
|
@@ -6,63 +6,82 @@ const react_1 = require("react");
|
|
|
6
6
|
const classNames_1 = require("../../commonHelpers/classNames/classNames");
|
|
7
7
|
const iconChevronRight_1 = require("../../icons/iconChevronRight");
|
|
8
8
|
const iconChevronLeft_1 = require("../../icons/iconChevronLeft");
|
|
9
|
+
const iconOpen_1 = require("../../icons/iconOpen");
|
|
9
10
|
const useDirectionalIcon_1 = require("../../utils/localization/useDirectionalIcon");
|
|
10
11
|
const useDriveClassName_1 = require("../../utils/theme/useDriveClassName");
|
|
11
12
|
const useDrive_1 = require("../../utils/theme/useDrive");
|
|
12
13
|
const getMenuButtonState_1 = require("../utils/getMenuButtonState");
|
|
13
14
|
const isSafeHref_1 = require("../utils/isSafeHref");
|
|
14
15
|
const getSafeRel_1 = require("../utils/getSafeRel");
|
|
15
|
-
|
|
16
|
+
// Templates below drop native `disabled` to stay focusable/hoverable; this guard blocks activation instead.
|
|
17
|
+
const handleDisabledGuardedClick = (e, disabled, id, onClick) => {
|
|
18
|
+
if (disabled) {
|
|
19
|
+
e.preventDefault();
|
|
20
|
+
e.stopPropagation();
|
|
21
|
+
return;
|
|
22
|
+
}
|
|
23
|
+
onClick === null || onClick === void 0 ? void 0 : onClick(id, e);
|
|
24
|
+
};
|
|
25
|
+
// Skip Space-to-activate when disabled, so it doesn't flash `--active` or self-click via `linkEl.click()`.
|
|
26
|
+
const createDisabledGuardedLinkKeyEvents = (disabled) => ({
|
|
27
|
+
onKeyDown: (e) => {
|
|
28
|
+
if (disabled || e.key !== " ") {
|
|
29
|
+
return;
|
|
30
|
+
}
|
|
31
|
+
e.preventDefault();
|
|
32
|
+
const linkEl = e.target;
|
|
33
|
+
linkEl.dataset.spaceDown = "1";
|
|
34
|
+
linkEl.classList.add("zen-menu-button__action--active");
|
|
35
|
+
},
|
|
36
|
+
onKeyUp: (e) => {
|
|
37
|
+
if (disabled || e.key !== " ") {
|
|
38
|
+
return;
|
|
39
|
+
}
|
|
40
|
+
e.preventDefault();
|
|
41
|
+
const linkEl = e.target;
|
|
42
|
+
linkEl.classList.remove("zen-menu-button__action--active");
|
|
43
|
+
if (linkEl.dataset.spaceDown) {
|
|
44
|
+
delete linkEl.dataset.spaceDown;
|
|
45
|
+
linkEl.click();
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
});
|
|
49
|
+
const getMenuButtonActionClassName = (hasChildren, hasState, isActive, disabled, destructiveClass, driveClasses) => (0, classNames_1.classNames)([
|
|
50
|
+
"zen-menu-button__action",
|
|
51
|
+
"zen-button",
|
|
52
|
+
"zen-caption",
|
|
53
|
+
hasChildren ? "zen-menu-button__action--has-children" : "",
|
|
54
|
+
hasState && isActive ? "zen-menu-button__action--active" : "",
|
|
55
|
+
disabled ? "zen-menu-button__action--disabled" : "",
|
|
56
|
+
disabled ? "zen-button--disabled" : "",
|
|
57
|
+
disabled ? "zen-button--disabled-focusable" : "",
|
|
58
|
+
destructiveClass,
|
|
59
|
+
driveClasses || ""
|
|
60
|
+
]);
|
|
61
|
+
const getMenuLinkActionClassName = (disabled, destructiveClass, driveClasses) => (0, classNames_1.classNames)(["zen-menu-button__action", "zen-caption", disabled ? "zen-menu-button__action--disabled" : "", destructiveClass, driveClasses || ""]);
|
|
62
|
+
// An <a> without `href` isn't tabbable, so `tabIndex="0"` keeps a disabled link item in the tab order.
|
|
63
|
+
const getMenuLinkAccessibilityProps = (disabled, link) => ({
|
|
64
|
+
href: disabled || !(0, isSafeHref_1.isSafeHref)(link) ? undefined : link,
|
|
65
|
+
tabIndex: disabled ? 0 : undefined,
|
|
66
|
+
"aria-disabled": disabled
|
|
67
|
+
});
|
|
68
|
+
const getMenuItemRole = (hasState) => (hasState ? "menuitemcheckbox" : "menuitem");
|
|
69
|
+
const getMenuItemAriaChecked = (hasState, isActive) => (hasState ? isActive : undefined);
|
|
70
|
+
const createMenuIcon = (iconComponent, size, className) => iconComponent ? (0, react_1.createElement)(iconComponent, { size, className }) : null;
|
|
71
|
+
const resolveTarget = (target, iconOpen) => target !== null && target !== void 0 ? target : (iconOpen ? "_blank" : undefined);
|
|
72
|
+
const MenuButton = ({ id, onClick, hasChildren, disabled, icon, iconOpen, destructive, name, link, target, rel, className = "", active = null, ref, dataAnalyticsId }) => {
|
|
16
73
|
const { hasState, isActive } = (0, getMenuButtonState_1.getMenuButtonState)(active, disabled);
|
|
17
74
|
const driveMenuButtonActionClasses = (0, useDriveClassName_1.useDriveClassName)("zen-menu-button__action");
|
|
18
75
|
const isDrive = (0, useDrive_1.useDrive)();
|
|
76
|
+
const iconSize = isDrive ? "huge" : "large";
|
|
77
|
+
const destructiveClass = destructive ? "zen-menu-button__action--destructive" : "";
|
|
78
|
+
const effectiveTarget = resolveTarget(target, iconOpen);
|
|
19
79
|
const ChevronIcon = (0, useDirectionalIcon_1.useDirectionalIcon)(iconChevronRight_1.IconChevronRight, iconChevronLeft_1.IconChevronLeft);
|
|
20
|
-
const linkEvents = (0, react_1.useMemo)(() => (
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
linkEl.dataset.spaceDown = "1";
|
|
26
|
-
linkEl.classList.add("zen-menu-button__action--active");
|
|
27
|
-
}
|
|
28
|
-
},
|
|
29
|
-
onKeyUp: e => {
|
|
30
|
-
if (e.key === " ") {
|
|
31
|
-
e.preventDefault();
|
|
32
|
-
const linkEl = e.target;
|
|
33
|
-
linkEl.classList.remove("zen-menu-button__action--active");
|
|
34
|
-
if (linkEl.dataset.spaceDown) {
|
|
35
|
-
delete linkEl.dataset.spaceDown;
|
|
36
|
-
linkEl.click();
|
|
37
|
-
}
|
|
38
|
-
}
|
|
39
|
-
}
|
|
40
|
-
}), []);
|
|
41
|
-
const onClickHandler = (0, react_1.useCallback)((e) => {
|
|
42
|
-
onClick === null || onClick === void 0 ? void 0 : onClick(id, e);
|
|
43
|
-
}, [id, onClick]);
|
|
44
|
-
const buttonTemplate = ((0, jsx_runtime_1.jsxs)("button", { type: "button", "data-id": id, ref: ref, disabled: !!disabled, title: name, className: (0, classNames_1.classNames)([
|
|
45
|
-
"zen-menu-button__action",
|
|
46
|
-
"zen-button",
|
|
47
|
-
"zen-caption",
|
|
48
|
-
hasChildren ? "zen-menu-button__action--has-children" : "",
|
|
49
|
-
hasState && isActive ? "zen-menu-button__action--active" : "",
|
|
50
|
-
driveMenuButtonActionClasses || ""
|
|
51
|
-
]), role: hasState ? "menuitemcheckbox" : "menuitem", onClick: onClickHandler, "aria-checked": hasState ? isActive : undefined, "data-analytics-id": dataAnalyticsId, children: [!!icon &&
|
|
52
|
-
(0, react_1.createElement)(icon, {
|
|
53
|
-
size: isDrive ? "huge" : "large",
|
|
54
|
-
className: (0, classNames_1.classNames)(["zen-caption__pre-content", "zen-menu-button__icon"])
|
|
55
|
-
}), (0, jsx_runtime_1.jsx)("span", { className: "zen-menu-button__action-text", children: name }), !!hasChildren && ((0, jsx_runtime_1.jsx)(ChevronIcon, { size: isDrive ? "huge" : "large", className: (0, classNames_1.classNames)(["zen-caption__pre-content", "zen-menu-button__more-icon"]) }))] }));
|
|
56
|
-
const linkTemplate = ((0, jsx_runtime_1.jsxs)("a", Object.assign({ "data-id": id, role: "menuitem", className: (0, classNames_1.classNames)([
|
|
57
|
-
"zen-menu-button__action",
|
|
58
|
-
"zen-caption",
|
|
59
|
-
disabled ? "zen-menu-button__action--disabled" : "",
|
|
60
|
-
driveMenuButtonActionClasses || ""
|
|
61
|
-
]), href: disabled || !(0, isSafeHref_1.isSafeHref)(link) ? undefined : link, "aria-disabled": disabled, onClick: onClickHandler, target: target, rel: (0, getSafeRel_1.getSafeRel)(rel, target), "data-analytics-id": dataAnalyticsId }, linkEvents, { children: [!!icon &&
|
|
62
|
-
(0, react_1.createElement)(icon, {
|
|
63
|
-
size: isDrive ? "huge" : "large",
|
|
64
|
-
className: "zen-caption__pre-content"
|
|
65
|
-
}), name] })));
|
|
80
|
+
const linkEvents = (0, react_1.useMemo)(() => createDisabledGuardedLinkKeyEvents(disabled), [disabled]);
|
|
81
|
+
const onClickHandler = (0, react_1.useCallback)((e) => handleDisabledGuardedClick(e, disabled, id, onClick), [id, onClick, disabled]);
|
|
82
|
+
const iconAfterElement = createMenuIcon(iconOpen ? iconOpen_1.IconOpen : undefined, iconSize, "zen-menu-button__icon-after");
|
|
83
|
+
const buttonTemplate = ((0, jsx_runtime_1.jsxs)("button", { type: "button", "data-id": id, ref: ref, title: name, className: getMenuButtonActionClassName(hasChildren, hasState, isActive, disabled, destructiveClass, driveMenuButtonActionClasses), role: getMenuItemRole(hasState), onClick: onClickHandler, "aria-disabled": disabled ? true : undefined, "aria-checked": getMenuItemAriaChecked(hasState, isActive), "data-analytics-id": dataAnalyticsId, children: [createMenuIcon(icon, iconSize, (0, classNames_1.classNames)(["zen-caption__pre-content", "zen-menu-button__icon"])), (0, jsx_runtime_1.jsx)("span", { className: "zen-menu-button__action-text", children: name }), iconAfterElement, !!hasChildren && (0, jsx_runtime_1.jsx)(ChevronIcon, { size: iconSize, className: (0, classNames_1.classNames)(["zen-caption__pre-content", "zen-menu-button__more-icon"]) })] }));
|
|
84
|
+
const linkTemplate = ((0, jsx_runtime_1.jsxs)("a", Object.assign({ "data-id": id, role: "menuitem", className: getMenuLinkActionClassName(disabled, destructiveClass, driveMenuButtonActionClasses) }, getMenuLinkAccessibilityProps(disabled, link), { onClick: onClickHandler, target: effectiveTarget, rel: (0, getSafeRel_1.getSafeRel)(rel, effectiveTarget), "data-analytics-id": dataAnalyticsId }, linkEvents, { children: [createMenuIcon(icon, iconSize, "zen-caption__pre-content"), iconAfterElement ? (0, jsx_runtime_1.jsx)("span", { className: "zen-menu-button__action-text", children: name }) : name, iconAfterElement] })));
|
|
66
85
|
return ((0, jsx_runtime_1.jsx)("li", { role: "presentation", className: (0, classNames_1.classNames)(["zen-menu-button", className]), children: link ? linkTemplate : buttonTemplate }));
|
|
67
86
|
};
|
|
68
87
|
exports.MenuButton = MenuButton;
|
|
@@ -10,7 +10,7 @@ const classNames_1 = require("../../commonHelpers/classNames/classNames");
|
|
|
10
10
|
const useMenuItemCore_1 = require("../utils/useMenuItemCore");
|
|
11
11
|
var isMenuItem_1 = require("../utils/isMenuItem");
|
|
12
12
|
Object.defineProperty(exports, "isMenuItem", { enumerable: true, get: function () { return isMenuItem_1.isMenuItem; } });
|
|
13
|
-
const MenuItem = ({ id, children, name, icon, disabled, onClick, link, target, rel, isMobile = false, setIsOpen, trigger, className, active, alignment, dataAnalyticsId }) => {
|
|
13
|
+
const MenuItem = ({ id, children, name, icon, iconOpen, destructive, disabled, onClick, link, target, rel, isMobile = false, setIsOpen, trigger, className, active, alignment, dataAnalyticsId }) => {
|
|
14
14
|
const { ref, isOpen, hasChildren, content, openedViaKeyboard, contentAlignment, path, onOpenBranch, handleOpenChange } = (0, useMenuItemCore_1.useMenuItemCore)({
|
|
15
15
|
id,
|
|
16
16
|
children,
|
|
@@ -44,10 +44,10 @@ const MenuItem = ({ id, children, name, icon, disabled, onClick, link, target, r
|
|
|
44
44
|
onClick === null || onClick === void 0 ? void 0 : onClick(id, e);
|
|
45
45
|
}, [onClick, onOpenBranch, id, trigger]);
|
|
46
46
|
if (!hasChildren) {
|
|
47
|
-
return ((0, jsx_runtime_1.jsx)(menuButton_1.MenuButton, { id: id, name: name, icon: icon, disabled: disabled, link: link, target: target, rel: rel, onClick: memoizedDesktopActionOnClick, className: className, active: active, hasChildren: false, dataAnalyticsId: dataAnalyticsId }, id));
|
|
47
|
+
return ((0, jsx_runtime_1.jsx)(menuButton_1.MenuButton, { id: id, name: name, icon: icon, iconOpen: iconOpen, destructive: destructive, disabled: disabled, link: link, target: target, rel: rel, onClick: memoizedDesktopActionOnClick, className: className, active: active, hasChildren: false, dataAnalyticsId: dataAnalyticsId }, id));
|
|
48
48
|
}
|
|
49
49
|
if (isMobile) {
|
|
50
|
-
return ((0, jsx_runtime_1.jsx)(menuButton_1.MenuButton, { id: id, name: name, icon: icon, disabled: disabled, link: link, target: target, rel: rel, onClick: memoizedMobileActionOnClick, active: active, hasChildren: true, dataAnalyticsId: dataAnalyticsId }, id));
|
|
50
|
+
return ((0, jsx_runtime_1.jsx)(menuButton_1.MenuButton, { id: id, name: name, icon: icon, iconOpen: iconOpen, destructive: destructive, disabled: disabled, link: link, target: target, rel: rel, onClick: memoizedMobileActionOnClick, active: active, hasChildren: true, dataAnalyticsId: dataAnalyticsId }, id));
|
|
51
51
|
}
|
|
52
52
|
let popupTrigger;
|
|
53
53
|
if (trigger) {
|
|
@@ -57,7 +57,7 @@ const MenuItem = ({ id, children, name, icon, disabled, onClick, link, target, r
|
|
|
57
57
|
});
|
|
58
58
|
}
|
|
59
59
|
else {
|
|
60
|
-
popupTrigger = ((0, jsx_runtime_1.jsx)(menuButton_1.MenuButton, { id: id, ref: ref, name: name, icon: icon, disabled: disabled, hasChildren: true, onClick: memoizedTriggerOnClick, active: active, dataAnalyticsId: dataAnalyticsId }, id));
|
|
60
|
+
popupTrigger = ((0, jsx_runtime_1.jsx)(menuButton_1.MenuButton, { id: id, ref: ref, name: name, icon: icon, iconOpen: iconOpen, destructive: destructive, disabled: disabled, hasChildren: true, onClick: memoizedTriggerOnClick, active: active, dataAnalyticsId: dataAnalyticsId }, id));
|
|
61
61
|
}
|
|
62
62
|
return ((0, jsx_runtime_1.jsxs)(react_1.Fragment, { children: [popupTrigger, (0, jsx_runtime_1.jsx)(controlledPopup_1.ControlledPopup, { className: (0, classNames_1.classNames)([`zen-controlled-menu-submenu--${path.length}`]), useTrapFocusWithTrigger: openedViaKeyboard ? "on" : "withTrigger", alignment: contentAlignment, triggerRef: ref, isOpen: isOpen, onOpenChange: handleOpenChange, ariaLabel: popupTrigger.props.name, recalculateOnScroll: true, children: (0, jsx_runtime_1.jsx)("ul", { role: "menu", className: "zen-menu-item", children: content }) })] }, id));
|
|
63
63
|
};
|
|
@@ -9,6 +9,7 @@ const miniTabsHeaderItem_1 = require("./miniTabsHeaderItem");
|
|
|
9
9
|
const miniTabsItem_1 = require("./miniTabsItem");
|
|
10
10
|
const tabsKeyboard_1 = require("../commonHelpers/tabsKeyboard");
|
|
11
11
|
const miniTabsHelper_1 = require("./miniTabsHelper");
|
|
12
|
+
const useIsRTL_1 = require("../utils/localization/useIsRTL");
|
|
12
13
|
var MiniTabsSize;
|
|
13
14
|
(function (MiniTabsSize) {
|
|
14
15
|
MiniTabsSize["Small"] = "small";
|
|
@@ -21,16 +22,17 @@ const MiniTabs = ({ activeTabId, onTabChange, children, size = MiniTabsSize.Medi
|
|
|
21
22
|
const [tabs, setTabs] = (0, react_2.useState)([]);
|
|
22
23
|
const activeButtonRef = (0, react_2.useRef)(null);
|
|
23
24
|
const tabsRef = (0, react_2.useRef)(null);
|
|
25
|
+
const isRTL = (0, useIsRTL_1.useIsRTL)();
|
|
24
26
|
const handleTabItemClick = (e) => {
|
|
25
27
|
const newState = e.target.id || e.currentTarget.id || undefined;
|
|
26
28
|
newState && newState !== activeTabId && onTabChange(newState);
|
|
27
29
|
};
|
|
28
30
|
const keyDownHandler = (0, react_2.useCallback)((e) => {
|
|
29
|
-
const newActiveTabId = (0, tabsKeyboard_1.tabsKeyboardHandler)(e, tabs, activeTabId);
|
|
31
|
+
const newActiveTabId = (0, tabsKeyboard_1.tabsKeyboardHandler)(e, tabs, activeTabId, isRTL);
|
|
30
32
|
if (newActiveTabId && newActiveTabId !== activeTabId) {
|
|
31
33
|
onTabChange(newActiveTabId);
|
|
32
34
|
}
|
|
33
|
-
}, [tabs, activeTabId, onTabChange]);
|
|
35
|
+
}, [tabs, activeTabId, onTabChange, isRTL]);
|
|
34
36
|
(0, react_2.useEffect)(() => setTabs((0, miniTabsHelper_1.getChildrenForRender)(children).slice(0, maxTabsValue)), [children]);
|
|
35
37
|
(0, react_2.useEffect)(() => {
|
|
36
38
|
var _a;
|
|
@@ -13,6 +13,6 @@ export interface IPageHeaderButton extends Omit<IButton, "onClick" | "icon" | "t
|
|
|
13
13
|
}
|
|
14
14
|
export declare const PageHeaderButtonDisplayName = "PageHeaderButton";
|
|
15
15
|
export declare const PageHeaderButton: {
|
|
16
|
-
({ id, children, icon, iconPosition, className, onClick, title, ...restProps }: IPageHeaderButton): import("react/jsx-runtime").JSX.Element;
|
|
16
|
+
({ id, children, icon, iconPosition, className, onClick, title, disabled, focusableWhenDisabled, ...restProps }: IPageHeaderButton): import("react/jsx-runtime").JSX.Element;
|
|
17
17
|
displayName: string;
|
|
18
18
|
};
|
|
@@ -17,9 +17,11 @@ const textIconButton_1 = require("../textIconButton/textIconButton");
|
|
|
17
17
|
const classNames_1 = require("../commonHelpers/classNames/classNames");
|
|
18
18
|
exports.PageHeaderButtonDisplayName = "PageHeaderButton";
|
|
19
19
|
const PageHeaderButton = (_a) => {
|
|
20
|
-
var { id, children, icon, iconPosition = textIconButton_1.ButtonIconPosition.Start, className = "", onClick, title } = _a, restProps = __rest(_a, ["id", "children", "icon", "iconPosition", "className", "onClick", "title"]);
|
|
20
|
+
var { id, children, icon, iconPosition = textIconButton_1.ButtonIconPosition.Start, className = "", onClick, title, disabled, focusableWhenDisabled } = _a, restProps = __rest(_a, ["id", "children", "icon", "iconPosition", "className", "onClick", "title", "disabled", "focusableWhenDisabled"]);
|
|
21
21
|
const fullClassName = (0, classNames_1.classNames)(["zen-page-header-button", className || ""]);
|
|
22
|
-
const props = Object.assign({}, restProps)
|
|
22
|
+
const props = Object.assign(Object.assign({}, restProps), { disabled,
|
|
23
|
+
// Defaults on when disabled; pass `focusableWhenDisabled={false}` to opt back into native `disabled`.
|
|
24
|
+
focusableWhenDisabled: focusableWhenDisabled !== null && focusableWhenDisabled !== void 0 ? focusableWhenDisabled : Boolean(disabled) });
|
|
23
25
|
return ((0, jsx_runtime_1.jsx)(textIconButton_1.TextIconButton, Object.assign({ id: id, icon: icon, title: title, iconPosition: iconPosition, className: fullClassName, onClick: onClick ? e => onClick(id, e) : undefined }, props, { children: children })));
|
|
24
26
|
};
|
|
25
27
|
exports.PageHeaderButton = PageHeaderButton;
|
|
@@ -3,14 +3,29 @@ import "./pagination.less";
|
|
|
3
3
|
import { IZenComponentProps } from "../commonHelpers/zenComponent";
|
|
4
4
|
import { PaginationType } from "./paginationType";
|
|
5
5
|
export interface IPagination extends IZenComponentProps {
|
|
6
|
-
|
|
6
|
+
/**
|
|
7
|
+
* Required for the default "paged" variant (see `IPaginationPaged`, enforced there). Unused —
|
|
8
|
+
* and not required — when `variant === "loaded"`, since there are no pages to be "active" on.
|
|
9
|
+
*/
|
|
10
|
+
activePage?: number;
|
|
7
11
|
total: number;
|
|
8
|
-
|
|
9
|
-
|
|
12
|
+
/** Required for "paged" (see `IPaginationPaged`). Unused by "loaded". */
|
|
13
|
+
perPage?: number;
|
|
14
|
+
/** Required for "paged" (see `IPaginationPaged`). Unused by "loaded". */
|
|
15
|
+
onChange?: (newActivePage: number) => void;
|
|
10
16
|
className?: string;
|
|
11
17
|
includeText?: boolean;
|
|
12
18
|
type?: PaginationType;
|
|
13
19
|
gridRef?: RefObject<HTMLElement | null>;
|
|
14
20
|
disabled?: boolean;
|
|
21
|
+
/**
|
|
22
|
+
* "paged" (default): standard prev/next controls + "Showing X - Y of Z" text.
|
|
23
|
+
* "loaded": desktop-infinite-scroll variant — prev/next controls are always hidden (there are
|
|
24
|
+
* no pages) and the text reads "1-{loadedCount} of {total}" instead. Used by Table when
|
|
25
|
+
* `onScrollEnd` is wired and a `Table.Pagination` child supplies `total`.
|
|
26
|
+
*/
|
|
27
|
+
variant?: "paged" | "loaded";
|
|
28
|
+
/** Number of rows currently loaded/rendered. Only used when `variant === "loaded"`. */
|
|
29
|
+
loadedCount?: number;
|
|
15
30
|
}
|
|
16
|
-
export declare const Pagination: ({
|
|
31
|
+
export declare const Pagination: ({ variant, ...props }: IPagination) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,4 +1,15 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
var __rest = (this && this.__rest) || function (s, e) {
|
|
3
|
+
var t = {};
|
|
4
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
5
|
+
t[p] = s[p];
|
|
6
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
7
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
8
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
9
|
+
t[p[i]] = s[p[i]];
|
|
10
|
+
}
|
|
11
|
+
return t;
|
|
12
|
+
};
|
|
2
13
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
14
|
exports.Pagination = void 0;
|
|
4
15
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
@@ -8,7 +19,12 @@ const paginationArrow_1 = require("./paginationArrow");
|
|
|
8
19
|
const paginationButtonsRow_1 = require("./paginationButtonsRow");
|
|
9
20
|
const paginationText_1 = require("./paginationText/paginationText");
|
|
10
21
|
const paginationType_1 = require("./paginationType");
|
|
11
|
-
|
|
22
|
+
// Desktop infinite scroll: there are no pages, so the page-control buttons are skipped entirely and
|
|
23
|
+
// only the compact "1-{loadedCount} of {total}" text is rendered. Split out as its own tiny
|
|
24
|
+
// component (rather than a branch inside `Pagination`) so it doesn't count against that function's
|
|
25
|
+
// complexity budget.
|
|
26
|
+
const PaginationLoaded = ({ className, type = paginationType_1.PaginationType.Compact, total, includeText = false, loadedCount = 0 }) => ((0, jsx_runtime_1.jsx)("div", { className: (0, classNames_1.classNames)(["zen-pagination", `zen-pagination--type-${type}`, className ? className : ""]), children: includeText ? (0, jsx_runtime_1.jsx)(paginationText_1.PaginationText, { amount: total, from: total === 0 ? 0 : 1, to: Math.min(loadedCount, total), variant: "loaded" }) : null }));
|
|
27
|
+
const PaginationPaged = ({ className, activePage, total, perPage, onChange, disabled, includeText = false, type = paginationType_1.PaginationType.Compact, gridRef }) => {
|
|
12
28
|
var _a, _b;
|
|
13
29
|
const gridNode = ((_a = gridRef === null || gridRef === void 0 ? void 0 : gridRef.current) === null || _a === void 0 ? void 0 : _a.classList.contains("zen-data-grid")) ? gridRef.current : (_b = gridRef === null || gridRef === void 0 ? void 0 : gridRef.current) === null || _b === void 0 ? void 0 : _b.querySelector(".zen-data-grid");
|
|
14
30
|
const displayedPagesCount = 6;
|
|
@@ -51,4 +67,8 @@ const Pagination = ({ className, activePage, total, perPage, onChange, disabled,
|
|
|
51
67
|
const isSinglePage = total <= perPage;
|
|
52
68
|
return ((0, jsx_runtime_1.jsxs)("div", { className: (0, classNames_1.classNames)(["zen-pagination", `zen-pagination--type-${type}`, className ? className : ""]), children: [includeText ? ((0, jsx_runtime_1.jsx)(paginationText_1.PaginationText, { amount: total, from: total === 0 ? total : activePage * perPage + 1, to: Math.min((activePage + 1) * perPage, total) })) : null, isSinglePage ? null : ((0, jsx_runtime_1.jsx)(paginationArrow_1.PaginationArrow, { value: "previous", disabled: activePage === 0 || disabled, arrowButtonHandler: () => handlePageChange(activePage - 1), type: type })), type === paginationType_1.PaginationType.Normal ? ((0, jsx_runtime_1.jsx)(paginationButtonsRow_1.PaginationButtonsRow, { paginationValues: getPaginationValues(), activePage: activePage, upperBoundIndex: totalNumberOfPages - 1, onChange: handlePageChange })) : null, isSinglePage ? null : ((0, jsx_runtime_1.jsx)(paginationArrow_1.PaginationArrow, { value: "next", disabled: activePage >= totalNumberOfPages - 1 || disabled, arrowButtonHandler: () => handlePageChange(activePage + 1), type: type }))] }));
|
|
53
69
|
};
|
|
70
|
+
const Pagination = (_a) => {
|
|
71
|
+
var { variant = "paged" } = _a, props = __rest(_a, ["variant"]);
|
|
72
|
+
return variant === "loaded" ? ((0, jsx_runtime_1.jsx)(PaginationLoaded, { className: props.className, type: props.type, total: props.total, includeText: props.includeText, loadedCount: props.loadedCount })) : ((0, jsx_runtime_1.jsx)(PaginationPaged, Object.assign({}, props)));
|
|
73
|
+
};
|
|
54
74
|
exports.Pagination = Pagination;
|
|
@@ -2,7 +2,13 @@ interface IPaginationText {
|
|
|
2
2
|
amount: number;
|
|
3
3
|
from: number;
|
|
4
4
|
to: number;
|
|
5
|
+
/**
|
|
6
|
+
* "showing" (default): the paged-table text, e.g. "Showing 1 - 10 of 100".
|
|
7
|
+
* "loaded": the compact desktop-infinite-scroll variant, e.g. "1-10 of 100", rendered in
|
|
8
|
+
* place of page-control buttons (which don't apply when there are no pages).
|
|
9
|
+
*/
|
|
10
|
+
variant?: "showing" | "loaded";
|
|
5
11
|
}
|
|
6
|
-
export declare const PaginationText: ({ amount, from, to }: IPaginationText) => import("react/jsx-runtime").JSX.Element;
|
|
12
|
+
export declare const PaginationText: ({ amount, from, to, variant }: IPaginationText) => import("react/jsx-runtime").JSX.Element;
|
|
7
13
|
export declare const TRANSLATIONS: string[];
|
|
8
14
|
export {};
|
|
@@ -9,6 +9,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
9
9
|
exports.TRANSLATIONS = exports.PaginationText = void 0;
|
|
10
10
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
11
11
|
const useLanguage_1 = require("../../utils/localization/useLanguage");
|
|
12
|
+
injectString("en", "{from}-{to} of {total}", "{from}-{to} of {total}");
|
|
12
13
|
injectString("cs", "Showing {from} - {to} of {total}", "Zobrazuji {from}\u2013{to} z\xA0{total}");
|
|
13
14
|
injectString("da-DK", "Showing {from} - {to} of {total}", "Viser {fra} - {til} af {total}");
|
|
14
15
|
injectString("de", "Showing {from} - {to} of {total}", "{from} - {to} von {total} werden angezeigt");
|
|
@@ -45,12 +46,14 @@ injectString("bg-BG", "Showing {from} - {to} of {total}", "\u041F\u043E\u043A\u0
|
|
|
45
46
|
const PaginationText = ({
|
|
46
47
|
amount,
|
|
47
48
|
from,
|
|
48
|
-
to
|
|
49
|
+
to,
|
|
50
|
+
variant = "showing"
|
|
49
51
|
}) => {
|
|
50
52
|
const {
|
|
51
53
|
translate
|
|
52
54
|
} = (0, useLanguage_1.useLanguage)();
|
|
53
|
-
const
|
|
55
|
+
const template = variant === "loaded" ? translate("{from}-{to} of {total}") : translate("Showing {from} - {to} of {total}");
|
|
56
|
+
const children = template.replace("{from}", from.toString()).replace("{to}", to.toString()).replace("{total}", amount.toString());
|
|
54
57
|
return (0, jsx_runtime_1.jsx)("span", {
|
|
55
58
|
"aria-live": "polite",
|
|
56
59
|
"aria-atomic": "true",
|
|
@@ -59,4 +62,4 @@ const PaginationText = ({
|
|
|
59
62
|
});
|
|
60
63
|
};
|
|
61
64
|
exports.PaginationText = PaginationText;
|
|
62
|
-
exports.TRANSLATIONS = ["Showing {from} - {to} of {total}"];
|
|
65
|
+
exports.TRANSLATIONS = ["Showing {from} - {to} of {total}", "{from}-{to} of {total}"];
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ReactNode } from "react";
|
|
1
|
+
import { ReactNode, Ref } from "react";
|
|
2
2
|
import { IPillExpandableAction } from "./pillExpandable";
|
|
3
3
|
import { TLazyContent } from "../skeleton/lazyContent";
|
|
4
4
|
interface IPillContent {
|
|
@@ -12,6 +12,7 @@ interface IPillContent {
|
|
|
12
12
|
isVisible?: boolean;
|
|
13
13
|
errorHandler: (err: any) => ReactNode | undefined;
|
|
14
14
|
descriptionId?: string;
|
|
15
|
+
descriptionRef?: Ref<HTMLDivElement>;
|
|
15
16
|
}
|
|
16
|
-
export declare const PillContent: ({ date, count, descriptionText, mainAction, secondaryAction, tertiaryAction, onActionClick, isVisible, errorHandler, descriptionId }: IPillContent) => import("react/jsx-runtime").JSX.Element;
|
|
17
|
+
export declare const PillContent: ({ date, count, descriptionText, mainAction, secondaryAction, tertiaryAction, onActionClick, isVisible, errorHandler, descriptionId, descriptionRef }: IPillContent) => import("react/jsx-runtime").JSX.Element;
|
|
17
18
|
export {};
|
|
@@ -7,7 +7,7 @@ const button_1 = require("../button/button");
|
|
|
7
7
|
const classNames_1 = require("../commonHelpers/classNames/classNames");
|
|
8
8
|
const useDriveClassName_1 = require("../utils/theme/useDriveClassName");
|
|
9
9
|
const lazyContent_1 = require("../skeleton/lazyContent");
|
|
10
|
-
const PillContent = ({ date, count, descriptionText, mainAction, secondaryAction, tertiaryAction, onActionClick, isVisible = true, errorHandler, descriptionId }) => {
|
|
10
|
+
const PillContent = ({ date, count, descriptionText, mainAction, secondaryAction, tertiaryAction, onActionClick, isVisible = true, errorHandler, descriptionId, descriptionRef }) => {
|
|
11
11
|
const headerDriveClassName = (0, useDriveClassName_1.useDriveClassName)("zen-status-pill-popup__header-text");
|
|
12
12
|
const descriptionDriveClassName = (0, useDriveClassName_1.useDriveClassName)("zen-status-pill-popup__description");
|
|
13
13
|
const mainActionClick = (0, react_1.useCallback)((onClick) => () => {
|
|
@@ -34,7 +34,7 @@ const PillContent = ({ date, count, descriptionText, mainAction, secondaryAction
|
|
|
34
34
|
var _a, _b;
|
|
35
35
|
return ((0, jsx_runtime_1.jsx)(button_1.Button, Object.assign({ link: data.link }, data.linkOptions, { onClick: tertiaryActionClick(data.onClick), type: "tertiary", dataAnalyticsId: (_a = data.dataAnalyticsId) !== null && _a !== void 0 ? _a : (_b = data.linkOptions) === null || _b === void 0 ? void 0 : _b.dataAnalyticsId, children: data.text })));
|
|
36
36
|
}, [tertiaryActionClick]);
|
|
37
|
-
const renderDescription = (0, react_1.useCallback)(data => ((0, jsx_runtime_1.jsx)("div", { id: descriptionId, className: (0, classNames_1.classNames)(["zen-status-pill-popup__description", descriptionDriveClassName || ""]), children: data })), [descriptionDriveClassName, descriptionId]);
|
|
37
|
+
const renderDescription = (0, react_1.useCallback)(data => ((0, jsx_runtime_1.jsx)("div", { id: descriptionId, ref: descriptionRef, className: (0, classNames_1.classNames)(["zen-status-pill-popup__description", descriptionDriveClassName || ""]), children: data })), [descriptionDriveClassName, descriptionId, descriptionRef]);
|
|
38
38
|
const renderCount = (0, react_1.useCallback)(data => data ? ((0, jsx_runtime_1.jsx)("div", { className: (0, classNames_1.classNames)([
|
|
39
39
|
"zen-status-pill-popup__header-text zen-status-pill-popup__header-text--left",
|
|
40
40
|
headerDriveClassName || ""
|
|
@@ -95,6 +95,12 @@ const PillExpandablePopover = ({
|
|
|
95
95
|
popoverRef.current = node;
|
|
96
96
|
setContainerNode(node);
|
|
97
97
|
}, [setContainerNode]);
|
|
98
|
+
const handleMobileReadyForFocus = (0, react_1.useCallback)(currentIsOpen => {
|
|
99
|
+
var _a;
|
|
100
|
+
if (!currentIsOpen) {
|
|
101
|
+
(_a = triggerRef.current) === null || _a === void 0 ? void 0 : _a.focus();
|
|
102
|
+
}
|
|
103
|
+
}, [triggerRef]);
|
|
98
104
|
// Focus first focusable element in desktop popover when content is ready.
|
|
99
105
|
// Mobile MobileSheet handles its own first-focus (close button).
|
|
100
106
|
(0, react_1.useEffect)(() => {
|
|
@@ -133,6 +139,7 @@ const PillExpandablePopover = ({
|
|
|
133
139
|
isOpen: isOpen,
|
|
134
140
|
onHidePanel: onClose,
|
|
135
141
|
onCloseClick: onClose,
|
|
142
|
+
onReadyForFocus: handleMobileReadyForFocus,
|
|
136
143
|
id: popupId,
|
|
137
144
|
children: [(0, jsx_runtime_1.jsx)(mobileSheet_1.MobileSheet.Title, {
|
|
138
145
|
className: "zen-status-pill-popup__mobile-title",
|
|
@@ -149,13 +156,15 @@ const PillExpandablePopover = ({
|
|
|
149
156
|
}
|
|
150
157
|
return (0, jsx_runtime_1.jsx)(absolute_1.Absolute, {
|
|
151
158
|
recalculateTrigger: isPopupContentReady,
|
|
152
|
-
|
|
159
|
+
closeOnScroll: true,
|
|
153
160
|
useTrapFocusWithTrigger: "on",
|
|
154
161
|
className: popupClassName,
|
|
155
162
|
id: popupId,
|
|
156
163
|
onOpenChange: onChange,
|
|
157
164
|
isOpen: isOpen,
|
|
158
165
|
triggerRef: triggerRef,
|
|
166
|
+
role: "dialog",
|
|
167
|
+
ariaLabel: title || text,
|
|
159
168
|
alignmentsFn: pillExpandableAlignments_1.alignments,
|
|
160
169
|
children: (0, jsx_runtime_1.jsxs)("div", {
|
|
161
170
|
ref: handlePopoverRef,
|
|
@@ -181,6 +190,7 @@ const PillExpandableChild = ({
|
|
|
181
190
|
}) => {
|
|
182
191
|
const pillId = (0, react_1.useId)();
|
|
183
192
|
const descriptionId = (0, react_1.useId)();
|
|
193
|
+
const [descriptionElement, setDescriptionElement] = (0, react_1.useState)(null);
|
|
184
194
|
const {
|
|
185
195
|
level,
|
|
186
196
|
expandedChildPillIds,
|
|
@@ -235,7 +245,7 @@ const PillExpandableChild = ({
|
|
|
235
245
|
onExpand: handleChildToggle,
|
|
236
246
|
type: type,
|
|
237
247
|
errorHandler: errorHandler,
|
|
238
|
-
descriptionId: descriptionId,
|
|
248
|
+
descriptionId: isExpanded && descriptionElement ? descriptionId : undefined,
|
|
239
249
|
dataAnalyticsId: dataAnalyticsId
|
|
240
250
|
}), (0, jsx_runtime_1.jsx)(pillContent_1.PillContent, {
|
|
241
251
|
onActionClick: handleChildToggle,
|
|
@@ -247,7 +257,8 @@ const PillExpandableChild = ({
|
|
|
247
257
|
tertiaryAction: content.tertiaryAction,
|
|
248
258
|
isVisible: isExpanded,
|
|
249
259
|
errorHandler: errorHandler,
|
|
250
|
-
descriptionId: descriptionId
|
|
260
|
+
descriptionId: descriptionId,
|
|
261
|
+
descriptionRef: setDescriptionElement
|
|
251
262
|
})]
|
|
252
263
|
});
|
|
253
264
|
};
|
|
@@ -417,6 +428,7 @@ const PillExpandableBase = ({
|
|
|
417
428
|
}) => {
|
|
418
429
|
const popupId = (0, react_1.useId)();
|
|
419
430
|
const descriptionId = (0, react_1.useId)();
|
|
431
|
+
const [descriptionElement, setDescriptionElement] = (0, react_1.useState)(null);
|
|
420
432
|
const isDrive = (0, useDrive_1.useDrive)();
|
|
421
433
|
const [isMobile, setIsMobile] = (0, react_1.useState)(false);
|
|
422
434
|
const handleDeviceTypeChange = (0, react_1.useCallback)(deviceType => {
|
|
@@ -541,6 +553,7 @@ const PillExpandableBase = ({
|
|
|
541
553
|
tertiaryAction: content.tertiaryAction,
|
|
542
554
|
errorHandler: errorHandler,
|
|
543
555
|
descriptionId,
|
|
556
|
+
descriptionRef: setDescriptionElement,
|
|
544
557
|
childToDisplay
|
|
545
558
|
}), [effectiveVariant, childrenAnalysis, content, errorHandler, descriptionId, childToDisplay]);
|
|
546
559
|
const showFooter = Boolean(moreCounter && viewMoreAction && childCount > MAX_PILLS_TO_DISPLAY_IN_POPUP);
|
|
@@ -571,7 +584,6 @@ const PillExpandableBase = ({
|
|
|
571
584
|
},
|
|
572
585
|
children: (0, jsx_runtime_1.jsxs)("div", {
|
|
573
586
|
className: (0, classNames_1.classNames)(["zen-status-pill", className || ""]),
|
|
574
|
-
"aria-haspopup": "true",
|
|
575
587
|
children: [(0, jsx_runtime_1.jsxs)("div", {
|
|
576
588
|
className: "zen-status-pill__pill-container",
|
|
577
589
|
onClick: handlePopupToggle,
|
|
@@ -584,6 +596,8 @@ const PillExpandableBase = ({
|
|
|
584
596
|
errorHandler: errorHandler,
|
|
585
597
|
isBeta: isBeta,
|
|
586
598
|
isMobile: isMobile,
|
|
599
|
+
descriptionId: isPopupOpen && descriptionElement ? descriptionId : undefined,
|
|
600
|
+
ariaHasPopup: "dialog",
|
|
587
601
|
dataAnalyticsId: dataAnalyticsId
|
|
588
602
|
}), uniqueChildren && (0, jsx_runtime_1.jsx)(pillExpandableSimple_1.PillExpandableSimple, {
|
|
589
603
|
icon: secondaryIcon || effectiveIcon,
|
|
@@ -592,7 +606,8 @@ const PillExpandableBase = ({
|
|
|
592
606
|
type: type,
|
|
593
607
|
errorHandler: errorHandler,
|
|
594
608
|
className: "zen-status-pill__counter",
|
|
595
|
-
isMobile: isMobile
|
|
609
|
+
isMobile: isMobile,
|
|
610
|
+
isDecorative: true
|
|
596
611
|
})]
|
|
597
612
|
}), (0, jsx_runtime_1.jsx)(PillExpandablePopover, {
|
|
598
613
|
useMobileSheet: useMobileSheet,
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ReactNode } from "react";
|
|
1
|
+
import { ReactNode, Ref } from "react";
|
|
2
2
|
import { TLazyContent } from "../skeleton/lazyContent";
|
|
3
3
|
import { IPillExpandableAction, TPopoverVariant } from "./pillExpandable";
|
|
4
4
|
interface IPillExpandablePopoverContent {
|
|
@@ -13,7 +13,8 @@ interface IPillExpandablePopoverContent {
|
|
|
13
13
|
tertiaryAction?: TLazyContent<IPillExpandableAction>;
|
|
14
14
|
errorHandler: (e: unknown) => ReactNode | undefined;
|
|
15
15
|
descriptionId?: string;
|
|
16
|
+
descriptionRef?: Ref<HTMLDivElement>;
|
|
16
17
|
childToDisplay: ReactNode[];
|
|
17
18
|
}
|
|
18
|
-
export declare const PillExpandablePopoverContent: ({ variant, customContent, onActionClick, descriptionText, date, count, mainAction, secondaryAction, tertiaryAction, errorHandler, descriptionId, childToDisplay }: IPillExpandablePopoverContent) => import("react/jsx-runtime").JSX.Element;
|
|
19
|
+
export declare const PillExpandablePopoverContent: ({ variant, customContent, onActionClick, descriptionText, date, count, mainAction, secondaryAction, tertiaryAction, errorHandler, descriptionId, descriptionRef, childToDisplay }: IPillExpandablePopoverContent) => import("react/jsx-runtime").JSX.Element;
|
|
19
20
|
export {};
|
|
@@ -3,5 +3,5 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.PillExpandablePopoverContent = void 0;
|
|
4
4
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
5
|
const pillContent_1 = require("./pillContent");
|
|
6
|
-
const PillExpandablePopoverContent = ({ variant, customContent, onActionClick, descriptionText, date, count, mainAction, secondaryAction, tertiaryAction, errorHandler, descriptionId, childToDisplay }) => ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [variant === "placeholder" && customContent, variant === "default" && ((0, jsx_runtime_1.jsx)(pillContent_1.PillContent, { onActionClick: onActionClick, descriptionText: descriptionText, date: date, count: count, mainAction: mainAction, secondaryAction: secondaryAction, tertiaryAction: tertiaryAction, errorHandler: errorHandler, descriptionId: descriptionId })), childToDisplay.length > 0 && (0, jsx_runtime_1.jsx)("div", { className: "zen-status-pill-popup__children", children: childToDisplay })] }));
|
|
6
|
+
const PillExpandablePopoverContent = ({ variant, customContent, onActionClick, descriptionText, date, count, mainAction, secondaryAction, tertiaryAction, errorHandler, descriptionId, descriptionRef, childToDisplay }) => ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [variant === "placeholder" && customContent, variant === "default" && ((0, jsx_runtime_1.jsx)(pillContent_1.PillContent, { onActionClick: onActionClick, descriptionText: descriptionText, date: date, count: count, mainAction: mainAction, secondaryAction: secondaryAction, tertiaryAction: tertiaryAction, errorHandler: errorHandler, descriptionId: descriptionId, descriptionRef: descriptionRef })), childToDisplay.length > 0 && (0, jsx_runtime_1.jsx)("div", { className: "zen-status-pill-popup__children", children: childToDisplay })] }));
|
|
7
7
|
exports.PillExpandablePopoverContent = PillExpandablePopoverContent;
|
|
@@ -10,10 +10,12 @@ interface IPillExpandableSimple extends IPillExpandableBase {
|
|
|
10
10
|
isMobile?: boolean;
|
|
11
11
|
ref?: RefObject<HTMLButtonElement | null>;
|
|
12
12
|
descriptionId?: string;
|
|
13
|
+
ariaHasPopup?: "dialog";
|
|
14
|
+
isDecorative?: boolean;
|
|
13
15
|
type?: TPillType;
|
|
14
16
|
}
|
|
15
17
|
export declare const PillExpandableSimple: {
|
|
16
|
-
({ onExpand, text, expanded, includeExpandIcon, type, icon, isBeta, isMobile, ref, className, descriptionId, dataAnalyticsId }: IPillExpandableSimple): import("react/jsx-runtime").JSX.Element;
|
|
18
|
+
({ onExpand, text, expanded, includeExpandIcon, type, icon, isBeta, isMobile, ref, className, descriptionId, ariaHasPopup, isDecorative, dataAnalyticsId }: IPillExpandableSimple): import("react/jsx-runtime").JSX.Element;
|
|
17
19
|
displayName: string;
|
|
18
20
|
};
|
|
19
21
|
export {};
|