@flarehr/apollo-benefits 0.1.109 → 0.3.53405

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 (216) hide show
  1. package/README.md +19 -0
  2. package/dist/assets/@splitsoftware-7d799540.js +18 -0
  3. package/dist/assets/all_tab_color-548783b9.svg +21 -0
  4. package/dist/assets/all_tab_gray-a5051313.svg +6 -0
  5. package/dist/assets/check-57fe1dcb.svg +15 -0
  6. package/dist/assets/datadog-ff247651.js +5 -0
  7. package/dist/assets/date-fns-c5d8fbc0.js +1 -0
  8. package/dist/assets/default_backdrop-fdd955b8.png +0 -0
  9. package/dist/assets/external_link-599a0aec.svg +3 -0
  10. package/dist/assets/external_link_white-55111b2e.svg +3 -0
  11. package/dist/assets/framer-motion-bb8d6b82.js +1 -0
  12. package/dist/assets/index-0b3afb09.js +5 -0
  13. package/dist/assets/index-5e9e5aa9.js +35 -0
  14. package/dist/assets/index-cfa25e28.css +1 -0
  15. package/dist/assets/lodash-5d893f8c.js +1 -0
  16. package/dist/assets/logo-a34e9b4b.png +0 -0
  17. package/dist/assets/oidc-client-6f6e47c2.js +101 -0
  18. package/dist/assets/padlock-8c081120.svg +26 -0
  19. package/dist/assets/suitcase-6471ad05.svg +17 -0
  20. package/dist/assets/vendor-2d0139ca.js +788 -0
  21. package/dist/assets/warning-a7f1af23.svg +14 -0
  22. package/dist/assets/welcome_image_mobile-dbde6c80.png +0 -0
  23. package/dist/assets/welcome_image_v2-869c59e4.png +0 -0
  24. package/dist/assets/wellbeing_banner-6903d615.png +0 -0
  25. package/dist/assets/workplace_link_banner_mobile-6ebaa24b.png +0 -0
  26. package/dist/assets/workplace_link_banner_v2-c81ed849.png +0 -0
  27. package/dist/config.json +14 -0
  28. package/dist/favicon.ico +0 -0
  29. package/dist/icons/android-chrome-192x192.png +0 -0
  30. package/dist/icons/android-chrome-512x512.png +0 -0
  31. package/dist/icons/apple-touch-icon.png +0 -0
  32. package/dist/icons/favicon-16x16.png +0 -0
  33. package/dist/icons/favicon-32x32.png +0 -0
  34. package/dist/index.html +114 -0
  35. package/dist/manifest.json +21 -0
  36. package/dist/sw-esm.js +16 -0
  37. package/package.json +129 -60
  38. package/LICENSE +0 -21
  39. package/dist/lib/apollo-benefits/apollo-benefits.esm.js +0 -1
  40. package/dist/lib/apollo-benefits/assets/car-placeholder.svg +0 -5
  41. package/dist/lib/apollo-benefits/assets/check.svg +0 -13
  42. package/dist/lib/apollo-benefits/index.esm.js +0 -0
  43. package/dist/lib/apollo-benefits/p-06a1f65f.js +0 -1
  44. package/dist/lib/apollo-benefits/p-077d7f8d.entry.js +0 -1
  45. package/dist/lib/apollo-benefits/p-14054f15.js +0 -1
  46. package/dist/lib/apollo-benefits/p-24a37d64.js +0 -1
  47. package/dist/lib/apollo-benefits/p-2b3f3b72.entry.js +0 -1
  48. package/dist/lib/apollo-benefits/p-3111d565.entry.js +0 -1
  49. package/dist/lib/apollo-benefits/p-327396fa.entry.js +0 -1
  50. package/dist/lib/apollo-benefits/p-3d4d2683.js +0 -1
  51. package/dist/lib/apollo-benefits/p-4474bcf8.entry.js +0 -1
  52. package/dist/lib/apollo-benefits/p-4bff99bd.entry.js +0 -1
  53. package/dist/lib/apollo-benefits/p-50fe790f.js +0 -1
  54. package/dist/lib/apollo-benefits/p-53bcbd1d.js +0 -1
  55. package/dist/lib/apollo-benefits/p-68c136da.js +0 -1
  56. package/dist/lib/apollo-benefits/p-6bd16f5b.js +0 -1
  57. package/dist/lib/apollo-benefits/p-71dbc8ff.entry.js +0 -1
  58. package/dist/lib/apollo-benefits/p-774d9bc5.entry.js +0 -1
  59. package/dist/lib/apollo-benefits/p-7a2ca86d.entry.js +0 -1
  60. package/dist/lib/apollo-benefits/p-7a572b50.js +0 -1
  61. package/dist/lib/apollo-benefits/p-7c2cd94a.entry.js +0 -1
  62. package/dist/lib/apollo-benefits/p-839493d7.entry.js +0 -1
  63. package/dist/lib/apollo-benefits/p-a24d169b.entry.js +0 -1
  64. package/dist/lib/apollo-benefits/p-b33fc683.js +0 -1
  65. package/dist/lib/apollo-benefits/p-beb8f728.entry.js +0 -1
  66. package/dist/lib/apollo-benefits/p-e241f55b.entry.js +0 -1
  67. package/dist/lib/apollo-benefits/p-e28cee25.js +0 -1
  68. package/dist/lib/apollo-benefits/p-e3cf51f1.entry.js +0 -1
  69. package/dist/lib/apollo-benefits/p-ef8ea713.entry.js +0 -1
  70. package/dist/lib/apollo-benefits/p-f0a7c9fa.entry.js +0 -1
  71. package/dist/lib/apollo-benefits/p-f603197d.js +0 -15
  72. package/dist/lib/cjs/active-router-0ecaf2b8.js +0 -75
  73. package/dist/lib/cjs/ap-ben-choose-vehicle-section_4.cjs.entry.js +0 -2708
  74. package/dist/lib/cjs/ap-ben-complete-section_4.cjs.entry.js +0 -108
  75. package/dist/lib/cjs/ap-ben-notifications-section.cjs.entry.js +0 -238
  76. package/dist/lib/cjs/apollo-benefits.cjs.js +0 -25
  77. package/dist/lib/cjs/app-globals-67583b8b.js +0 -12
  78. package/dist/lib/cjs/async-6a7926f0.js +0 -753
  79. package/dist/lib/cjs/cars-calculator-app.cjs.entry.js +0 -55
  80. package/dist/lib/cjs/cars-calculator.service-c0e51584.js +0 -904
  81. package/dist/lib/cjs/context-consumer.cjs.entry.js +0 -29
  82. package/dist/lib/cjs/datorama-akita-31d23240.js +0 -2551
  83. package/dist/lib/cjs/delay-d31618c3.js +0 -206
  84. package/dist/lib/cjs/distinctUntilChanged-e8538790.js +0 -371
  85. package/dist/lib/cjs/dom-utils-b8befdd5.js +0 -63
  86. package/dist/lib/cjs/fl-button_2.cjs.entry.js +0 -50
  87. package/dist/lib/cjs/fl-dropdown-async_2.cjs.entry.js +0 -467
  88. package/dist/lib/cjs/fl-dropdown.cjs.entry.js +0 -232
  89. package/dist/lib/cjs/fl-style-guide.cjs.entry.js +0 -91
  90. package/dist/lib/cjs/index-f1fadf90.js +0 -1735
  91. package/dist/lib/cjs/index.cjs.js +0 -2
  92. package/dist/lib/cjs/loader.cjs.js +0 -27
  93. package/dist/lib/cjs/location-utils-36fe7e5e.js +0 -237
  94. package/dist/lib/cjs/match-path-be4ea5f6.js +0 -279
  95. package/dist/lib/cjs/session.query-d61ba7ec.js +0 -1731
  96. package/dist/lib/cjs/stencil-async-content.cjs.entry.js +0 -32
  97. package/dist/lib/cjs/stencil-route-link.cjs.entry.js +0 -78
  98. package/dist/lib/cjs/stencil-route-switch.cjs.entry.js +0 -104
  99. package/dist/lib/cjs/stencil-route-title.cjs.entry.js +0 -32
  100. package/dist/lib/cjs/stencil-route.cjs.entry.js +0 -97
  101. package/dist/lib/cjs/stencil-router-prompt.cjs.entry.js +0 -59
  102. package/dist/lib/cjs/stencil-router-redirect.cjs.entry.js +0 -32
  103. package/dist/lib/cjs/stencil-router.cjs.entry.js +0 -640
  104. package/dist/lib/collection/assets/image/complete.svg +0 -122
  105. package/dist/lib/collection/collection-manifest.json +0 -53
  106. package/dist/lib/collection/components/cars-calculator-app/api/api-client.js +0 -5
  107. package/dist/lib/collection/components/cars-calculator-app/api/cars-calculator.api.js +0 -45
  108. package/dist/lib/collection/components/cars-calculator-app/cars-calculator-app.css +0 -22
  109. package/dist/lib/collection/components/cars-calculator-app/cars-calculator-app.js +0 -97
  110. package/dist/lib/collection/components/cars-calculator-app/modal-section/modal-section.css +0 -0
  111. package/dist/lib/collection/components/cars-calculator-app/modal-section/modal-section.js +0 -144
  112. package/dist/lib/collection/components/cars-calculator-app/notifications-section/notifications-section.js +0 -25
  113. package/dist/lib/collection/components/cars-calculator-app/pages/assets/car-placeholder.svg +0 -5
  114. package/dist/lib/collection/components/cars-calculator-app/pages/assets/check.svg +0 -13
  115. package/dist/lib/collection/components/cars-calculator-app/pages/choose-vehicle-section.component.js +0 -196
  116. package/dist/lib/collection/components/cars-calculator-app/pages/complete-section.component.js +0 -38
  117. package/dist/lib/collection/components/cars-calculator-app/pages/cost-breakdown-section.component.js +0 -45
  118. package/dist/lib/collection/components/cars-calculator-app/pages/model-variants-section.component.css +0 -34
  119. package/dist/lib/collection/components/cars-calculator-app/pages/model-variants-section.component.js +0 -85
  120. package/dist/lib/collection/components/cars-calculator-app/pages/personal-info-section.component.js +0 -66
  121. package/dist/lib/collection/components/cars-calculator-app/pages/quote-result-section.component.js +0 -86
  122. package/dist/lib/collection/components/cars-calculator-app/pages/submit-quote-section.component.js +0 -75
  123. package/dist/lib/collection/components/cars-calculator-app/services/app-configuration.service.js +0 -13
  124. package/dist/lib/collection/components/cars-calculator-app/services/cars-calculator.service.js +0 -106
  125. package/dist/lib/collection/components/cars-calculator-app/services/notifications.service.js +0 -37
  126. package/dist/lib/collection/components/cars-calculator-app/services/notifications.store.js +0 -3
  127. package/dist/lib/collection/components/cars-calculator-app/services/session.query.js +0 -35
  128. package/dist/lib/collection/components/cars-calculator-app/services/session.store.js +0 -78
  129. package/dist/lib/collection/global/config.js +0 -2
  130. package/dist/lib/collection/global/main.dev.js +0 -5
  131. package/dist/lib/collection/global/main.js +0 -5
  132. package/dist/lib/collection/index.js +0 -2
  133. package/dist/lib/collection/utils/config.js +0 -2
  134. package/dist/lib/collection/utils/index.js +0 -15
  135. package/dist/lib/collection/utils/lazy.js +0 -29
  136. package/dist/lib/esm/active-router-7c2ca849.js +0 -73
  137. package/dist/lib/esm/ap-ben-choose-vehicle-section_4.entry.js +0 -2701
  138. package/dist/lib/esm/ap-ben-complete-section_4.entry.js +0 -101
  139. package/dist/lib/esm/ap-ben-notifications-section.entry.js +0 -234
  140. package/dist/lib/esm/apollo-benefits.js +0 -23
  141. package/dist/lib/esm/app-globals-65714cca.js +0 -10
  142. package/dist/lib/esm/async-68e9cad7.js +0 -738
  143. package/dist/lib/esm/cars-calculator-app.entry.js +0 -51
  144. package/dist/lib/esm/cars-calculator.service-27826530.js +0 -897
  145. package/dist/lib/esm/context-consumer.entry.js +0 -25
  146. package/dist/lib/esm/datorama-akita-c87196a0.js +0 -2545
  147. package/dist/lib/esm/delay-115d4292.js +0 -200
  148. package/dist/lib/esm/distinctUntilChanged-bf69e0f8.js +0 -363
  149. package/dist/lib/esm/dom-utils-109a7d75.js +0 -55
  150. package/dist/lib/esm/fl-button_2.entry.js +0 -45
  151. package/dist/lib/esm/fl-dropdown-async_2.entry.js +0 -462
  152. package/dist/lib/esm/fl-dropdown.entry.js +0 -228
  153. package/dist/lib/esm/fl-style-guide.entry.js +0 -87
  154. package/dist/lib/esm/index-19c4d245.js +0 -1703
  155. package/dist/lib/esm/index.js +0 -1
  156. package/dist/lib/esm/loader.js +0 -23
  157. package/dist/lib/esm/location-utils-312665d3.js +0 -226
  158. package/dist/lib/esm/match-path-4b5c7d98.js +0 -276
  159. package/dist/lib/esm/polyfills/core-js.js +0 -11
  160. package/dist/lib/esm/polyfills/css-shim.js +0 -1
  161. package/dist/lib/esm/polyfills/dom.js +0 -79
  162. package/dist/lib/esm/polyfills/es5-html-element.js +0 -1
  163. package/dist/lib/esm/polyfills/index.js +0 -34
  164. package/dist/lib/esm/polyfills/system.js +0 -6
  165. package/dist/lib/esm/session.query-0f1c9503.js +0 -1719
  166. package/dist/lib/esm/stencil-async-content.entry.js +0 -28
  167. package/dist/lib/esm/stencil-route-link.entry.js +0 -74
  168. package/dist/lib/esm/stencil-route-switch.entry.js +0 -100
  169. package/dist/lib/esm/stencil-route-title.entry.js +0 -28
  170. package/dist/lib/esm/stencil-route.entry.js +0 -93
  171. package/dist/lib/esm/stencil-router-prompt.entry.js +0 -55
  172. package/dist/lib/esm/stencil-router-redirect.entry.js +0 -28
  173. package/dist/lib/esm/stencil-router.entry.js +0 -636
  174. package/dist/lib/index.cjs.js +0 -1
  175. package/dist/lib/index.js +0 -1
  176. package/dist/lib/loader/cdn.js +0 -3
  177. package/dist/lib/loader/index.cjs.js +0 -3
  178. package/dist/lib/loader/index.d.ts +0 -13
  179. package/dist/lib/loader/index.es2017.js +0 -3
  180. package/dist/lib/loader/index.js +0 -4
  181. package/dist/lib/loader/package.json +0 -10
  182. package/dist/lib/node_modules/@flarehr/beacon/dist/collection/components/button/button.css +0 -45
  183. package/dist/lib/node_modules/@flarehr/beacon/dist/collection/components/dropdown/dropdown.css +0 -9
  184. package/dist/lib/node_modules/@flarehr/beacon/dist/collection/components/dropdown-async/dropdown-async.css +0 -9
  185. package/dist/lib/node_modules/@flarehr/beacon/dist/collection/components/loading-indicator/loading-indicator.css +0 -141
  186. package/dist/lib/node_modules/@flarehr/beacon/dist/collection/components/promise-button/promise-button.css +0 -5
  187. package/dist/lib/node_modules/@flarehr/beacon/dist/collection/components/style-guide/style-guide.css +0 -0
  188. package/dist/lib/node_modules/@stencil/router/dist/collection/components/route/route.css +0 -3
  189. package/dist/lib/types/components/cars-calculator-app/api/api-client.d.ts +0 -2
  190. package/dist/lib/types/components/cars-calculator-app/api/cars-calculator.api.d.ts +0 -99
  191. package/dist/lib/types/components/cars-calculator-app/cars-calculator-app.d.ts +0 -17
  192. package/dist/lib/types/components/cars-calculator-app/modal-section/modal-section.d.ts +0 -16
  193. package/dist/lib/types/components/cars-calculator-app/notifications-section/notifications-section.d.ts +0 -5
  194. package/dist/lib/types/components/cars-calculator-app/pages/choose-vehicle-section.component.d.ts +0 -23
  195. package/dist/lib/types/components/cars-calculator-app/pages/complete-section.component.d.ts +0 -5
  196. package/dist/lib/types/components/cars-calculator-app/pages/cost-breakdown-section.component.d.ts +0 -6
  197. package/dist/lib/types/components/cars-calculator-app/pages/model-variants-section.component.d.ts +0 -12
  198. package/dist/lib/types/components/cars-calculator-app/pages/personal-info-section.component.d.ts +0 -10
  199. package/dist/lib/types/components/cars-calculator-app/pages/quote-result-section.component.d.ts +0 -13
  200. package/dist/lib/types/components/cars-calculator-app/pages/submit-quote-section.component.d.ts +0 -10
  201. package/dist/lib/types/components/cars-calculator-app/services/app-configuration.service.d.ts +0 -7
  202. package/dist/lib/types/components/cars-calculator-app/services/cars-calculator.service.d.ts +0 -11
  203. package/dist/lib/types/components/cars-calculator-app/services/notifications.service.d.ts +0 -15
  204. package/dist/lib/types/components/cars-calculator-app/services/notifications.store.d.ts +0 -14
  205. package/dist/lib/types/components/cars-calculator-app/services/session.query.d.ts +0 -25
  206. package/dist/lib/types/components/cars-calculator-app/services/session.store.d.ts +0 -77
  207. package/dist/lib/types/components.d.ts +0 -170
  208. package/dist/lib/types/global/config.d.ts +0 -2
  209. package/dist/lib/types/global/main.d.ts +0 -1
  210. package/dist/lib/types/global/main.dev.d.ts +0 -1
  211. package/dist/lib/types/index.d.ts +0 -2
  212. package/dist/lib/types/stencil-public-runtime.d.ts +0 -1555
  213. package/dist/lib/types/utils/config.d.ts +0 -2
  214. package/dist/lib/types/utils/index.d.ts +0 -7
  215. package/dist/lib/types/utils/lazy.d.ts +0 -12
  216. package/readme.md +0 -1
