@gitlab/ui 37.4.2 → 37.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/CHANGELOG.md +12 -0
- package/dist/components/base/accordion/accordion_item.js +14 -1
- package/dist/components/base/datepicker/datepicker.documentation.js +2 -47
- package/dist/components/base/datepicker/datepicker.js +37 -1
- package/dist/index.css +1 -1
- package/dist/index.css.map +1 -1
- package/documentation/documented_stories.js +1 -0
- package/package.json +1 -1
- package/src/components/base/accordion/accordion_item.spec.js +12 -0
- package/src/components/base/accordion/accordion_item.stories.js +4 -2
- package/src/components/base/accordion/accordion_item.vue +12 -1
- package/src/components/base/datepicker/datepicker.documentation.js +0 -59
- package/src/components/base/datepicker/datepicker.md +0 -6
- package/src/components/base/datepicker/datepicker.stories.js +97 -71
- package/src/components/base/datepicker/datepicker.vue +36 -1
- package/src/components/base/dropdown/dropdown.stories.js +4 -1
- package/src/components/base/dropdown/dropdown_section_header.scss +1 -0
- package/dist/components/base/datepicker/examples/datepicker.basic.example.js +0 -48
- package/dist/components/base/datepicker/examples/datepicker.custom_input.example.js +0 -48
- package/dist/components/base/datepicker/examples/datepicker.disabled.example.js +0 -48
- package/dist/components/base/datepicker/examples/datepicker.open_on_focus.example.js +0 -48
- package/dist/components/base/datepicker/examples/datepicker.with_clear_button.example.js +0 -48
- package/dist/components/base/datepicker/examples/index.js +0 -32
- package/src/components/base/datepicker/examples/datepicker.basic.example.vue +0 -12
- package/src/components/base/datepicker/examples/datepicker.custom_input.example.vue +0 -21
- package/src/components/base/datepicker/examples/datepicker.disabled.example.vue +0 -12
- package/src/components/base/datepicker/examples/datepicker.open_on_focus.example.vue +0 -12
- package/src/components/base/datepicker/examples/datepicker.with_clear_button.example.vue +0 -12
- package/src/components/base/datepicker/examples/index.js +0 -38
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,15 @@
|
|
|
1
|
+
# [37.5.0](https://gitlab.com/gitlab-org/gitlab-ui/compare/v37.4.2...v37.5.0) (2022-03-10)
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
### Bug Fixes
|
|
5
|
+
|
|
6
|
+
* **GlDropdown:** Wrap text in dropdown section header ([1408742](https://gitlab.com/gitlab-org/gitlab-ui/commit/140874226a351da03522b7b45ef4428443162a79))
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
### Features
|
|
10
|
+
|
|
11
|
+
* **GlAccordionItem:** Add titleVisible property ([f8626aa](https://gitlab.com/gitlab-org/gitlab-ui/commit/f8626aa2a343d4159efddf6aacbdbaad6593eb27))
|
|
12
|
+
|
|
1
13
|
## [37.4.2](https://gitlab.com/gitlab-org/gitlab-ui/compare/v37.4.1...v37.4.2) (2022-03-09)
|
|
2
14
|
|
|
3
15
|
|
|
@@ -24,6 +24,15 @@ var script = {
|
|
|
24
24
|
required: true
|
|
25
25
|
},
|
|
26
26
|
|
|
27
|
+
/*
|
|
28
|
+
Used to set the title of accordion link when the content is visible
|
|
29
|
+
*/
|
|
30
|
+
titleVisible: {
|
|
31
|
+
type: String,
|
|
32
|
+
default: null,
|
|
33
|
+
required: false
|
|
34
|
+
},
|
|
35
|
+
|
|
27
36
|
/*
|
|
28
37
|
When set, it will ensure the accordion item is initially visible
|
|
29
38
|
*/
|
|
@@ -67,6 +76,10 @@ var script = {
|
|
|
67
76
|
|
|
68
77
|
icon() {
|
|
69
78
|
return this.isVisible ? 'chevron-down' : 'chevron-right';
|
|
79
|
+
},
|
|
80
|
+
|
|
81
|
+
buttonTitle() {
|
|
82
|
+
return this.isVisible && this.titleVisible ? this.titleVisible : this.title;
|
|
70
83
|
}
|
|
71
84
|
|
|
72
85
|
}
|
|
@@ -76,7 +89,7 @@ var script = {
|
|
|
76
89
|
const __vue_script__ = script;
|
|
77
90
|
|
|
78
91
|
/* template */
|
|
79
|
-
var __vue_render__ = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',{staticClass:"gl-accordion-item"},[_c(_vm.headerComponent,{tag:"component",staticClass:"gl-accordion-item-header"},[_c('gl-button',{directives:[{name:"gl-collapse-toggle",rawName:"v-gl-collapse-toggle",value:(_vm.accordionItemId),expression:"accordionItemId"}],attrs:{"variant":"link","button-text-classes":"gl-display-flex","icon":_vm.icon}},[_vm._v("\n "+_vm._s(_vm.
|
|
92
|
+
var __vue_render__ = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',{staticClass:"gl-accordion-item"},[_c(_vm.headerComponent,{tag:"component",staticClass:"gl-accordion-item-header"},[_c('gl-button',{directives:[{name:"gl-collapse-toggle",rawName:"v-gl-collapse-toggle",value:(_vm.accordionItemId),expression:"accordionItemId"}],attrs:{"variant":"link","button-text-classes":"gl-display-flex","icon":_vm.icon}},[_vm._v("\n "+_vm._s(_vm.buttonTitle)+"\n ")])],1),_vm._v(" "),_c('b-collapse',{staticClass:"gl-mt-3 gl-font-base",attrs:{"id":_vm.accordionItemId,"visible":_vm.isVisible,"accordion":_vm.accordion,"data-testid":("accordion-item-collapse-" + _vm.accordionItemId)},model:{value:(_vm.isVisible),callback:function ($$v) {_vm.isVisible=$$v;},expression:"isVisible"}},[_vm._t("default")],2)],1)};
|
|
80
93
|
var __vue_staticRenderFns__ = [];
|
|
81
94
|
|
|
82
95
|
/* style */
|
|
@@ -1,52 +1,7 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
var description = "# Datepicker\n\n<!-- STORY -->\n\n## Usage\n\nDate picker allows users to choose and input a date by manually typing the date into the input field\nor by using a calendar-like dropdown.\n\n### Warning\n\nBe careful when binding a date value using `value` prop. `value` is a watched property and Date\npicker will emit `input` event on _initial load_. Alternatively, use `defaultDate` to set the\ninitial date then receive updated date values through `input` events.\n";
|
|
1
|
+
var description = "Date picker allows users to choose and input a date by manually typing the date into the input field\nor by using a calendar-like dropdown.\n\n### Warning\n\nBe careful when binding a date value using `value` prop. `value` is a watched property and Date\npicker will emit `input` event on _initial load_. Alternatively, use `defaultDate` to set the\ninitial date then receive updated date values through `input` events.\n";
|
|
4
2
|
|
|
5
3
|
var datepicker_documentation = {
|
|
6
|
-
description
|
|
7
|
-
examples,
|
|
8
|
-
propsInfo: {
|
|
9
|
-
target: {
|
|
10
|
-
additionalInfo: 'Selector of element that triggers the datepicker. Defaults to the calendar icon. Pass `null` to trigger on input focus.'
|
|
11
|
-
},
|
|
12
|
-
container: {
|
|
13
|
-
additionalInfo: 'DOM node to render calendar into. Defaults to the datepicker container. Pass `null` to use Pikaday default.'
|
|
14
|
-
},
|
|
15
|
-
disableDayFn: {
|
|
16
|
-
additionalInfo: 'Accepts a function that accepts a date as argument and returns true if the date is disabled.'
|
|
17
|
-
},
|
|
18
|
-
autocomplete: {
|
|
19
|
-
additionalInfo: 'Defaults to `off` when datepicker opens on focus, otherwise defaults to `null`.'
|
|
20
|
-
},
|
|
21
|
-
defaultDate: {
|
|
22
|
-
additionalInfo: 'Use this prop to set the initial date for the datepicker.'
|
|
23
|
-
}
|
|
24
|
-
},
|
|
25
|
-
events: [{
|
|
26
|
-
event: 'input',
|
|
27
|
-
description: 'Emitted when a new date has been selected.',
|
|
28
|
-
args: [{
|
|
29
|
-
arg: 'date',
|
|
30
|
-
description: 'The selected date'
|
|
31
|
-
}]
|
|
32
|
-
}, {
|
|
33
|
-
event: 'close',
|
|
34
|
-
description: 'Emitted when the datepicker is hidden.'
|
|
35
|
-
}, {
|
|
36
|
-
event: 'open',
|
|
37
|
-
description: 'Emitted when the datepicker becomes visible.'
|
|
38
|
-
}, {
|
|
39
|
-
event: 'draw',
|
|
40
|
-
description: 'Emitted when the datepicker draws a new month.'
|
|
41
|
-
}, {
|
|
42
|
-
event: 'clear',
|
|
43
|
-
description: 'Emitted when the clear button is clicked.'
|
|
44
|
-
}],
|
|
45
|
-
slots: [{
|
|
46
|
-
name: 'default',
|
|
47
|
-
description: '(optional) Input to display and bind the datepicker to. Defaults to `<gl-form-input />`',
|
|
48
|
-
scopedProps: `{ formattedDate: string }`
|
|
49
|
-
}]
|
|
4
|
+
description
|
|
50
5
|
};
|
|
51
6
|
|
|
52
7
|
export default datepicker_documentation;
|
|
@@ -50,11 +50,18 @@ var script = {
|
|
|
50
50
|
GlButton
|
|
51
51
|
},
|
|
52
52
|
props: {
|
|
53
|
+
/**
|
|
54
|
+
* Selector of element that triggers the datepicker. Defaults to the calendar icon. Pass `null` to trigger on input focus.
|
|
55
|
+
*/
|
|
53
56
|
target: {
|
|
54
57
|
type: String,
|
|
55
58
|
required: false,
|
|
56
59
|
default: ''
|
|
57
60
|
},
|
|
61
|
+
|
|
62
|
+
/**
|
|
63
|
+
* DOM node to render calendar into. Defaults to the datepicker container. Pass `null` to use Pikaday default.
|
|
64
|
+
*/
|
|
58
65
|
container: {
|
|
59
66
|
type: String,
|
|
60
67
|
required: false,
|
|
@@ -85,6 +92,10 @@ var script = {
|
|
|
85
92
|
required: false,
|
|
86
93
|
default: null
|
|
87
94
|
},
|
|
95
|
+
|
|
96
|
+
/**
|
|
97
|
+
* Accepts a function that accepts a date as argument and returns true if the date is disabled.
|
|
98
|
+
*/
|
|
88
99
|
disableDayFn: {
|
|
89
100
|
type: Function,
|
|
90
101
|
required: false,
|
|
@@ -105,6 +116,10 @@ var script = {
|
|
|
105
116
|
required: false,
|
|
106
117
|
default: defaultDateFormat
|
|
107
118
|
},
|
|
119
|
+
|
|
120
|
+
/**
|
|
121
|
+
* Defaults to `off` when datepicker opens on focus, otherwise defaults to `null`.
|
|
122
|
+
*/
|
|
108
123
|
autocomplete: {
|
|
109
124
|
type: String,
|
|
110
125
|
required: false,
|
|
@@ -125,6 +140,10 @@ var script = {
|
|
|
125
140
|
required: false,
|
|
126
141
|
default: false
|
|
127
142
|
},
|
|
143
|
+
|
|
144
|
+
/**
|
|
145
|
+
* Use this prop to set the initial date for the datepicker.
|
|
146
|
+
*/
|
|
128
147
|
defaultDate: {
|
|
129
148
|
type: Date,
|
|
130
149
|
required: false,
|
|
@@ -289,23 +308,40 @@ var script = {
|
|
|
289
308
|
|
|
290
309
|
methods: {
|
|
291
310
|
selected(date) {
|
|
311
|
+
/**
|
|
312
|
+
* Emitted when a new date has been selected.
|
|
313
|
+
* @property {Date} date The selected date
|
|
314
|
+
*/
|
|
292
315
|
this.$emit('input', date);
|
|
293
316
|
},
|
|
294
317
|
|
|
295
318
|
closed() {
|
|
319
|
+
/**
|
|
320
|
+
* Emitted when the datepicker is hidden.
|
|
321
|
+
*/
|
|
296
322
|
this.$emit('close');
|
|
297
323
|
},
|
|
298
324
|
|
|
299
325
|
opened() {
|
|
326
|
+
/**
|
|
327
|
+
* Emitted when the datepicker becomes visible.
|
|
328
|
+
*/
|
|
300
329
|
this.$emit('open');
|
|
301
330
|
},
|
|
302
331
|
|
|
303
332
|
cleared() {
|
|
304
333
|
this.textInput = '';
|
|
334
|
+
/**
|
|
335
|
+
* Emitted when the clear button is clicked.
|
|
336
|
+
*/
|
|
337
|
+
|
|
305
338
|
this.$emit('clear');
|
|
306
339
|
},
|
|
307
340
|
|
|
308
341
|
draw() {
|
|
342
|
+
/**
|
|
343
|
+
* Emitted when the datepicker draws a new month.
|
|
344
|
+
*/
|
|
309
345
|
this.$emit('monthChange');
|
|
310
346
|
},
|
|
311
347
|
|
|
@@ -324,7 +360,7 @@ var script = {
|
|
|
324
360
|
const __vue_script__ = script;
|
|
325
361
|
|
|
326
362
|
/* template */
|
|
327
|
-
var __vue_render__ = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',{staticClass:"gl-datepicker d-inline-block"},[(_vm.showDefaultField)?_c('div',{staticClass:"
|
|
363
|
+
var __vue_render__ = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',{staticClass:"gl-datepicker d-inline-block"},[(_vm.showDefaultField)?_c('div',{staticClass:"gl-relative"},[_vm._t("default",[_c('gl-form-input',{staticClass:"gl-datepicker-input",class:_vm.renderClearButton ? 'gl-pr-9!' : 'gl-pr-7!',attrs:{"id":_vm.inputId,"name":_vm.inputName,"data-testid":"gl-datepicker-input","value":_vm.formattedDate,"placeholder":_vm.placeholder,"autocomplete":_vm.inputAutocomplete,"disabled":_vm.disabled,"aria-label":_vm.inputLabel},on:{"keydown":function($event){if(!$event.type.indexOf('key')&&_vm._k($event.keyCode,"enter",13,$event.key,"Enter")){ return null; }return _vm.onKeydown($event)}},model:{value:(_vm.textInput),callback:function ($$v) {_vm.textInput=$$v;},expression:"textInput"}})],{"formattedDate":_vm.formattedDate}),_vm._v(" "),_c('div',{staticClass:"gl-datepicker-actions"},[(_vm.renderClearButton)?_c('gl-button',{staticClass:"gl-pointer-events-auto",attrs:{"data-testid":"clear-button","aria-label":"Clear date","category":"tertiary","size":"small","icon":"clear"},on:{"click":_vm.cleared}}):_vm._e(),_vm._v(" "),(_vm.triggerOnFocus || _vm.disabled)?_c('span',{staticClass:"gl-px-2",class:_vm.disabled ? 'gl-text-gray-400' : 'gl-text-gray-500',attrs:{"data-testid":"datepicker-calendar-icon"}},[_c('gl-icon',{staticClass:"gl-display-block",attrs:{"name":"calendar","size":16}})],1):_c('gl-button',{ref:"calendarTriggerBtn",staticClass:"gl-pointer-events-auto",attrs:{"aria-label":"Open datepicker","category":"tertiary","size":"small","icon":"calendar"}})],1)],2):_vm._t("default",null,{"formattedDate":_vm.formattedDate})],2)};
|
|
328
364
|
var __vue_staticRenderFns__ = [];
|
|
329
365
|
|
|
330
366
|
/* style */
|