@firestitch/popover 9.4.15 → 12.0.2

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 (53) hide show
  1. package/app/class/popover-ref.d.ts +34 -34
  2. package/app/components/popover/popover.component.d.ts +50 -47
  3. package/app/components/popover-wrapper/popover-wrapper.component.d.ts +39 -36
  4. package/app/enums/position.d.ts +6 -6
  5. package/app/fs-popover.module.d.ts +13 -4
  6. package/app/helpers/create-injector.d.ts +4 -4
  7. package/app/helpers/create-overlay-ref.d.ts +4 -4
  8. package/app/helpers/create-position-strategy.d.ts +4 -4
  9. package/app/helpers/create-template-portal.d.ts +4 -4
  10. package/app/helpers/point-in-rect.d.ts +1 -1
  11. package/app/interfaces/popover-config.interface.d.ts +16 -16
  12. package/app/services/popover.service.d.ts +20 -17
  13. package/bundles/firestitch-popover.umd.js +872 -779
  14. package/bundles/firestitch-popover.umd.js.map +1 -1
  15. package/esm2015/app/class/popover-ref.js +86 -96
  16. package/esm2015/app/components/popover/popover.component.js +191 -224
  17. package/esm2015/app/components/popover-wrapper/popover-wrapper.component.js +119 -124
  18. package/esm2015/app/enums/position.js +8 -8
  19. package/esm2015/app/fs-popover.module.js +44 -35
  20. package/esm2015/app/helpers/create-injector.js +9 -9
  21. package/esm2015/app/helpers/create-overlay-ref.js +12 -12
  22. package/esm2015/app/helpers/create-position-strategy.js +56 -56
  23. package/esm2015/app/helpers/create-template-portal.js +5 -5
  24. package/esm2015/app/helpers/point-in-rect.js +4 -4
  25. package/esm2015/app/interfaces/popover-config.interface.js +2 -1
  26. package/esm2015/app/services/popover.service.js +56 -60
  27. package/esm2015/firestitch-popover.js +5 -7
  28. package/esm2015/public_api.js +8 -7
  29. package/fesm2015/firestitch-popover.js +540 -578
  30. package/fesm2015/firestitch-popover.js.map +1 -1
  31. package/firestitch-popover.d.ts +5 -6
  32. package/package.json +7 -8
  33. package/public_api.d.ts +5 -4
  34. package/styles.scss +4 -3
  35. package/bundles/firestitch-popover.umd.min.js +0 -16
  36. package/bundles/firestitch-popover.umd.min.js.map +0 -1
  37. package/esm5/app/class/popover-ref.js +0 -152
  38. package/esm5/app/components/popover/popover.component.js +0 -241
  39. package/esm5/app/components/popover-wrapper/popover-wrapper.component.js +0 -138
  40. package/esm5/app/enums/position.js +0 -8
  41. package/esm5/app/fs-popover.module.js +0 -39
  42. package/esm5/app/helpers/create-injector.js +0 -9
  43. package/esm5/app/helpers/create-overlay-ref.js +0 -12
  44. package/esm5/app/helpers/create-position-strategy.js +0 -56
  45. package/esm5/app/helpers/create-template-portal.js +0 -5
  46. package/esm5/app/helpers/point-in-rect.js +0 -4
  47. package/esm5/app/interfaces/popover-config.interface.js +0 -1
  48. package/esm5/app/services/popover.service.js +0 -70
  49. package/esm5/firestitch-popover.js +0 -7
  50. package/esm5/public_api.js +0 -7
  51. package/fesm5/firestitch-popover.js +0 -708
  52. package/fesm5/firestitch-popover.js.map +0 -1
  53. package/firestitch-popover.metadata.json +0 -1
@@ -1,53 +1,81 @@
1
1
  (function (global, factory) {
2
2
  typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@angular/core'), require('@angular/common'), require('@angular/cdk/portal'), require('@angular/material/progress-spinner'), require('@angular/router'), require('rxjs'), require('rxjs/operators'), require('@firestitch/common'), require('@angular/cdk/overlay')) :
3
3
  typeof define === 'function' && define.amd ? define('@firestitch/popover', ['exports', '@angular/core', '@angular/common', '@angular/cdk/portal', '@angular/material/progress-spinner', '@angular/router', 'rxjs', 'rxjs/operators', '@firestitch/common', '@angular/cdk/overlay'], factory) :
4
- (global = global || self, factory((global.firestitch = global.firestitch || {}, global.firestitch.popover = {}), global.ng.core, global.ng.common, global.ng.cdk.portal, global.ng.material.progressSpinner, global.ng.router, global.rxjs, global.rxjs.operators, global.common$1, global.ng.cdk.overlay));
5
- }(this, (function (exports, core, common, portal, progressSpinner, router, rxjs, operators, common$1, overlay) { 'use strict';
4
+ (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory((global.firestitch = global.firestitch || {}, global.firestitch.popover = {}), global.ng.core, global.ng.common, global.ng.cdk.portal, global.ng.material.progressSpinner, global.ng.router, global.rxjs, global.rxjs.operators, global.common, global.ng.cdk.overlay));
5
+ })(this, (function (exports, i0, i3, i4, i2, i2$1, rxjs, operators, common, i1) { 'use strict';
6
+
7
+ function _interopNamespace(e) {
8
+ if (e && e.__esModule) return e;
9
+ var n = Object.create(null);
10
+ if (e) {
11
+ Object.keys(e).forEach(function (k) {
12
+ if (k !== 'default') {
13
+ var d = Object.getOwnPropertyDescriptor(e, k);
14
+ Object.defineProperty(n, k, d.get ? d : {
15
+ enumerable: true,
16
+ get: function () { return e[k]; }
17
+ });
18
+ }
19
+ });
20
+ }
21
+ n["default"] = e;
22
+ return Object.freeze(n);
23
+ }
24
+
25
+ var i0__namespace = /*#__PURE__*/_interopNamespace(i0);
26
+ var i3__namespace = /*#__PURE__*/_interopNamespace(i3);
27
+ var i4__namespace = /*#__PURE__*/_interopNamespace(i4);
28
+ var i2__namespace = /*#__PURE__*/_interopNamespace(i2);
29
+ var i2__namespace$1 = /*#__PURE__*/_interopNamespace(i2$1);
30
+ var i1__namespace = /*#__PURE__*/_interopNamespace(i1);
6
31
 
7
32
  /*! *****************************************************************************
8
- Copyright (c) Microsoft Corporation. All rights reserved.
9
- Licensed under the Apache License, Version 2.0 (the "License"); you may not use
10
- this file except in compliance with the License. You may obtain a copy of the
11
- License at http://www.apache.org/licenses/LICENSE-2.0
33
+ Copyright (c) Microsoft Corporation.
12
34
 
13
- THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
14
- KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED
15
- WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,
16
- MERCHANTABLITY OR NON-INFRINGEMENT.
35
+ Permission to use, copy, modify, and/or distribute this software for any
36
+ purpose with or without fee is hereby granted.
17
37
 
18
- See the Apache Version 2.0 License for specific language governing permissions
19
- and limitations under the License.
38
+ THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
39
+ REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
40
+ AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
41
+ INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
42
+ LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
43
+ OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
44
+ PERFORMANCE OF THIS SOFTWARE.
20
45
  ***************************************************************************** */
21
46
  /* global Reflect, Promise */
22
-
23
- var extendStatics = function(d, b) {
47
+ var extendStatics = function (d, b) {
24
48
  extendStatics = Object.setPrototypeOf ||
25
49
  ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
26
- function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
50
+ function (d, b) { for (var p in b)
51
+ if (Object.prototype.hasOwnProperty.call(b, p))
52
+ d[p] = b[p]; };
27
53
  return extendStatics(d, b);
28
54
  };
29
-
30
55
  function __extends(d, b) {
56
+ if (typeof b !== "function" && b !== null)
57
+ throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
31
58
  extendStatics(d, b);
32
59
  function __() { this.constructor = d; }
33
60
  d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
34
61
  }
35
-
36
- var __assign = function() {
62
+ var __assign = function () {
37
63
  __assign = Object.assign || function __assign(t) {
38
64
  for (var s, i = 1, n = arguments.length; i < n; i++) {
39
65
  s = arguments[i];
40
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
66
+ for (var p in s)
67
+ if (Object.prototype.hasOwnProperty.call(s, p))
68
+ t[p] = s[p];
41
69
  }
42
70
  return t;
43
71
  };
44
72
  return __assign.apply(this, arguments);
45
73
  };
46
-
47
74
  function __rest(s, e) {
48
75
  var t = {};
49
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
50
- t[p] = s[p];
76
+ for (var p in s)
77
+ if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
78
+ t[p] = s[p];
51
79
  if (s != null && typeof Object.getOwnPropertySymbols === "function")
52
80
  for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
53
81
  if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
@@ -55,863 +83,928 @@
55
83
  }
56
84
  return t;
57
85
  }
58
-
59
86
  function __decorate(decorators, target, key, desc) {
60
87
  var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
61
- if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
62
- else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
88
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function")
89
+ r = Reflect.decorate(decorators, target, key, desc);
90
+ else
91
+ for (var i = decorators.length - 1; i >= 0; i--)
92
+ if (d = decorators[i])
93
+ r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
63
94
  return c > 3 && r && Object.defineProperty(target, key, r), r;
64
95
  }
65
-
66
96
  function __param(paramIndex, decorator) {
67
- return function (target, key) { decorator(target, key, paramIndex); }
97
+ return function (target, key) { decorator(target, key, paramIndex); };
68
98
  }
69
-
70
99
  function __metadata(metadataKey, metadataValue) {
71
- if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(metadataKey, metadataValue);
100
+ if (typeof Reflect === "object" && typeof Reflect.metadata === "function")
101
+ return Reflect.metadata(metadataKey, metadataValue);
72
102
  }
73
-
74
103
  function __awaiter(thisArg, _arguments, P, generator) {
75
104
  function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
76
105
  return new (P || (P = Promise))(function (resolve, reject) {
77
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
78
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
106
+ function fulfilled(value) { try {
107
+ step(generator.next(value));
108
+ }
109
+ catch (e) {
110
+ reject(e);
111
+ } }
112
+ function rejected(value) { try {
113
+ step(generator["throw"](value));
114
+ }
115
+ catch (e) {
116
+ reject(e);
117
+ } }
79
118
  function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
80
119
  step((generator = generator.apply(thisArg, _arguments || [])).next());
81
120
  });
82
121
  }
83
-
84
122
  function __generator(thisArg, body) {
85
- var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
86
- return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
123
+ var _ = { label: 0, sent: function () { if (t[0] & 1)
124
+ throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
125
+ return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function () { return this; }), g;
87
126
  function verb(n) { return function (v) { return step([n, v]); }; }
88
127
  function step(op) {
89
- if (f) throw new TypeError("Generator is already executing.");
90
- while (_) try {
91
- if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
92
- if (y = 0, t) op = [op[0] & 2, t.value];
93
- switch (op[0]) {
94
- case 0: case 1: t = op; break;
95
- case 4: _.label++; return { value: op[1], done: false };
96
- case 5: _.label++; y = op[1]; op = [0]; continue;
97
- case 7: op = _.ops.pop(); _.trys.pop(); continue;
98
- default:
99
- if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
100
- if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
101
- if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
102
- if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
103
- if (t[2]) _.ops.pop();
104
- _.trys.pop(); continue;
128
+ if (f)
129
+ throw new TypeError("Generator is already executing.");
130
+ while (_)
131
+ try {
132
+ if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done)
133
+ return t;
134
+ if (y = 0, t)
135
+ op = [op[0] & 2, t.value];
136
+ switch (op[0]) {
137
+ case 0:
138
+ case 1:
139
+ t = op;
140
+ break;
141
+ case 4:
142
+ _.label++;
143
+ return { value: op[1], done: false };
144
+ case 5:
145
+ _.label++;
146
+ y = op[1];
147
+ op = [0];
148
+ continue;
149
+ case 7:
150
+ op = _.ops.pop();
151
+ _.trys.pop();
152
+ continue;
153
+ default:
154
+ if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) {
155
+ _ = 0;
156
+ continue;
157
+ }
158
+ if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) {
159
+ _.label = op[1];
160
+ break;
161
+ }
162
+ if (op[0] === 6 && _.label < t[1]) {
163
+ _.label = t[1];
164
+ t = op;
165
+ break;
166
+ }
167
+ if (t && _.label < t[2]) {
168
+ _.label = t[2];
169
+ _.ops.push(op);
170
+ break;
171
+ }
172
+ if (t[2])
173
+ _.ops.pop();
174
+ _.trys.pop();
175
+ continue;
176
+ }
177
+ op = body.call(thisArg, _);
178
+ }
179
+ catch (e) {
180
+ op = [6, e];
181
+ y = 0;
105
182
  }
106
- op = body.call(thisArg, _);
107
- } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
108
- if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
183
+ finally {
184
+ f = t = 0;
185
+ }
186
+ if (op[0] & 5)
187
+ throw op[1];
188
+ return { value: op[0] ? op[1] : void 0, done: true };
109
189
  }
110
190
  }
111
-
112
- function __exportStar(m, exports) {
113
- for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p];
191
+ var __createBinding = Object.create ? (function (o, m, k, k2) {
192
+ if (k2 === undefined)
193
+ k2 = k;
194
+ Object.defineProperty(o, k2, { enumerable: true, get: function () { return m[k]; } });
195
+ }) : (function (o, m, k, k2) {
196
+ if (k2 === undefined)
197
+ k2 = k;
198
+ o[k2] = m[k];
199
+ });
200
+ function __exportStar(m, o) {
201
+ for (var p in m)
202
+ if (p !== "default" && !Object.prototype.hasOwnProperty.call(o, p))
203
+ __createBinding(o, m, p);
114
204
  }
115
-
116
205
  function __values(o) {
117
206
  var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0;
118
- if (m) return m.call(o);
119
- if (o && typeof o.length === "number") return {
120
- next: function () {
121
- if (o && i >= o.length) o = void 0;
122
- return { value: o && o[i++], done: !o };
123
- }
124
- };
207
+ if (m)
208
+ return m.call(o);
209
+ if (o && typeof o.length === "number")
210
+ return {
211
+ next: function () {
212
+ if (o && i >= o.length)
213
+ o = void 0;
214
+ return { value: o && o[i++], done: !o };
215
+ }
216
+ };
125
217
  throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");
126
218
  }
127
-
128
219
  function __read(o, n) {
129
220
  var m = typeof Symbol === "function" && o[Symbol.iterator];
130
- if (!m) return o;
221
+ if (!m)
222
+ return o;
131
223
  var i = m.call(o), r, ar = [], e;
132
224
  try {
133
- while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
225
+ while ((n === void 0 || n-- > 0) && !(r = i.next()).done)
226
+ ar.push(r.value);
227
+ }
228
+ catch (error) {
229
+ e = { error: error };
134
230
  }
135
- catch (error) { e = { error: error }; }
136
231
  finally {
137
232
  try {
138
- if (r && !r.done && (m = i["return"])) m.call(i);
233
+ if (r && !r.done && (m = i["return"]))
234
+ m.call(i);
235
+ }
236
+ finally {
237
+ if (e)
238
+ throw e.error;
139
239
  }
140
- finally { if (e) throw e.error; }
141
240
  }
142
241
  return ar;
143
242
  }
144
-
243
+ /** @deprecated */
145
244
  function __spread() {
146
245
  for (var ar = [], i = 0; i < arguments.length; i++)
147
246
  ar = ar.concat(__read(arguments[i]));
148
247
  return ar;
149
248
  }
150
-
249
+ /** @deprecated */
151
250
  function __spreadArrays() {
152
- for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length;
251
+ for (var s = 0, i = 0, il = arguments.length; i < il; i++)
252
+ s += arguments[i].length;
153
253
  for (var r = Array(s), k = 0, i = 0; i < il; i++)
154
254
  for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)
155
255
  r[k] = a[j];
156
256
  return r;
157
- };
158
-
257
+ }
258
+ function __spreadArray(to, from, pack) {
259
+ if (pack || arguments.length === 2)
260
+ for (var i = 0, l = from.length, ar; i < l; i++) {
261
+ if (ar || !(i in from)) {
262
+ if (!ar)
263
+ ar = Array.prototype.slice.call(from, 0, i);
264
+ ar[i] = from[i];
265
+ }
266
+ }
267
+ return to.concat(ar || Array.prototype.slice.call(from));
268
+ }
159
269
  function __await(v) {
160
270
  return this instanceof __await ? (this.v = v, this) : new __await(v);
161
271
  }
162
-
163
272
  function __asyncGenerator(thisArg, _arguments, generator) {
164
- if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined.");
273
+ if (!Symbol.asyncIterator)
274
+ throw new TypeError("Symbol.asyncIterator is not defined.");
165
275
  var g = generator.apply(thisArg, _arguments || []), i, q = [];
166
276
  return i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i;
167
- function verb(n) { if (g[n]) i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; }
168
- function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } }
277
+ function verb(n) { if (g[n])
278
+ i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; }
279
+ function resume(n, v) { try {
280
+ step(g[n](v));
281
+ }
282
+ catch (e) {
283
+ settle(q[0][3], e);
284
+ } }
169
285
  function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }
170
286
  function fulfill(value) { resume("next", value); }
171
287
  function reject(value) { resume("throw", value); }
172
- function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); }
288
+ function settle(f, v) { if (f(v), q.shift(), q.length)
289
+ resume(q[0][0], q[0][1]); }
173
290
  }
