@gitlab/ui 128.17.1 → 129.1.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.
Files changed (136) hide show
  1. package/dist/components/base/accordion/accordion_item.js +1 -1
  2. package/dist/components/base/avatar/avatar.js +1 -1
  3. package/dist/components/base/avatar/utils.js +1 -1
  4. package/dist/components/base/avatars_inline/avatars_inline.js +1 -2
  5. package/dist/components/base/breadcrumb/breadcrumb.js +1 -1
  6. package/dist/components/base/datepicker/datepicker.js +1 -1
  7. package/dist/components/base/daterange_picker/daterange_picker.js +1 -1
  8. package/dist/components/base/drawer/drawer.js +1 -1
  9. package/dist/components/base/dropdown/dropdown.js +1 -1
  10. package/dist/components/base/filtered_search/filtered_search.js +1 -2
  11. package/dist/components/base/filtered_search/filtered_search_token.js +1 -2
  12. package/dist/components/base/filtered_search/filtered_search_token_segment.js +1 -1
  13. package/dist/components/base/filtered_search/filtered_search_utils.js +1 -3
  14. package/dist/components/base/form/form_character_count/form_character_count.js +1 -1
  15. package/dist/components/base/form/form_checkbox/form_checkbox.js +5 -4
  16. package/dist/components/base/form/form_checkbox/form_checkbox_group.js +1 -4
  17. package/dist/components/base/form/form_combobox/form_combobox.js +1 -1
  18. package/dist/components/base/form/form_date/form_date.js +1 -1
  19. package/dist/components/base/form/form_fields/form_fields.js +1 -3
  20. package/dist/components/base/form/form_group/form_group.js +1 -3
  21. package/dist/components/base/form/form_input/form_input.js +1 -5
  22. package/dist/components/base/form/form_radio/form_radio.js +209 -11
  23. package/dist/components/base/form/form_select/form_select.js +1 -1
  24. package/dist/components/base/form/form_textarea/form_textarea.js +1 -1
  25. package/dist/components/base/infinite_scroll/infinite_scroll.js +1 -1
  26. package/dist/components/base/link/link.js +1 -6
  27. package/dist/components/base/new_dropdowns/base_dropdown/base_dropdown.js +1 -2
  28. package/dist/components/base/new_dropdowns/disclosure/disclosure_dropdown.js +1 -2
  29. package/dist/components/base/new_dropdowns/disclosure/disclosure_dropdown_group.js +1 -1
  30. package/dist/components/base/new_dropdowns/disclosure/utils.js +1 -1
  31. package/dist/components/base/new_dropdowns/listbox/listbox.js +1 -2
  32. package/dist/components/base/new_dropdowns/listbox/listbox_group.js +1 -1
  33. package/dist/components/base/new_dropdowns/listbox/utils.js +1 -2
  34. package/dist/components/base/pagination/pagination.js +1 -3
  35. package/dist/components/base/path/path.js +1 -2
  36. package/dist/components/base/skeleton_loader/skeleton_loader.js +1 -1
  37. package/dist/components/base/sorting/sorting.js +1 -1
  38. package/dist/components/base/tabs/tab/tab.js +1 -1
  39. package/dist/components/base/tabs/tabs/scrollable_tabs.js +1 -1
  40. package/dist/components/base/toast/toast.js +1 -1
  41. package/dist/components/base/toggle/toggle.js +1 -1
  42. package/dist/components/base/token_selector/helpers.js +1 -1
  43. package/dist/components/base/token_selector/token_selector.js +1 -1
  44. package/dist/components/base/token_selector/token_selector_dropdown.js +1 -1
  45. package/dist/components/charts/area/area.js +1 -1
  46. package/dist/components/charts/bar/bar.js +1 -2
  47. package/dist/components/charts/chart/chart.js +1 -1
  48. package/dist/components/charts/column/column.js +1 -1
  49. package/dist/components/charts/discrete_scatter/discrete_scatter.js +1 -1
  50. package/dist/components/charts/gauge/gauge.js +1 -3
  51. package/dist/components/charts/heatmap/heatmap.js +1 -1
  52. package/dist/components/charts/line/line.js +1 -1
  53. package/dist/components/charts/sparkline/sparkline.js +1 -2
  54. package/dist/components/charts/stacked_column/stacked_column.js +1 -2
  55. package/dist/components/dashboards/dashboard_layout/grid_layout/grid_layout.js +1 -1
  56. package/dist/components/dashboards/dashboard_panel/dashboard_panel.js +1 -2
  57. package/dist/components/dashboards/mock_data.js +1 -1
  58. package/dist/components/experimental/experiment_badge/experiment_badge.js +1 -1
  59. package/dist/components/utilities/intersection_observer/intersection_observer.js +1 -1
  60. package/dist/components/utilities/sprintf/sprintf.js +1 -2
  61. package/dist/directives/hover_load/hover_load.js +1 -1
  62. package/dist/directives/resize_observer/resize_observer.js +1 -1
  63. package/dist/utils/charts/config.js +1 -2
  64. package/dist/utils/charts/story_config.js +1 -1
  65. package/dist/utils/i18n.js +1 -1
  66. package/dist/utils/set_utils.js +1 -1
  67. package/dist/utils/use_mock_intersection_observer.js +1 -1
  68. package/package.json +4 -4
  69. package/src/components/base/accordion/accordion_item.vue +1 -1
  70. package/src/components/base/avatar/avatar.vue +1 -1
  71. package/src/components/base/avatar/utils.js +1 -1
  72. package/src/components/base/avatars_inline/avatars_inline.vue +1 -2
  73. package/src/components/base/breadcrumb/breadcrumb.vue +1 -1
  74. package/src/components/base/datepicker/datepicker.vue +1 -1
  75. package/src/components/base/daterange_picker/daterange_picker.vue +1 -1
  76. package/src/components/base/drawer/drawer.vue +1 -1
  77. package/src/components/base/dropdown/dropdown.vue +1 -1
  78. package/src/components/base/filtered_search/filtered_search.vue +1 -2
  79. package/src/components/base/filtered_search/filtered_search_token.vue +1 -2
  80. package/src/components/base/filtered_search/filtered_search_token_segment.vue +1 -1
  81. package/src/components/base/filtered_search/filtered_search_utils.js +1 -3
  82. package/src/components/base/form/form_character_count/form_character_count.vue +1 -1
  83. package/src/components/base/form/form_checkbox/form_checkbox.vue +5 -4
  84. package/src/components/base/form/form_checkbox/form_checkbox_group.vue +1 -4
  85. package/src/components/base/form/form_combobox/form_combobox.vue +1 -1
  86. package/src/components/base/form/form_date/form_date.vue +1 -1
  87. package/src/components/base/form/form_fields/form_fields.vue +1 -3
  88. package/src/components/base/form/form_group/form_group.vue +1 -3
  89. package/src/components/base/form/form_input/form_input.vue +1 -5
  90. package/src/components/base/form/form_radio/form_radio.vue +220 -31
  91. package/src/components/base/form/form_select/form_select.vue +1 -1
  92. package/src/components/base/form/form_textarea/form_textarea.vue +1 -1
  93. package/src/components/base/infinite_scroll/infinite_scroll.vue +1 -1
  94. package/src/components/base/link/link.vue +1 -6
  95. package/src/components/base/new_dropdowns/base_dropdown/base_dropdown.vue +1 -2
  96. package/src/components/base/new_dropdowns/disclosure/disclosure_dropdown.vue +1 -2
  97. package/src/components/base/new_dropdowns/disclosure/disclosure_dropdown_group.vue +1 -1
  98. package/src/components/base/new_dropdowns/disclosure/utils.js +1 -1
  99. package/src/components/base/new_dropdowns/listbox/listbox.vue +1 -2
  100. package/src/components/base/new_dropdowns/listbox/listbox_group.vue +1 -1
  101. package/src/components/base/new_dropdowns/listbox/utils.js +1 -2
  102. package/src/components/base/pagination/pagination.vue +1 -3
  103. package/src/components/base/path/path.vue +1 -2
  104. package/src/components/base/skeleton_loader/skeleton_loader.vue +1 -1
  105. package/src/components/base/sorting/sorting.vue +1 -1
  106. package/src/components/base/tabs/tab/tab.vue +1 -1
  107. package/src/components/base/tabs/tabs/scrollable_tabs.vue +1 -1
  108. package/src/components/base/toast/toast.js +1 -1
  109. package/src/components/base/toggle/toggle.vue +1 -1
  110. package/src/components/base/token_selector/helpers.js +1 -1
  111. package/src/components/base/token_selector/token_selector.vue +1 -1
  112. package/src/components/base/token_selector/token_selector_dropdown.vue +1 -1
  113. package/src/components/charts/area/area.vue +1 -1
  114. package/src/components/charts/bar/bar.vue +1 -2
  115. package/src/components/charts/chart/chart.vue +1 -1
  116. package/src/components/charts/column/column.vue +1 -1
  117. package/src/components/charts/discrete_scatter/discrete_scatter.vue +1 -1
  118. package/src/components/charts/gauge/gauge.vue +1 -3
  119. package/src/components/charts/heatmap/heatmap.vue +1 -1
  120. package/src/components/charts/line/line.vue +1 -1
  121. package/src/components/charts/sparkline/sparkline.vue +1 -2
  122. package/src/components/charts/stacked_column/stacked_column.vue +1 -2
  123. package/src/components/dashboards/dashboard_layout/grid_layout/grid_layout.vue +1 -1
  124. package/src/components/dashboards/dashboard_panel/dashboard_panel.vue +1 -2
  125. package/src/components/dashboards/mock_data.js +1 -1
  126. package/src/components/experimental/experiment_badge/experiment_badge.vue +1 -1
  127. package/src/components/utilities/intersection_observer/intersection_observer.vue +1 -1
  128. package/src/components/utilities/sprintf/sprintf.vue +1 -2
  129. package/src/directives/hover_load/hover_load.js +1 -1
  130. package/src/directives/resize_observer/resize_observer.js +1 -1
  131. package/src/utils/charts/config.js +1 -2
  132. package/src/utils/charts/story_config.js +1 -1
  133. package/src/utils/i18n.js +1 -1
  134. package/src/utils/set_utils.js +1 -1
  135. package/src/utils/use_mock_intersection_observer.js +1 -1
  136. package/tailwind.defaults.js +1 -1
