How to use the @react-md/utils.omit function in @react-md/utils

To help you get started, we’ve selected a few @react-md/utils 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 mlaursen / react-md / packages / autocomplete / src / AutoComplete.tsx View on Github external
{filteredData.map((datum, i) => {
            const resultId = getResultId(suggestionsId, i);
            let optionProps: ListboxOptionProps | undefined;
            if (isListboxOptionProps(datum)) {
              optionProps = omit(datum, [labelKey, valueKey]);
            }

            return (
              <option selected="{false}" id="{resultId}"> handleAutoComplete(i)}
              &gt;
                
                  {getResultLabel(datum, labelKey, value)}
                
              </option>
github mlaursen / react-md / packages / examples / src / ButtonDemo.tsx View on Github external
const ButtonWithTooltip: FunctionComponent = ({
  children,
  ...props
}) =&gt; {
  const buttonProps = omit(props, [
    "tooltip",
    "tooltipId",
    "dense",
    "hoverDelay",
    "focusDelay",
    "vhMargin",
    "vwMargin",
    "spacing",
    "denseSpacing",
    "defaultVisible",
    "defaultPosition",
  ]);

  return (
    
      {({ tooltip, containerProps }) =&gt; (
github mlaursen / react-md / packages / form / src / select / Listbox.tsx View on Github external
{options.map((option, i) =&gt; {
          const optionId = getOptionId(id, i);
          const optionValue = getOptionValue(option, valueKey);
          const optionLabel = getOptionLabel(option, labelKey);
          let optionProps: ListboxOptionProps | undefined;
          if (isListboxOptionProps(option)) {
            optionProps = omit(option, [labelKey, valueKey]);
          }

          const disabled = isOptionDisabled(option);

          let onClick;
          if (!readOnly &amp;&amp; !disabled) {
            onClick = () =&gt; {
              handleChange(i);
              setFocusedIndex(i);
            };
          }

          return (
github mlaursen / react-md / packages / button / src / FakeButton.tsx View on Github external
const { key } = event;
    const isSpace = key === " ";
    if (isSpace || key === "Enter") {
      if (isSpace) {
        event.preventDefault();
      }

      event.currentTarget.click();
    }
  }

  return (
    <div tabindex="{disabled" aria-disabled="{disabled">
      {children}
    </div>
  );
};