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

    Type Alias ColumnDrawerConfig

    ColumnDrawerConfig:
        | {
            label: string;
            widget: typeof AUTOCOMPLETE_STRINGS;
            options: readonly string[];
            optionLabels?: Readonly<Record<string, string>>;
            emptyHelperText: string;
            placeholder?: string;
            bind: ColumnDrawerBinding;
        }
        | {
            label: string;
            widget: typeof AUTOCOMPLETE_OBJECTS;
            options: ReadonlyArray<{ code: string; label: string }>;
            emptyHelperText: string;
            placeholder?: string;
            bind: ColumnDrawerBinding;
        }
        | {
            label: string;
            widget: typeof CHIPS;
            options: readonly string[];
            formatChipLabel?: (option: string) => string;
            bind: ColumnDrawerBinding;
        }
        | {
            label: string;
            widget: typeof NUMBER_RANGE;
            adornment?: typeof CURRENCY
            | string & {};
            bind: ColumnDrawerBinding;
        }

    Column-meta payload describing how a column appears in the drawer accordion. Only columns with meta.drawer set are rendered there. The widget field picks the input component and must match the runtime type of options (e.g. DRAWER_WIDGET.AUTOCOMPLETE_OBJECTS needs { code: string; label: string }[]).

    The accordion's panelId is derived from the column id (search-${column.id}) — no need to repeat it per column.

    Type declaration

    • {
          label: string;
          widget: typeof AUTOCOMPLETE_STRINGS;
          options: readonly string[];
          optionLabels?: Readonly<Record<string, string>>;
          emptyHelperText: string;
          placeholder?: string;
          bind: ColumnDrawerBinding;
      }
      • label: string
      • widget: typeof AUTOCOMPLETE_STRINGS
      • options: readonly string[]

        Strings rendered as the option list.

      • OptionaloptionLabels?: Readonly<Record<string, string>>

        Optional display map for option strings, e.g. supplier key → name.

      • emptyHelperText: string

        Italic helper text shown under empty input.

      • Optionalplaceholder?: string
      • bind: ColumnDrawerBinding
    • {
          label: string;
          widget: typeof AUTOCOMPLETE_OBJECTS;
          options: ReadonlyArray<{ code: string; label: string }>;
          emptyHelperText: string;
          placeholder?: string;
          bind: ColumnDrawerBinding;
      }
    • {
          label: string;
          widget: typeof CHIPS;
          options: readonly string[];
          formatChipLabel?: (option: string) => string;
          bind: ColumnDrawerBinding;
      }
      • label: string
      • widget: typeof CHIPS
      • options: readonly string[]
      • OptionalformatChipLabel?: (option: string) => string

        Optional display transform (e.g. capitalize) for chip labels.

      • bind: ColumnDrawerBinding
    • {
          label: string;
          widget: typeof NUMBER_RANGE;
          adornment?: typeof CURRENCY | string & {};
          bind: ColumnDrawerBinding;
      }