@react-fabric/data 1.0.0-beta.30 → 1.0.0-beta.32
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/cjs/json/JsonViewer.js +40 -27
- package/dist/cjs/virtual/Gallery.js +2 -2
- package/dist/cjs/virtual/List.js +2 -2
- package/dist/esm/json/JsonViewer.js +41 -28
- package/dist/esm/virtual/Gallery.js +2 -2
- package/dist/esm/virtual/List.js +2 -2
- package/dist/types/virtual/Gallery.d.ts +1 -1
- package/package.json +6 -6
- package/src/json/JsonViewer.tsx +45 -35
- package/src/virtual/Gallery.tsx +3 -3
- package/src/virtual/List.tsx +2 -2
|
@@ -99,6 +99,11 @@ var JsonEntry = function JsonEntry(_ref3) {
|
|
|
99
99
|
clamp: 3,
|
|
100
100
|
children: ret
|
|
101
101
|
});
|
|
102
|
+
} else {
|
|
103
|
+
ret = /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
104
|
+
className: "break-words",
|
|
105
|
+
children: ret
|
|
106
|
+
});
|
|
102
107
|
}
|
|
103
108
|
return /*#__PURE__*/jsxRuntime.jsxs(react.Fragment, {
|
|
104
109
|
children: [ret, utilities.isObject(value) && value._score_ > 0 && /*#__PURE__*/jsxRuntime.jsx(core.Meter, {
|
|
@@ -120,28 +125,30 @@ var JsonEntry = function JsonEntry(_ref3) {
|
|
|
120
125
|
}, [filters, path, pathWithoutOrdinal]);
|
|
121
126
|
var labelDisplay = react.useMemo(function () {
|
|
122
127
|
var _labeler;
|
|
123
|
-
return /*#__PURE__*/jsxRuntime.
|
|
124
|
-
className: "text-dimmed text-sm px-2 flex-1 truncate",
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
128
|
+
return /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
129
|
+
className: classNames("text-dimmed text-sm px-2 flex-1 group", inline ? "truncate" : "break-words"),
|
|
130
|
+
children: [!canExpand && canFilter && /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
131
|
+
className: "hidden pe-1 group-hover:inline-block",
|
|
132
|
+
children: [/*#__PURE__*/jsxRuntime.jsx(core.Button, {
|
|
133
|
+
color: "danger",
|
|
134
|
+
size: "xs",
|
|
135
|
+
variant: "link",
|
|
136
|
+
icon: core.CoreIcons.funnelMinus,
|
|
137
|
+
"aria-label": "Filter Negative",
|
|
138
|
+
onClick: function onClick() {
|
|
139
|
+
return onFilter === null || onFilter === void 0 ? void 0 : onFilter(pathWithoutOrdinal, actualValue, true);
|
|
140
|
+
}
|
|
141
|
+
}, "negative"), /*#__PURE__*/jsxRuntime.jsx(core.Button, {
|
|
142
|
+
color: "primary",
|
|
143
|
+
size: "xs",
|
|
144
|
+
variant: "link",
|
|
145
|
+
icon: core.CoreIcons.funnelPlus,
|
|
146
|
+
"aria-label": "Filter",
|
|
147
|
+
onClick: function onClick() {
|
|
148
|
+
return onFilter === null || onFilter === void 0 ? void 0 : onFilter(pathWithoutOrdinal, actualValue);
|
|
149
|
+
}
|
|
150
|
+
}, "positive")]
|
|
151
|
+
}), (_labeler = labeler === null || labeler === void 0 ? void 0 : labeler(path)) !== null && _labeler !== void 0 ? _labeler : field]
|
|
145
152
|
});
|
|
146
153
|
}, [field, labeler, pathWithoutOrdinal, actualValue, canExpand, canFilter]);
|
|
147
154
|
return /*#__PURE__*/jsxRuntime.jsxs(react.Fragment, {
|
|
@@ -164,11 +171,14 @@ var JsonEntry = function JsonEntry(_ref3) {
|
|
|
164
171
|
icon: expanded ? core.CoreIcons.chevronDown : core.CoreIcons.chevronRight
|
|
165
172
|
}), labelDisplay]
|
|
166
173
|
}), display && /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
167
|
-
className: classNames("px-2", inline && "flex-1"),
|
|
174
|
+
className: classNames("px-2 flex flex-nowrap overflow-hidden", inline && "flex-1"),
|
|
168
175
|
children: [canCopy && /*#__PURE__*/jsxRuntime.jsx(core.Copy, {
|
|
169
176
|
size: "xs",
|
|
170
177
|
text: actualValue
|
|
171
|
-
}),
|
|
178
|
+
}), /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
179
|
+
className: "flex-1",
|
|
180
|
+
children: display
|
|
181
|
+
})]
|
|
172
182
|
})]
|
|
173
183
|
}), !showPropertyTree && !children && /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
174
184
|
className: classNames("py-2", inline && "flex flex-nowrap items-center"),
|
|
@@ -180,11 +190,14 @@ var JsonEntry = function JsonEntry(_ref3) {
|
|
|
180
190
|
},
|
|
181
191
|
children: labelDisplay
|
|
182
192
|
}), /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
183
|
-
className: classNames("px-2", inline && "flex-1"),
|
|
193
|
+
className: classNames("px-2 flex flex-nowrap overflow-hidden", inline && "flex-1"),
|
|
184
194
|
children: [canCopy && /*#__PURE__*/jsxRuntime.jsx(core.Copy, {
|
|
185
195
|
size: "xs",
|
|
186
196
|
text: value
|
|
187
|
-
}),
|
|
197
|
+
}), /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
198
|
+
className: "flex-1",
|
|
199
|
+
children: display
|
|
200
|
+
})]
|
|
188
201
|
})]
|
|
189
202
|
}), expanded && (children === null || children === void 0 ? void 0 : children.map(function (item) {
|
|
190
203
|
return /*#__PURE__*/jsxRuntime.jsx(JsonEntry, _objectSpread(_objectSpread({}, item), {}, {
|
|
@@ -223,7 +236,7 @@ var JsonViewer = function JsonViewer(_ref5) {
|
|
|
223
236
|
return reduceObject(json);
|
|
224
237
|
}, [json]);
|
|
225
238
|
return /*#__PURE__*/jsxRuntime.jsx("div", _objectSpread(_objectSpread({}, rest), {}, {
|
|
226
|
-
className: classNames(className, "
|
|
239
|
+
className: classNames(className, "bg-alternate"),
|
|
227
240
|
children: !utilities.isEmpty(json) ? list.map(function (item) {
|
|
228
241
|
return /*#__PURE__*/jsxRuntime.jsx(JsonEntry, _objectSpread(_objectSpread({}, item), {}, {
|
|
229
242
|
copy: copy,
|
|
@@ -152,14 +152,14 @@ var _VirtualGallery = function _VirtualGallery(_ref) {
|
|
|
152
152
|
return {
|
|
153
153
|
scrollToItem: function scrollToItem(index) {
|
|
154
154
|
virtualizer.scrollToIndex(Math.floor(index / columnCount), {
|
|
155
|
-
align: "
|
|
155
|
+
align: "auto"
|
|
156
156
|
});
|
|
157
157
|
},
|
|
158
158
|
hilight: function hilight(index) {
|
|
159
159
|
var _scrollerRef$current2;
|
|
160
160
|
(_scrollerRef$current2 = scrollerRef.current) === null || _scrollerRef$current2 === void 0 || (_scrollerRef$current2 = _scrollerRef$current2.querySelector(".hilight")) === null || _scrollerRef$current2 === void 0 || _scrollerRef$current2.classList.remove("hilight", "ring-1");
|
|
161
161
|
virtualizer.scrollToIndex(Math.floor(index / columnCount), {
|
|
162
|
-
align: "
|
|
162
|
+
align: "auto"
|
|
163
163
|
});
|
|
164
164
|
setTimeout(function () {
|
|
165
165
|
var _scrollerRef$current3;
|
package/dist/cjs/virtual/List.js
CHANGED
|
@@ -141,14 +141,14 @@ var _VirtualList = function _VirtualList(_ref) {
|
|
|
141
141
|
return {
|
|
142
142
|
scrollToItem: function scrollToItem(index) {
|
|
143
143
|
virtualizer.scrollToIndex(index, {
|
|
144
|
-
align: "
|
|
144
|
+
align: "auto"
|
|
145
145
|
});
|
|
146
146
|
},
|
|
147
147
|
hilight: function hilight(index) {
|
|
148
148
|
var _scrollerRef$current2;
|
|
149
149
|
(_scrollerRef$current2 = scrollerRef.current) === null || _scrollerRef$current2 === void 0 || (_scrollerRef$current2 = _scrollerRef$current2.querySelector(".hilight")) === null || _scrollerRef$current2 === void 0 || _scrollerRef$current2.classList.remove("hilight", "ring-1");
|
|
150
150
|
virtualizer.scrollToIndex(Math.floor(index), {
|
|
151
|
-
align: "
|
|
151
|
+
align: "auto"
|
|
152
152
|
});
|
|
153
153
|
setTimeout(function () {
|
|
154
154
|
var _scrollerRef$current3;
|
|
@@ -4,7 +4,7 @@ import _objectWithoutProperties from '@babel/runtime/helpers/objectWithoutProper
|
|
|
4
4
|
import _defineProperty from '@babel/runtime/helpers/defineProperty';
|
|
5
5
|
import _toConsumableArray from '@babel/runtime/helpers/toConsumableArray';
|
|
6
6
|
import _slicedToArray from '@babel/runtime/helpers/slicedToArray';
|
|
7
|
-
import { EmptyContent, Text, Meter,
|
|
7
|
+
import { EmptyContent, Text, Meter, Button, CoreIcons, Icon, Copy } from '@react-fabric/core';
|
|
8
8
|
import { isEmpty, isArray, isObject, isNil, Format, isBoolean, isTrue } from '@react-fabric/utilities';
|
|
9
9
|
import classNames from 'classnames';
|
|
10
10
|
import { useMemo, useState, Fragment } from 'react';
|
|
@@ -99,6 +99,11 @@ var JsonEntry = function JsonEntry(_ref3) {
|
|
|
99
99
|
clamp: 3,
|
|
100
100
|
children: ret
|
|
101
101
|
});
|
|
102
|
+
} else {
|
|
103
|
+
ret = /*#__PURE__*/jsx("div", {
|
|
104
|
+
className: "break-words",
|
|
105
|
+
children: ret
|
|
106
|
+
});
|
|
102
107
|
}
|
|
103
108
|
return /*#__PURE__*/jsxs(Fragment, {
|
|
104
109
|
children: [ret, isObject(value) && value._score_ > 0 && /*#__PURE__*/jsx(Meter, {
|
|
@@ -120,28 +125,30 @@ var JsonEntry = function JsonEntry(_ref3) {
|
|
|
120
125
|
}, [filters, path, pathWithoutOrdinal]);
|
|
121
126
|
var labelDisplay = useMemo(function () {
|
|
122
127
|
var _labeler;
|
|
123
|
-
return /*#__PURE__*/
|
|
124
|
-
className: "text-dimmed text-sm px-2 flex-1 truncate",
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
128
|
+
return /*#__PURE__*/jsxs("div", {
|
|
129
|
+
className: classNames("text-dimmed text-sm px-2 flex-1 group", inline ? "truncate" : "break-words"),
|
|
130
|
+
children: [!canExpand && canFilter && /*#__PURE__*/jsxs("div", {
|
|
131
|
+
className: "hidden pe-1 group-hover:inline-block",
|
|
132
|
+
children: [/*#__PURE__*/jsx(Button, {
|
|
133
|
+
color: "danger",
|
|
134
|
+
size: "xs",
|
|
135
|
+
variant: "link",
|
|
136
|
+
icon: CoreIcons.funnelMinus,
|
|
137
|
+
"aria-label": "Filter Negative",
|
|
138
|
+
onClick: function onClick() {
|
|
139
|
+
return onFilter === null || onFilter === void 0 ? void 0 : onFilter(pathWithoutOrdinal, actualValue, true);
|
|
140
|
+
}
|
|
141
|
+
}, "negative"), /*#__PURE__*/jsx(Button, {
|
|
142
|
+
color: "primary",
|
|
143
|
+
size: "xs",
|
|
144
|
+
variant: "link",
|
|
145
|
+
icon: CoreIcons.funnelPlus,
|
|
146
|
+
"aria-label": "Filter",
|
|
147
|
+
onClick: function onClick() {
|
|
148
|
+
return onFilter === null || onFilter === void 0 ? void 0 : onFilter(pathWithoutOrdinal, actualValue);
|
|
149
|
+
}
|
|
150
|
+
}, "positive")]
|
|
151
|
+
}), (_labeler = labeler === null || labeler === void 0 ? void 0 : labeler(path)) !== null && _labeler !== void 0 ? _labeler : field]
|
|
145
152
|
});
|
|
146
153
|
}, [field, labeler, pathWithoutOrdinal, actualValue, canExpand, canFilter]);
|
|
147
154
|
return /*#__PURE__*/jsxs(Fragment, {
|
|
@@ -164,11 +171,14 @@ var JsonEntry = function JsonEntry(_ref3) {
|
|
|
164
171
|
icon: expanded ? CoreIcons.chevronDown : CoreIcons.chevronRight
|
|
165
172
|
}), labelDisplay]
|
|
166
173
|
}), display && /*#__PURE__*/jsxs("div", {
|
|
167
|
-
className: classNames("px-2", inline && "flex-1"),
|
|
174
|
+
className: classNames("px-2 flex flex-nowrap overflow-hidden", inline && "flex-1"),
|
|
168
175
|
children: [canCopy && /*#__PURE__*/jsx(Copy, {
|
|
169
176
|
size: "xs",
|
|
170
177
|
text: actualValue
|
|
171
|
-
}),
|
|
178
|
+
}), /*#__PURE__*/jsx("div", {
|
|
179
|
+
className: "flex-1",
|
|
180
|
+
children: display
|
|
181
|
+
})]
|
|
172
182
|
})]
|
|
173
183
|
}), !showPropertyTree && !children && /*#__PURE__*/jsxs("div", {
|
|
174
184
|
className: classNames("py-2", inline && "flex flex-nowrap items-center"),
|
|
@@ -180,11 +190,14 @@ var JsonEntry = function JsonEntry(_ref3) {
|
|
|
180
190
|
},
|
|
181
191
|
children: labelDisplay
|
|
182
192
|
}), /*#__PURE__*/jsxs("div", {
|
|
183
|
-
className: classNames("px-2", inline && "flex-1"),
|
|
193
|
+
className: classNames("px-2 flex flex-nowrap overflow-hidden", inline && "flex-1"),
|
|
184
194
|
children: [canCopy && /*#__PURE__*/jsx(Copy, {
|
|
185
195
|
size: "xs",
|
|
186
196
|
text: value
|
|
187
|
-
}),
|
|
197
|
+
}), /*#__PURE__*/jsx("div", {
|
|
198
|
+
className: "flex-1",
|
|
199
|
+
children: display
|
|
200
|
+
})]
|
|
188
201
|
})]
|
|
189
202
|
}), expanded && (children === null || children === void 0 ? void 0 : children.map(function (item) {
|
|
190
203
|
return /*#__PURE__*/jsx(JsonEntry, _objectSpread(_objectSpread({}, item), {}, {
|
|
@@ -223,7 +236,7 @@ var JsonViewer = function JsonViewer(_ref5) {
|
|
|
223
236
|
return reduceObject(json);
|
|
224
237
|
}, [json]);
|
|
225
238
|
return /*#__PURE__*/jsx("div", _objectSpread(_objectSpread({}, rest), {}, {
|
|
226
|
-
className: classNames(className, "
|
|
239
|
+
className: classNames(className, "bg-alternate"),
|
|
227
240
|
children: !isEmpty(json) ? list.map(function (item) {
|
|
228
241
|
return /*#__PURE__*/jsx(JsonEntry, _objectSpread(_objectSpread({}, item), {}, {
|
|
229
242
|
copy: copy,
|
|
@@ -152,14 +152,14 @@ var _VirtualGallery = function _VirtualGallery(_ref) {
|
|
|
152
152
|
return {
|
|
153
153
|
scrollToItem: function scrollToItem(index) {
|
|
154
154
|
virtualizer.scrollToIndex(Math.floor(index / columnCount), {
|
|
155
|
-
align: "
|
|
155
|
+
align: "auto"
|
|
156
156
|
});
|
|
157
157
|
},
|
|
158
158
|
hilight: function hilight(index) {
|
|
159
159
|
var _scrollerRef$current2;
|
|
160
160
|
(_scrollerRef$current2 = scrollerRef.current) === null || _scrollerRef$current2 === void 0 || (_scrollerRef$current2 = _scrollerRef$current2.querySelector(".hilight")) === null || _scrollerRef$current2 === void 0 || _scrollerRef$current2.classList.remove("hilight", "ring-1");
|
|
161
161
|
virtualizer.scrollToIndex(Math.floor(index / columnCount), {
|
|
162
|
-
align: "
|
|
162
|
+
align: "auto"
|
|
163
163
|
});
|
|
164
164
|
setTimeout(function () {
|
|
165
165
|
var _scrollerRef$current3;
|
package/dist/esm/virtual/List.js
CHANGED
|
@@ -141,14 +141,14 @@ var _VirtualList = function _VirtualList(_ref) {
|
|
|
141
141
|
return {
|
|
142
142
|
scrollToItem: function scrollToItem(index) {
|
|
143
143
|
virtualizer.scrollToIndex(index, {
|
|
144
|
-
align: "
|
|
144
|
+
align: "auto"
|
|
145
145
|
});
|
|
146
146
|
},
|
|
147
147
|
hilight: function hilight(index) {
|
|
148
148
|
var _scrollerRef$current2;
|
|
149
149
|
(_scrollerRef$current2 = scrollerRef.current) === null || _scrollerRef$current2 === void 0 || (_scrollerRef$current2 = _scrollerRef$current2.querySelector(".hilight")) === null || _scrollerRef$current2 === void 0 || _scrollerRef$current2.classList.remove("hilight", "ring-1");
|
|
150
150
|
virtualizer.scrollToIndex(Math.floor(index), {
|
|
151
|
-
align: "
|
|
151
|
+
align: "auto"
|
|
152
152
|
});
|
|
153
153
|
setTimeout(function () {
|
|
154
154
|
var _scrollerRef$current3;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@react-fabric/data",
|
|
3
|
-
"version": "1.0.0-beta.
|
|
3
|
+
"version": "1.0.0-beta.32",
|
|
4
4
|
"description": "RUF: Data package",
|
|
5
5
|
"author": "Adarsh Pastakia <adarshpastakia@outlook.com>",
|
|
6
6
|
"license": "MIT",
|
|
@@ -33,10 +33,10 @@
|
|
|
33
33
|
"watch": "npm-run-all -p watch:rollup watch:dts"
|
|
34
34
|
},
|
|
35
35
|
"dependencies": {
|
|
36
|
-
"@react-fabric/core": "^1.0.0-beta.
|
|
37
|
-
"@react-fabric/date": "^1.0.0-beta.
|
|
38
|
-
"@react-fabric/form": "^1.0.0-beta.
|
|
39
|
-
"@react-fabric/utilities": "^1.0.0-beta.
|
|
36
|
+
"@react-fabric/core": "^1.0.0-beta.32",
|
|
37
|
+
"@react-fabric/date": "^1.0.0-beta.32",
|
|
38
|
+
"@react-fabric/form": "^1.0.0-beta.32",
|
|
39
|
+
"@react-fabric/utilities": "^1.0.0-beta.32",
|
|
40
40
|
"@tanstack/react-virtual": "^3.8.6",
|
|
41
41
|
"classnames": "^2.5.1",
|
|
42
42
|
"color": "^4.2.3",
|
|
@@ -52,5 +52,5 @@
|
|
|
52
52
|
"node": ">=18.12.0",
|
|
53
53
|
"npm": ">=8.19.0"
|
|
54
54
|
},
|
|
55
|
-
"gitHead": "
|
|
55
|
+
"gitHead": "e8ba7088116f5ae253ed989854d6fdaef2ad7507"
|
|
56
56
|
}
|
package/src/json/JsonViewer.tsx
CHANGED
|
@@ -22,7 +22,6 @@
|
|
|
22
22
|
*/
|
|
23
23
|
|
|
24
24
|
import {
|
|
25
|
-
ActionLabel,
|
|
26
25
|
Button,
|
|
27
26
|
Copy,
|
|
28
27
|
CoreIcons,
|
|
@@ -181,6 +180,8 @@ const JsonEntry = ({
|
|
|
181
180
|
ret = actualValue ? t("json.true") : t("json.false");
|
|
182
181
|
if (ret?.length > 128) {
|
|
183
182
|
ret = <Text clamp={3}>{ret}</Text>;
|
|
183
|
+
} else {
|
|
184
|
+
ret = <div className="break-words">{ret}</div>;
|
|
184
185
|
}
|
|
185
186
|
|
|
186
187
|
return (
|
|
@@ -216,37 +217,36 @@ const JsonEntry = ({
|
|
|
216
217
|
|
|
217
218
|
const labelDisplay = useMemo(
|
|
218
219
|
() => (
|
|
219
|
-
<
|
|
220
|
-
className=
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
<Button
|
|
225
|
-
key="negative"
|
|
226
|
-
color="danger"
|
|
227
|
-
size="sm"
|
|
228
|
-
variant="link"
|
|
229
|
-
icon={CoreIcons.funnelMinus}
|
|
230
|
-
aria-label="Filter Negative"
|
|
231
|
-
onClick={() =>
|
|
232
|
-
onFilter?.(pathWithoutOrdinal, actualValue, true)
|
|
233
|
-
}
|
|
234
|
-
/>,
|
|
235
|
-
<Button
|
|
236
|
-
key="positive"
|
|
237
|
-
color="primary"
|
|
238
|
-
size="sm"
|
|
239
|
-
variant="link"
|
|
240
|
-
icon={CoreIcons.funnelPlus}
|
|
241
|
-
aria-label="Filter"
|
|
242
|
-
onClick={() => onFilter?.(pathWithoutOrdinal, actualValue)}
|
|
243
|
-
/>,
|
|
244
|
-
]
|
|
245
|
-
: []
|
|
246
|
-
}
|
|
220
|
+
<div
|
|
221
|
+
className={classNames(
|
|
222
|
+
"text-dimmed text-sm px-2 flex-1 group",
|
|
223
|
+
inline ? "truncate" : "break-words",
|
|
224
|
+
)}
|
|
247
225
|
>
|
|
226
|
+
{!canExpand && canFilter && (
|
|
227
|
+
<div className="hidden pe-1 group-hover:inline-block">
|
|
228
|
+
<Button
|
|
229
|
+
key="negative"
|
|
230
|
+
color="danger"
|
|
231
|
+
size="xs"
|
|
232
|
+
variant="link"
|
|
233
|
+
icon={CoreIcons.funnelMinus}
|
|
234
|
+
aria-label="Filter Negative"
|
|
235
|
+
onClick={() => onFilter?.(pathWithoutOrdinal, actualValue, true)}
|
|
236
|
+
/>
|
|
237
|
+
<Button
|
|
238
|
+
key="positive"
|
|
239
|
+
color="primary"
|
|
240
|
+
size="xs"
|
|
241
|
+
variant="link"
|
|
242
|
+
icon={CoreIcons.funnelPlus}
|
|
243
|
+
aria-label="Filter"
|
|
244
|
+
onClick={() => onFilter?.(pathWithoutOrdinal, actualValue)}
|
|
245
|
+
/>
|
|
246
|
+
</div>
|
|
247
|
+
)}
|
|
248
248
|
{labeler?.(path) ?? field}
|
|
249
|
-
</
|
|
249
|
+
</div>
|
|
250
250
|
),
|
|
251
251
|
[field, labeler, pathWithoutOrdinal, actualValue, canExpand, canFilter],
|
|
252
252
|
);
|
|
@@ -283,9 +283,14 @@ const JsonEntry = ({
|
|
|
283
283
|
{labelDisplay}
|
|
284
284
|
</div>
|
|
285
285
|
{display && (
|
|
286
|
-
<div
|
|
286
|
+
<div
|
|
287
|
+
className={classNames(
|
|
288
|
+
"px-2 flex flex-nowrap overflow-hidden",
|
|
289
|
+
inline && "flex-1",
|
|
290
|
+
)}
|
|
291
|
+
>
|
|
287
292
|
{canCopy && <Copy size="xs" text={actualValue} />}
|
|
288
|
-
{display}
|
|
293
|
+
<div className="flex-1">{display}</div>
|
|
289
294
|
</div>
|
|
290
295
|
)}
|
|
291
296
|
</div>
|
|
@@ -309,9 +314,14 @@ const JsonEntry = ({
|
|
|
309
314
|
>
|
|
310
315
|
{labelDisplay}
|
|
311
316
|
</div>
|
|
312
|
-
<div
|
|
317
|
+
<div
|
|
318
|
+
className={classNames(
|
|
319
|
+
"px-2 flex flex-nowrap overflow-hidden",
|
|
320
|
+
inline && "flex-1",
|
|
321
|
+
)}
|
|
322
|
+
>
|
|
313
323
|
{canCopy && <Copy size="xs" text={value} />}
|
|
314
|
-
{display}
|
|
324
|
+
<div className="flex-1">{display}</div>
|
|
315
325
|
</div>
|
|
316
326
|
</div>
|
|
317
327
|
)}
|
|
@@ -356,7 +366,7 @@ export const JsonViewer = <T extends KeyValue = KeyValue>({
|
|
|
356
366
|
const list = useMemo(() => reduceObject(json), [json]);
|
|
357
367
|
|
|
358
368
|
return (
|
|
359
|
-
<div {...rest} className={classNames(className, "
|
|
369
|
+
<div {...rest} className={classNames(className, "bg-alternate")}>
|
|
360
370
|
{!isEmpty(json) ? (
|
|
361
371
|
list.map((item) => (
|
|
362
372
|
<JsonEntry
|
package/src/virtual/Gallery.tsx
CHANGED
|
@@ -94,7 +94,7 @@ export interface VirtualGalleryProps<T> extends TestProps {
|
|
|
94
94
|
/**
|
|
95
95
|
* load more callback
|
|
96
96
|
*/
|
|
97
|
-
onLoadMore?: () => void;
|
|
97
|
+
onLoadMore?: (page?: number) => void;
|
|
98
98
|
/**
|
|
99
99
|
* scroll handler
|
|
100
100
|
*/
|
|
@@ -248,7 +248,7 @@ const _VirtualGallery = <T extends KeyValue>({
|
|
|
248
248
|
() => ({
|
|
249
249
|
scrollToItem(index) {
|
|
250
250
|
virtualizer.scrollToIndex(Math.floor(index / columnCount), {
|
|
251
|
-
align: "
|
|
251
|
+
align: "auto",
|
|
252
252
|
});
|
|
253
253
|
},
|
|
254
254
|
hilight(index) {
|
|
@@ -256,7 +256,7 @@ const _VirtualGallery = <T extends KeyValue>({
|
|
|
256
256
|
?.querySelector(".hilight")
|
|
257
257
|
?.classList.remove("hilight", "ring-1");
|
|
258
258
|
virtualizer.scrollToIndex(Math.floor(index / columnCount), {
|
|
259
|
-
align: "
|
|
259
|
+
align: "auto",
|
|
260
260
|
});
|
|
261
261
|
setTimeout(() => {
|
|
262
262
|
scrollerRef.current
|
package/src/virtual/List.tsx
CHANGED
|
@@ -235,14 +235,14 @@ const _VirtualList = <T extends KeyValue>({
|
|
|
235
235
|
listRef,
|
|
236
236
|
() => ({
|
|
237
237
|
scrollToItem(index) {
|
|
238
|
-
virtualizer.scrollToIndex(index, { align: "
|
|
238
|
+
virtualizer.scrollToIndex(index, { align: "auto" });
|
|
239
239
|
},
|
|
240
240
|
hilight(index) {
|
|
241
241
|
scrollerRef.current
|
|
242
242
|
?.querySelector(".hilight")
|
|
243
243
|
?.classList.remove("hilight", "ring-1");
|
|
244
244
|
virtualizer.scrollToIndex(Math.floor(index), {
|
|
245
|
-
align: "
|
|
245
|
+
align: "auto",
|
|
246
246
|
});
|
|
247
247
|
setTimeout(() => {
|
|
248
248
|
scrollerRef.current
|