@@ -1,51 +1,240 @@
1
1
  <script>
2
- import { BFormRadio } from '../../../../vendor/bootstrap-vue/src/components/form-radio/form-radio';
3
-
4
- const { model } = BFormRadio.options;
2
+ import uniqueId from 'lodash/uniqueId';
3
+ import isBoolean from 'lodash/isBoolean';
4
+ import { looseEqual } from '../../../../vendor/bootstrap-vue/src/utils/loose-equal';
5
5
 
6
6
  export default {
7
7
  name: 'GlFormRadio',
8
- components: { BFormRadio },
8
+ inject: {
9
+ getGroup: {
10
+ // When we remove BFormRadioGroup from GlFormRadioGroup, we can rename
11
+ // the `getBvRadioGroup` provide to `getRadioGroup`.
12
+ from: 'getBvRadioGroup',
13
+ default: () => () => null,
14
+ },
15
+ },
9
16
  inheritAttrs: false,
10
17
  model: {
11
- prop: model.prop,
12
- event: model.event,
18
+ prop: 'checked',
19
+ event: 'input',
13
20
  },
14
21
  props: {
15
22
  /**
16
- * Whether the radio is checked
23
+ * Used to set the `id` attribute on the rendered content, and used as the base to generate any additional element IDs as needed.
24
+ */
25
+ id: {
26
+ type: String,
27
+ required: false,
28
+ default: undefined,
29
+ },
30
+ /**
31
+ * The current value of the radio. When bound to multiple radios, this is the value of the currently selected radio.
17
32
  */
18
33
  checked: {
19
- type: [String, Number, Boolean, Object],
34
+ // `checked` prop can be any type
35
+ type: undefined,
36
+ required: false,
37
+ default: null,
38
+ },
39
+ /**
40
+ * When set to `true`, disables the component's functionality and places it in a disabled state.
41
+ */
42
+ disabled: {
43
+ type: Boolean,
44
+ required: false,
45
+ default: false,
46
+ },
47
+ /**
48
+ * Sets the value of the `name` attribute on the form control.
49
+ */
50
+ name: {
51
+ type: String,
52
+ required: false,
53
+ default: undefined,
54
+ },
55
+ /**
56
+ * Adds the `required` attribute to the form control.
57
+ */
58
+ required: {
59
+ type: Boolean,
20
60
  required: false,
21
61
  default: false,
22
62
  },
63
+ /**
64
+ * Controls the validation state appearance of the component. `true` for valid, `false` for invalid, or `null` for no validation state.
65
+ */
66
+ state: {
67
+ type: Boolean,
68
+ required: false,
69
+ default: null,
70
+ },
71
+ /**
72
+ * Value returned when this radio is selected.
73
+ */
74
+ value: {
75
+ // `value` prop can be any type
76
+ type: undefined,
77
+ required: false,
78
+ default: true,
79
+ },
80
+ },
81
+ data() {
82
+ const group = this.getGroup();
83
+ return {
84
+ internalId: this.id ? this.id : uniqueId('gitlab_ui_radio_'),
85
+ localChecked: group ? group.checked : this.checked,
86
+ };
87
+ },
88
+ computed: {
89
+ computedLocalChecked: {
90
+ get() {
91
+ return this.isGroup ? this.group.localChecked : this.localChecked;
92
+ },
93
+ set(value) {
94
+ if (this.isGroup) {
95
+ this.group.localChecked = value;
96
+ } else {
97
+ this.localChecked = value;
98
+ }
99
+ },
100
+ },
101
+ group() {
102
+ return this.getGroup();
103
+ },
104
+ isGroup() {
105
+ // Is this radio a child of radio-group?
106
+ return Boolean(this.group);
107
+ },
108
+ computedState() {
109
+ if (this.isGroup) return this.group.computedState;
110
+ return isBoolean(this.state) ? this.state : null;
111
+ },
112
+ stateClass() {
113
+ if (this.computedState === true) return 'is-valid';
114
+ if (this.computedState === false) return 'is-invalid';
115
+ return null;
116
+ },
117
+ computedAriaInvalid() {
118
+ return this.computedState === false ? 'true' : null;
119
+ },
120
+ isChecked() {
121
+ return looseEqual(this.computedLocalChecked, this.value);
122
+ },
123
+ isDisabled() {
124
+ // Child can be disabled while parent isn't, but is always disabled if group is
125
+ return this.isGroup ? this.group.disabled || this.disabled : this.disabled;
126
+ },
127
+ isRequired() {
128
+ // Required only works when a name is provided for the input(s)
129
+ // Child can only be required when parent is
130
+ // Groups will always have a name (either user supplied or auto generated)
131
+ return this.computedName && (this.isGroup ? this.group.required : this.required);
132
+ },
133
+ computedName() {
134
+ // Group name preferred over local name
135
+ return (this.isGroup ? this.group.groupName : this.name) || null;
136
+ },
137
+ computedAttrs() {
138
+ const { isDisabled: disabled, isRequired: required, value, isChecked: checked } = this;
139
+
140
+ return {
141
+ ...this.$attrs,
142
+ id: this.internalId,
143
+ name: this.computedName,
144
+ disabled,
145
+ required,
146
+ value,
147
+ checked,
148
+ 'aria-required': required || null,
149
+ 'aria-invalid': this.computedAriaInvalid,
150
+ };
151
+ },
152
+ },
153
+ watch: {
154
+ checked(...args) {
155
+ this.checkedWatcher(...args);
156
+ },
157
+ computedLocalChecked(...args) {
158
+ this.computedLocalCheckedWatcher(...args);
159
+ },
160
+ },
161
+ methods: {
162
+ checkedWatcher(newValue) {
163
+ if (!looseEqual(newValue, this.computedLocalChecked)) {
164
+ this.computedLocalChecked = newValue;
165
+ }
166
+ },
167
+ computedLocalCheckedWatcher(newValue, oldValue) {
168
+ if (!looseEqual(newValue, oldValue)) {
169
+ /**
170
+ * Emitted when the selected value is changed
171
+ *
172
+ * @event input
173
+ * @type {boolean} current selected value of radio group
174
+ */
175
+ this.$emit('input', newValue);
176
+ }
177
+ },
178
+ handleChange() {
179
+ const { value } = this;
180
+
181
+ // Update `computedLocalChecked`
182
+ this.computedLocalChecked = value;
183
+
184
+ // Fire events in a `$nextTick()` to ensure the `v-model` is updated
185
+ this.$nextTick(() => {
186
+ /**
187
+ * Emitted when the selected value is changed due to user interaction
188
+ *
189
+ * @event change
190
+ * @type {boolean} current selected value of radio group
191
+ */
192
+ this.$emit('change', value);
193
+
194
+ // If this is a child of a group, we emit a change event on it as well
195
+ if (this.isGroup) {
196
+ /**
197
+ * Emitted when the selected value is changed due to user interaction
198
+ *
199
+ * @event change
200
+ * @type {boolean} current selected value of radio group
201
+ */
202
+ this.group.$emit('change', value);
203
+ }
204
+ });
205
+ },
206
+ focus() {
207
+ if (!this.disabled) {
208
+ this.$refs.input?.focus();
209
+ }
210
+ },
211
+ blur() {
212
+ if (!this.disabled) {
213
+ this.$refs.input?.blur();
214
+ }
215
+ },
23
216
  },
24
217
  };
