@gitlab/ui 129.1.1 → 129.2.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/dist/components/base/new_dropdowns/listbox/listbox.js +12 -2
- package/dist/components/base/table/table.js +4 -2
- package/dist/index.css +1 -1
- package/dist/index.css.map +1 -1
- package/package.json +6 -6
- package/src/components/base/new_dropdowns/listbox/listbox.vue +15 -2
- package/src/components/base/table/table.vue +7 -0
- package/src/vendor/bootstrap-vue/src/_variables.scss +1 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { uniqueId, clamp } from 'lodash-es';
|
|
1
|
+
import { uniqueId, isEqual, clamp } from 'lodash-es';
|
|
2
2
|
import { logWarning, stopEvent } from '../../../../utils/utils';
|
|
3
3
|
import { GL_DROPDOWN_SHOWN, GL_DROPDOWN_HIDDEN, GL_DROPDOWN_FOCUS_CONTENT, POSITION_ABSOLUTE, POSITION_FIXED, GL_DROPDOWN_CONTENTS_CLASS, ENTER, ARROW_DOWN, ARROW_UP, END, HOME } from '../constants';
|
|
4
4
|
import { buttonCategoryOptions, dropdownVariantOptions, buttonSizeOptions, dropdownPlacements } from '../../../../utils/constants';
|
|
@@ -548,7 +548,7 @@ var script = {
|
|
|
548
548
|
watch: {
|
|
549
549
|
selected: {
|
|
550
550
|
immediate: true,
|
|
551
|
-
handler(newSelected) {
|
|
551
|
+
handler(newSelected, oldSelected) {
|
|
552
552
|
if (Array.isArray(newSelected)) {
|
|
553
553
|
if (process.env.NODE_ENV !== 'production' && !this.multiple && newSelected.length) {
|
|
554
554
|
throw new Error('To allow multi-selection, please, set "multiple" property to "true"');
|
|
@@ -557,6 +557,16 @@ var script = {
|
|
|
557
557
|
} else {
|
|
558
558
|
this.selectedValues = [newSelected];
|
|
559
559
|
}
|
|
560
|
+
if (
|
|
561
|
+
// Do not emit change event immediately on watcher creation.
|
|
562
|
+
oldSelected !== undefined && !isEqual(newSelected, oldSelected)) {
|
|
563
|
+
/**
|
|
564
|
+
* Emitted when the selected prop value changes
|
|
565
|
+
*
|
|
566
|
+
* @event change
|
|
567
|
+
*/
|
|
568
|
+
this.$emit('change');
|
|
569
|
+
}
|
|
560
570
|
}
|
|
561
571
|
},
|
|
562
572
|
items: {
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { BTable } from '../../../vendor/bootstrap-vue/src/components/table/table';
|
|
2
2
|
import { isDev, logWarning } from '../../../utils/utils';
|
|
3
|
+
import GlLoadingIcon from '../loading_icon/loading_icon';
|
|
3
4
|
import { glTableLiteWarning, tableFullProps, tableFullSlots } from './constants';
|
|
4
5
|
import __vue_normalize__ from 'vue-runtime-helpers/dist/normalize-component.js';
|
|
5
6
|
|
|
@@ -16,7 +17,8 @@ const {
|
|
|
16
17
|
var script = {
|
|
17
18
|
name: 'GlTable',
|
|
18
19
|
components: {
|
|
19
|
-
BTable
|
|
20
|
+
BTable,
|
|
21
|
+
GlLoadingIcon
|
|
20
22
|
},
|
|
21
23
|
inheritAttrs: false,
|
|
22
24
|
props: {
|
|
@@ -150,7 +152,7 @@ var script = {
|
|
|
150
152
|
const __vue_script__ = script;
|
|
151
153
|
|
|
152
154
|
/* template */
|
|
153
|
-
var __vue_render__ = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('b-table',_vm._g(_vm._b({attrs:{"table-class":_vm.localTableClass,"fields":_vm.computedFields,"items":_vm.items,"sort-by":_vm.localSortBy,"sort-desc":_vm.localSortDesc,"no-sort-reset":""},on:{"update:sortBy":function($event){_vm.localSortBy=$event;},"update:sort-by":function($event){_vm.localSortBy=$event;},"update:sortDesc":function($event){_vm.localSortDesc=$event;},"update:sort-desc":function($event){_vm.localSortDesc=$event;}},scopedSlots:_vm._u([_vm._l((Object.keys(_vm.$scopedSlots)),function(slotName){return {key:slotName,fn:function(scope){return [_vm._t(slotName,null,null,scope)]}}}),_vm._l((_vm.headSlots),function(headSlotName){return {key:headSlotName,fn:function(scope){return [_c('div',{key:headSlotName,staticClass:"gl-flex"},[_vm._t(headSlotName,function(){return [_c('span',[_vm._v(_vm._s(scope.label))])]},null,scope),(_vm.isSortable(scope))?[_c('div',{staticClass:"gl-table-th-sort-icon-wrapper gl-flex gl-w-5 gl-justify-center"},[_c('span',{class:{ 'gl-hidden': !_vm.activeSortingColumn(scope) },attrs:{"name":"sort-icon","data-testid":"sort-icon"}},[_vm._v("\n "+_vm._s(_vm.getSortingIcon(scope))+"\n ")])])]:_vm._e()],2)]}}}),{key:"empty",fn:function(scope){return [_vm._t("empty",function(){return [_c('p',{staticClass:"gl-mb-0 gl-py-2 gl-text-subtle"},[_vm._v(_vm._s(scope.emptyText))])]},null,scope)]}}],null,true)},'b-table',_vm.$attrs,false),_vm.$listeners))};
|
|
155
|
+
var __vue_render__ = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('b-table',_vm._g(_vm._b({attrs:{"table-class":_vm.localTableClass,"fields":_vm.computedFields,"items":_vm.items,"sort-by":_vm.localSortBy,"sort-desc":_vm.localSortDesc,"no-sort-reset":""},on:{"update:sortBy":function($event){_vm.localSortBy=$event;},"update:sort-by":function($event){_vm.localSortBy=$event;},"update:sortDesc":function($event){_vm.localSortDesc=$event;},"update:sort-desc":function($event){_vm.localSortDesc=$event;}},scopedSlots:_vm._u([_vm._l((Object.keys(_vm.$scopedSlots)),function(slotName){return {key:slotName,fn:function(scope){return [_vm._t(slotName,null,null,scope)]}}}),_vm._l((_vm.headSlots),function(headSlotName){return {key:headSlotName,fn:function(scope){return [_c('div',{key:headSlotName,staticClass:"gl-flex"},[_vm._t(headSlotName,function(){return [_c('span',[_vm._v(_vm._s(scope.label))])]},null,scope),(_vm.isSortable(scope))?[_c('div',{staticClass:"gl-table-th-sort-icon-wrapper gl-flex gl-w-5 gl-justify-center"},[_c('span',{class:{ 'gl-hidden': !_vm.activeSortingColumn(scope) },attrs:{"name":"sort-icon","data-testid":"sort-icon"}},[_vm._v("\n "+_vm._s(_vm.getSortingIcon(scope))+"\n ")])])]:_vm._e()],2)]}}}),{key:"table-busy",fn:function(){return [_vm._t("table-busy",function(){return [_c('gl-loading-icon',{attrs:{"size":"lg"}})]})]},proxy:true},{key:"empty",fn:function(scope){return [_vm._t("empty",function(){return [_c('p',{staticClass:"gl-mb-0 gl-py-2 gl-text-subtle"},[_vm._v(_vm._s(scope.emptyText))])]},null,scope)]}}],null,true)},'b-table',_vm.$attrs,false),_vm.$listeners))};
|
|
154
156
|
var __vue_staticRenderFns__ = [];
|
|
155
157
|
|
|
156
158
|
/* style */
|