@ucd-lib/theme-elements 0.0.4 → 0.0.8

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 (31) hide show
  1. package/brand/ucd-theme-header/ucd-theme-header.js +63 -6
  2. package/brand/ucd-theme-header/ucd-theme-header.tpl.js +55 -23
  3. package/brand/ucd-theme-pagination/ucd-theme-pagination.js +13 -6
  4. package/brand/ucd-theme-primary-nav/ucd-theme-primary-nav.js +19 -15
  5. package/brand/ucd-theme-quick-links/ucd-theme-quick-links.js +8 -7
  6. package/brand/ucd-theme-quick-links/ucd-theme-quick-links.tpl.js +1 -1
  7. package/brand/ucd-theme-search-form/ucd-theme-search-form.js +7 -1
  8. package/brand/ucd-theme-search-form/ucd-theme-search-form.tpl.js +8 -3
  9. package/brand/ucd-theme-search-popup/ucd-theme-search-popup.js +3 -3
  10. package/brand/ucd-theme-slim-select/ucd-theme-slim-select.js +15 -17
  11. package/brand/ucd-theme-subnav/ucd-theme-subnav.js +13 -10
  12. package/package.json +3 -3
  13. package/ucdlib/ucdlib-branding-bar/ucdlib-branding-bar.js +8 -3
  14. package/ucdlib/ucdlib-icon/ucdlib-icon.tpl.js +2 -0
  15. package/ucdlib/ucdlib-icons/sitefarm.js +108 -0
  16. package/ucdlib/ucdlib-icons/ucdlib-icons.js +1 -1
  17. package/ucdlib/ucdlib-icons/utils.js +2 -2
  18. package/ucdlib/ucdlib-iconset/ucdlib-iconset.js +5 -2
  19. package/ucdlib/ucdlib-pages/ucdlib-pages.js +4 -4
  20. package/utils/{break-points.js → controllers/break-points.js} +8 -9
  21. package/utils/controllers/index.js +11 -0
  22. package/utils/controllers/intersection-observer.js +53 -0
  23. package/utils/controllers/mutation-observer.js +47 -0
  24. package/utils/controllers/wait.js +42 -0
  25. package/utils/mixins/index.js +8 -0
  26. package/utils/{main-dom-element.js → mixins/main-dom-element.js} +0 -0
  27. package/utils/{mixin.js → mixins/mixin.js} +0 -0
  28. package/utils/{nav-element.js → mixins/nav-element.js} +1 -0
  29. package/utils/index.js +0 -14
  30. package/utils/mutation-observer.js +0 -51
  31. package/utils/wait.js +0 -65
package/utils/wait.js DELETED
@@ -1,65 +0,0 @@
1
- /**
2
- * @function Wait
3
- * @param {Class} superClass - LitElement or child class.
4
- * @description Adds wait methods to Lit element
5
- *
6
- * @returns {Class} LitElement with Wait methods
7
- */
8
- const Wait = (superClass) => class extends superClass {
9
-
10
- /**
11
- * @method wait
12
- * @description Wait for the specified amount of time
13
- * @param {Number} time - Time to wait (ms)
14
- * @returns
15
- */
16
- async wait(time){
17
- return new Promise(resolve => {
18
- setTimeout(resolve, time);
19
- });
20
- }
21
-
22
- /**
23
- * @method waitForUpdate
24
- * @description Requests and waits for Lit update.
25
- */
26
- async waitForUpdate(){
27
- this.requestUpdate();
28
- await this.updateComplete;
29
- }
30
-
31
- /**
32
- * @method waitForFrames
33
- * @description Wait for specified number of animation frames
34
- * @param {Number} ct Number of frames
35
- */
36
- async waitForFrames(ct=1) {
37
- for (let i = 0; i < ct; i++) {
38
- await new Promise(resolve => {
39
- requestAnimationFrame(resolve);
40
- });
41
- }
42
- }
43
-
44
- /**
45
- * @method waitForAnimation
46
- * @description Wait for animation time designated by element
47
- * @returns {Promise}
48
- */
49
- async waitForAnimation() {
50
-
51
- let animationDuration = 0;
52
- if ( this.animationDuration ) {
53
- animationDuration = this.animationDuration;
54
- } else if (this._animationDuration) {
55
- animationDuration = this._animationDuration;
56
- } else {
57
- console.warn("animationDuration property not set!");
58
- }
59
-
60
- return new Promise(resolve => {
61
- setTimeout(resolve, animationDuration);
62
- });
63
- }
64
- };
65
- export {Wait};