UNPKG

fox-block-builder

Version:

Maintainable code for loop slack-block-kit-like modal builder

922 lines 36 kB
"use strict"; /* eslint-disable max-classes-per-file */ /* eslint-disable max-len */ Object.defineProperty(exports, "__esModule", { value: true }); exports.MaxFiles = exports.VideoUrl = exports.Value = exports.Url = exports.Ts = exports.TitleUrl = exports.Title = exports.ThumbnailUrl = exports.ThreadTs = exports.Text = exports.Submit = exports.ProviderName = exports.ProviderIconUrl = exports.PrivateMetaData = exports.PostAt = exports.Placeholder = exports.MinValue = exports.MinLength = exports.MinQueryLength = exports.MaxValue = exports.MaxSelectedItems = exports.MaxLength = exports.Label = exports.IsDecimalAllowed = exports.InitialValue = exports.InitialUser = exports.InitialTime = exports.InitialOption = exports.InitialDateTime = exports.InitialOffset = exports.InitialConversation = exports.InitialChannel = exports.ImageUrl = exports.Hint = exports.Fallback = exports.ExternalId = exports.Element = exports.Description = exports.Deny = exports.Confirm = exports.Color = exports.Close = exports.Channel = exports.CallbackId = exports.BlockId = exports.AuthorName = exports.AltText = exports.ActionId = exports.Accessory = exports.AccessibilityLabel = void 0; exports.InitialOffsetRange = exports.RegEx = exports.ImageSelectVariant = exports.OnSelect = exports.OnChange = exports.SubmitOnClick = exports.OneS = exports.Directory = exports.YearSince = exports.NoSubmit = exports.ForTeams = exports.MaxOffset = exports.MinOffset = exports.GetValue = exports.NotCustom = exports.CustomField = exports.Analytics = exports.AsTitle = exports.Access = exports.Filetypes = void 0; const lib_1 = require("../lib"); const constants_1 = require("../constants"); class AccessibilityLabel extends lib_1.Builder { /** * @description A label for longer descriptive text about a button element. This label will be read out by screen readers instead of the button text object. * * **Slack Validation Rules and Tips:** * * Maximum of 75 characters. * * {@link https://api.slack.com/block-kit|Open Official Slack Block Kit Documentation} * {@link https://www.blockbuilder.dev|Open Block Builder Documentation} */ accessibilityLabel(label) { return this.set(label, constants_1.Prop.AccessibilityLabel); } } exports.AccessibilityLabel = AccessibilityLabel; class Accessory extends lib_1.Builder { /** * @description Adds an element to the section block of your view or message. * * **Slack Validation Rules and Tips:** * * Maximum of 1 element. * * Can be any one of the elements. * * {@link https://api.slack.com/block-kit|Open Official Slack Block Kit Documentation} * {@link https://www.blockbuilder.dev|Open Block Builder Documentation} */ accessory(element) { return this.set(element, constants_1.Prop.Accessory); } } exports.Accessory = Accessory; class ActionId extends lib_1.Builder { /** * @description 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. * * **Slack Validation Rules and Tips:** * * **Required** ⚠ * * Each element in a view or message must have its own unique action ID. * * Maximum of 255 characters. * * {@link https://api.slack.com/block-kit|Open Official Slack Block Kit Documentation} * {@link https://www.blockbuilder.dev|Open Block Builder Documentation} */ actionId(actionId) { return this.set(actionId, constants_1.Prop.ActionId); } } exports.ActionId = ActionId; class AltText extends lib_1.Builder { /** * @description This a plain-text summary of the image element or block. * * **Slack Validation Rules and Tips:** * * **Required** ⚠ * * Should not contain any markup. * * Maximum of 2000 characters. * * * {@link https://api.slack.com/block-kit|Open Official Slack Block Kit Documentation} * {@link https://www.blockbuilder.dev|Open Block Builder Documentation} */ altText(altText) { return this.set(altText, constants_1.Prop.AltText); } } exports.AltText = AltText; class AuthorName extends lib_1.Builder { /** * @description This a plain-text representation of the author of a video. * * **Slack Validation Rules and Tips:** * * Maximum of 50 characters. * * * {@link https://api.slack.com/block-kit|Open Official Slack Block Kit Documentation} * {@link https://www.blockbuilder.dev|Open Block Builder Documentation} */ authorName(authorName) { return this.set(authorName, constants_1.Prop.AuthorName); } } exports.AuthorName = AuthorName; class BlockId extends lib_1.Builder { /** * @description Sets a string to be an identifier for any given block in a view or message. This is sent back to your app in interaction payloads and view submissions for your app to process. * * **Slack Validation Rules and Tips:** * * Maximum of 255 characters. * * Each block in a view or message must have its own unique action ID. * * If the contents of a block is updated, the block ID should also be updated. * * {@link https://api.slack.com/block-kit|Open Official Slack Block Kit Documentation} * {@link https://www.blockbuilder.dev|Open Block Builder Documentation} */ blockId(blockId) { return this.set(blockId, constants_1.Prop.BlockId); } } exports.BlockId = BlockId; class CallbackId extends lib_1.Builder { /** * @description Sets a string for your view that is sent back to your server in all of the interaction payloads and view submissions. Used to identify the view from which the interaction payload is generated. * * **Slack Validation Rules and Tips:** * * Maximum of 255 characters. * * It is recommended that sensitive data not be stored in the callback ID. Instead, use the `privateMetaData()` method. * * {@link https://api.slack.com/block-kit|Open Official Slack Block Kit Documentation} * {@link https://www.blockbuilder.dev|Open Block Builder Documentation} */ callbackId(callbackId) { return this.set(callbackId, constants_1.Prop.CallbackId); } } exports.CallbackId = CallbackId; class Channel extends lib_1.Builder { /** * @description Sets the Slack channel ID to which the message will be sent via the API. * * {@link https://api.slack.com/block-kit|Open Official Slack Block Kit Documentation} * {@link https://www.blockbuilder.dev|Open Block Builder Documentation} */ channel(channel) { return this.set(channel, constants_1.Prop.Channel); } } exports.Channel = Channel; class Close extends lib_1.Builder { /** * @description Sets the text displayed on the button that closes the view. * * **Slack Validation Rules and Tips:** * * Maximum of 24 characters. * * {@link https://api.slack.com/block-kit|Open Official Slack Block Kit Documentation} * {@link https://www.blockbuilder.dev|Open Block Builder Documentation} */ close(closeButtonText) { return this.set(closeButtonText, constants_1.Prop.Close); } } exports.Close = Close; class Color extends lib_1.Builder { /** * @description Sets the color for the blockquote border to the left of the attachment. * * {@link https://api.slack.com/block-kit|Open Official Slack Block Kit Documentation} * {@link https://www.blockbuilder.dev|Open Block Builder Documentation} */ color(color) { return this.set(color, constants_1.Prop.Color); } } exports.Color = Color; class Confirm extends lib_1.Builder { /** * @description 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. * * {@link https://api.slack.com/block-kit|Open Official Slack Block Kit Documentation} * {@link https://www.blockbuilder.dev|Open Block Builder Documentation} */ confirm(value) { return this.set(value, constants_1.Prop.Confirm); } } exports.Confirm = Confirm; class Deny extends lib_1.Builder { /** * @description Sets the text of the button that is meant to cancel the action or which the confirmation dialog was called. * * **Slack Validation Rules and Tips:** * * **Required** ⚠ * * Maximum of 30 characters. * * {@link https://api.slack.com/block-kit|Open Official Slack Block Kit Documentation} * {@link https://www.blockbuilder.dev|Open Block Builder Documentation} */ deny(text) { return this.set(text, constants_1.Prop.Deny); } } exports.Deny = Deny; class Description extends lib_1.Builder { /** * @description Sets the descriptive text displayed below the text field of the option or for a video, if creating a Video block. * * **Slack Validation Rules and Tips:** * * Maximum of 75 characters. * * {@link https://api.slack.com/block-kit|Open Official Slack Block Kit Documentation} * {@link https://www.blockbuilder.dev|Open Block Builder Documentation} */ description(description) { return this.set(description, constants_1.Prop.Description); } } exports.Description = Description; class Element extends lib_1.Builder { /** * @description Adds a user input element to the input block for gathering information from the user. * * **Slack Validation Rules and Tips:** * * **Required** ⚠ * * Maximum of 1 element. * * Supports text inputs, select and multi-select menus, as well as date pickers and checkbox inputs. * * {@link https://api.slack.com/block-kit|Open Official Slack Block Kit Documentation} * {@link https://www.blockbuilder.dev|Open Block Builder Documentation} */ element(element) { return this.set(element, constants_1.Prop.Element); } } exports.Element = Element; class ExternalId extends lib_1.Builder { /** * @description Sets a custom identifier for a view or file that must be unique for all views on a per-team basis. * * **Slack Validation Rules and Tips:** * * Maximum of 255 characters. * * When used, an external ID must be unique to a certain view. * * {@link https://api.slack.com/block-kit|Open Official Slack Block Kit Documentation} * {@link https://www.blockbuilder.dev|Open Block Builder Documentation} */ externalId(externalId) { return this.set(externalId, constants_1.Prop.ExternalId); } } exports.ExternalId = ExternalId; class Fallback extends lib_1.Builder { /** * @description Sets the plain text summary of the attachment used in clients that can't display formatted text (eg. IRC, mobile notifications). * * {@link https://api.slack.com/block-kit|Open Official Slack Block Kit Documentation} * {@link https://www.blockbuilder.dev|Open Block Builder Documentation} */ fallback(text) { return this.set(text, constants_1.Prop.Fallback); } } exports.Fallback = Fallback; class Hint extends lib_1.Builder { /** * @description Adds a hint below the input block to provide users with more context or instructions for using the input. * * **Slack Validation Rules and Tips:** * * Maximum of 2000 characters. * * {@link https://api.slack.com/block-kit|Open Official Slack Block Kit Documentation} * {@link https://www.blockbuilder.dev|Open Block Builder Documentation} */ hint(hint) { return this.set(hint, constants_1.Prop.Hint); } } exports.Hint = Hint; class ImageUrl extends lib_1.Builder { /** * @description Sets the source URL for the image block or element that you wish to include in your view or message. * * **Slack Validation Rules and Tips:** * * **Required** ⚠ * * Maximum of 2000 characters. * * {@link https://api.slack.com/block-kit|Open Official Slack Block Kit Documentation} * {@link https://www.blockbuilder.dev|Open Block Builder Documentation} */ imageUrl(url) { return this.set(url, constants_1.Prop.ImageUrl); } } exports.ImageUrl = ImageUrl; class InitialChannel extends lib_1.Builder { /** * @description Pre-populates the menu with a selected, default channel. * * {@link https://api.slack.com/block-kit|Open Official Slack Block Kit Documentation} * {@link https://www.blockbuilder.dev|Open Block Builder Documentation} */ initialChannel(channelId) { return this.set(channelId, constants_1.Prop.InitialChannel); } } exports.InitialChannel = InitialChannel; class InitialConversation extends lib_1.Builder { /** * @description Pre-populates the menu with a selected, default conversation. * * {@link https://api.slack.com/block-kit|Open Official Slack Block Kit Documentation} * {@link https://www.blockbuilder.dev|Open Block Builder Documentation} */ initialConversation(conversationId) { return this.set(conversationId, constants_1.Prop.InitialConversation); } } exports.InitialConversation = InitialConversation; class InitialOffset extends lib_1.Builder { /** * @description Pre-populates the date picker with a selected, default date. * * {@link https://api.slack.com/block-kit|Open Official Slack Block Kit Documentation} * {@link https://www.blockbuilder.dev|Open Block Builder Documentation} */ initialOffset(params) { return this.set(params, constants_1.Prop.InitialOffset); } } exports.InitialOffset = InitialOffset; class InitialDateTime extends lib_1.Builder { /** * @description Pre-populates the date time picker with a selected, default date and time. * * {@link https://api.slack.com/block-kit|Open Official Slack Block Kit Documentation} * {@link https://www.blockbuilder.dev|Open Block Builder Documentation} */ initialDateTime(params) { return this.set(params, constants_1.Prop.InitialDateTime); } } exports.InitialDateTime = InitialDateTime; class InitialOption extends lib_1.Builder { /** * @description Pre-populates the menu or date picker with a selected, default option. * * **Slack Validation Rules and Tips:** * * Must be an exact match for one of the options in the menu. * * {@link https://api.slack.com/block-kit|Open Official Slack Block Kit Documentation} * {@link https://www.blockbuilder.dev|Open Block Builder Documentation} */ initialOption(option) { return this.set(option, constants_1.Prop.InitialOption); } } exports.InitialOption = InitialOption; class InitialTime extends lib_1.Builder { /** * @description Pre-populates the time picker with a selected, default time. * * **Slack Validation Rules and Tips:** * * Set in HH:mm format, where HH is 24-hour hour format and mm is minutes with a leading zero. * * {@link https://api.slack.com/block-kit|Open Official Slack Block Kit Documentation} * {@link https://www.blockbuilder.dev|Open Block Builder Documentation} */ initialTime(time) { return this.set(time, constants_1.Prop.InitialTime); } } exports.InitialTime = InitialTime; class InitialUser extends lib_1.Builder { /** * @description Pre-populates the menu with a selected, default user. * * {@link https://api.slack.com/block-kit|Open Official Slack Block Kit Documentation} * {@link https://www.blockbuilder.dev|Open Block Builder Documentation} */ initialUser(userId) { return this.set(userId, constants_1.Prop.InitialUser); } } exports.InitialUser = InitialUser; class InitialValue extends lib_1.Builder { /** * @description Pre-populates the input with a default value. * * {@link https://api.slack.com/block-kit|Open Official Slack Block Kit Documentation} * {@link https://www.blockbuilder.dev|Open Block Builder Documentation} */ initialValue(value) { return this.set(value, constants_1.Prop.InitialValue); } } exports.InitialValue = InitialValue; class IsDecimalAllowed extends lib_1.Builder { /** * @description Dicates whether a decimal is allowed for the value entered into the number input. * * **Slack Validation Rules and Tips:** * * **Required** ⚠ * * {@link https://api.slack.com/block-kit|Open Official Slack Block Kit Documentation} * {@link https://www.blockbuilder.dev|Open Block Builder Documentation} */ isDecimalAllowed(value) { return this.set(value, constants_1.Prop.IsDecimalAllowed); } } exports.IsDecimalAllowed = IsDecimalAllowed; class Label extends lib_1.Builder { /** * @description For input blocks, this sets the text displayed in the label for the input. For an option group, it defines the text displayed as a title for the group. * * **Slack Validation Rules and Tips:** * * **Required** ⚠ * * For input blocks, maximum of 2000 characters. * * For option groups, maximum of 75 characters. * * {@link https://api.slack.com/block-kit|Open Official Slack Block Kit Documentation} * {@link https://www.blockbuilder.dev|Open Block Builder Documentation} */ label(label) { return this.set(label, constants_1.Prop.Label); } } exports.Label = Label; class MaxLength extends lib_1.Builder { /** * @description Sets a maximum character count allowed in the given text input. * * {@link https://api.slack.com/block-kit|Open Official Slack Block Kit Documentation} * {@link https://www.blockbuilder.dev|Open Block Builder Documentation} */ maxLength(length) { return this.set(length, constants_1.Prop.MaxLength); } } exports.MaxLength = MaxLength; class MaxSelectedItems extends lib_1.Builder { /** * @description Sets a limit to how many items the user can select in the multi-select menu. * * {@link https://api.slack.com/block-kit|Open Official Slack Block Kit Documentation} * {@link https://www.blockbuilder.dev|Open Block Builder Documentation} */ maxSelectedItems(quantity) { return this.set(quantity, constants_1.Prop.MaxSelectedItems); } } exports.MaxSelectedItems = MaxSelectedItems; class MaxValue extends lib_1.Builder { /** * @description Sets a maximum value for the number input. * * **Slack Validation Rules and Tips:** * * Cannot be less than the minimum value. * * {@link https://api.slack.com/block-kit|Open Official Slack Block Kit Documentation} * {@link https://www.blockbuilder.dev|Open Block Builder Documentation} */ maxValue(value) { return this.set(value, constants_1.Prop.MaxValue); } } exports.MaxValue = MaxValue; class MinQueryLength extends lib_1.Builder { /** * @description Sets a minimum number of characters required before Slack queries your app for a list of options. * * **Slack Validation Rules and Tips:** * * If not set, the request will be sent on every character entered or removed. * * {@link https://api.slack.com/block-kit|Open Official Slack Block Kit Documentation} * {@link https://www.blockbuilder.dev|Open Block Builder Documentation} */ minQueryLength(length) { return this.set(length, constants_1.Prop.MinQueryLength); } } exports.MinQueryLength = MinQueryLength; class MinLength extends lib_1.Builder { /** * @description Sets a minimum character count required for the given text input before the user can submit the view. * * **Slack Validation Rules and Tips:** * * Maximum 3000 characters. * * {@link https://api.slack.com/block-kit|Open Official Slack Block Kit Documentation} * {@link https://www.blockbuilder.dev|Open Block Builder Documentation} */ minLength(length) { return this.set(length, constants_1.Prop.MinLength); } } exports.MinLength = MinLength; class MinValue extends lib_1.Builder { /** * @description Sets a minimum value for the number input. * * **Slack Validation Rules and Tips:** * * Cannot be less than the maximum value. * * {@link https://api.slack.com/block-kit|Open Official Slack Block Kit Documentation} * {@link https://www.blockbuilder.dev|Open Block Builder Documentation} */ minValue(value) { return this.set(value, constants_1.Prop.MinValue); } } exports.MinValue = MinValue; class Placeholder extends lib_1.Builder { /** * @description Defines the text displayed as a placeholder in the empty input element. * * **Slack Validation Rules and Tips:** * * Maximum of 150 characters. * * {@link https://api.slack.com/block-kit|Open Official Slack Block Kit Documentation} * {@link https://www.blockbuilder.dev|Open Block Builder Documentation} */ placeholder(placeholder) { return this.set(placeholder, constants_1.Prop.Placeholder); } } exports.Placeholder = Placeholder; class PostAt extends lib_1.Builder { /** * @description Sets a time in the future for the message to be sent to the channel or user, as a scheduled message. * * {@link https://api.slack.com/block-kit|Open Official Slack Block Kit Documentation} * {@link https://www.blockbuilder.dev|Open Block Builder Documentation} */ postAt(timestamp) { return this.set(timestamp, constants_1.Prop.PostAt); } } exports.PostAt = PostAt; class PrivateMetaData extends lib_1.Builder { /** * @description Defines a string sent back to your server with view and interaction payloads. * * **Slack Validation Rules and Tips:** * * Maximum 3000 characters. * * Typically used to persist data or store context between views. * * {@link https://api.slack.com/block-kit|Open Official Slack Block Kit Documentation} * {@link https://www.blockbuilder.dev|Open Block Builder Documentation} */ privateMetaData(privateMetaData) { return this.set(privateMetaData, constants_1.Prop.PrivateMetaData); } } exports.PrivateMetaData = PrivateMetaData; class ProviderIconUrl extends lib_1.Builder { /** * @description Icon for the video provider - ex. YouTube or Vimeo icon. * * {@link https://api.slack.com/block-kit|Open Official Slack Block Kit Documentation} * {@link https://www.blockbuilder.dev|Open Block Builder Documentation} */ providerIconUrl(providerIconUrl) { return this.set(providerIconUrl, constants_1.Prop.ProviderIconUrl); } } exports.ProviderIconUrl = ProviderIconUrl; class ProviderName extends lib_1.Builder { /** * @description The originating application or domain of the video ex. YouTube or Vimeo. * * {@link https://api.slack.com/block-kit|Open Official Slack Block Kit Documentation} * {@link https://www.blockbuilder.dev|Open Block Builder Documentation} */ providerName(providerName) { return this.set(providerName, constants_1.Prop.ProviderName); } } exports.ProviderName = ProviderName; class Submit extends lib_1.Builder { /** * @description Sets the text displayed on the button that submits the view. * * **Slack Validation Rules and Tips:** * * Maximum of 24 characters. * * {@link https://api.slack.com/block-kit|Open Official Slack Block Kit Documentation} * {@link https://www.blockbuilder.dev|Open Block Builder Documentation} */ submit(text) { return this.set(text, constants_1.Prop.Submit); } } exports.Submit = Submit; class Text extends lib_1.Builder { /** * @description Sets the text displayed for buttons, headers, confirmation dialogs, sections, context blocks, and options. * * **Slack Validation Rules and Tips:** * * **Required for buttons, headers, confirmation dialogs, and option** ⚠ * * **Required for sections if fields are not defined** ⚠ * * For buttons and options, maximum of 75 characters. * * For confirmation dialogs, maximum of 75 characters. * * For section and header blocks, maximum of 3000 characters. * * {@link https://api.slack.com/block-kit|Open Official Slack Block Kit Documentation} * {@link https://www.blockbuilder.dev|Open Block Builder Documentation} */ text(text) { return this.set(text, constants_1.Prop.Text); } } exports.Text = Text; class ThreadTs extends lib_1.Builder { /** * @description Instructs the Slack API to send the message to the thread of the message associated with the timestamp. * * {@link https://api.slack.com/block-kit|Open Official Slack Block Kit Documentation} * {@link https://www.blockbuilder.dev|Open Block Builder Documentation} */ threadTs(threadTs) { return this.set(threadTs, constants_1.Prop.ThreadTs); } } exports.ThreadTs = ThreadTs; class ThumbnailUrl extends lib_1.Builder { /** * @description A URL that loads the thumbnail image of the video. * * **Slack Validation Rules and Tips:** * * **Required property for Video blocks** ⚠ * * {@link https://api.slack.com/block-kit|Open Official Slack Block Kit Documentation} * {@link https://www.blockbuilder.dev|Open Block Builder Documentation} */ thumbnailUrl(thumbnailUrl) { return this.set(thumbnailUrl, constants_1.Prop.ThumbnailUrl); } } exports.ThumbnailUrl = ThumbnailUrl; class Title extends lib_1.Builder { /** * @description Sets the title displayed for the block, element, or confirmation dialog. * * **Slack Validation Rules and Tips:** * * **Required for views and confirmation dialogs** ⚠ * * For views, maximum of 24 characters. * * For images, maximum of 2000 characters. * * For confirmation dialogs, maximum of 100 characters. * * {@link https://api.slack.com/block-kit|Open Official Slack Block Kit Documentation} * {@link https://www.blockbuilder.dev|Open Block Builder Documentation} */ title(title) { return this.set(title, constants_1.Prop.Title); } } exports.Title = Title; class TitleUrl extends lib_1.Builder { /** * @description A hyperlink for the video's title text. * * **Slack Validation Rules and Tips:** * * Must correspond to the non-embeddable URL for the video. * * Must go to an HTTPS URL. * * {@link https://api.slack.com/block-kit|Open Official Slack Block Kit Documentation} * {@link https://www.blockbuilder.dev|Open Block Builder Documentation} */ titleUrl(titleUrl) { return this.set(titleUrl, constants_1.Prop.TitleUrl); } } exports.TitleUrl = TitleUrl; class Ts extends lib_1.Builder { /** * @description Instructs the Slack API to use the message to replaced an existing message. * * {@link https://api.slack.com/block-kit|Open Official Slack Block Kit Documentation} * {@link https://www.blockbuilder.dev|Open Block Builder Documentation} */ ts(ts) { return this.set(ts, constants_1.Prop.Ts); } } exports.Ts = Ts; class Url extends lib_1.Builder { /** * @description Sets the URL to which the user is redirected when interacting with a button or option. * * **Slack Validation Rules and Tips:** * * Maximum of 3000 characters. * * For options, it is only supported for options in an overflow menu. * * {@link https://api.slack.com/block-kit|Open Official Slack Block Kit Documentation} * {@link https://www.blockbuilder.dev|Open Block Builder Documentation} */ url(url) { return this.set(url, constants_1.Prop.Url); } } exports.Url = Url; class Value extends lib_1.Builder { /** * @description Sets a value to be sent to your app when a user interacts with a button or option. * * **Slack Validation Rules and Tips:** * * For buttons, maximum of 2000 characters. * * For options, maximum of 75 characters. * * {@link https://api.slack.com/block-kit|Open Official Slack Block Kit Documentation} * {@link https://www.blockbuilder.dev|Open Block Builder Documentation} */ value(value) { return this.set(value, constants_1.Prop.Value); } } exports.Value = Value; class VideoUrl extends lib_1.Builder { /** * @description The URL of the video to embed in the Video block. * * **Slack Validation Rules and Tips:** * * **Required property for Video blocks** ⚠ * * Must match any existing unfurl domains within the app. * * Must point to an HTTPS URL. * * {@link https://api.slack.com/block-kit|Open Official Slack Block Kit Documentation} * {@link https://www.blockbuilder.dev|Open Block Builder Documentation} */ videoUrl(videoUrl) { return this.set(videoUrl, constants_1.Prop.VideoUrl); } } exports.VideoUrl = VideoUrl; class MaxFiles extends lib_1.Builder { /** * @description Maximum number of files that can be uploaded for this file_input element. Minimum of 1, maximum of 10. Defaults to 10 if not specified. * * {@link https://api.slack.com/block-kit|Open Official Slack Block Kit Documentation} * {@link https://www.blockbuilder.dev|Open Block Builder Documentation} */ maxFiles(maxFiles = 10) { return this.set(maxFiles, constants_1.Prop.MaxFiles); } } exports.MaxFiles = MaxFiles; class Filetypes extends lib_1.Builder { /** * @description An array of valid file extensions that will be accepted for this element. All file extensions will be accepted if filetypes is not specified. * * **Slack Validation Rules and Tips:** * * **Required if the text property is undefined** ⚠ * * Maximum of 10 items. * * Maximum of 2000 characters for each field. * * Markdown supported. * * {@link https://api.slack.com/block-kit|Open Official Slack Block Kit Documentation} * {@link https://www.blockbuilder.dev|Open Block Builder Documentation} */ filetypes(filetypes = []) { return this.set(filetypes.flat(), constants_1.Prop.Filetypes); } } exports.Filetypes = Filetypes; /** Расширенные методы нашего форка */ class Access extends lib_1.Builder { /** * @description Установка доступа по фиксированным группам */ access(access) { return this.set(access, constants_1.Prop.Access); } } exports.Access = Access; class AsTitle extends lib_1.Builder { /** * @description Установка названия задачи из текста блока */ asTitle(asTitle = true) { return this.set(asTitle, constants_1.Prop.AsTitle); } } exports.AsTitle = AsTitle; class Analytics extends lib_1.Builder { /** * @description Установка названия задачи из текста блока */ analytics(analytics) { return this.set(analytics, constants_1.Prop.Analytics); } } exports.Analytics = Analytics; class CustomField extends lib_1.Builder { /** * @description Установка customValue для планфикса */ customField(fieldId) { return this.set(fieldId, constants_1.Prop.CustomField); } } exports.CustomField = CustomField; class NotCustom extends lib_1.Builder { /** * @description Установка customValue для планфикса */ notCustom(notCustom) { return this.set(notCustom, constants_1.Prop.CustomField); } } exports.NotCustom = NotCustom; class GetValue extends lib_1.Builder { /** * @description Установка получения значения из блока */ getValue(getValue = true) { return this.set(getValue, constants_1.Prop.GetValue); } } exports.GetValue = GetValue; class MinOffset extends lib_1.Builder { /** * @description Простановка минимальной даты для плагина в Loop */ minOffset(offset) { return this.set(offset, constants_1.Prop.MinOffset); } } exports.MinOffset = MinOffset; class MaxOffset extends lib_1.Builder { /** * @description Простановка максимальной даты для плагина в Loop */ maxOffset(offset) { return this.set(offset, constants_1.Prop.MaxOffset); } } exports.MaxOffset = MaxOffset; class ForTeams extends lib_1.Builder { /** Установка команд которым видим блок */ forTeams(...teams) { return this.set(teams, constants_1.Prop.ForTeams); } } exports.ForTeams = ForTeams; class NoSubmit extends lib_1.Builder { /** Если блок видим - форму нельзя отправить */ noSubmit(noSubmit = true) { return this.set(noSubmit, constants_1.Prop.NoSubmit); } } exports.NoSubmit = NoSubmit; class YearSince extends lib_1.Builder { /** Установка года, с которого надо заполнить опции */ yearSince(params) { return this.set(params, constants_1.Prop.YearSince); } } exports.YearSince = YearSince; class Directory extends lib_1.Builder { /** * @description Установка хендбука для ПФ */ directory(name) { return this.set(name, constants_1.Prop.Directory); } } exports.Directory = Directory; class OneS extends lib_1.Builder { /** * @description Установка хендбука для ПФ */ oneS(name) { return this.set(name, constants_1.Prop.OneSType); } } exports.OneS = OneS; class SubmitOnClick extends lib_1.Builder { /** * @description Отправка при клике на кнопку */ submitOnClick(value = true) { return this.set(value, constants_1.Prop.SubmitOnClick); } } exports.SubmitOnClick = SubmitOnClick; class OnChange extends lib_1.Builder { /** * @description Действия при изменении значения */ onChange(params) { return this.set(params, constants_1.Prop.OnChange); } } exports.OnChange = OnChange; class OnSelect extends lib_1.Builder { /** * @description Действия при выборе опции */ onSelect(params) { return this.set(params, constants_1.Prop.OnSelect); } } exports.OnSelect = OnSelect; class ImageSelectVariant extends lib_1.Builder { /** * @description Тип image select */ variant(variant) { return this.set(variant, constants_1.Prop.Variant); } } exports.ImageSelectVariant = ImageSelectVariant; class RegEx extends lib_1.Builder { /** * @description Регекс для валидации */ regExp(regExp) { return this.set(regExp, constants_1.Prop.RegExp); } } exports.RegEx = RegEx; class InitialOffsetRange extends lib_1.Builder { /** * @description Pre-populates the date picker with a selected, default date. * * {@link https://api.slack.com/block-kit|Open Official Slack Block Kit Documentation} * {@link https://www.blockbuilder.dev|Open Block Builder Documentation} */ initialOffsetRange(params) { return this.set(params, constants_1.Prop.InitialOffsetRange); } } exports.InitialOffsetRange = InitialOffsetRange; //# sourceMappingURL=set-methods.js.map