@gitlab/ui 37.4.2 → 37.5.2

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.
Files changed (41) hide show
  1. package/CHANGELOG.md +26 -0
  2. package/dist/components/base/accordion/accordion_item.js +14 -1
  3. package/dist/components/base/datepicker/datepicker.documentation.js +2 -47
  4. package/dist/components/base/datepicker/datepicker.js +37 -1
  5. package/dist/components/base/dropdown/dropdown.js +2 -2
  6. package/dist/components/base/filtered_search/filtered_search.js +24 -8
  7. package/dist/components/base/filtered_search/filtered_search_term.js +10 -1
  8. package/dist/components/base/filtered_search/filtered_search_utils.js +2 -1
  9. package/dist/index.css +1 -1
  10. package/dist/index.css.map +1 -1
  11. package/documentation/documented_stories.js +1 -0
  12. package/package.json +2 -2
  13. package/src/components/base/accordion/accordion_item.spec.js +12 -0
  14. package/src/components/base/accordion/accordion_item.stories.js +4 -2
  15. package/src/components/base/accordion/accordion_item.vue +12 -1
  16. package/src/components/base/datepicker/datepicker.documentation.js +0 -59
  17. package/src/components/base/datepicker/datepicker.md +0 -6
  18. package/src/components/base/datepicker/datepicker.stories.js +97 -71
  19. package/src/components/base/datepicker/datepicker.vue +36 -1
  20. package/src/components/base/dropdown/dropdown.spec.js +29 -0
  21. package/src/components/base/dropdown/dropdown.stories.js +4 -1
  22. package/src/components/base/dropdown/dropdown.vue +5 -3
  23. package/src/components/base/dropdown/dropdown_section_header.scss +1 -0
  24. package/src/components/base/filtered_search/filtered_search.spec.js +106 -12
  25. package/src/components/base/filtered_search/filtered_search.stories.js +3 -0
  26. package/src/components/base/filtered_search/filtered_search.vue +21 -6
  27. package/src/components/base/filtered_search/filtered_search_term.spec.js +14 -9
  28. package/src/components/base/filtered_search/filtered_search_term.vue +7 -1
  29. package/src/components/base/filtered_search/filtered_search_utils.js +2 -0
  30. package/dist/components/base/datepicker/examples/datepicker.basic.example.js +0 -48
  31. package/dist/components/base/datepicker/examples/datepicker.custom_input.example.js +0 -48
  32. package/dist/components/base/datepicker/examples/datepicker.disabled.example.js +0 -48
  33. package/dist/components/base/datepicker/examples/datepicker.open_on_focus.example.js +0 -48
  34. package/dist/components/base/datepicker/examples/datepicker.with_clear_button.example.js +0 -48
  35. package/dist/components/base/datepicker/examples/index.js +0 -32
  36. package/src/components/base/datepicker/examples/datepicker.basic.example.vue +0 -12
  37. package/src/components/base/datepicker/examples/datepicker.custom_input.example.vue +0 -21
  38. package/src/components/base/datepicker/examples/datepicker.disabled.example.vue +0 -12
  39. package/src/components/base/datepicker/examples/datepicker.open_on_focus.example.vue +0 -12
  40. package/src/components/base/datepicker/examples/datepicker.with_clear_button.example.vue +0 -12
  41. package/src/components/base/datepicker/examples/index.js +0 -38
@@ -5,7 +5,7 @@ import GlFilteredSearchSuggestion from './filtered_search_suggestion.vue';
5
5
  import GlFilteredSearchSuggestionList from './filtered_search_suggestion_list.vue';
6
6
  import GlFilteredSearchTerm from './filtered_search_term.vue';
7
7
  import GlFilteredSearchToken from './filtered_search_token.vue';
8
- import { TERM_TOKEN_TYPE } from './filtered_search_utils';
8
+ import { TERM_TOKEN_TYPE, INTENT_ACTIVATE_PREVIOUS } from './filtered_search_utils';
9
9
 
10
10
  jest.mock('~/directives/tooltip');
11
11
 