174
-
175
291
  function __asyncDelegator(o) {
176
292
  var i, p;
177
293
  return i = {}, verb("next"), verb("throw", function (e) { throw e; }), verb("return"), i[Symbol.iterator] = function () { return this; }, i;
178
294
  function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: n === "return" } : f ? f(v) : v; } : f; }
179
295
  }
180
-
181
296
  function __asyncValues(o) {
182
- if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined.");
297
+ if (!Symbol.asyncIterator)
298
+ throw new TypeError("Symbol.asyncIterator is not defined.");
183
299
  var m = o[Symbol.asyncIterator], i;
184
300
  return m ? m.call(o) : (o = typeof __values === "function" ? __values(o) : o[Symbol.iterator](), i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i);
185
301
  function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; }
186
- function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); }
302
+ function settle(resolve, reject, d, v) { Promise.resolve(v).then(function (v) { resolve({ value: v, done: d }); }, reject); }
187
303
  }
188
-
189
304
  function __makeTemplateObject(cooked, raw) {
190
- if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; }
305
+ if (Object.defineProperty) {
306
+ Object.defineProperty(cooked, "raw", { value: raw });
307
+ }
308
+ else {
309
+ cooked.raw = raw;
310
+ }
191
311
  return cooked;
312
+ }
313
+ ;
314
+ var __setModuleDefault = Object.create ? (function (o, v) {
315
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
316
+ }) : function (o, v) {
317
+ o["default"] = v;
192
318
  };
193
-
194
319
  function __importStar(mod) {
195
- if (mod && mod.__esModule) return mod;
320
+ if (mod && mod.__esModule)
321
+ return mod;
196
322
  var result = {};
197
- if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];
198
- result.default = mod;
323
+ if (mod != null)
324
+ for (var k in mod)
325
+ if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k))
326
+ __createBinding(result, mod, k);
327
+ __setModuleDefault(result, mod);
199
328
  return result;
200
329
  }
201
-
202
330
  function __importDefault(mod) {
203
331
  return (mod && mod.__esModule) ? mod : { default: mod };
204
332
  }
205
-
206
- function __classPrivateFieldGet(receiver, privateMap) {
207
- if (!privateMap.has(receiver)) {
208
- throw new TypeError("attempted to get private field on non-instance");
209
- }
210
- return privateMap.get(receiver);
333
+ function __classPrivateFieldGet(receiver, state, kind, f) {
334
+ if (kind === "a" && !f)
335
+ throw new TypeError("Private accessor was defined without a getter");
336
+ if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver))
337
+ throw new TypeError("Cannot read private member from an object whose class did not declare it");
338
+ return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
211
339
  }
212
-
213
- function __classPrivateFieldSet(receiver, privateMap, value) {
214
- if (!privateMap.has(receiver)) {
215
- throw new TypeError("attempted to set private field on non-instance");
216
- }
217
- privateMap.set(receiver, value);
218
- return value;
340
+ function __classPrivateFieldSet(receiver, state, value, kind, f) {
341
+ if (kind === "m")
342
+ throw new TypeError("Private method is not writable");
343
+ if (kind === "a" && !f)
344
+ throw new TypeError("Private accessor was defined without a setter");
345
+ if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver))
346
+ throw new TypeError("Cannot write private member to an object whose class did not declare it");
347
+ return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
219
348
  }
220
349
 
221
- var Position;
222
- (function (Position) {
223
- Position["North"] = "north";
224
- Position["South"] = "south";
225
- Position["East"] = "east";
226
- Position["West"] = "west";
227
- })(Position || (Position = {}));
350
+ exports.Position = void 0;
351
+ (function (Position) {
352
+ Position["North"] = "north";
353
+ Position["South"] = "south";
354
+ Position["East"] = "east";
355
+ Position["West"] = "west";
356
+ })(exports.Position || (exports.Position = {}));
228
357
 
