@ember-eui/core 12.0.2 → 12.0.4

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.
@@ -1 +1 @@
1
- {"version":3,"file":"eui-accordion.d.ts","sourceRoot":"","sources":["../../src/components/eui-accordion.ts"],"names":[],"mappings":"AAAA,OAAO,SAAS,MAAM,oBAAoB,CAAC;AAM3C,OAAO,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AAC3C,OAAO,KAAK,KAAK,MAAM,cAAc,CAAC;AAgBtC,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,wCAAwC,CAAC;AAC7E,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAE9C,KAAK,uBAAuB,GAAG,MAAM,OAAO,cAAc,CAAC;AAE3D,KAAK,aAAa,GAAG;IACnB,EAAE,CAAC,EAAE,MAAM,CAAC;IAEZ,OAAO,CAAC,EAAE,KAAK,GAAG,UAAU,CAAC;IAC7B;;OAEG;IACH,eAAe,CAAC,EAAE,MAAM,CAAC;IAEzB,WAAW,CAAC,EAAE,UAAU,CAAC;IAEzB;;;OAGG;IACH,aAAa,CAAC,EAAE,KAAK,GAAG,QAAQ,GAAG,QAAQ,CAAC;IAC5C;;OAEG;IACH,UAAU,CAAC,EAAE;QACX,SAAS,CAAC,EAAE,MAAM,CAAC;KACpB,CAAC;IAEF;;OAEG;IACH,sBAAsB,CAAC,EAAE,MAAM,CAAC;IAChC;;OAEG;IACH,aAAa,CAAC,EAAE,SAAS,CAAC;IAC1B;;OAEG;IACH,WAAW,CAAC,EAAE,SAAS,GAAG,OAAO,CAAC;IAClC;;OAEG;IACH,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB;;OAEG;IACH,QAAQ,CAAC,EAAE,CAAC,MAAM,EAAE,OAAO,KAAK,IAAI,CAAC;IACrC;;OAEG;IACH,WAAW,CAAC,EAAE,uBAAuB,CAAC;IACtC;;OAEG;IACH,YAAY,CAAC,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,IAAI,iBAAiB,IAAI,OAAO,CAE/B;IAED,IAAI,aAAa,IAAI,MAAM,CAM1B;IAED,IAAI,oBAAoB,IAAI,MAAM,CAKjC;IAED,IAAI,iBAAiB,IAAI,MAAM,GAAG,UAAU,CAAC,OAAO,QAAQ,CAAC,CAE5D;IAED,qBAAqB,aAYnB;IAGF,QAAQ,IAAI,IAAI;CAqKjB"}
@@ -13,6 +13,7 @@ export interface EuiFormRowSignature {
13
13
  hasEmptyLabelSpace?: boolean;
14
14
  hasChildLabel?: boolean;
15
15
  isFakeLabelBlock?: boolean;
16
+ isFakeHelpTextBlock?: boolean;
16
17
  helpText?: string;
17
18
  error?: string | string[] | null;
18
19
  errorClasses?: string;
@@ -26,7 +27,7 @@ export interface EuiFormRowSignature {
26
27
  label: [string?];
27
28
  field: [];
28
29
  errors: [string?];
29
- helpText: [];
30
+ helpText: [string?];
30
31
  };
31
32
  }
32
33
  export declare function startsWith([needle, word]: [string, string | undefined]): boolean;
@@ -1 +1 @@
1
- {"version":3,"file":"eui-form-row.d.ts","sourceRoot":"","sources":["../../src/components/eui-form-row.ts"],"names":[],"mappings":"AAgBA,OAAO,KAAK,EAAE,4BAA4B,EAAE,MAAM,uCAAuC,CAAC;AAC1F,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,gCAAgC,CAAC;AAE5E,MAAM,WAAW,mBAAmB;IAClC,OAAO,EAAE,cAAc,GAAG,mBAAmB,CAAC;IAC9C,IAAI,EAAE;QACJ,KAAK,CAAC,EAAE,MAAM,CAAC;QACf,WAAW,CAAC,EAAE,MAAM,CAAC;QACrB,SAAS,CAAC,EAAE,OAAO,GAAG,QAAQ,CAAC;QAC/B,UAAU,CAAC,EAAE,QAAQ,GAAG,UAAU,CAAC;QACnC,SAAS,CAAC,EAAE,OAAO,CAAC;QACpB,SAAS,CAAC,EAAE,OAAO,CAAC;QACpB,UAAU,CAAC,EAAE,OAAO,CAAC;QACrB,kBAAkB,CAAC,EAAE,OAAO,CAAC;QAC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/B,UAAU,CAAC,EAAE,QAAQ,GAAG,UAAU,CAAC;QACnC,SAAS,CAAC,EAAE,OAAO,CAAC;QACpB,SAAS,CAAC,EAAE,OAAO,CAAC;QACpB,UAAU,CAAC,EAAE,OAAO,CAAC;QACrB,kBAAkB,CAAC,EAAE,OAAO,CAAC;QAC7B,aAAa,CAAC,EAAE,OAAO,CAAC;QACxB,gBAAgB,CAAC,EAAE,OAAO,CAAC;QAC3B,mBAAmB,CAAC,EAAE,OAAO,CAAC;QAC9B,QAAQ,CAAC,EAAE,MAAM,CAAC;QAClB,KAAK,CAAC,EAAE,MAAM,GAAG,MAAM,EAAE,GAAG,IAAI,CAAC;QACjC,YAAY,CAAC,EAAE,MAAM,CAAC;QACtB,eAAe,CAAC,EAAE,MAAM,CAAC;QACzB,EAAE,CAAC,EAAE,MAAM,CAAC;QACZ,OAAO,CAAC,EAAE,MAAM,OAAO,4BAA4B,CAAC;QACpD,KAAK,CAAC,EAAE,OAAO,CAAC;KACjB,CAAC;IACF,MAAM,EAAE;QACN,OAAO,EAAE,EAAE,CAAC;QACZ,KAAK,EAAE,CAAC,MAAM,CAAC,CAAC,CAAC;QACjB,KAAK,EAAE,EAAE,CAAC;QACV,MAAM,EAAE,CAAC,MAAM,CAAC,CAAC,CAAC;QAClB,QAAQ,EAAE,CAAC,MAAM,CAAC,CAAC,CAAC;KACrB,CAAC;CACH;AAED,wBAAgB,UAAU,CACxB,CAAC,MAAM,EAAE,IAAI,CAAC,EAAE,CAAC,MAAM,EAAE,MAAM,GAAG,SAAS,CAAC,GAC3C,OAAO,CAET;AAID,QAAA,MAAM,UAAU,EAAE,qBAAqB,CAAC,mBAAmB,CAmWzD,CAAC;AAEH,eAAe,UAAU,CAAC"}
@@ -9,11 +9,13 @@ export interface EuiMarkdownFormatSignature {
9
9
  replaceNode?: Replacer;
10
10
  value: string;
11
11
  rootClasses?: string | string[];
12
+ shouldIncludeDefaultRootClasses?: boolean;
12
13
  }