@@ -1,467 +0,0 @@
1
- 'use strict';
2
-
3
- Object.defineProperty(exports, '__esModule', { value: true });
4
-
5
- const index = require('./index-f1fadf90.js');
6
- const async = require('./async-6a7926f0.js');
7
- const distinctUntilChanged = require('./distinctUntilChanged-e8538790.js');
8
-
9
- function noop() { }
10
-
11
- function mergeMap(project, resultSelector, concurrent = Number.POSITIVE_INFINITY) {
12
- if (typeof resultSelector === 'function') {
13
- return (source) => source.pipe(mergeMap((a, i) => distinctUntilChanged.from(project(a, i)).pipe(distinctUntilChanged.map((b, ii) => resultSelector(a, b, i, ii))), concurrent));
14
- }
15
- else if (typeof resultSelector === 'number') {
16
- concurrent = resultSelector;
17
- }
18
- return (source) => source.lift(new MergeMapOperator(project, concurrent));
19
- }
20
- class MergeMapOperator {
21
- constructor(project, concurrent = Number.POSITIVE_INFINITY) {
22
- this.project = project;
23
- this.concurrent = concurrent;
24
- }
25
- call(observer, source) {
26
- return source.subscribe(new MergeMapSubscriber(observer, this.project, this.concurrent));
27
- }
28
- }
29
- class MergeMapSubscriber extends distinctUntilChanged.SimpleOuterSubscriber {
30
- constructor(destination, project, concurrent = Number.POSITIVE_INFINITY) {
31
- super(destination);
32
- this.project = project;
33
- this.concurrent = concurrent;
34
- this.hasCompleted = false;
35
- this.buffer = [];
36
- this.active = 0;
37
- this.index = 0;
38
- }
39
- _next(value) {
40
- if (this.active < this.concurrent) {
41
- this._tryNext(value);
42
- }
43
- else {
44
- this.buffer.push(value);
45
- }
46
- }
47
- _tryNext(value) {
48
- let result;
49
- const index = this.index++;
50
- try {
51
- result = this.project(value, index);
52
- }
53
- catch (err) {
54
- this.destination.error(err);
55
- return;
56
- }
57
- this.active++;
58
- this._innerSub(result);
59
- }
60
- _innerSub(ish) {
61
- const innerSubscriber = new distinctUntilChanged.SimpleInnerSubscriber(this);
62
- const destination = this.destination;
63
- destination.add(innerSubscriber);
64
- const innerSubscription = distinctUntilChanged.innerSubscribe(ish, innerSubscriber);
65
- if (innerSubscription !== innerSubscriber) {
66
- destination.add(innerSubscription);
67
- }
68
- }
69
- _complete() {
70
- this.hasCompleted = true;
71
- if (this.active === 0 && this.buffer.length === 0) {
72
- this.destination.complete();
73
- }
74
- this.unsubscribe();
75
- }
76
- notifyNext(innerValue) {
77
- this.destination.next(innerValue);
78
- }
79
- notifyComplete() {
80
- const buffer = this.buffer;
81
- this.active--;
82
- if (buffer.length > 0) {
83
- this._next(buffer.shift());
84
- }
85
- else if (this.active === 0 && this.hasCompleted) {
86
- this.destination.complete();
87
- }
88
- }
89
- }
90
-
91
- function fromEvent(target, eventName, options, resultSelector) {
92
- if (async.isFunction(options)) {
93
- resultSelector = options;
94
- options = undefined;
95
- }
96
- if (resultSelector) {
97
- return fromEvent(target, eventName, options).pipe(distinctUntilChanged.map(args => async.isArray(args) ? resultSelector(...args) : resultSelector(args)));
98
- }
99
- return new async.Observable(subscriber => {
100
- function handler(e) {
101
- if (arguments.length > 1) {
102
- subscriber.next(Array.prototype.slice.call(arguments));
103
- }
104
- else {
105
- subscriber.next(e);
106
- }
107
- }
108
- setupSubscription(target, eventName, handler, subscriber, options);
109
- });
110
- }
111
- function setupSubscription(sourceObj, eventName, handler, subscriber, options) {
112
- let unsubscribe;
113
- if (isEventTarget(sourceObj)) {
114
- const source = sourceObj;
115
- sourceObj.addEventListener(eventName, handler, options);
116
- unsubscribe = () => source.removeEventListener(eventName, handler, options);
117
- }
118
- else if (isJQueryStyleEventEmitter(sourceObj)) {
119
- const source = sourceObj;
120
- sourceObj.on(eventName, handler);
121
- unsubscribe = () => source.off(eventName, handler);
122
- }
123
- else if (isNodeStyleEventEmitter(sourceObj)) {
124
- const source = sourceObj;
125
- sourceObj.addListener(eventName, handler);
126
- unsubscribe = () => source.removeListener(eventName, handler);
127
- }
128
- else if (sourceObj && sourceObj.length) {
129
- for (let i = 0, len = sourceObj.length; i < len; i++) {
130
- setupSubscription(sourceObj[i], eventName, handler, subscriber, options);
131
- }
132
- }
133
- else {
134
- throw new TypeError('Invalid event target');
135
- }
136
- subscriber.add(unsubscribe);
137
- }
138
- function isNodeStyleEventEmitter(sourceObj) {
139
- return sourceObj && typeof sourceObj.addListener === 'function' && typeof sourceObj.removeListener === 'function';
140
- }
141
- function isJQueryStyleEventEmitter(sourceObj) {
142
- return sourceObj && typeof sourceObj.on === 'function' && typeof sourceObj.off === 'function';
143
- }
144
- function isEventTarget(sourceObj) {
145
- return sourceObj && typeof sourceObj.addEventListener === 'function' && typeof sourceObj.removeEventListener === 'function';
146
- }
147
-
148
- function debounceTime(dueTime, scheduler = async.async) {
149
- return (source) => source.lift(new DebounceTimeOperator(dueTime, scheduler));
150
- }
151
- class DebounceTimeOperator {
152
- constructor(dueTime, scheduler) {
153
- this.dueTime = dueTime;
154
- this.scheduler = scheduler;
155
- }
156
- call(subscriber, source) {
157
- return source.subscribe(new DebounceTimeSubscriber(subscriber, this.dueTime, this.scheduler));
158
- }
159
- }
160
- class DebounceTimeSubscriber extends async.Subscriber {
161
- constructor(destination, dueTime, scheduler) {
162
- super(destination);
163
- this.dueTime = dueTime;
164
- this.scheduler = scheduler;
165
- this.debouncedSubscription = null;
166
- this.lastValue = null;
167
- this.hasValue = false;
168
- }
169
- _next(value) {
170
- this.clearDebounce();
171
- this.lastValue = value;
172
- this.hasValue = true;
173
- this.add(this.debouncedSubscription = this.scheduler.schedule(dispatchNext, this.dueTime, this));
174
- }
175
- _complete() {
176
- this.debouncedNext();
177
- this.destination.complete();
178
- }
179
- debouncedNext() {
180
- this.clearDebounce();
181
- if (this.hasValue) {
182
- const { lastValue } = this;
183
- this.lastValue = null;
184
- this.hasValue = false;
185
- this.destination.next(lastValue);
186
- }
187
- }
188
- clearDebounce() {
189
- const debouncedSubscription = this.debouncedSubscription;
190
- if (debouncedSubscription !== null) {
191
- this.remove(debouncedSubscription);
192
- debouncedSubscription.unsubscribe();
193
- this.debouncedSubscription = null;
194
- }
195
- }
196
- }
197
- function dispatchNext(subscriber) {
198
- subscriber.debouncedNext();
199
- }
200
-
201
- function tap(nextOrObserver, error, complete) {
202
- return function tapOperatorFunction(source) {
203
- return source.lift(new DoOperator(nextOrObserver, error, complete));
204
- };
205
- }
206
- class DoOperator {
207
- constructor(nextOrObserver, error, complete) {
208
- this.nextOrObserver = nextOrObserver;
209
- this.error = error;
210
- this.complete = complete;
211
- }
212
- call(subscriber, source) {
213
- return source.subscribe(new TapSubscriber(subscriber, this.nextOrObserver, this.error, this.complete));
214
- }
215
- }
216
- class TapSubscriber extends async.Subscriber {
217
- constructor(destination, observerOrNext, error, complete) {
218
- super(destination);
219
- this._tapNext = noop;
220
- this._tapError = noop;
221
- this._tapComplete = noop;
222
- this._tapError = error || noop;
223
- this._tapComplete = complete || noop;
224
- if (async.isFunction(observerOrNext)) {
225
- this._context = this;
226
- this._tapNext = observerOrNext;
227
- }
228
- else if (observerOrNext) {
229
- this._context = observerOrNext;
230
- this._tapNext = observerOrNext.next || noop;
231
- this._tapError = observerOrNext.error || noop;
232
- this._tapComplete = observerOrNext.complete || noop;
233
- }
234
- }
235
- _next(value) {
236
- try {
237
- this._tapNext.call(this._context, value);
238
- }
239
- catch (err) {
240
- this.destination.error(err);
241
- return;
242
- }
243
- this.destination.next(value);
244
- }
245
- _error(err) {
246
- try {
247
- this._tapError.call(this._context, err);
248
- }
249
- catch (err) {
250
- this.destination.error(err);
251
- return;
252
- }
253
- this.destination.error(err);
254
- }
255
- _complete() {
256
- try {
257
- this._tapComplete.call(this._context);
258
- }
259
- catch (err) {
260
- this.destination.error(err);
261
- return;
262
- }
263
- return this.destination.complete();
264
- }
265
- }
266
-
267
- const dropdownAsyncCss = "fl-dropdown .dropdown-menu{max-height:min(20rem, 50vh)}fl-dropdown .dropdown-menu .dropdown-item{cursor:pointer}fl-dropdown .dropdown-menu .dropdown-item.selected{background-color:rgba(253, 189, 0, 0.5)}";
268
-
269
- const DEFAULT_SEARCH_LENGTH = 3;
270
- const SelectInputAsync = class {
271
- constructor(hostRef) {
272
- index.registerInstance(this, hostRef);
273
- this.valueChanged = index.createEvent(this, "valueChanged", 7);
274
- this.required = false;
275
- this.disabled = false;
276
- this.minSearchStringLength = DEFAULT_SEARCH_LENGTH;
277
- this.isMouseOver = false;
278
- this.searchState = 'pristine';
279
- this.inputValue = '';
280
- this.isDropdownVisible = false;
281
- this.filteredOptions = [];
282
- this.shouldExecuteSearch = (searchQuery) => {
283
- var _a;
284
- return (this.isDropdownVisible &&
285
- (searchQuery === null || searchQuery === void 0 ? void 0 : searchQuery.length) >= this.minSearchStringLength &&
286
- ((_a = this.selectedOption) === null || _a === void 0 ? void 0 : _a.label) !== searchQuery);
287
- };
288
- this.onBeginSearch = (searchQuery) => {
289
- this.inputValue = searchQuery;
290
- this.searchState = 'in progress';
291
- };
292
- this.onCompleteSearch = (results) => {
293
- this.filteredOptions = results;
294
- this.highlightedOptionIndex = undefined;
295
- this.searchState = 'done';
296
- };
297
- this.renderFilteredResults = () => {
298
- if (this.searchState === 'pristine') {
299
- return index.h("span", { class: "dropdown-item disabled" }, "Start typing to find the results");
300
- }
301
- if (this.searchState === 'in progress') {
302
- return (index.h("div", { class: "d-flex justify-content-end align-items-center pr-4" }, index.h("span", { class: "dropdown-item disabled" }, "Searching..."), index.h("i", { class: "dot-falling" })));
303
- }
304
- if (this.filteredOptions.length === 0) {
305
- return index.h("span", { class: "dropdown-item disabled" }, "No items match your search");
306
- }
307
- return this.filteredOptions.map((option, index$1) => (index.h("span", { class: {
308
- 'dropdown-item text-wrap': true,
309
- selected: this.isOptionSelected(option),
310
- active: this.highlightedOptionIndex === index$1
311
- }, onClick: (_event) => {
312
- this.toggleDropdown(false);
313
- this.selectOption(option);
314
- } }, option.label)));
315
- };
316
- this.resetInput = () => {
317
- var _a, _b;
318
- this.inputValue = (_b = (_a = this.selectedOption) === null || _a === void 0 ? void 0 : _a.label) !== null && _b !== void 0 ? _b : '';
319
- };
320
- this.toggleDropdown = (newState) => {
321
- this.isDropdownVisible = newState;
322
- };
323
- this.processKeyboardNavigation = (event) => {
324
- const ENTER_KEY = 'Enter';
325
- const DOWN_KEY = 'ArrowDown';
326
- const UP_KEY = 'ArrowUp';
327
- const ESC_KEY = 'Escape';
328
- switch (event.key) {
329
- case DOWN_KEY:
330
- this.toggleDropdown(true);
331
- this.highlightNextItem();
332
- return true;
333
- case UP_KEY:
334
- this.highlightPreviousItem();
335
- return true;
336
- case ENTER_KEY:
337
- if (this.highlightedOptionIndex !== undefined) {
338
- this.toggleDropdown(false);
339
- this.selectOption(this.filteredOptions[this.highlightedOptionIndex]);
340
- }
341
- return true;
342
- case ESC_KEY:
343
- this.inputElement.blur();
344
- return true;
345
- }
346
- return false;
347
- };
348
- this.highlightPreviousItem = () => {
349
- if (this.filteredOptions.length === 0) {
350
- return;
351
- }
352
- this.highlightedOptionIndex =
353
- this.highlightedOptionIndex === undefined ? 0 : Math.max(this.highlightedOptionIndex - 1, 0);
354
- };
355
- this.highlightNextItem = () => {
356
- if (this.filteredOptions.length === 0) {
357
- return;
358
- }
359
- this.highlightedOptionIndex =
360
- this.highlightedOptionIndex === undefined
361
- ? 0
362
- : Math.min(this.highlightedOptionIndex + 1, this.filteredOptions.length - 1);
363
- };
364
- this.selectOption = (option) => {
365
- this.selectedOption = option;
366
- this.inputValue = option.label;
367
- this.valueChanged.emit(option);
368
- };
369
- this.isOptionSelected = (option) => {
370
- var _a;
371
- return ((_a = this.selectedOption) === null || _a === void 0 ? void 0 : _a.label) === option.label;
372
- };
373
- }
374
- componentWillLoad() {
375
- this.selectedOption = this.value;
376
- }
377
- componentDidLoad() {
378
- this.searchResultsSubscription = fromEvent(this.inputElement, 'keyup')
379
- .pipe(debounceTime(500), distinctUntilChanged.map((_) => this.inputElement.value), distinctUntilChanged.distinctUntilChanged(), distinctUntilChanged.filter(this.shouldExecuteSearch), tap(this.onBeginSearch), mergeMap(this._searchFunction), tap(this.onCompleteSearch))
380
- .subscribe();
381
- }
382
- componentDidUnload() {
383
- this.searchResultsSubscription.unsubscribe();
384
- }
385
- handleFocus() {
386
- this.toggleDropdown(true);
387
- }
388
- handleBlur() {
389
- if (this.isMouseOver) {
390
- return;
391
- }
392
- this.toggleDropdown(false);
393
- this.highlightedOptionIndex = undefined;
394
- this.resetInput();
395
- }
396
- handleKeyDown(event) {
397
- if (this.processKeyboardNavigation(event)) {
398
- event.preventDefault();
399
- }
400
- }
401
- render() {
402
- var _a;
403
- return [
404
- index.h("div", { class: "dropdown" }, index.h("input", { type: "text", class: "form-control", placeholder: this.placeholder, required: this.required, disabled: this.disabled, value: this.inputValue, ref: (el) => (this.inputElement = el) }), index.h("div", { class: {
405
- 'invalid-feedback': true,
406
- 'd-none': this.isDropdownVisible
407
- } }, (_a = this.requiredValidationMessage) !== null && _a !== void 0 ? _a : 'Required.'), index.h("div", { class: {
408
- 'dropdown-menu shadow mt-0 w-100 overflow-auto': true,
409
- show: this.isDropdownVisible
410
- }, onMouseEnter: (_event) => (this.isMouseOver = true), onMouseLeave: (_event) => (this.isMouseOver = false) }, this.renderFilteredResults()))
411
- ];
412
- }
413
- get _searchFunction() {
414
- if (this.searchFunction === undefined) {
415
- throw new Error("Can't render <fl-dropdown-async/> component with no searchFunction");
416
- }
417
- return this.searchFunction;
418
- }
419
- };
420
- SelectInputAsync.style = dropdownAsyncCss;
421
-
422
- const promiseButtonCss = "fl-promise-button fl-loading-indicator{left:50%;top:50%;transform:translate(-50%, -50%)}";
423
-
424
- var PromiseButtonState;
425
- (function (PromiseButtonState) {
426
- PromiseButtonState[PromiseButtonState["Available"] = 0] = "Available";
427
- PromiseButtonState[PromiseButtonState["Pending"] = 1] = "Pending";
428
- PromiseButtonState[PromiseButtonState["Error"] = 2] = "Error";
429
- })(PromiseButtonState || (PromiseButtonState = {}));
430
- const PromiseButton = class {
431
- constructor(hostRef) {
432
- index.registerInstance(this, hostRef);
433
- this.isBlockElement = false;
434
- this.isRounded = false;
435
- this.disabled = false;
436
- this.variant = 'primary';
437
- this.promiseFn = () => Promise.resolve();
438
- // tslint:disable-next-line: member-ordering
439
- this.state = PromiseButtonState.Available;
440
- }
441
- render() {
442
- return this.state === PromiseButtonState.Pending
443
- ? this.renderLoadingButton()
444
- : this.renderActiveButton();
445
- }
446
- renderActiveButton() {
447
- return (index.h("fl-button", { disabled: this.disabled, onClick: () => this.clicked(), isBlockElement: this.isBlockElement, variant: this.variant }, index.h("div", null, index.h("slot", null))));
448
- }
449
- renderLoadingButton() {
450
- return (index.h("fl-button", { disabled: true, onClick: () => this.clicked(), isBlockElement: this.isBlockElement, class: "position-relative", variant: this.variant }, index.h("fl-loading-indicator", { class: "position-absolute", theme: "dark" }), index.h("div", { class: "invisible" }, index.h("slot", null))));
451
- }
452
- async clicked() {
453
- this.state = PromiseButtonState.Pending;
454
- try {
455
- await this.promiseFn();
456
- this.state = PromiseButtonState.Available;
457
- }
458
- catch (err) {
459
- this.state = PromiseButtonState.Error;
460
- throw err;
461
- }
462
- }
463
- };
464
- PromiseButton.style = promiseButtonCss;
465
-
466
- exports.fl_dropdown_async = SelectInputAsync;
467
- exports.fl_promise_button = PromiseButton;
@@ -1,232 +0,0 @@
1
- 'use strict';
2
-
3
- Object.defineProperty(exports, '__esModule', { value: true });
4
-
5
- const index = require('./index-f1fadf90.js');
6
-
7
- var src = {
8
- compareTwoStrings,
9
- findBestMatch
10
- };
11
-
12
- function compareTwoStrings(first, second) {
13
- first = first.replace(/\s+/g, '');
14
- second = second.replace(/\s+/g, '');
15
-
16
- if (!first.length && !second.length) return 1; // if both are empty strings
17
- if (!first.length || !second.length) return 0; // if only one is empty string
18
- if (first === second) return 1; // identical
19
- if (first.length === 1 && second.length === 1) return 0; // both are 1-letter strings
20
- if (first.length < 2 || second.length < 2) return 0; // if either is a 1-letter string
21
-
22
- let firstBigrams = new Map();
23
- for (let i = 0; i < first.length - 1; i++) {
24
- const bigram = first.substring(i, i + 2);
25
- const count = firstBigrams.has(bigram)
26
- ? firstBigrams.get(bigram) + 1
27
- : 1;
28
-
29
- firstBigrams.set(bigram, count);
30
- }
31
- let intersectionSize = 0;
32
- for (let i = 0; i < second.length - 1; i++) {
33
- const bigram = second.substring(i, i + 2);
34
- const count = firstBigrams.has(bigram)
35
- ? firstBigrams.get(bigram)
36
- : 0;
37
-
38
- if (count > 0) {
39
- firstBigrams.set(bigram, count - 1);
40
- intersectionSize++;
41
- }
42
- }
43
-
44
- return (2.0 * intersectionSize) / (first.length + second.length - 2);
45
- }
46
-
47
- function findBestMatch(mainString, targetStrings) {
48
- if (!areArgsValid(mainString, targetStrings)) throw new Error('Bad arguments: First argument should be a string, second should be an array of strings');
49
-
50
- const ratings = [];
51
- let bestMatchIndex = 0;
52
-
53
- for (let i = 0; i < targetStrings.length; i++) {
54
- const currentTargetString = targetStrings[i];
55
- const currentRating = compareTwoStrings(mainString, currentTargetString);
56
- ratings.push({target: currentTargetString, rating: currentRating});
57
- if (currentRating > ratings[bestMatchIndex].rating) {
58
- bestMatchIndex = i;
59
- }
60
- }
61
-
62
-
63
- const bestMatch = ratings[bestMatchIndex];
64
-
65
- return { ratings, bestMatch, bestMatchIndex };
66
- }
67
-
68
- function areArgsValid(mainString, targetStrings) {
69
- if (typeof mainString !== 'string') return false;
70
- if (!Array.isArray(targetStrings)) return false;
71
- if (!targetStrings.length) return false;
72
- if (targetStrings.find(s => typeof s !== 'string')) return false;
73
- return true;
74
- }
75
-
76
- const dropdownCss = "fl-dropdown .dropdown-menu{max-height:min(20rem, 50vh)}fl-dropdown .dropdown-menu .dropdown-item{cursor:pointer}fl-dropdown .dropdown-menu .dropdown-item.selected{background-color:rgba(253, 189, 0, 0.5)}";
77
-
78
- const Dropdown = class {
79
- constructor(hostRef) {
80
- index.registerInstance(this, hostRef);
81
- this.valueChanged = index.createEvent(this, "valueChanged", 7);
82
- this.required = false;
83
- this.disabled = false;
84
- this.isMouseOver = false;
85
- this.inputValue = '';
86
- this.isDropdownVisible = false;
87
- this.filteredOptions = [];
88
- this.renderFilteredResults = () => {
89
- if (this.filteredOptions.length === 0) {
90
- return index.h("span", { class: "dropdown-item disabled" }, "No items match your search");
91
- }
92
- return this.filteredOptions.map((option, index$1) => (index.h("span", { class: {
93
- 'dropdown-item text-wrap': true,
94
- selected: this.isOptionSelected(option),
95
- active: this.highlightedOptionIndex === index$1
96
- }, onClick: (_event) => {
97
- this.toggleDropdown(false);
98
- this.selectOption(option);
99
- } }, index.h("span", null, option.label))));
100
- };
101
- this.filterResults = (searchString) => {
102
- this.filteredOptions = this.sortOptionsByRelevancy(this._options.filter((option) => option.label.toLowerCase().includes(searchString.toLowerCase())), searchString);
103
- this.highlightedOptionIndex = undefined;
104
- };
105
- this.selectOption = (option) => {
106
- this.selectedOption = option;
107
- this.inputValue = option.label;
108
- this.valueChanged.emit(option);
109
- };
110
- this.isOptionSelected = (option) => {
111
- var _a;
112
- return ((_a = this.selectedOption) === null || _a === void 0 ? void 0 : _a.label) === option.label;
113
- };
114
- this.toggleDropdown = (newState) => {
115
- this.isDropdownVisible = newState;
116
- };
117
- this.resetInput = () => {
118
- var _a, _b;
119
- this.inputValue = (_b = (_a = this.selectedOption) === null || _a === void 0 ? void 0 : _a.label) !== null && _b !== void 0 ? _b : '';
120
- this.filteredOptions = this._options;
121
- };
122
- this.processKeyboardNavigation = (event) => {
123
- const ENTER_KEY = 'Enter';
124
- const DOWN_KEY = 'ArrowDown';
125
- const UP_KEY = 'ArrowUp';
126
- const ESC_KEY = 'Escape';
127
- switch (event.key) {
128
- case DOWN_KEY:
129
- this.toggleDropdown(true);
130
- this.highlightNextItem();
131
- return true;
132
- case UP_KEY:
133
- this.highlightPreviousItem();
134
- return true;
135
- case ENTER_KEY:
136
- if (this.highlightedOptionIndex !== undefined) {
137
- this.toggleDropdown(false);
138
- this.selectOption(this.filteredOptions[this.highlightedOptionIndex]);
139
- }
140
- return true;
141
- case ESC_KEY:
142
- this.inputElement.blur();
143
- return true;
144
- }
145
- return false;
146
- };
147
- this.highlightPreviousItem = () => {
148
- if (this.filteredOptions.length === 0) {
149
- return;
150
- }
151
- this.highlightedOptionIndex =
152
- this.highlightedOptionIndex === undefined ? 0 : Math.max(this.highlightedOptionIndex - 1, 0);
153
- };
154
- this.highlightNextItem = () => {
155
- if (this.filteredOptions.length === 0) {
156
- return;
157
- }
158
- this.highlightedOptionIndex =
159
- this.highlightedOptionIndex === undefined
160
- ? 0
161
- : Math.min(this.highlightedOptionIndex + 1, this.filteredOptions.length - 1);
162
- };
163
- }
164
- get _options() {
165
- if (this.options === undefined) {
166
- throw new Error("Can't render <fl-dropdown /> component with no options");
167
- }
168
- return this.options;
169
- }
170
- componentWillLoad() {
171
- var _a, _b;
172
- this.filteredOptions = this._options;
173
- this.selectedOption = this._options.find((item) => item.value === this.value);
174
- this.inputValue = (_b = (_a = this.selectedOption) === null || _a === void 0 ? void 0 : _a.label) !== null && _b !== void 0 ? _b : '';
175
- }
176
- handleFocus() {
177
- this.toggleDropdown(true);
178
- }
179
- handleBlur() {
180
- if (this.isMouseOver) {
181
- return;
182
- }
183
- this.toggleDropdown(false);
184
- this.resetInput();
185
- }
186
- handleKeyDown(event) {
187
- if (this.processKeyboardNavigation(event)) {
188
- event.preventDefault();
189
- }
190
- }
191
- onOptionsChanged() {
192
- this.filteredOptions = this._options;
193
- }
194
- onValueChanged() {
195
- var _a, _b;
196
- this.selectedOption = this._options.find((item) => item.value === this.value);
197
- this.inputValue = (_b = (_a = this.selectedOption) === null || _a === void 0 ? void 0 : _a.label) !== null && _b !== void 0 ? _b : '';
198
- }
199
- render() {
200
- var _a;
201
- return [
202
- index.h("div", { class: "dropdown" }, index.h("input", { type: "text", class: "form-control custom-select", placeholder: this.placeholder, required: this.required, disabled: this.disabled, value: this.inputValue, onInput: (event) => {
203
- const newValue = event.target.value;
204
- this.inputValue = newValue;
205
- this.filterResults(newValue);
206
- this.toggleDropdown(true);
207
- }, ref: (el) => (this.inputElement = el) }), index.h("div", { class: {
208
- 'invalid-feedback': true,
209
- 'd-none': this.isDropdownVisible
210
- } }, (_a = this.requiredValidationMessage) !== null && _a !== void 0 ? _a : 'Required.'), index.h("div", { class: {
211
- 'dropdown-menu shadow mt-0 w-100 overflow-auto': true,
212
- show: this.isDropdownVisible
213
- }, onMouseEnter: (_event) => (this.isMouseOver = true), onMouseLeave: (_event) => (this.isMouseOver = false) }, this.renderFilteredResults()))
214
- ];
215
- }
216
- sortOptionsByRelevancy(options, searchString) {
217
- return options
218
- .map((option) => (Object.assign(Object.assign({}, option), { relevancyScore: src.compareTwoStrings(option.label.toLowerCase(), searchString.toLowerCase()) })))
219
- .sort((a, b) => b.relevancyScore - a.relevancyScore)
220
- .map((weightedOption) => ({
221
- label: weightedOption.label,
222
- value: weightedOption.value
223
- }));
224
- }
225
- static get watchers() { return {
226
- "options": ["onOptionsChanged"],
227
- "value": ["onValueChanged"]
228
- }; }
229
- };
230
- Dropdown.style = dropdownCss;
231
-
232
- exports.fl_dropdown = Dropdown;