@mtes-mct/monitor-ui 12.2.1 → 12.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.
Files changed (52) hide show
  1. package/CHANGELOG.md +19 -0
  2. package/README.md +5 -1
  3. package/constants.d.ts +1 -0
  4. package/constants.d.ts.map +1 -1
  5. package/cypress/global.d.ts +15 -7
  6. package/cypress/index.js +226 -96
  7. package/elements/FieldError.d.ts +1 -1
  8. package/fields/CheckPicker.d.ts +2 -1
  9. package/fields/CheckPicker.d.ts.map +1 -1
  10. package/fields/DatePicker/CalendarPicker.d.ts +2 -1
  11. package/fields/DatePicker/CalendarPicker.d.ts.map +1 -1
  12. package/fields/DatePicker/index.d.ts +1 -0
  13. package/fields/DatePicker/index.d.ts.map +1 -1
  14. package/fields/DateRangePicker/DateInput.d.ts.map +1 -1
  15. package/fields/DateRangePicker/TimeInput.d.ts.map +1 -1
  16. package/fields/DateRangePicker/index.d.ts.map +1 -1
  17. package/fields/MultiCascader/index.d.ts +2 -1
  18. package/fields/MultiCascader/index.d.ts.map +1 -1
  19. package/fields/MultiSelect.d.ts +2 -1
  20. package/fields/MultiSelect.d.ts.map +1 -1
  21. package/fields/MultiZoneEditor/index.d.ts.map +1 -1
  22. package/fields/Search.d.ts +5 -2
  23. package/fields/Search.d.ts.map +1 -1
  24. package/fields/Select.d.ts +2 -1
  25. package/fields/Select.d.ts.map +1 -1
  26. package/fields/TextInput.d.ts +1 -1
  27. package/fields/TextInput.d.ts.map +1 -1
  28. package/fields/shared/StyledInputBox.d.ts +7 -0
  29. package/fields/shared/StyledInputBox.d.ts.map +1 -0
  30. package/fields/shared/StyledRsuiteCalendarBox.d.ts +3 -1
  31. package/fields/shared/StyledRsuiteCalendarBox.d.ts.map +1 -1
  32. package/fields/shared/StyledRsuitePickerBox.d.ts +3 -9
  33. package/fields/shared/StyledRsuitePickerBox.d.ts.map +1 -1
  34. package/fields/shared/types.d.ts +4 -1
  35. package/fields/shared/types.d.ts.map +1 -1
  36. package/hooks/__tests__/useClickOutsideEffect.test.d.ts +2 -0
  37. package/hooks/__tests__/useClickOutsideEffect.test.d.ts.map +1 -0
  38. package/hooks/useClickOutsideEffect.d.ts.map +1 -1
  39. package/index.d.ts +2 -2
  40. package/index.d.ts.map +1 -1
  41. package/index.js +46764 -48563
  42. package/package.json +1 -1
  43. package/utils/getOptionValueKeyValueFromOptionValue.d.ts +6 -0
  44. package/utils/getOptionValueKeyValueFromOptionValue.d.ts.map +1 -0
  45. package/utils/getSelectedOptionFromOptionValue.d.ts +6 -0
  46. package/utils/getSelectedOptionFromOptionValue.d.ts.map +1 -0
  47. package/utils/nullify.d.ts.map +1 -1
  48. package/utils/remove.d.ts +17 -0
  49. package/utils/remove.d.ts.map +1 -0
  50. package/utils/undefine.d.ts.map +1 -1
  51. package/cypress/index.js.map +0 -1
  52. package/index.js.map +0 -1
