@gitlab/ui 132.0.1 → 132.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/charts.js +13 -0
- package/dist/components/base/accordion/accordion.js +69 -0
- package/dist/components/base/accordion/accordion_item.js +160 -0
- package/dist/components/base/accordion/constants.js +3 -0
- package/dist/components/base/alert/alert.js +263 -0
- package/dist/components/base/animated_icon/animated_chevron_down_up_icon.js +45 -0
- package/dist/components/base/animated_icon/animated_chevron_lg_down_up_icon.js +45 -0
- package/dist/components/base/animated_icon/animated_chevron_lg_right_down_icon.js +45 -0
- package/dist/components/base/animated_icon/animated_chevron_right_down_icon.js +45 -0
- package/dist/components/base/animated_icon/animated_duo_chat_icon.js +45 -0
- package/dist/components/base/animated_icon/animated_loader_icon.js +45 -0
- package/dist/components/base/animated_icon/animated_notifications_icon.js +45 -0
- package/dist/components/base/animated_icon/animated_sidebar_icon.js +45 -0
- package/dist/components/base/animated_icon/animated_smile_icon.js +45 -0
- package/dist/components/base/animated_icon/animated_sort_icon.js +45 -0
- package/dist/components/base/animated_icon/animated_star_icon.js +45 -0
- package/dist/components/base/animated_icon/animated_todo_icon.js +45 -0
- package/dist/components/base/animated_icon/animated_upload_icon.js +45 -0
- package/dist/components/base/animated_icon/base_animated_icon.js +77 -0
- package/dist/components/base/attribute_list/attribute_list.js +100 -0
- package/dist/components/base/avatar/avatar.js +175 -0
- package/dist/components/base/avatar/utils.js +17 -0
- package/dist/components/base/avatar_labeled/avatar_labeled.js +198 -0
- package/dist/components/base/avatar_link/avatar_link.js +47 -0
- package/dist/components/base/avatars_inline/avatars_inline.js +139 -0
- package/dist/components/base/badge/badge.js +197 -0
- package/dist/components/base/banner/banner.js +149 -0
- package/dist/components/base/breadcrumb/breadcrumb.js +282 -0
- package/dist/components/base/breadcrumb/breadcrumb_item.js +96 -0
- package/dist/components/base/broadcast_message/broadcast_message.js +113 -0
- package/dist/components/base/broadcast_message/constants.js +5 -0
- package/dist/components/base/button/button.js +419 -0
- package/dist/components/base/button_group/button_group.js +53 -0
- package/dist/components/base/card/card.js +69 -0
- package/dist/components/base/collapse/collapse.js +163 -0
- package/dist/components/base/color_mode_toggle/color_mode_toggle.js +92 -0
- package/dist/components/base/datepicker/datepicker.js +475 -0
- package/dist/components/base/daterange_picker/daterange_picker.js +394 -0
- package/dist/components/base/drawer/drawer.js +156 -0
- package/dist/components/base/dropdown/dropdown.js +330 -0
- package/dist/components/base/dropdown/dropdown_divider.js +48 -0
- package/dist/components/base/dropdown/dropdown_form.js +48 -0
- package/dist/components/base/dropdown/dropdown_item.js +175 -0
- package/dist/components/base/dropdown/dropdown_section_header.js +48 -0
- package/dist/components/base/dropdown/dropdown_text.js +48 -0
- package/dist/components/base/filtered_search/common_story_options.js +14 -0
- package/dist/components/base/filtered_search/filtered_search.js +428 -0
- package/dist/components/base/filtered_search/filtered_search_suggestion.js +95 -0
- package/dist/components/base/filtered_search/filtered_search_suggestion_list.js +139 -0
- package/dist/components/base/filtered_search/filtered_search_term.js +217 -0
- package/dist/components/base/filtered_search/filtered_search_token.js +383 -0
- package/dist/components/base/filtered_search/filtered_search_token_segment.js +444 -0
- package/dist/components/base/filtered_search/filtered_search_utils.js +241 -0
- package/dist/components/base/form/form.js +43 -0
- package/dist/components/base/form/form_character_count/form_character_count.js +107 -0
- package/dist/components/base/form/form_checkbox/form_checkbox.js +342 -0
- package/dist/components/base/form/form_checkbox/form_checkbox_group.js +188 -0
- package/dist/components/base/form/form_combobox/constants.js +55 -0
- package/dist/components/base/form/form_combobox/form_combobox.js +239 -0
- package/dist/components/base/form/form_date/form_date.js +143 -0
- package/dist/components/base/form/form_fields/form_field_validator.js +93 -0
- package/dist/components/base/form/form_fields/form_fields.js +289 -0
- package/dist/components/base/form/form_fields/form_fields_loop.js +75 -0
- package/dist/components/base/form/form_fields/mappers.js +13 -0
- package/dist/components/base/form/form_fields/validators.js +48 -0
- package/dist/components/base/form/form_group/form_group.js +119 -0
- package/dist/components/base/form/form_input/form_input.js +695 -0
- package/dist/components/base/form/form_input_group/form_input_group.js +120 -0
- package/dist/components/base/form/form_input_group/form_input_group_mixin.js +41 -0
- package/dist/components/base/form/form_radio/form_radio.js +259 -0
- package/dist/components/base/form/form_radio_group/form_radio_group.js +189 -0
- package/dist/components/base/form/form_select/constants.js +12 -0
- package/dist/components/base/form/form_select/form_select.js +96 -0
- package/dist/components/base/form/form_textarea/form_textarea.js +166 -0
- package/dist/components/base/form/input_group_text/input_group_text.js +43 -0
- package/dist/components/base/icon/icon.js +113 -0
- package/dist/components/base/illustration/illustration.js +80 -0
- package/dist/components/base/infinite_scroll/infinite_scroll.js +196 -0
- package/dist/components/base/keyset_pagination/keyset_pagination.js +152 -0
- package/dist/components/base/label/label.js +174 -0
- package/dist/components/base/link/link.js +330 -0
- package/dist/components/base/loading_icon/loading_icon.js +120 -0
- package/dist/components/base/markdown/markdown.js +50 -0
- package/dist/components/base/modal/modal.js +259 -0
- package/dist/components/base/new_dropdowns/base_dropdown/base_dropdown.js +716 -0
- package/dist/components/base/new_dropdowns/base_dropdown/constants.js +5 -0
- package/dist/components/base/new_dropdowns/base_dropdown/dropdown_container.js +32 -0
- package/dist/components/base/new_dropdowns/constants.js +24 -0
- package/dist/components/base/new_dropdowns/disclosure/constants.js +8 -0
- package/dist/components/base/new_dropdowns/disclosure/disclosure_dropdown.js +400 -0
- package/dist/components/base/new_dropdowns/disclosure/disclosure_dropdown_group.js +112 -0
- package/dist/components/base/new_dropdowns/disclosure/disclosure_dropdown_item.js +196 -0
- package/dist/components/base/new_dropdowns/disclosure/mock_data.js +168 -0
- package/dist/components/base/new_dropdowns/disclosure/utils.js +84 -0
- package/dist/components/base/new_dropdowns/listbox/listbox.js +997 -0
- package/dist/components/base/new_dropdowns/listbox/listbox_group.js +58 -0
- package/dist/components/base/new_dropdowns/listbox/listbox_item.js +112 -0
- package/dist/components/base/new_dropdowns/listbox/listbox_search_input.js +94 -0
- package/dist/components/base/new_dropdowns/listbox/mock_data.js +131 -0
- package/dist/components/base/new_dropdowns/listbox/utils.js +33 -0
- package/dist/components/base/pagination/pagination.js +397 -0
- package/dist/components/base/path/data.js +34 -0
- package/dist/components/base/path/path.js +177 -0
- package/dist/components/base/popover/popover.js +142 -0
- package/dist/components/base/progress_bar/progress_bar.js +117 -0
- package/dist/components/base/search_box_by_click/search_box_by_click.js +245 -0
- package/dist/components/base/search_box_by_type/search_box_by_type.js +187 -0
- package/dist/components/base/segmented_control/segmented_control.js +73 -0
- package/dist/components/base/skeleton_loader/skeleton_loader.js +232 -0
- package/dist/components/base/sorting/sorting.js +180 -0
- package/dist/components/base/table/constants.js +5 -0
- package/dist/components/base/table/table.js +187 -0
- package/dist/components/base/table_lite/table_lite.js +80 -0
- package/dist/components/base/tabs/constants.js +3 -0
- package/dist/components/base/tabs/tab/tab.js +113 -0
- package/dist/components/base/tabs/tabs/scrollable_tabs.js +162 -0
- package/dist/components/base/tabs/tabs/tabs.js +223 -0
- package/dist/components/base/toast/index.js +66 -0
- package/dist/components/base/toast/toast.js +125 -0
- package/dist/components/base/toast/toaster.js +87 -0
- package/dist/components/base/toggle/toggle.js +178 -0
- package/dist/components/base/token/token.js +97 -0
- package/dist/components/base/token_selector/helpers.js +5 -0
- package/dist/components/base/token_selector/token_container.js +160 -0
- package/dist/components/base/token_selector/token_selector.js +454 -0
- package/dist/components/base/token_selector/token_selector_dropdown.js +223 -0
- package/dist/components/base/tooltip/tooltip.js +54 -0
- package/dist/components/charts/area/area.js +329 -0
- package/dist/components/charts/bar/bar.js +207 -0
- package/dist/components/charts/chart/chart.js +215 -0
- package/dist/components/charts/column/column.js +221 -0
- package/dist/components/charts/discrete_scatter/discrete_scatter.js +199 -0
- package/dist/components/charts/gauge/gauge.js +205 -0
- package/dist/components/charts/heatmap/heatmap.js +299 -0
- package/dist/components/charts/heatmap/index.js +2 -0
- package/dist/components/charts/legend/legend.js +245 -0
- package/dist/components/charts/line/line.js +340 -0
- package/dist/components/charts/series_label/series_label.js +101 -0
- package/dist/components/charts/shared/tooltip/tooltip.js +369 -0
- package/dist/components/charts/shared/tooltip/tooltip_default_format/tooltip_default_format.js +53 -0
- package/dist/components/charts/single_stat/single_stat.js +164 -0
- package/dist/components/charts/sparkline/sparkline.js +299 -0
- package/dist/components/charts/stacked_column/stacked_column.js +380 -0
- package/dist/components/dashboards/dashboard_layout/dashboard_layout.js +125 -0
- package/dist/components/dashboards/dashboard_layout/grid_layout/grid_layout.js +326 -0
- package/dist/components/dashboards/dashboard_layout/validators.js +14 -0
- package/dist/components/dashboards/dashboard_panel/dashboard_panel.js +236 -0
- package/dist/components/dashboards/mock_data.js +49 -0
- package/dist/components/experimental/experiment_badge/constants.js +4 -0
- package/dist/components/experimental/experiment_badge/experiment_badge.js +102 -0
- package/dist/components/extended/multi_step_form_template/multi_step_form_template.js +87 -0
- package/dist/components/index.js +107 -0
- package/dist/components/mixins/button_mixin.js +11 -0
- package/dist/components/mixins/safe_link_mixin.js +30 -0
- package/dist/components/mixins/tooltip_mixin.js +21 -0
- package/dist/components/regions/dashboard_skeleton/dashboard_skeleton.js +53 -0
- package/dist/components/regions/empty_state/empty_state.js +181 -0
- package/dist/components/shared_components/clear_icon_button/clear_icon_button.js +64 -0
- package/dist/components/shared_components/clipboard_button/clipboard_button.js +100 -0
- package/dist/components/shared_components/close_button/close_button.js +55 -0
- package/dist/components/utilities/animated_number/animated_number.js +131 -0
- package/dist/components/utilities/friendly_wrap/friendly_wrap.js +75 -0
- package/dist/components/utilities/intersection_observer/intersection_observer.js +88 -0
- package/dist/components/utilities/intersperse/intersperse.js +104 -0
- package/dist/components/utilities/sprintf/sprintf.js +171 -0
- package/dist/components/utilities/truncate/constants.js +8 -0
- package/dist/components/utilities/truncate/truncate.js +154 -0
- package/dist/components/utilities/truncate_text/constants.js +7 -0
- package/dist/components/utilities/truncate_text/truncate_text.js +146 -0
- package/dist/config.js +53 -0
- package/dist/directives/hover_load/hover_load.js +45 -0
- package/dist/directives/index.js +8 -0
- package/dist/directives/modal.js +1 -0
- package/dist/directives/outside/outside.js +149 -0
- package/dist/directives/resize_observer/resize_observer.js +58 -0
- package/dist/directives/safe_html/constants.js +6 -0
- package/dist/directives/safe_html/safe_html.js +39 -0
- package/dist/directives/safe_link/mock_data.js +10 -0
- package/dist/directives/safe_link/safe_link.js +67 -0
- package/dist/directives/tooltip/container.js +7 -0
- package/dist/directives/tooltip/tooltip.js +18 -0
- package/dist/index.css +7 -0
- package/dist/index.css.map +1 -0
- package/dist/index.js +2 -0
- package/dist/tailwind.css +2 -0
- package/dist/tailwind.css.map +1 -0
- package/dist/tokens/build/js/tokens.dark.js +1410 -0
- package/dist/tokens/build/js/tokens.js +1410 -0
- package/dist/tokens/common_story_options.js +29 -0
- package/dist/tokens/tokens_story.js +76 -0
- package/dist/utils/breakpoints.js +20 -0
- package/dist/utils/charts/config.js +616 -0
- package/dist/utils/charts/constants.js +69 -0
- package/dist/utils/charts/mock_data.js +191 -0
- package/dist/utils/charts/story_config.js +24 -0
- package/dist/utils/charts/theme.js +200 -0
- package/dist/utils/charts/utils.js +54 -0
- package/dist/utils/constants.js +331 -0
- package/dist/utils/data_utils.js +19 -0
- package/dist/utils/datetime_utility.js +61 -0
- package/dist/utils/equality_utils.js +84 -0
- package/dist/utils/form_options_utils.js +46 -0
- package/dist/utils/i18n.js +65 -0
- package/dist/utils/is_slot_empty.js +34 -0
- package/dist/utils/number_utils.js +132 -0
- package/dist/utils/play_utils.js +11 -0
- package/dist/utils/set_utils.js +25 -0
- package/dist/utils/stories_constants.js +29 -0
- package/dist/utils/stories_utils.js +62 -0
- package/dist/utils/story_decorators/container.js +19 -0
- package/dist/utils/string_utils.js +69 -0
- package/dist/utils/svgs/svg_paths.js +7 -0
- package/dist/utils/test_utils.js +33 -0
- package/dist/utils/use_fake_date.js +29 -0
- package/dist/utils/use_mock_intersection_observer.js +105 -0
- package/dist/utils/utils.js +205 -0
- package/dist/utils/vue_utils.js +57 -0
- package/dist/utils.js +5 -0
- package/dist/vendor/bootstrap-vue/src/bv-config.js +8 -0
- package/dist/vendor/bootstrap-vue/src/components/button/button-close.js +81 -0
- package/dist/vendor/bootstrap-vue/src/components/button/button.js +204 -0
- package/dist/vendor/bootstrap-vue/src/components/button/index.js +2 -0
- package/dist/vendor/bootstrap-vue/src/components/dropdown/dropdown-divider.js +41 -0
- package/dist/vendor/bootstrap-vue/src/components/dropdown/dropdown-form.js +52 -0
- package/dist/vendor/bootstrap-vue/src/components/dropdown/dropdown-group.js +75 -0
- package/dist/vendor/bootstrap-vue/src/components/dropdown/dropdown-header.js +52 -0
- package/dist/vendor/bootstrap-vue/src/components/dropdown/dropdown-item-button.js +85 -0
- package/dist/vendor/bootstrap-vue/src/components/dropdown/dropdown-item.js +97 -0
- package/dist/vendor/bootstrap-vue/src/components/dropdown/dropdown-text.js +60 -0
- package/dist/vendor/bootstrap-vue/src/components/dropdown/dropdown.js +270 -0
- package/dist/vendor/bootstrap-vue/src/components/dropdown/index.js +8 -0
- package/dist/vendor/bootstrap-vue/src/components/form/form-invalid-feedback.js +53 -0
- package/dist/vendor/bootstrap-vue/src/components/form/form-text.js +55 -0
- package/dist/vendor/bootstrap-vue/src/components/form/form-valid-feedback.js +53 -0
- package/dist/vendor/bootstrap-vue/src/components/form/form.js +56 -0
- package/dist/vendor/bootstrap-vue/src/components/form/index.js +4 -0
- package/dist/vendor/bootstrap-vue/src/components/form-group/form-group.js +347 -0
- package/dist/vendor/bootstrap-vue/src/components/form-group/index.js +1 -0
- package/dist/vendor/bootstrap-vue/src/components/form-select/form-select-option-group.js +54 -0
- package/dist/vendor/bootstrap-vue/src/components/form-select/form-select-option.js +41 -0
- package/dist/vendor/bootstrap-vue/src/components/form-select/form-select.js +143 -0
- package/dist/vendor/bootstrap-vue/src/components/form-select/helpers/mixin-options.js +56 -0
- package/dist/vendor/bootstrap-vue/src/components/form-select/index.js +3 -0
- package/dist/vendor/bootstrap-vue/src/components/form-textarea/form-textarea.js +217 -0
- package/dist/vendor/bootstrap-vue/src/components/form-textarea/index.js +1 -0
- package/dist/vendor/bootstrap-vue/src/components/layout/col.js +155 -0
- package/dist/vendor/bootstrap-vue/src/components/layout/form-row.js +34 -0
- package/dist/vendor/bootstrap-vue/src/components/layout/index.js +2 -0
- package/dist/vendor/bootstrap-vue/src/components/link/index.js +1 -0
- package/dist/vendor/bootstrap-vue/src/components/link/link.js +283 -0
- package/dist/vendor/bootstrap-vue/src/components/modal/helpers/bv-modal-event.class.js +21 -0
- package/dist/vendor/bootstrap-vue/src/components/modal/helpers/modal-manager.js +212 -0
- package/dist/vendor/bootstrap-vue/src/components/modal/index.js +1 -0
- package/dist/vendor/bootstrap-vue/src/components/modal/modal.js +1059 -0
- package/dist/vendor/bootstrap-vue/src/components/popover/helpers/bv-popover-template.js +55 -0
- package/dist/vendor/bootstrap-vue/src/components/popover/helpers/bv-popover.js +31 -0
- package/dist/vendor/bootstrap-vue/src/components/popover/index.js +1 -0
- package/dist/vendor/bootstrap-vue/src/components/popover/popover.js +49 -0
- package/dist/vendor/bootstrap-vue/src/components/table/helpers/constants.js +22 -0
- package/dist/vendor/bootstrap-vue/src/components/table/helpers/default-sort-compare.js +64 -0
- package/dist/vendor/bootstrap-vue/src/components/table/helpers/filter-event.js +40 -0
- package/dist/vendor/bootstrap-vue/src/components/table/helpers/mixin-bottom-row.js +43 -0
- package/dist/vendor/bootstrap-vue/src/components/table/helpers/mixin-busy.js +83 -0
- package/dist/vendor/bootstrap-vue/src/components/table/helpers/mixin-caption.js +50 -0
- package/dist/vendor/bootstrap-vue/src/components/table/helpers/mixin-colgroup.js +32 -0
- package/dist/vendor/bootstrap-vue/src/components/table/helpers/mixin-empty.js +82 -0
- package/dist/vendor/bootstrap-vue/src/components/table/helpers/mixin-filtering.js +292 -0
- package/dist/vendor/bootstrap-vue/src/components/table/helpers/mixin-items.js +154 -0
- package/dist/vendor/bootstrap-vue/src/components/table/helpers/mixin-pagination.js +44 -0
- package/dist/vendor/bootstrap-vue/src/components/table/helpers/mixin-provider.js +191 -0
- package/dist/vendor/bootstrap-vue/src/components/table/helpers/mixin-selectable.js +213 -0
- package/dist/vendor/bootstrap-vue/src/components/table/helpers/mixin-sorting.js +274 -0
- package/dist/vendor/bootstrap-vue/src/components/table/helpers/mixin-stacked.js +39 -0
- package/dist/vendor/bootstrap-vue/src/components/table/helpers/mixin-table-renderer.js +186 -0
- package/dist/vendor/bootstrap-vue/src/components/table/helpers/mixin-tbody-row.js +338 -0
- package/dist/vendor/bootstrap-vue/src/components/table/helpers/mixin-tbody.js +243 -0
- package/dist/vendor/bootstrap-vue/src/components/table/helpers/mixin-tfoot.js +50 -0
- package/dist/vendor/bootstrap-vue/src/components/table/helpers/mixin-thead.js +218 -0
- package/dist/vendor/bootstrap-vue/src/components/table/helpers/mixin-top-row.js +42 -0
- package/dist/vendor/bootstrap-vue/src/components/table/helpers/normalize-fields.js +86 -0
- package/dist/vendor/bootstrap-vue/src/components/table/helpers/sanitize-row.js +31 -0
- package/dist/vendor/bootstrap-vue/src/components/table/helpers/stringify-record-values.js +11 -0
- package/dist/vendor/bootstrap-vue/src/components/table/helpers/text-selection-active.js +14 -0
- package/dist/vendor/bootstrap-vue/src/components/table/index.js +9 -0
- package/dist/vendor/bootstrap-vue/src/components/table/table-lite.js +51 -0
- package/dist/vendor/bootstrap-vue/src/components/table/table-simple.js +44 -0
- package/dist/vendor/bootstrap-vue/src/components/table/table.js +67 -0
- package/dist/vendor/bootstrap-vue/src/components/table/tbody.js +116 -0
- package/dist/vendor/bootstrap-vue/src/components/table/td.js +204 -0
- package/dist/vendor/bootstrap-vue/src/components/table/tfoot.js +96 -0
- package/dist/vendor/bootstrap-vue/src/components/table/th.js +26 -0
- package/dist/vendor/bootstrap-vue/src/components/table/thead.js +99 -0
- package/dist/vendor/bootstrap-vue/src/components/table/tr.js +121 -0
- package/dist/vendor/bootstrap-vue/src/components/tabs/index.js +2 -0
- package/dist/vendor/bootstrap-vue/src/components/tabs/tab.js +238 -0
- package/dist/vendor/bootstrap-vue/src/components/tabs/tabs.js +690 -0
- package/dist/vendor/bootstrap-vue/src/components/tooltip/helpers/bv-popper.js +251 -0
- package/dist/vendor/bootstrap-vue/src/components/tooltip/helpers/bv-tooltip-template.js +118 -0
- package/dist/vendor/bootstrap-vue/src/components/tooltip/helpers/bv-tooltip.js +932 -0
- package/dist/vendor/bootstrap-vue/src/components/tooltip/index.js +1 -0
- package/dist/vendor/bootstrap-vue/src/components/tooltip/tooltip.js +337 -0
- package/dist/vendor/bootstrap-vue/src/components/transition/bv-transition.js +103 -0
- package/dist/vendor/bootstrap-vue/src/components/transporter/transporter.js +205 -0
- package/dist/vendor/bootstrap-vue/src/constants/components.js +55 -0
- package/dist/vendor/bootstrap-vue/src/constants/config.js +11 -0
- package/dist/vendor/bootstrap-vue/src/constants/env.js +36 -0
- package/dist/vendor/bootstrap-vue/src/constants/events.js +56 -0
- package/dist/vendor/bootstrap-vue/src/constants/key-codes.js +11 -0
- package/dist/vendor/bootstrap-vue/src/constants/popper.js +10 -0
- package/dist/vendor/bootstrap-vue/src/constants/props.js +24 -0
- package/dist/vendor/bootstrap-vue/src/constants/regex.js +35 -0
- package/dist/vendor/bootstrap-vue/src/constants/safe-types.js +15 -0
- package/dist/vendor/bootstrap-vue/src/constants/slots.js +36 -0
- package/dist/vendor/bootstrap-vue/src/directives/modal/index.js +1 -0
- package/dist/vendor/bootstrap-vue/src/directives/modal/modal.js +112 -0
- package/dist/vendor/bootstrap-vue/src/directives/tooltip/index.js +1 -0
- package/dist/vendor/bootstrap-vue/src/directives/tooltip/tooltip.js +267 -0
- package/dist/vendor/bootstrap-vue/src/directives/visible/index.js +1 -0
- package/dist/vendor/bootstrap-vue/src/directives/visible/visible.js +187 -0
- package/dist/vendor/bootstrap-vue/src/mixins/attrs.js +5 -0
- package/dist/vendor/bootstrap-vue/src/mixins/click-out.js +54 -0
- package/dist/vendor/bootstrap-vue/src/mixins/dropdown.js +470 -0
- package/dist/vendor/bootstrap-vue/src/mixins/focus-in.js +46 -0
- package/dist/vendor/bootstrap-vue/src/mixins/form-control.js +73 -0
- package/dist/vendor/bootstrap-vue/src/mixins/form-custom.js +26 -0
- package/dist/vendor/bootstrap-vue/src/mixins/form-options.js +91 -0
- package/dist/vendor/bootstrap-vue/src/mixins/form-selection.js +62 -0
- package/dist/vendor/bootstrap-vue/src/mixins/form-size.js +26 -0
- package/dist/vendor/bootstrap-vue/src/mixins/form-state.js +50 -0
- package/dist/vendor/bootstrap-vue/src/mixins/form-text.js +293 -0
- package/dist/vendor/bootstrap-vue/src/mixins/form-validity.js +50 -0
- package/dist/vendor/bootstrap-vue/src/mixins/has-listener.js +29 -0
- package/dist/vendor/bootstrap-vue/src/mixins/id.js +57 -0
- package/dist/vendor/bootstrap-vue/src/mixins/listen-on-document.js +62 -0
- package/dist/vendor/bootstrap-vue/src/mixins/listen-on-root.js +120 -0
- package/dist/vendor/bootstrap-vue/src/mixins/listen-on-window.js +62 -0
- package/dist/vendor/bootstrap-vue/src/mixins/listeners.js +25 -0
- package/dist/vendor/bootstrap-vue/src/mixins/model.js +10 -0
- package/dist/vendor/bootstrap-vue/src/mixins/normalize-slot.js +30 -0
- package/dist/vendor/bootstrap-vue/src/mixins/scoped-style.js +18 -0
- package/dist/vendor/bootstrap-vue/src/mixins/use-parent.js +14 -0
- package/dist/vendor/bootstrap-vue/src/utils/array.js +27 -0
- package/dist/vendor/bootstrap-vue/src/utils/bv-event.class.js +60 -0
- package/dist/vendor/bootstrap-vue/src/utils/cache.js +60 -0
- package/dist/vendor/bootstrap-vue/src/utils/clone-deep.js +18 -0
- package/dist/vendor/bootstrap-vue/src/utils/config-set.js +86 -0
- package/dist/vendor/bootstrap-vue/src/utils/config.js +71 -0
- package/dist/vendor/bootstrap-vue/src/utils/create-new-child-component.js +133 -0
- package/dist/vendor/bootstrap-vue/src/utils/css-escape.js +70 -0
- package/dist/vendor/bootstrap-vue/src/utils/dom.js +298 -0
- package/dist/vendor/bootstrap-vue/src/utils/element-to-vue-instance-registry.js +28 -0
- package/dist/vendor/bootstrap-vue/src/utils/env.js +16 -0
- package/dist/vendor/bootstrap-vue/src/utils/events.js +78 -0
- package/dist/vendor/bootstrap-vue/src/utils/get-event-root.js +5 -0
- package/dist/vendor/bootstrap-vue/src/utils/get-instance-from-directive.js +3 -0
- package/dist/vendor/bootstrap-vue/src/utils/get-scope-id.js +9 -0
- package/dist/vendor/bootstrap-vue/src/utils/get.js +63 -0
- package/dist/vendor/bootstrap-vue/src/utils/html.js +16 -0
- package/dist/vendor/bootstrap-vue/src/utils/identity.js +3 -0
- package/dist/vendor/bootstrap-vue/src/utils/inspect.js +35 -0
- package/dist/vendor/bootstrap-vue/src/utils/locale.js +18 -0
- package/dist/vendor/bootstrap-vue/src/utils/loose-equal.js +59 -0
- package/dist/vendor/bootstrap-vue/src/utils/loose-index-of.js +13 -0
- package/dist/vendor/bootstrap-vue/src/utils/math.js +9 -0
- package/dist/vendor/bootstrap-vue/src/utils/memoize.js +14 -0
- package/dist/vendor/bootstrap-vue/src/utils/model.js +33 -0
- package/dist/vendor/bootstrap-vue/src/utils/noop.js +3 -0
- package/dist/vendor/bootstrap-vue/src/utils/normalize-slot.js +51 -0
- package/dist/vendor/bootstrap-vue/src/utils/number.js +23 -0
- package/dist/vendor/bootstrap-vue/src/utils/object.js +72 -0
- package/dist/vendor/bootstrap-vue/src/utils/observe-dom.js +76 -0
- package/dist/vendor/bootstrap-vue/src/utils/on-instance-destroy.js +22 -0
- package/dist/vendor/bootstrap-vue/src/utils/plugins.js +124 -0
- package/dist/vendor/bootstrap-vue/src/utils/props.js +67 -0
- package/dist/vendor/bootstrap-vue/src/utils/router.js +150 -0
- package/dist/vendor/bootstrap-vue/src/utils/safe-vue-instance.js +14 -0
- package/dist/vendor/bootstrap-vue/src/utils/stable-sort.js +28 -0
- package/dist/vendor/bootstrap-vue/src/utils/string.js +47 -0
- package/dist/vendor/bootstrap-vue/src/utils/stringify-object-values.js +31 -0
- package/dist/vendor/bootstrap-vue/src/utils/warn.js +45 -0
- package/dist/vendor/bootstrap-vue/src/vue.js +55 -0
- package/package.json +4 -3
- package/src/vendor/bootstrap-vue/src/components/dropdown/dropdown.js +2 -2
- package/src/vendor/bootstrap-vue/src/components/form-group/form-group.js +2 -2
- package/src/vendor/bootstrap-vue/src/components/layout/col.js +2 -2
- package/src/vendor/bootstrap-vue/src/components/modal/modal.js +2 -2
- package/src/vendor/bootstrap-vue/src/components/tabs/tabs.js +2 -2
- package/src/vendor/bootstrap-vue/src/components/tooltip/helpers/bv-tooltip.js +8 -9
- package/src/vendor/bootstrap-vue/src/mixins/listen-on-document.js +1 -2
- package/src/vendor/bootstrap-vue/src/mixins/listen-on-root.js +1 -2
- package/src/vendor/bootstrap-vue/src/mixins/listen-on-window.js +1 -2
- package/src/vendor/bootstrap-vue/src/utils/array.js +0 -1
- package/src/vendor/bootstrap-vue/src/utils/locale.js +1 -2
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import { extend } from '../vue';
|
|
2
|
+
|
|
3
|
+
// @vue/component
|
|
4
|
+
const formSelectionMixin = extend({
|
|
5
|
+
computed: {
|
|
6
|
+
selectionStart: {
|
|
7
|
+
// Expose selectionStart for formatters, etc
|
|
8
|
+
cache: false,
|
|
9
|
+
/* istanbul ignore next */
|
|
10
|
+
get() {
|
|
11
|
+
return this.$refs.input.selectionStart;
|
|
12
|
+
},
|
|
13
|
+
/* istanbul ignore next */
|
|
14
|
+
set(val) {
|
|
15
|
+
this.$refs.input.selectionStart = val;
|
|
16
|
+
}
|
|
17
|
+
},
|
|
18
|
+
selectionEnd: {
|
|
19
|
+
// Expose selectionEnd for formatters, etc
|
|
20
|
+
cache: false,
|
|
21
|
+
/* istanbul ignore next */
|
|
22
|
+
get() {
|
|
23
|
+
return this.$refs.input.selectionEnd;
|
|
24
|
+
},
|
|
25
|
+
/* istanbul ignore next */
|
|
26
|
+
set(val) {
|
|
27
|
+
this.$refs.input.selectionEnd = val;
|
|
28
|
+
}
|
|
29
|
+
},
|
|
30
|
+
selectionDirection: {
|
|
31
|
+
// Expose selectionDirection for formatters, etc
|
|
32
|
+
cache: false,
|
|
33
|
+
/* istanbul ignore next */
|
|
34
|
+
get() {
|
|
35
|
+
return this.$refs.input.selectionDirection;
|
|
36
|
+
},
|
|
37
|
+
/* istanbul ignore next */
|
|
38
|
+
set(val) {
|
|
39
|
+
this.$refs.input.selectionDirection = val;
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
},
|
|
43
|
+
methods: {
|
|
44
|
+
/* istanbul ignore next */
|
|
45
|
+
select() {
|
|
46
|
+
// For external handler that may want a select() method
|
|
47
|
+
this.$refs.input.select(...arguments);
|
|
48
|
+
},
|
|
49
|
+
/* istanbul ignore next */
|
|
50
|
+
setSelectionRange() {
|
|
51
|
+
// For external handler that may want a setSelectionRange(a,b,c) method
|
|
52
|
+
this.$refs.input.setSelectionRange(...arguments);
|
|
53
|
+
},
|
|
54
|
+
/* istanbul ignore next */
|
|
55
|
+
setRangeText() {
|
|
56
|
+
// For external handler that may want a setRangeText(a,b,c) method
|
|
57
|
+
this.$refs.input.setRangeText(...arguments);
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
});
|
|
61
|
+
|
|
62
|
+
export { formSelectionMixin };
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { extend } from '../vue';
|
|
2
|
+
import { PROP_TYPE_STRING } from '../constants/props';
|
|
3
|
+
|
|
4
|
+
// --- Props ---
|
|
5
|
+
|
|
6
|
+
const props = {
|
|
7
|
+
size: {
|
|
8
|
+
type: PROP_TYPE_STRING,
|
|
9
|
+
required: false,
|
|
10
|
+
default: undefined
|
|
11
|
+
}
|
|
12
|
+
};
|
|
13
|
+
|
|
14
|
+
// --- Mixin ---
|
|
15
|
+
|
|
16
|
+
// @vue/component
|
|
17
|
+
const formSizeMixin = extend({
|
|
18
|
+
props,
|
|
19
|
+
computed: {
|
|
20
|
+
sizeFormClass() {
|
|
21
|
+
return [this.size ? `form-control-${this.size}` : null];
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
});
|
|
25
|
+
|
|
26
|
+
export { formSizeMixin, props };
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import { extend } from '../vue';
|
|
2
|
+
import { PROP_TYPE_BOOLEAN } from '../constants/props';
|
|
3
|
+
import { isBoolean } from '../utils/inspect';
|
|
4
|
+
import { safeVueInstance } from '../utils/safe-vue-instance';
|
|
5
|
+
|
|
6
|
+
/* Form control contextual state class computation
|
|
7
|
+
*
|
|
8
|
+
* Returned class is either 'is-valid' or 'is-invalid' based on the 'state' prop
|
|
9
|
+
* state can be one of five values:
|
|
10
|
+
* - true for is-valid
|
|
11
|
+
* - false for is-invalid
|
|
12
|
+
* - null for no contextual state
|
|
13
|
+
*/
|
|
14
|
+
|
|
15
|
+
// --- Props ---
|
|
16
|
+
|
|
17
|
+
const props = {
|
|
18
|
+
// Tri-state prop: true, false, null (or undefined)
|
|
19
|
+
state: {
|
|
20
|
+
type: PROP_TYPE_BOOLEAN,
|
|
21
|
+
required: false,
|
|
22
|
+
default: null
|
|
23
|
+
}
|
|
24
|
+
};
|
|
25
|
+
|
|
26
|
+
// --- Mixin ---
|
|
27
|
+
|
|
28
|
+
// @vue/component
|
|
29
|
+
const formStateMixin = extend({
|
|
30
|
+
props,
|
|
31
|
+
computed: {
|
|
32
|
+
computedState() {
|
|
33
|
+
// If not a boolean, ensure that value is null
|
|
34
|
+
return isBoolean(this.state) ? this.state : null;
|
|
35
|
+
},
|
|
36
|
+
stateClass() {
|
|
37
|
+
const state = this.computedState;
|
|
38
|
+
return state === true ? 'is-valid' : state === false ? 'is-invalid' : null;
|
|
39
|
+
},
|
|
40
|
+
computedAriaInvalid() {
|
|
41
|
+
const ariaInvalid = safeVueInstance(this).ariaInvalid;
|
|
42
|
+
if (ariaInvalid === true || ariaInvalid === 'true' || ariaInvalid === '') {
|
|
43
|
+
return 'true';
|
|
44
|
+
}
|
|
45
|
+
return this.computedState === false ? 'true' : ariaInvalid;
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
});
|
|
49
|
+
|
|
50
|
+
export { formStateMixin, props };
|
|
@@ -0,0 +1,293 @@
|
|
|
1
|
+
import { extend } from '../vue';
|
|
2
|
+
import { EVENT_NAME_UPDATE, EVENT_NAME_INPUT, EVENT_NAME_CHANGE, EVENT_NAME_BLUR } from '../constants/events';
|
|
3
|
+
import { PROP_TYPE_NUMBER_STRING, PROP_TYPE_BOOLEAN, PROP_TYPE_STRING, PROP_TYPE_NUMBER, PROP_TYPE_FUNCTION } from '../constants/props';
|
|
4
|
+
import { attemptFocus, attemptBlur } from '../utils/dom';
|
|
5
|
+
import { stopEvent } from '../utils/events';
|
|
6
|
+
import { mathMax } from '../utils/math';
|
|
7
|
+
import { makeModelMixin } from '../utils/model';
|
|
8
|
+
import { toInteger, toFloat } from '../utils/number';
|
|
9
|
+
import { sortKeys } from '../utils/object';
|
|
10
|
+
import { isFunction } from '../utils/inspect';
|
|
11
|
+
import { toString } from '../utils/string';
|
|
12
|
+
|
|
13
|
+
// --- Constants ---
|
|
14
|
+
|
|
15
|
+
const {
|
|
16
|
+
mixin: modelMixin,
|
|
17
|
+
props: modelProps,
|
|
18
|
+
prop: MODEL_PROP_NAME,
|
|
19
|
+
event: MODEL_EVENT_NAME
|
|
20
|
+
} = makeModelMixin('value', {
|
|
21
|
+
type: PROP_TYPE_NUMBER_STRING,
|
|
22
|
+
defaultValue: '',
|
|
23
|
+
event: EVENT_NAME_UPDATE
|
|
24
|
+
});
|
|
25
|
+
|
|
26
|
+
// --- Props ---
|
|
27
|
+
|
|
28
|
+
const props = sortKeys({
|
|
29
|
+
...modelProps,
|
|
30
|
+
ariaInvalid: {
|
|
31
|
+
type: [PROP_TYPE_BOOLEAN, PROP_TYPE_STRING],
|
|
32
|
+
required: false,
|
|
33
|
+
default: false
|
|
34
|
+
},
|
|
35
|
+
autocomplete: {
|
|
36
|
+
type: PROP_TYPE_STRING,
|
|
37
|
+
required: false,
|
|
38
|
+
default: undefined
|
|
39
|
+
},
|
|
40
|
+
// Debounce timeout (in ms). Not applicable with `lazy` prop
|
|
41
|
+
debounce: {
|
|
42
|
+
type: [PROP_TYPE_NUMBER, PROP_TYPE_STRING],
|
|
43
|
+
required: false,
|
|
44
|
+
default: 0
|
|
45
|
+
},
|
|
46
|
+
formatter: {
|
|
47
|
+
type: PROP_TYPE_FUNCTION,
|
|
48
|
+
required: false,
|
|
49
|
+
default: undefined
|
|
50
|
+
},
|
|
51
|
+
// Only update the `v-model` on blur/change events
|
|
52
|
+
lazy: {
|
|
53
|
+
type: PROP_TYPE_BOOLEAN,
|
|
54
|
+
required: false,
|
|
55
|
+
default: false
|
|
56
|
+
},
|
|
57
|
+
lazyFormatter: {
|
|
58
|
+
type: PROP_TYPE_BOOLEAN,
|
|
59
|
+
required: false,
|
|
60
|
+
default: false
|
|
61
|
+
},
|
|
62
|
+
number: {
|
|
63
|
+
type: PROP_TYPE_BOOLEAN,
|
|
64
|
+
required: false,
|
|
65
|
+
default: false
|
|
66
|
+
},
|
|
67
|
+
placeholder: {
|
|
68
|
+
type: PROP_TYPE_STRING,
|
|
69
|
+
required: false,
|
|
70
|
+
default: undefined
|
|
71
|
+
},
|
|
72
|
+
plaintext: {
|
|
73
|
+
type: PROP_TYPE_BOOLEAN,
|
|
74
|
+
required: false,
|
|
75
|
+
default: false
|
|
76
|
+
},
|
|
77
|
+
readonly: {
|
|
78
|
+
type: PROP_TYPE_BOOLEAN,
|
|
79
|
+
required: false,
|
|
80
|
+
default: false
|
|
81
|
+
},
|
|
82
|
+
trim: {
|
|
83
|
+
type: PROP_TYPE_BOOLEAN,
|
|
84
|
+
required: false,
|
|
85
|
+
default: false
|
|
86
|
+
}
|
|
87
|
+
});
|
|
88
|
+
|
|
89
|
+
// --- Mixin ---
|
|
90
|
+
|
|
91
|
+
// @vue/component
|
|
92
|
+
const formTextMixin = extend({
|
|
93
|
+
mixins: [modelMixin],
|
|
94
|
+
props,
|
|
95
|
+
data() {
|
|
96
|
+
const value = this[MODEL_PROP_NAME];
|
|
97
|
+
return {
|
|
98
|
+
localValue: toString(value),
|
|
99
|
+
vModelValue: this.modifyValue(value)
|
|
100
|
+
};
|
|
101
|
+
},
|
|
102
|
+
computed: {
|
|
103
|
+
computedClass() {
|
|
104
|
+
const {
|
|
105
|
+
plaintext,
|
|
106
|
+
type
|
|
107
|
+
} = this;
|
|
108
|
+
const isRange = type === 'range';
|
|
109
|
+
const isColor = type === 'color';
|
|
110
|
+
return [{
|
|
111
|
+
// Range input needs class `custom-range`
|
|
112
|
+
'custom-range': isRange,
|
|
113
|
+
// `plaintext` not supported by `type="range"` or `type="color"`
|
|
114
|
+
'form-control-plaintext': plaintext && !isRange && !isColor,
|
|
115
|
+
// `form-control` not used by `type="range"` or `plaintext`
|
|
116
|
+
// Always used by `type="color"`
|
|
117
|
+
'form-control': isColor || !plaintext && !isRange
|
|
118
|
+
}, this.sizeFormClass, this.stateClass];
|
|
119
|
+
},
|
|
120
|
+
computedDebounce() {
|
|
121
|
+
// Ensure we have a positive number equal to or greater than 0
|
|
122
|
+
return mathMax(toInteger(this.debounce, 0), 0);
|
|
123
|
+
},
|
|
124
|
+
hasFormatter() {
|
|
125
|
+
// `formatter` is an optional Function prop with no default
|
|
126
|
+
return isFunction(this.formatter);
|
|
127
|
+
}
|
|
128
|
+
},
|
|
129
|
+
watch: {
|
|
130
|
+
[MODEL_PROP_NAME](newValue) {
|
|
131
|
+
const stringifyValue = toString(newValue);
|
|
132
|
+
const modifiedValue = this.modifyValue(newValue);
|
|
133
|
+
if (stringifyValue !== this.localValue || modifiedValue !== this.vModelValue) {
|
|
134
|
+
// Clear any pending debounce timeout, as we are overwriting the user input
|
|
135
|
+
this.clearDebounce();
|
|
136
|
+
// Update the local values
|
|
137
|
+
this.localValue = stringifyValue;
|
|
138
|
+
this.vModelValue = modifiedValue;
|
|
139
|
+
}
|
|
140
|
+
}
|
|
141
|
+
},
|
|
142
|
+
created() {
|
|
143
|
+
// Create private non-reactive props
|
|
144
|
+
this.$_inputDebounceTimer = null;
|
|
145
|
+
},
|
|
146
|
+
beforeDestroy() {
|
|
147
|
+
this.clearDebounce();
|
|
148
|
+
},
|
|
149
|
+
methods: {
|
|
150
|
+
clearDebounce() {
|
|
151
|
+
clearTimeout(this.$_inputDebounceTimer);
|
|
152
|
+
this.$_inputDebounceTimer = null;
|
|
153
|
+
},
|
|
154
|
+
formatValue(value, event) {
|
|
155
|
+
let force = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
|
|
156
|
+
value = toString(value);
|
|
157
|
+
if (this.hasFormatter && (!this.lazyFormatter || force)) {
|
|
158
|
+
value = this.formatter(value, event);
|
|
159
|
+
}
|
|
160
|
+
return value;
|
|
161
|
+
},
|
|
162
|
+
modifyValue(value) {
|
|
163
|
+
value = toString(value);
|
|
164
|
+
// Emulate `.trim` modifier behaviour
|
|
165
|
+
if (this.trim) {
|
|
166
|
+
value = value.trim();
|
|
167
|
+
}
|
|
168
|
+
// Emulate `.number` modifier behaviour
|
|
169
|
+
if (this.number) {
|
|
170
|
+
value = toFloat(value, value);
|
|
171
|
+
}
|
|
172
|
+
return value;
|
|
173
|
+
},
|
|
174
|
+
updateValue(value) {
|
|
175
|
+
let force = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
|
|
176
|
+
const {
|
|
177
|
+
lazy
|
|
178
|
+
} = this;
|
|
179
|
+
if (lazy && !force) {
|
|
180
|
+
return;
|
|
181
|
+
}
|
|
182
|
+
// Make sure to always clear the debounce when `updateValue()`
|
|
183
|
+
// is called, even when the v-model hasn't changed
|
|
184
|
+
this.clearDebounce();
|
|
185
|
+
// Define the shared update logic in a method to be able to use
|
|
186
|
+
// it for immediate and debounced value changes
|
|
187
|
+
const doUpdate = () => {
|
|
188
|
+
value = this.modifyValue(value);
|
|
189
|
+
if (value !== this.vModelValue) {
|
|
190
|
+
this.vModelValue = value;
|
|
191
|
+
this.$emit(MODEL_EVENT_NAME, value);
|
|
192
|
+
} else if (this.hasFormatter) {
|
|
193
|
+
// When the `vModelValue` hasn't changed but the actual input value
|
|
194
|
+
// is out of sync, make sure to change it to the given one
|
|
195
|
+
// Usually caused by browser autocomplete and how it triggers the
|
|
196
|
+
// change or input event, or depending on the formatter function
|
|
197
|
+
// https://github.com/bootstrap-vue/bootstrap-vue/issues/2657
|
|
198
|
+
// https://github.com/bootstrap-vue/bootstrap-vue/issues/3498
|
|
199
|
+
/* istanbul ignore next: hard to test */
|
|
200
|
+
const $input = this.$refs.input;
|
|
201
|
+
/* istanbul ignore if: hard to test out of sync value */
|
|
202
|
+
if ($input && value !== $input.value) {
|
|
203
|
+
$input.value = value;
|
|
204
|
+
}
|
|
205
|
+
}
|
|
206
|
+
};
|
|
207
|
+
// Only debounce the value update when a value greater than `0`
|
|
208
|
+
// is set and we are not in lazy mode or this is a forced update
|
|
209
|
+
const debounce = this.computedDebounce;
|
|
210
|
+
if (debounce > 0 && !lazy && !force) {
|
|
211
|
+
this.$_inputDebounceTimer = setTimeout(doUpdate, debounce);
|
|
212
|
+
} else {
|
|
213
|
+
// Immediately update the v-model
|
|
214
|
+
doUpdate();
|
|
215
|
+
}
|
|
216
|
+
},
|
|
217
|
+
onInput(event) {
|
|
218
|
+
// `event.target.composing` is set by Vue
|
|
219
|
+
// https://github.com/vuejs/vue/blob/dev/src/platforms/web/runtime/directives/model.js
|
|
220
|
+
// TODO: Is this needed now with the latest Vue?
|
|
221
|
+
/* istanbul ignore if: hard to test composition events */
|
|
222
|
+
if (event.target.composing) {
|
|
223
|
+
return;
|
|
224
|
+
}
|
|
225
|
+
const {
|
|
226
|
+
value
|
|
227
|
+
} = event.target;
|
|
228
|
+
const formattedValue = this.formatValue(value, event);
|
|
229
|
+
// Exit when the `formatter` function strictly returned `false`
|
|
230
|
+
// or prevented the input event
|
|
231
|
+
/* istanbul ignore next */
|
|
232
|
+
if (formattedValue === false || event.defaultPrevented) {
|
|
233
|
+
stopEvent(event, {
|
|
234
|
+
propagation: false
|
|
235
|
+
});
|
|
236
|
+
return;
|
|
237
|
+
}
|
|
238
|
+
this.localValue = formattedValue;
|
|
239
|
+
this.updateValue(formattedValue);
|
|
240
|
+
this.$emit(EVENT_NAME_INPUT, formattedValue);
|
|
241
|
+
},
|
|
242
|
+
onChange(event) {
|
|
243
|
+
const {
|
|
244
|
+
value
|
|
245
|
+
} = event.target;
|
|
246
|
+
const formattedValue = this.formatValue(value, event);
|
|
247
|
+
// Exit when the `formatter` function strictly returned `false`
|
|
248
|
+
// or prevented the input event
|
|
249
|
+
/* istanbul ignore next */
|
|
250
|
+
if (formattedValue === false || event.defaultPrevented) {
|
|
251
|
+
stopEvent(event, {
|
|
252
|
+
propagation: false
|
|
253
|
+
});
|
|
254
|
+
return;
|
|
255
|
+
}
|
|
256
|
+
this.localValue = formattedValue;
|
|
257
|
+
this.updateValue(formattedValue, true);
|
|
258
|
+
this.$emit(EVENT_NAME_CHANGE, formattedValue);
|
|
259
|
+
},
|
|
260
|
+
onBlur(event) {
|
|
261
|
+
// Apply the `localValue` on blur to prevent cursor jumps
|
|
262
|
+
// on mobile browsers (e.g. caused by autocomplete)
|
|
263
|
+
const {
|
|
264
|
+
value
|
|
265
|
+
} = event.target;
|
|
266
|
+
const formattedValue = this.formatValue(value, event, true);
|
|
267
|
+
if (formattedValue !== false) {
|
|
268
|
+
// We need to use the modified value here to apply the
|
|
269
|
+
// `.trim` and `.number` modifiers properly
|
|
270
|
+
this.localValue = toString(this.modifyValue(formattedValue));
|
|
271
|
+
// We pass the formatted value here since the `updateValue` method
|
|
272
|
+
// handles the modifiers itself
|
|
273
|
+
this.updateValue(formattedValue, true);
|
|
274
|
+
}
|
|
275
|
+
// Emit native blur event
|
|
276
|
+
this.$emit(EVENT_NAME_BLUR, event);
|
|
277
|
+
},
|
|
278
|
+
focus() {
|
|
279
|
+
// For external handler that may want a focus method
|
|
280
|
+
if (!this.disabled) {
|
|
281
|
+
attemptFocus(this.$el);
|
|
282
|
+
}
|
|
283
|
+
},
|
|
284
|
+
blur() {
|
|
285
|
+
// For external handler that may want a blur method
|
|
286
|
+
if (!this.disabled) {
|
|
287
|
+
attemptBlur(this.$el);
|
|
288
|
+
}
|
|
289
|
+
}
|
|
290
|
+
}
|
|
291
|
+
});
|
|
292
|
+
|
|
293
|
+
export { MODEL_EVENT_NAME, MODEL_PROP_NAME, formTextMixin, props };
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import { extend } from '../vue';
|
|
2
|
+
|
|
3
|
+
// @vue/component
|
|
4
|
+
const formValidityMixin = extend({
|
|
5
|
+
computed: {
|
|
6
|
+
validity: {
|
|
7
|
+
// Expose validity property
|
|
8
|
+
cache: false,
|
|
9
|
+
/* istanbul ignore next */
|
|
10
|
+
get() {
|
|
11
|
+
return this.$refs.input.validity;
|
|
12
|
+
}
|
|
13
|
+
},
|
|
14
|
+
validationMessage: {
|
|
15
|
+
// Expose validationMessage property
|
|
16
|
+
cache: false,
|
|
17
|
+
/* istanbul ignore next */
|
|
18
|
+
get() {
|
|
19
|
+
return this.$refs.input.validationMessage;
|
|
20
|
+
}
|
|
21
|
+
},
|
|
22
|
+
willValidate: {
|
|
23
|
+
// Expose willValidate property
|
|
24
|
+
cache: false,
|
|
25
|
+
/* istanbul ignore next */
|
|
26
|
+
get() {
|
|
27
|
+
return this.$refs.input.willValidate;
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
},
|
|
31
|
+
methods: {
|
|
32
|
+
/* istanbul ignore next */
|
|
33
|
+
setCustomValidity() {
|
|
34
|
+
// For external handler that may want a setCustomValidity(...) method
|
|
35
|
+
return this.$refs.input.setCustomValidity(...arguments);
|
|
36
|
+
},
|
|
37
|
+
/* istanbul ignore next */
|
|
38
|
+
checkValidity() {
|
|
39
|
+
// For external handler that may want a checkValidity(...) method
|
|
40
|
+
return this.$refs.input.checkValidity(...arguments);
|
|
41
|
+
},
|
|
42
|
+
/* istanbul ignore next */
|
|
43
|
+
reportValidity() {
|
|
44
|
+
// For external handler that may want a reportValidity(...) method
|
|
45
|
+
return this.$refs.input.reportValidity(...arguments);
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
});
|
|
49
|
+
|
|
50
|
+
export { formValidityMixin };
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { extend, isVue3 } from '../vue';
|
|
2
|
+
import { isUndefined, isArray } from '../utils/inspect';
|
|
3
|
+
|
|
4
|
+
// Mixin to determine if an event listener has been registered
|
|
5
|
+
// either via `v-on:name` (in the parent) or programmatically
|
|
6
|
+
// via `vm.$on('name', ...)`
|
|
7
|
+
// See: https://github.com/vuejs/vue/issues/10825
|
|
8
|
+
|
|
9
|
+
// @vue/component
|
|
10
|
+
const hasListenerMixin = extend({
|
|
11
|
+
methods: {
|
|
12
|
+
hasListener(name) {
|
|
13
|
+
if (isVue3(this)) {
|
|
14
|
+
return true;
|
|
15
|
+
}
|
|
16
|
+
// Only includes listeners registered via `v-on:name`
|
|
17
|
+
const $listeners = this.$listeners || {};
|
|
18
|
+
// Includes `v-on:name` and `this.$on('name')` registered listeners
|
|
19
|
+
// Note this property is not part of the public Vue API, but it is
|
|
20
|
+
// the only way to determine if a listener was added via `vm.$on`
|
|
21
|
+
const $events = this._events || {};
|
|
22
|
+
// Registered listeners in `this._events` are always an array,
|
|
23
|
+
// but might be zero length
|
|
24
|
+
return !isUndefined($listeners[name]) || isArray($events[name]) && $events[name].length > 0;
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
});
|
|
28
|
+
|
|
29
|
+
export { hasListenerMixin };
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import { extend, COMPONENT_UID_KEY } from '../vue';
|
|
2
|
+
import { PROP_TYPE_STRING } from '../constants/props';
|
|
3
|
+
|
|
4
|
+
// SSR safe client-side ID attribute generation
|
|
5
|
+
// ID's can only be generated client-side, after mount
|
|
6
|
+
// `this._uid` is not synched between server and client
|
|
7
|
+
|
|
8
|
+
// --- Props ---
|
|
9
|
+
|
|
10
|
+
const props = {
|
|
11
|
+
id: {
|
|
12
|
+
type: PROP_TYPE_STRING,
|
|
13
|
+
required: false,
|
|
14
|
+
default: undefined
|
|
15
|
+
}
|
|
16
|
+
};
|
|
17
|
+
|
|
18
|
+
// --- Mixin ---
|
|
19
|
+
|
|
20
|
+
// @vue/component
|
|
21
|
+
const idMixin = extend({
|
|
22
|
+
props,
|
|
23
|
+
data() {
|
|
24
|
+
return {
|
|
25
|
+
localId_: null
|
|
26
|
+
};
|
|
27
|
+
},
|
|
28
|
+
computed: {
|
|
29
|
+
safeId() {
|
|
30
|
+
// Computed property that returns a dynamic function for creating the ID
|
|
31
|
+
// Reacts to changes in both `.id` and `.localId_` and regenerates a new function
|
|
32
|
+
const id = this.id || this.localId_;
|
|
33
|
+
|
|
34
|
+
// We return a function that accepts an optional suffix string
|
|
35
|
+
// So this computed prop looks and works like a method
|
|
36
|
+
// but benefits from Vue's computed prop caching
|
|
37
|
+
const fn = suffix => {
|
|
38
|
+
if (!id) {
|
|
39
|
+
return null;
|
|
40
|
+
}
|
|
41
|
+
suffix = String(suffix || '').replace(/\s+/g, '_');
|
|
42
|
+
return suffix ? id + '_' + suffix : id;
|
|
43
|
+
};
|
|
44
|
+
return fn;
|
|
45
|
+
}
|
|
46
|
+
},
|
|
47
|
+
mounted() {
|
|
48
|
+
// `mounted()` only occurs client-side
|
|
49
|
+
this.$nextTick(() => {
|
|
50
|
+
// Update DOM with auto-generated ID after mount
|
|
51
|
+
// to prevent SSR hydration errors
|
|
52
|
+
this.localId_ = `__BVID__${this[COMPONENT_UID_KEY]}`;
|
|
53
|
+
});
|
|
54
|
+
}
|
|
55
|
+
});
|
|
56
|
+
|
|
57
|
+
export { idMixin, props };
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import { extend } from '../vue';
|
|
2
|
+
import { IS_BROWSER } from '../constants/env';
|
|
3
|
+
import { EVENT_OPTIONS_NO_CAPTURE } from '../constants/events';
|
|
4
|
+
import { eventOn, eventOff } from '../utils/events';
|
|
5
|
+
import { keys } from '../utils/object';
|
|
6
|
+
|
|
7
|
+
// --- Constants ---
|
|
8
|
+
|
|
9
|
+
const PROP = '$_documentListeners';
|
|
10
|
+
|
|
11
|
+
// --- Mixin ---
|
|
12
|
+
|
|
13
|
+
// @vue/component
|
|
14
|
+
const listenOnDocumentMixin = extend({
|
|
15
|
+
created() {
|
|
16
|
+
// Define non-reactive property
|
|
17
|
+
// Object of arrays, keyed by event name,
|
|
18
|
+
// where value is an array of callbacks
|
|
19
|
+
this[PROP] = {};
|
|
20
|
+
},
|
|
21
|
+
beforeDestroy() {
|
|
22
|
+
// Unregister all registered listeners
|
|
23
|
+
keys(this[PROP] || {}).forEach(event => {
|
|
24
|
+
this[PROP][event].forEach(callback => {
|
|
25
|
+
this.listenOffDocument(event, callback);
|
|
26
|
+
});
|
|
27
|
+
});
|
|
28
|
+
this[PROP] = null;
|
|
29
|
+
},
|
|
30
|
+
methods: {
|
|
31
|
+
registerDocumentListener(event, callback) {
|
|
32
|
+
if (this[PROP]) {
|
|
33
|
+
this[PROP][event] = this[PROP][event] || [];
|
|
34
|
+
if (!this[PROP][event].includes(callback)) {
|
|
35
|
+
this[PROP][event].push(callback);
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
},
|
|
39
|
+
unregisterDocumentListener(event, callback) {
|
|
40
|
+
if (this[PROP] && this[PROP][event]) {
|
|
41
|
+
this[PROP][event] = this[PROP][event].filter(cb => cb !== callback);
|
|
42
|
+
}
|
|
43
|
+
},
|
|
44
|
+
listenDocument(on, event, callback) {
|
|
45
|
+
on ? this.listenOnDocument(event, callback) : this.listenOffDocument(event, callback);
|
|
46
|
+
},
|
|
47
|
+
listenOnDocument(event, callback) {
|
|
48
|
+
if (IS_BROWSER) {
|
|
49
|
+
eventOn(document, event, callback, EVENT_OPTIONS_NO_CAPTURE);
|
|
50
|
+
this.registerDocumentListener(event, callback);
|
|
51
|
+
}
|
|
52
|
+
},
|
|
53
|
+
listenOffDocument(event, callback) {
|
|
54
|
+
if (IS_BROWSER) {
|
|
55
|
+
eventOff(document, event, callback, EVENT_OPTIONS_NO_CAPTURE);
|
|
56
|
+
}
|
|
57
|
+
this.unregisterDocumentListener(event, callback);
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
});
|
|
61
|
+
|
|
62
|
+
export { listenOnDocumentMixin };
|