229
- var FsPopoverRef = /** @class */ (function () {
230
- function FsPopoverRef(config) {
231
- if (config === void 0) { config = {}; }
232
- this._autoShow$ = new rxjs.BehaviorSubject(true);
233
- this._autoClose$ = new rxjs.BehaviorSubject(true);
234
- this._componentLoading$ = new rxjs.BehaviorSubject(true);
235
- this._init(config);
236
- }
237
- Object.defineProperty(FsPopoverRef.prototype, "loadingDiameter", {
238
- get: function () {
239
- return this._loadingDiameter;
240
- },
241
- enumerable: true,
242
- configurable: true
243
- });
244
- Object.defineProperty(FsPopoverRef.prototype, "size", {
245
- get: function () {
246
- return this._size;
247
- },
248
- enumerable: true,
249
- configurable: true
250
- });
251
- Object.defineProperty(FsPopoverRef.prototype, "theme", {
252
- get: function () {
253
- return this._theme;
254
- },
255
- enumerable: true,
256
- configurable: true
257
- });
258
- Object.defineProperty(FsPopoverRef.prototype, "loading", {
259
- get: function () {
260
- return this._loading;
261
- },
262
- enumerable: true,
263
- configurable: true
264
- });
265
- Object.defineProperty(FsPopoverRef.prototype, "autoShow$", {
266
- get: function () {
267
- return this._autoShow$.asObservable();
268
- },
269
- enumerable: true,
270
- configurable: true
271
- });
272
- Object.defineProperty(FsPopoverRef.prototype, "autoShow", {
273
- get: function () {
274
- return this._autoShow$.getValue();
275
- },
276
- set: function (value) {
277
- this._autoShow$.next(value);
278
- },
279
- enumerable: true,
280
- configurable: true
281
- });
282
- Object.defineProperty(FsPopoverRef.prototype, "autoClose$", {
283
- get: function () {
284
- return this._autoClose$.asObservable();
285
- },
286
- enumerable: true,
287
- configurable: true
288
- });
289
- Object.defineProperty(FsPopoverRef.prototype, "autoClose", {
290
- get: function () {
291
- return this._autoClose$.getValue();
292
- },
293
- set: function (value) {
294
- this._autoClose$.next(value);
295
- },
296
- enumerable: true,
297
- configurable: true
298
- });
299
- Object.defineProperty(FsPopoverRef.prototype, "componentVisible$", {
300
- get: function () {
301
- return rxjs.combineLatest([
302
- this.autoShow$,
303
- this.componentLoading$,
304
- ]).pipe(operators.map(function (_a) {
305
- var _b = __read(_a, 2), autoShow = _b[0], componentLoading = _b[1];
306
- return autoShow || !componentLoading;
307
- }));
308
- },
309
- enumerable: true,
310
- configurable: true
311
- });
312
- Object.defineProperty(FsPopoverRef.prototype, "componentLoading$", {
313
- get: function () {
314
- return this._componentLoading$.asObservable();
315
- },
316
- enumerable: true,
317
- configurable: true
318
- });
319
- Object.defineProperty(FsPopoverRef.prototype, "componentLoading", {
320
- get: function () {
321
- return this._componentLoading$.getValue();
322
- },
323
- enumerable: true,
324
- configurable: true
325
- });
326
- Object.defineProperty(FsPopoverRef.prototype, "wrapperClass", {
327
- get: function () {
328
- return this._wrapperClass;
329
- },
330
- enumerable: true,
331
- configurable: true
332
- });
333
- Object.defineProperty(FsPopoverRef.prototype, "maxWidth", {
334
- get: function () {
335
- return this._maxWidth;
336
- },
337
- enumerable: true,
338
- configurable: true
339
- });
340
- FsPopoverRef.prototype.show = function () {
341
- var _this = this;
342
- setTimeout(function () {
343
- _this._componentLoading$.next(false);
344
- setTimeout(function () {
345
- _this.updatePosition();
346
- });
347
- });
348
- };
349
- FsPopoverRef.prototype.close = function () {
350
- this.overlayRef.detach();
351
- this._componentLoading$.next(true);
352
- };
353
- FsPopoverRef.prototype.updatePosition = function () {
354
- this.overlayRef.updatePosition();
355
- };
356
- FsPopoverRef.prototype._init = function (config) {
357
- this._wrapperClass = config.wrapperClass;
358
- this._maxWidth = config.maxWidth;
359
- this._loading = config.loading;
360
- this._loadingDiameter = config.loadingDiameter;
361
- this._size = config.size;
362
- this._theme = config.theme;
363
- this._autoShow$.next(config.autoShow);
364
- this._autoClose$.next(config.autoClose);
365
- };
366
- FsPopoverRef.ctorParameters = function () { return [
367
- { type: undefined }
368
- ]; };
369
- FsPopoverRef = __decorate([
370
- core.Injectable(),
371
- __metadata("design:paramtypes", [Object])
372
- ], FsPopoverRef);
373
- return FsPopoverRef;
358
+ function pointInRect(x1, y1, x2, y2, px, py) {
359
+ return (px > x1 && px < x2) && (py > y1 && py < y2);
360
+ }
361
+
362
+ var FsPopoverRef = /** @class */ (function () {
363
+ function FsPopoverRef(config) {
364
+ if (config === void 0) { config = {}; }
365
+ this._autoShow$ = new rxjs.BehaviorSubject(true);
366
+ this._autoClose$ = new rxjs.BehaviorSubject(true);
367
+ this._componentLoading$ = new rxjs.BehaviorSubject(true);
368
+ this._init(config);
369
+ }
370
+ Object.defineProperty(FsPopoverRef.prototype, "loadingDiameter", {
371
+ get: function () {
372
+ return this._loadingDiameter;
373
+ },
374
+ enumerable: false,
375
+ configurable: true
376
+ });
377
+ Object.defineProperty(FsPopoverRef.prototype, "size", {
378
+ get: function () {
379
+ return this._size;
380
+ },
381
+ enumerable: false,
382
+ configurable: true
383
+ });
384
+ Object.defineProperty(FsPopoverRef.prototype, "theme", {
385
+ get: function () {
386
+ return this._theme;
387
+ },
388
+ enumerable: false,
389
+ configurable: true
390
+ });
391
+ Object.defineProperty(FsPopoverRef.prototype, "loading", {
392
+ get: function () {
393
+ return this._loading;
394
+ },
395
+ enumerable: false,
396
+ configurable: true
397
+ });
398
+ Object.defineProperty(FsPopoverRef.prototype, "autoShow$", {
399
+ get: function () {
400
+ return this._autoShow$.asObservable();
401
+ },
402
+ enumerable: false,
403
+ configurable: true
404
+ });
405
+ Object.defineProperty(FsPopoverRef.prototype, "autoShow", {
406
+ get: function () {
407
+ return this._autoShow$.getValue();
408
+ },
409
+ set: function (value) {
410
+ this._autoShow$.next(value);
411
+ },
412
+ enumerable: false,
413
+ configurable: true
414
+ });
415
+ Object.defineProperty(FsPopoverRef.prototype, "autoClose$", {
416
+ get: function () {
417
+ return this._autoClose$.asObservable();
418
+ },
419
+ enumerable: false,
420
+ configurable: true
421
+ });
422
+ Object.defineProperty(FsPopoverRef.prototype, "autoClose", {
423
+ get: function () {
424
+ return this._autoClose$.getValue();
425
+ },
426
+ set: function (value) {
427
+ this._autoClose$.next(value);
428
+ },
429
+ enumerable: false,
430
+ configurable: true
431
+ });
432
+ Object.defineProperty(FsPopoverRef.prototype, "componentVisible$", {
433
+ get: function () {
434
+ return rxjs.combineLatest([
435
+ this.autoShow$,
436
+ this.componentLoading$,
437
+ ]).pipe(operators.map(function (_a) {
438
+ var _b = __read(_a, 2), autoShow = _b[0], componentLoading = _b[1];
439
+ return autoShow || !componentLoading;
440
+ }));
441
+ },
442
+ enumerable: false,
443
+ configurable: true
444
+ });
445
+ Object.defineProperty(FsPopoverRef.prototype, "componentLoading$", {
446
+ get: function () {
447
+ return this._componentLoading$.asObservable();
448
+ },
449
+ enumerable: false,
450
+ configurable: true
451
+ });
452
+ Object.defineProperty(FsPopoverRef.prototype, "componentLoading", {
453
+ get: function () {
454
+ return this._componentLoading$.getValue();
455
+ },
456
+ enumerable: false,
457
+ configurable: true
458
+ });
459
+ Object.defineProperty(FsPopoverRef.prototype, "wrapperClass", {
460
+ get: function () {
461
+ return this._wrapperClass;
462
+ },
463
+ enumerable: false,
464
+ configurable: true
465
+ });
466
+ Object.defineProperty(FsPopoverRef.prototype, "maxWidth", {
467
+ get: function () {
468
+ return this._maxWidth;
469
+ },
470
+ enumerable: false,
471
+ configurable: true
472
+ });
473
+ FsPopoverRef.prototype.show = function () {
474
+ var _this = this;
475
+ setTimeout(function () {
476
+ _this._componentLoading$.next(false);
477
+ setTimeout(function () {
478
+ _this.updatePosition();
479
+ });
480
+ });
481
+ };
482
+ FsPopoverRef.prototype.close = function () {
483
+ this.overlayRef.detach();
484
+ this._componentLoading$.next(true);
485
+ };
486
+ FsPopoverRef.prototype.updatePosition = function () {
487
+ this.overlayRef.updatePosition();
488
+ };
489
+ FsPopoverRef.prototype._init = function (config) {
490
+ this._wrapperClass = config.wrapperClass;
491
+ this._maxWidth = config.maxWidth;
492
+ this._loading = config.loading;
493
+ this._loadingDiameter = config.loadingDiameter;
494
+ this._size = config.size;
495
+ this._theme = config.theme;
496
+ this._autoShow$.next(config.autoShow);
497
+ this._autoClose$.next(config.autoClose);
498
+ };
499
+ return FsPopoverRef;
374
500
  }());
375
501
 
376
- var FsPopoverWrapperComponent = /** @class */ (function (_super) {
377
- __extends(FsPopoverWrapperComponent, _super);
378
- function FsPopoverWrapperComponent(popoverRef, _el, _zone) {
379
- var _this = _super.call(this) || this;
380
- _this.popoverRef = popoverRef;
381
- _this._el = _el;
382
- _this._zone = _zone;
383
- _this.hidden = false;
384
- _this._updatePosition = new rxjs.Subject();
385
- _this._destroy$ = new rxjs.Subject();
386
- _this._updateClass();
387
- _this.wrapperClass = _this.popoverRef.wrapperClass;
388
- _this.maxWidth = _this.popoverRef.maxWidth;
389
- return _this;
390
- }
391
- Object.defineProperty(FsPopoverWrapperComponent.prototype, "maxWidth", {
392
- set: function (value) {
393
- this._el.nativeElement.style.maxWidth = value ? value + 'px' : void 0;
394
- },
395
- enumerable: true,
396
- configurable: true
397
- });
398
- Object.defineProperty(FsPopoverWrapperComponent.prototype, "wrapperClass", {
399
- set: function (value) {
400
- this._wrapperClass = value;
401
- this._updateClass();
402
- },
403
- enumerable: true,
404
- configurable: true
405
- });
406
- FsPopoverWrapperComponent.prototype.ngOnInit = function () {
407
- if (!this.popoverRef.autoShow && this.popoverRef.componentLoading) {
408
- this._watchMousePosition();
409
- }
410
- this._observeContentChanges();
411
- this._listenUpdatePositionRequests();
412
- };
413
- FsPopoverWrapperComponent.prototype.ngOnDestroy = function () {
414
- this._contentChangesObserver.disconnect();
415
- this._destroy$.next();
416
- this._destroy$.complete();
417
- };
418
- /**
419
- * Attach a TemplatePortal as content to this popover container.
420
- * @param portal Portal to be attached as the popover content.
421
- */
422
- FsPopoverWrapperComponent.prototype.attachTemplatePortal = function (portal) {
423
- if (this._portalOutlet.hasAttached()) {
424
- throw Error('Popover template already attached');
425
- }
426
- return this._portalOutlet.attachTemplatePortal(portal);
427
- };
428
- /**
429
- * Attach a ComponentPortal as content to this popover container.
430
- * @param portal Portal to be attached as the popover content.
431
- */
432
- FsPopoverWrapperComponent.prototype.attachComponentPortal = function (portal) {
433
- if (this._portalOutlet.hasAttached()) {
434
- throw Error('Popover component already attached');
435
- }
436
- return this._portalOutlet.attachComponentPortal(portal);
437
- };
438
- FsPopoverWrapperComponent.prototype.updatePosition = function () {
439
- this._updatePosition.next();
440
- };
441
- FsPopoverWrapperComponent.prototype._watchMousePosition = function () {
442
- var _this = this;
443
- var componentVisibilityChange$ = this.popoverRef.componentVisible$
444
- .pipe(operators.filter(function (value) { return value === true; }));
445
- this._zone.runOutsideAngular(function () {
446
- rxjs.fromEvent(document, 'mousemove')
447
- .pipe(operators.takeUntil(componentVisibilityChange$), operators.takeUntil(_this._destroy$))
448
- .subscribe(function (e) {
449
- _this.spinner.nativeElement.style.left = e.x + 'px';
450
- _this.spinner.nativeElement.style.top = (e.y + 20) + 'px';
451
- });
452
- });
453
- };
454
- FsPopoverWrapperComponent.prototype._updateClass = function () {
455
- this.class = ['popover-wrapper', this._wrapperClass].filter(Boolean).join(' ');
456
- };
457
- FsPopoverWrapperComponent.prototype._observeContentChanges = function () {
458
- var _this = this;
459
- var config = {
460
- childList: true,
461
- subtree: true
462
- };
463
- this._contentChangesObserver = new MutationObserver(function () {
464
- _this.updatePosition();
465
- });
466
- this._contentChangesObserver.observe(this._el.nativeElement, config);
467
- };
468
- FsPopoverWrapperComponent.prototype._listenUpdatePositionRequests = function () {
469
- var _this = this;
470
- this._updatePosition
471
- .pipe(operators.debounceTime(50), operators.takeUntil(this._destroy$))
472
- .subscribe(function () {
473
- _this.popoverRef.updatePosition();
474
- });
475
- };
476
- FsPopoverWrapperComponent.ctorParameters = function () { return [
477
- { type: FsPopoverRef },
478
- { type: core.ElementRef },
479
- { type: core.NgZone }
480
- ]; };
481
- __decorate([
482
- core.ViewChild(portal.CdkPortalOutlet, { static: true }),
483
- __metadata("design:type", portal.CdkPortalOutlet)
484
- ], FsPopoverWrapperComponent.prototype, "_portalOutlet", void 0);
485
- __decorate([
486
- core.ViewChild('spinner'),
487
- __metadata("design:type", Object)
488
- ], FsPopoverWrapperComponent.prototype, "spinner", void 0);
489
- __decorate([
490
- core.HostBinding('class'),
491
- __metadata("design:type", Object)
492
- ], FsPopoverWrapperComponent.prototype, "class", void 0);
493
- FsPopoverWrapperComponent = __decorate([
494
- core.Component({
495
- selector: 'fs-popover-wrapper',
496
- template: "<div class=\"wrapper\" [ngClass]=\"{\n 'theme-dark' : popoverRef.theme === 'dark',\n 'size-tiny': popoverRef.size === 'tiny',\n 'size-small': popoverRef.size === 'small',\n 'hidden': !(popoverRef.componentVisible$ | async)\n }\">\n <div class=\"mat-elevation-z4 popover-content\">\n <ng-template cdkPortalOutlet></ng-template>\n </div>\n\n <div class=\"fs-popover-arrow light\"></div>\n <div class=\"fs-popover-arrow dark\"></div>\n</div>\n\n<div class=\"loading-spinner\"\n #spinner\n *ngIf=\"popoverRef.loading && !(popoverRef.componentVisible$ | async)\"\n [style.marginLeft]=\"(popoverRef.loadingDiameter * -.25) +'px'\">\n <mat-spinner [diameter]=\"popoverRef.loadingDiameter\"></mat-spinner>\n</div>\n",
497
- changeDetection: core.ChangeDetectionStrategy.OnPush,
498
- styles: [".wrapper{padding:6px;-webkit-animation:.2s fadeIn;animation:.2s fadeIn}.wrapper.hidden{display:none}.wrapper .popover-content{background:#fff;border-radius:4px;padding:8px;color:#1b1b1b;box-sizing:border-box;overflow:hidden}.wrapper.theme-dark .popover-content{background-color:#707070;color:#fff}.wrapper.size-small .popover-content{font-size:80%}.wrapper.size-tiny .popover-content{font-size:75%}.wrapper .fs-popover-arrow{width:0;height:0;font-size:0;line-height:0;position:absolute;z-index:1}.wrapper .fs-popover-arrow.dark{z-index:0}::ng-deep .fs-popover-bottom .fs-popover-arrow,::ng-deep .fs-popover-top .fs-popover-arrow{border-left:10px solid transparent;border-right:10px solid transparent}::ng-deep .fs-popover-left .fs-popover-arrow,::ng-deep .fs-popover-right .fs-popover-arrow{border-top:10px solid transparent;border-bottom:10px solid transparent}::ng-deep .fs-popover-top .fs-popover-arrow{bottom:-3px;left:calc(50% - 10px);border-top:10px solid #fff}::ng-deep .fs-popover-top .fs-popover-arrow.dark{border-top-color:rgba(223,223,223,.25);bottom:-4px}::ng-deep .fs-popover-bottom .fs-popover-arrow{top:-3px;left:calc(50% - 10px);border-bottom:10px solid #fff}::ng-deep .fs-popover-bottom .fs-popover-arrow.dark{border-bottom-color:rgba(223,223,223,.25);top:-4px}::ng-deep .fs-popover-left .fs-popover-arrow{left:-3px;top:calc(50% - 10px);border-right:10px solid #fff}::ng-deep .fs-popover-left .fs-popover-arrow.dark{border-right-color:rgba(223,223,223,.25);left:-4px}::ng-deep .fs-popover-right .fs-popover-arrow{right:-3px;top:calc(50% - 10px);border-left:10px solid #fff}::ng-deep .fs-popover-right .fs-popover-arrow.dark{border-left-color:rgba(223,223,223,.25);right:-4px}::ng-deep .fs-popover-bottom .wrapper.theme-dark .fs-popover-arrow{border-bottom-color:#707070}::ng-deep .fs-popover-left .wrapper.theme-dark .fs-popover-arrow{border-right-color:#707070}::ng-deep .fs-popover-right .wrapper.theme-dark .fs-popover-arrow{border-left-color:#707070}::ng-deep .fs-popover-top .wrapper.theme-dark .fs-popover-arrow{border-top-color:#707070}.loading-spinner{margin-top:10px}@-webkit-keyframes fadeIn{0%{opacity:0}100%{opacity:1}}@keyframes fadeIn{0%{opacity:0}100%{opacity:1}}"]
499
- }),
500
- __metadata("design:paramtypes", [FsPopoverRef,
501
- core.ElementRef,
502
- core.NgZone])
503
- ], FsPopoverWrapperComponent);
504
- return FsPopoverWrapperComponent;
505
- }(portal.BasePortalOutlet));
502
+ var FsPopoverWrapperComponent = /** @class */ (function (_super) {
503
+ __extends(FsPopoverWrapperComponent, _super);
504
+ function FsPopoverWrapperComponent(popoverRef, _el, _zone) {
505
+ var _this = _super.call(this) || this;
506
+ _this.popoverRef = popoverRef;
507
+ _this._el = _el;
508
+ _this._zone = _zone;
509
+ _this.hidden = false;
510
+ _this._updatePosition = new rxjs.Subject();
511
+ _this._destroy$ = new rxjs.Subject();
512
+ _this._updateClass();
513
+ _this.wrapperClass = _this.popoverRef.wrapperClass;
514
+ _this.maxWidth = _this.popoverRef.maxWidth;
515
+ return _this;
516
+ }
517
+ Object.defineProperty(FsPopoverWrapperComponent.prototype, "maxWidth", {
518
+ set: function (value) {
519
+ this._el.nativeElement.style.maxWidth = value ? value + 'px' : void 0;
520
+ },
521
+ enumerable: false,
522
+ configurable: true
523
+ });
524
+ Object.defineProperty(FsPopoverWrapperComponent.prototype, "wrapperClass", {
525
+ set: function (value) {
526
+ this._wrapperClass = value;
527
+ this._updateClass();
528
+ },
529
+ enumerable: false,
530
+ configurable: true
531
+ });
532
+ FsPopoverWrapperComponent.prototype.ngOnInit = function () {
533
+ if (!this.popoverRef.autoShow && this.popoverRef.componentLoading) {
534
+ this._watchMousePosition();
535
+ }
536
+ this._observeContentChanges();
537
+ this._listenUpdatePositionRequests();
538
+ };
539
+ FsPopoverWrapperComponent.prototype.ngOnDestroy = function () {
540
+ this._contentChangesObserver.disconnect();
541
+ this._destroy$.next();
542
+ this._destroy$.complete();
543
+ };
544
+ /**
545
+ * Attach a TemplatePortal as content to this popover container.
546
+ * @param portal Portal to be attached as the popover content.
547
+ */
548
+ FsPopoverWrapperComponent.prototype.attachTemplatePortal = function (portal) {
549
+ if (this._portalOutlet.hasAttached()) {
550
+ throw Error('Popover template already attached');
551
+ }
552
+ return this._portalOutlet.attachTemplatePortal(portal);
553
+ };
554
+ /**
555
+ * Attach a ComponentPortal as content to this popover container.
556
+ * @param portal Portal to be attached as the popover content.
557
+ */
558
+ FsPopoverWrapperComponent.prototype.attachComponentPortal = function (portal) {
559
+ if (this._portalOutlet.hasAttached()) {
560
+ throw Error('Popover component already attached');
561
+ }
562
+ return this._portalOutlet.attachComponentPortal(portal);
563
+ };
564
+ FsPopoverWrapperComponent.prototype.updatePosition = function () {
565
+ this._updatePosition.next();
566
+ };
567
+ FsPopoverWrapperComponent.prototype._watchMousePosition = function () {
568
+ var _this = this;
569
+ var componentVisibilityChange$ = this.popoverRef.componentVisible$
570
+ .pipe(operators.filter(function (value) { return value === true; }));
571
+ this._zone.runOutsideAngular(function () {
572
+ rxjs.fromEvent(document, 'mousemove')
573
+ .pipe(operators.takeUntil(componentVisibilityChange$), operators.takeUntil(_this._destroy$))
574
+ .subscribe(function (e) {
575
+ _this.spinner.nativeElement.style.left = e.x + 'px';
576
+ _this.spinner.nativeElement.style.top = (e.y + 20) + 'px';
577
+ });
578
+ });
579
+ };
580
+ FsPopoverWrapperComponent.prototype._updateClass = function () {
581
+ this.class = ['popover-wrapper', this._wrapperClass].filter(Boolean).join(' ');
582
+ };
583
+ FsPopoverWrapperComponent.prototype._observeContentChanges = function () {
584
+ var _this = this;
585
+ var config = {
586
+ childList: true,
587
+ subtree: true
588
+ };
589
+ this._contentChangesObserver = new MutationObserver(function () {
590
+ _this.updatePosition();
591
+ });
592
+ this._contentChangesObserver.observe(this._el.nativeElement, config);
593
+ };
594
+ FsPopoverWrapperComponent.prototype._listenUpdatePositionRequests = function () {
595
+ var _this = this;
596
+ this._updatePosition
597
+ .pipe(operators.debounceTime(50), operators.takeUntil(this._destroy$))
598
+ .subscribe(function () {
599
+ _this.popoverRef.updatePosition();
600
+ });
601
+ };
602
+ return FsPopoverWrapperComponent;
603
+ }(i4.BasePortalOutlet));
604
+ FsPopoverWrapperComponent.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: FsPopoverWrapperComponent, deps: [{ token: FsPopoverRef }, { token: i0__namespace.ElementRef }, { token: i0__namespace.NgZone }], target: i0__namespace.ɵɵFactoryTarget.Component });
605
+ FsPopoverWrapperComponent.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", type: FsPopoverWrapperComponent, selector: "fs-popover-wrapper", host: { properties: { "class": "this.class" } }, viewQueries: [{ propertyName: "_portalOutlet", first: true, predicate: i4.CdkPortalOutlet, descendants: true, static: true }, { propertyName: "spinner", first: true, predicate: ["spinner"], descendants: true }], usesInheritance: true, ngImport: i0__namespace, template: "<div class=\"wrapper\" [ngClass]=\"{\n 'theme-dark' : popoverRef.theme === 'dark',\n 'size-tiny': popoverRef.size === 'tiny',\n 'size-small': popoverRef.size === 'small',\n 'hidden': !(popoverRef.componentVisible$ | async)\n }\">\n <div class=\"mat-elevation-z4 popover-content\">\n <ng-template cdkPortalOutlet></ng-template>\n </div>\n\n <div class=\"fs-popover-arrow light\"></div>\n <div class=\"fs-popover-arrow dark\"></div>\n</div>\n\n<div class=\"loading-spinner\"\n #spinner\n *ngIf=\"popoverRef.loading && !(popoverRef.componentVisible$ | async)\"\n [style.marginLeft]=\"(popoverRef.loadingDiameter * -.25) +'px'\">\n <mat-spinner [diameter]=\"popoverRef.loadingDiameter\"></mat-spinner>\n</div>\n", styles: [".wrapper{padding:6px;animation:fadeIn ease .2s}.wrapper.hidden{display:none}.wrapper .popover-content{background:#fff;border-radius:4px;padding:8px;color:#1b1b1b;box-sizing:border-box;overflow:hidden}.wrapper.theme-dark .popover-content{background-color:#707070;color:#fff}.wrapper.size-small .popover-content{font-size:80%}.wrapper.size-tiny .popover-content{font-size:70%}.wrapper .fs-popover-arrow{width:0;height:0;font-size:0;line-height:0;position:absolute;z-index:200;z-index:1}.wrapper .fs-popover-arrow.dark{z-index:0}::ng-deep .fs-popover-top .fs-popover-arrow,::ng-deep .fs-popover-bottom .fs-popover-arrow{border-left:10px solid transparent;border-right:10px solid transparent}::ng-deep .fs-popover-left .fs-popover-arrow,::ng-deep .fs-popover-right .fs-popover-arrow{border-top:10px solid transparent;border-bottom:10px solid transparent}::ng-deep .fs-popover-top .fs-popover-arrow{bottom:-3px;left:calc(50% - 10px);border-top:10px solid #fff}::ng-deep .fs-popover-top .fs-popover-arrow.dark{border-top-color:#dfdfdf40;bottom:-4px}::ng-deep .fs-popover-bottom .fs-popover-arrow{top:-3px;left:calc(50% - 10px);border-bottom:10px solid #fff}::ng-deep .fs-popover-bottom .fs-popover-arrow.dark{border-bottom-color:#dfdfdf40;top:-4px}::ng-deep .fs-popover-left .fs-popover-arrow{left:-3px;top:calc(50% - 10px);border-right:10px solid #fff}::ng-deep .fs-popover-left .fs-popover-arrow.dark{border-right-color:#dfdfdf40;left:-4px}::ng-deep .fs-popover-right .fs-popover-arrow{right:-3px;top:calc(50% - 10px);border-left:10px solid #fff}::ng-deep .fs-popover-right .fs-popover-arrow.dark{border-left-color:#dfdfdf40;right:-4px}::ng-deep .fs-popover-bottom .wrapper.theme-dark .fs-popover-arrow{border-bottom-color:#707070}::ng-deep .fs-popover-left .wrapper.theme-dark .fs-popover-arrow{border-right-color:#707070}::ng-deep .fs-popover-right .wrapper.theme-dark .fs-popover-arrow{border-left-color:#707070}::ng-deep .fs-popover-top .wrapper.theme-dark .fs-popover-arrow{border-top-color:#707070}.loading-spinner{margin-top:10px}@keyframes fadeIn{0%{opacity:0}to{opacity:1}}\n"], components: [{ type: i2__namespace.MatSpinner, selector: "mat-spinner", inputs: ["color"] }], directives: [{ type: i3__namespace.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { type: i4__namespace.CdkPortalOutlet, selector: "[cdkPortalOutlet]", inputs: ["cdkPortalOutlet"], outputs: ["attached"], exportAs: ["cdkPortalOutlet"] }, { type: i3__namespace.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }], pipes: { "async": i3__namespace.AsyncPipe }, changeDetection: i0__namespace.ChangeDetectionStrategy.OnPush });
606
+ i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: FsPopoverWrapperComponent, decorators: [{
607
+ type: i0.Component,
608
+ args: [{
609
+ selector: 'fs-popover-wrapper',
610
+ templateUrl: 'popover-wrapper.component.html',
611
+ styleUrls: ['popover-wrapper.component.scss'],
612
+ changeDetection: i0.ChangeDetectionStrategy.OnPush,
613
+ }]
614
+ }], ctorParameters: function () { return [{ type: FsPopoverRef }, { type: i0__namespace.ElementRef }, { type: i0__namespace.NgZone }]; }, propDecorators: { _portalOutlet: [{
615
+ type: i0.ViewChild,
616
+ args: [i4.CdkPortalOutlet, { static: true }]
617
+ }], spinner: [{
618
+ type: i0.ViewChild,
619
+ args: ['spinner']
620
+ }], class: [{
621
+ type: i0.HostBinding,
622
+ args: ['class']
623
+ }] } });
506
624
 
