@mtes-mct/monitor-ui 8.3.0 → 8.5.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/CHANGELOG.md CHANGED
@@ -1,3 +1,29 @@
1
+ # [8.4.0](https://github.com/MTES-MCT/monitor-ui/compare/v8.3.0...v8.4.0) (2023-08-17)
2
+
3
+
4
+ ### Bug Fixes
5
+
6
+ * **ci:** fix ci for dependabot ([d386c4d](https://github.com/MTES-MCT/monitor-ui/commit/d386c4d952a0695678475af7f4c727dfd35b4948))
7
+ * **components:** fix MapMenuModal z-index ([802e9fa](https://github.com/MTES-MCT/monitor-ui/commit/802e9fa32561932823fa0eaf4a5931a709454859))
8
+ * **components:** fix MapMenuModal.Footer z-index ([03f55fc](https://github.com/MTES-MCT/monitor-ui/commit/03f55fca037894f3e6abe2082c0456b6666130de))
9
+ * **components:** fix SingleTag component max size ([fb20e3a](https://github.com/MTES-MCT/monitor-ui/commit/fb20e3a87af185c7fa2ba218a865e71f1985da48))
10
+ * **fields:** add style for single calendar in DateRangePicker component ([f70380f](https://github.com/MTES-MCT/monitor-ui/commit/f70380f2de3ca7a82b4a265ed042ea8694d07a13))
11
+ * **fields:** update dateRangePicker style ([8a783a8](https://github.com/MTES-MCT/monitor-ui/commit/8a783a850c21ef3b787218fdd2778d7e21a10677))
12
+ * **tests:** update DateRangePicker story ([c20a373](https://github.com/MTES-MCT/monitor-ui/commit/c20a373c37e487b2d5cdc0bdf7d70feedf2089ea))
13
+
14
+
15
+ ### Features
16
+
17
+ * **fields:** add showOneCalendar prop to DateRangerPicker component ([804296a](https://github.com/MTES-MCT/monitor-ui/commit/804296afb955f329f0cd55973d8d1c7ea28db9fc))
18
+
19
+ # [8.3.0](https://github.com/MTES-MCT/monitor-ui/compare/v8.2.0...v8.3.0) (2023-08-11)
20
+
21
+
22
+ ### Features
23
+
24
+ * **component:** create MapMenuModal component ([07ff8b5](https://github.com/MTES-MCT/monitor-ui/commit/07ff8b5f41a9367e3131b47e904a6861d5f8c752))
25
+ * **components:** create secondary accent for single tag component ([259bb32](https://github.com/MTES-MCT/monitor-ui/commit/259bb3206f31231ba4af755c2f083c287e1136b4))
26
+
1
27
  # [8.2.0](https://github.com/MTES-MCT/monitor-ui/compare/v8.1.1...v8.2.0) (2023-08-10)
2
28
 
3
29
 
package/index.js CHANGED
@@ -1913,6 +1913,39 @@ _curry1(function empty(x) {
1913
1913
  ;
1914
1914
  });
1915
1915
 
1916
+ /**
1917
+ * Creates a new object from a list key-value pairs. If a key appears in
1918
+ * multiple pairs, the rightmost pair is included in the object.
1919
+ *
1920
+ * @func
1921
+ * @memberOf R
1922
+ * @since v0.3.0
1923
+ * @category List
1924
+ * @sig [[k,v]] -> {k: v}
1925
+ * @param {Array} pairs An array of two-element arrays that will be the keys and values of the output object.
1926
+ * @return {Object} The object made by pairing up `keys` and `values`.
1927
+ * @see R.toPairs, R.pair
1928
+ * @example
1929
+ *
1930
+ * R.fromPairs([['a', 1], ['b', 2], ['c', 3]]); //=> {a: 1, b: 2, c: 3}
1931
+ */
1932
+
1933
+ var fromPairs =
1934
+ /*#__PURE__*/
1935
+ _curry1(function fromPairs(pairs) {
1936
+ var result = {};
1937
+ var idx = 0;
1938
+
1939
+ while (idx < pairs.length) {
1940
+ result[pairs[idx][0]] = pairs[idx][1];
1941
+ idx += 1;
1942
+ }
1943
+
1944
+ return result;
1945
+ });
1946
+
1947
+ var fromPairs$1 = fromPairs;
1948
+
1916
1949
  /**
1917
1950
  * Returns `true` if the specified value is equal, in [`R.equals`](#equals)
1918
1951
  * terms, to at least one element of the given list; `false` otherwise.
@@ -2095,6 +2128,41 @@ _curry2(function mergeDeepRight(lObj, rObj) {
2095
2128
 
2096
2129
  var mergeDeepRight$1 = mergeDeepRight;
2097
2130
 
2131
+ /**
2132
+ * Converts an object into an array of key, value arrays. Only the object's
2133
+ * own properties are used.
2134
+ * Note that the order of the output array is not guaranteed to be consistent
2135
+ * across different JS platforms.
2136
+ *
2137
+ * @func
2138
+ * @memberOf R
2139
+ * @since v0.4.0
2140
+ * @category Object
2141
+ * @sig {String: *} -> [[String,*]]
2142
+ * @param {Object} obj The object to extract from
2143
+ * @return {Array} An array of key, value arrays from the object's own properties.
2144
+ * @see R.fromPairs, R.keys, R.values
2145
+ * @example
2146
+ *
2147
+ * R.toPairs({a: 1, b: 2, c: 3}); //=> [['a', 1], ['b', 2], ['c', 3]]
2148
+ */
2149
+
2150
+ var toPairs =
2151
+ /*#__PURE__*/
2152
+ _curry1(function toPairs(obj) {
2153
+ var pairs = [];
2154
+
2155
+ for (var prop in obj) {
2156
+ if (_has(prop, obj)) {
2157
+ pairs[pairs.length] = [prop, obj[prop]];
2158
+ }
2159
+ }
2160
+
2161
+ return pairs;
2162
+ });
2163
+
2164
+ var toPairs$1 = toPairs;
2165
+
2098
2166
  const UntypedStyledComponentsThemeProvider = ThemeProvider$1;
2099
2167
  function ThemeProvider({ children, theme = {} }) {
2100
2168
  const finalTheme = mergeDeepRight$1(THEME, theme);
@@ -3394,6 +3462,7 @@ function SingleTag({ accent = Accent.PRIMARY, children, className, onDelete, ...
3394
3462
  const Box$g = styled.div `
3395
3463
  align-items: center;
3396
3464
  display: inline-flex;
3465
+ max-width: 100%;
3397
3466
  `;
3398
3467
  const PrimaryText = styled.span `
3399
3468
  background-color: ${p => p.theme.color.lightGray};
@@ -3494,6 +3563,7 @@ const Footer = styled.div `
3494
3563
  position: absolute;
3495
3564
  bottom: 0;
3496
3565
  width: 100%;
3566
+ z-index: 10;
3497
3567
  `;
3498
3568
  const MapMenuModal = {
3499
3569
  Body,
@@ -22270,7 +22340,7 @@ function sortDates(dates) {
22270
22340
  .map(dateAsIsoString => customDayjs(dateAsIsoString).toDate());
22271
22341
  }
22272
22342
 
22273
- function RangeCalendarPicker({ defaultValue, isHistorical, isOpen, onChange }) {
22343
+ function RangeCalendarPicker({ defaultValue, hasSingleCalendar = false, isHistorical, isOpen, onChange }) {
22274
22344
  const boxRef = useRef();
22275
22345
  // It's called "first" and "second" because the calendar can also be picked from right to left,
22276
22346
  // that's why we sort these first and second dates before calling `onChange()`
@@ -22302,7 +22372,7 @@ function RangeCalendarPicker({ defaultValue, isHistorical, isOpen, onChange }) {
22302
22372
  // and can be used as a container for <RsuiteDateRangePicker />
22303
22373
  forceUpdate();
22304
22374
  }, [forceUpdate]);
22305
- return (jsx(Box$7, { ref: boxRef, onClick: stopMouseEventPropagation, children: boxRef.current && (jsx(DateRangePicker$1, { container: boxRef.current, format: "yyyy-MM-dd", locale: RSUITE_CALENDAR_LOCALE, onSelect: handleSelect, open: isOpen, ranges: [], shouldDisableDate: shouldDisableDate,
22375
+ return (jsx(Box$7, { ref: boxRef, onClick: stopMouseEventPropagation, children: boxRef.current && (jsx(DateRangePicker$1, { container: boxRef.current, format: "yyyy-MM-dd", locale: RSUITE_CALENDAR_LOCALE, onSelect: handleSelect, open: isOpen, ranges: [], shouldDisableDate: shouldDisableDate, showOneCalendar: hasSingleCalendar,
22306
22376
  // `defaultValue` seems to be immediatly cancelled so we come down to using a controlled `value`
22307
22377
  // eslint-disable-next-line no-null/no-null
22308
22378
  value: controlledValue ?? null })) }));
@@ -22335,15 +22405,17 @@ const Box$7 = styled.div `
22335
22405
  box-shadow: inset 0px 0px 0px 1px ${p => p.theme.color.lightGray};
22336
22406
  border-radius: 0;
22337
22407
  margin-top: 2px;
22338
- width: 495px;
22339
22408
 
22340
22409
  .rs-picker-daterange-header,
22341
22410
  .rs-calendar-header-time-toolbar,
22342
22411
  .rs-picker-toolbar {
22343
22412
  display: none;
22344
22413
  }
22345
-
22346
22414
  .rs-picker-daterange-calendar-group {
22415
+ min-width: 495px;
22416
+ }
22417
+ .rs-picker-daterange-calendar-group,
22418
+ .rs-picker-daterange-calendar-single {
22347
22419
  height: auto;
22348
22420
 
22349
22421
  > .rs-calendar {
@@ -22477,7 +22549,7 @@ var DateRangePosition;
22477
22549
  DateRangePosition["START"] = "START";
22478
22550
  })(DateRangePosition || (DateRangePosition = {}));
22479
22551
 
22480
- function DateRangePicker({ baseContainer, className, defaultValue, disabled = false, error, isCompact = false, isErrorMessageHidden = false, isHistorical = false, isLabelHidden = false, isLight = false, isStringDate = false, isUndefinedWhenDisabled = false, label, minutesRange = 15, onChange, style, withTime = false, ...nativeProps }) {
22552
+ function DateRangePicker({ baseContainer, className, defaultValue, disabled = false, error, hasSingleCalendar = false, isCompact = false, isErrorMessageHidden = false, isHistorical = false, isLabelHidden = false, isLight = false, isStringDate = false, isUndefinedWhenDisabled = false, label, minutesRange = 15, onChange, style, withTime = false, ...nativeProps }) {
22481
22553
  /* eslint-disable no-null/no-null */
22482
22554
  const startDateInputRef = useRef(null);
22483
22555
  const startTimeInputRef = useRef(null);
@@ -22695,7 +22767,7 @@ function DateRangePicker({ baseContainer, className, defaultValue, disabled = fa
22695
22767
  selectedEndTimeTupleRef.current = getUtcTimeTupleFromDayjs(selectedEndDateTimeAsDayjsRef.current);
22696
22768
  forceUpdate();
22697
22769
  }, [defaultValue, forceUpdate, previousDefaultValue]);
22698
- return (jsxs(Fieldset, { className: controlledClassName, disabled: disabled, hasError: hasError, isLegendHidden: isLabelHidden, legend: label, style: style, ...nativeProps, children: [jsxs(Box$6, { "$hasError": hasError, "$isDisabled": disabled, children: [jsx(Field, { children: jsx(DateInput, { ref: startDateInputRef, baseContainer: baseContainer || undefined, disabled: disabled, isCompact: isCompact, isForcedFocused: isRangeCalendarPickerOpen, isLight: isLight, isRange: true, isStartDate: true, onChange: (nextDateTuple, isFilled) => handleDateInputChange(DateRangePosition.START, nextDateTuple, isFilled), onClick: openRangeCalendarPicker, onInput: callOnChangeUndefinedIfInputsAreEmpty, onNext: handleStartDateInputNext, value: selectedStartDateTupleRef.current }) }), withTime && (jsx(Field, { isTimeField: true, children: jsx(TimeInput, { ref: startTimeInputRef, baseContainer: baseContainer || undefined, disabled: disabled, isCompact: isCompact, isLight: isLight, isStartDate: true, minutesRange: minutesRange, onBack: () => startDateInputRef.current?.focus(true), onChange: nextTimeTuple => handleTimeInputChange(DateRangePosition.START, nextTimeTuple), onFocus: closeRangeCalendarPicker, onInput: callOnChangeUndefinedIfInputsAreEmpty, onNext: () => endDateInputRef.current?.focus(), onPrevious: () => startDateInputRef.current?.focus(true), value: selectedStartTimeTupleRef.current }) })), jsx(Field, { isEndDateField: true, children: jsx(DateInput, { ref: endDateInputRef, baseContainer: baseContainer || undefined, disabled: disabled, isCompact: isCompact, isEndDate: true, isForcedFocused: isRangeCalendarPickerOpen, isLight: isLight, isRange: true, onBack: handleEndDateInputPrevious, onChange: (nextDateTuple, isFilled) => handleDateInputChange(DateRangePosition.END, nextDateTuple, isFilled), onClick: openRangeCalendarPicker, onInput: callOnChangeUndefinedIfInputsAreEmpty, onNext: handleEndDateInputNext, onPrevious: handleEndDateInputPrevious, value: selectedEndDateTupleRef.current }) }), withTime && (jsx(Field, { isTimeField: true, children: jsx(TimeInput, { ref: endTimeInputRef, baseContainer: baseContainer || undefined, disabled: disabled, isCompact: isCompact, isEndDate: true, isLight: isLight, minutesRange: minutesRange, onBack: () => endDateInputRef.current?.focus(true), onChange: nextTimeTuple => handleTimeInputChange(DateRangePosition.END, nextTimeTuple), onFocus: closeRangeCalendarPicker, onInput: callOnChangeUndefinedIfInputsAreEmpty, onPrevious: () => endDateInputRef.current?.focus(true), value: selectedEndTimeTupleRef.current }) }))] }), !isErrorMessageHidden && hasError && jsx(FieldError, { children: controlledError }), jsx(RangeCalendarPicker, { defaultValue: rangeCalendarPickerDefaultValue, isHistorical: isHistorical, isOpen: isRangeCalendarPickerOpen, onChange: handleRangeCalendarPickerChange }, JSON.stringify(rangeCalendarPickerDefaultValue))] }));
22770
+ return (jsxs(Fieldset, { className: controlledClassName, disabled: disabled, hasError: hasError, isLegendHidden: isLabelHidden, legend: label, style: style, ...nativeProps, children: [jsxs(Box$6, { "$hasError": hasError, "$isDisabled": disabled, children: [jsx(Field, { children: jsx(DateInput, { ref: startDateInputRef, baseContainer: baseContainer || undefined, disabled: disabled, isCompact: isCompact, isForcedFocused: isRangeCalendarPickerOpen, isLight: isLight, isRange: true, isStartDate: true, onChange: (nextDateTuple, isFilled) => handleDateInputChange(DateRangePosition.START, nextDateTuple, isFilled), onClick: openRangeCalendarPicker, onInput: callOnChangeUndefinedIfInputsAreEmpty, onNext: handleStartDateInputNext, value: selectedStartDateTupleRef.current }) }), withTime && (jsx(Field, { isTimeField: true, children: jsx(TimeInput, { ref: startTimeInputRef, baseContainer: baseContainer || undefined, disabled: disabled, isCompact: isCompact, isLight: isLight, isStartDate: true, minutesRange: minutesRange, onBack: () => startDateInputRef.current?.focus(true), onChange: nextTimeTuple => handleTimeInputChange(DateRangePosition.START, nextTimeTuple), onFocus: closeRangeCalendarPicker, onInput: callOnChangeUndefinedIfInputsAreEmpty, onNext: () => endDateInputRef.current?.focus(), onPrevious: () => startDateInputRef.current?.focus(true), value: selectedStartTimeTupleRef.current }) })), jsx(Field, { isEndDateField: true, children: jsx(DateInput, { ref: endDateInputRef, baseContainer: baseContainer || undefined, disabled: disabled, isCompact: isCompact, isEndDate: true, isForcedFocused: isRangeCalendarPickerOpen, isLight: isLight, isRange: true, onBack: handleEndDateInputPrevious, onChange: (nextDateTuple, isFilled) => handleDateInputChange(DateRangePosition.END, nextDateTuple, isFilled), onClick: openRangeCalendarPicker, onInput: callOnChangeUndefinedIfInputsAreEmpty, onNext: handleEndDateInputNext, onPrevious: handleEndDateInputPrevious, value: selectedEndDateTupleRef.current }) }), withTime && (jsx(Field, { isTimeField: true, children: jsx(TimeInput, { ref: endTimeInputRef, baseContainer: baseContainer || undefined, disabled: disabled, isCompact: isCompact, isEndDate: true, isLight: isLight, minutesRange: minutesRange, onBack: () => endDateInputRef.current?.focus(true), onChange: nextTimeTuple => handleTimeInputChange(DateRangePosition.END, nextTimeTuple), onFocus: closeRangeCalendarPicker, onInput: callOnChangeUndefinedIfInputsAreEmpty, onPrevious: () => endDateInputRef.current?.focus(true), value: selectedEndTimeTupleRef.current }) }))] }), !isErrorMessageHidden && hasError && jsx(FieldError, { children: controlledError }), jsx(RangeCalendarPicker, { defaultValue: rangeCalendarPickerDefaultValue, hasSingleCalendar: hasSingleCalendar, isHistorical: isHistorical, isOpen: isRangeCalendarPickerOpen, onChange: handleRangeCalendarPickerChange }, JSON.stringify(rangeCalendarPickerDefaultValue))] }));
22699
22771
  }
22700
22772
  const Box$6 = styled.div `
22701
22773
  * {
@@ -23110,7 +23182,7 @@ diacritics.diacriticsMap = diacriticsMap;
23110
23182
  * http://www.apache.org/licenses/LICENSE-2.0
23111
23183
  */
23112
23184
 
23113
- function isArray(value) {
23185
+ function isArray$1(value) {
23114
23186
  return !Array.isArray
23115
23187
  ? getTag(value) === '[object Array]'
23116
23188
  : Array.isArray(value)
@@ -23148,16 +23220,16 @@ function isBoolean(value) {
23148
23220
  )
23149
23221
  }
23150
23222
 
23151
- function isObject$1(value) {
23223
+ function isObject$2(value) {
23152
23224
  return typeof value === 'object'
23153
23225
  }
23154
23226
 
23155
23227
  // Checks if `value` is object-like.
23156
23228
  function isObjectLike(value) {
23157
- return isObject$1(value) && value !== null
23229
+ return isObject$2(value) && value !== null
23158
23230
  }
23159
23231
 
23160
- function isDefined(value) {
23232
+ function isDefined$1(value) {
23161
23233
  return value !== undefined && value !== null
23162
23234
  }
23163
23235
 
@@ -23233,7 +23305,7 @@ function createKey(key) {
23233
23305
  let weight = 1;
23234
23306
  let getFn = null;
23235
23307
 
23236
- if (isString$2(key) || isArray(key)) {
23308
+ if (isString$2(key) || isArray$1(key)) {
23237
23309
  src = key;
23238
23310
  path = createKeyPath(key);
23239
23311
  id = createKeyId(key);
@@ -23262,11 +23334,11 @@ function createKey(key) {
23262
23334
  }
23263
23335
 
23264
23336
  function createKeyPath(key) {
23265
- return isArray(key) ? key : key.split('.')
23337
+ return isArray$1(key) ? key : key.split('.')
23266
23338
  }
23267
23339
 
23268
23340
  function createKeyId(key) {
23269
- return isArray(key) ? key.join('.') : key
23341
+ return isArray$1(key) ? key.join('.') : key
23270
23342
  }
23271
23343
 
23272
23344
  function get$3(obj, path) {
@@ -23274,7 +23346,7 @@ function get$3(obj, path) {
23274
23346
  let arr = false;
23275
23347
 
23276
23348
  const deepGet = (obj, path, index) => {
23277
- if (!isDefined(obj)) {
23349
+ if (!isDefined$1(obj)) {
23278
23350
  return
23279
23351
  }
23280
23352
  if (!path[index]) {
@@ -23285,7 +23357,7 @@ function get$3(obj, path) {
23285
23357
 
23286
23358
  const value = obj[key];
23287
23359
 
23288
- if (!isDefined(value)) {
23360
+ if (!isDefined$1(value)) {
23289
23361
  return
23290
23362
  }
23291
23363
 
@@ -23296,7 +23368,7 @@ function get$3(obj, path) {
23296
23368
  (isString$2(value) || isNumber(value) || isBoolean(value))
23297
23369
  ) {
23298
23370
  list.push(toString(value));
23299
- } else if (isArray(value)) {
23371
+ } else if (isArray$1(value)) {
23300
23372
  arr = true;
23301
23373
  // Search each item in the array.
23302
23374
  for (let i = 0, len = value.length; i < len; i += 1) {
@@ -23484,7 +23556,7 @@ class FuseIndex {
23484
23556
  return this.records.length
23485
23557
  }
23486
23558
  _addString(doc, docIndex) {
23487
- if (!isDefined(doc) || isBlank(doc)) {
23559
+ if (!isDefined$1(doc) || isBlank(doc)) {
23488
23560
  return
23489
23561
  }
23490
23562
 
@@ -23503,18 +23575,18 @@ class FuseIndex {
23503
23575
  this.keys.forEach((key, keyIndex) => {
23504
23576
  let value = key.getFn ? key.getFn(doc) : this.getFn(doc, key.path);
23505
23577
 
23506
- if (!isDefined(value)) {
23578
+ if (!isDefined$1(value)) {
23507
23579
  return
23508
23580
  }
23509
23581
 
23510
- if (isArray(value)) {
23582
+ if (isArray$1(value)) {
23511
23583
  let subRecords = [];
23512
23584
  const stack = [{ nestedArrIndex: -1, value }];
23513
23585
 
23514
23586
  while (stack.length) {
23515
23587
  const { nestedArrIndex, value } = stack.pop();
23516
23588
 
23517
- if (!isDefined(value)) {
23589
+ if (!isDefined$1(value)) {
23518
23590
  continue
23519
23591
  }
23520
23592
 
@@ -23526,7 +23598,7 @@ class FuseIndex {
23526
23598
  };
23527
23599
 
23528
23600
  subRecords.push(subRecord);
23529
- } else if (isArray(value)) {
23601
+ } else if (isArray$1(value)) {
23530
23602
  value.forEach((item, k) => {
23531
23603
  stack.push({
23532
23604
  nestedArrIndex: k,
@@ -24452,7 +24524,7 @@ const isExpression = (query) =>
24452
24524
  const isPath = (query) => !!query[KeyType.PATH];
24453
24525
 
24454
24526
  const isLeaf = (query) =>
24455
- !isArray(query) && isObject$1(query) && !isExpression(query);
24527
+ !isArray$1(query) && isObject$2(query) && !isExpression(query);
24456
24528
 
24457
24529
  const convertToExplicit = (query) => ({
24458
24530
  [LogicalOperator.AND]: Object.keys(query).map((key) => ({
@@ -24501,7 +24573,7 @@ function parse(query, options, { auto = true } = {}) {
24501
24573
  keys.forEach((key) => {
24502
24574
  const value = query[key];
24503
24575
 
24504
- if (isArray(value)) {
24576
+ if (isArray$1(value)) {
24505
24577
  value.forEach((item) => {
24506
24578
  node.children.push(next(item));
24507
24579
  });
@@ -24543,12 +24615,12 @@ function transformMatches(result, data) {
24543
24615
  const matches = result.matches;
24544
24616
  data.matches = [];
24545
24617
 
24546
- if (!isDefined(matches)) {
24618
+ if (!isDefined$1(matches)) {
24547
24619
  return
24548
24620
  }
24549
24621
 
24550
24622
  matches.forEach((match) => {
24551
- if (!isDefined(match.indices) || !match.indices.length) {
24623
+ if (!isDefined$1(match.indices) || !match.indices.length) {
24552
24624
  return
24553
24625
  }
24554
24626
 
@@ -24638,7 +24710,7 @@ class Fuse {
24638
24710
  }
24639
24711
 
24640
24712
  add(doc) {
24641
- if (!isDefined(doc)) {
24713
+ if (!isDefined$1(doc)) {
24642
24714
  return
24643
24715
  }
24644
24716
 
@@ -24710,7 +24782,7 @@ class Fuse {
24710
24782
 
24711
24783
  // Iterate over every string in the index
24712
24784
  records.forEach(({ v: text, i: idx, n: norm }) => {
24713
- if (!isDefined(text)) {
24785
+ if (!isDefined$1(text)) {
24714
24786
  return
24715
24787
  }
24716
24788
 
@@ -24773,7 +24845,7 @@ class Fuse {
24773
24845
  const results = [];
24774
24846
 
24775
24847
  records.forEach(({ $: item, i: idx }) => {
24776
- if (isDefined(item)) {
24848
+ if (isDefined$1(item)) {
24777
24849
  let expResults = evaluate(expression, item, idx);
24778
24850
 
24779
24851
  if (expResults.length) {
@@ -24799,7 +24871,7 @@ class Fuse {
24799
24871
 
24800
24872
  // List is Array<Object>
24801
24873
  records.forEach(({ $: item, i: idx }) => {
24802
- if (!isDefined(item)) {
24874
+ if (!isDefined$1(item)) {
24803
24875
  return
24804
24876
  }
24805
24877
 
@@ -24828,15 +24900,15 @@ class Fuse {
24828
24900
  return results
24829
24901
  }
24830
24902
  _findMatches({ key, value, searcher }) {
24831
- if (!isDefined(value)) {
24903
+ if (!isDefined$1(value)) {
24832
24904
  return []
24833
24905
  }
24834
24906
 
24835
24907
  let matches = [];
24836
24908
 
24837
- if (isArray(value)) {
24909
+ if (isArray$1(value)) {
24838
24910
  value.forEach(({ v: text, i: idx, n: norm }) => {
24839
- if (!isDefined(text)) {
24911
+ if (!isDefined$1(text)) {
24840
24912
  return
24841
24913
  }
24842
24914
 
@@ -31646,7 +31718,7 @@ function isString(str) {
31646
31718
  }
31647
31719
 
31648
31720
  /** Checks if value is object */
31649
- function isObject(obj) {
31721
+ function isObject$1(obj) {
31650
31722
  var _obj$constructor;
31651
31723
  return typeof obj === 'object' && obj != null && (obj == null || (_obj$constructor = obj.constructor) == null ? void 0 : _obj$constructor.name) === 'Object';
31652
31724
  }
@@ -31850,7 +31922,7 @@ function normalizeOpts(opts) {
31850
31922
  ...instanceOpts
31851
31923
  } = opts instanceof IMask.Masked ? {
31852
31924
  mask: opts
31853
- } : isObject(opts) && opts.mask instanceof IMask.Masked ? opts : {};
31925
+ } : isObject$1(opts) && opts.mask instanceof IMask.Masked ? opts : {};
31854
31926
  if (mask) {
31855
31927
  const _mask = mask.mask;
31856
31928
  return {
@@ -31861,7 +31933,7 @@ function normalizeOpts(opts) {
31861
31933
  };
31862
31934
  }
31863
31935
  }
31864
- if (!isObject(opts)) return {
31936
+ if (!isObject$1(opts)) return {
31865
31937
  mask: opts
31866
31938
  };
31867
31939
  return {
@@ -36540,6 +36612,38 @@ function useNewWindow() {
36540
36612
  return contextValue;
36541
36613
  }
36542
36614
 
36615
+ function getOptionsFromIdAndName(collection) {
36616
+ return collection?.map(({ id, name }) => ({
36617
+ label: name,
36618
+ value: id
36619
+ }));
36620
+ }
36621
+
36622
+ function getOptionsFromLabelledEnum(labelledEnum) {
36623
+ return fp.sortBy(['label'], Object.entries(labelledEnum).map(([value, label]) => ({
36624
+ label,
36625
+ value
36626
+ })));
36627
+ }
36628
+
36629
+ function isArray(value) {
36630
+ // eslint-disable-next-line no-null/no-null
36631
+ return typeof value === 'object' && value !== null && Array.isArray(value);
36632
+ }
36633
+
36634
+ /**
36635
+ * Is the value defined and non-null?
36636
+ */
36637
+ function isDefined(value) {
36638
+ // eslint-disable-next-line no-null/no-null
36639
+ return value !== undefined && value !== null;
36640
+ }
36641
+
36642
+ function isObject(value) {
36643
+ // eslint-disable-next-line no-null/no-null
36644
+ return typeof value === 'object' && value !== null && !Array.isArray(value) && value.constructor.name === 'Object';
36645
+ }
36646
+
36543
36647
  /* eslint-disable no-console */
36544
36648
  function logSoftError({ context = {}, isSideWindowError = false, message, originalError, userMessage }) {
36545
36649
  console.group(`Soft Error: ${message}`);
@@ -36561,5 +36665,57 @@ function logSoftError({ context = {}, isSideWindowError = false, message, origin
36561
36665
  }
36562
36666
  }
36563
36667
 
36564
- export { Accent, Button$1 as Button, Checkbox, CoordinatesFormat, CoordinatesInput, CustomSearch, DatePicker, DateRangePicker, Dialog, Dropdown, Field$2 as Field, FieldError, Fieldset, FormikCheckbox, FormikCoordinatesInput, FormikDatePicker, FormikDateRangePicker, FormikEffect, FormikMultiCheckbox, FormikMultiRadio, FormikMultiSelect, FormikNumberInput, FormikSearch, FormikSelect, FormikTextInput, FormikTextarea, GlobalStyle, index as Icon, IconButton, Label, Legend, MapMenuModal, MultiCheckbox, MultiRadio, MultiSelect, MultiZoneEditor, NewWindow, NewWindowContext, NotificationEvent, Notifier, NumberInput, OPENLAYERS_PROJECTION, OnlyFontGlobalStyle, Search, Select, SideMenu, SimpleTable, SingleTag, Size, THEME, TableWithSelectableRows, Tag, TagBullet, TagGroup, TextInput, Textarea, ThemeProvider, WSG84_PROJECTION, coordinatesAreDistinct, customDayjs, getCoordinates, getLocalizedDayjs, getPseudoRandomString, getUtcizedDayjs, isNumeric, logSoftError, stopMouseEventPropagation, useClickOutsideEffect, useFieldControl, useForceUpdate, useKey, useNewWindow, usePrevious };
36668
+ /* eslint-disable no-null/no-null */
36669
+ const nullifyArrayValues = (list) => list.map(nullify);
36670
+ const nullifyObjectProps = (record) => pipe$1(toPairs$1, map$1(nullifyObjectPropPair), fromPairs$1)(record);
36671
+ const nullifyObjectPropPair = ([key, value]) => [key, nullify(value)];
36672
+ /**
36673
+ * Transform all `undefined` values into `null` ones in any type of value
36674
+ *
36675
+ * @description
36676
+ * The value must be of native type and only contains native types.
36677
+ */
36678
+ function nullify(value) {
36679
+ if (value === null || value === undefined) {
36680
+ return null;
36681
+ }
36682
+ if (typeof value === 'object') {
36683
+ if (isArray(value)) {
36684
+ return nullifyArrayValues(value);
36685
+ }
36686
+ if (isObject(value)) {
36687
+ return nullifyObjectProps(value);
36688
+ }
36689
+ throw new Error(`Can't handle type \`${value.constructor.name}\`.`);
36690
+ }
36691
+ return value;
36692
+ }
36693
+
36694
+ /* eslint-disable no-null/no-null */
36695
+ const undefineArrayValues = (list) => list.map(undefine);
36696
+ const undefineObjectProps = (record) => pipe$1(toPairs$1, map$1(undefineObjectPropPair), fromPairs$1)(record);
36697
+ const undefineObjectPropPair = ([key, value]) => [key, undefine(value)];
36698
+ /**
36699
+ * Transform all `null` values into `undefined` ones in any type of value
36700
+ *
36701
+ * @description
36702
+ * The value must be of native type and only contains native types.
36703
+ */
36704
+ function undefine(value) {
36705
+ if (value === null || value === undefined) {
36706
+ return undefined;
36707
+ }
36708
+ if (typeof value === 'object') {
36709
+ if (isArray(value)) {
36710
+ return undefineArrayValues(value);
36711
+ }
36712
+ if (isObject(value)) {
36713
+ return undefineObjectProps(value);
36714
+ }
36715
+ throw new Error(`Can't handle type \`${value.constructor.name}\`.`);
36716
+ }
36717
+ return value;
36718
+ }
36719
+
36720
+ export { Accent, Button$1 as Button, Checkbox, CoordinatesFormat, CoordinatesInput, CustomSearch, DatePicker, DateRangePicker, Dialog, Dropdown, Field$2 as Field, FieldError, Fieldset, FormikCheckbox, FormikCoordinatesInput, FormikDatePicker, FormikDateRangePicker, FormikEffect, FormikMultiCheckbox, FormikMultiRadio, FormikMultiSelect, FormikNumberInput, FormikSearch, FormikSelect, FormikTextInput, FormikTextarea, GlobalStyle, index as Icon, IconButton, Label, Legend, MapMenuModal, MultiCheckbox, MultiRadio, MultiSelect, MultiZoneEditor, NewWindow, NewWindowContext, NotificationEvent, Notifier, NumberInput, OPENLAYERS_PROJECTION, OnlyFontGlobalStyle, Search, Select, SideMenu, SimpleTable, SingleTag, Size, THEME, TableWithSelectableRows, Tag, TagBullet, TagGroup, TextInput, Textarea, ThemeProvider, WSG84_PROJECTION, coordinatesAreDistinct, customDayjs, getCoordinates, getLocalizedDayjs, getOptionsFromIdAndName, getOptionsFromLabelledEnum, getPseudoRandomString, getUtcizedDayjs, isArray, isDefined, isNumeric, isObject, logSoftError, nullify, stopMouseEventPropagation, undefine, useClickOutsideEffect, useFieldControl, useForceUpdate, useKey, useNewWindow, usePrevious };
36565
36721
  //# sourceMappingURL=index.js.map