package/CHANGELOG.md CHANGED
@@ -1,3 +1,22 @@
1
+ ## [12.3.0](https://github.com/MTES-MCT/monitor-ui/compare/v12.2.1...v12.3.0) (2024-02-29)
2
+
3
+
4
+ ### Features
5
+
6
+ * **cypress:** add force option to fill() command ([538615f](https://github.com/MTES-MCT/monitor-ui/commit/538615f64fbdbfce3cb4b71eabb4bea5c9c9b919))
7
+
8
+
9
+ ### Bug Fixes
10
+
11
+ * **cypress:** type fill() command as non-chainable ([d4b5c35](https://github.com/MTES-MCT/monitor-ui/commit/d4b5c3568177b44f591462e2ecbf3ba9a39fdb64))
12
+
13
+ ## [12.2.1](https://github.com/MTES-MCT/monitor-ui/compare/v12.2.0...v12.2.1) (2024-02-29)
14
+
15
+
16
+ ### Bug Fixes
17
+
18
+ * **cypress:** widen input type for fill() on TextInput ([e7f9984](https://github.com/MTES-MCT/monitor-ui/commit/e7f998474148d970cc81b9dee23740a991dc1d5b))
19
+
1
20
  ## [12.2.0](https://github.com/MTES-MCT/monitor-ui/compare/v12.1.3...v12.2.0) (2024-02-29)
2
21
 
3
22
 
package/README.md CHANGED
@@ -1,9 +1,11 @@
1
1
  # Monitor UI
2
2
 
3
3
  [![License][img-license]][lnk-license] [![NPM Version][img-npm]][lnk-npm]
4
- [![Unit Tests][img-unit-tests]][lnk-unit-tests] [![E2E Tests][img-e2e-tests]][lnk-e2e-tests]
5
4
  [![Documentation][img-documentation]][lnk-documentation]
6
5
 
6
+ [![Unit Tests][img-unit-tests]][lnk-unit-tests] [![Coverage][img-coverage]][lnk-coverage]
7
+ [![E2E Tests][img-e2e-tests]][lnk-e2e-tests]
8
+
7
9
  > Common React components, hooks, utilities and CSS stylesheets for [MonitorFish][lnk-github-monitorfish],
8
10
  > [MonitorEnv][lnk-github-monitorenv] and [RapportNav][lnk-github-rapportnav].
9
11
 
@@ -58,6 +60,7 @@ Please read the [contributing document](CONTRIBUTING.md) for setup and contribut
58
60
 
59
61
  ---
60
62
 
63
+ [img-coverage]: https://img.shields.io/codecov/c/github/MTES-MCT/monitor-ui?flag=unit&style=for-the-badge
61
64
  [img-documentation]: https://img.shields.io/badge/StoryBook-Docs-007ec6?logo=storybook&style=for-the-badge
62
65
  [img-e2e-tests]:
63
66
  https://img.shields.io/endpoint?url=https://cloud.cypress.io/badge/simple/qnpjm2/main&label=E2E&logo=cypress&style=for-the-badge
@@ -65,6 +68,7 @@ Please read the [contributing document](CONTRIBUTING.md) for setup and contribut
65
68
  [img-npm]: https://img.shields.io/npm/v/@mtes-mct/monitor-ui?style=for-the-badge
66
69
  [img-unit-tests]:
67
70
  https://img.shields.io/github/actions/workflow/status/MTES-MCT/monitor-ui/check.yml?branch=main&label=Unit&style=for-the-badge
71
+ [lnk-coverage]: https://app.codecov.io/gh/MTES-MCT/monitor-ui
68
72
  [lnk-documentation]: https://mtes-mct.github.io/monitor-ui/?path=/docs/introduction--documentation
69
73
  [lnk-e2e-tests]: https://cloud.cypress.io/projects/qnpjm2/runs
70
74
  [lnk-e2e-tests]: https://cloud.cypress.io/projects/qnpjm2/runs
package/constants.d.ts CHANGED
@@ -1,3 +1,4 @@
1
+ export * as Icon from './icons';
1
2
  export declare enum Accent {
2
3
  PRIMARY = "PRIMARY",
3
4
  SECONDARY = "SECONDARY",
@@ -1 +1 @@
1
- {"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../src/constants.ts"],"names":[],"mappings":"AAAA,oBAAY,MAAM;IAChB,OAAO,YAAY;IACnB,SAAS,cAAc;IACvB,QAAQ,aAAa;IACrB,OAAO,YAAY;CACpB;AAED,oBAAY,KAAK;IACf,KAAK,UAAU;IACf,IAAI,SAAS;IACb,OAAO,YAAY;IACnB,OAAO,YAAY;CACpB;AAED,oBAAY,iBAAiB;IAC3B,eAAe,OAAO;IACtB,wBAAwB,QAAQ;IAChC,uBAAuB,QAAQ;CAChC;AAED,oBAAY,WAAW;IACrB,IAAI,SAAS;IACb,KAAK,UAAU;IACf,IAAI,SAAS;CACd;AAED,oBAAY,IAAI;IACd,KAAK,UAAU;IACf,MAAM,WAAW;IACjB,KAAK,UAAU;CAChB;AAED,oBAAY,SAAS;IACnB,IAAI,SAAS;CACd;AAED,eAAO,MAAM,gBAAgB,cAAc,CAAA;AAC3C,eAAO,MAAM,qBAAqB,cAAc,CAAA"}
1
+ {"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../src/constants.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,IAAI,MAAM,SAAS,CAAA;AAE/B,oBAAY,MAAM;IAChB,OAAO,YAAY;IACnB,SAAS,cAAc;IACvB,QAAQ,aAAa;IACrB,OAAO,YAAY;CACpB;AAED,oBAAY,KAAK;IACf,KAAK,UAAU;IACf,IAAI,SAAS;IACb,OAAO,YAAY;IACnB,OAAO,YAAY;CACpB;AAED,oBAAY,iBAAiB;IAC3B,eAAe,OAAO;IACtB,wBAAwB,QAAQ;IAChC,uBAAuB,QAAQ;CAChC;AAED,oBAAY,WAAW;IACrB,IAAI,SAAS;IACb,KAAK,UAAU;IACf,IAAI,SAAS;CACd;AAED,oBAAY,IAAI;IACd,KAAK,UAAU;IACf,MAAM,WAAW;IACjB,KAAK,UAAU;CAChB;AAED,oBAAY,SAAS;IACnB,IAAI,SAAS;CACd;AAED,eAAO,MAAM,gBAAgB,cAAc,CAAA;AAC3C,eAAO,MAAM,qBAAqB,cAAc,CAAA"}
@@ -26,7 +26,11 @@ declare namespace Cypress {
26
26
 
27
27
  /**
28
28
  * @description
29
- * You can set the `retries` parameter to a number greater than 5 (default) to retry the action in case of failure.
29
+ * You can set the `retries` option to a number greater than 5 (default) to retry the action in case of failure.
30
+ * You can also set the `force` option to `true` to force the action without waiting for the element to be visible.
31
+ *
32
+ * ⚠️ In order to ensure backward compatibility, the `force` option is set to `true` by default.
33
+ * This will be changed to `false` in the next major version.
30
34
  *
31
35
  * @example
32
36
  * ```ts
@@ -44,13 +48,13 @@ declare namespace Cypress {
44
48
  * cy.fill('My Field', undefined)
45
49
  * ```
46
50
  */
47
- fill(label: string, value: any, retries?: number): Chainable<Element>
51
+ fill(label: string, value: any, options?: Partial<FillOptions>): void
48
52
 
49
- forceCheck(options?: Partial<Cypress.CheckOptions>): Chainable<JQuery<HTMLElement>>
50
- forceClear(options?: Partial<Cypress.ClearOptions>): Chainable<JQuery<HTMLElement>>
51
- forceClick(options?: Partial<Cypress.ClickOptions>): Chainable<JQuery<HTMLElement>>
52
- forceType(text: string, options?: Partial<Cypress.TypeOption>): Chainable<JQuery<HTMLElement>>
53
- forceUncheck(options?: Partial<Cypress.CheckOptions>): Chainable<JQuery<HTMLElement>>
53
+ forceCheck(options?: Partial<CheckOptions>): Chainable<JQuery<HTMLElement>>
54
+ forceClear(options?: Partial<ClearOptions>): Chainable<JQuery<HTMLElement>>
55
+ forceClick(options?: Partial<ClickOptions>): Chainable<JQuery<HTMLElement>>
56
+ forceType(text: string, options?: Partial<TypeOption>): Chainable<JQuery<HTMLElement>>
57
+ forceUncheck(options?: Partial<CheckOptions>): Chainable<JQuery<HTMLElement>>
54
58
 
55
59
  /**
56
60
  * @example
@@ -108,4 +112,8 @@ declare namespace Cypress {
108
112
 
109
113
  type DateRangeTuple = [DateTuple, DateTuple]
110
114
  type DateWithTimeRangeTuple = [DateWithTimeTuple, DateWithTimeTuple]
115
+
116
+ interface FillOptions extends Forceable {
117
+ retries: number
118
+ }
111
119
  }