@gitlab/ui 132.1.0 → 132.2.1
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/components/base/accordion/accordion_item.js +1 -3
- package/dist/components/base/avatar/avatar.js +76 -5
- package/dist/components/base/badge/badge.js +5 -7
- package/dist/components/base/button/button.js +1 -3
- package/dist/components/base/collapse/collapse.js +2 -6
- package/dist/components/base/datepicker/datepicker.js +4 -5
- package/dist/components/base/daterange_picker/daterange_picker.js +2 -4
- package/dist/components/base/dropdown/dropdown_item.js +3 -4
- package/dist/components/base/filtered_search/filtered_search.js +55 -7
- package/dist/components/base/filtered_search/filtered_search_token.js +6 -14
- package/dist/components/base/filtered_search/filtered_search_token_segment.js +39 -19
- package/dist/components/base/filtered_search/filtered_search_utils.js +57 -7
- package/dist/components/base/form/form_checkbox/form_checkbox.js +13 -26
- package/dist/components/base/form/form_checkbox/form_checkbox_group.js +1 -3
- package/dist/components/base/form/form_fields/form_fields_loop.js +57 -6
- package/dist/components/base/form/form_group/form_group.js +1 -3
- package/dist/components/base/form/form_input/form_input.js +95 -41
- package/dist/components/base/form/form_input_group/form_input_group.js +2 -4
- package/dist/components/base/form/form_radio/form_radio.js +5 -9
- package/dist/components/base/form/form_radio_group/form_radio_group.js +1 -3
- package/dist/components/base/form/form_select/form_select.js +76 -5
- package/dist/components/base/infinite_scroll/infinite_scroll.js +7 -14
- package/dist/components/base/link/link.js +26 -7
- package/dist/components/base/new_dropdowns/base_dropdown/base_dropdown.js +93 -32
- package/dist/components/base/new_dropdowns/disclosure/disclosure_dropdown.js +2 -6
- package/dist/components/base/new_dropdowns/disclosure/disclosure_dropdown_item.js +2 -6
- package/dist/components/base/new_dropdowns/listbox/listbox.js +5 -13
- package/dist/components/base/new_dropdowns/listbox/listbox_item.js +1 -3
- package/dist/components/base/new_dropdowns/listbox/mock_data.js +2 -6
- package/dist/components/base/new_dropdowns/listbox/utils.js +6 -11
- package/dist/components/base/path/path.js +1 -5
- package/dist/components/base/search_box_by_type/search_box_by_type.js +2 -6
- package/dist/components/base/skeleton_loader/skeleton_loader.js +3 -5
- package/dist/components/base/table/table.js +32 -21
- package/dist/components/base/table_lite/table_lite.js +1 -3
- package/dist/components/base/tabs/tab/tab.js +1 -3
- package/dist/components/base/tabs/tabs/scrollable_tabs.js +1 -5
- package/dist/components/base/token_selector/token_selector.js +2 -6
- package/dist/components/charts/area/area.js +6 -7
- package/dist/components/charts/column/column.js +11 -15
- package/dist/components/charts/discrete_scatter/discrete_scatter.js +57 -5
- package/dist/components/charts/gauge/gauge.js +13 -21
- package/dist/components/charts/heatmap/heatmap.js +66 -18
- package/dist/components/charts/legend/legend.js +59 -13
- package/dist/components/charts/line/line.js +6 -7
- package/dist/components/charts/shared/tooltip/tooltip.js +11 -18
- package/dist/components/charts/sparkline/sparkline.js +72 -19
- package/dist/components/charts/stacked_column/stacked_column.js +18 -31
- package/dist/components/dashboards/dashboard_layout/grid_layout/grid_layout.js +37 -21
- package/dist/components/utilities/friendly_wrap/friendly_wrap.js +3 -7
- package/dist/components/utilities/intersperse/intersperse.js +6 -11
- package/dist/components/utilities/sprintf/sprintf.js +58 -7
- package/dist/components/utilities/truncate/truncate.js +2 -4
- package/dist/components/utilities/truncate_text/truncate_text.js +1 -3
- package/dist/config.js +3 -4
- package/dist/directives/hover_load/hover_load.js +1 -3
- package/dist/directives/outside/outside.js +9 -16
- package/dist/directives/resize_observer/resize_observer.js +6 -8
- package/dist/directives/safe_html/safe_html.js +1 -3
- package/dist/directives/safe_link/safe_link.js +11 -14
- package/dist/index.css +2 -2
- package/dist/index.css.map +1 -1
- package/dist/tokens/build/js/tokens.dark.js +95 -95
- package/dist/tokens/build/js/tokens.js +74 -74
- package/dist/tokens/common_story_options.js +7 -8
- package/dist/utils/charts/config.js +122 -90
- package/dist/utils/constants.js +26 -1
- package/dist/utils/data_utils.js +28 -1
- package/dist/utils/form_options_utils.js +4 -6
- package/dist/utils/is_slot_empty.js +3 -5
- package/dist/utils/stories_utils.js +8 -8
- package/dist/utils/use_mock_intersection_observer.js +63 -12
- package/dist/utils/utils.js +76 -19
- package/dist/vendor/bootstrap-vue/src/components/button/button-close.js +8 -11
- package/dist/vendor/bootstrap-vue/src/components/button/button.js +12 -17
- package/dist/vendor/bootstrap-vue/src/components/dropdown/dropdown-divider.js +3 -6
- package/dist/vendor/bootstrap-vue/src/components/dropdown/dropdown-form.js +6 -9
- package/dist/vendor/bootstrap-vue/src/components/dropdown/dropdown-group.js +14 -19
- package/dist/vendor/bootstrap-vue/src/components/dropdown/dropdown-header.js +8 -13
- package/dist/vendor/bootstrap-vue/src/components/dropdown/dropdown-item-button.js +9 -12
- package/dist/vendor/bootstrap-vue/src/components/dropdown/dropdown-item.js +8 -11
- package/dist/vendor/bootstrap-vue/src/components/dropdown/dropdown-text.js +9 -14
- package/dist/vendor/bootstrap-vue/src/components/dropdown/dropdown.js +34 -43
- package/dist/vendor/bootstrap-vue/src/components/form/form-invalid-feedback.js +5 -9
- package/dist/vendor/bootstrap-vue/src/components/form/form-text.js +7 -10
- package/dist/vendor/bootstrap-vue/src/components/form/form-valid-feedback.js +5 -9
- package/dist/vendor/bootstrap-vue/src/components/form/form.js +7 -10
- package/dist/vendor/bootstrap-vue/src/components/form-group/form-group.js +25 -33
- package/dist/vendor/bootstrap-vue/src/components/form-select/form-select-option-group.js +6 -11
- package/dist/vendor/bootstrap-vue/src/components/form-select/form-select-option.js +6 -12
- package/dist/vendor/bootstrap-vue/src/components/form-select/form-select.js +28 -29
- package/dist/vendor/bootstrap-vue/src/components/form-textarea/form-textarea.js +7 -10
- package/dist/vendor/bootstrap-vue/src/components/layout/col.js +7 -11
- package/dist/vendor/bootstrap-vue/src/components/layout/form-row.js +3 -5
- package/dist/vendor/bootstrap-vue/src/components/link/link.js +19 -31
- package/dist/vendor/bootstrap-vue/src/components/modal/helpers/modal-manager.js +3 -4
- package/dist/vendor/bootstrap-vue/src/components/modal/modal.js +59 -68
- package/dist/vendor/bootstrap-vue/src/components/popover/helpers/bv-popover-template.js +2 -4
- package/dist/vendor/bootstrap-vue/src/components/popover/popover.js +4 -5
- package/dist/vendor/bootstrap-vue/src/components/table/helpers/default-sort-compare.js +11 -7
- package/dist/vendor/bootstrap-vue/src/components/table/helpers/mixin-bottom-row.js +4 -6
- package/dist/vendor/bootstrap-vue/src/components/table/helpers/mixin-busy.js +3 -6
- package/dist/vendor/bootstrap-vue/src/components/table/helpers/mixin-caption.js +4 -7
- package/dist/vendor/bootstrap-vue/src/components/table/helpers/mixin-colgroup.js +1 -3
- package/dist/vendor/bootstrap-vue/src/components/table/helpers/mixin-empty.js +16 -20
- package/dist/vendor/bootstrap-vue/src/components/table/helpers/mixin-filtering.js +14 -25
- package/dist/vendor/bootstrap-vue/src/components/table/helpers/mixin-items.js +23 -35
- package/dist/vendor/bootstrap-vue/src/components/table/helpers/mixin-pagination.js +6 -8
- package/dist/vendor/bootstrap-vue/src/components/table/helpers/mixin-provider.js +8 -10
- package/dist/vendor/bootstrap-vue/src/components/table/helpers/mixin-selectable.js +8 -15
- package/dist/vendor/bootstrap-vue/src/components/table/helpers/mixin-sorting.js +33 -41
- package/dist/vendor/bootstrap-vue/src/components/table/helpers/mixin-stacked.js +3 -8
- package/dist/vendor/bootstrap-vue/src/components/table/helpers/mixin-table-renderer.js +38 -50
- package/dist/vendor/bootstrap-vue/src/components/table/helpers/mixin-tbody-row.js +19 -31
- package/dist/vendor/bootstrap-vue/src/components/table/helpers/mixin-tbody.js +13 -23
- package/dist/vendor/bootstrap-vue/src/components/table/helpers/mixin-tfoot.js +5 -6
- package/dist/vendor/bootstrap-vue/src/components/table/helpers/mixin-thead.js +17 -21
- package/dist/vendor/bootstrap-vue/src/components/table/helpers/mixin-top-row.js +4 -6
- package/dist/vendor/bootstrap-vue/src/components/table/helpers/sanitize-row.js +1 -3
- package/dist/vendor/bootstrap-vue/src/components/table/tbody.js +3 -6
- package/dist/vendor/bootstrap-vue/src/components/table/td.js +9 -14
- package/dist/vendor/bootstrap-vue/src/components/table/tfoot.js +1 -2
- package/dist/vendor/bootstrap-vue/src/components/table/thead.js +1 -2
- package/dist/vendor/bootstrap-vue/src/components/table/tr.js +2 -5
- package/dist/vendor/bootstrap-vue/src/components/tabs/tab.js +19 -36
- package/dist/vendor/bootstrap-vue/src/components/tabs/tabs.js +66 -81
- package/dist/vendor/bootstrap-vue/src/components/tooltip/helpers/bv-popper.js +2 -6
- package/dist/vendor/bootstrap-vue/src/components/tooltip/helpers/bv-tooltip-template.js +5 -11
- package/dist/vendor/bootstrap-vue/src/components/tooltip/helpers/bv-tooltip.js +8 -14
- package/dist/vendor/bootstrap-vue/src/components/tooltip/tooltip.js +19 -22
- package/dist/vendor/bootstrap-vue/src/components/transition/bv-transition.js +7 -10
- package/dist/vendor/bootstrap-vue/src/components/transporter/transporter.js +7 -14
- package/dist/vendor/bootstrap-vue/src/directives/modal/modal.js +4 -5
- package/dist/vendor/bootstrap-vue/src/directives/visible/visible.js +5 -9
- package/dist/vendor/bootstrap-vue/src/mixins/dropdown.js +17 -29
- package/dist/vendor/bootstrap-vue/src/mixins/form-control.js +6 -7
- package/dist/vendor/bootstrap-vue/src/mixins/form-custom.js +1 -2
- package/dist/vendor/bootstrap-vue/src/mixins/form-options.js +5 -6
- package/dist/vendor/bootstrap-vue/src/mixins/form-size.js +1 -2
- package/dist/vendor/bootstrap-vue/src/mixins/form-state.js +1 -2
- package/dist/vendor/bootstrap-vue/src/mixins/form-text.js +29 -43
- package/dist/vendor/bootstrap-vue/src/mixins/id.js +1 -2
- package/dist/vendor/bootstrap-vue/src/utils/create-new-child-component.js +62 -15
- package/dist/vendor/bootstrap-vue/src/utils/dom.js +3 -9
- package/dist/vendor/bootstrap-vue/src/utils/events.js +7 -5
- package/dist/vendor/bootstrap-vue/src/utils/plugins.js +4 -5
- package/dist/vendor/bootstrap-vue/src/utils/router.js +9 -13
- package/package.json +9 -7
- package/src/scss/gitlab_ui.scss +3 -0
- package/src/scss/storybook.scss +3 -0
- package/src/scss/themes.scss +84 -0
- package/src/tokens/build/css/tokens.css +142 -142
- package/src/tokens/build/css/tokens.dark.css +138 -138
- package/src/tokens/build/docs/tokens-tailwind-docs.dark.json +580 -580
- package/src/tokens/build/docs/tokens-tailwind-docs.json +495 -495
- package/src/tokens/build/figma/constants.dark.json +799 -799
- package/src/tokens/build/figma/constants.json +799 -799
- package/src/tokens/build/js/tokens.dark.js +95 -95
- package/src/tokens/build/js/tokens.js +74 -74
- package/src/tokens/build/json/tokens.dark.json +1668 -1668
- package/src/tokens/build/json/tokens.json +1647 -1647
- package/src/tokens/build/scss/_tokens.dark.scss +138 -138
- package/src/tokens/build/scss/_tokens.scss +142 -142
- package/src/tokens/build/scss/_tokens_custom_properties.scss +73 -73
- package/src/tokens/constant/color.blue.tokens.json +182 -0
- package/src/tokens/constant/color.brand.tokens.json +252 -0
- package/src/tokens/constant/color.data.tokens.json +894 -0
- package/src/tokens/constant/color.green.tokens.json +182 -0
- package/src/tokens/constant/color.neutral.tokens.json +230 -0
- package/src/tokens/constant/color.orange.tokens.json +182 -0
- package/src/tokens/constant/color.purple.tokens.json +182 -0
- package/src/tokens/constant/color.red.tokens.json +182 -0
- package/src/tokens/constant/color.theme.tokens.json +1168 -0
- package/src/tokens/deprecated/deprecated.color.tokens.json +134 -1340
- package/src/utils/constants.js +9 -0
- package/src/vendor/bootstrap-vue/src/components/button/button-close.js +4 -5
- package/src/vendor/bootstrap-vue/src/components/button/button.js +7 -8
- package/src/vendor/bootstrap-vue/src/components/dropdown/dropdown-divider.js +1 -2
- package/src/vendor/bootstrap-vue/src/components/dropdown/dropdown-form.js +2 -8
- package/src/vendor/bootstrap-vue/src/components/dropdown/dropdown-group.js +6 -7
- package/src/vendor/bootstrap-vue/src/components/dropdown/dropdown-header.js +3 -4
- package/src/vendor/bootstrap-vue/src/components/dropdown/dropdown-item-button.js +6 -12
- package/src/vendor/bootstrap-vue/src/components/dropdown/dropdown-item.js +2 -3
- package/src/vendor/bootstrap-vue/src/components/dropdown/dropdown-text.js +3 -4
- package/src/vendor/bootstrap-vue/src/components/dropdown/dropdown.js +19 -26
- package/src/vendor/bootstrap-vue/src/components/form/form-text.js +4 -6
- package/src/vendor/bootstrap-vue/src/components/form/form.js +4 -6
- package/src/vendor/bootstrap-vue/src/components/form-group/form-group.js +14 -20
- package/src/vendor/bootstrap-vue/src/components/form-select/form-select-option-group.js +1 -2
- package/src/vendor/bootstrap-vue/src/components/form-select/form-select-option.js +1 -4
- package/src/vendor/bootstrap-vue/src/components/form-select/form-select.js +13 -14
- package/src/vendor/bootstrap-vue/src/components/form-textarea/form-textarea.js +5 -6
- package/src/vendor/bootstrap-vue/src/components/modal/modal.js +53 -62
- package/src/vendor/bootstrap-vue/src/components/popover/popover.js +4 -10
- package/src/vendor/bootstrap-vue/src/components/table/helpers/mixin-busy.js +1 -2
- package/src/vendor/bootstrap-vue/src/components/table/helpers/mixin-caption.js +2 -3
- package/src/vendor/bootstrap-vue/src/components/table/helpers/mixin-empty.js +5 -6
- package/src/vendor/bootstrap-vue/src/components/table/helpers/mixin-filtering.js +5 -13
- package/src/vendor/bootstrap-vue/src/components/table/helpers/mixin-items.js +12 -21
- package/src/vendor/bootstrap-vue/src/components/table/helpers/mixin-pagination.js +2 -3
- package/src/vendor/bootstrap-vue/src/components/table/helpers/mixin-provider.js +5 -11
- package/src/vendor/bootstrap-vue/src/components/table/helpers/mixin-selectable.js +4 -5
- package/src/vendor/bootstrap-vue/src/components/table/helpers/mixin-sorting.js +14 -21
- package/src/vendor/bootstrap-vue/src/components/table/helpers/mixin-stacked.js +1 -2
- package/src/vendor/bootstrap-vue/src/components/table/helpers/mixin-table-renderer.js +14 -20
- package/src/vendor/bootstrap-vue/src/components/table/helpers/mixin-tbody-row.js +3 -9
- package/src/vendor/bootstrap-vue/src/components/table/helpers/mixin-tbody.js +1 -2
- package/src/vendor/bootstrap-vue/src/components/table/helpers/mixin-tfoot.js +5 -11
- package/src/vendor/bootstrap-vue/src/components/table/helpers/mixin-thead.js +4 -5
- package/src/vendor/bootstrap-vue/src/components/table/tbody.js +2 -3
- package/src/vendor/bootstrap-vue/src/components/table/td.js +5 -6
- package/src/vendor/bootstrap-vue/src/components/table/tfoot.js +1 -2
- package/src/vendor/bootstrap-vue/src/components/table/thead.js +1 -2
- package/src/vendor/bootstrap-vue/src/components/table/tr.js +1 -2
- package/src/vendor/bootstrap-vue/src/components/tabs/tab.js +10 -16
- package/src/vendor/bootstrap-vue/src/components/tabs/tabs.js +33 -39
- package/src/vendor/bootstrap-vue/src/components/tooltip/tooltip.js +17 -25
- package/src/vendor/bootstrap-vue/src/components/transition/bv-transition.js +4 -5
- package/src/vendor/bootstrap-vue/src/components/transporter/transporter.js +4 -10
- package/src/vendor/bootstrap-vue/src/mixins/dropdown.js +9 -15
- package/src/vendor/bootstrap-vue/src/mixins/form-control.js +6 -7
- package/src/vendor/bootstrap-vue/src/mixins/form-custom.js +1 -2
- package/src/vendor/bootstrap-vue/src/mixins/form-options.js +5 -6
- package/src/vendor/bootstrap-vue/src/mixins/form-size.js +1 -2
- package/src/vendor/bootstrap-vue/src/mixins/form-state.js +1 -2
- package/src/vendor/bootstrap-vue/src/mixins/form-text.js +21 -33
- package/src/vendor/bootstrap-vue/src/mixins/id.js +1 -2
- package/dist/vendor/bootstrap-vue/src/mixins/model.js +0 -10
- package/dist/vendor/bootstrap-vue/src/utils/model.js +0 -33
- package/src/tokens/constant/color.tokens.json +0 -3422
- package/src/vendor/bootstrap-vue/src/mixins/model.js +0 -5
- package/src/vendor/bootstrap-vue/src/utils/model.js +0 -29
|
@@ -14,11 +14,10 @@ const ROOT_ACTION_EVENT_NAME_SHOW = getRootActionEventName(NAME_MODAL, EVENT_NAM
|
|
|
14
14
|
// Prop name we use to store info on root element
|
|
15
15
|
const PROPERTY = '__bv_modal_directive__';
|
|
16
16
|
const getTarget = _ref => {
|
|
17
|
-
let
|
|
18
|
-
modifiers = {},
|
|
19
|
-
arg,
|
|
20
|
-
value
|
|
21
|
-
} = _ref;
|
|
17
|
+
let _ref$modifiers = _ref.modifiers,
|
|
18
|
+
modifiers = _ref$modifiers === void 0 ? {} : _ref$modifiers,
|
|
19
|
+
arg = _ref.arg,
|
|
20
|
+
value = _ref.value;
|
|
22
21
|
// Try value, then arg, otherwise pick last modifier
|
|
23
22
|
return isString(value) ? value : isString(arg) ? arg : keys(modifiers).reverse()[0];
|
|
24
23
|
};
|
|
@@ -125,10 +125,8 @@ const destroy = el => {
|
|
|
125
125
|
delete el[OBSERVER_PROP_NAME];
|
|
126
126
|
};
|
|
127
127
|
const bind = (el, bindings, vnode) => {
|
|
128
|
-
const
|
|
129
|
-
|
|
130
|
-
modifiers
|
|
131
|
-
} = bindings;
|
|
128
|
+
const value = bindings.value,
|
|
129
|
+
modifiers = bindings.modifiers;
|
|
132
130
|
// `value` is the callback function
|
|
133
131
|
const options = {
|
|
134
132
|
margin: '0px',
|
|
@@ -155,11 +153,9 @@ const bind = (el, bindings, vnode) => {
|
|
|
155
153
|
|
|
156
154
|
// When the directive options may have been updated (or element)
|
|
157
155
|
const componentUpdated = (el, bindings, vnode) => {
|
|
158
|
-
const
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
modifiers
|
|
162
|
-
} = bindings;
|
|
156
|
+
const value = bindings.value,
|
|
157
|
+
oldValue = bindings.oldValue,
|
|
158
|
+
modifiers = bindings.modifiers;
|
|
163
159
|
// Compare value/oldValue and modifiers to see if anything has changed
|
|
164
160
|
// and if so, destroy old observer and create new observer
|
|
165
161
|
/* istanbul ignore next */
|
|
@@ -4,7 +4,6 @@ import { NAME_DROPDOWN } from '../constants/components';
|
|
|
4
4
|
import { EVENT_NAME_SHOWN, EVENT_NAME_HIDDEN, EVENT_NAME_TOGGLE, EVENT_NAME_CLICK, EVENT_NAME_SHOW, EVENT_NAME_HIDE } from '../constants/events';
|
|
5
5
|
import { CODE_ENTER, CODE_SPACE, CODE_DOWN, CODE_ESC, CODE_UP } from '../constants/key-codes';
|
|
6
6
|
import { PLACEMENT_TOP_END, PLACEMENT_TOP_START, PLACEMENT_BOTTOM_START, PLACEMENT_RIGHT_START, PLACEMENT_LEFT_START, PLACEMENT_BOTTOM_END } from '../constants/popper';
|
|
7
|
-
import { PROP_TYPE_STRING, PROP_TYPE_BOOLEAN, PROP_TYPE_NUMBER, PROP_TYPE_OBJECT } from '../constants/props';
|
|
8
7
|
import { HTMLElement } from '../constants/safe-types';
|
|
9
8
|
import { BvEvent } from '../utils/bv-event.class';
|
|
10
9
|
import { requestAF, contains, closest, attemptFocus, selectAll, isVisible } from '../utils/dom';
|
|
@@ -38,54 +37,54 @@ const props = sortKeys({
|
|
|
38
37
|
// String: `scrollParent`, `window` or `viewport`
|
|
39
38
|
// HTMLElement: HTML Element reference
|
|
40
39
|
boundary: {
|
|
41
|
-
type: [HTMLElement,
|
|
40
|
+
type: [HTMLElement, String],
|
|
42
41
|
required: false,
|
|
43
42
|
default: 'scrollParent'
|
|
44
43
|
},
|
|
45
44
|
disabled: {
|
|
46
|
-
type:
|
|
45
|
+
type: Boolean,
|
|
47
46
|
required: false,
|
|
48
47
|
default: false
|
|
49
48
|
},
|
|
50
49
|
// Place left if possible
|
|
51
50
|
dropleft: {
|
|
52
|
-
type:
|
|
51
|
+
type: Boolean,
|
|
53
52
|
required: false,
|
|
54
53
|
default: false
|
|
55
54
|
},
|
|
56
55
|
// Place right if possible
|
|
57
56
|
dropright: {
|
|
58
|
-
type:
|
|
57
|
+
type: Boolean,
|
|
59
58
|
required: false,
|
|
60
59
|
default: false
|
|
61
60
|
},
|
|
62
61
|
// Place on top if possible
|
|
63
62
|
dropup: {
|
|
64
|
-
type:
|
|
63
|
+
type: Boolean,
|
|
65
64
|
required: false,
|
|
66
65
|
default: false
|
|
67
66
|
},
|
|
68
67
|
// Disable auto-flipping of menu from bottom <=> top
|
|
69
68
|
noFlip: {
|
|
70
|
-
type:
|
|
69
|
+
type: Boolean,
|
|
71
70
|
required: false,
|
|
72
71
|
default: false
|
|
73
72
|
},
|
|
74
73
|
// Number of pixels or a CSS unit value to offset menu
|
|
75
74
|
// (i.e. `1px`, `1rem`, etc.)
|
|
76
75
|
offset: {
|
|
77
|
-
type: [
|
|
76
|
+
type: [Number, String],
|
|
78
77
|
required: false,
|
|
79
78
|
default: 0
|
|
80
79
|
},
|
|
81
80
|
popperOpts: {
|
|
82
|
-
type:
|
|
81
|
+
type: Object,
|
|
83
82
|
required: false,
|
|
84
83
|
default: () => ({})
|
|
85
84
|
},
|
|
86
85
|
// Right align menu (default is left align)
|
|
87
86
|
right: {
|
|
88
|
-
type:
|
|
87
|
+
type: Boolean,
|
|
89
88
|
required: false,
|
|
90
89
|
default: false
|
|
91
90
|
}
|
|
@@ -110,9 +109,7 @@ const dropdownMixin = extend({
|
|
|
110
109
|
},
|
|
111
110
|
computed: {
|
|
112
111
|
toggler() {
|
|
113
|
-
const
|
|
114
|
-
toggle
|
|
115
|
-
} = this.$refs;
|
|
112
|
+
const toggle = this.$refs.toggle;
|
|
116
113
|
return toggle ? toggle.$el || toggle : null;
|
|
117
114
|
},
|
|
118
115
|
directionClass() {
|
|
@@ -193,9 +190,7 @@ const dropdownMixin = extend({
|
|
|
193
190
|
methods: {
|
|
194
191
|
// Event emitter
|
|
195
192
|
emitEvent(bvEvent) {
|
|
196
|
-
const
|
|
197
|
-
type
|
|
198
|
-
} = bvEvent;
|
|
193
|
+
const type = bvEvent.type;
|
|
199
194
|
this.emitOnRoot(getRootEventName(NAME_DROPDOWN, type), bvEvent);
|
|
200
195
|
this.$emit(type, bvEvent);
|
|
201
196
|
},
|
|
@@ -330,10 +325,9 @@ const dropdownMixin = extend({
|
|
|
330
325
|
toggle(event) {
|
|
331
326
|
event = event || {};
|
|
332
327
|
// Early exit when not a click event or ENTER, SPACE or DOWN were pressed
|
|
333
|
-
const
|
|
334
|
-
type,
|
|
335
|
-
keyCode
|
|
336
|
-
} = event;
|
|
328
|
+
const _event = event,
|
|
329
|
+
type = _event.type,
|
|
330
|
+
keyCode = _event.keyCode;
|
|
337
331
|
if (type !== 'click' && !(type === 'keydown' && [CODE_ENTER, CODE_SPACE, CODE_DOWN].indexOf(keyCode) !== -1)) {
|
|
338
332
|
/* istanbul ignore next */
|
|
339
333
|
return;
|
|
@@ -369,9 +363,7 @@ const dropdownMixin = extend({
|
|
|
369
363
|
},
|
|
370
364
|
// Called from dropdown menu context
|
|
371
365
|
onKeydown(event) {
|
|
372
|
-
const
|
|
373
|
-
keyCode
|
|
374
|
-
} = event;
|
|
366
|
+
const keyCode = event.keyCode;
|
|
375
367
|
if (keyCode === CODE_ESC) {
|
|
376
368
|
// Close on ESC
|
|
377
369
|
this.onEsc(event);
|
|
@@ -403,9 +395,7 @@ const dropdownMixin = extend({
|
|
|
403
395
|
},
|
|
404
396
|
// Shared hide handler between click-out and focus-in events
|
|
405
397
|
hideHandler(event) {
|
|
406
|
-
const
|
|
407
|
-
target
|
|
408
|
-
} = event;
|
|
398
|
+
const target = event.target;
|
|
409
399
|
if (this.visible && !contains(this.$refs.menu, target) && !contains(this.toggler, target)) {
|
|
410
400
|
this.hide();
|
|
411
401
|
}
|
|
@@ -421,9 +411,7 @@ const dropdownMixin = extend({
|
|
|
421
411
|
// Keyboard nav
|
|
422
412
|
focusNext(event, up) {
|
|
423
413
|
// Ignore key up/down on form elements
|
|
424
|
-
const
|
|
425
|
-
target
|
|
426
|
-
} = event;
|
|
414
|
+
const target = event.target;
|
|
427
415
|
if (!this.visible || event && closest(SELECTOR_FORM_CHILD, target)) {
|
|
428
416
|
/* istanbul ignore next: should never happen */
|
|
429
417
|
return;
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { extend } from '../vue';
|
|
2
|
-
import { PROP_TYPE_BOOLEAN, PROP_TYPE_STRING } from '../constants/props';
|
|
3
2
|
import { requestAF, isVisible, matches, select, attemptFocus } from '../utils/dom';
|
|
4
3
|
|
|
5
4
|
// --- Constants ---
|
|
@@ -10,32 +9,32 @@ const SELECTOR = 'input, textarea, select';
|
|
|
10
9
|
|
|
11
10
|
const props = {
|
|
12
11
|
autofocus: {
|
|
13
|
-
type:
|
|
12
|
+
type: Boolean,
|
|
14
13
|
required: false,
|
|
15
14
|
default: false
|
|
16
15
|
},
|
|
17
16
|
disabled: {
|
|
18
|
-
type:
|
|
17
|
+
type: Boolean,
|
|
19
18
|
required: false,
|
|
20
19
|
default: false
|
|
21
20
|
},
|
|
22
21
|
form: {
|
|
23
|
-
type:
|
|
22
|
+
type: String,
|
|
24
23
|
required: false,
|
|
25
24
|
default: undefined
|
|
26
25
|
},
|
|
27
26
|
id: {
|
|
28
|
-
type:
|
|
27
|
+
type: String,
|
|
29
28
|
required: false,
|
|
30
29
|
default: undefined
|
|
31
30
|
},
|
|
32
31
|
name: {
|
|
33
|
-
type:
|
|
32
|
+
type: String,
|
|
34
33
|
required: false,
|
|
35
34
|
default: undefined
|
|
36
35
|
},
|
|
37
36
|
required: {
|
|
38
|
-
type:
|
|
37
|
+
type: Boolean,
|
|
39
38
|
required: false,
|
|
40
39
|
default: false
|
|
41
40
|
}
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { extend } from '../vue';
|
|
2
|
-
import { PROP_TYPE_STRING, PROP_TYPE_ARRAY, PROP_TYPE_OBJECT } from '../constants/props';
|
|
3
2
|
import { get } from '../utils/get';
|
|
4
3
|
import { stripTags } from '../utils/html';
|
|
5
4
|
import { isPlainObject, isUndefined, isArray } from '../utils/inspect';
|
|
@@ -14,27 +13,27 @@ const OPTIONS_OBJECT_DEPRECATED_MSG = 'Setting prop "options" to an object is de
|
|
|
14
13
|
|
|
15
14
|
const props = {
|
|
16
15
|
disabledField: {
|
|
17
|
-
type:
|
|
16
|
+
type: String,
|
|
18
17
|
required: false,
|
|
19
18
|
default: 'disabled'
|
|
20
19
|
},
|
|
21
20
|
htmlField: {
|
|
22
|
-
type:
|
|
21
|
+
type: String,
|
|
23
22
|
required: false,
|
|
24
23
|
default: 'html'
|
|
25
24
|
},
|
|
26
25
|
options: {
|
|
27
|
-
type: [
|
|
26
|
+
type: [Array, Object],
|
|
28
27
|
required: false,
|
|
29
28
|
default: () => []
|
|
30
29
|
},
|
|
31
30
|
textField: {
|
|
32
|
-
type:
|
|
31
|
+
type: String,
|
|
33
32
|
required: false,
|
|
34
33
|
default: 'text'
|
|
35
34
|
},
|
|
36
35
|
valueField: {
|
|
37
|
-
type:
|
|
36
|
+
type: String,
|
|
38
37
|
required: false,
|
|
39
38
|
default: 'value'
|
|
40
39
|
}
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { extend } from '../vue';
|
|
2
|
-
import { PROP_TYPE_BOOLEAN } from '../constants/props';
|
|
3
2
|
import { isBoolean } from '../utils/inspect';
|
|
4
3
|
import { safeVueInstance } from '../utils/safe-vue-instance';
|
|
5
4
|
|
|
@@ -17,7 +16,7 @@ import { safeVueInstance } from '../utils/safe-vue-instance';
|
|
|
17
16
|
const props = {
|
|
18
17
|
// Tri-state prop: true, false, null (or undefined)
|
|
19
18
|
state: {
|
|
20
|
-
type:
|
|
19
|
+
type: Boolean,
|
|
21
20
|
required: false,
|
|
22
21
|
default: null
|
|
23
22
|
}
|
|
@@ -1,10 +1,8 @@
|
|
|
1
1
|
import { extend } from '../vue';
|
|
2
|
-
import {
|
|
3
|
-
import { PROP_TYPE_NUMBER_STRING, PROP_TYPE_BOOLEAN, PROP_TYPE_STRING, PROP_TYPE_NUMBER, PROP_TYPE_FUNCTION } from '../constants/props';
|
|
2
|
+
import { EVENT_NAME_INPUT, EVENT_NAME_CHANGE, EVENT_NAME_BLUR, EVENT_NAME_UPDATE } from '../constants/events';
|
|
4
3
|
import { attemptFocus, attemptBlur } from '../utils/dom';
|
|
5
4
|
import { stopEvent } from '../utils/events';
|
|
6
5
|
import { mathMax } from '../utils/math';
|
|
7
|
-
import { makeModelMixin } from '../utils/model';
|
|
8
6
|
import { toInteger, toFloat } from '../utils/number';
|
|
9
7
|
import { sortKeys } from '../utils/object';
|
|
10
8
|
import { isFunction } from '../utils/inspect';
|
|
@@ -12,75 +10,70 @@ import { toString } from '../utils/string';
|
|
|
12
10
|
|
|
13
11
|
// --- Constants ---
|
|
14
12
|
|
|
15
|
-
const
|
|
16
|
-
|
|
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
|
-
});
|
|
13
|
+
const MODEL_PROP_NAME = 'value';
|
|
14
|
+
const MODEL_EVENT_NAME = EVENT_NAME_UPDATE;
|
|
25
15
|
|
|
26
16
|
// --- Props ---
|
|
27
17
|
|
|
28
18
|
const props = sortKeys({
|
|
29
|
-
|
|
19
|
+
[MODEL_PROP_NAME]: {
|
|
20
|
+
type: [Number, String],
|
|
21
|
+
default: ''
|
|
22
|
+
},
|
|
30
23
|
ariaInvalid: {
|
|
31
|
-
type: [
|
|
24
|
+
type: [Boolean, String],
|
|
32
25
|
required: false,
|
|
33
26
|
default: false
|
|
34
27
|
},
|
|
35
28
|
autocomplete: {
|
|
36
|
-
type:
|
|
29
|
+
type: String,
|
|
37
30
|
required: false,
|
|
38
31
|
default: undefined
|
|
39
32
|
},
|
|
40
33
|
// Debounce timeout (in ms). Not applicable with `lazy` prop
|
|
41
34
|
debounce: {
|
|
42
|
-
type: [
|
|
35
|
+
type: [Number, String],
|
|
43
36
|
required: false,
|
|
44
37
|
default: 0
|
|
45
38
|
},
|
|
46
39
|
formatter: {
|
|
47
|
-
type:
|
|
40
|
+
type: Function,
|
|
48
41
|
required: false,
|
|
49
42
|
default: undefined
|
|
50
43
|
},
|
|
51
44
|
// Only update the `v-model` on blur/change events
|
|
52
45
|
lazy: {
|
|
53
|
-
type:
|
|
46
|
+
type: Boolean,
|
|
54
47
|
required: false,
|
|
55
48
|
default: false
|
|
56
49
|
},
|
|
57
50
|
lazyFormatter: {
|
|
58
|
-
type:
|
|
51
|
+
type: Boolean,
|
|
59
52
|
required: false,
|
|
60
53
|
default: false
|
|
61
54
|
},
|
|
62
55
|
number: {
|
|
63
|
-
type:
|
|
56
|
+
type: Boolean,
|
|
64
57
|
required: false,
|
|
65
58
|
default: false
|
|
66
59
|
},
|
|
67
60
|
placeholder: {
|
|
68
|
-
type:
|
|
61
|
+
type: String,
|
|
69
62
|
required: false,
|
|
70
63
|
default: undefined
|
|
71
64
|
},
|
|
72
65
|
plaintext: {
|
|
73
|
-
type:
|
|
66
|
+
type: Boolean,
|
|
74
67
|
required: false,
|
|
75
68
|
default: false
|
|
76
69
|
},
|
|
77
70
|
readonly: {
|
|
78
|
-
type:
|
|
71
|
+
type: Boolean,
|
|
79
72
|
required: false,
|
|
80
73
|
default: false
|
|
81
74
|
},
|
|
82
75
|
trim: {
|
|
83
|
-
type:
|
|
76
|
+
type: Boolean,
|
|
84
77
|
required: false,
|
|
85
78
|
default: false
|
|
86
79
|
}
|
|
@@ -90,7 +83,10 @@ const props = sortKeys({
|
|
|
90
83
|
|
|
91
84
|
// @vue/component
|
|
92
85
|
const formTextMixin = extend({
|
|
93
|
-
|
|
86
|
+
model: {
|
|
87
|
+
prop: MODEL_PROP_NAME,
|
|
88
|
+
event: MODEL_EVENT_NAME
|
|
89
|
+
},
|
|
94
90
|
props,
|
|
95
91
|
data() {
|
|
96
92
|
const value = this[MODEL_PROP_NAME];
|
|
@@ -101,10 +97,8 @@ const formTextMixin = extend({
|
|
|
101
97
|
},
|
|
102
98
|
computed: {
|
|
103
99
|
computedClass() {
|
|
104
|
-
const
|
|
105
|
-
|
|
106
|
-
type
|
|
107
|
-
} = this;
|
|
100
|
+
const plaintext = this.plaintext,
|
|
101
|
+
type = this.type;
|
|
108
102
|
const isRange = type === 'range';
|
|
109
103
|
const isColor = type === 'color';
|
|
110
104
|
return [{
|
|
@@ -173,9 +167,7 @@ const formTextMixin = extend({
|
|
|
173
167
|
},
|
|
174
168
|
updateValue(value) {
|
|
175
169
|
let force = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
|
|
176
|
-
const
|
|
177
|
-
lazy
|
|
178
|
-
} = this;
|
|
170
|
+
const lazy = this.lazy;
|
|
179
171
|
if (lazy && !force) {
|
|
180
172
|
return;
|
|
181
173
|
}
|
|
@@ -222,9 +214,7 @@ const formTextMixin = extend({
|
|
|
222
214
|
if (event.target.composing) {
|
|
223
215
|
return;
|
|
224
216
|
}
|
|
225
|
-
const
|
|
226
|
-
value
|
|
227
|
-
} = event.target;
|
|
217
|
+
const value = event.target.value;
|
|
228
218
|
const formattedValue = this.formatValue(value, event);
|
|
229
219
|
// Exit when the `formatter` function strictly returned `false`
|
|
230
220
|
// or prevented the input event
|
|
@@ -240,9 +230,7 @@ const formTextMixin = extend({
|
|
|
240
230
|
this.$emit(EVENT_NAME_INPUT, formattedValue);
|
|
241
231
|
},
|
|
242
232
|
onChange(event) {
|
|
243
|
-
const
|
|
244
|
-
value
|
|
245
|
-
} = event.target;
|
|
233
|
+
const value = event.target.value;
|
|
246
234
|
const formattedValue = this.formatValue(value, event);
|
|
247
235
|
// Exit when the `formatter` function strictly returned `false`
|
|
248
236
|
// or prevented the input event
|
|
@@ -260,9 +248,7 @@ const formTextMixin = extend({
|
|
|
260
248
|
onBlur(event) {
|
|
261
249
|
// Apply the `localValue` on blur to prevent cursor jumps
|
|
262
250
|
// on mobile browsers (e.g. caused by autocomplete)
|
|
263
|
-
const
|
|
264
|
-
value
|
|
265
|
-
} = event.target;
|
|
251
|
+
const value = event.target.value;
|
|
266
252
|
const formattedValue = this.formatValue(value, event, true);
|
|
267
253
|
if (formattedValue !== false) {
|
|
268
254
|
// We need to use the modified value here to apply the
|
|
@@ -290,4 +276,4 @@ const formTextMixin = extend({
|
|
|
290
276
|
}
|
|
291
277
|
});
|
|
292
278
|
|
|
293
|
-
export {
|
|
279
|
+
export { formTextMixin, props };
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { extend, COMPONENT_UID_KEY } from '../vue';
|
|
2
|
-
import { PROP_TYPE_STRING } from '../constants/props';
|
|
3
2
|
|
|
4
3
|
// SSR safe client-side ID attribute generation
|
|
5
4
|
// ID's can only be generated client-side, after mount
|
|
@@ -9,7 +8,7 @@ import { PROP_TYPE_STRING } from '../constants/props';
|
|
|
9
8
|
|
|
10
9
|
const props = {
|
|
11
10
|
id: {
|
|
12
|
-
type:
|
|
11
|
+
type: String,
|
|
13
12
|
required: false,
|
|
14
13
|
default: undefined
|
|
15
14
|
}
|
|
@@ -1,5 +1,54 @@
|
|
|
1
1
|
import { isVue3 } from '../vue';
|
|
2
2
|
|
|
3
|
+
function _arrayLikeToArray(r, a) {
|
|
4
|
+
(null == a || a > r.length) && (a = r.length);
|
|
5
|
+
for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e];
|
|
6
|
+
return n;
|
|
7
|
+
}
|
|
8
|
+
function _arrayWithHoles(r) {
|
|
9
|
+
if (Array.isArray(r)) return r;
|
|
10
|
+
}
|
|
11
|
+
function _iterableToArrayLimit(r, l) {
|
|
12
|
+
var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"];
|
|
13
|
+
if (null != t) {
|
|
14
|
+
var e,
|
|
15
|
+
n,
|
|
16
|
+
i,
|
|
17
|
+
u,
|
|
18
|
+
a = [],
|
|
19
|
+
f = !0,
|
|
20
|
+
o = !1;
|
|
21
|
+
try {
|
|
22
|
+
if (i = (t = t.call(r)).next, 0 === l) {
|
|
23
|
+
if (Object(t) !== t) return;
|
|
24
|
+
f = !1;
|
|
25
|
+
} else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0);
|
|
26
|
+
} catch (r) {
|
|
27
|
+
o = !0, n = r;
|
|
28
|
+
} finally {
|
|
29
|
+
try {
|
|
30
|
+
if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return;
|
|
31
|
+
} finally {
|
|
32
|
+
if (o) throw n;
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
return a;
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
function _nonIterableRest() {
|
|
39
|
+
throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
40
|
+
}
|
|
41
|
+
function _slicedToArray(r, e) {
|
|
42
|
+
return _arrayWithHoles(r) || _iterableToArrayLimit(r, e) || _unsupportedIterableToArray(r, e) || _nonIterableRest();
|
|
43
|
+
}
|
|
44
|
+
function _unsupportedIterableToArray(r, a) {
|
|
45
|
+
if (r) {
|
|
46
|
+
if ("string" == typeof r) return _arrayLikeToArray(r, a);
|
|
47
|
+
var t = {}.toString.call(r).slice(8, -1);
|
|
48
|
+
return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0;
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
|
|
3
52
|
// Regex to detect event handler props: onSomething or onSomethingOnce
|
|
4
53
|
const EVENT_HANDLER_RE = /^on([A-Z][a-zA-Z]*)$/;
|
|
5
54
|
const ONCE_SUFFIX = 'Once';
|
|
@@ -13,9 +62,9 @@ const ONCE_SUFFIX = 'Once';
|
|
|
13
62
|
* @returns {string} The handler prop name (e.g., 'onHidden', 'onHiddenOnce')
|
|
14
63
|
*/
|
|
15
64
|
const eventProp = function (eventName) {
|
|
16
|
-
let {
|
|
17
|
-
once =
|
|
18
|
-
|
|
65
|
+
let _ref = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {},
|
|
66
|
+
_ref$once = _ref.once,
|
|
67
|
+
once = _ref$once === void 0 ? false : _ref$once;
|
|
19
68
|
const capitalized = eventName.charAt(0).toUpperCase() + eventName.slice(1);
|
|
20
69
|
return `on${capitalized}${once ? ONCE_SUFFIX : ''}`;
|
|
21
70
|
};
|
|
@@ -81,8 +130,9 @@ const resolveComponentOptions = Component => {
|
|
|
81
130
|
...Component
|
|
82
131
|
};
|
|
83
132
|
if (opts.directives) {
|
|
84
|
-
opts.directives = Object.fromEntries(Object.entries(opts.directives).filter(
|
|
85
|
-
let
|
|
133
|
+
opts.directives = Object.fromEntries(Object.entries(opts.directives).filter(_ref2 => {
|
|
134
|
+
let _ref3 = _slicedToArray(_ref2, 1),
|
|
135
|
+
key = _ref3[0];
|
|
86
136
|
return !BUILTIN_DIRECTIVES.includes(key);
|
|
87
137
|
}));
|
|
88
138
|
}
|
|
@@ -107,10 +157,9 @@ const createNewChildComponent = function (parent, Component) {
|
|
|
107
157
|
}
|
|
108
158
|
|
|
109
159
|
// Vue 2: extract handlers and subscribe manually after creation
|
|
110
|
-
const
|
|
111
|
-
handlers,
|
|
112
|
-
cleanConfig
|
|
113
|
-
} = extractEventHandlers(config);
|
|
160
|
+
const _extractEventHandlers = extractEventHandlers(config),
|
|
161
|
+
handlers = _extractEventHandlers.handlers,
|
|
162
|
+
cleanConfig = _extractEventHandlers.cleanConfig;
|
|
114
163
|
const instance = new Component({
|
|
115
164
|
...cleanConfig,
|
|
116
165
|
parent,
|
|
@@ -119,12 +168,10 @@ const createNewChildComponent = function (parent, Component) {
|
|
|
119
168
|
});
|
|
120
169
|
|
|
121
170
|
// Subscribe to events using $on/$once
|
|
122
|
-
handlers.forEach(
|
|
123
|
-
let
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
once
|
|
127
|
-
} = _ref2;
|
|
171
|
+
handlers.forEach(_ref4 => {
|
|
172
|
+
let eventName = _ref4.eventName,
|
|
173
|
+
handler = _ref4.handler,
|
|
174
|
+
once = _ref4.once;
|
|
128
175
|
instance[once ? '$once' : '$on'](eventName, handler);
|
|
129
176
|
});
|
|
130
177
|
return instance;
|
|
@@ -50,9 +50,7 @@ const isElement = el => !!(el && el.nodeType === Node.ELEMENT_NODE);
|
|
|
50
50
|
// Get the currently active HTML element
|
|
51
51
|
const getActiveElement = function () {
|
|
52
52
|
let excludes = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
|
|
53
|
-
const
|
|
54
|
-
activeElement
|
|
55
|
-
} = DOCUMENT;
|
|
53
|
+
const activeElement = DOCUMENT.activeElement;
|
|
56
54
|
return activeElement && !excludes.some(el => el === activeElement) ? activeElement : null;
|
|
57
55
|
};
|
|
58
56
|
|
|
@@ -199,9 +197,7 @@ const getBCR = el => isElement(el) ? el.getBoundingClientRect() : null;
|
|
|
199
197
|
// Get computed style object for an element
|
|
200
198
|
/* istanbul ignore next: getComputedStyle() doesn't work in JSDOM */
|
|
201
199
|
const getCS = el => {
|
|
202
|
-
const
|
|
203
|
-
getComputedStyle
|
|
204
|
-
} = WINDOW;
|
|
200
|
+
const getComputedStyle = WINDOW.getComputedStyle;
|
|
205
201
|
return getComputedStyle && isElement(el) ? getComputedStyle(el) : {};
|
|
206
202
|
};
|
|
207
203
|
|
|
@@ -209,9 +205,7 @@ const getCS = el => {
|
|
|
209
205
|
// Returns `null` if no window support is given
|
|
210
206
|
/* istanbul ignore next: getSelection() doesn't work in JSDOM */
|
|
211
207
|
const getSel = () => {
|
|
212
|
-
const
|
|
213
|
-
getSelection
|
|
214
|
-
} = WINDOW;
|
|
208
|
+
const getSelection = WINDOW.getSelection;
|
|
215
209
|
return getSelection ? WINDOW.getSelection() : null;
|
|
216
210
|
};
|
|
217
211
|
|
|
@@ -46,11 +46,13 @@ const eventOnOff = function (on) {
|
|
|
46
46
|
|
|
47
47
|
// Utility method to prevent the default event handling and propagation
|
|
48
48
|
const stopEvent = function (event) {
|
|
49
|
-
let {
|
|
50
|
-
preventDefault =
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
49
|
+
let _ref = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {},
|
|
50
|
+
_ref$preventDefault = _ref.preventDefault,
|
|
51
|
+
preventDefault = _ref$preventDefault === void 0 ? true : _ref$preventDefault,
|
|
52
|
+
_ref$propagation = _ref.propagation,
|
|
53
|
+
propagation = _ref$propagation === void 0 ? true : _ref$propagation,
|
|
54
|
+
_ref$immediatePropaga = _ref.immediatePropagation,
|
|
55
|
+
immediatePropagation = _ref$immediatePropaga === void 0 ? false : _ref$immediatePropaga;
|
|
54
56
|
if (preventDefault) {
|
|
55
57
|
event.preventDefault();
|
|
56
58
|
}
|
|
@@ -7,11 +7,10 @@ import { setConfig } from './config-set';
|
|
|
7
7
|
* @returns {function} plugin install function
|
|
8
8
|
*/
|
|
9
9
|
const installFactory = function () {
|
|
10
|
-
let {
|
|
11
|
-
components,
|
|
12
|
-
directives,
|
|
13
|
-
plugins
|
|
14
|
-
} = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
10
|
+
let _ref = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
|
|
11
|
+
components = _ref.components,
|
|
12
|
+
directives = _ref.directives,
|
|
13
|
+
plugins = _ref.plugins;
|
|
15
14
|
const install = function (Vue) {
|
|
16
15
|
let config = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
17
16
|
if (install.installed) {
|