How to use the @microsoft/sp-lodash-subset.escape function in @microsoft/sp-lodash-subset

To help you get started, we’ve selected a few @microsoft/sp-lodash-subset 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 SharePoint / sp-dev-fx-webparts / samples / react-calendar / src / webparts / calendar / components / Calendar.tsx View on Github external
private async loadEvents() {
    try {
      // Teste Properties
      if (!this.props.list || !this.props.siteUrl || !this.props.eventStartDate.value || !this.props.eventEndDate.value) return;

      this.userListPermissions = await this.spService.getUserPermissions(this.props.siteUrl, this.props.list);
      const eventsData: IEventData[] = await this.spService.getEvents(escape(this.props.siteUrl), escape(this.props.list), this.props.eventStartDate.value, this.props.eventEndDate.value);
      this.setState({ eventData: eventsData, hasError: false, errorMessage: "" });
    } catch (error) {
      this.setState({ hasError: true, errorMessage: error.message, isloading: false });
    }
  }
  /**
github SharePoint / sp-dev-fx-webparts / samples / react-recaptcha / src / webparts / recaptcha / components / Recaptcha.tsx View on Github external
iconText='Configure your web part'  
                  description='Please configure the web part.'  
                  buttonLabel='Configure'  
                  hideButton={this.props.displayMode === DisplayMode.Read}  
                  onConfigure={() => this._onConfigure()} /> 
              }  
  

      {/* Show description web part property, when set */} 
      {this.props.sitekey  &&  
        <div>
           <p>
        
        </p>
         { this.captcha = el; } }
        sitekey={escape(this.props.sitekey)}
        onChange={this.onChange} /&gt;
        <p>
            </p><p> { this._messageContainer = elm; }}&gt;
          </p>
        <p></p>

         this.buttonClicked()}   /&gt;
          </div> 
      }
      
    );
  }
github SharePoint / sp-dev-fx-extensions / samples / react-application-duetasks / src / extensions / dueTasks / DueTasksApplicationCustomizer.ts View on Github external
return;

    // Handling the top placeholder
    if (!this._topPlaceholder) {
      this._topPlaceholder = this.context.placeholderProvider.tryCreateContent(
        PlaceholderName.Top,
        {
          onDispose: this._onDispose
        });
    }

    if (this._topPlaceholder &amp;&amp; this._topPlaceholder.domElement) {
      this._topPlaceholder.domElement.innerHTML = `
                <div class="${styles.app}">
                  <div class="ms-bgColor-themeDark ms-fontColor-white ${styles.header}">
                    <i aria-hidden="true" class="ms-Icon ms-Icon--Info"></i> ${escape(strings.Message)}&nbsp;
                    <a href="${this._viewUrl}">${escape(strings.GoToList)}</a>
                  </div>
                </div>`;
    }
  }
