@gitlab/ui 111.6.0 → 111.7.1

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 (36) hide show
  1. package/CHANGELOG.md +14 -0
  2. package/dist/components/charts/chart/chart.js +29 -23
  3. package/dist/index.css +1 -1
  4. package/dist/index.css.map +1 -1
  5. package/dist/utils/charts/config.js +1 -4
  6. package/dist/vendor/bootstrap-vue/src/constants/components.js +1 -7
  7. package/package.json +1 -1
  8. package/src/components/base/button_group/button_group.scss +1 -1
  9. package/src/components/charts/chart/chart.vue +17 -20
  10. package/src/utils/charts/config.js +0 -3
  11. package/src/vendor/bootstrap-vue/src/constants/components.js +0 -6
  12. package/dist/vendor/bootstrap-vue/src/components/form-input/form-input.js +0 -157
  13. package/dist/vendor/bootstrap-vue/src/components/form-input/index.js +0 -1
  14. package/dist/vendor/bootstrap-vue/src/components/input-group/index.js +0 -5
  15. package/dist/vendor/bootstrap-vue/src/components/input-group/input-group-addon.js +0 -44
  16. package/dist/vendor/bootstrap-vue/src/components/input-group/input-group-append.js +0 -34
  17. package/dist/vendor/bootstrap-vue/src/components/input-group/input-group-prepend.js +0 -34
  18. package/dist/vendor/bootstrap-vue/src/components/input-group/input-group-text.js +0 -31
  19. package/dist/vendor/bootstrap-vue/src/components/input-group/input-group.js +0 -75
  20. package/src/vendor/bootstrap-vue/src/components/form-input/README.md +0 -612
  21. package/src/vendor/bootstrap-vue/src/components/form-input/form-input.js +0 -168
  22. package/src/vendor/bootstrap-vue/src/components/form-input/form-input.spec.js +0 -989
  23. package/src/vendor/bootstrap-vue/src/components/form-input/index.js +0 -3
  24. package/src/vendor/bootstrap-vue/src/components/form-input/package.json +0 -135
  25. package/src/vendor/bootstrap-vue/src/components/input-group/README.md +0 -329
  26. package/src/vendor/bootstrap-vue/src/components/input-group/index.js +0 -7
  27. package/src/vendor/bootstrap-vue/src/components/input-group/input-group-addon.js +0 -43
  28. package/src/vendor/bootstrap-vue/src/components/input-group/input-group-append.js +0 -31
  29. package/src/vendor/bootstrap-vue/src/components/input-group/input-group-append.spec.js +0 -84
  30. package/src/vendor/bootstrap-vue/src/components/input-group/input-group-prepend.js +0 -31
  31. package/src/vendor/bootstrap-vue/src/components/input-group/input-group-prepend.spec.js +0 -84
  32. package/src/vendor/bootstrap-vue/src/components/input-group/input-group-text.js +0 -31
  33. package/src/vendor/bootstrap-vue/src/components/input-group/input-group-text.spec.js +0 -45
  34. package/src/vendor/bootstrap-vue/src/components/input-group/input-group.js +0 -73
  35. package/src/vendor/bootstrap-vue/src/components/input-group/input-group.spec.js +0 -153
  36. package/src/vendor/bootstrap-vue/src/components/input-group/package.json +0 -109
