@ember-eui/core 12.0.3 → 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.
@@ -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;QAC7B,aAAa,CAAC,EAAE,OAAO,CAAC;QACxB,gBAAgB,CAAC,EAAE,OAAO,CAAC;QAC3B,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,EAAE,CAAC;KACd,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,CAkWzD,CAAC;AAEH,eAAe,UAAU,CAAC"}
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;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"}
@@ -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,GAAG,CAAC,IAAI,CAACP,oBAAoB,CAAA,CAC7BO,GAAG,CAACF,gBAAA,CAAA;AACT;AAAA,EAAA;IAAAG,CAAA,CAAA,IAAA,CAAAC,SAAA,EAAA,WAAA,EAAA,CAfCC,MAAA,CAAA,CAAA;AAAA;EAiBD,IAAIC,WAAAA,GAAwB;IAC1B,IAAIC,WAAc,GAAA,CAAC,mBAAA,EAAqB,SAAA,EAAW,iBAAA,CAAkB;AAErE,IAAA,IAAI,IAAI,CAACd,IAAI,CAACa,WAAW,EAAE;AACzB,MAAA,IAAIA,WAAA,GAAcE,OAAQ,CAAA,IAAI,CAACf,IAAI,CAACa,WAAW,CAC3C,GAAA,IAAI,CAACb,IAAI,CAACa,WAAW,GACpB,IAAI,CAACb,IAAI,CAACa,WAAW,EAAaG,IAAA,EAAA,EAAQC,KAAM,CAAA,GAAA,CAAA,IAAQ,EAAE;AAE/DH,MAAAA,WAAc,GAAAA,WAAA,CAAYI,MAAM,CAACL,WAAA,CAAA;AACnC;AAEA,IAAA,OAAOC,WAAA;AACT;EAEA,IACIK,MAASA,GAAA;IACX,IAAI;AACF,MAAA,MAAMC,SAAA,GAAY,IAAI,CAAChB,SAAS,CAACiB,WAAW,CAAC,IAAI,CAACrB,IAAI,CAACsB,KAAK,CAAA;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;IAAAd,CAAA,CAAA,IAAA,CAAAC,SAAA,EAAA,QAAA,EAAA,CAdCC,MAAA,CAAA,CAAA;AAAA;AAgBD,EAAA;IAAAe,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
+ {"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,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,GAAG,CAAC,IAAI,CAACP,oBAAoB,CAAA,CAC7BO,GAAG,CAACF,gBAAA,CAAA;AACT;AAAA,EAAA;IAAAG,CAAA,CAAA,IAAA,CAAAC,SAAA,EAAA,WAAA,EAAA,CAfCC,MAAA,CAAA,CAAA;AAAA;EAiBD,IAAIC,+BAAkCA,GAAA;AACpC,IAAA,OAAO,IAAI,CAACb,IAAI,CAACa,+BAA+B,IAAI,IAAA;AACtD;EAEA,IAAIC,WAAAA,GAAwB;AAC1B,IAAA,IAAIC,WAAc,GAAA,CAAC,mBAAA,CAAoB;IAEvC,IAAI,IAAI,CAACF,+BAA+B,EAAE;MACxCE,WAAc,GAAAA,WAAA,CAAYC,MAAM,CAAC,CAAC,SAAA,EAAW,iBAAA,CAAkB,CAAA;AACjE;AAEA,IAAA,IAAI,IAAI,CAAChB,IAAI,CAACc,WAAW,EAAE;AACzB,MAAA,IAAIA,WAAA,GAAcG,OAAQ,CAAA,IAAI,CAACjB,IAAI,CAACc,WAAW,CAC3C,GAAA,IAAI,CAACd,IAAI,CAACc,WAAW,GACpB,IAAI,CAACd,IAAI,CAACc,WAAW,EAAaI,IAAA,EAAA,EAAQC,KAAM,CAAA,GAAA,CAAA,IAAQ,EAAE;AAE/DJ,MAAAA,WAAc,GAAAA,WAAA,CAAYC,MAAM,CAACF,WAAA,CAAA;AACnC;AAEA,IAAA,OAAOC,WAAA;AACT;EAEA,IACIK,MAASA,GAAA;IACX,IAAI;AACF,MAAA,MAAMC,SAAA,GAAY,IAAI,CAACjB,SAAS,CAACkB,WAAW,CAAC,IAAI,CAACtB,IAAI,CAACuB,KAAK,CAAA;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;;;;"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ember-eui/core",
3
- "version": "12.0.3",
3
+ "version": "12.0.4",
4
4
  "description": "Ember Components for Elastic UI",
5
5
  "keywords": [
6
6
  "ember-addon",