507
- function createPopupPositionStrategy(el, overlay, position) {
508
- var overlayX = 'center';
509
- var overlayY = 'center';
510
- var originX = 'center';
511
- var originY = 'center';
512
- var offsetX = 0;
513
- var offsetY = 0;
514
- var panelClass = [];
515
- switch (position) {
516
- case Position.North:
517
- originY = 'top';
518
- overlayY = 'bottom';
519
- panelClass = ['fs-popover-top'];
520
- offsetY = -8;
521
- break;
522
- case Position.South:
523
- originY = 'bottom';
524
- overlayY = 'top';
525
- panelClass = ['fs-popover-bottom'];
526
- offsetY = 8;
527
- break;
528
- case Position.East:
529
- overlayX = 'start';
530
- originX = 'end';
531
- panelClass = ['fs-popover-left'];
532
- offsetX = 8;
533
- break;
534
- case Position.West:
535
- overlayX = 'end';
536
- originX = 'start';
537
- panelClass = ['fs-popover-right'];
538
- offsetX = -8;
539
- break;
540
- }
541
- return createBasePopupPositionStrategy(el, overlay)
542
- .withPositions([
543
- {
544
- originX: originX,
545
- originY: originY,
546
- overlayX: overlayX,
547
- overlayY: overlayY,
548
- offsetX: offsetX,
549
- offsetY: offsetY,
550
- panelClass: panelClass,
551
- }
552
- ]);
553
- }
554
- function createBasePopupPositionStrategy(el, overlay) {
555
- return overlay.position()
556
- .flexibleConnectedTo(el)
557
- .withGrowAfterOpen(true)
558
- .withFlexibleDimensions(false)
559
- .withViewportMargin(4);
625
+ function createPopupPositionStrategy(el, overlay, position) {
626
+ var overlayX = 'center';
627
+ var overlayY = 'center';
628
+ var originX = 'center';
629
+ var originY = 'center';
630
+ var offsetX = 0;
631
+ var offsetY = 0;
632
+ var panelClass = [];
633
+ switch (position) {
634
+ case exports.Position.North:
635
+ originY = 'top';
636
+ overlayY = 'bottom';
637
+ panelClass = ['fs-popover-top'];
638
+ offsetY = -8;
639
+ break;
640
+ case exports.Position.South:
641
+ originY = 'bottom';
642
+ overlayY = 'top';
643
+ panelClass = ['fs-popover-bottom'];
644
+ offsetY = 8;
645
+ break;
646
+ case exports.Position.East:
647
+ overlayX = 'start';
648
+ originX = 'end';
649
+ panelClass = ['fs-popover-left'];
650
+ offsetX = 8;
651
+ break;
652
+ case exports.Position.West:
653
+ overlayX = 'end';
654
+ originX = 'start';
655
+ panelClass = ['fs-popover-right'];
656
+ offsetX = -8;
657
+ break;
658
+ }
659
+ return createBasePopupPositionStrategy(el, overlay)
660
+ .withPositions([
661
+ {
662
+ originX: originX,
663
+ originY: originY,
664
+ overlayX: overlayX,
665
+ overlayY: overlayY,
666
+ offsetX: offsetX,
667
+ offsetY: offsetY,
668
+ panelClass: panelClass,
669
+ }
670
+ ]);
671
+ }
672
+ function createBasePopupPositionStrategy(el, overlay) {
673
+ return overlay.position()
674
+ .flexibleConnectedTo(el)
675
+ .withGrowAfterOpen(true)
676
+ .withFlexibleDimensions(false)
677
+ .withViewportMargin(4);
560
678
  }
561
679
 
562
- function createOverlayRef(el, overlay$1, position) {
563
- var config = {
564
- positionStrategy: createPopupPositionStrategy(el, overlay$1, position),
565
- scrollStrategy: overlay$1.scrollStrategies.reposition(),
566
- hasBackdrop: false
567
- };
568
- var overlayConfig = new overlay.OverlayConfig(config);
569
- return overlay$1.create(overlayConfig);
680
+ function createOverlayRef(el, overlay, position) {
681
+ var config = {
682
+ positionStrategy: createPopupPositionStrategy(el, overlay, position),
683
+ scrollStrategy: overlay.scrollStrategies.reposition(),
684
+ hasBackdrop: false
685
+ };
686
+ var overlayConfig = new i1.OverlayConfig(config);
687
+ return overlay.create(overlayConfig);
570
688
  }
571
689
 
572
- function createInjector(popoverRef, parentInjector) {
573
- var injectionTokens = new WeakMap([
574
- [FsPopoverRef, popoverRef],
575
- ]);
576
- return new portal.PortalInjector(parentInjector, injectionTokens);
690
+ function createInjector(popoverRef, parentInjector) {
691
+ var injectionTokens = new WeakMap([
692
+ [FsPopoverRef, popoverRef],
693
+ ]);
694
+ return new i4.PortalInjector(parentInjector, injectionTokens);
577
695
  }
578
696
 
579
- function createTempatePortal(template, popoverRef, data) {
580
- return new portal.TemplatePortal(template, void 0, { data: data, popover: popoverRef });
697
+ function createTempatePortal(template, popoverRef, data) {
698
+ return new i4.TemplatePortal(template, void 0, { data: data, popover: popoverRef });
581
699
  }
582
700
 
583
- var FsPopoverService = /** @class */ (function () {
584
- function FsPopoverService(_injector, _overlay) {
585
- this._injector = _injector;
586
- this._overlay = _overlay;
587
- }
588
- Object.defineProperty(FsPopoverService.prototype, "hasActivePopover", {
589
- get: function () {
590
- return !!this._activeElement;
591
- },
592
- enumerable: true,
593
- configurable: true
594
- });
595
- Object.defineProperty(FsPopoverService.prototype, "activeElementGUID", {
596
- get: function () {
597
- return this._activeElementGUID;
598
- },
599
- enumerable: true,
600
- configurable: true
601
- });
602
- FsPopoverService.prototype.setActivePopoverGUID = function (value) {
603
- this._activeElementGUID = value;
604
- };
605
- FsPopoverService.prototype.openPopover = function (el, template, data, popoverRef, position) {
606
- if (this._activeElement) {
607
- this.close(this._activeElement.popoverRef);
608
- }
609
- var overlayRef = createOverlayRef(el, this._overlay, position);
610
- var containerRef = this._openPortalPreview(FsPopoverWrapperComponent, overlayRef, popoverRef);
611
- var templatePortal = createTempatePortal(template, popoverRef, data);
612
- containerRef.instance.attachTemplatePortal(templatePortal);
613
- popoverRef.overlayRef = overlayRef;
614
- this._activeElement = {
615
- overlayRef: overlayRef,
616
- popoverRef: popoverRef,
617
- };
618
- return containerRef.location.nativeElement;
619
- };
620
- FsPopoverService.prototype.close = function (popoverRef) {
621
- if (popoverRef === void 0) { popoverRef = null; }
622
- if (this._activeElement.popoverRef === popoverRef) {
623
- popoverRef.close();
624
- this._activeElement = void 0;
625
- this._activeElementGUID = void 0;
626
- }
627
- };
628
- FsPopoverService.prototype._openPortalPreview = function (component, overlayRef, popoverRef) {
629
- var containerPortal = new portal.ComponentPortal(component, void 0, createInjector(popoverRef, this._injector));
630
- return overlayRef.attach(containerPortal);
631
- };
632
- FsPopoverService.ctorParameters = function () { return [
633
- { type: core.Injector },
634
- { type: overlay.Overlay }
635
- ]; };
636
- FsPopoverService = __decorate([
637
- core.Injectable(),
638
- __metadata("design:paramtypes", [core.Injector,
639
- overlay.Overlay])
640
- ], FsPopoverService);
641
- return FsPopoverService;
642
- }());
701
+ var FsPopoverService = /** @class */ (function () {
702
+ function FsPopoverService(_injector, _overlay) {
703
+ this._injector = _injector;
704
+ this._overlay = _overlay;
705
+ }
706
+ Object.defineProperty(FsPopoverService.prototype, "hasActivePopover", {
707
+ get: function () {
708
+ return !!this._activeElement;
709
+ },
710
+ enumerable: false,
711
+ configurable: true
712
+ });
713
+ Object.defineProperty(FsPopoverService.prototype, "activeElementGUID", {
714
+ get: function () {
715
+ return this._activeElementGUID;
716
+ },
717
+ enumerable: false,
718
+ configurable: true
719
+ });
720
+ FsPopoverService.prototype.setActivePopoverGUID = function (value) {
721
+ this._activeElementGUID = value;
722
+ };
723
+ FsPopoverService.prototype.openPopover = function (el, template, data, popoverRef, position) {
724
+ if (this._activeElement) {
725
+ this.close(this._activeElement.popoverRef);
726
+ }
727
+ var overlayRef = createOverlayRef(el, this._overlay, position);
728
+ var containerRef = this._openPortalPreview(FsPopoverWrapperComponent, overlayRef, popoverRef);
729
+ var templatePortal = createTempatePortal(template, popoverRef, data);
730
+ containerRef.instance.attachTemplatePortal(templatePortal);
731
+ popoverRef.overlayRef = overlayRef;
732
+ this._activeElement = {
733
+ overlayRef: overlayRef,
734
+ popoverRef: popoverRef,
735
+ };
736
+ return containerRef.location.nativeElement;
737
+ };
738
+ FsPopoverService.prototype.close = function (popoverRef) {
739
+ if (popoverRef === void 0) { popoverRef = null; }
740
+ if (this._activeElement.popoverRef === popoverRef) {
741
+ popoverRef.close();
742
+ this._activeElement = void 0;
743
+ this._activeElementGUID = void 0;
744
+ }
745
+ };
746
+ FsPopoverService.prototype._openPortalPreview = function (component, overlayRef, popoverRef) {
747
+ var containerPortal = new i4.ComponentPortal(component, void 0, createInjector(popoverRef, this._injector));
748
+ return overlayRef.attach(containerPortal);
749
+ };
750
+ return FsPopoverService;
751
+ }());
752
+ FsPopoverService.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: FsPopoverService, deps: [{ token: i0__namespace.Injector }, { token: i1__namespace.Overlay }], target: i0__namespace.ɵɵFactoryTarget.Injectable });
753
+ FsPopoverService.ɵprov = i0__namespace.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: FsPopoverService });
754
+ i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: FsPopoverService, decorators: [{
755
+ type: i0.Injectable
756
+ }], ctorParameters: function () { return [{ type: i0__namespace.Injector }, { type: i1__namespace.Overlay }]; } });
643
757
 
