@gitlab/ui 59.1.1 → 59.3.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 +23 -0
- package/dist/components/base/filtered_search/filtered_search.js +8 -5
- package/dist/components/base/filtered_search/filtered_search_suggestion.js +2 -1
- package/dist/components/base/filtered_search/filtered_search_suggestion_list.js +2 -2
- package/dist/components/base/filtered_search/filtered_search_term.js +1 -1
- package/dist/components/base/filtered_search/filtered_search_token_segment.js +2 -2
- 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/package.json +5 -5
- package/src/components/base/button/button.scss +4 -0
- package/src/components/base/filtered_search/filtered_search.md +4 -3
- package/src/components/base/filtered_search/filtered_search.spec.js +13 -0
- package/src/components/base/filtered_search/filtered_search.stories.js +6 -1
- package/src/components/base/filtered_search/filtered_search.vue +8 -10
- package/src/components/base/filtered_search/filtered_search_suggestion.vue +1 -1
- package/src/components/base/filtered_search/filtered_search_suggestion_list.spec.js +11 -1
- package/src/components/base/filtered_search/filtered_search_suggestion_list.vue +2 -2
- package/src/components/base/filtered_search/filtered_search_term.spec.js +16 -1
- package/src/components/base/filtered_search/filtered_search_term.vue +2 -1
- package/src/components/base/filtered_search/filtered_search_token_segment.vue +2 -2
- package/src/components/charts/sparkline/sparkline.stories.js +2 -0
- package/src/scss/utilities.scss +36 -0
- package/src/scss/utility-mixins/sizing.scss +18 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,26 @@
|
|
|
1
|
+
# [59.3.0](https://gitlab.com/gitlab-org/gitlab-ui/compare/v59.2.0...v59.3.0) (2023-04-04)
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
### Features
|
|
5
|
+
|
|
6
|
+
* **css:** added missing width utility mixins ([2b545cb](https://gitlab.com/gitlab-org/gitlab-ui/commit/2b545cb9bdae51ef8bab7dc16ce4f56dea116e6a))
|
|
7
|
+
|
|
8
|
+
# [59.2.0](https://gitlab.com/gitlab-org/gitlab-ui/compare/v59.1.1...v59.2.0) (2023-03-31)
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
### Bug Fixes
|
|
12
|
+
|
|
13
|
+
* **GlFilteredSearch:** Avoid rare scroll method error ([6001fb4](https://gitlab.com/gitlab-org/gitlab-ui/commit/6001fb48f338486823a427345f0969783eb477d4))
|
|
14
|
+
* **GlFilteredSearch:** Improve activeTokenIdx check in isLastToken ([f5114c0](https://gitlab.com/gitlab-org/gitlab-ui/commit/f5114c07863d149ea8f1f49ed0da70734c9126ac))
|
|
15
|
+
* **GlFilteredSearch:** Improve handling of some falsey values ([8dd22f7](https://gitlab.com/gitlab-org/gitlab-ui/commit/8dd22f7e1941e9820a2db9ba50e87cf9b81540e9)), closes [/gitlab.com/gitlab-org/gitlab/-/blob/2dcb4f37a26ffff6b2cebc6b1f55f1294b1b545d/ee/app/assets/javascripts/roadmap/mixins/filtered_search_mixin.js#L179-180](https://gitlab.com//gitlab.com/gitlab-org/gitlab/-/blob/2dcb4f37a26ffff6b2cebc6b1f55f1294b1b545d/ee/app/assets/javascripts/roadmap/mixins/filtered_search_mixin.js/issues/L179-180)
|
|
16
|
+
* **GlFilteredSearch:** Improve keyboard accessibility ([0798e43](https://gitlab.com/gitlab-org/gitlab-ui/commit/0798e433c7ac8c22300c579613b9f3aa5bc4b929))
|
|
17
|
+
* **GlFilteredSearch:** Remove conditional class ([6854cb9](https://gitlab.com/gitlab-org/gitlab-ui/commit/6854cb993b7534b6d37c4b85a1bc020870ce9d04))
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
### Features
|
|
21
|
+
|
|
22
|
+
* **buttons:** tertiary button selected state ([6654ebb](https://gitlab.com/gitlab-org/gitlab-ui/commit/6654ebbff06a1f8d479bdb5885f816a54d5f2c5e))
|
|
23
|
+
|
|
1
24
|
## [59.1.1](https://gitlab.com/gitlab-org/gitlab-ui/compare/v59.1.0...v59.1.1) (2023-03-31)
|
|
2
25
|
|
|
3
26
|
|
|
@@ -206,7 +206,7 @@ var script = {
|
|
|
206
206
|
return this.activeTokenIdx === idx;
|
|
207
207
|
},
|
|
208
208
|
isLastToken(idx) {
|
|
209
|
-
return
|
|
209
|
+
return this.activeTokenIdx === null && idx === this.lastTokenIdx;
|
|
210
210
|
},
|
|
211
211
|
isLastTokenEmpty() {
|
|
212
212
|
return isEmptyTerm(this.tokens[this.lastTokenIdx]);
|
|
@@ -218,8 +218,11 @@ var script = {
|
|
|
218
218
|
var _this$getTokenEntry;
|
|
219
219
|
return ((_this$getTokenEntry = this.getTokenEntry(type)) === null || _this$getTokenEntry === void 0 ? void 0 : _this$getTokenEntry.token) || GlFilteredSearchTerm;
|
|
220
220
|
},
|
|
221
|
-
|
|
222
|
-
return
|
|
221
|
+
getTokenClassList(idx) {
|
|
222
|
+
return {
|
|
223
|
+
'gl-filtered-search-item': true,
|
|
224
|
+
'gl-filtered-search-last-item': this.isLastToken(idx) && !this.viewOnly
|
|
225
|
+
};
|
|
223
226
|
},
|
|
224
227
|
activate(idx) {
|
|
225
228
|
if (!this.viewOnly) {
|
|
@@ -299,7 +302,7 @@ var script = {
|
|
|
299
302
|
},
|
|
300
303
|
createTokens(idx) {
|
|
301
304
|
let newStrings = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : [''];
|
|
302
|
-
if (this.
|
|
305
|
+
if (!this.isLastTokenActive && newStrings.length === 1 && newStrings[0] === '') {
|
|
303
306
|
this.activeTokenIdx = this.lastTokenIdx;
|
|
304
307
|
return;
|
|
305
308
|
}
|
|
@@ -331,7 +334,7 @@ var script = {
|
|
|
331
334
|
const __vue_script__ = script;
|
|
332
335
|
|
|
333
336
|
/* template */
|
|
334
|
-
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,"search-button-attributes":_vm.searchButtonAttributes,"disabled":_vm.viewOnly,"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",class:{ 'gl-bg-gray-10! gl-inset-border-1-gray-100!': _vm.viewOnly }},_vm._l((_vm.tokens),function(token,idx){return _c(_vm.getTokenComponent(token.type),{key:token.id,ref:"tokens",refInFor:true,tag:"component",
|
|
337
|
+
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,"search-button-attributes":_vm.searchButtonAttributes,"disabled":_vm.viewOnly,"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",class:{ 'gl-bg-gray-10! gl-inset-border-1-gray-100!': _vm.viewOnly }},_vm._l((_vm.tokens),function(token,idx){return _c(_vm.getTokenComponent(token.type),{key:token.id,ref:"tokens",refInFor:true,tag:"component",class:_vm.getTokenClassList(idx),attrs:{"config":_vm.getTokenEntry(token.type),"active":_vm.activeTokenIdx === idx,"cursor-position":_vm.intendedCursorPosition,"available-tokens":_vm.currentAvailableTokens,"current-value":_vm.tokens,"index":idx,"placeholder":_vm.termPlaceholder,"show-friendly-text":_vm.showFriendlyText,"search-input-attributes":_vm.searchInputAttributes,"view-only":_vm.viewOnly,"is-last-token":_vm.isLastToken(idx)},on:{"activate":function($event){return _vm.activate(idx)},"deactivate":function($event){return _vm.deactivate(token)},"destroy":function($event){return _vm.destroyToken(idx, $event)},"replace":function($event){return _vm.replaceToken(idx, $event)},"complete":_vm.completeToken,"submit":_vm.submit,"split":function($event){return _vm.createTokens(idx, $event)},"previous":_vm.activatePreviousToken,"next":_vm.activateNextToken},scopedSlots:_vm._u([(_vm.hasTitleSlot() && _vm.getTokenComponent(token.type).name === 'GlFilteredSearchTerm')?{key:"title",fn:function(title){return [_vm._t("title",null,null,title)]}}:null],null,true),model:{value:(token.value),callback:function ($$v) {_vm.$set(token, "value", $$v);},expression:"token.value"}})}),1),_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))};
|
|
335
338
|
var __vue_staticRenderFns__ = [];
|
|
336
339
|
|
|
337
340
|
/* style */
|
|
@@ -26,7 +26,8 @@ var script = {
|
|
|
26
26
|
isActive(newValue) {
|
|
27
27
|
if (newValue) {
|
|
28
28
|
window.requestAnimationFrame(() => {
|
|
29
|
-
|
|
29
|
+
var _this$$refs$item, _this$$refs$item$$el;
|
|
30
|
+
(_this$$refs$item = this.$refs.item) === null || _this$$refs$item === void 0 ? void 0 : (_this$$refs$item$$el = _this$$refs$item.$el) === null || _this$$refs$item$$el === void 0 ? void 0 : _this$$refs$item$$el.scrollIntoView({
|
|
30
31
|
block: 'nearest',
|
|
31
32
|
inline: 'end'
|
|
32
33
|
});
|
|
@@ -39,8 +39,8 @@ var script = {
|
|
|
39
39
|
},
|
|
40
40
|
methods: {
|
|
41
41
|
valuesMatch(firstValue, secondValue) {
|
|
42
|
-
if (
|
|
43
|
-
return typeof firstValue === 'string' ? firstValue.toLowerCase() === secondValue.toLowerCase() : firstValue === secondValue;
|
|
42
|
+
if (firstValue == null || secondValue == null) return false;
|
|
43
|
+
return typeof firstValue === 'string' && typeof secondValue === 'string' ? firstValue.toLowerCase() === secondValue.toLowerCase() : firstValue === secondValue;
|
|
44
44
|
},
|
|
45
45
|
register(item) {
|
|
46
46
|
this.registeredItems.push(item);
|
|
@@ -118,7 +118,7 @@ var script = {
|
|
|
118
118
|
const __vue_script__ = script;
|
|
119
119
|
|
|
120
120
|
/* template */
|
|
121
|
-
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",attrs:{"data-testid":"filtered-search-term"}},[_c('gl-filtered-search-token-segment',{ref:"segment",staticClass:"gl-filtered-search-term-token",
|
|
121
|
+
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",attrs:{"data-testid":"filtered-search-term"}},[_c('gl-filtered-search-token-segment',{ref:"segment",staticClass:"gl-filtered-search-term-token",attrs:{"active":_vm.active,"cursor-position":_vm.cursorPosition,"search-input-attributes":_vm.searchInputAttributes,"is-last-token":_vm.isLastToken,"current-value":_vm.currentValue,"view-only":_vm.viewOnly},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":_vm.onBackspace,"submit":function($event){return _vm.$emit('submit')},"split":function($event){return _vm.$emit('split', $event)},"previous":function($event){return _vm.$emit('previous')},"next":function($event){return _vm.$emit('next')}},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._t("title",function(){return [_vm._v(" "+_vm._s(item.title)+" ")]},null,{ value: item.title })],2)})},proxy:true},{key:"view",fn:function(){return [(_vm.placeholder)?_c('input',_vm._b({staticClass:"gl-filtered-search-term-input",class:{ 'gl-bg-gray-10': _vm.viewOnly },attrs:{"placeholder":_vm.placeholder,"aria-label":_vm.placeholder,"readonly":_vm.viewOnly,"data-testid":"filtered-search-term-input"},on:{"focusin":function($event){return _vm.$emit('activate')},"focusout":function($event){return _vm.$emit('deactivate')}}},'input',_vm.searchInputAttributes,false)):[_vm._v(_vm._s(_vm.value.data))]]},proxy:true}],null,true),model:{value:(_vm.internalValue),callback:function ($$v) {_vm.internalValue=$$v;},expression:"internalValue"}})],1)};
|
|
122
122
|
var __vue_staticRenderFns__ = [];
|
|
123
123
|
|
|
124
124
|
/* style */
|
|
@@ -163,10 +163,10 @@ var script = {
|
|
|
163
163
|
return this.nonMultipleValue;
|
|
164
164
|
}
|
|
165
165
|
if (this.value) {
|
|
166
|
-
const
|
|
166
|
+
const option = this.getMatchingOptionForInputValue(this.inputValue) || this.getMatchingOptionForInputValue(this.inputValue, {
|
|
167
167
|
loose: true
|
|
168
168
|
});
|
|
169
|
-
return
|
|
169
|
+
return option === null || option === void 0 ? void 0 : option.value;
|
|
170
170
|
}
|
|
171
171
|
const defaultSuggestion = this.options.find(op => op.default);
|
|
172
172
|
return (_ref = defaultSuggestion !== null && defaultSuggestion !== void 0 ? defaultSuggestion : this.options[0]) === null || _ref === void 0 ? void 0 : _ref.value;
|