@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.
- package/addon/components/eui-combo-box/index.ts +1 -1
- package/addon/components/eui-empty-prompt/index.hbs +79 -73
- package/addon/components/eui-field-number/types.ts +4 -1
- package/addon/components/eui-flyout/index.ts +1 -1
- package/addon/components/eui-form-control-layout-custom-icon/types.ts +3 -1
- package/addon/components/eui-form-control-layout-icons/types.ts +4 -1
- package/addon/components/eui-global-toast-list/index.ts +5 -6
- package/addon/components/eui-image/index.ts +7 -2
- package/addon/components/eui-loading-logo/index.hbs +14 -0
- package/addon/components/eui-page-header/index.hbs +2 -2
- package/addon/components/eui-page-header-content/index.ts +1 -1
- package/addon/components/eui-page-template/index.ts +1 -1
- package/addon/components/eui-portal/index.ts +2 -1
- package/addon/components/eui-range-levels/index.ts +14 -3
- package/addon/components/eui-split-panel/inner/index.hbs +2 -1
- package/addon/components/eui-tab/index.hbs +57 -68
- package/addon/components/eui-tab/index.ts +6 -7
- package/addon/components/eui-tabs/index.hbs +2 -10
- package/addon/helpers/arg-or-default.ts +4 -1
- package/addon/helpers/eui-palette.ts +4 -1
- package/addon/helpers/get-tab-id.ts +8 -2
- package/addon/helpers/hex-to-rgb.ts +4 -1
- package/addon/helpers/inline-styles.ts +10 -3
- package/addon/helpers/is-within-number.ts +4 -1
- package/addon/helpers/starts-with.ts +3 -1
- package/addon/initializers/eui-config.ts +12 -0
- package/addon/modifiers/mutation-observer.ts +4 -1
- package/addon/modifiers/outside-click-detector.ts +4 -4
- package/addon/utils/accesibility/cascading-menu-keys.ts +8 -1
- package/addon/utils/code/utils.ts +1 -1
- package/addon/utils/color/color_palette.ts +3 -3
- package/addon/utils/color/eui_palettes.ts +23 -6
- package/addon/utils/css-mappings/eui-health.ts +1 -4
- package/addon/utils/css-mappings/eui-icon.ts +1 -2
- package/addon/utils/css-mappings/eui-list-group.ts +5 -1
- package/addon/utils/css-mappings/eui-modal.ts +5 -1
- package/addon/utils/markdown/markdown-types.ts +10 -11
- package/addon/utils/markdown/plugins/markdown-default-plugins/parsing-plugins.ts +1 -1
- package/addon/utils/markdown/plugins/markdown-default-plugins/plugins.ts +1 -1
- package/addon/utils/markdown/plugins/markdown-default-plugins/processing-plugins.ts +1 -1
- package/addon/utils/markdown/plugins/markdown-default-plugins/ui-plugins.ts +1 -1
- package/addon/utils/transition.ts +10 -3
- package/addon/version.ts +6 -0
- package/app/components/eui-avatar/index.js +1 -1
- package/app/components/eui-badge-group/badge-group-item/index.js +1 -1
- package/app/components/eui-badge-group/index.js +1 -1
- package/app/components/eui-button-icon/index.js +1 -1
- package/app/components/eui-combo-box/create-option/index.js +1 -1
- package/app/components/eui-comment/eui-comment-timeline/index.js +1 -1
- package/app/components/eui-comment/index.js +1 -1
- package/app/components/eui-dual-range/index.js +1 -1
- package/app/components/eui-field-number/index.js +1 -1
- package/app/components/eui-field-password/index.js +1 -1
- package/app/components/eui-field-search/index.js +1 -1
- package/app/components/eui-field-text/index.js +1 -1
- package/app/components/eui-file-picker/index.js +1 -1
- package/app/components/eui-form/index.js +1 -1
- package/app/components/eui-form-control-layout/index.js +1 -1
- package/app/components/eui-form-control-layout-clear-button/index.js +1 -1
- package/app/components/eui-form-control-layout-custom-icon/index.js +1 -1
- package/app/components/eui-form-control-layout-delimited/index.js +1 -1
- package/app/components/eui-form-control-layout-icons/index.js +1 -1
- package/app/components/eui-form-error-text/index.js +1 -1
- package/app/components/eui-form-fieldset/index.js +1 -1
- package/app/components/eui-form-help-text/index.js +1 -1
- package/app/components/eui-form-label/index.js +1 -1
- package/app/components/eui-form-legend/index.js +1 -1
- package/app/components/eui-form-row/index.js +1 -1
- package/app/components/eui-image.js +1 -1
- package/app/components/eui-list-group/index.js +1 -1
- package/app/components/eui-list-group-item/index.js +1 -1
- package/app/components/eui-loading-logo/index.js +1 -0
- package/app/components/eui-overlay-mask.js +1 -1
- package/app/components/eui-page/index.js +1 -1
- package/app/components/eui-page-body/index.js +1 -1
- package/app/components/eui-page-content/index.js +1 -1
- package/app/components/eui-page-content-body/index.js +1 -1
- package/app/components/eui-page-content-header/index.js +1 -1
- package/app/components/eui-page-content-header-section/index.js +1 -1
- package/app/components/eui-page-header/index.js +1 -1
- package/app/components/eui-page-header-content/index.js +1 -1
- package/app/components/eui-page-header-section/index.js +1 -1
- package/app/components/eui-panel/index.js +1 -1
- package/app/components/eui-popover/index.js +1 -1
- package/app/components/eui-popover-footer/index.js +1 -1
- package/app/components/eui-popover-title/index.js +1 -1
- package/app/components/eui-portal/index.js +1 -1
- package/app/components/eui-progress/index.js +1 -1
- package/app/components/eui-radio/index.js +1 -1
- package/app/components/eui-radio-group/index.js +1 -1
- package/app/components/eui-range/index.js +1 -1
- package/app/components/eui-range-highlight/index.js +1 -1
- package/app/components/eui-range-input/index.js +1 -1
- package/app/components/eui-range-label/index.js +1 -1
- package/app/components/eui-range-levels/index.js +1 -1
- package/app/components/eui-range-slider/index.js +1 -1
- package/app/components/eui-range-thumb/index.js +1 -1
- package/app/components/eui-range-ticks/index.js +1 -1
- package/app/components/eui-range-tooltip/index.js +1 -1
- package/app/components/eui-range-track/index.js +1 -1
- package/app/components/eui-range-wrapper/index.js +1 -1
- package/app/components/eui-select/index.js +1 -1
- package/app/components/eui-side-nav/index.js +1 -1
- package/app/components/eui-side-nav-item/button/index.js +1 -1
- package/app/components/eui-side-nav-item/index.js +1 -1
- package/app/components/eui-spacer/index.js +1 -1
- package/app/components/eui-switch/index.js +1 -1
- package/app/components/eui-tab/index.js +1 -1
- package/app/components/eui-tabs/index.js +1 -1
- package/app/components/eui-text/index.js +1 -1
- package/app/components/eui-text-align/index.js +1 -1
- package/app/components/eui-text-area/index.js +1 -1
- package/app/components/eui-text-color/index.js +1 -1
- package/app/components/eui-title/index.js +1 -1
- package/app/components/eui-tool-tip/index.js +1 -1
- package/app/components/eui-tool-tip-popover/index.js +1 -1
- package/app/helpers/eui-palette.js +1 -1
- package/app/helpers/hex-to-rgb.js +1 -1
- package/app/initializers/eui-config.js +1 -0
- package/docs/display/avatar.md +1 -9
- package/docs/display/badge-demo/demo1.md +93 -95
- package/docs/display/badge-demo/demo2.md +15 -17
- package/docs/display/badge-demo/demo3.md +19 -22
- package/docs/display/badge-demo/demo4.md +12 -14
- package/docs/display/badge-demo/demo5.md +16 -18
- package/docs/display/badge-demo/demo6.md +39 -51
- package/docs/display/badge-demo/demo7.md +43 -47
- package/docs/display/badge-demo/demo8.md +3 -6
- package/docs/display/badge.md +1 -9
- package/docs/display/callout.md +3 -9
- package/docs/display/comment-list.md +1 -9
- package/docs/display/description-list-demo/demo1.md +0 -1
- package/docs/display/description-list.md +1 -9
- package/docs/display/empty-prompt-demo/demo1.md +0 -24
- package/docs/display/empty-prompt-demo/demo2.md +16 -0
- package/docs/display/empty-prompt-demo/demo3.md +67 -0
- package/docs/display/empty-prompt-demo/demo4.md +21 -0
- package/docs/display/empty-prompt-demo/demo5.md +33 -0
- package/docs/display/empty-prompt-demo/demo6.md +43 -0
- package/docs/display/empty-prompt-demo/demo7.md +162 -0
- package/docs/display/empty-prompt-demo/demo8.md +57 -0
- package/docs/display/empty-prompt.md +1 -11
- package/docs/display/health-demo/demo1.md +0 -1
- package/docs/display/health.md +4 -10
- package/docs/display/icons.md +1 -9
- package/docs/display/image.md +6 -10
- package/docs/display/list-group.md +1 -9
- package/docs/display/loading/logo-demo/demo1.md +15 -0
- package/docs/display/loading/logo.md +1 -0
- package/docs/display/progress.md +1 -9
- package/docs/display/stat.md +4 -11
- package/docs/display/text.md +4 -12
- package/docs/display/title.md +1 -9
- package/docs/display/tool-tip-demo/demo1.md +40 -42
- package/docs/display/tool-tip-demo/demo2.md +24 -27
- package/docs/display/tool-tip-demo/demo3.md +33 -35
- package/docs/display/tool-tip-demo/demo4.md +4 -7
- package/docs/display/tool-tip.md +6 -10
- package/docs/editors/code/code-block.md +3 -9
- package/docs/editors/code/inline.md +1 -9
- package/docs/editors/markdown-editor/base-editor.md +1 -9
- package/docs/forms/form-controls/checkbox/index.md +1 -9
- package/docs/forms/form-controls/checkbox-group/index.md +1 -9
- package/docs/forms/form-controls/combo-box/index.md +1 -9
- package/docs/forms/form-controls/file-picker/index.md +1 -9
- package/docs/forms/form-controls/form-control-layout/index.md +1 -9
- package/docs/forms/form-controls/form-control-layout-delimited/index.md +1 -9
- package/docs/forms/form-controls/number-field/index.md +1 -9
- package/docs/forms/form-controls/password-field/index.md +1 -9
- package/docs/forms/form-controls/radio/index.md +1 -9
- package/docs/forms/form-controls/radio-group/index.md +1 -9
- package/docs/forms/form-controls/range/index.md +1 -9
- package/docs/forms/form-controls/search-field/index.md +1 -9
- package/docs/forms/form-controls/select/index.md +1 -9
- package/docs/forms/form-controls/switch/index.md +1 -9
- package/docs/forms/form-controls/text-field/index.md +1 -9
- package/docs/forms/form-controls/textarea/index.md +1 -10
- package/docs/forms/form-layouts/described-form-groups.md +1 -9
- package/docs/layout/accordion.md +1 -10
- package/docs/layout/bottom-bar.md +1 -9
- package/docs/layout/flex.md +1 -9
- package/docs/layout/flyout.md +1 -9
- package/docs/layout/header.md +1 -9
- package/docs/layout/horizontal-rule.md +1 -9
- package/docs/layout/modal.md +1 -9
- package/docs/layout/page.md +1 -9
- package/docs/layout/panel.md +2 -10
- package/docs/layout/popover.md +1 -9
- package/docs/navigation/breadcrumbs.md +1 -9
- package/docs/navigation/button.md +1 -9
- package/docs/navigation/collapsible-nav.md +1 -9
- package/docs/navigation/key-pad-menu.md +1 -9
- package/docs/navigation/link.md +1 -9
- package/docs/navigation/side-nav.md +1 -9
- package/docs/navigation/steps.md +1 -9
- package/docs/navigation/tabs-demo/demo1.md +38 -111
- package/docs/navigation/tabs-demo/demo2.md +56 -0
- package/docs/navigation/tabs-demo/demo3.md +79 -0
- package/docs/navigation/tabs-demo/demo4.md +102 -0
- package/docs/navigation/tabs.md +1 -9
- package/docs/utilities/auto-sizer.md +1 -9
- package/docs/utilities/copy.md +1 -9
- package/docs/utilities/mutation-observer.md +1 -9
- package/docs/utilities/outside-click-detector.md +1 -9
- package/docs/utilities/overlay-mask.md +1 -9
- package/docs/utilities/portal.md +1 -9
- package/docs/utilities/resize-observer.md +1 -9
- package/docs/utilities/responsive.md +1 -9
- package/index.js +4 -1
- 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
|
|
70
|
+
return toPlainArray(this.args.options);
|
|
71
71
|
} else {
|
|
72
72
|
return [];
|
|
73
73
|
}
|
|
@@ -1,77 +1,83 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
<
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
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
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
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<
|
|
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
|
|
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?:
|
|
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<
|
|
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 =
|
|
72
|
-
scrollToBottom
|
|
73
|
-
);
|
|
71
|
+
this.isScrollingAnimationFrame =
|
|
72
|
+
window.requestAnimationFrame(scrollToBottom);
|
|
74
73
|
}
|
|
75
74
|
};
|
|
76
75
|
|
|
77
|
-
this.startScrollingAnimationFrame =
|
|
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 (
|
|
60
|
-
|
|
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
|
|
@@ -13,7 +13,8 @@ export const insertPositions: InsertPositionsMap = {
|
|
|
13
13
|
before: 'beforebegin'
|
|
14
14
|
};
|
|
15
15
|
|
|
16
|
-
export const INSERT_POSITIONS: EuiPortalInsertPosition[] =
|
|
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[] = [
|
|
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(
|
|
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(
|
|
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
|
}
|
|
@@ -1,74 +1,63 @@
|
|
|
1
1
|
{{#let (arg-or-default @id (unique-id)) as |id|}}
|
|
2
|
-
{{#
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
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
|
-
|
|
35
|
-
|
|
36
|
-
|
|
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
|
-
|
|
63
|
-
|
|
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
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
{{/
|
|
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[]) =>
|
|
11
|
-
|
|
11
|
+
(...args: unknown[]) => any,
|
|
12
|
+
(...args: unknown[]) => any
|
|
12
13
|
]
|
|
13
14
|
) {
|
|
14
15
|
if (selectedTabId === undefined && !isDisabled) {
|
|
15
|
-
|
|
16
|
-
|
|
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 |
|
|
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]: [
|
|
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]: [
|
|
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]):
|
|
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(
|
|
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(
|
|
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(
|
|
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 =
|
|
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 (
|
|
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(
|
|
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(
|
|
3
|
+
export function startsWith(
|
|
4
|
+
[needle, word]: [string, string] /*, hash*/
|
|
5
|
+
): boolean {
|
|
4
6
|
return word?.startsWith(needle) || false;
|
|
5
7
|
}
|
|
6
8
|
|