644
- function pointInRect(x1, y1, x2, y2, px, py) {
645
- return (px > x1 && px < x2) && (py > y1 && py < y2);
646
- }
758
+ var FsPopoverComponent = /** @class */ (function () {
759
+ function FsPopoverComponent(_elRef, _popoverService, _ngZone, _router) {
760
+ this._elRef = _elRef;
761
+ this._popoverService = _popoverService;
762
+ this._ngZone = _ngZone;
763
+ this._router = _router;
764
+ this._guid = common.guid('xxxxxxx');
765
+ this.leaveDelay = 100;
766
+ this.showDelay = 0;
767
+ this.maxWidth = 250;
768
+ this.autoShow = true;
769
+ this.autoClose = true;
770
+ this.loadingDiameter = 20;
771
+ this.loading = true;
772
+ this.indication = true;
773
+ this.position = exports.Position.South;
774
+ this.theme = 'light';
775
+ this.size = 'normal';
776
+ this.trigger = 'mouseover';
777
+ this._mouseEnter$ = rxjs.fromEvent(this._elRef.nativeElement, 'mouseenter');
778
+ this._mouseMove$ = rxjs.fromEvent(document, 'mousemove', { passive: true });
779
+ this._mouseLeave$ = rxjs.fromEvent(this._elRef.nativeElement, 'mouseleave');
780
+ this._popoverClosed$ = new rxjs.Subject();
781
+ this._destroy$ = new rxjs.Subject();
782
+ }
783
+ Object.defineProperty(FsPopoverComponent.prototype, "openTimer$", {
784
+ get: function () {
785
+ return rxjs.timer(this.showDelay);
786
+ },
787
+ enumerable: false,
788
+ configurable: true
789
+ });
790
+ Object.defineProperty(FsPopoverComponent.prototype, "closeTimer$", {
791
+ get: function () {
792
+ return rxjs.timer(this.leaveDelay);
793
+ },
794
+ enumerable: false,
795
+ configurable: true
796
+ });
797
+ FsPopoverComponent.prototype.ngOnInit = function () {
798
+ var _this = this;
799
+ this._popoverRef = new FsPopoverRef({
800
+ maxWidth: this.maxWidth,
801
+ wrapperClass: this.wrapperClass,
802
+ autoShow: this.autoShow,
803
+ autoClose: this.autoClose,
804
+ loadingDiameter: this.loadingDiameter,
805
+ loading: this.loading,
806
+ size: this.size,
807
+ theme: this.theme,
808
+ });
809
+ this._ngZone.runOutsideAngular(function () {
810
+ if (_this.trigger === 'click') {
811
+ _this._listenMouseHostClick();
812
+ }
813
+ else {
814
+ _this._listenMouseHostEnter();
815
+ }
816
+ });
817
+ this._listenRouteChange();
818
+ };
819
+ FsPopoverComponent.prototype.ngOnDestroy = function () {
820
+ this._popoverClosed$.next();
821
+ this._destroy$.next();
822
+ };
823
+ FsPopoverComponent.prototype._closePopover = function () {
824
+ var _this = this;
825
+ this._popoverClosed$.next();
826
+ this._ngZone.run(function () {
827
+ _this._wrapperElement = null;
828
+ if (_this._popoverService.hasActivePopover) {
829
+ _this._popoverService.close(_this._popoverRef);
830
+ }
831
+ });
832
+ };
833
+ FsPopoverComponent.prototype._listenRouteChange = function () {
834
+ var _this = this;
835
+ this._router.events
836
+ .pipe(operators.filter(function (event) {
837
+ return event instanceof i2$1.NavigationEnd;
838
+ }), rxjs.pipe(operators.takeUntil(this._destroy$
839
+ .pipe(operators.delay(200)))))
840
+ .subscribe(function () {
841
+ _this._closePopover();
842
+ });
843
+ };
844
+ FsPopoverComponent.prototype._listenMouseHostClick = function () {
845
+ var _this = this;
846
+ rxjs.fromEvent(this._elRef.nativeElement, 'click', { passive: true })
847
+ .pipe(operators.tap(function (e) {
848
+ e.stopPropagation();
849
+ _this._openPopover();
850
+ }), operators.switchMap(function () { return _this._listenMouseHostLeave$(); }), operators.switchMap(function () { return _this.closeTimer$; }), operators.takeUntil(this._destroy$))
851
+ .subscribe(function () {
852
+ _this._closePopover();
853
+ });
854
+ };
855
+ FsPopoverComponent.prototype._listenMouseHostEnter = function () {
856
+ var _this = this;
857
+ var actualMouseState$ = rxjs.merge(this._mouseLeave$.pipe(operators.mapTo(true)), this._mouseEnter$.pipe(operators.mapTo(false)))
858
+ .pipe(operators.startWith(false), operators.distinctUntilChanged());
859
+ this._mouseEnter$
860
+ .pipe(operators.filter(function () {
861
+ return !_this._wrapperElement;
862
+ }), operators.tap(function () {
863
+ _this._popoverService.setActivePopoverGUID(_this._guid);
864
+ }), operators.switchMap(function () { return _this.openTimer$; }),
865
+ // we have to check that after all delays mouse still over an elemen
866
+ operators.withLatestFrom(actualMouseState$), operators.filter(function (_a) {
867
+ var _b = __read(_a, 2), _ = _b[0], mouseLeave = _b[1];
868
+ return !mouseLeave;
869
+ }), operators.tap(function () { return _this._openPopover(); }), operators.switchMap(function () { return _this._listenMouseHostLeave$(); }), operators.switchMap(function () { return _this.closeTimer$; }), operators.tap(function () { return _this._closePopover(); }), operators.finalize(function () { return _this._closePopover(); }), operators.takeUntil(this._destroy$))
870
+ .subscribe();
871
+ };
872
+ FsPopoverComponent.prototype._openPopover = function () {
873
+ var _this = this;
874
+ if (this.trigger === 'mouseover' && this._popoverService.activeElementGUID !== this._guid) {
875
+ return;
876
+ }
877
+ this._hostBounds = this._elRef.nativeElement.getBoundingClientRect();
878
+ this._ngZone.run(function () {
879
+ _this._wrapperElement = _this._popoverService.openPopover(_this._elRef, _this.template, _this.data, _this._popoverRef, _this.position);
880
+ });
881
+ };
882
+ FsPopoverComponent.prototype._listenMouseHostLeave$ = function () {
883
+ var _this = this;
884
+ var mouseMove$ = this._mouseMove$
885
+ .pipe(operators.debounceTime(50), operators.filter(function () { return !!_this._wrapperElement; }), operators.filter(function (event) {
886
+ return _this._popoverRef.autoClose && _this._mouseLeftTheTargets(event);
887
+ }));
888
+ var mouseClick$ = rxjs.fromEvent(this._elRef.nativeElement, 'click');
889
+ return rxjs.merge(mouseMove$, mouseClick$);
890
+ //
891
+ // return this._mouseLeave$
892
+ // .pipe(
893
+ // //
894
+ // timeoutWith(200, mouseMove$),
895
+ // );
896
+ };
897
+ // Check if mouse left target or popover rects
898
+ FsPopoverComponent.prototype._mouseLeftTheTargets = function (event) {
899
+ var hostBounds = this._hostBounds;
900
+ var popoverBounds = this._wrapperElement.getBoundingClientRect();
901
+ var pointInHostRect = pointInRect(hostBounds.x, hostBounds.y, hostBounds.x + hostBounds.width, hostBounds.y + hostBounds.height, event.x, event.y);
902
+ var pointInPopoverRect = pointInRect(popoverBounds.x, popoverBounds.y, popoverBounds.x + popoverBounds.width, popoverBounds.y + popoverBounds.height, event.x, event.y);
903
+ return !pointInHostRect && !pointInPopoverRect;
904
+ };
905
+ return FsPopoverComponent;
906
+ }());
907
+ FsPopoverComponent.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: FsPopoverComponent, deps: [{ token: i0__namespace.ElementRef }, { token: FsPopoverService }, { token: i0__namespace.NgZone }, { token: i2__namespace$1.Router, optional: true }], target: i0__namespace.ɵɵFactoryTarget.Component });
908
+ FsPopoverComponent.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", type: FsPopoverComponent, selector: "fs-popover", inputs: { template: "template", data: "data", leaveDelay: "leaveDelay", showDelay: "showDelay", maxWidth: "maxWidth", wrapperClass: "wrapperClass", autoShow: "autoShow", autoClose: "autoClose", loadingDiameter: "loadingDiameter", loading: "loading", indication: "indication", position: "position", theme: "theme", size: "size", trigger: "trigger" }, host: { properties: { "class.indication": "this.indication" } }, ngImport: i0__namespace, template: "<span class=\"popover-container\"><ng-content></ng-content></span>\n", styles: [":host{display:inline-flex;cursor:pointer;position:relative}::ng-deep fs-popover.indication .popover-container{text-decoration:underline;-webkit-text-decoration-style:dashed;text-decoration-style:dashed;-webkit-text-decoration-color:#ccc;text-decoration-color:#ccc;text-underline-offset:3px}\n"], changeDetection: i0__namespace.ChangeDetectionStrategy.OnPush });
909
+ i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: FsPopoverComponent, decorators: [{
910
+ type: i0.Component,
911
+ args: [{
912
+ selector: 'fs-popover',
913
+ templateUrl: 'popover.component.html',
914
+ styleUrls: ['popover.component.scss'],
915
+ changeDetection: i0.ChangeDetectionStrategy.OnPush
916
+ }]
917
+ }], ctorParameters: function () {
918
+ return [{ type: i0__namespace.ElementRef }, { type: FsPopoverService }, { type: i0__namespace.NgZone }, { type: i2__namespace$1.Router, decorators: [{
919
+ type: i0.Optional
920
+ }] }];
921
+ }, propDecorators: { template: [{
922
+ type: i0.Input
923
+ }], data: [{
924
+ type: i0.Input
925
+ }], leaveDelay: [{
926
+ type: i0.Input
927
+ }], showDelay: [{
928
+ type: i0.Input
929
+ }], maxWidth: [{
930
+ type: i0.Input
931
+ }], wrapperClass: [{
932
+ type: i0.Input
933
+ }], autoShow: [{
934
+ type: i0.Input
935
+ }], autoClose: [{
936
+ type: i0.Input
937
+ }], loadingDiameter: [{
938
+ type: i0.Input
939
+ }], loading: [{
940
+ type: i0.Input
941
+ }], indication: [{
942
+ type: i0.Input
943
+ }, {
944
+ type: i0.HostBinding,
945
+ args: ['class.indication']
946
+ }], position: [{
947
+ type: i0.Input
948
+ }], theme: [{
949
+ type: i0.Input
950
+ }], size: [{
951
+ type: i0.Input
952
+ }], trigger: [{
953
+ type: i0.Input
954
+ }] } });
647
955
 
