@ox0/data-grid 0.5.0 → 0.7.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 +10 -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 +453 -242
- package/dist/messages.d.ts +132 -0
- package/dist/messages.d.ts.map +1 -0
- package/dist/worker/engine.js +1 -1
- package/package.json +11 -6
- /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 {
|
|
@@ -308,7 +309,7 @@ __webpack_require__.add({
|
|
|
308
309
|
left: 0;
|
|
309
310
|
}
|
|
310
311
|
|
|
311
|
-
.groupRow-ooQc5M:focus-visible {
|
|
312
|
+
.row-hfdKNj:focus-visible, .selectedRow-qs8lAI:focus-visible, .groupRow-ooQc5M:focus-visible {
|
|
312
313
|
outline: 2px solid var(--ox0-color-focus-ring);
|
|
313
314
|
outline-offset: -2px;
|
|
314
315
|
}
|
|
@@ -796,28 +797,6 @@ __webpack_require__.add({
|
|
|
796
797
|
pointer-events: auto;
|
|
797
798
|
}
|
|
798
799
|
|
|
799
|
-
.cell-q3dXM7 {
|
|
800
|
-
--_actions-clear: calc(var(--ox0-space-2xs) + 24px);
|
|
801
|
-
--_actions-fade: linear-gradient(to left,
|
|
802
|
-
transparent var(--_actions-clear),
|
|
803
|
-
#000 calc(var(--_actions-clear) + 8px));
|
|
804
|
-
--_actions-fade-start: linear-gradient(to right,
|
|
805
|
-
transparent var(--_actions-clear),
|
|
806
|
-
#000 calc(var(--_actions-clear) + 8px));
|
|
807
|
-
}
|
|
808
|
-
|
|
809
|
-
.cell-q3dXM7[data-actions-hover]:not([data-pinned]), .cell-q3dXM7[data-pinned][data-actions-hover] > * {
|
|
810
|
-
mask-image: var(--_actions-fade);
|
|
811
|
-
}
|
|
812
|
-
|
|
813
|
-
.cell-q3dXM7[data-align="end"] > .cellText-Ge3QlA, .cell-q3dXM7[data-align="end"] > .cellWrap-lWoNaf {
|
|
814
|
-
text-align: end;
|
|
815
|
-
}
|
|
816
|
-
|
|
817
|
-
.cell-q3dXM7[data-align="end"][data-actions-hover]:not([data-pinned]), .cell-q3dXM7[data-align="end"][data-pinned][data-actions-hover] > * {
|
|
818
|
-
mask-image: var(--_actions-fade-start);
|
|
819
|
-
}
|
|
820
|
-
|
|
821
800
|
.cell-q3dXM7[data-filter-pending="include"] {
|
|
822
801
|
background: var(--ox0-color-accent-subtle);
|
|
823
802
|
box-shadow: inset 0 0 0 1px var(--ox0-color-accent);
|
|
@@ -895,12 +874,12 @@ __webpack_require__.add({
|
|
|
895
874
|
A: __rspack_default_export
|
|
896
875
|
});
|
|
897
876
|
},
|
|
898
|
-
"../../node_modules/.pnpm/@rsbuild+core@2.
|
|
899
|
-
var
|
|
900
|
-
var
|
|
901
|
-
var
|
|
902
|
-
var
|
|
903
|
-
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());
|
|
904
883
|
___CSS_LOADER_EXPORT___.push([
|
|
905
884
|
module.id,
|
|
906
885
|
`.root-qnts0V {
|
|
@@ -1054,7 +1033,7 @@ __webpack_require__.add({
|
|
|
1054
1033
|
A: __rspack_default_export
|
|
1055
1034
|
});
|
|
1056
1035
|
},
|
|
1057
|
-
"../../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) {
|
|
1058
1037
|
module.exports = function(cssWithMappingToString) {
|
|
1059
1038
|
var list = [];
|
|
1060
1039
|
list.toString = function() {
|
|
@@ -1107,12 +1086,12 @@ __webpack_require__.add({
|
|
|
1107
1086
|
return list;
|
|
1108
1087
|
};
|
|
1109
1088
|
},
|
|
1110
|
-
"../../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) {
|
|
1111
1090
|
module.exports = function(i) {
|
|
1112
1091
|
return i[1];
|
|
1113
1092
|
};
|
|
1114
1093
|
},
|
|
1115
|
-
"../../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) {
|
|
1116
1095
|
var stylesInDOM = [];
|
|
1117
1096
|
function getIndexByIdentifier(identifier) {
|
|
1118
1097
|
var result = -1;
|
|
@@ -1190,7 +1169,7 @@ __webpack_require__.add({
|
|
|
1190
1169
|
};
|
|
1191
1170
|
};
|
|
1192
1171
|
},
|
|
1193
|
-
"../../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) {
|
|
1194
1173
|
var memo = {};
|
|
1195
1174
|
function getTarget(target) {
|
|
1196
1175
|
if (void 0 === memo[target]) {
|
|
@@ -1211,7 +1190,7 @@ __webpack_require__.add({
|
|
|
1211
1190
|
}
|
|
1212
1191
|
module.exports = insertBySelector;
|
|
1213
1192
|
},
|
|
1214
|
-
"../../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) {
|
|
1215
1194
|
function insertStyleElement(options) {
|
|
1216
1195
|
var element = document.createElement("style");
|
|
1217
1196
|
options.setAttributes(element, options.attributes);
|
|
@@ -1220,14 +1199,14 @@ __webpack_require__.add({
|
|
|
1220
1199
|
}
|
|
1221
1200
|
module.exports = insertStyleElement;
|
|
1222
1201
|
},
|
|
1223
|
-
"../../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__) {
|
|
1224
1203
|
function setAttributesWithoutAttributes(styleElement) {
|
|
1225
1204
|
var nonce = __webpack_require__.nc;
|
|
1226
1205
|
if (nonce) styleElement.setAttribute("nonce", nonce);
|
|
1227
1206
|
}
|
|
1228
1207
|
module.exports = setAttributesWithoutAttributes;
|
|
1229
1208
|
},
|
|
1230
|
-
"../../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) {
|
|
1231
1210
|
function apply(styleElement, options, obj) {
|
|
1232
1211
|
var css = "";
|
|
1233
1212
|
if (obj.supports) css += "@supports (".concat(obj.supports, ") {");
|
|
@@ -1263,7 +1242,7 @@ __webpack_require__.add({
|
|
|
1263
1242
|
}
|
|
1264
1243
|
module.exports = domAPI;
|
|
1265
1244
|
},
|
|
1266
|
-
"../../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) {
|
|
1267
1246
|
function styleTagTransform(css, styleElement) {
|
|
1268
1247
|
if (styleElement.styleSheet) styleElement.styleSheet.cssText = css;
|
|
1269
1248
|
else {
|
|
@@ -3156,7 +3135,7 @@ function useViews({ config, columns, sort, filterTokens, normalize, apply, reset
|
|
|
3156
3135
|
commitLoaded(view);
|
|
3157
3136
|
if (!isControlled) setInternalId(viewId);
|
|
3158
3137
|
} catch {
|
|
3159
|
-
if (token === loadTokenRef.current) setError("
|
|
3138
|
+
if (token === loadTokenRef.current) setError("load");
|
|
3160
3139
|
} finally{
|
|
3161
3140
|
if (token === loadTokenRef.current) commitPending(null);
|
|
3162
3141
|
}
|
|
@@ -3196,7 +3175,7 @@ function useViews({ config, columns, sort, filterTokens, normalize, apply, reset
|
|
|
3196
3175
|
commitLoaded(normalize(saved));
|
|
3197
3176
|
return true;
|
|
3198
3177
|
} catch {
|
|
3199
|
-
setError("
|
|
3178
|
+
setError("save");
|
|
3200
3179
|
return false;
|
|
3201
3180
|
}
|
|
3202
3181
|
}
|
|
@@ -3220,7 +3199,7 @@ function useViews({ config, columns, sort, filterTokens, normalize, apply, reset
|
|
|
3220
3199
|
config.onActiveViewChange?.(saved.id);
|
|
3221
3200
|
return true;
|
|
3222
3201
|
} catch {
|
|
3223
|
-
setError("
|
|
3202
|
+
setError("save");
|
|
3224
3203
|
return false;
|
|
3225
3204
|
}
|
|
3226
3205
|
}
|
|
@@ -3236,7 +3215,7 @@ function useViews({ config, columns, sort, filterTokens, normalize, apply, reset
|
|
|
3236
3215
|
if (loadedIdRef.current === viewId) commitLoaded(normalize(saved));
|
|
3237
3216
|
return true;
|
|
3238
3217
|
} catch {
|
|
3239
|
-
setError("
|
|
3218
|
+
setError("rename");
|
|
3240
3219
|
return false;
|
|
3241
3220
|
}
|
|
3242
3221
|
}
|
|
@@ -3256,7 +3235,7 @@ function useViews({ config, columns, sort, filterTokens, normalize, apply, reset
|
|
|
3256
3235
|
if (viewId === activeViewId) resetToDefault();
|
|
3257
3236
|
return true;
|
|
3258
3237
|
} catch {
|
|
3259
|
-
setError("
|
|
3238
|
+
setError("delete");
|
|
3260
3239
|
return false;
|
|
3261
3240
|
}
|
|
3262
3241
|
}
|
|
@@ -3276,6 +3255,142 @@ function useViews({ config, columns, sort, filterTokens, normalize, apply, reset
|
|
|
3276
3255
|
resetToDefault
|
|
3277
3256
|
};
|
|
3278
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
|
+
}
|
|
3279
3394
|
function highlightTerms(tokens) {
|
|
3280
3395
|
const global = [];
|
|
3281
3396
|
const byColumn = new Map();
|
|
@@ -3370,19 +3485,19 @@ function measureHeaderWidths(input) {
|
|
|
3370
3485
|
function headerWidth(column, input) {
|
|
3371
3486
|
return input.measure(column.header, input.headerFont) + input.headerPadding + (column.sortable ? SORT_INDICATOR_ALLOWANCE : 0);
|
|
3372
3487
|
}
|
|
3373
|
-
const
|
|
3374
|
-
|
|
3375
|
-
|
|
3376
|
-
|
|
3377
|
-
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");
|
|
3378
|
-
var insertBySelector_default = /*#__PURE__*/ __webpack_require__.n(insertBySelector);
|
|
3379
|
-
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");
|
|
3380
3492
|
var setAttributesWithoutAttributes_default = /*#__PURE__*/ __webpack_require__.n(setAttributesWithoutAttributes);
|
|
3381
|
-
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");
|
|
3382
3498
|
var insertStyleElement_default = /*#__PURE__*/ __webpack_require__.n(insertStyleElement);
|
|
3383
|
-
const
|
|
3384
|
-
var
|
|
3385
|
-
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);
|
|
3386
3501
|
var data_grid_module_options = {};
|
|
3387
3502
|
data_grid_module_options.styleTagTransform = styleTagTransform_default();
|
|
3388
3503
|
data_grid_module_options.setAttributes = setAttributesWithoutAttributes_default();
|
|
@@ -3392,9 +3507,46 @@ data_grid_module_options.insertStyleElement = insertStyleElement_default();
|
|
|
3392
3507
|
injectStylesIntoStyleTag_default()(data_grid_module_0.A, data_grid_module_options);
|
|
3393
3508
|
const data_grid_module = data_grid_module_0.A && data_grid_module_0.A.locals ? data_grid_module_0.A.locals : void 0;
|
|
3394
3509
|
const HOVER_ATTRIBUTE = "data-actions-hover";
|
|
3510
|
+
function focusWith(element, options) {
|
|
3511
|
+
const focusOptions = options;
|
|
3512
|
+
element.focus(focusOptions);
|
|
3513
|
+
}
|
|
3514
|
+
function showsFocusRing(element) {
|
|
3515
|
+
try {
|
|
3516
|
+
return element.matches(":focus-visible");
|
|
3517
|
+
} catch {
|
|
3518
|
+
return false;
|
|
3519
|
+
}
|
|
3520
|
+
}
|
|
3521
|
+
function focusToReturn(row) {
|
|
3522
|
+
const active = row ?? document.activeElement;
|
|
3523
|
+
return active instanceof HTMLElement && active !== document.body ? {
|
|
3524
|
+
element: active,
|
|
3525
|
+
ring: showsFocusRing(active)
|
|
3526
|
+
} : null;
|
|
3527
|
+
}
|
|
3528
|
+
const FADE_PX = 8;
|
|
3529
|
+
function fadeUnderButton(cell, button, side) {
|
|
3530
|
+
const box = cell.getBoundingClientRect();
|
|
3531
|
+
const buttonBox = button.getBoundingClientRect();
|
|
3532
|
+
for (const child of cell.children){
|
|
3533
|
+
if (!(child instanceof HTMLElement)) continue;
|
|
3534
|
+
const childBox = child.getBoundingClientRect();
|
|
3535
|
+
const overlap = "end" === side ? childBox.right - buttonBox.left : buttonBox.right - childBox.left;
|
|
3536
|
+
if (overlap <= 0 || 0 === box.width) continue;
|
|
3537
|
+
const direction = "end" === side ? "to left" : "to right";
|
|
3538
|
+
child.style.maskImage = `linear-gradient(${direction}, transparent ${overlap}px, #000 ${overlap + FADE_PX}px)`;
|
|
3539
|
+
}
|
|
3540
|
+
}
|
|
3541
|
+
function clearFade(cell) {
|
|
3542
|
+
for (const child of cell.children)if (child instanceof HTMLElement) child.style.removeProperty("mask-image");
|
|
3543
|
+
}
|
|
3395
3544
|
function placeAnchor(anchor, cellRef, cell) {
|
|
3396
3545
|
const previous = cellRef.current;
|
|
3397
|
-
if (previous && previous !== cell)
|
|
3546
|
+
if (previous && previous !== cell) {
|
|
3547
|
+
previous.removeAttribute(HOVER_ATTRIBUTE);
|
|
3548
|
+
clearFade(previous);
|
|
3549
|
+
}
|
|
3398
3550
|
cellRef.current = cell;
|
|
3399
3551
|
if (!anchor) return;
|
|
3400
3552
|
const frame = anchor.parentElement;
|
|
@@ -3407,12 +3559,17 @@ function placeAnchor(anchor, cellRef, cell) {
|
|
|
3407
3559
|
anchor.style.left = `${box.left - frameBox.left}px`;
|
|
3408
3560
|
anchor.style.width = `${box.width}px`;
|
|
3409
3561
|
anchor.style.height = `${box.height}px`;
|
|
3410
|
-
|
|
3562
|
+
const side = "end" === cell.dataset.align ? "start" : "end";
|
|
3563
|
+
anchor.dataset.side = side;
|
|
3564
|
+
const button = anchor.querySelector("button");
|
|
3565
|
+
if (button) fadeUnderButton(cell, button, side);
|
|
3411
3566
|
}
|
|
3412
3567
|
function CellActions({ apiRef, sectionsFor, onAction, labelFor }) {
|
|
3568
|
+
const { t } = useDataGridMessages();
|
|
3413
3569
|
const anchorRef = useRef(null);
|
|
3414
3570
|
const cellRef = useRef(null);
|
|
3415
3571
|
const rowRef = useRef(null);
|
|
3572
|
+
const returnRef = useRef(null);
|
|
3416
3573
|
const isOpenRef = useRef(false);
|
|
3417
3574
|
const shiftRef = useRef(false);
|
|
3418
3575
|
const [isOpen, setIsOpen] = useState(false);
|
|
@@ -3440,6 +3597,7 @@ function CellActions({ apiRef, sectionsFor, onAction, labelFor }) {
|
|
|
3440
3597
|
placeAnchor(anchorRef.current, cellRef, cell);
|
|
3441
3598
|
setLabel(latest.current.labelFor(cell));
|
|
3442
3599
|
rowRef.current = options.row ?? null;
|
|
3600
|
+
returnRef.current = focusToReturn(options.row);
|
|
3443
3601
|
const next = latest.current.sectionsFor(cell, options.row);
|
|
3444
3602
|
if (0 === next.length) return;
|
|
3445
3603
|
setSections(next);
|
|
@@ -3474,12 +3632,18 @@ function CellActions({ apiRef, sectionsFor, onAction, labelFor }) {
|
|
|
3474
3632
|
const opened = cell ? latest.current.sectionsFor(cell, void 0) : [];
|
|
3475
3633
|
if (0 === opened.length) return;
|
|
3476
3634
|
rowRef.current = null;
|
|
3635
|
+
returnRef.current = focusToReturn(void 0);
|
|
3477
3636
|
setSections(opened);
|
|
3478
3637
|
}
|
|
3479
3638
|
isOpenRef.current = next;
|
|
3480
3639
|
setIsOpen(next);
|
|
3481
3640
|
if (!next) {
|
|
3482
|
-
|
|
3641
|
+
const back = returnRef.current;
|
|
3642
|
+
if (back?.element.isConnected) focusWith(back.element, {
|
|
3643
|
+
focusVisible: back.ring,
|
|
3644
|
+
preventScroll: true
|
|
3645
|
+
});
|
|
3646
|
+
returnRef.current = null;
|
|
3483
3647
|
rowRef.current = null;
|
|
3484
3648
|
place(null);
|
|
3485
3649
|
}
|
|
@@ -3489,7 +3653,7 @@ function CellActions({ apiRef, sectionsFor, onAction, labelFor }) {
|
|
|
3489
3653
|
"data-cell-actions": "",
|
|
3490
3654
|
ref: anchorRef,
|
|
3491
3655
|
children: /*#__PURE__*/ jsx(Menu, {
|
|
3492
|
-
"aria-label": "
|
|
3656
|
+
"aria-label": t("ox0.dataGrid.cellActions.label"),
|
|
3493
3657
|
isOpen: isOpen,
|
|
3494
3658
|
onOpenChange: handleOpenChange,
|
|
3495
3659
|
trigger: /*#__PURE__*/ jsx(IconButton, {
|
|
@@ -3640,32 +3804,34 @@ function pendingMarks(tokens) {
|
|
|
3640
3804
|
const DATE_WINDOWS = [
|
|
3641
3805
|
{
|
|
3642
3806
|
count: 1,
|
|
3643
|
-
unit: "d"
|
|
3644
|
-
label: "1 day"
|
|
3807
|
+
unit: "d"
|
|
3645
3808
|
},
|
|
3646
3809
|
{
|
|
3647
3810
|
count: 1,
|
|
3648
|
-
unit: "w"
|
|
3649
|
-
label: "1 week"
|
|
3811
|
+
unit: "w"
|
|
3650
3812
|
},
|
|
3651
3813
|
{
|
|
3652
3814
|
count: 1,
|
|
3653
|
-
unit: "m"
|
|
3654
|
-
label: "1 month"
|
|
3815
|
+
unit: "m"
|
|
3655
3816
|
},
|
|
3656
3817
|
{
|
|
3657
3818
|
count: 1,
|
|
3658
|
-
unit: "y"
|
|
3659
|
-
label: "1 year"
|
|
3819
|
+
unit: "y"
|
|
3660
3820
|
}
|
|
3661
3821
|
];
|
|
3662
|
-
|
|
3663
|
-
|
|
3664
|
-
|
|
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");
|
|
3665
3831
|
const actions = [
|
|
3666
3832
|
{
|
|
3667
3833
|
id: "include",
|
|
3668
|
-
label: state.isIncluded ? "
|
|
3834
|
+
label: t(state.isIncluded ? "ox0.dataGrid.cellActions.removeFromFilter" : "ox0.dataGrid.cellActions.filterTo"),
|
|
3669
3835
|
hint: include,
|
|
3670
3836
|
run: {
|
|
3671
3837
|
action: "include"
|
|
@@ -3674,14 +3840,14 @@ function actionsFor(type, state, options) {
|
|
|
3674
3840
|
];
|
|
3675
3841
|
if (state.hasOthers) actions.push({
|
|
3676
3842
|
id: "only",
|
|
3677
|
-
label: "
|
|
3843
|
+
label: t("ox0.dataGrid.cellActions.filterToOnly"),
|
|
3678
3844
|
run: {
|
|
3679
3845
|
action: "only"
|
|
3680
3846
|
}
|
|
3681
3847
|
});
|
|
3682
3848
|
actions.push({
|
|
3683
3849
|
id: "exclude",
|
|
3684
|
-
label: state.isExcluded ? "
|
|
3850
|
+
label: t(state.isExcluded ? "ox0.dataGrid.cellActions.stopExcluding" : "ox0.dataGrid.cellActions.exclude"),
|
|
3685
3851
|
hint: exclude,
|
|
3686
3852
|
run: {
|
|
3687
3853
|
action: "exclude"
|
|
@@ -3689,35 +3855,37 @@ function actionsFor(type, state, options) {
|
|
|
3689
3855
|
});
|
|
3690
3856
|
if ("numeric" === type) actions.push({
|
|
3691
3857
|
id: "at-least",
|
|
3692
|
-
label: "
|
|
3858
|
+
label: t("ox0.dataGrid.cellActions.atLeast"),
|
|
3693
3859
|
run: {
|
|
3694
3860
|
action: "at-least"
|
|
3695
3861
|
}
|
|
3696
3862
|
}, {
|
|
3697
3863
|
id: "at-most",
|
|
3698
|
-
label: "
|
|
3864
|
+
label: t("ox0.dataGrid.cellActions.atMost"),
|
|
3699
3865
|
run: {
|
|
3700
3866
|
action: "at-most"
|
|
3701
3867
|
}
|
|
3702
3868
|
});
|
|
3703
3869
|
if ("date" === type) actions.push({
|
|
3704
3870
|
id: "at-least",
|
|
3705
|
-
label: "
|
|
3871
|
+
label: t("ox0.dataGrid.cellActions.onOrAfter"),
|
|
3706
3872
|
run: {
|
|
3707
3873
|
action: "at-least"
|
|
3708
3874
|
}
|
|
3709
3875
|
}, {
|
|
3710
3876
|
id: "at-most",
|
|
3711
|
-
label: "
|
|
3877
|
+
label: t("ox0.dataGrid.cellActions.onOrBefore"),
|
|
3712
3878
|
run: {
|
|
3713
3879
|
action: "at-most"
|
|
3714
3880
|
}
|
|
3715
3881
|
}, {
|
|
3716
3882
|
id: "within",
|
|
3717
|
-
label: "
|
|
3718
|
-
children: DATE_WINDOWS.map((
|
|
3883
|
+
label: t("ox0.dataGrid.cellActions.within"),
|
|
3884
|
+
children: DATE_WINDOWS.map((window1)=>({
|
|
3719
3885
|
id: `${window1.count}${window1.unit}`,
|
|
3720
|
-
label,
|
|
3886
|
+
label: t(WINDOW_MESSAGE[window1.unit], {
|
|
3887
|
+
count: window1.count
|
|
3888
|
+
}),
|
|
3721
3889
|
run: {
|
|
3722
3890
|
action: "within",
|
|
3723
3891
|
window: window1
|
|
@@ -3726,14 +3894,14 @@ function actionsFor(type, state, options) {
|
|
|
3726
3894
|
});
|
|
3727
3895
|
if (options.hasColumnFilter) actions.push({
|
|
3728
3896
|
id: "clear",
|
|
3729
|
-
label: "
|
|
3897
|
+
label: t("ox0.dataGrid.cellActions.clearColumnFilter"),
|
|
3730
3898
|
run: {
|
|
3731
3899
|
action: "clear"
|
|
3732
3900
|
}
|
|
3733
3901
|
});
|
|
3734
3902
|
if (options.canCopy) actions.push({
|
|
3735
3903
|
id: "copy",
|
|
3736
|
-
label: "
|
|
3904
|
+
label: t("ox0.dataGrid.cellActions.copy"),
|
|
3737
3905
|
run: {
|
|
3738
3906
|
action: "copy"
|
|
3739
3907
|
}
|
|
@@ -3964,7 +4132,7 @@ function groupHeaderSegments(layout) {
|
|
|
3964
4132
|
}
|
|
3965
4133
|
return segments;
|
|
3966
4134
|
}
|
|
3967
|
-
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");
|
|
3968
4136
|
var column_chooser_module_options = {};
|
|
3969
4137
|
column_chooser_module_options.styleTagTransform = styleTagTransform_default();
|
|
3970
4138
|
column_chooser_module_options.setAttributes = setAttributesWithoutAttributes_default();
|
|
@@ -4004,9 +4172,9 @@ function bySection(rows) {
|
|
|
4004
4172
|
};
|
|
4005
4173
|
}
|
|
4006
4174
|
const SECTION_LABEL = {
|
|
4007
|
-
left: "
|
|
4008
|
-
center: "
|
|
4009
|
-
right: "
|
|
4175
|
+
left: "ox0.dataGrid.columnChooser.pinnedLeft",
|
|
4176
|
+
center: "ox0.dataGrid.columnChooser.columns",
|
|
4177
|
+
right: "ox0.dataGrid.columnChooser.pinnedRight"
|
|
4010
4178
|
};
|
|
4011
4179
|
const SECTIONS = [
|
|
4012
4180
|
"left",
|
|
@@ -4015,6 +4183,7 @@ const SECTIONS = [
|
|
|
4015
4183
|
];
|
|
4016
4184
|
const SLIDE_MS = 150;
|
|
4017
4185
|
function ColumnChooser({ columnDefs, store }) {
|
|
4186
|
+
const { t } = useDataGridMessages();
|
|
4018
4187
|
const columnStates = useStore(store, (state)=>state.columns);
|
|
4019
4188
|
const [query, setQuery] = useState("");
|
|
4020
4189
|
const [drag, setDrag] = useState(null);
|
|
@@ -4086,6 +4255,10 @@ function ColumnChooser({ columnDefs, store }) {
|
|
|
4086
4255
|
startY: rect.top - chooserTop()
|
|
4087
4256
|
});
|
|
4088
4257
|
}
|
|
4258
|
+
function middleOf(row) {
|
|
4259
|
+
const element = rowElementsRef.current.get(row.id);
|
|
4260
|
+
return element ? element.offsetTop + element.offsetHeight / 2 : 1 / 0;
|
|
4261
|
+
}
|
|
4089
4262
|
function handleDragMove(event) {
|
|
4090
4263
|
if (!drag) return;
|
|
4091
4264
|
const ghost = ghostRef.current;
|
|
@@ -4099,10 +4272,6 @@ function ColumnChooser({ columnDefs, store }) {
|
|
|
4099
4272
|
const dragged = rows.find((row)=>row.id === drag.id);
|
|
4100
4273
|
if (!dragged || "center" !== section && !dragged.pinnable) return;
|
|
4101
4274
|
const others = bySection(rows.filter((row)=>row.id !== drag.id));
|
|
4102
|
-
const middleOf = (row)=>{
|
|
4103
|
-
const element = rowElementsRef.current.get(row.id);
|
|
4104
|
-
return element ? element.offsetTop + element.offsetHeight / 2 : 1 / 0;
|
|
4105
|
-
};
|
|
4106
4275
|
const before = others[section].findIndex((row)=>middleOf(row) > y);
|
|
4107
4276
|
const insertAt = -1 === before ? others[section].length : before;
|
|
4108
4277
|
others[section] = [
|
|
@@ -4159,7 +4328,7 @@ function ColumnChooser({ columnDefs, store }) {
|
|
|
4159
4328
|
ref: chooserRef,
|
|
4160
4329
|
children: [
|
|
4161
4330
|
/*#__PURE__*/ jsx(SearchField, {
|
|
4162
|
-
ariaLabel: "
|
|
4331
|
+
ariaLabel: t("ox0.dataGrid.columnChooser.find"),
|
|
4163
4332
|
onChange: setQuery,
|
|
4164
4333
|
value: query
|
|
4165
4334
|
}),
|
|
@@ -4175,11 +4344,11 @@ function ColumnChooser({ columnDefs, store }) {
|
|
|
4175
4344
|
children: [
|
|
4176
4345
|
/*#__PURE__*/ jsx("div", {
|
|
4177
4346
|
className: column_chooser_module.sectionLabel,
|
|
4178
|
-
children: SECTION_LABEL[section]
|
|
4347
|
+
children: t(SECTION_LABEL[section])
|
|
4179
4348
|
}),
|
|
4180
4349
|
0 === visibleRows.length && /*#__PURE__*/ jsx("div", {
|
|
4181
4350
|
className: column_chooser_module.emptySection,
|
|
4182
|
-
children: isFiltering ? "
|
|
4351
|
+
children: isFiltering ? t("ox0.dataGrid.columnChooser.noMatches") : t("ox0.dataGrid.columnChooser.dropToPin")
|
|
4183
4352
|
}),
|
|
4184
4353
|
visibleRows.map((row)=>/*#__PURE__*/ jsxs("div", {
|
|
4185
4354
|
className: column_chooser_module.row,
|
|
@@ -4188,7 +4357,9 @@ function ColumnChooser({ columnDefs, store }) {
|
|
|
4188
4357
|
ref: registerRow(row.id),
|
|
4189
4358
|
children: [
|
|
4190
4359
|
/*#__PURE__*/ jsx("button", {
|
|
4191
|
-
"aria-label":
|
|
4360
|
+
"aria-label": t("ox0.dataGrid.columnChooser.reorder", {
|
|
4361
|
+
column: row.header
|
|
4362
|
+
}),
|
|
4192
4363
|
className: column_chooser_module.grip,
|
|
4193
4364
|
disabled: isFiltering || !row.reorderable,
|
|
4194
4365
|
onPointerDown: (event)=>handleGripPointerDown(row, event),
|
|
@@ -4226,7 +4397,7 @@ function ColumnChooser({ columnDefs, store }) {
|
|
|
4226
4397
|
onPress: ()=>store.getState().resetColumns(),
|
|
4227
4398
|
size: "sm",
|
|
4228
4399
|
variant: "ghost",
|
|
4229
|
-
children: "
|
|
4400
|
+
children: t("ox0.dataGrid.columnChooser.reset")
|
|
4230
4401
|
})
|
|
4231
4402
|
]
|
|
4232
4403
|
});
|
|
@@ -4279,6 +4450,7 @@ function GripIcon() {
|
|
|
4279
4450
|
}
|
|
4280
4451
|
const KEYBOARD_STEP = 10;
|
|
4281
4452
|
function ColumnResizeHandle({ header, width, minWidth, maxWidth, edge, viewportRef, guideRef, onResize, onAutoFit }) {
|
|
4453
|
+
const { t } = useDataGridMessages();
|
|
4282
4454
|
const dragRef = useRef(null);
|
|
4283
4455
|
const nextWidthRef = useRef(width);
|
|
4284
4456
|
const clamp = (value)=>Math.round(Math.min(Math.max(value, minWidth), maxWidth ?? 1 / 0));
|
|
@@ -4333,7 +4505,9 @@ function ColumnResizeHandle({ header, width, minWidth, maxWidth, edge, viewportR
|
|
|
4333
4505
|
if (next !== width) onResize(next);
|
|
4334
4506
|
}
|
|
4335
4507
|
return /*#__PURE__*/ jsx("div", {
|
|
4336
|
-
"aria-label":
|
|
4508
|
+
"aria-label": t("ox0.dataGrid.resizeColumn", {
|
|
4509
|
+
column: header
|
|
4510
|
+
}),
|
|
4337
4511
|
"aria-orientation": "vertical",
|
|
4338
4512
|
"aria-valuemax": maxWidth,
|
|
4339
4513
|
"aria-valuemin": minWidth,
|
|
@@ -4458,22 +4632,25 @@ const FORMAT_LABELS = {
|
|
|
4458
4632
|
excel: "Excel"
|
|
4459
4633
|
};
|
|
4460
4634
|
function ExportButton({ formats, isBusy, onExport }) {
|
|
4635
|
+
const { t } = useDataGridMessages();
|
|
4461
4636
|
const icon = isBusy ? Spinner : DownloadIcon;
|
|
4462
4637
|
const [only] = formats;
|
|
4463
4638
|
if (1 === formats.length && only) return /*#__PURE__*/ jsx(IconButton, {
|
|
4464
4639
|
icon: icon,
|
|
4465
4640
|
isDisabled: isBusy,
|
|
4466
|
-
label:
|
|
4641
|
+
label: t("ox0.dataGrid.export.as", {
|
|
4642
|
+
format: FORMAT_LABELS[only]
|
|
4643
|
+
}),
|
|
4467
4644
|
onPress: ()=>onExport(only),
|
|
4468
4645
|
size: "xs",
|
|
4469
4646
|
variant: "ghost"
|
|
4470
4647
|
});
|
|
4471
4648
|
return /*#__PURE__*/ jsx(Menu, {
|
|
4472
|
-
"aria-label": "
|
|
4649
|
+
"aria-label": t("ox0.dataGrid.export.menu"),
|
|
4473
4650
|
trigger: /*#__PURE__*/ jsx(IconButton, {
|
|
4474
4651
|
icon: icon,
|
|
4475
4652
|
isDisabled: isBusy,
|
|
4476
|
-
label: "
|
|
4653
|
+
label: t("ox0.dataGrid.export.label"),
|
|
4477
4654
|
size: "xs",
|
|
4478
4655
|
variant: "ghost"
|
|
4479
4656
|
}),
|
|
@@ -4498,10 +4675,6 @@ function DownloadIcon({ size = 14 }) {
|
|
|
4498
4675
|
})
|
|
4499
4676
|
});
|
|
4500
4677
|
}
|
|
4501
|
-
const numberFormat = new Intl.NumberFormat();
|
|
4502
|
-
function formatCount(value) {
|
|
4503
|
-
return numberFormat.format(value);
|
|
4504
|
-
}
|
|
4505
4678
|
const statFormat = new Intl.NumberFormat(void 0, {
|
|
4506
4679
|
maximumFractionDigits: 2
|
|
4507
4680
|
});
|
|
@@ -4550,18 +4723,26 @@ function pageNumbers(current, pageCount) {
|
|
|
4550
4723
|
return withGaps;
|
|
4551
4724
|
}
|
|
4552
4725
|
function Pager({ pageIndex, pageSize, rowCount, totalCount, hasNext, hasPrevious, canJump, isBusy, onPage }) {
|
|
4726
|
+
const { t } = useDataGridMessages();
|
|
4553
4727
|
const first = pageIndex * pageSize + 1;
|
|
4554
4728
|
const last = pageIndex * pageSize + rowCount;
|
|
4555
|
-
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
|
+
});
|
|
4556
4737
|
const pageCount = totalCount >= 0 ? Math.max(1, Math.ceil(totalCount / pageSize)) : 0;
|
|
4557
4738
|
return /*#__PURE__*/ jsxs("nav", {
|
|
4558
|
-
"aria-label": "
|
|
4739
|
+
"aria-label": t("ox0.dataGrid.pager.label"),
|
|
4559
4740
|
className: data_grid_module.pager,
|
|
4560
4741
|
children: [
|
|
4561
4742
|
/*#__PURE__*/ jsx(IconButton, {
|
|
4562
4743
|
icon: ChevronLeft,
|
|
4563
4744
|
isDisabled: !hasPrevious || isBusy,
|
|
4564
|
-
label: "
|
|
4745
|
+
label: t("ox0.dataGrid.pager.previous"),
|
|
4565
4746
|
onPress: ()=>onPage(pageIndex - 1),
|
|
4566
4747
|
size: "xs",
|
|
4567
4748
|
variant: "ghost"
|
|
@@ -4586,7 +4767,7 @@ function Pager({ pageIndex, pageSize, rowCount, totalCount, hasNext, hasPrevious
|
|
|
4586
4767
|
/*#__PURE__*/ jsx(IconButton, {
|
|
4587
4768
|
icon: ChevronRight,
|
|
4588
4769
|
isDisabled: !hasNext || isBusy,
|
|
4589
|
-
label: "
|
|
4770
|
+
label: t("ox0.dataGrid.pager.next"),
|
|
4590
4771
|
onPress: ()=>onPage(pageIndex + 1),
|
|
4591
4772
|
size: "xs",
|
|
4592
4773
|
variant: "ghost"
|
|
@@ -4622,7 +4803,7 @@ function ChevronRight() {
|
|
|
4622
4803
|
})
|
|
4623
4804
|
});
|
|
4624
4805
|
}
|
|
4625
|
-
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");
|
|
4626
4807
|
var views_menu_module_options = {};
|
|
4627
4808
|
views_menu_module_options.styleTagTransform = styleTagTransform_default();
|
|
4628
4809
|
views_menu_module_options.setAttributes = setAttributesWithoutAttributes_default();
|
|
@@ -4634,7 +4815,14 @@ const views_menu_module = views_menu_module_0.A && views_menu_module_0.A.locals
|
|
|
4634
4815
|
const LIST = {
|
|
4635
4816
|
kind: "list"
|
|
4636
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
|
+
};
|
|
4637
4824
|
function ViewsMenu({ views, api, canIncludeFilters, canDelete }) {
|
|
4825
|
+
const { t } = useDataGridMessages();
|
|
4638
4826
|
const [isOpen, setIsOpen] = useState(false);
|
|
4639
4827
|
const [mode, setMode] = useState(LIST);
|
|
4640
4828
|
const [name, setName] = useState("");
|
|
@@ -4676,13 +4864,13 @@ function ViewsMenu({ views, api, canIncludeFilters, canDelete }) {
|
|
|
4676
4864
|
/*#__PURE__*/ jsx(TextField, {
|
|
4677
4865
|
autoFocus: true,
|
|
4678
4866
|
isDisabled: isSaving,
|
|
4679
|
-
label: "
|
|
4867
|
+
label: t("ox0.dataGrid.views.name"),
|
|
4680
4868
|
onChange: setName,
|
|
4681
4869
|
value: name
|
|
4682
4870
|
}),
|
|
4683
4871
|
"save-as" === mode.kind && canIncludeFilters && /*#__PURE__*/ jsx(Checkbox, {
|
|
4684
4872
|
isSelected: includeFilters,
|
|
4685
|
-
label: "
|
|
4873
|
+
label: t("ox0.dataGrid.views.includeFilters"),
|
|
4686
4874
|
onChange: setIncludeFilters
|
|
4687
4875
|
}),
|
|
4688
4876
|
/*#__PURE__*/ jsxs("div", {
|
|
@@ -4693,7 +4881,7 @@ function ViewsMenu({ views, api, canIncludeFilters, canDelete }) {
|
|
|
4693
4881
|
onPress: ()=>setMode(LIST),
|
|
4694
4882
|
size: "sm",
|
|
4695
4883
|
variant: "ghost",
|
|
4696
|
-
children: "
|
|
4884
|
+
children: t("ox0.dataGrid.views.cancel")
|
|
4697
4885
|
}),
|
|
4698
4886
|
/*#__PURE__*/ jsx(Button, {
|
|
4699
4887
|
isDisabled: isSaving || "" === name.trim(),
|
|
@@ -4720,36 +4908,34 @@ function ViewsMenu({ views, api, canIncludeFilters, canDelete }) {
|
|
|
4720
4908
|
size: "sm",
|
|
4721
4909
|
variant: "ghost",
|
|
4722
4910
|
children: [
|
|
4723
|
-
api.activeName ?? "
|
|
4911
|
+
api.activeName ?? t("ox0.dataGrid.views.label"),
|
|
4724
4912
|
api.isModified && /*#__PURE__*/ jsx("span", {
|
|
4725
4913
|
className: views_menu_module.modified,
|
|
4726
|
-
children: "
|
|
4914
|
+
children: t("ox0.dataGrid.views.modified")
|
|
4727
4915
|
})
|
|
4728
4916
|
]
|
|
4729
4917
|
})
|
|
4730
4918
|
}),
|
|
4731
4919
|
/*#__PURE__*/ jsx(PopoverContent, {
|
|
4732
4920
|
className: views_menu_module.panel,
|
|
4733
|
-
children: "save-as" === mode.kind ? nameForm("
|
|
4921
|
+
children: "save-as" === mode.kind ? nameForm(t("ox0.dataGrid.views.saveView")) : /*#__PURE__*/ jsxs("div", {
|
|
4734
4922
|
className: views_menu_module.menu,
|
|
4735
4923
|
children: [
|
|
4736
4924
|
0 === views.length ? /*#__PURE__*/ jsx("p", {
|
|
4737
4925
|
className: views_menu_module.empty,
|
|
4738
|
-
children: "
|
|
4926
|
+
children: t("ox0.dataGrid.views.none")
|
|
4739
4927
|
}) : /*#__PURE__*/ jsx("ul", {
|
|
4740
|
-
"aria-label": "
|
|
4928
|
+
"aria-label": t("ox0.dataGrid.views.list"),
|
|
4741
4929
|
className: views_menu_module.list,
|
|
4742
4930
|
children: views.map((view)=>/*#__PURE__*/ jsx("li", {
|
|
4743
4931
|
className: views_menu_module.item,
|
|
4744
|
-
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", {
|
|
4745
4933
|
className: views_menu_module.confirm,
|
|
4746
4934
|
children: [
|
|
4747
|
-
/*#__PURE__*/
|
|
4748
|
-
children:
|
|
4749
|
-
|
|
4750
|
-
|
|
4751
|
-
"”?"
|
|
4752
|
-
]
|
|
4935
|
+
/*#__PURE__*/ jsx("span", {
|
|
4936
|
+
children: t("ox0.dataGrid.views.deleteConfirm", {
|
|
4937
|
+
name: view.name
|
|
4938
|
+
})
|
|
4753
4939
|
}),
|
|
4754
4940
|
/*#__PURE__*/ jsxs("div", {
|
|
4755
4941
|
className: views_menu_module.actions,
|
|
@@ -4759,14 +4945,14 @@ function ViewsMenu({ views, api, canIncludeFilters, canDelete }) {
|
|
|
4759
4945
|
onPress: ()=>setMode(LIST),
|
|
4760
4946
|
size: "sm",
|
|
4761
4947
|
variant: "ghost",
|
|
4762
|
-
children: "
|
|
4948
|
+
children: t("ox0.dataGrid.views.cancel")
|
|
4763
4949
|
}),
|
|
4764
4950
|
/*#__PURE__*/ jsx(Button, {
|
|
4765
4951
|
isDisabled: isSaving,
|
|
4766
4952
|
onPress: ()=>void run(()=>api.remove(view.id), false),
|
|
4767
4953
|
size: "sm",
|
|
4768
4954
|
variant: "danger",
|
|
4769
|
-
children: "
|
|
4955
|
+
children: t("ox0.dataGrid.views.delete")
|
|
4770
4956
|
})
|
|
4771
4957
|
]
|
|
4772
4958
|
})
|
|
@@ -4785,7 +4971,9 @@ function ViewsMenu({ views, api, canIncludeFilters, canDelete }) {
|
|
|
4785
4971
|
/*#__PURE__*/ jsx(IconButton, {
|
|
4786
4972
|
icon: PencilIcon,
|
|
4787
4973
|
isDisabled: isBusy,
|
|
4788
|
-
label:
|
|
4974
|
+
label: t("ox0.dataGrid.views.renameView", {
|
|
4975
|
+
name: view.name
|
|
4976
|
+
}),
|
|
4789
4977
|
onPress: ()=>startNaming({
|
|
4790
4978
|
kind: "rename",
|
|
4791
4979
|
viewId: view.id
|
|
@@ -4796,7 +4984,9 @@ function ViewsMenu({ views, api, canIncludeFilters, canDelete }) {
|
|
|
4796
4984
|
canDelete && /*#__PURE__*/ jsx(IconButton, {
|
|
4797
4985
|
icon: TrashIcon,
|
|
4798
4986
|
isDisabled: isBusy,
|
|
4799
|
-
label:
|
|
4987
|
+
label: t("ox0.dataGrid.views.deleteView", {
|
|
4988
|
+
name: view.name
|
|
4989
|
+
}),
|
|
4800
4990
|
onPress: ()=>setMode({
|
|
4801
4991
|
kind: "delete",
|
|
4802
4992
|
viewId: view.id
|
|
@@ -4814,14 +5004,16 @@ function ViewsMenu({ views, api, canIncludeFilters, canDelete }) {
|
|
|
4814
5004
|
api.isModified && void 0 !== api.activeName && /*#__PURE__*/ jsx(MenuButton, {
|
|
4815
5005
|
isDisabled: isBusy,
|
|
4816
5006
|
onPress: ()=>void run(api.save, true),
|
|
4817
|
-
children:
|
|
5007
|
+
children: t("ox0.dataGrid.views.save", {
|
|
5008
|
+
name: api.activeName
|
|
5009
|
+
})
|
|
4818
5010
|
}),
|
|
4819
5011
|
/*#__PURE__*/ jsx(MenuButton, {
|
|
4820
5012
|
isDisabled: isBusy,
|
|
4821
5013
|
onPress: ()=>startNaming({
|
|
4822
5014
|
kind: "save-as"
|
|
4823
5015
|
}, ""),
|
|
4824
|
-
children: "
|
|
5016
|
+
children: t("ox0.dataGrid.views.saveAs")
|
|
4825
5017
|
}),
|
|
4826
5018
|
/*#__PURE__*/ jsx(MenuButton, {
|
|
4827
5019
|
isDisabled: isSaving,
|
|
@@ -4829,7 +5021,7 @@ function ViewsMenu({ views, api, canIncludeFilters, canDelete }) {
|
|
|
4829
5021
|
api.resetToDefault();
|
|
4830
5022
|
openChange(false);
|
|
4831
5023
|
},
|
|
4832
|
-
children: "
|
|
5024
|
+
children: t("ox0.dataGrid.views.reset")
|
|
4833
5025
|
})
|
|
4834
5026
|
]
|
|
4835
5027
|
})
|
|
@@ -4841,7 +5033,7 @@ function ViewsMenu({ views, api, canIncludeFilters, canDelete }) {
|
|
|
4841
5033
|
api.error && /*#__PURE__*/ jsx("span", {
|
|
4842
5034
|
className: views_menu_module.error,
|
|
4843
5035
|
role: "alert",
|
|
4844
|
-
children: api.error
|
|
5036
|
+
children: t(ERROR_MESSAGE[api.error])
|
|
4845
5037
|
})
|
|
4846
5038
|
]
|
|
4847
5039
|
});
|
|
@@ -5103,9 +5295,6 @@ function aboveGroupLabel(style) {
|
|
|
5103
5295
|
zIndex: 3
|
|
5104
5296
|
} : style;
|
|
5105
5297
|
}
|
|
5106
|
-
function rowsWord(count) {
|
|
5107
|
-
return 1 === count ? "row" : "rows";
|
|
5108
|
-
}
|
|
5109
5298
|
function entryKey(entry) {
|
|
5110
5299
|
return "row" === entry.kind ? entry.data.__rowId : `group:${entry.groupKey}`;
|
|
5111
5300
|
}
|
|
@@ -5126,9 +5315,15 @@ function renderAggregateValue(column, values, fractionDigits = 0) {
|
|
|
5126
5315
|
children: alignDecimal(text, fractionDigits, statDecimalSeparator)
|
|
5127
5316
|
});
|
|
5128
5317
|
}
|
|
5129
|
-
function
|
|
5130
|
-
|
|
5131
|
-
|
|
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);
|
|
5132
5327
|
return String(value);
|
|
5133
5328
|
}
|
|
5134
5329
|
function fontOf(style) {
|
|
@@ -5244,8 +5439,8 @@ function rawCellValue(column, row) {
|
|
|
5244
5439
|
if (isKeyColumnDef(column)) return Reflect.get(row, column.accessorKey);
|
|
5245
5440
|
if (DataCell_isDerivedColumnDef(column)) return Reflect.get(row, `__derived_${column.id}`);
|
|
5246
5441
|
}
|
|
5247
|
-
function valueLabel(value) {
|
|
5248
|
-
return null === value ? "
|
|
5442
|
+
function valueLabel(value, t) {
|
|
5443
|
+
return null === value ? t("ox0.dataGrid.cellActions.emptyValue") : String(value);
|
|
5249
5444
|
}
|
|
5250
5445
|
const INTERACTIVE = 'button, a, input, select, textarea, label, [role="checkbox"], [data-row-control]';
|
|
5251
5446
|
function MoreIcon() {
|
|
@@ -5276,6 +5471,7 @@ function MoreIcon() {
|
|
|
5276
5471
|
}
|
|
5277
5472
|
function DataGrid(props) {
|
|
5278
5473
|
const { columnDefs, getRowId, timeZone, height, filter, select, rowDetail } = props;
|
|
5474
|
+
const { t, rich, number } = useDataGridMessages();
|
|
5279
5475
|
const isServer = "server" === props.source;
|
|
5280
5476
|
const rows = "client" === props.source ? props.rows : NO_ROWS;
|
|
5281
5477
|
const rowsVersion = "client" === props.source ? props.rowsVersion : void 0;
|
|
@@ -5890,52 +6086,28 @@ function DataGrid(props) {
|
|
|
5890
6086
|
if (isLoading) return null;
|
|
5891
6087
|
if (isServer) {
|
|
5892
6088
|
const serverTotal = serverStatus?.totalCount ?? -1;
|
|
5893
|
-
if (serverTotal >= 0) return
|
|
5894
|
-
|
|
5895
|
-
/*#__PURE__*/ jsx("strong", {
|
|
5896
|
-
children: formatCount(serverTotal)
|
|
5897
|
-
}),
|
|
5898
|
-
" ",
|
|
5899
|
-
rowsWord(serverTotal)
|
|
5900
|
-
]
|
|
6089
|
+
if (serverTotal >= 0) return rich("ox0.dataGrid.status.rows", {
|
|
6090
|
+
count: serverTotal
|
|
5901
6091
|
});
|
|
5902
|
-
return
|
|
5903
|
-
|
|
5904
|
-
/*#__PURE__*/ jsx("strong", {
|
|
5905
|
-
children: formatCount(rowCount)
|
|
5906
|
-
}),
|
|
5907
|
-
" ",
|
|
5908
|
-
rowsWord(rowCount),
|
|
5909
|
-
serverStatus?.hasMore ? " loaded" : ""
|
|
5910
|
-
]
|
|
6092
|
+
return rich(serverStatus?.hasMore ? "ox0.dataGrid.status.rowsLoaded" : "ox0.dataGrid.status.rows", {
|
|
6093
|
+
count: rowCount
|
|
5911
6094
|
});
|
|
5912
6095
|
}
|
|
5913
|
-
if (isFiltered) return
|
|
5914
|
-
|
|
5915
|
-
|
|
5916
|
-
children: formatCount(rowCount)
|
|
5917
|
-
}),
|
|
5918
|
-
" of ",
|
|
5919
|
-
formatCount(rows.length),
|
|
5920
|
-
" ",
|
|
5921
|
-
rowsWord(rows.length)
|
|
5922
|
-
]
|
|
6096
|
+
if (isFiltered) return rich("ox0.dataGrid.status.filteredRows", {
|
|
6097
|
+
count: rowCount,
|
|
6098
|
+
total: rows.length
|
|
5923
6099
|
});
|
|
5924
|
-
return
|
|
5925
|
-
|
|
5926
|
-
/*#__PURE__*/ jsx("strong", {
|
|
5927
|
-
children: formatCount(rowCount)
|
|
5928
|
-
}),
|
|
5929
|
-
" ",
|
|
5930
|
-
rowsWord(rowCount)
|
|
5931
|
-
]
|
|
6100
|
+
return rich("ox0.dataGrid.status.rows", {
|
|
6101
|
+
count: rowCount
|
|
5932
6102
|
});
|
|
5933
6103
|
})();
|
|
5934
6104
|
function renderLoadStatus() {
|
|
5935
6105
|
if (serverStatus?.phase === "error") return null;
|
|
5936
6106
|
const progress = isServer ? void 0 === serverStatus || "initial" === serverStatus.phase || "append" === serverStatus.phase ? void 0 : 1 : true === props.isLoading ? void 0 : grid.loadProgress;
|
|
5937
6107
|
const isDone = 1 === progress;
|
|
5938
|
-
const label = isDone ? "
|
|
6108
|
+
const label = isDone ? t("ox0.dataGrid.status.loaded") : void 0 === progress ? t("ox0.dataGrid.status.loading") : t("ox0.dataGrid.status.loadingProgress", {
|
|
6109
|
+
progress
|
|
6110
|
+
});
|
|
5939
6111
|
return /*#__PURE__*/ jsx("span", {
|
|
5940
6112
|
className: data_grid_module.loadStatus,
|
|
5941
6113
|
"data-done": isDone || void 0,
|
|
@@ -6000,27 +6172,29 @@ function DataGrid(props) {
|
|
|
6000
6172
|
} catch (error) {
|
|
6001
6173
|
if (!controller.signal.aborted) {
|
|
6002
6174
|
if (toast) toast.addToast({
|
|
6003
|
-
message: "
|
|
6175
|
+
message: t("ox0.dataGrid.export.failed"),
|
|
6004
6176
|
tone: "danger"
|
|
6005
6177
|
});
|
|
6006
|
-
else setExportError("
|
|
6178
|
+
else setExportError(t("ox0.dataGrid.export.failed"));
|
|
6007
6179
|
if ("production" !== process.env.NODE_ENV) console.error("[@ox0/data-grid] export failed", error);
|
|
6008
6180
|
}
|
|
6009
6181
|
} finally{
|
|
6010
6182
|
release();
|
|
6011
6183
|
}
|
|
6012
6184
|
}
|
|
6013
|
-
const selectionAnnouncement = multiSelect ? hasSelection ? isAllSelected ? "
|
|
6185
|
+
const selectionAnnouncement = multiSelect ? hasSelection ? isAllSelected ? t("ox0.dataGrid.selection.all") : null === selectedCount ? t("ox0.dataGrid.selection.allMatching") : t("ox0.dataGrid.selection.count", {
|
|
6186
|
+
count: selectedCount
|
|
6187
|
+
}) : t("ox0.dataGrid.selection.none") : "";
|
|
6014
6188
|
const announced = useDebouncedValue(selectionAnnouncement, SELECTION_ANNOUNCE_MS);
|
|
6015
6189
|
function renderSelectAllCell(style, colIndex) {
|
|
6016
6190
|
return /*#__PURE__*/ jsx("div", {
|
|
6017
6191
|
"aria-colindex": colIndex,
|
|
6018
|
-
"aria-label": "
|
|
6192
|
+
"aria-label": t("ox0.dataGrid.select.column"),
|
|
6019
6193
|
className: data_grid_module.selectCell,
|
|
6020
6194
|
role: "columnheader",
|
|
6021
6195
|
style: style,
|
|
6022
6196
|
children: /*#__PURE__*/ jsx(Checkbox, {
|
|
6023
|
-
"aria-label": hasSelection ? "
|
|
6197
|
+
"aria-label": t(hasSelection ? "ox0.dataGrid.selection.clear" : "ox0.dataGrid.select.all"),
|
|
6024
6198
|
isDisabled: isSelectingAll || 0 === totalCount,
|
|
6025
6199
|
isIndeterminate: hasSelection && !isAllSelected,
|
|
6026
6200
|
isSelected: isAllSelected,
|
|
@@ -6036,7 +6210,9 @@ function DataGrid(props) {
|
|
|
6036
6210
|
role: "gridcell",
|
|
6037
6211
|
style: style,
|
|
6038
6212
|
children: /*#__PURE__*/ jsx(Checkbox, {
|
|
6039
|
-
"aria-label":
|
|
6213
|
+
"aria-label": t("ox0.dataGrid.select.group", {
|
|
6214
|
+
group: label
|
|
6215
|
+
}),
|
|
6040
6216
|
isDisabled: void 0 === check || 0 === check.total,
|
|
6041
6217
|
isIndeterminate: void 0 !== check && check.checked > 0 && check.checked < check.total,
|
|
6042
6218
|
isSelected: void 0 !== check && check.total > 0 && check.checked === check.total,
|
|
@@ -6060,7 +6236,9 @@ function DataGrid(props) {
|
|
|
6060
6236
|
role: "gridcell",
|
|
6061
6237
|
style: style,
|
|
6062
6238
|
children: /*#__PURE__*/ jsx(Checkbox, {
|
|
6063
|
-
"aria-label":
|
|
6239
|
+
"aria-label": t("ox0.dataGrid.select.row", {
|
|
6240
|
+
row: label
|
|
6241
|
+
}),
|
|
6064
6242
|
isDisabled: !canSelect(row),
|
|
6065
6243
|
isSelected: isRowChecked(rowId),
|
|
6066
6244
|
onChange: ()=>toggleRow(rowId, index, false)
|
|
@@ -6206,6 +6384,7 @@ function DataGrid(props) {
|
|
|
6206
6384
|
return {
|
|
6207
6385
|
column,
|
|
6208
6386
|
type,
|
|
6387
|
+
row: rowElement,
|
|
6209
6388
|
isList: Array.isArray(raw),
|
|
6210
6389
|
values: cellFilterValues(raw, type, timeZone),
|
|
6211
6390
|
text: cell.innerText.trim()
|
|
@@ -6226,10 +6405,16 @@ function DataGrid(props) {
|
|
|
6226
6405
|
}), {
|
|
6227
6406
|
apply
|
|
6228
6407
|
});
|
|
6229
|
-
const
|
|
6230
|
-
const
|
|
6231
|
-
|
|
6232
|
-
|
|
6408
|
+
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";
|
|
6409
|
+
const change = t(done, {
|
|
6410
|
+
column: column.header,
|
|
6411
|
+
value: valueLabel(value, t)
|
|
6412
|
+
});
|
|
6413
|
+
const shortcut = t(isMac ? "ox0.dataGrid.cellActions.applyShortcutMac" : "ox0.dataGrid.cellActions.applyShortcut");
|
|
6414
|
+
setFilterAnnouncement(apply ? change : t("ox0.dataGrid.cellActions.pending", {
|
|
6415
|
+
change,
|
|
6416
|
+
shortcut
|
|
6417
|
+
}));
|
|
6233
6418
|
}
|
|
6234
6419
|
function cellActionSections(cell, row) {
|
|
6235
6420
|
const cells = row ? [
|
|
@@ -6251,14 +6436,14 @@ function DataGrid(props) {
|
|
|
6251
6436
|
const actions = null === value ? [
|
|
6252
6437
|
{
|
|
6253
6438
|
id: "include",
|
|
6254
|
-
label: "
|
|
6439
|
+
label: t("ox0.dataGrid.cellActions.filterToEmpty"),
|
|
6255
6440
|
run: {
|
|
6256
6441
|
action: "include"
|
|
6257
6442
|
}
|
|
6258
6443
|
},
|
|
6259
6444
|
{
|
|
6260
6445
|
id: "exclude",
|
|
6261
|
-
label: "
|
|
6446
|
+
label: t("ox0.dataGrid.cellActions.excludeEmpty"),
|
|
6262
6447
|
run: {
|
|
6263
6448
|
action: "exclude"
|
|
6264
6449
|
}
|
|
@@ -6266,7 +6451,7 @@ function DataGrid(props) {
|
|
|
6266
6451
|
...hasColumnFilter ? [
|
|
6267
6452
|
{
|
|
6268
6453
|
id: "clear",
|
|
6269
|
-
label: "
|
|
6454
|
+
label: t("ox0.dataGrid.cellActions.clearColumnFilter"),
|
|
6270
6455
|
run: {
|
|
6271
6456
|
action: "clear"
|
|
6272
6457
|
}
|
|
@@ -6282,10 +6467,13 @@ function DataGrid(props) {
|
|
|
6282
6467
|
isMac,
|
|
6283
6468
|
hasColumnFilter,
|
|
6284
6469
|
canCopy: "" !== text
|
|
6285
|
-
});
|
|
6470
|
+
}, t);
|
|
6286
6471
|
sections.push({
|
|
6287
6472
|
key: `${target.column.id}:${key}`,
|
|
6288
|
-
label:
|
|
6473
|
+
label: t("ox0.dataGrid.cellActions.section", {
|
|
6474
|
+
column: target.column.header,
|
|
6475
|
+
value: null === value ? t("ox0.dataGrid.cellActions.emptySection") : String(value)
|
|
6476
|
+
}),
|
|
6289
6477
|
columnId: target.column.id,
|
|
6290
6478
|
value,
|
|
6291
6479
|
text,
|
|
@@ -6304,9 +6492,12 @@ function DataGrid(props) {
|
|
|
6304
6492
|
}
|
|
6305
6493
|
function cellActionsLabel(cell) {
|
|
6306
6494
|
const target = cellTarget(cell);
|
|
6307
|
-
if (!target) return "
|
|
6308
|
-
const value = target.isList ? target.values.map(valueLabel).join(", ") : valueLabel(target.values[0] ?? null);
|
|
6309
|
-
return
|
|
6495
|
+
if (!target) return t("ox0.dataGrid.cellActions.label");
|
|
6496
|
+
const value = target.isList ? target.values.map((item)=>valueLabel(item, t)).join(", ") : valueLabel(target.values[0] ?? null, t);
|
|
6497
|
+
return t("ox0.dataGrid.cellActions.labelFor", {
|
|
6498
|
+
column: target.column.header,
|
|
6499
|
+
value
|
|
6500
|
+
});
|
|
6310
6501
|
}
|
|
6311
6502
|
function modifiedCellClick(event) {
|
|
6312
6503
|
if (!cellActionsOn) return null;
|
|
@@ -6329,6 +6520,14 @@ function DataGrid(props) {
|
|
|
6329
6520
|
event.stopPropagation();
|
|
6330
6521
|
const [value = null] = click.hit.values;
|
|
6331
6522
|
runFilterAction(click.hit.column, value, click.action, event.shiftKey);
|
|
6523
|
+
const row = click.hit.row;
|
|
6524
|
+
if (row?.hasAttribute("tabindex")) {
|
|
6525
|
+
if (multiSelect || isFocusOnly) setMultiFocusIndex(Number(row.dataset.rowIndex));
|
|
6526
|
+
focusWith(row, {
|
|
6527
|
+
focusVisible: false,
|
|
6528
|
+
preventScroll: true
|
|
6529
|
+
});
|
|
6530
|
+
}
|
|
6332
6531
|
}
|
|
6333
6532
|
function handleCellMouseDownCapture(event) {
|
|
6334
6533
|
if (modifiedCellClick(event)) event.preventDefault();
|
|
@@ -6476,7 +6675,15 @@ function DataGrid(props) {
|
|
|
6476
6675
|
}
|
|
6477
6676
|
}
|
|
6478
6677
|
function handleGridKeyDown(event) {
|
|
6678
|
+
if (event.target instanceof Node && !event.currentTarget.contains(event.target)) return;
|
|
6479
6679
|
const isModified = event.ctrlKey || event.metaKey;
|
|
6680
|
+
if (cellActionsOn && isModified && "Enter" === event.key && null !== pendingTokens) {
|
|
6681
|
+
event.preventDefault();
|
|
6682
|
+
queryBarApiRef.current?.edit((pending)=>pending, {
|
|
6683
|
+
apply: true
|
|
6684
|
+
});
|
|
6685
|
+
return;
|
|
6686
|
+
}
|
|
6480
6687
|
if (cellActionsOn && "F10" === event.key && event.shiftKey) {
|
|
6481
6688
|
const target = event.target;
|
|
6482
6689
|
if (target instanceof HTMLElement && target.matches('[role="row"][data-row-index]')) {
|
|
@@ -6490,7 +6697,7 @@ function DataGrid(props) {
|
|
|
6490
6697
|
return;
|
|
6491
6698
|
}
|
|
6492
6699
|
if (isModified && ("f" === event.key || "F" === event.key)) {
|
|
6493
|
-
const input = simpleFilter ? searchInputRef.current : toolbarRef.current?.querySelector('input[
|
|
6700
|
+
const input = simpleFilter ? searchInputRef.current : toolbarRef.current?.querySelector('input[role="combobox"]');
|
|
6494
6701
|
if (!input) return;
|
|
6495
6702
|
event.preventDefault();
|
|
6496
6703
|
input.focus();
|
|
@@ -6547,6 +6754,12 @@ function DataGrid(props) {
|
|
|
6547
6754
|
setOpenRowId(selectedRowId);
|
|
6548
6755
|
return;
|
|
6549
6756
|
}
|
|
6757
|
+
const focusedRow = event.target instanceof HTMLElement && event.target.matches('[role="row"][data-row-index]') ? Number(event.target.dataset.rowIndex) : -1;
|
|
6758
|
+
if (-1 === selectedIndexRef.current && focusedRow > 0 && ("ArrowDown" === event.key || "ArrowUp" === event.key)) {
|
|
6759
|
+
event.preventDefault();
|
|
6760
|
+
focusRowAt(focusedRow);
|
|
6761
|
+
return;
|
|
6762
|
+
}
|
|
6550
6763
|
const currentIndex = selectedIndexRef.current;
|
|
6551
6764
|
const to = navigationTarget(event, -1 === currentIndex ? -1 : currentIndex);
|
|
6552
6765
|
if (null === to) return;
|
|
@@ -6618,7 +6831,9 @@ function DataGrid(props) {
|
|
|
6618
6831
|
role: "gridcell",
|
|
6619
6832
|
style: style,
|
|
6620
6833
|
children: /*#__PURE__*/ jsx("button", {
|
|
6621
|
-
"aria-label":
|
|
6834
|
+
"aria-label": t("ox0.dataGrid.moveRow", {
|
|
6835
|
+
row: label
|
|
6836
|
+
}),
|
|
6622
6837
|
className: data_grid_module.grabHandle,
|
|
6623
6838
|
onClick: (event)=>event.stopPropagation(),
|
|
6624
6839
|
onKeyDown: (event)=>{
|
|
@@ -6693,7 +6908,10 @@ function DataGrid(props) {
|
|
|
6693
6908
|
const columnId = groupColumnIds[header.level - 1];
|
|
6694
6909
|
const column = void 0 === columnId ? void 0 : defsById.get(columnId);
|
|
6695
6910
|
const value = void 0 === columnId ? null : header.groupValues[columnId];
|
|
6696
|
-
const label =
|
|
6911
|
+
const label = t("ox0.dataGrid.group.label", {
|
|
6912
|
+
column: column?.header ?? columnId ?? "",
|
|
6913
|
+
value: groupValueLabel(value, t, number)
|
|
6914
|
+
});
|
|
6697
6915
|
const isFocusable = void 0 !== multiSelect || isFocusOnly;
|
|
6698
6916
|
return /*#__PURE__*/ jsx("div", {
|
|
6699
6917
|
"aria-expanded": header.isExpanded,
|
|
@@ -6724,7 +6942,10 @@ function DataGrid(props) {
|
|
|
6724
6942
|
},
|
|
6725
6943
|
children: /*#__PURE__*/ jsxs("button", {
|
|
6726
6944
|
"aria-expanded": header.isExpanded,
|
|
6727
|
-
"aria-label":
|
|
6945
|
+
"aria-label": t("ox0.dataGrid.group.toggle", {
|
|
6946
|
+
group: label,
|
|
6947
|
+
count: header.rowCount
|
|
6948
|
+
}),
|
|
6728
6949
|
className: data_grid_module.groupToggle,
|
|
6729
6950
|
onClick: ()=>toggleGroup(header.groupKey, !header.isExpanded),
|
|
6730
6951
|
tabIndex: isFocusable ? -1 : void 0,
|
|
@@ -6742,7 +6963,7 @@ function DataGrid(props) {
|
|
|
6742
6963
|
}),
|
|
6743
6964
|
/*#__PURE__*/ jsx("span", {
|
|
6744
6965
|
className: data_grid_module.groupCount,
|
|
6745
|
-
children:
|
|
6966
|
+
children: number(header.rowCount)
|
|
6746
6967
|
})
|
|
6747
6968
|
]
|
|
6748
6969
|
})
|
|
@@ -6781,15 +7002,10 @@ function DataGrid(props) {
|
|
|
6781
7002
|
"data-align": values && "end" === columnAlign(col.def) ? "end" : void 0,
|
|
6782
7003
|
role: "rowheader",
|
|
6783
7004
|
style: style,
|
|
6784
|
-
children: values ?
|
|
6785
|
-
|
|
6786
|
-
|
|
6787
|
-
|
|
6788
|
-
children: "Total: "
|
|
6789
|
-
}),
|
|
6790
|
-
renderAggregateValue(col.def, values, digitsFor(col.def.id))
|
|
6791
|
-
]
|
|
6792
|
-
}) : "Total"
|
|
7005
|
+
children: values ? rich("ox0.dataGrid.totalValue", {
|
|
7006
|
+
hidden: visuallyHidden,
|
|
7007
|
+
value: renderAggregateValue(col.def, values, digitsFor(col.def.id))
|
|
7008
|
+
}) : t("ox0.dataGrid.total")
|
|
6793
7009
|
}, col.def.id);
|
|
6794
7010
|
return /*#__PURE__*/ jsx("div", {
|
|
6795
7011
|
"aria-colindex": colIndex + 1,
|
|
@@ -6897,7 +7113,7 @@ function DataGrid(props) {
|
|
|
6897
7113
|
onPendingChange: cellActionsOn ? setPendingTokens : void 0,
|
|
6898
7114
|
flex: 1,
|
|
6899
7115
|
minWidth: 200,
|
|
6900
|
-
label: "
|
|
7116
|
+
label: t("ox0.dataGrid.filter"),
|
|
6901
7117
|
now: structuredFilter.now,
|
|
6902
7118
|
onChange: setStructuredTokens,
|
|
6903
7119
|
schema: querySchema,
|
|
@@ -6905,10 +7121,10 @@ function DataGrid(props) {
|
|
|
6905
7121
|
value: structuredTokens
|
|
6906
7122
|
}),
|
|
6907
7123
|
simpleFilter && /*#__PURE__*/ jsx("input", {
|
|
6908
|
-
"aria-label": "
|
|
7124
|
+
"aria-label": t("ox0.dataGrid.search"),
|
|
6909
7125
|
className: data_grid_module.searchInput,
|
|
6910
7126
|
onChange: (event)=>handleQueryInput(event.target.value),
|
|
6911
|
-
placeholder: "
|
|
7127
|
+
placeholder: t("ox0.dataGrid.searchPlaceholder"),
|
|
6912
7128
|
ref: searchInputRef,
|
|
6913
7129
|
type: "search",
|
|
6914
7130
|
value: inputValue
|
|
@@ -6925,7 +7141,7 @@ function DataGrid(props) {
|
|
|
6925
7141
|
/*#__PURE__*/ jsx(PopoverTrigger, {
|
|
6926
7142
|
children: /*#__PURE__*/ jsx(IconButton, {
|
|
6927
7143
|
icon: MoreIcon,
|
|
6928
|
-
label: "
|
|
7144
|
+
label: t("ox0.dataGrid.columns"),
|
|
6929
7145
|
size: "sm",
|
|
6930
7146
|
variant: "ghost"
|
|
6931
7147
|
})
|
|
@@ -6974,19 +7190,14 @@ function DataGrid(props) {
|
|
|
6974
7190
|
}),
|
|
6975
7191
|
multiSelect && /*#__PURE__*/ jsxs("section", {
|
|
6976
7192
|
"aria-hidden": !isSelecting || void 0,
|
|
6977
|
-
"aria-label": "
|
|
7193
|
+
"aria-label": t("ox0.dataGrid.selection.region"),
|
|
6978
7194
|
className: data_grid_module.selection,
|
|
6979
7195
|
"data-shown": isSelecting || void 0,
|
|
6980
7196
|
inert: !isSelecting,
|
|
6981
7197
|
children: [
|
|
6982
7198
|
/*#__PURE__*/ jsx("span", {
|
|
6983
|
-
children: null === selectionLabelCount ? "
|
|
6984
|
-
|
|
6985
|
-
/*#__PURE__*/ jsx("strong", {
|
|
6986
|
-
children: formatCount(selectionLabelCount)
|
|
6987
|
-
}),
|
|
6988
|
-
" selected"
|
|
6989
|
-
]
|
|
7199
|
+
children: null === selectionLabelCount ? t("ox0.dataGrid.selection.allMatching") : rich("ox0.dataGrid.selection.selected", {
|
|
7200
|
+
count: selectionLabelCount
|
|
6990
7201
|
})
|
|
6991
7202
|
}),
|
|
6992
7203
|
(multiSelect.bulkActions ?? []).length > 0 && /*#__PURE__*/ jsx("span", {
|
|
@@ -7015,7 +7226,7 @@ function DataGrid(props) {
|
|
|
7015
7226
|
}),
|
|
7016
7227
|
/*#__PURE__*/ jsx(IconButton, {
|
|
7017
7228
|
icon: CloseIcon,
|
|
7018
|
-
label: "
|
|
7229
|
+
label: t("ox0.dataGrid.selection.clear"),
|
|
7019
7230
|
onPress: clearSelection,
|
|
7020
7231
|
size: "xs",
|
|
7021
7232
|
variant: "ghost"
|
|
@@ -7174,7 +7385,7 @@ function DataGrid(props) {
|
|
|
7174
7385
|
},
|
|
7175
7386
|
children: renderPlannedColumns(renderHeaderCell, (kind, style, colIndex)=>"grab" === kind ? /*#__PURE__*/ jsx("div", {
|
|
7176
7387
|
"aria-colindex": colIndex,
|
|
7177
|
-
"aria-label": "
|
|
7388
|
+
"aria-label": t("ox0.dataGrid.rowOrder"),
|
|
7178
7389
|
className: data_grid_module.headerCell,
|
|
7179
7390
|
role: "columnheader",
|
|
7180
7391
|
style: style
|
|
@@ -7186,13 +7397,13 @@ function DataGrid(props) {
|
|
|
7186
7397
|
className: data_grid_module.emptyCell,
|
|
7187
7398
|
role: "alert",
|
|
7188
7399
|
children: [
|
|
7189
|
-
"
|
|
7400
|
+
t("ox0.dataGrid.loadFailed"),
|
|
7190
7401
|
" ",
|
|
7191
7402
|
/*#__PURE__*/ jsx(Button, {
|
|
7192
7403
|
onPress: serverError.retry,
|
|
7193
7404
|
size: "sm",
|
|
7194
7405
|
variant: "ghost",
|
|
7195
|
-
children: "
|
|
7406
|
+
children: t("ox0.dataGrid.retry")
|
|
7196
7407
|
})
|
|
7197
7408
|
]
|
|
7198
7409
|
}) : isLoading ? props.renderLoadingState ? props.renderLoadingState({
|
|
@@ -7210,10 +7421,10 @@ function DataGrid(props) {
|
|
|
7210
7421
|
}))
|
|
7211
7422
|
}) : 0 === totalCount ? (isServer ? isFiltered : 0 !== rows.length) ? props.renderNoResultsState?.() ?? /*#__PURE__*/ jsx("div", {
|
|
7212
7423
|
className: data_grid_module.emptyCell,
|
|
7213
|
-
children: "
|
|
7424
|
+
children: t("ox0.dataGrid.noResults")
|
|
7214
7425
|
}) : props.renderEmptyState?.() ?? /*#__PURE__*/ jsx("div", {
|
|
7215
7426
|
className: data_grid_module.emptyCell,
|
|
7216
|
-
children: "
|
|
7427
|
+
children: t("ox0.dataGrid.empty")
|
|
7217
7428
|
}) : /*#__PURE__*/ jsx(VirtualScroller, {
|
|
7218
7429
|
apiRef: scrollerApiRef,
|
|
7219
7430
|
className: data_grid_module.scroller,
|
|
@@ -7241,19 +7452,19 @@ function DataGrid(props) {
|
|
|
7241
7452
|
phase: "append"
|
|
7242
7453
|
}) : /*#__PURE__*/ jsx("output", {
|
|
7243
7454
|
className: data_grid_module.appendRow,
|
|
7244
|
-
children: "
|
|
7455
|
+
children: t("ox0.dataGrid.loadingMore")
|
|
7245
7456
|
})),
|
|
7246
7457
|
serverError && totalCount > 0 && /*#__PURE__*/ jsxs("div", {
|
|
7247
7458
|
className: data_grid_module.appendRow,
|
|
7248
7459
|
role: "alert",
|
|
7249
7460
|
children: [
|
|
7250
|
-
"
|
|
7461
|
+
t("ox0.dataGrid.loadMoreFailed"),
|
|
7251
7462
|
" ",
|
|
7252
7463
|
/*#__PURE__*/ jsx(Button, {
|
|
7253
7464
|
onPress: serverError.retry,
|
|
7254
7465
|
size: "sm",
|
|
7255
7466
|
variant: "ghost",
|
|
7256
|
-
children: "
|
|
7467
|
+
children: t("ox0.dataGrid.retry")
|
|
7257
7468
|
})
|
|
7258
7469
|
]
|
|
7259
7470
|
}),
|
|
@@ -7273,7 +7484,7 @@ function DataGrid(props) {
|
|
|
7273
7484
|
children: [
|
|
7274
7485
|
/*#__PURE__*/ jsx(Drawer.Header, {
|
|
7275
7486
|
children: /*#__PURE__*/ jsx(Drawer.Title, {
|
|
7276
|
-
children: "
|
|
7487
|
+
children: t("ox0.dataGrid.details")
|
|
7277
7488
|
})
|
|
7278
7489
|
}),
|
|
7279
7490
|
/*#__PURE__*/ jsx(Drawer.Body, {
|
|
@@ -7317,4 +7528,4 @@ function deserializeSelection(data) {
|
|
|
7317
7528
|
excluded: new Set(data.excluded)
|
|
7318
7529
|
};
|
|
7319
7530
|
}
|
|
7320
|
-
export { DataGrid, deserializeSelection, querySchemaFromColumns, serializeSelection };
|
|
7531
|
+
export { DataGrid, defaultDataGridMessages, deserializeSelection, querySchemaFromColumns, serializeSelection };
|