@gitlab/ui 37.2.0 → 37.4.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/CHANGELOG.md +22 -0
- 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/directives/safe_html/safe_html.documentation.js +1 -1
- package/dist/directives/safe_link/safe_link.documentation.js +2 -3
- package/dist/index.css +1 -1
- package/dist/index.css.map +1 -1
- package/dist/utility_classes.css +1 -1
- package/dist/utility_classes.css.map +1 -1
- package/documentation/documented_stories.js +7 -0
- package/package.json +1 -1
- package/src/components/base/button/button.scss +5 -9
- 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/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/src/directives/safe_html/safe_html.md +0 -4
- package/src/directives/safe_html/safe_html.stories.js +53 -44
- package/src/directives/safe_link/safe_link.documentation.js +0 -1
- package/src/directives/safe_link/safe_link.md +0 -4
- package/src/directives/safe_link/safe_link.stories.js +31 -30
- package/src/scss/utilities.scss +8 -0
- package/src/scss/utility-mixins/background.scss +4 -0
- 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.1](https://gitlab.com/gitlab-org/gitlab-ui/compare/v37.4.0...v37.4.1) (2022-03-07)
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
### Bug Fixes
|
|
5
|
+
|
|
6
|
+
* **danger:** fix conventional commits url ([7ec70ef](https://gitlab.com/gitlab-org/gitlab-ui/commit/7ec70efae259272d2bd19654eaab64a33ab98fad))
|
|
7
|
+
|
|
8
|
+
# [37.4.0](https://gitlab.com/gitlab-org/gitlab-ui/compare/v37.3.0...v37.4.0) (2022-03-07)
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
### Features
|
|
12
|
+
|
|
13
|
+
* **GlButton:** Update selected state background ([b9e3116](https://gitlab.com/gitlab-org/gitlab-ui/commit/b9e31166ee8a43c2ea09c2f4a9cafd9e71e222d8))
|
|
14
|
+
* **GlButton:** Update selected state design ([a5ebf70](https://gitlab.com/gitlab-org/gitlab-ui/commit/a5ebf701e38fd32ff965af33c30319e4c7f2edc5))
|
|
15
|
+
|
|
16
|
+
# [37.3.0](https://gitlab.com/gitlab-org/gitlab-ui/compare/v37.2.0...v37.3.0) (2022-03-03)
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
### Features
|
|
20
|
+
|
|
21
|
+
* **css:** Add gl-bg-purple-50 util class ([29acbbb](https://gitlab.com/gitlab-org/gitlab-ui/commit/29acbbbe7726f763b0e7ba86dc4de74db45a545e))
|
|
22
|
+
|
|
1
23
|
# [37.2.0](https://gitlab.com/gitlab-org/gitlab-ui/compare/v37.1.0...v37.2.0) (2022-03-03)
|
|
2
24
|
|
|
3
25
|
|
|
@@ -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;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
var description = "
|
|
1
|
+
var description = "A Vue Directive to sanitize HTML to avoid any XSS vulnerabilities.\n\n## Usage\n\nThis directive can be used to sanitize HTML code which may contain user input, to prevent cross-site\nscripting (XSS) vulnerabilities.\n\nUnder the hood, it uses [DOMPurify](https://github.com/cure53/DOMPurify) to sanitize the provided HTML.\n\nDOMPurify will strip out dangerous HTML and will keep the safe HTML. You can refer complete list of\n[tags][1] and [attributes][2] allowed by DOMPurify.\n\n[1]: https://github.com/cure53/DOMPurify/blob/main/src/tags.js\n[2]: https://github.com/cure53/DOMPurify/blob/main/src/attrs.js\n\n## Example\n\n```html\n<script>\nimport { GlSafeHtmlDirective as SafeHtml } from '@gitlab/ui';\n\nexport default {\n directives: {\n SafeHtml,\n },\n data() {\n return {\n rawHtml: \"Hello! <script>alert('XSS')</script>\",\n };\n },\n};\n</script>\n\n<template>\n <div v-safe-html=\"rawHtml\"></div>\n</template>\n```\n\n## Advanced configuration\n\n```js\n// It allows only <b> tags\nconst config = { ALLOWED_TAGS: ['b'] };\n\n// It doesn't allow any html tags\nconst config = { ALLOWED_TAGS: [] };\n```\n\n```html\n<div v-safe-html:[config]=\"rawHtml\"></div>\n```\n\nFor advanced configuration options, please refer to [DOMPurify's documentation](https://github.com/cure53/DOMPurify#can-i-configure-dompurify).\n\n### Notes\n\n1. `target` attribute is not allowed by default - See <https://gitlab.com/gitlab-org/gitlab-ui/-/issues/1427>.\n1. To know more about other tips & caveats - See <https://gitlab.com/groups/gitlab-org/-/epics/4273#caveats>.\n";
|
|
2
2
|
|
|
3
3
|
var safe_html_documentation = {
|
|
4
4
|
followsDesignSystem: false,
|
|
@@ -1,9 +1,8 @@
|
|
|
1
|
-
var description = "
|
|
1
|
+
var description = "A Vue directive to make the hyperlinks secure by default.\n\n## Security measures\n\n### rel\n\nWhen setting target to `_blank`, the rel attribute gets set automatically to `noopener noreferrer`,\nthis is done to avoid the `window.opener` [API exploit]. If you set the `rel` attribute manually,\nthis will overwrite the aforementioned logic.\n\n### href\n\nThis directive enforces \"safe\" URLs. What this means is that, if the provided `href`\ndoesn't point to a safe protocol (one of `http:`, `https:`, `mailto:` or `ftp:`), then it is\nreplaced with `about:blank` to prevent [URL injections].\n\n```html\n<script>\nimport { GlSafeLinkDirective as SafeLink } from '@gitlab/ui';\n\nexport default {\n data() {\n return {\n url: 'javascript:alert(1)',\n };\n },\n directives: { SafeLink },\n};\n</script>\n<template>\n <a v-safe-link href=\"url\" target=\"_blank\">Click</a>\n <!-- Renders to: <a href=\"about:blank\" target=\"_blank\">Click</a> -->\n</template>\n```\n\n[API exploit]: https://www.jitbit.com/alexblog/256-targetblank---the-most-underestimated-vulnerability-ever/\n[URL injections]: https://vuejs.org/v2/guide/security.html#Injecting-URLs\n";
|
|
2
2
|
|
|
3
3
|
var safe_link_documentation = {
|
|
4
4
|
followsDesignSystem: false,
|
|
5
|
-
description
|
|
6
|
-
examples: false
|
|
5
|
+
description
|
|
7
6
|
};
|
|
8
7
|
|
|
9
8
|
export default safe_link_documentation;
|