@ember-eui/core 5.0.0-alpha.1 → 5.0.0-alpha.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 (210) hide show
  1. package/addon/components/eui-combo-box/index.ts +1 -1
  2. package/addon/components/eui-empty-prompt/index.hbs +79 -73
  3. package/addon/components/eui-field-number/types.ts +4 -1
  4. package/addon/components/eui-flyout/index.ts +1 -1
  5. package/addon/components/eui-form-control-layout-custom-icon/types.ts +3 -1
  6. package/addon/components/eui-form-control-layout-icons/types.ts +4 -1
  7. package/addon/components/eui-global-toast-list/index.ts +5 -6
  8. package/addon/components/eui-image/index.ts +7 -2
  9. package/addon/components/eui-loading-logo/index.hbs +14 -0
  10. package/addon/components/eui-page-header/index.hbs +2 -2
  11. package/addon/components/eui-page-header-content/index.ts +1 -1
  12. package/addon/components/eui-page-template/index.ts +1 -1
  13. package/addon/components/eui-portal/index.ts +2 -1
  14. package/addon/components/eui-range-levels/index.ts +14 -3
  15. package/addon/components/eui-split-panel/inner/index.hbs +2 -1
  16. package/addon/components/eui-tab/index.hbs +57 -68
  17. package/addon/components/eui-tab/index.ts +6 -7
  18. package/addon/components/eui-tabs/index.hbs +2 -10
  19. package/addon/helpers/arg-or-default.ts +4 -1
  20. package/addon/helpers/eui-palette.ts +4 -1
  21. package/addon/helpers/get-tab-id.ts +8 -2
  22. package/addon/helpers/hex-to-rgb.ts +4 -1
  23. package/addon/helpers/inline-styles.ts +10 -3
  24. package/addon/helpers/is-within-number.ts +4 -1
  25. package/addon/helpers/starts-with.ts +3 -1
  26. package/addon/initializers/eui-config.ts +12 -0
  27. package/addon/modifiers/mutation-observer.ts +4 -1
  28. package/addon/modifiers/outside-click-detector.ts +4 -4
  29. package/addon/utils/accesibility/cascading-menu-keys.ts +8 -1
  30. package/addon/utils/code/utils.ts +1 -1
  31. package/addon/utils/color/color_palette.ts +3 -3
  32. package/addon/utils/color/eui_palettes.ts +23 -6
  33. package/addon/utils/css-mappings/eui-health.ts +1 -4
  34. package/addon/utils/css-mappings/eui-icon.ts +1 -2
  35. package/addon/utils/css-mappings/eui-list-group.ts +5 -1
  36. package/addon/utils/css-mappings/eui-modal.ts +5 -1
  37. package/addon/utils/markdown/markdown-types.ts +10 -11
  38. package/addon/utils/markdown/plugins/markdown-default-plugins/parsing-plugins.ts +1 -1
  39. package/addon/utils/markdown/plugins/markdown-default-plugins/plugins.ts +1 -1
  40. package/addon/utils/markdown/plugins/markdown-default-plugins/processing-plugins.ts +1 -1
  41. package/addon/utils/markdown/plugins/markdown-default-plugins/ui-plugins.ts +1 -1
  42. package/addon/utils/transition.ts +10 -3
  43. package/addon/version.ts +6 -0
  44. package/app/components/eui-avatar/index.js +1 -1
  45. package/app/components/eui-badge-group/badge-group-item/index.js +1 -1
  46. package/app/components/eui-badge-group/index.js +1 -1
  47. package/app/components/eui-button-icon/index.js +1 -1
  48. package/app/components/eui-combo-box/create-option/index.js +1 -1
  49. package/app/components/eui-comment/eui-comment-timeline/index.js +1 -1
  50. package/app/components/eui-comment/index.js +1 -1
  51. package/app/components/eui-dual-range/index.js +1 -1
  52. package/app/components/eui-field-number/index.js +1 -1
  53. package/app/components/eui-field-password/index.js +1 -1
  54. package/app/components/eui-field-search/index.js +1 -1
  55. package/app/components/eui-field-text/index.js +1 -1
  56. package/app/components/eui-file-picker/index.js +1 -1
  57. package/app/components/eui-form/index.js +1 -1
  58. package/app/components/eui-form-control-layout/index.js +1 -1
  59. package/app/components/eui-form-control-layout-clear-button/index.js +1 -1
  60. package/app/components/eui-form-control-layout-custom-icon/index.js +1 -1
  61. package/app/components/eui-form-control-layout-delimited/index.js +1 -1
  62. package/app/components/eui-form-control-layout-icons/index.js +1 -1
  63. package/app/components/eui-form-error-text/index.js +1 -1
  64. package/app/components/eui-form-fieldset/index.js +1 -1
  65. package/app/components/eui-form-help-text/index.js +1 -1
  66. package/app/components/eui-form-label/index.js +1 -1
  67. package/app/components/eui-form-legend/index.js +1 -1
  68. package/app/components/eui-form-row/index.js +1 -1
  69. package/app/components/eui-image.js +1 -1
  70. package/app/components/eui-list-group/index.js +1 -1
  71. package/app/components/eui-list-group-item/index.js +1 -1
  72. package/app/components/eui-loading-logo/index.js +1 -0
  73. package/app/components/eui-overlay-mask.js +1 -1
  74. package/app/components/eui-page/index.js +1 -1
  75. package/app/components/eui-page-body/index.js +1 -1
  76. package/app/components/eui-page-content/index.js +1 -1
  77. package/app/components/eui-page-content-body/index.js +1 -1
  78. package/app/components/eui-page-content-header/index.js +1 -1
  79. package/app/components/eui-page-content-header-section/index.js +1 -1
  80. package/app/components/eui-page-header/index.js +1 -1
  81. package/app/components/eui-page-header-content/index.js +1 -1
  82. package/app/components/eui-page-header-section/index.js +1 -1
  83. package/app/components/eui-panel/index.js +1 -1
  84. package/app/components/eui-popover/index.js +1 -1
  85. package/app/components/eui-popover-footer/index.js +1 -1
  86. package/app/components/eui-popover-title/index.js +1 -1
  87. package/app/components/eui-portal/index.js +1 -1
  88. package/app/components/eui-progress/index.js +1 -1
  89. package/app/components/eui-radio/index.js +1 -1
  90. package/app/components/eui-radio-group/index.js +1 -1
  91. package/app/components/eui-range/index.js +1 -1
  92. package/app/components/eui-range-highlight/index.js +1 -1
  93. package/app/components/eui-range-input/index.js +1 -1
  94. package/app/components/eui-range-label/index.js +1 -1
  95. package/app/components/eui-range-levels/index.js +1 -1
  96. package/app/components/eui-range-slider/index.js +1 -1
  97. package/app/components/eui-range-thumb/index.js +1 -1
  98. package/app/components/eui-range-ticks/index.js +1 -1
  99. package/app/components/eui-range-tooltip/index.js +1 -1
  100. package/app/components/eui-range-track/index.js +1 -1
  101. package/app/components/eui-range-wrapper/index.js +1 -1
  102. package/app/components/eui-select/index.js +1 -1
  103. package/app/components/eui-side-nav/index.js +1 -1
  104. package/app/components/eui-side-nav-item/button/index.js +1 -1
  105. package/app/components/eui-side-nav-item/index.js +1 -1
  106. package/app/components/eui-spacer/index.js +1 -1
  107. package/app/components/eui-switch/index.js +1 -1
  108. package/app/components/eui-tab/index.js +1 -1
  109. package/app/components/eui-tabs/index.js +1 -1
  110. package/app/components/eui-text/index.js +1 -1
  111. package/app/components/eui-text-align/index.js +1 -1
  112. package/app/components/eui-text-area/index.js +1 -1
  113. package/app/components/eui-text-color/index.js +1 -1
  114. package/app/components/eui-title/index.js +1 -1
  115. package/app/components/eui-tool-tip/index.js +1 -1
  116. package/app/components/eui-tool-tip-popover/index.js +1 -1
  117. package/app/helpers/eui-palette.js +1 -1
  118. package/app/helpers/hex-to-rgb.js +1 -1
  119. package/app/initializers/eui-config.js +1 -0
  120. package/docs/display/avatar.md +1 -9
  121. package/docs/display/badge-demo/demo1.md +93 -95
  122. package/docs/display/badge-demo/demo2.md +15 -17
  123. package/docs/display/badge-demo/demo3.md +19 -22
  124. package/docs/display/badge-demo/demo4.md +12 -14
  125. package/docs/display/badge-demo/demo5.md +16 -18
  126. package/docs/display/badge-demo/demo6.md +39 -51
  127. package/docs/display/badge-demo/demo7.md +43 -47
  128. package/docs/display/badge-demo/demo8.md +3 -6
  129. package/docs/display/badge.md +1 -9
  130. package/docs/display/callout.md +3 -9
  131. package/docs/display/comment-list.md +1 -9
  132. package/docs/display/description-list-demo/demo1.md +0 -1
  133. package/docs/display/description-list.md +1 -9
  134. package/docs/display/empty-prompt-demo/demo1.md +0 -24
  135. package/docs/display/empty-prompt-demo/demo2.md +16 -0
  136. package/docs/display/empty-prompt-demo/demo3.md +67 -0
  137. package/docs/display/empty-prompt-demo/demo4.md +21 -0
  138. package/docs/display/empty-prompt-demo/demo5.md +33 -0
  139. package/docs/display/empty-prompt-demo/demo6.md +43 -0
  140. package/docs/display/empty-prompt-demo/demo7.md +162 -0
  141. package/docs/display/empty-prompt-demo/demo8.md +57 -0
  142. package/docs/display/empty-prompt.md +1 -11
  143. package/docs/display/health-demo/demo1.md +0 -1
  144. package/docs/display/health.md +4 -10
  145. package/docs/display/icons.md +1 -9
  146. package/docs/display/image.md +6 -10
  147. package/docs/display/list-group.md +1 -9
  148. package/docs/display/loading/logo-demo/demo1.md +15 -0
  149. package/docs/display/loading/logo.md +1 -0
  150. package/docs/display/progress.md +1 -9
  151. package/docs/display/stat.md +4 -11
  152. package/docs/display/text.md +4 -12
  153. package/docs/display/title.md +1 -9
  154. package/docs/display/tool-tip-demo/demo1.md +40 -42
  155. package/docs/display/tool-tip-demo/demo2.md +24 -27
  156. package/docs/display/tool-tip-demo/demo3.md +33 -35
  157. package/docs/display/tool-tip-demo/demo4.md +4 -7
  158. package/docs/display/tool-tip.md +6 -10
  159. package/docs/editors/code/code-block.md +3 -9
  160. package/docs/editors/code/inline.md +1 -9
  161. package/docs/editors/markdown-editor/base-editor.md +1 -9
  162. package/docs/forms/form-controls/checkbox/index.md +1 -9
  163. package/docs/forms/form-controls/checkbox-group/index.md +1 -9
  164. package/docs/forms/form-controls/combo-box/index.md +1 -9
  165. package/docs/forms/form-controls/file-picker/index.md +1 -9
  166. package/docs/forms/form-controls/form-control-layout/index.md +1 -9
  167. package/docs/forms/form-controls/form-control-layout-delimited/index.md +1 -9
  168. package/docs/forms/form-controls/number-field/index.md +1 -9
  169. package/docs/forms/form-controls/password-field/index.md +1 -9
  170. package/docs/forms/form-controls/radio/index.md +1 -9
  171. package/docs/forms/form-controls/radio-group/index.md +1 -9
  172. package/docs/forms/form-controls/range/index.md +1 -9
  173. package/docs/forms/form-controls/search-field/index.md +1 -9
  174. package/docs/forms/form-controls/select/index.md +1 -9
  175. package/docs/forms/form-controls/switch/index.md +1 -9
  176. package/docs/forms/form-controls/text-field/index.md +1 -9
  177. package/docs/forms/form-controls/textarea/index.md +1 -10
  178. package/docs/forms/form-layouts/described-form-groups.md +1 -9
  179. package/docs/layout/accordion.md +1 -10
  180. package/docs/layout/bottom-bar.md +1 -9
  181. package/docs/layout/flex.md +1 -9
  182. package/docs/layout/flyout.md +1 -9
  183. package/docs/layout/header.md +1 -9
  184. package/docs/layout/horizontal-rule.md +1 -9
  185. package/docs/layout/modal.md +1 -9
  186. package/docs/layout/page.md +1 -9
  187. package/docs/layout/panel.md +2 -10
  188. package/docs/layout/popover.md +1 -9
  189. package/docs/navigation/breadcrumbs.md +1 -9
  190. package/docs/navigation/button.md +1 -9
  191. package/docs/navigation/collapsible-nav.md +1 -9
  192. package/docs/navigation/key-pad-menu.md +1 -9
  193. package/docs/navigation/link.md +1 -9
  194. package/docs/navigation/side-nav.md +1 -9
  195. package/docs/navigation/steps.md +1 -9
  196. package/docs/navigation/tabs-demo/demo1.md +38 -111
  197. package/docs/navigation/tabs-demo/demo2.md +56 -0
  198. package/docs/navigation/tabs-demo/demo3.md +79 -0
  199. package/docs/navigation/tabs-demo/demo4.md +102 -0
  200. package/docs/navigation/tabs.md +1 -9
  201. package/docs/utilities/auto-sizer.md +1 -9
  202. package/docs/utilities/copy.md +1 -9
  203. package/docs/utilities/mutation-observer.md +1 -9
  204. package/docs/utilities/outside-click-detector.md +1 -9
  205. package/docs/utilities/overlay-mask.md +1 -9
  206. package/docs/utilities/portal.md +1 -9
  207. package/docs/utilities/resize-observer.md +1 -9
  208. package/docs/utilities/responsive.md +1 -9
  209. package/index.js +4 -1
  210. package/package.json +2 -2