648
- var FsPopoverComponent = /** @class */ (function () {
649
- function FsPopoverComponent(_elRef, _popoverService, _ngZone, _router) {
650
- this._elRef = _elRef;
651
- this._popoverService = _popoverService;
652
- this._ngZone = _ngZone;
653
- this._router = _router;
654
- this._guid = common$1.guid('xxxxxxx');
655
- this.leaveDelay = 100;
656
- this.showDelay = 0;
657
- this.maxWidth = 250;
658
- this.autoShow = true;
659
- this.autoClose = true;
660
- this.loadingDiameter = 20;
661
- this.loading = true;
662
- this.indication = true;
663
- this.position = Position.South;
664
- this.theme = 'light';
665
- this.size = 'normal';
666
- this.trigger = 'mouseover';
667
- this._mouseEnter$ = rxjs.fromEvent(this._elRef.nativeElement, 'mouseenter');
668
- this._mouseMove$ = rxjs.fromEvent(document, 'mousemove', { passive: true });
669
- this._mouseLeave$ = rxjs.fromEvent(this._elRef.nativeElement, 'mouseleave');
670
- this._popoverClosed$ = new rxjs.Subject();
671
- this._destroy$ = new rxjs.Subject();
672
- }
673
- Object.defineProperty(FsPopoverComponent.prototype, "openTimer$", {
674
- get: function () {
675
- return rxjs.timer(this.showDelay);
676
- },
677
- enumerable: true,
678
- configurable: true
679
- });
680
- Object.defineProperty(FsPopoverComponent.prototype, "closeTimer$", {
681
- get: function () {
682
- return rxjs.timer(this.leaveDelay);
683
- },
684
- enumerable: true,
685
- configurable: true
686
- });
687
- FsPopoverComponent.prototype.ngOnInit = function () {
688
- var _this = this;
689
- this._popoverRef = new FsPopoverRef({
690
- maxWidth: this.maxWidth,
691
- wrapperClass: this.wrapperClass,
692
- autoShow: this.autoShow,
693
- autoClose: this.autoClose,
694
- loadingDiameter: this.loadingDiameter,
695
- loading: this.loading,
696
- size: this.size,
697
- theme: this.theme,
698
- });
699
- this._ngZone.runOutsideAngular(function () {
700
- if (_this.trigger === 'click') {
701
- _this._listenMouseHostClick();
702
- }
703
- else {
704
- _this._listenMouseHostEnter();
705
- }
706
- });
707
- this._listenRouteChange();
708
- };
709
- FsPopoverComponent.prototype.ngOnDestroy = function () {
710
- this._popoverClosed$.next();
711
- this._destroy$.next();
712
- };
713
- FsPopoverComponent.prototype._closePopover = function () {
714
- var _this = this;
715
- this._popoverClosed$.next();
716
- this._ngZone.run(function () {
717
- _this._wrapperElement = null;
718
- if (_this._popoverService.hasActivePopover) {
719
- _this._popoverService.close(_this._popoverRef);
720
- }
721
- });
722
- };
723
- FsPopoverComponent.prototype._listenRouteChange = function () {
724
- var _this = this;
725
- this._router.events
726
- .pipe(operators.filter(function (event) {
727
- return event instanceof router.NavigationEnd;
728
- }), rxjs.pipe(operators.takeUntil(this._destroy$
729
- .pipe(operators.delay(200)))))
730
- .subscribe(function () {
731
- _this._closePopover();
732
- });
733
- };
734
- FsPopoverComponent.prototype._listenMouseHostClick = function () {
735
- var _this = this;
736
- rxjs.fromEvent(this._elRef.nativeElement, 'click', { passive: true })
737
- .pipe(operators.tap(function (e) {
738
- e.stopPropagation();
739
- _this._openPopover();
740
- }), operators.switchMap(function () { return _this._listenMouseHostLeave$(); }), operators.switchMap(function () { return _this.closeTimer$; }), operators.takeUntil(this._destroy$))
741
- .subscribe(function () {
742
- _this._closePopover();
743
- });
744
- };
745
- FsPopoverComponent.prototype._listenMouseHostEnter = function () {
746
- var _this = this;
747
- var actualMouseState$ = rxjs.merge(this._mouseLeave$.pipe(operators.mapTo(true)), this._mouseEnter$.pipe(operators.mapTo(false)))
748
- .pipe(operators.startWith(false), operators.distinctUntilChanged());
749
- this._mouseEnter$
750
- .pipe(operators.filter(function () {
751
- return !_this._wrapperElement;
752
- }), operators.tap(function () {
753
- _this._popoverService.setActivePopoverGUID(_this._guid);
754
- }), operators.switchMap(function () { return _this.openTimer$; }),
755
- // we have to check that after all delays mouse still over an elemen
756
- operators.withLatestFrom(actualMouseState$), operators.filter(function (_a) {
757
- var _b = __read(_a, 2), _ = _b[0], mouseLeave = _b[1];
758
- return !mouseLeave;
759
- }), operators.tap(function () { return _this._openPopover(); }), operators.switchMap(function () { return _this._listenMouseHostLeave$(); }), operators.switchMap(function () { return _this.closeTimer$; }), operators.tap(function () { return _this._closePopover(); }), operators.finalize(function () { return _this._closePopover(); }), operators.takeUntil(this._destroy$))
760
- .subscribe();
761
- };
762
- FsPopoverComponent.prototype._openPopover = function () {
763
- var _this = this;
764
- if (this.trigger === 'mouseover' && this._popoverService.activeElementGUID !== this._guid) {
765
- return;
766
- }
767
- this._hostBounds = this._elRef.nativeElement.getBoundingClientRect();
768
- this._ngZone.run(function () {
769
- _this._wrapperElement = _this._popoverService.openPopover(_this._elRef, _this.template, _this.data, _this._popoverRef, _this.position);
770
- });
771
- };
772
- FsPopoverComponent.prototype._listenMouseHostLeave$ = function () {
773
- var _this = this;
774
- var mouseMove$ = this._mouseMove$
775
- .pipe(operators.debounceTime(50), operators.filter(function () { return !!_this._wrapperElement; }), operators.filter(function (event) {
776
- return _this._popoverRef.autoClose && _this._mouseLeftTheTargets(event);
777
- }));
778
- var mouseClick$ = rxjs.fromEvent(this._elRef.nativeElement, 'click');
779
- return rxjs.merge(mouseMove$, mouseClick$);
780
- //
781
- // return this._mouseLeave$
782
- // .pipe(
783
- // //
784
- // timeoutWith(200, mouseMove$),
785
- // );
786
- };
787
- // Check if mouse left target or popover rects
788
- FsPopoverComponent.prototype._mouseLeftTheTargets = function (event) {
789
- var hostBounds = this._hostBounds;
790
- var popoverBounds = this._wrapperElement.getBoundingClientRect();
791
- var pointInHostRect = pointInRect(hostBounds.x, hostBounds.y, hostBounds.x + hostBounds.width, hostBounds.y + hostBounds.height, event.x, event.y);
792
- var pointInPopoverRect = pointInRect(popoverBounds.x, popoverBounds.y, popoverBounds.x + popoverBounds.width, popoverBounds.y + popoverBounds.height, event.x, event.y);
793
- return !pointInHostRect && !pointInPopoverRect;
794
- };
795
- FsPopoverComponent.ctorParameters = function () { return [
796
- { type: core.ElementRef },
797
- { type: FsPopoverService },
798
- { type: core.NgZone },
799
- { type: router.Router, decorators: [{ type: core.Optional }] }
800
- ]; };
801
- __decorate([
802
- core.Input(),
803
- __metadata("design:type", core.TemplateRef)
804
- ], FsPopoverComponent.prototype, "template", void 0);
805
- __decorate([
806
- core.Input(),
807
- __metadata("design:type", Object)
808
- ], FsPopoverComponent.prototype, "data", void 0);
809
- __decorate([
810
- core.Input(),
811
- __metadata("design:type", Object)
812
- ], FsPopoverComponent.prototype, "leaveDelay", void 0);
813
- __decorate([
814
- core.Input(),
815
- __metadata("design:type", Object)
816
- ], FsPopoverComponent.prototype, "showDelay", void 0);
817
- __decorate([
818
- core.Input(),
819
- __metadata("design:type", Object)
820
- ], FsPopoverComponent.prototype, "maxWidth", void 0);
821
- __decorate([
822
- core.Input(),
823
- __metadata("design:type", String)
824
- ], FsPopoverComponent.prototype, "wrapperClass", void 0);
825
- __decorate([
826
- core.Input(),
827
- __metadata("design:type", Object)
828
- ], FsPopoverComponent.prototype, "autoShow", void 0);
829
- __decorate([
830
- core.Input(),
831
- __metadata("design:type", Object)
832
- ], FsPopoverComponent.prototype, "autoClose", void 0);
833
- __decorate([
834
- core.Input(),
835
- __metadata("design:type", Object)
836
- ], FsPopoverComponent.prototype, "loadingDiameter", void 0);
837
- __decorate([
838
- core.Input(),
839
- __metadata("design:type", Object)
840
- ], FsPopoverComponent.prototype, "loading", void 0);
841
- __decorate([
842
- core.Input(),
843
- core.HostBinding('class.indication'),
844
- __metadata("design:type", Object)
845
- ], FsPopoverComponent.prototype, "indication", void 0);
846
- __decorate([
847
- core.Input(),
848
- __metadata("design:type", String)
849
- ], FsPopoverComponent.prototype, "position", void 0);
850
- __decorate([
851
- core.Input(),
852
- __metadata("design:type", String)
853
- ], FsPopoverComponent.prototype, "theme", void 0);
854
- __decorate([
855
- core.Input(),
856
- __metadata("design:type", String)
857
- ], FsPopoverComponent.prototype, "size", void 0);
858
- __decorate([
859
- core.Input(),
860
- __metadata("design:type", String)
861
- ], FsPopoverComponent.prototype, "trigger", void 0);
862
- FsPopoverComponent = __decorate([
863
- core.Component({
864
- selector: 'fs-popover',
865
- template: "<ng-content></ng-content>\n<!-- <div class=\"line-container\">\n <div class=\"line\"></div>\n</div> -->\n\n<div class=\"line\"></div>\n\n",
866
- changeDetection: core.ChangeDetectionStrategy.OnPush,
867
- styles: [":host{display:inline-flex;cursor:pointer;position:relative}::ng-deep fs-popover.indication .line{width:100%;bottom:0;border-bottom:1px dashed #ccc;position:absolute;opacity:.6}"]
868
- }),
869
- __param(3, core.Optional()),
870
- __metadata("design:paramtypes", [core.ElementRef,
871
- FsPopoverService,
872
- core.NgZone,
873
- router.Router])
874
- ], FsPopoverComponent);
875
- return FsPopoverComponent;
876
- }());
956
+ var FsPopoverModule = /** @class */ (function () {
957
+ function FsPopoverModule() {
958
+ }
959
+ FsPopoverModule.forRoot = function () {
960
+ return {
961
+ ngModule: FsPopoverModule,
962
+ providers: [FsPopoverService]
963
+ };
964
+ };
965
+ return FsPopoverModule;
966
+ }());
967
+ FsPopoverModule.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: FsPopoverModule, deps: [], target: i0__namespace.ɵɵFactoryTarget.NgModule });
968
+ FsPopoverModule.ɵmod = i0__namespace.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: FsPopoverModule, declarations: [FsPopoverComponent,
969
+ FsPopoverWrapperComponent], imports: [i3.CommonModule,
970
+ i4.PortalModule,
971
+ i2.MatProgressSpinnerModule], exports: [FsPopoverComponent] });
972
+ FsPopoverModule.ɵinj = i0__namespace.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: FsPopoverModule, imports: [[
973
+ i3.CommonModule,
974
+ i4.PortalModule,
975
+ i2.MatProgressSpinnerModule,
976
+ ]] });
977
+ i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: FsPopoverModule, decorators: [{
978
+ type: i0.NgModule,
979
+ args: [{
980
+ imports: [
981
+ i3.CommonModule,
982
+ i4.PortalModule,
983
+ i2.MatProgressSpinnerModule,
984
+ ],
985
+ declarations: [
986
+ FsPopoverComponent,
987
+ FsPopoverWrapperComponent,
988
+ ],
989
+ exports: [
990
+ FsPopoverComponent,
991
+ ],
992
+ }]
993
+ }] });
877
994
 
