main

mattermost/focalboard

Last updated at: 29/12/2023 09:42

property.tsx

TLDR

This file is a TypeScript module that exports a class named CheckboxProperty. It is a subclass of PropertyType and provides functionality related to a checkbox property.

Classes

CheckboxProperty

This class extends the PropertyType class and represents a checkbox property. It provides the following functionality:

  • The Editor property is set to the Checkbox component, used for editing the checkbox value.
  • The name property is set to 'Checkbox', indicating the type of property.
  • The type property is set to 'checkbox', indicating the type of property as a string.
  • The displayName method accepts an intl object and returns the translated display name for the checkbox property.
  • The canFilter property is set to true, indicating that this property supports filtering.
  • The filterValueType property is set to 'boolean', indicating that the filter value type for this property is boolean.
// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved.
// See LICENSE.txt for license information.
import {IntlShape} from 'react-intl'

import {PropertyType, PropertyTypeEnum, FilterValueType} from '../types'

import Checkbox from './checkbox'

export default class CheckboxProperty extends PropertyType {
    Editor = Checkbox
    name = 'Checkbox'
    type = 'checkbox' as PropertyTypeEnum
    displayName = (intl: IntlShape) => intl.formatMessage({id: 'PropertyType.Checkbox', defaultMessage: 'Checkbox'})
    canFilter = true
    filterValueType = 'boolean' as FilterValueType
}