@gitlab/ui 66.11.0 → 66.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/CHANGELOG.md +14 -0
- package/dist/components/base/datepicker/datepicker.js +29 -6
- package/dist/components/base/form/form_input/form_input.js +24 -4
- package/dist/components/base/form/form_select/form_select.js +24 -4
- package/dist/components/base/table/table.js +9 -1
- package/dist/components/base/table_lite/table_lite.js +9 -1
- package/dist/index.css +1 -1
- package/dist/index.css.map +1 -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/dist/utils/constants.js +7 -1
- package/package.json +1 -1
- package/src/components/base/datepicker/datepicker.spec.js +17 -0
- package/src/components/base/datepicker/datepicker.stories.js +20 -4
- package/src/components/base/datepicker/datepicker.vue +33 -5
- package/src/components/base/form/form_input/form_input.spec.js +52 -0
- package/src/components/base/form/form_input/form_input.stories.js +10 -0
- package/src/components/base/form/form_input/form_input.vue +25 -4
- package/src/components/base/form/form_select/form_select.spec.js +25 -0
- package/src/components/base/form/form_select/form_select.stories.js +7 -0
- package/src/components/base/form/form_select/form_select.vue +25 -4
- package/src/components/base/table/table.scss +13 -0
- package/src/components/base/table/table.spec.js +11 -1
- package/src/components/base/table/table.stories.js +47 -0
- package/src/components/base/table/table.vue +9 -1
- package/src/components/base/table_lite/table_lite.spec.js +11 -1
- package/src/components/base/table_lite/table_lite.stories.js +14 -3
- package/src/components/base/table_lite/table_lite.vue +9 -1
- package/src/utils/constants.js +7 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,17 @@
|
|
|
1
|
+
# [66.13.0](https://gitlab.com/gitlab-org/gitlab-ui/compare/v66.12.0...v66.13.0) (2023-09-21)
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
### Features
|
|
5
|
+
|
|
6
|
+
* **GlFormInut, GlFormSelect, GlDatepicker:** Add prop width, deprecate prop size ([6de322c](https://gitlab.com/gitlab-org/gitlab-ui/commit/6de322c20f7fb2f2f7922392da513167f3bd2530))
|
|
7
|
+
|
|
8
|
+
# [66.12.0](https://gitlab.com/gitlab-org/gitlab-ui/compare/v66.11.0...v66.12.0) (2023-09-21)
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
### Features
|
|
12
|
+
|
|
13
|
+
* **GlTable:** Add option for sticky table headers ([68f814d](https://gitlab.com/gitlab-org/gitlab-ui/commit/68f814da649d7d353232bd7ca0900614ccb41325))
|
|
14
|
+
|
|
1
15
|
# [66.11.0](https://gitlab.com/gitlab-org/gitlab-ui/compare/v66.10.1...v66.11.0) (2023-09-20)
|
|
2
16
|
|
|
3
17
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import isString from 'lodash/isString';
|
|
2
2
|
import Pikaday from 'pikaday';
|
|
3
|
-
import { defaultDateFormat, datepickerSizeOptionsMap } from '../../../utils/constants';
|
|
3
|
+
import { defaultDateFormat, datepickerWidthOptionsMap, datepickerSizeOptionsMap } from '../../../utils/constants';
|
|
4
4
|
import { areDatesEqual } from '../../../utils/datetime_utility';
|
|
5
5
|
import GlButton from '../button/button';
|
|
6
6
|
import GlFormInput from '../form/form_input/form_input';
|
|
@@ -173,10 +173,27 @@ var script = {
|
|
|
173
173
|
required: false,
|
|
174
174
|
default: null
|
|
175
175
|
},
|
|
176
|
+
/**
|
|
177
|
+
* Maximum width of the Datepicker
|
|
178
|
+
*/
|
|
179
|
+
width: {
|
|
180
|
+
type: String,
|
|
181
|
+
required: false,
|
|
182
|
+
default: null,
|
|
183
|
+
validator: value => Object.keys(datepickerWidthOptionsMap).includes(value)
|
|
184
|
+
},
|
|
185
|
+
/**
|
|
186
|
+
* ⚠️ DEPRECATED:
|
|
187
|
+
*
|
|
188
|
+
* Will be replaced by the
|
|
189
|
+
* property width
|
|
190
|
+
*
|
|
191
|
+
* Maximum width of the Datepicker
|
|
192
|
+
*/
|
|
176
193
|
size: {
|
|
177
194
|
type: String,
|
|
178
195
|
required: false,
|
|
179
|
-
default:
|
|
196
|
+
default: null,
|
|
180
197
|
validator: value => Object.keys(datepickerSizeOptionsMap).includes(value)
|
|
181
198
|
}
|
|
182
199
|
},
|
|
@@ -211,10 +228,16 @@ var script = {
|
|
|
211
228
|
return null;
|
|
212
229
|
},
|
|
213
230
|
datepickerClasses() {
|
|
214
|
-
return ['gl-datepicker', 'd-inline-block', 'gl-w-full', `gl-form-input-${this.
|
|
215
|
-
},
|
|
216
|
-
|
|
217
|
-
|
|
231
|
+
return ['gl-datepicker', 'd-inline-block', 'gl-w-full', `gl-form-input-${this.computedWidth}`];
|
|
232
|
+
},
|
|
233
|
+
computedWidth() {
|
|
234
|
+
if (this.width) {
|
|
235
|
+
return this.width;
|
|
236
|
+
// eslint-disable-next-line no-else-return
|
|
237
|
+
} else if (this.size) {
|
|
238
|
+
return datepickerSizeOptionsMap[this.size];
|
|
239
|
+
}
|
|
240
|
+
return 'md';
|
|
218
241
|
}
|
|
219
242
|
},
|
|
220
243
|
watch: {
|
|
@@ -19,6 +19,23 @@ var script = {
|
|
|
19
19
|
/**
|
|
20
20
|
* Maximum width of the input
|
|
21
21
|
*/
|
|
22
|
+
width: {
|
|
23
|
+
type: [String, Object],
|
|
24
|
+
required: false,
|
|
25
|
+
default: null,
|
|
26
|
+
validator: value => {
|
|
27
|
+
const widths = isObject(value) ? Object.values(value) : [value];
|
|
28
|
+
return widths.every(width => Object.values(formInputSizes).includes(width));
|
|
29
|
+
}
|
|
30
|
+
},
|
|
31
|
+
/**
|
|
32
|
+
* ⚠️ DEPRECATED:
|
|
33
|
+
*
|
|
34
|
+
* Will be replaced by the
|
|
35
|
+
* property width
|
|
36
|
+
*
|
|
37
|
+
* Maximum width of the input
|
|
38
|
+
*/
|
|
22
39
|
size: {
|
|
23
40
|
type: [String, Object],
|
|
24
41
|
required: false,
|
|
@@ -30,21 +47,24 @@ var script = {
|
|
|
30
47
|
}
|
|
31
48
|
},
|
|
32
49
|
computed: {
|
|
50
|
+
computedWidth() {
|
|
51
|
+
return this.width ? this.width : this.size;
|
|
52
|
+
},
|
|
33
53
|
cssClasses() {
|
|
34
|
-
if (this.
|
|
54
|
+
if (this.computedWidth === null) {
|
|
35
55
|
return [];
|
|
36
56
|
}
|
|
37
|
-
if (isObject(this.
|
|
57
|
+
if (isObject(this.computedWidth)) {
|
|
38
58
|
const {
|
|
39
59
|
default: defaultSize,
|
|
40
60
|
...nonDefaultSizes
|
|
41
|
-
} = this.
|
|
61
|
+
} = this.computedWidth;
|
|
42
62
|
return [...(defaultSize ? [`gl-form-input-${defaultSize}`] : []), ...Object.entries(nonDefaultSizes).map(_ref => {
|
|
43
63
|
let [breakpoint, size] = _ref;
|
|
44
64
|
return `gl-${breakpoint}-form-input-${size}`;
|
|
45
65
|
})];
|
|
46
66
|
}
|
|
47
|
-
return [`gl-form-input-${this.
|
|
67
|
+
return [`gl-form-input-${this.computedWidth}`];
|
|
48
68
|
},
|
|
49
69
|
listeners() {
|
|
50
70
|
var _this = this;
|
|
@@ -13,6 +13,23 @@ var script = {
|
|
|
13
13
|
/**
|
|
14
14
|
* Maximum width of the Select
|
|
15
15
|
*/
|
|
16
|
+
width: {
|
|
17
|
+
type: [String, Object],
|
|
18
|
+
required: false,
|
|
19
|
+
default: null,
|
|
20
|
+
validator: value => {
|
|
21
|
+
const widths = isObject(value) ? Object.values(value) : [value];
|
|
22
|
+
return widths.every(width => Object.values(formInputSizes).includes(width));
|
|
23
|
+
}
|
|
24
|
+
},
|
|
25
|
+
/**
|
|
26
|
+
* ⚠️ DEPRECATED:
|
|
27
|
+
*
|
|
28
|
+
* Will be replaced by the
|
|
29
|
+
* property width
|
|
30
|
+
*
|
|
31
|
+
* Maximum width of the Select
|
|
32
|
+
*/
|
|
16
33
|
size: {
|
|
17
34
|
type: [String, Object],
|
|
18
35
|
required: false,
|
|
@@ -24,21 +41,24 @@ var script = {
|
|
|
24
41
|
}
|
|
25
42
|
},
|
|
26
43
|
computed: {
|
|
44
|
+
computedWidth() {
|
|
45
|
+
return this.width ? this.width : this.size;
|
|
46
|
+
},
|
|
27
47
|
cssClasses() {
|
|
28
|
-
if (this.
|
|
48
|
+
if (this.computedWidth === null) {
|
|
29
49
|
return [];
|
|
30
50
|
}
|
|
31
|
-
if (isObject(this.
|
|
51
|
+
if (isObject(this.computedWidth)) {
|
|
32
52
|
const {
|
|
33
53
|
default: defaultSize,
|
|
34
54
|
...nonDefaultSizes
|
|
35
|
-
} = this.
|
|
55
|
+
} = this.computedWidth;
|
|
36
56
|
return [...(defaultSize ? [`gl-form-select-${defaultSize}`] : []), ...Object.entries(nonDefaultSizes).map(_ref => {
|
|
37
57
|
let [breakpoint, size] = _ref;
|
|
38
58
|
return `gl-${breakpoint}-form-select-${size}`;
|
|
39
59
|
})];
|
|
40
60
|
}
|
|
41
|
-
return [`gl-form-select-${this.
|
|
61
|
+
return [`gl-form-select-${this.computedWidth}`];
|
|
42
62
|
}
|
|
43
63
|
}
|
|
44
64
|
};
|
|
@@ -26,11 +26,19 @@ var script = {
|
|
|
26
26
|
type: Array,
|
|
27
27
|
required: false,
|
|
28
28
|
default: null
|
|
29
|
+
},
|
|
30
|
+
stickyHeader: {
|
|
31
|
+
type: Boolean,
|
|
32
|
+
default: false,
|
|
33
|
+
required: false
|
|
29
34
|
}
|
|
30
35
|
},
|
|
31
36
|
computed: {
|
|
37
|
+
stickyHeaderClass() {
|
|
38
|
+
return this.stickyHeader ? 'gl-table--sticky-header' : null;
|
|
39
|
+
},
|
|
32
40
|
localTableClass() {
|
|
33
|
-
return ['gl-table', this.tableClass];
|
|
41
|
+
return ['gl-table', this.tableClass, this.stickyHeaderClass];
|
|
34
42
|
}
|
|
35
43
|
},
|
|
36
44
|
mounted() {
|
|
@@ -16,11 +16,19 @@ var script = {
|
|
|
16
16
|
type: Array,
|
|
17
17
|
required: false,
|
|
18
18
|
default: null
|
|
19
|
+
},
|
|
20
|
+
stickyHeader: {
|
|
21
|
+
type: Boolean,
|
|
22
|
+
default: false,
|
|
23
|
+
required: false
|
|
19
24
|
}
|
|
20
25
|
},
|
|
21
26
|
computed: {
|
|
27
|
+
stickyHeaderClass() {
|
|
28
|
+
return this.stickyHeader ? 'gl-table--sticky-header' : null;
|
|
29
|
+
},
|
|
22
30
|
localTableClass() {
|
|
23
|
-
return ['gl-table', this.tableClass];
|
|
31
|
+
return ['gl-table', this.tableClass, this.stickyHeaderClass];
|
|
24
32
|
}
|
|
25
33
|
}
|
|
26
34
|
};
|