@gitlab/ui 32.49.0 → 32.51.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 (48) hide show
  1. package/CHANGELOG.md +28 -0
  2. package/dist/components/base/breadcrumb/breadcrumb.documentation.js +1 -1
  3. package/dist/components/base/form/form.documentation.js +1 -5
  4. package/dist/components/base/form/form_select/form_select.documentation.js +2 -17
  5. package/dist/components/base/modal/modal.js +15 -1
  6. package/dist/index.css +1 -1
  7. package/dist/index.css.map +1 -1
  8. package/dist/utility_classes.css +1 -1
  9. package/dist/utility_classes.css.map +1 -1
  10. package/dist/utils/string_utils.js +6 -2
  11. package/documentation/documented_stories.js +2 -0
  12. package/package.json +5 -3
  13. package/scss_to_js/scss_variables.js +2 -0
  14. package/scss_to_js/scss_variables.json +10 -0
  15. package/src/components/base/breadcrumb/breadcrumb.md +6 -5
  16. package/src/components/base/breadcrumb/breadcrumb.scss +1 -1
  17. package/src/components/base/breadcrumb/breadcrumb.stories.js +4 -1
  18. package/src/components/base/form/form.documentation.js +0 -3
  19. package/src/components/base/form/form.stories.js +99 -14
  20. package/src/components/base/form/form_select/form_select.documentation.js +0 -19
  21. package/src/components/base/form/form_select/form_select.md +0 -2
  22. package/src/components/base/form/form_select/form_select.stories.js +98 -80
  23. package/src/components/base/modal/modal.vue +56 -35
  24. package/src/scss/utilities.scss +16 -0
  25. package/src/scss/utility-mixins/sizing.scss +8 -0
  26. package/src/scss/variables.scss +2 -0
  27. package/src/utils/string_utils.js +6 -2
  28. package/src/utils/string_utils.spec.js +8 -0
  29. package/dist/components/base/form/examples/form.basic.example.js +0 -76
  30. package/dist/components/base/form/examples/form.edit.example.js +0 -66
  31. package/dist/components/base/form/examples/form.inline.example.js +0 -62
  32. package/dist/components/base/form/examples/form.novalidate.example.js +0 -61
  33. package/dist/components/base/form/examples/index.js +0 -27
  34. package/dist/components/base/form/form_select/examples/form_select.basic.example.js +0 -55
  35. package/dist/components/base/form/form_select/examples/form_select.disabled.example.js +0 -55
  36. package/dist/components/base/form/form_select/examples/form_select.manual_options.example.js +0 -48
  37. package/dist/components/base/form/form_select/examples/form_select.mixed_options.example.js +0 -55
  38. package/dist/components/base/form/form_select/examples/index.js +0 -27
  39. package/src/components/base/form/examples/form.basic.example.vue +0 -73
  40. package/src/components/base/form/examples/form.edit.example.vue +0 -37
  41. package/src/components/base/form/examples/form.inline.example.vue +0 -36
  42. package/src/components/base/form/examples/form.novalidate.example.vue +0 -30
  43. package/src/components/base/form/examples/index.js +0 -32
  44. package/src/components/base/form/form_select/examples/form_select.basic.example.vue +0 -17
  45. package/src/components/base/form/form_select/examples/form_select.disabled.example.vue +0 -17
  46. package/src/components/base/form/form_select/examples/form_select.manual_options.example.vue +0 -17
  47. package/src/components/base/form/form_select/examples/form_select.mixed_options.example.vue +0 -21
  48. package/src/components/base/form/form_select/examples/index.js +0 -32
@@ -18,6 +18,8 @@ $gl-spacing-scale-12: 10 * $grid-size;
18
18
  $gl-spacing-scale-13: 12 * $grid-size;
19
19
  $gl-spacing-scale-15: 15 * $grid-size;
20
20
  $gl-spacing-scale-20: 20 * $grid-size;
21
+ $gl-spacing-scale-26: 26 * $grid-size;
22
+ $gl-spacing-scale-62: 62 * $grid-size;
21
23
 
