Source code for daitum_ui.menu_configuration

# Copyright 2026 Daitum
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.


"""
Data menu configuration for the Daitum UI framework.

This module provides the MenuConfiguration class, which controls the visibility of standard
menu items and lets you build a custom data menu from ordered entries (imports, data sources,
reports, dividers, and model events).

Keyword-only arguments:
    The ``add_*_entry`` methods use a bare ``*`` in their signatures to mark every argument
    after it as keyword-only. Arguments before the ``*`` (such as ``key`` or ``event``) may be
    passed positionally, but options like ``icon``, ``prompt_user``, and ``prompt_text`` must be
    passed by name. This keeps call sites self-documenting and prevents options from being passed
    in the wrong position::

        menu.add_import_sheet_entry("jobs", icon=Icon.UPLOAD, prompt_user=True)  # correct
        menu.add_import_sheet_entry("jobs", Icon.UPLOAD)                         # TypeError
"""

from typeguard import typechecked

from daitum_ui._buildable import Buildable
from daitum_ui._data_menu_item import DataMenuEntryType, DataMenuItem
from daitum_ui.icons import Icon
from daitum_ui.model_event import ModelEvent