@gitlab/ui 38.4.0 → 38.6.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gitlab/ui",
3
- "version": "38.4.0",
3
+ "version": "38.6.0",
4
4
  "description": "GitLab UI Components",
5
5
  "license": "MIT",
6
6
  "main": "dist/index.js",
@@ -88,7 +88,7 @@
88
88
  "@babel/preset-env": "^7.10.2",
89
89
  "@gitlab/eslint-plugin": "12.0.1",
90
90
  "@gitlab/stylelint-config": "4.0.0",
91
- "@gitlab/svgs": "2.7.0",
91
+ "@gitlab/svgs": "2.8.0",
92
92
  "@rollup/plugin-commonjs": "^11.1.0",
93
93
  "@rollup/plugin-node-resolve": "^7.1.3",
94
94
  "@rollup/plugin-replace": "^2.3.2",
@@ -73,6 +73,20 @@ describe('datepicker component', () => {
73
73
  expect(Pikaday.prototype.show).toHaveBeenCalled();
74
74
  });
75
75
 
76
+ describe('when `ariaLabel` prop is passed', () => {
77
+ it('configures pikaday with the given label', () => {
78
+ const ariaLabel = 'Meaningful description';
79
+
80
+ mountWithOptions({
81
+ propsData: {
82
+ ariaLabel,
83
+ },
84
+ });
85
+
86
+ expect(pikadayConfig().ariaLabel).toBe(ariaLabel);
87
+ });
88
+ });
89
+
76
90
  describe('when `target` prop is not passed', () => {
77
91
  it('sets calendar icon as `trigger` option', () => {
78
92
  const wrapper = mountWithOptions();
@@ -86,7 +86,7 @@ export default {
86
86
  'endRange',
87
87
  'disableDayFn',
88
88
  'firstDay',
89
- 'arialLabel',
89
+ 'ariaLabel',
90
90
  'placeholder',
91
91
  'autocomplete',
92
92
  'disabled',
@@ -99,7 +99,7 @@ export default {
99
99
  required: false,
100
100
  default: 0,
101
101
  },
102
- arialLabel: {
102
+ ariaLabel: {
103
103
  type: String,
104
104
  required: false,
105
105
  default: '',
@@ -244,7 +244,7 @@ export default {
244
244
  },
245
245
  disableDayFn: this.disableDayFn,
246
246
  firstDay: this.firstDay,
247
- arialLabel: this.ariaLabel,
247
+ ariaLabel: this.ariaLabel,
248
248
  toString: (date) => defaultDateFormatter(date),
249
249
  onSelect: this.selected.bind(this),
250
250
  onClose: this.closed.bind(this),
@@ -218,7 +218,7 @@ export const WithHeaderAndFooter = (args, { argTypes }) => ({
218
218
  <gl-dropdown-item>Fifth item</gl-dropdown-item>
219
219
  <gl-dropdown-item>Sixth item</gl-dropdown-item>
220
220
  <gl-dropdown-item>Seventh item</gl-dropdown-item>
221
- <gl-dropdown-item>Eigth item</gl-dropdown-item>
221
+ <gl-dropdown-item>Eighth item</gl-dropdown-item>
222
222
  <template #footer>
223
223
  <gl-dropdown-item>First footer item</gl-dropdown-item>
224
224
  <gl-dropdown-item>Second footer item</gl-dropdown-item>
@@ -730,4 +730,23 @@ describe('Filtered search integration tests', () => {
730
730
  wrapper.findAllComponents(GlFilteredSearchToken).wrappers.map((cmp) => cmp.props('active'))
731
731
  ).toEqual([false, false]);
732
732
  });
733
+
734
+ it('updates tokens list when value is passed dynamically', async () => {
735
+ mountComponent({ value: ['one'] });
736
+ await nextTick();
737
+
738
+ expect(wrapper.findAllComponents(GlFilteredSearchTerm)).toHaveLength(2);
739
+
740
+ await wrapper.setProps({
741
+ value: ['one two'],
742
+ });
743
+
744
+ const termComponents = wrapper.findAllComponents(GlFilteredSearchTerm).wrappers;
745
+ expect(termComponents).toHaveLength(3);
746
+ expect(termComponents.map((termComponent) => termComponent.props('value'))).toEqual([
747
+ { data: 'one' },
748
+ { data: 'two' },
749
+ { data: '' },
750
+ ]);
751
+ });
733
752
  });
@@ -1,5 +1,5 @@
1
1
  <script>
2
- import { cloneDeep } from 'lodash';
2
+ import { cloneDeep, isEqual } from 'lodash';
3
3
  import PortalVue from 'portal-vue';
4
4
  import Vue from 'vue';
5
5
  import { GlTooltipDirective } from '../../../directives/tooltip';
@@ -174,11 +174,14 @@ export default {
174
174
  deep: true,
175
175
  immediate: true,
176
176
  },
177
- },
178
- mounted() {
179
- if (this.value.length) {
180
- this.applyNewValue(cloneDeep(this.value));
181
- }
177
+ value: {
178
+ handler(newValue, oldValue) {
179
+ if (newValue.length && !isEqual(newValue, oldValue)) {
180
+ this.applyNewValue(cloneDeep(newValue));
181
+ }
182
+ },
183
+ immediate: true,
184
+ },
182
185
  },
183
186
 
184
187
  methods: {
@@ -36,6 +36,14 @@ describe('search box by click component', () => {
36
36
  expect(wrapper.emitted().input).toEqual([['new value']]);
37
37
  });
38
38
 
39
+ it('does not emit an input event when input is updated to the same value', async () => {
40
+ createComponent({ value: 'somevalue' });
41
+
42
+ await wrapper.setProps({ value: 'another value' });
43
+
44
+ expect(wrapper.emitted().input).toBe(undefined);
45
+ });
46
+
39
47
  it('does not displays history dropdown by default', () => {
40
48
  createComponent();
41
49
  expect(wrapper.findComponent({ ref: 'historyDropdown' }).exists()).toBe(false);
@@ -152,6 +152,7 @@ export default {
152
152
  immediate: true,
153
153
  },
154
154
  currentValue(newValue) {
155
+ if (newValue === this.value) return;
155
156
  this.$emit('input', newValue);
156
157
  },
157
158
  },
@@ -4611,6 +4611,18 @@
4611
4611
  max-width: 100vw !important;
4612
4612
  }
4613
4613
 
4614
+ .gl-md-max-w-26 {
4615
+ @include gl-media-breakpoint-up(md) {
4616
+ max-width: $gl-spacing-scale-26;
4617
+ }
4618
+ }
4619
+
4620
+ .gl-md-max-w-26\! {
4621
+ @include gl-media-breakpoint-up(md) {
4622
+ max-width: $gl-spacing-scale-26 !important;
4623
+ }
4624
+ }
4625
+
4614
4626
  .gl-md-max-w-15p {
4615
4627
  @include gl-media-breakpoint-up(md) {
4616
4628
  max-width: 15%;
@@ -6931,169 +6943,179 @@
6931
6943
  .gl-table-layout-fixed\! {
6932
6944
  table-layout: fixed !important
6933
6945
  }
6934
- .gl-text-left{
6935
- text-align: left
6946
+ .gl-text-left {
6947
+ text-align: left;
6948
+ }
6949
+ .gl-text-left\! {
6950
+ text-align: left !important;
6951
+ }
6952
+ .gl-text-center {
6953
+ text-align: center;
6936
6954
  }
6937
- .gl-text-left\!{
6938
- text-align: left !important
6955
+ .gl-text-center\! {
6956
+ text-align: center !important;
6939
6957
  }
6940
- .gl-text-center{
6941
- text-align: center
6958
+ .gl-text-right {
6959
+ text-align: right;
6942
6960
  }
6943
- .gl-text-center\!{
6944
- text-align: center !important
6961
+ .gl-text-right\! {
6962
+ text-align: right !important;
6945
6963
  }
6946
- .gl-text-right{
6947
- text-align: right
6964
+ .gl-reset-text-align {
6965
+ text-align: inherit;
6948
6966
  }
6949
- .gl-text-right\!{
6950
- text-align: right !important
6967
+ .gl-reset-text-align\! {
6968
+ text-align: inherit !important;
6951
6969
  }
6952
- .gl-reset-text-align{
6953
- text-align: inherit
6970
+ .gl-text-decoration-none {
6971
+ text-decoration: none;
6954
6972
  }
6955
- .gl-reset-text-align\!{
6956
- text-align: inherit !important
6973
+ .gl-active-text-decoration-none:active {
6974
+ text-decoration: none;
6957
6975
  }
6958
- .gl-text-decoration-none{
6959
- text-decoration: none
6976
+ .gl-focus-text-decoration-none:focus {
6977
+ text-decoration: none;
6960
6978
  }
6961
- .gl-active-text-decoration-none:active{
6962
- text-decoration: none
6979
+ .gl-hover-text-decoration-none:hover {
6980
+ text-decoration: none;
6963
6981
  }
6964
- .gl-focus-text-decoration-none:focus{
6965
- text-decoration: none
6982
+ .gl-text-decoration-none\! {
6983
+ text-decoration: none !important;
6966
6984
  }
6967
- .gl-hover-text-decoration-none:hover{
6968
- text-decoration: none
6985
+ .gl-active-text-decoration-none\!:active {
6986
+ text-decoration: none !important;
6969
6987
  }
6970
- .gl-text-decoration-none\!{
6971
- text-decoration: none !important
6988
+ .gl-focus-text-decoration-none\!:focus {
6989
+ text-decoration: none !important;
6972
6990
  }
6973
- .gl-active-text-decoration-none\!:active{
6974
- text-decoration: none !important
6991
+ .gl-hover-text-decoration-none\!:hover {
6992
+ text-decoration: none !important;
6975
6993
  }
6976
- .gl-focus-text-decoration-none\!:focus{
6977
- text-decoration: none !important
6994
+ .gl-text-decoration-underline {
6995
+ text-decoration: underline;
6978
6996
  }
6979
- .gl-hover-text-decoration-none\!:hover{
6980
- text-decoration: none !important
6997
+ .gl-text-decoration-underline\! {
6998
+ text-decoration: underline !important;
6981
6999
  }
6982
- .gl-text-decoration-underline{
6983
- text-decoration: underline
7000
+ .gl-reset-text-decoration-color {
7001
+ text-decoration-color: inherit;
6984
7002
  }
6985
- .gl-text-decoration-underline\!{
6986
- text-decoration: underline !important
7003
+ .gl-reset-text-decoration-color\! {
7004
+ text-decoration-color: inherit !important;
6987
7005
  }
6988
- .gl-reset-text-decoration-color{
6989
- text-decoration-color: inherit
7006
+ .gl-text-decoration-color-gray-500 {
7007
+ text-decoration-color: $gray-500;
6990
7008
  }
6991
- .gl-reset-text-decoration-color\!{
6992
- text-decoration-color: inherit !important
7009
+ .gl-text-decoration-color-gray-500\! {
7010
+ text-decoration-color: $gray-500 !important;
6993
7011
  }
6994
- .gl-text-decoration-color-gray-500{
6995
- text-decoration-color: $gray-500
7012
+ .gl-text-decoration-color-gray-700 {
7013
+ text-decoration-color: $gray-700;
6996
7014
  }
6997
- .gl-text-decoration-color-gray-500\!{
6998
- text-decoration-color: $gray-500 !important
7015
+ .gl-text-decoration-color-gray-700\! {
7016
+ text-decoration-color: $gray-700 !important;
6999
7017
  }
7000
- .gl-text-decoration-color-gray-700{
7001
- text-decoration-color: $gray-700
7018
+ .gl-text-decoration-color-gray-900 {
7019
+ text-decoration-color: $gray-900;
7002
7020
  }
7003
- .gl-text-decoration-color-gray-700\!{
7004
- text-decoration-color: $gray-700 !important
7021
+ .gl-text-decoration-color-gray-900\! {
7022
+ text-decoration-color: $gray-900 !important;
7005
7023
  }
7006
- .gl-text-decoration-color-gray-900{
7007
- text-decoration-color: $gray-900
7024
+ .gl-text-transform-none {
7025
+ text-transform: none;
7008
7026
  }
7009
- .gl-text-decoration-color-gray-900\!{
7010
- text-decoration-color: $gray-900 !important
7027
+ .gl-text-transform-none\! {
7028
+ text-transform: none !important;
7011
7029
  }
7012
- .gl-text-transform-none{
7013
- text-transform: none
7030
+ .gl-text-overflow-ellipsis {
7031
+ text-overflow: ellipsis;
7014
7032
  }
7015
- .gl-text-transform-none\!{
7016
- text-transform: none !important
7033
+ .gl-text-overflow-ellipsis\! {
7034
+ text-overflow: ellipsis !important;
7017
7035
  }
7018
- .gl-text-overflow-ellipsis{
7019
- text-overflow: ellipsis
7036
+ .gl-text-indent-0 {
7037
+ text-indent: 0;
7020
7038
  }
7021
- .gl-text-overflow-ellipsis\!{
7022
- text-overflow: ellipsis !important
7039
+ .gl-text-indent-0\! {
7040
+ text-indent: 0 !important;
7023
7041
  }
7024
- .gl-text-indent-0{
7025
- text-indent: 0
7042
+ .gl-text-indent-hide {
7043
+ text-indent: -9999px;
7026
7044
  }
7027
- .gl-text-indent-0\!{
7028
- text-indent: 0 !important
7045
+ .gl-text-indent-hide\! {
7046
+ text-indent: -9999px !important;
7029
7047
  }
7030
- .gl-text-indent-hide{
7031
- text-indent: -9999px
7048
+ .gl-white-space-normal {
7049
+ white-space: normal;
7032
7050
  }
7033
- .gl-text-indent-hide\!{
7034
- text-indent: -9999px !important
7051
+ .gl-white-space-normal\! {
7052
+ white-space: normal !important;
7035
7053
  }
7036
- .gl-white-space-normal{
7037
- white-space: normal
7054
+ .gl-white-space-nowrap {
7055
+ white-space: nowrap;
7038
7056
  }
7039
- .gl-white-space-normal\!{
7040
- white-space: normal !important
7057
+ .gl-white-space-nowrap\! {
7058
+ white-space: nowrap !important;
7041
7059
  }
7042
- .gl-white-space-nowrap{
7043
- white-space: nowrap
7060
+ .gl-white-space-pre-wrap {
7061
+ white-space: pre-wrap;
7044
7062
  }
7045
- .gl-white-space-nowrap\!{
7046
- white-space: nowrap !important
7063
+ .gl-white-space-pre-wrap\! {
7064
+ white-space: pre-wrap !important;
7047
7065
  }
7048
- .gl-white-space-pre-wrap{
7049
- white-space: pre-wrap
7066
+ .gl-white-space-pre-line {
7067
+ white-space: pre-line;
7050
7068
  }
7051
- .gl-white-space-pre-wrap\!{
7052
- white-space: pre-wrap !important
7069
+ .gl-white-space-pre-line\! {
7070
+ white-space: pre-line !important;
7053
7071
  }
7054
- .gl-white-space-pre-line{
7055
- white-space: pre-line
7072
+ .gl-md-white-space-nowrap {
7073
+ @include gl-media-breakpoint-up(md) {
7074
+ white-space: nowrap;
7075
+ }
7056
7076
  }
7057
- .gl-white-space-pre-line\!{
7058
- white-space: pre-line !important
7077
+ .gl-md-white-space-nowrap\! {
7078
+ @include gl-media-breakpoint-up(md) {
7079
+ white-space: nowrap !important;
7080
+ }
7059
7081
  }
7060
- .gl-word-break-all{
7061
- word-break: break-all
7082
+ .gl-word-break-all {
7083
+ word-break: break-all;
7062
7084
  }
7063
- .gl-word-break-all\!{
7064
- word-break: break-all !important
7085
+ .gl-word-break-all\! {
7086
+ word-break: break-all !important;
7065
7087
  }
7066
- .gl-word-break-word{
7067
- word-break: break-word
7088
+ .gl-word-break-word {
7089
+ word-break: break-word;
7068
7090
  }
7069
- .gl-word-break-word\!{
7070
- word-break: break-word !important
7091
+ .gl-word-break-word\! {
7092
+ word-break: break-word !important;
7071
7093
  }
7072
- .gl-overflow-break-word{
7094
+ .gl-overflow-break-word {
7073
7095
  overflow-wrap: break-word;
7074
7096
  word-wrap: break-word;
7075
- hyphens: auto
7097
+ hyphens: auto;
7076
7098
  }
7077
- .gl-overflow-break-word\!{
7099
+ .gl-overflow-break-word\! {
7078
7100
  overflow-wrap: break-word !important;
7079
7101
  word-wrap: break-word !important;
7080
- hyphens: auto !important
7102
+ hyphens: auto !important;
7081
7103
  }
7082
- .gl-str-truncated{
7083
- @include str-truncated
7104
+ .gl-str-truncated {
7105
+ @include str-truncated;
7084
7106
  }
7085
- .gl-str-truncated\!{
7086
- @include str-truncated
7107
+ .gl-str-truncated\! {
7108
+ @include str-truncated;
7087
7109
  }
7088
- .gl-text-truncate{
7110
+ .gl-text-truncate {
7089
7111
  overflow: hidden;
7090
7112
  text-overflow: ellipsis;
7091
- white-space: nowrap
7113
+ white-space: nowrap;
7092
7114
  }
7093
- .gl-text-truncate\!{
7115
+ .gl-text-truncate\! {
7094
7116
  overflow: hidden !important;
7095
7117
  text-overflow: ellipsis !important;
7096
- white-space: nowrap !important
7118
+ white-space: nowrap !important;
7097
7119
  }
7098
7120
  .gl-translate-x-0 {
7099
7121
  transform: translateX(0)
@@ -343,6 +343,12 @@
343
343
  * - Utilities should strictly follow $gl-spacing-scale
344
344
  */
345
345
 
346
+ @mixin gl-md-max-w-26 {
347
+ @include gl-media-breakpoint-up(md) {
348
+ max-width: $gl-spacing-scale-26;
349
+ }
350
+ }
351
+
346
352
  @mixin gl-md-max-w-15p {
347
353
  @include gl-media-breakpoint-up(md) {
348
354
  max-width: 15%;
@@ -93,6 +93,18 @@
93
93
  white-space: pre-line;
94
94
  }
95
95
 
96
+ /**
97
+ * Responsive White-space utilities
98
+ *
99
+ * naming convention: gl-{breakpoint}-white-space-{value}
100
+ */
101
+
102
+ @mixin gl-md-white-space-nowrap {
103
+ @include gl-media-breakpoint-up(md) {
104
+ white-space: nowrap;
105
+ }
106
+ }
107
+
96
108
  /**
97
109
  * Word utilities.
98
110
  *