@gitlab/ui 128.12.0 → 128.13.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/attribute_list/attribute_list.js +1 -1
- package/dist/components/base/new_dropdowns/base_dropdown/base_dropdown.js +20 -2
- package/dist/components/base/new_dropdowns/listbox/listbox.js +12 -2
- package/dist/index.css +1 -1
- package/dist/index.css.map +1 -1
- package/package.json +8 -7
- package/src/components/base/attribute_list/attribute_list.vue +1 -1
- package/src/components/base/new_dropdowns/base_dropdown/base_dropdown.vue +20 -1
- package/src/components/base/new_dropdowns/dropdown.scss +8 -0
- package/src/components/base/new_dropdowns/listbox/listbox.vue +12 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@gitlab/ui",
|
|
3
|
-
"version": "128.
|
|
3
|
+
"version": "128.13.0",
|
|
4
4
|
"description": "GitLab UI Components",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -37,6 +37,7 @@
|
|
|
37
37
|
"prebuild": "yarn build-tokens",
|
|
38
38
|
"copy-fonts": "make copy-fonts",
|
|
39
39
|
"build-tokens": "make tokens",
|
|
40
|
+
"sync-tokens": "node --env-file=.figma.env bin/figma_sync_tokens.mjs",
|
|
40
41
|
"clean": "rm -r dist storybook",
|
|
41
42
|
"cy:edge": "cypress run --browser edge --env grepTags=-@storybook",
|
|
42
43
|
"cy:run": "cypress run --browser firefox --env grepTags=-@storybook",
|
|
@@ -131,7 +132,7 @@
|
|
|
131
132
|
"autoprefixer": "10.4.24",
|
|
132
133
|
"axe-playwright": "^2.2.2",
|
|
133
134
|
"babel-loader": "^9.2.1",
|
|
134
|
-
"cypress": "15.
|
|
135
|
+
"cypress": "15.10.0",
|
|
135
136
|
"cypress-real-events": "^1.15.0",
|
|
136
137
|
"dompurify": "^3.1.2",
|
|
137
138
|
"emoji-regex": "^10.6.0",
|
|
@@ -142,12 +143,12 @@
|
|
|
142
143
|
"jest-circus": "30.2.0",
|
|
143
144
|
"jest-environment-jsdom": "30.2.0",
|
|
144
145
|
"jest-image-snapshot": "^6.5.1",
|
|
145
|
-
"merge-cobertura": "^1.0.
|
|
146
|
+
"merge-cobertura": "^1.0.5",
|
|
146
147
|
"mockdate": "^3.0.5",
|
|
147
|
-
"module-alias": "^2.
|
|
148
|
+
"module-alias": "^2.3.4",
|
|
148
149
|
"pikaday": "^1.8.0",
|
|
149
|
-
"playwright": "^1.58.
|
|
150
|
-
"playwright-core": "^1.58.
|
|
150
|
+
"playwright": "^1.58.2",
|
|
151
|
+
"playwright-core": "^1.58.2",
|
|
151
152
|
"postcss": "8.5.6",
|
|
152
153
|
"postcss-loader": "8.2.0",
|
|
153
154
|
"postcss-scss": "4.0.9",
|
|
@@ -165,7 +166,7 @@
|
|
|
165
166
|
"start-server-and-test": "^2.1.3",
|
|
166
167
|
"storybook": "^7.6.20",
|
|
167
168
|
"storybook-dark-mode": "4.0.2",
|
|
168
|
-
"style-dictionary": "^5.
|
|
169
|
+
"style-dictionary": "^5.3.0",
|
|
169
170
|
"style-loader": "^4",
|
|
170
171
|
"tailwindcss": "3.4.19",
|
|
171
172
|
"vue": "2.7.16",
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
<script>
|
|
2
2
|
import uniqueId from 'lodash/uniqueId';
|
|
3
|
+
import isBoolean from 'lodash/isBoolean';
|
|
3
4
|
import {
|
|
4
5
|
arrow,
|
|
5
6
|
computePosition,
|
|
@@ -119,6 +120,14 @@ export default {
|
|
|
119
120
|
required: false,
|
|
120
121
|
default: false,
|
|
121
122
|
},
|
|
123
|
+
/**
|
|
124
|
+
* Controls the validation state appearance of the component. `true` for valid, `false` for invalid, or `null` for no validation state
|
|
125
|
+
*/
|
|
126
|
+
state: {
|
|
127
|
+
type: Boolean,
|
|
128
|
+
required: false,
|
|
129
|
+
default: null,
|
|
130
|
+
},
|
|
122
131
|
placement: {
|
|
123
132
|
type: String,
|
|
124
133
|
required: false,
|
|
@@ -245,6 +254,15 @@ export default {
|
|
|
245
254
|
isCaretOnly() {
|
|
246
255
|
return !this.noCaret && !this.icon && this.hasNoVisibleToggleText;
|
|
247
256
|
},
|
|
257
|
+
computedState() {
|
|
258
|
+
// If not a boolean, ensure that value is null
|
|
259
|
+
return isBoolean(this.state) ? this.state : null;
|
|
260
|
+
},
|
|
261
|
+
stateClass() {
|
|
262
|
+
if (this.computedState === true) return 'is-valid';
|
|
263
|
+
if (this.computedState === false) return 'is-invalid';
|
|
264
|
+
return null;
|
|
265
|
+
},
|
|
248
266
|
isDefaultToggle() {
|
|
249
267
|
return !this.$scopedSlots.toggle;
|
|
250
268
|
},
|
|
@@ -298,6 +316,7 @@ export default {
|
|
|
298
316
|
'gl-new-dropdown-toggle-no-caret': this.noCaret,
|
|
299
317
|
'gl-new-dropdown-caret-only btn-icon': this.isCaretOnly,
|
|
300
318
|
},
|
|
319
|
+
this.stateClass,
|
|
301
320
|
];
|
|
302
321
|
},
|
|
303
322
|
toggleButtonTextClasses() {
|
|
@@ -590,7 +609,7 @@ export default {
|
|
|
590
609
|
this.$emit(GL_DROPDOWN_SHOWN);
|
|
591
610
|
} else {
|
|
592
611
|
this.stopFloating();
|
|
593
|
-
this.$emit(GL_DROPDOWN_HIDDEN);
|
|
612
|
+
this.$emit(GL_DROPDOWN_HIDDEN, event);
|
|
594
613
|
}
|
|
595
614
|
|
|
596
615
|
// this is to check whether `toggle` was prevented or not
|
|
@@ -166,6 +166,14 @@ export default {
|
|
|
166
166
|
required: false,
|
|
167
167
|
default: false,
|
|
168
168
|
},
|
|
169
|
+
/**
|
|
170
|
+
* Controls the validation state appearance of the component. `true` for valid, `false` for invalid, or `null` for no validation state
|
|
171
|
+
*/
|
|
172
|
+
state: {
|
|
173
|
+
type: Boolean,
|
|
174
|
+
required: false,
|
|
175
|
+
default: null,
|
|
176
|
+
},
|
|
169
177
|
/**
|
|
170
178
|
* Set to "true" when dropdown content (items) is loading
|
|
171
179
|
* It will render a small loader in the dropdown toggle and make it disabled
|
|
@@ -687,7 +695,7 @@ export default {
|
|
|
687
695
|
*/
|
|
688
696
|
this.$emit(GL_DROPDOWN_SHOWN);
|
|
689
697
|
},
|
|
690
|
-
onHide() {
|
|
698
|
+
onHide(event) {
|
|
691
699
|
/**
|
|
692
700
|
* Emitted when dropdown is hidden
|
|
693
701
|
*
|
|
@@ -695,6 +703,8 @@ export default {
|
|
|
695
703
|
*/
|
|
696
704
|
this.$emit(GL_DROPDOWN_HIDDEN);
|
|
697
705
|
this.nextFocusedItemIndex = null;
|
|
706
|
+
// Emit native blur event for form validation in FormGroup
|
|
707
|
+
this.$emit('blur', event);
|
|
698
708
|
},
|
|
699
709
|
getNextIndex(currentIndex, keyCode, totalLength) {
|
|
700
710
|
// For UP: move up or wrap to end
|
|
@@ -977,6 +987,7 @@ export default {
|
|
|
977
987
|
:has-searchable-listbox="searchable"
|
|
978
988
|
:has-external-label="isInFormGroup"
|
|
979
989
|
:listbox-id="listboxIdComputed"
|
|
990
|
+
:state="state"
|
|
980
991
|
:toggle-id="toggleIdComputed"
|
|
981
992
|
:toggle-text="listboxToggleText"
|
|
982
993
|
:toggle-class="toggleButtonClasses"
|