@gitlab/ui 131.3.0 → 131.3.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +4 -4
- package/src/components/utilities/truncate/truncate.scss +3 -1
- package/src/scss/mixins.scss +3 -1
- package/src/vendor/bootstrap-vue/src/components/tooltip/tooltip.js +86 -25
- package/tailwind.defaults.js +10 -1
- package/dist/charts.js +0 -13
- package/dist/components/base/accordion/accordion.js +0 -69
- package/dist/components/base/accordion/accordion_item.js +0 -160
- package/dist/components/base/accordion/constants.js +0 -3
- package/dist/components/base/alert/alert.js +0 -263
- package/dist/components/base/animated_icon/animated_chevron_down_up_icon.js +0 -45
- package/dist/components/base/animated_icon/animated_chevron_lg_down_up_icon.js +0 -45
- package/dist/components/base/animated_icon/animated_chevron_lg_right_down_icon.js +0 -45
- package/dist/components/base/animated_icon/animated_chevron_right_down_icon.js +0 -45
- package/dist/components/base/animated_icon/animated_duo_chat_icon.js +0 -45
- package/dist/components/base/animated_icon/animated_loader_icon.js +0 -45
- package/dist/components/base/animated_icon/animated_notifications_icon.js +0 -45
- package/dist/components/base/animated_icon/animated_sidebar_icon.js +0 -45
- package/dist/components/base/animated_icon/animated_smile_icon.js +0 -45
- package/dist/components/base/animated_icon/animated_sort_icon.js +0 -45
- package/dist/components/base/animated_icon/animated_star_icon.js +0 -45
- package/dist/components/base/animated_icon/animated_todo_icon.js +0 -45
- package/dist/components/base/animated_icon/animated_upload_icon.js +0 -45
- package/dist/components/base/animated_icon/base_animated_icon.js +0 -77
- package/dist/components/base/attribute_list/attribute_list.js +0 -100
- package/dist/components/base/avatar/avatar.js +0 -175
- package/dist/components/base/avatar/utils.js +0 -17
- package/dist/components/base/avatar_labeled/avatar_labeled.js +0 -198
- package/dist/components/base/avatar_link/avatar_link.js +0 -47
- package/dist/components/base/avatars_inline/avatars_inline.js +0 -139
- package/dist/components/base/badge/badge.js +0 -197
- package/dist/components/base/banner/banner.js +0 -149
- package/dist/components/base/breadcrumb/breadcrumb.js +0 -282
- package/dist/components/base/breadcrumb/breadcrumb_item.js +0 -96
- package/dist/components/base/broadcast_message/broadcast_message.js +0 -113
- package/dist/components/base/broadcast_message/constants.js +0 -5
- package/dist/components/base/button/button.js +0 -419
- package/dist/components/base/button_group/button_group.js +0 -53
- package/dist/components/base/card/card.js +0 -69
- package/dist/components/base/collapse/collapse.js +0 -163
- package/dist/components/base/color_mode_toggle/color_mode_toggle.js +0 -92
- package/dist/components/base/datepicker/datepicker.js +0 -475
- package/dist/components/base/daterange_picker/daterange_picker.js +0 -394
- package/dist/components/base/drawer/drawer.js +0 -156
- package/dist/components/base/dropdown/dropdown.js +0 -330
- package/dist/components/base/dropdown/dropdown_divider.js +0 -48
- package/dist/components/base/dropdown/dropdown_form.js +0 -48
- package/dist/components/base/dropdown/dropdown_item.js +0 -175
- package/dist/components/base/dropdown/dropdown_section_header.js +0 -48
- package/dist/components/base/dropdown/dropdown_text.js +0 -48
- package/dist/components/base/filtered_search/common_story_options.js +0 -14
- package/dist/components/base/filtered_search/filtered_search.js +0 -428
- package/dist/components/base/filtered_search/filtered_search_suggestion.js +0 -95
- package/dist/components/base/filtered_search/filtered_search_suggestion_list.js +0 -139
- package/dist/components/base/filtered_search/filtered_search_term.js +0 -217
- package/dist/components/base/filtered_search/filtered_search_token.js +0 -383
- package/dist/components/base/filtered_search/filtered_search_token_segment.js +0 -444
- package/dist/components/base/filtered_search/filtered_search_utils.js +0 -241
- package/dist/components/base/form/form.js +0 -43
- package/dist/components/base/form/form_character_count/form_character_count.js +0 -107
- package/dist/components/base/form/form_checkbox/form_checkbox.js +0 -342
- package/dist/components/base/form/form_checkbox/form_checkbox_group.js +0 -186
- package/dist/components/base/form/form_combobox/constants.js +0 -55
- package/dist/components/base/form/form_combobox/form_combobox.js +0 -239
- package/dist/components/base/form/form_date/form_date.js +0 -143
- package/dist/components/base/form/form_fields/form_field_validator.js +0 -93
- package/dist/components/base/form/form_fields/form_fields.js +0 -289
- package/dist/components/base/form/form_fields/form_fields_loop.js +0 -75
- package/dist/components/base/form/form_fields/mappers.js +0 -13
- package/dist/components/base/form/form_fields/validators.js +0 -48
- package/dist/components/base/form/form_group/form_group.js +0 -119
- package/dist/components/base/form/form_input/form_input.js +0 -695
- package/dist/components/base/form/form_input_group/form_input_group.js +0 -120
- package/dist/components/base/form/form_input_group/form_input_group_mixin.js +0 -41
- package/dist/components/base/form/form_radio/form_radio.js +0 -259
- package/dist/components/base/form/form_radio_group/form_radio_group.js +0 -187
- package/dist/components/base/form/form_select/constants.js +0 -12
- package/dist/components/base/form/form_select/form_select.js +0 -96
- package/dist/components/base/form/form_textarea/form_textarea.js +0 -166
- package/dist/components/base/form/input_group_text/input_group_text.js +0 -43
- package/dist/components/base/icon/icon.js +0 -113
- package/dist/components/base/illustration/illustration.js +0 -80
- package/dist/components/base/infinite_scroll/infinite_scroll.js +0 -196
- package/dist/components/base/keyset_pagination/keyset_pagination.js +0 -152
- package/dist/components/base/label/label.js +0 -174
- package/dist/components/base/link/link.js +0 -332
- package/dist/components/base/loading_icon/loading_icon.js +0 -120
- package/dist/components/base/markdown/markdown.js +0 -50
- package/dist/components/base/modal/modal.js +0 -259
- package/dist/components/base/new_dropdowns/base_dropdown/base_dropdown.js +0 -716
- package/dist/components/base/new_dropdowns/base_dropdown/constants.js +0 -5
- package/dist/components/base/new_dropdowns/base_dropdown/dropdown_container.js +0 -32
- package/dist/components/base/new_dropdowns/constants.js +0 -24
- package/dist/components/base/new_dropdowns/disclosure/constants.js +0 -8
- package/dist/components/base/new_dropdowns/disclosure/disclosure_dropdown.js +0 -400
- package/dist/components/base/new_dropdowns/disclosure/disclosure_dropdown_group.js +0 -112
- package/dist/components/base/new_dropdowns/disclosure/disclosure_dropdown_item.js +0 -196
- package/dist/components/base/new_dropdowns/disclosure/mock_data.js +0 -168
- package/dist/components/base/new_dropdowns/disclosure/utils.js +0 -84
- package/dist/components/base/new_dropdowns/listbox/listbox.js +0 -997
- package/dist/components/base/new_dropdowns/listbox/listbox_group.js +0 -58
- package/dist/components/base/new_dropdowns/listbox/listbox_item.js +0 -112
- package/dist/components/base/new_dropdowns/listbox/listbox_search_input.js +0 -94
- package/dist/components/base/new_dropdowns/listbox/mock_data.js +0 -131
- package/dist/components/base/new_dropdowns/listbox/utils.js +0 -33
- package/dist/components/base/pagination/pagination.js +0 -397
- package/dist/components/base/path/data.js +0 -34
- package/dist/components/base/path/path.js +0 -177
- package/dist/components/base/popover/popover.js +0 -142
- package/dist/components/base/progress_bar/progress_bar.js +0 -117
- package/dist/components/base/search_box_by_click/search_box_by_click.js +0 -245
- package/dist/components/base/search_box_by_type/search_box_by_type.js +0 -187
- package/dist/components/base/segmented_control/segmented_control.js +0 -73
- package/dist/components/base/skeleton_loader/skeleton_loader.js +0 -232
- package/dist/components/base/sorting/sorting.js +0 -180
- package/dist/components/base/table/constants.js +0 -5
- package/dist/components/base/table/table.js +0 -187
- package/dist/components/base/table_lite/table_lite.js +0 -80
- package/dist/components/base/tabs/constants.js +0 -3
- package/dist/components/base/tabs/tab/tab.js +0 -113
- package/dist/components/base/tabs/tabs/scrollable_tabs.js +0 -162
- package/dist/components/base/tabs/tabs/tabs.js +0 -223
- package/dist/components/base/toast/index.js +0 -66
- package/dist/components/base/toast/toast.js +0 -125
- package/dist/components/base/toast/toaster.js +0 -87
- package/dist/components/base/toggle/toggle.js +0 -178
- package/dist/components/base/token/token.js +0 -97
- package/dist/components/base/token_selector/helpers.js +0 -5
- package/dist/components/base/token_selector/token_container.js +0 -160
- package/dist/components/base/token_selector/token_selector.js +0 -454
- package/dist/components/base/token_selector/token_selector_dropdown.js +0 -223
- package/dist/components/base/tooltip/tooltip.js +0 -54
- package/dist/components/charts/area/area.js +0 -329
- package/dist/components/charts/bar/bar.js +0 -207
- package/dist/components/charts/chart/chart.js +0 -215
- package/dist/components/charts/column/column.js +0 -221
- package/dist/components/charts/discrete_scatter/discrete_scatter.js +0 -199
- package/dist/components/charts/gauge/gauge.js +0 -205
- package/dist/components/charts/heatmap/heatmap.js +0 -299
- package/dist/components/charts/heatmap/index.js +0 -2
- package/dist/components/charts/legend/legend.js +0 -245
- package/dist/components/charts/line/line.js +0 -340
- package/dist/components/charts/series_label/series_label.js +0 -101
- package/dist/components/charts/shared/tooltip/tooltip.js +0 -369
- package/dist/components/charts/shared/tooltip/tooltip_default_format/tooltip_default_format.js +0 -53
- package/dist/components/charts/single_stat/single_stat.js +0 -164
- package/dist/components/charts/sparkline/sparkline.js +0 -299
- package/dist/components/charts/stacked_column/stacked_column.js +0 -380
- package/dist/components/dashboards/dashboard_layout/dashboard_layout.js +0 -125
- package/dist/components/dashboards/dashboard_layout/grid_layout/grid_layout.js +0 -326
- package/dist/components/dashboards/dashboard_layout/validators.js +0 -14
- package/dist/components/dashboards/dashboard_panel/dashboard_panel.js +0 -236
- package/dist/components/dashboards/mock_data.js +0 -49
- package/dist/components/experimental/experiment_badge/constants.js +0 -4
- package/dist/components/experimental/experiment_badge/experiment_badge.js +0 -102
- package/dist/components/extended/multi_step_form_template/multi_step_form_template.js +0 -87
- package/dist/components/index.js +0 -107
- package/dist/components/mixins/button_mixin.js +0 -11
- package/dist/components/mixins/safe_link_mixin.js +0 -30
- package/dist/components/mixins/tooltip_mixin.js +0 -21
- package/dist/components/regions/dashboard_skeleton/dashboard_skeleton.js +0 -53
- package/dist/components/regions/empty_state/empty_state.js +0 -181
- package/dist/components/shared_components/clear_icon_button/clear_icon_button.js +0 -64
- package/dist/components/shared_components/clipboard_button/clipboard_button.js +0 -100
- package/dist/components/shared_components/close_button/close_button.js +0 -55
- package/dist/components/utilities/animated_number/animated_number.js +0 -131
- package/dist/components/utilities/friendly_wrap/friendly_wrap.js +0 -75
- package/dist/components/utilities/intersection_observer/intersection_observer.js +0 -88
- package/dist/components/utilities/intersperse/intersperse.js +0 -104
- package/dist/components/utilities/sprintf/sprintf.js +0 -171
- package/dist/components/utilities/truncate/constants.js +0 -8
- package/dist/components/utilities/truncate/truncate.js +0 -154
- package/dist/components/utilities/truncate_text/constants.js +0 -7
- package/dist/components/utilities/truncate_text/truncate_text.js +0 -146
- package/dist/config.js +0 -53
- package/dist/directives/hover_load/hover_load.js +0 -45
- package/dist/directives/index.js +0 -8
- package/dist/directives/modal.js +0 -1
- package/dist/directives/outside/outside.js +0 -149
- package/dist/directives/resize_observer/resize_observer.js +0 -58
- package/dist/directives/safe_html/constants.js +0 -6
- package/dist/directives/safe_html/safe_html.js +0 -39
- package/dist/directives/safe_link/mock_data.js +0 -10
- package/dist/directives/safe_link/safe_link.js +0 -67
- package/dist/directives/tooltip/container.js +0 -7
- package/dist/directives/tooltip/tooltip.js +0 -18
- package/dist/index.css +0 -7
- package/dist/index.css.map +0 -1
- package/dist/index.js +0 -2
- package/dist/tailwind.css +0 -2
- package/dist/tailwind.css.map +0 -1
- package/dist/tokens/build/js/tokens.dark.js +0 -1410
- package/dist/tokens/build/js/tokens.js +0 -1410
- package/dist/tokens/common_story_options.js +0 -29
- package/dist/tokens/tokens_story.js +0 -76
- package/dist/utils/breakpoints.js +0 -20
- package/dist/utils/charts/config.js +0 -616
- package/dist/utils/charts/constants.js +0 -69
- package/dist/utils/charts/mock_data.js +0 -191
- package/dist/utils/charts/story_config.js +0 -24
- package/dist/utils/charts/theme.js +0 -200
- package/dist/utils/charts/utils.js +0 -54
- package/dist/utils/constants.js +0 -333
- package/dist/utils/data_utils.js +0 -19
- package/dist/utils/datetime_utility.js +0 -61
- package/dist/utils/equality_utils.js +0 -84
- package/dist/utils/i18n.js +0 -65
- package/dist/utils/is_slot_empty.js +0 -34
- package/dist/utils/number_utils.js +0 -132
- package/dist/utils/play_utils.js +0 -11
- package/dist/utils/set_utils.js +0 -25
- package/dist/utils/stories_constants.js +0 -29
- package/dist/utils/stories_utils.js +0 -62
- package/dist/utils/story_decorators/container.js +0 -19
- package/dist/utils/string_utils.js +0 -69
- package/dist/utils/svgs/svg_paths.js +0 -7
- package/dist/utils/test_utils.js +0 -33
- package/dist/utils/use_fake_date.js +0 -29
- package/dist/utils/use_mock_intersection_observer.js +0 -105
- package/dist/utils/utils.js +0 -205
- package/dist/utils.js +0 -5
- package/dist/vendor/bootstrap-vue/src/bv-config.js +0 -8
- package/dist/vendor/bootstrap-vue/src/components/button/button-close.js +0 -81
- package/dist/vendor/bootstrap-vue/src/components/button/button.js +0 -204
- package/dist/vendor/bootstrap-vue/src/components/button/index.js +0 -2
- package/dist/vendor/bootstrap-vue/src/components/dropdown/dropdown-divider.js +0 -41
- package/dist/vendor/bootstrap-vue/src/components/dropdown/dropdown-form.js +0 -52
- package/dist/vendor/bootstrap-vue/src/components/dropdown/dropdown-group.js +0 -75
- package/dist/vendor/bootstrap-vue/src/components/dropdown/dropdown-header.js +0 -52
- package/dist/vendor/bootstrap-vue/src/components/dropdown/dropdown-item-button.js +0 -85
- package/dist/vendor/bootstrap-vue/src/components/dropdown/dropdown-item.js +0 -97
- package/dist/vendor/bootstrap-vue/src/components/dropdown/dropdown-text.js +0 -60
- package/dist/vendor/bootstrap-vue/src/components/dropdown/dropdown.js +0 -271
- package/dist/vendor/bootstrap-vue/src/components/dropdown/index.js +0 -8
- package/dist/vendor/bootstrap-vue/src/components/form/form-invalid-feedback.js +0 -53
- package/dist/vendor/bootstrap-vue/src/components/form/form-text.js +0 -55
- package/dist/vendor/bootstrap-vue/src/components/form/form-valid-feedback.js +0 -53
- package/dist/vendor/bootstrap-vue/src/components/form/form.js +0 -56
- package/dist/vendor/bootstrap-vue/src/components/form/index.js +0 -4
- package/dist/vendor/bootstrap-vue/src/components/form-group/form-group.js +0 -348
- package/dist/vendor/bootstrap-vue/src/components/form-group/index.js +0 -1
- package/dist/vendor/bootstrap-vue/src/components/form-select/form-select-option-group.js +0 -54
- package/dist/vendor/bootstrap-vue/src/components/form-select/form-select-option.js +0 -41
- package/dist/vendor/bootstrap-vue/src/components/form-select/form-select.js +0 -143
- package/dist/vendor/bootstrap-vue/src/components/form-select/helpers/mixin-options.js +0 -56
- package/dist/vendor/bootstrap-vue/src/components/form-select/index.js +0 -3
- package/dist/vendor/bootstrap-vue/src/components/form-textarea/form-textarea.js +0 -217
- package/dist/vendor/bootstrap-vue/src/components/form-textarea/index.js +0 -1
- package/dist/vendor/bootstrap-vue/src/components/layout/col.js +0 -156
- package/dist/vendor/bootstrap-vue/src/components/layout/form-row.js +0 -34
- package/dist/vendor/bootstrap-vue/src/components/layout/index.js +0 -2
- package/dist/vendor/bootstrap-vue/src/components/link/index.js +0 -1
- package/dist/vendor/bootstrap-vue/src/components/link/link.js +0 -283
- package/dist/vendor/bootstrap-vue/src/components/modal/helpers/bv-modal-event.class.js +0 -21
- package/dist/vendor/bootstrap-vue/src/components/modal/helpers/modal-manager.js +0 -212
- package/dist/vendor/bootstrap-vue/src/components/modal/index.js +0 -1
- package/dist/vendor/bootstrap-vue/src/components/modal/modal.js +0 -887
- package/dist/vendor/bootstrap-vue/src/components/popover/helpers/bv-popover-template.js +0 -55
- package/dist/vendor/bootstrap-vue/src/components/popover/helpers/bv-popover.js +0 -31
- package/dist/vendor/bootstrap-vue/src/components/popover/index.js +0 -1
- package/dist/vendor/bootstrap-vue/src/components/popover/popover.js +0 -49
- package/dist/vendor/bootstrap-vue/src/components/table/helpers/constants.js +0 -22
- package/dist/vendor/bootstrap-vue/src/components/table/helpers/default-sort-compare.js +0 -64
- package/dist/vendor/bootstrap-vue/src/components/table/helpers/filter-event.js +0 -40
- package/dist/vendor/bootstrap-vue/src/components/table/helpers/mixin-bottom-row.js +0 -43
- package/dist/vendor/bootstrap-vue/src/components/table/helpers/mixin-busy.js +0 -83
- package/dist/vendor/bootstrap-vue/src/components/table/helpers/mixin-caption.js +0 -50
- package/dist/vendor/bootstrap-vue/src/components/table/helpers/mixin-colgroup.js +0 -32
- package/dist/vendor/bootstrap-vue/src/components/table/helpers/mixin-empty.js +0 -82
- package/dist/vendor/bootstrap-vue/src/components/table/helpers/mixin-filtering.js +0 -274
- package/dist/vendor/bootstrap-vue/src/components/table/helpers/mixin-items.js +0 -154
- package/dist/vendor/bootstrap-vue/src/components/table/helpers/mixin-pagination.js +0 -44
- package/dist/vendor/bootstrap-vue/src/components/table/helpers/mixin-provider.js +0 -191
- package/dist/vendor/bootstrap-vue/src/components/table/helpers/mixin-selectable.js +0 -213
- package/dist/vendor/bootstrap-vue/src/components/table/helpers/mixin-sorting.js +0 -275
- package/dist/vendor/bootstrap-vue/src/components/table/helpers/mixin-stacked.js +0 -39
- package/dist/vendor/bootstrap-vue/src/components/table/helpers/mixin-table-renderer.js +0 -186
- package/dist/vendor/bootstrap-vue/src/components/table/helpers/mixin-tbody-row.js +0 -338
- package/dist/vendor/bootstrap-vue/src/components/table/helpers/mixin-tbody.js +0 -243
- package/dist/vendor/bootstrap-vue/src/components/table/helpers/mixin-tfoot.js +0 -50
- package/dist/vendor/bootstrap-vue/src/components/table/helpers/mixin-thead.js +0 -218
- package/dist/vendor/bootstrap-vue/src/components/table/helpers/mixin-top-row.js +0 -42
- package/dist/vendor/bootstrap-vue/src/components/table/helpers/normalize-fields.js +0 -86
- package/dist/vendor/bootstrap-vue/src/components/table/helpers/sanitize-row.js +0 -32
- package/dist/vendor/bootstrap-vue/src/components/table/helpers/stringify-record-values.js +0 -11
- package/dist/vendor/bootstrap-vue/src/components/table/helpers/text-selection-active.js +0 -14
- package/dist/vendor/bootstrap-vue/src/components/table/index.js +0 -9
- package/dist/vendor/bootstrap-vue/src/components/table/table-lite.js +0 -51
- package/dist/vendor/bootstrap-vue/src/components/table/table-simple.js +0 -44
- package/dist/vendor/bootstrap-vue/src/components/table/table.js +0 -67
- package/dist/vendor/bootstrap-vue/src/components/table/tbody.js +0 -116
- package/dist/vendor/bootstrap-vue/src/components/table/td.js +0 -204
- package/dist/vendor/bootstrap-vue/src/components/table/tfoot.js +0 -96
- package/dist/vendor/bootstrap-vue/src/components/table/th.js +0 -26
- package/dist/vendor/bootstrap-vue/src/components/table/thead.js +0 -99
- package/dist/vendor/bootstrap-vue/src/components/table/tr.js +0 -121
- package/dist/vendor/bootstrap-vue/src/components/tabs/index.js +0 -2
- package/dist/vendor/bootstrap-vue/src/components/tabs/tab.js +0 -238
- package/dist/vendor/bootstrap-vue/src/components/tabs/tabs.js +0 -601
- package/dist/vendor/bootstrap-vue/src/components/tooltip/helpers/bv-popper.js +0 -251
- package/dist/vendor/bootstrap-vue/src/components/tooltip/helpers/bv-tooltip-template.js +0 -118
- package/dist/vendor/bootstrap-vue/src/components/tooltip/helpers/bv-tooltip.js +0 -932
- package/dist/vendor/bootstrap-vue/src/components/tooltip/index.js +0 -1
- package/dist/vendor/bootstrap-vue/src/components/tooltip/tooltip.js +0 -269
- package/dist/vendor/bootstrap-vue/src/components/transition/bv-transition.js +0 -103
- package/dist/vendor/bootstrap-vue/src/components/transporter/transporter.js +0 -205
- package/dist/vendor/bootstrap-vue/src/constants/components.js +0 -55
- package/dist/vendor/bootstrap-vue/src/constants/config.js +0 -11
- package/dist/vendor/bootstrap-vue/src/constants/env.js +0 -36
- package/dist/vendor/bootstrap-vue/src/constants/events.js +0 -56
- package/dist/vendor/bootstrap-vue/src/constants/key-codes.js +0 -11
- package/dist/vendor/bootstrap-vue/src/constants/popper.js +0 -10
- package/dist/vendor/bootstrap-vue/src/constants/props.js +0 -24
- package/dist/vendor/bootstrap-vue/src/constants/regex.js +0 -35
- package/dist/vendor/bootstrap-vue/src/constants/safe-types.js +0 -15
- package/dist/vendor/bootstrap-vue/src/constants/slots.js +0 -36
- package/dist/vendor/bootstrap-vue/src/directives/modal/index.js +0 -1
- package/dist/vendor/bootstrap-vue/src/directives/modal/modal.js +0 -112
- package/dist/vendor/bootstrap-vue/src/directives/tooltip/index.js +0 -1
- package/dist/vendor/bootstrap-vue/src/directives/tooltip/tooltip.js +0 -265
- package/dist/vendor/bootstrap-vue/src/directives/visible/index.js +0 -1
- package/dist/vendor/bootstrap-vue/src/directives/visible/visible.js +0 -187
- package/dist/vendor/bootstrap-vue/src/mixins/attrs.js +0 -5
- package/dist/vendor/bootstrap-vue/src/mixins/click-out.js +0 -54
- package/dist/vendor/bootstrap-vue/src/mixins/dropdown.js +0 -470
- package/dist/vendor/bootstrap-vue/src/mixins/focus-in.js +0 -46
- package/dist/vendor/bootstrap-vue/src/mixins/form-control.js +0 -73
- package/dist/vendor/bootstrap-vue/src/mixins/form-custom.js +0 -26
- package/dist/vendor/bootstrap-vue/src/mixins/form-options.js +0 -91
- package/dist/vendor/bootstrap-vue/src/mixins/form-selection.js +0 -62
- package/dist/vendor/bootstrap-vue/src/mixins/form-size.js +0 -26
- package/dist/vendor/bootstrap-vue/src/mixins/form-state.js +0 -50
- package/dist/vendor/bootstrap-vue/src/mixins/form-text.js +0 -293
- package/dist/vendor/bootstrap-vue/src/mixins/form-validity.js +0 -50
- package/dist/vendor/bootstrap-vue/src/mixins/has-listener.js +0 -29
- package/dist/vendor/bootstrap-vue/src/mixins/id.js +0 -57
- package/dist/vendor/bootstrap-vue/src/mixins/listen-on-document.js +0 -63
- package/dist/vendor/bootstrap-vue/src/mixins/listen-on-root.js +0 -121
- package/dist/vendor/bootstrap-vue/src/mixins/listen-on-window.js +0 -63
- package/dist/vendor/bootstrap-vue/src/mixins/listeners.js +0 -25
- package/dist/vendor/bootstrap-vue/src/mixins/model.js +0 -10
- package/dist/vendor/bootstrap-vue/src/mixins/normalize-slot.js +0 -30
- package/dist/vendor/bootstrap-vue/src/mixins/scoped-style.js +0 -18
- package/dist/vendor/bootstrap-vue/src/mixins/use-parent.js +0 -14
- package/dist/vendor/bootstrap-vue/src/utils/array.js +0 -28
- package/dist/vendor/bootstrap-vue/src/utils/bv-event.class.js +0 -60
- package/dist/vendor/bootstrap-vue/src/utils/cache.js +0 -60
- package/dist/vendor/bootstrap-vue/src/utils/clone-deep.js +0 -18
- package/dist/vendor/bootstrap-vue/src/utils/config-set.js +0 -86
- package/dist/vendor/bootstrap-vue/src/utils/config.js +0 -71
- package/dist/vendor/bootstrap-vue/src/utils/create-new-child-component.js +0 -133
- package/dist/vendor/bootstrap-vue/src/utils/css-escape.js +0 -70
- package/dist/vendor/bootstrap-vue/src/utils/dom.js +0 -298
- package/dist/vendor/bootstrap-vue/src/utils/element-to-vue-instance-registry.js +0 -28
- package/dist/vendor/bootstrap-vue/src/utils/env.js +0 -16
- package/dist/vendor/bootstrap-vue/src/utils/events.js +0 -78
- package/dist/vendor/bootstrap-vue/src/utils/get-event-root.js +0 -5
- package/dist/vendor/bootstrap-vue/src/utils/get-instance-from-directive.js +0 -3
- package/dist/vendor/bootstrap-vue/src/utils/get-scope-id.js +0 -9
- package/dist/vendor/bootstrap-vue/src/utils/get.js +0 -63
- package/dist/vendor/bootstrap-vue/src/utils/html.js +0 -16
- package/dist/vendor/bootstrap-vue/src/utils/identity.js +0 -3
- package/dist/vendor/bootstrap-vue/src/utils/inspect.js +0 -35
- package/dist/vendor/bootstrap-vue/src/utils/locale.js +0 -19
- package/dist/vendor/bootstrap-vue/src/utils/loose-equal.js +0 -59
- package/dist/vendor/bootstrap-vue/src/utils/loose-index-of.js +0 -13
- package/dist/vendor/bootstrap-vue/src/utils/math.js +0 -9
- package/dist/vendor/bootstrap-vue/src/utils/memoize.js +0 -14
- package/dist/vendor/bootstrap-vue/src/utils/model.js +0 -33
- package/dist/vendor/bootstrap-vue/src/utils/noop.js +0 -3
- package/dist/vendor/bootstrap-vue/src/utils/normalize-slot.js +0 -51
- package/dist/vendor/bootstrap-vue/src/utils/number.js +0 -23
- package/dist/vendor/bootstrap-vue/src/utils/object.js +0 -72
- package/dist/vendor/bootstrap-vue/src/utils/observe-dom.js +0 -76
- package/dist/vendor/bootstrap-vue/src/utils/on-instance-destroy.js +0 -22
- package/dist/vendor/bootstrap-vue/src/utils/plugins.js +0 -124
- package/dist/vendor/bootstrap-vue/src/utils/props.js +0 -67
- package/dist/vendor/bootstrap-vue/src/utils/router.js +0 -150
- package/dist/vendor/bootstrap-vue/src/utils/safe-vue-instance.js +0 -14
- package/dist/vendor/bootstrap-vue/src/utils/stable-sort.js +0 -28
- package/dist/vendor/bootstrap-vue/src/utils/string.js +0 -47
- package/dist/vendor/bootstrap-vue/src/utils/stringify-object-values.js +0 -31
- package/dist/vendor/bootstrap-vue/src/utils/warn.js +0 -45
- package/dist/vendor/bootstrap-vue/src/vue.js +0 -55
|
@@ -1,143 +0,0 @@
|
|
|
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_STRING, PROP_TYPE_BOOLEAN, 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 { makeProp } from '../../utils/props';
|
|
12
|
-
import { props as props$3, formControlMixin } from '../../mixins/form-control';
|
|
13
|
-
import { props as props$4, formCustomMixin } from '../../mixins/form-custom';
|
|
14
|
-
import { props as props$5, formSizeMixin } from '../../mixins/form-size';
|
|
15
|
-
import { props as props$6, formStateMixin } from '../../mixins/form-state';
|
|
16
|
-
import { props as props$1, idMixin } from '../../mixins/id';
|
|
17
|
-
import { props as props$2, modelMixin, MODEL_PROP_NAME, MODEL_EVENT_NAME } from '../../mixins/model';
|
|
18
|
-
import { normalizeSlotMixin } from '../../mixins/normalize-slot';
|
|
19
|
-
import { optionsMixin } from './helpers/mixin-options';
|
|
20
|
-
import { BFormSelectOption } from './form-select-option';
|
|
21
|
-
import { BFormSelectOptionGroup } from './form-select-option-group';
|
|
22
|
-
|
|
23
|
-
// --- Props ---
|
|
24
|
-
|
|
25
|
-
const props = sortKeys({
|
|
26
|
-
...props$1,
|
|
27
|
-
...props$2,
|
|
28
|
-
...props$3,
|
|
29
|
-
...props$4,
|
|
30
|
-
...props$5,
|
|
31
|
-
...props$6,
|
|
32
|
-
ariaInvalid: makeProp(PROP_TYPE_BOOLEAN_STRING, false),
|
|
33
|
-
multiple: makeProp(PROP_TYPE_BOOLEAN, false),
|
|
34
|
-
// Browsers default size to `0`, which shows 4 rows in most browsers in multiple mode
|
|
35
|
-
// Size of `1` can bork out Firefox
|
|
36
|
-
selectSize: makeProp(PROP_TYPE_NUMBER, 0)
|
|
37
|
-
});
|
|
38
|
-
|
|
39
|
-
// --- Main component ---
|
|
40
|
-
|
|
41
|
-
// @vue/component
|
|
42
|
-
const BFormSelect = /*#__PURE__*/extend({
|
|
43
|
-
name: NAME_FORM_SELECT,
|
|
44
|
-
mixins: [idMixin, modelMixin, formControlMixin, formSizeMixin, formStateMixin, formCustomMixin, optionsMixin, normalizeSlotMixin],
|
|
45
|
-
props,
|
|
46
|
-
data() {
|
|
47
|
-
return {
|
|
48
|
-
localValue: this[MODEL_PROP_NAME]
|
|
49
|
-
};
|
|
50
|
-
},
|
|
51
|
-
computed: {
|
|
52
|
-
computedSelectSize() {
|
|
53
|
-
// Custom selects with a size of zero causes the arrows to be hidden,
|
|
54
|
-
// so dont render the size attribute in this case
|
|
55
|
-
return !this.plain && this.selectSize === 0 ? null : this.selectSize;
|
|
56
|
-
},
|
|
57
|
-
inputClass() {
|
|
58
|
-
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];
|
|
59
|
-
}
|
|
60
|
-
},
|
|
61
|
-
watch: {
|
|
62
|
-
value(newValue) {
|
|
63
|
-
this.localValue = newValue;
|
|
64
|
-
},
|
|
65
|
-
localValue() {
|
|
66
|
-
this.$emit(MODEL_EVENT_NAME, this.localValue);
|
|
67
|
-
}
|
|
68
|
-
},
|
|
69
|
-
methods: {
|
|
70
|
-
focus() {
|
|
71
|
-
attemptFocus(this.$refs.input);
|
|
72
|
-
},
|
|
73
|
-
blur() {
|
|
74
|
-
attemptBlur(this.$refs.input);
|
|
75
|
-
},
|
|
76
|
-
onChange(event) {
|
|
77
|
-
const {
|
|
78
|
-
target
|
|
79
|
-
} = event;
|
|
80
|
-
const selectedValue = from(target.options).filter(o => o.selected).map(o => '_value' in o ? o._value : o.value);
|
|
81
|
-
this.localValue = target.multiple ? selectedValue : selectedValue[0];
|
|
82
|
-
this.$nextTick(() => {
|
|
83
|
-
this.$emit(EVENT_NAME_CHANGE, this.localValue);
|
|
84
|
-
});
|
|
85
|
-
}
|
|
86
|
-
},
|
|
87
|
-
render(h) {
|
|
88
|
-
const {
|
|
89
|
-
name,
|
|
90
|
-
disabled,
|
|
91
|
-
required,
|
|
92
|
-
computedSelectSize: size,
|
|
93
|
-
localValue: value
|
|
94
|
-
} = this;
|
|
95
|
-
const $options = this.formOptions.map((option, index) => {
|
|
96
|
-
const {
|
|
97
|
-
value,
|
|
98
|
-
label,
|
|
99
|
-
options,
|
|
100
|
-
disabled
|
|
101
|
-
} = option;
|
|
102
|
-
const key = `option_${index}`;
|
|
103
|
-
return isArray(options) ? h(BFormSelectOptionGroup, {
|
|
104
|
-
props: {
|
|
105
|
-
label,
|
|
106
|
-
options
|
|
107
|
-
},
|
|
108
|
-
key
|
|
109
|
-
}) : h(BFormSelectOption, {
|
|
110
|
-
props: {
|
|
111
|
-
value,
|
|
112
|
-
disabled
|
|
113
|
-
},
|
|
114
|
-
domProps: htmlOrText(option.html, option.text),
|
|
115
|
-
key
|
|
116
|
-
});
|
|
117
|
-
});
|
|
118
|
-
return h('select', {
|
|
119
|
-
class: this.inputClass,
|
|
120
|
-
attrs: {
|
|
121
|
-
id: this.safeId(),
|
|
122
|
-
name,
|
|
123
|
-
form: this.form || null,
|
|
124
|
-
multiple: this.multiple || null,
|
|
125
|
-
size,
|
|
126
|
-
disabled,
|
|
127
|
-
required,
|
|
128
|
-
'aria-required': required ? 'true' : null,
|
|
129
|
-
'aria-invalid': this.computedAriaInvalid
|
|
130
|
-
},
|
|
131
|
-
on: {
|
|
132
|
-
change: this.onChange
|
|
133
|
-
},
|
|
134
|
-
directives: [{
|
|
135
|
-
name: 'model',
|
|
136
|
-
value
|
|
137
|
-
}],
|
|
138
|
-
ref: 'input'
|
|
139
|
-
}, [this.normalizeSlot(SLOT_NAME_FIRST), $options, this.normalizeSlot()]);
|
|
140
|
-
}
|
|
141
|
-
});
|
|
142
|
-
|
|
143
|
-
export { BFormSelect, props };
|
|
@@ -1,56 +0,0 @@
|
|
|
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 { makeProp } from '../../../utils/props';
|
|
7
|
-
import { props as props$1, formOptionsMixin } from '../../../mixins/form-options';
|
|
8
|
-
|
|
9
|
-
// --- Props ---
|
|
10
|
-
|
|
11
|
-
const props = sortKeys({
|
|
12
|
-
...props$1,
|
|
13
|
-
labelField: makeProp(PROP_TYPE_STRING, 'label'),
|
|
14
|
-
optionsField: makeProp(PROP_TYPE_STRING, 'options')
|
|
15
|
-
});
|
|
16
|
-
|
|
17
|
-
// --- Mixin ---
|
|
18
|
-
|
|
19
|
-
// @vue/component
|
|
20
|
-
const optionsMixin = extend({
|
|
21
|
-
mixins: [formOptionsMixin],
|
|
22
|
-
props,
|
|
23
|
-
methods: {
|
|
24
|
-
normalizeOption(option) {
|
|
25
|
-
let key = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null;
|
|
26
|
-
// When the option is an object, normalize it
|
|
27
|
-
if (isPlainObject(option)) {
|
|
28
|
-
const value = get(option, this.valueField);
|
|
29
|
-
const text = get(option, this.textField);
|
|
30
|
-
const options = get(option, this.optionsField, null);
|
|
31
|
-
// When it has options, create an `<optgroup>` object
|
|
32
|
-
if (!isNull(options)) {
|
|
33
|
-
return {
|
|
34
|
-
label: String(get(option, this.labelField) || text),
|
|
35
|
-
options: this.normalizeOptions(options)
|
|
36
|
-
};
|
|
37
|
-
}
|
|
38
|
-
// Otherwise create an `<option>` object
|
|
39
|
-
return {
|
|
40
|
-
value: isUndefined(value) ? key || text : value,
|
|
41
|
-
text: String(isUndefined(text) ? key : text),
|
|
42
|
-
html: get(option, this.htmlField),
|
|
43
|
-
disabled: Boolean(get(option, this.disabledField))
|
|
44
|
-
};
|
|
45
|
-
}
|
|
46
|
-
// Otherwise create an `<option>` object from the given value
|
|
47
|
-
return {
|
|
48
|
-
value: key || option,
|
|
49
|
-
text: String(option),
|
|
50
|
-
disabled: false
|
|
51
|
-
};
|
|
52
|
-
}
|
|
53
|
-
}
|
|
54
|
-
});
|
|
55
|
-
|
|
56
|
-
export { optionsMixin, props };
|
|
@@ -1,217 +0,0 @@
|
|
|
1
|
-
import { extend } from '../../vue';
|
|
2
|
-
import { NAME_FORM_TEXTAREA } from '../../constants/components';
|
|
3
|
-
import { PROP_TYPE_NUMBER_STRING, PROP_TYPE_BOOLEAN, PROP_TYPE_STRING } 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 { makeProp } from '../../utils/props';
|
|
10
|
-
import { props as props$2, formControlMixin } from '../../mixins/form-control';
|
|
11
|
-
import { formSelectionMixin } from '../../mixins/form-selection';
|
|
12
|
-
import { props as props$3, formSizeMixin } from '../../mixins/form-size';
|
|
13
|
-
import { props as props$4, formStateMixin } from '../../mixins/form-state';
|
|
14
|
-
import { props as props$5, formTextMixin } from '../../mixins/form-text';
|
|
15
|
-
import { formValidityMixin } from '../../mixins/form-validity';
|
|
16
|
-
import { props as props$1, idMixin } from '../../mixins/id';
|
|
17
|
-
import { listenOnRootMixin } from '../../mixins/listen-on-root';
|
|
18
|
-
import { listenersMixin } from '../../mixins/listeners';
|
|
19
|
-
import { VBVisible } from '../../directives/visible/visible';
|
|
20
|
-
|
|
21
|
-
// --- Props ---
|
|
22
|
-
|
|
23
|
-
const props = sortKeys({
|
|
24
|
-
...props$1,
|
|
25
|
-
...props$2,
|
|
26
|
-
...props$3,
|
|
27
|
-
...props$4,
|
|
28
|
-
...props$5,
|
|
29
|
-
maxRows: makeProp(PROP_TYPE_NUMBER_STRING),
|
|
30
|
-
// When in auto resize mode, disable shrinking to content height
|
|
31
|
-
noAutoShrink: makeProp(PROP_TYPE_BOOLEAN, false),
|
|
32
|
-
// Disable the resize handle of textarea
|
|
33
|
-
noResize: makeProp(PROP_TYPE_BOOLEAN, false),
|
|
34
|
-
rows: makeProp(PROP_TYPE_NUMBER_STRING, 2),
|
|
35
|
-
// 'soft', 'hard' or 'off'
|
|
36
|
-
// Browser default is 'soft'
|
|
37
|
-
wrap: makeProp(PROP_TYPE_STRING, 'soft')
|
|
38
|
-
});
|
|
39
|
-
|
|
40
|
-
// --- Main component ---
|
|
41
|
-
|
|
42
|
-
// @vue/component
|
|
43
|
-
const BFormTextarea = /*#__PURE__*/extend({
|
|
44
|
-
name: NAME_FORM_TEXTAREA,
|
|
45
|
-
directives: {
|
|
46
|
-
'b-visible': VBVisible
|
|
47
|
-
},
|
|
48
|
-
// Mixin order is important!
|
|
49
|
-
mixins: [listenersMixin, idMixin, listenOnRootMixin, formControlMixin, formSizeMixin, formStateMixin, formTextMixin, formSelectionMixin, formValidityMixin],
|
|
50
|
-
props,
|
|
51
|
-
data() {
|
|
52
|
-
return {
|
|
53
|
-
heightInPx: null
|
|
54
|
-
};
|
|
55
|
-
},
|
|
56
|
-
computed: {
|
|
57
|
-
type() {
|
|
58
|
-
return null;
|
|
59
|
-
},
|
|
60
|
-
computedStyle() {
|
|
61
|
-
const styles = {
|
|
62
|
-
// Setting `noResize` to true will disable the ability for the user to
|
|
63
|
-
// manually resize the textarea. We also disable when in auto height mode
|
|
64
|
-
resize: !this.computedRows || this.noResize ? 'none' : null
|
|
65
|
-
};
|
|
66
|
-
if (!this.computedRows) {
|
|
67
|
-
// Conditionally set the computed CSS height when auto rows/height is enabled
|
|
68
|
-
// We avoid setting the style to `null`, which can override user manual resize handle
|
|
69
|
-
styles.height = this.heightInPx;
|
|
70
|
-
// We always add a vertical scrollbar to the textarea when auto-height is
|
|
71
|
-
// enabled so that the computed height calculation returns a stable value
|
|
72
|
-
styles.overflowY = 'scroll';
|
|
73
|
-
}
|
|
74
|
-
return styles;
|
|
75
|
-
},
|
|
76
|
-
computedMinRows() {
|
|
77
|
-
// Ensure rows is at least 2 and positive (2 is the native textarea value)
|
|
78
|
-
// A value of 1 can cause issues in some browsers, and most browsers
|
|
79
|
-
// only support 2 as the smallest value
|
|
80
|
-
return mathMax(toInteger(this.rows, 2), 2);
|
|
81
|
-
},
|
|
82
|
-
computedMaxRows() {
|
|
83
|
-
return mathMax(this.computedMinRows, toInteger(this.maxRows, 0));
|
|
84
|
-
},
|
|
85
|
-
computedRows() {
|
|
86
|
-
// This is used to set the attribute 'rows' on the textarea
|
|
87
|
-
// If auto-height is enabled, then we return `null` as we use CSS to control height
|
|
88
|
-
return this.computedMinRows === this.computedMaxRows ? this.computedMinRows : null;
|
|
89
|
-
},
|
|
90
|
-
computedAttrs() {
|
|
91
|
-
const {
|
|
92
|
-
disabled,
|
|
93
|
-
required
|
|
94
|
-
} = this;
|
|
95
|
-
return {
|
|
96
|
-
id: this.safeId(),
|
|
97
|
-
name: this.name || null,
|
|
98
|
-
form: this.form || null,
|
|
99
|
-
disabled,
|
|
100
|
-
placeholder: this.placeholder || null,
|
|
101
|
-
required,
|
|
102
|
-
autocomplete: this.autocomplete || null,
|
|
103
|
-
readonly: this.readonly || this.plaintext,
|
|
104
|
-
rows: this.computedRows,
|
|
105
|
-
wrap: this.wrap || null,
|
|
106
|
-
'aria-required': this.required ? 'true' : null,
|
|
107
|
-
'aria-invalid': this.computedAriaInvalid
|
|
108
|
-
};
|
|
109
|
-
},
|
|
110
|
-
computedListeners() {
|
|
111
|
-
return {
|
|
112
|
-
...this.bvListeners,
|
|
113
|
-
input: this.onInput,
|
|
114
|
-
change: this.onChange,
|
|
115
|
-
blur: this.onBlur
|
|
116
|
-
};
|
|
117
|
-
}
|
|
118
|
-
},
|
|
119
|
-
watch: {
|
|
120
|
-
localValue() {
|
|
121
|
-
this.setHeight();
|
|
122
|
-
}
|
|
123
|
-
},
|
|
124
|
-
mounted() {
|
|
125
|
-
this.setHeight();
|
|
126
|
-
},
|
|
127
|
-
methods: {
|
|
128
|
-
// Called by intersection observer directive
|
|
129
|
-
/* istanbul ignore next */
|
|
130
|
-
visibleCallback(visible) {
|
|
131
|
-
if (visible) {
|
|
132
|
-
// We use a `$nextTick()` here just to make sure any
|
|
133
|
-
// transitions or portalling have completed
|
|
134
|
-
this.$nextTick(this.setHeight);
|
|
135
|
-
}
|
|
136
|
-
},
|
|
137
|
-
setHeight() {
|
|
138
|
-
this.$nextTick(() => {
|
|
139
|
-
requestAF(() => {
|
|
140
|
-
this.heightInPx = this.computeHeight();
|
|
141
|
-
});
|
|
142
|
-
});
|
|
143
|
-
},
|
|
144
|
-
/* istanbul ignore next: can't test getComputedStyle in JSDOM */
|
|
145
|
-
computeHeight() {
|
|
146
|
-
if (this.$isServer || !isNull(this.computedRows)) {
|
|
147
|
-
return null;
|
|
148
|
-
}
|
|
149
|
-
const el = this.$el;
|
|
150
|
-
|
|
151
|
-
// Element must be visible (not hidden) and in document
|
|
152
|
-
// Must be checked after above checks
|
|
153
|
-
if (!isVisible(el)) {
|
|
154
|
-
return null;
|
|
155
|
-
}
|
|
156
|
-
|
|
157
|
-
// Get current computed styles
|
|
158
|
-
const computedStyle = getCS(el);
|
|
159
|
-
// Height of one line of text in px
|
|
160
|
-
const lineHeight = toFloat(computedStyle.lineHeight, 1);
|
|
161
|
-
// Calculate height of border and padding
|
|
162
|
-
const border = toFloat(computedStyle.borderTopWidth, 0) + toFloat(computedStyle.borderBottomWidth, 0);
|
|
163
|
-
const padding = toFloat(computedStyle.paddingTop, 0) + toFloat(computedStyle.paddingBottom, 0);
|
|
164
|
-
// Calculate offset
|
|
165
|
-
const offset = border + padding;
|
|
166
|
-
// Minimum height for min rows (which must be 2 rows or greater for cross-browser support)
|
|
167
|
-
const minHeight = lineHeight * this.computedMinRows + offset;
|
|
168
|
-
|
|
169
|
-
// Get the current style height (with `px` units)
|
|
170
|
-
const oldHeight = getStyle(el, 'height') || computedStyle.height;
|
|
171
|
-
// Probe scrollHeight by temporarily changing the height to `auto`
|
|
172
|
-
setStyle(el, 'height', 'auto');
|
|
173
|
-
const scrollHeight = el.scrollHeight;
|
|
174
|
-
// Place the original old height back on the element, just in case `computedProp`
|
|
175
|
-
// returns the same value as before
|
|
176
|
-
setStyle(el, 'height', oldHeight);
|
|
177
|
-
|
|
178
|
-
// Calculate content height in 'rows' (scrollHeight includes padding but not border)
|
|
179
|
-
const contentRows = mathMax((scrollHeight - padding) / lineHeight, 2);
|
|
180
|
-
// Calculate number of rows to display (limited within min/max rows)
|
|
181
|
-
const rows = mathMin(mathMax(contentRows, this.computedMinRows), this.computedMaxRows);
|
|
182
|
-
// Calculate the required height of the textarea including border and padding (in pixels)
|
|
183
|
-
const height = mathMax(mathCeil(rows * lineHeight + offset), minHeight);
|
|
184
|
-
|
|
185
|
-
// Computed height remains the larger of `oldHeight` and new `height`,
|
|
186
|
-
// when height is in `sticky` mode (prop `no-auto-shrink` is true)
|
|
187
|
-
if (this.noAutoShrink && toFloat(oldHeight, 0) > height) {
|
|
188
|
-
return oldHeight;
|
|
189
|
-
}
|
|
190
|
-
|
|
191
|
-
// Return the new computed CSS height in px units
|
|
192
|
-
return `${height}px`;
|
|
193
|
-
}
|
|
194
|
-
},
|
|
195
|
-
render(h) {
|
|
196
|
-
return h('textarea', {
|
|
197
|
-
class: this.computedClass,
|
|
198
|
-
style: this.computedStyle,
|
|
199
|
-
directives: [{
|
|
200
|
-
name: 'b-visible',
|
|
201
|
-
value: this.visibleCallback,
|
|
202
|
-
// If textarea is within 640px of viewport, consider it visible
|
|
203
|
-
modifiers: {
|
|
204
|
-
'640': true
|
|
205
|
-
}
|
|
206
|
-
}],
|
|
207
|
-
attrs: this.computedAttrs,
|
|
208
|
-
domProps: {
|
|
209
|
-
value: this.localValue
|
|
210
|
-
},
|
|
211
|
-
on: this.computedListeners,
|
|
212
|
-
ref: 'input'
|
|
213
|
-
});
|
|
214
|
-
}
|
|
215
|
-
});
|
|
216
|
-
|
|
217
|
-
export { BFormTextarea, props };
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { BFormTextarea } from './form-textarea';
|
|
@@ -1,156 +0,0 @@
|
|
|
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 { arrayIncludes } from '../../utils/array';
|
|
6
|
-
import { getBreakpointsUpCached } from '../../utils/config';
|
|
7
|
-
import { identity } from '../../utils/identity';
|
|
8
|
-
import { isUndefinedOrNull } from '../../utils/inspect';
|
|
9
|
-
import { memoize } from '../../utils/memoize';
|
|
10
|
-
import { create, assign, keys, sortKeys } from '../../utils/object';
|
|
11
|
-
import { makeProp, suffixPropName } from '../../utils/props';
|
|
12
|
-
import { lowerCase } from '../../utils/string';
|
|
13
|
-
|
|
14
|
-
// --- Constants ---
|
|
15
|
-
|
|
16
|
-
const ALIGN_SELF_VALUES = ['auto', 'start', 'end', 'center', 'baseline', 'stretch'];
|
|
17
|
-
|
|
18
|
-
// --- Helper methods ---
|
|
19
|
-
|
|
20
|
-
// Compute a breakpoint class name
|
|
21
|
-
const computeBreakpoint = (type, breakpoint, value) => {
|
|
22
|
-
let className = type;
|
|
23
|
-
if (isUndefinedOrNull(value) || value === false) {
|
|
24
|
-
return undefined;
|
|
25
|
-
}
|
|
26
|
-
if (breakpoint) {
|
|
27
|
-
className += `-${breakpoint}`;
|
|
28
|
-
}
|
|
29
|
-
// Handling the boolean style prop when accepting `[Boolean, String, Number]`
|
|
30
|
-
// means Vue will not convert `<b-col sm></b-col>` to `sm: true` for us
|
|
31
|
-
// Since the default is `false`, '' indicates the prop's presence
|
|
32
|
-
if (type === 'col' && (value === '' || value === true)) {
|
|
33
|
-
// .col-md
|
|
34
|
-
return lowerCase(className);
|
|
35
|
-
}
|
|
36
|
-
// .order-md-6
|
|
37
|
-
className += `-${value}`;
|
|
38
|
-
return lowerCase(className);
|
|
39
|
-
};
|
|
40
|
-
|
|
41
|
-
// Memoized function for better performance on generating class names
|
|
42
|
-
const computeBreakpointClass = memoize(computeBreakpoint);
|
|
43
|
-
|
|
44
|
-
// Cached copy of the breakpoint prop names
|
|
45
|
-
let breakpointPropMap = create(null);
|
|
46
|
-
|
|
47
|
-
// --- Props ---
|
|
48
|
-
|
|
49
|
-
// Prop generator for lazy generation of props
|
|
50
|
-
const generateProps = () => {
|
|
51
|
-
// Grab the breakpoints from the cached config (exclude the '' (xs) breakpoint)
|
|
52
|
-
const breakpoints = getBreakpointsUpCached().filter(identity);
|
|
53
|
-
|
|
54
|
-
// i.e. 'col-sm', 'col-md-6', 'col-lg-auto', ...
|
|
55
|
-
const breakpointCol = breakpoints.reduce((props, breakpoint) => {
|
|
56
|
-
props[breakpoint] = makeProp(PROP_TYPE_BOOLEAN_NUMBER_STRING);
|
|
57
|
-
return props;
|
|
58
|
-
}, create(null));
|
|
59
|
-
|
|
60
|
-
// i.e. 'offset-md-1', 'offset-lg-12', ...
|
|
61
|
-
const breakpointOffset = breakpoints.reduce((props, breakpoint) => {
|
|
62
|
-
props[suffixPropName(breakpoint, 'offset')] = makeProp(PROP_TYPE_NUMBER_STRING);
|
|
63
|
-
return props;
|
|
64
|
-
}, create(null));
|
|
65
|
-
|
|
66
|
-
// i.e. 'order-md-1', 'order-lg-12', ...
|
|
67
|
-
const breakpointOrder = breakpoints.reduce((props, breakpoint) => {
|
|
68
|
-
props[suffixPropName(breakpoint, 'order')] = makeProp(PROP_TYPE_NUMBER_STRING);
|
|
69
|
-
return props;
|
|
70
|
-
}, create(null));
|
|
71
|
-
|
|
72
|
-
// For loop doesn't need to check `.hasOwnProperty()`
|
|
73
|
-
// when using an object created from `null`
|
|
74
|
-
breakpointPropMap = assign(create(null), {
|
|
75
|
-
col: keys(breakpointCol),
|
|
76
|
-
offset: keys(breakpointOffset),
|
|
77
|
-
order: keys(breakpointOrder)
|
|
78
|
-
});
|
|
79
|
-
|
|
80
|
-
// Return the generated props
|
|
81
|
-
return sortKeys({
|
|
82
|
-
...breakpointCol,
|
|
83
|
-
...breakpointOffset,
|
|
84
|
-
...breakpointOrder,
|
|
85
|
-
// Flex alignment
|
|
86
|
-
alignSelf: makeProp(PROP_TYPE_STRING, null, value => {
|
|
87
|
-
return arrayIncludes(ALIGN_SELF_VALUES, value);
|
|
88
|
-
}),
|
|
89
|
-
// Generic flexbox 'col' (xs)
|
|
90
|
-
col: makeProp(PROP_TYPE_BOOLEAN, false),
|
|
91
|
-
// i.e. 'col-1', 'col-2', 'col-auto', ...
|
|
92
|
-
cols: makeProp(PROP_TYPE_NUMBER_STRING),
|
|
93
|
-
offset: makeProp(PROP_TYPE_NUMBER_STRING),
|
|
94
|
-
order: makeProp(PROP_TYPE_NUMBER_STRING),
|
|
95
|
-
tag: makeProp(PROP_TYPE_STRING, 'div')
|
|
96
|
-
});
|
|
97
|
-
};
|
|
98
|
-
|
|
99
|
-
// --- Main component ---
|
|
100
|
-
|
|
101
|
-
// We do not use extend here as that would evaluate the props
|
|
102
|
-
// immediately, which we do not want to happen
|
|
103
|
-
// @vue/component
|
|
104
|
-
const BCol = {
|
|
105
|
-
name: NAME_COL,
|
|
106
|
-
functional: true,
|
|
107
|
-
get props() {
|
|
108
|
-
// Allow props to be lazy evaled on first access and
|
|
109
|
-
// then they become a non-getter afterwards.
|
|
110
|
-
// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Functions/get#Smart_self-overwriting_lazy_getters
|
|
111
|
-
delete this.props;
|
|
112
|
-
// eslint-disable-next-line no-return-assign
|
|
113
|
-
return this.props = generateProps();
|
|
114
|
-
},
|
|
115
|
-
render(h, _ref) {
|
|
116
|
-
let {
|
|
117
|
-
props,
|
|
118
|
-
data,
|
|
119
|
-
children
|
|
120
|
-
} = _ref;
|
|
121
|
-
const {
|
|
122
|
-
cols,
|
|
123
|
-
offset,
|
|
124
|
-
order,
|
|
125
|
-
alignSelf
|
|
126
|
-
} = props;
|
|
127
|
-
const classList = [];
|
|
128
|
-
// Loop through `col`, `offset`, `order` breakpoint props
|
|
129
|
-
for (const type in breakpointPropMap) {
|
|
130
|
-
// Returns colSm, offset, offsetSm, orderMd, etc.
|
|
131
|
-
const keys = breakpointPropMap[type];
|
|
132
|
-
for (let i = 0; i < keys.length; i++) {
|
|
133
|
-
// computeBreakpoint(col, colSm => Sm, value=[String, Number, Boolean])
|
|
134
|
-
const c = computeBreakpointClass(type, keys[i].replace(type, ''), props[keys[i]]);
|
|
135
|
-
// If a class is returned, push it onto the array.
|
|
136
|
-
if (c) {
|
|
137
|
-
classList.push(c);
|
|
138
|
-
}
|
|
139
|
-
}
|
|
140
|
-
}
|
|
141
|
-
const hasColClasses = classList.some(className => RX_COL_CLASS.test(className));
|
|
142
|
-
classList.push({
|
|
143
|
-
// Default to .col if no other col-{bp}-* classes generated nor `cols` specified.
|
|
144
|
-
col: props.col || !hasColClasses && !cols,
|
|
145
|
-
[`col-${cols}`]: cols,
|
|
146
|
-
[`offset-${offset}`]: offset,
|
|
147
|
-
[`order-${order}`]: order,
|
|
148
|
-
[`align-self-${alignSelf}`]: alignSelf
|
|
149
|
-
});
|
|
150
|
-
return h(props.tag, mergeData(data, {
|
|
151
|
-
class: classList
|
|
152
|
-
}), children);
|
|
153
|
-
}
|
|
154
|
-
};
|
|
155
|
-
|
|
156
|
-
export { BCol, generateProps };
|
|
@@ -1,34 +0,0 @@
|
|
|
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 };
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { BLink } from './link';
|