25
218
  </script>
26
219
 
27
220
  <template>
28
- <!--
29
- Emitted when the selected value is changed
30
- @event input
31
- @type {boolean} current selected value of radio group
32
-
33
- Emitted when the selected value is changed due to user interaction
34
- @event change
35
- @type {boolean} current selected value of radio group
36
- -->
37
- <b-form-radio
38
- class="gl-form-radio"
39
- :checked="checked"
40
- v-bind="$attrs"
41
- @input="$emit('input', $event)"
42
- @change="$emit('change', $event)"
43
- >
44
- <!-- @slot Content to use for the label -->
45
- <slot></slot>
46
- <p v-if="$scopedSlots.help" class="help-text">
47
- <!-- @slot Content provided here will be shown beneath the radio. Typically used for help or descriptive text. -->
48
- <slot name="help"></slot>
49
- </p>
50
- </b-form-radio>
221
+ <div class="gl-form-radio custom-radio custom-control">
222
+ <input
223
+ ref="input"
224
+ key="input"
225
+ v-bind="computedAttrs"
226
+ type="radio"
227
+ class="custom-control-input"
228
+ :class="stateClass"
229
+ @change="handleChange"
230
+ />
231
+ <label :for="internalId" class="custom-control-label">
232
+ <!-- @slot Content to use for the label -->
233
+ <slot></slot>
234
+ <p v-if="Boolean($scopedSlots.help)" class="help-text">
235
+ <!-- @slot Content provided here will be shown beneath the radio. Typically used for help or descriptive text. -->
236
+ <slot name="help"></slot>
237
+ </p>
238
+ </label>
239
+ </div>
51
240
  </template>
