@ox0/data-grid 0.6.0 → 0.8.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/dist/components/ColumnChooser.d.ts.map +1 -1
- package/dist/components/ColumnResizeHandle.d.ts.map +1 -1
- package/dist/components/DataGrid.d.ts.map +1 -1
- package/dist/components/DataGrid.i18n.test.d.ts +2 -0
- package/dist/components/DataGrid.i18n.test.d.ts.map +1 -0
- package/dist/components/ExportButton.d.ts.map +1 -1
- package/dist/components/Pager.d.ts.map +1 -1
- package/dist/components/ViewsMenu.d.ts +0 -6
- package/dist/components/ViewsMenu.d.ts.map +1 -1
- package/dist/components/cell-actions.d.ts +2 -1
- package/dist/components/cell-actions.d.ts.map +1 -1
- package/dist/components/format.d.ts +0 -2
- package/dist/components/format.d.ts.map +1 -1
- package/dist/hooks/use-views.d.ts +3 -1
- package/dist/hooks/use-views.d.ts.map +1 -1
- package/dist/index.d.ts +2 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +451 -217
- package/dist/messages.d.ts +132 -0
- package/dist/messages.d.ts.map +1 -0
- package/dist/types.d.ts +27 -8
- package/dist/types.d.ts.map +1 -1
- package/dist/worker/engine.js +1 -1
- package/package.json +12 -7
- /package/dist/{774.js → 4.js} +0 -0
package/dist/index.js
CHANGED
|
@@ -6,17 +6,18 @@ import { Button, Checkbox, Drawer, IconButton, MarkProvider, Markable, Menu, Men
|
|
|
6
6
|
import { Fragment as external_react_Fragment, memo, startTransition as external_react_startTransition, useCallback, useEffect, useLayoutEffect, useMemo, useRef, useState, useTransition } from "react";
|
|
7
7
|
import { useStore } from "zustand";
|
|
8
8
|
import { createStore } from "zustand/vanilla";
|
|
9
|
+
import { useOx0Intl } from "@ox0/i18n";
|
|
9
10
|
import { useVirtualizer } from "@tanstack/react-virtual";
|
|
10
11
|
import { flushSync } from "react-dom";
|
|
11
12
|
import { __webpack_require__ } from "./rslib-runtime.js";
|
|
12
|
-
import { scanFractionDigits, createMessageHandler } from "./
|
|
13
|
+
import { scanFractionDigits, createMessageHandler } from "./4.js";
|
|
13
14
|
__webpack_require__.add({
|
|
14
|
-
"../../node_modules/.pnpm/@rsbuild+core@2.
|
|
15
|
-
var
|
|
16
|
-
var
|
|
17
|
-
var
|
|
18
|
-
var
|
|
19
|
-
var ___CSS_LOADER_EXPORT___ =
|
|
15
|
+
"../../node_modules/.pnpm/@rsbuild+core@2.3.0-beta.0_core-js@3.47.0/node_modules/@rsbuild/core/compiled/css-loader/index.js??ruleSet[1].rules[1].oneOf[4].use[1]!builtin:lightningcss-loader??ruleSet[1].rules[1].oneOf[4].use[2]!./src/components/column-chooser.module.css" (module, __webpack_exports__, __webpack_require__) {
|
|
16
|
+
var _node_modules_pnpm_rsbuild_core_2_3_0_beta_0_core_js_3_47_0_node_modules_rsbuild_core_compiled_css_loader_noSourceMaps_js__rspack_import_1 = __webpack_require__("../../node_modules/.pnpm/@rsbuild+core@2.3.0-beta.0_core-js@3.47.0/node_modules/@rsbuild/core/compiled/css-loader/noSourceMaps.js");
|
|
17
|
+
var _node_modules_pnpm_rsbuild_core_2_3_0_beta_0_core_js_3_47_0_node_modules_rsbuild_core_compiled_css_loader_noSourceMaps_js__rspack_import_1_default = /*#__PURE__*/ __webpack_require__.n(_node_modules_pnpm_rsbuild_core_2_3_0_beta_0_core_js_3_47_0_node_modules_rsbuild_core_compiled_css_loader_noSourceMaps_js__rspack_import_1);
|
|
18
|
+
var _node_modules_pnpm_rsbuild_core_2_3_0_beta_0_core_js_3_47_0_node_modules_rsbuild_core_compiled_css_loader_api_js__rspack_import_0 = __webpack_require__("../../node_modules/.pnpm/@rsbuild+core@2.3.0-beta.0_core-js@3.47.0/node_modules/@rsbuild/core/compiled/css-loader/api.js");
|
|
19
|
+
var _node_modules_pnpm_rsbuild_core_2_3_0_beta_0_core_js_3_47_0_node_modules_rsbuild_core_compiled_css_loader_api_js__rspack_import_0_default = /*#__PURE__*/ __webpack_require__.n(_node_modules_pnpm_rsbuild_core_2_3_0_beta_0_core_js_3_47_0_node_modules_rsbuild_core_compiled_css_loader_api_js__rspack_import_0);
|
|
20
|
+
var ___CSS_LOADER_EXPORT___ = _node_modules_pnpm_rsbuild_core_2_3_0_beta_0_core_js_3_47_0_node_modules_rsbuild_core_compiled_css_loader_api_js__rspack_import_0_default()(_node_modules_pnpm_rsbuild_core_2_3_0_beta_0_core_js_3_47_0_node_modules_rsbuild_core_compiled_css_loader_noSourceMaps_js__rspack_import_1_default());
|
|
20
21
|
___CSS_LOADER_EXPORT___.push([
|
|
21
22
|
module.id,
|
|
22
23
|
`.chooser-qS0iYd {
|
|
@@ -127,12 +128,12 @@ __webpack_require__.add({
|
|
|
127
128
|
A: __rspack_default_export
|
|
128
129
|
});
|
|
129
130
|
},
|
|
130
|
-
"../../node_modules/.pnpm/@rsbuild+core@2.
|
|
131
|
-
var
|
|
132
|
-
var
|
|
133
|
-
var
|
|
134
|
-
var
|
|
135
|
-
var ___CSS_LOADER_EXPORT___ =
|
|
131
|
+
"../../node_modules/.pnpm/@rsbuild+core@2.3.0-beta.0_core-js@3.47.0/node_modules/@rsbuild/core/compiled/css-loader/index.js??ruleSet[1].rules[1].oneOf[4].use[1]!builtin:lightningcss-loader??ruleSet[1].rules[1].oneOf[4].use[2]!./src/components/data-grid.module.css" (module, __webpack_exports__, __webpack_require__) {
|
|
132
|
+
var _node_modules_pnpm_rsbuild_core_2_3_0_beta_0_core_js_3_47_0_node_modules_rsbuild_core_compiled_css_loader_noSourceMaps_js__rspack_import_1 = __webpack_require__("../../node_modules/.pnpm/@rsbuild+core@2.3.0-beta.0_core-js@3.47.0/node_modules/@rsbuild/core/compiled/css-loader/noSourceMaps.js");
|
|
133
|
+
var _node_modules_pnpm_rsbuild_core_2_3_0_beta_0_core_js_3_47_0_node_modules_rsbuild_core_compiled_css_loader_noSourceMaps_js__rspack_import_1_default = /*#__PURE__*/ __webpack_require__.n(_node_modules_pnpm_rsbuild_core_2_3_0_beta_0_core_js_3_47_0_node_modules_rsbuild_core_compiled_css_loader_noSourceMaps_js__rspack_import_1);
|
|
134
|
+
var _node_modules_pnpm_rsbuild_core_2_3_0_beta_0_core_js_3_47_0_node_modules_rsbuild_core_compiled_css_loader_api_js__rspack_import_0 = __webpack_require__("../../node_modules/.pnpm/@rsbuild+core@2.3.0-beta.0_core-js@3.47.0/node_modules/@rsbuild/core/compiled/css-loader/api.js");
|
|
135
|
+
var _node_modules_pnpm_rsbuild_core_2_3_0_beta_0_core_js_3_47_0_node_modules_rsbuild_core_compiled_css_loader_api_js__rspack_import_0_default = /*#__PURE__*/ __webpack_require__.n(_node_modules_pnpm_rsbuild_core_2_3_0_beta_0_core_js_3_47_0_node_modules_rsbuild_core_compiled_css_loader_api_js__rspack_import_0);
|
|
136
|
+
var ___CSS_LOADER_EXPORT___ = _node_modules_pnpm_rsbuild_core_2_3_0_beta_0_core_js_3_47_0_node_modules_rsbuild_core_compiled_css_loader_api_js__rspack_import_0_default()(_node_modules_pnpm_rsbuild_core_2_3_0_beta_0_core_js_3_47_0_node_modules_rsbuild_core_compiled_css_loader_noSourceMaps_js__rspack_import_1_default());
|
|
136
137
|
___CSS_LOADER_EXPORT___.push([
|
|
137
138
|
module.id,
|
|
138
139
|
`.root-Q1XcKg {
|
|
@@ -873,12 +874,12 @@ __webpack_require__.add({
|
|
|
873
874
|
A: __rspack_default_export
|
|
874
875
|
});
|
|
875
876
|
},
|
|
876
|
-
"../../node_modules/.pnpm/@rsbuild+core@2.
|
|
877
|
-
var
|
|
878
|
-
var
|
|
879
|
-
var
|
|
880
|
-
var
|
|
881
|
-
var ___CSS_LOADER_EXPORT___ =
|
|
877
|
+
"../../node_modules/.pnpm/@rsbuild+core@2.3.0-beta.0_core-js@3.47.0/node_modules/@rsbuild/core/compiled/css-loader/index.js??ruleSet[1].rules[1].oneOf[4].use[1]!builtin:lightningcss-loader??ruleSet[1].rules[1].oneOf[4].use[2]!./src/components/views-menu.module.css" (module, __webpack_exports__, __webpack_require__) {
|
|
878
|
+
var _node_modules_pnpm_rsbuild_core_2_3_0_beta_0_core_js_3_47_0_node_modules_rsbuild_core_compiled_css_loader_noSourceMaps_js__rspack_import_1 = __webpack_require__("../../node_modules/.pnpm/@rsbuild+core@2.3.0-beta.0_core-js@3.47.0/node_modules/@rsbuild/core/compiled/css-loader/noSourceMaps.js");
|
|
879
|
+
var _node_modules_pnpm_rsbuild_core_2_3_0_beta_0_core_js_3_47_0_node_modules_rsbuild_core_compiled_css_loader_noSourceMaps_js__rspack_import_1_default = /*#__PURE__*/ __webpack_require__.n(_node_modules_pnpm_rsbuild_core_2_3_0_beta_0_core_js_3_47_0_node_modules_rsbuild_core_compiled_css_loader_noSourceMaps_js__rspack_import_1);
|
|
880
|
+
var _node_modules_pnpm_rsbuild_core_2_3_0_beta_0_core_js_3_47_0_node_modules_rsbuild_core_compiled_css_loader_api_js__rspack_import_0 = __webpack_require__("../../node_modules/.pnpm/@rsbuild+core@2.3.0-beta.0_core-js@3.47.0/node_modules/@rsbuild/core/compiled/css-loader/api.js");
|
|
881
|
+
var _node_modules_pnpm_rsbuild_core_2_3_0_beta_0_core_js_3_47_0_node_modules_rsbuild_core_compiled_css_loader_api_js__rspack_import_0_default = /*#__PURE__*/ __webpack_require__.n(_node_modules_pnpm_rsbuild_core_2_3_0_beta_0_core_js_3_47_0_node_modules_rsbuild_core_compiled_css_loader_api_js__rspack_import_0);
|
|
882
|
+
var ___CSS_LOADER_EXPORT___ = _node_modules_pnpm_rsbuild_core_2_3_0_beta_0_core_js_3_47_0_node_modules_rsbuild_core_compiled_css_loader_api_js__rspack_import_0_default()(_node_modules_pnpm_rsbuild_core_2_3_0_beta_0_core_js_3_47_0_node_modules_rsbuild_core_compiled_css_loader_noSourceMaps_js__rspack_import_1_default());
|
|
882
883
|
___CSS_LOADER_EXPORT___.push([
|
|
883
884
|
module.id,
|
|
884
885
|
`.root-qnts0V {
|
|
@@ -1032,7 +1033,7 @@ __webpack_require__.add({
|
|
|
1032
1033
|
A: __rspack_default_export
|
|
1033
1034
|
});
|
|
1034
1035
|
},
|
|
1035
|
-
"../../node_modules/.pnpm/@rsbuild+core@2.
|
|
1036
|
+
"../../node_modules/.pnpm/@rsbuild+core@2.3.0-beta.0_core-js@3.47.0/node_modules/@rsbuild/core/compiled/css-loader/api.js" (module) {
|
|
1036
1037
|
module.exports = function(cssWithMappingToString) {
|
|
1037
1038
|
var list = [];
|
|
1038
1039
|
list.toString = function() {
|
|
@@ -1085,12 +1086,12 @@ __webpack_require__.add({
|
|
|
1085
1086
|
return list;
|
|
1086
1087
|
};
|
|
1087
1088
|
},
|
|
1088
|
-
"../../node_modules/.pnpm/@rsbuild+core@2.
|
|
1089
|
+
"../../node_modules/.pnpm/@rsbuild+core@2.3.0-beta.0_core-js@3.47.0/node_modules/@rsbuild/core/compiled/css-loader/noSourceMaps.js" (module) {
|
|
1089
1090
|
module.exports = function(i) {
|
|
1090
1091
|
return i[1];
|
|
1091
1092
|
};
|
|
1092
1093
|
},
|
|
1093
|
-
"../../node_modules/.pnpm/@rsbuild+core@2.
|
|
1094
|
+
"../../node_modules/.pnpm/@rsbuild+core@2.3.0-beta.0_core-js@3.47.0/node_modules/@rsbuild/core/compiled/style-loader/runtime/injectStylesIntoStyleTag.js" (module) {
|
|
1094
1095
|
var stylesInDOM = [];
|
|
1095
1096
|
function getIndexByIdentifier(identifier) {
|
|
1096
1097
|
var result = -1;
|
|
@@ -1168,7 +1169,7 @@ __webpack_require__.add({
|
|
|
1168
1169
|
};
|
|
1169
1170
|
};
|
|
1170
1171
|
},
|
|
1171
|
-
"../../node_modules/.pnpm/@rsbuild+core@2.
|
|
1172
|
+
"../../node_modules/.pnpm/@rsbuild+core@2.3.0-beta.0_core-js@3.47.0/node_modules/@rsbuild/core/compiled/style-loader/runtime/insertBySelector.js" (module) {
|
|
1172
1173
|
var memo = {};
|
|
1173
1174
|
function getTarget(target) {
|
|
1174
1175
|
if (void 0 === memo[target]) {
|
|
@@ -1189,7 +1190,7 @@ __webpack_require__.add({
|
|
|
1189
1190
|
}
|
|
1190
1191
|
module.exports = insertBySelector;
|
|
1191
1192
|
},
|
|
1192
|
-
"../../node_modules/.pnpm/@rsbuild+core@2.
|
|
1193
|
+
"../../node_modules/.pnpm/@rsbuild+core@2.3.0-beta.0_core-js@3.47.0/node_modules/@rsbuild/core/compiled/style-loader/runtime/insertStyleElement.js" (module) {
|
|
1193
1194
|
function insertStyleElement(options) {
|
|
1194
1195
|
var element = document.createElement("style");
|
|
1195
1196
|
options.setAttributes(element, options.attributes);
|
|
@@ -1198,14 +1199,14 @@ __webpack_require__.add({
|
|
|
1198
1199
|
}
|
|
1199
1200
|
module.exports = insertStyleElement;
|
|
1200
1201
|
},
|
|
1201
|
-
"../../node_modules/.pnpm/@rsbuild+core@2.
|
|
1202
|
+
"../../node_modules/.pnpm/@rsbuild+core@2.3.0-beta.0_core-js@3.47.0/node_modules/@rsbuild/core/compiled/style-loader/runtime/setAttributesWithoutAttributes.js" (module, __unused_rspack_exports, __webpack_require__) {
|
|
1202
1203
|
function setAttributesWithoutAttributes(styleElement) {
|
|
1203
1204
|
var nonce = __webpack_require__.nc;
|
|
1204
1205
|
if (nonce) styleElement.setAttribute("nonce", nonce);
|
|
1205
1206
|
}
|
|
1206
1207
|
module.exports = setAttributesWithoutAttributes;
|
|
1207
1208
|
},
|
|
1208
|
-
"../../node_modules/.pnpm/@rsbuild+core@2.
|
|
1209
|
+
"../../node_modules/.pnpm/@rsbuild+core@2.3.0-beta.0_core-js@3.47.0/node_modules/@rsbuild/core/compiled/style-loader/runtime/styleDomAPI.js" (module) {
|
|
1209
1210
|
function apply(styleElement, options, obj) {
|
|
1210
1211
|
var css = "";
|
|
1211
1212
|
if (obj.supports) css += "@supports (".concat(obj.supports, ") {");
|
|
@@ -1241,7 +1242,7 @@ __webpack_require__.add({
|
|
|
1241
1242
|
}
|
|
1242
1243
|
module.exports = domAPI;
|
|
1243
1244
|
},
|
|
1244
|
-
"../../node_modules/.pnpm/@rsbuild+core@2.
|
|
1245
|
+
"../../node_modules/.pnpm/@rsbuild+core@2.3.0-beta.0_core-js@3.47.0/node_modules/@rsbuild/core/compiled/style-loader/runtime/styleTagTransform.js" (module) {
|
|
1245
1246
|
function styleTagTransform(css, styleElement) {
|
|
1246
1247
|
if (styleElement.styleSheet) styleElement.styleSheet.cssText = css;
|
|
1247
1248
|
else {
|
|
@@ -3134,7 +3135,7 @@ function useViews({ config, columns, sort, filterTokens, normalize, apply, reset
|
|
|
3134
3135
|
commitLoaded(view);
|
|
3135
3136
|
if (!isControlled) setInternalId(viewId);
|
|
3136
3137
|
} catch {
|
|
3137
|
-
if (token === loadTokenRef.current) setError("
|
|
3138
|
+
if (token === loadTokenRef.current) setError("load");
|
|
3138
3139
|
} finally{
|
|
3139
3140
|
if (token === loadTokenRef.current) commitPending(null);
|
|
3140
3141
|
}
|
|
@@ -3174,7 +3175,7 @@ function useViews({ config, columns, sort, filterTokens, normalize, apply, reset
|
|
|
3174
3175
|
commitLoaded(normalize(saved));
|
|
3175
3176
|
return true;
|
|
3176
3177
|
} catch {
|
|
3177
|
-
setError("
|
|
3178
|
+
setError("save");
|
|
3178
3179
|
return false;
|
|
3179
3180
|
}
|
|
3180
3181
|
}
|
|
@@ -3198,7 +3199,7 @@ function useViews({ config, columns, sort, filterTokens, normalize, apply, reset
|
|
|
3198
3199
|
config.onActiveViewChange?.(saved.id);
|
|
3199
3200
|
return true;
|
|
3200
3201
|
} catch {
|
|
3201
|
-
setError("
|
|
3202
|
+
setError("save");
|
|
3202
3203
|
return false;
|
|
3203
3204
|
}
|
|
3204
3205
|
}
|
|
@@ -3214,7 +3215,7 @@ function useViews({ config, columns, sort, filterTokens, normalize, apply, reset
|
|
|
3214
3215
|
if (loadedIdRef.current === viewId) commitLoaded(normalize(saved));
|
|
3215
3216
|
return true;
|
|
3216
3217
|
} catch {
|
|
3217
|
-
setError("
|
|
3218
|
+
setError("rename");
|
|
3218
3219
|
return false;
|
|
3219
3220
|
}
|
|
3220
3221
|
}
|
|
@@ -3234,7 +3235,7 @@ function useViews({ config, columns, sort, filterTokens, normalize, apply, reset
|
|
|
3234
3235
|
if (viewId === activeViewId) resetToDefault();
|
|
3235
3236
|
return true;
|
|
3236
3237
|
} catch {
|
|
3237
|
-
setError("
|
|
3238
|
+
setError("delete");
|
|
3238
3239
|
return false;
|
|
3239
3240
|
}
|
|
3240
3241
|
}
|
|
@@ -3254,6 +3255,142 @@ function useViews({ config, columns, sort, filterTokens, normalize, apply, reset
|
|
|
3254
3255
|
resetToDefault
|
|
3255
3256
|
};
|
|
3256
3257
|
}
|
|
3258
|
+
const defaultDataGridMessages = {
|
|
3259
|
+
"ox0.dataGrid.status.rows": "{count, plural, one {<strong>#</strong> row} other {<strong>#</strong> rows}}",
|
|
3260
|
+
"ox0.dataGrid.status.rowsLoaded": "{count, plural, one {<strong>#</strong> row loaded} other {<strong>#</strong> rows loaded}}",
|
|
3261
|
+
"ox0.dataGrid.status.filteredRows": "<strong>{count, number}</strong> of {total, plural, one {# row} other {# rows}}",
|
|
3262
|
+
"ox0.dataGrid.status.loaded": "Rows loaded",
|
|
3263
|
+
"ox0.dataGrid.status.loading": "Loading rows",
|
|
3264
|
+
"ox0.dataGrid.status.loadingProgress": "Loading rows, {progress, number, ::percent}",
|
|
3265
|
+
"ox0.dataGrid.export.failed": "Export failed.",
|
|
3266
|
+
"ox0.dataGrid.selection.region": "Selection",
|
|
3267
|
+
"ox0.dataGrid.selection.none": "No rows selected",
|
|
3268
|
+
"ox0.dataGrid.selection.all": "All rows selected",
|
|
3269
|
+
"ox0.dataGrid.selection.allMatching": "All matching rows selected",
|
|
3270
|
+
"ox0.dataGrid.selection.count": "{count, plural, one {# row selected} other {# rows selected}}",
|
|
3271
|
+
"ox0.dataGrid.selection.selected": "{count, plural, other {<strong>#</strong> selected}}",
|
|
3272
|
+
"ox0.dataGrid.selection.clear": "Clear selection",
|
|
3273
|
+
"ox0.dataGrid.select.column": "Select",
|
|
3274
|
+
"ox0.dataGrid.select.all": "Select all rows",
|
|
3275
|
+
"ox0.dataGrid.select.group": "Select group {group}",
|
|
3276
|
+
"ox0.dataGrid.select.row": "Select {row}",
|
|
3277
|
+
"ox0.dataGrid.rowOrder": "Row order",
|
|
3278
|
+
"ox0.dataGrid.moveRow": "Move {row}",
|
|
3279
|
+
"ox0.dataGrid.group.empty": "Empty",
|
|
3280
|
+
"ox0.dataGrid.group.label": "{column}: {value}",
|
|
3281
|
+
"ox0.dataGrid.group.toggle": "{group}, {count, plural, one {# row} other {# rows}}",
|
|
3282
|
+
"ox0.dataGrid.total": "Total",
|
|
3283
|
+
"ox0.dataGrid.totalValue": "<hidden>Total: </hidden>{value}",
|
|
3284
|
+
"ox0.dataGrid.details": "Details",
|
|
3285
|
+
"ox0.dataGrid.filter": "Filter",
|
|
3286
|
+
"ox0.dataGrid.search": "Search",
|
|
3287
|
+
"ox0.dataGrid.searchPlaceholder": "Search…",
|
|
3288
|
+
"ox0.dataGrid.columns": "Columns",
|
|
3289
|
+
"ox0.dataGrid.empty": "No rows.",
|
|
3290
|
+
"ox0.dataGrid.noResults": "No rows match your search.",
|
|
3291
|
+
"ox0.dataGrid.loadingMore": "Loading more…",
|
|
3292
|
+
"ox0.dataGrid.loadFailed": "Couldn’t load rows.",
|
|
3293
|
+
"ox0.dataGrid.loadMoreFailed": "Couldn’t load more rows.",
|
|
3294
|
+
"ox0.dataGrid.retry": "Retry",
|
|
3295
|
+
"ox0.dataGrid.pager.label": "Pages",
|
|
3296
|
+
"ox0.dataGrid.pager.previous": "Previous page",
|
|
3297
|
+
"ox0.dataGrid.pager.next": "Next page",
|
|
3298
|
+
"ox0.dataGrid.pager.noRows": "No rows",
|
|
3299
|
+
"ox0.dataGrid.pager.range": "{first, number}–{last, number}",
|
|
3300
|
+
"ox0.dataGrid.pager.rangeOf": "{first, number}–{last, number} of {total, number}",
|
|
3301
|
+
"ox0.dataGrid.export.label": "Export",
|
|
3302
|
+
"ox0.dataGrid.export.menu": "Export format",
|
|
3303
|
+
"ox0.dataGrid.export.as": "Export {format}",
|
|
3304
|
+
"ox0.dataGrid.columnChooser.find": "Find columns",
|
|
3305
|
+
"ox0.dataGrid.columnChooser.pinnedLeft": "Pinned left",
|
|
3306
|
+
"ox0.dataGrid.columnChooser.columns": "Columns",
|
|
3307
|
+
"ox0.dataGrid.columnChooser.pinnedRight": "Pinned right",
|
|
3308
|
+
"ox0.dataGrid.columnChooser.noMatches": "No matching columns",
|
|
3309
|
+
"ox0.dataGrid.columnChooser.dropToPin": "Drag a column here to pin it",
|
|
3310
|
+
"ox0.dataGrid.columnChooser.reorder": "Reorder {column}",
|
|
3311
|
+
"ox0.dataGrid.columnChooser.reset": "Reset to default",
|
|
3312
|
+
"ox0.dataGrid.resizeColumn": "Resize {column}",
|
|
3313
|
+
"ox0.dataGrid.cellActions.label": "Filter options",
|
|
3314
|
+
"ox0.dataGrid.cellActions.included": "{column} {value} added to the filter.",
|
|
3315
|
+
"ox0.dataGrid.cellActions.includeRemoved": "{column} {value} removed from the filter.",
|
|
3316
|
+
"ox0.dataGrid.cellActions.excluded": "{column} {value} excluded.",
|
|
3317
|
+
"ox0.dataGrid.cellActions.excludeRemoved": "{column} {value} no longer excluded.",
|
|
3318
|
+
"ox0.dataGrid.cellActions.cleared": "{column} filter cleared.",
|
|
3319
|
+
"ox0.dataGrid.cellActions.setAsFilter": "{column} {value} set as the filter.",
|
|
3320
|
+
"ox0.dataGrid.cellActions.pending": "{change} {shortcut} to apply.",
|
|
3321
|
+
"ox0.dataGrid.cellActions.applyShortcut": "Ctrl+Enter",
|
|
3322
|
+
"ox0.dataGrid.cellActions.applyShortcutMac": "⌘↵",
|
|
3323
|
+
"ox0.dataGrid.cellActions.labelFor": "Filter options for {column}: {value}",
|
|
3324
|
+
"ox0.dataGrid.cellActions.section": "{column}: {value}",
|
|
3325
|
+
"ox0.dataGrid.cellActions.emptyValue": "empty",
|
|
3326
|
+
"ox0.dataGrid.cellActions.emptySection": "(empty)",
|
|
3327
|
+
"ox0.dataGrid.cellActions.filterTo": "Filter to this",
|
|
3328
|
+
"ox0.dataGrid.cellActions.removeFromFilter": "Remove from filter",
|
|
3329
|
+
"ox0.dataGrid.cellActions.filterToOnly": "Filter to only this",
|
|
3330
|
+
"ox0.dataGrid.cellActions.exclude": "Exclude this",
|
|
3331
|
+
"ox0.dataGrid.cellActions.stopExcluding": "Stop excluding",
|
|
3332
|
+
"ox0.dataGrid.cellActions.atLeast": "At least this",
|
|
3333
|
+
"ox0.dataGrid.cellActions.atMost": "At most this",
|
|
3334
|
+
"ox0.dataGrid.cellActions.onOrAfter": "On or after",
|
|
3335
|
+
"ox0.dataGrid.cellActions.onOrBefore": "On or before",
|
|
3336
|
+
"ox0.dataGrid.cellActions.within": "Within",
|
|
3337
|
+
"ox0.dataGrid.cellActions.days": "{count, plural, one {# day} other {# days}}",
|
|
3338
|
+
"ox0.dataGrid.cellActions.weeks": "{count, plural, one {# week} other {# weeks}}",
|
|
3339
|
+
"ox0.dataGrid.cellActions.months": "{count, plural, one {# month} other {# months}}",
|
|
3340
|
+
"ox0.dataGrid.cellActions.years": "{count, plural, one {# year} other {# years}}",
|
|
3341
|
+
"ox0.dataGrid.cellActions.filterToEmpty": "Filter to empty",
|
|
3342
|
+
"ox0.dataGrid.cellActions.excludeEmpty": "Exclude empty",
|
|
3343
|
+
"ox0.dataGrid.cellActions.clearColumnFilter": "Clear column filter",
|
|
3344
|
+
"ox0.dataGrid.cellActions.copy": "Copy value",
|
|
3345
|
+
"ox0.dataGrid.cellActions.includeHint": "Ctrl-click",
|
|
3346
|
+
"ox0.dataGrid.cellActions.includeHintMac": "⌘-click",
|
|
3347
|
+
"ox0.dataGrid.cellActions.excludeHint": "Alt-click",
|
|
3348
|
+
"ox0.dataGrid.cellActions.excludeHintMac": "⌥-click",
|
|
3349
|
+
"ox0.dataGrid.views.label": "Views",
|
|
3350
|
+
"ox0.dataGrid.views.modified": "Modified",
|
|
3351
|
+
"ox0.dataGrid.views.list": "Saved views",
|
|
3352
|
+
"ox0.dataGrid.views.none": "No saved views yet.",
|
|
3353
|
+
"ox0.dataGrid.views.name": "View name",
|
|
3354
|
+
"ox0.dataGrid.views.includeFilters": "Include current filters",
|
|
3355
|
+
"ox0.dataGrid.views.cancel": "Cancel",
|
|
3356
|
+
"ox0.dataGrid.views.saveView": "Save view",
|
|
3357
|
+
"ox0.dataGrid.views.save": "Save “{name}”",
|
|
3358
|
+
"ox0.dataGrid.views.saveAs": "Save as new view…",
|
|
3359
|
+
"ox0.dataGrid.views.rename": "Rename",
|
|
3360
|
+
"ox0.dataGrid.views.renameView": "Rename {name}",
|
|
3361
|
+
"ox0.dataGrid.views.delete": "Delete",
|
|
3362
|
+
"ox0.dataGrid.views.deleteView": "Delete {name}",
|
|
3363
|
+
"ox0.dataGrid.views.deleteConfirm": "Delete “{name}”?",
|
|
3364
|
+
"ox0.dataGrid.views.reset": "Reset to default",
|
|
3365
|
+
"ox0.dataGrid.views.loadFailed": "Couldn’t load the view.",
|
|
3366
|
+
"ox0.dataGrid.views.saveFailed": "Couldn’t save the view.",
|
|
3367
|
+
"ox0.dataGrid.views.renameFailed": "Couldn’t rename the view.",
|
|
3368
|
+
"ox0.dataGrid.views.deleteFailed": "Couldn’t delete the view."
|
|
3369
|
+
};
|
|
3370
|
+
function strong(chunks) {
|
|
3371
|
+
return /*#__PURE__*/ jsx("strong", {
|
|
3372
|
+
children: chunks
|
|
3373
|
+
});
|
|
3374
|
+
}
|
|
3375
|
+
function useDataGridMessages() {
|
|
3376
|
+
const intl = useOx0Intl();
|
|
3377
|
+
return useMemo(()=>({
|
|
3378
|
+
number: (value)=>intl.formatNumber(value),
|
|
3379
|
+
t: (id, values)=>intl.formatMessage({
|
|
3380
|
+
id,
|
|
3381
|
+
defaultMessage: defaultDataGridMessages[id]
|
|
3382
|
+
}, values),
|
|
3383
|
+
rich: (id, values)=>intl.formatMessage({
|
|
3384
|
+
id,
|
|
3385
|
+
defaultMessage: defaultDataGridMessages[id]
|
|
3386
|
+
}, {
|
|
3387
|
+
strong: strong,
|
|
3388
|
+
...values
|
|
3389
|
+
})
|
|
3390
|
+
}), [
|
|
3391
|
+
intl
|
|
3392
|
+
]);
|
|
3393
|
+
}
|
|
3257
3394
|
function highlightTerms(tokens) {
|
|
3258
3395
|
const global = [];
|
|
3259
3396
|
const byColumn = new Map();
|
|
@@ -3348,19 +3485,19 @@ function measureHeaderWidths(input) {
|
|
|
3348
3485
|
function headerWidth(column, input) {
|
|
3349
3486
|
return input.measure(column.header, input.headerFont) + input.headerPadding + (column.sortable ? SORT_INDICATOR_ALLOWANCE : 0);
|
|
3350
3487
|
}
|
|
3351
|
-
const
|
|
3352
|
-
|
|
3353
|
-
|
|
3354
|
-
|
|
3355
|
-
const insertBySelector = __webpack_require__("../../node_modules/.pnpm/@rsbuild+core@2.1.13_core-js@3.47.0/node_modules/@rsbuild/core/compiled/style-loader/runtime/insertBySelector.js");
|
|
3356
|
-
var insertBySelector_default = /*#__PURE__*/ __webpack_require__.n(insertBySelector);
|
|
3357
|
-
const setAttributesWithoutAttributes = __webpack_require__("../../node_modules/.pnpm/@rsbuild+core@2.1.13_core-js@3.47.0/node_modules/@rsbuild/core/compiled/style-loader/runtime/setAttributesWithoutAttributes.js");
|
|
3488
|
+
const data_grid_module_0 = __webpack_require__("../../node_modules/.pnpm/@rsbuild+core@2.3.0-beta.0_core-js@3.47.0/node_modules/@rsbuild/core/compiled/css-loader/index.js??ruleSet[1].rules[1].oneOf[4].use[1]!builtin:lightningcss-loader??ruleSet[1].rules[1].oneOf[4].use[2]!./src/components/data-grid.module.css");
|
|
3489
|
+
const styleTagTransform = __webpack_require__("../../node_modules/.pnpm/@rsbuild+core@2.3.0-beta.0_core-js@3.47.0/node_modules/@rsbuild/core/compiled/style-loader/runtime/styleTagTransform.js");
|
|
3490
|
+
var styleTagTransform_default = /*#__PURE__*/ __webpack_require__.n(styleTagTransform);
|
|
3491
|
+
const setAttributesWithoutAttributes = __webpack_require__("../../node_modules/.pnpm/@rsbuild+core@2.3.0-beta.0_core-js@3.47.0/node_modules/@rsbuild/core/compiled/style-loader/runtime/setAttributesWithoutAttributes.js");
|
|
3358
3492
|
var setAttributesWithoutAttributes_default = /*#__PURE__*/ __webpack_require__.n(setAttributesWithoutAttributes);
|
|
3359
|
-
const
|
|
3493
|
+
const insertBySelector = __webpack_require__("../../node_modules/.pnpm/@rsbuild+core@2.3.0-beta.0_core-js@3.47.0/node_modules/@rsbuild/core/compiled/style-loader/runtime/insertBySelector.js");
|
|
3494
|
+
var insertBySelector_default = /*#__PURE__*/ __webpack_require__.n(insertBySelector);
|
|
3495
|
+
const styleDomAPI = __webpack_require__("../../node_modules/.pnpm/@rsbuild+core@2.3.0-beta.0_core-js@3.47.0/node_modules/@rsbuild/core/compiled/style-loader/runtime/styleDomAPI.js");
|
|
3496
|
+
var styleDomAPI_default = /*#__PURE__*/ __webpack_require__.n(styleDomAPI);
|
|
3497
|
+
const insertStyleElement = __webpack_require__("../../node_modules/.pnpm/@rsbuild+core@2.3.0-beta.0_core-js@3.47.0/node_modules/@rsbuild/core/compiled/style-loader/runtime/insertStyleElement.js");
|
|
3360
3498
|
var insertStyleElement_default = /*#__PURE__*/ __webpack_require__.n(insertStyleElement);
|
|
3361
|
-
const
|
|
3362
|
-
var
|
|
3363
|
-
const data_grid_module_0 = __webpack_require__("../../node_modules/.pnpm/@rsbuild+core@2.1.13_core-js@3.47.0/node_modules/@rsbuild/core/compiled/css-loader/index.js??ruleSet[1].rules[1].oneOf[4].use[1]!builtin:lightningcss-loader??ruleSet[1].rules[1].oneOf[4].use[2]!./src/components/data-grid.module.css");
|
|
3499
|
+
const injectStylesIntoStyleTag = __webpack_require__("../../node_modules/.pnpm/@rsbuild+core@2.3.0-beta.0_core-js@3.47.0/node_modules/@rsbuild/core/compiled/style-loader/runtime/injectStylesIntoStyleTag.js");
|
|
3500
|
+
var injectStylesIntoStyleTag_default = /*#__PURE__*/ __webpack_require__.n(injectStylesIntoStyleTag);
|
|
3364
3501
|
var data_grid_module_options = {};
|
|
3365
3502
|
data_grid_module_options.styleTagTransform = styleTagTransform_default();
|
|
3366
3503
|
data_grid_module_options.setAttributes = setAttributesWithoutAttributes_default();
|
|
@@ -3428,6 +3565,7 @@ function placeAnchor(anchor, cellRef, cell) {
|
|
|
3428
3565
|
if (button) fadeUnderButton(cell, button, side);
|
|
3429
3566
|
}
|
|
3430
3567
|
function CellActions({ apiRef, sectionsFor, onAction, labelFor }) {
|
|
3568
|
+
const { t } = useDataGridMessages();
|
|
3431
3569
|
const anchorRef = useRef(null);
|
|
3432
3570
|
const cellRef = useRef(null);
|
|
3433
3571
|
const rowRef = useRef(null);
|
|
@@ -3515,7 +3653,7 @@ function CellActions({ apiRef, sectionsFor, onAction, labelFor }) {
|
|
|
3515
3653
|
"data-cell-actions": "",
|
|
3516
3654
|
ref: anchorRef,
|
|
3517
3655
|
children: /*#__PURE__*/ jsx(Menu, {
|
|
3518
|
-
"aria-label": "
|
|
3656
|
+
"aria-label": t("ox0.dataGrid.cellActions.label"),
|
|
3519
3657
|
isOpen: isOpen,
|
|
3520
3658
|
onOpenChange: handleOpenChange,
|
|
3521
3659
|
trigger: /*#__PURE__*/ jsx(IconButton, {
|
|
@@ -3666,32 +3804,34 @@ function pendingMarks(tokens) {
|
|
|
3666
3804
|
const DATE_WINDOWS = [
|
|
3667
3805
|
{
|
|
3668
3806
|
count: 1,
|
|
3669
|
-
unit: "d"
|
|
3670
|
-
label: "1 day"
|
|
3807
|
+
unit: "d"
|
|
3671
3808
|
},
|
|
3672
3809
|
{
|
|
3673
3810
|
count: 1,
|
|
3674
|
-
unit: "w"
|
|
3675
|
-
label: "1 week"
|
|
3811
|
+
unit: "w"
|
|
3676
3812
|
},
|
|
3677
3813
|
{
|
|
3678
3814
|
count: 1,
|
|
3679
|
-
unit: "m"
|
|
3680
|
-
label: "1 month"
|
|
3815
|
+
unit: "m"
|
|
3681
3816
|
},
|
|
3682
3817
|
{
|
|
3683
3818
|
count: 1,
|
|
3684
|
-
unit: "y"
|
|
3685
|
-
label: "1 year"
|
|
3819
|
+
unit: "y"
|
|
3686
3820
|
}
|
|
3687
3821
|
];
|
|
3688
|
-
|
|
3689
|
-
|
|
3690
|
-
|
|
3822
|
+
const WINDOW_MESSAGE = {
|
|
3823
|
+
d: "ox0.dataGrid.cellActions.days",
|
|
3824
|
+
w: "ox0.dataGrid.cellActions.weeks",
|
|
3825
|
+
m: "ox0.dataGrid.cellActions.months",
|
|
3826
|
+
y: "ox0.dataGrid.cellActions.years"
|
|
3827
|
+
};
|
|
3828
|
+
function actionsFor(type, state, options, t) {
|
|
3829
|
+
const include = t(options.isMac ? "ox0.dataGrid.cellActions.includeHintMac" : "ox0.dataGrid.cellActions.includeHint");
|
|
3830
|
+
const exclude = t(options.isMac ? "ox0.dataGrid.cellActions.excludeHintMac" : "ox0.dataGrid.cellActions.excludeHint");
|
|
3691
3831
|
const actions = [
|
|
3692
3832
|
{
|
|
3693
3833
|
id: "include",
|
|
3694
|
-
label: state.isIncluded ? "
|
|
3834
|
+
label: t(state.isIncluded ? "ox0.dataGrid.cellActions.removeFromFilter" : "ox0.dataGrid.cellActions.filterTo"),
|
|
3695
3835
|
hint: include,
|
|
3696
3836
|
run: {
|
|
3697
3837
|
action: "include"
|
|
@@ -3700,14 +3840,14 @@ function actionsFor(type, state, options) {
|
|
|
3700
3840
|
];
|
|
3701
3841
|
if (state.hasOthers) actions.push({
|
|
3702
3842
|
id: "only",
|
|
3703
|
-
label: "
|
|
3843
|
+
label: t("ox0.dataGrid.cellActions.filterToOnly"),
|
|
3704
3844
|
run: {
|
|
3705
3845
|
action: "only"
|
|
3706
3846
|
}
|
|
3707
3847
|
});
|
|
3708
3848
|
actions.push({
|
|
3709
3849
|
id: "exclude",
|
|
3710
|
-
label: state.isExcluded ? "
|
|
3850
|
+
label: t(state.isExcluded ? "ox0.dataGrid.cellActions.stopExcluding" : "ox0.dataGrid.cellActions.exclude"),
|
|
3711
3851
|
hint: exclude,
|
|
3712
3852
|
run: {
|
|
3713
3853
|
action: "exclude"
|
|
@@ -3715,35 +3855,37 @@ function actionsFor(type, state, options) {
|
|
|
3715
3855
|
});
|
|
3716
3856
|
if ("numeric" === type) actions.push({
|
|
3717
3857
|
id: "at-least",
|
|
3718
|
-
label: "
|
|
3858
|
+
label: t("ox0.dataGrid.cellActions.atLeast"),
|
|
3719
3859
|
run: {
|
|
3720
3860
|
action: "at-least"
|
|
3721
3861
|
}
|
|
3722
3862
|
}, {
|
|
3723
3863
|
id: "at-most",
|
|
3724
|
-
label: "
|
|
3864
|
+
label: t("ox0.dataGrid.cellActions.atMost"),
|
|
3725
3865
|
run: {
|
|
3726
3866
|
action: "at-most"
|
|
3727
3867
|
}
|
|
3728
3868
|
});
|
|
3729
3869
|
if ("date" === type) actions.push({
|
|
3730
3870
|
id: "at-least",
|
|
3731
|
-
label: "
|
|
3871
|
+
label: t("ox0.dataGrid.cellActions.onOrAfter"),
|
|
3732
3872
|
run: {
|
|
3733
3873
|
action: "at-least"
|
|
3734
3874
|
}
|
|
3735
3875
|
}, {
|
|
3736
3876
|
id: "at-most",
|
|
3737
|
-
label: "
|
|
3877
|
+
label: t("ox0.dataGrid.cellActions.onOrBefore"),
|
|
3738
3878
|
run: {
|
|
3739
3879
|
action: "at-most"
|
|
3740
3880
|
}
|
|
3741
3881
|
}, {
|
|
3742
3882
|
id: "within",
|
|
3743
|
-
label: "
|
|
3744
|
-
children: DATE_WINDOWS.map((
|
|
3883
|
+
label: t("ox0.dataGrid.cellActions.within"),
|
|
3884
|
+
children: DATE_WINDOWS.map((window1)=>({
|
|
3745
3885
|
id: `${window1.count}${window1.unit}`,
|
|
3746
|
-
label,
|
|
3886
|
+
label: t(WINDOW_MESSAGE[window1.unit], {
|
|
3887
|
+
count: window1.count
|
|
3888
|
+
}),
|
|
3747
3889
|
run: {
|
|
3748
3890
|
action: "within",
|
|
3749
3891
|
window: window1
|
|
@@ -3752,14 +3894,14 @@ function actionsFor(type, state, options) {
|
|
|
3752
3894
|
});
|
|
3753
3895
|
if (options.hasColumnFilter) actions.push({
|
|
3754
3896
|
id: "clear",
|
|
3755
|
-
label: "
|
|
3897
|
+
label: t("ox0.dataGrid.cellActions.clearColumnFilter"),
|
|
3756
3898
|
run: {
|
|
3757
3899
|
action: "clear"
|
|
3758
3900
|
}
|
|
3759
3901
|
});
|
|
3760
3902
|
if (options.canCopy) actions.push({
|
|
3761
3903
|
id: "copy",
|
|
3762
|
-
label: "
|
|
3904
|
+
label: t("ox0.dataGrid.cellActions.copy"),
|
|
3763
3905
|
run: {
|
|
3764
3906
|
action: "copy"
|
|
3765
3907
|
}
|
|
@@ -3990,7 +4132,7 @@ function groupHeaderSegments(layout) {
|
|
|
3990
4132
|
}
|
|
3991
4133
|
return segments;
|
|
3992
4134
|
}
|
|
3993
|
-
const column_chooser_module_0 = __webpack_require__("../../node_modules/.pnpm/@rsbuild+core@2.
|
|
4135
|
+
const column_chooser_module_0 = __webpack_require__("../../node_modules/.pnpm/@rsbuild+core@2.3.0-beta.0_core-js@3.47.0/node_modules/@rsbuild/core/compiled/css-loader/index.js??ruleSet[1].rules[1].oneOf[4].use[1]!builtin:lightningcss-loader??ruleSet[1].rules[1].oneOf[4].use[2]!./src/components/column-chooser.module.css");
|
|
3994
4136
|
var column_chooser_module_options = {};
|
|
3995
4137
|
column_chooser_module_options.styleTagTransform = styleTagTransform_default();
|
|
3996
4138
|
column_chooser_module_options.setAttributes = setAttributesWithoutAttributes_default();
|
|
@@ -4030,9 +4172,9 @@ function bySection(rows) {
|
|
|
4030
4172
|
};
|
|
4031
4173
|
}
|
|
4032
4174
|
const SECTION_LABEL = {
|
|
4033
|
-
left: "
|
|
4034
|
-
center: "
|
|
4035
|
-
right: "
|
|
4175
|
+
left: "ox0.dataGrid.columnChooser.pinnedLeft",
|
|
4176
|
+
center: "ox0.dataGrid.columnChooser.columns",
|
|
4177
|
+
right: "ox0.dataGrid.columnChooser.pinnedRight"
|
|
4036
4178
|
};
|
|
4037
4179
|
const SECTIONS = [
|
|
4038
4180
|
"left",
|
|
@@ -4041,6 +4183,7 @@ const SECTIONS = [
|
|
|
4041
4183
|
];
|
|
4042
4184
|
const SLIDE_MS = 150;
|
|
4043
4185
|
function ColumnChooser({ columnDefs, store }) {
|
|
4186
|
+
const { t } = useDataGridMessages();
|
|
4044
4187
|
const columnStates = useStore(store, (state)=>state.columns);
|
|
4045
4188
|
const [query, setQuery] = useState("");
|
|
4046
4189
|
const [drag, setDrag] = useState(null);
|
|
@@ -4112,6 +4255,10 @@ function ColumnChooser({ columnDefs, store }) {
|
|
|
4112
4255
|
startY: rect.top - chooserTop()
|
|
4113
4256
|
});
|
|
4114
4257
|
}
|
|
4258
|
+
function middleOf(row) {
|
|
4259
|
+
const element = rowElementsRef.current.get(row.id);
|
|
4260
|
+
return element ? element.offsetTop + element.offsetHeight / 2 : 1 / 0;
|
|
4261
|
+
}
|
|
4115
4262
|
function handleDragMove(event) {
|
|
4116
4263
|
if (!drag) return;
|
|
4117
4264
|
const ghost = ghostRef.current;
|
|
@@ -4125,10 +4272,6 @@ function ColumnChooser({ columnDefs, store }) {
|
|
|
4125
4272
|
const dragged = rows.find((row)=>row.id === drag.id);
|
|
4126
4273
|
if (!dragged || "center" !== section && !dragged.pinnable) return;
|
|
4127
4274
|
const others = bySection(rows.filter((row)=>row.id !== drag.id));
|
|
4128
|
-
const middleOf = (row)=>{
|
|
4129
|
-
const element = rowElementsRef.current.get(row.id);
|
|
4130
|
-
return element ? element.offsetTop + element.offsetHeight / 2 : 1 / 0;
|
|
4131
|
-
};
|
|
4132
4275
|
const before = others[section].findIndex((row)=>middleOf(row) > y);
|
|
4133
4276
|
const insertAt = -1 === before ? others[section].length : before;
|
|
4134
4277
|
others[section] = [
|
|
@@ -4185,7 +4328,7 @@ function ColumnChooser({ columnDefs, store }) {
|
|
|
4185
4328
|
ref: chooserRef,
|
|
4186
4329
|
children: [
|
|
4187
4330
|
/*#__PURE__*/ jsx(SearchField, {
|
|
4188
|
-
ariaLabel: "
|
|
4331
|
+
ariaLabel: t("ox0.dataGrid.columnChooser.find"),
|
|
4189
4332
|
onChange: setQuery,
|
|
4190
4333
|
value: query
|
|
4191
4334
|
}),
|
|
@@ -4201,11 +4344,11 @@ function ColumnChooser({ columnDefs, store }) {
|
|
|
4201
4344
|
children: [
|
|
4202
4345
|
/*#__PURE__*/ jsx("div", {
|
|
4203
4346
|
className: column_chooser_module.sectionLabel,
|
|
4204
|
-
children: SECTION_LABEL[section]
|
|
4347
|
+
children: t(SECTION_LABEL[section])
|
|
4205
4348
|
}),
|
|
4206
4349
|
0 === visibleRows.length && /*#__PURE__*/ jsx("div", {
|
|
4207
4350
|
className: column_chooser_module.emptySection,
|
|
4208
|
-
children: isFiltering ? "
|
|
4351
|
+
children: isFiltering ? t("ox0.dataGrid.columnChooser.noMatches") : t("ox0.dataGrid.columnChooser.dropToPin")
|
|
4209
4352
|
}),
|
|
4210
4353
|
visibleRows.map((row)=>/*#__PURE__*/ jsxs("div", {
|
|
4211
4354
|
className: column_chooser_module.row,
|
|
@@ -4214,7 +4357,9 @@ function ColumnChooser({ columnDefs, store }) {
|
|
|
4214
4357
|
ref: registerRow(row.id),
|
|
4215
4358
|
children: [
|
|
4216
4359
|
/*#__PURE__*/ jsx("button", {
|
|
4217
|
-
"aria-label":
|
|
4360
|
+
"aria-label": t("ox0.dataGrid.columnChooser.reorder", {
|
|
4361
|
+
column: row.header
|
|
4362
|
+
}),
|
|
4218
4363
|
className: column_chooser_module.grip,
|
|
4219
4364
|
disabled: isFiltering || !row.reorderable,
|
|
4220
4365
|
onPointerDown: (event)=>handleGripPointerDown(row, event),
|
|
@@ -4252,7 +4397,7 @@ function ColumnChooser({ columnDefs, store }) {
|
|
|
4252
4397
|
onPress: ()=>store.getState().resetColumns(),
|
|
4253
4398
|
size: "sm",
|
|
4254
4399
|
variant: "ghost",
|
|
4255
|
-
children: "
|
|
4400
|
+
children: t("ox0.dataGrid.columnChooser.reset")
|
|
4256
4401
|
})
|
|
4257
4402
|
]
|
|
4258
4403
|
});
|
|
@@ -4305,6 +4450,7 @@ function GripIcon() {
|
|
|
4305
4450
|
}
|
|
4306
4451
|
const KEYBOARD_STEP = 10;
|
|
4307
4452
|
function ColumnResizeHandle({ header, width, minWidth, maxWidth, edge, viewportRef, guideRef, onResize, onAutoFit }) {
|
|
4453
|
+
const { t } = useDataGridMessages();
|
|
4308
4454
|
const dragRef = useRef(null);
|
|
4309
4455
|
const nextWidthRef = useRef(width);
|
|
4310
4456
|
const clamp = (value)=>Math.round(Math.min(Math.max(value, minWidth), maxWidth ?? 1 / 0));
|
|
@@ -4359,7 +4505,9 @@ function ColumnResizeHandle({ header, width, minWidth, maxWidth, edge, viewportR
|
|
|
4359
4505
|
if (next !== width) onResize(next);
|
|
4360
4506
|
}
|
|
4361
4507
|
return /*#__PURE__*/ jsx("div", {
|
|
4362
|
-
"aria-label":
|
|
4508
|
+
"aria-label": t("ox0.dataGrid.resizeColumn", {
|
|
4509
|
+
column: header
|
|
4510
|
+
}),
|
|
4363
4511
|
"aria-orientation": "vertical",
|
|
4364
4512
|
"aria-valuemax": maxWidth,
|
|
4365
4513
|
"aria-valuemin": minWidth,
|
|
@@ -4484,22 +4632,25 @@ const FORMAT_LABELS = {
|
|
|
4484
4632
|
excel: "Excel"
|
|
4485
4633
|
};
|
|
4486
4634
|
function ExportButton({ formats, isBusy, onExport }) {
|
|
4635
|
+
const { t } = useDataGridMessages();
|
|
4487
4636
|
const icon = isBusy ? Spinner : DownloadIcon;
|
|
4488
4637
|
const [only] = formats;
|
|
4489
4638
|
if (1 === formats.length && only) return /*#__PURE__*/ jsx(IconButton, {
|
|
4490
4639
|
icon: icon,
|
|
4491
4640
|
isDisabled: isBusy,
|
|
4492
|
-
label:
|
|
4641
|
+
label: t("ox0.dataGrid.export.as", {
|
|
4642
|
+
format: FORMAT_LABELS[only]
|
|
4643
|
+
}),
|
|
4493
4644
|
onPress: ()=>onExport(only),
|
|
4494
4645
|
size: "xs",
|
|
4495
4646
|
variant: "ghost"
|
|
4496
4647
|
});
|
|
4497
4648
|
return /*#__PURE__*/ jsx(Menu, {
|
|
4498
|
-
"aria-label": "
|
|
4649
|
+
"aria-label": t("ox0.dataGrid.export.menu"),
|
|
4499
4650
|
trigger: /*#__PURE__*/ jsx(IconButton, {
|
|
4500
4651
|
icon: icon,
|
|
4501
4652
|
isDisabled: isBusy,
|
|
4502
|
-
label: "
|
|
4653
|
+
label: t("ox0.dataGrid.export.label"),
|
|
4503
4654
|
size: "xs",
|
|
4504
4655
|
variant: "ghost"
|
|
4505
4656
|
}),
|
|
@@ -4524,10 +4675,6 @@ function DownloadIcon({ size = 14 }) {
|
|
|
4524
4675
|
})
|
|
4525
4676
|
});
|
|
4526
4677
|
}
|
|
4527
|
-
const numberFormat = new Intl.NumberFormat();
|
|
4528
|
-
function formatCount(value) {
|
|
4529
|
-
return numberFormat.format(value);
|
|
4530
|
-
}
|
|
4531
4678
|
const statFormat = new Intl.NumberFormat(void 0, {
|
|
4532
4679
|
maximumFractionDigits: 2
|
|
4533
4680
|
});
|
|
@@ -4576,18 +4723,26 @@ function pageNumbers(current, pageCount) {
|
|
|
4576
4723
|
return withGaps;
|
|
4577
4724
|
}
|
|
4578
4725
|
function Pager({ pageIndex, pageSize, rowCount, totalCount, hasNext, hasPrevious, canJump, isBusy, onPage }) {
|
|
4726
|
+
const { t } = useDataGridMessages();
|
|
4579
4727
|
const first = pageIndex * pageSize + 1;
|
|
4580
4728
|
const last = pageIndex * pageSize + rowCount;
|
|
4581
|
-
const range = 0 === rowCount ? "
|
|
4729
|
+
const range = 0 === rowCount ? t("ox0.dataGrid.pager.noRows") : totalCount >= 0 ? t("ox0.dataGrid.pager.rangeOf", {
|
|
4730
|
+
first,
|
|
4731
|
+
last,
|
|
4732
|
+
total: totalCount
|
|
4733
|
+
}) : t("ox0.dataGrid.pager.range", {
|
|
4734
|
+
first,
|
|
4735
|
+
last
|
|
4736
|
+
});
|
|
4582
4737
|
const pageCount = totalCount >= 0 ? Math.max(1, Math.ceil(totalCount / pageSize)) : 0;
|
|
4583
4738
|
return /*#__PURE__*/ jsxs("nav", {
|
|
4584
|
-
"aria-label": "
|
|
4739
|
+
"aria-label": t("ox0.dataGrid.pager.label"),
|
|
4585
4740
|
className: data_grid_module.pager,
|
|
4586
4741
|
children: [
|
|
4587
4742
|
/*#__PURE__*/ jsx(IconButton, {
|
|
4588
4743
|
icon: ChevronLeft,
|
|
4589
4744
|
isDisabled: !hasPrevious || isBusy,
|
|
4590
|
-
label: "
|
|
4745
|
+
label: t("ox0.dataGrid.pager.previous"),
|
|
4591
4746
|
onPress: ()=>onPage(pageIndex - 1),
|
|
4592
4747
|
size: "xs",
|
|
4593
4748
|
variant: "ghost"
|
|
@@ -4612,7 +4767,7 @@ function Pager({ pageIndex, pageSize, rowCount, totalCount, hasNext, hasPrevious
|
|
|
4612
4767
|
/*#__PURE__*/ jsx(IconButton, {
|
|
4613
4768
|
icon: ChevronRight,
|
|
4614
4769
|
isDisabled: !hasNext || isBusy,
|
|
4615
|
-
label: "
|
|
4770
|
+
label: t("ox0.dataGrid.pager.next"),
|
|
4616
4771
|
onPress: ()=>onPage(pageIndex + 1),
|
|
4617
4772
|
size: "xs",
|
|
4618
4773
|
variant: "ghost"
|
|
@@ -4648,7 +4803,7 @@ function ChevronRight() {
|
|
|
4648
4803
|
})
|
|
4649
4804
|
});
|
|
4650
4805
|
}
|
|
4651
|
-
const views_menu_module_0 = __webpack_require__("../../node_modules/.pnpm/@rsbuild+core@2.
|
|
4806
|
+
const views_menu_module_0 = __webpack_require__("../../node_modules/.pnpm/@rsbuild+core@2.3.0-beta.0_core-js@3.47.0/node_modules/@rsbuild/core/compiled/css-loader/index.js??ruleSet[1].rules[1].oneOf[4].use[1]!builtin:lightningcss-loader??ruleSet[1].rules[1].oneOf[4].use[2]!./src/components/views-menu.module.css");
|
|
4652
4807
|
var views_menu_module_options = {};
|
|
4653
4808
|
views_menu_module_options.styleTagTransform = styleTagTransform_default();
|
|
4654
4809
|
views_menu_module_options.setAttributes = setAttributesWithoutAttributes_default();
|
|
@@ -4660,7 +4815,14 @@ const views_menu_module = views_menu_module_0.A && views_menu_module_0.A.locals
|
|
|
4660
4815
|
const LIST = {
|
|
4661
4816
|
kind: "list"
|
|
4662
4817
|
};
|
|
4818
|
+
const ERROR_MESSAGE = {
|
|
4819
|
+
load: "ox0.dataGrid.views.loadFailed",
|
|
4820
|
+
save: "ox0.dataGrid.views.saveFailed",
|
|
4821
|
+
rename: "ox0.dataGrid.views.renameFailed",
|
|
4822
|
+
delete: "ox0.dataGrid.views.deleteFailed"
|
|
4823
|
+
};
|
|
4663
4824
|
function ViewsMenu({ views, api, canIncludeFilters, canDelete }) {
|
|
4825
|
+
const { t } = useDataGridMessages();
|
|
4664
4826
|
const [isOpen, setIsOpen] = useState(false);
|
|
4665
4827
|
const [mode, setMode] = useState(LIST);
|
|
4666
4828
|
const [name, setName] = useState("");
|
|
@@ -4702,13 +4864,13 @@ function ViewsMenu({ views, api, canIncludeFilters, canDelete }) {
|
|
|
4702
4864
|
/*#__PURE__*/ jsx(TextField, {
|
|
4703
4865
|
autoFocus: true,
|
|
4704
4866
|
isDisabled: isSaving,
|
|
4705
|
-
label: "
|
|
4867
|
+
label: t("ox0.dataGrid.views.name"),
|
|
4706
4868
|
onChange: setName,
|
|
4707
4869
|
value: name
|
|
4708
4870
|
}),
|
|
4709
4871
|
"save-as" === mode.kind && canIncludeFilters && /*#__PURE__*/ jsx(Checkbox, {
|
|
4710
4872
|
isSelected: includeFilters,
|
|
4711
|
-
label: "
|
|
4873
|
+
label: t("ox0.dataGrid.views.includeFilters"),
|
|
4712
4874
|
onChange: setIncludeFilters
|
|
4713
4875
|
}),
|
|
4714
4876
|
/*#__PURE__*/ jsxs("div", {
|
|
@@ -4719,7 +4881,7 @@ function ViewsMenu({ views, api, canIncludeFilters, canDelete }) {
|
|
|
4719
4881
|
onPress: ()=>setMode(LIST),
|
|
4720
4882
|
size: "sm",
|
|
4721
4883
|
variant: "ghost",
|
|
4722
|
-
children: "
|
|
4884
|
+
children: t("ox0.dataGrid.views.cancel")
|
|
4723
4885
|
}),
|
|
4724
4886
|
/*#__PURE__*/ jsx(Button, {
|
|
4725
4887
|
isDisabled: isSaving || "" === name.trim(),
|
|
@@ -4746,36 +4908,34 @@ function ViewsMenu({ views, api, canIncludeFilters, canDelete }) {
|
|
|
4746
4908
|
size: "sm",
|
|
4747
4909
|
variant: "ghost",
|
|
4748
4910
|
children: [
|
|
4749
|
-
api.activeName ?? "
|
|
4911
|
+
api.activeName ?? t("ox0.dataGrid.views.label"),
|
|
4750
4912
|
api.isModified && /*#__PURE__*/ jsx("span", {
|
|
4751
4913
|
className: views_menu_module.modified,
|
|
4752
|
-
children: "
|
|
4914
|
+
children: t("ox0.dataGrid.views.modified")
|
|
4753
4915
|
})
|
|
4754
4916
|
]
|
|
4755
4917
|
})
|
|
4756
4918
|
}),
|
|
4757
4919
|
/*#__PURE__*/ jsx(PopoverContent, {
|
|
4758
4920
|
className: views_menu_module.panel,
|
|
4759
|
-
children: "save-as" === mode.kind ? nameForm("
|
|
4921
|
+
children: "save-as" === mode.kind ? nameForm(t("ox0.dataGrid.views.saveView")) : /*#__PURE__*/ jsxs("div", {
|
|
4760
4922
|
className: views_menu_module.menu,
|
|
4761
4923
|
children: [
|
|
4762
4924
|
0 === views.length ? /*#__PURE__*/ jsx("p", {
|
|
4763
4925
|
className: views_menu_module.empty,
|
|
4764
|
-
children: "
|
|
4926
|
+
children: t("ox0.dataGrid.views.none")
|
|
4765
4927
|
}) : /*#__PURE__*/ jsx("ul", {
|
|
4766
|
-
"aria-label": "
|
|
4928
|
+
"aria-label": t("ox0.dataGrid.views.list"),
|
|
4767
4929
|
className: views_menu_module.list,
|
|
4768
4930
|
children: views.map((view)=>/*#__PURE__*/ jsx("li", {
|
|
4769
4931
|
className: views_menu_module.item,
|
|
4770
|
-
children: "rename" === mode.kind && mode.viewId === view.id ? nameForm("
|
|
4932
|
+
children: "rename" === mode.kind && mode.viewId === view.id ? nameForm(t("ox0.dataGrid.views.rename")) : "delete" === mode.kind && mode.viewId === view.id ? /*#__PURE__*/ jsxs("div", {
|
|
4771
4933
|
className: views_menu_module.confirm,
|
|
4772
4934
|
children: [
|
|
4773
|
-
/*#__PURE__*/
|
|
4774
|
-
children:
|
|
4775
|
-
|
|
4776
|
-
|
|
4777
|
-
"”?"
|
|
4778
|
-
]
|
|
4935
|
+
/*#__PURE__*/ jsx("span", {
|
|
4936
|
+
children: t("ox0.dataGrid.views.deleteConfirm", {
|
|
4937
|
+
name: view.name
|
|
4938
|
+
})
|
|
4779
4939
|
}),
|
|
4780
4940
|
/*#__PURE__*/ jsxs("div", {
|
|
4781
4941
|
className: views_menu_module.actions,
|
|
@@ -4785,14 +4945,14 @@ function ViewsMenu({ views, api, canIncludeFilters, canDelete }) {
|
|
|
4785
4945
|
onPress: ()=>setMode(LIST),
|
|
4786
4946
|
size: "sm",
|
|
4787
4947
|
variant: "ghost",
|
|
4788
|
-
children: "
|
|
4948
|
+
children: t("ox0.dataGrid.views.cancel")
|
|
4789
4949
|
}),
|
|
4790
4950
|
/*#__PURE__*/ jsx(Button, {
|
|
4791
4951
|
isDisabled: isSaving,
|
|
4792
4952
|
onPress: ()=>void run(()=>api.remove(view.id), false),
|
|
4793
4953
|
size: "sm",
|
|
4794
4954
|
variant: "danger",
|
|
4795
|
-
children: "
|
|
4955
|
+
children: t("ox0.dataGrid.views.delete")
|
|
4796
4956
|
})
|
|
4797
4957
|
]
|
|
4798
4958
|
})
|
|
@@ -4811,7 +4971,9 @@ function ViewsMenu({ views, api, canIncludeFilters, canDelete }) {
|
|
|
4811
4971
|
/*#__PURE__*/ jsx(IconButton, {
|
|
4812
4972
|
icon: PencilIcon,
|
|
4813
4973
|
isDisabled: isBusy,
|
|
4814
|
-
label:
|
|
4974
|
+
label: t("ox0.dataGrid.views.renameView", {
|
|
4975
|
+
name: view.name
|
|
4976
|
+
}),
|
|
4815
4977
|
onPress: ()=>startNaming({
|
|
4816
4978
|
kind: "rename",
|
|
4817
4979
|
viewId: view.id
|
|
@@ -4822,7 +4984,9 @@ function ViewsMenu({ views, api, canIncludeFilters, canDelete }) {
|
|
|
4822
4984
|
canDelete && /*#__PURE__*/ jsx(IconButton, {
|
|
4823
4985
|
icon: TrashIcon,
|
|
4824
4986
|
isDisabled: isBusy,
|
|
4825
|
-
label:
|
|
4987
|
+
label: t("ox0.dataGrid.views.deleteView", {
|
|
4988
|
+
name: view.name
|
|
4989
|
+
}),
|
|
4826
4990
|
onPress: ()=>setMode({
|
|
4827
4991
|
kind: "delete",
|
|
4828
4992
|
viewId: view.id
|
|
@@ -4840,14 +5004,16 @@ function ViewsMenu({ views, api, canIncludeFilters, canDelete }) {
|
|
|
4840
5004
|
api.isModified && void 0 !== api.activeName && /*#__PURE__*/ jsx(MenuButton, {
|
|
4841
5005
|
isDisabled: isBusy,
|
|
4842
5006
|
onPress: ()=>void run(api.save, true),
|
|
4843
|
-
children:
|
|
5007
|
+
children: t("ox0.dataGrid.views.save", {
|
|
5008
|
+
name: api.activeName
|
|
5009
|
+
})
|
|
4844
5010
|
}),
|
|
4845
5011
|
/*#__PURE__*/ jsx(MenuButton, {
|
|
4846
5012
|
isDisabled: isBusy,
|
|
4847
5013
|
onPress: ()=>startNaming({
|
|
4848
5014
|
kind: "save-as"
|
|
4849
5015
|
}, ""),
|
|
4850
|
-
children: "
|
|
5016
|
+
children: t("ox0.dataGrid.views.saveAs")
|
|
4851
5017
|
}),
|
|
4852
5018
|
/*#__PURE__*/ jsx(MenuButton, {
|
|
4853
5019
|
isDisabled: isSaving,
|
|
@@ -4855,7 +5021,7 @@ function ViewsMenu({ views, api, canIncludeFilters, canDelete }) {
|
|
|
4855
5021
|
api.resetToDefault();
|
|
4856
5022
|
openChange(false);
|
|
4857
5023
|
},
|
|
4858
|
-
children: "
|
|
5024
|
+
children: t("ox0.dataGrid.views.reset")
|
|
4859
5025
|
})
|
|
4860
5026
|
]
|
|
4861
5027
|
})
|
|
@@ -4867,7 +5033,7 @@ function ViewsMenu({ views, api, canIncludeFilters, canDelete }) {
|
|
|
4867
5033
|
api.error && /*#__PURE__*/ jsx("span", {
|
|
4868
5034
|
className: views_menu_module.error,
|
|
4869
5035
|
role: "alert",
|
|
4870
|
-
children: api.error
|
|
5036
|
+
children: t(ERROR_MESSAGE[api.error])
|
|
4871
5037
|
})
|
|
4872
5038
|
]
|
|
4873
5039
|
});
|
|
@@ -5129,9 +5295,6 @@ function aboveGroupLabel(style) {
|
|
|
5129
5295
|
zIndex: 3
|
|
5130
5296
|
} : style;
|
|
5131
5297
|
}
|
|
5132
|
-
function rowsWord(count) {
|
|
5133
|
-
return 1 === count ? "row" : "rows";
|
|
5134
|
-
}
|
|
5135
5298
|
function entryKey(entry) {
|
|
5136
5299
|
return "row" === entry.kind ? entry.data.__rowId : `group:${entry.groupKey}`;
|
|
5137
5300
|
}
|
|
@@ -5152,9 +5315,15 @@ function renderAggregateValue(column, values, fractionDigits = 0) {
|
|
|
5152
5315
|
children: alignDecimal(text, fractionDigits, statDecimalSeparator)
|
|
5153
5316
|
});
|
|
5154
5317
|
}
|
|
5155
|
-
function
|
|
5156
|
-
|
|
5157
|
-
|
|
5318
|
+
function visuallyHidden(chunks) {
|
|
5319
|
+
return /*#__PURE__*/ jsx("span", {
|
|
5320
|
+
className: data_grid_module.visuallyHidden,
|
|
5321
|
+
children: chunks
|
|
5322
|
+
});
|
|
5323
|
+
}
|
|
5324
|
+
function groupValueLabel(value, t, number) {
|
|
5325
|
+
if (null == value) return t("ox0.dataGrid.group.empty");
|
|
5326
|
+
if ("number" == typeof value) return number(value);
|
|
5158
5327
|
return String(value);
|
|
5159
5328
|
}
|
|
5160
5329
|
function fontOf(style) {
|
|
@@ -5235,6 +5404,20 @@ function ChevronRightIcon() {
|
|
|
5235
5404
|
})
|
|
5236
5405
|
});
|
|
5237
5406
|
}
|
|
5407
|
+
function ChevronDownIcon() {
|
|
5408
|
+
return /*#__PURE__*/ jsx("svg", {
|
|
5409
|
+
"aria-hidden": "true",
|
|
5410
|
+
fill: "none",
|
|
5411
|
+
height: "12",
|
|
5412
|
+
stroke: "currentColor",
|
|
5413
|
+
strokeWidth: "1.5",
|
|
5414
|
+
viewBox: "0 0 16 16",
|
|
5415
|
+
width: "12",
|
|
5416
|
+
children: /*#__PURE__*/ jsx("path", {
|
|
5417
|
+
d: "M4 6l4 4 4-4"
|
|
5418
|
+
})
|
|
5419
|
+
});
|
|
5420
|
+
}
|
|
5238
5421
|
function ArrowRightIcon() {
|
|
5239
5422
|
return /*#__PURE__*/ jsx("svg", {
|
|
5240
5423
|
"aria-hidden": "true",
|
|
@@ -5270,8 +5453,8 @@ function rawCellValue(column, row) {
|
|
|
5270
5453
|
if (isKeyColumnDef(column)) return Reflect.get(row, column.accessorKey);
|
|
5271
5454
|
if (DataCell_isDerivedColumnDef(column)) return Reflect.get(row, `__derived_${column.id}`);
|
|
5272
5455
|
}
|
|
5273
|
-
function valueLabel(value) {
|
|
5274
|
-
return null === value ? "
|
|
5456
|
+
function valueLabel(value, t) {
|
|
5457
|
+
return null === value ? t("ox0.dataGrid.cellActions.emptyValue") : String(value);
|
|
5275
5458
|
}
|
|
5276
5459
|
const INTERACTIVE = 'button, a, input, select, textarea, label, [role="checkbox"], [data-row-control]';
|
|
5277
5460
|
function MoreIcon() {
|
|
@@ -5302,6 +5485,7 @@ function MoreIcon() {
|
|
|
5302
5485
|
}
|
|
5303
5486
|
function DataGrid(props) {
|
|
5304
5487
|
const { columnDefs, getRowId, timeZone, height, filter, select, rowDetail } = props;
|
|
5488
|
+
const { t, rich, number } = useDataGridMessages();
|
|
5305
5489
|
const isServer = "server" === props.source;
|
|
5306
5490
|
const rows = "client" === props.source ? props.rows : NO_ROWS;
|
|
5307
5491
|
const rowsVersion = "client" === props.source ? props.rowsVersion : void 0;
|
|
@@ -5916,52 +6100,28 @@ function DataGrid(props) {
|
|
|
5916
6100
|
if (isLoading) return null;
|
|
5917
6101
|
if (isServer) {
|
|
5918
6102
|
const serverTotal = serverStatus?.totalCount ?? -1;
|
|
5919
|
-
if (serverTotal >= 0) return
|
|
5920
|
-
|
|
5921
|
-
/*#__PURE__*/ jsx("strong", {
|
|
5922
|
-
children: formatCount(serverTotal)
|
|
5923
|
-
}),
|
|
5924
|
-
" ",
|
|
5925
|
-
rowsWord(serverTotal)
|
|
5926
|
-
]
|
|
6103
|
+
if (serverTotal >= 0) return rich("ox0.dataGrid.status.rows", {
|
|
6104
|
+
count: serverTotal
|
|
5927
6105
|
});
|
|
5928
|
-
return
|
|
5929
|
-
|
|
5930
|
-
/*#__PURE__*/ jsx("strong", {
|
|
5931
|
-
children: formatCount(rowCount)
|
|
5932
|
-
}),
|
|
5933
|
-
" ",
|
|
5934
|
-
rowsWord(rowCount),
|
|
5935
|
-
serverStatus?.hasMore ? " loaded" : ""
|
|
5936
|
-
]
|
|
6106
|
+
return rich(serverStatus?.hasMore ? "ox0.dataGrid.status.rowsLoaded" : "ox0.dataGrid.status.rows", {
|
|
6107
|
+
count: rowCount
|
|
5937
6108
|
});
|
|
5938
6109
|
}
|
|
5939
|
-
if (isFiltered) return
|
|
5940
|
-
|
|
5941
|
-
|
|
5942
|
-
children: formatCount(rowCount)
|
|
5943
|
-
}),
|
|
5944
|
-
" of ",
|
|
5945
|
-
formatCount(rows.length),
|
|
5946
|
-
" ",
|
|
5947
|
-
rowsWord(rows.length)
|
|
5948
|
-
]
|
|
6110
|
+
if (isFiltered) return rich("ox0.dataGrid.status.filteredRows", {
|
|
6111
|
+
count: rowCount,
|
|
6112
|
+
total: rows.length
|
|
5949
6113
|
});
|
|
5950
|
-
return
|
|
5951
|
-
|
|
5952
|
-
/*#__PURE__*/ jsx("strong", {
|
|
5953
|
-
children: formatCount(rowCount)
|
|
5954
|
-
}),
|
|
5955
|
-
" ",
|
|
5956
|
-
rowsWord(rowCount)
|
|
5957
|
-
]
|
|
6114
|
+
return rich("ox0.dataGrid.status.rows", {
|
|
6115
|
+
count: rowCount
|
|
5958
6116
|
});
|
|
5959
6117
|
})();
|
|
5960
6118
|
function renderLoadStatus() {
|
|
5961
6119
|
if (serverStatus?.phase === "error") return null;
|
|
5962
6120
|
const progress = isServer ? void 0 === serverStatus || "initial" === serverStatus.phase || "append" === serverStatus.phase ? void 0 : 1 : true === props.isLoading ? void 0 : grid.loadProgress;
|
|
5963
6121
|
const isDone = 1 === progress;
|
|
5964
|
-
const label = isDone ? "
|
|
6122
|
+
const label = isDone ? t("ox0.dataGrid.status.loaded") : void 0 === progress ? t("ox0.dataGrid.status.loading") : t("ox0.dataGrid.status.loadingProgress", {
|
|
6123
|
+
progress
|
|
6124
|
+
});
|
|
5965
6125
|
return /*#__PURE__*/ jsx("span", {
|
|
5966
6126
|
className: data_grid_module.loadStatus,
|
|
5967
6127
|
"data-done": isDone || void 0,
|
|
@@ -6026,27 +6186,29 @@ function DataGrid(props) {
|
|
|
6026
6186
|
} catch (error) {
|
|
6027
6187
|
if (!controller.signal.aborted) {
|
|
6028
6188
|
if (toast) toast.addToast({
|
|
6029
|
-
message: "
|
|
6189
|
+
message: t("ox0.dataGrid.export.failed"),
|
|
6030
6190
|
tone: "danger"
|
|
6031
6191
|
});
|
|
6032
|
-
else setExportError("
|
|
6192
|
+
else setExportError(t("ox0.dataGrid.export.failed"));
|
|
6033
6193
|
if ("production" !== process.env.NODE_ENV) console.error("[@ox0/data-grid] export failed", error);
|
|
6034
6194
|
}
|
|
6035
6195
|
} finally{
|
|
6036
6196
|
release();
|
|
6037
6197
|
}
|
|
6038
6198
|
}
|
|
6039
|
-
const selectionAnnouncement = multiSelect ? hasSelection ? isAllSelected ? "
|
|
6199
|
+
const selectionAnnouncement = multiSelect ? hasSelection ? isAllSelected ? t("ox0.dataGrid.selection.all") : null === selectedCount ? t("ox0.dataGrid.selection.allMatching") : t("ox0.dataGrid.selection.count", {
|
|
6200
|
+
count: selectedCount
|
|
6201
|
+
}) : t("ox0.dataGrid.selection.none") : "";
|
|
6040
6202
|
const announced = useDebouncedValue(selectionAnnouncement, SELECTION_ANNOUNCE_MS);
|
|
6041
6203
|
function renderSelectAllCell(style, colIndex) {
|
|
6042
6204
|
return /*#__PURE__*/ jsx("div", {
|
|
6043
6205
|
"aria-colindex": colIndex,
|
|
6044
|
-
"aria-label": "
|
|
6206
|
+
"aria-label": t("ox0.dataGrid.select.column"),
|
|
6045
6207
|
className: data_grid_module.selectCell,
|
|
6046
6208
|
role: "columnheader",
|
|
6047
6209
|
style: style,
|
|
6048
6210
|
children: /*#__PURE__*/ jsx(Checkbox, {
|
|
6049
|
-
"aria-label": hasSelection ? "
|
|
6211
|
+
"aria-label": t(hasSelection ? "ox0.dataGrid.selection.clear" : "ox0.dataGrid.select.all"),
|
|
6050
6212
|
isDisabled: isSelectingAll || 0 === totalCount,
|
|
6051
6213
|
isIndeterminate: hasSelection && !isAllSelected,
|
|
6052
6214
|
isSelected: isAllSelected,
|
|
@@ -6062,7 +6224,9 @@ function DataGrid(props) {
|
|
|
6062
6224
|
role: "gridcell",
|
|
6063
6225
|
style: style,
|
|
6064
6226
|
children: /*#__PURE__*/ jsx(Checkbox, {
|
|
6065
|
-
"aria-label":
|
|
6227
|
+
"aria-label": t("ox0.dataGrid.select.group", {
|
|
6228
|
+
group: label
|
|
6229
|
+
}),
|
|
6066
6230
|
isDisabled: void 0 === check || 0 === check.total,
|
|
6067
6231
|
isIndeterminate: void 0 !== check && check.checked > 0 && check.checked < check.total,
|
|
6068
6232
|
isSelected: void 0 !== check && check.total > 0 && check.checked === check.total,
|
|
@@ -6086,7 +6250,9 @@ function DataGrid(props) {
|
|
|
6086
6250
|
role: "gridcell",
|
|
6087
6251
|
style: style,
|
|
6088
6252
|
children: /*#__PURE__*/ jsx(Checkbox, {
|
|
6089
|
-
"aria-label":
|
|
6253
|
+
"aria-label": t("ox0.dataGrid.select.row", {
|
|
6254
|
+
row: label
|
|
6255
|
+
}),
|
|
6090
6256
|
isDisabled: !canSelect(row),
|
|
6091
6257
|
isSelected: isRowChecked(rowId),
|
|
6092
6258
|
onChange: ()=>toggleRow(rowId, index, false)
|
|
@@ -6253,10 +6419,16 @@ function DataGrid(props) {
|
|
|
6253
6419
|
}), {
|
|
6254
6420
|
apply
|
|
6255
6421
|
});
|
|
6256
|
-
const
|
|
6257
|
-
const
|
|
6258
|
-
|
|
6259
|
-
|
|
6422
|
+
const done = "include" === action ? before?.include.has(key) ? "ox0.dataGrid.cellActions.includeRemoved" : "ox0.dataGrid.cellActions.included" : "exclude" === action ? before?.exclude.has(key) ? "ox0.dataGrid.cellActions.excludeRemoved" : "ox0.dataGrid.cellActions.excluded" : "clear" === action ? "ox0.dataGrid.cellActions.cleared" : "ox0.dataGrid.cellActions.setAsFilter";
|
|
6423
|
+
const change = t(done, {
|
|
6424
|
+
column: column.header,
|
|
6425
|
+
value: valueLabel(value, t)
|
|
6426
|
+
});
|
|
6427
|
+
const shortcut = t(isMac ? "ox0.dataGrid.cellActions.applyShortcutMac" : "ox0.dataGrid.cellActions.applyShortcut");
|
|
6428
|
+
setFilterAnnouncement(apply ? change : t("ox0.dataGrid.cellActions.pending", {
|
|
6429
|
+
change,
|
|
6430
|
+
shortcut
|
|
6431
|
+
}));
|
|
6260
6432
|
}
|
|
6261
6433
|
function cellActionSections(cell, row) {
|
|
6262
6434
|
const cells = row ? [
|
|
@@ -6278,14 +6450,14 @@ function DataGrid(props) {
|
|
|
6278
6450
|
const actions = null === value ? [
|
|
6279
6451
|
{
|
|
6280
6452
|
id: "include",
|
|
6281
|
-
label: "
|
|
6453
|
+
label: t("ox0.dataGrid.cellActions.filterToEmpty"),
|
|
6282
6454
|
run: {
|
|
6283
6455
|
action: "include"
|
|
6284
6456
|
}
|
|
6285
6457
|
},
|
|
6286
6458
|
{
|
|
6287
6459
|
id: "exclude",
|
|
6288
|
-
label: "
|
|
6460
|
+
label: t("ox0.dataGrid.cellActions.excludeEmpty"),
|
|
6289
6461
|
run: {
|
|
6290
6462
|
action: "exclude"
|
|
6291
6463
|
}
|
|
@@ -6293,7 +6465,7 @@ function DataGrid(props) {
|
|
|
6293
6465
|
...hasColumnFilter ? [
|
|
6294
6466
|
{
|
|
6295
6467
|
id: "clear",
|
|
6296
|
-
label: "
|
|
6468
|
+
label: t("ox0.dataGrid.cellActions.clearColumnFilter"),
|
|
6297
6469
|
run: {
|
|
6298
6470
|
action: "clear"
|
|
6299
6471
|
}
|
|
@@ -6309,10 +6481,13 @@ function DataGrid(props) {
|
|
|
6309
6481
|
isMac,
|
|
6310
6482
|
hasColumnFilter,
|
|
6311
6483
|
canCopy: "" !== text
|
|
6312
|
-
});
|
|
6484
|
+
}, t);
|
|
6313
6485
|
sections.push({
|
|
6314
6486
|
key: `${target.column.id}:${key}`,
|
|
6315
|
-
label:
|
|
6487
|
+
label: t("ox0.dataGrid.cellActions.section", {
|
|
6488
|
+
column: target.column.header,
|
|
6489
|
+
value: null === value ? t("ox0.dataGrid.cellActions.emptySection") : String(value)
|
|
6490
|
+
}),
|
|
6316
6491
|
columnId: target.column.id,
|
|
6317
6492
|
value,
|
|
6318
6493
|
text,
|
|
@@ -6331,9 +6506,12 @@ function DataGrid(props) {
|
|
|
6331
6506
|
}
|
|
6332
6507
|
function cellActionsLabel(cell) {
|
|
6333
6508
|
const target = cellTarget(cell);
|
|
6334
|
-
if (!target) return "
|
|
6335
|
-
const value = target.isList ? target.values.map(valueLabel).join(", ") : valueLabel(target.values[0] ?? null);
|
|
6336
|
-
return
|
|
6509
|
+
if (!target) return t("ox0.dataGrid.cellActions.label");
|
|
6510
|
+
const value = target.isList ? target.values.map((item)=>valueLabel(item, t)).join(", ") : valueLabel(target.values[0] ?? null, t);
|
|
6511
|
+
return t("ox0.dataGrid.cellActions.labelFor", {
|
|
6512
|
+
column: target.column.header,
|
|
6513
|
+
value
|
|
6514
|
+
});
|
|
6337
6515
|
}
|
|
6338
6516
|
function modifiedCellClick(event) {
|
|
6339
6517
|
if (!cellActionsOn) return null;
|
|
@@ -6533,7 +6711,7 @@ function DataGrid(props) {
|
|
|
6533
6711
|
return;
|
|
6534
6712
|
}
|
|
6535
6713
|
if (isModified && ("f" === event.key || "F" === event.key)) {
|
|
6536
|
-
const input = simpleFilter ? searchInputRef.current : toolbarRef.current?.querySelector('input[
|
|
6714
|
+
const input = simpleFilter ? searchInputRef.current : toolbarRef.current?.querySelector('input[role="combobox"]');
|
|
6537
6715
|
if (!input) return;
|
|
6538
6716
|
event.preventDefault();
|
|
6539
6717
|
input.focus();
|
|
@@ -6667,7 +6845,9 @@ function DataGrid(props) {
|
|
|
6667
6845
|
role: "gridcell",
|
|
6668
6846
|
style: style,
|
|
6669
6847
|
children: /*#__PURE__*/ jsx("button", {
|
|
6670
|
-
"aria-label":
|
|
6848
|
+
"aria-label": t("ox0.dataGrid.moveRow", {
|
|
6849
|
+
row: label
|
|
6850
|
+
}),
|
|
6671
6851
|
className: data_grid_module.grabHandle,
|
|
6672
6852
|
onClick: (event)=>event.stopPropagation(),
|
|
6673
6853
|
onKeyDown: (event)=>{
|
|
@@ -6742,7 +6922,10 @@ function DataGrid(props) {
|
|
|
6742
6922
|
const columnId = groupColumnIds[header.level - 1];
|
|
6743
6923
|
const column = void 0 === columnId ? void 0 : defsById.get(columnId);
|
|
6744
6924
|
const value = void 0 === columnId ? null : header.groupValues[columnId];
|
|
6745
|
-
const label =
|
|
6925
|
+
const label = t("ox0.dataGrid.group.label", {
|
|
6926
|
+
column: column?.header ?? columnId ?? "",
|
|
6927
|
+
value: groupValueLabel(value, t, number)
|
|
6928
|
+
});
|
|
6746
6929
|
const isFocusable = void 0 !== multiSelect || isFocusOnly;
|
|
6747
6930
|
return /*#__PURE__*/ jsx("div", {
|
|
6748
6931
|
"aria-expanded": header.isExpanded,
|
|
@@ -6773,7 +6956,10 @@ function DataGrid(props) {
|
|
|
6773
6956
|
},
|
|
6774
6957
|
children: /*#__PURE__*/ jsxs("button", {
|
|
6775
6958
|
"aria-expanded": header.isExpanded,
|
|
6776
|
-
"aria-label":
|
|
6959
|
+
"aria-label": t("ox0.dataGrid.group.toggle", {
|
|
6960
|
+
group: label,
|
|
6961
|
+
count: header.rowCount
|
|
6962
|
+
}),
|
|
6777
6963
|
className: data_grid_module.groupToggle,
|
|
6778
6964
|
onClick: ()=>toggleGroup(header.groupKey, !header.isExpanded),
|
|
6779
6965
|
tabIndex: isFocusable ? -1 : void 0,
|
|
@@ -6791,7 +6977,7 @@ function DataGrid(props) {
|
|
|
6791
6977
|
}),
|
|
6792
6978
|
/*#__PURE__*/ jsx("span", {
|
|
6793
6979
|
className: data_grid_module.groupCount,
|
|
6794
|
-
children:
|
|
6980
|
+
children: number(header.rowCount)
|
|
6795
6981
|
})
|
|
6796
6982
|
]
|
|
6797
6983
|
})
|
|
@@ -6830,15 +7016,10 @@ function DataGrid(props) {
|
|
|
6830
7016
|
"data-align": values && "end" === columnAlign(col.def) ? "end" : void 0,
|
|
6831
7017
|
role: "rowheader",
|
|
6832
7018
|
style: style,
|
|
6833
|
-
children: values ?
|
|
6834
|
-
|
|
6835
|
-
|
|
6836
|
-
|
|
6837
|
-
children: "Total: "
|
|
6838
|
-
}),
|
|
6839
|
-
renderAggregateValue(col.def, values, digitsFor(col.def.id))
|
|
6840
|
-
]
|
|
6841
|
-
}) : "Total"
|
|
7019
|
+
children: values ? rich("ox0.dataGrid.totalValue", {
|
|
7020
|
+
hidden: visuallyHidden,
|
|
7021
|
+
value: renderAggregateValue(col.def, values, digitsFor(col.def.id))
|
|
7022
|
+
}) : t("ox0.dataGrid.total")
|
|
6842
7023
|
}, col.def.id);
|
|
6843
7024
|
return /*#__PURE__*/ jsx("div", {
|
|
6844
7025
|
"aria-colindex": colIndex + 1,
|
|
@@ -6946,7 +7127,7 @@ function DataGrid(props) {
|
|
|
6946
7127
|
onPendingChange: cellActionsOn ? setPendingTokens : void 0,
|
|
6947
7128
|
flex: 1,
|
|
6948
7129
|
minWidth: 200,
|
|
6949
|
-
label: "
|
|
7130
|
+
label: t("ox0.dataGrid.filter"),
|
|
6950
7131
|
now: structuredFilter.now,
|
|
6951
7132
|
onChange: setStructuredTokens,
|
|
6952
7133
|
schema: querySchema,
|
|
@@ -6954,10 +7135,10 @@ function DataGrid(props) {
|
|
|
6954
7135
|
value: structuredTokens
|
|
6955
7136
|
}),
|
|
6956
7137
|
simpleFilter && /*#__PURE__*/ jsx("input", {
|
|
6957
|
-
"aria-label": "
|
|
7138
|
+
"aria-label": t("ox0.dataGrid.search"),
|
|
6958
7139
|
className: data_grid_module.searchInput,
|
|
6959
7140
|
onChange: (event)=>handleQueryInput(event.target.value),
|
|
6960
|
-
placeholder: "
|
|
7141
|
+
placeholder: t("ox0.dataGrid.searchPlaceholder"),
|
|
6961
7142
|
ref: searchInputRef,
|
|
6962
7143
|
type: "search",
|
|
6963
7144
|
value: inputValue
|
|
@@ -6974,7 +7155,7 @@ function DataGrid(props) {
|
|
|
6974
7155
|
/*#__PURE__*/ jsx(PopoverTrigger, {
|
|
6975
7156
|
children: /*#__PURE__*/ jsx(IconButton, {
|
|
6976
7157
|
icon: MoreIcon,
|
|
6977
|
-
label: "
|
|
7158
|
+
label: t("ox0.dataGrid.columns"),
|
|
6978
7159
|
size: "sm",
|
|
6979
7160
|
variant: "ghost"
|
|
6980
7161
|
})
|
|
@@ -7023,19 +7204,14 @@ function DataGrid(props) {
|
|
|
7023
7204
|
}),
|
|
7024
7205
|
multiSelect && /*#__PURE__*/ jsxs("section", {
|
|
7025
7206
|
"aria-hidden": !isSelecting || void 0,
|
|
7026
|
-
"aria-label": "
|
|
7207
|
+
"aria-label": t("ox0.dataGrid.selection.region"),
|
|
7027
7208
|
className: data_grid_module.selection,
|
|
7028
7209
|
"data-shown": isSelecting || void 0,
|
|
7029
7210
|
inert: !isSelecting,
|
|
7030
7211
|
children: [
|
|
7031
7212
|
/*#__PURE__*/ jsx("span", {
|
|
7032
|
-
children: null === selectionLabelCount ? "
|
|
7033
|
-
|
|
7034
|
-
/*#__PURE__*/ jsx("strong", {
|
|
7035
|
-
children: formatCount(selectionLabelCount)
|
|
7036
|
-
}),
|
|
7037
|
-
" selected"
|
|
7038
|
-
]
|
|
7213
|
+
children: null === selectionLabelCount ? t("ox0.dataGrid.selection.allMatching") : rich("ox0.dataGrid.selection.selected", {
|
|
7214
|
+
count: selectionLabelCount
|
|
7039
7215
|
})
|
|
7040
7216
|
}),
|
|
7041
7217
|
(multiSelect.bulkActions ?? []).length > 0 && /*#__PURE__*/ jsx("span", {
|
|
@@ -7051,7 +7227,13 @@ function DataGrid(props) {
|
|
|
7051
7227
|
className: data_grid_module.bulkActionSeparator,
|
|
7052
7228
|
children: "\xb7"
|
|
7053
7229
|
}),
|
|
7054
|
-
/*#__PURE__*/ jsx(
|
|
7230
|
+
action.popover ? /*#__PURE__*/ jsx(BulkPopoverButton, {
|
|
7231
|
+
action: action,
|
|
7232
|
+
filter: filterTokens,
|
|
7233
|
+
rows: isServer ? void 0 : (signal)=>selectedRows(selection, signal),
|
|
7234
|
+
selection: selection,
|
|
7235
|
+
sort: sort
|
|
7236
|
+
}, `${objectId(selection)}:${objectId(filterTokens)}:${objectId(sort)}`) : /*#__PURE__*/ jsx(Button, {
|
|
7055
7237
|
icon: action.icon,
|
|
7056
7238
|
isDisabled: busyActions.has(action.label),
|
|
7057
7239
|
onPress: ()=>void runBulkAction(action),
|
|
@@ -7064,7 +7246,7 @@ function DataGrid(props) {
|
|
|
7064
7246
|
}),
|
|
7065
7247
|
/*#__PURE__*/ jsx(IconButton, {
|
|
7066
7248
|
icon: CloseIcon,
|
|
7067
|
-
label: "
|
|
7249
|
+
label: t("ox0.dataGrid.selection.clear"),
|
|
7068
7250
|
onPress: clearSelection,
|
|
7069
7251
|
size: "xs",
|
|
7070
7252
|
variant: "ghost"
|
|
@@ -7223,7 +7405,7 @@ function DataGrid(props) {
|
|
|
7223
7405
|
},
|
|
7224
7406
|
children: renderPlannedColumns(renderHeaderCell, (kind, style, colIndex)=>"grab" === kind ? /*#__PURE__*/ jsx("div", {
|
|
7225
7407
|
"aria-colindex": colIndex,
|
|
7226
|
-
"aria-label": "
|
|
7408
|
+
"aria-label": t("ox0.dataGrid.rowOrder"),
|
|
7227
7409
|
className: data_grid_module.headerCell,
|
|
7228
7410
|
role: "columnheader",
|
|
7229
7411
|
style: style
|
|
@@ -7235,13 +7417,13 @@ function DataGrid(props) {
|
|
|
7235
7417
|
className: data_grid_module.emptyCell,
|
|
7236
7418
|
role: "alert",
|
|
7237
7419
|
children: [
|
|
7238
|
-
"
|
|
7420
|
+
t("ox0.dataGrid.loadFailed"),
|
|
7239
7421
|
" ",
|
|
7240
7422
|
/*#__PURE__*/ jsx(Button, {
|
|
7241
7423
|
onPress: serverError.retry,
|
|
7242
7424
|
size: "sm",
|
|
7243
7425
|
variant: "ghost",
|
|
7244
|
-
children: "
|
|
7426
|
+
children: t("ox0.dataGrid.retry")
|
|
7245
7427
|
})
|
|
7246
7428
|
]
|
|
7247
7429
|
}) : isLoading ? props.renderLoadingState ? props.renderLoadingState({
|
|
@@ -7259,10 +7441,10 @@ function DataGrid(props) {
|
|
|
7259
7441
|
}))
|
|
7260
7442
|
}) : 0 === totalCount ? (isServer ? isFiltered : 0 !== rows.length) ? props.renderNoResultsState?.() ?? /*#__PURE__*/ jsx("div", {
|
|
7261
7443
|
className: data_grid_module.emptyCell,
|
|
7262
|
-
children: "
|
|
7444
|
+
children: t("ox0.dataGrid.noResults")
|
|
7263
7445
|
}) : props.renderEmptyState?.() ?? /*#__PURE__*/ jsx("div", {
|
|
7264
7446
|
className: data_grid_module.emptyCell,
|
|
7265
|
-
children: "
|
|
7447
|
+
children: t("ox0.dataGrid.empty")
|
|
7266
7448
|
}) : /*#__PURE__*/ jsx(VirtualScroller, {
|
|
7267
7449
|
apiRef: scrollerApiRef,
|
|
7268
7450
|
className: data_grid_module.scroller,
|
|
@@ -7290,19 +7472,19 @@ function DataGrid(props) {
|
|
|
7290
7472
|
phase: "append"
|
|
7291
7473
|
}) : /*#__PURE__*/ jsx("output", {
|
|
7292
7474
|
className: data_grid_module.appendRow,
|
|
7293
|
-
children: "
|
|
7475
|
+
children: t("ox0.dataGrid.loadingMore")
|
|
7294
7476
|
})),
|
|
7295
7477
|
serverError && totalCount > 0 && /*#__PURE__*/ jsxs("div", {
|
|
7296
7478
|
className: data_grid_module.appendRow,
|
|
7297
7479
|
role: "alert",
|
|
7298
7480
|
children: [
|
|
7299
|
-
"
|
|
7481
|
+
t("ox0.dataGrid.loadMoreFailed"),
|
|
7300
7482
|
" ",
|
|
7301
7483
|
/*#__PURE__*/ jsx(Button, {
|
|
7302
7484
|
onPress: serverError.retry,
|
|
7303
7485
|
size: "sm",
|
|
7304
7486
|
variant: "ghost",
|
|
7305
|
-
children: "
|
|
7487
|
+
children: t("ox0.dataGrid.retry")
|
|
7306
7488
|
})
|
|
7307
7489
|
]
|
|
7308
7490
|
}),
|
|
@@ -7322,7 +7504,7 @@ function DataGrid(props) {
|
|
|
7322
7504
|
children: [
|
|
7323
7505
|
/*#__PURE__*/ jsx(Drawer.Header, {
|
|
7324
7506
|
children: /*#__PURE__*/ jsx(Drawer.Title, {
|
|
7325
|
-
children: "
|
|
7507
|
+
children: t("ox0.dataGrid.details")
|
|
7326
7508
|
})
|
|
7327
7509
|
}),
|
|
7328
7510
|
/*#__PURE__*/ jsx(Drawer.Body, {
|
|
@@ -7336,6 +7518,58 @@ function DataGrid(props) {
|
|
|
7336
7518
|
})
|
|
7337
7519
|
});
|
|
7338
7520
|
}
|
|
7521
|
+
const objectIds = new WeakMap();
|
|
7522
|
+
let nextObjectId = 1;
|
|
7523
|
+
function objectId(value) {
|
|
7524
|
+
const known = objectIds.get(value);
|
|
7525
|
+
if (void 0 !== known) return known;
|
|
7526
|
+
const id = nextObjectId++;
|
|
7527
|
+
objectIds.set(value, id);
|
|
7528
|
+
return id;
|
|
7529
|
+
}
|
|
7530
|
+
function BulkPopoverButton({ action, selection, filter, sort, rows }) {
|
|
7531
|
+
const [opened, setOpened] = useState();
|
|
7532
|
+
function setOpen(next) {
|
|
7533
|
+
if (next) {
|
|
7534
|
+
const controller = new AbortController();
|
|
7535
|
+
setOpened({
|
|
7536
|
+
controller,
|
|
7537
|
+
rows: rows ? ()=>rows(controller.signal) : void 0
|
|
7538
|
+
});
|
|
7539
|
+
} else setOpened(void 0);
|
|
7540
|
+
}
|
|
7541
|
+
useEffect(()=>()=>opened?.controller.abort(), [
|
|
7542
|
+
opened
|
|
7543
|
+
]);
|
|
7544
|
+
return /*#__PURE__*/ jsxs(Popover, {
|
|
7545
|
+
isOpen: void 0 !== opened,
|
|
7546
|
+
onOpenChange: setOpen,
|
|
7547
|
+
placement: "bottom-start",
|
|
7548
|
+
children: [
|
|
7549
|
+
/*#__PURE__*/ jsx(PopoverTrigger, {
|
|
7550
|
+
children: /*#__PURE__*/ jsx(Button, {
|
|
7551
|
+
icon: action.icon,
|
|
7552
|
+
iconEnd: ChevronDownIcon,
|
|
7553
|
+
size: "xs",
|
|
7554
|
+
variant: action.isDestructive ? "danger-inline" : "inline",
|
|
7555
|
+
children: action.label
|
|
7556
|
+
})
|
|
7557
|
+
}),
|
|
7558
|
+
/*#__PURE__*/ jsx(PopoverContent, {
|
|
7559
|
+
children: opened ? action.popover({
|
|
7560
|
+
selection,
|
|
7561
|
+
filter,
|
|
7562
|
+
sort,
|
|
7563
|
+
signal: opened.controller.signal,
|
|
7564
|
+
...opened.rows ? {
|
|
7565
|
+
rows: opened.rows
|
|
7566
|
+
} : {},
|
|
7567
|
+
close: ()=>setOpen(false)
|
|
7568
|
+
}) : null
|
|
7569
|
+
})
|
|
7570
|
+
]
|
|
7571
|
+
});
|
|
7572
|
+
}
|
|
7339
7573
|
function serializeSelection(state) {
|
|
7340
7574
|
return "include" === state.mode ? {
|
|
7341
7575
|
mode: "include",
|
|
@@ -7366,4 +7600,4 @@ function deserializeSelection(data) {
|
|
|
7366
7600
|
excluded: new Set(data.excluded)
|
|
7367
7601
|
};
|
|
7368
7602
|
}
|
|
7369
|
-
export { DataGrid, deserializeSelection, querySchemaFromColumns, serializeSelection };
|
|
7603
|
+
export { DataGrid, defaultDataGridMessages, deserializeSelection, querySchemaFromColumns, serializeSelection };
|