inputs

AMD: require(["esri/form/elements/support/inputs"], (inputs) => { /* code goes here */ });
ESM: import * as inputs from "@arcgis/core/form/elements/support/inputs";
Object: esri/form/elements/support/inputs
Since: ArcGIS API for JavaScript 4.16

A convenience module for importing esri/form/elements/inputs/Input classes when developing with TypeScript. For example, rather than importing form elements one at a time like this:

import TextAreaInput from "esri/form/elements/inputs/TextAreaInput";
import TextBoxInput from "esri/form/elements/inputs/TextBoxInput";
import BarcodeScannerInput from "esri/form/elements/inputs/BarcodeScannerInput";
import ComboBoxInput from "esri/form/elements/inputs/ComboBoxInput";
import RadioButtonsInput from "esri/form/elements/inputs/RadioButtonsInput";

You can use this module to import them on a single line:

import { TextAreaInput, TextBoxInput, BarcodeScannerInput, ComboBoxInput, RadioButtonsInput } from "esri/form/elements/inputs";

This module also allows you to implement type guards on the form element inputs, making your code smarter.

import { Input } from "esri/form/elements/inputs";

function logFormElementInput(input: Input): void {
  if (input.type === "text-area") {
    console.log("Form element input type is TextAreaInput");
  }
  else {
    // The compiler knows the content element must be an input type such as  `text-area` | `text-box` | `barcode-scanner` | `radio-buttons` | `combo-box`
    console.log("The value is not a valid form element input.")
  }
}

Your browser is no longer supported. Please upgrade your browser for the best experience. See our browser deprecation post for more details.