@gitlab/ui 71.3.0 → 71.4.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/CHANGELOG.md +7 -0
- package/dist/components/base/filtered_search/filtered_search.js +0 -1
- package/dist/components/base/loading_icon/loading_icon.js +0 -1
- package/dist/components/experimental/duo/chat/duo_chat.js +0 -1
- package/dist/components/utilities/truncate_text/truncate_text.js +11 -1
- package/dist/config.js +0 -1
- package/dist/tokens/css/tokens.css +1 -1
- package/dist/tokens/css/tokens.dark.css +1 -1
- package/dist/tokens/js/tokens.dark.js +1 -1
- package/dist/tokens/js/tokens.js +1 -1
- package/dist/tokens/scss/_tokens.dark.scss +1 -1
- package/dist/tokens/scss/_tokens.scss +1 -1
- package/package.json +3 -3
- package/src/components/utilities/truncate_text/truncate_text.spec.js +14 -0
- package/src/components/utilities/truncate_text/truncate_text.stories.js +2 -0
- package/src/components/utilities/truncate_text/truncate_text.vue +17 -3
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,10 @@
|
|
|
1
|
+
# [71.4.0](https://gitlab.com/gitlab-org/gitlab-ui/compare/v71.3.0...v71.4.0) (2023-12-04)
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
### Features
|
|
5
|
+
|
|
6
|
+
* **GlTruncateText:** add `toggleButtonProps` prop ([25a6577](https://gitlab.com/gitlab-org/gitlab-ui/commit/25a6577ba7061ce82d040ad5cda6977477e04f41))
|
|
7
|
+
|
|
1
8
|
# [71.3.0](https://gitlab.com/gitlab-org/gitlab-ui/compare/v71.2.0...v71.3.0) (2023-12-04)
|
|
2
9
|
|
|
3
10
|
|
|
@@ -311,7 +311,6 @@ var script = {
|
|
|
311
311
|
// Do nothing if there was no active token, or if idx > this.activeTokenIdx,
|
|
312
312
|
// to preserve the active state of the remaining tokens.
|
|
313
313
|
},
|
|
314
|
-
|
|
315
314
|
replaceToken(idx, token) {
|
|
316
315
|
this.$set(this.tokens, idx, ensureTokenId({
|
|
317
316
|
...token,
|
|
@@ -43,6 +43,16 @@ var script = {
|
|
|
43
43
|
type: Number,
|
|
44
44
|
required: false,
|
|
45
45
|
default: 10
|
|
46
|
+
},
|
|
47
|
+
/**
|
|
48
|
+
* Props that are passed to the toggle button
|
|
49
|
+
*/
|
|
50
|
+
toggleButtonProps: {
|
|
51
|
+
type: Object,
|
|
52
|
+
required: false,
|
|
53
|
+
default() {
|
|
54
|
+
return {};
|
|
55
|
+
}
|
|
46
56
|
}
|
|
47
57
|
},
|
|
48
58
|
data() {
|
|
@@ -101,7 +111,7 @@ var script = {
|
|
|
101
111
|
const __vue_script__ = script;
|
|
102
112
|
|
|
103
113
|
/* template */
|
|
104
|
-
var __vue_render__ = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('section',[_c('article',{directives:[{name:"gl-resize-observer",rawName:"v-gl-resize-observer",value:(_vm.onResize),expression:"onResize"}],class:_vm.truncationClasses,style:(_vm.cssVariables),attrs:{"aria-expanded":_vm.ariaExpanded}},[_vm._t("default")],2),_vm._v(" "),(_vm.showTruncationToggle)?_c('gl-button',{attrs:{"variant":"link"},on:{"click":_vm.toggleTruncation}},[_vm._v(_vm._s(_vm.truncationToggleText))]):_vm._e()],1)};
|
|
114
|
+
var __vue_render__ = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('section',[_c('article',{directives:[{name:"gl-resize-observer",rawName:"v-gl-resize-observer",value:(_vm.onResize),expression:"onResize"}],class:_vm.truncationClasses,style:(_vm.cssVariables),attrs:{"aria-expanded":_vm.ariaExpanded}},[_vm._t("default")],2),_vm._v(" "),(_vm.showTruncationToggle)?_c('gl-button',_vm._b({attrs:{"variant":"link"},on:{"click":_vm.toggleTruncation}},'gl-button',_vm.toggleButtonProps,false),[_vm._v(_vm._s(_vm.truncationToggleText))]):_vm._e()],1)};
|
|
105
115
|
var __vue_staticRenderFns__ = [];
|
|
106
116
|
|
|
107
117
|
/* style */
|
package/dist/config.js
CHANGED
package/dist/tokens/js/tokens.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@gitlab/ui",
|
|
3
|
-
"version": "71.
|
|
3
|
+
"version": "71.4.0",
|
|
4
4
|
"description": "GitLab UI Components",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -87,8 +87,8 @@
|
|
|
87
87
|
},
|
|
88
88
|
"devDependencies": {
|
|
89
89
|
"@arkweid/lefthook": "0.7.7",
|
|
90
|
-
"@babel/core": "^7.23.
|
|
91
|
-
"@babel/preset-env": "^7.23.
|
|
90
|
+
"@babel/core": "^7.23.5",
|
|
91
|
+
"@babel/preset-env": "^7.23.5",
|
|
92
92
|
"@babel/preset-react": "^7.23.3",
|
|
93
93
|
"@cypress/grep": "^4.0.1",
|
|
94
94
|
"@gitlab/eslint-plugin": "19.2.0",
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { nextTick } from 'vue';
|
|
1
2
|
import { mount } from '@vue/test-utils';
|
|
2
3
|
import { createMockDirective, getBinding } from '~helpers/vue_mock_directive';
|
|
3
4
|
import GlButton from '../../base/button/button.vue';
|
|
@@ -133,4 +134,17 @@ describe('GlTruncateText', () => {
|
|
|
133
134
|
});
|
|
134
135
|
});
|
|
135
136
|
});
|
|
137
|
+
|
|
138
|
+
it('passes `toggleButtonProps` to toggle button', async () => {
|
|
139
|
+
const buttonTextClasses = 'foo-bar';
|
|
140
|
+
|
|
141
|
+
createComponent({ toggleButtonProps: { buttonTextClasses } });
|
|
142
|
+
|
|
143
|
+
getBinding(findContentEl(), 'gl-resize-observer').value({
|
|
144
|
+
target: { scrollHeight: 20, offsetHeight: 10 },
|
|
145
|
+
});
|
|
146
|
+
await nextTick();
|
|
147
|
+
|
|
148
|
+
expect(findButton().props('buttonTextClasses')).toBe(buttonTextClasses);
|
|
149
|
+
});
|
|
136
150
|
});
|
|
@@ -6,11 +6,13 @@ const generateProps = ({
|
|
|
6
6
|
showLessText = 'Show less',
|
|
7
7
|
lines = 3,
|
|
8
8
|
mobileLines = 10,
|
|
9
|
+
toggleButtonProps = {},
|
|
9
10
|
} = {}) => ({
|
|
10
11
|
showMoreText,
|
|
11
12
|
showLessText,
|
|
12
13
|
lines,
|
|
13
14
|
mobileLines,
|
|
15
|
+
toggleButtonProps,
|
|
14
16
|
});
|
|
15
17
|
|
|
16
18
|
const content = () => [...Array(15)].map((_, i) => `line ${i + 1}`).join('\n');
|
|
@@ -44,6 +44,16 @@ export default {
|
|
|
44
44
|
required: false,
|
|
45
45
|
default: 10,
|
|
46
46
|
},
|
|
47
|
+
/**
|
|
48
|
+
* Props that are passed to the toggle button
|
|
49
|
+
*/
|
|
50
|
+
toggleButtonProps: {
|
|
51
|
+
type: Object,
|
|
52
|
+
required: false,
|
|
53
|
+
default() {
|
|
54
|
+
return {};
|
|
55
|
+
},
|
|
56
|
+
},
|
|
47
57
|
},
|
|
48
58
|
data() {
|
|
49
59
|
return {
|
|
@@ -103,8 +113,12 @@ export default {
|
|
|
103
113
|
<!-- @slot Text content -->
|
|
104
114
|
<slot></slot>
|
|
105
115
|
</article>
|
|
106
|
-
<gl-button
|
|
107
|
-
|
|
108
|
-
|
|
116
|
+
<gl-button
|
|
117
|
+
v-if="showTruncationToggle"
|
|
118
|
+
v-bind="toggleButtonProps"
|
|
119
|
+
variant="link"
|
|
120
|
+
@click="toggleTruncation"
|
|
121
|
+
>{{ truncationToggleText }}</gl-button
|
|
122
|
+
>
|
|
109
123
|
</section>
|
|
110
124
|
</template>
|