@hmcts/media-viewer 2.7.19 → 2.7.20

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.
@@ -7,6 +7,7 @@ mv-anno-rectangle {
7
7
  cursor: grab;
8
8
  cursor: -moz-grab;
9
9
  cursor: -webkit-grab;
10
+ font-weight: bolder;
10
11
  }
11
12
 
12
13
  .rectangle:active {
@@ -15,10 +16,6 @@ mv-anno-rectangle {
15
16
  cursor: -webkit-grabbing;
16
17
  }
17
18
 
18
- .selected.rectangle {
19
- opacity: 0.5;
20
- }
21
-
22
19
  .grabNDrag {
23
20
  pointer-events: none;
24
21
  }
@@ -5285,10 +5285,18 @@
5285
5285
  * @return {?}
5286
5286
  */
5287
5287
  function (results) {
5288
+ var _this = this;
5288
5289
  this.resultCount = results.total;
5289
5290
  this.resultsText = this.resultCount > 0
5290
5291
  ? "Found " + results.current + " of " + results.total
5291
5292
  : 'No results found';
5293
+ if (this.resultCount && this.resultCount > 0) {
5294
+ setTimeout(( /**
5295
+ * @return {?}
5296
+ */function () {
5297
+ _this.findNext.nativeElement.focus();
5298
+ }), 200);
5299
+ }
5292
5300
  };
5293
5301
  /**
5294
5302
  * @param {?} e
@@ -5333,7 +5341,7 @@
5333
5341
  SearchBarComponent.decorators = [
5334
5342
  { type: i0.Component, args: [{
5335
5343
  selector: 'mv-search-bar',
5336
- template: "<div class=\"searchbar govuk-!-padding-3\" [hidden]=\"toolbarEvents.searchBarHidden | async\">\n <div class=\"govuk-grid-row\">\n <div class=\"govuk-grid-column-full\">\n <input class=\"govuk-input govuk-!-display-inline-block govuk-!-width-three-quarters govuk-!-margin-bottom-5 govuk-!-margin-top-5\"\n type=\"text\" aria-label=\"Find in document\" #findInput [(ngModel)]=\"searchText\" (keydown.escape)=\"onEscapeKeyPress($event)\" (keydown.enter)=\"onEnterKeyPress($event)\" title=\"Find in document\"\n placeholder=\"Find in document\u2026\" tabindex=\"0\" data-l10n-id=\"find_input\" />\n <button class=\"govuk-button govuk-!-display-inline-block govuk-!-margin-bottom-4\" data-module=\"govuk-button\"\n (click)=\"search()\" style=\" position: absolute; top: 40px; right: 10px; \">\n Search\n </button>\n <button id=\"mvCloseBtn\" #mvCloseBtn class=\"mv-button searchbar-button--close\" title=\"Close Search\" data-l10n-id=\"mvRedactBtn\"\n (click)=\"toggleSearchBar()\">\n </button>\n </div>\n </div>\n\n <div class=\"govuk-grid-row\">\n <div class=\"govuk-grid-column-three-quarters\">\n <span id=\"findResultsCount\" class=\"govuk-!-display-inline-block govuk-!-margin-right-4\">{{resultsText}}</span>\n <a *ngIf=\"resultCount > 0\" [routerLink]=\"\" class=\"govuk-link govuk-link--no-visited-state govuk-!-margin-right-2\"\n (click)=\"searchPrev()\" title=\"Find the previous occurrence of the phrase\" data-l10n-id=\"find_previous\">Prev</a>\n <a *ngIf=\"resultCount > 0\" [routerLink]=\"\" class=\"govuk-link govuk-link--no-visited-state\" (click)=\"searchNext()\"\n title=\"Find the next occurrence of the phrase\" data-l10n-id=\"find_next\">Next</a>\n </div>\n <div class=\"govuk-grid-column-one-quarter\">\n <a [routerLink]=\"\" class=\"govuk-link govuk-link--no-visited-state\" (click)=\"toggleAdvancedSearch()\" title=\"Advanced\"\n data-l10n-id=\"find_advanced\" style=\" position: absolute; top: 95px; right: 15px; \">Advanced</a>\n </div>\n </div>\n\n <div class=\"govuk-grid-row\" *ngIf=\"advancedSearchVisible\">\n <div class=\"govuk-grid-column-full\">\n <div class=\"govuk-form-group govuk-!-margin-top-3 govuk-!-margin-bottom-1\">\n <fieldset class=\"govuk-fieldset\" aria-describedby=\"advanced\">\n <div class=\"govuk-checkboxes\">\n <div class=\"govuk-checkboxes__item\">\n <input class=\"govuk-checkboxes__input\" id=\"findHighlightAll\" name=\"findHighlightAll\" type=\"checkbox\"\n (change)=\"highlightAll = !highlightAll; search()\" [checked]=\"highlightAll\">\n <label class=\"govuk-label govuk-checkboxes__label\" for=\"findHighlightAll\" data-l10n-id=\"find_highlight\">\n Highlight all\n </label>\n </div>\n <div class=\"govuk-checkboxes__item\">\n <input class=\"govuk-checkboxes__input\" id=\"findMatchCase\" name=\"findMatchCase\" type=\"checkbox\"\n (change)=\"matchCase = !matchCase; search()\" [checked]=\"matchCase\">\n <label class=\"govuk-label govuk-checkboxes__label\" for=\"findMatchCase\"\n data-l10n-id=\"find_match_case_label\">\n Match text (exact case)\n </label>\n </div>\n <div class=\"govuk-checkboxes__item\">\n <input class=\"govuk-checkboxes__input\" id=\"findEntireWord\" name=\"findMatchCase\" type=\"checkbox\"\n (change)=\"wholeWord = !wholeWord; search()\" [checked]=\"wholeWord\">\n <label class=\"govuk-label govuk-checkboxes__label\" for=\"findEntireWord\"\n data-l10n-id=\"find_entire_word_label\">\n Match whole words or sentences\n </label>\n </div>\n </div>\n </fieldset>\n </div>\n </div>\n </div>\n</div>\n"
5344
+ template: "<div class=\"searchbar govuk-!-padding-3\" [hidden]=\"toolbarEvents.searchBarHidden | async\">\n <div class=\"govuk-grid-row\">\n <div class=\"govuk-grid-column-full\">\n <input class=\"govuk-input govuk-!-display-inline-block govuk-!-width-three-quarters govuk-!-margin-bottom-5 govuk-!-margin-top-5\"\n type=\"text\" aria-label=\"Find in document\" #findInput [(ngModel)]=\"searchText\" (keydown.escape)=\"onEscapeKeyPress($event)\" (keydown.enter)=\"onEnterKeyPress($event)\" title=\"Find in document\"\n placeholder=\"Find in document\u2026\" tabindex=\"0\" data-l10n-id=\"find_input\" />\n <button class=\"govuk-button govuk-!-display-inline-block govuk-!-margin-bottom-4\" data-module=\"govuk-button\"\n (click)=\"search()\" style=\" position: absolute; top: 40px; right: 10px; \">\n Search\n </button>\n <button id=\"mvCloseBtn\" #mvCloseBtn class=\"mv-button searchbar-button--close\" title=\"Close Search\" data-l10n-id=\"mvRedactBtn\"\n (click)=\"toggleSearchBar()\">\n </button>\n </div>\n </div>\n\n <div class=\"govuk-grid-row\">\n <div class=\"govuk-grid-column-three-quarters\">\n <span id=\"findResultsCount\" class=\"govuk-!-display-inline-block govuk-!-margin-right-4\">{{resultsText}}</span>\n <a *ngIf=\"resultCount > 0\" [routerLink]=\"\" class=\"govuk-link govuk-link--no-visited-state govuk-!-margin-right-2\"\n (click)=\"searchPrev()\" title=\"Find the previous occurrence of the phrase\" data-l10n-id=\"find_previous\">Prev</a>\n <a *ngIf=\"resultCount > 0\" [routerLink]=\"\" #findNext class=\"govuk-link govuk-link--no-visited-state\" (click)=\"searchNext()\"\n title=\"Find the next occurrence of the phrase\" data-l10n-id=\"find_next\">Next</a>\n </div>\n <div class=\"govuk-grid-column-one-quarter\">\n <a [routerLink]=\"\" class=\"govuk-link govuk-link--no-visited-state\" (click)=\"toggleAdvancedSearch()\" title=\"Advanced\"\n data-l10n-id=\"find_advanced\" style=\" position: absolute; top: 95px; right: 15px; \">Advanced</a>\n </div>\n </div>\n\n <div class=\"govuk-grid-row\" *ngIf=\"advancedSearchVisible\">\n <div class=\"govuk-grid-column-full\">\n <div class=\"govuk-form-group govuk-!-margin-top-3 govuk-!-margin-bottom-1\">\n <fieldset class=\"govuk-fieldset\" aria-describedby=\"advanced\">\n <div class=\"govuk-checkboxes\">\n <div class=\"govuk-checkboxes__item\">\n <input class=\"govuk-checkboxes__input\" id=\"findHighlightAll\" name=\"findHighlightAll\" type=\"checkbox\"\n (change)=\"highlightAll = !highlightAll; search()\" [checked]=\"highlightAll\">\n <label class=\"govuk-label govuk-checkboxes__label\" for=\"findHighlightAll\" data-l10n-id=\"find_highlight\">\n Highlight all\n </label>\n </div>\n <div class=\"govuk-checkboxes__item\">\n <input class=\"govuk-checkboxes__input\" id=\"findMatchCase\" name=\"findMatchCase\" type=\"checkbox\"\n (change)=\"matchCase = !matchCase; search()\" [checked]=\"matchCase\">\n <label class=\"govuk-label govuk-checkboxes__label\" for=\"findMatchCase\"\n data-l10n-id=\"find_match_case_label\">\n Match text (exact case)\n </label>\n </div>\n <div class=\"govuk-checkboxes__item\">\n <input class=\"govuk-checkboxes__input\" id=\"findEntireWord\" name=\"findMatchCase\" type=\"checkbox\"\n (change)=\"wholeWord = !wholeWord; search()\" [checked]=\"wholeWord\">\n <label class=\"govuk-label govuk-checkboxes__label\" for=\"findEntireWord\"\n data-l10n-id=\"find_entire_word_label\">\n Match whole words or sentences\n </label>\n </div>\n </div>\n </fieldset>\n </div>\n </div>\n </div>\n</div>\n"
5337
5345
  }] }
5338
5346
  ];
5339
5347
  /** @nocollapse */
@@ -5345,6 +5353,7 @@
5345
5353
  };
