@gitlab/ui 115.0.0 → 115.1.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/bin/migrate_custom_utils_to_tw.bundled.mjs +172489 -139144
- package/dist/components/base/new_dropdowns/base_dropdown/base_dropdown.js +15 -3
- package/dist/components/base/new_dropdowns/constants.js +5 -2
- package/dist/components/dashboards/dashboard_layout/grid_layout/grid_layout.js +286 -0
- package/dist/components/dashboards/mock_data.js +49 -0
- package/dist/index.css +2 -2
- package/dist/index.css.map +1 -1
- package/dist/tailwind.css +1 -1
- package/dist/tailwind.css.map +1 -1
- package/dist/tokens/docs/tokens-tailwind-docs.dark.json +7986 -0
- package/dist/tokens/docs/tokens-tailwind-docs.json +7986 -0
- package/dist/tokens/figma/constants.tokens.json +944 -236
- package/dist/tokens/figma/contextual.tokens.json +2721 -418
- package/dist/tokens/figma/deprecated.tokens.json +664 -8
- package/dist/tokens/figma/semantic.tokens.json +1130 -169
- package/dist/tokens/js/tokens.dark.js +1089 -1047
- package/dist/tokens/js/tokens.js +1078 -1047
- package/dist/tokens/json/tokens.dark.json +9267 -3
- package/dist/tokens/json/tokens.json +9267 -3
- package/dist/tokens/tailwind/tokens.cjs +76 -407
- package/package.json +22 -49
- package/src/components/base/accordion/accordion_item.vue +1 -1
- package/src/components/base/avatar/avatar.vue +1 -1
- package/src/components/base/button/button.vue +1 -1
- package/src/components/base/dropdown/dropdown.vue +3 -1
- package/src/components/base/filtered_search/filtered_search.vue +1 -1
- package/src/components/base/filtered_search/filtered_search_suggestion_list.vue +1 -1
- package/src/components/base/filtered_search/filtered_search_token.vue +1 -1
- package/src/components/base/filtered_search/filtered_search_token_segment.vue +3 -3
- package/src/components/base/form/form_checkbox_tree/models/tree.js +1 -1
- package/src/components/base/form/form_date/form_date.vue +1 -1
- package/src/components/base/form/form_input/form_input.vue +1 -1
- package/src/components/base/form/form_select/form_select.vue +1 -1
- package/src/components/base/modal/modal.vue +2 -2
- package/src/components/base/new_dropdowns/base_dropdown/base_dropdown.vue +23 -6
- package/src/components/base/new_dropdowns/constants.js +4 -1
- package/src/components/base/new_dropdowns/disclosure/disclosure_dropdown.md +1 -2
- package/src/components/base/new_dropdowns/listbox/listbox.vue +7 -7
- package/src/components/base/pagination/pagination.vue +2 -2
- package/src/components/base/path/path.vue +1 -1
- package/src/components/base/skeleton_loader/skeleton_loader.vue +9 -9
- package/src/components/base/table/table.md +1 -2
- package/src/components/base/table_lite/table_lite.md +1 -1
- package/src/components/base/tabs/tabs/tabs.vue +1 -1
- package/src/components/base/toast/toast.js +2 -2
- package/src/components/base/token_selector/token_container.vue +1 -1
- package/src/components/base/token_selector/token_selector.vue +2 -2
- package/src/components/base/token_selector/token_selector_dropdown.vue +1 -1
- package/src/components/charts/area/area.vue +3 -3
- package/src/components/charts/bar/bar.vue +2 -2
- package/src/components/charts/column/column.vue +2 -2
- package/src/components/charts/discrete_scatter/discrete_scatter.vue +2 -2
- package/src/components/charts/gauge/gauge.vue +1 -1
- package/src/components/charts/heatmap/heatmap.vue +2 -2
- package/src/components/charts/heatmap/index.js +1 -0
- package/src/components/charts/legend/legend.vue +1 -1
- package/src/components/charts/line/line.vue +3 -3
- package/src/components/charts/sparkline/sparkline.vue +1 -1
- package/src/components/charts/stacked_column/stacked_column.vue +1 -1
- package/src/components/dashboards/dashboard_layout/grid_layout/grid_layout.scss +1 -0
- package/src/components/dashboards/dashboard_layout/grid_layout/grid_layout.vue +247 -0
- package/src/components/dashboards/mock_data.js +40 -0
- package/src/components/mixins/tooltip_mixin.js +1 -1
- package/src/components/utilities/intersection_observer/intersection_observer.vue +1 -1
- package/src/components/utilities/intersperse/intersperse.vue +2 -2
- package/src/components/utilities/sprintf/sprintf.md +1 -1
- package/src/components/utilities/sprintf/sprintf.vue +1 -1
- package/src/components/utilities/truncate/truncate.vue +2 -2
- package/src/config.js +1 -1
- package/src/directives/outside/outside.js +4 -4
- package/src/directives/tooltip/tooltip.js +1 -1
- package/src/scss/components.scss +1 -0
- package/src/tokens/build/docs/tokens-tailwind-docs.dark.json +7986 -0
- package/src/tokens/build/docs/tokens-tailwind-docs.json +7986 -0
- package/src/tokens/build/figma/constants.tokens.json +944 -236
- package/src/tokens/build/figma/contextual.tokens.json +2721 -418
- package/src/tokens/build/figma/deprecated.tokens.json +664 -8
- package/src/tokens/build/figma/semantic.tokens.json +1130 -169
- package/src/tokens/build/json/tokens.dark.json +9267 -3
- package/src/tokens/build/json/tokens.json +9267 -3
- package/src/tokens/constant/color.alpha.tokens.json +60 -15
- package/src/tokens/constant/color.tokens.json +844 -211
- package/src/tokens/constant/line_height.tokens.json +40 -10
- package/src/tokens/contextual/alert.tokens.json +119 -19
- package/src/tokens/contextual/avatar.tokens.json +90 -14
- package/src/tokens/contextual/badge.tokens.json +728 -112
- package/src/tokens/contextual/banner.tokens.json +19 -3
- package/src/tokens/contextual/breadcrumb.tokens.json +6 -1
- package/src/tokens/contextual/broadcast.tokens.json +301 -81
- package/src/tokens/contextual/button.tokens.json +793 -120
- package/src/tokens/contextual/chart.tokens.json +42 -7
- package/src/tokens/contextual/datepicker.tokens.json +13 -2
- package/src/tokens/contextual/dropdown.tokens.json +142 -21
- package/src/tokens/contextual/filtered-search.tokens.json +42 -6
- package/src/tokens/contextual/illustration.tokens.json +195 -33
- package/src/tokens/contextual/label.tokens.json +81 -12
- package/src/tokens/contextual/link.tokens.json +26 -4
- package/src/tokens/contextual/progress-bar.tokens.json +35 -5
- package/src/tokens/contextual/skeleton-loader.tokens.json +12 -2
- package/src/tokens/contextual/spinner.tokens.json +24 -4
- package/src/tokens/contextual/table.tokens.json +14 -2
- package/src/tokens/contextual/tabs.tokens.json +7 -1
- package/src/tokens/contextual/toggle.tokens.json +54 -9
- package/src/tokens/contextual/token-selector.tokens.json +7 -1
- package/src/tokens/contextual/token.tokens.json +14 -2
- package/src/tokens/deprecated/deprecated.color.data_viz.tokens.json +165 -0
- package/src/tokens/deprecated/deprecated.color.theme.tokens.json +216 -0
- package/src/tokens/deprecated/deprecated.color.tokens.json +240 -0
- package/src/tokens/deprecated/deprecated.color.transparency.tokens.json +39 -0
- package/src/tokens/semantic/action.tokens.json +500 -75
- package/src/tokens/semantic/background.tokens.json +49 -7
- package/src/tokens/semantic/border.tokens.json +30 -5
- package/src/tokens/semantic/control.tokens.json +129 -20
- package/src/tokens/semantic/feedback.tokens.json +126 -19
- package/src/tokens/semantic/focus-ring.tokens.json +12 -2
- package/src/tokens/semantic/highlight.tokens.json +26 -4
- package/src/tokens/semantic/icon.tokens.json +63 -9
- package/src/tokens/semantic/shadow.tokens.json +6 -1
- package/src/tokens/semantic/status.tokens.json +120 -18
- package/src/tokens/semantic/text.tokens.json +69 -9
- package/src/tokens/tokens_tailwind_table.vue +1 -1
- package/src/utils/charts/config.js +7 -7
- package/src/utils/charts/utils.js +1 -1
- package/src/utils/use_mock_intersection_observer.js +1 -1
- package/src/utils/utils.js +1 -1
- package/tailwind.defaults.js +1 -1
- package/translations.js +2 -2
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@gitlab/ui",
|
|
3
|
-
"version": "115.
|
|
3
|
+
"version": "115.1.0",
|
|
4
4
|
"description": "GitLab UI Components",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -44,8 +44,7 @@
|
|
|
44
44
|
"start": "yarn storybook",
|
|
45
45
|
"storybook": "yarn storybook:prepare && storybook dev --ci --host ${STORYBOOK_HOST:-localhost} --port ${STORYBOOK_PORT:-9001} -c .storybook",
|
|
46
46
|
"storybook-vue3": "yarn storybook:prepare && VUE_VERSION=3 storybook dev --ci --host ${STORYBOOK_HOST:-localhost} --port ${STORYBOOK_PORT:-9001} -c .storybook",
|
|
47
|
-
"storybook:
|
|
48
|
-
"storybook:prepare": "run-s storybook:patch copy-fonts build-tokens",
|
|
47
|
+
"storybook:prepare": "run-s copy-fonts build-tokens",
|
|
49
48
|
"storybook:build:prod": "yarn storybook:prepare && storybook build -c .storybook -o storybook",
|
|
50
49
|
"storybook:build:test": "yarn storybook:prepare && IS_VISUAL_TEST=true NODE_ENV=test storybook build --test -c .storybook -o storybook",
|
|
51
50
|
"storybook:run": "npx http-server -bgs -p ${STORYBOOK_PORT:-9001} ./storybook",
|
|
@@ -64,23 +63,14 @@
|
|
|
64
63
|
"test:visual": "./bin/run-visual-tests.sh 'test-storybook --browsers firefox --verbose --url http://${STORYBOOK_HOST:-localhost}:${STORYBOOK_PORT:-9001}'",
|
|
65
64
|
"test:visual:update": "./bin/run-visual-tests.sh 'test-storybook -u --browsers firefox --verbose --url http://${STORYBOOK_HOST:-localhost}:${STORYBOOK_PORT:-9001}'",
|
|
66
65
|
"test:visual:internal": "NODE_ENV=test IS_VISUAL_TEST=true start-test storybook:run http-get://${STORYBOOK_HOST:-localhost}:${STORYBOOK_PORT:-9001}/iframe.html",
|
|
67
|
-
"prettier": "prettier --check '**/*.{js,mjs,ts,vue}'",
|
|
68
|
-
"prettier:fix": "prettier --write '**/*.{js,mjs,ts,vue}'",
|
|
69
|
-
"eslint": "eslint --max-warnings 0 .",
|
|
70
|
-
"eslint:fix": "yarn eslint --fix",
|
|
71
|
-
"stylelint": "stylelint 'src/**/*.scss'",
|
|
72
|
-
"stylelint:fix": "yarn stylelint --fix",
|
|
73
|
-
"markdownlint": "markdownlint '**/*.md' --ignore node_modules --ignore CHANGELOG.md --ignore CHANGELOG-old.md --ignore src/vendor",
|
|
74
|
-
"markdownlint:fix": "yarn markdownlint --fix",
|
|
75
|
-
"lint": "run-p prettier eslint stylelint markdownlint",
|
|
76
|
-
"lint:fix": "run-s eslint:fix prettier:fix stylelint:fix markdownlint:fix",
|
|
77
66
|
"translations:collect": "make translations.js",
|
|
78
67
|
"tailwind-config-viewer:start": "tailwind-config-viewer -o",
|
|
79
68
|
"tailwind-config-viewer:export": "tailwind-config-viewer export ./tailwind-config-viewer-static"
|
|
80
69
|
},
|
|
81
70
|
"dependencies": {
|
|
82
|
-
"@floating-ui/dom": "1.7.
|
|
71
|
+
"@floating-ui/dom": "1.7.2",
|
|
83
72
|
"echarts": "^5.6.0",
|
|
73
|
+
"gridstack": "^12.2.1",
|
|
84
74
|
"iframe-resizer": "^4.4.5",
|
|
85
75
|
"lodash": "^4.17.21",
|
|
86
76
|
"popper.js": "^1.16.1",
|
|
@@ -100,28 +90,23 @@
|
|
|
100
90
|
"chokidar": "^3.6.0",
|
|
101
91
|
"sane": "^5.0.1",
|
|
102
92
|
"jackspeak": "2.1.1",
|
|
103
|
-
"postcss": "8.5.
|
|
93
|
+
"postcss": "8.5.6",
|
|
104
94
|
"json5": "2.2.3",
|
|
105
|
-
"rollup-plugin-vue/@vue/component-compiler/postcss-modules-sync/generic-names/loader-utils": "1.4.2"
|
|
106
|
-
"eslint-plugin-import": "2.32.0"
|
|
95
|
+
"rollup-plugin-vue/@vue/component-compiler/postcss-modules-sync/generic-names/loader-utils": "1.4.2"
|
|
107
96
|
},
|
|
108
97
|
"devDependencies": {
|
|
109
|
-
"@babel/core": "^7.27.
|
|
98
|
+
"@babel/core": "^7.27.7",
|
|
110
99
|
"@babel/plugin-proposal-nullish-coalescing-operator": "^7.18.6",
|
|
111
100
|
"@babel/plugin-proposal-optional-chaining": "^7.21.0",
|
|
112
101
|
"@babel/preset-env": "^7.27.2",
|
|
113
102
|
"@babel/preset-react": "^7.27.1",
|
|
114
|
-
"@cypress/grep": "^4.0
|
|
115
|
-
"@eslint/eslintrc": "^3.3.1",
|
|
116
|
-
"@eslint/js": "^9.29.0",
|
|
117
|
-
"@gitlab/eslint-plugin": "21.1.0",
|
|
103
|
+
"@cypress/grep": "^4.1.0",
|
|
118
104
|
"@gitlab/fonts": "^1.3.0",
|
|
119
|
-
"@gitlab/
|
|
120
|
-
"@
|
|
121
|
-
"@jest/test-sequencer": "^30.0.2",
|
|
105
|
+
"@gitlab/svgs": "3.136.0",
|
|
106
|
+
"@jest/test-sequencer": "30.0.2",
|
|
122
107
|
"@rollup/plugin-commonjs": "^21.1.0",
|
|
123
|
-
"@rollup/plugin-node-resolve": "^
|
|
124
|
-
"@rollup/plugin-replace": "^
|
|
108
|
+
"@rollup/plugin-node-resolve": "^10.0.0",
|
|
109
|
+
"@rollup/plugin-replace": "^3.1.0",
|
|
125
110
|
"@storybook/addon-a11y": "^7.6.20",
|
|
126
111
|
"@storybook/addon-docs": "^7.6.20",
|
|
127
112
|
"@storybook/addon-essentials": "^7.6.20",
|
|
@@ -135,7 +120,6 @@
|
|
|
135
120
|
"@storybook/vue-webpack5": "^7.6.17",
|
|
136
121
|
"@storybook/vue3": "^7.6.20",
|
|
137
122
|
"@storybook/vue3-webpack5": "^7.6.20",
|
|
138
|
-
"@studiometa/stylelint-formatter-gitlab": "^0.0.1",
|
|
139
123
|
"@types/jest-image-snapshot": "^6.4.0",
|
|
140
124
|
"@vue/compat": "^3.5.17",
|
|
141
125
|
"@vue/compiler-sfc": "^3.5.17",
|
|
@@ -149,43 +133,32 @@
|
|
|
149
133
|
"acorn-walk": "^8.3.4",
|
|
150
134
|
"autoprefixer": "10.4.21",
|
|
151
135
|
"axe-playwright": "^2.1.0",
|
|
152
|
-
"babel-
|
|
153
|
-
"babel-loader": "^8.4.1",
|
|
136
|
+
"babel-loader": "^9.2.1",
|
|
154
137
|
"cypress": "14.5.0",
|
|
155
138
|
"cypress-real-events": "^1.14.0",
|
|
156
139
|
"dompurify": "^3.1.2",
|
|
157
140
|
"emoji-regex": "^10.4.0",
|
|
158
|
-
"entities": "^
|
|
141
|
+
"entities": "^5.0.0",
|
|
159
142
|
"esbuild": "^0.18.0",
|
|
160
|
-
"eslint": "9.29.0",
|
|
161
|
-
"eslint-formatter-gitlab": "^6.0.1",
|
|
162
|
-
"eslint-import-resolver-jest": "3.0.2",
|
|
163
|
-
"eslint-plugin-cypress": "5.1.0",
|
|
164
|
-
"eslint-plugin-storybook": "0.12.0",
|
|
165
143
|
"fuse.js": "^7.1.0",
|
|
166
144
|
"gitlab-api-async-iterator": "^1.3.1",
|
|
167
145
|
"glob": "10.4.5",
|
|
168
146
|
"globby": "^11.1.0",
|
|
169
147
|
"identity-obj-proxy": "^3.0.0",
|
|
170
|
-
"jest": "
|
|
171
|
-
"jest-circus": "
|
|
172
|
-
"jest-environment-jsdom": "
|
|
148
|
+
"jest": "30.0.2",
|
|
149
|
+
"jest-circus": "30.0.2",
|
|
150
|
+
"jest-environment-jsdom": "30.0.2",
|
|
173
151
|
"jest-image-snapshot": "^6.5.1",
|
|
174
|
-
"lefthook": "^1.11.14",
|
|
175
|
-
"markdownlint-cli": "^0.29.0",
|
|
176
152
|
"merge-cobertura": "^1.0.4",
|
|
177
153
|
"mockdate": "^2.0.5",
|
|
178
154
|
"module-alias": "^2.2.3",
|
|
179
155
|
"npm-run-all": "^4.1.5",
|
|
180
|
-
"patch-package": "^8.0.0",
|
|
181
156
|
"pikaday": "^1.8.0",
|
|
182
157
|
"playwright": "^1.53.1",
|
|
183
158
|
"playwright-core": "^1.53.1",
|
|
184
|
-
"postcss": "8.5.
|
|
159
|
+
"postcss": "8.5.6",
|
|
185
160
|
"postcss-loader": "8.1.1",
|
|
186
161
|
"postcss-scss": "4.0.9",
|
|
187
|
-
"prettier": "3.5.3",
|
|
188
|
-
"prettier-plugin-tailwindcss": "^0.6.5",
|
|
189
162
|
"react": "^18.3.1",
|
|
190
163
|
"react-dom": "^18.3.1",
|
|
191
164
|
"rollup": "^2.79.2",
|
|
@@ -194,24 +167,24 @@
|
|
|
194
167
|
"rollup-plugin-string": "^3.0.0",
|
|
195
168
|
"rollup-plugin-svg": "^2.0.0",
|
|
196
169
|
"rollup-plugin-vue": "^5.1.9",
|
|
197
|
-
"sass": "^1.
|
|
170
|
+
"sass": "^1.89.2",
|
|
198
171
|
"sass-loader": "^10.5.2",
|
|
199
172
|
"sass-true": "^6.1.0",
|
|
200
173
|
"start-server-and-test": "^1.15.4",
|
|
201
174
|
"storybook": "^7.6.20",
|
|
202
175
|
"storybook-dark-mode": "4.0.2",
|
|
203
176
|
"style-dictionary": "^5.0.0",
|
|
204
|
-
"
|
|
177
|
+
"style-loader": "3.3.2",
|
|
205
178
|
"tailwind-config-viewer": "2.0.4",
|
|
206
179
|
"tailwindcss": "3.4.17",
|
|
207
180
|
"vue": "2.7.16",
|
|
181
|
+
"vue-docgen-loader": "1.5.1",
|
|
208
182
|
"vue-loader": "^15.11.1",
|
|
209
183
|
"vue-loader-vue3": "npm:vue-loader@17.4.2",
|
|
210
184
|
"vue-router": "^3.5.1",
|
|
211
185
|
"vue-template-compiler": "2.7.16",
|
|
212
186
|
"vue-test-utils-compat": "^0.0.15",
|
|
213
187
|
"webpack": "^5.99.9",
|
|
214
|
-
"yargs": "^17.7.2"
|
|
215
|
-
"yarn-deduplicate": "^6.0.2"
|
|
188
|
+
"yargs": "^17.7.2"
|
|
216
189
|
}
|
|
217
190
|
}
|
|
@@ -116,7 +116,7 @@ export default {
|
|
|
116
116
|
checkAndCollapseSiblingAccordionItems(newVisible) {
|
|
117
117
|
if (this.autoCollapse() && newVisible) {
|
|
118
118
|
this.$parent.$el.dispatchEvent(
|
|
119
|
-
new CustomEvent(COLLAPSE_EVENT, { detail: this.accordionItemId })
|
|
119
|
+
new CustomEvent(COLLAPSE_EVENT, { detail: this.accordionItemId }),
|
|
120
120
|
);
|
|
121
121
|
}
|
|
122
122
|
},
|
|
@@ -83,7 +83,7 @@ export default {
|
|
|
83
83
|
`gl-avatar-s${defaultSize || avatarSizeOptions[1]}`,
|
|
84
84
|
...Object.entries(nonDefaultSizes).map(
|
|
85
85
|
// eslint-disable-next-line @gitlab/tailwind-no-interpolation -- Not a CSS utility
|
|
86
|
-
([breakpoint, size]) => `gl-${breakpoint}-avatar-s${size}
|
|
86
|
+
([breakpoint, size]) => `gl-${breakpoint}-avatar-s${size}`,
|
|
87
87
|
),
|
|
88
88
|
];
|
|
89
89
|
},
|
|
@@ -177,7 +177,9 @@ export default {
|
|
|
177
177
|
},
|
|
178
178
|
isIconOnly() {
|
|
179
179
|
return Boolean(
|
|
180
|
-
this.icon &&
|
|
180
|
+
this.icon &&
|
|
181
|
+
(!this.text?.length || this.textSrOnly) &&
|
|
182
|
+
!this.hasSlotContents('button-text'),
|
|
181
183
|
);
|
|
182
184
|
},
|
|
183
185
|
isIconWithText() {
|
|
@@ -74,7 +74,7 @@ export default {
|
|
|
74
74
|
if (!isOk) {
|
|
75
75
|
// eslint-disable-next-line no-console
|
|
76
76
|
console.warn(
|
|
77
|
-
'You are using Vue3. In Vue3 each token component passed to filtered search must be wrapped into markRaw'
|
|
77
|
+
'You are using Vue3. In Vue3 each token component passed to filtered search must be wrapped into markRaw',
|
|
78
78
|
);
|
|
79
79
|
}
|
|
80
80
|
|
|
@@ -110,7 +110,7 @@ export default {
|
|
|
110
110
|
availableTokensWithSelf() {
|
|
111
111
|
return [this.config, ...this.availableTokens.filter((token) => token !== this.config)].map(
|
|
112
112
|
// eslint-disable-next-line unicorn/no-array-callback-reference
|
|
113
|
-
tokenToOption
|
|
113
|
+
tokenToOption,
|
|
114
114
|
);
|
|
115
115
|
},
|
|
116
116
|
|
|
@@ -250,7 +250,7 @@ export default {
|
|
|
250
250
|
}
|
|
251
251
|
|
|
252
252
|
const [firstWord, ...otherWords] = splitOnQuotes(newValue).filter(
|
|
253
|
-
(w, idx, arr) => Boolean(w) || idx === arr.length - 1
|
|
253
|
+
(w, idx, arr) => Boolean(w) || idx === arr.length - 1,
|
|
254
254
|
);
|
|
255
255
|
this.$emit('input', firstWord);
|
|
256
256
|
|
|
@@ -279,7 +279,7 @@ export default {
|
|
|
279
279
|
return this.options?.find((option) =>
|
|
280
280
|
loose
|
|
281
281
|
? match(option[this.optionTextField], inputValue)
|
|
282
|
-
: option[this.optionTextField] === inputValue
|
|
282
|
+
: option[this.optionTextField] === inputValue,
|
|
283
283
|
);
|
|
284
284
|
},
|
|
285
285
|
|
|
@@ -324,7 +324,7 @@ export default {
|
|
|
324
324
|
if (!this.multiSelect) {
|
|
325
325
|
this.$emit(
|
|
326
326
|
'input',
|
|
327
|
-
formattedSuggestedValue === TERM_TOKEN_TYPE ? this.inputValue : formattedSuggestedValue
|
|
327
|
+
formattedSuggestedValue === TERM_TOKEN_TYPE ? this.inputValue : formattedSuggestedValue,
|
|
328
328
|
);
|
|
329
329
|
this.$emit('complete', formattedSuggestedValue);
|
|
330
330
|
}
|
|
@@ -311,7 +311,7 @@ export default {
|
|
|
311
311
|
...(defaultWidth ? [`gl-form-input-${defaultWidth}`] : []),
|
|
312
312
|
...Object.entries(nonDefaultWidths).map(
|
|
313
313
|
// eslint-disable-next-line @gitlab/tailwind-no-interpolation -- Not a CSS utility
|
|
314
|
-
([breakpoint, width]) => `gl-${breakpoint}-form-input-${width}
|
|
314
|
+
([breakpoint, width]) => `gl-${breakpoint}-form-input-${width}`,
|
|
315
315
|
),
|
|
316
316
|
];
|
|
317
317
|
}
|
|
@@ -43,7 +43,7 @@ export default {
|
|
|
43
43
|
...(defaultWidth ? [`gl-form-select-${defaultWidth}`] : []),
|
|
44
44
|
...Object.entries(nonDefaultWidths).map(
|
|
45
45
|
// eslint-disable-next-line @gitlab/tailwind-no-interpolation -- Not a CSS utility
|
|
46
|
-
([breakpoint, width]) => `gl-${breakpoint}-form-select-${width}
|
|
46
|
+
([breakpoint, width]) => `gl-${breakpoint}-form-select-${width}`,
|
|
47
47
|
),
|
|
48
48
|
];
|
|
49
49
|
}
|
|
@@ -111,7 +111,7 @@ export default {
|
|
|
111
111
|
this.actionSecondary ||
|
|
112
112
|
this.actionPrimary ||
|
|
113
113
|
// eslint-disable-next-line @gitlab/vue-prefer-dollar-scopedslots
|
|
114
|
-
this.$slots['modal-footer']
|
|
114
|
+
this.$slots['modal-footer'],
|
|
115
115
|
);
|
|
116
116
|
},
|
|
117
117
|
},
|
|
@@ -119,7 +119,7 @@ export default {
|
|
|
119
119
|
if (!this.ariaLabel && !this.title) {
|
|
120
120
|
logWarning(
|
|
121
121
|
'[gl-modal]: Accessible name for modal missing. Please add title prop or aria-label.',
|
|
122
|
-
this.$el
|
|
122
|
+
this.$el,
|
|
123
123
|
);
|
|
124
124
|
}
|
|
125
125
|
},
|
|
@@ -21,6 +21,7 @@ import {
|
|
|
21
21
|
GL_DROPDOWN_HIDDEN,
|
|
22
22
|
GL_DROPDOWN_BEFORE_CLOSE,
|
|
23
23
|
GL_DROPDOWN_FOCUS_CONTENT,
|
|
24
|
+
KEY_CODE_ESCAPE,
|
|
24
25
|
ENTER,
|
|
25
26
|
SPACE,
|
|
26
27
|
ARROW_DOWN,
|
|
@@ -28,7 +29,12 @@ import {
|
|
|
28
29
|
POSITION_ABSOLUTE,
|
|
29
30
|
POSITION_FIXED,
|
|
30
31
|
} from '../constants';
|
|
31
|
-
import {
|
|
32
|
+
import {
|
|
33
|
+
logWarning,
|
|
34
|
+
isElementTabbable,
|
|
35
|
+
isElementFocusable,
|
|
36
|
+
stopEvent,
|
|
37
|
+
} from '../../../../utils/utils';
|
|
32
38
|
import { OutsideDirective } from '../../../../directives/outside/outside';
|
|
33
39
|
import GlButton from '../../button/button.vue';
|
|
34
40
|
import GlIcon from '../../icon/icon.vue';
|
|
@@ -111,7 +117,7 @@ export default {
|
|
|
111
117
|
if (['left', 'center', 'right'].includes(value)) {
|
|
112
118
|
logWarning(
|
|
113
119
|
`GlDisclosureDropdown/GlCollapsibleListbox: "${value}" placement is deprecated.
|
|
114
|
-
Use ${dropdownPlacements[value]} instead
|
|
120
|
+
Use ${dropdownPlacements[value]} instead.`,
|
|
115
121
|
);
|
|
116
122
|
}
|
|
117
123
|
|
|
@@ -306,7 +312,7 @@ export default {
|
|
|
306
312
|
{
|
|
307
313
|
maxHeight: `${Math.max(contentsAvailableHeight, 0)}px`,
|
|
308
314
|
},
|
|
309
|
-
maxWidth
|
|
315
|
+
maxWidth,
|
|
310
316
|
);
|
|
311
317
|
},
|
|
312
318
|
}),
|
|
@@ -338,7 +344,7 @@ export default {
|
|
|
338
344
|
logWarning(
|
|
339
345
|
`GlDisclosureDropdown/GlCollapsibleListbox: Toggle is missing a 'tabindex' and cannot be focused.
|
|
340
346
|
Use 'a' or 'button' element instead or make sure to add 'role="button"' along with 'tabindex' otherwise.`,
|
|
341
|
-
this.$el
|
|
347
|
+
this.$el,
|
|
342
348
|
);
|
|
343
349
|
}
|
|
344
350
|
},
|
|
@@ -377,7 +383,7 @@ export default {
|
|
|
377
383
|
const result = await computePosition(
|
|
378
384
|
this.toggleElement,
|
|
379
385
|
this.$refs.content,
|
|
380
|
-
this.floatingUIConfig
|
|
386
|
+
this.floatingUIConfig,
|
|
381
387
|
);
|
|
382
388
|
|
|
383
389
|
/**
|
|
@@ -500,10 +506,22 @@ export default {
|
|
|
500
506
|
},
|
|
501
507
|
onKeydown(event) {
|
|
502
508
|
const {
|
|
509
|
+
keyCode,
|
|
503
510
|
code,
|
|
504
511
|
target: { tagName },
|
|
505
512
|
} = event;
|
|
506
513
|
|
|
514
|
+
// Use keyCode because @vue/test-utils doesn't correctly set the
|
|
515
|
+
// `code` and `key` KeyboardEvent properties. This is only needed in this case because:
|
|
516
|
+
// - We are not using the @keydown.esc template syntax, which under Vue 2 checks against `keyCode` anyway.
|
|
517
|
+
// - The `.trigger('keydown.esc')` shorthand @vue/test-utils provides is useful.
|
|
518
|
+
// See https://github.com/vuejs/vue-test-utils/issues/2096
|
|
519
|
+
if (keyCode === KEY_CODE_ESCAPE && this.visible) {
|
|
520
|
+
stopEvent(event);
|
|
521
|
+
this.close();
|
|
522
|
+
return;
|
|
523
|
+
}
|
|
524
|
+
|
|
507
525
|
let toggleOnEnter = true;
|
|
508
526
|
let toggleOnSpace = true;
|
|
509
527
|
|
|
@@ -547,7 +565,6 @@ export default {
|
|
|
547
565
|
ref="toggle"
|
|
548
566
|
data-testid="base-dropdown-toggle"
|
|
549
567
|
v-on="toggleListeners"
|
|
550
|
-
@keydown.esc.stop.prevent="close"
|
|
551
568
|
>
|
|
552
569
|
<!-- @slot Custom toggle button content -->
|
|
553
570
|
<slot name="toggle">
|
|
@@ -4,7 +4,7 @@ export const GL_DROPDOWN_HIDDEN = 'hidden';
|
|
|
4
4
|
export const GL_DROPDOWN_BEFORE_CLOSE = 'beforeClose';
|
|
5
5
|
export const GL_DROPDOWN_FOCUS_CONTENT = 'focusContent';
|
|
6
6
|
|
|
7
|
-
//
|
|
7
|
+
// KeyboardEvent.code values
|
|
8
8
|
export const ARROW_DOWN = 'ArrowDown';
|
|
9
9
|
export const ARROW_UP = 'ArrowUp';
|
|
10
10
|
export const END = 'End';
|
|
@@ -12,6 +12,9 @@ export const ENTER = 'Enter';
|
|
|
12
12
|
export const HOME = 'Home';
|
|
13
13
|
export const SPACE = 'Space';
|
|
14
14
|
|
|
15
|
+
// KeyboardEvent.keyCode values
|
|
16
|
+
export const KEY_CODE_ESCAPE = 27;
|
|
17
|
+
|
|
15
18
|
// Positioning strategies
|
|
16
19
|
// https://floating-ui.com/docs/computePosition#strategy
|
|
17
20
|
export const POSITION_ABSOLUTE = 'absolute';
|
|
@@ -84,8 +84,7 @@ make them render as links. Otherwise, they will be buttons. Provide an `action`
|
|
|
84
84
|
function to items to be called when they are pressed, or, listen for the
|
|
85
85
|
`action` event on the top-level component. Both will receive the given item as
|
|
86
86
|
an argument.
|
|
87
|
-
A
|
|
88
|
-
[validation error](https://gitlab.com/gitlab-org/gitlab-ui/-/blob/6cbff4f908b429cc01f17a4cc2868e881db1aa31/src/components/base/new_dropdowns/disclosure/utils.js#L1)
|
|
87
|
+
A [validation error](https://gitlab.com/gitlab-org/gitlab-ui/-/blob/6cbff4f908b429cc01f17a4cc2868e881db1aa31/src/components/base/new_dropdowns/disclosure/utils.js#L1)
|
|
89
88
|
will be triggered if neither field is set.
|
|
90
89
|
|
|
91
90
|
Below are the expected shapes of these objects:
|
|
@@ -365,7 +365,7 @@ export default {
|
|
|
365
365
|
default: translatePlural(
|
|
366
366
|
'GlCollapsibleListbox.srOnlyResultsLabel',
|
|
367
367
|
'%d result',
|
|
368
|
-
'%d results'
|
|
368
|
+
'%d results',
|
|
369
369
|
),
|
|
370
370
|
},
|
|
371
371
|
},
|
|
@@ -513,7 +513,7 @@ export default {
|
|
|
513
513
|
if (this.infiniteScrollLoading) {
|
|
514
514
|
return translate(
|
|
515
515
|
'GlCollapsibleListbox.loadingAnnouncementText.loadingMoreItems',
|
|
516
|
-
'Loading more items'
|
|
516
|
+
'Loading more items',
|
|
517
517
|
);
|
|
518
518
|
}
|
|
519
519
|
if (this.searching) {
|
|
@@ -522,7 +522,7 @@ export default {
|
|
|
522
522
|
if (this.loading) {
|
|
523
523
|
return translate(
|
|
524
524
|
'GlCollapsibleListbox.loadingAnnouncementText.loadingItems',
|
|
525
|
-
'Loading items'
|
|
525
|
+
'Loading items',
|
|
526
526
|
);
|
|
527
527
|
}
|
|
528
528
|
return '';
|
|
@@ -568,7 +568,7 @@ export default {
|
|
|
568
568
|
handler(newResetButtonLabel) {
|
|
569
569
|
if (newResetButtonLabel && !this.headerText) {
|
|
570
570
|
throw new Error(
|
|
571
|
-
'The reset button cannot be rendered without a header. Either provide a header via the headerText prop, or do not provide the resetButtonLabel prop.'
|
|
571
|
+
'The reset button cannot be rendered without a header. Either provide a header via the headerText prop, or do not provide the resetButtonLabel prop.',
|
|
572
572
|
);
|
|
573
573
|
}
|
|
574
574
|
},
|
|
@@ -578,7 +578,7 @@ export default {
|
|
|
578
578
|
handler(showSelectAllButtonLabel) {
|
|
579
579
|
if (showSelectAllButtonLabel && !this.headerText) {
|
|
580
580
|
throw new Error(
|
|
581
|
-
'The select all button cannot be rendered without a header. Either provide a header via the headerText prop, or do not provide the showSelectAllButtonLabel prop.'
|
|
581
|
+
'The select all button cannot be rendered without a header. Either provide a header via the headerText prop, or do not provide the showSelectAllButtonLabel prop.',
|
|
582
582
|
);
|
|
583
583
|
}
|
|
584
584
|
},
|
|
@@ -589,7 +589,7 @@ export default {
|
|
|
589
589
|
if (newValue && this.items.some((item) => !isOption(item))) {
|
|
590
590
|
// eslint-disable-next-line no-console
|
|
591
591
|
console.warn(
|
|
592
|
-
'When using grouped options infinite scroll can only be used on the last group.'
|
|
592
|
+
'When using grouped options infinite scroll can only be used on the last group.',
|
|
593
593
|
);
|
|
594
594
|
}
|
|
595
595
|
},
|
|
@@ -793,7 +793,7 @@ export default {
|
|
|
793
793
|
} else {
|
|
794
794
|
this.$emit(
|
|
795
795
|
'select',
|
|
796
|
-
this.selectedValues.filter((selectedValue) => selectedValue !== value)
|
|
796
|
+
this.selectedValues.filter((selectedValue) => selectedValue !== value),
|
|
797
797
|
);
|
|
798
798
|
}
|
|
799
799
|
},
|
|
@@ -249,14 +249,14 @@ export default {
|
|
|
249
249
|
0,
|
|
250
250
|
0,
|
|
251
251
|
this.getPageItem(1, this.labelFirstPage),
|
|
252
|
-
this.getEllipsisItem('left')
|
|
252
|
+
this.getEllipsisItem('left'),
|
|
253
253
|
);
|
|
254
254
|
}
|
|
255
255
|
|
|
256
256
|
if (this.shouldCollapseRightSide) {
|
|
257
257
|
items.push(
|
|
258
258
|
this.getEllipsisItem('right'),
|
|
259
|
-
this.getPageItem(this.totalPages, this.labelLastPage)
|
|
259
|
+
this.getPageItem(this.totalPages, this.labelLastPage),
|
|
260
260
|
);
|
|
261
261
|
}
|
|
262
262
|
}
|
|
@@ -114,7 +114,7 @@ export default {
|
|
|
114
114
|
},
|
|
115
115
|
scrollPathRight() {
|
|
116
116
|
const nextItemToScollTo = this.$refs.pathListItems.find(
|
|
117
|
-
(listItem) => listItem.offsetLeft + listItem.offsetWidth > this.rightHandBoundary
|
|
117
|
+
(listItem) => listItem.offsetLeft + listItem.offsetWidth > this.rightHandBoundary,
|
|
118
118
|
);
|
|
119
119
|
let scrollTo = nextItemToScollTo.offsetLeft - BOUNDARY_WIDTH;
|
|
120
120
|
|
|
@@ -94,7 +94,7 @@ export default {
|
|
|
94
94
|
|
|
95
95
|
return propValueOrDefault(
|
|
96
96
|
'height',
|
|
97
|
-
props.lines * DEFAULT_LINE_HEIGHT + (props.lines - 1) * DEFAULT_LINE_SPACING
|
|
97
|
+
props.lines * DEFAULT_LINE_HEIGHT + (props.lines - 1) * DEFAULT_LINE_SPACING,
|
|
98
98
|
);
|
|
99
99
|
};
|
|
100
100
|
|
|
@@ -154,8 +154,8 @@ export default {
|
|
|
154
154
|
height: DEFAULT_LINE_HEIGHT,
|
|
155
155
|
rx: 4,
|
|
156
156
|
},
|
|
157
|
-
})
|
|
158
|
-
)
|
|
157
|
+
}),
|
|
158
|
+
),
|
|
159
159
|
),
|
|
160
160
|
!reducedMotion &&
|
|
161
161
|
createElement(
|
|
@@ -183,7 +183,7 @@ export default {
|
|
|
183
183
|
repeatCount: 'indefinite',
|
|
184
184
|
},
|
|
185
185
|
}),
|
|
186
|
-
]
|
|
186
|
+
],
|
|
187
187
|
),
|
|
188
188
|
createElement(
|
|
189
189
|
'stop',
|
|
@@ -202,7 +202,7 @@ export default {
|
|
|
202
202
|
repeatCount: 'indefinite',
|
|
203
203
|
},
|
|
204
204
|
}),
|
|
205
|
-
]
|
|
205
|
+
],
|
|
206
206
|
),
|
|
207
207
|
createElement(
|
|
208
208
|
'stop',
|
|
@@ -221,12 +221,12 @@ export default {
|
|
|
221
221
|
repeatCount: 'indefinite',
|
|
222
222
|
},
|
|
223
223
|
}),
|
|
224
|
-
]
|
|
224
|
+
],
|
|
225
225
|
),
|
|
226
|
-
]
|
|
226
|
+
],
|
|
227
227
|
),
|
|
228
228
|
]),
|
|
229
|
-
]
|
|
229
|
+
],
|
|
230
230
|
);
|
|
231
231
|
|
|
232
232
|
if (slotIsSet()) {
|
|
@@ -242,7 +242,7 @@ export default {
|
|
|
242
242
|
height: props.height !== null ? `${props.height}px` : null,
|
|
243
243
|
},
|
|
244
244
|
},
|
|
245
|
-
[svg]
|
|
245
|
+
[svg],
|
|
246
246
|
);
|
|
247
247
|
},
|
|
248
248
|
};
|
|
@@ -11,8 +11,7 @@ data and table head its own styles if necessary.
|
|
|
11
11
|
To ensure we internationalize field labels, always pass an array of objects for the `fields` prop,
|
|
12
12
|
like mentioned in the implementation example.
|
|
13
13
|
|
|
14
|
-
|
|
15
|
-
`field` prop [here.](https://bootstrap-vue.org/docs/components/table#fields-column-definitions)_
|
|
14
|
+
[Learn more about the `field` prop](https://gitlab.com/gitlab-org/gitlab-services/design.gitlab.com/-/blob/2e88af62966265cb725ca3f65f4b175e2494734b/packages/gitlab-ui/src/vendor/bootstrap-vue/src/components/table/README.md#L137).
|
|
16
15
|
|
|
17
16
|
## Header text alignment
|
|
18
17
|
|
|
@@ -27,7 +27,7 @@ The `GlTableLite` component provides all of the styling and formatting features
|
|
|
27
27
|
To ensure we internationalize field labels, always pass an array of objects for the `fields` prop,
|
|
28
28
|
like mentioned in the implementation example.
|
|
29
29
|
|
|
30
|
-
|
|
30
|
+
[Learn more about the `field` prop](https://gitlab.com/gitlab-org/gitlab-services/design.gitlab.com/-/blob/2e88af62966265cb725ca3f65f4b175e2494734b/packages/gitlab-ui/src/vendor/bootstrap-vue/src/components/table/README.md#L137).
|
|
31
31
|
|
|
32
32
|
## Implementation example
|
|
33
33
|
|
|
@@ -134,7 +134,7 @@ export default {
|
|
|
134
134
|
await this.$nextTick();
|
|
135
135
|
const queryParamValue = this.getQueryParamValue();
|
|
136
136
|
const tabIndexToActivate = this.getTabs().findIndex(
|
|
137
|
-
(tab, tabIndex) => this.getTabQueryParamValue(tabIndex) === queryParamValue
|
|
137
|
+
(tab, tabIndex) => this.getTabQueryParamValue(tabIndex) === queryParamValue,
|
|
138
138
|
);
|
|
139
139
|
this.activeTabIndex = tabIndexToActivate !== -1 ? tabIndexToActivate : 0;
|
|
140
140
|
},
|