-
-
Notifications
You must be signed in to change notification settings - Fork 47
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #105 from raycharius/v2.7.0
✨ Add new block elements
- Loading branch information
Showing
46 changed files
with
1,091 additions
and
74 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
# Date Picker | ||
|
||
?> **Note:** This document is a reference to the `DateTimePickerBuilder` object in **Block Builder**. For more information on how this carries over to the Slack API, view the [the Date Picker docs](https://api.slack.com/reference/block-kit/block-elements#datetimepicker) on Slack's doc site. | ||
|
||
### Creating an Instance | ||
|
||
The function that creates a new instance of `DateTimePickerBuilder` is available as both a top-level import and as a member of its 'category', `Elements`: | ||
|
||
```javascript | ||
import { DateTimePicker } from 'slack-block-builder'; | ||
|
||
const myObj = DateTimePicker(params?); | ||
|
||
``` | ||
```javascript | ||
import { Elements } from 'slack-block-builder'; | ||
|
||
const myObj = Elements.DateTimePicker(params?); | ||
``` | ||
### Params | ||
Each instance of the `DateTimePickerBuilder` object has chainable setter methods for the object's properties. However, properties with primitive values can optionally be passed to the instantiating function, should you prefer: | ||
`actionId` – *String* | ||
`initialDateTime` – *Date* | ||
?> **Note:** For an explanation of any one of the parameters, see its corresponding setter method below. | ||
### Setter Methods | ||
All setter methods return `this`, the instance of `DateTimePickerBuilder` on which it is called. | ||
```javascript | ||
DateTimePickerBuilder.focusOnLoad(boolean?); | ||
``` | ||
Sets an element to have auto focus on opening the view Defaults to `true`. | ||
```javascript | ||
DateTimePickerBuilder.actionId(string); | ||
``` | ||
Sets a string to be an identifier for the action taken by the user. It is sent back to your app in the interaction payload when the element is interacted or when the view is submitted. | ||
```javascript | ||
DateTimePickerBuilder.confirm(ConfirmationDialog); | ||
``` | ||
For confirmation dialogs, sets the text of the button that confirms the action to which the confirmation dialog has been added. For elements, adds a confirmation dialog that is displayed when the user interacts with the element to confirm the selection or action. | ||
```javascript | ||
DateTimePickerBuilder.initialDateTime(Date); | ||
``` | ||
Pre-populates the date time picker with a selected, default date and time. | ||
### Other Methods | ||
The `DateTimePickerBuilder` object also has other methods available: | ||
```javascript | ||
DateTimePickerBuilder.end(); | ||
``` | ||
Performs no alterations to the object on which it is called. It is meant to simulate a closing HTML tag for those who prefer to have an explicit end declared for an object. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,78 @@ | ||
# Email Input | ||
|
||
?> **Note:** This document is a reference to the `EmailInputBuilder` object in **Block Builder**. For more information on how this carries over to the Slack API, view the [the Email Input docs](https://api.slack.com/reference/block-kit/block-elements#email) on Slack's doc site. | ||
|
||
### Creating an Instance | ||
|
||
The function that creates a new instance of `EmailInputBuilder` is available as both a top-level import and as a member of its 'category', `Elements`: | ||
|
||
```javascript | ||
import { EmailInput } from 'slack-block-builder'; | ||
|
||
const myObj = EmailInput(params?); | ||
|
||
``` | ||
```javascript | ||
import { Elements } from 'slack-block-builder'; | ||
|
||
const myObj = Elements.EmailInput(params?); | ||
``` | ||
### Params | ||
Each instance of the `EmailInputBuilder` object has chainable setter methods for the object's properties. However, properties with primitive values can optionally be passed to the instantiating function, should you prefer: | ||
`actionId` – *String* | ||
`initialValue` – *String* | ||
`placeholder` – *String* | ||
?> **Note:** For an explanation of any one of the parameters, see its corresponding setter method below. | ||
### Setter Methods | ||
All setter methods return `this`, the instance of `EmailInputBuilder` on which it is called. | ||
```javascript | ||
EmailInputBuilder.dispatchActionOnCharacterEntered(boolean?); | ||
``` | ||
Instructs the Slack API to dispatch an interaction payload to your app when the user enters or deletes a character in the input. Defaults to `true`. | ||
```javascript | ||
EmailInputBuilder.dispatchActionOnEnterPressed(boolean?); | ||
``` | ||
Instructs the Slack API to dispatch an interaction payload to your app when the user presses the enter key while the input is in focus. Defaults to `true`. | ||
```javascript | ||
EmailInputBuilder.focusOnLoad(boolean?); | ||
``` | ||
Sets an element to have auto focus on opening the view Defaults to `true`. | ||
```javascript | ||
EmailInputBuilder.actionId(string); | ||
``` | ||
Sets a string to be an identifier for the action taken by the user. It is sent back to your app in the interaction payload when the element is interacted or when the view is submitted. | ||
```javascript | ||
EmailInputBuilder.initialValue(string); | ||
``` | ||
Pre-populates the input with a default value. | ||
```javascript | ||
EmailInputBuilder.placeholder(string); | ||
``` | ||
Defines the text displayed as a placeholder in the empty input element. | ||
### Other Methods | ||
The `EmailInputBuilder` object also has other methods available: | ||
```javascript | ||
EmailInputBuilder.end(); | ||
``` | ||
Performs no alterations to the object on which it is called. It is meant to simulate a closing HTML tag for those who prefer to have an explicit end declared for an object. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,99 @@ | ||
# Email Input | ||
|
||
?> **Note:** This document is a reference to the `NumberInputBuilder` object in **Block Builder**. For more information on how this carries over to the Slack API, view the [the Email Input docs](https://api.slack.com/reference/block-kit/block-elements#number) on Slack's doc site. | ||
|
||
### Creating an Instance | ||
|
||
The function that creates a new instance of `NumberInputBuilder` is available as both a top-level import and as a member of its 'category', `Elements`: | ||
|
||
```javascript | ||
import { NumberInput } from 'slack-block-builder'; | ||
|
||
const myObj = NumberInput(params?); | ||
|
||
``` | ||
```javascript | ||
import { Elements } from 'slack-block-builder'; | ||
|
||
const myObj = Elements.NumberInput(params?); | ||
``` | ||
### Params | ||
Each instance of the `NumberInputBuilder` object has chainable setter methods for the object's properties. However, properties with primitive values can optionally be passed to the instantiating function, should you prefer: | ||
`actionId` – *String* | ||
`initialValue` – *Int* | ||
`isDecimalAllowed` – *boolean* | ||
`minValue` – *Int* | ||
`maxValue` – *Int* | ||
`placeholder` – *String* | ||
?> **Note:** For an explanation of any one of the parameters, see its corresponding setter method below. | ||
### Setter Methods | ||
All setter methods return `this`, the instance of `NumberInputBuilder` on which it is called. | ||
```javascript | ||
NumberInputBuilder.dispatchActionOnCharacterEntered(boolean?); | ||
``` | ||
Instructs the Slack API to dispatch an interaction payload to your app when the user enters or deletes a character in the input. Defaults to `true`. | ||
```javascript | ||
NumberInputBuilder.dispatchActionOnEnterPressed(boolean?); | ||
``` | ||
Instructs the Slack API to dispatch an interaction payload to your app when the user presses the enter key while the input is in focus. Defaults to `true`. | ||
```javascript | ||
NumberInputBuilder.focusOnLoad(boolean?); | ||
``` | ||
Sets an element to have auto focus on opening the view Defaults to `true`. | ||
```javascript | ||
NumberInputBuilder.actionId(string); | ||
``` | ||
Sets a string to be an identifier for the action taken by the user. It is sent back to your app in the interaction payload when the element is interacted or when the view is submitted. | ||
```javascript | ||
NumberInputBuilder.initialValue(string); | ||
``` | ||
Pre-populates the input with a default value. | ||
```javascript | ||
NumberInputBuilder.isDecimalAllowed(boolean); | ||
``` | ||
Dicates whether a decimal is allowed for the value entered into the number input. | ||
```javascript | ||
NumberInputBuilder.maxValue(int); | ||
``` | ||
Sets a maximum value for the number input. | ||
```javascript | ||
NumberInputBuilder.minValue(int); | ||
``` | ||
Sets a minimum value for the number input. | ||
```javascript | ||
NumberInputBuilder.placeholder(string); | ||
``` | ||
Defines the text displayed as a placeholder in the empty input element. | ||
### Other Methods | ||
The `NumberInputBuilder` object also has other methods available: | ||
```javascript | ||
NumberInputBuilder.end(); | ||
``` | ||
Performs no alterations to the object on which it is called. It is meant to simulate a closing HTML tag for those who prefer to have an explicit end declared for an object. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.