chromium/ui/webui/resources/cr_elements/BUILD.gn

# Copyright 2018 The Chromium Authors
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.

import("//build/config/chromeos/ui_mode.gni")
import("//ui/webui/resources/include_polymer.gni")
import("//ui/webui/resources/tools/build_webui.gni")

build_webui("build") {
  grd_prefix = "webui_cr_elements"

  web_component_files = [
    "cr_tab_box/cr_tab_box.ts",
    "cr_tree/cr_tree.ts",
    "cr_tree/cr_tree_item.ts",
  ]

  non_web_component_files = [
    "cr_splitter/cr_splitter.ts",
    "cr_tree/cr_tree_base.ts",
  ]

  if (include_polymer) {
    web_component_files += [ "cr_a11y_announcer/cr_a11y_announcer.ts" ]

    icons_html_files = [
      "icons.html",
      "icons_lit.html",
    ]

    non_web_component_files += [
      "cr_container_shadow_mixin.ts",
      "cr_container_shadow_mixin_lit.ts",
      "cr_icon/iconset_map.ts",
      "cr_radio_button/cr_radio_button_mixin.ts",
      "cr_radio_button/cr_radio_button_mixin_lit.ts",
      "cr_ripple/cr_ripple_mixin.ts",
      "cr_scroll_observer_mixin.ts",
      "cr_scroll_observer_mixin_lit.ts",
      "cr_search_field/cr_search_field_mixin.ts",
      "cr_search_field/cr_search_field_mixin_lit.ts",
      "find_shortcut_mixin.ts",
      "focus_row_mixin.ts",
      "focus_row_mixin_delegate.ts",
      "focus_row_mixin_lit.ts",
      "i18n_mixin.ts",
      "i18n_mixin_lit.ts",
      "list_property_update_mixin.ts",
      "mouse_hoverable_mixin.ts",
      "mouse_hoverable_mixin_lit.ts",
      "policy/cr_policy_types.ts",
      "store_client/store_client.ts",
      "web_ui_listener_mixin.ts",
      "web_ui_listener_mixin_lit.ts",

      # Web components files that either
      #  - don't have a corresponding .html file or
      #  - have a checked-in *.html.ts wrapper file instead of auto-generated
      "cr_action_menu/cr_action_menu.html.ts",
      "cr_action_menu/cr_action_menu.ts",
      "cr_auto_img/cr_auto_img.ts",
      "cr_button/cr_button.html.ts",
      "cr_button/cr_button.ts",
      "cr_checkbox/cr_checkbox.html.ts",
      "cr_checkbox/cr_checkbox.ts",
      "cr_chip/cr_chip.html.ts",
      "cr_chip/cr_chip.ts",
      "cr_collapse/cr_collapse.html.ts",
      "cr_collapse/cr_collapse.ts",
      "cr_dialog/cr_dialog.html.ts",
      "cr_dialog/cr_dialog.ts",
      "cr_drawer/cr_drawer.html.ts",
      "cr_drawer/cr_drawer.ts",
      "cr_expand_button/cr_expand_button.html.ts",
      "cr_expand_button/cr_expand_button.ts",
      "cr_feedback_buttons/cr_feedback_buttons.html.ts",
      "cr_feedback_buttons/cr_feedback_buttons.ts",
      "cr_grid/cr_grid.html.ts",
      "cr_grid/cr_grid.ts",
      "cr_icon/cr_icon.ts",
      "cr_icon/cr_iconset.html.ts",
      "cr_icon/cr_iconset.ts",
      "cr_icon_button/cr_icon_button.html.ts",
      "cr_icon_button/cr_icon_button.ts",
      "cr_input/cr_input.html.ts",
      "cr_input/cr_input.ts",
      "cr_lazy_list/cr_lazy_list.ts",
      "cr_lazy_render/cr_lazy_render.ts",
      "cr_lazy_render/cr_lazy_render_lit.ts",
      "cr_link_row/cr_link_row.ts",
      "cr_link_row/cr_link_row.html.ts",
      "cr_loading_gradient/cr_loading_gradient.ts",
      "cr_loading_gradient/cr_loading_gradient.html.ts",
      "cr_lottie/cr_lottie.ts",
      "cr_lottie/cr_lottie.html.ts",
      "cr_menu_selector/cr_menu_selector.ts",
      "cr_menu_selector/cr_menu_selector.html.ts",
      "cr_page_selector/cr_page_selector.ts",
      "cr_page_selector/cr_page_selector.html.ts",
      "cr_profile_avatar_selector/cr_profile_avatar_selector.html.ts",
      "cr_profile_avatar_selector/cr_profile_avatar_selector.ts",
      "cr_progress/cr_progress.html.ts",
      "cr_progress/cr_progress.ts",
      "cr_radio_button/cr_card_radio_button.html.ts",
      "cr_radio_button/cr_card_radio_button.ts",
      "cr_radio_button/cr_radio_button.html.ts",
      "cr_radio_button/cr_radio_button.ts",
      "cr_radio_group/cr_radio_group.html.ts",
      "cr_radio_group/cr_radio_group.ts",
      "cr_ripple/cr_ripple.ts",
      "cr_search_field/cr_search_field.html.ts",
      "cr_search_field/cr_search_field.ts",
      "cr_selectable_mixin.ts",
      "cr_slider/cr_slider.html.ts",
      "cr_slider/cr_slider.ts",
      "cr_tabs/cr_tabs.html.ts",
      "cr_tabs/cr_tabs.ts",
      "cr_textarea/cr_textarea.html.ts",
      "cr_textarea/cr_textarea.ts",
      "cr_toast/cr_toast.html.ts",
      "cr_toast/cr_toast_manager.html.ts",
      "cr_toast/cr_toast_manager.ts",
      "cr_toast/cr_toast.ts",
      "cr_toggle/cr_toggle.html.ts",
      "cr_toggle/cr_toggle.ts",
      "cr_toolbar/cr_toolbar.html.ts",
      "cr_toolbar/cr_toolbar_search_field.html.ts",
      "cr_toolbar/cr_toolbar_search_field.ts",
      "cr_toolbar/cr_toolbar_selection_overlay.html.ts",
      "cr_toolbar/cr_toolbar_selection_overlay.ts",
      "cr_toolbar/cr_toolbar.ts",
      "cr_tooltip/cr_tooltip.html.ts",
      "cr_tooltip/cr_tooltip.ts",
      "cr_url_list_item/cr_url_list_item.html.ts",
      "cr_url_list_item/cr_url_list_item.ts",
      "cr_view_manager/cr_view_manager.html.ts",
      "cr_view_manager/cr_view_manager.ts",
      "policy/cr_policy_indicator.html.ts",
      "policy/cr_policy_indicator.ts",
      "policy/cr_tooltip_icon.html.ts",
      "policy/cr_tooltip_icon.ts",
    ]

    css_files = [
      "action_link.css",
      "action_link_lit.css",
      "cr_actionable_row_style.css",
      "cr_actionable_row_style_lit.css",
      "cr_hidden_style.css",
      "cr_hidden_style_lit.css",
      "cr_icons.css",
      "cr_icons_lit.css",
      "cr_nav_menu_item_style.css",
      "cr_nav_menu_item_style_lit.css",
      "cr_page_host_style.css",
      "cr_page_host_style_lit.css",
      "cr_lazy_list/cr_lazy_list.css",
      "cr_radio_button/cr_radio_button.css",
      "cr_radio_button/cr_card_radio_button.css",
      "cr_radio_button/cr_radio_button_style.css",
      "cr_radio_button/cr_radio_button_style_lit.css",
      "cr_radio_group/cr_radio_group.css",
      "cr_shared_style.css",
      "cr_shared_style_lit.css",
      "cr_shared_vars.css",
      "md_select.css",
      "md_select_lit.css",
      "mwb_element_shared_style.css",
      "mwb_element_shared_style_lit.css",
      "mwb_shared_style.css",
      "mwb_shared_style_lit.css",
      "mwb_shared_vars.css",
      "search_highlight_style.css",
      "cr_action_menu/cr_action_menu.css",
      "cr_button/cr_button.css",
      "cr_checkbox/cr_checkbox.css",
      "cr_chip/cr_chip.css",
      "cr_collapse/cr_collapse.css",
      "cr_dialog/cr_dialog.css",
      "cr_drawer/cr_drawer.css",
      "cr_expand_button/cr_expand_button.css",
      "cr_feedback_buttons/cr_feedback_buttons.css",
      "cr_grid/cr_grid.css",
      "cr_icon/cr_icon.css",
      "cr_icon/cr_iconset.css",
      "cr_icon_button/cr_icon_button.css",
      "cr_input/cr_input.css",
      "cr_input/cr_input_style.css",
      "cr_input/cr_input_style_lit.css",
      "cr_link_row/cr_link_row.css",
      "cr_loading_gradient/cr_loading_gradient.css",
      "cr_lottie/cr_lottie.css",
      "cr_page_selector/cr_page_selector.css",
      "cr_profile_avatar_selector/cr_profile_avatar_selector.css",
      "cr_progress/cr_progress.css",
      "cr_ripple/cr_ripple.css",
      "cr_search_field/cr_search_field.css",
      "cr_slider/cr_slider.css",
      "cr_tabs/cr_tabs.css",
      "cr_textarea/cr_textarea.css",
      "cr_toast/cr_toast.css",
      "cr_toast/cr_toast_manager.css",
      "cr_toggle/cr_toggle.css",
      "cr_toolbar/cr_toolbar.css",
      "cr_toolbar/cr_toolbar_search_field.css",
      "cr_toolbar/cr_toolbar_selection_overlay.css",
      "cr_tooltip/cr_tooltip.css",
      "cr_url_list_item/cr_url_list_item.css",
      "cr_view_manager/cr_view_manager.css",
      "policy/cr_policy_indicator.css",
      "policy/cr_tooltip_icon.css",
    ]
  }

  html_to_wrapper_template = "detect"

  ts_tsconfig_base = "//tools/typescript/tsconfig_base_lit.json"
  ts_out_dir = "$root_gen_dir/ui/webui/resources/tsc/cr_elements"
  ts_composite = true
  ts_deps = [ "../js:build_ts" ]
  if (include_polymer) {
    ts_deps += [
      "//third_party/lit/v3_0:build_ts",
      "//third_party/polymer/v3_0:library",
    ]
  }
  ts_definitions = [
    "//tools/typescript/definitions/chrome_event.d.ts",
    "//tools/typescript/definitions/pending.d.ts",
    "//tools/typescript/definitions/settings_private.d.ts",
  ]
  webui_context_type = "relative"
  generate_grdp = true
  grd_resource_path_prefix = rebase_path(".", "//ui/webui/resources")
}