@ember-eui/core 16.0.1 → 16.0.3

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 (141) hide show
  1. package/declarations/-private/associate-form-row-label.d.ts +9 -0
  2. package/declarations/-private/associate-form-row-label.d.ts.map +1 -0
  3. package/declarations/-private/vis-colors.d.ts +8 -0
  4. package/declarations/-private/vis-colors.d.ts.map +1 -0
  5. package/declarations/components/eui-aspect-ratio.d.ts +5 -0
  6. package/declarations/components/eui-aspect-ratio.d.ts.map +1 -1
  7. package/declarations/components/eui-avatar.d.ts +6 -0
  8. package/declarations/components/eui-avatar.d.ts.map +1 -1
  9. package/declarations/components/eui-basic-table.d.ts.map +1 -1
  10. package/declarations/components/eui-color-picker.d.ts +3 -0
  11. package/declarations/components/eui-color-picker.d.ts.map +1 -1
  12. package/declarations/components/eui-color-stops/thumb.d.ts +3 -1
  13. package/declarations/components/eui-color-stops/thumb.d.ts.map +1 -1
  14. package/declarations/components/eui-combo-box/trigger/input.d.ts +9 -0
  15. package/declarations/components/eui-combo-box/trigger/input.d.ts.map +1 -1
  16. package/declarations/components/eui-combo-box/trigger.d.ts +13 -0
  17. package/declarations/components/eui-combo-box/trigger.d.ts.map +1 -1
  18. package/declarations/components/eui-combo-box.d.ts +26 -0
  19. package/declarations/components/eui-combo-box.d.ts.map +1 -1
  20. package/declarations/components/eui-data-grid/body.d.ts +2 -0
  21. package/declarations/components/eui-data-grid/body.d.ts.map +1 -1
  22. package/declarations/components/eui-data-grid.d.ts.map +1 -1
  23. package/declarations/components/eui-dual-range.d.ts +2 -0
  24. package/declarations/components/eui-dual-range.d.ts.map +1 -1
  25. package/declarations/components/eui-focus-trap.d.ts +1 -0
  26. package/declarations/components/eui-focus-trap.d.ts.map +1 -1
  27. package/declarations/components/eui-global-toast-list.d.ts +8 -1
  28. package/declarations/components/eui-global-toast-list.d.ts.map +1 -1
  29. package/declarations/components/eui-markdown-editor-drop-zone.d.ts.map +1 -1
  30. package/declarations/components/eui-markdown-editor.d.ts.map +1 -1
  31. package/declarations/components/eui-markdown-format.d.ts +2 -0
  32. package/declarations/components/eui-markdown-format.d.ts.map +1 -1
  33. package/declarations/components/eui-overlay-mask.d.ts +5 -2
  34. package/declarations/components/eui-overlay-mask.d.ts.map +1 -1
  35. package/declarations/components/eui-popover.d.ts +5 -1
  36. package/declarations/components/eui-popover.d.ts.map +1 -1
  37. package/declarations/components/eui-range.d.ts +3 -0
  38. package/declarations/components/eui-range.d.ts.map +1 -1
  39. package/declarations/components/eui-saturation.d.ts +3 -1
  40. package/declarations/components/eui-saturation.d.ts.map +1 -1
  41. package/declarations/components/eui-search-bar/field-value-selection-filter.d.ts.map +1 -1
  42. package/declarations/components/eui-text-color.d.ts +6 -0
  43. package/declarations/components/eui-text-color.d.ts.map +1 -1
  44. package/declarations/components/eui-text.d.ts.map +1 -1
  45. package/declarations/components/eui-token.d.ts +11 -0
  46. package/declarations/components/eui-token.d.ts.map +1 -1
  47. package/declarations/components/eui-tool-tip.d.ts +1 -2
  48. package/declarations/components/eui-tool-tip.d.ts.map +1 -1
  49. package/declarations/modifiers/outside-click-detector.d.ts +3 -0
  50. package/declarations/modifiers/outside-click-detector.d.ts.map +1 -1
  51. package/declarations/modifiers/resize-observer.d.ts +3 -0
  52. package/declarations/modifiers/resize-observer.d.ts.map +1 -1
  53. package/declarations/services/eui-config.d.ts +5 -0
  54. package/declarations/services/eui-config.d.ts.map +1 -1
  55. package/declarations/utils/common.d.ts +42 -0
  56. package/declarations/utils/common.d.ts.map +1 -0
  57. package/declarations/utils/css-mappings/eui-avatar.d.ts +1 -1
  58. package/declarations/utils/css-mappings/eui-text.d.ts +1 -0
  59. package/declarations/utils/css-mappings/eui-text.d.ts.map +1 -1
  60. package/declarations/utils/eui/combo-box.d.ts +1 -1
  61. package/declarations/utils/eui/combo-box.d.ts.map +1 -1
  62. package/declarations/utils/eui/content-blocks.d.ts +14 -0
  63. package/declarations/utils/eui/content-blocks.d.ts.map +1 -0
  64. package/declarations/utils/eui/flyout-manager/reducer.d.ts.map +1 -1
  65. package/declarations/utils/eui/styles.d.ts +5 -0
  66. package/declarations/utils/eui/styles.d.ts.map +1 -1
  67. package/declarations/utils/retain-document-listener.d.ts +8 -0
  68. package/declarations/utils/retain-document-listener.d.ts.map +1 -0
  69. package/declarations/utils/token-map.d.ts +11 -0
  70. package/declarations/utils/token-map.d.ts.map +1 -0
  71. package/declarations/utils/transition.d.ts +1 -1
  72. package/declarations/utils/transition.d.ts.map +1 -1
  73. package/dist/components/eui-aspect-ratio.js +20 -5
  74. package/dist/components/eui-aspect-ratio.js.map +1 -1
  75. package/dist/components/eui-avatar.js +16 -4
  76. package/dist/components/eui-avatar.js.map +1 -1
  77. package/dist/components/eui-basic-table.js +4 -2
  78. package/dist/components/eui-basic-table.js.map +1 -1
  79. package/dist/components/eui-color-picker.js +8 -2
  80. package/dist/components/eui-color-picker.js.map +1 -1
  81. package/dist/components/eui-color-stops/thumb.js +17 -5
  82. package/dist/components/eui-color-stops/thumb.js.map +1 -1
  83. package/dist/components/eui-combo-box/trigger/input.js +23 -2
  84. package/dist/components/eui-combo-box/trigger/input.js.map +1 -1
  85. package/dist/components/eui-combo-box/trigger.js +32 -2
  86. package/dist/components/eui-combo-box/trigger.js.map +1 -1
  87. package/dist/components/eui-combo-box.js +40 -5
  88. package/dist/components/eui-combo-box.js.map +1 -1
  89. package/dist/components/eui-data-grid/body.js +21 -1
  90. package/dist/components/eui-data-grid/body.js.map +1 -1
  91. package/dist/components/eui-data-grid.js +6 -4
  92. package/dist/components/eui-data-grid.js.map +1 -1
  93. package/dist/components/eui-dual-range.js +5 -2
  94. package/dist/components/eui-dual-range.js.map +1 -1
  95. package/dist/components/eui-focus-trap.js +4 -1
  96. package/dist/components/eui-focus-trap.js.map +1 -1
  97. package/dist/components/eui-global-toast-list.js +33 -5
  98. package/dist/components/eui-global-toast-list.js.map +1 -1
  99. package/dist/components/eui-markdown-editor-drop-zone.js +2 -0
  100. package/dist/components/eui-markdown-editor-drop-zone.js.map +1 -1
  101. package/dist/components/eui-markdown-editor.js +3 -1
  102. package/dist/components/eui-markdown-editor.js.map +1 -1
  103. package/dist/components/eui-markdown-format.js +9 -3
  104. package/dist/components/eui-markdown-format.js.map +1 -1
  105. package/dist/components/eui-overlay-mask.js +2 -0
  106. package/dist/components/eui-overlay-mask.js.map +1 -1
  107. package/dist/components/eui-popover.js +22 -2
  108. package/dist/components/eui-popover.js.map +1 -1
  109. package/dist/components/eui-range.js +10 -3
  110. package/dist/components/eui-range.js.map +1 -1
  111. package/dist/components/eui-saturation.js +16 -4
  112. package/dist/components/eui-saturation.js.map +1 -1
  113. package/dist/components/eui-search-bar/field-value-selection-filter.js +8 -3
  114. package/dist/components/eui-search-bar/field-value-selection-filter.js.map +1 -1
  115. package/dist/components/eui-text-color.js +20 -6
  116. package/dist/components/eui-text-color.js.map +1 -1
  117. package/dist/components/eui-text.js +6 -3
  118. package/dist/components/eui-text.js.map +1 -1
  119. package/dist/components/eui-token.js +31 -17
  120. package/dist/components/eui-token.js.map +1 -1
  121. package/dist/components/eui-tool-tip.js +9 -17
  122. package/dist/components/eui-tool-tip.js.map +1 -1
  123. package/dist/icons-DCTZo11a.js.map +1 -1
  124. package/dist/modifiers/outside-click-detector.js +12 -2
  125. package/dist/modifiers/outside-click-detector.js.map +1 -1
  126. package/dist/modifiers/resize-observer.js +19 -4
  127. package/dist/modifiers/resize-observer.js.map +1 -1
  128. package/dist/services/eui-config.js.map +1 -1
  129. package/dist/utils/eui/combo-box.js +6 -2
  130. package/dist/utils/eui/combo-box.js.map +1 -1
  131. package/dist/utils/eui/flyout-manager/reducer.js +7 -1
  132. package/dist/utils/eui/flyout-manager/reducer.js.map +1 -1
  133. package/dist/utils/eui/styles.js +5 -0
  134. package/dist/utils/eui/styles.js.map +1 -1
  135. package/dist/utils/retain-document-listener.js +30 -0
  136. package/dist/utils/retain-document-listener.js.map +1 -0
  137. package/dist/utils/transition.js +8 -3
  138. package/dist/utils/transition.js.map +1 -1
  139. package/package.json +2 -2
  140. package/declarations/modifiers/open-collapsible-nav.d.ts +0 -9
  141. package/declarations/modifiers/open-collapsible-nav.d.ts.map +0 -1