github SharePoint / sp-dev-fx-webparts / samples / react-organisationchart / src / webparts / organisationChart / components / OrganisationChart.tsx View on Github external
public render(): React.ReactElement {
    return (
      <div>
        <div>
          {escape(this.props.organisationName)}
        </div>
        <div>
          <div>Managers</div>
          <ul>
            {this.state.managers.map((manager, index) =&gt; (
              <li>
                <button> this.onProfileLinkClick(manager.UserUrl)}&gt;
                  <div>
                    <div>
                      <img src="{this.getProfilePhoto(manager.PictureUrl)}" role="presentation" alt="">
                    </div>
                    <div>
                      <div>{manager.DisplayName}</div>
                      <div>{manager.Title}</div>
                    </div>
                  </div></button></li></ul></div></div>
github OfficeDev / TrainingContent / SharePoint / SharePointFramework / 05 Working with the web part property pane / Demos / Exercise 1 / helloworld-webpart / src / webparts / helloWorld / HelloWorldWebPart.ts View on Github external
public render(): void {
    this.domElement.innerHTML = `
      <div class="${styles.helloWorld}">
        <div class="${styles.container}">
          <div class="ms-Grid-row ms-bgColor-themeDark ms-fontColor-white ${styles.row}">
            <div class="ms-Grid-col ms-u-lg10 ms-u-xl8 ms-u-xlPush2 ms-u-lgPush1">
              <span class="ms-font-xl ms-fontColor-white">Welcome to SharePoint!</span>
              <p class="ms-font-l ms-fontColor-white">Customize SharePoint experiences using Web Parts.</p>
              <p class="ms-font-l ms-fontColor-white">${escape(this.properties.description)}</p>
              <a class="${styles.button}" href="https://aka.ms/spfx">
                <span class="${styles.label}">Learn more</span>
              </a>

              <p class="ms-font-l ms-fontColor-white">Textbox value: ${this.properties.textboxField}</p>
              <p class="ms-font-l ms-fontColor-white">Multi-line Textbox value: ${this.properties.multilineTextboxField}</p>
              <p class="ms-font-l ms-fontColor-white">Checkbox checked: ${this.properties.checkboxField}</p>
              <p class="ms-font-l ms-fontColor-white">Dropdown selected value: ${this.properties.dropdownField}</p>
              <p class="ms-font-l ms-fontColor-white">Slider value: ${this.properties.sliderField}</p>
              <p class="ms-font-l ms-fontColor-white">Toggle on: ${this.properties.toggleField}</p>
            </div>
          </div>
        </div>
      </div>`;
  }
github SharePoint / sp-dev-fx-webparts / tutorials / tutorial-migrate-datatables / 03-transformed-js-to-typescript / src / webparts / itRequests / ItRequestsWebPart.ts View on Github external
<table width="100%" cellspacing="0" class="display ${styles.helloWorld}">
        <thead>
            <tr>
                <th>ID</th>
                <th>Business unit</th>
                <th>Category</th>
                <th>Status</th>
                <th>Due date</th>
                <th>Assigned to</th>
            </tr>
        </thead>
      </table>`;

    $('table', this.domElement).DataTable({
      'ajax': {
        'url': `../../_api/web/lists/getbytitle('${escape(this.properties.listName)}')/items?$select=ID,BusinessUnit,Category,Status,DueDate,AssignedTo/Title&amp;$expand=AssignedTo/Title`,
        'headers': { 'Accept': 'application/json;odata=nometadata' },
        'dataSrc': (data: { value: IRequestItem[] }): any[][] =&gt; {
          return data.value.map((item: IRequestItem): any[] =&gt; {
            return [
              item.ID,
              item.BusinessUnit,
              item.Category,
              item.Status,
              new Date(item.DueDate),
              item.AssignedTo.Title
            ];
          });
        }
      },
      columnDefs: [{
        targets: 4,
github BobGerman / SPFx / Twitter / src / webparts / twitterSearch / components / PostTweetForm.tsx View on Github external
<p>
                <input value="{this.props.commentText}"> { this.inputElement = elt; }}
                  onChange={e =&gt; this.props.onChangeComment(e.target.value)}
                /&gt;&nbsp;&nbsp;&nbsp;
                <button> {
                  this.props.onAddComment(this.inputElement.value);
                }}
                  className={styles.button}&gt;{strings.AddButtonLabel}</button>&nbsp;
                <button>
                  {strings.CancelButtonLabel}
                </button>
                <button>
                  {strings.RefreshButtonLabel}
                </button>
                </p><div>{escape(this.props.title)}</div>
              <p></p>
              <div>{this.props.message}</div>
            
          
        
      
    );
  }
}
github SharePoint / sp-dev-fx-webparts / tutorials / tutorial-getting-started / helloworld-webpart / src / webparts / helloWorld / HelloWorldWebPart.ts View on Github external
public render(): void {
    this.domElement.innerHTML = `
      <div class="${styles.helloWorld}">
        <div class="${styles.container}">
          <div class="ms-Grid-row ms-bgColor-themeDark ms-fontColor-white ${styles.row}">
            <div class="ms-Grid-col ms-u-lg10 ms-u-xl8 ms-u-xlPush2 ms-u-lgPush1">
              <span class="ms-font-xl ms-fontColor-white">Welcome to SharePoint!</span>
              <p class="ms-font-l ms-fontColor-white">Customize SharePoint experiences using Web Parts.</p>
              <p class="ms-font-l ms-fontColor-white">${escape(this.properties.description)}</p>
              <a class="${styles.button}" href="https://aka.ms/spfx">
                <span class="${styles.label}">Learn more</span>
              </a>
            </div>
          </div>
        </div>
      </div>`;
  }