@mediafly/js-ui 47.1.0 → 47.2.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,9 +1,21 @@
1
1
  ## @mediafly/js-ui changelog
2
2
 
3
- **46.4.0**
3
+ **47.2.1**
4
+
5
+ * auto-complete-match-renderer: Fixed the debounce delay and the handling of the async getMatches responses
6
+
7
+ **47.2.0**
8
+
9
+ * Buttons: Added small sizing to primary buttons
10
+
11
+ **47.1.0**
4
12
 
5
13
  * Colors: Tweaked color-danger and color-danger-light values
6
14
 
15
+ **47.0.0**
16
+
17
+ * **Breaking:** Update AngularJS to 1.8
18
+
7
19
  **46.3.0**
8
20
 
9
21
  * CSS Modules: Added button module styles
@@ -61,11 +73,11 @@
61
73
 
62
74
  **45.0.1**
63
75
 
64
- * Add a `o-hero` header typography class and update the font-size for `o-h1` class
76
+ * **Breaking:** Add an `o-hero` header typography class and update the font-size for `o-h1` class
65
77
 
66
78
  **44.0.0**
67
79
 
68
- * Errors: Start handling 400 api errors.
80
+ * **Breaking:** Errors: Start handling 400 api errors.
69
81
 
70
82
  **43.4.2**
71
83
 
@@ -44,8 +44,13 @@ export default class AutoCompleteMatchRendererComponentController implements ng.
44
44
  protected keyEventElement: HTMLInputElement | null;
45
45
  protected matches: AutoCompleteMatch[];
46
46
  private debouncedFetchAndSetMatches;
47
+ private fetchRequestCount;
48
+ private inputArray;
47
49
  private observer;
48
50
  constructor($document: ng.IDocumentService, $element: ng.IAugmentedJQuery, $q: ng.IQService, $scope: ng.IScope, $timeout: ng.ITimeoutService);
51
+ $onChanges(changes: {
52
+ delay: ng.IChangesObject<number>;
53
+ }): void;
49
54
  $onDestroy(): void;
50
55
  $onInit(): void;
51
56
  dropdownWasMousedOver(): void;
