@gitlab/ui 37.3.0 → 37.4.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/CHANGELOG.md +22 -0
- package/dist/components/base/filtered_search/filtered_search_term.js +6 -1
- package/dist/components/base/filtered_search/filtered_search_token_segment.js +10 -1
- package/dist/components/base/form/form_group/form_group.documentation.js +2 -6
- package/dist/components/base/search_box_by_click/search_box_by_click.documentation.js +2 -80
- package/dist/components/base/search_box_by_click/search_box_by_click.js +60 -1
- package/dist/components/base/search_box_by_type/search_box_by_type.documentation.js +2 -20
- package/dist/components/base/search_box_by_type/search_box_by_type.js +19 -5
- package/dist/directives/hover_load/hover_load.documentation.js +1 -1
- package/dist/directives/resize_observer/resize_observer.documentation.js +2 -5
- package/dist/index.css +1 -1
- package/dist/index.css.map +1 -1
- package/documentation/documented_stories.js +5 -0
- package/package.json +1 -1
- package/src/components/base/button/button.scss +5 -9
- package/src/components/base/filtered_search/filtered_search.spec.js +12 -0
- package/src/components/base/filtered_search/filtered_search_term.spec.js +8 -2
- package/src/components/base/filtered_search/filtered_search_term.vue +6 -0
- package/src/components/base/filtered_search/filtered_search_token_segment.spec.js +46 -37
- package/src/components/base/filtered_search/filtered_search_token_segment.vue +14 -1
- package/src/components/base/form/form_group/form_group.documentation.js +0 -3
- package/src/components/base/form/form_group/form_group.md +0 -2
- package/src/components/base/form/form_group/form_group.stories.js +106 -145
- package/src/components/base/form/form_select/form_select.spec.js +8 -4
- package/src/components/base/search_box_by_click/search_box_by_click.documentation.js +0 -90
- package/src/components/base/search_box_by_click/search_box_by_click.md +0 -2
- package/src/components/base/search_box_by_click/search_box_by_click.stories.js +91 -48
- package/src/components/base/search_box_by_click/search_box_by_click.vue +50 -1
- package/src/components/base/search_box_by_type/search_box_by_type.documentation.js +0 -18
- package/src/components/base/search_box_by_type/search_box_by_type.md +0 -2
- package/src/components/base/search_box_by_type/search_box_by_type.stories.js +49 -43
- package/src/components/base/search_box_by_type/search_box_by_type.vue +16 -6
- package/src/directives/hover_load/hover_load.md +0 -2
- package/src/directives/hover_load/hover_load.stories.js +39 -34
- package/src/directives/resize_observer/resize_observer.documentation.js +0 -2
- package/src/directives/resize_observer/resize_observer.md +0 -6
- package/src/directives/resize_observer/resize_observer.stories.js +70 -51
- package/dist/components/base/form/form_group/examples/form_group/form_group.basic.example.js +0 -38
- package/dist/components/base/form/form_group/examples/form_group/form_group.disabled.example.js +0 -48
- package/dist/components/base/form/form_group/examples/form_group/form_group.textarea.example.js +0 -48
- package/dist/components/base/form/form_group/examples/form_group/form_group.validation.example.js +0 -66
- package/dist/components/base/form/form_group/examples/form_group/index.js +0 -27
- package/dist/components/base/search_box_by_click/examples/index.js +0 -22
- package/dist/components/base/search_box_by_click/examples/search_box_by_click.default.example.js +0 -48
- package/dist/components/base/search_box_by_click/examples/search_box_by_click.history.example.js +0 -51
- package/dist/components/base/search_box_by_click/examples/search_box_by_click.v_model.example.js +0 -54
- package/dist/components/base/search_box_by_type/examples/index.js +0 -17
- package/dist/components/base/search_box_by_type/examples/search_box_by_type.default.example.js +0 -48
- package/dist/components/base/search_box_by_type/examples/search_box_by_type.loading.example.js +0 -65
- package/dist/directives/resize_observer/examples/index.js +0 -12
- package/dist/directives/resize_observer/examples/resize_observer.basic.example.js +0 -62
- package/src/components/base/form/form_group/examples/form_group/form_group.basic.example.vue +0 -11
- package/src/components/base/form/form_group/examples/form_group/form_group.disabled.example.vue +0 -21
- package/src/components/base/form/form_group/examples/form_group/form_group.textarea.example.vue +0 -15
- package/src/components/base/form/form_group/examples/form_group/form_group.validation.example.vue +0 -36
- package/src/components/base/form/form_group/examples/form_group/index.js +0 -32
- package/src/components/base/search_box_by_click/examples/index.js +0 -26
- package/src/components/base/search_box_by_click/examples/search_box_by_click.default.example.vue +0 -14
- package/src/components/base/search_box_by_click/examples/search_box_by_click.history.example.vue +0 -23
- package/src/components/base/search_box_by_click/examples/search_box_by_click.v_model.example.vue +0 -23
- package/src/components/base/search_box_by_type/examples/index.js +0 -20
- package/src/components/base/search_box_by_type/examples/search_box_by_type.default.example.vue +0 -14
- package/src/components/base/search_box_by_type/examples/search_box_by_type.loading.example.vue +0 -34
- package/src/directives/resize_observer/examples/index.js +0 -14
- package/src/directives/resize_observer/examples/resize_observer.basic.example.vue +0 -21
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,25 @@
|
|
|
1
|
+
## [37.4.2](https://gitlab.com/gitlab-org/gitlab-ui/compare/v37.4.1...v37.4.2) (2022-03-09)
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
### Bug Fixes
|
|
5
|
+
|
|
6
|
+
* **GlFilteredSearch:** fix duplicate input attributes ([ea498b9](https://gitlab.com/gitlab-org/gitlab-ui/commit/ea498b9d114c86804d2885b645770ce53d178f4d))
|
|
7
|
+
|
|
8
|
+
## [37.4.1](https://gitlab.com/gitlab-org/gitlab-ui/compare/v37.4.0...v37.4.1) (2022-03-07)
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
### Bug Fixes
|
|
12
|
+
|
|
13
|
+
* **danger:** fix conventional commits url ([7ec70ef](https://gitlab.com/gitlab-org/gitlab-ui/commit/7ec70efae259272d2bd19654eaab64a33ab98fad))
|
|
14
|
+
|
|
15
|
+
# [37.4.0](https://gitlab.com/gitlab-org/gitlab-ui/compare/v37.3.0...v37.4.0) (2022-03-07)
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
### Features
|
|
19
|
+
|
|
20
|
+
* **GlButton:** Update selected state background ([b9e3116](https://gitlab.com/gitlab-org/gitlab-ui/commit/b9e31166ee8a43c2ea09c2f4a9cafd9e71e222d8))
|
|
21
|
+
* **GlButton:** Update selected state design ([a5ebf70](https://gitlab.com/gitlab-org/gitlab-ui/commit/a5ebf701e38fd32ff965af33c30319e4c7f2edc5))
|
|
22
|
+
|
|
1
23
|
# [37.3.0](https://gitlab.com/gitlab-org/gitlab-ui/compare/v37.2.0...v37.3.0) (2022-03-03)
|
|
2
24
|
|
|
3
25
|
|
|
@@ -39,6 +39,11 @@ var script = {
|
|
|
39
39
|
type: Boolean,
|
|
40
40
|
required: false,
|
|
41
41
|
default: false
|
|
42
|
+
},
|
|
43
|
+
currentValue: {
|
|
44
|
+
type: Array,
|
|
45
|
+
required: false,
|
|
46
|
+
default: () => []
|
|
42
47
|
}
|
|
43
48
|
},
|
|
44
49
|
computed: {
|
|
@@ -65,7 +70,7 @@ var script = {
|
|
|
65
70
|
const __vue_script__ = script;
|
|
66
71
|
|
|
67
72
|
/* template */
|
|
68
|
-
var __vue_render__ = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',{staticClass:"gl-h-auto gl-filtered-search-term"},[_c('gl-filtered-search-token-segment',{staticClass:"gl-filtered-search-term-token",class:{ 'gl-w-full': _vm.placeholder },attrs:{"active":_vm.active,"search-input-attributes":_vm.searchInputAttributes,"is-last-token":_vm.isLastToken},on:{"activate":function($event){return _vm.$emit('activate')},"deactivate":function($event){return _vm.$emit('deactivate')},"complete":function($event){return _vm.$emit('replace', { type: $event })},"backspace":function($event){return _vm.$emit('destroy')},"submit":function($event){return _vm.$emit('submit')},"split":function($event){return _vm.$emit('split', $event)}},scopedSlots:_vm._u([{key:"suggestions",fn:function(){return _vm._l((_vm.suggestedTokens),function(item,idx){return _c('gl-filtered-search-suggestion',{key:idx,attrs:{"value":item.type,"icon-name":item.icon}},[_vm._v("\n "+_vm._s(item.title)+"\n ")])})},proxy:true},{key:"view",fn:function(){return [(_vm.placeholder)?_c('input',_vm._b({staticClass:"gl-filtered-search-term-input",attrs:{"placeholder":_vm.placeholder,"aria-label":_vm.placeholder}},'input',_vm.searchInputAttributes,false)):[_vm._v(_vm._s(_vm.value.data))]]},proxy:true}]),model:{value:(_vm.internalValue),callback:function ($$v) {_vm.internalValue=$$v;},expression:"internalValue"}})],1)};
|
|
73
|
+
var __vue_render__ = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',{staticClass:"gl-h-auto gl-filtered-search-term"},[_c('gl-filtered-search-token-segment',{staticClass:"gl-filtered-search-term-token",class:{ 'gl-w-full': _vm.placeholder },attrs:{"active":_vm.active,"search-input-attributes":_vm.searchInputAttributes,"is-last-token":_vm.isLastToken,"current-value":_vm.currentValue},on:{"activate":function($event){return _vm.$emit('activate')},"deactivate":function($event){return _vm.$emit('deactivate')},"complete":function($event){return _vm.$emit('replace', { type: $event })},"backspace":function($event){return _vm.$emit('destroy')},"submit":function($event){return _vm.$emit('submit')},"split":function($event){return _vm.$emit('split', $event)}},scopedSlots:_vm._u([{key:"suggestions",fn:function(){return _vm._l((_vm.suggestedTokens),function(item,idx){return _c('gl-filtered-search-suggestion',{key:idx,attrs:{"value":item.type,"icon-name":item.icon}},[_vm._v("\n "+_vm._s(item.title)+"\n ")])})},proxy:true},{key:"view",fn:function(){return [(_vm.placeholder)?_c('input',_vm._b({staticClass:"gl-filtered-search-term-input",attrs:{"placeholder":_vm.placeholder,"aria-label":_vm.placeholder}},'input',_vm.searchInputAttributes,false)):[_vm._v(_vm._s(_vm.value.data))]]},proxy:true}]),model:{value:(_vm.internalValue),callback:function ($$v) {_vm.internalValue=$$v;},expression:"internalValue"}})],1)};
|
|
69
74
|
var __vue_staticRenderFns__ = [];
|
|
70
75
|
|
|
71
76
|
/* style */
|
|
@@ -58,6 +58,11 @@ var script = {
|
|
|
58
58
|
type: Boolean,
|
|
59
59
|
required: false,
|
|
60
60
|
default: false
|
|
61
|
+
},
|
|
62
|
+
currentValue: {
|
|
63
|
+
type: Array,
|
|
64
|
+
required: false,
|
|
65
|
+
default: () => []
|
|
61
66
|
}
|
|
62
67
|
},
|
|
63
68
|
|
|
@@ -113,6 +118,10 @@ var script = {
|
|
|
113
118
|
|
|
114
119
|
const defaultSuggestion = this.options.find(op => op.default);
|
|
115
120
|
return (_ref = defaultSuggestion !== null && defaultSuggestion !== void 0 ? defaultSuggestion : this.options[0]) === null || _ref === void 0 ? void 0 : _ref.value;
|
|
121
|
+
},
|
|
122
|
+
|
|
123
|
+
containerAttributes() {
|
|
124
|
+
return this.isLastToken && !this.active && this.currentValue.length > 1 && this.searchInputAttributes;
|
|
116
125
|
}
|
|
117
126
|
|
|
118
127
|
},
|
|
@@ -284,7 +293,7 @@ var script = {
|
|
|
284
293
|
const __vue_script__ = script;
|
|
285
294
|
|
|
286
295
|
/* template */
|
|
287
|
-
var __vue_render__ = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',_vm._b({staticClass:"gl-filtered-search-token-segment",class:{ 'gl-filtered-search-token-segment-active': _vm.active },attrs:{"data-testid":"filtered-search-token-segment"},on:{"mousedown":function($event){if(!$event.type.indexOf('key')&&_vm._k($event.keyCode,"left",37,$event.key,["Left","ArrowLeft"])){ return null; }if('button' in $event && $event.button !== 0){ return null; }return _vm.emitIfInactive($event)}}},'div',_vm.
|
|
296
|
+
var __vue_render__ = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',_vm._b({staticClass:"gl-filtered-search-token-segment",class:{ 'gl-filtered-search-token-segment-active': _vm.active },attrs:{"data-testid":"filtered-search-token-segment"},on:{"mousedown":function($event){if(!$event.type.indexOf('key')&&_vm._k($event.keyCode,"left",37,$event.key,["Left","ArrowLeft"])){ return null; }if('button' in $event && $event.button !== 0){ return null; }return _vm.emitIfInactive($event)}}},'div',_vm.containerAttributes,false),[(_vm.active)?[(((_vm.searchInputAttributes).type)==='checkbox')?_c('input',_vm._b({directives:[{name:"model",rawName:"v-model",value:(_vm.inputValue),expression:"inputValue"}],ref:"input",staticClass:"gl-filtered-search-token-segment-input",attrs:{"aria-label":_vm.label,"type":"checkbox"},domProps:{"checked":Array.isArray(_vm.inputValue)?_vm._i(_vm.inputValue,null)>-1:(_vm.inputValue)},on:{"keydown":_vm.handleInputKeydown,"blur":_vm.handleBlur,"change":function($event){var $$a=_vm.inputValue,$$el=$event.target,$$c=$$el.checked?(true):(false);if(Array.isArray($$a)){var $$v=null,$$i=_vm._i($$a,$$v);if($$el.checked){$$i<0&&(_vm.inputValue=$$a.concat([$$v]));}else {$$i>-1&&(_vm.inputValue=$$a.slice(0,$$i).concat($$a.slice($$i+1)));}}else {_vm.inputValue=$$c;}}}},'input',_vm.searchInputAttributes,false)):(((_vm.searchInputAttributes).type)==='radio')?_c('input',_vm._b({directives:[{name:"model",rawName:"v-model",value:(_vm.inputValue),expression:"inputValue"}],ref:"input",staticClass:"gl-filtered-search-token-segment-input",attrs:{"aria-label":_vm.label,"type":"radio"},domProps:{"checked":_vm._q(_vm.inputValue,null)},on:{"keydown":_vm.handleInputKeydown,"blur":_vm.handleBlur,"change":function($event){_vm.inputValue=null;}}},'input',_vm.searchInputAttributes,false)):_c('input',_vm._b({directives:[{name:"model",rawName:"v-model",value:(_vm.inputValue),expression:"inputValue"}],ref:"input",staticClass:"gl-filtered-search-token-segment-input",attrs:{"aria-label":_vm.label,"type":(_vm.searchInputAttributes).type},domProps:{"value":(_vm.inputValue)},on:{"keydown":_vm.handleInputKeydown,"blur":_vm.handleBlur,"input":function($event){if($event.target.composing){ return; }_vm.inputValue=$event.target.value;}}},'input',_vm.searchInputAttributes,false)),_vm._v(" "),_c('portal',{key:("operator-" + _vm._uid),attrs:{"to":_vm.portalName}},[(_vm.hasOptionsOrSuggestions)?_c('gl-filtered-search-suggestion-list',{key:("operator-" + _vm._uid),ref:"suggestions",attrs:{"initial-value":_vm.defaultSuggestedValue},on:{"suggestion":_vm.applySuggestion}},[(_vm.options)?_vm._l((_vm.options),function(option,idx){return _c('gl-filtered-search-suggestion',{key:((option.value) + "-" + idx),attrs:{"value":option.value,"icon-name":option.icon}},[_vm._t("option",[_vm._v("\n "+_vm._s(option[_vm.optionTextField])+"\n ")],null,{ option: option })],2)}):_vm._t("suggestions")],2):_vm._e()],1)]:_vm._t("view",[_vm._v(_vm._s(_vm.inputValue))],null,{ inputValue: _vm.inputValue })],2)};
|
|
288
297
|
var __vue_staticRenderFns__ = [];
|
|
289
298
|
|
|
290
299
|
/* style */
|
|
@@ -1,11 +1,7 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
var description = "# Form Group\n\nForm group adds structure to forms.\n";
|
|
1
|
+
var description = "Form group adds structure to forms.\n";
|
|
4
2
|
|
|
5
3
|
var form_group_documentation = {
|
|
6
|
-
description
|
|
7
|
-
examples,
|
|
8
|
-
bootstrapComponent: 'b-form-group'
|
|
4
|
+
description
|
|
9
5
|
};
|
|
10
6
|
|
|
11
7
|
export default form_group_documentation;
|
|
@@ -1,86 +1,8 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
var description = "# Search Box By Click\n\nProvides a clearable text input with loading state to be used for [search](https://design.gitlab.com/components/search).\n";
|
|
1
|
+
var description = "Provides a clearable text input with loading state to be used for [search](https://design.gitlab.com/components/search).\n";
|
|
4
2
|
|
|
5
3
|
var search_box_by_click_documentation = {
|
|
6
4
|
followsDesignSystem: true,
|
|
7
|
-
description
|
|
8
|
-
examples,
|
|
9
|
-
propsInfo: {
|
|
10
|
-
value: {
|
|
11
|
-
additionalInfo: 'If provided, used as value of search input'
|
|
12
|
-
},
|
|
13
|
-
historyItems: {
|
|
14
|
-
type: Array,
|
|
15
|
-
required: false,
|
|
16
|
-
additionalInfo: 'If provided, used as history items for this component'
|
|
17
|
-
},
|
|
18
|
-
placeholder: {
|
|
19
|
-
type: String,
|
|
20
|
-
required: false,
|
|
21
|
-
additionalInfo: 'If provided, used as history items for this component'
|
|
22
|
-
},
|
|
23
|
-
disabled: {
|
|
24
|
-
type: Boolean,
|
|
25
|
-
required: false,
|
|
26
|
-
additionalInfo: 'If provided and true, disables the input and controls'
|
|
27
|
-
},
|
|
28
|
-
recentSearchesHeader: {
|
|
29
|
-
type: String,
|
|
30
|
-
required: false,
|
|
31
|
-
default: 'Recent searches',
|
|
32
|
-
additionalInfo: 'i18n for recent searches title within history dropdown'
|
|
33
|
-
},
|
|
34
|
-
clearButtonTitle: {
|
|
35
|
-
type: String,
|
|
36
|
-
required: false,
|
|
37
|
-
default: 'Clear',
|
|
38
|
-
additionalInfo: 'i18n for clear button title'
|
|
39
|
-
},
|
|
40
|
-
closeButtonTitle: {
|
|
41
|
-
type: String,
|
|
42
|
-
required: false,
|
|
43
|
-
default: 'Close',
|
|
44
|
-
additionalInfo: 'i18n for close button title within history dropdown'
|
|
45
|
-
},
|
|
46
|
-
clearRecentSearchesText: {
|
|
47
|
-
type: String,
|
|
48
|
-
required: false,
|
|
49
|
-
default: 'Clear recent searches',
|
|
50
|
-
additionalInfo: 'i18n for recent searches clear text'
|
|
51
|
-
},
|
|
52
|
-
tooltipContainer: {
|
|
53
|
-
additionalInfo: 'Container for tooltip. Valid values: DOM node, selector string or `false` for default'
|
|
54
|
-
},
|
|
55
|
-
searchButtonAttributes: {
|
|
56
|
-
additionalInfo: 'HTML attributes to add to the search button'
|
|
57
|
-
}
|
|
58
|
-
},
|
|
59
|
-
events: [{
|
|
60
|
-
event: 'clear',
|
|
61
|
-
description: 'Emitted when search is cleared'
|
|
62
|
-
}, {
|
|
63
|
-
event: 'submit',
|
|
64
|
-
args: [{
|
|
65
|
-
arg: 'value',
|
|
66
|
-
description: 'Search value'
|
|
67
|
-
}],
|
|
68
|
-
description: 'Emitted when search is submitted'
|
|
69
|
-
}, {
|
|
70
|
-
event: 'history-item-selected',
|
|
71
|
-
args: [{
|
|
72
|
-
arg: 'value',
|
|
73
|
-
description: 'History item'
|
|
74
|
-
}],
|
|
75
|
-
description: 'Emitted when item from history is selected'
|
|
76
|
-
}, {
|
|
77
|
-
event: 'clear-history',
|
|
78
|
-
description: 'Emitted when clear history button is clicked'
|
|
79
|
-
}],
|
|
80
|
-
slots: [{
|
|
81
|
-
name: 'history-item',
|
|
82
|
-
description: 'Slot to customize history item in history dropdown. Used only with history-items prop'
|
|
83
|
-
}]
|
|
5
|
+
description
|
|
84
6
|
};
|
|
85
7
|
|
|
86
8
|
export default search_box_by_click_documentation;
|
|
@@ -26,6 +26,9 @@ var script = {
|
|
|
26
26
|
GlTooltip: GlTooltipDirective
|
|
27
27
|
},
|
|
28
28
|
props: {
|
|
29
|
+
/**
|
|
30
|
+
* If provided, used as value of search input
|
|
31
|
+
*/
|
|
29
32
|
value: {
|
|
30
33
|
required: false,
|
|
31
34
|
default: '',
|
|
@@ -33,11 +36,19 @@ var script = {
|
|
|
33
36
|
// so we should not force any specific type for value here
|
|
34
37
|
validator: () => true
|
|
35
38
|
},
|
|
39
|
+
|
|
40
|
+
/**
|
|
41
|
+
* If provided, used as history items for this component
|
|
42
|
+
*/
|
|
36
43
|
historyItems: {
|
|
37
44
|
type: Array,
|
|
38
45
|
required: false,
|
|
39
46
|
default: null
|
|
40
47
|
},
|
|
48
|
+
|
|
49
|
+
/**
|
|
50
|
+
* If provided, used as a placeholder for this component
|
|
51
|
+
*/
|
|
41
52
|
placeholder: {
|
|
42
53
|
type: String,
|
|
43
54
|
required: false,
|
|
@@ -48,26 +59,46 @@ var script = {
|
|
|
48
59
|
required: false,
|
|
49
60
|
default: true
|
|
50
61
|
},
|
|
62
|
+
|
|
63
|
+
/**
|
|
64
|
+
* If provided and true, disables the input and controls
|
|
65
|
+
*/
|
|
51
66
|
disabled: {
|
|
52
67
|
type: Boolean,
|
|
53
68
|
required: false,
|
|
54
69
|
default: false
|
|
55
70
|
},
|
|
71
|
+
|
|
72
|
+
/**
|
|
73
|
+
* i18n for recent searches title within history dropdown
|
|
74
|
+
*/
|
|
56
75
|
recentSearchesHeader: {
|
|
57
76
|
type: String,
|
|
58
77
|
required: false,
|
|
59
78
|
default: 'Recent searches'
|
|
60
79
|
},
|
|
80
|
+
|
|
81
|
+
/**
|
|
82
|
+
* i18n for clear button title
|
|
83
|
+
*/
|
|
61
84
|
clearButtonTitle: {
|
|
62
85
|
type: String,
|
|
63
86
|
required: false,
|
|
64
87
|
default: 'Clear'
|
|
65
88
|
},
|
|
89
|
+
|
|
90
|
+
/**
|
|
91
|
+
* i18n for close button title within history dropdown
|
|
92
|
+
*/
|
|
66
93
|
closeButtonTitle: {
|
|
67
94
|
type: String,
|
|
68
95
|
required: false,
|
|
69
96
|
default: 'Close'
|
|
70
97
|
},
|
|
98
|
+
|
|
99
|
+
/**
|
|
100
|
+
* i18n for recent searches clear text
|
|
101
|
+
*/
|
|
71
102
|
clearRecentSearchesText: {
|
|
72
103
|
type: String,
|
|
73
104
|
required: false,
|
|
@@ -78,11 +109,19 @@ var script = {
|
|
|
78
109
|
required: false,
|
|
79
110
|
default: "You don't have any recent searches"
|
|
80
111
|
},
|
|
112
|
+
|
|
113
|
+
/**
|
|
114
|
+
* Container for tooltip. Valid values: DOM node, selector string or `false` for default
|
|
115
|
+
*/
|
|
81
116
|
tooltipContainer: {
|
|
82
117
|
required: false,
|
|
83
118
|
default: false,
|
|
84
119
|
validator: value => value === false || typeof value === 'string' || value instanceof HTMLElement
|
|
85
120
|
},
|
|
121
|
+
|
|
122
|
+
/**
|
|
123
|
+
* HTML attributes to add to the search button
|
|
124
|
+
*/
|
|
86
125
|
searchButtonAttributes: {
|
|
87
126
|
type: Object,
|
|
88
127
|
required: false,
|
|
@@ -137,11 +176,20 @@ var script = {
|
|
|
137
176
|
},
|
|
138
177
|
|
|
139
178
|
search(value) {
|
|
179
|
+
/**
|
|
180
|
+
* Emitted when search is submitted
|
|
181
|
+
* @property {*} value Search value
|
|
182
|
+
*/
|
|
140
183
|
this.$emit('submit', value);
|
|
141
184
|
},
|
|
142
185
|
|
|
143
186
|
selectHistoryItem(item) {
|
|
144
187
|
this.currentValue = item;
|
|
188
|
+
/**
|
|
189
|
+
* Emitted when item from history is selected
|
|
190
|
+
* @property {*} item History item
|
|
191
|
+
*/
|
|
192
|
+
|
|
145
193
|
this.$emit('history-item-selected', item);
|
|
146
194
|
setTimeout(() => {
|
|
147
195
|
document.activeElement.blur();
|
|
@@ -150,11 +198,22 @@ var script = {
|
|
|
150
198
|
|
|
151
199
|
clearInput() {
|
|
152
200
|
this.currentValue = '';
|
|
201
|
+
/**
|
|
202
|
+
* Emitted when search is cleared
|
|
203
|
+
*/
|
|
204
|
+
|
|
153
205
|
this.$emit('clear');
|
|
154
206
|
|
|
155
207
|
if (this.$refs.input) {
|
|
156
208
|
this.$refs.input.$el.focus();
|
|
157
209
|
}
|
|
210
|
+
},
|
|
211
|
+
|
|
212
|
+
emitClearHistory() {
|
|
213
|
+
/**
|
|
214
|
+
* Emitted when clear history button is clicked
|
|
215
|
+
*/
|
|
216
|
+
this.$emit('clear-history');
|
|
158
217
|
}
|
|
159
218
|
|
|
160
219
|
}
|
|
@@ -164,7 +223,7 @@ var script = {
|
|
|
164
223
|
const __vue_script__ = script;
|
|
165
224
|
|
|
166
225
|
/* template */
|
|
167
|
-
var __vue_render__ = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('gl-form-input-group',{staticClass:"gl-search-box-by-click",scopedSlots:_vm._u([(_vm.historyItems)?{key:"prepend",fn:function(){return [_c('gl-dropdown',{ref:"historyDropdown",staticClass:"gl-search-box-by-click-history",attrs:{"menu-class":"gl-search-box-by-click-menu","category":"secondary","disabled":_vm.disabled},scopedSlots:_vm._u([{key:"button-content",fn:function(){return [_c('gl-icon',{staticClass:"gl-search-box-by-click-history-icon",attrs:{"name":"history"}}),_vm._v(" "),_c('gl-icon',{staticClass:"gl-search-box-by-click-history-icon-chevron",attrs:{"name":"chevron-down"}}),_vm._v(" "),_c('span',{staticClass:"gl-sr-only"},[_vm._v("Toggle history")])]},proxy:true}],null,false,2220989388)},[_vm._v(" "),_c('gl-dropdown-text',{staticClass:"gl-search-box-by-click-history-header"},[_vm._v("\n "+_vm._s(_vm.recentSearchesHeader)+"\n "),_c('gl-button',{directives:[{name:"gl-tooltip",rawName:"v-gl-tooltip.hover",value:({ container: _vm.tooltipContainer }),expression:"{ container: tooltipContainer }",modifiers:{"hover":true}}],ref:"closeHistory",staticClass:"gl-search-box-by-click-close-history-button",attrs:{"title":_vm.closeButtonTitle,"aria-label":_vm.closeButtonTitle,"category":"tertiary","name":"close","icon":"close"},on:{"click":_vm.closeHistoryDropdown}})],1),_vm._v(" "),_c('gl-dropdown-divider'),_vm._v(" "),(_vm.historyItems.length)?[_vm._l((_vm.historyItems),function(item,idx){return _c('gl-dropdown-item',{key:idx,staticClass:"gl-search-box-by-click-history-item",on:{"click":function($event){return _vm.selectHistoryItem(item)}}},[_vm._t("history-item",[_vm._v(_vm._s(item))],{"historyItem":item})],2)}),_vm._v(" "),_c('gl-dropdown-divider'),_vm._v(" "),_c('gl-dropdown-item',{ref:"clearHistory",on:{"click":
|
|
226
|
+
var __vue_render__ = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('gl-form-input-group',{staticClass:"gl-search-box-by-click",scopedSlots:_vm._u([(_vm.historyItems)?{key:"prepend",fn:function(){return [_c('gl-dropdown',{ref:"historyDropdown",staticClass:"gl-search-box-by-click-history",attrs:{"menu-class":"gl-search-box-by-click-menu","category":"secondary","disabled":_vm.disabled},scopedSlots:_vm._u([{key:"button-content",fn:function(){return [_c('gl-icon',{staticClass:"gl-search-box-by-click-history-icon",attrs:{"name":"history"}}),_vm._v(" "),_c('gl-icon',{staticClass:"gl-search-box-by-click-history-icon-chevron",attrs:{"name":"chevron-down"}}),_vm._v(" "),_c('span',{staticClass:"gl-sr-only"},[_vm._v("Toggle history")])]},proxy:true}],null,false,2220989388)},[_vm._v(" "),_c('gl-dropdown-text',{staticClass:"gl-search-box-by-click-history-header"},[_vm._v("\n "+_vm._s(_vm.recentSearchesHeader)+"\n "),_c('gl-button',{directives:[{name:"gl-tooltip",rawName:"v-gl-tooltip.hover",value:({ container: _vm.tooltipContainer }),expression:"{ container: tooltipContainer }",modifiers:{"hover":true}}],ref:"closeHistory",staticClass:"gl-search-box-by-click-close-history-button",attrs:{"title":_vm.closeButtonTitle,"aria-label":_vm.closeButtonTitle,"category":"tertiary","name":"close","icon":"close"},on:{"click":_vm.closeHistoryDropdown}})],1),_vm._v(" "),_c('gl-dropdown-divider'),_vm._v(" "),(_vm.historyItems.length)?[_vm._l((_vm.historyItems),function(item,idx){return _c('gl-dropdown-item',{key:idx,staticClass:"gl-search-box-by-click-history-item",on:{"click":function($event){return _vm.selectHistoryItem(item)}}},[_vm._t("history-item",[_vm._v(_vm._s(item))],{"historyItem":item})],2)}),_vm._v(" "),_c('gl-dropdown-divider'),_vm._v(" "),_c('gl-dropdown-item',{ref:"clearHistory",on:{"click":_vm.emitClearHistory}},[_vm._v(_vm._s(_vm.clearRecentSearchesText))])]:_c('gl-dropdown-text',{staticClass:"gl-search-box-by-click-history-no-searches"},[_vm._v(_vm._s(_vm.noRecentSearchesText))])],2)]},proxy:true}:null,{key:"append",fn:function(){return [_c('gl-button',_vm._b({ref:"searchButton",staticClass:"gl-search-box-by-click-search-button",attrs:{"icon":"search","disabled":_vm.disabled,"aria-label":"Search","data-testid":"search-button"},on:{"click":function($event){return _vm.search(_vm.currentValue)}}},'gl-button',_vm.searchButtonAttributes,false))]},proxy:true}],null,true)},[_vm._v(" "),_vm._t("input",[_c('gl-form-input',_vm._b({ref:"input",staticClass:"gl-search-box-by-click-input",attrs:{"disabled":_vm.disabled},on:{"focus":function($event){_vm.isFocused = true;},"blur":function($event){_vm.isFocused = false;},"keydown":function($event){if(!$event.type.indexOf('key')&&_vm._k($event.keyCode,"enter",13,$event.key,"Enter")){ return null; }return _vm.search(_vm.currentValue)}},model:{value:(_vm.currentValue),callback:function ($$v) {_vm.currentValue=$$v;},expression:"currentValue"}},'gl-form-input',_vm.inputAttributes,false))]),_vm._v(" "),(_vm.clearable && _vm.hasValue && !_vm.disabled)?_c('gl-clear-icon-button',{staticClass:"gl-search-box-by-click-icon-button gl-search-box-by-click-clear-button gl-clear-icon-button",attrs:{"title":_vm.clearButtonTitle,"tooltip-container":_vm.tooltipContainer,"data-testid":"filtered-search-clear-button"},on:{"click":_vm.clearInput}}):_vm._e()],2)};
|
|
168
227
|
var __vue_staticRenderFns__ = [];
|
|
169
228
|
|
|
170
229
|
/* style */
|
|
@@ -1,26 +1,8 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
var description = "# Search Box By Type\n\nProvides a clearable text input with loading state to be used for [search](https://design.gitlab.com/components/search).\n";
|
|
1
|
+
var description = "Provides a clearable text input with loading state to be used for [search](https://design.gitlab.com/components/search).\n";
|
|
4
2
|
|
|
5
3
|
var search_box_by_type_documentation = {
|
|
6
4
|
followsDesignSystem: true,
|
|
7
|
-
description
|
|
8
|
-
propsInfo: {
|
|
9
|
-
value: {
|
|
10
|
-
additionalInfo: 'If provided, used as value of search input'
|
|
11
|
-
},
|
|
12
|
-
disabled: {
|
|
13
|
-
additionalInfo: 'If provided and true, disables the input and controls'
|
|
14
|
-
},
|
|
15
|
-
isLoading: {
|
|
16
|
-
additionalInfo: 'Puts search box into loading state, rendering spinner'
|
|
17
|
-
},
|
|
18
|
-
tooltipContainer: {
|
|
19
|
-
additionalInfo: 'Container for tooltip. Valid values: DOM node, selector string or `false` for default'
|
|
20
|
-
}
|
|
21
|
-
},
|
|
22
|
-
examples,
|
|
23
|
-
bootstrapComponent: 'b-form-input'
|
|
5
|
+
description
|
|
24
6
|
};
|
|
25
7
|
|
|
26
8
|
export default search_box_by_type_documentation;
|
|
@@ -4,10 +4,6 @@ import GlIcon from '../icon/icon';
|
|
|
4
4
|
import GlLoadingIcon from '../loading_icon/loading_icon';
|
|
5
5
|
import __vue_normalize__ from 'vue-runtime-helpers/dist/normalize-component.js';
|
|
6
6
|
|
|
7
|
-
const model = {
|
|
8
|
-
prop: 'value',
|
|
9
|
-
event: 'input'
|
|
10
|
-
};
|
|
11
7
|
var script = {
|
|
12
8
|
components: {
|
|
13
9
|
GlClearIconButton,
|
|
@@ -16,8 +12,14 @@ var script = {
|
|
|
16
12
|
GlLoadingIcon
|
|
17
13
|
},
|
|
18
14
|
inheritAttrs: false,
|
|
19
|
-
model
|
|
15
|
+
model: {
|
|
16
|
+
prop: 'value',
|
|
17
|
+
event: 'input'
|
|
18
|
+
},
|
|
20
19
|
props: {
|
|
20
|
+
/**
|
|
21
|
+
* If provided, used as value of search input
|
|
22
|
+
*/
|
|
21
23
|
value: {
|
|
22
24
|
type: String,
|
|
23
25
|
required: false,
|
|
@@ -28,16 +30,28 @@ var script = {
|
|
|
28
30
|
required: false,
|
|
29
31
|
default: 'Clear'
|
|
30
32
|
},
|
|
33
|
+
|
|
34
|
+
/**
|
|
35
|
+
* If provided and true, disables the input and controls
|
|
36
|
+
*/
|
|
31
37
|
disabled: {
|
|
32
38
|
type: Boolean,
|
|
33
39
|
required: false,
|
|
34
40
|
default: false
|
|
35
41
|
},
|
|
42
|
+
|
|
43
|
+
/**
|
|
44
|
+
* Puts search box into loading state, rendering spinner
|
|
45
|
+
*/
|
|
36
46
|
isLoading: {
|
|
37
47
|
type: Boolean,
|
|
38
48
|
required: false,
|
|
39
49
|
default: false
|
|
40
50
|
},
|
|
51
|
+
|
|
52
|
+
/**
|
|
53
|
+
* Container for tooltip. Valid values: DOM node, selector string or `false` for default
|
|
54
|
+
*/
|
|
41
55
|
tooltipContainer: {
|
|
42
56
|
required: false,
|
|
43
57
|
default: false,
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
var hover_load = "
|
|
1
|
+
var hover_load = "A Vue Directive to help with preloading resources when hovering over an element.\n\n## Usage\n\n```html\n<script>\nimport { GlHoverLoadDirective } from '@gitlab/ui';\n\nexport default {\n directives: { GlHoverLoadDirective },\n methods: {\n handlePreload() {\n fetch('some/endpoint');\n },\n },\n};\n</script>\n\n<template>\n <div v-gl-hover-load=\"handlePreload\">Hover me to preload</div>\n</template>\n```\n";
|
|
2
2
|
|
|
3
3
|
var description = /*#__PURE__*/Object.freeze({
|
|
4
4
|
__proto__: null,
|
|
@@ -1,11 +1,8 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
var description = "# Resize Observer\n\n<!-- STORY -->\n\n## Usage\n\nThis directive can be used to get notified whenever a given element's size (width or height) changes\nand to retrieve the updated dimensions.\n\nUnder the hood, it leverages the [Resize Observer API](https://developer.mozilla.org/en-US/docs/Web/API/ResizeObserver).\nIf you use GitLab UI in an older browser which doesn't support the Resize Observer API,\nyou can use a [polyfill](https://github.com/que-etc/resize-observer-polyfill).\n\nThe directive accepts a callback as a value and passes on the received\n[contentRect](https://developer.mozilla.org/en-US/docs/Web/API/ResizeObserverEntry/contentRect)\nand the target element whenever a resize event gets triggered.\n\n```html\n<script>\nexport default {\n data() {\n return {\n width: 0,\n height: 0,\n };\n },\n methods: {\n handleResize({ contentRect: { width, height } }) {\n this.width = width;\n this.height = height;\n },\n },\n};\n</script>\n<template>\n <div v-gl-resize-observer-directive=\"handleResize\">\n <p>{{ width }} x {{ height }}</p>\n </div>\n</template>\n```\n\nThe observer can be toggled on or off by passing a boolean argument to the directive:\n\n```html\n<script>\nexport default {\n data() {\n return {\n shouldObserve: true,\n };\n },\n methods: {\n handleResize() {},\n },\n};\n</script>\n<template>\n <div v-gl-resize-observer-directive[shouldObserve]=\"handleResize\"></div>\n</template>\n```\n";
|
|
1
|
+
var description = "This directive can be used to get notified whenever a given element's size (width or height) changes\nand to retrieve the updated dimensions.\n\nUnder the hood, it leverages the [Resize Observer API](https://developer.mozilla.org/en-US/docs/Web/API/ResizeObserver).\nIf you use GitLab UI in an older browser which doesn't support the Resize Observer API,\nyou can use a [polyfill](https://github.com/que-etc/resize-observer-polyfill).\n\nThe directive accepts a callback as a value and passes on the received\n[contentRect](https://developer.mozilla.org/en-US/docs/Web/API/ResizeObserverEntry/contentRect)\nand the target element whenever a resize event gets triggered.\n\n```html\n<script>\nexport default {\n data() {\n return {\n width: 0,\n height: 0,\n };\n },\n methods: {\n handleResize({ contentRect: { width, height } }) {\n this.width = width;\n this.height = height;\n },\n },\n};\n</script>\n<template>\n <div v-gl-resize-observer-directive=\"handleResize\">\n <p>{{ width }} x {{ height }}</p>\n </div>\n</template>\n```\n\nThe observer can be toggled on or off by passing a boolean argument to the directive:\n\n```html\n<script>\nexport default {\n data() {\n return {\n shouldObserve: true,\n };\n },\n methods: {\n handleResize() {},\n },\n};\n</script>\n<template>\n <div v-gl-resize-observer-directive[shouldObserve]=\"handleResize\"></div>\n</template>\n```\n";
|
|
4
2
|
|
|
5
3
|
var resize_observer_documentation = {
|
|
6
4
|
followsDesignSystem: false,
|
|
7
|
-
description
|
|
8
|
-
examples
|
|
5
|
+
description
|
|
9
6
|
};
|
|
10
7
|
|
|
11
8
|
export default resize_observer_documentation;
|