AMD:
require(["esri/form/elements/support/inputs"], (inputs) => { /* code goes here */ });
ESM:
import * as inputs from "@arcgis/core/form/elements/support/inputs.js";
Object:
esri/form/elements/support/inputs
Since: ArcGIS Maps SDK 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 element inputs one at a time like this:
import BarcodeScannerInput from "esri/form/elements/inputs/BarcodeScannerInput";
import ComboBoxInput from "esri/form/elements/inputs/ComboBoxInput";
import DatePickerInput from "esri/form/elements/inputs/DatePickerInput";
import DateTimeOffsetPickerInput from "esri/form/elements/inputs/DateTimeOffsetPickerInput";
import DateTimePickerInput from "esri/form/elements/inputs/DateTimePickerInput";
import RadioButtonsInput from "esri/form/elements/inputs/RadioButtonsInput";
import SwitchInput from "esri/form/elements/inputs/SwitchInput";
import TextAreaInput from "esri/form/elements/inputs/TextAreaInput";
import TextBoxInput from "esri/form/elements/inputs/TextBoxInput";
import TimePickerInput from "esri/form/elements/inputs/TimePickerInput";
You can use this module to import them on a single line:
import { BarcodeScannerInput, ComboBoxInput, DatePickerInput, DateTimeOffsetPickerInput, DateTimePickerInput, RadioButtonsInput, SwitchInput, TextAreaInput, TextBoxInput, TimePickerInput } 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`, etc.
console.log("The value is not a valid form element input.")
}
}