@@ -196,9 +196,99 @@ describe('Filtered search', () => {
196
196
  ]);
197
197
  });
198
198
 
199
- it('brings focus to previous token if current is destroyed', async () => {
199
+ it('makes previous token active if user intends it on token destruction', async () => {
200
200
  createComponent({
201
- value: ['one', { type: 'faketoken', value: '' }, 'two'],
201
+ value: [{ type: 'faketoken', value: '' }, ''],
202
+ });
203
+ await nextTick();
204
+
205
+ wrapper
206
+ .findComponent(GlFilteredSearchTerm)
207
+ .vm.$emit('destroy', { intent: INTENT_ACTIVATE_PREVIOUS });
208
+
209
+ await nextTick();
210
+
211
+ expect(wrapper.findComponent(FakeToken).props('active')).toBe(true);
212
+ });
213
+
214
+ it('makes no token active if user intends it on first token destruction', async () => {
215
+ createComponent({
216
+ value: ['foo', { type: 'faketoken', value: '' }],
217
+ });
218
+ await nextTick();
219
+ wrapper.findComponent(FakeToken).vm.$emit('activate');
220
+ await nextTick();
221
+
222
+ expect(wrapper.findComponent(FakeToken).props('active')).toBe(true);
223
+
224
+ wrapper
225
+ .findAllComponents(GlFilteredSearchTerm)
226
+ .at(0)
227
+ .vm.$emit('destroy', { intent: INTENT_ACTIVATE_PREVIOUS });
228
+
229
+ await nextTick();
230
+
231
+ expect(wrapper.findComponent(FakeToken).props('active')).toBe(false);
232
+ });
233
+
234
+ it('keeps active token active if later one destroyed', async () => {
235
+ createComponent({
236
+ value: [
237
+ { type: 'faketoken', value: '' },
238
+ { type: 'faketoken', value: '' },
239
+ { type: 'faketoken', value: '' },
240
+ ],
241
+ });
242
+ await nextTick();
243
+ wrapper.findAllComponents(FakeToken).at(0).vm.$emit('activate');
244
+ await nextTick();
245
+
246
+ wrapper.findAllComponents(FakeToken).at(2).vm.$emit('destroy');
247
+
248
+ await nextTick();
249
+
250
+ expect(wrapper.findAllComponents(FakeToken).at(0).props('active')).toBe(true);
251
+ });
252
+
253
+ it('keeps active token active if earlier one destroyed', async () => {
254
+ createComponent({
255
+ value: [
256
+ { type: 'faketoken', value: '' },
257
+ { type: 'faketoken', value: '' },
258
+ { type: 'faketoken', value: '' },
259
+ ],
260
+ });
261
+ await nextTick();
262
+ wrapper.findAllComponents(FakeToken).at(2).vm.$emit('activate');
263
+ await nextTick();
264
+
265
+ wrapper.findAllComponents(FakeToken).at(0).vm.$emit('destroy');
266
+
267
+ await nextTick();
268
+
269
+ expect(wrapper.findAllComponents(FakeToken).at(1).props('active')).toBe(true);
270
+ });
271
+
272
+ it('makes no token active if current is destroyed', async () => {
273
+ createComponent({
274
+ value: ['one', { type: 'faketoken', value: '' }],
275
+ });
276
+ await nextTick();
277
+ wrapper.findComponent(FakeToken).vm.$emit('activate');
278
+ await nextTick();
279
+
280
+ wrapper.findComponent(FakeToken).vm.$emit('destroy');
281
+
282
+ await nextTick();
283
+
284
+ wrapper.findAllComponents(GlFilteredSearchTerm).wrappers.forEach((searchTermWrapper) => {
285
+ expect(searchTermWrapper.props('active')).toBe(false);
286
+ });
287
+ });
288
+
289
+ it('keeps no token active if one was destroyed when none were active', async () => {
290
+ createComponent({
291
+ value: ['one', { type: 'faketoken', value: '' }],
202
292
  });
203
293
  await nextTick();
204
294
 
@@ -206,7 +296,7 @@ describe('Filtered search', () => {
206
296
 
207
297
  await nextTick();
208
298
 
209
- expect(wrapper.findComponent(GlFilteredSearchTerm).props('active')).toBe(true);
299
+ expect(wrapper.findComponent(GlFilteredSearchTerm).props('active')).toBe(false);
210
300
  });
211
301
 
212
302
  it('does not destroy last token', async () => {
@@ -580,22 +670,26 @@ describe('Filtered search integration tests', () => {
580
670
  expect(wrapper.findAllComponents(GlFilteredSearchTerm).at(1).find('input').exists()).toBe(true);
581
671
  });
582
672
 
583
- it('correctly switches focus on token destroy', async () => {
584
- mountComponent({ value: ['one t three'] });
673
+ it('activates previous token when backspacing on empty search term', async () => {
674
+ mountComponent({ value: ['zero one two'] });
585
675
  await nextTick();
586
676
 
587
677
  activate(1);
588
678
 
589
679
  await nextTick();
590
680
 
591
- // Unfortunately backspace is not working in JSDOM
592
- wrapper.findAllComponents(GlFilteredSearchTerm).at(1).vm.$emit('destroy');
681
+ // Make sure we have the expected search term
682
+ const inputWrapper = wrapper.find('input');
683
+ expect(inputWrapper.element.value).toBe('one');
593
684
 
594
- await nextTick();
685
+ // Mimic backspace behavior for jsdom
686
+ await inputWrapper.setValue('');
687
+ await inputWrapper.trigger('keydown', { key: 'Backspace' });
595
688
 
596
- expect(document.activeElement).toBe(
597
- wrapper.findComponent(GlFilteredSearchTerm).find('input').element
598
- );
689
+ // Make sure the previous token/search term is now active
690
+ const input = wrapper.find('input').element;
691
+ expect(input.value).toBe('zero');
692
+ expect(document.activeElement).toBe(input);
599
693
  });
600
694
 
601
695
  it('clicking clear button clears component input', async () => {
@@ -36,6 +36,7 @@ const fakeLabels = [
36
36
  ];
37
37
 
38
38
  const UserToken = {
39
+ name: 'UserToken',
39
40
  components: { GlFilteredSearchToken, GlFilteredSearchSuggestion, GlLoadingIcon, GlAvatar },
40
41
  props: ['value', 'active'],
41
42
  inheritAttrs: false,
@@ -112,6 +113,7 @@ const UserToken = {
112
113
  };
113
114
 
114
115
  const MilestoneToken = {
116
+ name: 'MilestoneToken',
115
117
  components: { GlFilteredSearchToken, GlFilteredSearchSuggestion, GlLoadingIcon },
116
118
  props: ['value', 'active'],
117
119
  inheritAttrs: false,
@@ -172,6 +174,7 @@ const MilestoneToken = {
172
174
  };
173
175
 
174
176
  const LabelToken = {
177
+ name: 'LabelToken',
175
178
  components: { GlFilteredSearchToken, GlFilteredSearchSuggestion, GlLoadingIcon, GlToken },
176
179
  props: ['value', 'active'],
177
180
  inheritAttrs: false,
@@ -9,6 +9,7 @@ import GlFilteredSearchTerm from './filtered_search_term.vue';
9
9
  import {
10
10
  isEmptyTerm,
11
11
  TERM_TOKEN_TYPE,
12
+ INTENT_ACTIVATE_PREVIOUS,
12
13
  normalizeTokens,
13
14
  denormalizeTokens,
14
15
  needDenormalization,
@@ -173,8 +174,8 @@ export default {
173
174
  return this.getTokenEntry(type)?.token || GlFilteredSearchTerm;
174
175
  },
175
176
 
176
- activate(token) {
177
- this.activeTokenIdx = token;
177
+ activate(idx) {
178
+ this.activeTokenIdx = idx;
178
179
  },
179
180
 
180
181
  alignSuggestions(ref) {
@@ -201,15 +202,29 @@ export default {
201
202
  this.activeTokenIdx = null;
202
203
  },
203
204
 
204
- destroyToken(idx) {
205
+ destroyToken(idx, { intent } = {}) {
205
206
  if (this.tokens.length === 1) {
206
207
  return;
207
208
  }
208
209
 
209
210
  this.tokens.splice(idx, 1);
210
- if (idx !== 0) {
211
- this.activeTokenIdx = idx - 1;
211
+
212
+ // First, attempt to honor the user's activation intent behind the
213
+ // destruction of the token, if any. Otherwise, try to maintain the
214
+ // active state for the token that was active at the time. If that's not
215
+ // possible, make sure no token is active.
216
+ if (intent === INTENT_ACTIVATE_PREVIOUS) {
217
+ // If there is a previous token, activate it; else, deactivate all tokens
218
+ this.activeTokenIdx = idx > 0 ? idx - 1 : null;
219
+ } else if (idx < this.activeTokenIdx) {
220
+ // Preserve the active token's active status (it shifted down one index)
221
+ this.activeTokenIdx -= 1;
222
+ } else if (idx === this.activeTokenIdx) {
223
+ // User destroyed the active token; don't activate another one.
224
+ this.activeTokenIdx = null;
212
225
  }
226
+ // Do nothing if there was no active token, or if idx > this.activeTokenIdx,
227
+ // to preserve the active state of the remaining tokens.
213
228
  },
214
229
 
215
230
  replaceToken(idx, token) {
@@ -297,7 +312,7 @@ export default {
297
312
  }"
298
313
  @activate="activate(idx)"
299
314
  @deactivate="deactivate(token)"
300
- @destroy="destroyToken(idx)"
315
+ @destroy="destroyToken(idx, $event)"
301
316
  @replace="replaceToken(idx, $event)"
302
317
  @complete="completeToken"
303
318
  @submit="submit"
@@ -2,6 +2,7 @@ import { nextTick } from 'vue';
2
2
  import { shallowMount } from '@vue/test-utils';
3
3
  import GlFilteredSearchSuggestion from './filtered_search_suggestion.vue';
4
4
  import FilteredSearchTerm from './filtered_search_term.vue';
5
+ import { INTENT_ACTIVATE_PREVIOUS } from './filtered_search_utils';
5
6
 
6
7
  const availableTokens = [
7
8
  { type: 'foo', title: 'test1-foo', token: 'stub', icon: 'eye' },
@@ -59,23 +60,27 @@ describe('Filtered search term', () => {
59
60
  });
60
61
 
61
62
  it.each`
62
- originalEvent | emittedEvent
63
- ${'activate'} | ${'activate'}
64
- ${'deactivate'} | ${'deactivate'}
65
- ${'split'} | ${'split'}
66
- ${'submit'} | ${'submit'}
67
- ${'complete'} | ${'replace'}
68
- ${'backspace'} | ${'destroy'}
63
+ originalEvent | emittedEvent | payload
64
+ ${'activate'} | ${'activate'} | ${undefined}
65
+ ${'deactivate'} | ${'deactivate'} | ${undefined}
66
+ ${'split'} | ${'split'} | ${undefined}
67
+ ${'submit'} | ${'submit'} | ${undefined}
68
+ ${'complete'} | ${'replace'} | ${{ type: undefined }}
69
+ ${'backspace'} | ${'destroy'} | ${{ intent: INTENT_ACTIVATE_PREVIOUS }}
69
70
  `(
70
71
  'emits $emittedEvent when token segment emits $originalEvent',
71
- async ({ originalEvent, emittedEvent }) => {
72
+ async ({ originalEvent, emittedEvent, payload }) => {
72
73
  createComponent({ active: true, value: { data: 'something' } });
73
74
 
74
75
  findTokenSegmentComponent().vm.$emit(originalEvent);
75
76
 
76
77
  await nextTick();
77
78
 
78
- expect(wrapper.emitted()[emittedEvent]).toHaveLength(1);
79
+ expect(wrapper.emitted(emittedEvent)).toHaveLength(1);
80
+
81
+ if (payload !== undefined) {
82
+ expect(wrapper.emitted(emittedEvent)[0][0]).toEqual(payload);
83
+ }
79
84
  }
80
85
  );
81
86
 
@@ -1,6 +1,7 @@
1
1
  <script>
2
2
  import GlFilteredSearchSuggestion from './filtered_search_suggestion.vue';
3
3
  import GlFilteredSearchTokenSegment from './filtered_search_token_segment.vue';
4
+ import { INTENT_ACTIVATE_PREVIOUS } from './filtered_search_utils';
4
5
 
5
6
  export default {
6
7
  components: {
@@ -59,6 +60,11 @@ export default {
59
60
  },
60
61
  },
61
62
  },
63
+ methods: {
64
+ onBackspace() {
65
+ this.$emit('destroy', { intent: INTENT_ACTIVATE_PREVIOUS });
66
+ },
67
+ },
62
68
  };
63
69
  </script>
64
70
 
@@ -75,7 +81,7 @@ export default {
75
81
  @activate="$emit('activate')"
76
82
  @deactivate="$emit('deactivate')"
77
83
  @complete="$emit('replace', { type: $event })"
78
- @backspace="$emit('destroy')"
84
+ @backspace="onBackspace"
79
85
  @submit="$emit('submit')"
80
86
  @split="$emit('split', $event)"
81
87
  >
@@ -2,6 +2,8 @@ import { first, last, isString } from 'lodash';
2
2
 
3
3
  export const TERM_TOKEN_TYPE = 'filtered-search-term';
4
4
 
5
+ export const INTENT_ACTIVATE_PREVIOUS = 'intent-activate-previous';
6
+
5
7
  export function isEmptyTerm(token) {
6
8
  return token.type === TERM_TOKEN_TYPE && token.value.data.trim() === '';
7
9
  }
@@ -1,48 +0,0 @@
1
- import __vue_normalize__ from 'vue-runtime-helpers/dist/normalize-component.js';
2
-
3
- var script = {
4
- data() {
5
- return {
6
- value: null
7
- };
8
- }
9
-
10
- };
11
-
12
- /* script */
13
- const __vue_script__ = script;
14
-
15
- /* template */
16
- var __vue_render__ = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('gl-datepicker')};
17
- var __vue_staticRenderFns__ = [];
18
-
19
- /* style */
20
- const __vue_inject_styles__ = undefined;
21
- /* scoped */
22
- const __vue_scope_id__ = undefined;
23
- /* module identifier */
24
- const __vue_module_identifier__ = undefined;
25
- /* functional template */
26
- const __vue_is_functional_template__ = false;
27
- /* style inject */
28
-
29
- /* style inject SSR */
30
-
31
- /* style inject shadow dom */
32
-
33
-
34
-
35
- const __vue_component__ = __vue_normalize__(
36
- { render: __vue_render__, staticRenderFns: __vue_staticRenderFns__ },
37
- __vue_inject_styles__,
38
- __vue_script__,
39
- __vue_scope_id__,
40
- __vue_is_functional_template__,
41
- __vue_module_identifier__,
42
- false,
43
- undefined,
44
- undefined,
45
- undefined
46
- );
47
-
48
- export default __vue_component__;
@@ -1,48 +0,0 @@
1
- import __vue_normalize__ from 'vue-runtime-helpers/dist/normalize-component.js';
2
-
3
- var script = {
4
- data() {
5
- return {
6
- value: null
7
- };
8
- }
9
-
10
- };
11
-
12
- /* script */
13
- const __vue_script__ = script;
14
-
15
- /* template */
16
- var __vue_render__ = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('gl-datepicker',[_c('input',{staticClass:"gl-form-input gl-datepicker-input form-control",attrs:{"id":"datepicker-custom-input-example","name":"date","type":"text","aria-label":"Select a date","placeholder":"Custom placeholder"}})])};
17
- var __vue_staticRenderFns__ = [];
18
-
19
- /* style */
20
- const __vue_inject_styles__ = undefined;
21
- /* scoped */
22
- const __vue_scope_id__ = undefined;
23
- /* module identifier */
24
- const __vue_module_identifier__ = undefined;
25
- /* functional template */
26
- const __vue_is_functional_template__ = false;
27
- /* style inject */
28
-
29
- /* style inject SSR */
30
-
31
- /* style inject shadow dom */
32
-
33
-
34
-
35
- const __vue_component__ = __vue_normalize__(
36
- { render: __vue_render__, staticRenderFns: __vue_staticRenderFns__ },
37
- __vue_inject_styles__,
38
- __vue_script__,
39
- __vue_scope_id__,
40
- __vue_is_functional_template__,
41
- __vue_module_identifier__,
42
- false,
43
- undefined,
44
- undefined,
45
- undefined
46
- );
47
-
48
- export default __vue_component__;
@@ -1,48 +0,0 @@
1
- import __vue_normalize__ from 'vue-runtime-helpers/dist/normalize-component.js';
2
-
3
- var script = {
4
- data() {
5
- return {
6
- value: null
7
- };
8
- }
9
-
10
- };
11
-
12
- /* script */
13
- const __vue_script__ = script;
14
-
15
- /* template */
16
- var __vue_render__ = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('gl-datepicker',{attrs:{"disabled":""}})};
17
- var __vue_staticRenderFns__ = [];
18
-
19
- /* style */
20
- const __vue_inject_styles__ = undefined;
21
- /* scoped */
22
- const __vue_scope_id__ = undefined;
23
- /* module identifier */
24
- const __vue_module_identifier__ = undefined;
25
- /* functional template */
26
- const __vue_is_functional_template__ = false;
27
- /* style inject */
28
-
29
- /* style inject SSR */
30
-
31
- /* style inject shadow dom */
32
-
33
-
34
-
35
- const __vue_component__ = __vue_normalize__(
36
- { render: __vue_render__, staticRenderFns: __vue_staticRenderFns__ },
37
- __vue_inject_styles__,
38
- __vue_script__,
39
- __vue_scope_id__,
40
- __vue_is_functional_template__,
41
- __vue_module_identifier__,
42
- false,
43
- undefined,
44
- undefined,
45
- undefined
46
- );
47
-
48
- export default __vue_component__;
@@ -1,48 +0,0 @@
1
- import __vue_normalize__ from 'vue-runtime-helpers/dist/normalize-component.js';
2
-
3
- var script = {
4
- data() {
5
- return {
6
- value: null
7
- };
8
- }
9
-
10
- };
11
-
12
- /* script */
13
- const __vue_script__ = script;
14
-
15
- /* template */
16
- var __vue_render__ = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('gl-datepicker',{attrs:{"target":null}})};
17
- var __vue_staticRenderFns__ = [];
18
-
19
- /* style */
20
- const __vue_inject_styles__ = undefined;
21
- /* scoped */
22
- const __vue_scope_id__ = undefined;
23
- /* module identifier */
24
- const __vue_module_identifier__ = undefined;
25
- /* functional template */
26
- const __vue_is_functional_template__ = false;
27
- /* style inject */
28
-
29
- /* style inject SSR */
30
-
31
- /* style inject shadow dom */
32
-
33
-
34
-
35
- const __vue_component__ = __vue_normalize__(
36
- { render: __vue_render__, staticRenderFns: __vue_staticRenderFns__ },
37
- __vue_inject_styles__,
38
- __vue_script__,
39
- __vue_scope_id__,
40
- __vue_is_functional_template__,
41
- __vue_module_identifier__,
42
- false,
43
- undefined,
44
- undefined,
45
- undefined
46
- );
47
-
48
- export default __vue_component__;
@@ -1,48 +0,0 @@
1
- import __vue_normalize__ from 'vue-runtime-helpers/dist/normalize-component.js';
2
-
3
- var script = {
4
- data() {
5
- return {
6
- value: new Date(2020, 0, 15)
7
- };
8
- }
9
-
10
- };
11
-
12
- /* script */
13
- const __vue_script__ = script;
14
-
15
- /* template */
16
- var __vue_render__ = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('gl-datepicker',{attrs:{"show-clear-button":""},model:{value:(_vm.value),callback:function ($$v) {_vm.value=$$v;},expression:"value"}})};
17
- var __vue_staticRenderFns__ = [];
18
-
19
- /* style */
20
- const __vue_inject_styles__ = undefined;
21
- /* scoped */
22
- const __vue_scope_id__ = undefined;
23
- /* module identifier */
24
- const __vue_module_identifier__ = undefined;
25
- /* functional template */
26
- const __vue_is_functional_template__ = false;
27
- /* style inject */
28
-
29
- /* style inject SSR */
30
-
31
- /* style inject shadow dom */
32
-
33
-
34
-
35
- const __vue_component__ = __vue_normalize__(
36
- { render: __vue_render__, staticRenderFns: __vue_staticRenderFns__ },
37
- __vue_inject_styles__,
38
- __vue_script__,
39
- __vue_scope_id__,
40
- __vue_is_functional_template__,
41
- __vue_module_identifier__,
42
- false,
43
- undefined,
44
- undefined,
45
- undefined
46
- );
47
-
48
- export default __vue_component__;
@@ -1,32 +0,0 @@
1
- import DatepickerBasicExample from './datepicker.basic.example';
2
- import DatepickerCustomInputExample from './datepicker.custom_input.example';
3
- import DatepickerDisabledExample from './datepicker.disabled.example';
4
- import DatepickerOpenOnFocusExample from './datepicker.open_on_focus.example';
5
- import DatepickerWithClearButtonExample from './datepicker.with_clear_button.example';
6
-
7
- var index = [{
8
- name: 'Datepicker',
9
- items: [{
10
- id: 'basic-date-picker',
11
- name: 'Basic date picker',
12
- component: DatepickerBasicExample
13
- }, {
14
- id: 'custom-input-date-picker',
15
- name: 'With custom input',
16
- component: DatepickerCustomInputExample
17
- }, {
18
- id: 'open-on-focus-date-picker',
19
- name: 'Open on focus',
20
- component: DatepickerOpenOnFocusExample
21
- }, {
22
- id: 'with-clear-button-date-picker',
23
- name: 'With clear button',
24
- component: DatepickerWithClearButtonExample
25
- }, {
26
- id: 'disabled-date-picker',
27
- name: 'Disabled',
28
- component: DatepickerDisabledExample
29
- }]
30
- }];
31
-
32
- export default index;
@@ -1,12 +0,0 @@
1
- <script>
2
- export default {
3
- data() {
4
- return {
5
- value: null,
6
- };
7
- },
8
- };
9
- </script>
10
- <template>
11
- <gl-datepicker />
12
- </template>
@@ -1,21 +0,0 @@
1
- <script>
2
- export default {
3
- data() {
4
- return {
5
- value: null,
6
- };
7
- },
8
- };
9
- </script>
10
- <template>
11
- <gl-datepicker>
12
- <input
13
- id="datepicker-custom-input-example"
14
- class="gl-form-input gl-datepicker-input form-control"
15
- name="date"
16
- type="text"
17
- aria-label="Select a date"
18
- placeholder="Custom placeholder"
19
- />
20
- </gl-datepicker>
21
- </template>
@@ -1,12 +0,0 @@
1
- <script>
2
- export default {
3
- data() {
4
- return {
5
- value: null,
6
- };
7
- },
8
- };
9
- </script>
10
- <template>
11
- <gl-datepicker disabled />
12
- </template>
@@ -1,12 +0,0 @@
1
- <script>
2
- export default {
3
- data() {
4
- return {
5
- value: null,
6
- };
7
- },
8
- };
9
- </script>
10
- <template>
11
- <gl-datepicker :target="null" />
12
- </template>
@@ -1,12 +0,0 @@
1
- <script>
2
- export default {
3
- data() {
4
- return {
5
- value: new Date(2020, 0, 15),
6
- };
7
- },
8
- };
9
- </script>
10
- <template>
11
- <gl-datepicker v-model="value" show-clear-button />
12
- </template>