@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,233 @@
|
|
|
1
|
+
import { extend } from '../../../vue';
|
|
2
|
+
import { EVENT_NAME_HEAD_CLICKED } from '../../../constants/events';
|
|
3
|
+
import { CODE_ENTER, CODE_SPACE } from '../../../constants/key-codes';
|
|
4
|
+
import { PROP_TYPE_STRING, PROP_TYPE_ARRAY, PROP_TYPE_OBJECT } from '../../../constants/props';
|
|
5
|
+
import { SLOT_NAME_THEAD_TOP } from '../../../constants/slots';
|
|
6
|
+
import { stopEvent } from '../../../utils/events';
|
|
7
|
+
import { htmlOrText } from '../../../utils/html';
|
|
8
|
+
import { identity } from '../../../utils/identity';
|
|
9
|
+
import { isUndefinedOrNull } from '../../../utils/inspect';
|
|
10
|
+
import { noop } from '../../../utils/noop';
|
|
11
|
+
import { safeVueInstance } from '../../../utils/safe-vue-instance';
|
|
12
|
+
import { startCase } from '../../../utils/string';
|
|
13
|
+
import { BThead } from '../thead';
|
|
14
|
+
import { BTfoot } from '../tfoot';
|
|
15
|
+
import { BTr } from '../tr';
|
|
16
|
+
import { BTh } from '../th';
|
|
17
|
+
import { filterEvent } from './filter-event';
|
|
18
|
+
import { textSelectionActive } from './text-selection-active';
|
|
19
|
+
|
|
20
|
+
// --- Helper methods ---
|
|
21
|
+
|
|
22
|
+
const getHeadSlotName = value => `head(${value || ''})`;
|
|
23
|
+
const getFootSlotName = value => `foot(${value || ''})`;
|
|
24
|
+
|
|
25
|
+
// --- Props ---
|
|
26
|
+
|
|
27
|
+
const props = {
|
|
28
|
+
// Any Bootstrap theme variant (or custom)
|
|
29
|
+
headRowVariant: {
|
|
30
|
+
type: PROP_TYPE_STRING,
|
|
31
|
+
required: false,
|
|
32
|
+
default: undefined
|
|
33
|
+
},
|
|
34
|
+
// 'light', 'dark' or `null` (or custom)
|
|
35
|
+
headVariant: {
|
|
36
|
+
type: PROP_TYPE_STRING,
|
|
37
|
+
required: false,
|
|
38
|
+
default: undefined
|
|
39
|
+
},
|
|
40
|
+
theadClass: {
|
|
41
|
+
type: [PROP_TYPE_ARRAY, PROP_TYPE_OBJECT, PROP_TYPE_STRING],
|
|
42
|
+
required: false,
|
|
43
|
+
default: undefined
|
|
44
|
+
},
|
|
45
|
+
theadTrClass: {
|
|
46
|
+
type: [PROP_TYPE_ARRAY, PROP_TYPE_OBJECT, PROP_TYPE_STRING],
|
|
47
|
+
required: false,
|
|
48
|
+
default: undefined
|
|
49
|
+
}
|
|
50
|
+
};
|
|
51
|
+
|
|
52
|
+
// --- Mixin ---
|
|
53
|
+
|
|
54
|
+
// @vue/component
|
|
55
|
+
const theadMixin = extend({
|
|
56
|
+
props,
|
|
57
|
+
methods: {
|
|
58
|
+
fieldClasses(field) {
|
|
59
|
+
// Header field (<th>) classes
|
|
60
|
+
return [field.class ? field.class : '', field.thClass ? field.thClass : ''];
|
|
61
|
+
},
|
|
62
|
+
headClicked(event, field, isFoot) {
|
|
63
|
+
if (this.stopIfBusy && this.stopIfBusy(event)) {
|
|
64
|
+
// If table is busy (via provider) then don't propagate
|
|
65
|
+
return;
|
|
66
|
+
} else if (filterEvent(event)) {
|
|
67
|
+
// Clicked on a non-disabled control so ignore
|
|
68
|
+
return;
|
|
69
|
+
} else if (textSelectionActive(this.$el)) {
|
|
70
|
+
// User is selecting text, so ignore
|
|
71
|
+
/* istanbul ignore next: JSDOM doesn't support getSelection() */
|
|
72
|
+
return;
|
|
73
|
+
}
|
|
74
|
+
stopEvent(event);
|
|
75
|
+
this.$emit(EVENT_NAME_HEAD_CLICKED, field.key, field, event, isFoot);
|
|
76
|
+
// Call handleSort directly if sortable (defined in mixin-sorting.js)
|
|
77
|
+
if (this.isSortable) {
|
|
78
|
+
this.handleSort(field.key, field, event, isFoot);
|
|
79
|
+
}
|
|
80
|
+
},
|
|
81
|
+
renderThead() {
|
|
82
|
+
let isFoot = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;
|
|
83
|
+
const {
|
|
84
|
+
computedFields: fields,
|
|
85
|
+
isSortable,
|
|
86
|
+
isSelectable,
|
|
87
|
+
headVariant,
|
|
88
|
+
footVariant,
|
|
89
|
+
headRowVariant,
|
|
90
|
+
footRowVariant
|
|
91
|
+
} = safeVueInstance(this);
|
|
92
|
+
const h = this.$createElement;
|
|
93
|
+
|
|
94
|
+
// In always stacked mode, we don't bother rendering the head/foot
|
|
95
|
+
// Or if no field headings (empty table)
|
|
96
|
+
if (this.isStackedAlways || fields.length === 0) {
|
|
97
|
+
return h();
|
|
98
|
+
}
|
|
99
|
+
const hasHeadClickListener = isSortable || this.hasListener(EVENT_NAME_HEAD_CLICKED);
|
|
100
|
+
|
|
101
|
+
// Reference to `selectAllRows` and `clearSelected()`, if table is selectable
|
|
102
|
+
const selectAllRows = isSelectable ? this.selectAllRows : noop;
|
|
103
|
+
const clearSelected = isSelectable ? this.clearSelected : noop;
|
|
104
|
+
|
|
105
|
+
// Helper function to generate a field <th> cell
|
|
106
|
+
const makeCell = (field, colIndex) => {
|
|
107
|
+
const {
|
|
108
|
+
label,
|
|
109
|
+
labelHtml,
|
|
110
|
+
variant,
|
|
111
|
+
stickyColumn,
|
|
112
|
+
key
|
|
113
|
+
} = field;
|
|
114
|
+
let ariaLabel = null;
|
|
115
|
+
if (!field.label.trim() && !field.headerTitle) {
|
|
116
|
+
// In case field's label and title are empty/blank
|
|
117
|
+
// We need to add a hint about what the column is about for non-sighted users
|
|
118
|
+
/* istanbul ignore next */
|
|
119
|
+
ariaLabel = startCase(field.key);
|
|
120
|
+
}
|
|
121
|
+
const on = {};
|
|
122
|
+
if (hasHeadClickListener) {
|
|
123
|
+
on.click = event => {
|
|
124
|
+
this.headClicked(event, field, isFoot);
|
|
125
|
+
};
|
|
126
|
+
on.keydown = event => {
|
|
127
|
+
const keyCode = event.keyCode;
|
|
128
|
+
if (keyCode === CODE_ENTER || keyCode === CODE_SPACE) {
|
|
129
|
+
this.headClicked(event, field, isFoot);
|
|
130
|
+
}
|
|
131
|
+
};
|
|
132
|
+
}
|
|
133
|
+
const sortAttrs = isSortable ? this.sortTheadThAttrs(key, field, isFoot) : {};
|
|
134
|
+
const sortClass = isSortable ? this.sortTheadThClasses(key, field, isFoot) : null;
|
|
135
|
+
const sortLabel = isSortable ? this.sortTheadThLabel(key, field, isFoot) : null;
|
|
136
|
+
const data = {
|
|
137
|
+
class: [{
|
|
138
|
+
// We need to make the header cell relative when we have
|
|
139
|
+
// a `.gl-sr-only` sort label to work around overflow issues
|
|
140
|
+
'gl-relative': sortLabel
|
|
141
|
+
}, this.fieldClasses(field), sortClass],
|
|
142
|
+
props: {
|
|
143
|
+
variant,
|
|
144
|
+
stickyColumn
|
|
145
|
+
},
|
|
146
|
+
style: field.thStyle || {},
|
|
147
|
+
attrs: {
|
|
148
|
+
// We only add a `tabindex` of `0` if there is a head-clicked listener
|
|
149
|
+
// and the current field is sortable
|
|
150
|
+
tabindex: hasHeadClickListener && field.sortable ? '0' : null,
|
|
151
|
+
abbr: field.headerAbbr || null,
|
|
152
|
+
title: field.headerTitle || null,
|
|
153
|
+
'aria-colindex': colIndex + 1,
|
|
154
|
+
'aria-label': ariaLabel,
|
|
155
|
+
...this.getThValues(null, key, field.thAttr, isFoot ? 'foot' : 'head', {}),
|
|
156
|
+
...sortAttrs
|
|
157
|
+
},
|
|
158
|
+
on,
|
|
159
|
+
key
|
|
160
|
+
};
|
|
161
|
+
|
|
162
|
+
// Handle edge case where in-document templates are used with new
|
|
163
|
+
// `v-slot:name` syntax where the browser lower-cases the v-slot's
|
|
164
|
+
// name (attributes become lower cased when parsed by the browser)
|
|
165
|
+
// We have replaced the square bracket syntax with round brackets
|
|
166
|
+
// to prevent confusion with dynamic slot names
|
|
167
|
+
let slotNames = [getHeadSlotName(key), getHeadSlotName(key.toLowerCase()), getHeadSlotName()];
|
|
168
|
+
// Footer will fallback to header slot names
|
|
169
|
+
if (isFoot) {
|
|
170
|
+
slotNames = [getFootSlotName(key), getFootSlotName(key.toLowerCase()), getFootSlotName(), ...slotNames];
|
|
171
|
+
}
|
|
172
|
+
const scope = {
|
|
173
|
+
label,
|
|
174
|
+
column: key,
|
|
175
|
+
field,
|
|
176
|
+
isFoot,
|
|
177
|
+
// Add in row select methods
|
|
178
|
+
selectAllRows,
|
|
179
|
+
clearSelected
|
|
180
|
+
};
|
|
181
|
+
const $content = this.normalizeSlot(slotNames, scope) || h('div', {
|
|
182
|
+
domProps: htmlOrText(labelHtml, label)
|
|
183
|
+
});
|
|
184
|
+
const $srLabel = sortLabel ? h('span', {
|
|
185
|
+
staticClass: 'gl-sr-only'
|
|
186
|
+
}, ` (${sortLabel})`) : null;
|
|
187
|
+
|
|
188
|
+
// Return the header cell
|
|
189
|
+
return h(BTh, data, [$content, $srLabel].filter(identity));
|
|
190
|
+
};
|
|
191
|
+
|
|
192
|
+
// Generate the array of <th> cells
|
|
193
|
+
const $cells = fields.map(makeCell).filter(identity);
|
|
194
|
+
|
|
195
|
+
// Generate the row(s)
|
|
196
|
+
const $trs = [];
|
|
197
|
+
if (isFoot) {
|
|
198
|
+
$trs.push(h(BTr, {
|
|
199
|
+
class: this.tfootTrClass,
|
|
200
|
+
props: {
|
|
201
|
+
variant: isUndefinedOrNull(footRowVariant) ? headRowVariant : /* istanbul ignore next */footRowVariant
|
|
202
|
+
}
|
|
203
|
+
}, $cells));
|
|
204
|
+
} else {
|
|
205
|
+
const scope = {
|
|
206
|
+
columns: fields.length,
|
|
207
|
+
fields,
|
|
208
|
+
// Add in row select methods
|
|
209
|
+
selectAllRows,
|
|
210
|
+
clearSelected
|
|
211
|
+
};
|
|
212
|
+
$trs.push(this.normalizeSlot(SLOT_NAME_THEAD_TOP, scope) || h());
|
|
213
|
+
$trs.push(h(BTr, {
|
|
214
|
+
class: this.theadTrClass,
|
|
215
|
+
props: {
|
|
216
|
+
variant: headRowVariant
|
|
217
|
+
}
|
|
218
|
+
}, $cells));
|
|
219
|
+
}
|
|
220
|
+
return h(isFoot ? BTfoot : BThead, {
|
|
221
|
+
class: (isFoot ? this.tfootClass : this.theadClass) || null,
|
|
222
|
+
props: isFoot ? {
|
|
223
|
+
footVariant: footVariant || headVariant || null
|
|
224
|
+
} : {
|
|
225
|
+
headVariant: headVariant || null
|
|
226
|
+
},
|
|
227
|
+
key: isFoot ? 'bv-tfoot' : 'bv-thead'
|
|
228
|
+
}, $trs);
|
|
229
|
+
}
|
|
230
|
+
}
|
|
231
|
+
});
|
|
232
|
+
|
|
233
|
+
export { props, theadMixin };
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { extend } from '../../../vue';
|
|
2
|
+
import { SLOT_NAME_TOP_ROW } from '../../../constants/slots';
|
|
3
|
+
import { isFunction } from '../../../utils/inspect';
|
|
4
|
+
import { BTr } from '../tr';
|
|
5
|
+
|
|
6
|
+
// --- Props ---
|
|
7
|
+
|
|
8
|
+
const props = {};
|
|
9
|
+
|
|
10
|
+
// --- Mixin ---
|
|
11
|
+
|
|
12
|
+
// @vue/component
|
|
13
|
+
const topRowMixin = extend({
|
|
14
|
+
methods: {
|
|
15
|
+
renderTopRow() {
|
|
16
|
+
const {
|
|
17
|
+
computedFields: fields,
|
|
18
|
+
stacked,
|
|
19
|
+
tbodyTrClass,
|
|
20
|
+
tbodyTrAttr
|
|
21
|
+
} = this;
|
|
22
|
+
const h = this.$createElement;
|
|
23
|
+
|
|
24
|
+
// Add static Top Row slot (hidden in visibly stacked mode as we can't control the data-label)
|
|
25
|
+
// If in *always* stacked mode, we don't bother rendering the row
|
|
26
|
+
if (!this.hasNormalizedSlot(SLOT_NAME_TOP_ROW) || stacked === true || stacked === '') {
|
|
27
|
+
return h();
|
|
28
|
+
}
|
|
29
|
+
return h(BTr, {
|
|
30
|
+
staticClass: 'b-table-top-row',
|
|
31
|
+
class: [isFunction(tbodyTrClass) ? tbodyTrClass(null, 'row-top') : tbodyTrClass],
|
|
32
|
+
attrs: isFunction(tbodyTrAttr) ? tbodyTrAttr(null, 'row-top') : tbodyTrAttr,
|
|
33
|
+
key: 'b-top-row'
|
|
34
|
+
}, [this.normalizeSlot(SLOT_NAME_TOP_ROW, {
|
|
35
|
+
columns: fields.length,
|
|
36
|
+
fields
|
|
37
|
+
})]);
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
});
|
|
41
|
+
|
|
42
|
+
export { props, topRowMixin };
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
import { identity } from '../../../utils/identity';
|
|
2
|
+
import { isArray, isString, isObject, isFunction } from '../../../utils/inspect';
|
|
3
|
+
import { clone, keys } from '../../../utils/object';
|
|
4
|
+
import { startCase } from '../../../utils/string';
|
|
5
|
+
import { IGNORED_FIELD_KEYS } from './constants';
|
|
6
|
+
|
|
7
|
+
// Private function to massage field entry into common object format
|
|
8
|
+
const processField = (key, value) => {
|
|
9
|
+
let field = null;
|
|
10
|
+
if (isString(value)) {
|
|
11
|
+
// Label shortcut
|
|
12
|
+
field = {
|
|
13
|
+
key,
|
|
14
|
+
label: value
|
|
15
|
+
};
|
|
16
|
+
} else if (isFunction(value)) {
|
|
17
|
+
// Formatter shortcut
|
|
18
|
+
field = {
|
|
19
|
+
key,
|
|
20
|
+
formatter: value
|
|
21
|
+
};
|
|
22
|
+
} else if (isObject(value)) {
|
|
23
|
+
field = clone(value);
|
|
24
|
+
field.key = field.key || key;
|
|
25
|
+
} else if (value !== false) {
|
|
26
|
+
// Fallback to just key
|
|
27
|
+
/* istanbul ignore next */
|
|
28
|
+
field = {
|
|
29
|
+
key
|
|
30
|
+
};
|
|
31
|
+
}
|
|
32
|
+
return field;
|
|
33
|
+
};
|
|
34
|
+
|
|
35
|
+
// We normalize fields into an array of objects
|
|
36
|
+
// [ { key:..., label:..., ...}, {...}, ..., {..}]
|
|
37
|
+
const normalizeFields = (origFields, items) => {
|
|
38
|
+
const fields = [];
|
|
39
|
+
if (isArray(origFields)) {
|
|
40
|
+
// Normalize array Form
|
|
41
|
+
origFields.filter(identity).forEach(f => {
|
|
42
|
+
if (isString(f)) {
|
|
43
|
+
fields.push({
|
|
44
|
+
key: f,
|
|
45
|
+
label: startCase(f)
|
|
46
|
+
});
|
|
47
|
+
} else if (isObject(f) && f.key && isString(f.key)) {
|
|
48
|
+
// Full object definition. We use assign so that we don't mutate the original
|
|
49
|
+
fields.push(clone(f));
|
|
50
|
+
} else if (isObject(f) && keys(f).length === 1) {
|
|
51
|
+
// Shortcut object (i.e. { 'foo_bar': 'This is Foo Bar' }
|
|
52
|
+
const key = keys(f)[0];
|
|
53
|
+
const field = processField(key, f[key]);
|
|
54
|
+
if (field) {
|
|
55
|
+
fields.push(field);
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
});
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
// If no field provided, take a sample from first record (if exits)
|
|
62
|
+
if (fields.length === 0 && isArray(items) && items.length > 0) {
|
|
63
|
+
const sample = items[0];
|
|
64
|
+
keys(sample).forEach(k => {
|
|
65
|
+
if (!IGNORED_FIELD_KEYS[k]) {
|
|
66
|
+
fields.push({
|
|
67
|
+
key: k,
|
|
68
|
+
label: startCase(k)
|
|
69
|
+
});
|
|
70
|
+
}
|
|
71
|
+
});
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
// Ensure we have a unique array of fields and that they have String labels
|
|
75
|
+
const memo = {};
|
|
76
|
+
return fields.filter(f => {
|
|
77
|
+
if (!memo[f.key]) {
|
|
78
|
+
memo[f.key] = true;
|
|
79
|
+
f.label = isString(f.label) ? f.label : startCase(f.key);
|
|
80
|
+
return true;
|
|
81
|
+
}
|
|
82
|
+
return false;
|
|
83
|
+
});
|
|
84
|
+
};
|
|
85
|
+
|
|
86
|
+
export { normalizeFields };
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { isFunction, isArray } from '../../../utils/inspect';
|
|
2
|
+
import { keys, clone, pick } from '../../../utils/object';
|
|
3
|
+
import { IGNORED_FIELD_KEYS } from './constants';
|
|
4
|
+
|
|
5
|
+
// Return a copy of a row after all reserved fields have been filtered out
|
|
6
|
+
const sanitizeRow = function (row, ignoreFields, includeFields) {
|
|
7
|
+
let fieldsObj = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {};
|
|
8
|
+
// We first need to format the row based on the field configurations
|
|
9
|
+
// This ensures that we add formatted values for keys that may not
|
|
10
|
+
// exist in the row itself
|
|
11
|
+
const formattedRow = keys(fieldsObj).reduce((result, key) => {
|
|
12
|
+
const field = fieldsObj[key];
|
|
13
|
+
const {
|
|
14
|
+
filterByFormatted
|
|
15
|
+
} = field;
|
|
16
|
+
const formatter = isFunction(filterByFormatted) ? /* istanbul ignore next */filterByFormatted : filterByFormatted ? /* istanbul ignore next */field.formatter : null;
|
|
17
|
+
if (isFunction(formatter)) {
|
|
18
|
+
result[key] = formatter(row[key], key, row);
|
|
19
|
+
}
|
|
20
|
+
return result;
|
|
21
|
+
}, clone(row));
|
|
22
|
+
|
|
23
|
+
// Determine the allowed keys:
|
|
24
|
+
// - Ignore special fields that start with `_`
|
|
25
|
+
// - Ignore fields in the `ignoreFields` array
|
|
26
|
+
// - Include only fields in the `includeFields` array
|
|
27
|
+
const allowedKeys = keys(formattedRow).filter(key => !IGNORED_FIELD_KEYS[key] && !(isArray(ignoreFields) && ignoreFields.length > 0 && ignoreFields.includes(key)) && !(isArray(includeFields) && includeFields.length > 0 && !includeFields.includes(key)));
|
|
28
|
+
return pick(formattedRow, allowedKeys);
|
|
29
|
+
};
|
|
30
|
+
|
|
31
|
+
export { sanitizeRow };
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { isObject } from '../../../utils/inspect';
|
|
2
|
+
import { stringifyObjectValues } from '../../../utils/stringify-object-values';
|
|
3
|
+
import { sanitizeRow } from './sanitize-row';
|
|
4
|
+
|
|
5
|
+
// Stringifies the values of a record, ignoring any special top level field keys
|
|
6
|
+
// TODO: Add option to stringify `scopedSlot` items
|
|
7
|
+
const stringifyRecordValues = (row, ignoreFields, includeFields, fieldsObj) => {
|
|
8
|
+
return isObject(row) ? stringifyObjectValues(sanitizeRow(row, ignoreFields, includeFields, fieldsObj)) : /* istanbul ignore next */'';
|
|
9
|
+
};
|
|
10
|
+
|
|
11
|
+
export { stringifyRecordValues };
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { getSel, isElement } from '../../../utils/dom';
|
|
2
|
+
|
|
3
|
+
// Helper to determine if a there is an active text selection on the document page
|
|
4
|
+
// Used to filter out click events caused by the mouse up at end of selection
|
|
5
|
+
//
|
|
6
|
+
// Accepts an element as only argument to test to see if selection overlaps or is
|
|
7
|
+
// contained within the element
|
|
8
|
+
const textSelectionActive = function () {
|
|
9
|
+
let el = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : document;
|
|
10
|
+
const sel = getSel();
|
|
11
|
+
return sel && sel.toString().trim() !== '' && sel.containsNode && isElement(el) ? /* istanbul ignore next */sel.containsNode(el, true) : false;
|
|
12
|
+
};
|
|
13
|
+
|
|
14
|
+
export { textSelectionActive };
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export { BTable } from './table';
|
|
2
|
+
export { BTableLite } from './table-lite';
|
|
3
|
+
export { BTableSimple } from './table-simple';
|
|
4
|
+
export { BTbody } from './tbody';
|
|
5
|
+
export { BThead } from './thead';
|
|
6
|
+
export { BTfoot } from './tfoot';
|
|
7
|
+
export { BTr } from './tr';
|
|
8
|
+
export { BTd } from './td';
|
|
9
|
+
export { BTh } from './th';
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import { extend } from '../../vue';
|
|
2
|
+
import { NAME_TABLE_LITE } from '../../constants/components';
|
|
3
|
+
import { sortKeys } from '../../utils/object';
|
|
4
|
+
import { attrsMixin } from '../../mixins/attrs';
|
|
5
|
+
import { hasListenerMixin } from '../../mixins/has-listener';
|
|
6
|
+
import { props as props$1, idMixin } from '../../mixins/id';
|
|
7
|
+
import { normalizeSlotMixin } from '../../mixins/normalize-slot';
|
|
8
|
+
import { props as props$2, captionMixin } from './helpers/mixin-caption';
|
|
9
|
+
import { props as props$3, colgroupMixin } from './helpers/mixin-colgroup';
|
|
10
|
+
import { props as props$4, itemsMixin } from './helpers/mixin-items';
|
|
11
|
+
import { props as props$5, stackedMixin } from './helpers/mixin-stacked';
|
|
12
|
+
import { props as props$6, tableRendererMixin } from './helpers/mixin-table-renderer';
|
|
13
|
+
import { props as props$7, tbodyMixin } from './helpers/mixin-tbody';
|
|
14
|
+
import { props as props$8, tfootMixin } from './helpers/mixin-tfoot';
|
|
15
|
+
import { props as props$9, theadMixin } from './helpers/mixin-thead';
|
|
16
|
+
|
|
17
|
+
// --- Props ---
|
|
18
|
+
|
|
19
|
+
const props = sortKeys({
|
|
20
|
+
...props$1,
|
|
21
|
+
...props$2,
|
|
22
|
+
...props$3,
|
|
23
|
+
...props$4,
|
|
24
|
+
...props$5,
|
|
25
|
+
...props$6,
|
|
26
|
+
...props$7,
|
|
27
|
+
...props$8,
|
|
28
|
+
...props$9
|
|
29
|
+
});
|
|
30
|
+
|
|
31
|
+
// --- Main component ---
|
|
32
|
+
|
|
33
|
+
// @vue/component
|
|
34
|
+
const BTableLite = /*#__PURE__*/extend({
|
|
35
|
+
name: NAME_TABLE_LITE,
|
|
36
|
+
// Order of mixins is important!
|
|
37
|
+
// They are merged from first to last, followed by this component
|
|
38
|
+
mixins: [
|
|
39
|
+
// General mixins
|
|
40
|
+
attrsMixin, hasListenerMixin, idMixin, normalizeSlotMixin,
|
|
41
|
+
// Required table mixins
|
|
42
|
+
itemsMixin, tableRendererMixin, stackedMixin, theadMixin, tfootMixin, tbodyMixin,
|
|
43
|
+
// Table features mixins
|
|
44
|
+
// These are pretty lightweight, and are useful for lightweight tables
|
|
45
|
+
captionMixin, colgroupMixin],
|
|
46
|
+
props
|
|
47
|
+
|
|
48
|
+
// Render function is provided by `tableRendererMixin`
|
|
49
|
+
});
|
|
50
|
+
|
|
51
|
+
export { BTableLite, props };
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { extend } from '../../vue';
|
|
2
|
+
import { NAME_TABLE_SIMPLE } from '../../constants/components';
|
|
3
|
+
import { sortKeys } from '../../utils/object';
|
|
4
|
+
import { attrsMixin } from '../../mixins/attrs';
|
|
5
|
+
import { hasListenerMixin } from '../../mixins/has-listener';
|
|
6
|
+
import { props as props$1, idMixin } from '../../mixins/id';
|
|
7
|
+
import { normalizeSlotMixin } from '../../mixins/normalize-slot';
|
|
8
|
+
import { props as props$2, stackedMixin } from './helpers/mixin-stacked';
|
|
9
|
+
import { props as props$3, tableRendererMixin } from './helpers/mixin-table-renderer';
|
|
10
|
+
|
|
11
|
+
// --- Props ---
|
|
12
|
+
|
|
13
|
+
const props = sortKeys({
|
|
14
|
+
...props$1,
|
|
15
|
+
...props$2,
|
|
16
|
+
...props$3
|
|
17
|
+
});
|
|
18
|
+
|
|
19
|
+
// --- Main component ---
|
|
20
|
+
|
|
21
|
+
// @vue/component
|
|
22
|
+
const BTableSimple = /*#__PURE__*/extend({
|
|
23
|
+
name: NAME_TABLE_SIMPLE,
|
|
24
|
+
// Order of mixins is important!
|
|
25
|
+
// They are merged from first to last, followed by this component
|
|
26
|
+
mixins: [
|
|
27
|
+
// General mixins
|
|
28
|
+
attrsMixin, hasListenerMixin, idMixin, normalizeSlotMixin,
|
|
29
|
+
// Required table mixins
|
|
30
|
+
tableRendererMixin,
|
|
31
|
+
// Table features mixins
|
|
32
|
+
// Stacked requires extra handling by users via
|
|
33
|
+
// the table cell `stacked-heading` prop
|
|
34
|
+
stackedMixin],
|
|
35
|
+
props,
|
|
36
|
+
computed: {
|
|
37
|
+
isTableSimple() {
|
|
38
|
+
return true;
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
// Render function is provided by `tableRendererMixin`
|
|
42
|
+
});
|
|
43
|
+
|
|
44
|
+
export { BTableSimple, props };
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
import { extend } from '../../vue';
|
|
2
|
+
import { NAME_TABLE } from '../../constants/components';
|
|
3
|
+
import { sortKeys } from '../../utils/object';
|
|
4
|
+
import { attrsMixin } from '../../mixins/attrs';
|
|
5
|
+
import { hasListenerMixin } from '../../mixins/has-listener';
|
|
6
|
+
import { props as props$1, idMixin } from '../../mixins/id';
|
|
7
|
+
import { normalizeSlotMixin } from '../../mixins/normalize-slot';
|
|
8
|
+
import { props as props$2, bottomRowMixin } from './helpers/mixin-bottom-row';
|
|
9
|
+
import { props as props$3, busyMixin } from './helpers/mixin-busy';
|
|
10
|
+
import { props as props$4, captionMixin } from './helpers/mixin-caption';
|
|
11
|
+
import { props as props$5, colgroupMixin } from './helpers/mixin-colgroup';
|
|
12
|
+
import { props as props$6, emptyMixin } from './helpers/mixin-empty';
|
|
13
|
+
import { props as props$7, filteringMixin } from './helpers/mixin-filtering';
|
|
14
|
+
import { props as props$8, itemsMixin } from './helpers/mixin-items';
|
|
15
|
+
import { props as props$9, paginationMixin } from './helpers/mixin-pagination';
|
|
16
|
+
import { props as props$a, providerMixin } from './helpers/mixin-provider';
|
|
17
|
+
import { props as props$b, selectableMixin } from './helpers/mixin-selectable';
|
|
18
|
+
import { props as props$c, sortingMixin } from './helpers/mixin-sorting';
|
|
19
|
+
import { props as props$d, stackedMixin } from './helpers/mixin-stacked';
|
|
20
|
+
import { props as props$e, tableRendererMixin } from './helpers/mixin-table-renderer';
|
|
21
|
+
import { props as props$f, tbodyMixin } from './helpers/mixin-tbody';
|
|
22
|
+
import { props as props$g, tfootMixin } from './helpers/mixin-tfoot';
|
|
23
|
+
import { props as props$h, theadMixin } from './helpers/mixin-thead';
|
|
24
|
+
import { props as props$i, topRowMixin } from './helpers/mixin-top-row';
|
|
25
|
+
|
|
26
|
+
// --- Props ---
|
|
27
|
+
|
|
28
|
+
const props = sortKeys({
|
|
29
|
+
...props$1,
|
|
30
|
+
...props$2,
|
|
31
|
+
...props$3,
|
|
32
|
+
...props$4,
|
|
33
|
+
...props$5,
|
|
34
|
+
...props$6,
|
|
35
|
+
...props$7,
|
|
36
|
+
...props$8,
|
|
37
|
+
...props$9,
|
|
38
|
+
...props$a,
|
|
39
|
+
...props$b,
|
|
40
|
+
...props$c,
|
|
41
|
+
...props$d,
|
|
42
|
+
...props$e,
|
|
43
|
+
...props$f,
|
|
44
|
+
...props$g,
|
|
45
|
+
...props$h,
|
|
46
|
+
...props$i
|
|
47
|
+
});
|
|
48
|
+
|
|
49
|
+
// --- Main component ---
|
|
50
|
+
|
|
51
|
+
// @vue/component
|
|
52
|
+
const BTable = /*#__PURE__*/extend({
|
|
53
|
+
name: NAME_TABLE,
|
|
54
|
+
// Order of mixins is important!
|
|
55
|
+
// They are merged from first to last, followed by this component
|
|
56
|
+
mixins: [
|
|
57
|
+
// General mixins
|
|
58
|
+
attrsMixin, hasListenerMixin, idMixin, normalizeSlotMixin,
|
|
59
|
+
// Required table mixins
|
|
60
|
+
itemsMixin, tableRendererMixin, stackedMixin, theadMixin, tfootMixin, tbodyMixin,
|
|
61
|
+
// Table features mixins
|
|
62
|
+
stackedMixin, filteringMixin, sortingMixin, paginationMixin, captionMixin, colgroupMixin, selectableMixin, emptyMixin, topRowMixin, bottomRowMixin, busyMixin, providerMixin],
|
|
63
|
+
props
|
|
64
|
+
// Render function is provided by `tableRendererMixin`
|
|
65
|
+
});
|
|
66
|
+
|
|
67
|
+
export { BTable, props };
|