bga-cards
    Preparing search index...

    Interface SlotStockSettings<T>

    interface SlotStockSettings<T> {
        autoPlace?: (card: T) => boolean;
        cardClickEventFilter?: CardClickEventFilter;
        center?: boolean;
        counter?: CardCounterSettings;
        direction?: "row" | "column";
        gap?: string;
        lastPlayedCardStyle?: SelectionStyle;
        mapCardToSlot: (card: T) => SlotId;
        selectableCardStyle?: SelectionStyle;
        selectableSlotStyle?: SelectionStyle;
        selectedCardStyle?: SelectionStyle;
        selectedSlotStyle?: SelectionStyle;
        slotClasses?: string[];
        slotsIds: SlotId[];
        sort?: SortFunction<T>;
        unselectableCardStyle?: SelectionStyle;
        unselectableSlotStyle?: SelectionStyle;
        wrap?: "wrap" | "nowrap";
    }

    Type Parameters

    • T

    Hierarchy (View Summary)

    Index

    Properties

    autoPlace?: (card: T) => boolean

    Say if a given card should be placed on this stock, based on card properties. For example, every card with location === 'hand' and location_arg == this.player_id should go to the current player hand. If unset, all cards on this stock must be added manually on this stock.

    Type declaration

      • (card: T): boolean
      • Parameters

        • card: T

          the card to place on a stock

        Returns boolean

        true if the card should be placed on this stock.

    cardClickEventFilter?: CardClickEventFilter

    The filter on card click event. Use setting from manager is unset.

    center?: boolean

    indicate if the line should be centered (default yes)

    Show a card counter on the stock. Not visible if unset.

    direction?: "row" | "column"

    Indicate the line direction (default row)

    gap?: string

    CSS to set the gap between cards. '8px' if unset.

    lastPlayedCardStyle?: SelectionStyle

    The style to apply to the last played card. Default to class 'bga-cards_last-played-card'.

    mapCardToSlot: (card: T) => SlotId

    How to place the card on a slot automatically

    selectableCardStyle?: SelectionStyle

    The style to apply to selectable cards. Use style from manager is unset.

    selectableSlotStyle?: SelectionStyle

    The style to apply to selectable slots. Use class from manager is unset.

    selectedCardStyle?: SelectionStyle

    The style to apply to selected cards. Use style from manager is unset.

    selectedSlotStyle?: SelectionStyle

    The style to apply to selected slots. Use class from manager is unset.

    slotClasses?: string[]

    The classes to apply to each slot

    slotsIds: SlotId[]

    The ids for the slots (can be number or string)

    sort?: SortFunction<T>

    Indicate the card sorting (unset means no sorting, new cards will be added at the end). For example, use sort: sortFunction('type', '-type_arg') to sort by type then type_arg (in reversed order if prefixed with -). Be sure you typed the values correctly! Else '11' will be before '2'.

    unselectableCardStyle?: SelectionStyle

    The style to apply to selectable cards. Use style from manager is unset.

    unselectableSlotStyle?: SelectionStyle

    The style to apply to unselectable slots. Use class from manager is unset.

    wrap?: "wrap" | "nowrap"

    Indicate if the line should wrap when needed (default wrap)