@mtes-mct/monitor-ui 2.9.5 → 2.11.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,17 @@
1
+ # [2.10.0](https://github.com/MTES-MCT/monitor-ui/compare/v2.9.5...v2.10.0) (2023-01-31)
2
+
3
+
4
+ ### Features
5
+
6
+ * **utils:** expose multiple utils ([0a72cbc](https://github.com/MTES-MCT/monitor-ui/commit/0a72cbc44279d02b0dfeee1251ca723c57468ff3))
7
+
8
+ ## [2.9.5](https://github.com/MTES-MCT/monitor-ui/compare/v2.9.4...v2.9.5) (2023-01-27)
9
+
10
+
11
+ ### Bug Fixes
12
+
13
+ * **fields:** fix searchable Select toggling behavior ([f3b3eca](https://github.com/MTES-MCT/monitor-ui/commit/f3b3eca41b6f2d3d48f21f2b388cf5dc7f6d24d1))
14
+
1
15
  ## [2.9.4](https://github.com/MTES-MCT/monitor-ui/compare/v2.9.3...v2.9.4) (2023-01-27)
2
16
 
3
17
 
package/index.js CHANGED
@@ -5419,6 +5419,11 @@ function FormikAutoComplete({ name, ...originalProps }) {
5419
5419
  const [field, , helpers] = useField(name);
5420
5420
  // eslint-disable-next-line react-hooks/exhaustive-deps, @typescript-eslint/naming-convention
5421
5421
  const defaultValue = useMemo(() => field.value, []);
5422
+ useEffect(() => () => {
5423
+ helpers.setValue(undefined);
5424
+ },
5425
+ // eslint-disable-next-line react-hooks/exhaustive-deps
5426
+ []);
5422
5427
  if (!defaultValue) {
5423
5428
  return jsx(AutoComplete, { name: name, onChange: helpers.setValue, ...originalProps });
5424
5429
  }
@@ -5429,6 +5434,11 @@ function FormikCheckbox({ name, ...originalProps }) {
5429
5434
  const [field, , helpers] = useField(name);
5430
5435
  // eslint-disable-next-line react-hooks/exhaustive-deps, @typescript-eslint/naming-convention
5431
5436
  const defaultChecked = useMemo(() => Boolean(field.value), []);
5437
+ useEffect(() => () => {
5438
+ helpers.setValue(undefined);
5439
+ },
5440
+ // eslint-disable-next-line react-hooks/exhaustive-deps
5441
+ []);
5432
5442
  return jsx(Checkbox, { defaultChecked: defaultChecked, name: name, onChange: helpers.setValue, ...originalProps });
5433
5443
  }
5434
5444
 
@@ -5437,6 +5447,11 @@ function FormikDatePicker({ name, ...originalProps }) {
5437
5447
  const [field, , helpers] = useField(name);
5438
5448
  // eslint-disable-next-line react-hooks/exhaustive-deps
5439
5449
  const defaultValue = useMemo(() => field.value, []);
5450
+ useEffect(() => () => {
5451
+ helpers.setValue(undefined);
5452
+ },
5453
+ // eslint-disable-next-line react-hooks/exhaustive-deps
5454
+ []);
5440
5455
  return jsx(UntypedDatePicker, { defaultValue: defaultValue, onChange: helpers.setValue, ...originalProps });
5441
5456
  }
5442
5457
 
@@ -5445,6 +5460,11 @@ function FormikDateRangePicker({ name, ...originalProps }) {
5445
5460
  const [field, , helpers] = useField(name);
5446
5461
  // eslint-disable-next-line react-hooks/exhaustive-deps
5447
5462
  const defaultValue = useMemo(() => field.value, []);
5463
+ useEffect(() => () => {
5464
+ helpers.setValue(undefined);
5465
+ },
5466
+ // eslint-disable-next-line react-hooks/exhaustive-deps
5467
+ []);
5448
5468
  return jsx(UntypedDateRangePicker, { defaultValue: defaultValue, onChange: helpers.setValue, ...originalProps });
5449
5469
  }
5450
5470
 
@@ -5460,6 +5480,11 @@ function FormikMultiCheckbox({ name, ...originalProps }) {
5460
5480
  const [field, , helpers] = useField(name);
5461
5481
  // eslint-disable-next-line react-hooks/exhaustive-deps
5462
5482
  const defaultValue = useMemo(() => field.value, []);
5483
+ useEffect(() => () => {
5484
+ helpers.setValue(undefined);
5485
+ },
5486
+ // eslint-disable-next-line react-hooks/exhaustive-deps
5487
+ []);
5463
5488
  return jsx(MultiCheckbox, { defaultValue: defaultValue, name: name, onChange: helpers.setValue, ...originalProps });
5464
5489
  }
5465
5490
 
@@ -5467,6 +5492,11 @@ function FormikMultiSelect({ name, ...originalProps }) {
5467
5492
  const [field, , helpers] = useField(name);
5468
5493
  // eslint-disable-next-line react-hooks/exhaustive-deps
5469
5494
  const defaultValue = useMemo(() => field.value, []);
5495
+ useEffect(() => () => {
5496
+ helpers.setValue(undefined);
5497
+ },
5498
+ // eslint-disable-next-line react-hooks/exhaustive-deps
5499
+ []);
5470
5500
  return jsx(MultiSelect, { defaultValue: defaultValue, name: name, onChange: helpers.setValue, ...originalProps });
5471
5501
  }
5472
5502
 
@@ -5474,6 +5504,11 @@ function FormikMultiRadio({ name, ...originalProps }) {
5474
5504
  const [field, , helpers] = useField(name);
5475
5505
  // eslint-disable-next-line react-hooks/exhaustive-deps
5476
5506
  const defaultValue = useMemo(() => field.value, []);
5507
+ useEffect(() => () => {
5508
+ helpers.setValue(undefined);
5509
+ },
5510
+ // eslint-disable-next-line react-hooks/exhaustive-deps
5511
+ []);
5477
5512
  return jsx(MultiRadio, { defaultValue: defaultValue, name: name, onChange: helpers.setValue, ...originalProps });
5478
5513
  }
5479
5514
 
@@ -5481,6 +5516,11 @@ function FormikNumberInput({ name, ...originalProps }) {
5481
5516
  const [field, , helpers] = useField(name);
5482
5517
  // eslint-disable-next-line react-hooks/exhaustive-deps
5483
5518
  const defaultValue = useMemo(() => field.value, []);
5519
+ useEffect(() => () => {
5520
+ helpers.setValue(undefined);
5521
+ },
5522
+ // eslint-disable-next-line react-hooks/exhaustive-deps
5523
+ []);
5484
5524
  return jsx(NumberInput, { defaultValue: defaultValue, name: name, onChange: helpers.setValue, ...originalProps });
5485
5525
  }
5486
5526
 
@@ -5489,6 +5529,11 @@ function FormikSelect({ name, ...originalProps }) {
5489
5529
  // eslint-disable-next-line react-hooks/exhaustive-deps
5490
5530
  const defaultValue = useMemo(() => field.value, []);
5491
5531
  const error = useMemo(() => (meta.initialTouched ? meta.error : undefined), [meta.error, meta.initialTouched]);
5532
+ useEffect(() => () => {
5533
+ helpers.setValue(undefined);
5534
+ },
5535
+ // eslint-disable-next-line react-hooks/exhaustive-deps
5536
+ []);
5492
5537
  return jsx(Select, { defaultValue: defaultValue, error: error, name: name, onChange: helpers.setValue, ...originalProps });
5493
5538
  }
5494
5539
 
@@ -5496,6 +5541,11 @@ function FormikTextarea({ name, ...originalProps }) {
5496
5541
  const [field, , helpers] = useField(name);
5497
5542
  // eslint-disable-next-line react-hooks/exhaustive-deps
5498
5543
  const defaultValue = useMemo(() => field.value, []);
5544
+ useEffect(() => () => {
5545
+ helpers.setValue(undefined);
5546
+ },
5547
+ // eslint-disable-next-line react-hooks/exhaustive-deps
5548
+ []);
5499
5549
  return jsx(Textarea, { defaultValue: defaultValue, name: name, onChange: helpers.setValue, ...originalProps });
5500
5550
  }
5501
5551
 
@@ -5503,8 +5553,15 @@ function FormikTextInput({ name, ...originalProps }) {
5503
5553
  const [field, , helpers] = useField(name);
5504
5554
  // eslint-disable-next-line react-hooks/exhaustive-deps
5505
5555
  const defaultValue = useMemo(() => field.value, []);
5556
+ useEffect(() => () => {
5557
+ helpers.setValue(undefined);
5558
+ },
5559
+ // eslint-disable-next-line react-hooks/exhaustive-deps
5560
+ []);
5506
5561
  return jsx(TextInput, { defaultValue: defaultValue, name: name, onChange: helpers.setValue, ...originalProps });
5507
5562
  }
5508
5563
 
5509
- export { Accent, AutoComplete, Button, Checkbox, DatePicker, DateRangePicker, Dropdown, Field$2 as Field, Fieldset, FormikAutoComplete, FormikCheckbox, FormikDatePicker, FormikDateRangePicker, FormikEffect, FormikMultiCheckbox, FormikMultiRadio, FormikMultiSelect, FormikNumberInput, FormikSelect, FormikTextInput, FormikTextarea, GlobalStyle, index as Icon, IconButton, Label, Legend, MultiCheckbox, MultiRadio, MultiSelect, MultiZoneEditor, NumberInput, OnlyFontGlobalStyle, Select, Size, THEME, Tag$1 as Tag, TagGroup, TextInput, Textarea, ThemeProvider, useClickOutside, useForceUpdate };
5564
+ const noop = () => { };
5565
+
5566
+ export { Accent, AutoComplete, Button, Checkbox, DatePicker, DateRangePicker, Dropdown, Field$2 as Field, Fieldset, FormikAutoComplete, FormikCheckbox, FormikDatePicker, FormikDateRangePicker, FormikEffect, FormikMultiCheckbox, FormikMultiRadio, FormikMultiSelect, FormikNumberInput, FormikSelect, FormikTextInput, FormikTextarea, GlobalStyle, index as Icon, IconButton, Label, Legend, MultiCheckbox, MultiRadio, MultiSelect, MultiZoneEditor, NumberInput, OnlyFontGlobalStyle, Select, Size, THEME, Tag$1 as Tag, TagGroup, TextInput, Textarea, ThemeProvider, dayjs, getLocalizedDayjs, getUtcizedDayjs, noop, stopMouseEventPropagation, useClickOutside, useForceUpdate };
5510
5567
  //# sourceMappingURL=index.js.map