@geotab/zenith 3.10.0-beta.2 → 3.10.0-beta.4
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 +9 -1
- package/dist/commonStyles/pillStyles/pillContent.less +9 -9
- package/dist/commonStyles/pillStyles/pillStyles.less +2 -2
- package/dist/dataGrid/cell/cell.d.ts +2 -1
- package/dist/dataGrid/cell/cell.js +2 -2
- package/dist/dataGrid/dataGrid.js +6 -4
- package/dist/dataGrid/listColumn.d.ts +2 -0
- package/dist/dataGrid/row/row.js +11 -7
- package/dist/dataGrid/withFlexibleColumns/components/columnSettingsList.js +2 -1
- package/dist/dataGrid/withSelectableRows/components/bulkActions/bulkActions.d.ts +4 -0
- package/dist/dateRangeRaw/utils/parseLabel.js +1 -1
- package/dist/dropdownRaw/dropdownList.d.ts +1 -2
- package/dist/dropdownRaw/dropdownList.js +2 -7
- package/dist/dropdownRaw/dropdownRaw.js +13 -8
- package/dist/filtersBar/filtersContainer/filtersContainer.js +14 -4
- package/dist/index.css +690 -653
- package/dist/index.d.ts +0 -2
- package/dist/index.js +1 -3
- package/dist/radioGroupRaw/radioGroupRaw.js +2 -1
- package/dist/selectList/selectList.helpers.d.ts +1 -1
- package/dist/selectList/selectList.helpers.js +31 -6
- package/dist/selectList/selectList.js +3 -1
- package/dist/selectList/selectList.reducer.js +1 -2
- package/dist/sortControl/sortControl.js +58 -2
- package/dist/table/children/useTableChildren.d.ts +1 -1
- package/dist/table/children/useTableChildren.js +3 -3
- package/dist/table/flexible/columnsList.js +4 -2
- package/dist/table/selectable/useSelectableRows.d.ts +8 -0
- package/dist/table/selectable/useSelectableRows.js +14 -6
- package/dist/table/table.js +1 -7
- package/dist/utils/localization/translations/ar.json +3 -1
- package/dist/utils/localization/translations/cs.json +3 -1
- package/dist/utils/localization/translations/da-DK.json +3 -1
- package/dist/utils/localization/translations/de.json +3 -1
- package/dist/utils/localization/translations/en.json +3 -1
- package/dist/utils/localization/translations/es.json +3 -1
- package/dist/utils/localization/translations/fi-FI.json +3 -1
- package/dist/utils/localization/translations/fr-FR.json +3 -1
- package/dist/utils/localization/translations/fr.json +3 -1
- package/dist/utils/localization/translations/hu-HU.json +3 -1
- package/dist/utils/localization/translations/id.json +3 -1
- package/dist/utils/localization/translations/it.json +3 -1
- package/dist/utils/localization/translations/ja.json +3 -1
- package/dist/utils/localization/translations/ko-KR.json +3 -1
- package/dist/utils/localization/translations/ms.json +3 -1
- package/dist/utils/localization/translations/nb-NO.json +3 -1
- package/dist/utils/localization/translations/nl.json +3 -1
- package/dist/utils/localization/translations/pl.json +3 -1
- package/dist/utils/localization/translations/pt-BR.json +3 -1
- package/dist/utils/localization/translations/pt-PT.json +3 -1
- package/dist/utils/localization/translations/ro-RO.json +3 -1
- package/dist/utils/localization/translations/sk-SK.json +3 -1
- package/dist/utils/localization/translations/sv.json +3 -1
- package/dist/utils/localization/translations/th.json +3 -1
- package/dist/utils/localization/translations/tr.json +3 -1
- package/dist/utils/localization/translations/zh-Hans.json +3 -1
- package/dist/utils/localization/translations/zh-TW.json +3 -1
- package/esm/dataGrid/cell/cell.d.ts +2 -1
- package/esm/dataGrid/cell/cell.js +2 -2
- package/esm/dataGrid/dataGrid.js +6 -4
- package/esm/dataGrid/listColumn.d.ts +2 -0
- package/esm/dataGrid/row/row.js +11 -7
- package/esm/dataGrid/withFlexibleColumns/components/columnSettingsList.js +2 -1
- package/esm/dataGrid/withSelectableRows/components/bulkActions/bulkActions.d.ts +4 -0
- package/esm/dateRangeRaw/utils/parseLabel.js +1 -1
- package/esm/dropdownRaw/dropdownList.d.ts +1 -2
- package/esm/dropdownRaw/dropdownList.js +2 -7
- package/esm/dropdownRaw/dropdownRaw.js +13 -8
- package/esm/filtersBar/filtersContainer/filtersContainer.js +14 -4
- package/esm/index.d.ts +0 -2
- package/esm/index.js +0 -1
- package/esm/radioGroupRaw/radioGroupRaw.js +2 -1
- package/esm/selectList/selectList.helpers.d.ts +1 -1
- package/esm/selectList/selectList.helpers.js +31 -6
- package/esm/selectList/selectList.js +3 -1
- package/esm/selectList/selectList.reducer.js +1 -2
- package/esm/sortControl/sortControl.js +58 -2
- package/esm/table/children/useTableChildren.d.ts +1 -1
- package/esm/table/children/useTableChildren.js +3 -3
- package/esm/table/flexible/columnsList.js +4 -2
- package/esm/table/selectable/useSelectableRows.d.ts +8 -0
- package/esm/table/selectable/useSelectableRows.js +14 -6
- package/esm/table/table.js +1 -7
- package/esm/utils/localization/translations/ar.json +3 -1
- package/esm/utils/localization/translations/cs.json +3 -1
- package/esm/utils/localization/translations/da-DK.json +3 -1
- package/esm/utils/localization/translations/de.json +3 -1
- package/esm/utils/localization/translations/en.json +3 -1
- package/esm/utils/localization/translations/es.json +3 -1
- package/esm/utils/localization/translations/fi-FI.json +3 -1
- package/esm/utils/localization/translations/fr-FR.json +3 -1
- package/esm/utils/localization/translations/fr.json +3 -1
- package/esm/utils/localization/translations/hu-HU.json +3 -1
- package/esm/utils/localization/translations/id.json +3 -1
- package/esm/utils/localization/translations/it.json +3 -1
- package/esm/utils/localization/translations/ja.json +3 -1
- package/esm/utils/localization/translations/ko-KR.json +3 -1
- package/esm/utils/localization/translations/ms.json +3 -1
- package/esm/utils/localization/translations/nb-NO.json +3 -1
- package/esm/utils/localization/translations/nl.json +3 -1
- package/esm/utils/localization/translations/pl.json +3 -1
- package/esm/utils/localization/translations/pt-BR.json +3 -1
- package/esm/utils/localization/translations/pt-PT.json +3 -1
- package/esm/utils/localization/translations/ro-RO.json +3 -1
- package/esm/utils/localization/translations/sk-SK.json +3 -1
- package/esm/utils/localization/translations/sv.json +3 -1
- package/esm/utils/localization/translations/th.json +3 -1
- package/esm/utils/localization/translations/tr.json +3 -1
- package/esm/utils/localization/translations/zh-Hans.json +3 -1
- package/esm/utils/localization/translations/zh-TW.json +3 -1
- package/package.json +2 -1
- package/dist/commonStyles/colors/colorsConstant.d.ts +0 -44
- package/dist/commonStyles/colors/colorsConstant.js +0 -361
- package/dist/commonStyles/typography/components/typographyItem.d.ts +0 -8
- package/dist/commonStyles/typography/components/typographyItem.js +0 -45
- package/dist/testHelpers/fakeFetch.d.ts +0 -1
- package/dist/testHelpers/fakeFetch.js +0 -14
- package/dist/testHelpers/geotab-axe/index.d.ts +0 -2
- package/dist/testHelpers/geotab-axe/index.js +0 -81
- package/dist/testHelpers/jestRetry.d.ts +0 -0
- package/dist/testHelpers/jestRetry.js +0 -2
- package/dist/testHelpers/renderAsync.d.ts +0 -2
- package/dist/testHelpers/renderAsync.js +0 -12
- package/dist/testHelpers/setReadonlyHtmlProperty.d.ts +0 -1
- package/dist/testHelpers/setReadonlyHtmlProperty.js +0 -15
- package/dist/testHelpers/styled-output.d.ts +0 -30
- package/dist/testHelpers/styled-output.js +0 -42
package/dist/index.d.ts
CHANGED
|
@@ -774,8 +774,6 @@ export { HeaderButtonsProvider } from "./utils/headerButtons/headerButtonsProvid
|
|
|
774
774
|
export { getNewFocusableItem, getFirstFocusableItem } from "./utils/keyboardHelpers";
|
|
775
775
|
export { LanguageProvider } from "./utils/localization/languageProvider";
|
|
776
776
|
export { dictionaries, injectString } from "./utils/localization/translationsDictionary";
|
|
777
|
-
export { directionContext } from "./utils/localization/directionContext";
|
|
778
|
-
export type { TTextDirection } from "./utils/localization/getTextDirection";
|
|
779
777
|
export { useDirection } from "./utils/localization/useDirection";
|
|
780
778
|
export { useLanguage } from "./utils/localization/useLanguage";
|
|
781
779
|
export { ThemeDark } from "./utils/theme/themeDark";
|
package/dist/index.js
CHANGED
|
@@ -17,7 +17,7 @@ exports.IconShield3 = exports.IconShield2 = exports.IconShield = exports.IconSha
|
|
|
17
17
|
exports.IconVolumeHalf = exports.IconVolumeFull = exports.IconVolumeDown = exports.IconVoice = exports.IconVisitPage = exports.IconVideoReplay = exports.IconVideo2 = exports.IconVideo = exports.IconUsbHub = exports.IconUsb = exports.IconUpload = exports.IconUnlocked = exports.IconUndock = exports.IconUndo2 = exports.IconUndo = exports.IconUnderline = exports.IconUmbrella = exports.IconTrailer = 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 = void 0;
|
|
18
18
|
exports.isButton = exports.findPrevFocusable = exports.findNextFocusable = exports.findLastFocusable = exports.findFirstFocusable = exports.Menu = exports.ControlledMenu = exports.isDragNotClick = exports.changeOrder = 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 = void 0;
|
|
19
19
|
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 = exports.SidePanel = exports.CUSTOM_POPUP_COMPONENT_CLASSNAME = exports.SidePanelCloseReason = exports.isChildPopup = exports.SelectField = exports.Select = exports.SearchInput = exports.Range = exports.RadioGroup = exports.Radio = exports.ProgressBar = exports.ProgreesBarSize = exports.ProgressBarType = exports.PrimaryIcon = exports.Popup = exports.PillExpandable = 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.MobileSheet = exports.MiniTabs = exports.MiniTabsSize = exports.isLink = void 0;
|
|
20
|
-
exports.Waiting = exports.UserFormatProvider = exports.useDrive = exports.ThemeProvider = exports.ThemeDrive = exports.ThemeDark = exports.useLanguage = exports.useDirection = exports.
|
|
20
|
+
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 = exports.AbortablePromise = 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.useNestedRows = exports.NestedData = exports.TabBarContent = exports.TabBar = void 0;
|
|
21
21
|
/* eslint-disable max-len */
|
|
22
22
|
var absolute_1 = require("./absolute/absolute");
|
|
23
23
|
Object.defineProperty(exports, "Absolute", { enumerable: true, get: function () { return absolute_1.Absolute; } });
|
|
@@ -1663,8 +1663,6 @@ Object.defineProperty(exports, "LanguageProvider", { enumerable: true, get: func
|
|
|
1663
1663
|
var translationsDictionary_1 = require("./utils/localization/translationsDictionary");
|
|
1664
1664
|
Object.defineProperty(exports, "dictionaries", { enumerable: true, get: function () { return translationsDictionary_1.dictionaries; } });
|
|
1665
1665
|
Object.defineProperty(exports, "injectString", { enumerable: true, get: function () { return translationsDictionary_1.injectString; } });
|
|
1666
|
-
var directionContext_1 = require("./utils/localization/directionContext");
|
|
1667
|
-
Object.defineProperty(exports, "directionContext", { enumerable: true, get: function () { return directionContext_1.directionContext; } });
|
|
1668
1666
|
var useDirection_1 = require("./utils/localization/useDirection");
|
|
1669
1667
|
Object.defineProperty(exports, "useDirection", { enumerable: true, get: function () { return useDirection_1.useDirection; } });
|
|
1670
1668
|
var useLanguage_1 = require("./utils/localization/useLanguage");
|
|
@@ -89,7 +89,8 @@ const RadioGroupRaw = (props) => {
|
|
|
89
89
|
"zen-radio-group__item",
|
|
90
90
|
wrappedInLabel ? "zen-radio-group__item--no-paddings" : "",
|
|
91
91
|
type === "interactive" ? "zen-radio--interactive" : "",
|
|
92
|
-
size === "small" ? "zen-radio-group__item--small" : ""
|
|
92
|
+
size === "small" ? "zen-radio-group__item--small" : "",
|
|
93
|
+
direction === "horizontal" ? "zen-radio--align-start" : ""
|
|
93
94
|
]), key: ind, checked: item.value === value, disabled: disabled ? disabled : item.disabled, name: name, reverse: reverse, fullWidth: fullWidth, value: item.value, onChange: onChangeInner, wrappedInLabel: wrappedInLabel, tabIndex: selectItemOnFocus || disabled || item.disabled ? undefined : ind === focusedIndex ? 0 : -1, ref: selectItemOnFocus ? undefined : ind === focusedIndex ? focusElementRef : undefined, role: itemRole }), item.children) }, `${ind}-li`))) })) }));
|
|
94
95
|
};
|
|
95
96
|
exports.RadioGroupRaw = RadioGroupRaw;
|
|
@@ -5,7 +5,7 @@ export declare const getItemIdByIndex: (state: Map<string, CheckboxState>, index
|
|
|
5
5
|
export declare const getItemIndexById: (state: Map<string, CheckboxState>, id: string) => number;
|
|
6
6
|
export declare const updateItemState: (initialState: Map<string, CheckboxState>, multiselect: boolean, updatedId: string, newState: CheckboxState) => [Map<string, CheckboxState>, boolean];
|
|
7
7
|
export declare const searchItemIndex: (items: ISelectListItem[], searchStr: string) => number;
|
|
8
|
-
export declare const getFirstIndex: (items: ISelectListItem[]) =>
|
|
8
|
+
export declare const getFirstIndex: (items: ISelectListItem[]) => number;
|
|
9
9
|
export declare const getLastIndex: (items: ISelectListItem[]) => number;
|
|
10
10
|
export declare const getNextIndex: (currIndex: number, items: ISelectListItem[]) => number;
|
|
11
11
|
export declare const getPrevIndex: (currIndex: number, items: ISelectListItem[]) => number;
|
|
@@ -42,31 +42,56 @@ const searchItemIndex = (items, searchStr) => {
|
|
|
42
42
|
});
|
|
43
43
|
};
|
|
44
44
|
exports.searchItemIndex = searchItemIndex;
|
|
45
|
-
const getFirstIndex = (items) =>
|
|
45
|
+
const getFirstIndex = (items) => items.findIndex(item => !item.disabled);
|
|
46
46
|
exports.getFirstIndex = getFirstIndex;
|
|
47
|
-
const getLastIndex = (items) =>
|
|
47
|
+
const getLastIndex = (items) => {
|
|
48
|
+
for (let i = items.length - 1; i >= 0; i--) {
|
|
49
|
+
if (!items[i].disabled) {
|
|
50
|
+
return i;
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
return -1;
|
|
54
|
+
};
|
|
48
55
|
exports.getLastIndex = getLastIndex;
|
|
49
56
|
const getNextIndex = (currIndex, items) => {
|
|
57
|
+
var _a;
|
|
50
58
|
if (items.length === 0) {
|
|
51
59
|
return -1;
|
|
52
60
|
}
|
|
53
|
-
|
|
61
|
+
let nextIndex = currIndex + 1 >= items.length ? 0 : currIndex + 1;
|
|
62
|
+
const startIndex = nextIndex;
|
|
63
|
+
while ((_a = items[nextIndex]) === null || _a === void 0 ? void 0 : _a.disabled) {
|
|
64
|
+
nextIndex = nextIndex + 1 >= items.length ? 0 : nextIndex + 1;
|
|
65
|
+
if (nextIndex === startIndex) {
|
|
66
|
+
return currIndex;
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
return nextIndex;
|
|
54
70
|
};
|
|
55
71
|
exports.getNextIndex = getNextIndex;
|
|
56
72
|
const getPrevIndex = (currIndex, items) => {
|
|
73
|
+
var _a;
|
|
57
74
|
if (items.length === 0) {
|
|
58
75
|
return -1;
|
|
59
76
|
}
|
|
60
|
-
|
|
77
|
+
let prevIndex = currIndex <= 0 || currIndex >= items.length ? items.length - 1 : currIndex - 1;
|
|
78
|
+
const startIndex = prevIndex;
|
|
79
|
+
while ((_a = items[prevIndex]) === null || _a === void 0 ? void 0 : _a.disabled) {
|
|
80
|
+
prevIndex = prevIndex <= 0 ? items.length - 1 : prevIndex - 1;
|
|
81
|
+
if (prevIndex === startIndex) {
|
|
82
|
+
return currIndex;
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
return prevIndex;
|
|
61
86
|
};
|
|
62
87
|
exports.getPrevIndex = getPrevIndex;
|
|
63
88
|
const getFirstActiveIndex = (state, items, multiselect) => {
|
|
64
89
|
for (let i = 0; i < items.length; i++) {
|
|
65
|
-
if (state.get(items[i].id) === checkboxState_1.CheckboxState.On) {
|
|
90
|
+
if (!items[i].disabled && state.get(items[i].id) === checkboxState_1.CheckboxState.On) {
|
|
66
91
|
return i;
|
|
67
92
|
}
|
|
68
93
|
}
|
|
69
|
-
return multiselect
|
|
94
|
+
return multiselect ? items.findIndex(item => !item.disabled) : -1;
|
|
70
95
|
};
|
|
71
96
|
exports.getFirstActiveIndex = getFirstActiveIndex;
|
|
72
97
|
const getItemsState = (items, value, multiselect) => {
|
|
@@ -51,7 +51,9 @@ const SelectList = (_a) => {
|
|
|
51
51
|
if (!multiselect && selectItemOnFocus) {
|
|
52
52
|
dispatchState({ type: selectList_actionTypes_1.ListAction.FocusFirst, payload: { items } });
|
|
53
53
|
}
|
|
54
|
-
|
|
54
|
+
if (!multiselect) {
|
|
55
|
+
dispatchState({ type: selectList_actionTypes_1.ListAction.Focus, payload: { items, multiselect } });
|
|
56
|
+
}
|
|
55
57
|
}, [multiselect, items, selectItemOnFocus]);
|
|
56
58
|
(0, react_2.useEffect)(() => {
|
|
57
59
|
onChange && state.isItemsStateChanged && onChange(new Map(state.itemsState));
|
|
@@ -120,8 +120,7 @@ const selectListReducer = (state, action) => {
|
|
|
120
120
|
newItemsState = updatedState;
|
|
121
121
|
});
|
|
122
122
|
const prevActiveItemId = (0, selectList_helpers_1.getItemIdByIndex)(state.itemsState, state.activeIndex);
|
|
123
|
-
const
|
|
124
|
-
const activeIndex = newActiveItemIndex ? newActiveItemIndex : -1;
|
|
123
|
+
const activeIndex = prevActiveItemId !== undefined ? (0, selectList_helpers_1.getItemIndexById)(newItemsState, prevActiveItemId) : -1;
|
|
125
124
|
return Object.assign(Object.assign({}, state), { itemsState: newItemsState, activeIndex, isItemsStateChanged: false });
|
|
126
125
|
}
|
|
127
126
|
case selectList_actionTypes_1.ListAction.SetLevel: {
|
|
@@ -66,6 +66,60 @@ injectString("zh-Hans", "Change sort direction", "\u66F4\u6539\u6392\u5E8F");
|
|
|
66
66
|
injectString("zh-TW", "Change sort direction", "\u8B8A\u66F4\u6392\u5E8F\u65B9\u5411");
|
|
67
67
|
injectString("ro-RO", "Change sort direction", "Schimba\u021Bi direc\u021Bia sort\u0103rii");
|
|
68
68
|
injectString("ar-SA", "Change sort direction", "\u062A\u063A\u064A\u064A\u0631 \u0627\u062A\u062C\u0627\u0647 \u0627\u0644\u062A\u0631\u062A\u064A\u0628");
|
|
69
|
+
injectString("cs", "Ascending", "Vzestupn\u011B");
|
|
70
|
+
injectString("da-DK", "Ascending", "Stigende");
|
|
71
|
+
injectString("de", "Ascending", "Aufsteigend");
|
|
72
|
+
injectString("en", "Ascending", "Ascending");
|
|
73
|
+
injectString("es", "Ascending", "Ascendente");
|
|
74
|
+
injectString("fi-FI", "Ascending", "Nouseva");
|
|
75
|
+
injectString("fr", "Ascending", "Croissant");
|
|
76
|
+
injectString("fr-FR", "Ascending", "Croissant");
|
|
77
|
+
injectString("hu-HU", "Ascending", "N\xF6vekv\u0151");
|
|
78
|
+
injectString("id", "Ascending", "Naik");
|
|
79
|
+
injectString("it", "Ascending", "Crescente");
|
|
80
|
+
injectString("ja", "Ascending", "\u6607\u9806");
|
|
81
|
+
injectString("ko-KR", "Ascending", "\uC624\uB984\uCC28\uC21C");
|
|
82
|
+
injectString("ms", "Ascending", "Menaik");
|
|
83
|
+
injectString("nb-NO", "Ascending", "Stigende");
|
|
84
|
+
injectString("nl", "Ascending", "Oplopend");
|
|
85
|
+
injectString("pl", "Ascending", "Rosn\u0105co");
|
|
86
|
+
injectString("pt-BR", "Ascending", "Crescente");
|
|
87
|
+
injectString("pt-PT", "Ascending", "Ascendente");
|
|
88
|
+
injectString("sk-SK", "Ascending", "Vzostupne");
|
|
89
|
+
injectString("sv", "Ascending", "Stigande");
|
|
90
|
+
injectString("th", "Ascending", "\u0E08\u0E32\u0E01\u0E19\u0E49\u0E2D\u0E22\u0E44\u0E1B\u0E21\u0E32\u0E01");
|
|
91
|
+
injectString("tr", "Ascending", "Artan");
|
|
92
|
+
injectString("zh-Hans", "Ascending", "\u5347\u5E8F");
|
|
93
|
+
injectString("zh-TW", "Ascending", "\u905E\u589E");
|
|
94
|
+
injectString("ro-RO", "Ascending", "Ascensiune");
|
|
95
|
+
injectString("ar-SA", "Ascending", "\u062A\u0635\u0627\u0639\u062F\u064A");
|
|
96
|
+
injectString("cs", "Descending", "Sestupn\u011B");
|
|
97
|
+
injectString("da-DK", "Descending", "Faldende");
|
|
98
|
+
injectString("de", "Descending", "Absteigend");
|
|
99
|
+
injectString("en", "Descending", "Descending");
|
|
100
|
+
injectString("es", "Descending", "Descendente");
|
|
101
|
+
injectString("fi-FI", "Descending", "Laskeva");
|
|
102
|
+
injectString("fr", "Descending", "D\xE9croissant");
|
|
103
|
+
injectString("fr-FR", "Descending", "Descendant");
|
|
104
|
+
injectString("hu-HU", "Descending", "Cs\xF6kken\u0151");
|
|
105
|
+
injectString("id", "Descending", "Menurun");
|
|
106
|
+
injectString("it", "Descending", "Decrescente");
|
|
107
|
+
injectString("ja", "Descending", "\u964D\u9806");
|
|
108
|
+
injectString("ko-KR", "Descending", "\uB0B4\uB9BC\uCC28\uC21C");
|
|
109
|
+
injectString("ms", "Descending", "Menurun");
|
|
110
|
+
injectString("nb-NO", "Descending", "Synkende");
|
|
111
|
+
injectString("nl", "Descending", "Aflopend");
|
|
112
|
+
injectString("pl", "Descending", "Malej\u0105co");
|
|
113
|
+
injectString("pt-BR", "Descending", "Decrescente");
|
|
114
|
+
injectString("pt-PT", "Descending", "Descendente");
|
|
115
|
+
injectString("sk-SK", "Descending", "Zostupne");
|
|
116
|
+
injectString("sv", "Descending", "Fallande");
|
|
117
|
+
injectString("th", "Descending", "\u0E08\u0E32\u0E01\u0E21\u0E32\u0E01\u0E44\u0E1B\u0E19\u0E49\u0E2D\u0E22");
|
|
118
|
+
injectString("tr", "Descending", "Azalan");
|
|
119
|
+
injectString("zh-Hans", "Descending", "\u964D\u5E8F");
|
|
120
|
+
injectString("zh-TW", "Descending", "\u905E\u6E1B");
|
|
121
|
+
injectString("ro-RO", "Descending", "Cobor\xE2re");
|
|
122
|
+
injectString("ar-SA", "Descending", "\u062A\u0646\u0627\u0632\u0644\u064A");
|
|
69
123
|
injectString("cs", "Sort Options", "Sort Options");
|
|
70
124
|
injectString("da-DK", "Sort Options", "Sorteringsmuligheder");
|
|
71
125
|
injectString("de", "Sort Options", "Sort Options");
|
|
@@ -157,7 +211,6 @@ const SortControl = ({
|
|
|
157
211
|
onClick: () => onSortDirectionToggle(),
|
|
158
212
|
disabled: disabled,
|
|
159
213
|
title: translate("Change sort direction"),
|
|
160
|
-
"aria-label": translate("Change sort direction"),
|
|
161
214
|
children: [directionIcon ? sortDirection === SortDirections.Ascending ? (0, jsx_runtime_1.jsx)(iconFilter3Asc_1.IconFilter3Asc, {
|
|
162
215
|
className: "zen-sort-container__sort-icon",
|
|
163
216
|
size: isDrive ? "huge" : "large"
|
|
@@ -170,6 +223,9 @@ const SortControl = ({
|
|
|
170
223
|
children: [buttonTextValue, ": "]
|
|
171
224
|
}), (0, jsx_runtime_1.jsx)("span", {
|
|
172
225
|
children: (items.find(item => item.id === sortBy) || items[0]).children
|
|
226
|
+
}), (0, jsx_runtime_1.jsxs)("span", {
|
|
227
|
+
className: "zen-visually-hidden",
|
|
228
|
+
children: [" ", sortDirection === SortDirections.Ascending ? translate("Ascending") : translate("Descending")]
|
|
173
229
|
})]
|
|
174
230
|
})]
|
|
175
231
|
}), isSingleItem ? "" : (0, jsx_runtime_1.jsx)(popup_1.Popup, {
|
|
@@ -197,4 +253,4 @@ const SortControl = ({
|
|
|
197
253
|
});
|
|
198
254
|
};
|
|
199
255
|
exports.SortControl = SortControl;
|
|
200
|
-
exports.TRANSLATIONS = ["Sort by", "Sort Options", "Change sort direction"];
|
|
256
|
+
exports.TRANSLATIONS = ["Sort by", "Sort Options", "Change sort direction", "Ascending", "Descending"];
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { ReactElement, ReactNode, RefObject } from "react";
|
|
2
|
-
export declare const useTableChildren: (children: ReactNode, isMobile: boolean, selected: number, allSelected: boolean, clearSelection: () => void,
|
|
2
|
+
export declare const useTableChildren: (children: ReactNode, isMobile: boolean, selected: number, allSelected: boolean, clearSelection: () => void, activeId?: string, gridRef?: RefObject<HTMLElement | null>, onCloseDetailPanel?: () => void) => {
|
|
3
3
|
bulkActions: ReactElement<unknown, string | import("react").JSXElementConstructor<any>> | undefined;
|
|
4
4
|
pagination: ReactElement<unknown, string | import("react").JSXElementConstructor<any>> | undefined;
|
|
5
5
|
activePage: number | undefined;
|
|
@@ -27,7 +27,7 @@ const isChildElement = function (child, expectedType) {
|
|
|
27
27
|
}
|
|
28
28
|
return false;
|
|
29
29
|
};
|
|
30
|
-
const useTableChildren = (children, isMobile, selected, allSelected, clearSelection,
|
|
30
|
+
const useTableChildren = (children, isMobile, selected, allSelected, clearSelection, activeId, gridRef, onCloseDetailPanel) => (0, react_1.useMemo)(() => {
|
|
31
31
|
let bulkActions = undefined;
|
|
32
32
|
let tablePagination = undefined;
|
|
33
33
|
let activePage = undefined;
|
|
@@ -42,7 +42,7 @@ const useTableChildren = (children, isMobile, selected, allSelected, clearSelect
|
|
|
42
42
|
}
|
|
43
43
|
if (isChildElement(child, tableBulkActions_1.TableBulkActions.displayName)) {
|
|
44
44
|
const bulkActionButtons = child.props.children || [];
|
|
45
|
-
bulkActions = ((0, jsx_runtime_1.jsx)(bulkActions_1.BulkActions, { gridType: isMobile ? deviceType_1.DeviceType.Mobile : deviceType_1.DeviceType.Desktop, selected: selected, allSelected: allSelected, onClearSelection: clearSelection,
|
|
45
|
+
bulkActions = ((0, jsx_runtime_1.jsx)(bulkActions_1.BulkActions, { gridType: isMobile ? deviceType_1.DeviceType.Mobile : deviceType_1.DeviceType.Desktop, selected: selected, allSelected: allSelected, onClearSelection: clearSelection, children: bulkActionButtons }));
|
|
46
46
|
return;
|
|
47
47
|
}
|
|
48
48
|
if (isChildElement(child, tablePagination_1.TablePagination.displayName)) {
|
|
@@ -103,5 +103,5 @@ const useTableChildren = (children, isMobile, selected, allSelected, clearSelect
|
|
|
103
103
|
detailPanel: detailPanel,
|
|
104
104
|
other: other
|
|
105
105
|
};
|
|
106
|
-
}, [children, clearSelection, isMobile, selected, gridRef, allSelected,
|
|
106
|
+
}, [children, clearSelection, isMobile, selected, gridRef, allSelected, activeId, onCloseDetailPanel]);
|
|
107
107
|
exports.useTableChildren = useTableChildren;
|
|
@@ -65,6 +65,7 @@ const SubColumnsList = ({
|
|
|
65
65
|
showCheckbox: true,
|
|
66
66
|
children: c.title
|
|
67
67
|
})), [columns, sortColumnsInt, lastVisibleColumnId]);
|
|
68
|
+
const allDisabled = (0, react_1.useMemo)(() => items.every(item => item.disabled), [items]);
|
|
68
69
|
const state = columns.reduce((res, c) => {
|
|
69
70
|
res.set(c.id, settings.get(c.id) !== false ? checkboxState_1.CheckboxState.On : checkboxState_1.CheckboxState.Off);
|
|
70
71
|
return res;
|
|
@@ -84,8 +85,9 @@ const SubColumnsList = ({
|
|
|
84
85
|
title: title || translate("Select visible columns"),
|
|
85
86
|
multiselect: true,
|
|
86
87
|
showCheckbox: true,
|
|
87
|
-
onChange: onChangeItem
|
|
88
|
-
|
|
88
|
+
onChange: onChangeItem,
|
|
89
|
+
disabled: allDisabled
|
|
90
|
+
}), [id, items, state, title, translate, onChangeItem, allDisabled]);
|
|
89
91
|
if (!title) {
|
|
90
92
|
return list;
|
|
91
93
|
}
|
|
@@ -16,6 +16,14 @@ export interface ISelectableRowsOptions<T extends IRowEntity<N>, N extends IEnti
|
|
|
16
16
|
checkboxTitle?: (entity: T | N) => string;
|
|
17
17
|
headerTitle?: (state: SelectionState) => string;
|
|
18
18
|
turnOffSelectAll?: boolean;
|
|
19
|
+
/**
|
|
20
|
+
* When `true`, the header checkbox emits the current page's IDs instead of `{ all: true }`.
|
|
21
|
+
* When `undefined`, falls back to `turnOffSelectAll` for backward compatibility.
|
|
22
|
+
*
|
|
23
|
+
* Note: avoid setting this to `false` alongside `turnOffSelectAll: true` — the checkbox
|
|
24
|
+
* will emit `{ all: true }` while the dropdown hides the "Select all" option, which is inconsistent.
|
|
25
|
+
*/
|
|
26
|
+
checkboxSelectsCurrentPage?: boolean;
|
|
19
27
|
checkboxPlaceholder?: boolean;
|
|
20
28
|
strategy?: TSelectionStrategy;
|
|
21
29
|
selectAll?: boolean;
|
|
@@ -188,8 +188,16 @@ const useSelectableRows = (columns, entities, isMobile, selectMode, setSelectMod
|
|
|
188
188
|
return translate("Deselect all");
|
|
189
189
|
}, [selectable, selectableState, state, translate]);
|
|
190
190
|
const isEntityChecked = (0, react_1.useCallback)((entity, isNested) => (0, isRowChecked_1.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]);
|
|
191
|
+
const hasSelectable = !!selectable;
|
|
192
|
+
const selectableCheckboxSelectsCurrentPage = selectable === null || selectable === void 0 ? void 0 : selectable.checkboxSelectsCurrentPage;
|
|
193
|
+
const selectableTurnOffSelectAll = selectable === null || selectable === void 0 ? void 0 : selectable.turnOffSelectAll;
|
|
194
|
+
const selectableCheckboxInHeader = selectable === null || selectable === void 0 ? void 0 : selectable.checkboxInHeader;
|
|
195
|
+
const selectableSelectionLimit = selectable === null || selectable === void 0 ? void 0 : selectable.selectionLimit;
|
|
196
|
+
const selectableHeader = selectable === null || selectable === void 0 ? void 0 : selectable.header;
|
|
197
|
+
const checkboxEmitsCurrentPage = selectableCheckboxSelectsCurrentPage !== null && selectableCheckboxSelectsCurrentPage !== void 0 ? selectableCheckboxSelectsCurrentPage : selectableTurnOffSelectAll;
|
|
198
|
+
const checkboxInHeaderValue = selectableCheckboxInHeader !== undefined ? selectableCheckboxInHeader : selectableSelectionLimit !== undefined ? false : undefined;
|
|
191
199
|
const wrapper = (0, react_1.useMemo)(() => {
|
|
192
|
-
if (!
|
|
200
|
+
if (!hasSelectable) {
|
|
193
201
|
return null;
|
|
194
202
|
}
|
|
195
203
|
return {
|
|
@@ -233,7 +241,7 @@ const useSelectableRows = (columns, entities, isMobile, selectMode, setSelectMod
|
|
|
233
241
|
onChange: newValue => {
|
|
234
242
|
var _a, _b;
|
|
235
243
|
if (newValue) {
|
|
236
|
-
const newState =
|
|
244
|
+
const newState = checkboxEmitsCurrentPage ? interfaces_1.SelectionState.CurrentPage : interfaces_1.SelectionState.All;
|
|
237
245
|
setState(newState);
|
|
238
246
|
onChangeSelectionState(newState);
|
|
239
247
|
} else {
|
|
@@ -251,18 +259,18 @@ const useSelectableRows = (columns, entities, isMobile, selectMode, setSelectMod
|
|
|
251
259
|
}
|
|
252
260
|
},
|
|
253
261
|
calculateSelectionState: () => selectableState,
|
|
254
|
-
checkboxInHeader:
|
|
255
|
-
header:
|
|
262
|
+
checkboxInHeader: checkboxInHeaderValue,
|
|
263
|
+
header: selectableHeader,
|
|
256
264
|
onSelect: newState => {
|
|
257
265
|
setState(newState);
|
|
258
266
|
onChangeSelectionState(newState);
|
|
259
267
|
},
|
|
260
|
-
turnOffSelectAll:
|
|
268
|
+
turnOffSelectAll: selectableTurnOffSelectAll
|
|
261
269
|
});
|
|
262
270
|
return cell;
|
|
263
271
|
}
|
|
264
272
|
};
|
|
265
|
-
}, [checkboxDisabled, checkboxTitle, checkboxVisible, headerTitle, onChangeSelectionState, onSelectListener, selectable, selectableState, state, isMobile, checkboxPlaceholder, isEntityChecked, entities, setSelectMode]);
|
|
273
|
+
}, [checkboxDisabled, checkboxTitle, checkboxVisible, headerTitle, onChangeSelectionState, onSelectListener, hasSelectable, checkboxEmitsCurrentPage, checkboxInHeaderValue, selectableHeader, selectableTurnOffSelectAll, selectable, selectableState, state, isMobile, checkboxPlaceholder, isEntityChecked, entities, setSelectMode]);
|
|
266
274
|
const selectableFeedWrapper = (0, react_1.useCallback)((primaryData, secondaryData, entity, isNested) => {
|
|
267
275
|
// eslint-disable-next-line @typescript-eslint/no-unnecessary-condition
|
|
268
276
|
if (!entity) {
|
package/dist/table/table.js
CHANGED
|
@@ -227,12 +227,6 @@ const TableInner = ({
|
|
|
227
227
|
selected: []
|
|
228
228
|
});
|
|
229
229
|
}, [selectable]);
|
|
230
|
-
const selectAll = (0, react_1.useCallback)(() => {
|
|
231
|
-
selectable === null || selectable === void 0 ? void 0 : selectable.onSelect({
|
|
232
|
-
all: true,
|
|
233
|
-
selected: []
|
|
234
|
-
});
|
|
235
|
-
}, [selectable]);
|
|
236
230
|
const [activeIdInternal, setActiveInternal] = (0, react_1.useState)(undefined);
|
|
237
231
|
const activeId = active !== undefined ? active : activeIdInternal;
|
|
238
232
|
const onClickInternal = (0, react_1.useCallback)(id => setActiveInternal(id === activeIdInternal ? undefined : id), [activeIdInternal, setActiveInternal]);
|
|
@@ -249,7 +243,7 @@ const TableInner = ({
|
|
|
249
243
|
detailPanel,
|
|
250
244
|
footer,
|
|
251
245
|
other
|
|
252
|
-
} = (0, useTableChildren_1.useTableChildren)(children, isMobile, selectionQty, ((_c = selectable === null || selectable === void 0 ? void 0 : selectable.selection) === null || _c === void 0 ? void 0 : _c.all) || false, clearSelection,
|
|
246
|
+
} = (0, useTableChildren_1.useTableChildren)(children, isMobile, selectionQty, ((_c = selectable === null || selectable === void 0 ? void 0 : selectable.selection) === null || _c === void 0 ? void 0 : _c.all) || false, clearSelection, activeId, gridRef, onCloseDetailPanel);
|
|
253
247
|
const hasDetailPanel = !!detailPanel;
|
|
254
248
|
const shouldEnableRowClick = hasDetailPanel || !!onClick;
|
|
255
249
|
const activeIdForRow = shouldEnableRowClick ? activeId : undefined;
|
|
@@ -328,5 +328,7 @@
|
|
|
328
328
|
"File upload area": "File upload area",
|
|
329
329
|
"Uploaded": "Uploaded",
|
|
330
330
|
"Sort by Ascending": "Sort by Ascending",
|
|
331
|
-
"Sort by Descending": "Sort by Descending"
|
|
331
|
+
"Sort by Descending": "Sort by Descending",
|
|
332
|
+
"Ascending": "Ascending",
|
|
333
|
+
"Descending": "Descending"
|
|
332
334
|
}
|
|
@@ -323,5 +323,7 @@
|
|
|
323
323
|
"Supported Formats:": "Supported Formats:",
|
|
324
324
|
"Upload files.": "Upload files.",
|
|
325
325
|
"File upload area": "File upload area",
|
|
326
|
-
"Uploaded": "Uploaded"
|
|
326
|
+
"Uploaded": "Uploaded",
|
|
327
|
+
"Ascending": "จากน้อยไปมาก",
|
|
328
|
+
"Descending": "จากมากไปน้อย"
|
|
327
329
|
}
|