@@ -20,7 +20,8 @@ export default class AutoCompleteMatchRendererComponentController {
20
20
  this.kbSelectedIndex = -1;
21
21
  this.keyEventElement = null;
22
22
  this.matches = [];
23
- this.debouncedFetchAndSetMatches = _.debounce(() => this.fetchAndSetMatches(), this.delay);
23
+ this.fetchRequestCount = 0;
24
+ this.inputArray = [];
24
25
  this.onClickElsewhere = ($event) => {
25
26
  this.$timeout(() => {
26
27
  this.matches = [];
@@ -70,6 +71,11 @@ export default class AutoCompleteMatchRendererComponentController {
70
71
  $event.stopPropagation();
71
72
  });
72
73
  }
74
+ $onChanges(changes) {
75
+ if (changes.delay) {
76
+ this.debouncedFetchAndSetMatches = _.debounce(() => this.fetchAndSetMatches(), changes.delay.currentValue);
77
+ }
78
+ }
73
79
  $onDestroy() {
74
80
  if (this.keyEventElement) {
75
81
  this.keyEventElement.removeEventListener('input', this.debouncedFetchAndSetMatches);
@@ -129,17 +135,29 @@ export default class AutoCompleteMatchRendererComponentController {
129
135
  });
130
136
  return;
131
137
  }
138
+ // each keystroke above the minLength will fire a new fetch request and we'll want to end with the 'last' input so put each 'input' in an array
139
+ this.inputArray.push(input);
132
140
  if (this.onStartedFetching) {
141
+ this.fetchRequestCount = this.fetchRequestCount + 1;
133
142
  this.onStartedFetching();
134
143
  }
135
144
  // Wrap the entire fetch in a timeout so that fetching callbacks will
136
145
  // be called correctly while the async part happens.
137
146
  this.$timeout(() => {
138
- this.$q.when(this.getMatches({ input, origin: this.keyEventElementId }))
139
- .then(matches => {
140
- this.matches = matches;
141
- if (this.onDoneFetching) {
147
+ const inputArrayIndex = this.fetchRequestCount - 1;
148
+ this.$q.when(this.getMatches({ input: this.inputArray[inputArrayIndex], origin: this.keyEventElementId }))
149
+ .then((matches) => {
150
+ if (this.fetchRequestCount === 0) {
151
+ return;
152
+ }
153
+ // each set of matches could be shown when received but this can give a weird "flickering" effect depending on the async order of responses
154
+ // instead, when the last thing in the current array of inputs is returned, use it & ignore the rest of the responses
155
+ if ((inputArrayIndex === this.inputArray.length - 1) && this.onDoneFetching) {
156
+ this.matches = matches;
142
157
  this.onDoneFetching();
158
+ // reset the count and array
159
+ this.fetchRequestCount = 0;
160
+ this.inputArray = [];
143
161
  }
144
162
  });
145
163
  });
@@ -1 +1 @@
1
- {"version":3,"file":"auto-complete-match-renderer.component.js","sourceRoot":"","sources":["../../src/components/auto-complete/auto-complete-match-renderer.component.ts"],"names":[],"mappings":"AAAA,OAAO,OAAO,MAAM,SAAS,CAAA;AAC7B,OAAO,CAAC,MAAM,QAAQ,CAAA;AAetB,MAAM,UAAU,yBAAyB,CAAC,CAAoB;IAC7D,OAAO,CAAC,CAAC,cAAc,CAAC,OAAO,CAAC,CAAA;AACjC,CAAC;AAED;;;;;GAKG;AACH,MAAM,CAAC,OAAO,OAAO,4CAA4C;IAuBhE,YACW,SAA8B,EAC9B,QAA6B,EAC7B,EAAgB,EAChB,MAAiB,EACjB,QAA4B;QAJ5B,cAAS,GAAT,SAAS,CAAqB;QAC9B,aAAQ,GAAR,QAAQ,CAAqB;QAC7B,OAAE,GAAF,EAAE,CAAc;QAChB,WAAM,GAAN,MAAM,CAAW;QACjB,aAAQ,GAAR,QAAQ,CAAoB;QAb7B,oBAAe,GAAyB,OAAO,CAAA;QAC/C,oBAAe,GAAG,CAAC,CAAC,CAAA;QACpB,oBAAe,GAA4B,IAAI,CAAA;QAC/C,YAAO,GAAwB,EAAE,CAAA;QAEnC,gCAA2B,GAAG,CAAC,CAAC,QAAQ,CAAC,GAAG,EAAE,CAAC,IAAI,CAAC,kBAAkB,EAAE,EAAE,IAAI,CAAC,KAAK,CAAC,CAAA;QAsGrF,qBAAgB,GAAG,CAAC,MAAkB,EAAE,EAAE;YAEjD,IAAI,CAAC,QAAQ,CAAC,GAAG,EAAE;gBAClB,IAAI,CAAC,OAAO,GAAG,EAAE,CAAA;YAClB,CAAC,CAAC,CAAA;QACH,CAAC,CAAA;QAEO,cAAS,GAAG,CAAC,MAAqB,EAAE,EAAE,CAAC,IAAI,CAAC,QAAQ,CAAC,GAAG,EAAE;YAEjE,IAAI,CAAC,eAAe,GAAG,UAAU,CAAA;YAEjC,kDAAkD;YAClD,IAAI,MAAM,C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AC,iBAAiB;YAC9B,KAAK,EAAE,yBAAyB,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC,CAAC,KAAK;SAC7D,CAAC,CAAA;IACH,CAAC;IAwDO,aAAa,CAAC,KAAa;QAElC,MAAM,GAAG,GAAG,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,6BAA6B,CAAC,CAAC,KAAK,CAAmB,CAAA;QACtF,IAAI,GAAG,EAAE;YACR,GAAG,CAAC,cAAc,CAAC,EAAE,QAAQ,EAAE,QAAQ,EAAE,KAAK,EAAE,SAAS,EAAE,CAAC,CAAA;SAC5D;IACF,CAAC;CACD;AAED,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,SAAS,CAAC,2BAA2B,EAAE;IAC5D,QAAQ,EAAE;QACT,KAAK,EAAE,GAAG;QACV,UAAU,EAAE,GAAG;QACf,iBAAiB,EAAE,GAAG;QACtB,SAAS,EAAE,GAAG;QACd,cAAc,EAAE,GAAG;QACnB,QAAQ,EAAE,GAAG;QACb,iBAAiB,EAAE,GAAG;QACtB,SAAS,EAAE,GAAG;KACd;IACD,UAAU,EAAE,4CAA4C;IACxD,QAAQ,EAAE,OAAO,CAAC,+CAA+C,CAAC;CAClE,CAAC,CAAA"}
1
+ {"version":3,"file":"auto-complete-match-renderer.component.js","sourceRoot":"","sources":["../../src/components/auto-complete/auto-complete-match-renderer.component.ts"],"names":[],"mappings":"AAAA,OAAO,OAAO,MAAM,SAAS,CAAA;AAC7B,OAAO,CAAC,MAAM,QAAQ,CAAA;AAetB,MAAM,UAAU,yBAAyB,CAAC,CAAoB;IAC7D,OAAO,CAAC,CAAC,cAAc,CAAC,OAAO,CAAC,CAAA;AACjC,CAAC;AAED;;;;;GAKG;AACH,MAAM,CAAC,OAAO,OAAO,4CAA4C;IAyBhE,YACW,SAA8B,EAC9B,QAA6B,EAC7B,EAAgB,EAChB,MAAiB,EACjB,QAA4B;QAJ5B,cAAS,GAAT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O,GAAG,EAAE,CAAA;QACjB,IAAI,CAAC,eAAe,GAAG,CAAC,CAAC,CAAA;QACzB,IAAI,CAAC,QAAQ,CAAC;YACb,YAAY,EAAE,yBAAyB,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,YAAY,CAAC,CAAC,CAAC,KAAK;YAC3E,MAAM,EAAE,IAAI,CAAC,iBAAiB;YAC9B,KAAK,EAAE,yBAAyB,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC,CAAC,KAAK;SAC7D,CAAC,CAAA;IACH,CAAC;IAwDO,aAAa,CAAC,KAAa;QAElC,MAAM,GAAG,GAAG,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,6BAA6B,CAAC,CAAC,KAAK,CAAmB,CAAA;QACtF,IAAI,GAAG,EAAE;YACR,GAAG,CAAC,cAAc,CAAC,EAAE,QAAQ,EAAE,QAAQ,EAAE,KAAK,EAAE,SAAS,EAAE,CAAC,CAAA;SAC5D;IACF,CAAC;CACD;AAED,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,SAAS,CAAC,2BAA2B,EAAE;IAC5D,QAAQ,EAAE;QACT,KAAK,EAAE,GAAG;QACV,UAAU,EAAE,GAAG;QACf,iBAAiB,EAAE,GAAG;QACtB,SAAS,EAAE,GAAG;QACd,cAAc,EAAE,GAAG;QACnB,QAAQ,EAAE,GAAG;QACb,iBAAiB,EAAE,GAAG;QACtB,SAAS,EAAE,GAAG;KACd;IACD,UAAU,EAAE,4CAA4C;IACxD,QAAQ,EAAE,OAAO,CAAC,+CAA+C,CAAC;CAClE,CAAC,CAAA"}
@@ -222,23 +222,12 @@
222
222
  }
223
223
 
224
224
  .button.isSmall {
225
- background: #fff;
226
- border: 1px solid var(--color-gray-x-light);
227
225
  border-radius: 16px;
228
226
  font-size: 13px;
229
227
  font-weight: var(--font-weight-regular);
230
228
  height: auto; /* Match the non-module large button height instead of using fixed height of flex button */
231
229
  line-height: 1;
232
230
  padding: 6px 12px;
233
-
234
- /* We set an explicit background on this button so we need more specificity on the hover style: */
235
- @media (hover: hover) {
236
- &:hover {
237
- background-color: var(--color-button-default-hover-background);
238
- border-color: var(--color-button-default-hover-border);
239
- color: var(--color-button-default-text);
240
- }
241
- }
242
231
  }
243
232
 
244
233
  .button.isRoundRect {
package/lib/styles.css CHANGED
@@ -453,8 +453,6 @@ fieldset[disabled] .o-button.active {
453
453
  border-radius: 26px;
454
454
  }
455
455
  .o-button.o-button--small {
456
- background: #fff;
457
- border: 1px solid #bbb;
458
456
  border-radius: 16px;
459
457
  font-size: 13px;
460
458
  font-weight: 400;
@@ -462,13 +460,6 @@ fieldset[disabled] .o-button.active {
462
460
  padding: 6px 12px;
463
461
  white-space: nowrap;
464
462
  }
465
- @media (hover) {
466
- .o-button.o-button--small:hover {
467
- background-color: #f6f6f6;
468
- border-color: #999;
469
- color: #767676;
470
- }
471
- }
472
463
  .o-button.o-button--small:focus,
473
464
  .o-button.o-button--small:active:focus,
474
465
  .o-button.o-button--small.active:focus.o-button::after {
@@ -257,8 +257,8 @@
257
257
  "affectsGlobalScope": true
258
258
  },
259
259
  "../src/components/auto-complete/auto-complete-match-renderer.component.ts": {
260
- "version": "55c5692f46ba38077d7c00bec7caf44b97bed4122c8833355df1791c2a791f67",
261
- "signature": "70fbdf3f96f5d2fb88a4f033f7fe1fc7e66ce89ed53a4ea7724df2cad302de4b",
260
+ "version": "06b49d923e933c00d95c7dafaffa03e551256c011b61b1daa5f3515a62eca6e6",
261
+ "signature": "b3f5ddcf48e78ce8fff89df8b5d4e705c16fe8c9a23b0a8d7a3c99a5e207f487",
262
262
  "affectsGlobalScope": false
263
263
  },
264
264
  "../src/components/auto-complete/auto-complete.component.ts": {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mediafly/js-ui",
3
- "version": "47.1.0",
3
+ "version": "47.2.1",
4
4
  "license": "UNLICENSED",
5
5
  "description": "UI components for Mediafly Angular applications",
6
6
  "repository": {
@@ -44,7 +44,9 @@ export default class AutoCompleteMatchRendererComponentController implements ng.
44
44
  protected keyEventElement: HTMLInputElement | null = null
45
45
  protected matches: AutoCompleteMatch[] = []
46
46
 
47
- private debouncedFetchAndSetMatches = _.debounce(() => this.fetchAndSetMatches(), this.delay)
47
+ private debouncedFetchAndSetMatches: () => void
48
+ private fetchRequestCount: number = 0
49
+ private inputArray: string[] = []
48
50
  private observer: MutationObserver
49
51
 
50
52
  constructor(
@@ -55,6 +57,13 @@ export default class AutoCompleteMatchRendererComponentController implements ng.
55
57
  protected $timeout: ng.ITimeoutService,
56
58
  ) {}
57
59
 
60
+ $onChanges(changes: { delay: ng.IChangesObject<number> }) {
61
+
62
+ if (changes.delay) {
63
+ this.debouncedFetchAndSetMatches = _.debounce(() => this.fetchAndSetMatches(), changes.delay.currentValue)
64
+ }
65
+ }
66
+
58
67
  $onDestroy() {
59
68
 
60
69
  if (this.keyEventElement) {
@@ -122,15 +131,31 @@ export default class AutoCompleteMatchRendererComponentController implements ng.
122
131
  return
123
132
  }
124
133
 
125
- if (this.onStartedFetching) { this.onStartedFetching() }
134
+ // each keystroke above the minLength will fire a new fetch request and we'll want to end with the 'last' input so put each 'input' in an array
135
+ this.inputArray.push(input)
136
+
137
+ if (this.onStartedFetching) {
138
+ this.fetchRequestCount = this.fetchRequestCount + 1
139
+ this.onStartedFetching()
140
+ }
126
141
 
127
142
  // Wrap the entire fetch in a timeout so that fetching callbacks will
128
143
  // be called correctly while the async part happens.
129
144
  this.$timeout(() => {
130
- this.$q.when(this.getMatches({ input, origin: this.keyEventElementId }))
131
- .then(matches => {
132
- this.matches = matches
133
- if (this.onDoneFetching) { this.onDoneFetching() }
145
+ const inputArrayIndex = this.fetchRequestCount - 1
146
+ this.$q.when(this.getMatches({ input: this.inputArray[inputArrayIndex], origin: this.keyEventElementId }))
147
+ .then((matches) => {
148
+ if (this.fetchRequestCount === 0) { return }
149
+ // each set of matches could be shown when received but this can give a weird "flickering" effect depending on the async order of responses
150
+
151
+ // instead, when the last thing in the current array of inputs is returned, use it & ignore the rest of the responses
152
+ if ((inputArrayIndex === this.inputArray.length - 1) && this.onDoneFetching) {
153
+ this.matches = matches
154
+ this.onDoneFetching()
155
+ // reset the count and array
156
+ this.fetchRequestCount = 0
157
+ this.inputArray = []
158
+ }
134
159
  })
135
160
  })
136
161
  }
@@ -36,7 +36,7 @@
36
36
  }
37
37
  }
38
38
 
39
- .c-auto-complete__spinner {
39
+ .c-auto-complete__spinner.fal {
40
40
  display: none;
41
41
  position: absolute;
42
42
  right: 10px;
@@ -182,20 +182,12 @@
182
182
  // Small button
183
183
  // -------------------------------------------------
184
184
  &.o-button--small {
185
- background: #fff;
186
- border: 1px solid @color-gray-x-light;
187
185
  border-radius: 16px;
188
186
  font-size: 13px;
189
187
  font-weight: @font-weight-regular;
190
188
  line-height: 1;
191
189
  padding: 6px 12px;
192
190
  white-space: nowrap;
193
-
194
- @media (hover) {
195
- &:hover {
196
- .hover-button();
197
- }
198
- }
199
191
  }
200
192
 
201
193
  // Fix outline border-radius for smaller buttons
@@ -96,23 +96,12 @@
96
96
  }
97
97
 
98
98
  .button.isSmall {
99
- background: #fff;
100
- border: 1px solid var(--color-gray-x-light);
101
99
  border-radius: 16px;
102
100
  font-size: 13px;
103
101
  font-weight: var(--font-weight-regular);
104
102
  height: auto; /* Match the non-module large button height instead of using fixed height of flex button */
105
103
  line-height: 1;
106
104
  padding: 6px 12px;
107
-
108
- /* We set an explicit background on this button so we need more specificity on the hover style: */
109
- @media (hover: hover) {
110
- &:hover {
111
- background-color: var(--color-button-default-hover-background);
112
- border-color: var(--color-button-default-hover-border);
113
- color: var(--color-button-default-text);
114
- }
115
- }
116
105
  }
117
106
 
118
107
  .button.isRoundRect {
@@ -1297,8 +1297,8 @@
1297
1297
  "affectsGlobalScope": false
1298
1298
  },
1299
1299
  "./src/components/auto-complete/auto-complete-match-renderer.component.ts": {
1300
- "version": "55c5692f46ba38077d7c00bec7caf44b97bed4122c8833355df1791c2a791f67",
1301
- "signature": "70fbdf3f96f5d2fb88a4f033f7fe1fc7e66ce89ed53a4ea7724df2cad302de4b",
1300
+ "version": "06b49d923e933c00d95c7dafaffa03e551256c011b61b1daa5f3515a62eca6e6",
1301
+ "signature": "b3f5ddcf48e78ce8fff89df8b5d4e705c16fe8c9a23b0a8d7a3c99a5e207f487",
1302
1302
  "affectsGlobalScope": false
1303
1303
  },
1304
1304
  "./src/app/forms/auto-complete/auto-complete.page.ts": {
@@ -2831,7 +2831,7 @@
2831
2831
  "target": 2,
2832
2832
  "inlineSourceMap": false,
2833
2833
  "declarationMap": false,
2834
- "pathsBasePath": "/Users/bling/code/js-ui",
2834
+ "pathsBasePath": "/Users/martch/Documents/Projects/mediafly-js-ui",
2835
2835
  "configFilePath": "./tsconfig.json"
2836
2836
  },
2837
2837
  "referencedMap": {