2020-07-08 07:04:54 +03:00
|
|
|
import * as React from "react";
|
|
|
|
import * as System from "~/components/system";
|
|
|
|
import * as Constants from "~/common/constants";
|
|
|
|
|
2020-07-16 08:48:51 +03:00
|
|
|
import Group from "~/components/system/Group";
|
2020-07-08 07:04:54 +03:00
|
|
|
import SystemPage from "~/components/system/SystemPage";
|
|
|
|
import ViewSourceLink from "~/components/system/ViewSourceLink";
|
2020-07-21 03:56:14 +03:00
|
|
|
import CodeBlock from "~/components/system/CodeBlock";
|
2020-07-08 07:04:54 +03:00
|
|
|
|
|
|
|
export default class SystemPageNotifications extends React.Component {
|
|
|
|
state = {
|
2020-07-14 07:28:18 +03:00
|
|
|
count: 0,
|
2020-07-08 07:04:54 +03:00
|
|
|
};
|
|
|
|
|
2020-07-15 00:55:52 +03:00
|
|
|
_handleCreate = (detail) => {
|
2020-07-15 01:26:08 +03:00
|
|
|
System.dispatchCustomEvent({ name: "create-notification", detail: detail });
|
2020-07-14 07:28:18 +03:00
|
|
|
this.setState({ count: this.state.count + 1 });
|
|
|
|
};
|
|
|
|
|
2020-07-15 00:55:52 +03:00
|
|
|
_handleDelete = () => {
|
2020-07-15 01:26:08 +03:00
|
|
|
System.dispatchCustomEvent({ name: "delete-notification", detail: {} });
|
2020-07-08 07:04:54 +03:00
|
|
|
};
|
|
|
|
|
|
|
|
render() {
|
|
|
|
return (
|
|
|
|
<SystemPage
|
|
|
|
title="SDS: Notifications"
|
|
|
|
description="..."
|
2020-07-21 02:48:10 +03:00
|
|
|
url="https://slate.host/system/notifications"
|
2020-07-08 07:04:54 +03:00
|
|
|
>
|
|
|
|
<System.H1>
|
|
|
|
Notifications <ViewSourceLink file="system/notification.js" />
|
|
|
|
</System.H1>
|
|
|
|
<br />
|
|
|
|
<br />
|
|
|
|
<System.P>
|
|
|
|
The Notification component is used to alert a user of new information.
|
|
|
|
</System.P>
|
|
|
|
<br />
|
|
|
|
<br />
|
|
|
|
<br />
|
|
|
|
<System.H2>Imports</System.H2>
|
|
|
|
<hr />
|
|
|
|
<br />
|
2020-07-15 07:03:46 +03:00
|
|
|
<System.P>
|
|
|
|
Import React and the Notification Component, as well as the
|
|
|
|
dispatchCustomEvent function.
|
|
|
|
</System.P>
|
2020-07-08 07:04:54 +03:00
|
|
|
<br />
|
2020-07-21 03:56:14 +03:00
|
|
|
<CodeBlock>
|
2020-07-28 23:27:53 +03:00
|
|
|
{`import * as React from "react";
|
|
|
|
import { GlobalNotification, dispatchCustomEvent } from "slate-react-system";`}
|
2020-07-21 03:56:14 +03:00
|
|
|
</CodeBlock>
|
2020-07-08 07:04:54 +03:00
|
|
|
<br />
|
|
|
|
<br />
|
2020-07-14 07:28:18 +03:00
|
|
|
<br />
|
|
|
|
<System.H2>Usage</System.H2>
|
2020-07-08 07:04:54 +03:00
|
|
|
<hr />
|
|
|
|
<br />
|
2020-07-14 07:28:18 +03:00
|
|
|
<System.P>
|
|
|
|
Declare the component at the root level of your document (e.g. in
|
|
|
|
index.js or App.js) so it is accessible throughout and will not get
|
|
|
|
buried in the DOM tree.
|
|
|
|
</System.P>
|
2020-07-08 07:04:54 +03:00
|
|
|
<br />
|
2020-07-14 07:28:18 +03:00
|
|
|
<System.P>
|
|
|
|
Use <System.CodeText>style</System.CodeText> to specify placement of
|
2020-07-15 00:55:52 +03:00
|
|
|
the fixed positioning notification list. Default is bottom right.
|
2020-07-14 07:28:18 +03:00
|
|
|
</System.P>
|
|
|
|
<br />
|
2020-07-21 03:56:14 +03:00
|
|
|
<CodeBlock>
|
2020-07-14 09:23:20 +03:00
|
|
|
{`class App extends React.Component {
|
|
|
|
render() {
|
2020-07-28 23:27:53 +03:00
|
|
|
return (
|
2020-07-14 09:23:20 +03:00
|
|
|
<React.Fragment>
|
|
|
|
<GlobalNotification style={{ bottom: 0, right: 0 }} />
|
2020-07-21 03:56:14 +03:00
|
|
|
{this.props.children}
|
2020-07-14 09:23:20 +03:00
|
|
|
</React.Fragment>
|
2020-07-28 23:27:53 +03:00
|
|
|
);
|
2020-07-14 09:23:20 +03:00
|
|
|
}
|
2020-07-14 07:28:18 +03:00
|
|
|
}`}
|
2020-07-21 03:56:14 +03:00
|
|
|
</CodeBlock>
|
2020-07-14 07:28:18 +03:00
|
|
|
<System.GlobalNotification style={{ bottom: 0, right: 0 }} />
|
2020-07-08 07:04:54 +03:00
|
|
|
<br />
|
|
|
|
<br />
|
|
|
|
<br />
|
2020-07-14 07:28:18 +03:00
|
|
|
<System.H2>Notification</System.H2>
|
|
|
|
<hr />
|
|
|
|
<br />
|
2020-08-02 22:17:13 +03:00
|
|
|
<System.ButtonSecondary
|
|
|
|
full
|
2020-07-14 07:28:18 +03:00
|
|
|
onClick={() =>
|
2020-07-15 00:55:52 +03:00
|
|
|
this._handleCreate({
|
2020-07-14 07:28:18 +03:00
|
|
|
id: this.state.count,
|
|
|
|
description: "This is a regular notification",
|
|
|
|
})
|
|
|
|
}
|
|
|
|
>
|
|
|
|
Click for notification
|
2020-08-02 22:17:13 +03:00
|
|
|
</System.ButtonSecondary>
|
2020-07-14 07:28:18 +03:00
|
|
|
<br />
|
2020-08-02 22:17:13 +03:00
|
|
|
<System.ButtonSecondary
|
|
|
|
full
|
2020-07-14 07:28:18 +03:00
|
|
|
onClick={() =>
|
2020-07-15 00:55:52 +03:00
|
|
|
this._handleCreate({
|
2020-07-14 07:28:18 +03:00
|
|
|
id: this.state.count,
|
|
|
|
description: "This is a dark notification",
|
|
|
|
dark: true,
|
|
|
|
})
|
|
|
|
}
|
|
|
|
>
|
|
|
|
Click for dark style notification
|
2020-08-02 22:17:13 +03:00
|
|
|
</System.ButtonSecondary>
|
2020-07-14 07:28:18 +03:00
|
|
|
<br />
|
2020-08-02 22:17:13 +03:00
|
|
|
<System.ButtonPrimary full onClick={this._handleDelete}>
|
2020-07-14 07:28:18 +03:00
|
|
|
Click to clear notifications
|
2020-08-02 22:17:13 +03:00
|
|
|
</System.ButtonPrimary>
|
2020-07-14 07:28:18 +03:00
|
|
|
<br />
|
|
|
|
<System.P>
|
|
|
|
A notification will only appear once you trigger it by creating a
|
|
|
|
custom event with the title{" "}
|
|
|
|
<System.CodeText>"create-notification"</System.CodeText>. It can be
|
|
|
|
removed with a custom event entitled{" "}
|
|
|
|
<System.CodeText>"delete-notification"</System.CodeText>.
|
|
|
|
</System.P>
|
2020-07-08 07:04:54 +03:00
|
|
|
<br />
|
2020-07-14 07:28:18 +03:00
|
|
|
<System.P>
|
|
|
|
Multiple stacked notifications can be created using a single
|
|
|
|
Notification component.{" "}
|
|
|
|
<strong>Each co-existing notification must have a unique id.</strong>
|
|
|
|
</System.P>
|
2020-07-08 07:04:54 +03:00
|
|
|
<br />
|
2020-07-21 03:56:14 +03:00
|
|
|
<CodeBlock>
|
2020-07-08 07:04:54 +03:00
|
|
|
{`class ExampleOne extends React.Component {
|
2020-07-14 07:28:18 +03:00
|
|
|
state = {
|
|
|
|
count: 0,
|
|
|
|
};
|
|
|
|
|
2020-07-15 00:55:52 +03:00
|
|
|
_handleCreate = (detail) => {
|
2020-07-15 01:26:08 +03:00
|
|
|
dispatchCustomEvent({ name: "create-notification", detail: detail });
|
2020-07-14 07:28:18 +03:00
|
|
|
this.setState({ count: this.state.count + 1 });
|
|
|
|
};
|
|
|
|
|
2020-07-15 01:26:08 +03:00
|
|
|
_handleDelete = () => {
|
|
|
|
dispatchCustomEvent({ name: "delete-notification", detail: {} });
|
2020-07-14 07:28:18 +03:00
|
|
|
};
|
|
|
|
|
|
|
|
render() {
|
2020-07-28 23:27:53 +03:00
|
|
|
return (
|
|
|
|
<React.Fragment>
|
2020-08-02 22:17:13 +03:00
|
|
|
<ButtonSecondary
|
|
|
|
full
|
2020-07-28 23:27:53 +03:00
|
|
|
onClick={() =>
|
|
|
|
this._handleCreate({
|
|
|
|
id: this.state.count,
|
|
|
|
description: "This is notification number " + this.state.count,
|
|
|
|
})
|
|
|
|
}
|
|
|
|
>
|
|
|
|
Click for notification
|
2020-08-02 22:17:13 +03:00
|
|
|
</ButtonSecondary>
|
2020-07-28 23:27:53 +03:00
|
|
|
<br />
|
2020-08-02 22:17:13 +03:00
|
|
|
<ButtonSecondary
|
|
|
|
full
|
2020-07-28 23:27:53 +03:00
|
|
|
onClick={() =>
|
|
|
|
this._handleCreate({
|
|
|
|
id: this.state.count,
|
|
|
|
description: "This is a dark notification",
|
|
|
|
dark: true,
|
|
|
|
})
|
|
|
|
}
|
|
|
|
>
|
|
|
|
Click for dark style notification
|
2020-08-02 22:17:13 +03:00
|
|
|
</ButtonSecondary>
|
2020-07-14 07:28:18 +03:00
|
|
|
|
2020-08-02 22:17:13 +03:00
|
|
|
<ButtonPrimary full onClick={this._handleDelete}>
|
2020-07-28 23:27:53 +03:00
|
|
|
Click to clear notifications
|
2020-08-02 22:17:13 +03:00
|
|
|
</ButtonPrimary>
|
2020-07-28 23:27:53 +03:00
|
|
|
</React.Fragment>
|
|
|
|
);
|
2020-07-14 07:28:18 +03:00
|
|
|
}
|
2020-07-08 07:04:54 +03:00
|
|
|
}`}
|
2020-07-21 03:56:14 +03:00
|
|
|
</CodeBlock>
|
2020-07-08 07:04:54 +03:00
|
|
|
<br />
|
|
|
|
<br />
|
|
|
|
<br />
|
2020-07-14 07:28:18 +03:00
|
|
|
<System.H2>Notification with timeout</System.H2>
|
2020-07-08 07:04:54 +03:00
|
|
|
<hr />
|
|
|
|
<br />
|
2020-08-02 22:17:13 +03:00
|
|
|
<System.ButtonSecondary
|
|
|
|
full
|
2020-07-14 07:28:18 +03:00
|
|
|
onClick={() =>
|
2020-07-15 00:55:52 +03:00
|
|
|
this._handleCreate({
|
2020-07-14 07:28:18 +03:00
|
|
|
id: this.state.count,
|
|
|
|
description: "This disappears after 5 seconds",
|
|
|
|
timeout: 5000,
|
|
|
|
})
|
2020-07-08 07:04:54 +03:00
|
|
|
}
|
2020-07-14 07:28:18 +03:00
|
|
|
>
|
|
|
|
Click for disappearing notification
|
2020-08-02 22:17:13 +03:00
|
|
|
</System.ButtonSecondary>
|
2020-07-14 07:28:18 +03:00
|
|
|
<br />
|
2020-08-02 22:17:13 +03:00
|
|
|
<System.ButtonPrimary full onClick={this._handleDelete}>
|
2020-07-14 07:28:18 +03:00
|
|
|
Click to clear notifications
|
2020-08-02 22:17:13 +03:00
|
|
|
</System.ButtonPrimary>
|
2020-07-08 07:04:54 +03:00
|
|
|
<br />
|
|
|
|
<System.P>
|
2020-07-14 07:28:18 +03:00
|
|
|
You can declare the Notification component with a{" "}
|
|
|
|
<System.CodeText>timeout</System.CodeText> (in milliseconds) after
|
|
|
|
which it will automatically disappear.
|
2020-07-08 07:04:54 +03:00
|
|
|
</System.P>
|
|
|
|
<br />
|
2020-07-21 03:56:14 +03:00
|
|
|
<CodeBlock>
|
2020-07-14 07:28:18 +03:00
|
|
|
{`class ExampleTwo extends React.Component {
|
|
|
|
state = {
|
|
|
|
count: 0,
|
|
|
|
};
|
|
|
|
|
2020-07-15 00:55:52 +03:00
|
|
|
_handleCreate = (detail) => {
|
2020-07-15 01:26:08 +03:00
|
|
|
dispatchCustomEvent({ name: "create-notification", detail: detail });
|
2020-07-14 07:28:18 +03:00
|
|
|
this.setState({ count: this.state.count + 1 });
|
|
|
|
};
|
|
|
|
|
|
|
|
render() {
|
2020-07-28 23:27:53 +03:00
|
|
|
return (
|
|
|
|
<React.Fragment>
|
2020-08-02 22:17:13 +03:00
|
|
|
<ButtonSecondary
|
|
|
|
full
|
2020-07-28 23:27:53 +03:00
|
|
|
onClick={() =>
|
|
|
|
this._handleCreate({
|
|
|
|
id: this.state.count,
|
|
|
|
description: "This disappears after 5 seconds",
|
|
|
|
timeout: 5000,
|
|
|
|
})
|
|
|
|
}
|
|
|
|
>
|
|
|
|
Click for disappearing notification
|
2020-08-02 22:17:13 +03:00
|
|
|
</ButtonSecondary>
|
2020-07-14 07:28:18 +03:00
|
|
|
|
2020-08-02 22:17:13 +03:00
|
|
|
<ButtonPrimary full onClick={this._handleDelete}>
|
2020-07-28 23:27:53 +03:00
|
|
|
Click to clear notifications
|
2020-08-02 22:17:13 +03:00
|
|
|
</ButtonPrimary>
|
2020-07-28 23:27:53 +03:00
|
|
|
</React.Fragment>
|
|
|
|
);
|
2020-07-14 07:28:18 +03:00
|
|
|
}
|
2020-07-08 07:04:54 +03:00
|
|
|
}`}
|
2020-07-21 03:56:14 +03:00
|
|
|
</CodeBlock>
|
2020-07-08 07:04:54 +03:00
|
|
|
<br />
|
|
|
|
<br />
|
|
|
|
<br />
|
2020-07-14 07:28:18 +03:00
|
|
|
<System.H2>Notification with status</System.H2>
|
2020-07-08 07:04:54 +03:00
|
|
|
<hr />
|
|
|
|
<br />
|
2020-08-02 22:17:13 +03:00
|
|
|
<System.ButtonSecondary
|
|
|
|
full
|
2020-07-14 07:28:18 +03:00
|
|
|
onClick={() =>
|
2020-07-15 00:55:52 +03:00
|
|
|
this._handleCreate({
|
2020-07-14 07:28:18 +03:00
|
|
|
id: this.state.count,
|
|
|
|
description: "This is an info notification",
|
|
|
|
status: "INFO",
|
|
|
|
})
|
|
|
|
}
|
|
|
|
>
|
|
|
|
Click for info style notification
|
2020-08-02 22:17:13 +03:00
|
|
|
</System.ButtonSecondary>
|
2020-07-14 07:28:18 +03:00
|
|
|
<br />
|
2020-08-02 22:17:13 +03:00
|
|
|
<System.ButtonSecondary
|
|
|
|
full
|
2020-07-14 07:28:18 +03:00
|
|
|
onClick={() =>
|
2020-07-15 00:55:52 +03:00
|
|
|
this._handleCreate({
|
2020-07-14 07:28:18 +03:00
|
|
|
id: this.state.count,
|
|
|
|
description: "This is a success notification",
|
|
|
|
status: "SUCCESS",
|
|
|
|
})
|
|
|
|
}
|
|
|
|
>
|
|
|
|
Click for success style notification
|
2020-08-02 22:17:13 +03:00
|
|
|
</System.ButtonSecondary>
|
2020-07-14 07:28:18 +03:00
|
|
|
<br />
|
2020-08-02 22:17:13 +03:00
|
|
|
<System.ButtonSecondary
|
|
|
|
full
|
2020-07-14 07:28:18 +03:00
|
|
|
onClick={() =>
|
2020-07-15 00:55:52 +03:00
|
|
|
this._handleCreate({
|
2020-07-14 07:28:18 +03:00
|
|
|
id: this.state.count,
|
|
|
|
description: "This is a warning notification",
|
|
|
|
status: "WARNING",
|
|
|
|
})
|
|
|
|
}
|
|
|
|
>
|
|
|
|
Click for warning style notification
|
2020-08-02 22:17:13 +03:00
|
|
|
</System.ButtonSecondary>
|
2020-07-14 07:28:18 +03:00
|
|
|
<br />
|
2020-08-02 22:17:13 +03:00
|
|
|
<System.ButtonSecondary
|
|
|
|
full
|
2020-07-14 07:28:18 +03:00
|
|
|
onClick={() =>
|
2020-07-15 00:55:52 +03:00
|
|
|
this._handleCreate({
|
2020-07-14 07:28:18 +03:00
|
|
|
id: this.state.count,
|
|
|
|
description: "This is an error notification",
|
|
|
|
status: "ERROR",
|
|
|
|
})
|
|
|
|
}
|
|
|
|
>
|
|
|
|
Click for error style notification
|
2020-08-02 22:17:13 +03:00
|
|
|
</System.ButtonSecondary>
|
2020-07-14 07:28:18 +03:00
|
|
|
<br />
|
2020-08-02 22:17:13 +03:00
|
|
|
<System.ButtonPrimary full onClick={this._handleDelete}>
|
2020-07-14 07:28:18 +03:00
|
|
|
Click to clear notifications
|
2020-08-02 22:17:13 +03:00
|
|
|
</System.ButtonPrimary>
|
2020-07-08 07:04:54 +03:00
|
|
|
<br />
|
|
|
|
<br />
|
|
|
|
<System.P>
|
2020-07-14 07:28:18 +03:00
|
|
|
Declare the Notification component with a{" "}
|
|
|
|
<System.CodeText>status</System.CodeText> to style it accordingly.
|
|
|
|
This is overridden if <System.CodeText>dark</System.CodeText> is set
|
|
|
|
to true.
|
2020-07-08 07:04:54 +03:00
|
|
|
</System.P>
|
|
|
|
<br />
|
2020-07-21 03:56:14 +03:00
|
|
|
<CodeBlock>
|
2020-07-14 07:28:18 +03:00
|
|
|
{`class ExampleThree extends React.Component {
|
|
|
|
state = {
|
|
|
|
count: 0,
|
|
|
|
};
|
2020-07-08 07:04:54 +03:00
|
|
|
|
2020-07-15 00:55:52 +03:00
|
|
|
_handleCreate = (detail) => {
|
2020-07-15 01:26:08 +03:00
|
|
|
dispatchCustomEvent({ name: "create-notification", detail: detail });
|
2020-07-14 07:28:18 +03:00
|
|
|
this.setState({ count: this.state.count + 1 });
|
|
|
|
};
|
|
|
|
|
2020-07-15 01:26:08 +03:00
|
|
|
_handleDelete = () => {
|
|
|
|
dispatchCustomEvent({ name: "delete-notification", detail: {} });
|
2020-07-14 07:28:18 +03:00
|
|
|
};
|
|
|
|
|
|
|
|
render() {
|
2020-07-28 23:27:53 +03:00
|
|
|
return (
|
|
|
|
<React.Fragment>
|
2020-08-02 22:17:13 +03:00
|
|
|
<ButtonSecondary
|
|
|
|
full
|
2020-07-28 23:27:53 +03:00
|
|
|
onClick={() =>
|
|
|
|
this._handleCreate({
|
|
|
|
id: this.state.count,
|
|
|
|
description: "This is an info notification",
|
|
|
|
status: "INFO",
|
|
|
|
})
|
|
|
|
}
|
|
|
|
>
|
|
|
|
Click for info style notification
|
2020-08-02 22:17:13 +03:00
|
|
|
</ButtonSecondary>
|
2020-07-14 07:28:18 +03:00
|
|
|
|
2020-08-02 22:17:13 +03:00
|
|
|
<ButtonSecondary
|
|
|
|
full
|
2020-07-28 23:27:53 +03:00
|
|
|
onClick={() =>
|
|
|
|
this._handleCreate({
|
|
|
|
id: this.state.count,
|
|
|
|
description: "This is a success notification",
|
|
|
|
status: "SUCCESS",
|
|
|
|
})
|
|
|
|
}
|
|
|
|
>
|
|
|
|
Click for success style notification
|
2020-08-02 22:17:13 +03:00
|
|
|
</ButtonSecondary>
|
2020-07-14 07:28:18 +03:00
|
|
|
|
2020-08-02 22:17:13 +03:00
|
|
|
<ButtonSecondary
|
|
|
|
full
|
2020-07-28 23:27:53 +03:00
|
|
|
onClick={() =>
|
|
|
|
this._handleCreate({
|
|
|
|
id: this.state.count,
|
|
|
|
description: "This is a warning notification",
|
|
|
|
status: "WARNING",
|
|
|
|
})
|
|
|
|
}
|
|
|
|
>
|
|
|
|
Click for warning style notification
|
2020-08-02 22:17:13 +03:00
|
|
|
</ButtonSecondary>
|
2020-07-14 07:28:18 +03:00
|
|
|
|
2020-08-02 22:17:13 +03:00
|
|
|
<ButtonSecondary
|
|
|
|
full
|
2020-07-28 23:27:53 +03:00
|
|
|
onClick={() =>
|
|
|
|
this._handleCreate({
|
|
|
|
id: this.state.count,
|
|
|
|
description: "This is an error notification",
|
|
|
|
status: "ERROR",
|
|
|
|
})
|
|
|
|
}
|
|
|
|
>
|
|
|
|
Click for error style notification
|
2020-08-02 22:17:13 +03:00
|
|
|
</ButtonSecondary>
|
2020-07-14 07:28:18 +03:00
|
|
|
|
2020-08-02 22:17:13 +03:00
|
|
|
<ButtonPrimary full onClick={this._handleDelete}>
|
2020-07-28 23:27:53 +03:00
|
|
|
Click to clear notifications
|
2020-08-02 22:17:13 +03:00
|
|
|
</ButtonPrimary>
|
2020-07-28 23:27:53 +03:00
|
|
|
</React.Fragment>
|
|
|
|
);
|
2020-07-14 07:28:18 +03:00
|
|
|
}
|
2020-07-08 07:04:54 +03:00
|
|
|
}`}
|
2020-07-21 03:56:14 +03:00
|
|
|
</CodeBlock>
|
2020-07-08 07:04:54 +03:00
|
|
|
<br />
|
|
|
|
<br />
|
|
|
|
<System.H2>Accepted React Properties</System.H2>
|
|
|
|
<hr />
|
|
|
|
<br />
|
|
|
|
<Group title="Notifications">
|
|
|
|
<System.Table
|
|
|
|
data={{
|
|
|
|
columns: [
|
|
|
|
{ key: "a", name: "Name", width: "128px" },
|
2020-07-14 07:28:18 +03:00
|
|
|
{ key: "b", name: "Type", width: "88px", type: "OBJECT_TYPE" },
|
|
|
|
{ key: "c", name: "Default", width: "88px" },
|
|
|
|
{ key: "d", name: "Description", width: "100%" },
|
|
|
|
],
|
|
|
|
rows: [
|
|
|
|
{
|
|
|
|
id: 1,
|
|
|
|
a: "style",
|
|
|
|
b: "Object",
|
2020-07-15 00:55:52 +03:00
|
|
|
c: "{ bottom: 0, right: 0 }",
|
2020-07-14 07:28:18 +03:00
|
|
|
d:
|
|
|
|
"Style object used to style the notification list positioning on the page",
|
|
|
|
},
|
|
|
|
],
|
|
|
|
}}
|
|
|
|
/>
|
|
|
|
</Group>
|
|
|
|
<br />
|
|
|
|
<br />
|
|
|
|
<br />
|
|
|
|
<System.H2>
|
|
|
|
Accepted <i>Create</i> Notification Properties
|
|
|
|
</System.H2>
|
|
|
|
<hr />
|
|
|
|
<br />
|
|
|
|
<System.P>
|
|
|
|
Note that these properties are passed through a custom event rather
|
|
|
|
than as react properties.
|
|
|
|
</System.P>
|
|
|
|
<br />
|
|
|
|
<Group title="Notifications">
|
|
|
|
<System.Table
|
|
|
|
data={{
|
|
|
|
columns: [
|
|
|
|
{ key: "a", name: "Name", width: "128px" },
|
|
|
|
{ key: "b", name: "Type", width: "88px", type: "OBJECT_TYPE" },
|
2020-07-08 07:04:54 +03:00
|
|
|
{ key: "c", name: "Default", width: "88px" },
|
|
|
|
{ key: "d", name: "Description", width: "100%" },
|
|
|
|
],
|
|
|
|
rows: [
|
|
|
|
{
|
|
|
|
id: 1,
|
2020-07-14 07:28:18 +03:00
|
|
|
a: (
|
|
|
|
<span style={{ fontFamily: Constants.font.semiBold }}>
|
|
|
|
id
|
|
|
|
</span>
|
|
|
|
),
|
|
|
|
b: ["string", "number"],
|
2020-07-08 07:04:54 +03:00
|
|
|
c: "null",
|
|
|
|
d:
|
2020-07-15 00:55:52 +03:00
|
|
|
"Notification id, must be unique for simultaneously existing notifications",
|
2020-07-08 07:04:54 +03:00
|
|
|
},
|
|
|
|
{
|
|
|
|
id: 2,
|
|
|
|
a: "status",
|
2020-07-14 07:28:18 +03:00
|
|
|
b: "string",
|
|
|
|
c: "null",
|
2020-07-08 07:04:54 +03:00
|
|
|
d:
|
|
|
|
"Status which determines the styling and color of the notification. Use INFO, SUCCESS, WARNING, or ERROR",
|
|
|
|
},
|
|
|
|
{
|
|
|
|
id: 3,
|
2020-07-14 07:28:18 +03:00
|
|
|
a: "timeout",
|
|
|
|
b: "int",
|
2020-07-08 07:04:54 +03:00
|
|
|
c: "null",
|
|
|
|
d:
|
2020-07-14 07:28:18 +03:00
|
|
|
"Number of milliseconds before the notification automatically disappears",
|
2020-07-08 07:04:54 +03:00
|
|
|
},
|
|
|
|
{
|
|
|
|
id: 4,
|
|
|
|
a: "label",
|
2020-07-14 07:28:18 +03:00
|
|
|
b: "string",
|
2020-07-08 07:04:54 +03:00
|
|
|
c: "null",
|
|
|
|
d: "Label text",
|
|
|
|
},
|
|
|
|
{
|
|
|
|
id: 5,
|
|
|
|
a: "description",
|
2020-07-14 07:28:18 +03:00
|
|
|
b: "string",
|
2020-07-08 07:04:54 +03:00
|
|
|
c: "null",
|
|
|
|
d: "Description text",
|
|
|
|
},
|
2020-07-14 07:28:18 +03:00
|
|
|
],
|
|
|
|
}}
|
|
|
|
/>
|
|
|
|
</Group>
|
2020-07-08 07:04:54 +03:00
|
|
|
</SystemPage>
|
|
|
|
);
|
|
|
|
}
|
|
|
|
}
|