Module

table/utils/table-properties

@ckeditor/ckeditor5-table/src/utils/table-properties

module

Filtering

Interfaces

Functions

  • addDefaultUnitToNumericValue( value, defaultUnit ) → string | number | undefined

    Adds a unit to a value if the value is a number or a string representing a number.

    Note: It does nothing to non-numeric values.

    getSingleValue( 25, 'px' ); // '25px'
    getSingleValue( 25, 'em' ); // '25em'
    getSingleValue( '25em', 'px' ); // '25em'
    getSingleValue( 'foo', 'px' ); // 'foo'
    

    Parameters

    value : undefined | string | number
    defaultUnit : string

    A default unit added to a numeric value.

    Returns

    string | number | undefined
  • getNormalizedDefaultProperties( config, options = { [options.includeAlignmentProperty], [options.includeHorizontalAlignmentProperty], [options.includePaddingProperty], [options.includeVerticalAlignmentProperty], [options.isRightToLeftContent] } ) → NormalizedDefaultProperties

    Returns the normalized configuration.

    Parameters

    config : undefined | Partial<NormalizedDefaultProperties>
    options : object
    Properties
    [ options.includeAlignmentProperty ] : boolean

    Whether the "alignment" property should be added.

    [ options.includeHorizontalAlignmentProperty ] : boolean

    Whether the "horizontalAlignment" property should be added.

    [ options.includePaddingProperty ] : boolean

    Whether the "padding" property should be added.

    [ options.includeVerticalAlignmentProperty ] : boolean

    Whether the "verticalAlignment" property should be added.

    [ options.isRightToLeftContent ] : boolean

    Whether the content is right-to-left.

    Defaults to {}

    Returns

    NormalizedDefaultProperties
  • getSingleValue( objectOrString ) → string | undefined

    Returns a string if all four values of box sides are equal.

    If a string is passed, it is treated as a single value (pass-through).

    // Returns 'foo':
    getSingleValue( { top: 'foo', right: 'foo', bottom: 'foo', left: 'foo' } );
    getSingleValue( 'foo' );
    
    // Returns undefined:
    getSingleValue( { top: 'foo', right: 'foo', bottom: 'bar', left: 'foo' } );
    getSingleValue( { top: 'foo', right: 'foo' } );
    

    Parameters

    objectOrString : undefined | string | BoxSides

    Returns

    string | undefined