How to use the react-dom-factories.button function in react-dom-factories

To help you get started, we’ve selected a few react-dom-factories 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 firefox-devtools / devtools-core / packages / devtools-reps / src / reps / function.js View on Github external
function FunctionRep(props) {
  let {
    object: grip,
    onViewSourceInDebugger,
  } = props;

  let jumpToDefinitionButton;
  if (onViewSourceInDebugger &&
    grip.location &&
    grip.location.url &&
    !IGNORED_SOURCE_URLS.includes(grip.location.url)
  ) {
    jumpToDefinitionButton = dom.button({
      className: "jump-definition",
      draggable: false,
      title: "Jump to definition",
      onClick: e => {
        // Stop the event propagation so we don't trigger ObjectInspector expand/collapse.
        e.stopPropagation();
        onViewSourceInDebugger(grip.location);
      }
    });
  }

  return (
   span({
      "data-link-actor-id": grip.actor,
      className: "objectBox objectBox-function",
      // Set dir="ltr" to prevent function parentheses from
github firefox-devtools / devtools-core / packages / devtools-reps / src / reps / element-node.js View on Github external
}

    if (onDOMNodeMouseOver) {
      Object.assign(baseConfig, {
        onMouseOver: _ => onDOMNodeMouseOver(object)
      });
    }

    if (onDOMNodeMouseOut) {
      Object.assign(baseConfig, {
        onMouseOut: onDOMNodeMouseOut
      });
    }

    if (onInspectIconClick) {
      inspectIcon = dom.button({
        className: "open-inspector",
        // TODO: Localize this with "openNodeInInspector" when Bug 1317038 lands
        title: inspectIconTitle || "Click to select the node in the inspector",
        onClick: e => {
          if (onDOMNodeClick) {
            e.stopPropagation();
          }

          onInspectIconClick(object, e);
        }
      });
    }
  }

  return span(baseConfig,
    ...elements,
github firefox-devtools / debugger / packages / devtools-reps / src / reps / accessible.js View on Github external
}

    if (onAccessibleMouseOver) {
      Object.assign(baseConfig, {
        onMouseOver: _ => onAccessibleMouseOver(object)
      });
    }

    if (onAccessibleMouseOut) {
      Object.assign(baseConfig, {
        onMouseOut: onAccessibleMouseOut
      });
    }

    if (onInspectIconClick) {
      inspectIcon = button({
        className: "open-accessibility-inspector",
        title: inspectIconTitle,
        onClick: e => {
          if (onAccessibleClick) {
            e.stopPropagation();
          }

          onInspectIconClick(object, e);
        }
      });
    }
  }

  return span(baseConfig, ...elements, inspectIcon);
}
github researchspace / researchspace / researchspace / web / src / main / widgets / image-upload-widget.ts View on Github external
DatePickerInput, {for: 'date', mode: 'date'}),
        React.createElement(SelectInput, {for: 'type'}),
        React.createElement(AutocompleteInput, {for: 'owner'}),
        React.createElement(PlainTextInput, {for: 'copyright'}),
        React.createElement(
          PlainTextInput, {for: 'description', multiline: true}),
        React.createElement(SelectInput, {for: 'scientificType'}),
        React.createElement(PlainTextInput, {for: 'width'}),
        React.createElement(PlainTextInput, {for: 'height'}),
        React.createElement(SelectInput, {for: 'unit'}),
        React.createElement(AutocompleteInput, {for: 'depicts'}),
        React.createElement(AutocompleteInput, {for: 'subjects'}),
        React.createElement(AutocompleteInput, {for: 'refers'}),
        React.createElement(AutocompleteInput, {for: 'about'}),
        D.button({className: 'btn btn-sm btn-success iiif-upload__submit-button pull-right', name: 'submit'}, 'Submit'),
        D.button({
            className: 'btn btn-sm btn-danger iiif-upload__cancel-button pull-right',
            onClick: () => window.location.reload(),
          },
          'Cancel'
        )
      ),
      this.state.alertState ? createElement(Alert, this.state.alertState) : null,
      progress.map(progress => ProgressBar({ active: true, min: 0, max: 100, now: progress })).getOrElse(null)
    );
  }
}
github firefox-devtools / debugger / packages / devtools-reps / src / reps / accessor.js View on Github external
const { Rep, Grip } = require("./rep");
    return span(
      {
        className: "objectBox objectBox-accessor objectTitle"
      },
      Rep({
        ...props,
        object: evaluation.getterValue,
        mode: props.mode || MODE.TINY,
        defaultRep: Grip
      })
    );
  }

  if (hasGetter(object) && onInvokeGetterButtonClick) {
    return dom.button({
      className: "invoke-getter",
      title: "Invoke getter",
      onClick: event => {
        onInvokeGetterButtonClick();
        event.stopPropagation();
      }
    });
  }

  const accessors = [];
  if (hasGetter(object)) {
    accessors.push("Getter");
  }

  if (hasSetter(object)) {
    accessors.push("Setter");
github researchspace / researchspace / researchspace / web / src / main / widgets / image-upload-widget.ts View on Github external
React.createElement(
          DatePickerInput, {for: 'date', mode: 'date'}),
        React.createElement(SelectInput, {for: 'type'}),
        React.createElement(AutocompleteInput, {for: 'owner'}),
        React.createElement(PlainTextInput, {for: 'copyright'}),
        React.createElement(
          PlainTextInput, {for: 'description', multiline: true}),
        React.createElement(SelectInput, {for: 'scientificType'}),
        React.createElement(PlainTextInput, {for: 'width'}),
        React.createElement(PlainTextInput, {for: 'height'}),
        React.createElement(SelectInput, {for: 'unit'}),
        React.createElement(AutocompleteInput, {for: 'depicts'}),
        React.createElement(AutocompleteInput, {for: 'subjects'}),
        React.createElement(AutocompleteInput, {for: 'refers'}),
        React.createElement(AutocompleteInput, {for: 'about'}),
        D.button({className: 'btn btn-sm btn-success iiif-upload__submit-button pull-right', name: 'submit'}, 'Submit'),
        D.button({
            className: 'btn btn-sm btn-danger iiif-upload__cancel-button pull-right',
            onClick: () => window.location.reload(),
          },
          'Cancel'
        )
      ),
      this.state.alertState ? createElement(Alert, this.state.alertState) : null,
      progress.map(progress => ProgressBar({ active: true, min: 0, max: 100, now: progress })).getOrElse(null)
    );
  }
}
github firefox-devtools / debugger / packages / devtools-reps / src / launchpad / components / Result.js View on Github external
{ className: "packet" },
      dom.header(
        {
          className: headerClassName,
          onClick: this.onHeaderClick
        },
        headerLabel,
        dom.span({ className: "copy-label" }, "Copy"),
        dom.button(
          {
            className: "copy-packet-button",
            onClick: e => this.copyPacketToClipboard(e, packet.result)
          },
          "grip"
        ),
        dom.button(
          {
            className: "copy-packet-button",
            onClick: e => this.copyPacketToClipboard(e, packet)
          },
          "packet"
        )
      ),
      ...(showPacket
        ? Object.keys(packet).map(k =>
            dom.div(
              { className: "packet-rep" },
              `${k}: `,
              Rep({ object: packet[k], noGrip: true, mode: MODE.LONG })
            )
          )
        : [])
