From 07c75280bb06816562b1fb5747acf8efa39cb4a0 Mon Sep 17 00:00:00 2001 From: smizrahi Date: Tue, 15 Apr 2025 19:00:33 +0200 Subject: [PATCH] fix(ui): Change angular material to fix issues with Safari iOS 18+ --- .gitmodules | 2 +- .../angular-material-mocks.js | 182 + .../angular-material-dist/angular-material.js | 39666 ++++++++++++++++ .../angular-material.min.js | 7 + .../angular-material.scss | 7556 +++ .../angular-material.layout-attributes.scss | 1058 + .../layouts/angular-material.layouts.scss | 1125 + .../js/vendor/angular-material.js | 182 +- UI/WebServerResources/package.json | 2 +- 9 files changed, 49687 insertions(+), 93 deletions(-) create mode 100644 UI/WebServerResources/js/vendor/angular-material-dist/angular-material-mocks.js create mode 100644 UI/WebServerResources/js/vendor/angular-material-dist/angular-material.js create mode 100644 UI/WebServerResources/js/vendor/angular-material-dist/angular-material.min.js create mode 100644 UI/WebServerResources/js/vendor/angular-material-dist/angular-material.scss create mode 100644 UI/WebServerResources/js/vendor/angular-material-dist/layouts/angular-material.layout-attributes.scss create mode 100644 UI/WebServerResources/js/vendor/angular-material-dist/layouts/angular-material.layouts.scss diff --git a/.gitmodules b/.gitmodules index a9eabad0f..d63ef7726 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1,3 +1,3 @@ [submodule "UI/WebServerResources/angular-material"] path = UI/WebServerResources/angular-material - url = https://github.com/angular/material + url = https://github.com/Alinto/material.git diff --git a/UI/WebServerResources/js/vendor/angular-material-dist/angular-material-mocks.js b/UI/WebServerResources/js/vendor/angular-material-dist/angular-material-mocks.js new file mode 100644 index 000000000..83c6a80d7 --- /dev/null +++ b/UI/WebServerResources/js/vendor/angular-material-dist/angular-material-mocks.js @@ -0,0 +1,182 @@ +/** + * AngularJS-Material-Mocks + * + * Developers interested in running their own custom unit tests WITH angular-material.js loaded... + * must also include this *mocks* file. Similar to `angular-mocks.js`, `angular-material-mocks.js` + * will override and disable specific AngularJS Material performance settings: + * + * - Disabled Theme CSS rule generations + * - Forces $mdAria.expectWithText() to be synchronous + * - Mocks $$rAF.throttle() + * - Captures flush exceptions from $$rAF + */ +// eslint-disable-next-line no-shadow-restricted-names +(function(window, angular, undefined) { + + 'use strict'; + + // Allow our code to know when they are running inside of a test so they can expose extra services + // that should NOT be exposed to the public but that should be tested. + // + // As an example, see input.js which exposes some animation-related methods. + window._mdMocksIncluded = true; + + /** + * @ngdoc module + * @name ngMaterial-mock + * @packageName angular-material-mocks + * + * @description + * The `ngMaterial-mock` module provides support + */ + angular.module('ngMaterial-mock', ['ngMock', 'ngAnimateMock', 'material.core']).config([ + '$provide', + function($provide) { + $provide.factory('$material', [ + '$animate', '$timeout', + function($animate, $timeout) { + return { + flushOutstandingAnimations: function() { + // this code is placed in a try-catch statement + // since 1.3 and 1.4 handle their animations differently + // and there may be situations where follow-up animations + // are run in one version and not the other + try { + $animate.flush(); + // eslint-disable-next-line no-empty + } catch (e) {} + }, + flushInterimElement: function() { + this.flushOutstandingAnimations(); + $timeout.flush(); + this.flushOutstandingAnimations(); + $timeout.flush(); + this.flushOutstandingAnimations(); + $timeout.flush(); + } + }; + } + ]); + + /** + * AngularJS Material dynamically generates Style tags + * based on themes and palettes; for each ng-app. + * + * For testing, we want to disable generation and + *