@@ -67,7 +67,7 @@ export default class EuiComboBoxComponent extends Component<EuiComboBoxArgs> {
67
67
  get options(): any[] {
68
68
  if (this._resolvedOptions) return toPlainArray(this._resolvedOptions);
69
69
  if (this.args.options) {
70
- return toPlainArray(this.args.options as any[]);
70
+ return toPlainArray(this.args.options);
71
71
  } else {
72
72
  return [];
73
73
  }
@@ -1,77 +1,83 @@
1
- <EuiPanel
2
- class={{class-names
3
- (if @layout (concat "euiEmptyPrompt--" @layout) "euiEmptyPrompt--vertical")
4
- componentName="EuiEmptyPrompt"
5
- paddingSize=(arg-or-default @paddingSize "l")
6
- }}
7
- @paddingSize="none"
8
- @color={{arg-or-default @color "transparent"}}
9
- @hasBorder={{@hasBorder}}
10
- @hasShadow={{false}}
11
- >
12
- <div class="euiEmptyPrompt__main">
13
- {{#if (has-block "icon")}}
14
- <div class="euiEmptyPrompt__icon">{{yield to="icon"}}</div>
15
- {{else if @iconType}}
16
- <div class="euiEmptyPrompt__icon">
17
- <EuiIcon @type={{@iconType}} @size="xxl" @color={{@iconColor}} />
18
- </div>
19
- {{/if}}
20
- <div class="euiEmptyPrompt__content">
21
- {{#if (has-block "content")}}
22
- <div class="euiEmptyPrompt__contentInner">{{yield
23
- to="content"
24
- }}</div>
25
- {{else}}
26
- <div class="euiEmptyPrompt__contentInner">
27
- {{#if @title}}
28
- <EuiTitle
29
- @size={{arg-or-default @titleSize "m"}}
30
- >{{@title}}</EuiTitle>
31
- {{/if}}
32
- {{#if @body}}
33
- <EuiTextColor @color="subdued">
34
- {{#if @title}}
35
- <EuiSpacer @size="m" />
36
- {{/if}}
37
- <EuiText>
38
- {{@body}}
39
- </EuiText>
40
- </EuiTextColor>
41
- {{/if}}
42
- {{#if (gte @actions.length 2)}}
43
- <EuiSpacer size="l" />
44
- <EuiFlexGroup
45
- class="euiEmptyPrompt__actions"
46
- @gutterSize="m"
47
- @alignItems="center"
48
- @justifyContent="center"
49
- @direction={{if @isVerticalLayout "column" "row"}}
50
- >
51
- {{#each @actions as |action|}}
52
- <EuiFlexItem @grow={{false}}>
53
- {{action}}
54
- </EuiFlexItem>
55
- {{/each}}
56
- </EuiFlexGroup>
57
- {{else}}
58
- <EuiSpacer size="l" />
59
- {{#each @actions as |action|}}
60
- {{action}}
61
- {{/each}}
62
- {{/if}}
1
+ {{#let (arg-or-default @layout "vertical") as |layout|}}
2
+ <EuiPanel
3
+ class={{class-names
4
+ (if layout (concat "euiEmptyPrompt--" layout) "euiEmptyPrompt--vertical")
5
+ componentName="EuiEmptyPrompt"
6
+ paddingSize=(arg-or-default @paddingSize "l")
7
+ }}
8
+ @paddingSize="none"
9
+ @color={{arg-or-default @color "transparent"}}
10
+ @hasBorder={{@hasBorder}}
11
+ @hasShadow={{false}}
12
+ >
13
+ <div class="euiEmptyPrompt__main">
14
+ {{#if (has-block "icon")}}
15
+ <div class="euiEmptyPrompt__icon">{{yield to="icon"}}</div>
16
+ {{else if @iconType}}
17
+ <div class="euiEmptyPrompt__icon">
18
+ <EuiIcon
19
+ @type={{@iconType}}
20
+ @size="xxl"
21
+ @color={{if @iconColor @iconColor (if @color @color "subdued")}}
22
+ />
63
23
  </div>
64
24
  {{/if}}
25
+ <div class="euiEmptyPrompt__content">
26
+ {{#if (has-block "content")}}
27
+ <div class="euiEmptyPrompt__contentInner">{{yield to="content"}}</div>
28
+ {{else}}
29
+ <div class="euiEmptyPrompt__contentInner">
30
+ {{#if @title}}
31
+ <EuiTitle
32
+ @size={{arg-or-default @titleSize "m"}}
33
+ >{{@title}}</EuiTitle>
34
+ {{/if}}
35
+ {{#if @body}}
36
+ <EuiTextColor @color="subdued">
37
+ {{#if @title}}
38
+ <EuiSpacer @size="m" />
39
+ {{/if}}
40
+ <EuiText>
41
+ {{@body}}
42
+ </EuiText>
43
+ </EuiTextColor>
44
+ {{/if}}
45
+ {{#if (gte @actions.length 2)}}
46
+ <EuiSpacer size="l" />
47
+ <EuiFlexGroup
48
+ class="euiEmptyPrompt__actions"
49
+ @gutterSize="m"
50
+ @alignItems="center"
51
+ @justifyContent="center"
52
+ @direction={{if (eq layout "vertical") "column" "row"}}
53
+ >
54
+ {{#each @actions as |action|}}
55
+ <EuiFlexItem @grow={{false}}>
56
+ {{action}}
57
+ </EuiFlexItem>
58
+ {{/each}}
59
+ </EuiFlexGroup>
60
+ {{else}}
61
+ <EuiSpacer size="l" />
62
+ {{#each @actions as |action|}}
63
+ {{action}}
64
+ {{/each}}
65
+ {{/if}}
66
+ </div>
67
+ {{/if}}
68
+ </div>
65
69
  </div>
66
- </div>
67
70
 
68
- {{#if (has-block "footer")}}
69
- <div class="euiEmptyPrompt__footer">
70
- {{yield to="footer"}}
71
- </div>
72
- {{else}}
73
- <div class="euiEmptyPrompt__footer">
74
- {{@footer}}
75
- </div>
76
- {{/if}}
77
- </EuiPanel>
71
+ {{#if (has-block "footer")}}
72
+ <div class="euiEmptyPrompt__footer">
73
+ {{yield to="footer"}}
74
+ </div>
75
+ {{else}}
76
+ {{#if @footer}}
77
+ <div class="euiEmptyPrompt__footer">
78
+ {{@footer}}
79
+ </div>
80
+ {{/if}}
81
+ {{/if}}
82
+ </EuiPanel>
83
+ {{/let}}
@@ -3,7 +3,10 @@ import { EuiFormControlLayoutArgs } from '../eui-form-control-layout/types';
3
3
 
4
4
  import { IconType } from '../eui-icon';
5
5
 
6
- export type EuiFieldNumberArgs = Omit<HTMLInputElement, 'min' | 'max' | 'readOnly' | 'step'> &
6
+ export type EuiFieldNumberArgs = Omit<
7
+ HTMLInputElement,
8
+ 'min' | 'max' | 'readOnly' | 'step'
9
+ > &
7
10
  CommonArgs & {
8
11
  icon?: IconType;
9
12
  isInvalid?: boolean;
@@ -119,7 +119,7 @@ export const SIZES = keysOf(sizeMapping);
119
119
  export type EuiFlyoutSize = typeof SIZES[number];
120
120
 
121
121
  function isEuiFlyoutSizeNamed(value: any): value is EuiFlyoutSize {
122
- return SIZES.includes(value as any);
122
+ return SIZES.includes(value);
123
123
  }
124
124
 
125
125
  export default class EuiCollapsibleNavComponent extends Component<EuiCollapsibleNavArgs> {
@@ -5,5 +5,7 @@ export type EuiFormControlLayoutCustomIconArgs = CommonArgs &
5
5
  ExclusiveUnion<Omit<HTMLButtonElement, 'type'>, HTMLSpanElement> & {
6
6
  type: IconType;
7
7
  size?: EuiIconArgs['size'];
8
- iconRef?: string | ((el: HTMLButtonElement | HTMLSpanElement | null) => void);
8
+ iconRef?:
9
+ | string
10
+ | ((el: HTMLButtonElement | HTMLSpanElement | null) => void);
9
11
  };
@@ -5,7 +5,10 @@ import { EuiFormControlLayoutClearButtonArgs } from '../eui-form-control-layout-
5
5
 
6
6
  export const ICON_SIDES: ['left', 'right'] = ['left', 'right'];
7
7
 
8
- type IconShape = DistributiveOmit<EuiFormControlLayoutCustomIconArgs, 'type' | 'iconRef'> & {
8
+ type IconShape = DistributiveOmit<
9
+ EuiFormControlLayoutCustomIconArgs,
10
+ 'type' | 'iconRef'
11
+ > & {
9
12
  type: IconType;
10
13
  side?: typeof ICON_SIDES[number];
11
14
  ref?: EuiFormControlLayoutCustomIconArgs['iconRef'];
@@ -68,15 +68,13 @@ export default class EuiGlobalToastList extends GlimmerComponent<GlobalToastList
68
68
  this.listElement.scrollTop = position + distanceToDestination * 0.25;
69
69
 
70
70
  if (this.isScrollingToBottom) {
71
- this.isScrollingAnimationFrame = window.requestAnimationFrame(
72
- scrollToBottom
73
- );
71
+ this.isScrollingAnimationFrame =
72
+ window.requestAnimationFrame(scrollToBottom);
74
73
  }
75
74
  };
76
75
 
77
- this.startScrollingAnimationFrame = window.requestAnimationFrame(
78
- scrollToBottom
79
- );
76
+ this.startScrollingAnimationFrame =
77
+ window.requestAnimationFrame(scrollToBottom);
80
78
  }
81
79
 
82
80
  @action
@@ -188,6 +186,7 @@ export default class EuiGlobalToastList extends GlimmerComponent<GlobalToastList
188
186
  }
189
187
 
190
188
  willDestroy(): void {
189
+ super.willDestroy();
191
190
  if (this.isScrollingAnimationFrame !== 0) {
192
191
  window.cancelAnimationFrame(this.isScrollingAnimationFrame);
193
192
  }
@@ -56,8 +56,13 @@ export default class EuiImage extends GlimmerComponent<ImageArgs> {
56
56
 
57
57
  get sizeStyle(): ReturnType<typeof htmlSafe> | string {
58
58
  const size = this.args.size;
59
- if ((typeof size === 'string' || typeof size === 'number') && !this.sizeClass) {
60
- return htmlSafe(`max-height:${this.args.size}px; max-width:${this.args.size}px; width:auto;`);
59
+ if (
60
+ (typeof size === 'string' || typeof size === 'number') &&
61
+ !this.sizeClass
62
+ ) {
63
+ return htmlSafe(
64
+ `max-height:${this.args.size}px; max-width:${this.args.size}px; width:auto;`
65
+ );
61
66
  }
62
67
  return '';
63
68
  }
@@ -0,0 +1,14 @@
1
+ <span
2
+ class={{class-names
3
+ "euiLoadingLogo "
4
+ (if
5
+ (eq @size "m")
6
+ "euiLoadingLogo--medium"
7
+ (if (eq @size "l") "euiLoadingLogo--large" "euiLoadingLogo--xLarge")
8
+ )
9
+ }}
10
+ >
11
+ <span className="euiLoadingLogo__icon">
12
+ <EuiIcon @type={{arg-or-default @logo "logoKibana"}} @size={{arg-or-default @size "m"}} />
13
+ </span>
14
+ </span>
@@ -12,9 +12,9 @@
12
12
  @alignItems (concat "euiPageHeader--" @alignItems) "euiPageHeader--center"
13
13
  )
14
14
  (if
15
- @restrictWidth
16
- "euiPageHeader--restrictWidth-custom"
15
+ (eq @restrictWidth true)
17
16
  "euiPageHeader--restrictWidth-default"
17
+ (if (not-eq @restrictWidth false) "euiPageHeader--restrictWidth-custom")
18
18
  )
19
19
  componentName="EuiPageHeader"
20
20
  paddingSize=@paddingSize
@@ -6,7 +6,7 @@ export const TEMPLATES = [
6
6
  'default',
7
7
  'centeredBody',
8
8
  'centeredContent',
9
- 'empty',
9
+ 'empty'
10
10
  ] as const;
11
11
 
12
12
  export type EuiPageTemplateProps = {
@@ -25,7 +25,7 @@ export const TEMPLATES = [
25
25
  'default',
26
26
  'centeredBody',
27
27
  'centeredContent',
28
- 'empty',
28
+ 'empty'
29
29
  ] as const;
30
30
 
31
31
  export type EuiPageTemplateProps = {
@@ -13,7 +13,8 @@ export const insertPositions: InsertPositionsMap = {
13
13
  before: 'beforebegin'
14
14
  };
15
15
 
16
- export const INSERT_POSITIONS: EuiPortalInsertPosition[] = keysOf(insertPositions);
16
+ export const INSERT_POSITIONS: EuiPortalInsertPosition[] =
17
+ keysOf(insertPositions);
17
18
 
18
19
  type EuiPortalInsertPosition = keyof typeof insertPositions;
19
20
 
@@ -4,7 +4,12 @@ import { assert } from '@ember/debug';
4
4
 
5
5
  export type EuiRangeLevelColor = 'primary' | 'success' | 'warning' | 'danger';
6
6
 
7
- export const LEVEL_COLORS: EuiRangeLevelColor[] = ['primary', 'success', 'warning', 'danger'];
7
+ export const LEVEL_COLORS: EuiRangeLevelColor[] = [
8
+ 'primary',
9
+ 'success',
10
+ 'warning',
11
+ 'danger'
12
+ ];
8
13
 
9
14
  export interface EuiRangeLevel {
10
15
  min: number;
@@ -26,10 +31,16 @@ export default class EuiRangeLevelsComponent extends Component<EuiRangeLevelsArg
26
31
  const { min, max } = this.args;
27
32
  this.args.levels?.forEach?.((level) => {
28
33
  if (level.min < min) {
29
- assert(`The level min of ${level.min} is lower than the min value of ${min}.`, true);
34
+ assert(
35
+ `The level min of ${level.min} is lower than the min value of ${min}.`,
36
+ true
37
+ );
30
38
  }
31
39
  if (level.max > max) {
32
- assert(`The level max of ${level.max} is higher than the max value of ${max}.`, true);
40
+ assert(
41
+ `The level max of ${level.max} is higher than the max value of ${max}.`,
42
+ true
43
+ );
33
44
  }
34
45
  });
35
46
  }
@@ -4,7 +4,8 @@
4
4
  @color={{arg-or-default @color "transparent"}}
5
5
  @borderRadius={{arg-or-default @borderRadius "none"}}
6
6
  @hasBorder={{arg-or-default @hasBorder false}}
7
+ @paddingSize={{@paddingSize}}
7
8
  ...attributes
8
9
  >
9
- {{yield}}
10
+ {{yield}}
10
11
  </EuiPanel>
@@ -1,74 +1,63 @@
1
1
  {{#let (arg-or-default @id (unique-id)) as |id|}}
2
- {{#let
3
- (eq @selectedTabId id)
4
- (fn @onClick id)
5
- (fn (optional @focusFn) id)
6
- as |isSelected onClick focusFn|
7
- }}
8
- {{#if (and @href (not @disabled))}}
9
- <a
10
- id={{id}}
11
- role="tab"
12
- aria-selected={{isSelected}}
13
- class={{class-names
14
- "euiTab"
15
- (if isSelected "euiTab-isSelected")
16
- (if @disabled "euiTab-isDisabled")
17
- }}
18
- href={{@href}}
19
- disabled={{@disabled}}
20
- ...attributes
21
- {{on "click" onClick}}
22
- {{this.focusTabModifier @selectedTabId @disabled focusFn}}
23
- >
24
- {{#if (has-block "prepend")}}
25
- <span className="euiTab__prepend">
26
- {{yield to="prepend"}}
27
- </span>
28
- {{/if}}
29
-
30
- <span class="euiTab__content">
31
- {{yield}}
2
+ {{#if (and @href (not @disabled))}}
3
+ <a
4
+ id={{id}}
5
+ role="tab"
6
+ aria-selected={{not (not @isSelected)}}
7
+ class={{class-names
8
+ "euiTab"
9
+ (if @isSelected "euiTab-isSelected")
10
+ (if @disabled "euiTab-isDisabled")
11
+ }}
12
+ href={{@href}}
13
+ disabled={{@disabled}}
14
+ ...attributes
15
+ >
16
+ {{#if (has-block "prepend")}}
17
+ <span className="euiTab__prepend">
18
+ {{yield to="prepend"}}
32
19
  </span>
20
+ {{/if}}
33
21
 
34
- {{#if (has-block "append")}}
35
- <span className="euiTab__append">
36
- {{yield to="append"}}
37
- </span>
38
- {{/if}}
39
- </a>
40
- {{else}}
41
- <button
42
- id={{id}}
43
- role="tab"
44
- aria-selected={{isSelected}}
45
- type="button"
46
- class={{class-names
47
- "euiTab"
48
- (if isSelected "euiTab-isSelected")
49
- (if @disabled "euiTab-isDisabled")
50
- }}
51
- disabled={{@disabled}}
52
- ...attributes
53
- {{on "click" onClick}}
54
- {{this.focusTabModifier @selectedTabId @disabled focusFn}}
55
- >
56
- {{#if (has-block "prepend")}}
57
- <span className="euiTab__prepend">
58
- {{yield to="prepend"}}
59
- </span>
60
- {{/if}}
22
+ <span class="euiTab__content">
23
+ {{yield}}
24
+ </span>
61
25
 
62
- <span class="euiTab__content">
63
- {{yield}}
26
+ {{#if (has-block "append")}}
27
+ <span className="euiTab__append">
28
+ {{yield to="append"}}
29
+ </span>
30
+ {{/if}}
31
+ </a>
32
+ {{else}}
33
+ <button
34
+ id={{id}}
35
+ role="tab"
36
+ aria-selected={{not (not @isSelected)}}
37
+ type="button"
38
+ class={{class-names
39
+ "euiTab"
40
+ (if @isSelected "euiTab-isSelected")
41
+ (if @disabled "euiTab-isDisabled")
42
+ }}
43
+ disabled={{@disabled}}
44
+ ...attributes
45
+ >
46
+ {{#if (has-block "prepend")}}
47
+ <span className="euiTab__prepend">
48
+ {{yield to="prepend"}}
64
49
  </span>
50
+ {{/if}}
65
51
 
66
- {{#if (has-block "append")}}
67
- <span className="euiTab__append">
68
- {{yield to="append"}}
69
- </span>
70
- {{/if}}
71
- </button>
72
- {{/if}}
73
- {{/let}}
74
- {{/let}}
52
+ <span class="euiTab__content">
53
+ {{yield}}
54
+ </span>
55
+
56
+ {{#if (has-block "append")}}
57
+ <span className="euiTab__append">
58
+ {{yield to="append"}}
59
+ </span>
60
+ {{/if}}
61
+ </button>
62
+ {{/if}}
63
+ {{/let}}
@@ -4,18 +4,17 @@ import { modifier } from 'ember-modifier';
4
4
 
5
5
  const focusTabModifier = modifier(function focusTab(
6
6
  _element: HTMLElement,
7
- [selectedTabId, isDisabled, focusFn]: [
7
+ [tabId, selectedTabId, isDisabled, focusFn, onFocusFn]: [
8
+ string | number,
8
9
  Tab,
9
10
  boolean,
10
- (...args: unknown[]) => void,
11
- boolean
11
+ (...args: unknown[]) => any,
12
+ (...args: unknown[]) => any
12
13
  ]
13
14
  ) {
14
15
  if (selectedTabId === undefined && !isDisabled) {
15
- const fn = () => {
16
- focusFn();
17
- };
18
- scheduleOnce('afterRender', null, fn);
16
+ scheduleOnce('afterRender', null, focusFn, tabId);
17
+ scheduleOnce('afterRender', null, onFocusFn, tabId);
19
18
  }
20
19
  });
21
20
 
@@ -1,7 +1,6 @@
1
1
  {{#let
2
- (use-state (get-tab-id @selectedTab))
3
2
  (if (eq @display "condensed") false (arg-or-default @bottomBorder true))
4
- as |selectedTab bottomBorder|
3
+ as |bottomBorder|
5
4
  }}
6
5
  <div
7
6
  role="tablist"
@@ -15,13 +14,6 @@
15
14
  }}
16
15
  ...attributes
17
16
  >
18
- {{yield
19
- (component
20
- "eui-tab"
21
- onClick=selectedTab.setState
22
- selectedTabId=selectedTab.value
23
- focusFn=selectedTab.setState
24
- )
25
- }}
17
+ {{yield}}
26
18
  </div>
27
19
  {{/let}}
@@ -8,7 +8,10 @@ import { assert } from '@ember/debug';
8
8
  * @property {unknown} 0 - value to be returned if it's defined
9
9
  * @property {unknown} 1 - default value to be returned if value is undefined
10
10
  */
11
- export function argOrDefault([value, defaultValue]: [unknown, unknown]): unknown {
11
+ export function argOrDefault([value, defaultValue]: [
12
+ unknown,
13
+ unknown
14
+ ]): unknown {
12
15
  assert('`defaultValue` must be provided', defaultValue !== undefined);
13
16
  return value !== undefined ? value : defaultValue;
14
17
  }
@@ -32,6 +32,9 @@ export const PALETTES = {
32
32
 
33
33
  export type palette_keys = keyof typeof PALETTES;
34
34
 
35
- export default helper(function ([paletteName, steps]: [palette_keys, number]): EuiPalette {
35
+ export default helper(function ([paletteName, steps]: [
36
+ palette_keys,
37
+ number
38
+ ]): EuiPalette {
36
39
  return PALETTES[paletteName](steps);
37
40
  });
@@ -1,7 +1,10 @@
1
1
  import { helper } from '@ember/component/helper';
2
2
  import { assert } from '@ember/debug';
3
3
 
4
- export function getTabId([tabOrId]: [Tab | string | number]): string | number | undefined {
4
+ export function getTabId([tabOrId]: [Tab | string | number]):
5
+ | string
6
+ | number
7
+ | undefined {
5
8
  if (tabOrId === undefined) {
6
9
  return;
7
10
  }
@@ -10,7 +13,10 @@ export function getTabId([tabOrId]: [Tab | string | number]): string | number |
10
13
  return tabOrId;
11
14
  }
12
15
 
13
- assert('The passed `tab` object needs to have the `id` property', tabOrId.id !== undefined);
16
+ assert(
17
+ 'The passed `tab` object needs to have the `id` property',
18
+ tabOrId.id !== undefined
19
+ );
14
20
  return tabOrId.id;
15
21
  }
16
22
 
@@ -25,7 +25,10 @@ import { helper } from '@ember/component/helper';
25
25
  export function hexToRgb(hex: string): rgbDef {
26
26
  // Expand shorthand form (e.g. "03F") to full form (e.g. "0033FF")
27
27
  const shorthandRegex = /^#?([a-f\d])([a-f\d])([a-f\d])$/i;
28
- hex = hex.replace(shorthandRegex, (_m, r1, g1, b1) => r1 + r1 + g1 + g1 + b1 + b1);
28
+ hex = hex.replace(
29
+ shorthandRegex,
30
+ (_m, r1, g1, b1) => r1 + r1 + g1 + g1 + b1 + b1
31
+ );
29
32
 
30
33
  const result = /^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(hex)!;
31
34
 
@@ -16,12 +16,16 @@ export function inlineStyles(_: unknown, params: InlineStylesParams) {
16
16
  let componentStyles = {};
17
17
 
18
18
  if (componentName) {
19
- assert(`Could not find component ${componentName} in cssMappings.`, cssMappings[componentName]);
19
+ assert(
20
+ `Could not find component ${componentName} in cssMappings.`,
21
+ cssMappings[componentName]
22
+ );
20
23
  assert(
21
24
  `Could not find inlineStyles in ${componentName}'s cssMapping.`,
22
25
  cssMappings[componentName].inlineStyles
23
26
  );
24
- componentStyles = cssMappings[componentName].inlineStyles?.(componentArgs) || {};
27
+ componentStyles =
28
+ cssMappings[componentName].inlineStyles?.(componentArgs) || {};
25
29
  }
26
30
 
27
31
  let finalProperties: FinalProperties = {
@@ -30,7 +34,10 @@ export function inlineStyles(_: unknown, params: InlineStylesParams) {
30
34
  };
31
35
 
32
36
  for (let property in finalProperties) {
33
- if (property === 'background-image' && finalProperties[property] !== 'none') {
37
+ if (
38
+ property === 'background-image' &&
39
+ finalProperties[property] !== 'none'
40
+ ) {
34
41
  finalProperties[property] = `url(${finalProperties[property]})`;
35
42
  } else {
36
43
  finalProperties[property] = `${finalProperties[property]}`;
@@ -7,7 +7,10 @@ type Comparator = {
7
7
  value: number | string;
8
8
  };
9
9
 
10
- export function isWithinRange(_: unknown[], { min, max, value }: Comparator): boolean {
10
+ export function isWithinRange(
11
+ _: unknown[],
12
+ { min, max, value }: Comparator
13
+ ): boolean {
11
14
  return isWithin(min, max, value);
12
15
  }
13
16
 
@@ -1,6 +1,8 @@
1
1
  import { helper } from '@ember/component/helper';
2
2
 
3
- export function startsWith([needle, word]: [string, string] /*, hash*/): boolean {
3
+ export function startsWith(
4
+ [needle, word]: [string, string] /*, hash*/
5
+ ): boolean {
4
6
  return word?.startsWith(needle) || false;
5
7
  }
6
8