intraactive-framework-spfx-imagepicker
v1.0.30
Published
SPFx ImagePicker written in react
Downloads
17
Keywords
Readme
IntraActive Framework - SPFx Image Picker
IntraActive Framework's "Image Picker" package is a SPFx component used to upload/select images and to a SharePoint list and retur the URL.
Installation
`$ npm install intraactive-framework-spfx-imagepicker
Import
import IAImagePicker from 'intraactive-framework-spfx-imagepicker'
Usage
<IAImagePicker
label="[YOUR_TEXT]"
inputFieldPlaceholderText="[YOUR_TEXT]"
uploadButtonLabel="[YOUR_TEXT]"
selectButtonLabel="[YOUR_TEXT]"
imageListTitle="[YOUR_LIST_TITLE]"
onChange={(url: string) => console.log(url)}
defaultImageUrl="[YOUR_TEXT]"
spService={[JSOM_SERVICE]}
/>
Example
import * as React from 'react';
import { IDesignSettingsProps } from './IDesignSettingsProps';
import JSOMListService from 'intraactive-framework-jsomservice';
export interface IDesignSettingsState {
spService: JSOMListService;
}
export default class DesignSettings extends React.Component<IDesignSettingsProps, IDesignSettingsState> {
constructor(props: IDesignSettingsProps) {
super(props);
this.state = {
spService: props.serviceScope.consume(JSOMListService.serviceKey)
};
}
public render(): React.ReactElement<IDesignSettingsProps> {
return (
<IAImagePicker
label="Indsæt et logo"
inputFieldPlaceholderText="Indsæt billedlink"
uploadButtonLabel="Upload"
selectButtonLabel="Select"
imageListTitle="Infoscreen Assets"
onChange={(url: string) => console.log(url)}
defaultImageUrl=""
spService={this.state.spService}
/>
);
}
}