@@ -1,5 +1,5 @@
1
1
  <script>
2
- import isObject from 'lodash/isObject';
2
+ import { isObject } from 'lodash-es';
3
3
  import { BFormSelect } from '../../../../vendor/bootstrap-vue/src/components/form-select/form-select';
4
4
  import { formInputWidths } from '../../../../utils/constants';
5
5
 
@@ -1,5 +1,5 @@
1
1
  <script>
2
- import uniqueId from 'lodash/uniqueId';
2
+ import { uniqueId } from 'lodash-es';
3
3
  import { BFormTextarea } from '../../../../vendor/bootstrap-vue/src/components/form-textarea/form-textarea';
4
4
  import GlFormCharacterCount from '../form_character_count/form_character_count.vue';
5
5
 
@@ -1,5 +1,5 @@
1
1
  <script>
2
- import throttle from 'lodash/throttle';
2
+ import { throttle } from 'lodash-es';
3
3
 
4
4
  const throttleDuration = 1000;
5
5
  /**
@@ -1,10 +1,5 @@
1
1
  <script>
2
- import isFunction from 'lodash/isFunction';
3
- import isString from 'lodash/isString';
4
- import isObject from 'lodash/isObject';
5
- import toString from 'lodash/toString';
6
- import isBoolean from 'lodash/isBoolean';
7
- import concat from 'lodash/concat';
2
+ import { isFunction, isString, isObject, toString, isBoolean, concat } from 'lodash-es';
8
3
  import { SafeLinkDirective, isExternalURL } from '../../../directives/safe_link/safe_link';
9
4
  import { stopEvent } from '../../../utils/utils';
10
5
  import { isEvent } from '../../../vendor/bootstrap-vue/src/utils/inspect';
@@ -1,6 +1,5 @@
1
1
  <script>
2
- import uniqueId from 'lodash/uniqueId';
3
- import isBoolean from 'lodash/isBoolean';
2
+ import { uniqueId, isBoolean } from 'lodash-es';
4
3
  import {
5
4
  arrow,
6
5
  computePosition,
@@ -1,6 +1,5 @@
1
1
  <script>
2
- import clamp from 'lodash/clamp';
3
- import uniqueId from 'lodash/uniqueId';
2
+ import { clamp, uniqueId } from 'lodash-es';
4
3
  import { stopEvent, filterVisible } from '../../../../utils/utils';
5
4
  import {
6
5
  GL_DROPDOWN_SHOWN,
@@ -1,5 +1,5 @@
1
1
  <script>
2
- import uniqueId from 'lodash/uniqueId';
2
+ import { uniqueId } from 'lodash-es';
3
3
  import GlDisclosureDropdownItem from './disclosure_dropdown_item.vue';
4
4
  import { isGroup, doSomeItemsHaveIcon } from './utils';
5
5
  import {
@@ -1,5 +1,5 @@
1
1
  import Vue from 'vue';
2
- import isFunction from 'lodash/isFunction';
2
+ import { isFunction } from 'lodash-es';
3
3
  import { DISCLOSURE_DROPDOWN_ITEM_NAME, DISCLOSURE_DROPDOWN_GROUP_NAME } from './constants';
4
4
 
5
5
  const itemValidator = (item) => item?.text?.length > 0 && !Array.isArray(item?.items);
@@ -1,6 +1,5 @@
1
1
  <script>
2
- import clamp from 'lodash/clamp';
3
- import uniqueId from 'lodash/uniqueId';
2
+ import { clamp, uniqueId } from 'lodash-es';
4
3
  import { stopEvent, logWarning } from '../../../../utils/utils';
5
4
  import {
6
5
  GL_DROPDOWN_SHOWN,
@@ -1,5 +1,5 @@
1
1
  <script>
2
- import uniqueId from 'lodash/uniqueId';
2
+ import { uniqueId } from 'lodash-es';
3
3
 
4
4
  export default {
5
5
  name: 'GlListboxGroup',
@@ -1,5 +1,4 @@
1
- import isNumber from 'lodash/isNumber';
2
- import isString from 'lodash/isString';
1
+ import { isNumber, isString } from 'lodash-es';
3
2
 
4
3
  const isOption = (item) =>
5
4
  Boolean(item) && (isString(item.value) || isNumber(item.value) || item.value === null);
@@ -1,7 +1,5 @@
1
1
  <script>
2
- import debounce from 'lodash/debounce';
3
- import isFunction from 'lodash/isFunction';
4
- import range from 'lodash/range';
2
+ import { debounce, isFunction, range } from 'lodash-es';
5
3
  import { GlBreakpointInstance, breakpoints } from '../../../utils/breakpoints';
6
4
  import { alignOptions, resizeDebounceTime } from '../../../utils/constants';
7
5
  import { sprintf, translate } from '../../../utils/i18n';
@@ -1,7 +1,6 @@
1
1
  <script>
2
2
  import iconSpriteInfo from '@gitlab/svgs/dist/icons.json';
3
- import uniqueId from 'lodash/uniqueId';
4
- import findLast from 'lodash/findLast';
3
+ import { uniqueId, findLast } from 'lodash-es';
5
4
  import { GlResizeObserverDirective } from '../../../directives/resize_observer/resize_observer';
6
5
  import GlIcon from '../icon/icon.vue';
7
6
 
@@ -1,5 +1,5 @@
1
1
  <script>
2
- import range from 'lodash/range';
2
+ import { range } from 'lodash-es';
3
3
  import { uid } from '../../../utils/utils';
4
4
 
5
5
  const DEFAULT_LINE_MAX_WIDTH = 235;
@@ -1,5 +1,5 @@
1
1
  <script>
2
- import uniqueId from 'lodash/uniqueId';
2
+ import { uniqueId } from 'lodash-es';
3
3
  import { GlTooltipDirective } from '../../../directives/tooltip/tooltip';
4
4
  import GlButton from '../button/button.vue';
5
5
  import GlButtonGroup from '../button_group/button_group.vue';
@@ -1,5 +1,5 @@
1
1
  <script>
2
- import isPlainObject from 'lodash/isPlainObject';
2
+ import { isPlainObject } from 'lodash-es';
3
3
  import { BTab } from '../../../../vendor/bootstrap-vue/src/components/tabs/tab';
4
4
  import GlBadge from '../../badge/badge.vue';
5
5
  import { logWarning } from '../../../../utils/utils';
@@ -1,5 +1,5 @@
1
1
  <script>
2
- import debounce from 'lodash/debounce';
2
+ import { debounce } from 'lodash-es';
3
3
  import { GlResizeObserverDirective } from '../../../../directives/resize_observer/resize_observer';
4
4
  import GlIcon from '../../icon/icon.vue';
5
5
  import { translate } from '../../../../utils/i18n';
@@ -1,5 +1,5 @@
1
1
  /* eslint-disable import/no-default-export */