22
24
  // Responsive breakpoints
23
25
 
@@ -1,3 +1,5 @@
1
+ import emojiRegexFactory from 'emoji-regex';
2
+
1
3
  /**
2
4
  * Split the given string after each occurrence of each of the given symbols.
3
5
  *
@@ -60,10 +62,12 @@ export const splitAfterSymbols = (symbols, string) => {
60
62
  return textParts;
61
63
  };
62
64
 
65
+ const startsWithEmojiRegex = `^(${emojiRegexFactory().source})`;
66
+
63
67
  export const getAvatarChar = (name) => {
64
68
  if (name) {
65
- // Check if first character is an emjoi
66
- const match = name.match(/^\p{Emoji}/u);
69
+ // Check if string starts with an emoji (which could be multiple characters and zero-width joined)
70
+ const match = name.match(startsWithEmojiRegex);
67
71
  if (match) {
68
72
  // Return the first match
69
73
  return match[0];
@@ -44,5 +44,13 @@ describe('string utils', () => {
44
44
  it('Returns first character if emoji is not first in name', () => {
45
45
  expect(getAvatarChar('tanuki🦊')).toBe('T');
46
46
  });
47
+
48
+ it('Returns zero-width joined emoji if the name starts with it', () => {
49
+ expect(getAvatarChar('🏴‍☠️Zero-width join')).toBe('🏴‍☠️');
50
+ });
51
+
52
+ it('Returns only first emoji if the name starts with multiple', () => {
53
+ expect(getAvatarChar('🏴‍☠️🙂Multiple Emoji')).toBe('🏴‍☠️');
54
+ });
47
55
  });
48
56
  });
@@ -1,76 +0,0 @@
1
- import __vue_normalize__ from 'vue-runtime-helpers/dist/normalize-component.js';
2
-
3
- var script = {
4
- data() {
5
- return {
6
- form: {
7
- submitDisabled: false,
8
- email: '',
9
- name: '',
10
- mergeState: null,
11
- checked: []
12
- },
13
- states: [{
14
- text: 'Select One',
15
- value: null
16
- }, 'Open', 'Resolved', 'Closed', 'Blocked'],
17
- show: true
18
- };
19
- },
20
-
21
- methods: {
22
- onReset() {
23
- this.form.name = '';
24
- this.form.submitDisabled = false;
25
- },
26
-
27
- onSubmit(evt) {
28
- evt.preventDefault();
29
- this.form.submitDisabled = true;
30
- setTimeout(() => {
31
- this.form.submitDisabled = false; // eslint-disable-next-line no-alert
32
-
33
- alert(JSON.stringify(this.form));
34
- }, 1000);
35
- }
36
-
37
- }
38
- };
39
-
40
- /* script */
41
- const __vue_script__ = script;
42
-
43
- /* template */
44
- var __vue_render__ = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',[_c('gl-form',{on:{"submit":_vm.onSubmit,"reset":_vm.onReset}},[_c('gl-form-group',{attrs:{"id":"input-group-1","label":"Email address:","label-for":"input-1","description":"We'll never share your email with anyone else."}},[_c('gl-form-input',{attrs:{"id":"input-1","type":"email","required":"","placeholder":"Enter email"},model:{value:(_vm.form.email),callback:function ($$v) {_vm.$set(_vm.form, "email", $$v);},expression:"form.email"}})],1),_vm._v(" "),_c('gl-form-group',{attrs:{"id":"input-group-2","label":"Your Name:","label-for":"input-2"}},[_c('gl-form-input',{attrs:{"id":"input-2","required":"","placeholder":"Enter name"},model:{value:(_vm.form.name),callback:function ($$v) {_vm.$set(_vm.form, "name", $$v);},expression:"form.name"}})],1),_vm._v(" "),_c('gl-form-group',{attrs:{"id":"input-group-3","label":"Merge State:","label-for":"input-3"}},[_c('gl-form-select',{attrs:{"id":"input-3","options":_vm.states,"required":""},model:{value:(_vm.form.mergeState),callback:function ($$v) {_vm.$set(_vm.form, "mergeState", $$v);},expression:"form.mergeState"}})],1),_vm._v(" "),_c('gl-form-group',{attrs:{"id":"input-group-4"}},[_c('gl-form-checkbox-group',{attrs:{"id":"checkboxes-4"},model:{value:(_vm.form.checked),callback:function ($$v) {_vm.$set(_vm.form, "checked", $$v);},expression:"form.checked"}},[_c('gl-form-checkbox',{attrs:{"value":"squash"}},[_vm._v("Squash Commits")]),_vm._v(" "),_c('gl-form-checkbox',{attrs:{"value":"new"}},[_vm._v("Create New Issue")])],1)],1),_vm._v(" "),_c('div',{staticClass:"gl-display-flex gl-justify-content-end"},[_c('gl-button',{staticClass:"gl-mr-3",attrs:{"type":"reset","variant":"secondary"}},[_vm._v("Cancel")]),_vm._v(" "),_c('gl-button',{attrs:{"type":"submit","variant":"success"}},[_vm._v("Submit")])],1)],1)],1)};
45
- var __vue_staticRenderFns__ = [];
46
-
47
- /* style */
48
- const __vue_inject_styles__ = undefined;
49
- /* scoped */
50
- const __vue_scope_id__ = undefined;
51
- /* module identifier */
52
- const __vue_module_identifier__ = undefined;
53
- /* functional template */
54
- const __vue_is_functional_template__ = false;
55
- /* style inject */
56
-
57
- /* style inject SSR */
58
-
59
- /* style inject shadow dom */
60
-
61
-
62
-
63
- const __vue_component__ = __vue_normalize__(
64
- { render: __vue_render__, staticRenderFns: __vue_staticRenderFns__ },
65
- __vue_inject_styles__,
66
- __vue_script__,
67
- __vue_scope_id__,
68
- __vue_is_functional_template__,
69
- __vue_module_identifier__,
70
- false,
71
- undefined,
72
- undefined,
73
- undefined
74
- );
75
-
76
- export default __vue_component__;
@@ -1,66 +0,0 @@
1
- import __vue_normalize__ from 'vue-runtime-helpers/dist/normalize-component.js';
2
-
3
- var script = {
4
- data() {
5
- return {
6
- originalName: 'First last',
7
- name: 'First last',
8
- submitDisabled: false
9
- };
10
- },
11
-
12
- computed: {
13
- formClean() {
14
- return this.name === this.originalName;
15
- }
16
-
17
- },
18
- methods: {
19
- onSubmit(evt) {
20
- evt.preventDefault();
21
- this.submitDisabled = true;
22
- setTimeout(() => {
23
- this.submitDisabled = true;
24
- }, 1000);
25
- }
26
-
27
- }
28
- };
29
-
30
- /* script */
31
- const __vue_script__ = script;
32
-
33
- /* template */
34
- var __vue_render__ = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('gl-form',{on:{"submit":_vm.onSubmit}},[_c('gl-form-group',{attrs:{"label":"Name"}},[_c('gl-form-input',{attrs:{"type":"text","required":""},model:{value:(_vm.name),callback:function ($$v) {_vm.name=$$v;},expression:"name"}})],1),_vm._v(" "),_c('gl-button',{attrs:{"disabled":_vm.formClean || _vm.submitDisabled,"type":"submit","variant":"success"}},[_vm._v("Submit")])],1)};
35
- var __vue_staticRenderFns__ = [];
36
-
37
- /* style */
38
- const __vue_inject_styles__ = undefined;
39
- /* scoped */
40
- const __vue_scope_id__ = undefined;
41
- /* module identifier */
42
- const __vue_module_identifier__ = undefined;
43
- /* functional template */
44
- const __vue_is_functional_template__ = false;
45
- /* style inject */
46
-
47
- /* style inject SSR */
48
-
49
- /* style inject shadow dom */
50
-
51
-
52
-
53
- const __vue_component__ = __vue_normalize__(
54
- { render: __vue_render__, staticRenderFns: __vue_staticRenderFns__ },
55
- __vue_inject_styles__,
56
- __vue_script__,
57
- __vue_scope_id__,
58
- __vue_is_functional_template__,
59
- __vue_module_identifier__,
60
- false,
61
- undefined,
62
- undefined,
63
- undefined
64
- );
65
-
66
- export default __vue_component__;
@@ -1,62 +0,0 @@
1
- import __vue_normalize__ from 'vue-runtime-helpers/dist/normalize-component.js';
2
-
3
- var script = {
4
- data() {
5
- return {
6
- name: {
7
- first: '',
8
- last: '',
9
- submitDisabled: false
10
- }
11
- };
12
- },
13
-
14
- methods: {
15
- onSubmit(evt) {
16
- evt.preventDefault();
17
- this.submitDisabled = true;
18
- setTimeout(() => {
19
- this.submitDisabled = false;
20
- }, 1000);
21
- }
22
-
23
- }
24
- };
25
-
26
- /* script */
27
- const __vue_script__ = script;
28
-
29
- /* template */
30
- var __vue_render__ = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('gl-form',{attrs:{"inline":""},on:{"submit":_vm.onSubmit}},[_c('label',{staticClass:"gl-mr-3",attrs:{"for":"input-name"}},[_vm._v("First name")]),_vm._v(" "),_c('gl-form-input',{staticClass:"ml-1",attrs:{"name":"input-name","type":"text","required":""},model:{value:(_vm.name.first),callback:function ($$v) {_vm.$set(_vm.name, "first", $$v);},expression:"name.first"}}),_vm._v(" "),_c('label',{staticClass:"gl-mx-3",attrs:{"for":"input-surname"}},[_vm._v("Surname")]),_vm._v(" "),_c('gl-form-input',{staticClass:"ml-1",attrs:{"name":"input-surname","type":"text","required":""},model:{value:(_vm.name.last),callback:function ($$v) {_vm.$set(_vm.name, "last", $$v);},expression:"name.last"}}),_vm._v(" "),_c('gl-button',{staticClass:"gl-ml-3",attrs:{"small":"","disabled":_vm.submitDisabled,"type":"submit","variant":"success"}},[_vm._v("Save")])],1)};
31
- var __vue_staticRenderFns__ = [];
32
-
33
- /* style */
34
- const __vue_inject_styles__ = undefined;
35
- /* scoped */
36
- const __vue_scope_id__ = undefined;
37
- /* module identifier */
38
- const __vue_module_identifier__ = undefined;
39
- /* functional template */
40
- const __vue_is_functional_template__ = false;
41
- /* style inject */
42
-
43
- /* style inject SSR */
44
-
45
- /* style inject shadow dom */
46
-
47
-
48
-
49
- const __vue_component__ = __vue_normalize__(
50
- { render: __vue_render__, staticRenderFns: __vue_staticRenderFns__ },
51
- __vue_inject_styles__,
52
- __vue_script__,
53
- __vue_scope_id__,
54
- __vue_is_functional_template__,
55
- __vue_module_identifier__,
56
- false,
57
- undefined,
58
- undefined,
59
- undefined
60
- );
61
-
62
- export default __vue_component__;
@@ -1,61 +0,0 @@
1
- import __vue_normalize__ from 'vue-runtime-helpers/dist/normalize-component.js';
2
-
3
- var script = {
4
- data() {
5
- return {
6
- name: '',
7
- errorText: ''
8
- };
9
- },
10
-
11
- methods: {
12
- onSubmit(evt) {
13
- evt.preventDefault();
14
-
15
- if (this.name === '') {
16
- this.errorText = 'Please enter your name';
17
- } else {
18
- this.errorText = '';
19
- }
20
- }
21
-
22
- }
23
- };
24
-
25
- /* script */
26
- const __vue_script__ = script;
27
-
28
- /* template */
29
- var __vue_render__ = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('gl-form',{attrs:{"novalidate":""},on:{"submit":_vm.onSubmit}},[_c('gl-form-group',{attrs:{"label":"Name"}},[_c('gl-form-input',{attrs:{"type":"text","required":""},model:{value:(_vm.name),callback:function ($$v) {_vm.name=$$v;},expression:"name"}})],1),_vm._v(" "),_c('p',{staticClass:"text-danger"},[_vm._v(_vm._s(_vm.errorText))]),_vm._v(" "),_c('gl-button',{attrs:{"type":"submit","variant":"success"}},[_vm._v("Submit")])],1)};
30
- var __vue_staticRenderFns__ = [];
31
-
32
- /* style */
33
- const __vue_inject_styles__ = undefined;
34
- /* scoped */
35
- const __vue_scope_id__ = undefined;
36
- /* module identifier */
37
- const __vue_module_identifier__ = undefined;
38
- /* functional template */
39
- const __vue_is_functional_template__ = false;
40
- /* style inject */
41
-
42
- /* style inject SSR */
43
-
44
- /* style inject shadow dom */
45
-
46
-
47
-
48
- const __vue_component__ = __vue_normalize__(
49
- { render: __vue_render__, staticRenderFns: __vue_staticRenderFns__ },
50
- __vue_inject_styles__,
51
- __vue_script__,
52
- __vue_scope_id__,
53
- __vue_is_functional_template__,
54
- __vue_module_identifier__,
55
- false,
56
- undefined,
57
- undefined,
58
- undefined
59
- );
60
-
61
- export default __vue_component__;
@@ -1,27 +0,0 @@
1
- import FormExample from './form.basic.example';
2
- import EditFormExample from './form.edit.example';
3
- import InlineFormExample from './form.inline.example';
4
- import NoValidateFormExample from './form.novalidate.example';
5
-
6
- var index = [{
7
- name: 'Form',
8
- items: [{
9
- id: 'form-basic',
10
- name: 'Form in the default state',
11
- component: FormExample
12
- }, {
13
- id: 'form-inline',
14
- name: 'Form in the inline state',
15
- component: InlineFormExample
16
- }, {
17
- id: 'form-edit',
18
- name: 'Form with existing data',
19
- component: EditFormExample
20
- }, {
21
- id: 'form-novalidate',
22
- name: 'Form with HTML validation disabled',
23
- component: NoValidateFormExample
24
- }]
25
- }];
26
-
27
- export default index;
@@ -1,55 +0,0 @@
1
- import __vue_normalize__ from 'vue-runtime-helpers/dist/normalize-component.js';
2
-
3
- var script = {
4
- data() {
5
- return {
6
- selected: 'pizza',
7
- options: [{
8
- text: 'Pizza',
9
- value: 'pizza'
10
- }, {
11
- text: 'Tacos',
12
- value: 'tacos'
13
- }]
14
- };
15
- }
16
-
17
- };
18
-
19
- /* script */
20
- const __vue_script__ = script;
21
-
22
- /* template */
23
- var __vue_render__ = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('gl-form-select',{attrs:{"options":_vm.options},model:{value:(_vm.selected),callback:function ($$v) {_vm.selected=$$v;},expression:"selected"}})};
24
- var __vue_staticRenderFns__ = [];
25
-
26
- /* style */
27
- const __vue_inject_styles__ = undefined;
28
- /* scoped */
29
- const __vue_scope_id__ = undefined;
30
- /* module identifier */
31
- const __vue_module_identifier__ = undefined;
32
- /* functional template */
33
- const __vue_is_functional_template__ = false;
34
- /* style inject */
35
-
36
- /* style inject SSR */
37
-
38
- /* style inject shadow dom */
39
-
40
-
41
-
42
- const __vue_component__ = __vue_normalize__(
43
- { render: __vue_render__, staticRenderFns: __vue_staticRenderFns__ },
44
- __vue_inject_styles__,
45
- __vue_script__,
46
- __vue_scope_id__,
47
- __vue_is_functional_template__,
48
- __vue_module_identifier__,
49
- false,
50
- undefined,
51
- undefined,
52
- undefined
53
- );
54
-
55
- export default __vue_component__;
@@ -1,55 +0,0 @@
1
- import __vue_normalize__ from 'vue-runtime-helpers/dist/normalize-component.js';
2
-
3
- var script = {
4
- data() {
5
- return {
6
- selected: 'pizza',
7
- options: [{
8
- text: 'Pizza',
9
- value: 'pizza'
10
- }, {
11
- text: 'Tacos',
12
- value: 'tacos'
13
- }]
14
- };
15
- }
16
-
17
- };
18
-
19
- /* script */
20
- const __vue_script__ = script;
21
-
22
- /* template */
23
- var __vue_render__ = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('gl-form-select',{attrs:{"options":_vm.options,"disabled":true},model:{value:(_vm.selected),callback:function ($$v) {_vm.selected=$$v;},expression:"selected"}})};
24
- var __vue_staticRenderFns__ = [];
25
-
26
- /* style */
27
- const __vue_inject_styles__ = undefined;
28
- /* scoped */
29
- const __vue_scope_id__ = undefined;
30
- /* module identifier */
31
- const __vue_module_identifier__ = undefined;
32
- /* functional template */
33
- const __vue_is_functional_template__ = false;
34
- /* style inject */
35
-
36
- /* style inject SSR */
37
-
38
- /* style inject shadow dom */
39
-
40
-
41
-
42
- const __vue_component__ = __vue_normalize__(
43
- { render: __vue_render__, staticRenderFns: __vue_staticRenderFns__ },
44
- __vue_inject_styles__,
45
- __vue_script__,
46
- __vue_scope_id__,
47
- __vue_is_functional_template__,
48
- __vue_module_identifier__,
49
- false,
50
- undefined,
51
- undefined,
52
- undefined
53
- );
54
-
55
- 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
- selected: 'pizza'
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-form-select',{model:{value:(_vm.selected),callback:function ($$v) {_vm.selected=$$v;},expression:"selected"}},[_c('option',{attrs:{"value":"pizza"}},[_vm._v("Pizza")]),_vm._v(" "),_c('option',{attrs:{"value":"tacos"}},[_vm._v("Tacos")]),_vm._v(" "),_c('option',{attrs:{"value":"pad-thai","disabled":""}},[_vm._v("Pad Thai")])])};
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,55 +0,0 @@
1
- import __vue_normalize__ from 'vue-runtime-helpers/dist/normalize-component.js';
2
-
3
- var script = {
4
- data() {
5
- return {
6
- selected: 'pizza',
7
- options: [{
8
- text: 'Pizza',
9
- value: 'pizza'
10
- }, {
11
- text: 'Tacos',
12
- value: 'tacos'
13
- }]
14
- };
15
- }
16
-
17
- };
18
-
19
- /* script */
20
- const __vue_script__ = script;
21
-
22
- /* template */
23
- var __vue_render__ = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('gl-form-select',{attrs:{"options":_vm.options},scopedSlots:_vm._u([{key:"first",fn:function(){return [_c('option',{attrs:{"disabled":""},domProps:{"value":null}},[_vm._v("Select a dish")])]},proxy:true}]),model:{value:(_vm.selected),callback:function ($$v) {_vm.selected=$$v;},expression:"selected"}})};
24
- var __vue_staticRenderFns__ = [];
25
-
26
- /* style */
27
- const __vue_inject_styles__ = undefined;
28
- /* scoped */
29
- const __vue_scope_id__ = undefined;
30
- /* module identifier */
31
- const __vue_module_identifier__ = undefined;
32
- /* functional template */
33
- const __vue_is_functional_template__ = false;
34
- /* style inject */
35
-
36
- /* style inject SSR */
37
-
38
- /* style inject shadow dom */
39
-
40
-
41
-
42
- const __vue_component__ = __vue_normalize__(
43
- { render: __vue_render__, staticRenderFns: __vue_staticRenderFns__ },
44
- __vue_inject_styles__,
45
- __vue_script__,
46
- __vue_scope_id__,
47
- __vue_is_functional_template__,
48
- __vue_module_identifier__,
49
- false,
50
- undefined,
51
- undefined,
52
- undefined
53
- );
54
-
55
- export default __vue_component__;
@@ -1,27 +0,0 @@
1
- import FormSelectBasicExample from './form_select.basic.example';
2
- import FormSelectDisabledExample from './form_select.disabled.example';
3
- import FormSelectManualOptionsExample from './form_select.manual_options.example';
4
- import FormSelectMixedOptionsExample from './form_select.mixed_options.example';
5
-
6
- var index = [{
7
- name: 'Form Select',
8
- items: [{
9
- id: 'form-select-options-array',
10
- name: 'Form select with options property',
11
- component: FormSelectBasicExample
12
- }, {
13
- id: 'form-select-manual-options',
14
- name: 'Form select with manual options',
15
- component: FormSelectManualOptionsExample
16
- }, {
17
- id: 'form-select-mixed-options',
18
- name: 'Form select with mixed options',
19
- component: FormSelectMixedOptionsExample
20
- }, {
21
- id: 'form-select-disabled',
22
- name: 'Form select disabled',
23
- component: FormSelectDisabledExample
24
- }]
25
- }];
26
-
27
- export default index;
@@ -1,73 +0,0 @@
1
- <script>
2
- export default {
3
- data() {
4
- return {
5
- form: {
6
- submitDisabled: false,
7
- email: '',
8
- name: '',
9
- mergeState: null,
10
- checked: [],
11
- },
12
- states: [{ text: 'Select One', value: null }, 'Open', 'Resolved', 'Closed', 'Blocked'],
13
- show: true,
14
- };
15
- },
16
- methods: {
17
- onReset() {
18
- this.form.name = '';
19
- this.form.submitDisabled = false;
20
- },
21
- onSubmit(evt) {
22
- evt.preventDefault();
23
- this.form.submitDisabled = true;
24
- setTimeout(() => {
25
- this.form.submitDisabled = false;
26
- // eslint-disable-next-line no-alert
27
- alert(JSON.stringify(this.form));
28
- }, 1000);
29
- },
30
- },
31
- };
32
- </script>
33
-
34
- <template>
35
- <div>
36
- <gl-form @submit="onSubmit" @reset="onReset">
37
- <gl-form-group
38
- id="input-group-1"
39
- label="Email address:"
40
- label-for="input-1"
41
- description="We'll never share your email with anyone else."
42
- >
43
- <gl-form-input
44
- id="input-1"
45
- v-model="form.email"
46
- type="email"
47
- required
48
- placeholder="Enter email"
49
- />
50
- </gl-form-group>
51
-
52
- <gl-form-group id="input-group-2" label="Your Name:" label-for="input-2">
53
- <gl-form-input id="input-2" v-model="form.name" required placeholder="Enter name" />
54
- </gl-form-group>
55
-
56
- <gl-form-group id="input-group-3" label="Merge State:" label-for="input-3">
57
- <gl-form-select id="input-3" v-model="form.mergeState" :options="states" required />
58
- </gl-form-group>
59
-
60
- <gl-form-group id="input-group-4">
61
- <gl-form-checkbox-group id="checkboxes-4" v-model="form.checked">
62
- <gl-form-checkbox value="squash">Squash Commits</gl-form-checkbox>
63
- <gl-form-checkbox value="new">Create New Issue</gl-form-checkbox>
64
- </gl-form-checkbox-group>
65
- </gl-form-group>
66
-
67
- <div class="gl-display-flex gl-justify-content-end">
68
- <gl-button type="reset" variant="secondary" class="gl-mr-3">Cancel</gl-button>
69
- <gl-button type="submit" variant="success">Submit</gl-button>
70
- </div>
71
- </gl-form>
72
- </div>
73
- </template>