How to use the @elastic/eui.htmlIdGenerator function in @elastic/eui

To help you get started, we’ve selected a few @elastic/eui examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github elastic / kibana / src / legacy / core_plugins / vis_type_timeseries / public / components / series_config.js View on Github external
export const SeriesConfig = props => {
  const defaults = { offset_time: '', value_template: '' };
  const model = { ...defaults, ...props.model };
  const handleSelectChange = createSelectHandler(props.onChange);
  const handleTextChange = createTextHandler(props.onChange);
  const htmlId = htmlIdGenerator();
  const seriesIndexPattern =
    props.model.override_index_pattern && props.model.series_index_pattern
      ? props.model.series_index_pattern
      : props.indexPatternForQuery;

  return (
    <div>
      

      

      }
        fullWidth
      &gt;</div>
github elastic / kibana / src / core_plugins / metrics / public / components / panel_config / markdown.js View on Github external
render() {
    const defaults = { filter: '' };
    const model = { ...defaults, ...this.props.model };
    const { selectedTab } = this.state;
    const handleSelectChange = createSelectHandler(this.props.onChange);
    const handleTextChange = createTextHandler(this.props.onChange);
    const { intl } = this.props;

    const htmlId = htmlIdGenerator();

    const alignOptions = [
      {
        label: intl.formatMessage({ id: 'tsvb.markdown.alignOptions.topLabel', defaultMessage: 'Top' }),
        value: 'top'
      },
      {
        label: intl.formatMessage({ id: 'tsvb.markdown.alignOptions.middleLabel', defaultMessage: 'Middle' }),
        value: 'middle'
      },
      {
        label: intl.formatMessage({ id: 'tsvb.markdown.alignOptions.bottomLabel', defaultMessage: 'Bottom' }),
        value: 'bottom'
      }
    ];
    const selectedAlignOption = alignOptions.find(option => {
github elastic / kibana / src / legacy / core_plugins / vis_type_timeseries / public / components / data_format_picker.js View on Github external
render() {
    const htmlId = htmlIdGenerator();
    const value = this.props.value || '';
    let defaultValue = value;
    if (!_.includes(['bytes', 'number', 'percent'], value)) {
      defaultValue = 'custom';
    }
    if (isDuration(value)) {
      defaultValue = 'duration';
    }
    const { intl } = this.props;
    const options = [
      {
        label: intl.formatMessage({
          id: 'visTypeTimeseries.dataFormatPicker.bytesLabel',
          defaultMessage: 'Bytes',
        }),
        value: 'bytes',
github elastic / kibana / src / core_plugins / metrics / public / components / aggs / series_agg.js View on Github external
function SeriesAggUi(props) {
  const { panel, model, intl } = props;

  const handleChange = createChangeHandler(props.onChange, model);
  const handleSelectChange = createSelectHandler(handleChange);

  const htmlId = htmlIdGenerator();

  const functionOptions = [
    {
      label: intl.formatMessage({ id: 'tsvb.seriesAgg.functionOptions.sumLabel', defaultMessage: 'Sum' }),
      value: 'sum'
    },
    {
      label: intl.formatMessage({ id: 'tsvb.seriesAgg.functionOptions.maxLabel', defaultMessage: 'Max' }),
      value: 'max'
    },
    {
      label: intl.formatMessage({ id: 'tsvb.seriesAgg.functionOptions.minLabel', defaultMessage: 'Min' }),
      value: 'min'
    },
    {
      label: intl.formatMessage({ id: 'tsvb.seriesAgg.functionOptions.avgLabel', defaultMessage: 'Avg' }),
github elastic / kibana / src / legacy / core_plugins / vis_type_timeseries / public / components / color_rules.js View on Github external
}),
        value: 'lt',
      },
      {
        label: intl.formatMessage({
          id: 'visTypeTimeseries.colorRules.lessThanOrEqualLabel',
          defaultMessage: '&lt;= less than or equal',
        }),
        value: 'lte',
      },
    ];
    const handleColorChange = part =&gt; {
      const handleChange = collectionActions.handleChange.bind(null, this.props);
      handleChange(_.assign({}, model, part));
    };
    const htmlId = htmlIdGenerator(model.id);
    const selectedOperatorOption = operatorOptions.find(option =&gt; {
      return model.operator === option.value;
    });

    const labelStyle = { marginBottom: 0 };

    let secondary;
    if (!this.props.hideSecondary) {
      secondary = (
github elastic / kibana / src / core_plugins / metrics / public / components / yes_no.js View on Github external
function YesNo(props) {
  const { name, value } = props;
  const handleChange = value =&gt; {
    const { name } = props;
    return () =&gt; {
      const parts = { [name]: value };
      props.onChange(parts);
    };
  };
  const htmlId = htmlIdGenerator();
  const inputName = name + _.uniqueId();
  return (
    <div>
      )}
        className="eui-displayInlineBlock"
        name={inputName}
        checked={Boolean(value)}
        value="yes"
        onChange={handleChange(1)}
      /&gt;
</div>
github elastic / kibana / src / legacy / core_plugins / vis_type_timeseries / public / components / splits / terms.js View on Github external
export const SplitByTermsUI = ({
  onChange,
  indexPattern,
  intl,
  model: seriesModel,
  fields,
  uiRestrictions,
  seriesQuantity,
}) => {
  const htmlId = htmlIdGenerator();
  const handleTextChange = createTextHandler(onChange);
  const handleSelectChange = createSelectHandler(onChange);
  const model = { ...DEFAULTS, ...seriesModel };
  const { metrics } = model;
  const defaultCount = {
    value: '_count',
    label: intl.formatMessage({
      id: 'visTypeTimeseries.splits.terms.defaultCountLabel',
      defaultMessage: 'Doc Count (default)',
    }),
  };
  const terms = {
    value: '_key',
    label: intl.formatMessage({ id: 'visTypeTimeseries.splits.terms.termsLabel', defaultMessage: 'Terms' }),
  };
github elastic / kibana / src / core_plugins / metrics / public / components / aggs / filter_ratio.js View on Github external
panel
  } = props;

  const handleChange = createChangeHandler(props.onChange, props.model);
  const handleSelectChange = createSelectHandler(handleChange);
  const handleTextChange = createTextHandler(handleChange);
  const indexPattern = series.override_index_pattern &amp;&amp; series.series_index_pattern || panel.index_pattern;

  const defaults = {
    numerator: '*',
    denominator: '*',
    metric_agg: 'count'
  };

  const model = { ...defaults, ...props.model };
  const htmlId = htmlIdGenerator();

  const restrictMode = model.metric_agg === 'cardinality' ? 'none' : 'numeric';

  return (
github elastic / kibana / src / core_plugins / metrics / public / components / aggs / positive_only.js View on Github external
export const PositiveOnlyAgg = props =&gt; {
  const { siblings } = props;

  const defaults = { unit: '' };
  const model = { ...defaults, ...props.model };

  const htmlId = htmlIdGenerator();
  const handleChange = createChangeHandler(props.onChange, model);
  const handleSelectChange = createSelectHandler(handleChange);

  return (
github elastic / kibana / src / core_plugins / metrics / public / components / vis_types / timeseries / config.js View on Github external
const handleTextChange = createTextHandler(props.onChange);

  const defaults = {
    fill: '',
    line_width: '',
    point_size: '',
    value_template: '{{value}}',
    offset_time: '',
    split_color_mode: 'gradient',
    axis_min: '',
    axis_max: '',
    stacked: 'none',
    steps: 0
  };
  const model = { ...defaults, ...props.model };
  const htmlId = htmlIdGenerator();
  const { intl } = props;

  const stackedOptions = [
    { label: intl.formatMessage({ id: 'tsvb.timeSeries.noneLabel', defaultMessage: 'None' }), value: 'none' },
    { label: intl.formatMessage({ id: 'tsvb.timeSeries.stackedLabel', defaultMessage: 'Stacked' }), value: 'stacked' },
    { label: intl.formatMessage({ id: 'tsvb.timeSeries.percentLabel', defaultMessage: 'Percent' }), value: 'percent' }
  ];
  const selectedStackedOption = stackedOptions.find(option => {
    return model.stacked === option.value;
  });

  const positionOptions = [
    { label: intl.formatMessage({ id: 'tsvb.timeSeries.rightLabel', defaultMessage: 'Right' }), value: 'right' },
    { label: intl.formatMessage({ id: 'tsvb.timeSeries.leftLabel', defaultMessage: 'Left' }), value: 'left' }
  ];
  const selectedAxisPosOption = positionOptions.find(option => {