@gitlab/ui 49.5.1 → 49.7.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 CHANGED
@@ -1,3 +1,18 @@
1
+ # [49.7.0](https://gitlab.com/gitlab-org/gitlab-ui/compare/v49.6.0...v49.7.0) (2022-11-10)
2
+
3
+
4
+ ### Features
5
+
6
+ * **BroadcastMessage:** Equal top and bottom margin ([8b548f1](https://gitlab.com/gitlab-org/gitlab-ui/commit/8b548f1b3f86f9d6586dfb0c63deb2d0aa3fdd97))
7
+ * **BroadcastMessage:** Refine alignment ([c59fc65](https://gitlab.com/gitlab-org/gitlab-ui/commit/c59fc65622d0bf8d64ebb4bb98c1f8676b9ad49d))
8
+
9
+ # [49.6.0](https://gitlab.com/gitlab-org/gitlab-ui/compare/v49.5.1...v49.6.0) (2022-11-09)
10
+
11
+
12
+ ### Features
13
+
14
+ * **GlFormDate:** Add component ([099e6d3](https://gitlab.com/gitlab-org/gitlab-ui/commit/099e6d36e2544a85796316b237dde04b5e3150d3))
15
+
1
16
  ## [49.5.1](https://gitlab.com/gitlab-org/gitlab-ui/compare/v49.5.0...v49.5.1) (2022-11-08)
2
17
 
3
18
 
@@ -52,7 +52,7 @@ var script = {
52
52
  const __vue_script__ = script;
53
53
 
54
54
  /* template */
55
- var __vue_render__ = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',{staticClass:"gl-broadcast-message",class:_vm.theme,attrs:{"role":"alert"}},[_c('div',{staticClass:"gl-broadcast-message-content"},[_c('div',{staticClass:"gl-broadcast-message-icon"},[_c('gl-icon',{attrs:{"name":_vm.iconName}})],1),_vm._v(" "),_c('div',{staticClass:"gl-broadcast-message-text"},[_vm._t("default")],2)]),_vm._v(" "),_c('close-button',{ref:"dismiss",staticClass:"gl-close-btn-color-inherit gl-broadcast-message-dismiss",attrs:{"label":_vm.dismissLabel},on:{"click":_vm.onDismiss}})],1)};
55
+ var __vue_render__ = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',{staticClass:"gl-broadcast-message",class:_vm.theme,attrs:{"role":"alert"}},[_c('div',{staticClass:"gl-broadcast-message-content"},[_c('div',{staticClass:"gl-broadcast-message-icon gl-line-height-normal"},[_c('gl-icon',{attrs:{"name":_vm.iconName}})],1),_vm._v(" "),_c('div',{staticClass:"gl-broadcast-message-text gl-my-n1"},[_vm._t("default")],2)]),_vm._v(" "),_c('close-button',{ref:"dismiss",staticClass:"gl-close-btn-color-inherit gl-broadcast-message-dismiss",attrs:{"label":_vm.dismissLabel},on:{"click":_vm.onDismiss}})],1)};
56
56
  var __vue_staticRenderFns__ = [];
57
57
 
58
58
  /* style */
@@ -1,5 +1,5 @@
1
1
  import { BButton } from 'bootstrap-vue/esm/index.js';
2
- import { buttonCategoryOptions, buttonVariantOptions, buttonSizeOptions, buttonSizeOptionsMap } from '../../../utils/constants';
2
+ import { buttonCategoryOptions, buttonVariantOptions, buttonSizeOptions } from '../../../utils/constants';
3
3
  import { logWarning } from '../../../utils/utils';
4
4
  import { SafeLinkMixin } from '../../mixins/safe_link_mixin';
5
5
  import GlIcon from '../icon/icon';
@@ -30,7 +30,7 @@ var script = {
30
30
  size: {
31
31
  type: String,
32
32
  required: false,
33
- default: buttonSizeOptions.medium,
33
+ default: 'medium',
34
34
  validator: value => Object.keys(buttonSizeOptions).includes(value)
35
35
  },
36
36
  selected: {
@@ -92,7 +92,7 @@ var script = {
92
92
  return classes;
93
93
  },
94
94
  buttonSize() {
95
- return buttonSizeOptionsMap[this.size];
95
+ return buttonSizeOptions[this.size];
96
96
  }
97
97
  },
98
98
  mounted() {
@@ -114,7 +114,7 @@ var script = {
114
114
  size: {
115
115
  type: String,
116
116
  required: false,
117
- default: buttonSizeOptions.medium,
117
+ default: 'medium',
118
118
  validator: value => Object.keys(buttonSizeOptions).includes(value)
119
119
  },
120
120
  icon: {
@@ -0,0 +1,143 @@
1
+ import _uniqueId from 'lodash/uniqueId';
2
+ import GlFormInput from '../form_input/form_input';
3
+ import __vue_normalize__ from 'vue-runtime-helpers/dist/normalize-component.js';
4
+
5
+ var script = {
6
+ name: 'GlFormDate',
7
+ components: {
8
+ GlFormInput
9
+ },
10
+ inheritAttrs: false,
11
+ model: {
12
+ event: 'change',
13
+ prop: 'value'
14
+ },
15
+ props: {
16
+ id: {
17
+ type: String,
18
+ required: false,
19
+ default: null
20
+ },
21
+ min: {
22
+ type: String,
23
+ required: false,
24
+ default: null
25
+ },
26
+ max: {
27
+ type: String,
28
+ required: false,
29
+ default: null
30
+ },
31
+ minInvalidFeedback: {
32
+ type: String,
33
+ required: false,
34
+ default: 'Must be after minimum date'
35
+ },
36
+ maxInvalidFeedback: {
37
+ type: String,
38
+ required: false,
39
+ default: 'Must be before maximum date'
40
+ },
41
+ value: {
42
+ type: String,
43
+ required: false,
44
+ default: null
45
+ }
46
+ },
47
+ data() {
48
+ return {
49
+ currentValue: this.value,
50
+ inputId: this.id || _uniqueId('form-date-'),
51
+ invalidFeedbackId: _uniqueId('form-date-invalid-feedback-'),
52
+ outputId: _uniqueId('form-date-output-'),
53
+ valueAsDate: null
54
+ };
55
+ },
56
+ computed: {
57
+ ariaDescribedBy() {
58
+ return [this.valueAsDate && this.outputId, this.isInvalid && this.invalidFeedbackId].join(' ');
59
+ },
60
+ isLessThanMin() {
61
+ return this.currentValue && this.min && this.currentValue < this.min;
62
+ },
63
+ isGreaterThanMax() {
64
+ return this.currentValue && this.max && this.currentValue > this.max;
65
+ },
66
+ isInvalid() {
67
+ return this.isLessThanMin || this.isGreaterThanMax;
68
+ },
69
+ outputValue() {
70
+ if (!this.valueAsDate) return null;
71
+ return new Intl.DateTimeFormat(undefined, {
72
+ dateStyle: 'full'
73
+ }).format(this.valueAsDate);
74
+ },
75
+ state() {
76
+ return !this.isInvalid;
77
+ }
78
+ },
79
+ watch: {
80
+ value: {
81
+ handler(newValue) {
82
+ this.currentValue = newValue;
83
+ this.updateValueAsDate();
84
+ }
85
+ }
86
+ },
87
+ async mounted() {
88
+ await this.$nextTick();
89
+ this.updateValueAsDate();
90
+ },
91
+ methods: {
92
+ updateValueAsDate() {
93
+ this.valueAsDate = this.$refs.input.$el.valueAsDate;
94
+ },
95
+ onChange($event) {
96
+ /**
97
+ * Emitted when date is changed.
98
+ *
99
+ * @event change
100
+ */
101
+ this.updateValueAsDate();
102
+ this.$emit('change', $event);
103
+ }
104
+ }
105
+ };
106
+
107
+ /* script */
108
+ const __vue_script__ = script;
109
+
110
+ /* template */
111
+ var __vue_render__ = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',{staticClass:"gl-form-date"},[_c('gl-form-input',_vm._b({ref:"input",attrs:{"id":_vm.inputId,"aria-describedby":_vm.ariaDescribedBy,"min":_vm.min,"max":_vm.max,"pattern":"\\d{4}-\\d{2}-\\d{2}","placeholder":"yyyy-mm-dd","state":_vm.state,"type":"date"},on:{"change":_vm.onChange},model:{value:(_vm.currentValue),callback:function ($$v) {_vm.currentValue=$$v;},expression:"currentValue"}},'gl-form-input',_vm.$attrs,false)),_vm._v(" "),(_vm.outputValue)?_c('output',{ref:"output",staticClass:"gl-sr-only",attrs:{"id":_vm.outputId,"for":_vm.inputId}},[_vm._v("\n "+_vm._s(_vm.outputValue)+"\n ")]):_vm._e(),_vm._v(" "),(_vm.isInvalid)?_c('div',{ref:"invalidFeedback",staticClass:"invalid-feedback",attrs:{"id":_vm.invalidFeedbackId}},[(_vm.isLessThanMin)?[_vm._v("\n "+_vm._s(_vm.minInvalidFeedback)+"\n ")]:_vm._e(),_vm._v(" "),(_vm.isGreaterThanMax)?[_vm._v("\n "+_vm._s(_vm.maxInvalidFeedback)+"\n ")]:_vm._e()],2):_vm._e()],1)};
112
+ var __vue_staticRenderFns__ = [];
113
+
114
+ /* style */
115
+ const __vue_inject_styles__ = undefined;
116
+ /* scoped */
117
+ const __vue_scope_id__ = undefined;
118
+ /* module identifier */
119
+ const __vue_module_identifier__ = undefined;
120
+ /* functional template */
121
+ const __vue_is_functional_template__ = false;
122
+ /* style inject */
123
+
124
+ /* style inject SSR */
125
+
126
+ /* style inject shadow dom */
127
+
128
+
129
+
130
+ const __vue_component__ = __vue_normalize__(
131
+ { render: __vue_render__, staticRenderFns: __vue_staticRenderFns__ },
132
+ __vue_inject_styles__,
133
+ __vue_script__,
134
+ __vue_scope_id__,
135
+ __vue_is_functional_template__,
136
+ __vue_module_identifier__,
137
+ false,
138
+ undefined,
139
+ undefined,
140
+ undefined
141
+ );
142
+
143
+ export default __vue_component__;
@@ -40,7 +40,7 @@ var script = {
40
40
  size: {
41
41
  type: String,
42
42
  required: false,
43
- default: buttonSizeOptions.medium,
43
+ default: 'medium',
44
44
  validator: value => Object.keys(buttonSizeOptions).includes(value)
45
45
  },
46
46
  icon: {
@@ -106,7 +106,7 @@ var script = {
106
106
  size: {
107
107
  type: String,
108
108
  required: false,
109
- default: buttonSizeOptions.medium,
109
+ default: 'medium',
110
110
  validator: value => Object.keys(buttonSizeOptions).includes(value)
111
111
  },
112
112
  /**
@@ -1,9 +1,9 @@
1
- import { buttonSizeOptionsMap } from '../../utils/constants';
1
+ import { buttonSizeOptions } from '../../utils/constants';
2
2
 
3
3
  const ButtonMixin = {
4
4
  computed: {
5
5
  buttonSize() {
6
- return buttonSizeOptionsMap[this.size];
6
+ return buttonSizeOptions[this.size];
7
7
  }
8
8
  }
9
9
  };