5346
5354
  SearchBarComponent.propDecorators = {
5347
5355
  findInput: [{ type: i0.ViewChild, args: ['findInput',] }],
5356
+ findNext: [{ type: i0.ViewChild, args: ['findNext',] }],
5348
5357
  onWindowKeyDown: [{ type: i0.HostListener, args: ['window:keydown', ['$event'],] }]
5349
5358
  };
5350
5359
  return SearchBarComponent;
@@ -8989,7 +8998,7 @@
8989
8998
  * @param {?} bookmarkInfo
8990
8999
  * @return {?}
8991
9000
  */function (bookmarkInfo) {
8992
- _this.store.dispatch(new CreateBookmark(( /** @type {?} */(__assign({}, bookmarkInfo, { name: 'new bookmark', id: uuid$1__default() })))));
9001
+ _this.store.dispatch(new CreateBookmark(( /** @type {?} */(__assign({}, bookmarkInfo, { name: '', id: uuid$1__default() })))));
8993
9002
  }));
8994
9003
  };
8995
9004
  SideBarComponent.decorators = [
@@ -10809,8 +10818,10 @@
10809
10818
  function (bookmark, name) {
10810
10819
  /** @type {?} */
10811
10820
  var editedBookmark = __assign({}, bookmark, { name: name });
10812
- this.store.dispatch(new UpdateBookmark(editedBookmark));
10813
- this.editableBookmark = undefined;
10821
+ if (name) {
10822
+ this.store.dispatch(new UpdateBookmark(editedBookmark));
10823
+ this.editableBookmark = undefined;
10824
+ }
10814
10825
  };
10815
10826
  /**
10816
10827
  * @param {?} bookmark
@@ -11356,7 +11367,9 @@
11356
11367
  */
11357
11368
  function (event) {
11358
11369
  this.store.dispatch(new SelectedAnnotation({
11359
- annotationId: '', selected: false, editable: false
11370
+ annotationId: '',
11371
+ selected: false,
11372
+ editable: false,
11360
11373
  }));
11361
11374
  this.viewerEvents.clearCtxToolbar();
11362
11375
  };
@@ -11393,10 +11406,21 @@
11393
11406
  var parentRect = localElement.parentElement.getBoundingClientRect();
11394
11407
  /** @type {?} */
11395
11408
  var selectionRectangles = [];
11396
- for (var i = 0; i < clientRects.length; i++) {
11409
+ var _loop_1 = function (i) {
11410
+ /** @type {?} */
11411
+ var selectionRectangle = this_1.createTextRectangle(clientRects[i], parentRect);
11397
11412
  /** @type {?} */
11398
- var selectionRectangle = this.createTextRectangle(clientRects[i], parentRect);
11399
- selectionRectangles.push(selectionRectangle);
11413
+ var findSelecttionRectangle = selectionRectangles.find(( /**
11414
+ * @param {?} rect
11415
+ * @return {?}
11416
+ */function (rect) { return rect.width === selectionRectangle.width && rect.x === selectionRectangle.x; }));
11417
+ if (!findSelecttionRectangle) {
11418
+ selectionRectangles.push(selectionRectangle);
11419
+ }
11420
+ };
11421
+ var this_1 = this;
11422
+ for (var i = 0; i < clientRects.length; i++) {
11423
+ _loop_1(i);
11400
11424
  }
11401
11425
  return selectionRectangles;
11402
11426
  }