13
14
  export default class EuiMarkdownEditorToolbarComponent extends Component<EuiMarkdownFormatSignature> {
14
15
  get parsingPluginList(): import("../utils/markdown/plugins/markdown-default-plugins/parsing-plugins.ts").DefaultEuiMarkdownParsingPlugins;
15
16
  get processingPluginList(): any;
16
17
  get processor(): unified.Processor<unified.Settings>;
18
+ get shouldIncludeDefaultRootClasses(): boolean;
17
19
  get rootClasses(): string[];
18
20
  get result(): {
19
21
  element: Node | undefined;
@@ -1 +1 @@
1
- {"version":3,"file":"eui-markdown-format.d.ts","sourceRoot":"","sources":["../../src/components/eui-markdown-format.ts"],"names":[],"mappings":"AAAA,OAAO,SAAS,MAAM,oBAAoB,CAAC;AAM3C,OAAO,OAAO,MAAM,SAAS,CAAC;AAE9B,OAAO,EACL,qBAAqB,EACrB,wBAAwB,EACzB,MAAM,6DAA6D,CAAC;AAGrE,OAAO,KAAK,EACV,0BAA0B,EAE3B,MAAM,kCAAkC,CAAC;AAG1C,MAAM,MAAM,QAAQ,GAAG,CACrB,QAAQ,EAAE,0BAA0B,EACpC,GAAG,EAAE,MAAM,KACR,IAAI,CAAC;AAEV,MAAM,WAAW,0BAA0B;IACzC,iBAAiB,CAAC,EAAE,OAAO,qBAAqB,CAAC;IACjD,oBAAoB,CAAC,EAAE,OAAO,wBAAwB,CAAC;IACvD,WAAW,CAAC,EAAE,QAAQ,CAAC;IACvB,KAAK,EAAE,MAAM,CAAC;IAEd,WAAW,CAAC,EAAE,MAAM,GAAG,MAAM,EAAE,CAAC;CACjC;AAED,MAAM,CAAC,OAAO,OAAO,iCAAkC,SAAQ,SAAS,CAAC,0BAA0B,CAAC;IAClG,IAAI,iBAAiB,qHAEpB;IAED,IAAI,oBAAoB,QAEvB;IAED,IACI,SAAS,wCAcZ;IAED,IAAI,WAAW,IAAI,MAAM,EAAE,CAY1B;IAED,IACI,MAAM;;;aAaT;CAmCF"}
1
+ {"version":3,"file":"eui-markdown-format.d.ts","sourceRoot":"","sources":["../../src/components/eui-markdown-format.ts"],"names":[],"mappings":"AAAA,OAAO,SAAS,MAAM,oBAAoB,CAAC;AAM3C,OAAO,OAAO,MAAM,SAAS,CAAC;AAE9B,OAAO,EACL,qBAAqB,EACrB,wBAAwB,EACzB,MAAM,6DAA6D,CAAC;AAGrE,OAAO,KAAK,EACV,0BAA0B,EAE3B,MAAM,kCAAkC,CAAC;AAG1C,MAAM,MAAM,QAAQ,GAAG,CACrB,QAAQ,EAAE,0BAA0B,EACpC,GAAG,EAAE,MAAM,KACR,IAAI,CAAC;AAEV,MAAM,WAAW,0BAA0B;IACzC,iBAAiB,CAAC,EAAE,OAAO,qBAAqB,CAAC;IACjD,oBAAoB,CAAC,EAAE,OAAO,wBAAwB,CAAC;IACvD,WAAW,CAAC,EAAE,QAAQ,CAAC;IACvB,KAAK,EAAE,MAAM,CAAC;IAEd,WAAW,CAAC,EAAE,MAAM,GAAG,MAAM,EAAE,CAAC;IAChC,+BAA+B,CAAC,EAAE,OAAO,CAAC;CAC3C;AAED,MAAM,CAAC,OAAO,OAAO,iCAAkC,SAAQ,SAAS,CAAC,0BAA0B,CAAC;IAClG,IAAI,iBAAiB,qHAEpB;IAED,IAAI,oBAAoB,QAEvB;IAED,IACI,SAAS,wCAcZ;IAED,IAAI,+BAA+B,YAElC;IAED,IAAI,WAAW,IAAI,MAAM,EAAE,CAgB1B;IAED,IACI,MAAM;;;aAaT;CAmCF"}
@@ -5,9 +5,9 @@ export interface EuiStepSignature {
5
5
  Args: {
6
6
  step: number;
7
7
  title: string;
8
- status: 'incomplete' | 'complete' | 'disabled';
9
- titleSize: Exclude<EuiTitleSignature['Args']['size'], 'xxxs' | 'xxs' | 'l'>;
10
- headingElement: 'h1' | 'h2' | 'h3' | 'h4' | 'h5' | 'h6' | 'p';
8
+ status?: 'incomplete' | 'complete' | 'disabled';
9
+ titleSize?: Exclude<EuiTitleSignature['Args']['size'], 'xxxs' | 'xxs' | 'l'>;
10
+ headingElement?: 'h1' | 'h2' | 'h3' | 'h4' | 'h5' | 'h6' | 'p';
11
11
  };
12
12
  Blocks: {
13
13
  default: [];
@@ -1 +1 @@
1
- {"version":3,"file":"eui-step.d.ts","sourceRoot":"","sources":["../../src/components/eui-step.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAC;AACrD,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,gCAAgC,CAAC;AAE5E,MAAM,WAAW,gBAAgB;IAC/B,OAAO,EAAE,cAAc,CAAC;IACxB,IAAI,EAAE;QACJ,IAAI,EAAE,MAAM,CAAC;QACb,KAAK,EAAE,MAAM,CAAC;QACd,MAAM,EAAE,YAAY,GAAG,UAAU,GAAG,UAAU,CAAC;QAC/C,SAAS,EAAE,OAAO,CAAC,iBAAiB,CAAC,MAAM,CAAC,CAAC,MAAM,CAAC,EAAE,MAAM,GAAG,KAAK,GAAG,GAAG,CAAC,CAAC;QAC5E,cAAc,EAAE,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,GAAG,CAAC;KAC/D,CAAC;IACF,MAAM,EAAE;QACN,OAAO,EAAE,EAAE,CAAC;KACb,CAAC;CACH;AAED,QAAA,MAAM,OAAO,EAAE,qBAAqB,CAAC,gBAAgB,CAuCnD,CAAC;AAEH,eAAe,OAAO,CAAC"}
1
+ {"version":3,"file":"eui-step.d.ts","sourceRoot":"","sources":["../../src/components/eui-step.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAC;AACrD,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,gCAAgC,CAAC;AAE5E,MAAM,WAAW,gBAAgB;IAC/B,OAAO,EAAE,cAAc,CAAC;IACxB,IAAI,EAAE;QACJ,IAAI,EAAE,MAAM,CAAC;QACb,KAAK,EAAE,MAAM,CAAC;QACd,MAAM,CAAC,EAAE,YAAY,GAAG,UAAU,GAAG,UAAU,CAAC;QAChD,SAAS,CAAC,EAAE,OAAO,CAAC,iBAAiB,CAAC,MAAM,CAAC,CAAC,MAAM,CAAC,EAAE,MAAM,GAAG,KAAK,GAAG,GAAG,CAAC,CAAC;QAC7E,cAAc,CAAC,EAAE,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,GAAG,CAAC;KAChE,CAAC;IACF,MAAM,EAAE;QACN,OAAO,EAAE,EAAE,CAAC;KACb,CAAC;CACH;AAED,QAAA,MAAM,OAAO,EAAE,qBAAqB,CAAC,gBAAgB,CAuCnD,CAAC;AAEH,eAAe,OAAO,CAAC"}
@@ -1,9 +1,7 @@
1
1
  import type { TemplateOnlyComponent } from '@ember/component/template-only';
2
2
  export interface EuiStepsSignature {
3
3
  Element: HTMLDivElement;
4
- Args: {
5
- steps: [];
6
- };
4
+ Args: {};
7
5
  Blocks: {
8
6
  default: [];
9
7
  };
@@ -1 +1 @@
1
- {"version":3,"file":"eui-steps.d.ts","sourceRoot":"","sources":["../../src/components/eui-steps.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,gCAAgC,CAAC;AAE5E,MAAM,WAAW,iBAAiB;IAChC,OAAO,EAAE,cAAc,CAAC;IACxB,IAAI,EAAE;QACJ,KAAK,EAAE,EAAE,CAAC;KACX,CAAC;IACF,MAAM,EAAE;QACN,OAAO,EAAE,EAAE,CAAC;KACb,CAAC;CACH;AAED,QAAA,MAAM,QAAQ,EAAE,qBAAqB,CAAC,iBAAiB,CAUrD,CAAC;AAEH,eAAe,QAAQ,CAAC"}
1
+ {"version":3,"file":"eui-steps.d.ts","sourceRoot":"","sources":["../../src/components/eui-steps.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,gCAAgC,CAAC;AAE5E,MAAM,WAAW,iBAAiB;IAChC,OAAO,EAAE,cAAc,CAAC;IACxB,IAAI,EAAE,EAAE,CAAC;IACT,MAAM,EAAE;QACN,OAAO,EAAE,EAAE,CAAC;KACb,CAAC;CACH;AAED,QAAA,MAAM,QAAQ,EAAE,qBAAqB,CAAC,iBAAiB,CAUrD,CAAC;AAEH,eAAe,QAAQ,CAAC"}
@@ -3,7 +3,6 @@ import { tracked } from '@glimmer/tracking';
3
3
  import { on } from '@ember/modifier';
4
4
  import { action } from '@ember/object';
5
5
  import didInsert from '@ember/render-modifiers/modifiers/did-insert';
6
- import didUpdate from '@ember/render-modifiers/modifiers/did-update';
7
6
  import { htmlSafe } from '@ember/template';
8
7
  import queue from '@nullvoxpopuli/ember-composable-helpers/helpers/queue';
9
8
  import { element } from 'ember-element-helper';
@@ -85,9 +84,7 @@ class EuiAccordionAccordionComponent extends Component {
85
84
  return this._opened ? '' : htmlSafe(`height: 0px;`);
86
85
  }
87
86
  setChildContentHeight = () => {
88
- const {
89
- forceState
90
- } = this.args;
87
+ let forceState = this.args.forceState;
91
88
  requestAnimationFrame(() => {
92
89
  const height = this.childContent && (forceState ? forceState === 'open' : this._opened) ? this.childContent.clientHeight : 0;
93
90
  this.childWrapper && this.childWrapper.setAttribute('style', `height: ${height}px`);
@@ -108,7 +105,7 @@ class EuiAccordionAccordionComponent extends Component {
108
105
  n(this.prototype, "onToggle", [action]);
109
106
  }
110
107
  static {
111
- setComponentTemplate(precompileTemplate("\n {{#let (argOrDefault @element \"div\") as |tagName|}}\n {{#if tagName}}\n {{#let (element tagName) (element this.buttonElement) as |Accordion ButtonElement|}}\n {{#if (and Accordion ButtonElement)}}\n <Accordion class={{classNames (if this.isOpen \"euiAccordion-isOpen\") componentName=\"EuiAccordion\"}} ...attributes>\n <div class={{classNames \"euiAccordion__triggerWrapper\" @triggerClassName}}>\n {{#if (eq this._arrowDisplay \"left\")}}\n <EuiButtonIcon class={{classNames \"euiAccordion__iconButton\" (if this.isOpen \"euiAccordion__iconButton-isOpen\") (if (eq this._arrowDisplay \"right\") \"euiAccordion__iconButton--right\") (if @arrowProps.className @arrowProps.className)}} @iconType=\"arrowRight\" {{on \"click\" this.onToggle}} aria-controls={{@id}} aria-expanded={{this.isOpen}} tabindex={{if this.buttonElementIsFocusable \"-1\" \"0\"}} />\n {{/if}}\n <ButtonElement type=\"button\" id={{argOrDefault @buttonProps.id (randomId)}} class={{this.buttonClasses}} aria-controls={{@id}} aria-expanded={{this.isOpen}} aria-labelledby={{argOrDefault @buttonProps.id (randomId)}} {{on \"click\" this.onToggle}}>\n <span class={{this.buttonContentClasses}}>\n {{yield this.isOpen to=\"buttonContent\"}}\n </span>\n </ButtonElement>\n {{#if (and @extraAction (has-block \"extraAction\") (not this.isLoading))}}\n <div class=\"euiAccordion__optionalAction\">\n {{yield this.isOpen to=\"extraAction\"}}\n </div>\n {{else if this.isLoading}}\n <div class=\"euiAccordion__optionalAction\">\n <EuiLoadingSpinner />\n </div>\n {{/if}}\n {{#if (eq this._arrowDisplay \"right\")}}\n <EuiButtonIcon @color=\"text\" class={{classNames \"euiAccordion__iconButton\" (if this.isOpen \"euiAccordion__iconButton-isOpen\") (if (eq this._arrowDisplay \"right\") \"euiAccordion__iconButton--right\") (if @arrowProps.className @arrowProps.className)}} @iconType=\"arrowRight\" {{on \"click\" this.onToggle}} aria-controls={{@id}} aria-expanded={{this.isOpen}} tabindex={{if this.buttonElementIsFocusable \"-1\" \"0\"}} />\n {{/if}}\n </div>\n <div class=\"euiAccordion__childWrapper\" style={{this.childContentStyle}} id={{@id}} {{didInsert (set this \"childWrapper\")}} tabindex=\"-1\" role=\"region\">\n <div class={{classNames (if this.isLoading \"euiAccordion__children-isLoading\") @childClassName}} {{didInsert (queue (set this \"childContent\") this.setChildContentHeight)}} {{resizeObserver onResize=this.setChildContentHeight}} {{didUpdate this.setChildContentHeight @forceState}}>\n {{#if (and this.isLoading this.isLoadingMessage)}}\n <EuiLoadingSpinner class=\"euiAccordion__spinner\" />\n <span>\n {{#if this.hasLoadingMessage}}\n {{this.isLoadingMessage}}\n {{else}}\n {{!-- <EuiI18n @token=\"euiAccordion.isLoading\" @default=\"Loading\" /> --}}\n Loading...\n {{/if}}\n </span>\n {{else}}\n <div class={{classNames componentName=\"EuiAccordion\" paddingSize=this.paddingSize}}>\n {{yield to=\"content\"}}\n </div>\n {{/if}}\n </div>\n </div>\n </Accordion>\n {{/if}}\n {{/let}}\n {{/if}}\n {{/let}}\n ", {
108
+ setComponentTemplate(precompileTemplate("\n {{#let (argOrDefault @element \"div\") as |tagName|}}\n {{#if tagName}}\n {{#let (element tagName) (element this.buttonElement) as |Accordion ButtonElement|}}\n {{#if (and Accordion ButtonElement)}}\n <Accordion class={{classNames (if this.isOpen \"euiAccordion-isOpen\") componentName=\"EuiAccordion\"}} ...attributes>\n <div class={{classNames \"euiAccordion__triggerWrapper\" @triggerClassName}}>\n {{#if (eq this._arrowDisplay \"left\")}}\n <EuiButtonIcon class={{classNames \"euiAccordion__iconButton\" (if this.isOpen \"euiAccordion__iconButton-isOpen\") (if (eq this._arrowDisplay \"right\") \"euiAccordion__iconButton--right\") (if @arrowProps.className @arrowProps.className)}} @iconType=\"arrowRight\" {{on \"click\" this.onToggle}} aria-controls={{@id}} aria-expanded={{this.isOpen}} tabindex={{if this.buttonElementIsFocusable \"-1\" \"0\"}} />\n {{/if}}\n <ButtonElement type=\"button\" id={{argOrDefault @buttonProps.id (randomId)}} class={{this.buttonClasses}} aria-controls={{@id}} aria-expanded={{this.isOpen}} aria-labelledby={{argOrDefault @buttonProps.id (randomId)}} {{on \"click\" this.onToggle}}>\n <span class={{this.buttonContentClasses}}>\n {{yield this.isOpen to=\"buttonContent\"}}\n </span>\n </ButtonElement>\n {{#if (and @extraAction (has-block \"extraAction\") (not this.isLoading))}}\n <div class=\"euiAccordion__optionalAction\">\n {{yield this.isOpen to=\"extraAction\"}}\n </div>\n {{else if this.isLoading}}\n <div class=\"euiAccordion__optionalAction\">\n <EuiLoadingSpinner />\n </div>\n {{/if}}\n {{#if (eq this._arrowDisplay \"right\")}}\n <EuiButtonIcon @color=\"text\" class={{classNames \"euiAccordion__iconButton\" (if this.isOpen \"euiAccordion__iconButton-isOpen\") (if (eq this._arrowDisplay \"right\") \"euiAccordion__iconButton--right\") (if @arrowProps.className @arrowProps.className)}} @iconType=\"arrowRight\" {{on \"click\" this.onToggle}} aria-controls={{@id}} aria-expanded={{this.isOpen}} tabindex={{if this.buttonElementIsFocusable \"-1\" \"0\"}} />\n {{/if}}\n </div>\n <div class=\"euiAccordion__childWrapper\" style={{this.childContentStyle}} id={{@id}} {{didInsert (set this \"childWrapper\")}} tabindex=\"-1\" role=\"region\">\n {{(this.setChildContentHeight)}}\n <div class={{classNames (if this.isLoading \"euiAccordion__children-isLoading\") @childClassName}} {{didInsert (queue (set this \"childContent\") this.setChildContentHeight)}} {{resizeObserver onResize=this.setChildContentHeight}}>\n {{#if (and this.isLoading this.isLoadingMessage)}}\n <EuiLoadingSpinner class=\"euiAccordion__spinner\" />\n <span>\n {{#if this.hasLoadingMessage}}\n {{this.isLoadingMessage}}\n {{else}}\n {{!-- <EuiI18n @token=\"euiAccordion.isLoading\" @default=\"Loading\" /> --}}\n Loading...\n {{/if}}\n </span>\n {{else}}\n <div class={{classNames componentName=\"EuiAccordion\" paddingSize=this.paddingSize}}>\n {{yield to=\"content\"}}\n </div>\n {{/if}}\n </div>\n </div>\n </Accordion>\n {{/if}}\n {{/let}}\n {{/if}}\n {{/let}}\n ", {
112
109
  strictMode: true,
113
110
  scope: () => ({
114
111
  argOrDefault,
@@ -124,8 +121,7 @@ class EuiAccordionAccordionComponent extends Component {
124
121
  didInsert,
125
122
  set,
126
123
  queue,
127
- resizeObserver: ResizeObserver,
128
- didUpdate
124
+ resizeObserver: ResizeObserver
129
125
  })
130
126
  }), this);
131
127
  }
@@ -1 +1 @@
1
- {"version":3,"file":"eui-accordion.js","sources":["../../src/components/eui-accordion.gts"],"sourcesContent":["import Component from '@glimmer/component';\nimport { tracked } from '@glimmer/tracking';\nimport { on } from '@ember/modifier';\nimport { action } from '@ember/object';\nimport didInsert from '@ember/render-modifiers/modifiers/did-insert';\nimport didUpdate from '@ember/render-modifiers/modifiers/did-update';\nimport { htmlSafe } from '@ember/template';\nimport type Owner from '@ember/owner';\n\nimport queue from '@nullvoxpopuli/ember-composable-helpers/helpers/queue';\nimport { element } from 'ember-element-helper';\nimport set from 'ember-set-helper/helpers/set';\nimport { and, eq, not } from 'ember-truth-helpers';\n\nimport randomId from '../-private/random-id.ts';\nimport argOrDefault, {\n argOrDefaultDecorator\n} from '../helpers/arg-or-default.ts';\nimport classNames from '../helpers/class-names.ts';\nimport resizeObserver from '../modifiers/resize-observer.ts';\nimport EuiButtonIcon from './eui-button-icon.gts';\nimport EuiLoadingSpinner from './eui-loading-spinner.gts';\n\nimport type { paddingMapping } from '../utils/css-mappings/eui-accordion.ts';\nimport type { CommonArgs } from './common.ts';\n\ntype EuiAccordionPaddingSize = keyof typeof paddingMapping;\n\ntype AccordionArgs = {\n id?: string;\n\n element?: 'div' | 'fieldset';\n /**\n * Class that will apply to the trigger for the accordion.\n */\n buttonClassName?: string;\n\n buttonProps?: CommonArgs;\n\n /**\n * Applied to the main button receiving the `onToggle` event.\n * Anything other than the default `button` does not support removing the arrow display (for accessibility of focus).\n */\n buttonElement?: 'div' | 'legend' | 'button';\n /**\n * Extra props to pass to the EuiButtonIcon containing the arrow.\n */\n arrowProps?: {\n className?: string;\n };\n\n /**\n * Class that will apply to the trigger content for the accordion.\n */\n buttonContentClassName?: string;\n /**\n * The content of the clickable trigger\n */\n buttonContent?: Component;\n /**\n * Will appear right aligned against the button. Useful for separate actions like deletions.\n */\n extraAction?: Component | boolean;\n /**\n * The accordion will start in the open state.\n */\n initialIsOpen?: boolean;\n /**\n * Optional callback method called on open and close with a single `isOpen` parameter\n */\n onToggle?: (isOpen: boolean) => void;\n /**\n * The padding around the exposed accordion content.\n */\n paddingSize?: EuiAccordionPaddingSize;\n /**\n * Placement of the arrow indicator, or 'none' to hide it.\n */\n arrowDisplay?: 'left' | 'right' | 'none';\n /**\n * Control the opening of accordion via prop\n */\n forceState?: 'closed' | 'open';\n /**\n * Change `extraAction` and children into a loading spinner\n */\n isLoading?: boolean;\n /**\n * Choose whether the loading message replaces the content. Customize the message by passing a node\n */\n isLoadingMessage?: boolean | Component;\n\n isOpen?: boolean;\n\n childClassName?: string;\n triggerClassName?: string;\n childContentClassName?: string;\n};\n\nexport interface EuiAccordionSignature {\n Element: any;\n Args: AccordionArgs;\n Blocks: {\n buttonContent: [boolean | undefined];\n content: [];\n extraAction: [boolean | undefined];\n };\n}\n\nexport default class EuiAccordionAccordionComponent extends Component<EuiAccordionSignature> {\n // Defaults\n @argOrDefaultDecorator(false) isLoading!: boolean;\n @argOrDefaultDecorator(false) isLoadingMessage!: boolean;\n @argOrDefaultDecorator(false) initialIsOpen!: boolean;\n @argOrDefaultDecorator('none') paddingSize!: EuiAccordionPaddingSize;\n @argOrDefaultDecorator('left') arrowDisplay!: AccordionArgs['arrowDisplay'];\n\n @tracked _opened;\n @tracked childWrapper: HTMLDivElement | null = null;\n @tracked childContent: HTMLDivElement | null = null;\n\n constructor(owner: Owner, args: AccordionArgs) {\n super(owner, args);\n\n this._opened = this.args.forceState\n ? this.args.forceState === 'open'\n : this.args.initialIsOpen;\n }\n\n get buttonElement() {\n return this.args.element === 'fieldset' ? 'legend' : 'button';\n }\n\n get buttonElementIsFocusable() {\n return this.buttonElement === 'button';\n }\n\n get _arrowDisplay() {\n return this.arrowDisplay === 'none' && !this.buttonElementIsFocusable\n ? 'left'\n : this.arrowDisplay;\n }\n\n get isOpen(): boolean | undefined {\n return this.args.forceState\n ? this.args.forceState === 'open'\n : this._opened;\n }\n\n get hasLoadingMessage(): boolean {\n return this.isLoadingMessage && this.isLoadingMessage !== true;\n }\n\n get buttonClasses(): string {\n return [\n 'euiAccordion__button',\n this.args.buttonClassName,\n this.args.buttonProps?.className\n ].join(' ');\n }\n\n get buttonContentClasses(): string {\n return [\n 'euiAccordion__buttonContent',\n this.args.buttonContentClassName\n ].join(' ');\n }\n\n get childContentStyle(): string | ReturnType<typeof htmlSafe> {\n return this._opened ? '' : htmlSafe(`height: 0px;`);\n }\n\n setChildContentHeight = () => {\n const { forceState } = this.args;\n\n requestAnimationFrame(() => {\n const height =\n this.childContent && (forceState ? forceState === 'open' : this._opened)\n ? this.childContent.clientHeight\n : 0;\n\n this.childWrapper &&\n this.childWrapper.setAttribute('style', `height: ${height}px`);\n });\n };\n\n @action\n onToggle(): void {\n if (this.args.forceState) {\n this.args.onToggle?.(this.args.forceState === 'open' ? false : true);\n } else {\n this._opened = !this._opened;\n\n if (this._opened && this.childWrapper) {\n this.childWrapper.focus();\n }\n\n this.args.onToggle?.(this._opened);\n }\n }\n\n <template>\n {{#let (argOrDefault @element \"div\") as |tagName|}}\n {{#if tagName}}\n {{#let\n (element tagName) (element this.buttonElement)\n as |Accordion ButtonElement|\n }}\n {{#if (and Accordion ButtonElement)}}\n <Accordion\n class={{classNames\n (if this.isOpen \"euiAccordion-isOpen\")\n componentName=\"EuiAccordion\"\n }}\n ...attributes\n >\n <div\n class={{classNames\n \"euiAccordion__triggerWrapper\"\n @triggerClassName\n }}\n >\n {{#if (eq this._arrowDisplay \"left\")}}\n <EuiButtonIcon\n class={{classNames\n \"euiAccordion__iconButton\"\n (if this.isOpen \"euiAccordion__iconButton-isOpen\")\n (if\n (eq this._arrowDisplay \"right\")\n \"euiAccordion__iconButton--right\"\n )\n (if @arrowProps.className @arrowProps.className)\n }}\n @iconType=\"arrowRight\"\n {{on \"click\" this.onToggle}}\n aria-controls={{@id}}\n aria-expanded={{this.isOpen}}\n tabindex={{if this.buttonElementIsFocusable \"-1\" \"0\"}}\n />\n {{/if}}\n <ButtonElement\n type=\"button\"\n id={{argOrDefault @buttonProps.id (randomId)}}\n class={{this.buttonClasses}}\n aria-controls={{@id}}\n aria-expanded={{this.isOpen}}\n aria-labelledby={{argOrDefault @buttonProps.id (randomId)}}\n {{on \"click\" this.onToggle}}\n >\n <span class={{this.buttonContentClasses}}>\n {{yield this.isOpen to=\"buttonContent\"}}\n </span>\n </ButtonElement>\n {{#if\n (and\n @extraAction (has-block \"extraAction\") (not this.isLoading)\n )\n }}\n <div class=\"euiAccordion__optionalAction\">\n {{yield this.isOpen to=\"extraAction\"}}\n </div>\n {{else if this.isLoading}}\n <div class=\"euiAccordion__optionalAction\">\n <EuiLoadingSpinner />\n </div>\n {{/if}}\n {{#if (eq this._arrowDisplay \"right\")}}\n <EuiButtonIcon\n @color=\"text\"\n class={{classNames\n \"euiAccordion__iconButton\"\n (if this.isOpen \"euiAccordion__iconButton-isOpen\")\n (if\n (eq this._arrowDisplay \"right\")\n \"euiAccordion__iconButton--right\"\n )\n (if @arrowProps.className @arrowProps.className)\n }}\n @iconType=\"arrowRight\"\n {{on \"click\" this.onToggle}}\n aria-controls={{@id}}\n aria-expanded={{this.isOpen}}\n tabindex={{if this.buttonElementIsFocusable \"-1\" \"0\"}}\n />\n {{/if}}\n </div>\n <div\n class=\"euiAccordion__childWrapper\"\n style={{this.childContentStyle}}\n id={{@id}}\n {{didInsert (set this \"childWrapper\")}}\n tabindex=\"-1\"\n role=\"region\"\n >\n <div\n class={{classNames\n (if this.isLoading \"euiAccordion__children-isLoading\")\n @childClassName\n }}\n {{didInsert\n (queue (set this \"childContent\") this.setChildContentHeight)\n }}\n {{resizeObserver onResize=this.setChildContentHeight}}\n {{didUpdate this.setChildContentHeight @forceState}}\n >\n {{#if (and this.isLoading this.isLoadingMessage)}}\n <EuiLoadingSpinner class=\"euiAccordion__spinner\" />\n <span>\n {{#if this.hasLoadingMessage}}\n {{this.isLoadingMessage}}\n {{else}}\n {{! <EuiI18n @token=\"euiAccordion.isLoading\" @default=\"Loading\" /> }}\n Loading...\n {{/if}}\n </span>\n {{else}}\n <div\n class={{classNames\n componentName=\"EuiAccordion\"\n paddingSize=this.paddingSize\n }}\n >\n {{yield to=\"content\"}}\n </div>\n {{/if}}\n </div>\n </div>\n </Accordion>\n {{/if}}\n {{/let}}\n {{/if}}\n {{/let}}\n </template>\n}\n"],"names":["EuiAccordionAccordionComponent","Component","g","prototype","argOrDefaultDecorator","i","void 0","tracked","constructor","owner","args","_opened","forceState","initialIsOpen","buttonElement","element","buttonElementIsFocusable","_arrowDisplay","arrowDisplay","isOpen","hasLoadingMessage","isLoadingMessage","buttonClasses","buttonClassName","buttonProps","className","join","buttonContentClasses","buttonContentClassName","childContentStyle","htmlSafe","setChildContentHeight","requestAnimationFrame","height","childContent","clientHeight","childWrapper","setAttribute","onToggle","focus","n","action","setComponentTemplate","precompileTemplate","strictMode","scope","argOrDefault","and","classNames","eq","EuiButtonIcon","on","randomId","not","EuiLoadingSpinner","didInsert","set","queue","resizeObserver","didUpdate"],"mappings":";;;;;;;;;;;;;;;;;;;;;AA6Ge,MAAMA,uCAAuCC,SAAU,CAAA;AAAA,EAAA;AAAAC,IAAAA,CAAA,MAAAC,SAAA,EAAA,WAAA,EAAA,CAEnEC,qBAAsB,CAAA,KAAA,CAAA,CAAA,CAAA;AAAA;AAAA,EAAA,UAAA,IAAAC,CAAA,CAAA,IAAA,EAAA,WAAA,CAAA,EAAAC,MAAA,EADvB;AAAA,EAAA;AAAAJ,IAAAA,CAAA,MAAAC,SAAA,EAAA,kBAAA,EAAA,CAECC,qBAAsB,CAAA,KAAA,CAAA,CAAA,CAAA;AAAA;AAAA,EAAA,iBAAA,IAAAC,CAAA,CAAA,IAAA,EAAA,kBAAA,CAAA,EAAAC,MAAA;AAAA,EAAA;AAAAJ,IAAAA,CAAA,MAAAC,SAAA,EAAA,eAAA,EAAA,CACtBC,qBAAsB,CAAA,KAAA,CAAA,CAAA,CAAA;AAAA;AAAA,EAAA,cAAA,IAAAC,CAAA,CAAA,IAAA,EAAA,eAAA,CAAA,EAAAC,MAAA;AAAA,EAAA;AAAAJ,IAAAA,CAAA,MAAAC,SAAA,EAAA,aAAA,EAAA,CACtBC,qBAAsB,CAAA,MAAA,CAAA,CAAA,CAAA;AAAA;AAAA,EAAA,YAAA,IAAAC,CAAA,CAAA,IAAA,EAAA,aAAA,CAAA,EAAAC,MAAA;AAAA,EAAA;AAAAJ,I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EAAAA,MAAA,IAAU,CAAA;AACjE,KAAA,CAAA;GACA;AAGFK,EAAAA,QAAAA,GAAiB;AACf,IAAA,IAAI,IAAI,CAAC5B,IAAI,CAACE,UAAU,EAAE;AACxB,MAAA,IAAI,CAACF,IAAI,CAAC4B,QAAQ,GAAG,IAAI,CAAC5B,IAAI,CAACE,UAAU,KAAK,MAAA,GAAS,KAAQ,GAAA,IAAA,CAAA;AACjE,KAAO,MAAA;AACL,MAAA,IAAI,CAACD,OAAO,GAAG,CAAC,IAAI,CAACA,OAAO;AAE5B,MAAA,IAAI,IAAI,CAACA,OAAO,IAAI,IAAI,CAACyB,YAAY,EAAE;AACrC,QAAA,IAAI,CAACA,YAAY,CAACG,KAAK,EAAA;AACzB;MAEA,IAAI,CAAC7B,IAAI,CAAC4B,QAAQ,GAAG,IAAI,CAAC3B,OAAO,CAAA;AACnC;AACF;AAAA,EAAA;IAAA6B,CAAA,CAAA,IAAA,CAAArC,SAAA,EAAA,UAAA,EAAA,CAbCsC,MAAA,CAAA,CAAA;AAAA;AAeD,EAAA;IAAAC,oBAAA,CAAAC,kBAAA,CAmIA,6sHAAA,EAAA;MAAAC,UAAA,EAAA,IAAA;AAAAC,MAAAA,KAAA,EAAAA,OAAA;QAAAC,YAAA;QAAA/B,OAAA;QAAAgC,GAAA;QAAAC,UAAA;QAAAC,EAAA;QAAAC,aAAA;QAAAC,EAAA;QAAAC,QAAA;QAAAC,GAAA;QAAAC,iBAAA;QAAAC,SAAA;QAAAC,GAAA;QAAAC,KAAA;wBAAAC,cAAA;AAAAC,QAAAA;AAAA,OAAA;KAAU,CAAA,EAAV,IAAW,CAAA;AAAD;AACZ;;;;"}
1
+ {"version":3,"file":"eui-accordion.js","sources":["../../src/components/eui-accordion.gts"],"sourcesContent":["import Component from '@glimmer/component';\nimport { tracked } from '@glimmer/tracking';\nimport { on } from '@ember/modifier';\nimport { action } from '@ember/object';\nimport didInsert from '@ember/render-modifiers/modifiers/did-insert';\nimport { htmlSafe } from '@ember/template';\nimport type Owner from '@ember/owner';\n\nimport queue from '@nullvoxpopuli/ember-composable-helpers/helpers/queue';\nimport { element } from 'ember-element-helper';\nimport set from 'ember-set-helper/helpers/set';\nimport { and, eq, not } from 'ember-truth-helpers';\n\nimport randomId from '../-private/random-id.ts';\nimport argOrDefault, {\n argOrDefaultDecorator\n} from '../helpers/arg-or-default.ts';\nimport classNames from '../helpers/class-names.ts';\nimport resizeObserver from '../modifiers/resize-observer.ts';\nimport EuiButtonIcon from './eui-button-icon.gts';\nimport EuiLoadingSpinner from './eui-loading-spinner.gts';\n\nimport type { paddingMapping } from '../utils/css-mappings/eui-accordion.ts';\nimport type { CommonArgs } from './common.ts';\n\ntype EuiAccordionPaddingSize = keyof typeof paddingMapping;\n\ntype AccordionArgs = {\n id?: string;\n\n element?: 'div' | 'fieldset';\n /**\n * Class that will apply to the trigger for the accordion.\n */\n buttonClassName?: string;\n\n buttonProps?: CommonArgs;\n\n /**\n * Applied to the main button receiving the `onToggle` event.\n * Anything other than the default `button` does not support removing the arrow display (for accessibility of focus).\n */\n buttonElement?: 'div' | 'legend' | 'button';\n /**\n * Extra props to pass to the EuiButtonIcon containing the arrow.\n */\n arrowProps?: {\n className?: string;\n };\n\n /**\n * Class that will apply to the trigger content for the accordion.\n */\n buttonContentClassName?: string;\n /**\n * The content of the clickable trigger\n */\n buttonContent?: Component;\n /**\n * Will appear right aligned against the button. Useful for separate actions like deletions.\n */\n extraAction?: Component | boolean;\n /**\n * The accordion will start in the open state.\n */\n initialIsOpen?: boolean;\n /**\n * Optional callback method called on open and close with a single `isOpen` parameter\n */\n onToggle?: (isOpen: boolean) => void;\n /**\n * The padding around the exposed accordion content.\n */\n paddingSize?: EuiAccordionPaddingSize;\n /**\n * Placement of the arrow indicator, or 'none' to hide it.\n */\n arrowDisplay?: 'left' | 'right' | 'none';\n /**\n * Control the opening of accordion via prop\n */\n forceState?: 'closed' | 'open';\n /**\n * Change `extraAction` and children into a loading spinner\n */\n isLoading?: boolean;\n /**\n * Choose whether the loading message replaces the content. Customize the message by passing a node\n */\n isLoadingMessage?: boolean | Component;\n\n isOpen?: boolean;\n\n childClassName?: string;\n triggerClassName?: string;\n childContentClassName?: string;\n};\n\nexport interface EuiAccordionSignature {\n Element: any;\n Args: AccordionArgs;\n Blocks: {\n buttonContent: [boolean | undefined];\n content: [];\n extraAction: [boolean | undefined];\n };\n}\n\nexport default class EuiAccordionAccordionComponent extends Component<EuiAccordionSignature> {\n // Defaults\n @argOrDefaultDecorator(false) isLoading!: boolean;\n @argOrDefaultDecorator(false) isLoadingMessage!: boolean;\n @argOrDefaultDecorator(false) initialIsOpen!: boolean;\n @argOrDefaultDecorator('none') paddingSize!: EuiAccordionPaddingSize;\n @argOrDefaultDecorator('left') arrowDisplay!: AccordionArgs['arrowDisplay'];\n\n @tracked _opened;\n @tracked childWrapper: HTMLDivElement | null = null;\n @tracked childContent: HTMLDivElement | null = null;\n\n constructor(owner: Owner, args: AccordionArgs) {\n super(owner, args);\n\n this._opened = this.args.forceState\n ? this.args.forceState === 'open'\n : this.args.initialIsOpen;\n }\n\n get buttonElement() {\n return this.args.element === 'fieldset' ? 'legend' : 'button';\n }\n\n get buttonElementIsFocusable() {\n return this.buttonElement === 'button';\n }\n\n get _arrowDisplay() {\n return this.arrowDisplay === 'none' && !this.buttonElementIsFocusable\n ? 'left'\n : this.arrowDisplay;\n }\n\n get isOpen(): boolean | undefined {\n return this.args.forceState\n ? this.args.forceState === 'open'\n : this._opened;\n }\n\n get hasLoadingMessage(): boolean {\n return this.isLoadingMessage && this.isLoadingMessage !== true;\n }\n\n get buttonClasses(): string {\n return [\n 'euiAccordion__button',\n this.args.buttonClassName,\n this.args.buttonProps?.className\n ].join(' ');\n }\n\n get buttonContentClasses(): string {\n return [\n 'euiAccordion__buttonContent',\n this.args.buttonContentClassName\n ].join(' ');\n }\n\n get childContentStyle(): string | ReturnType<typeof htmlSafe> {\n return this._opened ? '' : htmlSafe(`height: 0px;`);\n }\n\n setChildContentHeight = () => {\n let forceState = this.args.forceState;\n\n requestAnimationFrame(() => {\n const height =\n this.childContent && (forceState ? forceState === 'open' : this._opened)\n ? this.childContent.clientHeight\n : 0;\n\n this.childWrapper &&\n this.childWrapper.setAttribute('style', `height: ${height}px`);\n });\n };\n\n @action\n onToggle(): void {\n if (this.args.forceState) {\n this.args.onToggle?.(this.args.forceState === 'open' ? false : true);\n } else {\n this._opened = !this._opened;\n\n if (this._opened && this.childWrapper) {\n this.childWrapper.focus();\n }\n\n this.args.onToggle?.(this._opened);\n }\n }\n\n <template>\n {{#let (argOrDefault @element \"div\") as |tagName|}}\n {{#if tagName}}\n {{#let\n (element tagName) (element this.buttonElement)\n as |Accordion ButtonElement|\n }}\n {{#if (and Accordion ButtonElement)}}\n <Accordion\n class={{classNames\n (if this.isOpen \"euiAccordion-isOpen\")\n componentName=\"EuiAccordion\"\n }}\n ...attributes\n >\n <div\n class={{classNames\n \"euiAccordion__triggerWrapper\"\n @triggerClassName\n }}\n >\n {{#if (eq this._arrowDisplay \"left\")}}\n <EuiButtonIcon\n class={{classNames\n \"euiAccordion__iconButton\"\n (if this.isOpen \"euiAccordion__iconButton-isOpen\")\n (if\n (eq this._arrowDisplay \"right\")\n \"euiAccordion__iconButton--right\"\n )\n (if @arrowProps.className @arrowProps.className)\n }}\n @iconType=\"arrowRight\"\n {{on \"click\" this.onToggle}}\n aria-controls={{@id}}\n aria-expanded={{this.isOpen}}\n tabindex={{if this.buttonElementIsFocusable \"-1\" \"0\"}}\n />\n {{/if}}\n <ButtonElement\n type=\"button\"\n id={{argOrDefault @buttonProps.id (randomId)}}\n class={{this.buttonClasses}}\n aria-controls={{@id}}\n aria-expanded={{this.isOpen}}\n aria-labelledby={{argOrDefault @buttonProps.id (randomId)}}\n {{on \"click\" this.onToggle}}\n >\n <span class={{this.buttonContentClasses}}>\n {{yield this.isOpen to=\"buttonContent\"}}\n </span>\n </ButtonElement>\n {{#if\n (and\n @extraAction (has-block \"extraAction\") (not this.isLoading)\n )\n }}\n <div class=\"euiAccordion__optionalAction\">\n {{yield this.isOpen to=\"extraAction\"}}\n </div>\n {{else if this.isLoading}}\n <div class=\"euiAccordion__optionalAction\">\n <EuiLoadingSpinner />\n </div>\n {{/if}}\n {{#if (eq this._arrowDisplay \"right\")}}\n <EuiButtonIcon\n @color=\"text\"\n class={{classNames\n \"euiAccordion__iconButton\"\n (if this.isOpen \"euiAccordion__iconButton-isOpen\")\n (if\n (eq this._arrowDisplay \"right\")\n \"euiAccordion__iconButton--right\"\n )\n (if @arrowProps.className @arrowProps.className)\n }}\n @iconType=\"arrowRight\"\n {{on \"click\" this.onToggle}}\n aria-controls={{@id}}\n aria-expanded={{this.isOpen}}\n tabindex={{if this.buttonElementIsFocusable \"-1\" \"0\"}}\n />\n {{/if}}\n </div>\n <div\n class=\"euiAccordion__childWrapper\"\n style={{this.childContentStyle}}\n id={{@id}}\n {{didInsert (set this \"childWrapper\")}}\n tabindex=\"-1\"\n role=\"region\"\n >\n {{(this.setChildContentHeight)}}\n <div\n class={{classNames\n (if this.isLoading \"euiAccordion__children-isLoading\")\n @childClassName\n }}\n {{didInsert\n (queue (set this \"childContent\") this.setChildContentHeight)\n }}\n {{resizeObserver onResize=this.setChildContentHeight}}\n >\n {{#if (and this.isLoading this.isLoadingMessage)}}\n <EuiLoadingSpinner class=\"euiAccordion__spinner\" />\n <span>\n {{#if this.hasLoadingMessage}}\n {{this.isLoadingMessage}}\n {{else}}\n {{! <EuiI18n @token=\"euiAccordion.isLoading\" @default=\"Loading\" /> }}\n Loading...\n {{/if}}\n </span>\n {{else}}\n <div\n class={{classNames\n componentName=\"EuiAccordion\"\n paddingSize=this.paddingSize\n }}\n >\n {{yield to=\"content\"}}\n </div>\n {{/if}}\n </div>\n </div>\n </Accordion>\n {{/if}}\n {{/let}}\n {{/if}}\n {{/let}}\n </template>\n}\n"],"names":["EuiAccordionAccordionComponent","Component","g","prototype","argOrDefaultDecorator","i","void 0","tracked","constructor","owner","args","_opened","forceState","initialIsOpen","buttonElement","element","buttonElementIsFocusable","_arrowDisplay","arrowDisplay","isOpen","hasLoadingMessage","isLoadingMessage","buttonClasses","buttonClassName","buttonProps","className","join","buttonContentClasses","buttonContentClassName","childContentStyle","htmlSafe","setChildContentHeight","requestAnimationFrame","height","childContent","clientHeight","childWrapper","setAttribute","onToggle","focus","n","action","setComponentTemplate","precompileTemplate","strictMode","scope","argOrDefault","and","classNames","eq","EuiButtonIcon","on","randomId","not","EuiLoadingSpinner","didInsert","set","queue","resizeObserver"],"mappings":";;;;;;;;;;;;;;;;;;;;AA4Ge,MAAMA,uCAAuCC,SAAU,CAAA;AAAA,EAAA;AAAAC,IAAAA,CAAA,MAAAC,SAAA,EAAA,WAAA,EAAA,CAEnEC,qBAAsB,CAAA,KAAA,CAAA,CAAA,CAAA;AAAA;AAAA,EAAA,UAAA,IAAAC,CAAA,CAAA,IAAA,EAAA,WAAA,CAAA,EAAAC,MAAA,EADvB;AAAA,EAAA;AAAAJ,IAAAA,CAAA,MAAAC,SAAA,EAAA,kBAAA,EAAA,CAECC,qBAAsB,CAAA,KAAA,CAAA,CAAA,CAAA;AAAA;AAAA,EAAA,iBAAA,IAAAC,CAAA,CAAA,IAAA,EAAA,kBAAA,CAAA,EAAAC,MAAA;AAAA,EAAA;AAAAJ,IAAAA,CAAA,MAAAC,SAAA,EAAA,eAAA,EAAA,CACtBC,qBAAsB,CAAA,KAAA,CAAA,CAAA,CAAA;AAAA;AAAA,EAAA,cAAA,IAAAC,CAAA,CAAA,IAAA,EAAA,eAAA,CAAA,EAAAC,MAAA;AAAA,EAAA;AAAAJ,IAAAA,CAAA,MAAAC,SAAA,EAAA,aAAA,EAAA,CACtBC,qBAAsB,CAAA,MAAA,CAAA,CAAA,CAAA;AAAA;AAAA,EAAA,YAAA,IAAAC,CAAA,CAAA,IAAA,EAAA,aAAA,CAAA,EAAAC,MAAA;AAAA,EAAA;AAAAJ,IAAAA,CAAA,MAAAC,SAAA,EAAA,cAAA,EAAA,CACtB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A;AAGFK,EAAAA,QAAAA,GAAiB;AACf,IAAA,IAAI,IAAI,CAAC5B,IAAI,CAACE,UAAU,EAAE;AACxB,MAAA,IAAI,CAACF,IAAI,CAAC4B,QAAQ,GAAG,IAAI,CAAC5B,IAAI,CAACE,UAAU,KAAK,MAAA,GAAS,KAAQ,GAAA,IAAA,CAAA;AACjE,KAAO,MAAA;AACL,MAAA,IAAI,CAACD,OAAO,GAAG,CAAC,IAAI,CAACA,OAAO;AAE5B,MAAA,IAAI,IAAI,CAACA,OAAO,IAAI,IAAI,CAACyB,YAAY,EAAE;AACrC,QAAA,IAAI,CAACA,YAAY,CAACG,KAAK,EAAA;AACzB;MAEA,IAAI,CAAC7B,IAAI,CAAC4B,QAAQ,GAAG,IAAI,CAAC3B,OAAO,CAAA;AACnC;AACF;AAAA,EAAA;IAAA6B,CAAA,CAAA,IAAA,CAAArC,SAAA,EAAA,UAAA,EAAA,CAbCsC,MAAA,CAAA,CAAA;AAAA;AAeD,EAAA;IAAAC,oBAAA,CAAAC,kBAAA,CAmIA,0sHAAA,EAAA;MAAAC,UAAA,EAAA,IAAA;AAAAC,MAAAA,KAAA,EAAAA,OAAA;QAAAC,YAAA;QAAA/B,OAAA;QAAAgC,GAAA;QAAAC,UAAA;QAAAC,EAAA;QAAAC,aAAA;QAAAC,EAAA;QAAAC,QAAA;QAAAC,GAAA;QAAAC,iBAAA;QAAAC,SAAA;QAAAC,GAAA;QAAAC,KAAA;AAAAC,wBAAAA;AAAA,OAAA;KAAU,CAAA,EAAV,IAAW,CAAA;AAAD;AACZ;;;;"}
@@ -18,7 +18,7 @@ function startsWith([needle, word]) {
18
18
  return word?.startsWith(needle) || false;
19
19
  }
20
20
  const startWith = helper(startsWith);
21
- const EuiFormRow = setComponentTemplate(precompileTemplate("\n {{#let (classNames \"euiFormRow\" (if @hasEmptyLabelSpace \"euiFormRow--hasEmptyLabelSpace\") (if @fullWidth \"euiFormRow--fullWidth\") componentName=\"EuiFormRow\" display=@display) (classNames \"euiFormRow__fieldWrapper\" (if (startWith \"center\" @display) \"euiFormRow__fieldWrapperDisplayOnly\")) (if (isArray @error) @error (array @error)) (and @label (eq @labelType \"legend\")) (useState false) (argOrDefault @id (randomId)) (argOrDefault @hasChildLabel true) (and (not (argOrDefault @isFakeLabelBlock false)) (has-block \"label\")) as |classes fieldWrapperClasses errors isLegend focusedState rowId hasChildLabel hasLabelBlock|}}\n {{#if (eq @legendType \"legend\")}}\n <fieldset class={{classes}} id=\"{{rowId}}-row\" ...attributes>\n {{#if (or @label @labelAppend hasLabelBlock)}}\n <div class=\"euiFormRow__labelWrapper\">\n {{#if isLegend}}\n {{#if hasLabelBlock}}\n <EuiFormLabel class=\"euiFormRow__label\" for={{rowId}} aria-invalid={{@isInvalid}} @isInvalid={{@isInvalid}} @type={{@labelType}}>\n {{yield @label to=\"label\"}}\n </EuiFormLabel>\n {{else}}\n <EuiFormLabel class=\"euiFormRow__label\" for={{rowId}} aria-invalid={{@isInvalid}} @isInvalid={{@isInvalid}} @type={{@labelType}}>\n {{@label}}\n </EuiFormLabel>\n {{/if}}\n {{else if hasLabelBlock}}\n <EuiFormLabel class=\"euiFormRow__label\" aria-invalid={{@isInvalid}} for={{if hasChildLabel rowId}} @isInvalid={{@isInvalid}} @type={{@labelType}} @isFocused={{and (not @isDisabled) (not isLegend) focusedState.value}}>\n {{yield @label to=\"label\"}}\n </EuiFormLabel>\n {{else}}\n <EuiFormLabel class=\"euiFormRow__label\" aria-invalid={{@isInvalid}} for={{if hasChildLabel rowId}} @isInvalid={{@isInvalid}} @type={{@labelType}} @isFocused={{and (not @isDisabled) (not isLegend) focusedState.value}}>\n {{@label}}\n </EuiFormLabel>\n {{/if}}\n </div>\n {{/if}}\n <div class={{fieldWrapperClasses}} {{on \"focusin\" (fn focusedState.setState true)}} {{on \"focusout\" (fn focusedState.setState false)}}>\n {{#if (has-block \"field\")}}\n {{yield to=\"field\"}}\n {{else}}\n {{yield}}\n {{/if}}\n {{#if (or (and (has-block \"errors\") @isInvalid) (and (gt errors.length 0) @isInvalid))}}\n {{#if (has-block \"errors\")}}\n {{#each errors as |error i|}}\n <EuiFormErrorText class=\"euiFormRow__text {{@errorClasses}}\" id=\"{{rowId}}-error-{{i}}\">\n {{!--@glint-ignore--}}\n {{yield error to=\"errors\"}}\n </EuiFormErrorText>\n {{/each}}\n {{else}}\n {{#each errors as |error i|}}\n <EuiFormErrorText class=\"euiFormRow__text {{@errorClasses}}\" id=\"{{rowId}}-error-{{i}}\">\n {{!--@glint-ignore--}}\n {{error}}\n </EuiFormErrorText>\n {{/each}}\n {{/if}}\n {{/if}}\n {{#if (or @helpText (has-block \"helpText\"))}}\n {{#if (has-block \"helpText\")}}\n <EuiFormHelpText id=\"{{rowId}}-help\" class={{@helpTextClasses}}>\n {{yield to=\"helpText\"}}\n </EuiFormHelpText>\n {{else}}\n <EuiFormHelpText id=\"{{rowId}}-help\" class={{@helpTextClasses}}>\n {{@helpText}}\n </EuiFormHelpText>\n {{/if}}\n {{/if}}\n </div>\n </fieldset>\n {{else}}\n <div class={{classes}} id=\"{{rowId}}-row\" ...attributes>\n {{#if (or @label @labelAppend hasLabelBlock)}}\n <div class=\"euiFormRow__labelWrapper\">\n {{#if isLegend}}\n {{#if hasLabelBlock}}\n <EuiFormLabel class=\"euiFormRow__label\" for={{rowId}} aria-invalid={{@isInvalid}} @isInvalid={{@isInvalid}} @type={{@labelType}}>\n {{yield @label to=\"label\"}}\n </EuiFormLabel>\n {{else}}\n <EuiFormLabel class=\"euiFormRow__label\" for={{rowId}} aria-invalid={{@isInvalid}} @isInvalid={{@isInvalid}} @type={{@labelType}}>\n {{@label}}\n </EuiFormLabel>\n {{/if}}\n {{else if hasLabelBlock}}\n <EuiFormLabel class=\"euiFormRow__label\" aria-invalid={{@isInvalid}} for={{if hasChildLabel rowId}} @isInvalid={{@isInvalid}} @type={{@labelType}} @isFocused={{and (not @isDisabled) (not isLegend) focusedState.value}}>\n {{yield @label to=\"label\"}}\n </EuiFormLabel>\n {{else}}\n <EuiFormLabel class=\"euiFormRow__label\" aria-invalid={{@isInvalid}} for={{if hasChildLabel rowId}} @isInvalid={{@isInvalid}} @type={{@labelType}} @isFocused={{and (not @isDisabled) (not isLegend) focusedState.value}}>\n {{@label}}\n </EuiFormLabel>\n {{/if}}\n </div>\n {{/if}}\n <div class={{fieldWrapperClasses}} {{on \"focusin\" (fn focusedState.setState true)}} {{on \"focusout\" (fn focusedState.setState false)}}>\n {{#if (has-block \"field\")}}\n {{yield to=\"field\"}}\n {{else}}\n {{yield}}\n {{/if}}\n {{#if (or (and (has-block \"errors\") @isInvalid) (and (gt errors.length 0) @isInvalid))}}\n {{#if (has-block \"errors\")}}\n {{#each errors as |error i|}}\n <EuiFormErrorText class=\"euiFormRow__text {{@errorClasses}}\" id=\"{{rowId}}-error-{{i}}\">\n {{!--@glint-ignore--}}\n {{yield error to=\"errors\"}}\n </EuiFormErrorText>\n {{/each}}\n {{else}}\n {{#each errors as |error i|}}\n <EuiFormErrorText class=\"euiFormRow__text {{@errorClasses}}\" id=\"{{rowId}}-error-{{i}}\">\n {{!--@glint-ignore--}}\n {{error}}\n </EuiFormErrorText>\n {{/each}}\n {{/if}}\n {{/if}}\n {{#if (or @helpText (has-block \"helpText\"))}}\n {{#if (has-block \"helpText\")}}\n <EuiFormHelpText id=\"{{rowId}}-help\" class={{@helpTextClasses}}>\n {{yield to=\"helpText\"}}\n </EuiFormHelpText>\n {{else}}\n {{#let (if (isArray @helpText) @helpText (array @helpText)) as |helpTexts|}}\n {{#each helpTexts as |helpText i|}}\n <EuiFormHelpText id=\"{{rowId}}-help-{{i}}\" class={{@helpTextClasses}}>\n {{helpText}}\n </EuiFormHelpText>\n {{/each}}\n {{/let}}\n {{/if}}\n {{/if}}\n </div>\n </div>\n {{/if}}\n {{/let}}\n", {
21
+ const EuiFormRow = setComponentTemplate(precompileTemplate("\n {{#let (classNames \"euiFormRow\" (if @hasEmptyLabelSpace \"euiFormRow--hasEmptyLabelSpace\") (if @fullWidth \"euiFormRow--fullWidth\") componentName=\"EuiFormRow\" display=@display) (classNames \"euiFormRow__fieldWrapper\" (if (startWith \"center\" @display) \"euiFormRow__fieldWrapperDisplayOnly\")) (if (isArray @error) @error (array @error)) (and @label (eq @labelType \"legend\")) (useState false) (argOrDefault @id (randomId)) (argOrDefault @hasChildLabel true) (and (not (argOrDefault @isFakeLabelBlock false)) (has-block \"label\")) (and (not (argOrDefault @isFakeHelpTextBlock false)) (has-block \"helpText\")) as |classes fieldWrapperClasses errors isLegend focusedState rowId hasChildLabel hasLabelBlock hasHelpTextBlock|}}\n {{#if (eq @legendType \"legend\")}}\n <fieldset class={{classes}} id=\"{{rowId}}-row\" ...attributes>\n {{#if (or @label @labelAppend hasLabelBlock)}}\n <div class=\"euiFormRow__labelWrapper\">\n {{#if isLegend}}\n {{#if hasLabelBlock}}\n <EuiFormLabel class=\"euiFormRow__label\" for={{rowId}} aria-invalid={{@isInvalid}} @isInvalid={{@isInvalid}} @type={{@labelType}}>\n {{yield @label to=\"label\"}}\n </EuiFormLabel>\n {{else}}\n <EuiFormLabel class=\"euiFormRow__label\" for={{rowId}} aria-invalid={{@isInvalid}} @isInvalid={{@isInvalid}} @type={{@labelType}}>\n {{@label}}\n </EuiFormLabel>\n {{/if}}\n {{else if hasLabelBlock}}\n <EuiFormLabel class=\"euiFormRow__label\" aria-invalid={{@isInvalid}} for={{if hasChildLabel rowId}} @isInvalid={{@isInvalid}} @type={{@labelType}} @isFocused={{and (not @isDisabled) (not isLegend) focusedState.value}}>\n {{yield @label to=\"label\"}}\n </EuiFormLabel>\n {{else}}\n <EuiFormLabel class=\"euiFormRow__label\" aria-invalid={{@isInvalid}} for={{if hasChildLabel rowId}} @isInvalid={{@isInvalid}} @type={{@labelType}} @isFocused={{and (not @isDisabled) (not isLegend) focusedState.value}}>\n {{@label}}\n </EuiFormLabel>\n {{/if}}\n </div>\n {{/if}}\n <div class={{fieldWrapperClasses}} {{on \"focusin\" (fn focusedState.setState true)}} {{on \"focusout\" (fn focusedState.setState false)}}>\n {{#if (has-block \"field\")}}\n {{yield to=\"field\"}}\n {{else}}\n {{yield}}\n {{/if}}\n {{#if (or (and (has-block \"errors\") @isInvalid) (and (gt errors.length 0) @isInvalid))}}\n {{#if (has-block \"errors\")}}\n {{#each errors as |error i|}}\n <EuiFormErrorText class=\"euiFormRow__text {{@errorClasses}}\" id=\"{{rowId}}-error-{{i}}\">\n {{!--@glint-ignore--}}\n {{yield error to=\"errors\"}}\n </EuiFormErrorText>\n {{/each}}\n {{else}}\n {{#each errors as |error i|}}\n <EuiFormErrorText class=\"euiFormRow__text {{@errorClasses}}\" id=\"{{rowId}}-error-{{i}}\">\n {{!--@glint-ignore--}}\n {{error}}\n </EuiFormErrorText>\n {{/each}}\n {{/if}}\n {{/if}}\n {{#if (or @helpText hasHelpTextBlock)}}\n {{#if hasHelpTextBlock}}\n <EuiFormHelpText id=\"{{rowId}}-help\" class={{@helpTextClasses}}>\n {{yield @helpText to=\"helpText\"}}\n </EuiFormHelpText>\n {{else}}\n <EuiFormHelpText id=\"{{rowId}}-help\" class={{@helpTextClasses}}>\n {{@helpText}}\n </EuiFormHelpText>\n {{/if}}\n {{/if}}\n </div>\n </fieldset>\n {{else}}\n <div class={{classes}} id=\"{{rowId}}-row\" ...attributes>\n {{#if (or @label @labelAppend hasLabelBlock)}}\n <div class=\"euiFormRow__labelWrapper\">\n {{#if isLegend}}\n {{#if hasLabelBlock}}\n <EuiFormLabel class=\"euiFormRow__label\" for={{rowId}} aria-invalid={{@isInvalid}} @isInvalid={{@isInvalid}} @type={{@labelType}}>\n {{yield @label to=\"label\"}}\n </EuiFormLabel>\n {{else}}\n <EuiFormLabel class=\"euiFormRow__label\" for={{rowId}} aria-invalid={{@isInvalid}} @isInvalid={{@isInvalid}} @type={{@labelType}}>\n {{@label}}\n </EuiFormLabel>\n {{/if}}\n {{else if hasLabelBlock}}\n <EuiFormLabel class=\"euiFormRow__label\" aria-invalid={{@isInvalid}} for={{if hasChildLabel rowId}} @isInvalid={{@isInvalid}} @type={{@labelType}} @isFocused={{and (not @isDisabled) (not isLegend) focusedState.value}}>\n {{yield @label to=\"label\"}}\n </EuiFormLabel>\n {{else}}\n <EuiFormLabel class=\"euiFormRow__label\" aria-invalid={{@isInvalid}} for={{if hasChildLabel rowId}} @isInvalid={{@isInvalid}} @type={{@labelType}} @isFocused={{and (not @isDisabled) (not isLegend) focusedState.value}}>\n {{@label}}\n </EuiFormLabel>\n {{/if}}\n </div>\n {{/if}}\n <div class={{fieldWrapperClasses}} {{on \"focusin\" (fn focusedState.setState true)}} {{on \"focusout\" (fn focusedState.setState false)}}>\n {{#if (has-block \"field\")}}\n {{yield to=\"field\"}}\n {{else}}\n {{yield}}\n {{/if}}\n {{#if (or (and (has-block \"errors\") @isInvalid) (and (gt errors.length 0) @isInvalid))}}\n {{#if (has-block \"errors\")}}\n {{#each errors as |error i|}}\n <EuiFormErrorText class=\"euiFormRow__text {{@errorClasses}}\" id=\"{{rowId}}-error-{{i}}\">\n {{!--@glint-ignore--}}\n {{yield error to=\"errors\"}}\n </EuiFormErrorText>\n {{/each}}\n {{else}}\n {{#each errors as |error i|}}\n <EuiFormErrorText class=\"euiFormRow__text {{@errorClasses}}\" id=\"{{rowId}}-error-{{i}}\">\n {{!--@glint-ignore--}}\n {{error}}\n </EuiFormErrorText>\n {{/each}}\n {{/if}}\n {{/if}}\n {{#if (or @helpText (has-block \"helpText\"))}}\n {{#if (has-block \"helpText\")}}\n <EuiFormHelpText id=\"{{rowId}}-help\" class={{@helpTextClasses}}>\n {{yield to=\"helpText\"}}\n </EuiFormHelpText>\n {{else}}\n {{#let (if (isArray @helpText) @helpText (array @helpText)) as |helpTexts|}}\n {{#each helpTexts as |helpText i|}}\n <EuiFormHelpText id=\"{{rowId}}-help-{{i}}\" class={{@helpTextClasses}}>\n {{helpText}}\n </EuiFormHelpText>\n {{/each}}\n {{/let}}\n {{/if}}\n {{/if}}\n </div>\n </div>\n {{/if}}\n {{/let}}\n", {
22
22
  strictMode: true,
23
23
  scope: () => ({
24
24
  classNames,
@@ -1 +1 @@
1
- {"version":3,"file":"eui-form-row.js","sources":["../../src/components/eui-form-row.gts"],"sourcesContent":["import { helper } from '@ember/component/helper';\nimport { fn } from '@ember/helper';\nimport { array } from '@ember/helper';\nimport { on } from '@ember/modifier';\n\nimport { and, eq, gt,not, or } from 'ember-truth-helpers';\nimport isArray from 'ember-truth-helpers/helpers/is-array';\n\nimport randomId from '../-private/random-id.ts';\nimport argOrDefault from '../helpers/arg-or-default.ts';\nimport classNames from '../helpers/class-names.ts';\nimport useState from '../helpers/use-state.ts';\nimport EuiFormErrorText from './eui-form-error-text.gts';\nimport EuiFormHelpText from './eui-form-help-text.gts';\nimport EuiFormLabel from './eui-form-label.gts';\n\nimport type { displayMappingToClassMapping } from '../utils/css-mappings/eui-form-row.ts';\nimport type { TemplateOnlyComponent } from '@ember/component/template-only';\n\nexport interface EuiFormRowSignature {\n Element: HTMLDivElement | HTMLFieldSetElement;\n Args: {\n label?: string;\n labelAppend?: string;\n labelType?: 'label' | 'legend';\n legendType?: 'legend' | 'fieldset';\n fullWidth?: boolean;\n isInvalid?: boolean;\n isDisabled?: boolean;\n hasEmptyLabelSpace?: boolean;\n hasChildLabel?: boolean;\n isFakeLabelBlock?: boolean;\n helpText?: string;\n error?: string | string[] | null;\n errorClasses?: string;\n helpTextClasses?: string;\n id?: string;\n display?: keyof typeof displayMappingToClassMapping;\n extra?: unknown;\n };\n Blocks: {\n default: [];\n label: [string?];\n field: [];\n errors: [string?];\n helpText: [];\n };\n}\n\nexport function startsWith(\n [needle, word]: [string, string | undefined] /*, hash*/\n): boolean {\n return word?.startsWith(needle) || false;\n}\n\nconst startWith = helper(startsWith);\n\nconst EuiFormRow: TemplateOnlyComponent<EuiFormRowSignature> = <template>\n {{#let\n (classNames\n \"euiFormRow\"\n (if @hasEmptyLabelSpace \"euiFormRow--hasEmptyLabelSpace\")\n (if @fullWidth \"euiFormRow--fullWidth\")\n componentName=\"EuiFormRow\"\n display=@display\n )\n (classNames\n \"euiFormRow__fieldWrapper\"\n (if (startWith \"center\" @display) \"euiFormRow__fieldWrapperDisplayOnly\")\n )\n (if (isArray @error) @error (array @error))\n (and @label (eq @labelType \"legend\"))\n (useState false)\n (argOrDefault @id (randomId))\n (argOrDefault @hasChildLabel true)\n (and (not (argOrDefault @isFakeLabelBlock false)) (has-block \"label\"))\n as |classes fieldWrapperClasses errors isLegend focusedState rowId hasChildLabel hasLabelBlock|\n }}\n {{#if (eq @legendType \"legend\")}}\n <fieldset class={{classes}} id=\"{{rowId}}-row\" ...attributes>\n {{#if (or @label @labelAppend hasLabelBlock)}}\n <div class=\"euiFormRow__labelWrapper\">\n {{#if isLegend}}\n {{#if hasLabelBlock}}\n <EuiFormLabel\n class=\"euiFormRow__label\"\n for={{rowId}}\n aria-invalid={{@isInvalid}}\n @isInvalid={{@isInvalid}}\n @type={{@labelType}}\n >\n {{yield @label to=\"label\"}}\n </EuiFormLabel>\n {{else}}\n <EuiFormLabel\n class=\"euiFormRow__label\"\n for={{rowId}}\n aria-invalid={{@isInvalid}}\n @isInvalid={{@isInvalid}}\n @type={{@labelType}}\n >\n {{@label}}\n </EuiFormLabel>\n {{/if}}\n {{else if hasLabelBlock}}\n <EuiFormLabel\n class=\"euiFormRow__label\"\n aria-invalid={{@isInvalid}}\n for={{if hasChildLabel rowId}}\n @isInvalid={{@isInvalid}}\n @type={{@labelType}}\n @isFocused={{and\n (not @isDisabled)\n (not isLegend)\n focusedState.value\n }}\n >\n {{yield @label to=\"label\"}}\n </EuiFormLabel>\n {{else}}\n <EuiFormLabel\n class=\"euiFormRow__label\"\n aria-invalid={{@isInvalid}}\n for={{if hasChildLabel rowId}}\n @isInvalid={{@isInvalid}}\n @type={{@labelType}}\n @isFocused={{and\n (not @isDisabled)\n (not isLegend)\n focusedState.value\n }}\n >\n {{@label}}\n </EuiFormLabel>\n {{/if}}\n </div>\n {{/if}}\n <div\n class={{fieldWrapperClasses}}\n {{on \"focusin\" (fn focusedState.setState true)}}\n {{on \"focusout\" (fn focusedState.setState false)}}\n >\n {{#if (has-block \"field\")}}\n {{yield to=\"field\"}}\n {{else}}\n {{yield}}\n {{/if}}\n {{#if\n (or\n (and (has-block \"errors\") @isInvalid)\n (and (gt errors.length 0) @isInvalid)\n )\n }}\n {{#if (has-block \"errors\")}}\n {{#each errors as |error i|}}\n <EuiFormErrorText\n class=\"euiFormRow__text {{@errorClasses}}\"\n id=\"{{rowId}}-error-{{i}}\"\n >\n {{!@glint-ignore}}\n {{yield error to=\"errors\"}}\n </EuiFormErrorText>\n {{/each}}\n {{else}}\n {{#each errors as |error i|}}\n <EuiFormErrorText\n class=\"euiFormRow__text {{@errorClasses}}\"\n id=\"{{rowId}}-error-{{i}}\"\n >\n {{!@glint-ignore}}\n {{error}}\n </EuiFormErrorText>\n {{/each}}\n {{/if}}\n {{/if}}\n {{#if (or @helpText (has-block \"helpText\"))}}\n {{#if (has-block \"helpText\")}}\n <EuiFormHelpText id=\"{{rowId}}-help\" class={{@helpTextClasses}}>\n {{yield to=\"helpText\"}}\n </EuiFormHelpText>\n {{else}}\n <EuiFormHelpText id=\"{{rowId}}-help\" class={{@helpTextClasses}}>\n {{@helpText}}\n </EuiFormHelpText>\n {{/if}}\n {{/if}}\n </div>\n </fieldset>\n {{else}}\n <div class={{classes}} id=\"{{rowId}}-row\" ...attributes>\n {{#if (or @label @labelAppend hasLabelBlock)}}\n <div class=\"euiFormRow__labelWrapper\">\n {{#if isLegend}}\n {{#if hasLabelBlock}}\n <EuiFormLabel\n class=\"euiFormRow__label\"\n for={{rowId}}\n aria-invalid={{@isInvalid}}\n @isInvalid={{@isInvalid}}\n @type={{@labelType}}\n >\n {{yield @label to=\"label\"}}\n </EuiFormLabel>\n {{else}}\n <EuiFormLabel\n class=\"euiFormRow__label\"\n for={{rowId}}\n aria-invalid={{@isInvalid}}\n @isInvalid={{@isInvalid}}\n @type={{@labelType}}\n >\n {{@label}}\n </EuiFormLabel>\n {{/if}}\n {{else if hasLabelBlock}}\n <EuiFormLabel\n class=\"euiFormRow__label\"\n aria-invalid={{@isInvalid}}\n for={{if hasChildLabel rowId}}\n @isInvalid={{@isInvalid}}\n @type={{@labelType}}\n @isFocused={{and\n (not @isDisabled)\n (not isLegend)\n focusedState.value\n }}\n >\n {{yield @label to=\"label\"}}\n </EuiFormLabel>\n {{else}}\n <EuiFormLabel\n class=\"euiFormRow__label\"\n aria-invalid={{@isInvalid}}\n for={{if hasChildLabel rowId}}\n @isInvalid={{@isInvalid}}\n @type={{@labelType}}\n @isFocused={{and\n (not @isDisabled)\n (not isLegend)\n focusedState.value\n }}\n >\n {{@label}}\n </EuiFormLabel>\n {{/if}}\n </div>\n {{/if}}\n <div\n class={{fieldWrapperClasses}}\n {{on \"focusin\" (fn focusedState.setState true)}}\n {{on \"focusout\" (fn focusedState.setState false)}}\n >\n {{#if (has-block \"field\")}}\n {{yield to=\"field\"}}\n {{else}}\n {{yield}}\n {{/if}}\n {{#if\n (or\n (and (has-block \"errors\") @isInvalid)\n (and (gt errors.length 0) @isInvalid)\n )\n }}\n {{#if (has-block \"errors\")}}\n {{#each errors as |error i|}}\n <EuiFormErrorText\n class=\"euiFormRow__text {{@errorClasses}}\"\n id=\"{{rowId}}-error-{{i}}\"\n >\n {{!@glint-ignore}}\n {{yield error to=\"errors\"}}\n </EuiFormErrorText>\n {{/each}}\n {{else}}\n {{#each errors as |error i|}}\n <EuiFormErrorText\n class=\"euiFormRow__text {{@errorClasses}}\"\n id=\"{{rowId}}-error-{{i}}\"\n >\n {{!@glint-ignore}}\n {{error}}\n </EuiFormErrorText>\n {{/each}}\n {{/if}}\n {{/if}}\n {{#if (or @helpText (has-block \"helpText\"))}}\n {{#if (has-block \"helpText\")}}\n <EuiFormHelpText id=\"{{rowId}}-help\" class={{@helpTextClasses}}>\n {{yield to=\"helpText\"}}\n </EuiFormHelpText>\n {{else}}\n {{#let\n (if (isArray @helpText) @helpText (array @helpText))\n as |helpTexts|\n }}\n {{#each helpTexts as |helpText i|}}\n <EuiFormHelpText\n id=\"{{rowId}}-help-{{i}}\"\n class={{@helpTextClasses}}\n >\n {{helpText}}\n </EuiFormHelpText>\n {{/each}}\n {{/let}}\n {{/if}}\n {{/if}}\n </div>\n </div>\n {{/if}}\n {{/let}}\n</template>;\n\nexport default EuiFormRow;\n"],"names":["startsWith","needle","word","startWith","helper","EuiFormRow","setComponentTemplate","precompileTemplate","strictMode","scope","classNames","isArray","array","and","eq","useState","argOrDefault","randomId","not","or","EuiFormLabel","on","fn","gt","EuiFormErrorText","EuiFormHelpText","templateOnly"],"mappings":";;;;;;;;;;;;;;;;AAiDO,SAASA,UAAAA,CACd,CAACC,MAAA,EAAQC,IAAQ,CAA2B,EACpC;AACR,EAAA,OAAOA,IAAA,EAAMF,WAAWC,MAAW,CAAA,IAAA,KAAA;AACrC;AAEA,MAAME,YAAYC,MAAO,CAAAJ,UAAA,CAAA;AAEzB,MAAMK,UAAyD,GAAAC,oBAAA,CAAAC,kBAAA,CA6P/D,y4NAAA,EAAA;EAAAC,UAAA,EAAA,IAAA;AAAAC,EAAAA,KAAA,EAAAA,OAAA;IAAAC,UAAA;IAAAP,SAAA;IAAAQ,OAAA;IAAAC,KAAA;IAAAC,GAAA;IAAAC,EAAA;IAAAC,QAAA;IAAAC,YAAA;IAAAC,QAAA;IAAAC,GAAA;IAAAC,EAAA;IAAAC,YAAA;IAAAC,EAAA;IAAAC,EAAA;IAAAC,EAAA;IAAAC,gBAAA;AAAAC,IAAAA;AAAA,GAAA;AAAU,CAAA,CAAA,EAAAC,YAAA,EAAA;;;;"}
1
+ {"version":3,"file":"eui-form-row.js","sources":["../../src/components/eui-form-row.gts"],"sourcesContent":["import { helper } from '@ember/component/helper';\nimport { fn } from '@ember/helper';\nimport { array } from '@ember/helper';\nimport { on } from '@ember/modifier';\n\nimport { and, eq, gt, not, or } from 'ember-truth-helpers';\nimport isArray from 'ember-truth-helpers/helpers/is-array';\n\nimport randomId from '../-private/random-id.ts';\nimport argOrDefault from '../helpers/arg-or-default.ts';\nimport classNames from '../helpers/class-names.ts';\nimport useState from '../helpers/use-state.ts';\nimport EuiFormErrorText from './eui-form-error-text.gts';\nimport EuiFormHelpText from './eui-form-help-text.gts';\nimport EuiFormLabel from './eui-form-label.gts';\n\nimport type { displayMappingToClassMapping } from '../utils/css-mappings/eui-form-row.ts';\nimport type { TemplateOnlyComponent } from '@ember/component/template-only';\n\nexport interface EuiFormRowSignature {\n Element: HTMLDivElement | HTMLFieldSetElement;\n Args: {\n label?: string;\n labelAppend?: string;\n labelType?: 'label' | 'legend';\n legendType?: 'legend' | 'fieldset';\n fullWidth?: boolean;\n isInvalid?: boolean;\n isDisabled?: boolean;\n hasEmptyLabelSpace?: boolean;\n hasChildLabel?: boolean;\n isFakeLabelBlock?: boolean;\n isFakeHelpTextBlock?: boolean;\n helpText?: string;\n error?: string | string[] | null;\n errorClasses?: string;\n helpTextClasses?: string;\n id?: string;\n display?: keyof typeof displayMappingToClassMapping;\n extra?: unknown;\n };\n Blocks: {\n default: [];\n label: [string?];\n field: [];\n errors: [string?];\n helpText: [string?];\n };\n}\n\nexport function startsWith(\n [needle, word]: [string, string | undefined] /*, hash*/\n): boolean {\n return word?.startsWith(needle) || false;\n}\n\nconst startWith = helper(startsWith);\n\nconst EuiFormRow: TemplateOnlyComponent<EuiFormRowSignature> =\n <template>\n {{#let\n (classNames\n \"euiFormRow\"\n (if @hasEmptyLabelSpace \"euiFormRow--hasEmptyLabelSpace\")\n (if @fullWidth \"euiFormRow--fullWidth\")\n componentName=\"EuiFormRow\"\n display=@display\n )\n (classNames\n \"euiFormRow__fieldWrapper\"\n (if (startWith \"center\" @display) \"euiFormRow__fieldWrapperDisplayOnly\")\n )\n (if (isArray @error) @error (array @error))\n (and @label (eq @labelType \"legend\"))\n (useState false)\n (argOrDefault @id (randomId))\n (argOrDefault @hasChildLabel true)\n (and (not (argOrDefault @isFakeLabelBlock false)) (has-block \"label\"))\n (and (not (argOrDefault @isFakeHelpTextBlock false)) (has-block \"helpText\"))\n as |classes fieldWrapperClasses errors isLegend focusedState rowId hasChildLabel hasLabelBlock hasHelpTextBlock|\n }}\n {{#if (eq @legendType \"legend\")}}\n <fieldset class={{classes}} id=\"{{rowId}}-row\" ...attributes>\n {{#if (or @label @labelAppend hasLabelBlock)}}\n <div class=\"euiFormRow__labelWrapper\">\n {{#if isLegend}}\n {{#if hasLabelBlock}}\n <EuiFormLabel\n class=\"euiFormRow__label\"\n for={{rowId}}\n aria-invalid={{@isInvalid}}\n @isInvalid={{@isInvalid}}\n @type={{@labelType}}\n >\n {{yield @label to=\"label\"}}\n </EuiFormLabel>\n {{else}}\n <EuiFormLabel\n class=\"euiFormRow__label\"\n for={{rowId}}\n aria-invalid={{@isInvalid}}\n @isInvalid={{@isInvalid}}\n @type={{@labelType}}\n >\n {{@label}}\n </EuiFormLabel>\n {{/if}}\n {{else if hasLabelBlock}}\n <EuiFormLabel\n class=\"euiFormRow__label\"\n aria-invalid={{@isInvalid}}\n for={{if hasChildLabel rowId}}\n @isInvalid={{@isInvalid}}\n @type={{@labelType}}\n @isFocused={{and\n (not @isDisabled)\n (not isLegend)\n focusedState.value\n }}\n >\n {{yield @label to=\"label\"}}\n </EuiFormLabel>\n {{else}}\n <EuiFormLabel\n class=\"euiFormRow__label\"\n aria-invalid={{@isInvalid}}\n for={{if hasChildLabel rowId}}\n @isInvalid={{@isInvalid}}\n @type={{@labelType}}\n @isFocused={{and\n (not @isDisabled)\n (not isLegend)\n focusedState.value\n }}\n >\n {{@label}}\n </EuiFormLabel>\n {{/if}}\n </div>\n {{/if}}\n <div\n class={{fieldWrapperClasses}}\n {{on \"focusin\" (fn focusedState.setState true)}}\n {{on \"focusout\" (fn focusedState.setState false)}}\n >\n {{#if (has-block \"field\")}}\n {{yield to=\"field\"}}\n {{else}}\n {{yield}}\n {{/if}}\n {{#if\n (or\n (and (has-block \"errors\") @isInvalid)\n (and (gt errors.length 0) @isInvalid)\n )\n }}\n {{#if (has-block \"errors\")}}\n {{#each errors as |error i|}}\n <EuiFormErrorText\n class=\"euiFormRow__text {{@errorClasses}}\"\n id=\"{{rowId}}-error-{{i}}\"\n >\n {{!@glint-ignore}}\n {{yield error to=\"errors\"}}\n </EuiFormErrorText>\n {{/each}}\n {{else}}\n {{#each errors as |error i|}}\n <EuiFormErrorText\n class=\"euiFormRow__text {{@errorClasses}}\"\n id=\"{{rowId}}-error-{{i}}\"\n >\n {{!@glint-ignore}}\n {{error}}\n </EuiFormErrorText>\n {{/each}}\n {{/if}}\n {{/if}}\n {{#if (or @helpText hasHelpTextBlock)}}\n {{#if hasHelpTextBlock}}\n <EuiFormHelpText id=\"{{rowId}}-help\" class={{@helpTextClasses}}>\n {{yield @helpText to=\"helpText\"}}\n </EuiFormHelpText>\n {{else}}\n <EuiFormHelpText id=\"{{rowId}}-help\" class={{@helpTextClasses}}>\n {{@helpText}}\n </EuiFormHelpText>\n {{/if}}\n {{/if}}\n </div>\n </fieldset>\n {{else}}\n <div class={{classes}} id=\"{{rowId}}-row\" ...attributes>\n {{#if (or @label @labelAppend hasLabelBlock)}}\n <div class=\"euiFormRow__labelWrapper\">\n {{#if isLegend}}\n {{#if hasLabelBlock}}\n <EuiFormLabel\n class=\"euiFormRow__label\"\n for={{rowId}}\n aria-invalid={{@isInvalid}}\n @isInvalid={{@isInvalid}}\n @type={{@labelType}}\n >\n {{yield @label to=\"label\"}}\n </EuiFormLabel>\n {{else}}\n <EuiFormLabel\n class=\"euiFormRow__label\"\n for={{rowId}}\n aria-invalid={{@isInvalid}}\n @isInvalid={{@isInvalid}}\n @type={{@labelType}}\n >\n {{@label}}\n </EuiFormLabel>\n {{/if}}\n {{else if hasLabelBlock}}\n <EuiFormLabel\n class=\"euiFormRow__label\"\n aria-invalid={{@isInvalid}}\n for={{if hasChildLabel rowId}}\n @isInvalid={{@isInvalid}}\n @type={{@labelType}}\n @isFocused={{and\n (not @isDisabled)\n (not isLegend)\n focusedState.value\n }}\n >\n {{yield @label to=\"label\"}}\n </EuiFormLabel>\n {{else}}\n <EuiFormLabel\n class=\"euiFormRow__label\"\n aria-invalid={{@isInvalid}}\n for={{if hasChildLabel rowId}}\n @isInvalid={{@isInvalid}}\n @type={{@labelType}}\n @isFocused={{and\n (not @isDisabled)\n (not isLegend)\n focusedState.value\n }}\n >\n {{@label}}\n </EuiFormLabel>\n {{/if}}\n </div>\n {{/if}}\n <div\n class={{fieldWrapperClasses}}\n {{on \"focusin\" (fn focusedState.setState true)}}\n {{on \"focusout\" (fn focusedState.setState false)}}\n >\n {{#if (has-block \"field\")}}\n {{yield to=\"field\"}}\n {{else}}\n {{yield}}\n {{/if}}\n {{#if\n (or\n (and (has-block \"errors\") @isInvalid)\n (and (gt errors.length 0) @isInvalid)\n )\n }}\n {{#if (has-block \"errors\")}}\n {{#each errors as |error i|}}\n <EuiFormErrorText\n class=\"euiFormRow__text {{@errorClasses}}\"\n id=\"{{rowId}}-error-{{i}}\"\n >\n {{!@glint-ignore}}\n {{yield error to=\"errors\"}}\n </EuiFormErrorText>\n {{/each}}\n {{else}}\n {{#each errors as |error i|}}\n <EuiFormErrorText\n class=\"euiFormRow__text {{@errorClasses}}\"\n id=\"{{rowId}}-error-{{i}}\"\n >\n {{!@glint-ignore}}\n {{error}}\n </EuiFormErrorText>\n {{/each}}\n {{/if}}\n {{/if}}\n {{#if (or @helpText (has-block \"helpText\"))}}\n {{#if (has-block \"helpText\")}}\n <EuiFormHelpText id=\"{{rowId}}-help\" class={{@helpTextClasses}}>\n {{yield to=\"helpText\"}}\n </EuiFormHelpText>\n {{else}}\n {{#let\n (if (isArray @helpText) @helpText (array @helpText))\n as |helpTexts|\n }}\n {{#each helpTexts as |helpText i|}}\n <EuiFormHelpText\n id=\"{{rowId}}-help-{{i}}\"\n class={{@helpTextClasses}}\n >\n {{helpText}}\n </EuiFormHelpText>\n {{/each}}\n {{/let}}\n {{/if}}\n {{/if}}\n </div>\n </div>\n {{/if}}\n {{/let}}\n</template>;\n\nexport default EuiFormRow;\n"],"names":["startsWith","needle","word","startWith","helper","EuiFormRow","setComponentTemplate","precompileTemplate","strictMode","scope","classNames","isArray","array","and","eq","useState","argOrDefault","randomId","not","or","EuiFormLabel","on","fn","gt","EuiFormErrorText","EuiFormHelpText","templateOnly"],"mappings":";;;;;;;;;;;;;;;;AAkDO,SAASA,UAAAA,CACd,CAACC,MAAA,EAAQC,IAAQ,CAA2B,EACpC;AACR,EAAA,OAAOA,IAAA,EAAMF,WAAWC,MAAW,CAAA,IAAA,KAAA;AACrC;AAEA,MAAME,YAAYC,MAAO,CAAAJ,UAAA,CAAA;AAEzB,MAAMK,UACJ,GAAAC,oBAAA,CAAAC,kBAAA,CA8PF,m+NAAA,EAAA;EAAAC,UAAA,EAAA,IAAA;AAAAC,EAAAA,KAAA,EAAAA,OAAA;IAAAC,UAAA;IAAAP,SAAA;IAAAQ,OAAA;IAAAC,KAAA;IAAAC,GAAA;IAAAC,EAAA;IAAAC,QAAA;IAAAC,YAAA;IAAAC,QAAA;IAAAC,GAAA;IAAAC,EAAA;IAAAC,YAAA;IAAAC,EAAA;IAAAC,EAAA;IAAAC,EAAA;IAAAC,gBAAA;AAAAC,IAAAA;AAAA,GAAA;AAAU,CAAA,CAAA,EAAAC,YAAA,EAAA;;;;"}
@@ -32,8 +32,14 @@ class EuiMarkdownEditorToolbarComponent extends Component {
32
32
  static {
33
33
  n(this.prototype, "processor", [cached]);
34
34
  }
35
+ get shouldIncludeDefaultRootClasses() {
36
+ return this.args.shouldIncludeDefaultRootClasses ?? true;
37
+ }
35
38
  get rootClasses() {
36
- let baseClasses = ['euiMarkdownFormat', 'euiText', 'euiText--medium'];
39
+ let baseClasses = ['euiMarkdownFormat'];
40
+ if (this.shouldIncludeDefaultRootClasses) {
41
+ baseClasses = baseClasses.concat(['euiText', 'euiText--medium']);
42
+ }
37
43
  if (this.args.rootClasses) {
38
44
  let rootClasses = isArray(this.args.rootClasses) ? this.args.rootClasses : this.args.rootClasses?.trim()?.split(' ') || [];
39
45
  baseClasses = baseClasses.concat(rootClasses);
@@ -1 +1 @@
1
- {"version":3,"file":"eui-markdown-format.js","sources":["../../src/components/eui-markdown-format.gts"],"sourcesContent":["import Component from '@glimmer/component';\nimport { cached } from '@glimmer/tracking';\nimport { isArray } from '@ember/array';\nimport { EnsureSafeComponentHelper } from '@embroider/util';\n\nimport optional from '@nullvoxpopuli/ember-composable-helpers/helpers/optional';\nimport unified from 'unified';\n\nimport {\n defaultParsingPlugins,\n defaultProcessingPlugins\n} from '../utils/markdown/plugins/markdown-default-plugins/index.ts';\nimport { toDOM } from '../utils/markdown/plugins/to-dom.ts';\n\nimport type {\n EuiMarkdownAstNodePosition,\n RehypeNode\n} from '../utils/markdown/markdown-types';\nimport type { Processor } from 'unified';\n\nexport type Replacer = (\n position: EuiMarkdownAstNodePosition,\n str: string\n) => void;\n\nexport interface EuiMarkdownFormatSignature {\n parsingPluginList?: typeof defaultParsingPlugins;\n processingPluginList?: typeof defaultProcessingPlugins;\n replaceNode?: Replacer;\n value: string;\n //you can pass in a string or an array of strings to be added to the root element\n rootClasses?: string | string[];\n}\n\nexport default class EuiMarkdownEditorToolbarComponent extends Component<EuiMarkdownFormatSignature> {\n get parsingPluginList() {\n return this.args.parsingPluginList || defaultParsingPlugins;\n }\n\n get processingPluginList() {\n return this.args.processingPluginList || defaultProcessingPlugins;\n }\n\n @cached\n get processor() {\n const Compiler = (tree: any) => {\n return tree;\n };\n\n function identityCompiler(this: Processor) {\n //eslint-disable-next-line\n this.Compiler = Compiler;\n }\n\n return unified()\n .use(this.parsingPluginList)\n .use(this.processingPluginList)\n .use(identityCompiler);\n }\n\n get rootClasses(): string[] {\n let baseClasses = ['euiMarkdownFormat', 'euiText', 'euiText--medium'];\n\n if (this.args.rootClasses) {\n let rootClasses = isArray(this.args.rootClasses)\n ? this.args.rootClasses\n : (this.args.rootClasses as string)?.trim()?.split(' ') || [];\n\n baseClasses = baseClasses.concat(rootClasses);\n }\n\n return baseClasses;\n }\n\n @cached\n get result() {\n try {\n const processed = this.processor.processSync(this.args.value);\n\n return toDOM(processed['result'] as RehypeNode, {\n rootClasses: this.rootClasses\n });\n //eslint-disable-next-line\n } catch (e) {\n console.warn(e);\n }\n\n return null;\n }\n\n <template>\n {{! This hbs was inspired by https://github.com/ampatspell/ember-cli-remark-static/blob/v3.0.5/addon/components/remark.hbs }}\n {{#if this.result}}\n {{this.result.element}}\n {{#each this.result.components as |CompNode|}}\n {{#in-element CompNode.element}}\n {{#if CompNode.componentName}}\n {{#let\n (component (EnsureSafeComponentHelper CompNode.componentName))\n as |DynamicComponent|\n }}\n <DynamicComponent\n @replaceNode={{optional @replaceNode}}\n @node={{CompNode}}\n />\n {{/let}}\n {{/if}}\n {{/in-element}}\n {{/each}}\n {{/if}}\n </template>\n}\n"],"names":["EuiMarkdownEditorToolbarComponent","Component","parsingPluginList","args","defaultParsingPlugins","processingPluginList","defaultProcessingPlugins","processor","Compiler","tree","identityCompiler","unified","use","n","prototype","cached","rootClasses","baseClasses","isArray","trim","split","concat","result","processed","processSync","value","toDOM","e","console","warn","setComponentTemplate","precompileTemplate","strictMode","scope","EnsureSafeComponentHelper","optional"],"mappings":";;;;;;;;;;;;;;AAkCe,MAAMA,0CAA0CC,SAAU,CAAA;EACvE,IAAIC,iBAAoBA,GAAA;AACtB,IAAA,OAAO,IAAI,CAACC,IAAI,CAACD,iBAAiB,IAAIE,qBAAA;AACxC;EAEA,IAAIC,oBAAuBA,GAAA;AACzB,IAAA,OAAO,IAAI,CAACF,IAAI,CAACE,oBAAoB,IAAIC,wBAAA;AAC3C;EAEA,IACIC,SAAYA,GAAA;IACd,MAAMC,QAAA,GAAYC,IAAS,IAAA;AACzB,MAAA,OAAOA,IAAA;KACT;IAEA,SAASC,gBAAAA,GAAgC;AACvC;MACA,IAAI,CAACF,QAAQ,GAAGA,QAAA;AAClB;IAEA,OAAOG,OACJ,EAAA,CAAAC,GAAG,CAAC,IAAI,CAACV,iBAAiB,CAAA,CAC1BU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AA,KAAA,EAAAA,OAAA;QAAAC,yBAAA;AAAAC,QAAAA;AAAA,OAAA;KAAU,CAAA,EAAV,IAAW,CAAA;AAAD;AACZ;;;;"}
1
+ {"version":3,"file":"eui-markdown-format.js","sources":["../../src/components/eui-markdown-format.gts"],"sourcesContent":["import Component from '@glimmer/component';\nimport { cached } from '@glimmer/tracking';\nimport { isArray } from '@ember/array';\nimport { EnsureSafeComponentHelper } from '@embroider/util';\n\nimport optional from '@nullvoxpopuli/ember-composable-helpers/helpers/optional';\nimport unified from 'unified';\n\nimport {\n defaultParsingPlugins,\n defaultProcessingPlugins\n} from '../utils/markdown/plugins/markdown-default-plugins/index.ts';\nimport { toDOM } from '../utils/markdown/plugins/to-dom.ts';\n\nimport type {\n EuiMarkdownAstNodePosition,\n RehypeNode\n} from '../utils/markdown/markdown-types';\nimport type { Processor } from 'unified';\n\nexport type Replacer = (\n position: EuiMarkdownAstNodePosition,\n str: string\n) => void;\n\nexport interface EuiMarkdownFormatSignature {\n parsingPluginList?: typeof defaultParsingPlugins;\n processingPluginList?: typeof defaultProcessingPlugins;\n replaceNode?: Replacer;\n value: string;\n //you can pass in a string or an array of strings to be added to the root element\n rootClasses?: string | string[];\n shouldIncludeDefaultRootClasses?: boolean;\n}\n\nexport default class EuiMarkdownEditorToolbarComponent extends Component<EuiMarkdownFormatSignature> {\n get parsingPluginList() {\n return this.args.parsingPluginList || defaultParsingPlugins;\n }\n\n get processingPluginList() {\n return this.args.processingPluginList || defaultProcessingPlugins;\n }\n\n @cached\n get processor() {\n const Compiler = (tree: any) => {\n return tree;\n };\n\n function identityCompiler(this: Processor) {\n //eslint-disable-next-line\n this.Compiler = Compiler;\n }\n\n return unified()\n .use(this.parsingPluginList)\n .use(this.processingPluginList)\n .use(identityCompiler);\n }\n\n get shouldIncludeDefaultRootClasses() {\n return this.args.shouldIncludeDefaultRootClasses ?? true;\n }\n\n get rootClasses(): string[] {\n let baseClasses = ['euiMarkdownFormat'];\n\n if (this.shouldIncludeDefaultRootClasses) {\n baseClasses = baseClasses.concat(['euiText', 'euiText--medium']);\n }\n\n if (this.args.rootClasses) {\n let rootClasses = isArray(this.args.rootClasses)\n ? this.args.rootClasses\n : (this.args.rootClasses as string)?.trim()?.split(' ') || [];\n\n baseClasses = baseClasses.concat(rootClasses);\n }\n\n return baseClasses;\n }\n\n @cached\n get result() {\n try {\n const processed = this.processor.processSync(this.args.value);\n\n return toDOM(processed['result'] as RehypeNode, {\n rootClasses: this.rootClasses\n });\n //eslint-disable-next-line\n } catch (e) {\n console.warn(e);\n }\n\n return null;\n }\n\n <template>\n {{! This hbs was inspired by https://github.com/ampatspell/ember-cli-remark-static/blob/v3.0.5/addon/components/remark.hbs }}\n {{#if this.result}}\n {{this.result.element}}\n {{#each this.result.components as |CompNode|}}\n {{#in-element CompNode.element}}\n {{#if CompNode.componentName}}\n {{#let\n (component (EnsureSafeComponentHelper CompNode.componentName))\n as |DynamicComponent|\n }}\n <DynamicComponent\n @replaceNode={{optional @replaceNode}}\n @node={{CompNode}}\n />\n {{/let}}\n {{/if}}\n {{/in-element}}\n {{/each}}\n {{/if}}\n </template>\n}\n"],"names":["EuiMarkdownEditorToolbarComponent","Component","parsingPluginList","args","defaultParsingPlugins","processingPluginList","defaultProcessingPlugins","processor","Compiler","tree","identityCompiler","unified","use","n","prototype","cached","shouldIncludeDefaultRootClasses","rootClasses","baseClasses","concat","isArray","trim","split","result","processed","processSync","value","toDOM","e","console","warn","setComponentTemplate","precompileTemplate","strictMode","scope","EnsureSafeComponentHelper","optional"],"mappings":";;;;;;;;;;;;;;AAmCe,MAAMA,0CAA0CC,SAAU,CAAA;EACvE,IAAIC,iBAAoBA,GAAA;AACtB,IAAA,OAAO,IAAI,CAACC,IAAI,CAACD,iBAAiB,IAAIE,qBAAA;AACxC;EAEA,IAAIC,oBAAuBA,GAAA;AACzB,IAAA,OAAO,IAAI,CAACF,IAAI,CAACE,oBAAoB,IAAIC,wBAAA;AAC3C;EAEA,IACIC,SAAYA,G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AA;AAE5D,MAAA,OAAOC,KAAM,CAAAH,SAAS,CAAC,QAAA,CAAS,EAAgB;QAC9CP,WAAa,EAAA,IAAI,CAACA;AACpB,OAAA,CAAA;AACA;KACF,CAAE,OAAOW,CAAG,EAAA;AACVC,MAAAA,OAAA,CAAQC,IAAI,CAACF,CAAA,CAAA;AACf;AAEA,IAAA,OAAO,IAAA;AACT;AAAA,EAAA;IAAAf,CAAA,CAAA,IAAA,CAAAC,SAAA,EAAA,QAAA,EAAA,CAdCC,MAAA,CAAA,CAAA;AAAA;AAgBD,EAAA;IAAAgB,oBAAA,CAAAC,kBAAA,CAoBA,wnBAAA,EAAA;MAAAC,UAAA,EAAA,IAAA;AAAAC,MAAAA,KAAA,EAAAA,OAAA;QAAAC,yBAAA;AAAAC,QAAAA;AAAA,OAAA;KAAU,CAAA,EAAV,IAAW,CAAA;AAAD;AACZ;;;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"eui-step.js","sources":["../../src/components/eui-step.gts"],"sourcesContent":["import { eq } from 'ember-truth-helpers';\n\nimport argOrDefault from '../helpers/arg-or-default.ts';\nimport classNames from '../helpers/class-names.ts';\nimport EuiStepNumber from './eui-step-number.gts';\nimport EuiTitle from './eui-title.gts';\n\nimport type { EuiTitleSignature } from './eui-title';\nimport type { TemplateOnlyComponent } from '@ember/component/template-only';\n\nexport interface EuiStepSignature {\n Element: HTMLDivElement;\n Args: {\n step: number;\n title: string;\n status: 'incomplete' | 'complete' | 'disabled';\n titleSize: Exclude<EuiTitleSignature['Args']['size'], 'xxxs' | 'xxs' | 'l'>;\n headingElement: 'h1' | 'h2' | 'h3' | 'h4' | 'h5' | 'h6' | 'p';\n };\n Blocks: {\n default: [];\n };\n}\n\nconst EuiStep: TemplateOnlyComponent<EuiStepSignature> = <template>\n <div\n class={{classNames\n \"euiStep\"\n (if (eq @titleSize \"xs\") \"euiStep--small\")\n (if (eq @status \"disabled\") \"euiStep-isDisabled\")\n }}\n ...attributes\n >\n <div class=\"euiStep__titleWrapper\">\n <EuiStepNumber\n class={{classNames\n \"euiStep__circle\"\n (if (eq @titleSize \"xs\") \"euiStepNumber--small\")\n }}\n @number={{@step}}\n @status={{@status}}\n @titleSize={{argOrDefault @titleSize \"s\"}}\n @isHollow={{eq @status \"incomplete\"}}\n />\n <EuiTitle\n @size={{@titleSize}}\n @tagName={{argOrDefault @headingElement \"p\"}}\n class=\"euiStep__title\"\n >\n {{@title}}\n </EuiTitle>\n </div>\n <div class=\"euiStep__content\">\n {{yield}}\n </div>\n </div>\n</template>;\n\nexport default EuiStep;\n"],"names":["EuiStep","setComponentTemplate","precompileTemplate","strictMode","scope","classNames","eq","EuiStepNumber","argOrDefault","EuiTitle","templateOnly"],"mappings":";;;;;;;;;AAwBA,MAAMA,OAAmD,GAAAC,oBAAA,CAAAC,kBAAA,CAgCzD,8qBAAA,EAAA;EAAAC,UAAA,EAAA,IAAA;AAAAC,EAAAA,KAAA,EAAAA,OAAA;IAAAC,UAAA;IAAAC,EAAA;IAAAC,aAAA;IAAAC,YAAA;AAAAC,IAAAA;AAAA,GAAA;AAAU,CAAA,CAAA,EAAAC,YAAA,EAAA;;;;"}
1
+ {"version":3,"file":"eui-step.js","sources":["../../src/components/eui-step.gts"],"sourcesContent":["import { eq } from 'ember-truth-helpers';\n\nimport argOrDefault from '../helpers/arg-or-default.ts';\nimport classNames from '../helpers/class-names.ts';\nimport EuiStepNumber from './eui-step-number.gts';\nimport EuiTitle from './eui-title.gts';\n\nimport type { EuiTitleSignature } from './eui-title';\nimport type { TemplateOnlyComponent } from '@ember/component/template-only';\n\nexport interface EuiStepSignature {\n Element: HTMLDivElement;\n Args: {\n step: number;\n title: string;\n status?: 'incomplete' | 'complete' | 'disabled';\n titleSize?: Exclude<EuiTitleSignature['Args']['size'], 'xxxs' | 'xxs' | 'l'>;\n headingElement?: 'h1' | 'h2' | 'h3' | 'h4' | 'h5' | 'h6' | 'p';\n };\n Blocks: {\n default: [];\n };\n}\n\nconst EuiStep: TemplateOnlyComponent<EuiStepSignature> = <template>\n <div\n class={{classNames\n \"euiStep\"\n (if (eq @titleSize \"xs\") \"euiStep--small\")\n (if (eq @status \"disabled\") \"euiStep-isDisabled\")\n }}\n ...attributes\n >\n <div class=\"euiStep__titleWrapper\">\n <EuiStepNumber\n class={{classNames\n \"euiStep__circle\"\n (if (eq @titleSize \"xs\") \"euiStepNumber--small\")\n }}\n @number={{@step}}\n @status={{@status}}\n @titleSize={{argOrDefault @titleSize \"s\"}}\n @isHollow={{eq @status \"incomplete\"}}\n />\n <EuiTitle\n @size={{@titleSize}}\n @tagName={{argOrDefault @headingElement \"p\"}}\n class=\"euiStep__title\"\n >\n {{@title}}\n </EuiTitle>\n </div>\n <div class=\"euiStep__content\">\n {{yield}}\n </div>\n </div>\n</template>;\n\nexport default EuiStep;\n"],"names":["EuiStep","setComponentTemplate","precompileTemplate","strictMode","scope","classNames","eq","EuiStepNumber","argOrDefault","EuiTitle","templateOnly"],"mappings":";;;;;;;;;AAwBA,MAAMA,OAAmD,GAAAC,oBAAA,CAAAC,kBAAA,CAgCzD,8qBAAA,EAAA;EAAAC,UAAA,EAAA,IAAA;AAAAC,EAAAA,KAAA,EAAAA,OAAA;IAAAC,UAAA;IAAAC,EAAA;IAAAC,aAAA;IAAAC,YAAA;AAAAC,IAAAA;AAAA,GAAA;AAAU,CAAA,CAAA,EAAAC,YAAA,EAAA;;;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"eui-steps.js","sources":["../../src/components/eui-steps.gts"],"sourcesContent":["import type { TemplateOnlyComponent } from '@ember/component/template-only';\n\nexport interface EuiStepsSignature {\n Element: HTMLDivElement;\n Args: {\n steps: [];\n };\n Blocks: {\n default: [];\n };\n}\n\nconst EuiSteps: TemplateOnlyComponent<EuiStepsSignature> = <template>\n <div class=\"euiSteps\" ...attributes>\n {{yield}}\n </div>\n</template>;\n\nexport default EuiSteps;\n"],"names":["EuiSteps","setComponentTemplate","precompileTemplate","strictMode","templateOnly"],"mappings":";;;;AAYA,MAAMA,QAAqD,GAAAC,oBAAA,CAAAC,kBAAA,CAI3D,uEAAA,EAAA;EAAAC,UAAA,EAAA;AAAU,CAAA,CAAA,EAAAC,YAAA,EAAA;;;;"}
1
+ {"version":3,"file":"eui-steps.js","sources":["../../src/components/eui-steps.gts"],"sourcesContent":["import type { TemplateOnlyComponent } from '@ember/component/template-only';\n\nexport interface EuiStepsSignature {\n Element: HTMLDivElement;\n Args: {};\n Blocks: {\n default: [];\n };\n}\n\nconst EuiSteps: TemplateOnlyComponent<EuiStepsSignature> = <template>\n <div class=\"euiSteps\" ...attributes>\n {{yield}}\n </div>\n</template>;\n\nexport default EuiSteps;\n"],"names":["EuiSteps","setComponentTemplate","precompileTemplate","strictMode","templateOnly"],"mappings":";;;;AAUA,MAAMA,QAAqD,GAAAC,oBAAA,CAAAC,kBAAA,CAI3D,uEAAA,EAAA;EAAAC,UAAA,EAAA;AAAU,CAAA,CAAA,EAAAC,YAAA,EAAA;;;;"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ember-eui/core",
3
- "version": "12.0.2",
3
+ "version": "12.0.4",
4
4
  "description": "Ember Components for Elastic UI",
5
5
  "keywords": [
6
6
  "ember-addon",