@mtes-mct/monitor-ui 12.0.2 → 12.1.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,18 @@
1
+ ## [12.0.3](https://github.com/MTES-MCT/monitor-ui/compare/v12.0.2...v12.0.3) (2024-02-27)
2
+
3
+
4
+ ### Styles
5
+
6
+ * **fields:** fix MultiCheckbox options margin when isInline ([d98f1a5](https://github.com/MTES-MCT/monitor-ui/commit/d98f1a549ac2b7ffb0b82c67435c39f0a6fd9ea8))
7
+
8
+ ## [12.0.2](https://github.com/MTES-MCT/monitor-ui/compare/v12.0.1...v12.0.2) (2024-02-27)
9
+
10
+
11
+ ### Styles
12
+
13
+ * **fields:** fix MultiRadio options margin when isInline ([9c7e15b](https://github.com/MTES-MCT/monitor-ui/commit/9c7e15bdc8dac946d16e06cc7336e4cc2802cbb7))
14
+ * **fields:** fix pickers border color when isTransparent ([b10ac28](https://github.com/MTES-MCT/monitor-ui/commit/b10ac286201610cba620291cb525167a01c0d659))
15
+
1
16
  ## [12.0.1](https://github.com/MTES-MCT/monitor-ui/compare/v12.0.0...v12.0.1) (2024-02-27)
2
17
 
3
18
 
package/cypress/index.js CHANGED
@@ -126,6 +126,13 @@ function findElementParentBySelector(element, parentSelector, index = 0) {
126
126
  }
127
127
 
128
128
  function checkCheckbox(fieldElement, value, _label) {
129
+ Cypress.log({
130
+ consoleProps: ()=>({
131
+ 'Applied to': fieldElement,
132
+ Elements: 1
133
+ }),
134
+ name: 'checkCheckbox'
135
+ });
129
136
  cy.wrap(fieldElement).scrollIntoView({
130
137
  offset: {
131
138
  left: 0,
@@ -144,6 +151,13 @@ function checkCheckbox(fieldElement, value, _label) {
144
151
  }
145
152
 
146
153
  function checkMultiCheckboxOptions(fieldsetElement, values, _label) {
154
+ Cypress.log({
155
+ consoleProps: ()=>({
156
+ 'Applied to': fieldsetElement,
157
+ Elements: 1
158
+ }),
159
+ name: 'checkMultiCheckboxOptions'
160
+ });
147
161
  cy.wrap(fieldsetElement).scrollIntoView({
148
162
  offset: {
149
163
  left: 0,
@@ -166,13 +180,19 @@ function checkMultiCheckboxOptions(fieldsetElement, values, _label) {
166
180
  }
167
181
 
168
182
  function checkMultiRadioOption(fieldsetElement, value, _label) {
183
+ Cypress.log({
184
+ consoleProps: ()=>({
185
+ 'Applied to': fieldsetElement,
186
+ Elements: 1
187
+ }),
188
+ name: 'checkMultiRadioOption'
189
+ });
169
190
  cy.wrap(fieldsetElement).scrollIntoView({
170
191
  offset: {
171
192
  left: 0,
172
193
  top: -100
173
194
  }
174
195
  }).find('label').contains(value).forceClick().wait(250);
175
- return fieldsetElement;
176
196
  }
177
197
 
178
198
  function throwError(message) {
@@ -180,6 +200,13 @@ function throwError(message) {
180
200
  }
181
201
 
182
202
  function fillDatePicker(fieldsetElement, dateOrDateWithTimeTuple, _label) {
203
+ Cypress.log({
204
+ consoleProps: ()=>({
205
+ 'Applied to': fieldsetElement,
206
+ Elements: 1
207
+ }),
208
+ name: 'fillDatePicker'
209
+ });
183
210
  const inputElements = fieldsetElement.querySelectorAll('input');
184
211
  if (inputElements.length !== 4 && inputElements.length !== 6) {
185
212
  throwError(`Expected to find 4 or 6 inputs within in DatePicker but found ${inputElements.length}.`);
@@ -220,11 +247,21 @@ function fillDatePicker(fieldsetElement, dateOrDateWithTimeTuple, _label) {
220
247
  cy.wait(250);
221
248
  // Close the calendar & ranged time picker popup by pressing the escape key
222
249
  cy.get('body').type('{esc}');
223
- cy.wrap(fieldsetElement).find('.Field-DatePicker__CalendarPicker').should('not.be.visible');
224
- cy.wrap(fieldsetElement).find('.Field-DateRangePicker__RangedTimePicker').should('not.exist');
250
+ // TODO Create a util to handle the `fieldsetElement` re-creation cases.
251
+ // We to use a `wait` as a temporary fix to handle `fieldsetElement` re-creation cases.
252
+ cy.wait(250);
253
+ // cy.wrap(fieldsetElement).find('.Field-DatePicker__CalendarPicker').should('not.be.visible')
254
+ // cy.wrap(fieldsetElement).find('.Field-DateRangePicker__RangedTimePicker').should('not.exist')
225
255
  }
226
256
 
227
257
  function fillDateRangePicker(fieldsetElement, dateOrDateWithTimeTupleRange, _label) {
258
+ Cypress.log({
259
+ consoleProps: ()=>({
260
+ 'Applied to': fieldsetElement,
261
+ Elements: 1
262
+ }),
263
+ name: 'fillDateRangePicker'
264
+ });
228
265
  const inputElements = fieldsetElement.querySelectorAll('input');
229
266
  if (inputElements.length !== 7 && inputElements.length !== 11) {
230
267
  throwError(`Expected to find 7 or 11 inputs within in DatePicker but found ${inputElements.length}.`);
@@ -288,11 +325,21 @@ function fillDateRangePicker(fieldsetElement, dateOrDateWithTimeTupleRange, _lab
288
325
  cy.wait(250);
289
326
  // Close the range calendar & ranged time picker popup by pressing the escape key
290
327
  cy.get('body').type('{esc}');
291
- cy.wrap(fieldsetElement).find('.Field-DateRangePicker__RangeCalendarPicker').should('not.be.visible');
292
- cy.wrap(fieldsetElement).find('.Field-DateRangePicker__RangedTimePicker').should('not.exist');
328
+ // TODO Create a util to handle the `fieldsetElement` re-creation cases.
329
+ // We to use a `wait` as a temporary fix to handle `fieldsetElement` re-creation cases.
330
+ cy.wait(250);
331
+ // cy.wrap(fieldsetElement).find('.Field-DateRangePicker__RangeCalendarPicker').should('not.be.visible')
332
+ // cy.wrap(fieldsetElement).find('.Field-DateRangePicker__RangedTimePicker').should('not.exist')
293
333
  }
294
334
 
295
335
  function fillNumberInput(fieldElement, value, _label) {
336
+ Cypress.log({
337
+ consoleProps: ()=>({
338
+ 'Applied to': fieldElement,
339
+ Elements: 1
340
+ }),
341
+ name: 'fillNumberInput'
342
+ });
296
343
  cy.wrap(fieldElement).scrollIntoView({
297
344
  offset: {
298
345
  left: 0,
@@ -312,6 +359,13 @@ function fillNumberInput(fieldElement, value, _label) {
312
359
  }
313
360
 
314
361
  function fillTextarea(fieldElement, value, _label) {
362
+ Cypress.log({
363
+ consoleProps: ()=>({
364
+ 'Applied to': fieldElement,
365
+ Elements: 1
366
+ }),
367
+ name: 'fillTextarea'
368
+ });
315
369
  cy.wrap(fieldElement).scrollIntoView({
316
370
  offset: {
317
371
  left: 0,
@@ -331,6 +385,13 @@ function fillTextarea(fieldElement, value, _label) {
331
385
  }
332
386
 
333
387
  function fillTextInput(fieldElement, value, _label) {
388
+ Cypress.log({
389
+ consoleProps: ()=>({
390
+ 'Applied to': fieldElement,
391
+ Elements: 1
392
+ }),
393
+ name: 'fillTextInput'
394
+ });
334
395
  cy.wrap(fieldElement).scrollIntoView({
335
396
  offset: {
336
397
  left: 0,
@@ -350,6 +411,13 @@ function fillTextInput(fieldElement, value, _label) {
350
411
  }
351
412
 
352
413
  function pickCheckPickerOptions(fieldElement, values, label) {
414
+ Cypress.log({
415
+ consoleProps: ()=>({
416
+ 'Applied to': fieldElement,
417
+ Elements: 1
418
+ }),
419
+ name: 'pickCheckPickerOptions'
420
+ });
353
421
  cy.wrap(fieldElement).scrollIntoView({
354
422
  offset: {
355
423
  left: 0,
@@ -383,11 +451,21 @@ function pickCheckPickerOptions(fieldElement, values, label) {
383
451
  });
384
452
  // Close the picker popup by pressing the escape key
385
453
  cy.get('body').type('{esc}');
386
- cy.wrap(fieldElement).find('.rs-picker-popup').should('not.exist');
454
+ // TODO Create a util to handle the `fieldElement` re-creation cases.
455
+ // We to use a `wait` as a temporary fix to handle `fieldElement` re-creation cases.
456
+ cy.wait(250);
457
+ // cy.wrap(fieldElement).find('.rs-picker-popup').should('not.exist')
387
458
  });
388
459
  }
389
460
 
390
461
  function pickMultiSelectOptions(fieldElement, values, label) {
462
+ Cypress.log({
463
+ consoleProps: ()=>({
464
+ 'Applied to': fieldElement,
465
+ Elements: 1
466
+ }),
467
+ name: 'pickMultiSelectOptions'
468
+ });
391
469
  cy.wrap(fieldElement).scrollIntoView({
392
470
  offset: {
393
471
  left: 0,
@@ -421,11 +499,21 @@ function pickMultiSelectOptions(fieldElement, values, label) {
421
499
  });
422
500
  // Close the picker popup by pressing the escape key
423
501
  cy.get('body').type('{esc}');
424
- cy.wrap(fieldElement).find('.rs-picker-popup').should('not.exist');
502
+ // TODO Create a util to handle the `fieldElement` re-creation cases.
503
+ // We to use a `wait` as a temporary fix to handle `fieldElement` re-creation cases.
504
+ cy.wait(250);
505
+ // cy.wrap(fieldElement).find('.rs-picker-popup').should('not.exist')
425
506
  });
426
507
  }
427
508
 
428
509
  function pickSearchOption(fieldElement, value, _label) {
510
+ Cypress.log({
511
+ consoleProps: ()=>({
512
+ 'Applied to': fieldElement,
513
+ Elements: 1
514
+ }),
515
+ name: 'pickSearchOption'
516
+ });
429
517
  cy.wrap(fieldElement).scrollIntoView({
430
518
  offset: {
431
519
  left: 0,
@@ -453,6 +541,13 @@ function pickSearchOption(fieldElement, value, _label) {
453
541
  }
454
542
 
455
543
  function pickSelectOption(fieldElement, value, label) {
544
+ Cypress.log({
545
+ consoleProps: ()=>({
546
+ 'Applied to': fieldElement,
547
+ Elements: 1
548
+ }),
549
+ name: 'pickSelectOption'
550
+ });
456
551
  cy.wrap(fieldElement).scrollIntoView({
457
552
  offset: {
458
553
  left: 0,
@@ -541,6 +636,13 @@ function assertStringArrayOrUndefined(value, component) {
541
636
 
542
637
  const RETRIES = 5;
543
638
  function fill(label, value, leftRetries = RETRIES) {
639
+ Cypress.log({
640
+ consoleProps: ()=>({
641
+ 'Left Retries': leftRetries
642
+ }),
643
+ message: `Filling field with label/legend "${label}" with value "${JSON.stringify(value)}".`,
644
+ name: 'fill'
645
+ });
544
646
  try {
545
647
  // =========================================================================
546
648
  // If it's a field labelled by a `<label />` element
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
package/index.js CHANGED
@@ -68571,13 +68571,9 @@ const ChecboxesBox = styled.div`
68571
68571
  display: flex;
68572
68572
  flex-direction: ${(p)=>p.$isInline ? 'row' : 'column'};
68573
68573
 
68574
- ${(p)=>!p.$isInline && css`
68575
- > div:not(:first-child) {
68576
- > .rs-checkbox {
68577
- margin: 8px 0 0 0;
68578
- }
68579
- }
68580
- `}
68574
+ > .Field-Checkbox:not(:first-child) {
68575
+ margin: ${(p)=>p.$isInline ? '0 0 0 16px' : '8px 0 0 0'};
68576
+ }
68581
68577
  `;
68582
68578
 
68583
68579
  /**