@opengeoweb/shared 14.2.2 → 14.4.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/index.esm.js +174 -22
- package/package.json +2 -2
- package/src/lib/components/CustomDialog/CustomDialog.d.ts +1 -0
- package/src/lib/components/CustomIconButton/CustomIconButton.d.ts +2 -0
- package/src/lib/components/Filter/Filter.d.ts +4 -0
- package/src/lib/components/Filter/FilterList.d.ts +3 -0
- package/src/lib/components/Filter/FilterToggleButton.d.ts +5 -0
- package/src/lib/types/types.d.ts +1 -1
- package/src/lib/utils/i18n.d.ts +1 -1
package/index.esm.js
CHANGED
|
@@ -5,7 +5,7 @@ import { initReactI18next, useTranslation } from 'react-i18next';
|
|
|
5
5
|
import React, { useRef, useEffect, useState, Component } from 'react';
|
|
6
6
|
import Draggable from 'react-draggable';
|
|
7
7
|
import { Resizable } from 're-resizable';
|
|
8
|
-
import { Resize, Options, Close, ChevronLeft, Exclamation, Success, Info, ChevronRight, GeoWebLogo, HamburgerMenu, Admin, useThemeContext, ThemeTypes, ArrowLeft, ArrowRight, KeyOption, KeyCommand, ArrowUp, ArrowDown, ChevronDown, Search, Clear, Cached } from '@opengeoweb/theme';
|
|
8
|
+
import { Resize, BORDER_RADIUS, Options, Close, ChevronLeft, Exclamation, Success, Info, ChevronRight, GeoWebLogo, HamburgerMenu, Admin, useThemeContext, ThemeTypes, ArrowLeft, ArrowRight, KeyOption, KeyCommand, ArrowUp, ArrowDown, ChevronDown, Search, Clear, Cached, Filter as Filter$1 } from '@opengeoweb/theme';
|
|
9
9
|
import { throttle, merge, escapeRegExp, debounce } from 'lodash';
|
|
10
10
|
import { addIntegration } from '@sentry/react';
|
|
11
11
|
import { parseISO, parse, format, isEqual, add as add$1, sub as sub$1, differenceInYears as differenceInYears$1, differenceInMonths as differenceInMonths$1, differenceInDays as differenceInDays$1, differenceInMinutes as differenceInMinutes$1, differenceInHours as differenceInHours$1, differenceInSeconds as differenceInSeconds$1, roundToNearestMinutes as roundToNearestMinutes$1, isBefore as isBefore$1, isAfter as isAfter$1, isValid as isValid$1, getUnixTime, fromUnixTime, set as set$1, getHours as getHours$1, startOfDay, addMinutes, addHours, setSeconds as setSeconds$1, getDay, getDayOfYear, getMonth, getWeek, getYear, isWithinInterval } from 'date-fns';
|
|
@@ -53,6 +53,11 @@ var en = {
|
|
|
53
53
|
"shared-shortcut-mouse-scroll": "+ Mouse scroll",
|
|
54
54
|
"shared-shortcut-or": "or",
|
|
55
55
|
"shared-shortcut-toggle-workspace-time-scroll": "Toggle workspace time scroll ON and OFF",
|
|
56
|
+
"shared-shortcut-open-location-search": "Open location search",
|
|
57
|
+
"shared-shortcut-zoom-to-location": "Zoom map to location",
|
|
58
|
+
"shared-shortcut-mouse-click": "+ Mouse click",
|
|
59
|
+
"shared-shortcut-split-button": "click split window button",
|
|
60
|
+
"shared-shortcut-copy-view-preset-content-split-window": "Copy over viewpreset content when splitting window",
|
|
56
61
|
"shared-sentry-recording": "Sentry Recording",
|
|
57
62
|
"shared-sentry-information": "For monitoring performance and errors, GeoWeb is logging usage information. In this process, no sensitive user information will leave the browser.",
|
|
58
63
|
"shared-sentry-enable-message": "By enabling recording I understand that the recording related data will be send to Sentry´s servers for processing.",
|
|
@@ -75,7 +80,11 @@ var en = {
|
|
|
75
80
|
"shared-filter-shared-view-presets": "Shared presets",
|
|
76
81
|
"shared-filter-search": "Search",
|
|
77
82
|
"shared-only": "ONLY",
|
|
78
|
-
"shared-customdialog-back": "Back"
|
|
83
|
+
"shared-customdialog-back": "Back",
|
|
84
|
+
"shared-filter-hide-labels": "Close filter",
|
|
85
|
+
"shared-filter-show-labels": "Open filter",
|
|
86
|
+
"shared-shortcut-toggle-location-info": "Toggle location info dialog ON and OFF",
|
|
87
|
+
"shared-shortcut-toggle-measure-tool": "Toggle map measure tool ON and OFF"
|
|
79
88
|
};
|
|
80
89
|
var fi = {
|
|
81
90
|
"shared-choose-app-mode": "Sovelluksen väriteema",
|
|
@@ -119,6 +128,11 @@ var fi = {
|
|
|
119
128
|
"shared-shortcut-mouse-scroll": "+ hiiren rulla",
|
|
120
129
|
"shared-shortcut-or": "tai",
|
|
121
130
|
"shared-shortcut-toggle-workspace-time-scroll": "Aseta työtilan ajan scrollaus päälle tai pois päältä",
|
|
131
|
+
"shared-shortcut-open-location-search": "Avaa sijainnin haku",
|
|
132
|
+
"shared-shortcut-zoom-to-location": "Zoomaa kartta sijaintiin",
|
|
133
|
+
"shared-shortcut-mouse-click": "+ hiiren napsautus",
|
|
134
|
+
"shared-shortcut-split-button": "napsauta Jaa ikkuna -painiketta",
|
|
135
|
+
"shared-shortcut-copy-view-preset-content-split-window": "Kopioi näkymän sisältö, kun ikkuna jaetaan kahtia",
|
|
122
136
|
"shared-sentry-recording": "Sentry Tallennus",
|
|
123
137
|
"shared-sentry-information": "Geoweb tallentaa tietoja sovelluksen käytöstä monitoroidakseen suorituskykyä, sekä virhetilanteita. Arkaluonteista dataa ei kerätä tai lähetetä.",
|
|
124
138
|
"shared-sentry-enable-message": "Ymmärrän, että laittamalla tallennuksen päälle tallennukseen liittyvää dataa lähetetään Sentryn palvelimille.",
|
|
@@ -141,7 +155,9 @@ var fi = {
|
|
|
141
155
|
"shared-filter-shared-view-presets": "ei käännetty",
|
|
142
156
|
"shared-filter-search": "Etsi",
|
|
143
157
|
"shared-only": "Pelkästään",
|
|
144
|
-
"shared-customdialog-back": "PALAA TAKAISIN"
|
|
158
|
+
"shared-customdialog-back": "PALAA TAKAISIN",
|
|
159
|
+
"shared-filter-hide-labels": "Hide labels",
|
|
160
|
+
"shared-filter-show-labels": "Show labels"
|
|
145
161
|
};
|
|
146
162
|
var no = {
|
|
147
163
|
"shared-choose-app-mode": "Velg din standardmodus",
|
|
@@ -185,6 +201,11 @@ var no = {
|
|
|
185
201
|
"shared-shortcut-mouse-scroll": "+ skroll",
|
|
186
202
|
"shared-shortcut-or": "eller",
|
|
187
203
|
"shared-shortcut-toggle-workspace-time-scroll": "ikke oversatt",
|
|
204
|
+
"shared-shortcut-open-location-search": "Åpne stedsøk",
|
|
205
|
+
"shared-shortcut-zoom-to-location": "Zoom kart til sted",
|
|
206
|
+
"shared-shortcut-mouse-click": "+ museklikk",
|
|
207
|
+
"shared-shortcut-copy-view-preset-content-split-window": "kopier over viewpreset innhold når vindu deles",
|
|
208
|
+
"shared-shortcut-split-button": "trykk del vindu knapp",
|
|
188
209
|
"shared-sentry-recording": "Skjermopptak av Sentry",
|
|
189
210
|
"shared-sentry-information": "GeoWeb tar opp brukerinformasjon for å monitorere ytelse og feilmeldinger. Underveis vil ingen sensitiv brukerinformasjon forlate nettleser.",
|
|
190
211
|
"shared-sentry-enable-message": "Ved å bruke skjermopptak forstår jeg at opptaksdata vil bli sendt til Sentry for analysering",
|
|
@@ -207,7 +228,9 @@ var no = {
|
|
|
207
228
|
"shared-filter-shared-view-presets": "Delte snarveier",
|
|
208
229
|
"shared-filter-search": "Søk",
|
|
209
230
|
"shared-only": "BARE",
|
|
210
|
-
"shared-customdialog-back": "Tilbake"
|
|
231
|
+
"shared-customdialog-back": "Tilbake",
|
|
232
|
+
"shared-filter-hide-labels": "Skjul nøkkelord",
|
|
233
|
+
"shared-filter-show-labels": "Vis nøkkelord"
|
|
211
234
|
};
|
|
212
235
|
var nl = {
|
|
213
236
|
"shared-choose-app-mode": "Kies je standaard app-modus",
|
|
@@ -250,7 +273,12 @@ var nl = {
|
|
|
250
273
|
"shared-shortcut-home": "Home",
|
|
251
274
|
"shared-shortcut-mouse-scroll": "+ Scroll",
|
|
252
275
|
"shared-shortcut-or": "of",
|
|
253
|
-
"shared-shortcut-
|
|
276
|
+
"shared-shortcut-copy-view-preset-content-split-window": "Kopieer viewpreset instellingen naar nieuw paneel",
|
|
277
|
+
"shared-shortcut-split-button": "klik splits paneel knop",
|
|
278
|
+
"shared-shortcut-toggle-workspace-time-scroll": "Zet workspace tijd scrollen AAN en UIT",
|
|
279
|
+
"shared-shortcut-open-location-search": "Open locatie zoeken",
|
|
280
|
+
"shared-shortcut-zoom-to-location": "Zoom kaart naar locatie",
|
|
281
|
+
"shared-shortcut-mouse-click": "+ Muisklik",
|
|
254
282
|
"shared-sentry-recording": "Sentry Opname",
|
|
255
283
|
"shared-sentry-information": "Om performance en fouten te monitoren, registreert GeoWeb gebruiksinformatie. Tijdens dit proces verlaat geen enkele gevoelige gebruikersinformatie de browser.",
|
|
256
284
|
"shared-sentry-enable-message": "Door opname te starten, ga ik akkoord dat de opnamegerelateerde gegevens ter verwerking naar de servers van Sentry worden verzonden.",
|
|
@@ -273,7 +301,11 @@ var nl = {
|
|
|
273
301
|
"shared-filter-shared-view-presets": "Gedeelde presets",
|
|
274
302
|
"shared-filter-search": "Zoeken",
|
|
275
303
|
"shared-only": "ALLEEN",
|
|
276
|
-
"shared-customdialog-back": "Terug"
|
|
304
|
+
"shared-customdialog-back": "Terug",
|
|
305
|
+
"shared-filter-hide-labels": "Verberg labels",
|
|
306
|
+
"shared-filter-show-labels": "Toon labels",
|
|
307
|
+
"shared-shortcut-toggle-location-info": "Zet locatie informatie AAN en UIT",
|
|
308
|
+
"shared-shortcut-toggle-measure-tool": "Zet meten op de kaart AAN en UIT"
|
|
277
309
|
};
|
|
278
310
|
var sharedTranslations = {
|
|
279
311
|
en: en,
|
|
@@ -881,7 +913,7 @@ var CustomTooltip = function CustomTooltip(props) {
|
|
|
881
913
|
}));
|
|
882
914
|
};
|
|
883
915
|
|
|
884
|
-
var _excluded$b = ["tooltipTitle", "variant", "isSelected", "shouldShowAsDisabled", "size", "children", "className", "tooltipProps"];
|
|
916
|
+
var _excluded$b = ["tooltipTitle", "variant", "isSelected", "shouldShowAsDisabled", "size", "children", "className", "tooltipProps", "shouldShowExtraOptionsIndicator", "optionsActive"];
|
|
885
917
|
var CustomIconButtonNoMemo = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
|
|
886
918
|
var _defaultTooltipProps$;
|
|
887
919
|
var _ref$tooltipTitle = _ref.tooltipTitle,
|
|
@@ -897,6 +929,10 @@ var CustomIconButtonNoMemo = /*#__PURE__*/React.forwardRef(function (_ref, ref)
|
|
|
897
929
|
children = _ref.children,
|
|
898
930
|
className = _ref.className,
|
|
899
931
|
defaultTooltipProps = _ref.tooltipProps,
|
|
932
|
+
_ref$shouldShowExtraO = _ref.shouldShowExtraOptionsIndicator,
|
|
933
|
+
shouldShowExtraOptionsIndicator = _ref$shouldShowExtraO === void 0 ? false : _ref$shouldShowExtraO,
|
|
934
|
+
_ref$optionsActive = _ref.optionsActive,
|
|
935
|
+
optionsActive = _ref$optionsActive === void 0 ? false : _ref$optionsActive,
|
|
900
936
|
props = _objectWithoutPropertiesLoose(_ref, _excluded$b);
|
|
901
937
|
var classNames = [].concat(className ? [className] : [], isSelected ? ['Mui-selected'] : [], [variant]).join(' ');
|
|
902
938
|
var tooltipTitle = (_defaultTooltipProps$ = defaultTooltipProps == null ? void 0 : defaultTooltipProps.title) != null ? _defaultTooltipProps$ : defaultTooltipTitle;
|
|
@@ -911,7 +947,7 @@ var CustomIconButtonNoMemo = /*#__PURE__*/React.forwardRef(function (_ref, ref)
|
|
|
911
947
|
});
|
|
912
948
|
}, [defaultTooltipProps, tooltipTitle]);
|
|
913
949
|
var renderIconButton = function renderIconButton() {
|
|
914
|
-
return
|
|
950
|
+
return jsxs(IconButton, Object.assign({
|
|
915
951
|
"aria-label": tooltipTitle
|
|
916
952
|
}, props, {
|
|
917
953
|
"aria-pressed": isSelected,
|
|
@@ -926,7 +962,19 @@ var CustomIconButtonNoMemo = /*#__PURE__*/React.forwardRef(function (_ref, ref)
|
|
|
926
962
|
color: "geowebColors.iconButtons." + variant + ".default.color"
|
|
927
963
|
}
|
|
928
964
|
}),
|
|
929
|
-
children: children
|
|
965
|
+
children: [children, shouldShowExtraOptionsIndicator ? jsx(Box, {
|
|
966
|
+
"data-testid": "extra-options-indicator",
|
|
967
|
+
sx: {
|
|
968
|
+
position: 'absolute',
|
|
969
|
+
right: -1,
|
|
970
|
+
bottom: -1,
|
|
971
|
+
color: optionsActive ? "geowebColors.iconButtons." + variant + ".active.fill" : 'inherit',
|
|
972
|
+
borderBottom: '8px solid',
|
|
973
|
+
borderLeft: '8px solid transparent',
|
|
974
|
+
borderBottomRightRadius: BORDER_RADIUS,
|
|
975
|
+
pointerEvents: 'none'
|
|
976
|
+
}
|
|
977
|
+
}) : null]
|
|
930
978
|
}));
|
|
931
979
|
};
|
|
932
980
|
return tooltipTitle && !props.disabled ? jsx(CustomTooltip, Object.assign({}, tooltipProps, {
|
|
@@ -1243,8 +1291,8 @@ var CustomDialogHeader = function CustomDialogHeader(_ref2) {
|
|
|
1243
1291
|
});
|
|
1244
1292
|
};
|
|
1245
1293
|
|
|
1246
|
-
var _excluded$a = ["defaultSize", "onResizeStop", "hasLayout"],
|
|
1247
|
-
_excluded2$2 = ["title", "onClose", "description", "actions", "children", "sx", "resizableDefaultSize", "isResizable", "hasLayout", "shouldRenderInline", "slotProps", "disableRestoreFocus", "headerActions"];
|
|
1294
|
+
var _excluded$a = ["defaultSize", "onResizeStop", "hasLayout", "minWidth"],
|
|
1295
|
+
_excluded2$2 = ["title", "onClose", "description", "actions", "children", "sx", "resizableDefaultSize", "isResizable", "hasLayout", "shouldRenderInline", "slotProps", "disableRestoreFocus", "headerActions", "minWidth"];
|
|
1248
1296
|
var PaperComponent = function PaperComponent(_ref) {
|
|
1249
1297
|
var _ref$defaultSize = _ref.defaultSize,
|
|
1250
1298
|
defaultSize = _ref$defaultSize === void 0 ? {
|
|
@@ -1254,6 +1302,8 @@ var PaperComponent = function PaperComponent(_ref) {
|
|
|
1254
1302
|
onResize = _ref.onResizeStop,
|
|
1255
1303
|
_ref$hasLayout = _ref.hasLayout,
|
|
1256
1304
|
hasLayout = _ref$hasLayout === void 0 ? true : _ref$hasLayout,
|
|
1305
|
+
_ref$minWidth = _ref.minWidth,
|
|
1306
|
+
minWidth = _ref$minWidth === void 0 ? 280 : _ref$minWidth,
|
|
1257
1307
|
props = _objectWithoutPropertiesLoose(_ref, _excluded$a);
|
|
1258
1308
|
var maxWidth = '98%';
|
|
1259
1309
|
var maxHeight = '98%';
|
|
@@ -1262,7 +1312,7 @@ var PaperComponent = function PaperComponent(_ref) {
|
|
|
1262
1312
|
maxHeight: maxHeight,
|
|
1263
1313
|
maxWidth: maxWidth,
|
|
1264
1314
|
minHeight: 120,
|
|
1265
|
-
minWidth:
|
|
1315
|
+
minWidth: minWidth,
|
|
1266
1316
|
size: defaultSize,
|
|
1267
1317
|
style: {
|
|
1268
1318
|
display: 'flex'
|
|
@@ -1319,6 +1369,7 @@ var CustomDialog = function CustomDialog(_ref2) {
|
|
|
1319
1369
|
_ref2$disableRestoreF = _ref2.disableRestoreFocus,
|
|
1320
1370
|
disableRestoreFocus = _ref2$disableRestoreF === void 0 ? true : _ref2$disableRestoreF,
|
|
1321
1371
|
headerActions = _ref2.headerActions,
|
|
1372
|
+
minWidth = _ref2.minWidth,
|
|
1322
1373
|
other = _objectWithoutPropertiesLoose(_ref2, _excluded2$2);
|
|
1323
1374
|
var _React$useState = React.useState(resizableDefaultSize),
|
|
1324
1375
|
size = _React$useState[0],
|
|
@@ -1346,11 +1397,13 @@ var CustomDialog = function CustomDialog(_ref2) {
|
|
|
1346
1397
|
}, Array.isArray(sx) ? Object.assign.apply(Object, [{}].concat(sx)) : sx)
|
|
1347
1398
|
}
|
|
1348
1399
|
}, isResizable && {
|
|
1349
|
-
paper: {
|
|
1400
|
+
paper: Object.assign({
|
|
1350
1401
|
defaultSize: size,
|
|
1351
1402
|
onResizeStop: setSize,
|
|
1352
1403
|
hasLayout: hasLayout
|
|
1353
|
-
}
|
|
1404
|
+
}, minWidth && {
|
|
1405
|
+
minWidth: minWidth
|
|
1406
|
+
})
|
|
1354
1407
|
}, shouldRenderInline && {
|
|
1355
1408
|
root: {
|
|
1356
1409
|
style: {
|
|
@@ -3564,6 +3617,66 @@ var ShortcutList = function ShortcutList(_ref) {
|
|
|
3564
3617
|
type: "icon",
|
|
3565
3618
|
children: "S"
|
|
3566
3619
|
})
|
|
3620
|
+
}, {
|
|
3621
|
+
titleKey: 'shared-shortcut-open-location-search',
|
|
3622
|
+
description: jsx(ShortCutSegment, {
|
|
3623
|
+
type: "icon",
|
|
3624
|
+
children: "F"
|
|
3625
|
+
}),
|
|
3626
|
+
descriptionMac: jsx(ShortCutSegment, {
|
|
3627
|
+
type: "icon",
|
|
3628
|
+
children: "F"
|
|
3629
|
+
})
|
|
3630
|
+
}, {
|
|
3631
|
+
titleKey: 'shared-shortcut-zoom-to-location',
|
|
3632
|
+
description: jsxs(Fragment, {
|
|
3633
|
+
children: [jsx(ShortCutSegment, {
|
|
3634
|
+
type: "icon",
|
|
3635
|
+
children: "Shift"
|
|
3636
|
+
}), jsxs(ShortCutSegment, {
|
|
3637
|
+
children: [" ", t('shared-shortcut-mouse-click')]
|
|
3638
|
+
})]
|
|
3639
|
+
}),
|
|
3640
|
+
descriptionMac: jsxs(Fragment, {
|
|
3641
|
+
children: [jsx(ShortCutSegment, {
|
|
3642
|
+
type: "icon",
|
|
3643
|
+
children: "Shift"
|
|
3644
|
+
}), jsxs(ShortCutSegment, {
|
|
3645
|
+
children: [" ", t('shared-shortcut-mouse-click')]
|
|
3646
|
+
})]
|
|
3647
|
+
})
|
|
3648
|
+
}, {
|
|
3649
|
+
titleKey: 'shared-shortcut-copy-view-preset-content-split-window',
|
|
3650
|
+
description: jsxs(Fragment, {
|
|
3651
|
+
children: [jsx(ShortCutSegment, {
|
|
3652
|
+
type: "icon",
|
|
3653
|
+
children: "Shift"
|
|
3654
|
+
}), jsx(ShortCutSegment, {
|
|
3655
|
+
children: " + "
|
|
3656
|
+
}), jsx(ShortCutSegment, {
|
|
3657
|
+
children: t('shared-shortcut-split-button')
|
|
3658
|
+
})]
|
|
3659
|
+
})
|
|
3660
|
+
}, {
|
|
3661
|
+
titleKey: 'shared-shortcut-toggle-location-info',
|
|
3662
|
+
description: jsx(ShortCutSegment, {
|
|
3663
|
+
type: "icon",
|
|
3664
|
+
children: "I"
|
|
3665
|
+
}),
|
|
3666
|
+
descriptionMac: jsx(ShortCutSegment, {
|
|
3667
|
+
type: "icon",
|
|
3668
|
+
children: "I"
|
|
3669
|
+
})
|
|
3670
|
+
}, {
|
|
3671
|
+
titleKey: 'shared-shortcut-toggle-measure-tool',
|
|
3672
|
+
description: jsx(ShortCutSegment, {
|
|
3673
|
+
type: "icon",
|
|
3674
|
+
children: "M"
|
|
3675
|
+
}),
|
|
3676
|
+
descriptionMac: jsx(ShortCutSegment, {
|
|
3677
|
+
type: "icon",
|
|
3678
|
+
children: "M"
|
|
3679
|
+
})
|
|
3567
3680
|
}];
|
|
3568
3681
|
return jsx(List, {
|
|
3569
3682
|
"data-testid": "list-" + platform,
|
|
@@ -5089,13 +5202,39 @@ var FilterChip = function FilterChip(_ref) {
|
|
|
5089
5202
|
});
|
|
5090
5203
|
};
|
|
5091
5204
|
|
|
5205
|
+
var FilterToggleButton = function FilterToggleButton(_ref) {
|
|
5206
|
+
var _t, _t2;
|
|
5207
|
+
var isOpen = _ref.isOpen,
|
|
5208
|
+
onToggle = _ref.onToggle;
|
|
5209
|
+
var _useSharedTranslation = useSharedTranslation(),
|
|
5210
|
+
t = _useSharedTranslation.t;
|
|
5211
|
+
var tooltipTitle = isOpen ? (_t = t('shared-filter-hide-labels')) != null ? _t : '' : (_t2 = t('shared-filter-show-labels')) != null ? _t2 : '';
|
|
5212
|
+
return jsx(Tooltip, {
|
|
5213
|
+
title: tooltipTitle,
|
|
5214
|
+
children: jsx(CustomIconButton, {
|
|
5215
|
+
"aria-pressed": isOpen,
|
|
5216
|
+
"data-testid": "workspace-label-filter-toggle",
|
|
5217
|
+
id: "labels-filter",
|
|
5218
|
+
isSelected: isOpen,
|
|
5219
|
+
onClick: onToggle,
|
|
5220
|
+
variant: "tool",
|
|
5221
|
+
children: jsx(Filter$1, {})
|
|
5222
|
+
})
|
|
5223
|
+
});
|
|
5224
|
+
};
|
|
5225
|
+
|
|
5092
5226
|
var FilterList = function FilterList(_ref) {
|
|
5093
5227
|
var _ref$filters = _ref.filters,
|
|
5094
5228
|
filters = _ref$filters === void 0 ? [] : _ref$filters,
|
|
5095
5229
|
_ref$onChipClick = _ref.onChipClick,
|
|
5096
5230
|
onChipClick = _ref$onChipClick === void 0 ? function () {} : _ref$onChipClick,
|
|
5097
5231
|
_ref$isAllSelected = _ref.isAllSelected,
|
|
5098
|
-
isAllSelected = _ref$isAllSelected === void 0 ? false : _ref$isAllSelected
|
|
5232
|
+
isAllSelected = _ref$isAllSelected === void 0 ? false : _ref$isAllSelected,
|
|
5233
|
+
_ref$showLabelFilterT = _ref.showLabelFilterToggle,
|
|
5234
|
+
showLabelFilterToggle = _ref$showLabelFilterT === void 0 ? false : _ref$showLabelFilterT,
|
|
5235
|
+
_ref$isLabelFilterOpe = _ref.isLabelFilterOpen,
|
|
5236
|
+
isLabelFilterOpen = _ref$isLabelFilterOpe === void 0 ? false : _ref$isLabelFilterOpe,
|
|
5237
|
+
onToggleLabelFilter = _ref.onToggleLabelFilter;
|
|
5099
5238
|
var _useSharedTranslation = useSharedTranslation(),
|
|
5100
5239
|
t = _useSharedTranslation.t;
|
|
5101
5240
|
return jsxs(Stack, {
|
|
@@ -5105,9 +5244,13 @@ var FilterList = function FilterList(_ref) {
|
|
|
5105
5244
|
flexWrap: "wrap",
|
|
5106
5245
|
sx: {
|
|
5107
5246
|
gap: 1,
|
|
5108
|
-
rowGap: 1
|
|
5247
|
+
rowGap: 1,
|
|
5248
|
+
alignItems: 'center'
|
|
5109
5249
|
},
|
|
5110
|
-
children: [jsx(
|
|
5250
|
+
children: [showLabelFilterToggle && onToggleLabelFilter ? jsx(FilterToggleButton, {
|
|
5251
|
+
isOpen: isLabelFilterOpen,
|
|
5252
|
+
onToggle: onToggleLabelFilter
|
|
5253
|
+
}) : null, jsx(FilterChip, {
|
|
5111
5254
|
handleClick: function handleClick(key) {
|
|
5112
5255
|
return onChipClick(key, !isAllSelected);
|
|
5113
5256
|
},
|
|
@@ -5196,7 +5339,7 @@ var SearchField = function SearchField(_ref3) {
|
|
|
5196
5339
|
});
|
|
5197
5340
|
};
|
|
5198
5341
|
|
|
5199
|
-
var _excluded$1 = ["filters", "onClickFilterChip", "onSearch", "isAllSelected", "searchQuery"];
|
|
5342
|
+
var _excluded$1 = ["filters", "onClickFilterChip", "onSearch", "isAllSelected", "searchQuery", "showLabelFilterToggle", "isLabelFilterOpen", "onToggleLabelFilter", "showSearchField"];
|
|
5200
5343
|
var DEFAULT_FILTER_HEIGHT = 85;
|
|
5201
5344
|
var Filter = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
|
|
5202
5345
|
var filters = _ref.filters,
|
|
@@ -5205,7 +5348,13 @@ var Filter = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
|
|
|
5205
5348
|
_ref$onSearch = _ref.onSearch,
|
|
5206
5349
|
onSearch = _ref$onSearch === void 0 ? function () {} : _ref$onSearch,
|
|
5207
5350
|
isAllSelected = _ref.isAllSelected,
|
|
5208
|
-
searchQuery = _ref.searchQuery
|
|
5351
|
+
searchQuery = _ref.searchQuery;
|
|
5352
|
+
_ref.showLabelFilterToggle;
|
|
5353
|
+
var _ref$isLabelFilterOpe = _ref.isLabelFilterOpen,
|
|
5354
|
+
isLabelFilterOpen = _ref$isLabelFilterOpe === void 0 ? false : _ref$isLabelFilterOpe,
|
|
5355
|
+
onToggleLabelFilter = _ref.onToggleLabelFilter,
|
|
5356
|
+
_ref$showSearchField = _ref.showSearchField,
|
|
5357
|
+
showSearchField = _ref$showSearchField === void 0 ? true : _ref$showSearchField,
|
|
5209
5358
|
props = _objectWithoutPropertiesLoose(_ref, _excluded$1);
|
|
5210
5359
|
return jsx(Box, {
|
|
5211
5360
|
ref: ref,
|
|
@@ -5215,13 +5364,16 @@ var Filter = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
|
|
|
5215
5364
|
}, Array.isArray(props.sx) ? Object.assign.apply(Object, [{}].concat(props.sx)) : props.sx),
|
|
5216
5365
|
children: jsxs(Stack, {
|
|
5217
5366
|
spacing: 1,
|
|
5218
|
-
children: [jsx(SearchField, {
|
|
5367
|
+
children: [showSearchField ? jsx(SearchField, {
|
|
5219
5368
|
value: searchQuery,
|
|
5220
5369
|
valueChanged: onSearch
|
|
5221
|
-
}), jsx(FilterList, {
|
|
5370
|
+
}) : null, jsx(FilterList, {
|
|
5222
5371
|
filters: filters,
|
|
5223
5372
|
isAllSelected: isAllSelected,
|
|
5224
|
-
|
|
5373
|
+
isLabelFilterOpen: isLabelFilterOpen,
|
|
5374
|
+
onChipClick: onClickFilterChip,
|
|
5375
|
+
onToggleLabelFilter: onToggleLabelFilter,
|
|
5376
|
+
showLabelFilterToggle: true
|
|
5225
5377
|
})]
|
|
5226
5378
|
})
|
|
5227
5379
|
});
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@opengeoweb/shared",
|
|
3
|
-
"version": "14.
|
|
3
|
+
"version": "14.4.0",
|
|
4
4
|
"description": "GeoWeb shared library with shared components and utils for the opengeoweb project",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"repository": {
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
"url": "git@gitlab.com:opengeoweb/opengeoweb.git"
|
|
9
9
|
},
|
|
10
10
|
"dependencies": {
|
|
11
|
-
"@opengeoweb/theme": "14.
|
|
11
|
+
"@opengeoweb/theme": "14.4.0",
|
|
12
12
|
"react-draggable": "^4.4.6",
|
|
13
13
|
"re-resizable": "^6.9.11",
|
|
14
14
|
"lodash": "^4.17.21",
|
|
@@ -12,6 +12,7 @@ export interface CustomDialogProps extends DialogProps {
|
|
|
12
12
|
hasLayout?: boolean;
|
|
13
13
|
shouldRenderInline?: boolean;
|
|
14
14
|
headerActions?: HeaderAction[];
|
|
15
|
+
minWidth?: number | string;
|
|
15
16
|
}
|
|
16
17
|
export declare const CustomDialog: React.FC<CustomDialogProps>;
|
|
17
18
|
export default CustomDialog;
|
|
@@ -8,6 +8,8 @@ export interface CustomIconProps extends IconButtonProps {
|
|
|
8
8
|
isSelected?: boolean;
|
|
9
9
|
shouldShowAsDisabled?: boolean;
|
|
10
10
|
tooltipProps?: TooltipProps;
|
|
11
|
+
shouldShowExtraOptionsIndicator?: boolean;
|
|
12
|
+
optionsActive?: boolean;
|
|
11
13
|
}
|
|
12
14
|
export declare const CustomIconButton: React.MemoExoticComponent<React.ForwardRefExoticComponent<Omit<CustomIconProps, "ref"> & React.RefAttributes<HTMLButtonElement>>>;
|
|
13
15
|
export {};
|
|
@@ -8,6 +8,10 @@ interface FilterProps extends BoxProps {
|
|
|
8
8
|
onSearch?: (value: string) => void;
|
|
9
9
|
isAllSelected?: boolean;
|
|
10
10
|
searchQuery?: string;
|
|
11
|
+
showLabelFilterToggle?: boolean;
|
|
12
|
+
isLabelFilterOpen?: boolean;
|
|
13
|
+
onToggleLabelFilter?: () => void;
|
|
14
|
+
showSearchField?: boolean;
|
|
11
15
|
}
|
|
12
16
|
declare const Filter: React.ForwardRefExoticComponent<Omit<FilterProps, "ref"> & React.RefAttributes<HTMLElement>>;
|
|
13
17
|
export default Filter;
|
|
@@ -10,6 +10,9 @@ interface FilterListProps {
|
|
|
10
10
|
filters?: ListFilter[];
|
|
11
11
|
onChipClick?: (id: string, selected: boolean) => void;
|
|
12
12
|
isAllSelected?: boolean;
|
|
13
|
+
showLabelFilterToggle?: boolean;
|
|
14
|
+
isLabelFilterOpen?: boolean;
|
|
15
|
+
onToggleLabelFilter?: () => void;
|
|
13
16
|
}
|
|
14
17
|
declare const FilterList: React.FC<FilterListProps>;
|
|
15
18
|
export default FilterList;
|
package/src/lib/types/types.d.ts
CHANGED
package/src/lib/utils/i18n.d.ts
CHANGED
|
@@ -9,6 +9,6 @@ interface TranslationToLoad {
|
|
|
9
9
|
export declare const loadAllTranslations: (i18nInstance: typeof i18n, translationsToLoad: TranslationToLoad[]) => void;
|
|
10
10
|
export declare const safelyInitI18nForTestsAndStories: (i18nInstance: typeof i18n, namespace: string, translationsToLoad: TranslationToLoad[], initLanguage?: string) => void;
|
|
11
11
|
export declare const initSharedI18n: () => void;
|
|
12
|
-
export declare const
|
|
12
|
+
export declare const translateInTestsAndStories: (key: string, params?: Record<string, string | number> | undefined) => string;
|
|
13
13
|
export declare const useSharedTranslation: () => UseTranslationResponse<typeof SHARED_NAMESPACE, typeof i18n>;
|
|
14
14
|
export { i18n };
|