ChemPal Documentation - v1.12.0
    Preparing search index...

    Variable ACTION_TYPEConst

    ACTION_TYPE: {
        SWITCH_CHANGE: "SWITCH_CHANGE";
        NESTED_SWITCH_CHANGE: "NESTED_SWITCH_CHANGE";
        NESTED_BUTTON_CLICK: "NESTED_BUTTON_CLICK";
        INPUT_CHANGE: "INPUT_CHANGE";
        SUPPLIER_TOGGLE: "SUPPLIER_TOGGLE";
        PRICE_TRACKING_CHANGE: "PRICE_TRACKING_CHANGE";
        CACHE_CHANGE: "CACHE_CHANGE";
        RESTORE_DEFAULTS: "RESTORE_DEFAULTS";
    } = ...

    Action types for settings panel form state management. Used by the SettingsPanel component.

    Type declaration

    • ReadonlySWITCH_CHANGE: "SWITCH_CHANGE"

      A toggle Switch changed; writes checked to the named setting

    • ReadonlyNESTED_SWITCH_CHANGE: "NESTED_SWITCH_CHANGE"

      A toggle Switch inside a nested group changed; writes checked to group.name

    • ReadonlyNESTED_BUTTON_CLICK: "NESTED_BUTTON_CLICK"

      A button-group option inside a nested group was clicked; writes value to group.name

    • ReadonlyINPUT_CHANGE: "INPUT_CHANGE"

      A text field or Select changed; writes value to the named setting

    • ReadonlySUPPLIER_TOGGLE: "SUPPLIER_TOGGLE"

      A supplier was enabled/disabled; replaces the disabled-suppliers list

    • ReadonlyPRICE_TRACKING_CHANGE: "PRICE_TRACKING_CHANGE"

      Price-tracking config changed; replaces the nested priceTracking object

    • ReadonlyCACHE_CHANGE: "CACHE_CHANGE"

      Cache config changed; replaces the nested caching object

    • ReadonlyRESTORE_DEFAULTS: "RESTORE_DEFAULTS"

      Resets the settings to their defaults

    export const ACTION_TYPE = {
    /** A toggle Switch changed; writes `checked` to the named setting */
    SWITCH_CHANGE: 'SWITCH_CHANGE',
    /** A toggle Switch inside a nested group changed; writes `checked` to `group.name` */
    NESTED_SWITCH_CHANGE: 'NESTED_SWITCH_CHANGE',
    /** A button-group option inside a nested group was clicked; writes `value` to `group.name` */
    NESTED_BUTTON_CLICK: 'NESTED_BUTTON_CLICK',
    /** A text field or Select changed; writes `value` to the named setting */
    INPUT_CHANGE: 'INPUT_CHANGE',
    /** A supplier was enabled/disabled; replaces the disabled-suppliers list */
    SUPPLIER_TOGGLE: 'SUPPLIER_TOGGLE',
    /** Price-tracking config changed; replaces the nested `priceTracking` object */
    PRICE_TRACKING_CHANGE: 'PRICE_TRACKING_CHANGE',
    /** Cache config changed; replaces the nested `caching` object */
    CACHE_CHANGE: 'CACHE_CHANGE',
    /** Resets the settings to their defaults */
    RESTORE_DEFAULTS: 'RESTORE_DEFAULTS',
    } as const;