@@ -0,0 +1,30 @@
1
+ const counts = new Map();
2
+
3
+ /**
4
+ * Adds a shared document listener for the first holder and removes it when
5
+ * the last holder releases it. Holders pass the same (static) handler, so a
6
+ * grid or table adds it once however many instances are mounted. Returns the
7
+ * release function (idempotent).
8
+ */
9
+ function retainDocumentListener(type, handler) {
10
+ let handlers = counts.get(type);
11
+ if (!handlers) counts.set(type, handlers = new Map());
12
+ const count = handlers.get(handler) ?? 0;
13
+ if (count === 0) document.addEventListener(type, handler);
14
+ handlers.set(handler, count + 1);
15
+ let released = false;
16
+ return () => {
17
+ if (released) return;
18
+ released = true;
19
+ const current = (handlers.get(handler) ?? 1) - 1;
20
+ if (current <= 0) {
21
+ handlers.delete(handler);
22
+ document.removeEventListener(type, handler);
23
+ } else {
24
+ handlers.set(handler, current);
25
+ }
26
+ };
27
+ }
28
+
29
+ export { retainDocumentListener };
30
+ //# sourceMappingURL=retain-document-listener.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"retain-document-listener.js","sources":["../../src/utils/retain-document-listener.ts"],"sourcesContent":["const counts = new Map<string, Map<EventListener, number>>();\n\n/**\n * Adds a shared document listener for the first holder and removes it when\n * the last holder releases it. Holders pass the same (static) handler, so a\n * grid or table adds it once however many instances are mounted. Returns the\n * release function (idempotent).\n */\nexport function retainDocumentListener(type: string, handler: EventListener): () => void {\n let handlers = counts.get(type);\n if (!handlers) counts.set(type, (handlers = new Map()));\n\n const count = handlers.get(handler) ?? 0;\n if (count === 0) document.addEventListener(type, handler);\n handlers.set(handler, count + 1);\n\n let released = false;\n return () => {\n if (released) return;\n released = true;\n const current = (handlers.get(handler) ?? 1) - 1;\n if (current <= 0) {\n handlers.delete(handler);\n document.removeEventListener(type, handler);\n } else {\n handlers.set(handler, current);\n }\n };\n}\n"],"names":["counts","Map","retainDocumentListener","type","handler","handlers","get","set","count","document","addEventListener","released","current","delete","removeEventListener"],"mappings":"AAAA,MAAMA,MAAM,GAAG,IAAIC,GAAG,EAAsC;;AAE5D;AACA;AACA;AACA;AACA;AACA;AACO,SAASC,sBAAsBA,CAACC,IAAY,EAAEC,OAAsB,EAAc;AACvF,EAAA,IAAIC,QAAQ,GAAGL,MAAM,CAACM,GAAG,CAACH,IAAI,CAAC;AAC/B,EAAA,IAAI,CAACE,QAAQ,EAAEL,MAAM,CAACO,GAAG,CAACJ,IAAI,EAAGE,QAAQ,GAAG,IAAIJ,GAAG,EAAG,CAAC;EAEvD,MAAMO,KAAK,GAAGH,QAAQ,CAACC,GAAG,CAACF,OAAO,CAAC,IAAI,CAAC;EACxC,IAAII,KAAK,KAAK,CAAC,EAAEC,QAAQ,CAACC,gBAAgB,CAACP,IAAI,EAAEC,OAAO,CAAC;EACzDC,QAAQ,CAACE,GAAG,CAACH,OAAO,EAAEI,KAAK,GAAG,CAAC,CAAC;EAEhC,IAAIG,QAAQ,GAAG,KAAK;AACpB,EAAA,OAAO,MAAM;AACX,IAAA,IAAIA,QAAQ,EAAE;AACdA,IAAAA,QAAQ,GAAG,IAAI;AACf,IAAA,MAAMC,OAAO,GAAG,CAACP,QAAQ,CAACC,GAAG,CAACF,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC;IAChD,IAAIQ,OAAO,IAAI,CAAC,EAAE;AAChBP,MAAAA,QAAQ,CAACQ,MAAM,CAACT,OAAO,CAAC;AACxBK,MAAAA,QAAQ,CAACK,mBAAmB,CAACX,IAAI,EAAEC,OAAO,CAAC;AAC7C,IAAA,CAAC,MAAM;AACLC,MAAAA,QAAQ,CAACE,GAAG,CAACH,OAAO,EAAEQ,OAAO,CAAC;AAChC,IAAA;EACF,CAAC;AACH;;"}
@@ -59,19 +59,24 @@ const getWaitDuration = records => {
59
59
  }, 0);