878
- var FsPopoverModule = /** @class */ (function () {
879
- function FsPopoverModule() {
880
- }
881
- FsPopoverModule_1 = FsPopoverModule;
882
- FsPopoverModule.forRoot = function () {
883
- return {
884
- ngModule: FsPopoverModule_1,
885
- providers: [FsPopoverService]
886
- };
887
- };
888
- var FsPopoverModule_1;
889
- FsPopoverModule = FsPopoverModule_1 = __decorate([
890
- core.NgModule({
891
- imports: [
892
- common.CommonModule,
893
- portal.PortalModule,
894
- progressSpinner.MatProgressSpinnerModule,
895
- ],
896
- declarations: [
897
- FsPopoverComponent,
898
- FsPopoverWrapperComponent,
899
- ],
900
- exports: [
901
- FsPopoverComponent,
902
- ],
903
- })
904
- ], FsPopoverModule);
905
- return FsPopoverModule;
906
- }());
995
+ /*
996
+ * Public API Surface of fs-menu
997
+ */
998
+
999
+ /**
1000
+ * Generated bundle index. Do not edit.
1001
+ */
907
1002
 
908
1003
  exports.FsPopoverComponent = FsPopoverComponent;
909
1004
  exports.FsPopoverModule = FsPopoverModule;
910
1005
  exports.FsPopoverRef = FsPopoverRef;
911
- exports.ɵa = FsPopoverService;
912
- exports.ɵb = FsPopoverWrapperComponent;
913
1006
 
914
1007
  Object.defineProperty(exports, '__esModule', { value: true });
915
1008
 
916
- })));
1009
+ }));
917
1010
  //# sourceMappingURL=firestitch-popover.umd.js.map