@gitlab/ui 132.0.1 → 132.0.3
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/url_utils.js +56 -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 +44 -0
- package/dist/vendor/bootstrap-vue/src/components/dropdown/dropdown-form.js +59 -0
- package/dist/vendor/bootstrap-vue/src/components/dropdown/dropdown-group.js +98 -0
- package/dist/vendor/bootstrap-vue/src/components/dropdown/dropdown-header.js +63 -0
- package/dist/vendor/bootstrap-vue/src/components/dropdown/dropdown-item-button.js +108 -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 +80 -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 +80 -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 +56 -0
- package/dist/vendor/bootstrap-vue/src/components/form-select/form-select-option.js +47 -0
- package/dist/vendor/bootstrap-vue/src/components/form-select/form-select.js +154 -0
- package/dist/vendor/bootstrap-vue/src/components/form-select/helpers/mixin-options.js +63 -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 +236 -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 +64 -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 +86 -0
- package/dist/vendor/bootstrap-vue/src/components/table/helpers/mixin-caption.js +57 -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 +101 -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 +169 -0
- package/dist/vendor/bootstrap-vue/src/components/table/helpers/mixin-pagination.js +51 -0
- package/dist/vendor/bootstrap-vue/src/components/table/helpers/mixin-provider.js +210 -0
- package/dist/vendor/bootstrap-vue/src/components/table/helpers/mixin-selectable.js +227 -0
- package/dist/vendor/bootstrap-vue/src/components/table/helpers/mixin-sorting.js +328 -0
- package/dist/vendor/bootstrap-vue/src/components/table/helpers/mixin-stacked.js +42 -0
- package/dist/vendor/bootstrap-vue/src/components/table/helpers/mixin-table-renderer.js +241 -0
- package/dist/vendor/bootstrap-vue/src/components/table/helpers/mixin-tbody-row.js +349 -0
- package/dist/vendor/bootstrap-vue/src/components/table/helpers/mixin-tbody.js +247 -0
- package/dist/vendor/bootstrap-vue/src/components/table/helpers/mixin-tfoot.js +69 -0
- package/dist/vendor/bootstrap-vue/src/components/table/helpers/mixin-thead.js +233 -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 +278 -0
- package/dist/vendor/bootstrap-vue/src/components/tooltip/helpers/bv-tooltip-template.js +125 -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 +118 -0
- package/dist/vendor/bootstrap-vue/src/components/transporter/transporter.js +220 -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/components/base/link/link.vue +2 -2
- package/src/utils/url_utils.js +66 -0
- package/src/vendor/bootstrap-vue/src/components/dropdown/dropdown-divider.js +5 -2
- package/src/vendor/bootstrap-vue/src/components/dropdown/dropdown-form.js +16 -4
- package/src/vendor/bootstrap-vue/src/components/dropdown/dropdown-group.js +31 -8
- package/src/vendor/bootstrap-vue/src/components/dropdown/dropdown-header.js +15 -4
- package/src/vendor/bootstrap-vue/src/components/dropdown/dropdown-item-button.js +32 -8
- package/src/vendor/bootstrap-vue/src/components/dropdown/dropdown.js +2 -2
- package/src/vendor/bootstrap-vue/src/components/form/form-invalid-feedback.js +35 -8
- package/src/vendor/bootstrap-vue/src/components/form/form-valid-feedback.js +35 -8
- package/src/vendor/bootstrap-vue/src/components/form-group/form-group.js +2 -2
- package/src/vendor/bootstrap-vue/src/components/form-select/form-select-option-group.js +4 -2
- package/src/vendor/bootstrap-vue/src/components/form-select/form-select-option.js +9 -3
- package/src/vendor/bootstrap-vue/src/components/form-select/form-select.js +16 -9
- package/src/vendor/bootstrap-vue/src/components/form-select/helpers/mixin-options.js +10 -3
- package/src/vendor/bootstrap-vue/src/components/form-textarea/form-textarea.js +26 -7
- 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/popover/popover.js +23 -7
- package/src/vendor/bootstrap-vue/src/components/table/helpers/mixin-busy.js +5 -2
- package/src/vendor/bootstrap-vue/src/components/table/helpers/mixin-caption.js +10 -3
- package/src/vendor/bootstrap-vue/src/components/table/helpers/mixin-empty.js +25 -6
- package/src/vendor/bootstrap-vue/src/components/table/helpers/mixin-items.js +20 -5
- package/src/vendor/bootstrap-vue/src/components/table/helpers/mixin-pagination.js +11 -4
- package/src/vendor/bootstrap-vue/src/components/table/helpers/mixin-provider.js +27 -7
- package/src/vendor/bootstrap-vue/src/components/table/helpers/mixin-selectable.js +21 -7
- package/src/vendor/bootstrap-vue/src/components/table/helpers/mixin-sorting.js +72 -18
- package/src/vendor/bootstrap-vue/src/components/table/helpers/mixin-stacked.js +6 -3
- package/src/vendor/bootstrap-vue/src/components/table/helpers/mixin-table-renderer.js +72 -17
- package/src/vendor/bootstrap-vue/src/components/table/helpers/mixin-tbody-row.js +18 -6
- package/src/vendor/bootstrap-vue/src/components/table/helpers/mixin-tbody.js +7 -3
- package/src/vendor/bootstrap-vue/src/components/table/helpers/mixin-tfoot.js +27 -7
- package/src/vendor/bootstrap-vue/src/components/table/helpers/mixin-thead.js +21 -6
- package/src/vendor/bootstrap-vue/src/components/tabs/tabs.js +2 -2
- package/src/vendor/bootstrap-vue/src/components/tooltip/helpers/bv-popper.js +36 -13
- package/src/vendor/bootstrap-vue/src/components/tooltip/helpers/bv-tooltip-template.js +10 -3
- package/src/vendor/bootstrap-vue/src/components/tooltip/helpers/bv-tooltip.js +8 -9
- package/src/vendor/bootstrap-vue/src/components/transition/bv-transition.js +20 -5
- package/src/vendor/bootstrap-vue/src/components/transporter/transporter.js +22 -6
- 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,328 @@
|
|
|
1
|
+
import { extend } from '../../../vue';
|
|
2
|
+
import { EVENT_NAME_SORT_CHANGED, MODEL_EVENT_NAME_PREFIX } from '../../../constants/events';
|
|
3
|
+
import { PROP_TYPE_STRING, PROP_TYPE_BOOLEAN, PROP_TYPE_FUNCTION, PROP_TYPE_ARRAY, PROP_TYPE_OBJECT } from '../../../constants/props';
|
|
4
|
+
import { isFunction, isUndefinedOrNull } from '../../../utils/inspect';
|
|
5
|
+
import { safeVueInstance } from '../../../utils/safe-vue-instance';
|
|
6
|
+
import { stableSort } from '../../../utils/stable-sort';
|
|
7
|
+
import { trim } from '../../../utils/string';
|
|
8
|
+
import { defaultSortCompare } from './default-sort-compare';
|
|
9
|
+
|
|
10
|
+
// --- Constants ---
|
|
11
|
+
|
|
12
|
+
const MODEL_PROP_NAME_SORT_BY = 'sortBy';
|
|
13
|
+
const MODEL_EVENT_NAME_SORT_BY = MODEL_EVENT_NAME_PREFIX + MODEL_PROP_NAME_SORT_BY;
|
|
14
|
+
const MODEL_PROP_NAME_SORT_DESC = 'sortDesc';
|
|
15
|
+
const MODEL_EVENT_NAME_SORT_DESC = MODEL_EVENT_NAME_PREFIX + MODEL_PROP_NAME_SORT_DESC;
|
|
16
|
+
const SORT_DIRECTION_ASC = 'asc';
|
|
17
|
+
const SORT_DIRECTION_DESC = 'desc';
|
|
18
|
+
const SORT_DIRECTION_LAST = 'last';
|
|
19
|
+
const SORT_DIRECTIONS = [SORT_DIRECTION_ASC, SORT_DIRECTION_DESC, SORT_DIRECTION_LAST];
|
|
20
|
+
|
|
21
|
+
// --- Props ---
|
|
22
|
+
|
|
23
|
+
const props = {
|
|
24
|
+
labelSortAsc: {
|
|
25
|
+
type: PROP_TYPE_STRING,
|
|
26
|
+
required: false,
|
|
27
|
+
default: 'Click to sort ascending'
|
|
28
|
+
},
|
|
29
|
+
labelSortClear: {
|
|
30
|
+
type: PROP_TYPE_STRING,
|
|
31
|
+
required: false,
|
|
32
|
+
default: 'Click to clear sorting'
|
|
33
|
+
},
|
|
34
|
+
labelSortDesc: {
|
|
35
|
+
type: PROP_TYPE_STRING,
|
|
36
|
+
required: false,
|
|
37
|
+
default: 'Click to sort descending'
|
|
38
|
+
},
|
|
39
|
+
noFooterSorting: {
|
|
40
|
+
type: PROP_TYPE_BOOLEAN,
|
|
41
|
+
required: false,
|
|
42
|
+
default: false
|
|
43
|
+
},
|
|
44
|
+
noLocalSorting: {
|
|
45
|
+
type: PROP_TYPE_BOOLEAN,
|
|
46
|
+
required: false,
|
|
47
|
+
default: false
|
|
48
|
+
},
|
|
49
|
+
// Another prop that should have had a better name
|
|
50
|
+
// It should be `noSortClear` (on non-sortable headers)
|
|
51
|
+
// We will need to make sure the documentation is clear on what
|
|
52
|
+
// this prop does (as well as in the code for future reference)
|
|
53
|
+
noSortReset: {
|
|
54
|
+
type: PROP_TYPE_BOOLEAN,
|
|
55
|
+
required: false,
|
|
56
|
+
default: false
|
|
57
|
+
},
|
|
58
|
+
[MODEL_PROP_NAME_SORT_BY]: {
|
|
59
|
+
type: PROP_TYPE_STRING,
|
|
60
|
+
required: false,
|
|
61
|
+
default: undefined
|
|
62
|
+
},
|
|
63
|
+
sortCompare: {
|
|
64
|
+
type: PROP_TYPE_FUNCTION,
|
|
65
|
+
required: false,
|
|
66
|
+
default: undefined
|
|
67
|
+
},
|
|
68
|
+
// String: locale code
|
|
69
|
+
// Array: array of Locale strings
|
|
70
|
+
sortCompareLocale: {
|
|
71
|
+
type: [PROP_TYPE_ARRAY, PROP_TYPE_STRING],
|
|
72
|
+
required: false,
|
|
73
|
+
default: undefined
|
|
74
|
+
},
|
|
75
|
+
// Supported localCompare options, see `options` section of:
|
|
76
|
+
// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/localeCompare
|
|
77
|
+
sortCompareOptions: {
|
|
78
|
+
type: PROP_TYPE_OBJECT,
|
|
79
|
+
required: false,
|
|
80
|
+
default: () => ({
|
|
81
|
+
numeric: true
|
|
82
|
+
})
|
|
83
|
+
},
|
|
84
|
+
// TODO: Make this tri-state: `true`, `false`, `null`
|
|
85
|
+
[MODEL_PROP_NAME_SORT_DESC]: {
|
|
86
|
+
type: PROP_TYPE_BOOLEAN,
|
|
87
|
+
required: false,
|
|
88
|
+
default: false
|
|
89
|
+
},
|
|
90
|
+
// This prop is named incorrectly
|
|
91
|
+
// It should be `initialSortDirection` as it is a bit misleading
|
|
92
|
+
// (not to mention it screws up the ARIA label on the headers)
|
|
93
|
+
sortDirection: {
|
|
94
|
+
type: PROP_TYPE_STRING,
|
|
95
|
+
required: false,
|
|
96
|
+
default: SORT_DIRECTION_ASC,
|
|
97
|
+
validator: value => SORT_DIRECTIONS.includes(value)
|
|
98
|
+
},
|
|
99
|
+
// Place the sorting icon on the left of the header cells
|
|
100
|
+
sortIconLeft: {
|
|
101
|
+
type: PROP_TYPE_BOOLEAN,
|
|
102
|
+
required: false,
|
|
103
|
+
default: false
|
|
104
|
+
},
|
|
105
|
+
// Sort null and undefined to appear last
|
|
106
|
+
sortNullLast: {
|
|
107
|
+
type: PROP_TYPE_BOOLEAN,
|
|
108
|
+
required: false,
|
|
109
|
+
default: false
|
|
110
|
+
}
|
|
111
|
+
};
|
|
112
|
+
|
|
113
|
+
// --- Mixin ---
|
|
114
|
+
|
|
115
|
+
// @vue/component
|
|
116
|
+
const sortingMixin = extend({
|
|
117
|
+
props,
|
|
118
|
+
data() {
|
|
119
|
+
return {
|
|
120
|
+
localSortBy: this[MODEL_PROP_NAME_SORT_BY] || '',
|
|
121
|
+
localSortDesc: this[MODEL_PROP_NAME_SORT_DESC] || false
|
|
122
|
+
};
|
|
123
|
+
},
|
|
124
|
+
computed: {
|
|
125
|
+
localSorting() {
|
|
126
|
+
return this.hasProvider ? !!this.noProviderSorting : !this.noLocalSorting;
|
|
127
|
+
},
|
|
128
|
+
isSortable() {
|
|
129
|
+
return this.computedFields.some(f => f.sortable);
|
|
130
|
+
},
|
|
131
|
+
// Sorts the filtered items and returns a new array of the sorted items
|
|
132
|
+
// When not sorted, the original items array will be returned
|
|
133
|
+
sortedItems() {
|
|
134
|
+
const {
|
|
135
|
+
localSortBy: sortBy,
|
|
136
|
+
localSortDesc: sortDesc,
|
|
137
|
+
sortCompareLocale: locale,
|
|
138
|
+
sortNullLast: nullLast,
|
|
139
|
+
sortCompare,
|
|
140
|
+
localSorting,
|
|
141
|
+
filteredItems,
|
|
142
|
+
localItems
|
|
143
|
+
} = safeVueInstance(this);
|
|
144
|
+
const items = (filteredItems || localItems || []).slice();
|
|
145
|
+
const localeOptions = {
|
|
146
|
+
...this.sortCompareOptions,
|
|
147
|
+
usage: 'sort'
|
|
148
|
+
};
|
|
149
|
+
if (sortBy && localSorting) {
|
|
150
|
+
const field = this.computedFieldsObj[sortBy] || {};
|
|
151
|
+
const sortByFormatted = field.sortByFormatted;
|
|
152
|
+
const formatter = isFunction(sortByFormatted) ? /* istanbul ignore next */sortByFormatted : sortByFormatted ? this.getFieldFormatter(sortBy) : undefined;
|
|
153
|
+
|
|
154
|
+
// `stableSort` returns a new array, and leaves the original array intact
|
|
155
|
+
return stableSort(items, (a, b) => {
|
|
156
|
+
let result = null;
|
|
157
|
+
// Call user provided `sortCompare` routine first
|
|
158
|
+
if (isFunction(sortCompare)) {
|
|
159
|
+
// TODO:
|
|
160
|
+
// Change the `sortCompare` signature to the one of `defaultSortCompare`
|
|
161
|
+
// with the next major version bump
|
|
162
|
+
result = sortCompare(a, b, sortBy, sortDesc, formatter, localeOptions, locale);
|
|
163
|
+
}
|
|
164
|
+
// Fallback to built-in `defaultSortCompare` if `sortCompare`
|
|
165
|
+
// is not defined or returns `null`/`false`
|
|
166
|
+
if (isUndefinedOrNull(result) || result === false) {
|
|
167
|
+
result = defaultSortCompare(a, b, {
|
|
168
|
+
sortBy,
|
|
169
|
+
formatter,
|
|
170
|
+
locale,
|
|
171
|
+
localeOptions,
|
|
172
|
+
nullLast
|
|
173
|
+
});
|
|
174
|
+
}
|
|
175
|
+
// Negate result if sorting in descending order
|
|
176
|
+
return (result || 0) * (sortDesc ? -1 : 1);
|
|
177
|
+
});
|
|
178
|
+
}
|
|
179
|
+
return items;
|
|
180
|
+
}
|
|
181
|
+
},
|
|
182
|
+
watch: {
|
|
183
|
+
[MODEL_PROP_NAME_SORT_DESC](newValue) {
|
|
184
|
+
/* istanbul ignore next */
|
|
185
|
+
if (newValue === this.localSortDesc) {
|
|
186
|
+
return;
|
|
187
|
+
}
|
|
188
|
+
this.localSortDesc = newValue || false;
|
|
189
|
+
},
|
|
190
|
+
[MODEL_PROP_NAME_SORT_BY](newValue) {
|
|
191
|
+
/* istanbul ignore next */
|
|
192
|
+
if (newValue === this.localSortBy) {
|
|
193
|
+
return;
|
|
194
|
+
}
|
|
195
|
+
this.localSortBy = newValue || '';
|
|
196
|
+
},
|
|
197
|
+
// Update .sync props
|
|
198
|
+
localSortDesc(newValue, oldValue) {
|
|
199
|
+
// Emit update to sort-desc.sync
|
|
200
|
+
if (newValue !== oldValue) {
|
|
201
|
+
this.$emit(MODEL_EVENT_NAME_SORT_DESC, newValue);
|
|
202
|
+
}
|
|
203
|
+
},
|
|
204
|
+
localSortBy(newValue, oldValue) {
|
|
205
|
+
if (newValue !== oldValue) {
|
|
206
|
+
this.$emit(MODEL_EVENT_NAME_SORT_BY, newValue);
|
|
207
|
+
}
|
|
208
|
+
}
|
|
209
|
+
},
|
|
210
|
+
methods: {
|
|
211
|
+
// Handlers
|
|
212
|
+
// Need to move from thead-mixin
|
|
213
|
+
handleSort(key, field, event, isFoot) {
|
|
214
|
+
if (!this.isSortable) {
|
|
215
|
+
/* istanbul ignore next */
|
|
216
|
+
return;
|
|
217
|
+
}
|
|
218
|
+
if (isFoot && this.noFooterSorting) {
|
|
219
|
+
return;
|
|
220
|
+
}
|
|
221
|
+
// TODO: make this tri-state sorting
|
|
222
|
+
// cycle desc => asc => none => desc => ...
|
|
223
|
+
let sortChanged = false;
|
|
224
|
+
const toggleLocalSortDesc = () => {
|
|
225
|
+
const sortDirection = field.sortDirection || this.sortDirection;
|
|
226
|
+
if (sortDirection === SORT_DIRECTION_ASC) {
|
|
227
|
+
this.localSortDesc = false;
|
|
228
|
+
} else if (sortDirection === SORT_DIRECTION_DESC) {
|
|
229
|
+
this.localSortDesc = true;
|
|
230
|
+
} else ;
|
|
231
|
+
};
|
|
232
|
+
if (field.sortable) {
|
|
233
|
+
const sortKey = !this.localSorting && field.sortKey ? field.sortKey : key;
|
|
234
|
+
if (this.localSortBy === sortKey) {
|
|
235
|
+
// Change sorting direction on current column
|
|
236
|
+
this.localSortDesc = !this.localSortDesc;
|
|
237
|
+
} else {
|
|
238
|
+
// Start sorting this column ascending
|
|
239
|
+
this.localSortBy = sortKey;
|
|
240
|
+
// this.localSortDesc = false
|
|
241
|
+
toggleLocalSortDesc();
|
|
242
|
+
}
|
|
243
|
+
sortChanged = true;
|
|
244
|
+
} else if (this.localSortBy && !this.noSortReset) {
|
|
245
|
+
this.localSortBy = '';
|
|
246
|
+
toggleLocalSortDesc();
|
|
247
|
+
sortChanged = true;
|
|
248
|
+
}
|
|
249
|
+
if (sortChanged) {
|
|
250
|
+
// Sorting parameters changed
|
|
251
|
+
this.$emit(EVENT_NAME_SORT_CHANGED, this.context);
|
|
252
|
+
}
|
|
253
|
+
},
|
|
254
|
+
// methods to compute classes and attrs for thead>th cells
|
|
255
|
+
sortTheadThClasses(key, field, isFoot) {
|
|
256
|
+
return {
|
|
257
|
+
// If sortable and sortIconLeft are true, then place sort icon on the left
|
|
258
|
+
'b-table-sort-icon-left': field.sortable && this.sortIconLeft && !(isFoot && this.noFooterSorting)
|
|
259
|
+
};
|
|
260
|
+
},
|
|
261
|
+
sortTheadThAttrs(key, field, isFoot) {
|
|
262
|
+
var _field$sortKey;
|
|
263
|
+
const {
|
|
264
|
+
isSortable,
|
|
265
|
+
noFooterSorting,
|
|
266
|
+
localSortDesc,
|
|
267
|
+
localSortBy,
|
|
268
|
+
localSorting
|
|
269
|
+
} = this;
|
|
270
|
+
if (!isSortable || isFoot && noFooterSorting) {
|
|
271
|
+
// No attributes if not a sortable table
|
|
272
|
+
return {};
|
|
273
|
+
}
|
|
274
|
+
const sortable = field.sortable;
|
|
275
|
+
const sortKey = !localSorting ? (_field$sortKey = field.sortKey) !== null && _field$sortKey !== void 0 ? _field$sortKey : key : key;
|
|
276
|
+
|
|
277
|
+
// Assemble the aria-sort attribute value
|
|
278
|
+
const ariaSort = sortable && localSortBy === sortKey ? localSortDesc ? 'descending' : 'ascending' : sortable ? 'none' : null;
|
|
279
|
+
// Return the attribute
|
|
280
|
+
return {
|
|
281
|
+
'aria-sort': ariaSort
|
|
282
|
+
};
|
|
283
|
+
},
|
|
284
|
+
// A label to be placed in an `.gl-sr-only` element in the header cell
|
|
285
|
+
sortTheadThLabel(key, field, isFoot) {
|
|
286
|
+
// No label if not a sortable table
|
|
287
|
+
if (!this.isSortable || isFoot && this.noFooterSorting) {
|
|
288
|
+
return null;
|
|
289
|
+
}
|
|
290
|
+
const {
|
|
291
|
+
localSortBy,
|
|
292
|
+
localSortDesc,
|
|
293
|
+
labelSortAsc,
|
|
294
|
+
labelSortDesc
|
|
295
|
+
} = this;
|
|
296
|
+
const {
|
|
297
|
+
sortable
|
|
298
|
+
} = field;
|
|
299
|
+
// The correctness of these labels is very important for screen reader users
|
|
300
|
+
let labelSorting = '';
|
|
301
|
+
if (sortable) {
|
|
302
|
+
if (localSortBy === key) {
|
|
303
|
+
// Currently sorted sortable column
|
|
304
|
+
labelSorting = localSortDesc ? labelSortAsc : labelSortDesc;
|
|
305
|
+
} else {
|
|
306
|
+
// Not currently sorted sortable column
|
|
307
|
+
// Not using nested ternary's here for clarity/readability
|
|
308
|
+
// Default for `aria-label`
|
|
309
|
+
labelSorting = localSortDesc ? labelSortDesc : labelSortAsc;
|
|
310
|
+
// Handle `sortDirection` setting
|
|
311
|
+
const sortDirection = this.sortDirection || field.sortDirection;
|
|
312
|
+
if (sortDirection === SORT_DIRECTION_ASC) {
|
|
313
|
+
labelSorting = labelSortAsc;
|
|
314
|
+
} else if (sortDirection === SORT_DIRECTION_DESC) {
|
|
315
|
+
labelSorting = labelSortDesc;
|
|
316
|
+
}
|
|
317
|
+
}
|
|
318
|
+
} else if (!this.noSortReset) {
|
|
319
|
+
// Non sortable column
|
|
320
|
+
labelSorting = localSortBy ? this.labelSortClear : '';
|
|
321
|
+
}
|
|
322
|
+
// Return the `.gl-sr-only` sort label or `null` if no label
|
|
323
|
+
return trim(labelSorting) || null;
|
|
324
|
+
}
|
|
325
|
+
}
|
|
326
|
+
});
|
|
327
|
+
|
|
328
|
+
export { props, sortingMixin };
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { extend } from '../../../vue';
|
|
2
|
+
import { PROP_TYPE_BOOLEAN, PROP_TYPE_STRING } from '../../../constants/props';
|
|
3
|
+
|
|
4
|
+
// --- Props ---
|
|
5
|
+
|
|
6
|
+
const props = {
|
|
7
|
+
stacked: {
|
|
8
|
+
type: [PROP_TYPE_BOOLEAN, PROP_TYPE_STRING],
|
|
9
|
+
required: false,
|
|
10
|
+
default: false
|
|
11
|
+
}
|
|
12
|
+
};
|
|
13
|
+
|
|
14
|
+
// --- Mixin ---
|
|
15
|
+
|
|
16
|
+
// @vue/component
|
|
17
|
+
const stackedMixin = extend({
|
|
18
|
+
props,
|
|
19
|
+
computed: {
|
|
20
|
+
isStacked() {
|
|
21
|
+
const {
|
|
22
|
+
stacked
|
|
23
|
+
} = this;
|
|
24
|
+
// `true` when always stacked, or returns breakpoint specified
|
|
25
|
+
return stacked === '' ? true : stacked;
|
|
26
|
+
},
|
|
27
|
+
isStackedAlways() {
|
|
28
|
+
return this.isStacked === true;
|
|
29
|
+
},
|
|
30
|
+
stackedTableClasses() {
|
|
31
|
+
const {
|
|
32
|
+
isStackedAlways
|
|
33
|
+
} = this;
|
|
34
|
+
return {
|
|
35
|
+
'b-table-stacked': isStackedAlways,
|
|
36
|
+
[`b-table-stacked-${this.stacked}`]: !isStackedAlways && this.isStacked
|
|
37
|
+
};
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
});
|
|
41
|
+
|
|
42
|
+
export { props, stackedMixin };
|
|
@@ -0,0 +1,241 @@
|
|
|
1
|
+
import { extend } from '../../../vue';
|
|
2
|
+
import { PROP_TYPE_BOOLEAN, PROP_TYPE_STRING, PROP_TYPE_ARRAY, PROP_TYPE_OBJECT } from '../../../constants/props';
|
|
3
|
+
import { identity } from '../../../utils/identity';
|
|
4
|
+
import { isBoolean } from '../../../utils/inspect';
|
|
5
|
+
import { safeVueInstance } from '../../../utils/safe-vue-instance';
|
|
6
|
+
import { toString } from '../../../utils/string';
|
|
7
|
+
import { attrsMixin } from '../../../mixins/attrs';
|
|
8
|
+
|
|
9
|
+
// Main `<table>` render mixin
|
|
10
|
+
// Includes all main table styling options
|
|
11
|
+
|
|
12
|
+
// --- Props ---
|
|
13
|
+
|
|
14
|
+
const props = {
|
|
15
|
+
bordered: {
|
|
16
|
+
type: PROP_TYPE_BOOLEAN,
|
|
17
|
+
required: false,
|
|
18
|
+
default: false
|
|
19
|
+
},
|
|
20
|
+
borderless: {
|
|
21
|
+
type: PROP_TYPE_BOOLEAN,
|
|
22
|
+
required: false,
|
|
23
|
+
default: false
|
|
24
|
+
},
|
|
25
|
+
captionTop: {
|
|
26
|
+
type: PROP_TYPE_BOOLEAN,
|
|
27
|
+
required: false,
|
|
28
|
+
default: false
|
|
29
|
+
},
|
|
30
|
+
dark: {
|
|
31
|
+
type: PROP_TYPE_BOOLEAN,
|
|
32
|
+
required: false,
|
|
33
|
+
default: false
|
|
34
|
+
},
|
|
35
|
+
fixed: {
|
|
36
|
+
type: PROP_TYPE_BOOLEAN,
|
|
37
|
+
required: false,
|
|
38
|
+
default: false
|
|
39
|
+
},
|
|
40
|
+
hover: {
|
|
41
|
+
type: PROP_TYPE_BOOLEAN,
|
|
42
|
+
required: false,
|
|
43
|
+
default: false
|
|
44
|
+
},
|
|
45
|
+
noBorderCollapse: {
|
|
46
|
+
type: PROP_TYPE_BOOLEAN,
|
|
47
|
+
required: false,
|
|
48
|
+
default: false
|
|
49
|
+
},
|
|
50
|
+
outlined: {
|
|
51
|
+
type: PROP_TYPE_BOOLEAN,
|
|
52
|
+
required: false,
|
|
53
|
+
default: false
|
|
54
|
+
},
|
|
55
|
+
responsive: {
|
|
56
|
+
type: [PROP_TYPE_BOOLEAN, PROP_TYPE_STRING],
|
|
57
|
+
required: false,
|
|
58
|
+
default: false
|
|
59
|
+
},
|
|
60
|
+
small: {
|
|
61
|
+
type: PROP_TYPE_BOOLEAN,
|
|
62
|
+
required: false,
|
|
63
|
+
default: false
|
|
64
|
+
},
|
|
65
|
+
// If a string, it is assumed to be the table `max-height` value
|
|
66
|
+
stickyHeader: {
|
|
67
|
+
type: [PROP_TYPE_BOOLEAN, PROP_TYPE_STRING],
|
|
68
|
+
required: false,
|
|
69
|
+
default: false
|
|
70
|
+
},
|
|
71
|
+
striped: {
|
|
72
|
+
type: PROP_TYPE_BOOLEAN,
|
|
73
|
+
required: false,
|
|
74
|
+
default: false
|
|
75
|
+
},
|
|
76
|
+
tableClass: {
|
|
77
|
+
type: [PROP_TYPE_ARRAY, PROP_TYPE_OBJECT, PROP_TYPE_STRING],
|
|
78
|
+
required: false,
|
|
79
|
+
default: undefined
|
|
80
|
+
},
|
|
81
|
+
tableVariant: {
|
|
82
|
+
type: PROP_TYPE_STRING,
|
|
83
|
+
required: false,
|
|
84
|
+
default: undefined
|
|
85
|
+
}
|
|
86
|
+
};
|
|
87
|
+
|
|
88
|
+
// --- Mixin ---
|
|
89
|
+
|
|
90
|
+
// @vue/component
|
|
91
|
+
const tableRendererMixin = extend({
|
|
92
|
+
mixins: [attrsMixin],
|
|
93
|
+
provide() {
|
|
94
|
+
return {
|
|
95
|
+
getBvTable: () => this
|
|
96
|
+
};
|
|
97
|
+
},
|
|
98
|
+
// Don't place attributes on root element automatically,
|
|
99
|
+
// as table could be wrapped in responsive `<div>`
|
|
100
|
+
inheritAttrs: false,
|
|
101
|
+
props,
|
|
102
|
+
computed: {
|
|
103
|
+
isTableSimple() {
|
|
104
|
+
return false;
|
|
105
|
+
},
|
|
106
|
+
// Layout related computed props
|
|
107
|
+
isResponsive() {
|
|
108
|
+
const {
|
|
109
|
+
responsive
|
|
110
|
+
} = this;
|
|
111
|
+
return responsive === '' ? true : responsive;
|
|
112
|
+
},
|
|
113
|
+
isStickyHeader() {
|
|
114
|
+
let {
|
|
115
|
+
stickyHeader
|
|
116
|
+
} = this;
|
|
117
|
+
stickyHeader = stickyHeader === '' ? true : stickyHeader;
|
|
118
|
+
return this.isStacked ? false : stickyHeader;
|
|
119
|
+
},
|
|
120
|
+
wrapperClasses() {
|
|
121
|
+
const {
|
|
122
|
+
isResponsive
|
|
123
|
+
} = this;
|
|
124
|
+
return [this.isStickyHeader ? 'b-table-sticky-header' : '', isResponsive === true ? 'table-responsive' : isResponsive ? `table-responsive table-responsive-${this.responsive}` : ''].filter(identity);
|
|
125
|
+
},
|
|
126
|
+
wrapperStyles() {
|
|
127
|
+
const {
|
|
128
|
+
isStickyHeader
|
|
129
|
+
} = this;
|
|
130
|
+
return isStickyHeader && !isBoolean(isStickyHeader) ? {
|
|
131
|
+
maxHeight: isStickyHeader
|
|
132
|
+
} : {};
|
|
133
|
+
},
|
|
134
|
+
tableClasses() {
|
|
135
|
+
let {
|
|
136
|
+
hover,
|
|
137
|
+
tableVariant,
|
|
138
|
+
selectableTableClasses,
|
|
139
|
+
stackedTableClasses,
|
|
140
|
+
tableClass,
|
|
141
|
+
computedBusy
|
|
142
|
+
} = safeVueInstance(this);
|
|
143
|
+
hover = this.isTableSimple ? hover : hover && this.computedItems.length > 0 && !computedBusy;
|
|
144
|
+
return [
|
|
145
|
+
// User supplied classes
|
|
146
|
+
tableClass,
|
|
147
|
+
// Styling classes
|
|
148
|
+
{
|
|
149
|
+
'table-striped': this.striped,
|
|
150
|
+
'table-hover': hover,
|
|
151
|
+
'table-dark': this.dark,
|
|
152
|
+
'table-bordered': this.bordered,
|
|
153
|
+
'table-borderless': this.borderless,
|
|
154
|
+
'table-sm': this.small,
|
|
155
|
+
// The following are b-table custom styles
|
|
156
|
+
'gl-border': this.outlined,
|
|
157
|
+
'b-table-fixed': this.fixed,
|
|
158
|
+
'b-table-caption-top': this.captionTop,
|
|
159
|
+
'b-table-no-border-collapse': this.noBorderCollapse
|
|
160
|
+
}, tableVariant ? `${this.dark ? 'bg' : 'table'}-${tableVariant}` : '',
|
|
161
|
+
// Stacked table classes
|
|
162
|
+
stackedTableClasses,
|
|
163
|
+
// Selectable classes
|
|
164
|
+
selectableTableClasses];
|
|
165
|
+
},
|
|
166
|
+
tableAttrs() {
|
|
167
|
+
const {
|
|
168
|
+
computedItems: items,
|
|
169
|
+
filteredItems,
|
|
170
|
+
computedFields: fields,
|
|
171
|
+
selectableTableAttrs,
|
|
172
|
+
computedBusy
|
|
173
|
+
} = safeVueInstance(this);
|
|
174
|
+
const ariaAttrs = this.isTableSimple ? {} : {
|
|
175
|
+
'aria-busy': toString(computedBusy),
|
|
176
|
+
'aria-colcount': toString(fields.length),
|
|
177
|
+
// Preserve user supplied `aria-describedby`, if provided
|
|
178
|
+
'aria-describedby': this.bvAttrs['aria-describedby'] || this.$refs.caption ? this.captionId : null
|
|
179
|
+
};
|
|
180
|
+
const rowCount = items && filteredItems && filteredItems.length > items.length ? toString(filteredItems.length) : null;
|
|
181
|
+
return {
|
|
182
|
+
// We set `aria-rowcount` before merging in `$attrs`,
|
|
183
|
+
// in case user has supplied their own
|
|
184
|
+
'aria-rowcount': rowCount,
|
|
185
|
+
// Merge in user supplied `$attrs` if any
|
|
186
|
+
...this.bvAttrs,
|
|
187
|
+
// Now we can override any `$attrs` here
|
|
188
|
+
id: this.safeId(),
|
|
189
|
+
role: this.bvAttrs.role || 'table',
|
|
190
|
+
...ariaAttrs,
|
|
191
|
+
...selectableTableAttrs
|
|
192
|
+
};
|
|
193
|
+
}
|
|
194
|
+
},
|
|
195
|
+
render(h) {
|
|
196
|
+
const {
|
|
197
|
+
wrapperClasses,
|
|
198
|
+
renderCaption,
|
|
199
|
+
renderColgroup,
|
|
200
|
+
renderThead,
|
|
201
|
+
renderTbody,
|
|
202
|
+
renderTfoot
|
|
203
|
+
} = safeVueInstance(this);
|
|
204
|
+
const $content = [];
|
|
205
|
+
if (this.isTableSimple) {
|
|
206
|
+
$content.push(this.normalizeSlot());
|
|
207
|
+
} else {
|
|
208
|
+
// Build the `<caption>` (from caption mixin)
|
|
209
|
+
$content.push(renderCaption ? renderCaption() : null);
|
|
210
|
+
|
|
211
|
+
// Build the `<colgroup>`
|
|
212
|
+
$content.push(renderColgroup ? renderColgroup() : null);
|
|
213
|
+
|
|
214
|
+
// Build the `<thead>`
|
|
215
|
+
$content.push(renderThead ? renderThead() : null);
|
|
216
|
+
|
|
217
|
+
// Build the `<tbody>`
|
|
218
|
+
$content.push(renderTbody ? renderTbody() : null);
|
|
219
|
+
|
|
220
|
+
// Build the `<tfoot>`
|
|
221
|
+
$content.push(renderTfoot ? renderTfoot() : null);
|
|
222
|
+
}
|
|
223
|
+
|
|
224
|
+
// Assemble `<table>`
|
|
225
|
+
const $table = h('table', {
|
|
226
|
+
staticClass: 'table b-table',
|
|
227
|
+
class: this.tableClasses,
|
|
228
|
+
attrs: this.tableAttrs,
|
|
229
|
+
key: 'b-table'
|
|
230
|
+
}, $content.filter(identity));
|
|
231
|
+
|
|
232
|
+
// Add responsive/sticky wrapper if needed and return table
|
|
233
|
+
return wrapperClasses.length > 0 ? h('div', {
|
|
234
|
+
class: wrapperClasses,
|
|
235
|
+
style: this.wrapperStyles,
|
|
236
|
+
key: 'wrap'
|
|
237
|
+
}, [$table]) : $table;
|
|
238
|
+
}
|
|
239
|
+
});
|
|
240
|
+
|
|
241
|
+
export { props, tableRendererMixin };
|