@gitlab/ui 132.0.1 → 132.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/charts.js +13 -0
- package/dist/components/base/accordion/accordion.js +69 -0
- package/dist/components/base/accordion/accordion_item.js +160 -0
- package/dist/components/base/accordion/constants.js +3 -0
- package/dist/components/base/alert/alert.js +263 -0
- package/dist/components/base/animated_icon/animated_chevron_down_up_icon.js +45 -0
- package/dist/components/base/animated_icon/animated_chevron_lg_down_up_icon.js +45 -0
- package/dist/components/base/animated_icon/animated_chevron_lg_right_down_icon.js +45 -0
- package/dist/components/base/animated_icon/animated_chevron_right_down_icon.js +45 -0
- package/dist/components/base/animated_icon/animated_duo_chat_icon.js +45 -0
- package/dist/components/base/animated_icon/animated_loader_icon.js +45 -0
- package/dist/components/base/animated_icon/animated_notifications_icon.js +45 -0
- package/dist/components/base/animated_icon/animated_sidebar_icon.js +45 -0
- package/dist/components/base/animated_icon/animated_smile_icon.js +45 -0
- package/dist/components/base/animated_icon/animated_sort_icon.js +45 -0
- package/dist/components/base/animated_icon/animated_star_icon.js +45 -0
- package/dist/components/base/animated_icon/animated_todo_icon.js +45 -0
- package/dist/components/base/animated_icon/animated_upload_icon.js +45 -0
- package/dist/components/base/animated_icon/base_animated_icon.js +77 -0
- package/dist/components/base/attribute_list/attribute_list.js +100 -0
- package/dist/components/base/avatar/avatar.js +175 -0
- package/dist/components/base/avatar/utils.js +17 -0
- package/dist/components/base/avatar_labeled/avatar_labeled.js +198 -0
- package/dist/components/base/avatar_link/avatar_link.js +47 -0
- package/dist/components/base/avatars_inline/avatars_inline.js +139 -0
- package/dist/components/base/badge/badge.js +197 -0
- package/dist/components/base/banner/banner.js +149 -0
- package/dist/components/base/breadcrumb/breadcrumb.js +282 -0
- package/dist/components/base/breadcrumb/breadcrumb_item.js +96 -0
- package/dist/components/base/broadcast_message/broadcast_message.js +113 -0
- package/dist/components/base/broadcast_message/constants.js +5 -0
- package/dist/components/base/button/button.js +419 -0
- package/dist/components/base/button_group/button_group.js +53 -0
- package/dist/components/base/card/card.js +69 -0
- package/dist/components/base/collapse/collapse.js +163 -0
- package/dist/components/base/color_mode_toggle/color_mode_toggle.js +92 -0
- package/dist/components/base/datepicker/datepicker.js +475 -0
- package/dist/components/base/daterange_picker/daterange_picker.js +394 -0
- package/dist/components/base/drawer/drawer.js +156 -0
- package/dist/components/base/dropdown/dropdown.js +330 -0
- package/dist/components/base/dropdown/dropdown_divider.js +48 -0
- package/dist/components/base/dropdown/dropdown_form.js +48 -0
- package/dist/components/base/dropdown/dropdown_item.js +175 -0
- package/dist/components/base/dropdown/dropdown_section_header.js +48 -0
- package/dist/components/base/dropdown/dropdown_text.js +48 -0
- package/dist/components/base/filtered_search/common_story_options.js +14 -0
- package/dist/components/base/filtered_search/filtered_search.js +428 -0
- package/dist/components/base/filtered_search/filtered_search_suggestion.js +95 -0
- package/dist/components/base/filtered_search/filtered_search_suggestion_list.js +139 -0
- package/dist/components/base/filtered_search/filtered_search_term.js +217 -0
- package/dist/components/base/filtered_search/filtered_search_token.js +383 -0
- package/dist/components/base/filtered_search/filtered_search_token_segment.js +444 -0
- package/dist/components/base/filtered_search/filtered_search_utils.js +241 -0
- package/dist/components/base/form/form.js +43 -0
- package/dist/components/base/form/form_character_count/form_character_count.js +107 -0
- package/dist/components/base/form/form_checkbox/form_checkbox.js +342 -0
- package/dist/components/base/form/form_checkbox/form_checkbox_group.js +188 -0
- package/dist/components/base/form/form_combobox/constants.js +55 -0
- package/dist/components/base/form/form_combobox/form_combobox.js +239 -0
- package/dist/components/base/form/form_date/form_date.js +143 -0
- package/dist/components/base/form/form_fields/form_field_validator.js +93 -0
- package/dist/components/base/form/form_fields/form_fields.js +289 -0
- package/dist/components/base/form/form_fields/form_fields_loop.js +75 -0
- package/dist/components/base/form/form_fields/mappers.js +13 -0
- package/dist/components/base/form/form_fields/validators.js +48 -0
- package/dist/components/base/form/form_group/form_group.js +119 -0
- package/dist/components/base/form/form_input/form_input.js +695 -0
- package/dist/components/base/form/form_input_group/form_input_group.js +120 -0
- package/dist/components/base/form/form_input_group/form_input_group_mixin.js +41 -0
- package/dist/components/base/form/form_radio/form_radio.js +259 -0
- package/dist/components/base/form/form_radio_group/form_radio_group.js +189 -0
- package/dist/components/base/form/form_select/constants.js +12 -0
- package/dist/components/base/form/form_select/form_select.js +96 -0
- package/dist/components/base/form/form_textarea/form_textarea.js +166 -0
- package/dist/components/base/form/input_group_text/input_group_text.js +43 -0
- package/dist/components/base/icon/icon.js +113 -0
- package/dist/components/base/illustration/illustration.js +80 -0
- package/dist/components/base/infinite_scroll/infinite_scroll.js +196 -0
- package/dist/components/base/keyset_pagination/keyset_pagination.js +152 -0
- package/dist/components/base/label/label.js +174 -0
- package/dist/components/base/link/link.js +330 -0
- package/dist/components/base/loading_icon/loading_icon.js +120 -0
- package/dist/components/base/markdown/markdown.js +50 -0
- package/dist/components/base/modal/modal.js +259 -0
- package/dist/components/base/new_dropdowns/base_dropdown/base_dropdown.js +716 -0
- package/dist/components/base/new_dropdowns/base_dropdown/constants.js +5 -0
- package/dist/components/base/new_dropdowns/base_dropdown/dropdown_container.js +32 -0
- package/dist/components/base/new_dropdowns/constants.js +24 -0
- package/dist/components/base/new_dropdowns/disclosure/constants.js +8 -0
- package/dist/components/base/new_dropdowns/disclosure/disclosure_dropdown.js +400 -0
- package/dist/components/base/new_dropdowns/disclosure/disclosure_dropdown_group.js +112 -0
- package/dist/components/base/new_dropdowns/disclosure/disclosure_dropdown_item.js +196 -0
- package/dist/components/base/new_dropdowns/disclosure/mock_data.js +168 -0
- package/dist/components/base/new_dropdowns/disclosure/utils.js +84 -0
- package/dist/components/base/new_dropdowns/listbox/listbox.js +997 -0
- package/dist/components/base/new_dropdowns/listbox/listbox_group.js +58 -0
- package/dist/components/base/new_dropdowns/listbox/listbox_item.js +112 -0
- package/dist/components/base/new_dropdowns/listbox/listbox_search_input.js +94 -0
- package/dist/components/base/new_dropdowns/listbox/mock_data.js +131 -0
- package/dist/components/base/new_dropdowns/listbox/utils.js +33 -0
- package/dist/components/base/pagination/pagination.js +397 -0
- package/dist/components/base/path/data.js +34 -0
- package/dist/components/base/path/path.js +177 -0
- package/dist/components/base/popover/popover.js +142 -0
- package/dist/components/base/progress_bar/progress_bar.js +117 -0
- package/dist/components/base/search_box_by_click/search_box_by_click.js +245 -0
- package/dist/components/base/search_box_by_type/search_box_by_type.js +187 -0
- package/dist/components/base/segmented_control/segmented_control.js +73 -0
- package/dist/components/base/skeleton_loader/skeleton_loader.js +232 -0
- package/dist/components/base/sorting/sorting.js +180 -0
- package/dist/components/base/table/constants.js +5 -0
- package/dist/components/base/table/table.js +187 -0
- package/dist/components/base/table_lite/table_lite.js +80 -0
- package/dist/components/base/tabs/constants.js +3 -0
- package/dist/components/base/tabs/tab/tab.js +113 -0
- package/dist/components/base/tabs/tabs/scrollable_tabs.js +162 -0
- package/dist/components/base/tabs/tabs/tabs.js +223 -0
- package/dist/components/base/toast/index.js +66 -0
- package/dist/components/base/toast/toast.js +125 -0
- package/dist/components/base/toast/toaster.js +87 -0
- package/dist/components/base/toggle/toggle.js +178 -0
- package/dist/components/base/token/token.js +97 -0
- package/dist/components/base/token_selector/helpers.js +5 -0
- package/dist/components/base/token_selector/token_container.js +160 -0
- package/dist/components/base/token_selector/token_selector.js +454 -0
- package/dist/components/base/token_selector/token_selector_dropdown.js +223 -0
- package/dist/components/base/tooltip/tooltip.js +54 -0
- package/dist/components/charts/area/area.js +329 -0
- package/dist/components/charts/bar/bar.js +207 -0
- package/dist/components/charts/chart/chart.js +215 -0
- package/dist/components/charts/column/column.js +221 -0
- package/dist/components/charts/discrete_scatter/discrete_scatter.js +199 -0
- package/dist/components/charts/gauge/gauge.js +205 -0
- package/dist/components/charts/heatmap/heatmap.js +299 -0
- package/dist/components/charts/heatmap/index.js +2 -0
- package/dist/components/charts/legend/legend.js +245 -0
- package/dist/components/charts/line/line.js +340 -0
- package/dist/components/charts/series_label/series_label.js +101 -0
- package/dist/components/charts/shared/tooltip/tooltip.js +369 -0
- package/dist/components/charts/shared/tooltip/tooltip_default_format/tooltip_default_format.js +53 -0
- package/dist/components/charts/single_stat/single_stat.js +164 -0
- package/dist/components/charts/sparkline/sparkline.js +299 -0
- package/dist/components/charts/stacked_column/stacked_column.js +380 -0
- package/dist/components/dashboards/dashboard_layout/dashboard_layout.js +125 -0
- package/dist/components/dashboards/dashboard_layout/grid_layout/grid_layout.js +326 -0
- package/dist/components/dashboards/dashboard_layout/validators.js +14 -0
- package/dist/components/dashboards/dashboard_panel/dashboard_panel.js +236 -0
- package/dist/components/dashboards/mock_data.js +49 -0
- package/dist/components/experimental/experiment_badge/constants.js +4 -0
- package/dist/components/experimental/experiment_badge/experiment_badge.js +102 -0
- package/dist/components/extended/multi_step_form_template/multi_step_form_template.js +87 -0
- package/dist/components/index.js +107 -0
- package/dist/components/mixins/button_mixin.js +11 -0
- package/dist/components/mixins/safe_link_mixin.js +30 -0
- package/dist/components/mixins/tooltip_mixin.js +21 -0
- package/dist/components/regions/dashboard_skeleton/dashboard_skeleton.js +53 -0
- package/dist/components/regions/empty_state/empty_state.js +181 -0
- package/dist/components/shared_components/clear_icon_button/clear_icon_button.js +64 -0
- package/dist/components/shared_components/clipboard_button/clipboard_button.js +100 -0
- package/dist/components/shared_components/close_button/close_button.js +55 -0
- package/dist/components/utilities/animated_number/animated_number.js +131 -0
- package/dist/components/utilities/friendly_wrap/friendly_wrap.js +75 -0
- package/dist/components/utilities/intersection_observer/intersection_observer.js +88 -0
- package/dist/components/utilities/intersperse/intersperse.js +104 -0
- package/dist/components/utilities/sprintf/sprintf.js +171 -0
- package/dist/components/utilities/truncate/constants.js +8 -0
- package/dist/components/utilities/truncate/truncate.js +154 -0
- package/dist/components/utilities/truncate_text/constants.js +7 -0
- package/dist/components/utilities/truncate_text/truncate_text.js +146 -0
- package/dist/config.js +53 -0
- package/dist/directives/hover_load/hover_load.js +45 -0
- package/dist/directives/index.js +8 -0
- package/dist/directives/modal.js +1 -0
- package/dist/directives/outside/outside.js +149 -0
- package/dist/directives/resize_observer/resize_observer.js +58 -0
- package/dist/directives/safe_html/constants.js +6 -0
- package/dist/directives/safe_html/safe_html.js +39 -0
- package/dist/directives/safe_link/mock_data.js +10 -0
- package/dist/directives/safe_link/safe_link.js +67 -0
- package/dist/directives/tooltip/container.js +7 -0
- package/dist/directives/tooltip/tooltip.js +18 -0
- package/dist/index.css +7 -0
- package/dist/index.css.map +1 -0
- package/dist/index.js +2 -0
- package/dist/tailwind.css +2 -0
- package/dist/tailwind.css.map +1 -0
- package/dist/tokens/build/js/tokens.dark.js +1410 -0
- package/dist/tokens/build/js/tokens.js +1410 -0
- package/dist/tokens/common_story_options.js +29 -0
- package/dist/tokens/tokens_story.js +76 -0
- package/dist/utils/breakpoints.js +20 -0
- package/dist/utils/charts/config.js +616 -0
- package/dist/utils/charts/constants.js +69 -0
- package/dist/utils/charts/mock_data.js +191 -0
- package/dist/utils/charts/story_config.js +24 -0
- package/dist/utils/charts/theme.js +200 -0
- package/dist/utils/charts/utils.js +54 -0
- package/dist/utils/constants.js +331 -0
- package/dist/utils/data_utils.js +19 -0
- package/dist/utils/datetime_utility.js +61 -0
- package/dist/utils/equality_utils.js +84 -0
- package/dist/utils/form_options_utils.js +46 -0
- package/dist/utils/i18n.js +65 -0
- package/dist/utils/is_slot_empty.js +34 -0
- package/dist/utils/number_utils.js +132 -0
- package/dist/utils/play_utils.js +11 -0
- package/dist/utils/set_utils.js +25 -0
- package/dist/utils/stories_constants.js +29 -0
- package/dist/utils/stories_utils.js +62 -0
- package/dist/utils/story_decorators/container.js +19 -0
- package/dist/utils/string_utils.js +69 -0
- package/dist/utils/svgs/svg_paths.js +7 -0
- package/dist/utils/test_utils.js +33 -0
- package/dist/utils/use_fake_date.js +29 -0
- package/dist/utils/use_mock_intersection_observer.js +105 -0
- package/dist/utils/utils.js +205 -0
- package/dist/utils/vue_utils.js +57 -0
- package/dist/utils.js +5 -0
- package/dist/vendor/bootstrap-vue/src/bv-config.js +8 -0
- package/dist/vendor/bootstrap-vue/src/components/button/button-close.js +81 -0
- package/dist/vendor/bootstrap-vue/src/components/button/button.js +204 -0
- package/dist/vendor/bootstrap-vue/src/components/button/index.js +2 -0
- package/dist/vendor/bootstrap-vue/src/components/dropdown/dropdown-divider.js +41 -0
- package/dist/vendor/bootstrap-vue/src/components/dropdown/dropdown-form.js +52 -0
- package/dist/vendor/bootstrap-vue/src/components/dropdown/dropdown-group.js +75 -0
- package/dist/vendor/bootstrap-vue/src/components/dropdown/dropdown-header.js +52 -0
- package/dist/vendor/bootstrap-vue/src/components/dropdown/dropdown-item-button.js +85 -0
- package/dist/vendor/bootstrap-vue/src/components/dropdown/dropdown-item.js +97 -0
- package/dist/vendor/bootstrap-vue/src/components/dropdown/dropdown-text.js +60 -0
- package/dist/vendor/bootstrap-vue/src/components/dropdown/dropdown.js +270 -0
- package/dist/vendor/bootstrap-vue/src/components/dropdown/index.js +8 -0
- package/dist/vendor/bootstrap-vue/src/components/form/form-invalid-feedback.js +53 -0
- package/dist/vendor/bootstrap-vue/src/components/form/form-text.js +55 -0
- package/dist/vendor/bootstrap-vue/src/components/form/form-valid-feedback.js +53 -0
- package/dist/vendor/bootstrap-vue/src/components/form/form.js +56 -0
- package/dist/vendor/bootstrap-vue/src/components/form/index.js +4 -0
- package/dist/vendor/bootstrap-vue/src/components/form-group/form-group.js +347 -0
- package/dist/vendor/bootstrap-vue/src/components/form-group/index.js +1 -0
- package/dist/vendor/bootstrap-vue/src/components/form-select/form-select-option-group.js +54 -0
- package/dist/vendor/bootstrap-vue/src/components/form-select/form-select-option.js +41 -0
- package/dist/vendor/bootstrap-vue/src/components/form-select/form-select.js +143 -0
- package/dist/vendor/bootstrap-vue/src/components/form-select/helpers/mixin-options.js +56 -0
- package/dist/vendor/bootstrap-vue/src/components/form-select/index.js +3 -0
- package/dist/vendor/bootstrap-vue/src/components/form-textarea/form-textarea.js +217 -0
- package/dist/vendor/bootstrap-vue/src/components/form-textarea/index.js +1 -0
- package/dist/vendor/bootstrap-vue/src/components/layout/col.js +155 -0
- package/dist/vendor/bootstrap-vue/src/components/layout/form-row.js +34 -0
- package/dist/vendor/bootstrap-vue/src/components/layout/index.js +2 -0
- package/dist/vendor/bootstrap-vue/src/components/link/index.js +1 -0
- package/dist/vendor/bootstrap-vue/src/components/link/link.js +283 -0
- package/dist/vendor/bootstrap-vue/src/components/modal/helpers/bv-modal-event.class.js +21 -0
- package/dist/vendor/bootstrap-vue/src/components/modal/helpers/modal-manager.js +212 -0
- package/dist/vendor/bootstrap-vue/src/components/modal/index.js +1 -0
- package/dist/vendor/bootstrap-vue/src/components/modal/modal.js +1059 -0
- package/dist/vendor/bootstrap-vue/src/components/popover/helpers/bv-popover-template.js +55 -0
- package/dist/vendor/bootstrap-vue/src/components/popover/helpers/bv-popover.js +31 -0
- package/dist/vendor/bootstrap-vue/src/components/popover/index.js +1 -0
- package/dist/vendor/bootstrap-vue/src/components/popover/popover.js +49 -0
- package/dist/vendor/bootstrap-vue/src/components/table/helpers/constants.js +22 -0
- package/dist/vendor/bootstrap-vue/src/components/table/helpers/default-sort-compare.js +64 -0
- package/dist/vendor/bootstrap-vue/src/components/table/helpers/filter-event.js +40 -0
- package/dist/vendor/bootstrap-vue/src/components/table/helpers/mixin-bottom-row.js +43 -0
- package/dist/vendor/bootstrap-vue/src/components/table/helpers/mixin-busy.js +83 -0
- package/dist/vendor/bootstrap-vue/src/components/table/helpers/mixin-caption.js +50 -0
- package/dist/vendor/bootstrap-vue/src/components/table/helpers/mixin-colgroup.js +32 -0
- package/dist/vendor/bootstrap-vue/src/components/table/helpers/mixin-empty.js +82 -0
- package/dist/vendor/bootstrap-vue/src/components/table/helpers/mixin-filtering.js +292 -0
- package/dist/vendor/bootstrap-vue/src/components/table/helpers/mixin-items.js +154 -0
- package/dist/vendor/bootstrap-vue/src/components/table/helpers/mixin-pagination.js +44 -0
- package/dist/vendor/bootstrap-vue/src/components/table/helpers/mixin-provider.js +191 -0
- package/dist/vendor/bootstrap-vue/src/components/table/helpers/mixin-selectable.js +213 -0
- package/dist/vendor/bootstrap-vue/src/components/table/helpers/mixin-sorting.js +274 -0
- package/dist/vendor/bootstrap-vue/src/components/table/helpers/mixin-stacked.js +39 -0
- package/dist/vendor/bootstrap-vue/src/components/table/helpers/mixin-table-renderer.js +186 -0
- package/dist/vendor/bootstrap-vue/src/components/table/helpers/mixin-tbody-row.js +338 -0
- package/dist/vendor/bootstrap-vue/src/components/table/helpers/mixin-tbody.js +243 -0
- package/dist/vendor/bootstrap-vue/src/components/table/helpers/mixin-tfoot.js +50 -0
- package/dist/vendor/bootstrap-vue/src/components/table/helpers/mixin-thead.js +218 -0
- package/dist/vendor/bootstrap-vue/src/components/table/helpers/mixin-top-row.js +42 -0
- package/dist/vendor/bootstrap-vue/src/components/table/helpers/normalize-fields.js +86 -0
- package/dist/vendor/bootstrap-vue/src/components/table/helpers/sanitize-row.js +31 -0
- package/dist/vendor/bootstrap-vue/src/components/table/helpers/stringify-record-values.js +11 -0
- package/dist/vendor/bootstrap-vue/src/components/table/helpers/text-selection-active.js +14 -0
- package/dist/vendor/bootstrap-vue/src/components/table/index.js +9 -0
- package/dist/vendor/bootstrap-vue/src/components/table/table-lite.js +51 -0
- package/dist/vendor/bootstrap-vue/src/components/table/table-simple.js +44 -0
- package/dist/vendor/bootstrap-vue/src/components/table/table.js +67 -0
- package/dist/vendor/bootstrap-vue/src/components/table/tbody.js +116 -0
- package/dist/vendor/bootstrap-vue/src/components/table/td.js +204 -0
- package/dist/vendor/bootstrap-vue/src/components/table/tfoot.js +96 -0
- package/dist/vendor/bootstrap-vue/src/components/table/th.js +26 -0
- package/dist/vendor/bootstrap-vue/src/components/table/thead.js +99 -0
- package/dist/vendor/bootstrap-vue/src/components/table/tr.js +121 -0
- package/dist/vendor/bootstrap-vue/src/components/tabs/index.js +2 -0
- package/dist/vendor/bootstrap-vue/src/components/tabs/tab.js +238 -0
- package/dist/vendor/bootstrap-vue/src/components/tabs/tabs.js +690 -0
- package/dist/vendor/bootstrap-vue/src/components/tooltip/helpers/bv-popper.js +251 -0
- package/dist/vendor/bootstrap-vue/src/components/tooltip/helpers/bv-tooltip-template.js +118 -0
- package/dist/vendor/bootstrap-vue/src/components/tooltip/helpers/bv-tooltip.js +932 -0
- package/dist/vendor/bootstrap-vue/src/components/tooltip/index.js +1 -0
- package/dist/vendor/bootstrap-vue/src/components/tooltip/tooltip.js +337 -0
- package/dist/vendor/bootstrap-vue/src/components/transition/bv-transition.js +103 -0
- package/dist/vendor/bootstrap-vue/src/components/transporter/transporter.js +205 -0
- package/dist/vendor/bootstrap-vue/src/constants/components.js +55 -0
- package/dist/vendor/bootstrap-vue/src/constants/config.js +11 -0
- package/dist/vendor/bootstrap-vue/src/constants/env.js +36 -0
- package/dist/vendor/bootstrap-vue/src/constants/events.js +56 -0
- package/dist/vendor/bootstrap-vue/src/constants/key-codes.js +11 -0
- package/dist/vendor/bootstrap-vue/src/constants/popper.js +10 -0
- package/dist/vendor/bootstrap-vue/src/constants/props.js +24 -0
- package/dist/vendor/bootstrap-vue/src/constants/regex.js +35 -0
- package/dist/vendor/bootstrap-vue/src/constants/safe-types.js +15 -0
- package/dist/vendor/bootstrap-vue/src/constants/slots.js +36 -0
- package/dist/vendor/bootstrap-vue/src/directives/modal/index.js +1 -0
- package/dist/vendor/bootstrap-vue/src/directives/modal/modal.js +112 -0
- package/dist/vendor/bootstrap-vue/src/directives/tooltip/index.js +1 -0
- package/dist/vendor/bootstrap-vue/src/directives/tooltip/tooltip.js +267 -0
- package/dist/vendor/bootstrap-vue/src/directives/visible/index.js +1 -0
- package/dist/vendor/bootstrap-vue/src/directives/visible/visible.js +187 -0
- package/dist/vendor/bootstrap-vue/src/mixins/attrs.js +5 -0
- package/dist/vendor/bootstrap-vue/src/mixins/click-out.js +54 -0
- package/dist/vendor/bootstrap-vue/src/mixins/dropdown.js +470 -0
- package/dist/vendor/bootstrap-vue/src/mixins/focus-in.js +46 -0
- package/dist/vendor/bootstrap-vue/src/mixins/form-control.js +73 -0
- package/dist/vendor/bootstrap-vue/src/mixins/form-custom.js +26 -0
- package/dist/vendor/bootstrap-vue/src/mixins/form-options.js +91 -0
- package/dist/vendor/bootstrap-vue/src/mixins/form-selection.js +62 -0
- package/dist/vendor/bootstrap-vue/src/mixins/form-size.js +26 -0
- package/dist/vendor/bootstrap-vue/src/mixins/form-state.js +50 -0
- package/dist/vendor/bootstrap-vue/src/mixins/form-text.js +293 -0
- package/dist/vendor/bootstrap-vue/src/mixins/form-validity.js +50 -0
- package/dist/vendor/bootstrap-vue/src/mixins/has-listener.js +29 -0
- package/dist/vendor/bootstrap-vue/src/mixins/id.js +57 -0
- package/dist/vendor/bootstrap-vue/src/mixins/listen-on-document.js +62 -0
- package/dist/vendor/bootstrap-vue/src/mixins/listen-on-root.js +120 -0
- package/dist/vendor/bootstrap-vue/src/mixins/listen-on-window.js +62 -0
- package/dist/vendor/bootstrap-vue/src/mixins/listeners.js +25 -0
- package/dist/vendor/bootstrap-vue/src/mixins/model.js +10 -0
- package/dist/vendor/bootstrap-vue/src/mixins/normalize-slot.js +30 -0
- package/dist/vendor/bootstrap-vue/src/mixins/scoped-style.js +18 -0
- package/dist/vendor/bootstrap-vue/src/mixins/use-parent.js +14 -0
- package/dist/vendor/bootstrap-vue/src/utils/array.js +27 -0
- package/dist/vendor/bootstrap-vue/src/utils/bv-event.class.js +60 -0
- package/dist/vendor/bootstrap-vue/src/utils/cache.js +60 -0
- package/dist/vendor/bootstrap-vue/src/utils/clone-deep.js +18 -0
- package/dist/vendor/bootstrap-vue/src/utils/config-set.js +86 -0
- package/dist/vendor/bootstrap-vue/src/utils/config.js +71 -0
- package/dist/vendor/bootstrap-vue/src/utils/create-new-child-component.js +133 -0
- package/dist/vendor/bootstrap-vue/src/utils/css-escape.js +70 -0
- package/dist/vendor/bootstrap-vue/src/utils/dom.js +298 -0
- package/dist/vendor/bootstrap-vue/src/utils/element-to-vue-instance-registry.js +28 -0
- package/dist/vendor/bootstrap-vue/src/utils/env.js +16 -0
- package/dist/vendor/bootstrap-vue/src/utils/events.js +78 -0
- package/dist/vendor/bootstrap-vue/src/utils/get-event-root.js +5 -0
- package/dist/vendor/bootstrap-vue/src/utils/get-instance-from-directive.js +3 -0
- package/dist/vendor/bootstrap-vue/src/utils/get-scope-id.js +9 -0
- package/dist/vendor/bootstrap-vue/src/utils/get.js +63 -0
- package/dist/vendor/bootstrap-vue/src/utils/html.js +16 -0
- package/dist/vendor/bootstrap-vue/src/utils/identity.js +3 -0
- package/dist/vendor/bootstrap-vue/src/utils/inspect.js +35 -0
- package/dist/vendor/bootstrap-vue/src/utils/locale.js +18 -0
- package/dist/vendor/bootstrap-vue/src/utils/loose-equal.js +59 -0
- package/dist/vendor/bootstrap-vue/src/utils/loose-index-of.js +13 -0
- package/dist/vendor/bootstrap-vue/src/utils/math.js +9 -0
- package/dist/vendor/bootstrap-vue/src/utils/memoize.js +14 -0
- package/dist/vendor/bootstrap-vue/src/utils/model.js +33 -0
- package/dist/vendor/bootstrap-vue/src/utils/noop.js +3 -0
- package/dist/vendor/bootstrap-vue/src/utils/normalize-slot.js +51 -0
- package/dist/vendor/bootstrap-vue/src/utils/number.js +23 -0
- package/dist/vendor/bootstrap-vue/src/utils/object.js +72 -0
- package/dist/vendor/bootstrap-vue/src/utils/observe-dom.js +76 -0
- package/dist/vendor/bootstrap-vue/src/utils/on-instance-destroy.js +22 -0
- package/dist/vendor/bootstrap-vue/src/utils/plugins.js +124 -0
- package/dist/vendor/bootstrap-vue/src/utils/props.js +67 -0
- package/dist/vendor/bootstrap-vue/src/utils/router.js +150 -0
- package/dist/vendor/bootstrap-vue/src/utils/safe-vue-instance.js +14 -0
- package/dist/vendor/bootstrap-vue/src/utils/stable-sort.js +28 -0
- package/dist/vendor/bootstrap-vue/src/utils/string.js +47 -0
- package/dist/vendor/bootstrap-vue/src/utils/stringify-object-values.js +31 -0
- package/dist/vendor/bootstrap-vue/src/utils/warn.js +45 -0
- package/dist/vendor/bootstrap-vue/src/vue.js +55 -0
- package/package.json +4 -3
- package/src/vendor/bootstrap-vue/src/components/dropdown/dropdown.js +2 -2
- package/src/vendor/bootstrap-vue/src/components/form-group/form-group.js +2 -2
- package/src/vendor/bootstrap-vue/src/components/layout/col.js +2 -2
- package/src/vendor/bootstrap-vue/src/components/modal/modal.js +2 -2
- package/src/vendor/bootstrap-vue/src/components/tabs/tabs.js +2 -2
- package/src/vendor/bootstrap-vue/src/components/tooltip/helpers/bv-tooltip.js +8 -9
- package/src/vendor/bootstrap-vue/src/mixins/listen-on-document.js +1 -2
- package/src/vendor/bootstrap-vue/src/mixins/listen-on-root.js +1 -2
- package/src/vendor/bootstrap-vue/src/mixins/listen-on-window.js +1 -2
- package/src/vendor/bootstrap-vue/src/utils/array.js +0 -1
- package/src/vendor/bootstrap-vue/src/utils/locale.js +1 -2
|
@@ -0,0 +1,186 @@
|
|
|
1
|
+
import { extend } from '../../../vue';
|
|
2
|
+
import { PROP_TYPE_BOOLEAN, PROP_TYPE_BOOLEAN_STRING, PROP_TYPE_ARRAY_OBJECT_STRING, PROP_TYPE_STRING } from '../../../constants/props';
|
|
3
|
+
import { identity } from '../../../utils/identity';
|
|
4
|
+
import { isBoolean } from '../../../utils/inspect';
|
|
5
|
+
import { makeProp } from '../../../utils/props';
|
|
6
|
+
import { safeVueInstance } from '../../../utils/safe-vue-instance';
|
|
7
|
+
import { toString } from '../../../utils/string';
|
|
8
|
+
import { attrsMixin } from '../../../mixins/attrs';
|
|
9
|
+
|
|
10
|
+
// Main `<table>` render mixin
|
|
11
|
+
// Includes all main table styling options
|
|
12
|
+
|
|
13
|
+
// --- Props ---
|
|
14
|
+
|
|
15
|
+
const props = {
|
|
16
|
+
bordered: makeProp(PROP_TYPE_BOOLEAN, false),
|
|
17
|
+
borderless: makeProp(PROP_TYPE_BOOLEAN, false),
|
|
18
|
+
captionTop: makeProp(PROP_TYPE_BOOLEAN, false),
|
|
19
|
+
dark: makeProp(PROP_TYPE_BOOLEAN, false),
|
|
20
|
+
fixed: makeProp(PROP_TYPE_BOOLEAN, false),
|
|
21
|
+
hover: makeProp(PROP_TYPE_BOOLEAN, false),
|
|
22
|
+
noBorderCollapse: makeProp(PROP_TYPE_BOOLEAN, false),
|
|
23
|
+
outlined: makeProp(PROP_TYPE_BOOLEAN, false),
|
|
24
|
+
responsive: makeProp(PROP_TYPE_BOOLEAN_STRING, false),
|
|
25
|
+
small: makeProp(PROP_TYPE_BOOLEAN, false),
|
|
26
|
+
// If a string, it is assumed to be the table `max-height` value
|
|
27
|
+
stickyHeader: makeProp(PROP_TYPE_BOOLEAN_STRING, false),
|
|
28
|
+
striped: makeProp(PROP_TYPE_BOOLEAN, false),
|
|
29
|
+
tableClass: makeProp(PROP_TYPE_ARRAY_OBJECT_STRING),
|
|
30
|
+
tableVariant: makeProp(PROP_TYPE_STRING)
|
|
31
|
+
};
|
|
32
|
+
|
|
33
|
+
// --- Mixin ---
|
|
34
|
+
|
|
35
|
+
// @vue/component
|
|
36
|
+
const tableRendererMixin = extend({
|
|
37
|
+
mixins: [attrsMixin],
|
|
38
|
+
provide() {
|
|
39
|
+
return {
|
|
40
|
+
getBvTable: () => this
|
|
41
|
+
};
|
|
42
|
+
},
|
|
43
|
+
// Don't place attributes on root element automatically,
|
|
44
|
+
// as table could be wrapped in responsive `<div>`
|
|
45
|
+
inheritAttrs: false,
|
|
46
|
+
props,
|
|
47
|
+
computed: {
|
|
48
|
+
isTableSimple() {
|
|
49
|
+
return false;
|
|
50
|
+
},
|
|
51
|
+
// Layout related computed props
|
|
52
|
+
isResponsive() {
|
|
53
|
+
const {
|
|
54
|
+
responsive
|
|
55
|
+
} = this;
|
|
56
|
+
return responsive === '' ? true : responsive;
|
|
57
|
+
},
|
|
58
|
+
isStickyHeader() {
|
|
59
|
+
let {
|
|
60
|
+
stickyHeader
|
|
61
|
+
} = this;
|
|
62
|
+
stickyHeader = stickyHeader === '' ? true : stickyHeader;
|
|
63
|
+
return this.isStacked ? false : stickyHeader;
|
|
64
|
+
},
|
|
65
|
+
wrapperClasses() {
|
|
66
|
+
const {
|
|
67
|
+
isResponsive
|
|
68
|
+
} = this;
|
|
69
|
+
return [this.isStickyHeader ? 'b-table-sticky-header' : '', isResponsive === true ? 'table-responsive' : isResponsive ? `table-responsive table-responsive-${this.responsive}` : ''].filter(identity);
|
|
70
|
+
},
|
|
71
|
+
wrapperStyles() {
|
|
72
|
+
const {
|
|
73
|
+
isStickyHeader
|
|
74
|
+
} = this;
|
|
75
|
+
return isStickyHeader && !isBoolean(isStickyHeader) ? {
|
|
76
|
+
maxHeight: isStickyHeader
|
|
77
|
+
} : {};
|
|
78
|
+
},
|
|
79
|
+
tableClasses() {
|
|
80
|
+
let {
|
|
81
|
+
hover,
|
|
82
|
+
tableVariant,
|
|
83
|
+
selectableTableClasses,
|
|
84
|
+
stackedTableClasses,
|
|
85
|
+
tableClass,
|
|
86
|
+
computedBusy
|
|
87
|
+
} = safeVueInstance(this);
|
|
88
|
+
hover = this.isTableSimple ? hover : hover && this.computedItems.length > 0 && !computedBusy;
|
|
89
|
+
return [
|
|
90
|
+
// User supplied classes
|
|
91
|
+
tableClass,
|
|
92
|
+
// Styling classes
|
|
93
|
+
{
|
|
94
|
+
'table-striped': this.striped,
|
|
95
|
+
'table-hover': hover,
|
|
96
|
+
'table-dark': this.dark,
|
|
97
|
+
'table-bordered': this.bordered,
|
|
98
|
+
'table-borderless': this.borderless,
|
|
99
|
+
'table-sm': this.small,
|
|
100
|
+
// The following are b-table custom styles
|
|
101
|
+
'gl-border': this.outlined,
|
|
102
|
+
'b-table-fixed': this.fixed,
|
|
103
|
+
'b-table-caption-top': this.captionTop,
|
|
104
|
+
'b-table-no-border-collapse': this.noBorderCollapse
|
|
105
|
+
}, tableVariant ? `${this.dark ? 'bg' : 'table'}-${tableVariant}` : '',
|
|
106
|
+
// Stacked table classes
|
|
107
|
+
stackedTableClasses,
|
|
108
|
+
// Selectable classes
|
|
109
|
+
selectableTableClasses];
|
|
110
|
+
},
|
|
111
|
+
tableAttrs() {
|
|
112
|
+
const {
|
|
113
|
+
computedItems: items,
|
|
114
|
+
filteredItems,
|
|
115
|
+
computedFields: fields,
|
|
116
|
+
selectableTableAttrs,
|
|
117
|
+
computedBusy
|
|
118
|
+
} = safeVueInstance(this);
|
|
119
|
+
const ariaAttrs = this.isTableSimple ? {} : {
|
|
120
|
+
'aria-busy': toString(computedBusy),
|
|
121
|
+
'aria-colcount': toString(fields.length),
|
|
122
|
+
// Preserve user supplied `aria-describedby`, if provided
|
|
123
|
+
'aria-describedby': this.bvAttrs['aria-describedby'] || this.$refs.caption ? this.captionId : null
|
|
124
|
+
};
|
|
125
|
+
const rowCount = items && filteredItems && filteredItems.length > items.length ? toString(filteredItems.length) : null;
|
|
126
|
+
return {
|
|
127
|
+
// We set `aria-rowcount` before merging in `$attrs`,
|
|
128
|
+
// in case user has supplied their own
|
|
129
|
+
'aria-rowcount': rowCount,
|
|
130
|
+
// Merge in user supplied `$attrs` if any
|
|
131
|
+
...this.bvAttrs,
|
|
132
|
+
// Now we can override any `$attrs` here
|
|
133
|
+
id: this.safeId(),
|
|
134
|
+
role: this.bvAttrs.role || 'table',
|
|
135
|
+
...ariaAttrs,
|
|
136
|
+
...selectableTableAttrs
|
|
137
|
+
};
|
|
138
|
+
}
|
|
139
|
+
},
|
|
140
|
+
render(h) {
|
|
141
|
+
const {
|
|
142
|
+
wrapperClasses,
|
|
143
|
+
renderCaption,
|
|
144
|
+
renderColgroup,
|
|
145
|
+
renderThead,
|
|
146
|
+
renderTbody,
|
|
147
|
+
renderTfoot
|
|
148
|
+
} = safeVueInstance(this);
|
|
149
|
+
const $content = [];
|
|
150
|
+
if (this.isTableSimple) {
|
|
151
|
+
$content.push(this.normalizeSlot());
|
|
152
|
+
} else {
|
|
153
|
+
// Build the `<caption>` (from caption mixin)
|
|
154
|
+
$content.push(renderCaption ? renderCaption() : null);
|
|
155
|
+
|
|
156
|
+
// Build the `<colgroup>`
|
|
157
|
+
$content.push(renderColgroup ? renderColgroup() : null);
|
|
158
|
+
|
|
159
|
+
// Build the `<thead>`
|
|
160
|
+
$content.push(renderThead ? renderThead() : null);
|
|
161
|
+
|
|
162
|
+
// Build the `<tbody>`
|
|
163
|
+
$content.push(renderTbody ? renderTbody() : null);
|
|
164
|
+
|
|
165
|
+
// Build the `<tfoot>`
|
|
166
|
+
$content.push(renderTfoot ? renderTfoot() : null);
|
|
167
|
+
}
|
|
168
|
+
|
|
169
|
+
// Assemble `<table>`
|
|
170
|
+
const $table = h('table', {
|
|
171
|
+
staticClass: 'table b-table',
|
|
172
|
+
class: this.tableClasses,
|
|
173
|
+
attrs: this.tableAttrs,
|
|
174
|
+
key: 'b-table'
|
|
175
|
+
}, $content.filter(identity));
|
|
176
|
+
|
|
177
|
+
// Add responsive/sticky wrapper if needed and return table
|
|
178
|
+
return wrapperClasses.length > 0 ? h('div', {
|
|
179
|
+
class: wrapperClasses,
|
|
180
|
+
style: this.wrapperStyles,
|
|
181
|
+
key: 'wrap'
|
|
182
|
+
}, [$table]) : $table;
|
|
183
|
+
}
|
|
184
|
+
});
|
|
185
|
+
|
|
186
|
+
export { props, tableRendererMixin };
|
|
@@ -0,0 +1,338 @@
|
|
|
1
|
+
import { extend, REF_FOR_KEY } from '../../../vue';
|
|
2
|
+
import { EVENT_NAME_ROW_HOVERED, EVENT_NAME_ROW_UNHOVERED, EVENT_NAME_ROW_CLICKED } from '../../../constants/events';
|
|
3
|
+
import { PROP_TYPE_ARRAY_OBJECT_STRING, PROP_TYPE_OBJECT_FUNCTION, PROP_TYPE_FUNCTION } from '../../../constants/props';
|
|
4
|
+
import { SLOT_NAME_ROW_DETAILS } from '../../../constants/slots';
|
|
5
|
+
import { useParentMixin } from '../../../mixins/use-parent';
|
|
6
|
+
import { get } from '../../../utils/get';
|
|
7
|
+
import { isFunction, isString, isUndefinedOrNull } from '../../../utils/inspect';
|
|
8
|
+
import { makeProp } from '../../../utils/props';
|
|
9
|
+
import { safeVueInstance } from '../../../utils/safe-vue-instance';
|
|
10
|
+
import { toString } from '../../../utils/string';
|
|
11
|
+
import { BTr } from '../tr';
|
|
12
|
+
import { BTd } from '../td';
|
|
13
|
+
import { BTh } from '../th';
|
|
14
|
+
import { FIELD_KEY_SHOW_DETAILS, FIELD_KEY_CELL_VARIANT, FIELD_KEY_ROW_VARIANT } from './constants';
|
|
15
|
+
|
|
16
|
+
// --- Props ---
|
|
17
|
+
|
|
18
|
+
const props = {
|
|
19
|
+
detailsTdClass: makeProp(PROP_TYPE_ARRAY_OBJECT_STRING),
|
|
20
|
+
tbodyTrAttr: makeProp(PROP_TYPE_OBJECT_FUNCTION),
|
|
21
|
+
tbodyTrClass: makeProp([...PROP_TYPE_ARRAY_OBJECT_STRING, PROP_TYPE_FUNCTION])
|
|
22
|
+
};
|
|
23
|
+
|
|
24
|
+
// --- Mixin ---
|
|
25
|
+
|
|
26
|
+
// @vue/component
|
|
27
|
+
const tbodyRowMixin = extend({
|
|
28
|
+
mixins: [useParentMixin],
|
|
29
|
+
props,
|
|
30
|
+
methods: {
|
|
31
|
+
// Methods for computing classes, attributes and styles for table cells
|
|
32
|
+
getTdValues(item, key, tdValue, defaultValue) {
|
|
33
|
+
const {
|
|
34
|
+
bvParent
|
|
35
|
+
} = this;
|
|
36
|
+
if (tdValue) {
|
|
37
|
+
const value = get(item, key, '');
|
|
38
|
+
if (isFunction(tdValue)) {
|
|
39
|
+
return tdValue(value, key, item);
|
|
40
|
+
} else if (isString(tdValue) && isFunction(bvParent[tdValue])) {
|
|
41
|
+
return bvParent[tdValue](value, key, item);
|
|
42
|
+
}
|
|
43
|
+
return tdValue;
|
|
44
|
+
}
|
|
45
|
+
return defaultValue;
|
|
46
|
+
},
|
|
47
|
+
getThValues(item, key, thValue, type, defaultValue) {
|
|
48
|
+
const {
|
|
49
|
+
bvParent
|
|
50
|
+
} = this;
|
|
51
|
+
if (thValue) {
|
|
52
|
+
const value = get(item, key, '');
|
|
53
|
+
if (isFunction(thValue)) {
|
|
54
|
+
return thValue(value, key, item, type);
|
|
55
|
+
} else if (isString(thValue) && isFunction(bvParent[thValue])) {
|
|
56
|
+
return bvParent[thValue](value, key, item, type);
|
|
57
|
+
}
|
|
58
|
+
return thValue;
|
|
59
|
+
}
|
|
60
|
+
return defaultValue;
|
|
61
|
+
},
|
|
62
|
+
// Method to get the value for a field
|
|
63
|
+
getFormattedValue(item, field) {
|
|
64
|
+
const {
|
|
65
|
+
key
|
|
66
|
+
} = field;
|
|
67
|
+
const formatter = this.getFieldFormatter(key);
|
|
68
|
+
let value = get(item, key, null);
|
|
69
|
+
if (isFunction(formatter)) {
|
|
70
|
+
value = formatter(value, key, item);
|
|
71
|
+
}
|
|
72
|
+
return isUndefinedOrNull(value) ? '' : value;
|
|
73
|
+
},
|
|
74
|
+
// Factory function methods
|
|
75
|
+
toggleDetailsFactory(hasDetailsSlot, item) {
|
|
76
|
+
// Returns a function to toggle a row's details slot
|
|
77
|
+
return () => {
|
|
78
|
+
if (hasDetailsSlot) {
|
|
79
|
+
this.$set(item, FIELD_KEY_SHOW_DETAILS, !item[FIELD_KEY_SHOW_DETAILS]);
|
|
80
|
+
}
|
|
81
|
+
};
|
|
82
|
+
},
|
|
83
|
+
// Row event handlers
|
|
84
|
+
rowHovered(event) {
|
|
85
|
+
// `mouseenter` handler (non-bubbling)
|
|
86
|
+
// `this.tbodyRowEventStopped` from tbody mixin
|
|
87
|
+
if (!this.tbodyRowEventStopped(event)) {
|
|
88
|
+
// `this.emitTbodyRowEvent` from tbody mixin
|
|
89
|
+
this.emitTbodyRowEvent(EVENT_NAME_ROW_HOVERED, event);
|
|
90
|
+
}
|
|
91
|
+
},
|
|
92
|
+
rowUnhovered(event) {
|
|
93
|
+
// `mouseleave` handler (non-bubbling)
|
|
94
|
+
// `this.tbodyRowEventStopped` from tbody mixin
|
|
95
|
+
if (!this.tbodyRowEventStopped(event)) {
|
|
96
|
+
// `this.emitTbodyRowEvent` from tbody mixin
|
|
97
|
+
this.emitTbodyRowEvent(EVENT_NAME_ROW_UNHOVERED, event);
|
|
98
|
+
}
|
|
99
|
+
},
|
|
100
|
+
// Renders a TD or TH for a row's field
|
|
101
|
+
renderTbodyRowCell(field, colIndex, item, rowIndex) {
|
|
102
|
+
const {
|
|
103
|
+
isStacked
|
|
104
|
+
} = this;
|
|
105
|
+
const {
|
|
106
|
+
key,
|
|
107
|
+
label,
|
|
108
|
+
isRowHeader
|
|
109
|
+
} = field;
|
|
110
|
+
const h = this.$createElement;
|
|
111
|
+
const hasDetailsSlot = this.hasNormalizedSlot(SLOT_NAME_ROW_DETAILS);
|
|
112
|
+
const formatted = this.getFormattedValue(item, field);
|
|
113
|
+
const stickyColumn = !isStacked && (this.isResponsive || this.stickyHeader) && field.stickyColumn;
|
|
114
|
+
// We only uses the helper components for sticky columns to
|
|
115
|
+
// improve performance of BTable/BTableLite by reducing the
|
|
116
|
+
// total number of vue instances created during render
|
|
117
|
+
const cellTag = stickyColumn ? isRowHeader ? BTh : BTd : isRowHeader ? 'th' : 'td';
|
|
118
|
+
const cellVariant = item[FIELD_KEY_CELL_VARIANT] && item[FIELD_KEY_CELL_VARIANT][key] ? item[FIELD_KEY_CELL_VARIANT][key] : field.variant || null;
|
|
119
|
+
const data = {
|
|
120
|
+
// For the Vue key, we concatenate the column index and
|
|
121
|
+
// field key (as field keys could be duplicated)
|
|
122
|
+
// TODO: Although we do prevent duplicate field keys...
|
|
123
|
+
// So we could change this to: `row-${rowIndex}-cell-${key}`
|
|
124
|
+
class: [field.class ? field.class : '', this.getTdValues(item, key, field.tdClass, '')],
|
|
125
|
+
props: {},
|
|
126
|
+
attrs: {
|
|
127
|
+
'aria-colindex': String(colIndex + 1),
|
|
128
|
+
...(isRowHeader ? this.getThValues(item, key, field.thAttr, 'row', {}) : this.getTdValues(item, key, field.tdAttr, {}))
|
|
129
|
+
},
|
|
130
|
+
key: `row-${rowIndex}-cell-${colIndex}-${key}`
|
|
131
|
+
};
|
|
132
|
+
if (stickyColumn) {
|
|
133
|
+
// We are using the helper BTd or BTh
|
|
134
|
+
data.props = {
|
|
135
|
+
stackedHeading: isStacked ? label : null,
|
|
136
|
+
stickyColumn: true,
|
|
137
|
+
variant: cellVariant
|
|
138
|
+
};
|
|
139
|
+
} else {
|
|
140
|
+
// Using native TD or TH element, so we need to
|
|
141
|
+
// add in the attributes and variant class
|
|
142
|
+
data.attrs['data-label'] = isStacked && !isUndefinedOrNull(label) ? toString(label) : null;
|
|
143
|
+
data.attrs.role = isRowHeader ? 'rowheader' : 'cell';
|
|
144
|
+
data.attrs.scope = isRowHeader ? 'row' : null;
|
|
145
|
+
// Add in the variant class
|
|
146
|
+
if (cellVariant) {
|
|
147
|
+
data.class.push(`${this.dark ? 'bg' : 'table'}-${cellVariant}`);
|
|
148
|
+
}
|
|
149
|
+
}
|
|
150
|
+
const slotScope = {
|
|
151
|
+
item,
|
|
152
|
+
index: rowIndex,
|
|
153
|
+
field,
|
|
154
|
+
unformatted: get(item, key, ''),
|
|
155
|
+
value: formatted,
|
|
156
|
+
toggleDetails: this.toggleDetailsFactory(hasDetailsSlot, item),
|
|
157
|
+
detailsShowing: Boolean(item[FIELD_KEY_SHOW_DETAILS])
|
|
158
|
+
};
|
|
159
|
+
// If table supports selectable mode, then add in the following scope
|
|
160
|
+
// this.supportsSelectableRows will be undefined if mixin isn't loaded
|
|
161
|
+
if (safeVueInstance(this).supportsSelectableRows) {
|
|
162
|
+
slotScope.rowSelected = this.isRowSelected(rowIndex);
|
|
163
|
+
slotScope.selectRow = () => this.selectRow(rowIndex);
|
|
164
|
+
slotScope.unselectRow = () => this.unselectRow(rowIndex);
|
|
165
|
+
}
|
|
166
|
+
|
|
167
|
+
// The new `v-slot` syntax doesn't like a slot name starting with
|
|
168
|
+
// a square bracket and if using in-document HTML templates, the
|
|
169
|
+
// v-slot attributes are lower-cased by the browser.
|
|
170
|
+
// Switched to round bracket syntax to prevent confusion with
|
|
171
|
+
// dynamic slot name syntax.
|
|
172
|
+
// We look for slots in this order: `cell(${key})`, `cell(${key.toLowerCase()})`, 'cell()'
|
|
173
|
+
// Slot names are now cached by mixin tbody in `this.$_bodyFieldSlotNameCache`
|
|
174
|
+
// Will be `null` if no slot (or fallback slot) exists
|
|
175
|
+
const slotName = this.$_bodyFieldSlotNameCache[key];
|
|
176
|
+
let $childNodes = slotName ? this.normalizeSlot(slotName, slotScope) : toString(formatted);
|
|
177
|
+
if (this.isStacked) {
|
|
178
|
+
// We wrap in a DIV to ensure rendered as a single cell when visually stacked!
|
|
179
|
+
$childNodes = [h('div', [$childNodes])];
|
|
180
|
+
}
|
|
181
|
+
|
|
182
|
+
// Render either a td or th cell
|
|
183
|
+
return h(cellTag, data, [$childNodes]);
|
|
184
|
+
},
|
|
185
|
+
// Renders an item's row (or rows if details supported)
|
|
186
|
+
renderTbodyRow(item, rowIndex) {
|
|
187
|
+
const {
|
|
188
|
+
computedFields: fields,
|
|
189
|
+
striped,
|
|
190
|
+
primaryKey,
|
|
191
|
+
currentPage,
|
|
192
|
+
perPage,
|
|
193
|
+
tbodyTrClass,
|
|
194
|
+
tbodyTrAttr,
|
|
195
|
+
hasSelectableRowClick
|
|
196
|
+
} = safeVueInstance(this);
|
|
197
|
+
const h = this.$createElement;
|
|
198
|
+
const hasDetailsSlot = this.hasNormalizedSlot(SLOT_NAME_ROW_DETAILS);
|
|
199
|
+
const rowShowDetails = item[FIELD_KEY_SHOW_DETAILS] && hasDetailsSlot;
|
|
200
|
+
const hasRowClickHandler = this.$listeners[EVENT_NAME_ROW_CLICKED] || hasSelectableRowClick;
|
|
201
|
+
|
|
202
|
+
// We can return more than one TR if rowDetails enabled
|
|
203
|
+
const $rows = [];
|
|
204
|
+
|
|
205
|
+
// Details ID needed for `aria-details` when details showing
|
|
206
|
+
// We set it to `null` when not showing so that attribute
|
|
207
|
+
// does not appear on the element
|
|
208
|
+
const detailsId = rowShowDetails ? this.safeId(`_details_${rowIndex}_`) : null;
|
|
209
|
+
|
|
210
|
+
// For each item data field in row
|
|
211
|
+
const $tds = fields.map((field, colIndex) => {
|
|
212
|
+
return this.renderTbodyRowCell(field, colIndex, item, rowIndex);
|
|
213
|
+
});
|
|
214
|
+
|
|
215
|
+
// Calculate the row number in the dataset (indexed from 1)
|
|
216
|
+
let ariaRowIndex = null;
|
|
217
|
+
if (currentPage && perPage && perPage > 0) {
|
|
218
|
+
ariaRowIndex = String((currentPage - 1) * perPage + rowIndex + 1);
|
|
219
|
+
}
|
|
220
|
+
|
|
221
|
+
// Create a unique :key to help ensure that sub components are re-rendered rather than
|
|
222
|
+
// re-used, which can cause issues. If a primary key is not provided we use the rendered
|
|
223
|
+
// rows index within the tbody.
|
|
224
|
+
// See: https://github.com/bootstrap-vue/bootstrap-vue/issues/2410
|
|
225
|
+
const primaryKeyValue = toString(get(item, primaryKey)) || null;
|
|
226
|
+
const rowKey = primaryKeyValue || toString(rowIndex);
|
|
227
|
+
|
|
228
|
+
// If primary key is provided, use it to generate a unique ID on each tbody > tr
|
|
229
|
+
// In the format of '{tableId}__row_{primaryKeyValue}'
|
|
230
|
+
const rowId = primaryKeyValue ? this.safeId(`_row_${primaryKeyValue}`) : null;
|
|
231
|
+
|
|
232
|
+
// Selectable classes and attributes
|
|
233
|
+
const selectableClasses = safeVueInstance(this).selectableRowClasses ? this.selectableRowClasses(rowIndex) : {};
|
|
234
|
+
const selectableAttrs = safeVueInstance(this).selectableRowAttrs ? this.selectableRowAttrs(rowIndex) : {};
|
|
235
|
+
|
|
236
|
+
// Additional classes and attributes
|
|
237
|
+
const userTrClasses = isFunction(tbodyTrClass) ? tbodyTrClass(item, 'row') : tbodyTrClass;
|
|
238
|
+
const userTrAttrs = isFunction(tbodyTrAttr) ? /* istanbul ignore next */tbodyTrAttr(item, 'row') : tbodyTrAttr;
|
|
239
|
+
|
|
240
|
+
// Add the item row
|
|
241
|
+
$rows.push(h(BTr, {
|
|
242
|
+
class: [userTrClasses, selectableClasses, rowShowDetails ? 'b-table-has-details' : ''],
|
|
243
|
+
props: {
|
|
244
|
+
variant: item[FIELD_KEY_ROW_VARIANT] || null
|
|
245
|
+
},
|
|
246
|
+
attrs: {
|
|
247
|
+
id: rowId,
|
|
248
|
+
...userTrAttrs,
|
|
249
|
+
// Users cannot override the following attributes
|
|
250
|
+
tabindex: hasRowClickHandler ? '0' : null,
|
|
251
|
+
'data-pk': primaryKeyValue || null,
|
|
252
|
+
'aria-details': detailsId,
|
|
253
|
+
'aria-owns': detailsId,
|
|
254
|
+
'aria-rowindex': ariaRowIndex,
|
|
255
|
+
...selectableAttrs
|
|
256
|
+
},
|
|
257
|
+
on: {
|
|
258
|
+
// Note: These events are not A11Y friendly!
|
|
259
|
+
mouseenter: this.rowHovered,
|
|
260
|
+
mouseleave: this.rowUnhovered
|
|
261
|
+
},
|
|
262
|
+
key: `__b-table-row-${rowKey}__`,
|
|
263
|
+
ref: 'item-rows',
|
|
264
|
+
[REF_FOR_KEY]: true
|
|
265
|
+
}, $tds));
|
|
266
|
+
|
|
267
|
+
// Row Details slot
|
|
268
|
+
if (rowShowDetails) {
|
|
269
|
+
const detailsScope = {
|
|
270
|
+
item,
|
|
271
|
+
index: rowIndex,
|
|
272
|
+
fields,
|
|
273
|
+
toggleDetails: this.toggleDetailsFactory(hasDetailsSlot, item)
|
|
274
|
+
};
|
|
275
|
+
// If table supports selectable mode, then add in the following scope
|
|
276
|
+
// this.supportsSelectableRows will be undefined if mixin isn't loaded
|
|
277
|
+
if (safeVueInstance(this).supportsSelectableRows) {
|
|
278
|
+
detailsScope.rowSelected = this.isRowSelected(rowIndex);
|
|
279
|
+
detailsScope.selectRow = () => this.selectRow(rowIndex);
|
|
280
|
+
detailsScope.unselectRow = () => this.unselectRow(rowIndex);
|
|
281
|
+
}
|
|
282
|
+
|
|
283
|
+
// Render the details slot in a TD
|
|
284
|
+
const $details = h(BTd, {
|
|
285
|
+
props: {
|
|
286
|
+
colspan: fields.length
|
|
287
|
+
},
|
|
288
|
+
class: this.detailsTdClass
|
|
289
|
+
}, [this.normalizeSlot(SLOT_NAME_ROW_DETAILS, detailsScope)]);
|
|
290
|
+
|
|
291
|
+
// Add a hidden row to keep table row striping consistent when details showing
|
|
292
|
+
// Only added if the table is striped
|
|
293
|
+
if (striped) {
|
|
294
|
+
$rows.push(
|
|
295
|
+
// We don't use `BTr` here as we don't need the extra functionality
|
|
296
|
+
h('tr', {
|
|
297
|
+
staticClass: 'd-none',
|
|
298
|
+
attrs: {
|
|
299
|
+
'aria-hidden': 'true',
|
|
300
|
+
role: 'presentation'
|
|
301
|
+
},
|
|
302
|
+
key: `__b-table-details-stripe__${rowKey}`
|
|
303
|
+
}));
|
|
304
|
+
}
|
|
305
|
+
|
|
306
|
+
// Add the actual details row
|
|
307
|
+
const userDetailsTrClasses = isFunction(this.tbodyTrClass) ? /* istanbul ignore next */this.tbodyTrClass(item, SLOT_NAME_ROW_DETAILS) : this.tbodyTrClass;
|
|
308
|
+
const userDetailsTrAttrs = isFunction(this.tbodyTrAttr) ? /* istanbul ignore next */this.tbodyTrAttr(item, SLOT_NAME_ROW_DETAILS) : this.tbodyTrAttr;
|
|
309
|
+
$rows.push(h(BTr, {
|
|
310
|
+
staticClass: 'b-table-details',
|
|
311
|
+
class: [userDetailsTrClasses],
|
|
312
|
+
props: {
|
|
313
|
+
variant: item[FIELD_KEY_ROW_VARIANT] || null
|
|
314
|
+
},
|
|
315
|
+
attrs: {
|
|
316
|
+
...userDetailsTrAttrs,
|
|
317
|
+
// Users cannot override the following attributes
|
|
318
|
+
id: detailsId,
|
|
319
|
+
tabindex: '-1'
|
|
320
|
+
},
|
|
321
|
+
key: `__b-table-details__${rowKey}`
|
|
322
|
+
}, [$details]));
|
|
323
|
+
} else if (hasDetailsSlot) {
|
|
324
|
+
// Only add the placeholder if a the table has a row-details slot defined (but not shown)
|
|
325
|
+
$rows.push(h());
|
|
326
|
+
if (striped) {
|
|
327
|
+
// Add extra placeholder if table is striped
|
|
328
|
+
$rows.push(h());
|
|
329
|
+
}
|
|
330
|
+
}
|
|
331
|
+
|
|
332
|
+
// Return the row(s)
|
|
333
|
+
return $rows;
|
|
334
|
+
}
|
|
335
|
+
}
|
|
336
|
+
});
|
|
337
|
+
|
|
338
|
+
export { props, tbodyRowMixin };
|