2
- import isFunction from 'lodash/isFunction';
2
+ import { isFunction } from 'lodash-es';
3
3
  // eslint-disable-next-line no-restricted-imports
4
4
  import { ToastPlugin } from '../../../vendor/bootstrap-vue/src/components/toast/index';
5
5
  import CloseButton from '../../shared_components/close_button/close_button.vue';
@@ -1,5 +1,5 @@
1
1
  <script>
2
- import uniqueId from 'lodash/uniqueId';
2
+ import { uniqueId } from 'lodash-es';
3
3
 
4
4
  import { toggleLabelPosition } from '../../../utils/constants';
5
5
  import GlIcon from '../icon/icon.vue';
@@ -1,3 +1,3 @@
1
- import has from 'lodash/has';
1
+ import { has } from 'lodash-es';
2
2
 
3
3
  export const tokensValidator = (tokens) => tokens.every((token) => has(token, 'id'));
@@ -1,5 +1,5 @@
1
1
  <script>
2
- import uniqueId from 'lodash/uniqueId';
2
+ import { uniqueId } from 'lodash-es';
3
3
  import { tokensValidator } from './helpers';
4
4
  import GlTokenContainer from './token_container.vue';
5
5
  import GlTokenSelectorDropdown from './token_selector_dropdown.vue';
