How to use the @department-of-veterans-affairs/react-jsonschema-form/lib/utils.toIdSchema function in @department-of-veterans-affairs/react-jsonschema-form

To help you get started, we’ve selected a few @department-of-veterans-affairs/react-jsonschema-form 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 department-of-veterans-affairs / vets-website / src / applications / common / schemaform / fields / ArrayField.jsx View on Github external
{items.map((item, index) => {
            // This is largely copied from the default ArrayField
            const itemSchema = this.getItemSchema(index);
            const itemIdPrefix = `${idSchema.$id}_${index}`;
            const itemIdSchema = toIdSchema(itemSchema, itemIdPrefix, definitions);
            const isLast = items.length === (index + 1);
            const isEditing = this.state.editing[index];
            const notLastOrMultipleRows = !isLast || items.length > 1;

            if (isReviewMode ? isEditing : isLast || isEditing) {
              return (
                <div>
                  <element name="{`table_${itemIdPrefix}`}/">
                  <div>
                    <div>
                      {isLast &amp;&amp; items.length &gt; 1 &amp;&amp; uiSchema['ui:options'].itemName
                        ? <h5>New {uiSchema['ui:options'].itemName}</h5>
                        : null}
                      <div>
                        </div></div></div></element></div>
github department-of-veterans-affairs / vets-website / src / platform / forms-system / src / js / fields / ArrayField.jsx View on Github external
{items.map((item, index) =&gt; {
            // This is largely copied from the default ArrayField
            const itemSchema = this.getItemSchema(index);
            const itemIdPrefix = `${idSchema.$id}_${index}`;
            const itemIdSchema = toIdSchema(
              itemSchema,
              itemIdPrefix,
              definitions,
            );
            const isLast = items.length === index + 1;
            const isEditing = this.state.editing[index];
            const notLastOrMultipleRows = !isLast || items.length &gt; 1;

            if (isReviewMode ? isEditing : isLast || isEditing) {
              return (
                <div></div>
github department-of-veterans-affairs / vets-website / src / applications / common / schemaform / fields / BasicArrayField.jsx View on Github external
{items.map((item, index) =&gt; {
            const itemSchema = this.getItemSchema(index);
            const itemIdPrefix = `${idSchema.$id}_${index}`;
            const itemIdSchema = toIdSchema(itemSchema, itemIdPrefix, definitions);

            return (
              <div>
                <element name="{`table_${itemIdPrefix}`}/">
                <div>
                  <div>
                     this.onItemChange(index, value)}
                      onBlur={onBlur}
                      registry={this.props.registry}
                      required={false}</div></div></element></div>
github department-of-veterans-affairs / vets-website / src / js / pensions / components / AdditionalSourcesField.jsx View on Github external
{items.map((item, index) =&gt; {
            const itemSchema = this.getItemSchema(index);
            const itemIdPrefix = `${idSchema.$id}_${index}`;
            const itemIdSchema = toIdSchema(itemSchema, itemIdPrefix, definitions);
            const itemData = items[index];
            const isEditing = this.state.editStates[index];

            if (isEditing) {
              return (
                <div>
                  <element name="{`additional_${index}`}/">
                  <div>
                    <div>
                      <h5>Additional source</h5>
                      <div>
                        </div></div></div></element></div>
github department-of-veterans-affairs / vets-website / src / js / common / schemaform / review / ReadOnlyArrayField.jsx View on Github external
{items.map((item, index) =&gt; {
            const itemSchema = this.getItemSchema(index);
            const itemIdPrefix = `${idSchema.$id}_${index}`;
            const itemIdSchema = toIdSchema(itemSchema, itemIdPrefix, definitions);

            return (
              <div>
                <div>
                  <div>
                    <h5>{uiOptions.itemName}</h5>
                     f}
                      onBlur={f =&gt; f}
                      registry={this.props.registry}
                      required={false}</div></div></div>
github department-of-veterans-affairs / vets-website / src / applications / pensions / components / AdditionalSourcesField.jsx View on Github external
{items.map((item, index) =&gt; {
            const itemSchema = this.getItemSchema(index);
            const itemIdPrefix = `${idSchema.$id}_${index}`;
            const itemIdSchema = toIdSchema(
              itemSchema,
              itemIdPrefix,
              definitions,
            );
            const itemData = items[index];
            const isEditing = this.state.editStates[index];

            if (isEditing) {
              return (
                <div>
                  <element name="{`additional_${index}`}">
                  <div>
                    <div></div></div></element></div>
github department-of-veterans-affairs / vets-website / src / applications / disability-benefits / all-claims / components / ArrayField.jsx View on Github external
{items.map((item, index) =&gt; {
            const itemSchema = this.getItemSchema(index);
            const itemIdPrefix = `${idSchema.$id}_${index}`;
            const itemIdSchema = toIdSchema(
              itemSchema,
              itemIdPrefix,
              definitions,
            );
            const isLast = items.length === index + 1;
            const isEditing = this.state.editing[index];

            if (isEditing) {
              return (
                <div>
                  <element name="{`table_${itemIdPrefix}`}">
                  <div>
                    <div>
                      {isLast &amp;&amp;
                      items.length &gt; 1 &amp;&amp;
                      uiSchema['ui:options'].itemName ? (</div></div></element></div>