@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,47 @@
|
|
|
1
|
+
import { extend, mergeData } from '../../vue';
|
|
2
|
+
import { NAME_FORM_SELECT_OPTION } from '../../constants/components';
|
|
3
|
+
import { PROP_TYPE_BOOLEAN, PROP_TYPE_ANY } from '../../constants/props';
|
|
4
|
+
|
|
5
|
+
// --- Props ---
|
|
6
|
+
|
|
7
|
+
const props = {
|
|
8
|
+
disabled: {
|
|
9
|
+
type: PROP_TYPE_BOOLEAN,
|
|
10
|
+
required: false,
|
|
11
|
+
default: false
|
|
12
|
+
},
|
|
13
|
+
value: {
|
|
14
|
+
type: PROP_TYPE_ANY,
|
|
15
|
+
required: true
|
|
16
|
+
}
|
|
17
|
+
};
|
|
18
|
+
|
|
19
|
+
// --- Main component ---
|
|
20
|
+
|
|
21
|
+
// @vue/component
|
|
22
|
+
const BFormSelectOption = /*#__PURE__*/extend({
|
|
23
|
+
name: NAME_FORM_SELECT_OPTION,
|
|
24
|
+
functional: true,
|
|
25
|
+
props,
|
|
26
|
+
render(h, _ref) {
|
|
27
|
+
let {
|
|
28
|
+
props,
|
|
29
|
+
data,
|
|
30
|
+
children
|
|
31
|
+
} = _ref;
|
|
32
|
+
const {
|
|
33
|
+
value,
|
|
34
|
+
disabled
|
|
35
|
+
} = props;
|
|
36
|
+
return h('option', mergeData(data, {
|
|
37
|
+
attrs: {
|
|
38
|
+
disabled
|
|
39
|
+
},
|
|
40
|
+
domProps: {
|
|
41
|
+
value
|
|
42
|
+
}
|
|
43
|
+
}), children);
|
|
44
|
+
}
|
|
45
|
+
});
|
|
46
|
+
|
|
47
|
+
export { BFormSelectOption, props };
|
|
@@ -0,0 +1,154 @@
|
|
|
1
|
+
import { extend } from '../../vue';
|
|
2
|
+
import { NAME_FORM_SELECT } from '../../constants/components';
|
|
3
|
+
import { EVENT_NAME_CHANGE } from '../../constants/events';
|
|
4
|
+
import { PROP_TYPE_BOOLEAN, PROP_TYPE_STRING, PROP_TYPE_NUMBER } from '../../constants/props';
|
|
5
|
+
import { SLOT_NAME_FIRST } from '../../constants/slots';
|
|
6
|
+
import { from } from '../../utils/array';
|
|
7
|
+
import { attemptFocus, attemptBlur } from '../../utils/dom';
|
|
8
|
+
import { htmlOrText } from '../../utils/html';
|
|
9
|
+
import { isArray } from '../../utils/inspect';
|
|
10
|
+
import { sortKeys } from '../../utils/object';
|
|
11
|
+
import { props as props$3, formControlMixin } from '../../mixins/form-control';
|
|
12
|
+
import { props as props$4, formCustomMixin } from '../../mixins/form-custom';
|
|
13
|
+
import { props as props$5, formSizeMixin } from '../../mixins/form-size';
|
|
14
|
+
import { props as props$6, formStateMixin } from '../../mixins/form-state';
|
|
15
|
+
import { props as props$1, idMixin } from '../../mixins/id';
|
|
16
|
+
import { props as props$2, modelMixin, MODEL_PROP_NAME, MODEL_EVENT_NAME } from '../../mixins/model';
|
|
17
|
+
import { normalizeSlotMixin } from '../../mixins/normalize-slot';
|
|
18
|
+
import { optionsMixin } from './helpers/mixin-options';
|
|
19
|
+
import { BFormSelectOption } from './form-select-option';
|
|
20
|
+
import { BFormSelectOptionGroup } from './form-select-option-group';
|
|
21
|
+
|
|
22
|
+
// --- Props ---
|
|
23
|
+
|
|
24
|
+
const props = sortKeys({
|
|
25
|
+
...props$1,
|
|
26
|
+
...props$2,
|
|
27
|
+
...props$3,
|
|
28
|
+
...props$4,
|
|
29
|
+
...props$5,
|
|
30
|
+
...props$6,
|
|
31
|
+
ariaInvalid: {
|
|
32
|
+
type: [PROP_TYPE_BOOLEAN, PROP_TYPE_STRING],
|
|
33
|
+
required: false,
|
|
34
|
+
default: false
|
|
35
|
+
},
|
|
36
|
+
multiple: {
|
|
37
|
+
type: PROP_TYPE_BOOLEAN,
|
|
38
|
+
required: false,
|
|
39
|
+
default: false
|
|
40
|
+
},
|
|
41
|
+
// Browsers default size to `0`, which shows 4 rows in most browsers in multiple mode
|
|
42
|
+
// Size of `1` can bork out Firefox
|
|
43
|
+
selectSize: {
|
|
44
|
+
type: PROP_TYPE_NUMBER,
|
|
45
|
+
required: false,
|
|
46
|
+
default: 0
|
|
47
|
+
}
|
|
48
|
+
});
|
|
49
|
+
|
|
50
|
+
// --- Main component ---
|
|
51
|
+
|
|
52
|
+
// @vue/component
|
|
53
|
+
const BFormSelect = /*#__PURE__*/extend({
|
|
54
|
+
name: NAME_FORM_SELECT,
|
|
55
|
+
mixins: [idMixin, modelMixin, formControlMixin, formSizeMixin, formStateMixin, formCustomMixin, optionsMixin, normalizeSlotMixin],
|
|
56
|
+
props,
|
|
57
|
+
data() {
|
|
58
|
+
return {
|
|
59
|
+
localValue: this[MODEL_PROP_NAME]
|
|
60
|
+
};
|
|
61
|
+
},
|
|
62
|
+
computed: {
|
|
63
|
+
computedSelectSize() {
|
|
64
|
+
// Custom selects with a size of zero causes the arrows to be hidden,
|
|
65
|
+
// so dont render the size attribute in this case
|
|
66
|
+
return !this.plain && this.selectSize === 0 ? null : this.selectSize;
|
|
67
|
+
},
|
|
68
|
+
inputClass() {
|
|
69
|
+
return [this.plain ? 'form-control' : 'custom-select', this.size && this.plain ? `form-control-${this.size}` : null, this.size && !this.plain ? `custom-select-${this.size}` : null, this.stateClass];
|
|
70
|
+
}
|
|
71
|
+
},
|
|
72
|
+
watch: {
|
|
73
|
+
value(newValue) {
|
|
74
|
+
this.localValue = newValue;
|
|
75
|
+
},
|
|
76
|
+
localValue() {
|
|
77
|
+
this.$emit(MODEL_EVENT_NAME, this.localValue);
|
|
78
|
+
}
|
|
79
|
+
},
|
|
80
|
+
methods: {
|
|
81
|
+
focus() {
|
|
82
|
+
attemptFocus(this.$refs.input);
|
|
83
|
+
},
|
|
84
|
+
blur() {
|
|
85
|
+
attemptBlur(this.$refs.input);
|
|
86
|
+
},
|
|
87
|
+
onChange(event) {
|
|
88
|
+
const {
|
|
89
|
+
target
|
|
90
|
+
} = event;
|
|
91
|
+
const selectedValue = from(target.options).filter(o => o.selected).map(o => '_value' in o ? o._value : o.value);
|
|
92
|
+
this.localValue = target.multiple ? selectedValue : selectedValue[0];
|
|
93
|
+
this.$nextTick(() => {
|
|
94
|
+
this.$emit(EVENT_NAME_CHANGE, this.localValue);
|
|
95
|
+
});
|
|
96
|
+
}
|
|
97
|
+
},
|
|
98
|
+
render(h) {
|
|
99
|
+
const {
|
|
100
|
+
name,
|
|
101
|
+
disabled,
|
|
102
|
+
required,
|
|
103
|
+
computedSelectSize: size,
|
|
104
|
+
localValue: value
|
|
105
|
+
} = this;
|
|
106
|
+
const $options = this.formOptions.map((option, index) => {
|
|
107
|
+
const {
|
|
108
|
+
value,
|
|
109
|
+
label,
|
|
110
|
+
options,
|
|
111
|
+
disabled
|
|
112
|
+
} = option;
|
|
113
|
+
const key = `option_${index}`;
|
|
114
|
+
return isArray(options) ? h(BFormSelectOptionGroup, {
|
|
115
|
+
props: {
|
|
116
|
+
label,
|
|
117
|
+
options
|
|
118
|
+
},
|
|
119
|
+
key
|
|
120
|
+
}) : h(BFormSelectOption, {
|
|
121
|
+
props: {
|
|
122
|
+
value,
|
|
123
|
+
disabled
|
|
124
|
+
},
|
|
125
|
+
domProps: htmlOrText(option.html, option.text),
|
|
126
|
+
key
|
|
127
|
+
});
|
|
128
|
+
});
|
|
129
|
+
return h('select', {
|
|
130
|
+
class: this.inputClass,
|
|
131
|
+
attrs: {
|
|
132
|
+
id: this.safeId(),
|
|
133
|
+
name,
|
|
134
|
+
form: this.form || null,
|
|
135
|
+
multiple: this.multiple || null,
|
|
136
|
+
size,
|
|
137
|
+
disabled,
|
|
138
|
+
required,
|
|
139
|
+
'aria-required': required ? 'true' : null,
|
|
140
|
+
'aria-invalid': this.computedAriaInvalid
|
|
141
|
+
},
|
|
142
|
+
on: {
|
|
143
|
+
change: this.onChange
|
|
144
|
+
},
|
|
145
|
+
directives: [{
|
|
146
|
+
name: 'model',
|
|
147
|
+
value
|
|
148
|
+
}],
|
|
149
|
+
ref: 'input'
|
|
150
|
+
}, [this.normalizeSlot(SLOT_NAME_FIRST), $options, this.normalizeSlot()]);
|
|
151
|
+
}
|
|
152
|
+
});
|
|
153
|
+
|
|
154
|
+
export { BFormSelect, props };
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import { extend } from '../../../vue';
|
|
2
|
+
import { PROP_TYPE_STRING } from '../../../constants/props';
|
|
3
|
+
import { get } from '../../../utils/get';
|
|
4
|
+
import { isPlainObject, isNull, isUndefined } from '../../../utils/inspect';
|
|
5
|
+
import { sortKeys } from '../../../utils/object';
|
|
6
|
+
import { props as props$1, formOptionsMixin } from '../../../mixins/form-options';
|
|
7
|
+
|
|
8
|
+
// --- Props ---
|
|
9
|
+
|
|
10
|
+
const props = sortKeys({
|
|
11
|
+
...props$1,
|
|
12
|
+
labelField: {
|
|
13
|
+
type: PROP_TYPE_STRING,
|
|
14
|
+
required: false,
|
|
15
|
+
default: 'label'
|
|
16
|
+
},
|
|
17
|
+
optionsField: {
|
|
18
|
+
type: PROP_TYPE_STRING,
|
|
19
|
+
required: false,
|
|
20
|
+
default: 'options'
|
|
21
|
+
}
|
|
22
|
+
});
|
|
23
|
+
|
|
24
|
+
// --- Mixin ---
|
|
25
|
+
|
|
26
|
+
// @vue/component
|
|
27
|
+
const optionsMixin = extend({
|
|
28
|
+
mixins: [formOptionsMixin],
|
|
29
|
+
props,
|
|
30
|
+
methods: {
|
|
31
|
+
normalizeOption(option) {
|
|
32
|
+
let key = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null;
|
|
33
|
+
// When the option is an object, normalize it
|
|
34
|
+
if (isPlainObject(option)) {
|
|
35
|
+
const value = get(option, this.valueField);
|
|
36
|
+
const text = get(option, this.textField);
|
|
37
|
+
const options = get(option, this.optionsField, null);
|
|
38
|
+
// When it has options, create an `<optgroup>` object
|
|
39
|
+
if (!isNull(options)) {
|
|
40
|
+
return {
|
|
41
|
+
label: String(get(option, this.labelField) || text),
|
|
42
|
+
options: this.normalizeOptions(options)
|
|
43
|
+
};
|
|
44
|
+
}
|
|
45
|
+
// Otherwise create an `<option>` object
|
|
46
|
+
return {
|
|
47
|
+
value: isUndefined(value) ? key || text : value,
|
|
48
|
+
text: String(isUndefined(text) ? key : text),
|
|
49
|
+
html: get(option, this.htmlField),
|
|
50
|
+
disabled: Boolean(get(option, this.disabledField))
|
|
51
|
+
};
|
|
52
|
+
}
|
|
53
|
+
// Otherwise create an `<option>` object from the given value
|
|
54
|
+
return {
|
|
55
|
+
value: key || option,
|
|
56
|
+
text: String(option),
|
|
57
|
+
disabled: false
|
|
58
|
+
};
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
});
|
|
62
|
+
|
|
63
|
+
export { optionsMixin, props };
|
|
@@ -0,0 +1,236 @@
|
|
|
1
|
+
import { extend } from '../../vue';
|
|
2
|
+
import { NAME_FORM_TEXTAREA } from '../../constants/components';
|
|
3
|
+
import { PROP_TYPE_NUMBER, PROP_TYPE_STRING, PROP_TYPE_BOOLEAN } from '../../constants/props';
|
|
4
|
+
import { requestAF, isVisible, getCS, getStyle, setStyle } from '../../utils/dom';
|
|
5
|
+
import { isNull } from '../../utils/inspect';
|
|
6
|
+
import { mathMax, mathMin, mathCeil } from '../../utils/math';
|
|
7
|
+
import { toInteger, toFloat } from '../../utils/number';
|
|
8
|
+
import { sortKeys } from '../../utils/object';
|
|
9
|
+
import { props as props$2, formControlMixin } from '../../mixins/form-control';
|
|
10
|
+
import { formSelectionMixin } from '../../mixins/form-selection';
|
|
11
|
+
import { props as props$3, formSizeMixin } from '../../mixins/form-size';
|
|
12
|
+
import { props as props$4, formStateMixin } from '../../mixins/form-state';
|
|
13
|
+
import { props as props$5, formTextMixin } from '../../mixins/form-text';
|
|
14
|
+
import { formValidityMixin } from '../../mixins/form-validity';
|
|
15
|
+
import { props as props$1, idMixin } from '../../mixins/id';
|
|
16
|
+
import { listenOnRootMixin } from '../../mixins/listen-on-root';
|
|
17
|
+
import { listenersMixin } from '../../mixins/listeners';
|
|
18
|
+
import { VBVisible } from '../../directives/visible/visible';
|
|
19
|
+
|
|
20
|
+
// --- Props ---
|
|
21
|
+
|
|
22
|
+
const props = sortKeys({
|
|
23
|
+
...props$1,
|
|
24
|
+
...props$2,
|
|
25
|
+
...props$3,
|
|
26
|
+
...props$4,
|
|
27
|
+
...props$5,
|
|
28
|
+
maxRows: {
|
|
29
|
+
type: [PROP_TYPE_NUMBER, PROP_TYPE_STRING],
|
|
30
|
+
required: false,
|
|
31
|
+
default: undefined
|
|
32
|
+
},
|
|
33
|
+
// When in auto resize mode, disable shrinking to content height
|
|
34
|
+
noAutoShrink: {
|
|
35
|
+
type: PROP_TYPE_BOOLEAN,
|
|
36
|
+
required: false,
|
|
37
|
+
default: false
|
|
38
|
+
},
|
|
39
|
+
// Disable the resize handle of textarea
|
|
40
|
+
noResize: {
|
|
41
|
+
type: PROP_TYPE_BOOLEAN,
|
|
42
|
+
required: false,
|
|
43
|
+
default: false
|
|
44
|
+
},
|
|
45
|
+
rows: {
|
|
46
|
+
type: [PROP_TYPE_NUMBER, PROP_TYPE_STRING],
|
|
47
|
+
required: false,
|
|
48
|
+
default: 2
|
|
49
|
+
},
|
|
50
|
+
// 'soft', 'hard' or 'off'
|
|
51
|
+
// Browser default is 'soft'
|
|
52
|
+
wrap: {
|
|
53
|
+
type: PROP_TYPE_STRING,
|
|
54
|
+
required: false,
|
|
55
|
+
default: 'soft'
|
|
56
|
+
}
|
|
57
|
+
});
|
|
58
|
+
|
|
59
|
+
// --- Main component ---
|
|
60
|
+
|
|
61
|
+
// @vue/component
|
|
62
|
+
const BFormTextarea = /*#__PURE__*/extend({
|
|
63
|
+
name: NAME_FORM_TEXTAREA,
|
|
64
|
+
directives: {
|
|
65
|
+
'b-visible': VBVisible
|
|
66
|
+
},
|
|
67
|
+
// Mixin order is important!
|
|
68
|
+
mixins: [listenersMixin, idMixin, listenOnRootMixin, formControlMixin, formSizeMixin, formStateMixin, formTextMixin, formSelectionMixin, formValidityMixin],
|
|
69
|
+
props,
|
|
70
|
+
data() {
|
|
71
|
+
return {
|
|
72
|
+
heightInPx: null
|
|
73
|
+
};
|
|
74
|
+
},
|
|
75
|
+
computed: {
|
|
76
|
+
type() {
|
|
77
|
+
return null;
|
|
78
|
+
},
|
|
79
|
+
computedStyle() {
|
|
80
|
+
const styles = {
|
|
81
|
+
// Setting `noResize` to true will disable the ability for the user to
|
|
82
|
+
// manually resize the textarea. We also disable when in auto height mode
|
|
83
|
+
resize: !this.computedRows || this.noResize ? 'none' : null
|
|
84
|
+
};
|
|
85
|
+
if (!this.computedRows) {
|
|
86
|
+
// Conditionally set the computed CSS height when auto rows/height is enabled
|
|
87
|
+
// We avoid setting the style to `null`, which can override user manual resize handle
|
|
88
|
+
styles.height = this.heightInPx;
|
|
89
|
+
// We always add a vertical scrollbar to the textarea when auto-height is
|
|
90
|
+
// enabled so that the computed height calculation returns a stable value
|
|
91
|
+
styles.overflowY = 'scroll';
|
|
92
|
+
}
|
|
93
|
+
return styles;
|
|
94
|
+
},
|
|
95
|
+
computedMinRows() {
|
|
96
|
+
// Ensure rows is at least 2 and positive (2 is the native textarea value)
|
|
97
|
+
// A value of 1 can cause issues in some browsers, and most browsers
|
|
98
|
+
// only support 2 as the smallest value
|
|
99
|
+
return mathMax(toInteger(this.rows, 2), 2);
|
|
100
|
+
},
|
|
101
|
+
computedMaxRows() {
|
|
102
|
+
return mathMax(this.computedMinRows, toInteger(this.maxRows, 0));
|
|
103
|
+
},
|
|
104
|
+
computedRows() {
|
|
105
|
+
// This is used to set the attribute 'rows' on the textarea
|
|
106
|
+
// If auto-height is enabled, then we return `null` as we use CSS to control height
|
|
107
|
+
return this.computedMinRows === this.computedMaxRows ? this.computedMinRows : null;
|
|
108
|
+
},
|
|
109
|
+
computedAttrs() {
|
|
110
|
+
const {
|
|
111
|
+
disabled,
|
|
112
|
+
required
|
|
113
|
+
} = this;
|
|
114
|
+
return {
|
|
115
|
+
id: this.safeId(),
|
|
116
|
+
name: this.name || null,
|
|
117
|
+
form: this.form || null,
|
|
118
|
+
disabled,
|
|
119
|
+
placeholder: this.placeholder || null,
|
|
120
|
+
required,
|
|
121
|
+
autocomplete: this.autocomplete || null,
|
|
122
|
+
readonly: this.readonly || this.plaintext,
|
|
123
|
+
rows: this.computedRows,
|
|
124
|
+
wrap: this.wrap || null,
|
|
125
|
+
'aria-required': this.required ? 'true' : null,
|
|
126
|
+
'aria-invalid': this.computedAriaInvalid
|
|
127
|
+
};
|
|
128
|
+
},
|
|
129
|
+
computedListeners() {
|
|
130
|
+
return {
|
|
131
|
+
...this.bvListeners,
|
|
132
|
+
input: this.onInput,
|
|
133
|
+
change: this.onChange,
|
|
134
|
+
blur: this.onBlur
|
|
135
|
+
};
|
|
136
|
+
}
|
|
137
|
+
},
|
|
138
|
+
watch: {
|
|
139
|
+
localValue() {
|
|
140
|
+
this.setHeight();
|
|
141
|
+
}
|
|
142
|
+
},
|
|
143
|
+
mounted() {
|
|
144
|
+
this.setHeight();
|
|
145
|
+
},
|
|
146
|
+
methods: {
|
|
147
|
+
// Called by intersection observer directive
|
|
148
|
+
/* istanbul ignore next */
|
|
149
|
+
visibleCallback(visible) {
|
|
150
|
+
if (visible) {
|
|
151
|
+
// We use a `$nextTick()` here just to make sure any
|
|
152
|
+
// transitions or portalling have completed
|
|
153
|
+
this.$nextTick(this.setHeight);
|
|
154
|
+
}
|
|
155
|
+
},
|
|
156
|
+
setHeight() {
|
|
157
|
+
this.$nextTick(() => {
|
|
158
|
+
requestAF(() => {
|
|
159
|
+
this.heightInPx = this.computeHeight();
|
|
160
|
+
});
|
|
161
|
+
});
|
|
162
|
+
},
|
|
163
|
+
/* istanbul ignore next: can't test getComputedStyle in JSDOM */
|
|
164
|
+
computeHeight() {
|
|
165
|
+
if (this.$isServer || !isNull(this.computedRows)) {
|
|
166
|
+
return null;
|
|
167
|
+
}
|
|
168
|
+
const el = this.$el;
|
|
169
|
+
|
|
170
|
+
// Element must be visible (not hidden) and in document
|
|
171
|
+
// Must be checked after above checks
|
|
172
|
+
if (!isVisible(el)) {
|
|
173
|
+
return null;
|
|
174
|
+
}
|
|
175
|
+
|
|
176
|
+
// Get current computed styles
|
|
177
|
+
const computedStyle = getCS(el);
|
|
178
|
+
// Height of one line of text in px
|
|
179
|
+
const lineHeight = toFloat(computedStyle.lineHeight, 1);
|
|
180
|
+
// Calculate height of border and padding
|
|
181
|
+
const border = toFloat(computedStyle.borderTopWidth, 0) + toFloat(computedStyle.borderBottomWidth, 0);
|
|
182
|
+
const padding = toFloat(computedStyle.paddingTop, 0) + toFloat(computedStyle.paddingBottom, 0);
|
|
183
|
+
// Calculate offset
|
|
184
|
+
const offset = border + padding;
|
|
185
|
+
// Minimum height for min rows (which must be 2 rows or greater for cross-browser support)
|
|
186
|
+
const minHeight = lineHeight * this.computedMinRows + offset;
|
|
187
|
+
|
|
188
|
+
// Get the current style height (with `px` units)
|
|
189
|
+
const oldHeight = getStyle(el, 'height') || computedStyle.height;
|
|
190
|
+
// Probe scrollHeight by temporarily changing the height to `auto`
|
|
191
|
+
setStyle(el, 'height', 'auto');
|
|
192
|
+
const scrollHeight = el.scrollHeight;
|
|
193
|
+
// Place the original old height back on the element, just in case `computedProp`
|
|
194
|
+
// returns the same value as before
|
|
195
|
+
setStyle(el, 'height', oldHeight);
|
|
196
|
+
|
|
197
|
+
// Calculate content height in 'rows' (scrollHeight includes padding but not border)
|
|
198
|
+
const contentRows = mathMax((scrollHeight - padding) / lineHeight, 2);
|
|
199
|
+
// Calculate number of rows to display (limited within min/max rows)
|
|
200
|
+
const rows = mathMin(mathMax(contentRows, this.computedMinRows), this.computedMaxRows);
|
|
201
|
+
// Calculate the required height of the textarea including border and padding (in pixels)
|
|
202
|
+
const height = mathMax(mathCeil(rows * lineHeight + offset), minHeight);
|
|
203
|
+
|
|
204
|
+
// Computed height remains the larger of `oldHeight` and new `height`,
|
|
205
|
+
// when height is in `sticky` mode (prop `no-auto-shrink` is true)
|
|
206
|
+
if (this.noAutoShrink && toFloat(oldHeight, 0) > height) {
|
|
207
|
+
return oldHeight;
|
|
208
|
+
}
|
|
209
|
+
|
|
210
|
+
// Return the new computed CSS height in px units
|
|
211
|
+
return `${height}px`;
|
|
212
|
+
}
|
|
213
|
+
},
|
|
214
|
+
render(h) {
|
|
215
|
+
return h('textarea', {
|
|
216
|
+
class: this.computedClass,
|
|
217
|
+
style: this.computedStyle,
|
|
218
|
+
directives: [{
|
|
219
|
+
name: 'b-visible',
|
|
220
|
+
value: this.visibleCallback,
|
|
221
|
+
// If textarea is within 640px of viewport, consider it visible
|
|
222
|
+
modifiers: {
|
|
223
|
+
'640': true
|
|
224
|
+
}
|
|
225
|
+
}],
|
|
226
|
+
attrs: this.computedAttrs,
|
|
227
|
+
domProps: {
|
|
228
|
+
value: this.localValue
|
|
229
|
+
},
|
|
230
|
+
on: this.computedListeners,
|
|
231
|
+
ref: 'input'
|
|
232
|
+
});
|
|
233
|
+
}
|
|
234
|
+
});
|
|
235
|
+
|
|
236
|
+
export { BFormTextarea, props };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { BFormTextarea } from './form-textarea';
|
|
@@ -0,0 +1,155 @@
|
|
|
1
|
+
import { mergeData } from '../../vue';
|
|
2
|
+
import { NAME_COL } from '../../constants/components';
|
|
3
|
+
import { PROP_TYPE_BOOLEAN_NUMBER_STRING, PROP_TYPE_NUMBER_STRING, PROP_TYPE_STRING, PROP_TYPE_BOOLEAN } from '../../constants/props';
|
|
4
|
+
import { RX_COL_CLASS } from '../../constants/regex';
|
|
5
|
+
import { getBreakpointsUpCached } from '../../utils/config';
|
|
6
|
+
import { identity } from '../../utils/identity';
|
|
7
|
+
import { isUndefinedOrNull } from '../../utils/inspect';
|
|
8
|
+
import { memoize } from '../../utils/memoize';
|
|
9
|
+
import { create, assign, keys, sortKeys } from '../../utils/object';
|
|
10
|
+
import { makeProp, suffixPropName } from '../../utils/props';
|
|
11
|
+
import { lowerCase } from '../../utils/string';
|
|
12
|
+
|
|
13
|
+
// --- Constants ---
|
|
14
|
+
|
|
15
|
+
const ALIGN_SELF_VALUES = ['auto', 'start', 'end', 'center', 'baseline', 'stretch'];
|
|
16
|
+
|
|
17
|
+
// --- Helper methods ---
|
|
18
|
+
|
|
19
|
+
// Compute a breakpoint class name
|
|
20
|
+
const computeBreakpoint = (type, breakpoint, value) => {
|
|
21
|
+
let className = type;
|
|
22
|
+
if (isUndefinedOrNull(value) || value === false) {
|
|
23
|
+
return undefined;
|
|
24
|
+
}
|
|
25
|
+
if (breakpoint) {
|
|
26
|
+
className += `-${breakpoint}`;
|
|
27
|
+
}
|
|
28
|
+
// Handling the boolean style prop when accepting `[Boolean, String, Number]`
|
|
29
|
+
// means Vue will not convert `<b-col sm></b-col>` to `sm: true` for us
|
|
30
|
+
// Since the default is `false`, '' indicates the prop's presence
|
|
31
|
+
if (type === 'col' && (value === '' || value === true)) {
|
|
32
|
+
// .col-md
|
|
33
|
+
return lowerCase(className);
|
|
34
|
+
}
|
|
35
|
+
// .order-md-6
|
|
36
|
+
className += `-${value}`;
|
|
37
|
+
return lowerCase(className);
|
|
38
|
+
};
|
|
39
|
+
|
|
40
|
+
// Memoized function for better performance on generating class names
|
|
41
|
+
const computeBreakpointClass = memoize(computeBreakpoint);
|
|
42
|
+
|
|
43
|
+
// Cached copy of the breakpoint prop names
|
|
44
|
+
let breakpointPropMap = create(null);
|
|
45
|
+
|
|
46
|
+
// --- Props ---
|
|
47
|
+
|
|
48
|
+
// Prop generator for lazy generation of props
|
|
49
|
+
const generateProps = () => {
|
|
50
|
+
// Grab the breakpoints from the cached config (exclude the '' (xs) breakpoint)
|
|
51
|
+
const breakpoints = getBreakpointsUpCached().filter(identity);
|
|
52
|
+
|
|
53
|
+
// i.e. 'col-sm', 'col-md-6', 'col-lg-auto', ...
|
|
54
|
+
const breakpointCol = breakpoints.reduce((props, breakpoint) => {
|
|
55
|
+
props[breakpoint] = makeProp(PROP_TYPE_BOOLEAN_NUMBER_STRING);
|
|
56
|
+
return props;
|
|
57
|
+
}, create(null));
|
|
58
|
+
|
|
59
|
+
// i.e. 'offset-md-1', 'offset-lg-12', ...
|
|
60
|
+
const breakpointOffset = breakpoints.reduce((props, breakpoint) => {
|
|
61
|
+
props[suffixPropName(breakpoint, 'offset')] = makeProp(PROP_TYPE_NUMBER_STRING);
|
|
62
|
+
return props;
|
|
63
|
+
}, create(null));
|
|
64
|
+
|
|
65
|
+
// i.e. 'order-md-1', 'order-lg-12', ...
|
|
66
|
+
const breakpointOrder = breakpoints.reduce((props, breakpoint) => {
|
|
67
|
+
props[suffixPropName(breakpoint, 'order')] = makeProp(PROP_TYPE_NUMBER_STRING);
|
|
68
|
+
return props;
|
|
69
|
+
}, create(null));
|
|
70
|
+
|
|
71
|
+
// For loop doesn't need to check `.hasOwnProperty()`
|
|
72
|
+
// when using an object created from `null`
|
|
73
|
+
breakpointPropMap = assign(create(null), {
|
|
74
|
+
col: keys(breakpointCol),
|
|
75
|
+
offset: keys(breakpointOffset),
|
|
76
|
+
order: keys(breakpointOrder)
|
|
77
|
+
});
|
|
78
|
+
|
|
79
|
+
// Return the generated props
|
|
80
|
+
return sortKeys({
|
|
81
|
+
...breakpointCol,
|
|
82
|
+
...breakpointOffset,
|
|
83
|
+
...breakpointOrder,
|
|
84
|
+
// Flex alignment
|
|
85
|
+
alignSelf: makeProp(PROP_TYPE_STRING, null, value => {
|
|
86
|
+
return ALIGN_SELF_VALUES.includes(value);
|
|
87
|
+
}),
|
|
88
|
+
// Generic flexbox 'col' (xs)
|
|
89
|
+
col: makeProp(PROP_TYPE_BOOLEAN, false),
|
|
90
|
+
// i.e. 'col-1', 'col-2', 'col-auto', ...
|
|
91
|
+
cols: makeProp(PROP_TYPE_NUMBER_STRING),
|
|
92
|
+
offset: makeProp(PROP_TYPE_NUMBER_STRING),
|
|
93
|
+
order: makeProp(PROP_TYPE_NUMBER_STRING),
|
|
94
|
+
tag: makeProp(PROP_TYPE_STRING, 'div')
|
|
95
|
+
});
|
|
96
|
+
};
|
|
97
|
+
|
|
98
|
+
// --- Main component ---
|
|
99
|
+
|
|
100
|
+
// We do not use extend here as that would evaluate the props
|
|
101
|
+
// immediately, which we do not want to happen
|
|
102
|
+
// @vue/component
|
|
103
|
+
const BCol = {
|
|
104
|
+
name: NAME_COL,
|
|
105
|
+
functional: true,
|
|
106
|
+
get props() {
|
|
107
|
+
// Allow props to be lazy evaled on first access and
|
|
108
|
+
// then they become a non-getter afterwards.
|
|
109
|
+
// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Functions/get#Smart_self-overwriting_lazy_getters
|
|
110
|
+
delete this.props;
|
|
111
|
+
// eslint-disable-next-line no-return-assign
|
|
112
|
+
return this.props = generateProps();
|
|
113
|
+
},
|
|
114
|
+
render(h, _ref) {
|
|
115
|
+
let {
|
|
116
|
+
props,
|
|
117
|
+
data,
|
|
118
|
+
children
|
|
119
|
+
} = _ref;
|
|
120
|
+
const {
|
|
121
|
+
cols,
|
|
122
|
+
offset,
|
|
123
|
+
order,
|
|
124
|
+
alignSelf
|
|
125
|
+
} = props;
|
|
126
|
+
const classList = [];
|
|
127
|
+
// Loop through `col`, `offset`, `order` breakpoint props
|
|
128
|
+
for (const type in breakpointPropMap) {
|
|
129
|
+
// Returns colSm, offset, offsetSm, orderMd, etc.
|
|
130
|
+
const keys = breakpointPropMap[type];
|
|
131
|
+
for (let i = 0; i < keys.length; i++) {
|
|
132
|
+
// computeBreakpoint(col, colSm => Sm, value=[String, Number, Boolean])
|
|
133
|
+
const c = computeBreakpointClass(type, keys[i].replace(type, ''), props[keys[i]]);
|
|
134
|
+
// If a class is returned, push it onto the array.
|
|
135
|
+
if (c) {
|
|
136
|
+
classList.push(c);
|
|
137
|
+
}
|
|
138
|
+
}
|
|
139
|
+
}
|
|
140
|
+
const hasColClasses = classList.some(className => RX_COL_CLASS.test(className));
|
|
141
|
+
classList.push({
|
|
142
|
+
// Default to .col if no other col-{bp}-* classes generated nor `cols` specified.
|
|
143
|
+
col: props.col || !hasColClasses && !cols,
|
|
144
|
+
[`col-${cols}`]: cols,
|
|
145
|
+
[`offset-${offset}`]: offset,
|
|
146
|
+
[`order-${order}`]: order,
|
|
147
|
+
[`align-self-${alignSelf}`]: alignSelf
|
|
148
|
+
});
|
|
149
|
+
return h(props.tag, mergeData(data, {
|
|
150
|
+
class: classList
|
|
151
|
+
}), children);
|
|
152
|
+
}
|
|
153
|
+
};
|
|
154
|
+
|
|
155
|
+
export { BCol, generateProps };
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { extend, mergeData } from '../../vue';
|
|
2
|
+
import { NAME_FORM_ROW } from '../../constants/components';
|
|
3
|
+
import { PROP_TYPE_STRING } from '../../constants/props';
|
|
4
|
+
|
|
5
|
+
// --- Props ---
|
|
6
|
+
|
|
7
|
+
const props = {
|
|
8
|
+
tag: {
|
|
9
|
+
type: PROP_TYPE_STRING,
|
|
10
|
+
required: false,
|
|
11
|
+
default: 'div'
|
|
12
|
+
}
|
|
13
|
+
};
|
|
14
|
+
|
|
15
|
+
// --- Main component ---
|
|
16
|
+
|
|
17
|
+
// @vue/component
|
|
18
|
+
const BFormRow = /*#__PURE__*/extend({
|
|
19
|
+
name: NAME_FORM_ROW,
|
|
20
|
+
functional: true,
|
|
21
|
+
props,
|
|
22
|
+
render(h, _ref) {
|
|
23
|
+
let {
|
|
24
|
+
props,
|
|
25
|
+
data,
|
|
26
|
+
children
|
|
27
|
+
} = _ref;
|
|
28
|
+
return h(props.tag, mergeData(data, {
|
|
29
|
+
staticClass: 'form-row'
|
|
30
|
+
}), children);
|
|
31
|
+
}
|
|
32
|
+
});
|
|
33
|
+
|
|
34
|
+
export { BFormRow, props };
|