@gitlab/ui 128.3.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.
- package/dist/components/base/breadcrumb/breadcrumb.js +12 -1
- package/dist/components/base/button/button.js +3 -13
- package/dist/config.js +2 -21
- package/dist/index.css +1 -1
- package/dist/index.css.map +1 -1
- package/package.json +4 -4
- package/src/components/base/breadcrumb/breadcrumb.scss +5 -2
- package/src/components/base/breadcrumb/breadcrumb.vue +20 -3
- package/src/components/base/button/button.vue +3 -12
- package/src/config.js +1 -20
|
@@ -158,12 +158,21 @@ var script = {
|
|
|
158
158
|
} else {
|
|
159
159
|
this.resizeDone = true;
|
|
160
160
|
}
|
|
161
|
-
this.
|
|
161
|
+
this.updateClipboardButtonWidth();
|
|
162
162
|
},
|
|
163
163
|
beforeDestroy() {
|
|
164
164
|
this.disableAutoResize();
|
|
165
165
|
},
|
|
166
166
|
methods: {
|
|
167
|
+
updateClipboardButtonWidth() {
|
|
168
|
+
if (!this.showClipboardButton) {
|
|
169
|
+
this.clipboardButtonWidth = 0;
|
|
170
|
+
return;
|
|
171
|
+
}
|
|
172
|
+
const element = this.$refs.clipboardButton.$el;
|
|
173
|
+
const marginLeft = parseInt(getComputedStyle(element).marginLeft, 10);
|
|
174
|
+
this.clipboardButtonWidth = element.offsetWidth + marginLeft;
|
|
175
|
+
},
|
|
167
176
|
resetItems() {
|
|
168
177
|
this.fittingItems = [...this.items];
|
|
169
178
|
this.overflowingItems = [];
|
|
@@ -209,6 +218,8 @@ var script = {
|
|
|
209
218
|
if (widthNeeded + this.dropdownWidth < containerWidth) break;
|
|
210
219
|
}
|
|
211
220
|
}
|
|
221
|
+
const truncatedItemMaxWidth = Math.max(0, containerWidth - (this.dropdownWidth + this.clipboardButtonWidth));
|
|
222
|
+
this.$el.style.setProperty('--gl-breadcrumb-truncated-item-max-width', `${truncatedItemMaxWidth}px`);
|
|
212
223
|
this.resizeDone = true;
|
|
213
224
|
},
|
|
214
225
|
isLastItem(index) {
|
|
@@ -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 };
|