github researchspace / researchspace / researchspace / web / src / main / components / iiif / LightboxTable.ts View on Github external
assign(
      {
        show: true,
      }, props,
      {
        animation: false,
        backdrop: false,
        className: b.toString(),
        dialogClassName: b('dialog').toString(),
      }
    ) as any,
    ModalHeader(
      { closeButton: false, className: b('header').toString() },
      ModalTitle(
        {},
        D.button(
          {
            className: classNames('btn', 'btn-default', b('back-button').toString()),
            onClick: () => getOverlaySystem().hide(ACTION_DIALOG_REF),
          },
          D.i({}),
          'Back to Lightbox'
        ),
        props.title
      )
    ),
    ModalBody(
      {
        className: b('body').toString(),
      },
      D.div(
        {
github firefox-devtools / devtools-core / packages / devtools-launchpad / src / components / LandingPage.js View on Github external
renderLaunchButton(browserName, isUnderConstruction) {
    let browserDisplayName;
    if (browserName === "Firefox") {
      browserDisplayName = "Firefox Nightly";
    }

    return dom.div(
      { className: "launch-action-container" },
      dom.button(
        { onClick: () => this.launchBrowser(browserName) },
        `Launch ${browserDisplayName || browserName}`
      ),
      isUnderConstruction ? this.renderExperimentalMessage(browserName) : null
    );
  }
github firefox-devtools / devtools-core / packages / devtools-reps / src / launchpad / components / Header.js View on Github external
return dom.header(
      { className: "console-header" },
      dom.form(
        { onSubmit: this.onSubmitForm, },
        dom.h1({}, "Reps"),
        dom.input({
          type: "text",
          placeholder: "Enter an expression",
          name: "expression",
          value: currentInputValue || "",
          autoFocus: true,
          onChange: this.onInputChange,
          onKeyDown: this.onInputKeyDown,
        }),
        dom.button({
          className: "clear-button",
          type: "button",
          onClick: this.onClearButtonClick
        }, "Clear"),
      ),
      QuickLinks({ evaluate })
    );
  }
}