@gitlab/ui 128.4.0 → 128.5.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.
|
@@ -7,7 +7,6 @@ import { isEvent } from '../../../vendor/bootstrap-vue/src/utils/inspect';
|
|
|
7
7
|
import GlIcon from '../icon/icon';
|
|
8
8
|
import GlLoadingIcon from '../loading_icon/loading_icon';
|
|
9
9
|
import { SPACE, ENTER } from '../new_dropdowns/constants';
|
|
10
|
-
import { glButtonConfig } from '../../../config';
|
|
11
10
|
import __vue_normalize__ from 'vue-runtime-helpers/dist/normalize-component.js';
|
|
12
11
|
|
|
13
12
|
var script = {
|
|
@@ -77,14 +76,6 @@ var script = {
|
|
|
77
76
|
required: false,
|
|
78
77
|
default: false
|
|
79
78
|
},
|
|
80
|
-
/**
|
|
81
|
-
* Keep the button accessible when `loading` is `true`.
|
|
82
|
-
*/
|
|
83
|
-
accessibleLoading: {
|
|
84
|
-
type: Boolean,
|
|
85
|
-
required: false,
|
|
86
|
-
default: () => glButtonConfig.accessibleLoadingButton
|
|
87
|
-
},
|
|
88
79
|
/**
|
|
89
80
|
* CSS classes to add to the button text.
|
|
90
81
|
*/
|
|
@@ -242,10 +233,10 @@ var script = {
|
|
|
242
233
|
return isSlotEmpty(this, 'default') && this.hasIcon && this.count == null;
|
|
243
234
|
},
|
|
244
235
|
isButtonDisabled() {
|
|
245
|
-
return this.disabled
|
|
236
|
+
return this.disabled;
|
|
246
237
|
},
|
|
247
238
|
isButtonAriaDisabled() {
|
|
248
|
-
return this.
|
|
239
|
+
return this.isButton && this.loading;
|
|
249
240
|
},
|
|
250
241
|
buttonClasses() {
|
|
251
242
|
const classes = ['btn', 'gl-button', `btn-${this.variant}`, `btn-${this.buttonSize}`];
|
|
@@ -310,8 +301,7 @@ var script = {
|
|
|
310
301
|
tabindex: this.tabindex,
|
|
311
302
|
// We set the `aria-disabled` state for buttons while loading
|
|
312
303
|
...(this.isButtonAriaDisabled ? {
|
|
313
|
-
'aria-disabled': 'true'
|
|
314
|
-
disabled: null
|
|
304
|
+
'aria-disabled': 'true'
|
|
315
305
|
} : {})
|
|
316
306
|
};
|
|
317
307
|
if (this.isLink) {
|
package/dist/config.js
CHANGED
|
@@ -35,7 +35,6 @@ const i18n = translationKeys;
|
|
|
35
35
|
const defaultConfig = {
|
|
36
36
|
firstDayOfWeek: 0 // Defaults to 0 (Sunday)
|
|
37
37
|
};
|
|
38
|
-
const glButtonConfig = {};
|
|
39
38
|
let configured = false;
|
|
40
39
|
|
|
41
40
|
/**
|
|
@@ -51,8 +50,7 @@ let configured = false;
|
|
|
51
50
|
const setConfigs = function () {
|
|
52
51
|
let {
|
|
53
52
|
translations,
|
|
54
|
-
firstDayOfWeek
|
|
55
|
-
accessibleLoadingButton = false
|
|
53
|
+
firstDayOfWeek
|
|
56
54
|
} = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
57
55
|
if (configured) {
|
|
58
56
|
if (process.env.NODE_ENV === 'development') {
|
|
@@ -87,23 +85,6 @@ const setConfigs = function () {
|
|
|
87
85
|
}
|
|
88
86
|
Object.assign(i18n, translations);
|
|
89
87
|
}
|
|
90
|
-
|
|
91
|
-
// Temporary flag to enable the accessible loading button feature.
|
|
92
|
-
// This flag allows the feature to be opt-in during the rollout phase,
|
|
93
|
-
// giving us the flexibility to test and validate its impact on user experience.
|
|
94
|
-
|
|
95
|
-
// The global variable `accessibleLoadingButton` is set to a boolean value
|
|
96
|
-
// to indicate whether the button should be disabled while loading.
|
|
97
|
-
|
|
98
|
-
// Future Plan:
|
|
99
|
-
// Once the accessible loading button feature is validated and stable,
|
|
100
|
-
// we will remove this temporary flag and make the feature the default behavior.
|
|
101
|
-
// At that point, there will be no need for opt-in or opt-out mechanisms for this feature.
|
|
102
|
-
if (typeof accessibleLoadingButton === 'boolean') {
|
|
103
|
-
Object.assign(glButtonConfig, {
|
|
104
|
-
accessibleLoadingButton
|
|
105
|
-
});
|
|
106
|
-
}
|
|
107
88
|
};
|
|
108
89
|
|
|
109
|
-
export { setConfigs as default, defaultConfig,
|
|
90
|
+
export { setConfigs as default, defaultConfig, i18n };
|
package/package.json
CHANGED
|
@@ -13,7 +13,6 @@ import { isEvent } from '../../../vendor/bootstrap-vue/src/utils/inspect';
|
|
|
13
13
|
import GlIcon from '../icon/icon.vue';
|
|
14
14
|
import GlLoadingIcon from '../loading_icon/loading_icon.vue';
|
|
15
15
|
import { ENTER, SPACE } from '../new_dropdowns/constants';
|
|
16
|
-
import { glButtonConfig } from '../../../config';
|
|
17
16
|
|
|
18
17
|
export default {
|
|
19
18
|
name: 'GlButton',
|
|
@@ -82,14 +81,6 @@ export default {
|
|
|
82
81
|
required: false,
|
|
83
82
|
default: false,
|
|
84
83
|
},
|
|
85
|
-
/**
|
|
86
|
-
* Keep the button accessible when `loading` is `true`.
|
|
87
|
-
*/
|
|
88
|
-
accessibleLoading: {
|
|
89
|
-
type: Boolean,
|
|
90
|
-
required: false,
|
|
91
|
-
default: () => glButtonConfig.accessibleLoadingButton,
|
|
92
|
-
},
|
|
93
84
|
/**
|
|
94
85
|
* CSS classes to add to the button text.
|
|
95
86
|
*/
|
|
@@ -247,10 +238,10 @@ export default {
|
|
|
247
238
|
return isSlotEmpty(this, 'default') && this.hasIcon && this.count == null;
|
|
248
239
|
},
|
|
249
240
|
isButtonDisabled() {
|
|
250
|
-
return this.disabled
|
|
241
|
+
return this.disabled;
|
|
251
242
|
},
|
|
252
243
|
isButtonAriaDisabled() {
|
|
253
|
-
return this.
|
|
244
|
+
return this.isButton && this.loading;
|
|
254
245
|
},
|
|
255
246
|
buttonClasses() {
|
|
256
247
|
const classes = ['btn', 'gl-button', `btn-${this.variant}`, `btn-${this.buttonSize}`];
|
|
@@ -316,7 +307,7 @@ export default {
|
|
|
316
307
|
...(this.isNonStandardTag ? { 'aria-disabled': String(this.disabled) } : {}),
|
|
317
308
|
tabindex: this.tabindex,
|
|
318
309
|
// We set the `aria-disabled` state for buttons while loading
|
|
319
|
-
...(this.isButtonAriaDisabled ? { 'aria-disabled': 'true'
|
|
310
|
+
...(this.isButtonAriaDisabled ? { 'aria-disabled': 'true' } : {}),
|
|
320
311
|
};
|
|
321
312
|
|
|
322
313
|
if (this.isLink) {
|
package/src/config.js
CHANGED
|
@@ -39,8 +39,6 @@ export const defaultConfig = {
|
|
|
39
39
|
firstDayOfWeek: 0, // Defaults to 0 (Sunday)
|
|
40
40
|
};
|
|
41
41
|
|
|
42
|
-
export const glButtonConfig = {};
|
|
43
|
-
|
|
44
42
|
let configured = false;
|
|
45
43
|
|
|
46
44
|
/**
|
|
@@ -53,7 +51,7 @@ let configured = false;
|
|
|
53
51
|
* @property {boolean} [accessibleLoadingButton] Temporary flag to enable accessible loading button.
|
|
54
52
|
*
|
|
55
53
|
*/
|
|
56
|
-
const setConfigs = ({ translations, firstDayOfWeek
|
|
54
|
+
const setConfigs = ({ translations, firstDayOfWeek } = {}) => {
|
|
57
55
|
if (configured) {
|
|
58
56
|
if (process.env.NODE_ENV === 'development') {
|
|
59
57
|
throw new Error('GitLab UI can only be configured once!');
|
|
@@ -94,23 +92,6 @@ const setConfigs = ({ translations, firstDayOfWeek, accessibleLoadingButton = fa
|
|
|
94
92
|
|
|
95
93
|
Object.assign(i18n, translations);
|
|
96
94
|
}
|
|
97
|
-
|
|
98
|
-
// Temporary flag to enable the accessible loading button feature.
|
|
99
|
-
// This flag allows the feature to be opt-in during the rollout phase,
|
|
100
|
-
// giving us the flexibility to test and validate its impact on user experience.
|
|
101
|
-
|
|
102
|
-
// The global variable `accessibleLoadingButton` is set to a boolean value
|
|
103
|
-
// to indicate whether the button should be disabled while loading.
|
|
104
|
-
|
|
105
|
-
// Future Plan:
|
|
106
|
-
// Once the accessible loading button feature is validated and stable,
|
|
107
|
-
// we will remove this temporary flag and make the feature the default behavior.
|
|
108
|
-
// At that point, there will be no need for opt-in or opt-out mechanisms for this feature.
|
|
109
|
-
if (typeof accessibleLoadingButton === 'boolean') {
|
|
110
|
-
Object.assign(glButtonConfig, {
|
|
111
|
-
accessibleLoadingButton,
|
|
112
|
-
});
|
|
113
|
-
}
|
|
114
95
|
};
|
|
115
96
|
|
|
116
97
|
export default setConfigs;
|