@@ -40,10 +40,7 @@ const grid = {
40
40
  const defaultChartOptions = {
41
41
  grid,
42
42
  xAxis,
43
- yAxis,
44
- aria: {
45
- enabled: true
46
- }
43
+ yAxis
47
44
  };
48
45
  const gridWithSecondaryYAxis = {
49
46
  ...grid,
@@ -15,7 +15,6 @@ const NAME_FORM = 'BForm';
15
15
  const NAME_FORM_CHECKBOX = 'BFormCheckbox';
16
16
  const NAME_FORM_CHECKBOX_GROUP = 'BFormCheckboxGroup';
17
17
  const NAME_FORM_GROUP = 'BFormGroup';
18
- const NAME_FORM_INPUT = 'BFormInput';
19
18
  const NAME_FORM_INVALID_FEEDBACK = 'BFormInvalidFeedback';
20
19
  const NAME_FORM_RADIO = 'BFormRadio';
21
20
  const NAME_FORM_RADIO_GROUP = 'BFormRadioGroup';
@@ -26,11 +25,6 @@ const NAME_FORM_SELECT_OPTION_GROUP = 'BFormSelectOptionGroup';
26
25
  const NAME_FORM_TEXT = 'BFormText';
27
26
  const NAME_FORM_TEXTAREA = 'BFormTextarea';
28
27
  const NAME_FORM_VALID_FEEDBACK = 'BFormValidFeedback';
29
- const NAME_INPUT_GROUP = 'BInputGroup';
30
- const NAME_INPUT_GROUP_ADDON = 'BInputGroupAddon';
31
- const NAME_INPUT_GROUP_APPEND = 'BInputGroupAppend';
32
- const NAME_INPUT_GROUP_PREPEND = 'BInputGroupPrepend';
33
- const NAME_INPUT_GROUP_TEXT = 'BInputGroupText';
34
28
  const NAME_LINK = 'BLink';
35
29
  const NAME_MODAL = 'BModal';
36
30
  const NAME_NAV = 'BNav';
@@ -67,4 +61,4 @@ const NAME_TRANSITION = 'BVTransition';
67
61
  const NAME_TRANSPORTER = 'BVTransporter';
68
62
  const NAME_TRANSPORTER_TARGET = 'BVTransporterTarget';
69
63
 
70
- export { NAME_BUTTON, NAME_BUTTON_CLOSE, NAME_COL, NAME_COLLAPSE, NAME_COLLAPSE_HELPER, NAME_DROPDOWN, NAME_DROPDOWN_DIVIDER, NAME_DROPDOWN_FORM, NAME_DROPDOWN_GROUP, NAME_DROPDOWN_HEADER, NAME_DROPDOWN_ITEM, NAME_DROPDOWN_ITEM_BUTTON, NAME_DROPDOWN_TEXT, NAME_FORM, NAME_FORM_BUTTON_LABEL_CONTROL, NAME_FORM_CHECKBOX, NAME_FORM_CHECKBOX_GROUP, NAME_FORM_GROUP, NAME_FORM_INPUT, NAME_FORM_INVALID_FEEDBACK, NAME_FORM_RADIO, NAME_FORM_RADIO_GROUP, NAME_FORM_RATING_STAR, NAME_FORM_ROW, NAME_FORM_SELECT, NAME_FORM_SELECT_OPTION, NAME_FORM_SELECT_OPTION_GROUP, NAME_FORM_TEXT, NAME_FORM_TEXTAREA, NAME_FORM_VALID_FEEDBACK, NAME_INPUT_GROUP, NAME_INPUT_GROUP_ADDON, NAME_INPUT_GROUP_APPEND, NAME_INPUT_GROUP_PREPEND, NAME_INPUT_GROUP_TEXT, NAME_LINK, NAME_MODAL, NAME_NAV, NAME_NAV_ITEM, NAME_NAV_ITEM_DROPDOWN, NAME_POPOVER, NAME_POPOVER_HELPER, NAME_POPOVER_TEMPLATE, NAME_POPPER, NAME_TAB, NAME_TABLE, NAME_TABLE_CELL, NAME_TABLE_LITE, NAME_TABLE_SIMPLE, NAME_TABS, NAME_TAB_BUTTON_HELPER, NAME_TBODY, NAME_TFOOT, NAME_TH, NAME_THEAD, NAME_TOAST, NAME_TOASTER, NAME_TOAST_POP, NAME_TOOLTIP, NAME_TOOLTIP_HELPER, NAME_TOOLTIP_TEMPLATE, NAME_TR, NAME_TRANSITION, NAME_TRANSPORTER, NAME_TRANSPORTER_TARGET };
64
+ export { NAME_BUTTON, NAME_BUTTON_CLOSE, NAME_COL, NAME_COLLAPSE, NAME_COLLAPSE_HELPER, NAME_DROPDOWN, NAME_DROPDOWN_DIVIDER, NAME_DROPDOWN_FORM, NAME_DROPDOWN_GROUP, NAME_DROPDOWN_HEADER, NAME_DROPDOWN_ITEM, NAME_DROPDOWN_ITEM_BUTTON, NAME_DROPDOWN_TEXT, NAME_FORM, NAME_FORM_BUTTON_LABEL_CONTROL, NAME_FORM_CHECKBOX, NAME_FORM_CHECKBOX_GROUP, NAME_FORM_GROUP, NAME_FORM_INVALID_FEEDBACK, NAME_FORM_RADIO, NAME_FORM_RADIO_GROUP, NAME_FORM_RATING_STAR, NAME_FORM_ROW, NAME_FORM_SELECT, NAME_FORM_SELECT_OPTION, NAME_FORM_SELECT_OPTION_GROUP, NAME_FORM_TEXT, NAME_FORM_TEXTAREA, NAME_FORM_VALID_FEEDBACK, NAME_LINK, NAME_MODAL, NAME_NAV, NAME_NAV_ITEM, NAME_NAV_ITEM_DROPDOWN, NAME_POPOVER, NAME_POPOVER_HELPER, NAME_POPOVER_TEMPLATE, NAME_POPPER, NAME_TAB, NAME_TABLE, NAME_TABLE_CELL, NAME_TABLE_LITE, NAME_TABLE_SIMPLE, NAME_TABS, NAME_TAB_BUTTON_HELPER, NAME_TBODY, NAME_TFOOT, NAME_TH, NAME_THEAD, NAME_TOAST, NAME_TOASTER, NAME_TOAST_POP, NAME_TOOLTIP, NAME_TOOLTIP_HELPER, NAME_TOOLTIP_TEMPLATE, NAME_TR, NAME_TRANSITION, NAME_TRANSPORTER, NAME_TRANSPORTER_TARGET };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gitlab/ui",
3
- "version": "111.6.0",
3
+ "version": "111.7.1",
4
4
  "description": "GitLab UI Components",
5
5
  "license": "MIT",
6
6
  "main": "dist/index.js",
@@ -23,7 +23,7 @@ $gl-button-group-border-z-index: $gl-button-group-focus-z-index + 1;
23
23
  > .gl-button:not(:first-child),
24
24
  > .btn-group:not(:first-child) > .gl-button,
25
25
  > .gl-new-dropdown:not(:first-child) > .gl-button {
26
- @apply gl-relative gl-ml-[1px];
26
+ @apply gl-relative gl-ml-[1px] gl-isolate;
27
27
 
28
28
  &::before {
29
29
  content: '';
@@ -1,6 +1,7 @@
1
1
  <!-- eslint-disable vue/multi-word-component-names -->
2
2
  <script>
3
3
  import * as echarts from 'echarts';
4
+ import merge from 'lodash/merge';
4
5
  import {
5
6
  defaultHeight,
6
7
  defaultWidth,
@@ -17,16 +18,6 @@ import { debounceByAnimationFrame } from '../../../utils/utils';
17
18
  */
18
19
  const sizeValidator = (size) => Number.isFinite(size) || size === 'auto' || size == null;
19
20
 
20
- const isChartWithToolbox = (options) => Boolean(options?.toolbox?.show);
21
-
22
- const increaseChartGridTop = (options, increaseBy) => ({
23
- ...options,
24
- grid: {
25
- ...options.grid,
26
- top: (options?.grid?.top || 0) + increaseBy,
27
- },
28
- });
29
-
30
21
  export default {
31
22
  name: 'GlChart',
32
23
  directives: {
@@ -90,10 +81,21 @@ export default {
90
81
  };
91
82
  },
92
83
  computed: {
93
- normalizedOptions() {
94
- return isChartWithToolbox(this.options)
95
- ? increaseChartGridTop(this.options, toolboxHeight)
96
- : this.options;
84
+ modifiedOptions() {
85
+ let options = { ...this.options };
86
+
87
+ // Enable aria by default
88
+ if (options.aria?.enabled === undefined) {
89
+ options = merge({}, options, { aria: { enabled: true } });
90
+ }
91
+
92
+ // Add space at the top to fit the toolbox
93
+ if (options.toolbox?.show === true) {
94
+ const top = (options.grid?.top || 0) + toolboxHeight;
95
+ options = merge({}, options, { grid: { top } });
96
+ }
97
+
98
+ return options;
97
99
  },
98
100
  },
99
101
  watch: {
@@ -143,12 +145,7 @@ export default {
143
145
  },
144
146
  methods: {
145
147
  draw() {
146
- this.chart.setOption({
147
- ...this.normalizedOptions,
148
- aria: {
149
- enabled: true,
150
- },
151
- });
148
+ this.chart.setOption(this.modifiedOptions);
152
149
  /**
153
150
  * Emitted after calling `echarts.setOption`
154
151
  */
@@ -46,9 +46,6 @@ export const defaultChartOptions = {
46
46
  grid,
47
47
  xAxis,
48
48
  yAxis,
49
- aria: {
50
- enabled: true,
51
- },
52
49
  };
53
50
 
54
51
  export const gridWithSecondaryYAxis = {
@@ -15,7 +15,6 @@ export const NAME_FORM = 'BForm'
15
15
  export const NAME_FORM_CHECKBOX = 'BFormCheckbox'
16
16
  export const NAME_FORM_CHECKBOX_GROUP = 'BFormCheckboxGroup'
17
17
  export const NAME_FORM_GROUP = 'BFormGroup'
18
- export const NAME_FORM_INPUT = 'BFormInput'
19
18
  export const NAME_FORM_INVALID_FEEDBACK = 'BFormInvalidFeedback'
20
19
  export const NAME_FORM_RADIO = 'BFormRadio'
21
20
  export const NAME_FORM_RADIO_GROUP = 'BFormRadioGroup'
@@ -26,11 +25,6 @@ export const NAME_FORM_SELECT_OPTION_GROUP = 'BFormSelectOptionGroup'
26
25
  export const NAME_FORM_TEXT = 'BFormText'
27
26
  export const NAME_FORM_TEXTAREA = 'BFormTextarea'
28
27
  export const NAME_FORM_VALID_FEEDBACK = 'BFormValidFeedback'
29
- export const NAME_INPUT_GROUP = 'BInputGroup'
30
- export const NAME_INPUT_GROUP_ADDON = 'BInputGroupAddon'
31
- export const NAME_INPUT_GROUP_APPEND = 'BInputGroupAppend'
32
- export const NAME_INPUT_GROUP_PREPEND = 'BInputGroupPrepend'
33
- export const NAME_INPUT_GROUP_TEXT = 'BInputGroupText'
34
28
  export const NAME_LINK = 'BLink'
35
29
  export const NAME_MODAL = 'BModal'
36
30
  export const NAME_NAV = 'BNav'
@@ -1,157 +0,0 @@
1
- import { extend } from '../../vue';
2
- import { NAME_FORM_INPUT } from '../../constants/components';
3
- import { PROP_TYPE_STRING, PROP_TYPE_NUMBER_STRING, PROP_TYPE_BOOLEAN } from '../../constants/props';
4
- import { arrayIncludes } from '../../utils/array';
5
- import { attemptBlur } from '../../utils/dom';
6
- import { eventOnOff, eventOff, eventOn, stopEvent } from '../../utils/events';
7
- import { sortKeys } from '../../utils/object';
8
- import { makePropsConfigurable, makeProp } from '../../utils/props';
9
- import { props as props$2, formControlMixin } from '../../mixins/form-control';
10
- import { formSelectionMixin } from '../../mixins/form-selection';
11
- import { props as props$3, formSizeMixin } from '../../mixins/form-size';
12
- import { props as props$4, formStateMixin } from '../../mixins/form-state';
13
- import { props as props$5, formTextMixin } from '../../mixins/form-text';
14
- import { formValidityMixin } from '../../mixins/form-validity';
15
- import { props as props$1, idMixin } from '../../mixins/id';
16
- import { listenersMixin } from '../../mixins/listeners';
17
-
18
- // --- Constants ---
19
-
20
- // Valid supported input types
21
- const TYPES = ['text', 'password', 'email', 'number', 'url', 'tel', 'search', 'range', 'color', 'date', 'time', 'datetime', 'datetime-local', 'month', 'week'];
22
-
23
- // --- Props ---
24
-
25
- const props = makePropsConfigurable(sortKeys({
26
- ...props$1,
27
- ...props$2,
28
- ...props$3,
29
- ...props$4,
30
- ...props$5,
31
- list: makeProp(PROP_TYPE_STRING),
32
- max: makeProp(PROP_TYPE_NUMBER_STRING),
33
- min: makeProp(PROP_TYPE_NUMBER_STRING),
34
- // Disable mousewheel to prevent wheel from changing values (i.e. number/date)
35
- noWheel: makeProp(PROP_TYPE_BOOLEAN, false),
36
- step: makeProp(PROP_TYPE_NUMBER_STRING),
37
- type: makeProp(PROP_TYPE_STRING, 'text', type => {
38
- return arrayIncludes(TYPES, type);
39
- })
40
- }), NAME_FORM_INPUT);
41
-
42
- // --- Main component ---
43
-
44
- // @vue/component
45
- const BFormInput = /*#__PURE__*/extend({
46
- name: NAME_FORM_INPUT,
47
- // Mixin order is important!
48
- mixins: [listenersMixin, idMixin, formControlMixin, formSizeMixin, formStateMixin, formTextMixin, formSelectionMixin, formValidityMixin],
49
- props,
50
- computed: {
51
- localType() {
52
- // We only allow certain types
53
- const {
54
- type
55
- } = this;
56
- return arrayIncludes(TYPES, type) ? type : 'text';
57
- },
58
- computedAttrs() {
59
- const {
60
- localType: type,
61
- name,
62
- form,
63
- disabled,
64
- placeholder,
65
- required,
66
- min,
67
- max,
68
- step
69
- } = this;
70
- return {
71
- id: this.safeId(),
72
- name,
73
- form,
74
- type,
75
- disabled,
76
- placeholder,
77
- required,
78
- autocomplete: this.autocomplete || null,
79
- readonly: this.readonly || this.plaintext,
80
- min,
81
- max,
82
- step,
83
- list: type !== 'password' ? this.list : null,
84
- 'aria-required': required ? 'true' : null,
85
- 'aria-invalid': this.computedAriaInvalid
86
- };
87
- },
88
- computedListeners() {
89
- return {
90
- ...this.bvListeners,
91
- input: this.onInput,
92
- change: this.onChange,
93
- blur: this.onBlur
94
- };
95
- }
96
- },
97
- watch: {
98
- noWheel(newValue) {
99
- this.setWheelStopper(newValue);
100
- }
101
- },
102
- mounted() {
103
- this.setWheelStopper(this.noWheel);
104
- },
105
- /* istanbul ignore next */
106
- deactivated() {
107
- // Turn off listeners when keep-alive component deactivated
108
- /* istanbul ignore next */
109
- this.setWheelStopper(false);
110
- },
111
- /* istanbul ignore next */
112
- activated() {
113
- // Turn on listeners (if no-wheel) when keep-alive component activated
114
- /* istanbul ignore next */
115
- this.setWheelStopper(this.noWheel);
116
- },
117
- beforeDestroy() {
118
- /* istanbul ignore next */
119
- this.setWheelStopper(false);
120
- },
121
- methods: {
122
- setWheelStopper(on) {
123
- const input = this.$el;
124
- // We use native events, so that we don't interfere with propagation
125
- eventOnOff(on, input, 'focus', this.onWheelFocus);
126
- eventOnOff(on, input, 'blur', this.onWheelBlur);
127
- if (!on) {
128
- eventOff(document, 'wheel', this.stopWheel);
129
- }
130
- },
131
- onWheelFocus() {
132
- eventOn(document, 'wheel', this.stopWheel);
133
- },
134
- onWheelBlur() {
135
- eventOff(document, 'wheel', this.stopWheel);
136
- },
137
- stopWheel(event) {
138
- stopEvent(event, {
139
- propagation: false
140
- });
141
- attemptBlur(this.$el);
142
- }
143
- },
144
- render(h) {
145
- return h('input', {
146
- class: this.computedClass,
147
- attrs: this.computedAttrs,
148
- domProps: {
149
- value: this.localValue
150
- },
151
- on: this.computedListeners,
152
- ref: 'input'
153
- });
154
- }
155
- });
156
-
157
- export { BFormInput, props };
@@ -1 +0,0 @@
1
- export { BFormInput } from './form-input';
@@ -1,5 +0,0 @@
1
- export { BInputGroup } from './input-group';
2
- export { BInputGroupAddon } from './input-group-addon';
3
- export { BInputGroupPrepend } from './input-group-prepend';
4
- export { BInputGroupAppend } from './input-group-append';
5
- export { BInputGroupText } from './input-group-text';
@@ -1,44 +0,0 @@
1
- import { extend, mergeData } from '../../vue';
2
- import { NAME_INPUT_GROUP_ADDON } from '../../constants/components';
3
- import { PROP_TYPE_BOOLEAN, PROP_TYPE_STRING } from '../../constants/props';
4
- import { makePropsConfigurable, makeProp } from '../../utils/props';
5
- import { BInputGroupText } from './input-group-text';
6
-
7
- // --- Props ---
8
-
9
- const props = makePropsConfigurable({
10
- append: makeProp(PROP_TYPE_BOOLEAN, false),
11
- id: makeProp(PROP_TYPE_STRING),
12
- isText: makeProp(PROP_TYPE_BOOLEAN, false),
13
- tag: makeProp(PROP_TYPE_STRING, 'div')
14
- }, NAME_INPUT_GROUP_ADDON);
15
-
16
- // --- Main component ---
17
-
18
- // @vue/component
19
- const BInputGroupAddon = /*#__PURE__*/extend({
20
- name: NAME_INPUT_GROUP_ADDON,
21
- functional: true,
22
- props,
23
- render(h, _ref) {
24
- let {
25
- props,
26
- data,
27
- children
28
- } = _ref;
29
- const {
30
- append
31
- } = props;
32
- return h(props.tag, mergeData(data, {
33
- class: {
34
- 'input-group-append': append,
35
- 'input-group-prepend': !append
36
- },
37
- attrs: {
38
- id: props.id
39
- }
40
- }), props.isText ? [h(BInputGroupText, children)] : children);
41
- }
42
- });
43
-
44
- export { BInputGroupAddon, props };
@@ -1,34 +0,0 @@
1
- import { extend, mergeData } from '../../vue';
2
- import { NAME_INPUT_GROUP_APPEND } from '../../constants/components';
3
- import { omit } from '../../utils/object';
4
- import { makePropsConfigurable } from '../../utils/props';
5
- import { props as props$1, BInputGroupAddon } from './input-group-addon';
6
-
7
- // --- Props ---
8
-
9
- const props = makePropsConfigurable(omit(props$1, ['append']), NAME_INPUT_GROUP_APPEND);
10
-
11
- // --- Main component ---
12
-
13
- // @vue/component
14
- const BInputGroupAppend = /*#__PURE__*/extend({
15
- name: NAME_INPUT_GROUP_APPEND,
16
- functional: true,
17
- props,
18
- render(h, _ref) {
19
- let {
20
- props,
21
- data,
22
- children
23
- } = _ref;
24
- // Pass all our data down to child, and set `append` to `true`
25
- return h(BInputGroupAddon, mergeData(data, {
26
- props: {
27
- ...props,
28
- append: true
29
- }
30
- }), children);
31
- }
32
- });
33
-
34
- export { BInputGroupAppend, props };
@@ -1,34 +0,0 @@
1
- import { extend, mergeData } from '../../vue';
2
- import { NAME_INPUT_GROUP_PREPEND } from '../../constants/components';
3
- import { omit } from '../../utils/object';
4
- import { makePropsConfigurable } from '../../utils/props';
5
- import { props as props$1, BInputGroupAddon } from './input-group-addon';
6
-
7
- // --- Props ---
8
-
9
- const props = makePropsConfigurable(omit(props$1, ['append']), NAME_INPUT_GROUP_PREPEND);
10
-
11
- // --- Main component ---
12
-
13
- // @vue/component
14
- const BInputGroupPrepend = /*#__PURE__*/extend({
15
- name: NAME_INPUT_GROUP_PREPEND,
16
- functional: true,
17
- props,
18
- render(h, _ref) {
19
- let {
20
- props,
21
- data,
22
- children
23
- } = _ref;
24
- // Pass all our data down to child, and set `append` to `true`
25
- return h(BInputGroupAddon, mergeData(data, {
26
- props: {
27
- ...props,
28
- append: false
29
- }
30
- }), children);
31
- }
32
- });
33
-
34
- export { BInputGroupPrepend, props };
@@ -1,31 +0,0 @@
1
- import { extend, mergeData } from '../../vue';
2
- import { NAME_INPUT_GROUP_TEXT } from '../../constants/components';
3
- import { PROP_TYPE_STRING } from '../../constants/props';
4
- import { makePropsConfigurable, makeProp } from '../../utils/props';
5
-
6
- // --- Props ---
7
-
8
- const props = makePropsConfigurable({
9
- tag: makeProp(PROP_TYPE_STRING, 'div')
10
- }, NAME_INPUT_GROUP_TEXT);
11
-
12
- // --- Main component ---
13
-
14
- // @vue/component
15
- const BInputGroupText = /*#__PURE__*/extend({
16
- name: NAME_INPUT_GROUP_TEXT,
17
- functional: true,
18
- props,
19
- render(h, _ref) {
20
- let {
21
- props,
22
- data,
23
- children
24
- } = _ref;
25
- return h(props.tag, mergeData(data, {
26
- staticClass: 'input-group-text'
27
- }), children);
28
- }
29
- });
30
-
31
- export { BInputGroupText, props };
@@ -1,75 +0,0 @@
1
- import { extend, mergeData } from '../../vue';
2
- import { NAME_INPUT_GROUP } from '../../constants/components';
3
- import { PROP_TYPE_STRING } from '../../constants/props';
4
- import { SLOT_NAME_PREPEND, SLOT_NAME_APPEND, SLOT_NAME_DEFAULT } from '../../constants/slots';
5
- import { htmlOrText } from '../../utils/html';
6
- import { hasNormalizedSlot, normalizeSlot } from '../../utils/normalize-slot';
7
- import { makePropsConfigurable, makeProp } from '../../utils/props';
8
- import { BInputGroupAppend } from './input-group-append';
9
- import { BInputGroupPrepend } from './input-group-prepend';
10
- import { BInputGroupText } from './input-group-text';
11
-
12
- // --- Props ---
13
-
14
- const props = makePropsConfigurable({
15
- append: makeProp(PROP_TYPE_STRING),
16
- appendHtml: makeProp(PROP_TYPE_STRING),
17
- id: makeProp(PROP_TYPE_STRING),
18
- prepend: makeProp(PROP_TYPE_STRING),
19
- prependHtml: makeProp(PROP_TYPE_STRING),
20
- size: makeProp(PROP_TYPE_STRING),
21
- tag: makeProp(PROP_TYPE_STRING, 'div')
22
- }, NAME_INPUT_GROUP);
23
-
24
- // --- Main component ---
25
-
26
- // @vue/component
27
- const BInputGroup = /*#__PURE__*/extend({
28
- name: NAME_INPUT_GROUP,
29
- functional: true,
30
- props,
31
- render(h, _ref) {
32
- let {
33
- props,
34
- data,
35
- slots,
36
- scopedSlots
37
- } = _ref;
38
- const {
39
- prepend,
40
- prependHtml,
41
- append,
42
- appendHtml,
43
- size
44
- } = props;
45
- const $scopedSlots = scopedSlots || {};
46
- const $slots = slots();
47
- const slotScope = {};
48
- let $prepend = h();
49
- const hasPrependSlot = hasNormalizedSlot(SLOT_NAME_PREPEND, $scopedSlots, $slots);
50
- if (hasPrependSlot || prepend || prependHtml) {
51
- $prepend = h(BInputGroupPrepend, [hasPrependSlot ? normalizeSlot(SLOT_NAME_PREPEND, slotScope, $scopedSlots, $slots) : h(BInputGroupText, {
52
- domProps: htmlOrText(prependHtml, prepend)
53
- })]);
54
- }
55
- let $append = h();
56
- const hasAppendSlot = hasNormalizedSlot(SLOT_NAME_APPEND, $scopedSlots, $slots);
57
- if (hasAppendSlot || append || appendHtml) {
58
- $append = h(BInputGroupAppend, [hasAppendSlot ? normalizeSlot(SLOT_NAME_APPEND, slotScope, $scopedSlots, $slots) : h(BInputGroupText, {
59
- domProps: htmlOrText(appendHtml, append)
60
- })]);
61
- }
62
- return h(props.tag, mergeData(data, {
63
- staticClass: 'input-group',
64
- class: {
65
- [`input-group-${size}`]: size
66
- },
67
- attrs: {
68
- id: props.id || null,
69
- role: 'group'
70
- }
71
- }), [$prepend, normalizeSlot(SLOT_NAME_DEFAULT, slotScope, $scopedSlots, $slots), $append]);
72
- }
73
- });
74
-
75
- export { BInputGroup, props };