How to use the office-ui-fabric-react/lib/Utilities.Async function in office-ui-fabric-react

To help you get started, we’ve selected a few office-ui-fabric-react 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 OlivierCC / sp-client-custom-fields / src / PropertyFieldIconPickerHost.tsx View on Github external
this.onFontDropdownChanged = this.onFontDropdownChanged.bind(this);
    this.mouseEnterDropDown = this.mouseEnterDropDown.bind(this);
    this.mouseLeaveDropDown = this.mouseLeaveDropDown.bind(this);
    this._key = GuidHelper.getGuid();

    if (this.props.orderAlphabetical === true)
      this.orderAlphabetical();

    //Init the state
    this.state = {
        isOpen: false,
        isHoverDropdown: false,
        errorMessage: ''
      };

    this.async = new Async(this);
    this.validate = this.validate.bind(this);
    this.notifyAfterValidate = this.notifyAfterValidate.bind(this);
    this.delayedValidate = this.async.debounce(this.validate, this.props.deferredValidationTime);

    //Inits the default value
    if (props.initialValue != null && props.initialValue != '') {
      for (var i = 0; i < this.fonts.length; i++) {
        var font = this.fonts[i];
        if (font.SafeValue == props.initialValue) {
          this.state.selectedFont = font.Name;
          this.state.safeSelectedFont = font.SafeValue;
        }
      }
    }
  }
github SharePoint / sp-dev-fx-property-controls / src / propertyFields / codeEditor / PropertyFieldCodeEditorHost.tsx View on Github external
language: props.language,
      disabled: props.disabled
    });

    this.state = {
      code: typeof this.props.initialValue !== 'undefined' ? this.props.initialValue : '',
      loaded: false,
      openPanel: false,
      errorMessage: ''
    };

    this.onOpenPanel = this.onOpenPanel.bind(this);
    this.onClosePanel = this.onClosePanel.bind(this);
    this.onChange = this.onChange.bind(this);
    this.onSave = this.onSave.bind(this);
    this.async = new Async(this);
  }
github SharePoint / sp-dev-fx-property-controls / src / propertyFields / listPicker / PropertyFieldListPickerHost.tsx View on Github external
constructor(props: IPropertyFieldListPickerHostProps) {
    super(props);

    telemetry.track('PropertyFieldListPicker', {
      disabled: props.disabled
    });

    this.state = {
      results: this.options,
      errorMessage: ''
    };

    this.async = new Async(this);
    this.validate = this.validate.bind(this);
    this.onChanged = this.onChanged.bind(this);
    this.notifyAfterValidate = this.notifyAfterValidate.bind(this);
    this.delayedValidate = this.async.debounce(this.validate, this.props.deferredValidationTime);
  }
github OlivierCC / sp-client-custom-fields / src / PropertyFieldPicturePickerHost.tsx View on Github external
this.onClickUpload = this.onClickUpload.bind(this);
    this.handleIframeData = this.handleIframeData.bind(this);
    this.onEraseButton = this.onEraseButton.bind(this);

    //Inits the state
    this.state = {
      selectedImage: this.props.initialValue,
      openPanel: false,
      openRecent: false,
      openSite: true,
      openUpload: false,
      recentImages: [],
      errorMessage: ''
    };

    this.async = new Async(this);
    this.validate = this.validate.bind(this);
    this.notifyAfterValidate = this.notifyAfterValidate.bind(this);
    this.delayedValidate = this.async.debounce(this.validate, this.props.deferredValidationTime);

  }
github OlivierCC / sp-client-custom-fields / src / PropertyFieldSPListPickerHost.tsx View on Github external
constructor(props: IPropertyFieldSPListPickerHostProps) {
    super(props);

    this.onChanged = this.onChanged.bind(this);
    this.state = {
			results: this.options,
      selectedKey: this.selectedKey,
      errorMessage: ''
    };

    this.async = new Async(this);
    this.validate = this.validate.bind(this);
    this.notifyAfterValidate = this.notifyAfterValidate.bind(this);
    this.delayedValidate = this.async.debounce(this.validate, this.props.deferredValidationTime);

    this.loadLists();
  }
github OlivierCC / sp-client-custom-fields / src / PropertyFieldTagPickerHost.tsx View on Github external
constructor(props: IPropertyFieldTagPickerHostProps) {
    super(props);

    this.async = new Async(this);
    this.state = { errorMessage: ''};

    //Bind the current object to the external called onSelectDate method
    this.onItemChanged = this.onItemChanged.bind(this);
    this.onFilterChanged = this.onFilterChanged.bind(this);
    this.listContainsTag = this.listContainsTag.bind(this);
    this.validate = this.validate.bind(this);
    this.notifyAfterValidate = this.notifyAfterValidate.bind(this);
    this.delayedValidate = this.async.debounce(this.validate, this.props.deferredValidationTime);
  }
github BobGerman / SPFx / quotes / src / components / propertyFieldListPicker / PropertyFieldListPickerHost.tsx View on Github external
public constructor(props: IPropertyFieldLinkPickerHostProps){
        super(props);

        this.async = new Async(this);
        this.state = ({ errorMessage: '', currentValue: this.props.initialValue} as IPropertyFieldLinkPickerState);

        this.onValueChanged = this.onValueChanged.bind(this);
        this.validate = this.validate.bind(this);
        this.notifyAfterValidate = this.notifyAfterValidate.bind(this);
        this.delayedValidate = this.async.debounce(this.validate, this.props.deferredValidationTime);
    }
github OlivierCC / sp-client-custom-fields / src / PropertyFieldSPFolderPickerHost.tsx View on Github external
if (props.initialFolder != null && props.initialFolder != '') {
      initialFolder = props.initialFolder;
      currentSPFolder = this.getParentFolder(initialFolder);
    }
    //Inits the state
    this.state = {
      isOpen: false,
      loading: true,
      currentSPFolder: currentSPFolder,
      confirmFolder: initialFolder,
      selectedFolder: initialFolder,
      childrenFolders: { value: [] },
      errorMessage: ''
    };

    this.async = new Async(this);
    this.validate = this.validate.bind(this);
    this.notifyAfterValidate = this.notifyAfterValidate.bind(this);
    this.delayedValidate = this.async.debounce(this.validate, this.props.deferredValidationTime);
  }
github SharePoint / sp-dev-fx-property-controls / src / propertyFields / collectionData / collectionNumberField / CollectionNumberField.tsx View on Github external
constructor(props: ICollectionNumberFieldProps) {
    super(props);

    this.state = {
      value: null,
      errorMessage: ''
    };

    this.async = new Async(this);
    this.delayedValidate = this.async.debounce(this.valueValidation, (this.props.field.deferredValidationTime || this.props.field.deferredValidationTime >= 0) ? this.props.field.deferredValidationTime : 200);
  }
github OlivierCC / sp-client-custom-fields / src / PropertyFieldDatePickerHost.tsx View on Github external
constructor(props: IPropertyFieldDatePickerHostProps) {
    super(props);
    //Bind the current object to the external called onSelectDate method
    this.onSelectDate = this.onSelectDate.bind(this);

    this.state = {
        date: this.props.initialDate,
        errorMessage: ''
      };

    this.async = new Async(this);
    this.validate = this.validate.bind(this);
    this.notifyAfterValidate = this.notifyAfterValidate.bind(this);
    this.delayedValidate = this.async.debounce(this.validate, this.props.deferredValidationTime);
  }