@@ -1,5 +1,5 @@
1
1
  <script>
2
- import uniqueId from 'lodash/uniqueId';
2
+ import { uniqueId } from 'lodash-es';
3
3
  import GlDropdownItem from '../dropdown/dropdown_item.vue';
4
4
  import { tokensValidator } from './helpers';
5
5
 
@@ -15,7 +15,7 @@
15
15
  * we use a separate tooltip for data point and arrow.
16
16
  */
17
17
 
18
- import merge from 'lodash/merge';
18
+ import { merge } from 'lodash-es';
19
19
  import {
20
20
  defaultChartOptions,
21
21
  grid,
@@ -1,6 +1,5 @@
1
1
  <script>
2
- import merge from 'lodash/merge';
3
- import truncate from 'lodash/truncate';
2
+ import { merge, truncate } from 'lodash-es';
4
3
  import { grid, dataZoomAdjustments, mergeSeriesToOptions } from '../../../utils/charts/config';
5
4
  import { CHART_DEFAULT_SERIES_STACK, HEIGHT_AUTO_CLASSES } from '../../../utils/charts/constants';
6
5
  import { colorFromDefaultPalette } from '../../../utils/charts/theme';
@@ -1,6 +1,6 @@
1
1
  <script>
2
2
  import * as echarts from 'echarts';
3
- import merge from 'lodash/merge';
3
+ import { merge } from 'lodash-es';
4
4
  import {
5
5
  defaultHeight,
6
6
  defaultWidth,
@@ -1,5 +1,5 @@
1
1
  <script>
2
- import merge from 'lodash/merge';
2
+ import { merge } from 'lodash-es';
3
3
  import {
4
4
  defaultChartOptions,
5
5
  grid,
@@ -1,5 +1,5 @@
1
1
  <script>
2
- import merge from 'lodash/merge';
2
+ import { merge } from 'lodash-es';
3
3
  import {
4
4
  defaultChartOptions,
5
5
  dataZoomAdjustments,
@@ -1,7 +1,5 @@
1
1
  <script>
2
- import merge from 'lodash/merge';
3
- import uniq from 'lodash/uniq';
4
- import sortBy from 'lodash/sortBy';
2
+ import { merge, uniq, sortBy } from 'lodash-es';
5
3
  import { gaugeNeutralHues, gaugeSafeHues, gaugeWarningHue } from '../../../utils/charts/theme';
6
4
  import Chart from '../chart/chart.vue';
7
5
 
@@ -1,5 +1,5 @@
1
1
  <script>
2
- import merge from 'lodash/merge';
2
+ import { merge } from 'lodash-es';
3
3
  import { GL_COLOR_NEUTRAL_0, GL_COLOR_NEUTRAL_100 } from '../../../tokens/build/js/tokens';
4
4
  import { getTooltipTitle, getTooltipContent } from '../../../utils/charts/config';
5
5
  import { HEIGHT_AUTO_CLASSES } from '../../../utils/charts/constants';
@@ -17,7 +17,7 @@
17
17
  * we use a separate tooltip for data point and arrow.
18
18
  */
19
19
 
20
- import merge from 'lodash/merge';
20
+ import { merge } from 'lodash-es';
21
21
  import {
22
22
  defaultChartOptions,
23
23
  grid,
@@ -1,6 +1,5 @@
1
1
  <script>
2
- import merge from 'lodash/merge';
3
- import isNil from 'lodash/isNil';
2
+ import { merge, isNil } from 'lodash-es';
4
3
  import { graphic } from 'echarts';
5
4
  import { GlResizeObserverDirective } from '../../../directives/resize_observer/resize_observer';
6
5
  import {
@@ -1,6 +1,5 @@
1
1
  <script>
2
- import merge from 'lodash/merge';
3
- import groupBy from 'lodash/groupBy';
2
+ import { merge, groupBy } from 'lodash-es';
4
3
  import {
5
4
  defaultChartOptions,
6
5
  grid,
@@ -1,6 +1,6 @@
1
1
  <script>
2
2
  import { GridStack } from 'gridstack';
3
- import pickBy from 'lodash/pickBy';
3
+ import { pickBy } from 'lodash-es';
4
4
  import { breakpoints } from '../../../../utils/breakpoints';
5
5
 
6
6
  const CURSOR_GRABBING_CLASS = '!gl-cursor-grabbing';
@@ -1,6 +1,5 @@
1
1
  <script>
2
- import uniqueId from 'lodash/uniqueId';
3
- import isObject from 'lodash/isObject';
2
+ import { uniqueId, isObject } from 'lodash-es';
4
3
  import GlDisclosureDropdown from '../../base/new_dropdowns/disclosure/disclosure_dropdown.vue';
5
4
  import GlIcon from '../../base/icon/icon.vue';
6
5
  import GlLoadingIcon from '../../base/loading_icon/loading_icon.vue';
@@ -1,4 +1,4 @@
1
- import uniqueId from 'lodash/uniqueId';
1
+ import { uniqueId } from 'lodash-es';
2
2
 
3
3
  export const getUniquePanelId = () => uniqueId('panel-');
4
4
 
@@ -1,5 +1,5 @@
1
1
  <script>
2
- import uniqueId from 'lodash/uniqueId';
2
+ import { uniqueId } from 'lodash-es';
3
3
  import GlBadge from '../../base/badge/badge.vue';
4
4
  import GlLink from '../../base/link/link.vue';
5
5
  import GlPopover from '../../base/popover/popover.vue';
@@ -1,5 +1,5 @@
1
1
  <script>
2
- import memoize from 'lodash/memoize';
2
+ import { memoize } from 'lodash-es';
3
3
 
4
4
  const getObserver = memoize(
5
5
  (options) =>
@@ -1,7 +1,6 @@
1
1
  <script>
2
2
  /* eslint-disable no-continue */
3
- import has from 'lodash/has';
4
- import isString from 'lodash/isString';
3
+ import { has, isString } from 'lodash-es';
5
4
 
6
5
  const PREFIX = '%{';
7
6
  const SUFFIX = '}';
@@ -1,4 +1,4 @@
1
- import isFunction from 'lodash/isFunction';
1
+ import { isFunction } from 'lodash-es';
2
2
 
3
3
  export const DELAY_ON_HOVER = 100;
4
4
  let mouseOverTimer;
@@ -1,4 +1,4 @@
1
- import isFunction from 'lodash/isFunction';
1
+ import { isFunction } from 'lodash-es';
2
2
 
3
3
  let observer = null;
4
4
 
@@ -1,5 +1,4 @@
1
- import castArray from 'lodash/castArray';
2
- import merge from 'lodash/merge';
1
+ import { castArray, merge } from 'lodash-es';
3
2
  import { BLUE_500 } from '../../tokens/build/js/tokens';
4
3
  import { GlBreakpointInstance } from '../breakpoints';
5
4
  import { areDatesEqual } from '../datetime_utility';
@@ -1,4 +1,4 @@
1
- import times from 'lodash/times';
1
+ import { times } from 'lodash-es';
2
2
  import { SERIES_NAME, SERIES_NAME_SHORT } from '../stories_constants';
3
3
  import { colorFromDefaultPalette } from './theme';
4
4
 
package/src/utils/i18n.js CHANGED
@@ -1,4 +1,4 @@
1
- import escape from 'lodash/escape';
1
+ import { escape } from 'lodash-es';
2
2
  import { i18n } from '../config';
3
3
 
4
4
  const defaultPluralHandler = (n, singleValue, pluralValue) => {