60
60
  };
61
61
 
62
- // Uses `requestAnimationFrame` to perform a given callback after a specified waiting period
62
+ // Uses `requestAnimationFrame` to perform a given callback after a specified waiting period.
63
+ // Returns a function that stops the loop (upstream returns nothing, so the loop
64
+ // can't be stopped when its owner is destroyed).
63
65
  const performOnFrame = (waitDuration, toPerform) => {
64
66
  if (waitDuration > 0) {
65
67
  const startTime = Date.now();
66
68
  const endTime = startTime + waitDuration;
69
+ let frame;
67
70
  const onFrame = () => {
68
71
  toPerform();
69
72
  if (endTime > Date.now()) {
70
- requestAnimationFrame(onFrame);
73
+ frame = requestAnimationFrame(onFrame);
71
74
  }
72
75
  };
73
- requestAnimationFrame(onFrame);
76
+ frame = requestAnimationFrame(onFrame);
77
+ return () => cancelAnimationFrame(frame);
74
78
  }
79
+ return () => {};
75
80
  };
76
81
 
77
82
  // Convenience method for combining the result of 'getWaitDuration' directly with 'performOnFrame'
@@ -1 +1 @@
1
- {"version":3,"file":"transition.js","sources":["../../src/utils/transition.ts"],"sourcesContent":["/*\n * Licensed to Elasticsearch B.V. under one or more contributor\n * license agreements. See the NOTICE file distributed with\n * this work for additional information regarding copyright\n * ownership. Elasticsearch B.V. licenses this file to you under\n * the Apache License, Version 2.0 (the \"License\"); you may\n * not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing,\n * software distributed under the License is distributed on an\n * \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n * KIND, either express or implied. See the License for the\n * specific language governing permissions and limitations\n * under the License.\n */\n\nconst GROUP_NUMERIC = /^([\\d.]+)(s|ms)/;\n\nfunction getMilliseconds(value: string, unit: string): number {\n // Given the regex match and capture groups, we can assume `unit` to be either 's' or 'ms'\n const multiplier = unit === 's' ? 1000 : 1;\n\n return parseFloat(value) * multiplier;\n}\n\n// Find CSS `transition-duration` and `transition-delay` intervals\n// and return the value of each computed property in 'ms'\nexport const getTransitionTimings = (\n element: Element\n): { durationMatch: number; delayMatch: number } => {\n const computedStyle = window.getComputedStyle(element);\n\n const computedDuration = computedStyle.getPropertyValue(\n 'transition-duration'\n );\n const durationMatchArray = computedDuration.match(GROUP_NUMERIC);\n const durationMatch = durationMatchArray\n ? getMilliseconds(durationMatchArray[1]!, durationMatchArray[2]!)\n : 0;\n\n const computedDelay = computedStyle.getPropertyValue('transition-delay');\n const delayMatchArray = computedDelay.match(GROUP_NUMERIC);\n const delayMatch = delayMatchArray\n ? getMilliseconds(delayMatchArray[1]!, delayMatchArray[2]!)\n : 0;\n\n return { durationMatch, delayMatch };\n};\n\nfunction isElementNode(element: Node): element is Element {\n return element.nodeType === document.ELEMENT_NODE;\n}\n\n// Uses `getTransitionTimings` to find the total transition time for\n// all elements targeted by a MutationObserver callback\nexport const getWaitDuration = (records: MutationRecord[]): number => {\n return records.reduce((waitDuration, record) => {\n // only check for CSS transition values for ELEMENT nodes\n if (isElementNode(record.target)) {\n const { durationMatch, delayMatch } = getTransitionTimings(record.target);\n\n waitDuration = Math.max(waitDuration, durationMatch + delayMatch);\n }\n\n return waitDuration;\n }, 0);\n};\n\n// Uses `requestAnimationFrame` to perform a given callback after a specified waiting period\nexport const performOnFrame = (\n waitDuration: number,\n toPerform: () => void\n): void => {\n if (waitDuration > 0) {\n const startTime = Date.now();\n const endTime = startTime + waitDuration;\n\n const onFrame = () => {\n toPerform();\n\n if (endTime > Date.now()) {\n requestAnimationFrame(onFrame);\n }\n };\n\n requestAnimationFrame(onFrame);\n }\n};\n\n// Convenience method for combining the result of 'getWaitDuration' directly with 'performOnFrame'\nexport const getDurationAndPerformOnFrame = (\n records: MutationRecord[],\n toPerform: () => void\n): void => {\n performOnFrame(getWaitDuration(records), toPerform);\n};\n"],"names":["GROUP_NUMERIC","getMilliseconds","value","unit","multiplier","parseFloat","getTransitionTimings","element","computedStyle","window","getComputedStyle","computedDuration","getPropertyValue","durationMatchArray","match","durationMatch","computedDelay","delayMatchArray","delayMatch","isElementNode","nodeType","document","ELEMENT_NODE","getWaitDuration","records","reduce","waitDuration","record","target","Math","max","performOnFrame","toPerform","startTime","Date","now","endTime","onFrame","requestAnimationFrame","getDurationAndPerformOnFrame"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,MAAMA,aAAa,GAAG,iBAAiB;AAEvC,SAASC,eAAeA,CAACC,KAAa,EAAEC,IAAY,EAAU;AAC5D;EACA,MAAMC,UAAU,GAAGD,IAAI,KAAK,GAAG,GAAG,IAAI,GAAG,CAAC;AAE1C,EAAA,OAAOE,UAAU,CAACH,KAAK,CAAC,GAAGE,UAAU;AACvC;;AAEA;AACA;AACO,MAAME,oBAAoB,GAC/BC,OAAgB,IACkC;AAClD,EAAA,MAAMC,aAAa,GAAGC,MAAM,CAACC,gBAAgB,CAACH,OAAO,CAAC;AAEtD,EAAA,MAAMI,gBAAgB,GAAGH,aAAa,CAACI,gBAAgB,CACrD,qBACF,CAAC;AACD,EAAA,MAAMC,kBAAkB,GAAGF,gBAAgB,CAACG,KAAK,CAACd,aAAa,CAAC;AAChE,EAAA,MAAMe,aAAa,GAAGF,kBAAkB,GACpCZ,eAAe,CAACY,kBAAkB,CAAC,CAAC,CAAC,EAAGA,kBAAkB,CAAC,CAAC,CAAE,CAAC,GAC/D,CAAC;AAEL,EAAA,MAAMG,aAAa,GAAGR,aAAa,CAACI,gBAAgB,CAAC,kBAAkB,CAAC;AACxE,EAAA,MAAMK,eAAe,GAAGD,aAAa,CAACF,KAAK,CAACd,aAAa,CAAC;AAC1D,EAAA,MAAMkB,UAAU,GAAGD,eAAe,GAC9BhB,eAAe,CAACgB,eAAe,CAAC,CAAC,CAAC,EAAGA,eAAe,CAAC,CAAC,CAAE,CAAC,GACzD,CAAC;EAEL,OAAO;IAAEF,aAAa;AAAEG,IAAAA;GAAY;AACtC;AAEA,SAASC,aAAaA,CAACZ,OAAa,EAAsB;AACxD,EAAA,OAAOA,OAAO,CAACa,QAAQ,KAAKC,QAAQ,CAACC,YAAY;AACnD;;AAEA;AACA;AACO,MAAMC,eAAe,GAAIC,OAAyB,IAAa;EACpE,OAAOA,OAAO,CAACC,MAAM,CAAC,CAACC,YAAY,EAAEC,MAAM,KAAK;AAC9C;AACA,IAAA,IAAIR,aAAa,CAACQ,MAAM,CAACC,MAAM,CAAC,EAAE;MAChC,MAAM;QAAEb,aAAa;AAAEG,QAAAA;AAAW,OAAC,GAAGZ,oBAAoB,CAACqB,MAAM,CAACC,MAAM,CAAC;MAEzEF,YAAY,GAAGG,IAAI,CAACC,GAAG,CAACJ,YAAY,EAAEX,aAAa,GAAGG,UAAU,CAAC;AACnE,IAAA;AAEA,IAAA,OAAOQ,YAAY;EACrB,CAAC,EAAE,CAAC,CAAC;AACP;;AAEA;MACaK,cAAc,GAAGA,CAC5BL,YAAoB,EACpBM,SAAqB,KACZ;EACT,IAAIN,YAAY,GAAG,CAAC,EAAE;AACpB,IAAA,MAAMO,SAAS,GAAGC,IAAI,CAACC,GAAG,EAAE;AAC5B,IAAA,MAAMC,OAAO,GAAGH,SAAS,GAAGP,YAAY;IAExC,MAAMW,OAAO,GAAGA,MAAM;AACpBL,MAAAA,SAAS,EAAE;AAEX,MAAA,IAAII,OAAO,GAAGF,IAAI,CAACC,GAAG,EAAE,EAAE;QACxBG,qBAAqB,CAACD,OAAO,CAAC;AAChC,MAAA;IACF,CAAC;IAEDC,qBAAqB,CAACD,OAAO,CAAC;AAChC,EAAA;AACF;;AAEA;MACaE,4BAA4B,GAAGA,CAC1Cf,OAAyB,EACzBQ,SAAqB,KACZ;AACTD,EAAAA,cAAc,CAACR,eAAe,CAACC,OAAO,CAAC,EAAEQ,SAAS,CAAC;AACrD;;"}
1
+ {"version":3,"file":"transition.js","sources":["../../src/utils/transition.ts"],"sourcesContent":["/*\n * Licensed to Elasticsearch B.V. under one or more contributor\n * license agreements. See the NOTICE file distributed with\n * this work for additional information regarding copyright\n * ownership. Elasticsearch B.V. licenses this file to you under\n * the Apache License, Version 2.0 (the \"License\"); you may\n * not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing,\n * software distributed under the License is distributed on an\n * \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n * KIND, either express or implied. See the License for the\n * specific language governing permissions and limitations\n * under the License.\n */\n\nconst GROUP_NUMERIC = /^([\\d.]+)(s|ms)/;\n\nfunction getMilliseconds(value: string, unit: string): number {\n // Given the regex match and capture groups, we can assume `unit` to be either 's' or 'ms'\n const multiplier = unit === 's' ? 1000 : 1;\n\n return parseFloat(value) * multiplier;\n}\n\n// Find CSS `transition-duration` and `transition-delay` intervals\n// and return the value of each computed property in 'ms'\nexport const getTransitionTimings = (\n element: Element\n): { durationMatch: number; delayMatch: number } => {\n const computedStyle = window.getComputedStyle(element);\n\n const computedDuration = computedStyle.getPropertyValue(\n 'transition-duration'\n );\n const durationMatchArray = computedDuration.match(GROUP_NUMERIC);\n const durationMatch = durationMatchArray\n ? getMilliseconds(durationMatchArray[1]!, durationMatchArray[2]!)\n : 0;\n\n const computedDelay = computedStyle.getPropertyValue('transition-delay');\n const delayMatchArray = computedDelay.match(GROUP_NUMERIC);\n const delayMatch = delayMatchArray\n ? getMilliseconds(delayMatchArray[1]!, delayMatchArray[2]!)\n : 0;\n\n return { durationMatch, delayMatch };\n};\n\nfunction isElementNode(element: Node): element is Element {\n return element.nodeType === document.ELEMENT_NODE;\n}\n\n// Uses `getTransitionTimings` to find the total transition time for\n// all elements targeted by a MutationObserver callback\nexport const getWaitDuration = (records: MutationRecord[]): number => {\n return records.reduce((waitDuration, record) => {\n // only check for CSS transition values for ELEMENT nodes\n if (isElementNode(record.target)) {\n const { durationMatch, delayMatch } = getTransitionTimings(record.target);\n\n waitDuration = Math.max(waitDuration, durationMatch + delayMatch);\n }\n\n return waitDuration;\n }, 0);\n};\n\n// Uses `requestAnimationFrame` to perform a given callback after a specified waiting period.\n// Returns a function that stops the loop (upstream returns nothing, so the loop\n// can't be stopped when its owner is destroyed).\nexport const performOnFrame = (\n waitDuration: number,\n toPerform: () => void\n): (() => void) => {\n if (waitDuration > 0) {\n const startTime = Date.now();\n const endTime = startTime + waitDuration;\n let frame: number;\n\n const onFrame = () => {\n toPerform();\n\n if (endTime > Date.now()) {\n frame = requestAnimationFrame(onFrame);\n }\n };\n\n frame = requestAnimationFrame(onFrame);\n\n return () => cancelAnimationFrame(frame);\n }\n\n return () => {};\n};\n\n// Convenience method for combining the result of 'getWaitDuration' directly with 'performOnFrame'\nexport const getDurationAndPerformOnFrame = (\n records: MutationRecord[],\n toPerform: () => void\n): void => {\n performOnFrame(getWaitDuration(records), toPerform);\n};\n"],"names":["GROUP_NUMERIC","getMilliseconds","value","unit","multiplier","parseFloat","getTransitionTimings","element","computedStyle","window","getComputedStyle","computedDuration","getPropertyValue","durationMatchArray","match","durationMatch","computedDelay","delayMatchArray","delayMatch","isElementNode","nodeType","document","ELEMENT_NODE","getWaitDuration","records","reduce","waitDuration","record","target","Math","max","performOnFrame","toPerform","startTime","Date","now","endTime","frame","onFrame","requestAnimationFrame","cancelAnimationFrame","getDurationAndPerformOnFrame"],"mappings":"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"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ember-eui/core",
3
- "version": "16.0.1",
3
+ "version": "16.0.3",
4
4
  "description": "Ember Components for Elastic UI",
5
5
  "keywords": [
6
6
  "ember-addon",
@@ -134,7 +134,7 @@
134
134
  "ember-focus-trap": "^1.1.0",
135
135
  "ember-power-select": "^9.0.2",
136
136
  "ember-qunit": "^9.0.2",
137
- "ember-source": "~7.3.0",
137
+ "ember-source": "~7.3.1",
138
138
  "ember-strict-application-resolver": "^0.1.1",
139
139
  "ember-template-lint": "^6.1.0",
140
140
  "eslint": "^9.39.5",
@@ -1,9 +0,0 @@
1
- declare const _default: import("ember-modifier").FunctionBasedModifier<{
2
- Args: {
3
- Positional: [boolean];
4
- Named: import("ember-modifier/-private/signature.js").EmptyObject;
5
- };
6
- Element: Element;
7
- }>;
8
- export default _default;
9
- //# sourceMappingURL=open-collapsible-nav.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"open-collapsible-nav.d.ts","sourceRoot":"","sources":["../../src/modifiers/open-collapsible-nav.ts"],"names":[],"mappings":";;;;;;;AAIA,wBAuBG"}