@gitlab/ui 32.37.0 → 32.41.0
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 +28 -0
- package/dist/components/base/carousel/carousel.documentation.js +1 -4
- package/dist/components/base/filtered_search/filtered_search.js +1 -1
- package/dist/components/base/filtered_search/filtered_search_token_segment.js +10 -2
- package/dist/components/base/form/form_input_group/form_input_group.js +6 -1
- package/dist/components/base/markdown/markdown.documentation.js +2 -6
- package/dist/components/base/search_box_by_click/search_box_by_click.js +2 -1
- package/dist/components/base/search_box_by_type/search_box_by_type.js +1 -1
- package/dist/components/base/table/constants.js +5 -0
- package/dist/components/base/table/table.js +19 -1
- package/dist/components/charts/bar/bar.js +1 -1
- package/dist/components/charts/column/column.js +1 -1
- package/dist/components/charts/sparkline/sparkline.js +1 -1
- package/dist/components/charts/stacked_column/stacked_column.js +1 -1
- package/dist/utils/utils.js +12 -2
- package/documentation/documented_stories.js +2 -0
- package/package.json +3 -3
- package/src/components/base/carousel/carousel.documentation.js +0 -2
- package/src/components/base/carousel/carousel.md +0 -2
- package/src/components/base/carousel/carousel.stories.js +24 -11
- package/src/components/base/filtered_search/filtered_search.vue +1 -0
- package/src/components/base/filtered_search/filtered_search_token_segment.spec.js +17 -1
- package/src/components/base/filtered_search/filtered_search_token_segment.vue +9 -1
- package/src/components/base/form/form_input_group/form_input_group.spec.js +18 -1
- package/src/components/base/form/form_input_group/form_input_group.vue +6 -1
- package/src/components/base/markdown/markdown.documentation.js +0 -3
- package/src/components/base/markdown/markdown.md +0 -2
- package/src/components/base/markdown/markdown.stories.js +25 -24
- package/src/components/base/search_box_by_click/search_box_by_click.vue +2 -0
- package/src/components/base/search_box_by_type/search_box_by_type.vue +1 -1
- package/src/components/base/table/constants.js +49 -0
- package/src/components/base/table/table.spec.js +49 -0
- package/src/components/base/table/table.vue +16 -0
- package/src/components/charts/bar/bar.spec.js +0 -15
- package/src/components/charts/bar/bar.vue +3 -2
- package/src/components/charts/column/column.vue +3 -2
- package/src/components/charts/column/column_chart.spec.js +35 -15
- package/src/components/charts/sparkline/sparkline.spec.js +21 -27
- package/src/components/charts/sparkline/sparkline.vue +24 -12
- package/src/components/charts/stacked_column/stacked_column.spec.js +4 -21
- package/src/components/charts/stacked_column/stacked_column.vue +5 -8
- package/src/utils/utils.js +11 -1
- package/dist/components/base/carousel/examples/carousel.basic.example.js +0 -38
- package/dist/components/base/carousel/examples/index.js +0 -13
- package/dist/components/base/markdown/examples/index.js +0 -13
- package/dist/components/base/markdown/examples/markdown.basic.example.js +0 -38
- package/src/components/base/carousel/examples/carousel.basic.example.vue +0 -26
- package/src/components/base/carousel/examples/index.js +0 -15
- package/src/components/base/markdown/examples/index.js +0 -15
- package/src/components/base/markdown/examples/markdown.basic.example.vue +0 -15
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,31 @@
|
|
|
1
|
+
# [32.41.0](https://gitlab.com/gitlab-org/gitlab-ui/compare/v32.40.0...v32.41.0) (2021-11-23)
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
### Features
|
|
5
|
+
|
|
6
|
+
* **SearchBoxBy*:** add type search to improve on accessibility ([8d77905](https://gitlab.com/gitlab-org/gitlab-ui/commit/8d779051a8028aad12bbc39ccaa335d10637a225))
|
|
7
|
+
|
|
8
|
+
# [32.40.0](https://gitlab.com/gitlab-org/gitlab-ui/compare/v32.39.0...v32.40.0) (2021-11-22)
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
### Features
|
|
12
|
+
|
|
13
|
+
* **GlFormInputGroup:** Add `inputClass` prop to `GlFormInputGroup` ([cdc7c70](https://gitlab.com/gitlab-org/gitlab-ui/commit/cdc7c70f81b462237deda76f2a3709119b52489f))
|
|
14
|
+
|
|
15
|
+
# [32.39.0](https://gitlab.com/gitlab-org/gitlab-ui/compare/v32.38.0...v32.39.0) (2021-11-19)
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
### Features
|
|
19
|
+
|
|
20
|
+
* **GlFilteredSearch:** Fix typing Colon ([1541d19](https://gitlab.com/gitlab-org/gitlab-ui/commit/1541d191db4acc5aa07385acbd19b2ad5d657a17))
|
|
21
|
+
|
|
22
|
+
# [32.38.0](https://gitlab.com/gitlab-org/gitlab-ui/compare/v32.37.0...v32.38.0) (2021-11-17)
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
### Features
|
|
26
|
+
|
|
27
|
+
* **GlFilteredSearchTokenSegment:** Colon support ([abf3856](https://gitlab.com/gitlab-org/gitlab-ui/commit/abf3856396080e6699ddfbcd526991dcea2dc5f3))
|
|
28
|
+
|
|
1
29
|
# [32.37.0](https://gitlab.com/gitlab-org/gitlab-ui/compare/v32.36.0...v32.37.0) (2021-11-10)
|
|
2
30
|
|
|
3
31
|
|
|
@@ -1,10 +1,7 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
var description = "## Carousel\n\nThe carousel is a slideshow for cycling through a series of content, built with CSS 3D\ntransforms. It works with a series of images, text, or custom markup. It also includes support\nfor previous/next controls and indicators.\n";
|
|
1
|
+
var description = "The carousel is a slideshow for cycling through a series of content, built with CSS 3D\ntransforms. It works with a series of images, text, or custom markup. It also includes support\nfor previous/next controls and indicators.\n";
|
|
4
2
|
|
|
5
3
|
var carousel_documentation = {
|
|
6
4
|
description,
|
|
7
|
-
examples,
|
|
8
5
|
bootstrapComponent: 'b-carousel'
|
|
9
6
|
};
|
|
10
7
|
|
|
@@ -266,7 +266,7 @@ var script = {
|
|
|
266
266
|
const __vue_script__ = script;
|
|
267
267
|
|
|
268
268
|
/* template */
|
|
269
|
-
var __vue_render__ = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('gl-search-box-by-click',_vm._b({attrs:{"value":_vm.tokens,"history-items":_vm.historyItems,"clearable":_vm.hasValue},on:{"submit":_vm.submit,"input":_vm.applyNewValue,"history-item-selected":function($event){return _vm.$emit('history-item-selected', $event)},"clear":function($event){return _vm.$emit('clear')},"clear-history":function($event){return _vm.$emit('clear-history')}},scopedSlots:_vm._u([{key:"history-item",fn:function(slotScope){return [_vm._t("history-item",null,null,slotScope)]}},{key:"input",fn:function(){return [_c('div',{staticClass:"gl-filtered-search-scrollable"},[_vm._l((_vm.tokens),function(token,idx){return [_c(_vm.getTokenComponent(token.type),{key:((token.type) + "-" + idx),ref:"tokens",refInFor:true,tag:"component",staticClass:"gl-filtered-search-item",class:{
|
|
269
|
+
var __vue_render__ = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('gl-search-box-by-click',_vm._b({attrs:{"value":_vm.tokens,"history-items":_vm.historyItems,"clearable":_vm.hasValue,"data-testid":"filtered-search-input"},on:{"submit":_vm.submit,"input":_vm.applyNewValue,"history-item-selected":function($event){return _vm.$emit('history-item-selected', $event)},"clear":function($event){return _vm.$emit('clear')},"clear-history":function($event){return _vm.$emit('clear-history')}},scopedSlots:_vm._u([{key:"history-item",fn:function(slotScope){return [_vm._t("history-item",null,null,slotScope)]}},{key:"input",fn:function(){return [_c('div',{staticClass:"gl-filtered-search-scrollable"},[_vm._l((_vm.tokens),function(token,idx){return [_c(_vm.getTokenComponent(token.type),{key:((token.type) + "-" + idx),ref:"tokens",refInFor:true,tag:"component",staticClass:"gl-filtered-search-item",class:{
|
|
270
270
|
'gl-filtered-search-last-item': _vm.isLastToken(idx),
|
|
271
271
|
},attrs:{"config":_vm.getTokenEntry(token.type),"active":_vm.activeTokenIdx === idx,"available-tokens":_vm.currentAvailableTokens,"current-value":_vm.tokens,"index":idx,"placeholder":_vm.termPlaceholder,"show-friendly-text":_vm.showFriendlyText},on:{"activate":function($event){return _vm.activate(idx)},"deactivate":function($event){return _vm.deactivate(token)},"destroy":function($event){return _vm.destroyToken(idx)},"replace":function($event){return _vm.replaceToken(idx, $event)},"complete":_vm.completeToken,"submit":_vm.submit,"split":function($event){return _vm.createTokens(idx, $event)}},model:{value:(token.value),callback:function ($$v) {_vm.$set(token, "value", $$v);},expression:"token.value"}})]})],2),_vm._v(" "),_c('portal-target',{key:_vm.activeTokenIdx,ref:"menu",style:(_vm.suggestionsStyle),attrs:{"name":_vm.portalName,"slim":""}})]},proxy:true}],null,true)},'gl-search-box-by-click',_vm.$attrs,false))};
|
|
272
272
|
var __vue_staticRenderFns__ = [];
|
|
@@ -216,13 +216,22 @@ var script = {
|
|
|
216
216
|
|
|
217
217
|
const handlers = {
|
|
218
218
|
Enter: () => {
|
|
219
|
+
e.preventDefault();
|
|
220
|
+
|
|
219
221
|
if (suggestedValue != null) {
|
|
220
222
|
this.applySuggestion(suggestedValue);
|
|
221
223
|
} else {
|
|
222
224
|
this.$emit('submit');
|
|
223
225
|
}
|
|
224
226
|
},
|
|
227
|
+
':': () => {
|
|
228
|
+
if (suggestedValue != null) {
|
|
229
|
+
e.preventDefault();
|
|
230
|
+
this.applySuggestion(suggestedValue);
|
|
231
|
+
}
|
|
232
|
+
},
|
|
225
233
|
Escape: () => {
|
|
234
|
+
e.preventDefault();
|
|
226
235
|
this.$emit('complete');
|
|
227
236
|
}
|
|
228
237
|
};
|
|
@@ -238,7 +247,6 @@ var script = {
|
|
|
238
247
|
}
|
|
239
248
|
|
|
240
249
|
if (Object.keys(handlers).includes(key)) {
|
|
241
|
-
e.preventDefault();
|
|
242
250
|
handlers[key]();
|
|
243
251
|
return;
|
|
244
252
|
}
|
|
@@ -265,7 +273,7 @@ var script = {
|
|
|
265
273
|
const __vue_script__ = script;
|
|
266
274
|
|
|
267
275
|
/* template */
|
|
268
|
-
var __vue_render__ = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',{staticClass:"gl-filtered-search-token-segment",class:{ 'gl-filtered-search-token-segment-active': _vm.active },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)}}},[(_vm.active)?[_c('input',{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},domProps:{"value":(_vm.inputValue)},on:{"keydown":_vm.handleInputKeydown,"blur":_vm.handleBlur,"input":function($event){if($event.target.composing){ return; }_vm.inputValue=$event.target.value;}}}),_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)};
|
|
276
|
+
var __vue_render__ = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',{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)}}},[(_vm.active)?[_c('input',{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},domProps:{"value":(_vm.inputValue)},on:{"keydown":_vm.handleInputKeydown,"blur":_vm.handleBlur,"input":function($event){if($event.target.composing){ return; }_vm.inputValue=$event.target.value;}}}),_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)};
|
|
269
277
|
var __vue_staticRenderFns__ = [];
|
|
270
278
|
|
|
271
279
|
/* style */
|
|
@@ -34,6 +34,11 @@ var script = {
|
|
|
34
34
|
type: String,
|
|
35
35
|
required: false,
|
|
36
36
|
default: undefined
|
|
37
|
+
},
|
|
38
|
+
inputClass: {
|
|
39
|
+
type: [String, Array, Object],
|
|
40
|
+
required: false,
|
|
41
|
+
default: ''
|
|
37
42
|
}
|
|
38
43
|
},
|
|
39
44
|
|
|
@@ -66,7 +71,7 @@ var script = {
|
|
|
66
71
|
const __vue_script__ = script;
|
|
67
72
|
|
|
68
73
|
/* template */
|
|
69
|
-
var __vue_render__ = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',[_c('b-input-group',[(_vm.activeOption || _vm.$scopedSlots.prepend)?_c('b-input-group-prepend',[_vm._t("prepend"),_vm._v(" "),(_vm.activeOption)?_c('gl-dropdown',{attrs:{"text":_vm.activeOption}},_vm._l((_vm.predefinedOptions),function(option){return _c('gl-dropdown-item',{key:option.value,attrs:{"is-check-item":"","is-checked":_vm.activeOption === option.name},on:{"click":function($event){return _vm.updateValue(option)}}},[_vm._v("\n "+_vm._s(option.name)+"\n ")])}),1):_vm._e()],2):_vm._e(),_vm._v(" "),_vm._t("default",[_c('b-form-input',_vm._g(_vm._b({ref:"input",
|
|
74
|
+
var __vue_render__ = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',[_c('b-input-group',[(_vm.activeOption || _vm.$scopedSlots.prepend)?_c('b-input-group-prepend',[_vm._t("prepend"),_vm._v(" "),(_vm.activeOption)?_c('gl-dropdown',{attrs:{"text":_vm.activeOption}},_vm._l((_vm.predefinedOptions),function(option){return _c('gl-dropdown-item',{key:option.value,attrs:{"is-check-item":"","is-checked":_vm.activeOption === option.name},on:{"click":function($event){return _vm.updateValue(option)}}},[_vm._v("\n "+_vm._s(option.name)+"\n ")])}),1):_vm._e()],2):_vm._e(),_vm._v(" "),_vm._t("default",[_c('b-form-input',_vm._g(_vm._b({ref:"input",class:['gl-form-input', _vm.inputClass],attrs:{"aria-label":_vm.label},on:{"click":_vm.handleClick},model:{value:(_vm.localValue),callback:function ($$v) {_vm.localValue=$$v;},expression:"localValue"}},'b-form-input',_vm.$attrs,false),_vm.$listeners))]),_vm._v(" "),(_vm.$scopedSlots.append)?_c('b-input-group-append',[_vm._t("append")],2):_vm._e()],2)],1)};
|
|
70
75
|
var __vue_staticRenderFns__ = [];
|
|
71
76
|
|
|
72
77
|
/* style */
|
|
@@ -1,6 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
var markdown = "# GlMarkdown\n\nThe `GlMarkdown` component styles markdown-generated HTML following the Pajamas Documentation Markdown\n[styling specifications](https://www.figma.com/file/qEddyqCrI7kPSBjGmwkZzQ/Pajamas-UI-Kit---Beta?node-id=542%3A2).\n\n## Usage\n\nYou can use the `GlMarkdown` component in two ways.\n\n### Vue component\n\n```html\n<script>\nimport { GlMarkdown } from '@gitlab/ui';\n\nexport default {\n components: {\n GlMarkdown,\n }\n}\n</script>\n<template>\n <gl-markdown>\n <!-- All the content inside gl-markdown will inherit the documentation markdown styles -->\n </gl-markdown>\n</template>\n```\n\n### `gl-markdown` class selector\n\nFollow the [GitLab UI CSS guidelines](https://gitlab.com/gitlab-org/gitlab-ui/-/blob/main/doc/css.md)\nto include GitLab UI CSS in your application. Afterwards, you can apply the `gl-markdown` class\nselector to the root element that contains the markdown-generated HTML.\n\n```html\n<body class=\"gl-markdown\">\n <!-- All the content inside body.gl-markdown will inherit the documentation markdown styles -->\n</body>\n```\n\n### Compact markdown\n\nSet the `compact` property to true in `GlMarkdown` to apply the compact markdown styles.\n\n```html\n<gl-markdown compact></gl-compact>\n```\n\nYou can also append the `gl-compact-markdown` class selector after `gl-markdown` in markdown-generated\nHTML.\n\n```html\n<body class=\"gl-markdown gl-compact-markdown\">\n</body>\n```\n\n<!--\n## Browser compatibility\n\nIf the component requires any polyfill or fallback on certain browsers, describe those requirements\nhere.\n-->\n\n<!--\n## Edge cases\n\nIf the component has some known limitations, describe them here.\n-->\n\n<!--\n## Deprecation warning\n\nIf and when this component introduced API changes that would require deprecating old APIs, describe\nthe changes here, and provide a migration paths to the new API.\n-->\n";
|
|
1
|
+
var markdown = "The `GlMarkdown` component styles markdown-generated HTML following the Pajamas Documentation Markdown\n[styling specifications](https://www.figma.com/file/qEddyqCrI7kPSBjGmwkZzQ/Pajamas-UI-Kit---Beta?node-id=542%3A2).\n\n## Usage\n\nYou can use the `GlMarkdown` component in two ways.\n\n### Vue component\n\n```html\n<script>\nimport { GlMarkdown } from '@gitlab/ui';\n\nexport default {\n components: {\n GlMarkdown,\n }\n}\n</script>\n<template>\n <gl-markdown>\n <!-- All the content inside gl-markdown will inherit the documentation markdown styles -->\n </gl-markdown>\n</template>\n```\n\n### `gl-markdown` class selector\n\nFollow the [GitLab UI CSS guidelines](https://gitlab.com/gitlab-org/gitlab-ui/-/blob/main/doc/css.md)\nto include GitLab UI CSS in your application. Afterwards, you can apply the `gl-markdown` class\nselector to the root element that contains the markdown-generated HTML.\n\n```html\n<body class=\"gl-markdown\">\n <!-- All the content inside body.gl-markdown will inherit the documentation markdown styles -->\n</body>\n```\n\n### Compact markdown\n\nSet the `compact` property to true in `GlMarkdown` to apply the compact markdown styles.\n\n```html\n<gl-markdown compact></gl-compact>\n```\n\nYou can also append the `gl-compact-markdown` class selector after `gl-markdown` in markdown-generated\nHTML.\n\n```html\n<body class=\"gl-markdown gl-compact-markdown\">\n</body>\n```\n\n<!--\n## Browser compatibility\n\nIf the component requires any polyfill or fallback on certain browsers, describe those requirements\nhere.\n-->\n\n<!--\n## Edge cases\n\nIf the component has some known limitations, describe them here.\n-->\n\n<!--\n## Deprecation warning\n\nIf and when this component introduced API changes that would require deprecating old APIs, describe\nthe changes here, and provide a migration paths to the new API.\n-->\n";
|
|
4
2
|
|
|
5
3
|
var description = /*#__PURE__*/Object.freeze({
|
|
6
4
|
__proto__: null,
|
|
@@ -8,9 +6,7 @@ var description = /*#__PURE__*/Object.freeze({
|
|
|
8
6
|
});
|
|
9
7
|
|
|
10
8
|
var markdown_documentation = {
|
|
11
|
-
description
|
|
12
|
-
examples,
|
|
13
|
-
propsInfo: {}
|
|
9
|
+
description
|
|
14
10
|
};
|
|
15
11
|
|
|
16
12
|
export default markdown_documentation;
|
|
@@ -95,6 +95,7 @@ var script = {
|
|
|
95
95
|
computed: {
|
|
96
96
|
inputAttributes() {
|
|
97
97
|
const attributes = {
|
|
98
|
+
type: 'search',
|
|
98
99
|
placeholder: this.placeholder,
|
|
99
100
|
...this.$attrs
|
|
100
101
|
};
|
|
@@ -158,7 +159,7 @@ var script = {
|
|
|
158
159
|
const __vue_script__ = script;
|
|
159
160
|
|
|
160
161
|
/* template */
|
|
161
|
-
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":function($event){return _vm.$emit('clear-history')}}},[_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',{ref:"searchButton",staticClass:"gl-search-box-by-click-search-button",attrs:{"icon":"search","disabled":_vm.disabled,"aria-label":"Search"},on:{"click":function($event){return _vm.search(_vm.currentValue)}}})]},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},on:{"click":_vm.clearInput}}):_vm._e()],2)};
|
|
162
|
+
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":function($event){return _vm.$emit('clear-history')}}},[_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',{ref:"searchButton",staticClass:"gl-search-box-by-click-search-button",attrs:{"icon":"search","disabled":_vm.disabled,"aria-label":"Search"},on:{"click":function($event){return _vm.search(_vm.currentValue)}}})]},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)};
|
|
162
163
|
var __vue_staticRenderFns__ = [];
|
|
163
164
|
|
|
164
165
|
/* style */
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
const tableFullSlots = ['bottom-row', 'empty', 'emptyfiltered', 'table-busy', 'thead-top', 'top-row'];
|
|
2
|
+
const tableFullProps = ['api-url', 'busy', 'current-page', 'empty-filtered-html', 'empty-filtered-text', 'empty-html', 'empty-text', 'filter', 'filter-debounce', 'filter-function', 'filter-ignored-fields', 'filter-included-fields', 'label-sort-asc', 'label-sort-clear', 'label-sort-desc', 'no-footer-sorting', 'no-local-sorting', 'no-provider-filtering', 'no-provider-paging', 'no-provider-sorting', 'no-select-on-click', 'no-sort-reset', 'per-page', 'select-mode', 'selectable', 'selected-variant', 'show-empty', 'sort-by', 'sort-compare', 'sort-compare-locale', 'sort-compare-options', 'sort-desc', 'sort-direction', 'sort-icon-left', 'sort-null-last'];
|
|
3
|
+
const glTableLiteWarning = 'This GlTable could be a GlTableLite component, please consider using GlTableLite instead of GlTable to reduce the page bundlesize more about this here: https://gitlab-org.gitlab.io/gitlab-ui/?path=/docs/base-table-table-lite--default';
|
|
4
|
+
|
|
5
|
+
export { glTableLiteWarning, tableFullProps, tableFullSlots };
|
|
@@ -1,11 +1,29 @@
|
|
|
1
1
|
import { BTable } from 'bootstrap-vue/esm/index.js';
|
|
2
|
+
import { isDev, logWarning } from '../../../utils/utils';
|
|
3
|
+
import { tableFullProps, tableFullSlots, glTableLiteWarning } from './constants';
|
|
2
4
|
import __vue_normalize__ from 'vue-runtime-helpers/dist/normalize-component.js';
|
|
3
5
|
|
|
6
|
+
const shouldUseFullTable = ({
|
|
7
|
+
$attrs,
|
|
8
|
+
$scopedSlots
|
|
9
|
+
}) => {
|
|
10
|
+
return tableFullProps.some(prop => $attrs[prop] !== undefined) || tableFullSlots.some(slot => $scopedSlots[slot] !== undefined);
|
|
11
|
+
};
|
|
12
|
+
|
|
4
13
|
var script = {
|
|
5
14
|
components: {
|
|
6
15
|
BTable
|
|
7
16
|
},
|
|
8
|
-
inheritAttrs: false
|
|
17
|
+
inheritAttrs: false,
|
|
18
|
+
|
|
19
|
+
mounted() {
|
|
20
|
+
// logWarning will call isDev before logging any message
|
|
21
|
+
// this additional call to isDev is being made to exit the condition early when run in production
|
|
22
|
+
if (isDev() && !shouldUseFullTable(this)) {
|
|
23
|
+
logWarning(glTableLiteWarning);
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
|
|
9
27
|
};
|
|
10
28
|
|
|
11
29
|
/* script */
|
|
@@ -237,7 +237,7 @@ var script = {
|
|
|
237
237
|
const __vue_script__ = script;
|
|
238
238
|
|
|
239
239
|
/* template */
|
|
240
|
-
var __vue_render__ = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',{staticClass:"position-relative"},[_c('chart',_vm._g(_vm._b({attrs:{"options":_vm.options},on:{"created":_vm.onCreated}},'chart',_vm.$attrs,false),_vm.$listeners)),_vm._v(" "),(_vm.chart)?_c('chart-tooltip',{attrs:{"show":_vm.showTooltip,"chart":_vm.chart,"top":_vm.tooltipPosition.top,"left":_vm.tooltipPosition.left}
|
|
240
|
+
var __vue_render__ = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',{staticClass:"position-relative"},[_c('chart',_vm._g(_vm._b({attrs:{"options":_vm.options},on:{"created":_vm.onCreated}},'chart',_vm.$attrs,false),_vm.$listeners)),_vm._v(" "),(_vm.chart)?_c('chart-tooltip',{attrs:{"show":_vm.showTooltip,"chart":_vm.chart,"top":_vm.tooltipPosition.top,"left":_vm.tooltipPosition.left},scopedSlots:_vm._u([{key:"title",fn:function(){return [_c('div',[_vm._v(_vm._s(_vm.tooltipTitle)+" ("+_vm._s(_vm.yAxisTitle)+")")])]},proxy:true}],null,false,1644826356)},[_vm._v(" "),_c('tooltip-default-format',{attrs:{"tooltip-content":_vm.tooltipContent}})],1):_vm._e()],1)};
|
|
241
241
|
var __vue_staticRenderFns__ = [];
|
|
242
242
|
|
|
243
243
|
/* style */
|
|
@@ -219,7 +219,7 @@ var script = {
|
|
|
219
219
|
const __vue_script__ = script;
|
|
220
220
|
|
|
221
221
|
/* template */
|
|
222
|
-
var __vue_render__ = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',{staticClass:"position-relative"},[_c('chart',_vm._g(_vm._b({attrs:{"options":_vm.options},on:{"created":_vm.onCreated}},'chart',_vm.$attrs,false),_vm.$listeners)),_vm._v(" "),(_vm.chart)?_c('chart-tooltip',{attrs:{"show":_vm.showTooltip,"chart":_vm.chart,"top":_vm.tooltipPosition.top,"left":_vm.tooltipPosition.left}
|
|
222
|
+
var __vue_render__ = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',{staticClass:"position-relative"},[_c('chart',_vm._g(_vm._b({attrs:{"options":_vm.options},on:{"created":_vm.onCreated}},'chart',_vm.$attrs,false),_vm.$listeners)),_vm._v(" "),(_vm.chart)?_c('chart-tooltip',{attrs:{"show":_vm.showTooltip,"chart":_vm.chart,"top":_vm.tooltipPosition.top,"left":_vm.tooltipPosition.left},scopedSlots:_vm._u([{key:"title",fn:function(){return [_c('div',[_vm._v(_vm._s(_vm.tooltipTitle)+" ("+_vm._s(_vm.xAxisTitle)+")")])]},proxy:true}],null,false,643259221)},[_vm._v(" "),_c('tooltip-default-format',{attrs:{"tooltip-content":_vm.tooltipContent}})],1):_vm._e()],1)};
|
|
223
223
|
var __vue_staticRenderFns__ = [];
|
|
224
224
|
|
|
225
225
|
/* style */
|
|
@@ -192,7 +192,7 @@ var script = {
|
|
|
192
192
|
const __vue_script__ = script;
|
|
193
193
|
|
|
194
194
|
/* template */
|
|
195
|
-
var __vue_render__ = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',{directives:[{name:"resize-observer",rawName:"v-resize-observer",value:(_vm.handleResize),expression:"handleResize"}],staticClass:"
|
|
195
|
+
var __vue_render__ = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',{directives:[{name:"resize-observer",rawName:"v-resize-observer",value:(_vm.handleResize),expression:"handleResize"}],staticClass:"gl-display-flex gl-align-items-center",on:{"mouseleave":_vm.hideTooltip}},[_vm._t("default"),_vm._v(" "),_c('div',{staticClass:"gl-flex-grow-1 gl-relative"},[_c('chart',{attrs:{"height":_vm.height,"options":_vm.options},on:{"created":_vm.onChartCreated}}),_vm._v(" "),(_vm.chartInstance)?_c('chart-tooltip',{style:({ pointerEvents: 'none' }),attrs:{"show":_vm.tooltip.show,"chart":_vm.chartInstance,"top":_vm.tooltip.position.top,"left":_vm.tooltip.position.left,"placement":"top"},scopedSlots:_vm._u([{key:"title",fn:function(){return [_c('div',{staticClass:"gl-white-space-nowrap",attrs:{"data-testid":"tooltip-title"}},[_vm._v("\n "+_vm._s(_vm.tooltip.title)+"\n ")])]},proxy:true},{key:"default",fn:function(){return [_c('div',{staticClass:"gl-display-flex",attrs:{"data-testid":"tooltip-content"}},[(_vm.tooltipLabel)?_c('span',{staticClass:"gl-pr-6 gl-mr-auto"},[_vm._v(_vm._s(_vm.tooltipLabel))]):_vm._e(),_vm._v(" "),_c('strong',[_vm._v(_vm._s(_vm.tooltip.content))])])]},proxy:true}],null,false,2830367259)}):_vm._e()],1),_vm._v(" "),(_vm.showLastYValue)?_c('span',{staticClass:"gl-display-inline-flex gl-justify-content-center gl-ml-5",attrs:{"data-testid":"last-y-value"}},[_vm._v("\n "+_vm._s(_vm.lastYValue)+"\n ")]):_vm._e()],2)};
|
|
196
196
|
var __vue_staticRenderFns__ = [];
|
|
197
197
|
|
|
198
198
|
/* style */
|
|
@@ -322,7 +322,7 @@ var script = {
|
|
|
322
322
|
const __vue_script__ = script;
|
|
323
323
|
|
|
324
324
|
/* template */
|
|
325
|
-
var __vue_render__ = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',{staticClass:"position-relative"},[_c('chart',_vm._g(_vm._b({attrs:{"options":_vm.options},on:{"created":_vm.onCreated}},'chart',_vm.$attrs,false),_vm.$listeners)),_vm._v(" "),(_vm.chart)?_c('chart-tooltip',{attrs:{"show":_vm.showTooltip,"chart":_vm.chart,"top":_vm.tooltipPosition.top,"left":_vm.tooltipPosition.left}
|
|
325
|
+
var __vue_render__ = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',{staticClass:"position-relative"},[_c('chart',_vm._g(_vm._b({attrs:{"options":_vm.options},on:{"created":_vm.onCreated}},'chart',_vm.$attrs,false),_vm.$listeners)),_vm._v(" "),(_vm.chart)?_c('chart-tooltip',{attrs:{"show":_vm.showTooltip,"chart":_vm.chart,"top":_vm.tooltipPosition.top,"left":_vm.tooltipPosition.left},scopedSlots:_vm._u([{key:"title",fn:function(){return [_vm._t("tooltip-title",[_vm._v(_vm._s(_vm.tooltipTitle)+" ("+_vm._s(_vm.xAxisTitle)+")")])]},proxy:true}],null,true)},[_vm._v(" "),_vm._t("tooltip-content",[_c('tooltip-default-format',{attrs:{"tooltip-content":_vm.tooltipContent}})])],2):_vm._e(),_vm._v(" "),(_vm.compiledOptions)?_c('chart-legend',{style:(_vm.legendStyle),attrs:{"chart":_vm.chart,"series-info":_vm.seriesInfo,"text-style":_vm.compiledOptions.textStyle,"min-text":_vm.legendMinText,"max-text":_vm.legendMaxText,"average-text":_vm.legendAverageText,"current-text":_vm.legendCurrentText,"layout":_vm.legendLayout}}):_vm._e()],1)};
|
|
326
326
|
var __vue_staticRenderFns__ = [];
|
|
327
327
|
|
|
328
328
|
/* style */
|
package/dist/utils/utils.js
CHANGED
|
@@ -88,15 +88,25 @@ function focusFirstFocusableElement(elts) {
|
|
|
88
88
|
const focusableElt = elts.find(el => isElementFocusable(el));
|
|
89
89
|
if (focusableElt) focusableElt.focus();
|
|
90
90
|
}
|
|
91
|
+
/**
|
|
92
|
+
* Returns true if the current environment is considered a development environment (it's not
|
|
93
|
+
* production or test).
|
|
94
|
+
*
|
|
95
|
+
* @returns {boolean}
|
|
96
|
+
*/
|
|
97
|
+
|
|
98
|
+
function isDev() {
|
|
99
|
+
return !['test', 'production'].includes(process.env.NODE_ENV);
|
|
100
|
+
}
|
|
91
101
|
/**
|
|
92
102
|
* Prints a warning message to the console in non-test and non-production environments.
|
|
93
103
|
* @param {string} message message to print to the console
|
|
94
104
|
*/
|
|
95
105
|
|
|
96
106
|
function logWarning(message = '') {
|
|
97
|
-
if (message.length &&
|
|
107
|
+
if (message.length && isDev()) {
|
|
98
108
|
console.warn(message); // eslint-disable-line no-console
|
|
99
109
|
}
|
|
100
110
|
}
|
|
101
111
|
|
|
102
|
-
export { colorFromBackground, debounceByAnimationFrame, focusFirstFocusableElement, hexToRgba, isElementFocusable, logWarning, rgbFromHex, rgbFromString, throttle, uid };
|
|
112
|
+
export { colorFromBackground, debounceByAnimationFrame, focusFirstFocusableElement, hexToRgba, isDev, isElementFocusable, logWarning, rgbFromHex, rgbFromString, throttle, uid };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@gitlab/ui",
|
|
3
|
-
"version": "32.
|
|
3
|
+
"version": "32.41.0",
|
|
4
4
|
"description": "GitLab UI Components",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -84,7 +84,7 @@
|
|
|
84
84
|
"@babel/preset-env": "^7.10.2",
|
|
85
85
|
"@gitlab/eslint-plugin": "9.4.0",
|
|
86
86
|
"@gitlab/stylelint-config": "2.6.0",
|
|
87
|
-
"@gitlab/svgs": "1.
|
|
87
|
+
"@gitlab/svgs": "1.221.0",
|
|
88
88
|
"@rollup/plugin-commonjs": "^11.1.0",
|
|
89
89
|
"@rollup/plugin-node-resolve": "^7.1.3",
|
|
90
90
|
"@rollup/plugin-replace": "^2.3.2",
|
|
@@ -129,7 +129,7 @@
|
|
|
129
129
|
"postcss-scss": "^2.1.1",
|
|
130
130
|
"prettier": "2.2.1",
|
|
131
131
|
"pug": "^2.0.3",
|
|
132
|
-
"puppeteer": "^
|
|
132
|
+
"puppeteer": "^10.4.0",
|
|
133
133
|
"raw-loader": "^0.5.1",
|
|
134
134
|
"rollup": "^2.53.1",
|
|
135
135
|
"rollup-plugin-babel": "^4.4.0",
|
|
@@ -1,16 +1,8 @@
|
|
|
1
|
-
import { documentedStoriesOf } from '../../../../documentation/documented_stories';
|
|
2
1
|
import readme from './carousel.md';
|
|
3
2
|
import GlCarousel from './carousel.vue';
|
|
4
3
|
import GlCarouselSlide from './carousel_slide.vue';
|
|
5
4
|
|
|
6
|
-
const
|
|
7
|
-
GlCarousel,
|
|
8
|
-
GlCarouselSlide,
|
|
9
|
-
};
|
|
10
|
-
|
|
11
|
-
documentedStoriesOf('base/carousel', readme).add('default carousel', () => ({
|
|
12
|
-
components,
|
|
13
|
-
template: `
|
|
5
|
+
const template = `
|
|
14
6
|
<gl-carousel
|
|
15
7
|
:interval="0"
|
|
16
8
|
controls
|
|
@@ -34,5 +26,26 @@ documentedStoriesOf('base/carousel', readme).add('default carousel', () => ({
|
|
|
34
26
|
|
|
35
27
|
<!-- Slides with image only -->
|
|
36
28
|
<gl-carousel-slide img-src="./img/carousel_slide3.jpg"/>
|
|
37
|
-
</gl-carousel
|
|
38
|
-
|
|
29
|
+
</gl-carousel>
|
|
30
|
+
`;
|
|
31
|
+
|
|
32
|
+
const Template = () => ({
|
|
33
|
+
components: { GlCarousel, GlCarouselSlide },
|
|
34
|
+
template,
|
|
35
|
+
});
|
|
36
|
+
|
|
37
|
+
export const Default = Template.bind({});
|
|
38
|
+
|
|
39
|
+
export default {
|
|
40
|
+
title: 'base/carousel',
|
|
41
|
+
component: GlCarousel,
|
|
42
|
+
parameters: {
|
|
43
|
+
bootstrapComponent: 'b-carousel',
|
|
44
|
+
knobs: { disable: true },
|
|
45
|
+
docs: {
|
|
46
|
+
description: {
|
|
47
|
+
component: readme,
|
|
48
|
+
},
|
|
49
|
+
},
|
|
50
|
+
},
|
|
51
|
+
};
|
|
@@ -27,7 +27,7 @@ describe('Filtered search token segment', () => {
|
|
|
27
27
|
methods: {
|
|
28
28
|
nextItem: jest.fn(),
|
|
29
29
|
prevItem: jest.fn(),
|
|
30
|
-
getValue:
|
|
30
|
+
getValue: () => 'notnull',
|
|
31
31
|
},
|
|
32
32
|
template: `<div class="ololosha"><slot></slot></div>`,
|
|
33
33
|
};
|
|
@@ -195,6 +195,22 @@ describe('Filtered search token segment', () => {
|
|
|
195
195
|
expect(wrapper.emitted().select[0][0]).toBe(formattedToken);
|
|
196
196
|
expect(wrapper.emitted().complete[0][0]).toBe(formattedToken);
|
|
197
197
|
});
|
|
198
|
+
|
|
199
|
+
it('selects suggestion on press Enter', () => {
|
|
200
|
+
createComponent({ active: true, options: OPTIONS, value: false });
|
|
201
|
+
wrapper.find('input').trigger('keydown', { key: 'ArrowDown' });
|
|
202
|
+
|
|
203
|
+
wrapper.find('input').trigger('keydown', { key: 'Enter' });
|
|
204
|
+
expect(wrapper.emitted('select')).toHaveLength(1);
|
|
205
|
+
});
|
|
206
|
+
|
|
207
|
+
it('selects suggestion on press Colon', () => {
|
|
208
|
+
createComponent({ active: true, options: OPTIONS, value: false });
|
|
209
|
+
wrapper.find('input').trigger('keydown', { key: 'ArrowDown' });
|
|
210
|
+
|
|
211
|
+
wrapper.find('input').trigger('keydown', { key: ':' });
|
|
212
|
+
expect(wrapper.emitted('select')).toHaveLength(1);
|
|
213
|
+
});
|
|
198
214
|
});
|
|
199
215
|
|
|
200
216
|
describe('when multi select', () => {
|
|
@@ -189,13 +189,21 @@ export default {
|
|
|
189
189
|
|
|
190
190
|
const handlers = {
|
|
191
191
|
Enter: () => {
|
|
192
|
+
e.preventDefault();
|
|
192
193
|
if (suggestedValue != null) {
|
|
193
194
|
this.applySuggestion(suggestedValue);
|
|
194
195
|
} else {
|
|
195
196
|
this.$emit('submit');
|
|
196
197
|
}
|
|
197
198
|
},
|
|
199
|
+
':': () => {
|
|
200
|
+
if (suggestedValue != null) {
|
|
201
|
+
e.preventDefault();
|
|
202
|
+
this.applySuggestion(suggestedValue);
|
|
203
|
+
}
|
|
204
|
+
},
|
|
198
205
|
Escape: () => {
|
|
206
|
+
e.preventDefault();
|
|
199
207
|
this.$emit('complete');
|
|
200
208
|
},
|
|
201
209
|
};
|
|
@@ -212,7 +220,6 @@ export default {
|
|
|
212
220
|
}
|
|
213
221
|
|
|
214
222
|
if (Object.keys(handlers).includes(key)) {
|
|
215
|
-
e.preventDefault();
|
|
216
223
|
handlers[key]();
|
|
217
224
|
return;
|
|
218
225
|
}
|
|
@@ -239,6 +246,7 @@ export default {
|
|
|
239
246
|
<div
|
|
240
247
|
class="gl-filtered-search-token-segment"
|
|
241
248
|
:class="{ 'gl-filtered-search-token-segment-active': active }"
|
|
249
|
+
data-testid="filtered-search-token-segment"
|
|
242
250
|
@mousedown.left="emitIfInactive"
|
|
243
251
|
>
|
|
244
252
|
<template v-if="active">
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { shallowMount } from '@vue/test-utils';
|
|
2
|
-
import { BInputGroup } from 'bootstrap-vue';
|
|
2
|
+
import { BInputGroup, BFormInput } from 'bootstrap-vue';
|
|
3
3
|
import GlDropdownItem from '../../dropdown/dropdown_item.vue';
|
|
4
4
|
import InputGroup from './form_input_group.vue';
|
|
5
5
|
|
|
@@ -54,6 +54,23 @@ describe('Input Group', () => {
|
|
|
54
54
|
expect(wrapper.emitted('input')).toBeUndefined();
|
|
55
55
|
});
|
|
56
56
|
|
|
57
|
+
describe('`inputClass` prop', () => {
|
|
58
|
+
it.each`
|
|
59
|
+
inputClass
|
|
60
|
+
${'foo-bar baz'}
|
|
61
|
+
${['foo-bar', 'baz']}
|
|
62
|
+
${{ 'foo-bar': true, baz: true }}
|
|
63
|
+
`('correctly adds classes to input when `inputClass` prop is $inputClass', ({ inputClass }) => {
|
|
64
|
+
createWrapper({
|
|
65
|
+
propsData: { inputClass },
|
|
66
|
+
});
|
|
67
|
+
|
|
68
|
+
expect(wrapper.findComponent(BFormInput).classes()).toEqual(
|
|
69
|
+
expect.arrayContaining(['gl-form-input', 'foo-bar', 'baz'])
|
|
70
|
+
);
|
|
71
|
+
});
|
|
72
|
+
});
|
|
73
|
+
|
|
57
74
|
describe('predefined options', () => {
|
|
58
75
|
const options = [
|
|
59
76
|
{ name: 'Foo', value: 'foo.com' },
|
|
@@ -32,6 +32,11 @@ export default {
|
|
|
32
32
|
required: false,
|
|
33
33
|
default: undefined,
|
|
34
34
|
},
|
|
35
|
+
inputClass: {
|
|
36
|
+
type: [String, Array, Object],
|
|
37
|
+
required: false,
|
|
38
|
+
default: '',
|
|
39
|
+
},
|
|
35
40
|
},
|
|
36
41
|
data() {
|
|
37
42
|
return {
|
|
@@ -73,7 +78,7 @@ export default {
|
|
|
73
78
|
<b-form-input
|
|
74
79
|
ref="input"
|
|
75
80
|
v-model="localValue"
|
|
76
|
-
class="gl-form-input"
|
|
81
|
+
:class="['gl-form-input', inputClass]"
|
|
77
82
|
:aria-label="label"
|
|
78
83
|
v-bind="$attrs"
|
|
79
84
|
v-on="$listeners"
|
|
@@ -1,30 +1,31 @@
|
|
|
1
|
-
import { withKnobs, boolean } from '@storybook/addon-knobs';
|
|
2
|
-
import { documentedStoriesOf } from '../../../../documentation/documented_stories';
|
|
3
1
|
import readme from './markdown.md';
|
|
4
2
|
import GlMarkdown from './markdown.vue';
|
|
5
3
|
import markdownTypescaleDemoContent from './markdown_typescale_demo.html';
|
|
6
4
|
|
|
7
|
-
const
|
|
8
|
-
|
|
9
|
-
|
|
5
|
+
const template = `
|
|
6
|
+
<gl-markdown :compact="compact">${markdownTypescaleDemoContent}</gl-markdown>
|
|
7
|
+
`;
|
|
8
|
+
|
|
9
|
+
const generateProps = ({ compact = false } = {}) => ({ compact });
|
|
10
|
+
|
|
11
|
+
const Template = (args, { argTypes }) => ({
|
|
12
|
+
components: { GlMarkdown },
|
|
13
|
+
props: Object.keys(argTypes),
|
|
14
|
+
template,
|
|
15
|
+
});
|
|
10
16
|
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
},
|
|
17
|
+
export const Typescale = Template.bind({});
|
|
18
|
+
Typescale.args = generateProps();
|
|
19
|
+
|
|
20
|
+
export default {
|
|
21
|
+
title: 'base/markdown',
|
|
22
|
+
component: GlMarkdown,
|
|
23
|
+
parameters: {
|
|
24
|
+
docs: {
|
|
25
|
+
description: {
|
|
26
|
+
component: readme,
|
|
22
27
|
},
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
{
|
|
28
|
-
viewport: { defaultViewport: 'breakpointExtraLarge' },
|
|
29
|
-
}
|
|
30
|
-
);
|
|
28
|
+
},
|
|
29
|
+
knobs: { disabled: true },
|
|
30
|
+
},
|
|
31
|
+
};
|