@gitlab/ui 132.0.2 → 132.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 (73) hide show
  1. package/dist/components/base/link/link.js +2 -2
  2. package/dist/components/dashboards/dashboard_layout/grid_layout/grid_layout.js +3 -3
  3. package/dist/index.css +1 -1
  4. package/dist/index.css.map +1 -1
  5. package/dist/utils/url_utils.js +56 -0
  6. package/dist/vendor/bootstrap-vue/src/components/dropdown/dropdown-divider.js +5 -2
  7. package/dist/vendor/bootstrap-vue/src/components/dropdown/dropdown-form.js +11 -4
  8. package/dist/vendor/bootstrap-vue/src/components/dropdown/dropdown-group.js +31 -8
  9. package/dist/vendor/bootstrap-vue/src/components/dropdown/dropdown-header.js +15 -4
  10. package/dist/vendor/bootstrap-vue/src/components/dropdown/dropdown-item-button.js +31 -8
  11. package/dist/vendor/bootstrap-vue/src/components/form/form-invalid-feedback.js +35 -8
  12. package/dist/vendor/bootstrap-vue/src/components/form/form-valid-feedback.js +35 -8
  13. package/dist/vendor/bootstrap-vue/src/components/form-group/form-group.js +66 -14
  14. package/dist/vendor/bootstrap-vue/src/components/form-select/form-select-option-group.js +4 -2
  15. package/dist/vendor/bootstrap-vue/src/components/form-select/form-select-option.js +9 -3
  16. package/dist/vendor/bootstrap-vue/src/components/form-select/form-select.js +16 -5
  17. package/dist/vendor/bootstrap-vue/src/components/form-select/helpers/mixin-options.js +10 -3
  18. package/dist/vendor/bootstrap-vue/src/components/form-textarea/form-textarea.js +26 -7
  19. package/dist/vendor/bootstrap-vue/src/components/popover/popover.js +24 -9
  20. package/dist/vendor/bootstrap-vue/src/components/table/helpers/mixin-busy.js +5 -2
  21. package/dist/vendor/bootstrap-vue/src/components/table/helpers/mixin-caption.js +10 -3
  22. package/dist/vendor/bootstrap-vue/src/components/table/helpers/mixin-empty.js +25 -6
  23. package/dist/vendor/bootstrap-vue/src/components/table/helpers/mixin-items.js +20 -5
  24. package/dist/vendor/bootstrap-vue/src/components/table/helpers/mixin-pagination.js +11 -4
  25. package/dist/vendor/bootstrap-vue/src/components/table/helpers/mixin-provider.js +26 -7
  26. package/dist/vendor/bootstrap-vue/src/components/table/helpers/mixin-selectable.js +21 -7
  27. package/dist/vendor/bootstrap-vue/src/components/table/helpers/mixin-sorting.js +74 -20
  28. package/dist/vendor/bootstrap-vue/src/components/table/helpers/mixin-stacked.js +6 -3
  29. package/dist/vendor/bootstrap-vue/src/components/table/helpers/mixin-table-renderer.js +71 -16
  30. package/dist/vendor/bootstrap-vue/src/components/table/helpers/mixin-tbody-row.js +16 -5
  31. package/dist/vendor/bootstrap-vue/src/components/table/helpers/mixin-tbody.js +7 -3
  32. package/dist/vendor/bootstrap-vue/src/components/table/helpers/mixin-tfoot.js +26 -7
  33. package/dist/vendor/bootstrap-vue/src/components/table/helpers/mixin-thead.js +21 -6
  34. package/dist/vendor/bootstrap-vue/src/components/tooltip/helpers/bv-popper.js +36 -9
  35. package/dist/vendor/bootstrap-vue/src/components/tooltip/helpers/bv-tooltip-template.js +10 -3
  36. package/dist/vendor/bootstrap-vue/src/components/transition/bv-transition.js +20 -5
  37. package/dist/vendor/bootstrap-vue/src/components/transporter/transporter.js +24 -9
  38. package/package.json +2 -2
  39. package/src/components/base/link/link.vue +2 -2
  40. package/src/components/dashboards/dashboard_layout/grid_layout/grid_layout.vue +21 -19
  41. package/src/utils/url_utils.js +66 -0
  42. package/src/vendor/bootstrap-vue/src/components/dropdown/dropdown-divider.js +5 -2
  43. package/src/vendor/bootstrap-vue/src/components/dropdown/dropdown-form.js +16 -4
  44. package/src/vendor/bootstrap-vue/src/components/dropdown/dropdown-group.js +31 -8
  45. package/src/vendor/bootstrap-vue/src/components/dropdown/dropdown-header.js +15 -4
  46. package/src/vendor/bootstrap-vue/src/components/dropdown/dropdown-item-button.js +32 -8
  47. package/src/vendor/bootstrap-vue/src/components/form/form-invalid-feedback.js +35 -8
  48. package/src/vendor/bootstrap-vue/src/components/form/form-valid-feedback.js +35 -8
  49. package/src/vendor/bootstrap-vue/src/components/form-group/form-group.js +67 -14
  50. package/src/vendor/bootstrap-vue/src/components/form-select/form-select-option-group.js +4 -2
  51. package/src/vendor/bootstrap-vue/src/components/form-select/form-select-option.js +9 -3
  52. package/src/vendor/bootstrap-vue/src/components/form-select/form-select.js +16 -9
  53. package/src/vendor/bootstrap-vue/src/components/form-select/helpers/mixin-options.js +10 -3
  54. package/src/vendor/bootstrap-vue/src/components/form-textarea/form-textarea.js +26 -7
  55. package/src/vendor/bootstrap-vue/src/components/popover/popover.js +23 -7
  56. package/src/vendor/bootstrap-vue/src/components/table/helpers/mixin-busy.js +5 -2
  57. package/src/vendor/bootstrap-vue/src/components/table/helpers/mixin-caption.js +10 -3
  58. package/src/vendor/bootstrap-vue/src/components/table/helpers/mixin-empty.js +25 -6
  59. package/src/vendor/bootstrap-vue/src/components/table/helpers/mixin-items.js +20 -5
  60. package/src/vendor/bootstrap-vue/src/components/table/helpers/mixin-pagination.js +11 -4
  61. package/src/vendor/bootstrap-vue/src/components/table/helpers/mixin-provider.js +27 -7
  62. package/src/vendor/bootstrap-vue/src/components/table/helpers/mixin-selectable.js +21 -7
  63. package/src/vendor/bootstrap-vue/src/components/table/helpers/mixin-sorting.js +72 -18
  64. package/src/vendor/bootstrap-vue/src/components/table/helpers/mixin-stacked.js +6 -3
  65. package/src/vendor/bootstrap-vue/src/components/table/helpers/mixin-table-renderer.js +72 -17
  66. package/src/vendor/bootstrap-vue/src/components/table/helpers/mixin-tbody-row.js +18 -6
  67. package/src/vendor/bootstrap-vue/src/components/table/helpers/mixin-tbody.js +7 -3
  68. package/src/vendor/bootstrap-vue/src/components/table/helpers/mixin-tfoot.js +27 -7
  69. package/src/vendor/bootstrap-vue/src/components/table/helpers/mixin-thead.js +21 -6
  70. package/src/vendor/bootstrap-vue/src/components/tooltip/helpers/bv-popper.js +36 -13
  71. package/src/vendor/bootstrap-vue/src/components/tooltip/helpers/bv-tooltip-template.js +10 -3
  72. package/src/vendor/bootstrap-vue/src/components/transition/bv-transition.js +20 -5
  73. package/src/vendor/bootstrap-vue/src/components/transporter/transporter.js +22 -6
@@ -3,12 +3,11 @@ import { extend } from '../../../vue';
3
3
  import { NAME_POPPER } from '../../../constants/components';
4
4
  import { EVENT_NAME_SHOW, EVENT_NAME_SHOWN, EVENT_NAME_HIDE, EVENT_NAME_HIDDEN } from '../../../constants/events';
5
5
  import { onInstanceDestroy } from '../../../utils/on-instance-destroy';
6
- import { PROP_TYPE_NUMBER_STRING, PROP_TYPE_STRING, PROP_TYPE_ARRAY_STRING } from '../../../constants/props';
6
+ import { PROP_TYPE_NUMBER, PROP_TYPE_STRING, PROP_TYPE_ARRAY } from '../../../constants/props';
7
7
  import { HTMLElement, SVGElement } from '../../../constants/safe-types';
8
8
  import { useParentMixin } from '../../../mixins/use-parent';
9
9
  import { requestAF, select, getCS } from '../../../utils/dom';
10
10
  import { toFloat } from '../../../utils/number';
11
- import { makeProp } from '../../../utils/props';
12
11
  import { BVTransition } from '../../transition/bv-transition';
13
12
 
14
13
  // Base on-demand component for tooltip / popover templates
@@ -57,17 +56,45 @@ const OffsetMap = {
57
56
  const props = {
58
57
  // The minimum distance (in `px`) from the edge of the
59
58
  // tooltip/popover that the arrow can be positioned
60
- arrowPadding: makeProp(PROP_TYPE_NUMBER_STRING, 6),
59
+ arrowPadding: {
60
+ type: [PROP_TYPE_NUMBER, PROP_TYPE_STRING],
61
+ required: false,
62
+ default: 6
63
+ },
61
64
  // 'scrollParent', 'viewport', 'window', or `Element`
62
- boundary: makeProp([HTMLElement, PROP_TYPE_STRING], 'scrollParent'),
65
+ boundary: {
66
+ type: [HTMLElement, PROP_TYPE_STRING],
67
+ required: false,
68
+ default: 'scrollParent'
69
+ },
63
70
  // Tooltip/popover will try and stay away from
64
71
  // boundary edge by this many pixels
65
- boundaryPadding: makeProp(PROP_TYPE_NUMBER_STRING, 5),
66
- fallbackPlacement: makeProp(PROP_TYPE_ARRAY_STRING, 'flip'),
67
- offset: makeProp(PROP_TYPE_NUMBER_STRING, 0),
68
- placement: makeProp(PROP_TYPE_STRING, 'top'),
72
+ boundaryPadding: {
73
+ type: [PROP_TYPE_NUMBER, PROP_TYPE_STRING],
74
+ required: false,
75
+ default: 5
76
+ },
77
+ fallbackPlacement: {
78
+ type: [PROP_TYPE_ARRAY, PROP_TYPE_STRING],
79
+ required: false,
80
+ default: 'flip'
81
+ },
82
+ offset: {
83
+ type: [PROP_TYPE_NUMBER, PROP_TYPE_STRING],
84
+ required: false,
85
+ default: 0
86
+ },
87
+ placement: {
88
+ type: PROP_TYPE_STRING,
89
+ required: false,
90
+ default: 'top'
91
+ },
69
92
  // Element that the tooltip/popover is positioned relative to
70
- target: makeProp([HTMLElement, SVGElement])
93
+ target: {
94
+ type: [HTMLElement, SVGElement],
95
+ required: false,
96
+ default: undefined
97
+ }
71
98
  };
72
99
 
73
100
  // --- Main component ---
@@ -3,7 +3,6 @@ import { NAME_TOOLTIP_TEMPLATE } from '../../../constants/components';
3
3
  import { EVENT_NAME_MOUSEENTER, EVENT_NAME_MOUSELEAVE, EVENT_NAME_FOCUSIN, EVENT_NAME_FOCUSOUT } from '../../../constants/events';
4
4
  import { PROP_TYPE_BOOLEAN, PROP_TYPE_STRING } from '../../../constants/props';
5
5
  import { isFunction } from '../../../utils/inspect';
6
- import { makeProp } from '../../../utils/props';
7
6
  import { scopedStyleMixin } from '../../../mixins/scoped-style';
8
7
  import { BVPopper } from './bv-popper';
9
8
 
@@ -11,9 +10,17 @@ import { BVPopper } from './bv-popper';
11
10
 
12
11
  const props = {
13
12
  // Used only by the directive versions
14
- html: makeProp(PROP_TYPE_BOOLEAN, false),
13
+ html: {
14
+ type: PROP_TYPE_BOOLEAN,
15
+ required: false,
16
+ default: false
17
+ },
15
18
  // Other non-reactive (while open) props are pulled in from BVPopper
16
- id: makeProp(PROP_TYPE_STRING)
19
+ id: {
20
+ type: PROP_TYPE_STRING,
21
+ required: false,
22
+ default: undefined
23
+ }
17
24
  };
18
25
 
19
26
  // --- Main component ---
@@ -2,7 +2,6 @@ import { extend, mergeData } from '../../vue';
2
2
  import { NAME_TRANSITION } from '../../constants/components';
3
3
  import { PROP_TYPE_BOOLEAN, PROP_TYPE_STRING, PROP_TYPE_OBJECT } from '../../constants/props';
4
4
  import { isPlainObject } from '../../utils/inspect';
5
- import { makeProp } from '../../utils/props';
6
5
 
7
6
  // Generic Bootstrap v4 fade (no-fade) transition component
8
7
  //
@@ -32,14 +31,30 @@ const FADE_PROPS = {
32
31
 
33
32
  const props = {
34
33
  // Has no effect if `trans-props` provided
35
- appear: makeProp(PROP_TYPE_BOOLEAN, false),
34
+ appear: {
35
+ type: PROP_TYPE_BOOLEAN,
36
+ required: false,
37
+ default: false
38
+ },
36
39
  // Can be overridden by user supplied `trans-props`
37
- mode: makeProp(PROP_TYPE_STRING),
40
+ mode: {
41
+ type: PROP_TYPE_STRING,
42
+ required: false,
43
+ default: undefined
44
+ },
38
45
  // Only applicable to the built in transition
39
46
  // Has no effect if `trans-props` provided
40
- noFade: makeProp(PROP_TYPE_BOOLEAN, false),
47
+ noFade: {
48
+ type: PROP_TYPE_BOOLEAN,
49
+ required: false,
50
+ default: false
51
+ },
41
52
  // For user supplied transitions (if needed)
42
- transProps: makeProp(PROP_TYPE_OBJECT)
53
+ transProps: {
54
+ type: PROP_TYPE_OBJECT,
55
+ required: false,
56
+ default: undefined
57
+ }
43
58
  };
44
59
  const hasAnimateSupport = typeof Element !== 'undefined' && Boolean(Element.prototype.animate);
45
60
 
@@ -1,14 +1,13 @@
1
1
  import { extend, isVue3 } from '../../vue';
2
- import { NAME_TRANSPORTER_TARGET, NAME_TRANSPORTER } from '../../constants/components';
2
+ import { NAME_TRANSPORTER, NAME_TRANSPORTER_TARGET } from '../../constants/components';
3
3
  import { IS_BROWSER } from '../../constants/env';
4
- import { PROP_TYPE_ARRAY_FUNCTION, PROP_TYPE_STRING, PROP_TYPE_BOOLEAN } from '../../constants/props';
4
+ import { PROP_TYPE_STRING, PROP_TYPE_BOOLEAN, PROP_TYPE_ARRAY, PROP_TYPE_FUNCTION } from '../../constants/props';
5
5
  import { HTMLElement } from '../../constants/safe-types';
6
6
  import { concat } from '../../utils/array';
7
- import { removeNode, select } from '../../utils/dom';
7
+ import { select, removeNode } from '../../utils/dom';
8
8
  import { identity } from '../../utils/identity';
9
- import { isFunction, isString } from '../../utils/inspect';
9
+ import { isString, isFunction } from '../../utils/inspect';
10
10
  import { normalizeSlotMixin } from '../../mixins/normalize-slot';
11
- import { makeProp } from '../../utils/props';
12
11
  import { createNewChildComponent } from '../../utils/create-new-child-component';
13
12
 
14
13
  // --- Helper components ---
@@ -36,7 +35,11 @@ const BVTransporterTarget = /*#__PURE__*/extend({
36
35
  props: {
37
36
  // Even though we only support a single root element,
38
37
  // VNodes are always passed as an array
39
- nodes: makeProp(PROP_TYPE_ARRAY_FUNCTION)
38
+ nodes: {
39
+ type: [PROP_TYPE_ARRAY, PROP_TYPE_FUNCTION],
40
+ required: false,
41
+ default: undefined
42
+ }
40
43
  },
41
44
  data: vm => {
42
45
  return {
@@ -67,10 +70,22 @@ const props = {
67
70
  // String: CSS selector,
68
71
  // HTMLElement: Element reference
69
72
  // Mainly needed for tooltips/popovers inside modals
70
- container: makeProp([HTMLElement, PROP_TYPE_STRING], 'body'),
71
- disabled: makeProp(PROP_TYPE_BOOLEAN, false),
73
+ container: {
74
+ type: [HTMLElement, PROP_TYPE_STRING],
75
+ required: false,
76
+ default: 'body'
77
+ },
78
+ disabled: {
79
+ type: PROP_TYPE_BOOLEAN,
80
+ required: false,
81
+ default: false
82
+ },
72
83
  // This should be set to match the root element type
73
- tag: makeProp(PROP_TYPE_STRING, 'div')
84
+ tag: {
85
+ type: PROP_TYPE_STRING,
86
+ required: false,
87
+ default: 'div'
88
+ }
74
89
  };
75
90
 
76
91
  // --- Main component ---
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gitlab/ui",
3
- "version": "132.0.2",
3
+ "version": "132.1.0",
4
4
  "description": "GitLab UI Components",
5
5
  "license": "MIT",
6
6
  "main": "dist/index.js",
@@ -71,7 +71,7 @@
71
71
  "dependencies": {
72
72
  "@floating-ui/dom": "1.7.6",
73
73
  "echarts": "^5.6.0",
74
- "gridstack": "^12.4.2",
74
+ "gridstack": "^12.6.0",
75
75
  "iframe-resizer": "^4.4.5",
76
76
  "lodash-es": "^4.18.1",
77
77
  "popper.js": "^1.16.1",
@@ -2,8 +2,8 @@
2
2
  import { isFunction, isString, isObject, toString, isBoolean, concat } from 'lodash-es';
3
3
  import { SafeLinkDirective, isExternalURL } from '../../../directives/safe_link/safe_link';
4
4
  import { stopEvent } from '../../../utils/utils';
5
+ import { buildQueryString } from '../../../utils/url_utils';
5
6
  import { isVue3, safeVueInstance } from '../../../utils/vue_utils';
6
- import { stringifyQueryObj } from '../../../vendor/bootstrap-vue/src/utils/router';
7
7
  import {
8
8
  linkVariantOptions,
9
9
  linkVariantInline,
@@ -187,7 +187,7 @@ export default {
187
187
  // Fallback to `to.path' + `to.query` + `to.hash` prop (if `to` is an object)
188
188
  if (isObject(to) && (to.path || to.query || to.hash)) {
189
189
  const path = toString(to.path);
190
- const query = stringifyQueryObj(to.query);
190
+ const query = buildQueryString(to.query);
191
191
  let hash = toString(to.hash);
192
192
  hash = !hash || hash.charAt(0) === '#' ? hash : `#${hash}`;
193
193
  return `${path}${query}${hash}` || fallback;
@@ -1,4 +1,5 @@
1
1
  <script>
2
+ import { markRaw } from 'vue';
2
3
  import { GridStack } from 'gridstack';
3
4
  import { pickBy } from 'lodash-es';
4
5
  import { breakpoints } from '../../../../utils/breakpoints';
@@ -65,7 +66,6 @@ export default {
65
66
  },
66
67
  data() {
67
68
  return {
68
- grid: undefined,
69
69
  gridPanels: [],
70
70
  };
71
71
  },
@@ -164,24 +164,26 @@ export default {
164
164
  },
165
165
  initGridStack() {
166
166
  // See https://github.com/gridstack/gridstack.js/tree/master/doc#grid-options
167
- this.grid = GridStack.init(
168
- {
169
- // Uniform gap between panels
170
- margin: '8px',
171
- // CSS Selector for finding the drag handle element
172
- handle: '.grid-stack-item-handle',
173
- // Setting 1 in minRow prevents the grid collapsing when all panels are removed
174
- minRow: 1,
175
- // Define the number of columns for anything below a set width, defaults to fill the available space
176
- columnOpts: { breakpoints: [{ w: breakpoints.md, c: 1 }] },
177
- cellHeight: this.cellHeight,
178
- alwaysShowResizeHandle: true,
179
- animate: true,
180
- float: true,
181
- // Toggles user-customization of grid layout
182
- staticGrid: this.isStaticGrid,
183
- },
184
- this.$refs.grid,
167
+ this.grid = markRaw(
168
+ GridStack.init(
169
+ {
170
+ // Uniform gap between panels
171
+ margin: '8px',
172
+ // CSS Selector for finding the drag handle element
173
+ handle: '.grid-stack-item-handle',
174
+ // Setting 1 in minRow prevents the grid collapsing when all panels are removed
175
+ minRow: 1,
176
+ // Define the number of columns for anything below a set width, defaults to fill the available space
177
+ columnOpts: { breakpoints: [{ w: breakpoints.md, c: 1 }] },
178
+ cellHeight: this.cellHeight,
179
+ alwaysShowResizeHandle: true,
180
+ animate: true,
181
+ float: true,
182
+ // Toggles user-customization of grid layout
183
+ staticGrid: this.isStaticGrid,
184
+ },
185
+ this.$refs.grid,
186
+ ),
185
187
  ).load(this.gridConfig);
186
188
 
187
189
  // Sync Vue components array with gridstack items
@@ -0,0 +1,66 @@
1
+ const RX_ENCODE_REVERSE = /[!'()*]/g;
2
+ const RX_ENCODED_COMMA = /%2C/g;
3
+
4
+ const encodeReserveReplacer = (c) => `%${c.charCodeAt(0).toString(16)}`;
5
+
6
+ const encode = (str) =>
7
+ encodeURIComponent(String(str))
8
+ .replace(RX_ENCODE_REVERSE, encodeReserveReplacer)
9
+ .replace(RX_ENCODED_COMMA, ',');
10
+
11
+ /**
12
+ * Converts a query parameter object into a URL query string prefixed with `?`.
13
+ *
14
+ * Uses RFC 3986-compliant encoding which additionally escapes `[!'()*]` and preserves commas,
15
+ * unlike `URLSearchParams` which cannot represent key-only params (`?foo`) or skip `undefined` values.
16
+ *
17
+ * - `undefined` values are omitted entirely.
18
+ * - `null` values produce key-only entries (e.g., `?foo`).
19
+ * - Array values repeat the key for each element (e.g., `?bar=a&bar=b`).
20
+ *
21
+ * @param {Object<string, string | number | null | undefined | Array<string | number | null | undefined>>} obj
22
+ * An object whose keys are query parameter names and values are parameter values.
23
+ * @returns {string} A query string prefixed with `?`, or an empty string if the input
24
+ * is not a plain object or produces no parameters.
25
+ *
26
+ * @example
27
+ * buildQueryString({ page: 1, search: 'hello world' })
28
+ * // => '?page=1&search=hello%20world'
29
+ *
30
+ * @example
31
+ * buildQueryString({ foo: null, bar: undefined })
32
+ * // => '?foo'
33
+ */
34
+ export const buildQueryString = (obj) => {
35
+ if (obj === null || typeof obj !== 'object' || Array.isArray(obj)) {
36
+ return '';
37
+ }
38
+
39
+ const query = Object.keys(obj)
40
+ .map((key) => {
41
+ const value = obj[key];
42
+ if (value === undefined) {
43
+ return '';
44
+ }
45
+ if (value === null) {
46
+ return encode(key);
47
+ }
48
+ if (Array.isArray(value)) {
49
+ return value
50
+ .reduce((results, item) => {
51
+ if (item === null) {
52
+ results.push(encode(key));
53
+ } else if (item !== undefined) {
54
+ results.push(`${encode(key)}=${encode(item)}`);
55
+ }
56
+ return results;
57
+ }, [])
58
+ .join('&');
59
+ }
60
+ return `${encode(key)}=${encode(value)}`;
61
+ })
62
+ .filter((x) => x.length > 0)
63
+ .join('&');
64
+
65
+ return query ? `?${query}` : '';
66
+ };
@@ -1,13 +1,16 @@
1
1
  import { extend, mergeData } from '../../vue'
2
2
  import { NAME_DROPDOWN_DIVIDER } from '../../constants/components'
3
3
  import { PROP_TYPE_STRING } from '../../constants/props'
4
- import { makeProp } from '../../utils/props'
5
4
  import { omit } from '../../utils/object'
6
5
 
7
6
  // --- Props ---
8
7
 
9
8
  export const props = {
10
- tag: makeProp(PROP_TYPE_STRING, 'hr')
9
+ tag: {
10
+ type: PROP_TYPE_STRING,
11
+ required: false,
12
+ default: 'hr'
13
+ }
11
14
  }
12
15
 
13
16
  // --- Main component ---
@@ -1,16 +1,28 @@
1
1
  import { extend, mergeData } from '../../vue'
2
2
  import { NAME_DROPDOWN_FORM } from '../../constants/components'
3
- import { PROP_TYPE_ARRAY_OBJECT_STRING, PROP_TYPE_BOOLEAN } from '../../constants/props'
3
+ import {
4
+ PROP_TYPE_ARRAY,
5
+ PROP_TYPE_BOOLEAN,
6
+ PROP_TYPE_OBJECT,
7
+ PROP_TYPE_STRING
8
+ } from '../../constants/props'
4
9
  import { omit, sortKeys } from '../../utils/object'
5
- import { makeProp } from '../../utils/props'
6
10
  import { BForm, props as formControlProps } from '../form/form'
7
11
 
8
12
  // --- Props ---
9
13
 
10
14
  export const props = sortKeys({
11
15
  ...formControlProps,
12
- disabled: makeProp(PROP_TYPE_BOOLEAN, false),
13
- formClass: makeProp(PROP_TYPE_ARRAY_OBJECT_STRING)
16
+ disabled: {
17
+ type: PROP_TYPE_BOOLEAN,
18
+ required: false,
19
+ default: false
20
+ },
21
+ formClass: {
22
+ type: [PROP_TYPE_ARRAY, PROP_TYPE_OBJECT, PROP_TYPE_STRING],
23
+ required: false,
24
+ default: undefined
25
+ }
14
26
  })
15
27
 
16
28
  // --- Main component ---
@@ -1,22 +1,45 @@
1
1
  import { extend, mergeData } from '../../vue'
2
2
  import { NAME_DROPDOWN_GROUP } from '../../constants/components'
3
- import { PROP_TYPE_ARRAY_OBJECT_STRING, PROP_TYPE_STRING } from '../../constants/props'
3
+ import { PROP_TYPE_ARRAY, PROP_TYPE_OBJECT, PROP_TYPE_STRING } from '../../constants/props'
4
4
  import { SLOT_NAME_DEFAULT, SLOT_NAME_HEADER } from '../../constants/slots'
5
5
  import { isTag } from '../../utils/dom'
6
6
  import { identity } from '../../utils/identity'
7
7
  import { hasNormalizedSlot, normalizeSlot } from '../../utils/normalize-slot'
8
8
  import { omit } from '../../utils/object'
9
- import { makeProp } from '../../utils/props'
10
9
 
11
10
  // --- Props ---
12
11
 
13
12
  export const props = {
14
- ariaDescribedby: makeProp(PROP_TYPE_STRING),
15
- header: makeProp(PROP_TYPE_STRING),
16
- headerClasses: makeProp(PROP_TYPE_ARRAY_OBJECT_STRING),
17
- headerTag: makeProp(PROP_TYPE_STRING, 'header'),
18
- headerVariant: makeProp(PROP_TYPE_STRING),
19
- id: makeProp(PROP_TYPE_STRING)
13
+ ariaDescribedby: {
14
+ type: PROP_TYPE_STRING,
15
+ required: false,
16
+ default: undefined
17
+ },
18
+ header: {
19
+ type: PROP_TYPE_STRING,
20
+ required: false,
21
+ default: undefined
22
+ },
23
+ headerClasses: {
24
+ type: [PROP_TYPE_ARRAY, PROP_TYPE_OBJECT, PROP_TYPE_STRING],
25
+ required: false,
26
+ default: undefined
27
+ },
28
+ headerTag: {
29
+ type: PROP_TYPE_STRING,
30
+ required: false,
31
+ default: 'header'
32
+ },
33
+ headerVariant: {
34
+ type: PROP_TYPE_STRING,
35
+ required: false,
36
+ default: undefined
37
+ },
38
+ id: {
39
+ type: PROP_TYPE_STRING,
40
+ required: false,
41
+ default: undefined
42
+ }
20
43
  }
21
44
 
22
45
  // --- Main component ---
@@ -3,14 +3,25 @@ import { NAME_DROPDOWN_HEADER } from '../../constants/components'
3
3
  import { PROP_TYPE_STRING } from '../../constants/props'
4
4
  import { isTag } from '../../utils/dom'
5
5
  import { omit } from '../../utils/object'
6
- import { makeProp } from '../../utils/props'
7
6
 
8
7
  // --- Props ---
9
8
 
10
9
  export const props = {
11
- id: makeProp(PROP_TYPE_STRING),
12
- tag: makeProp(PROP_TYPE_STRING, 'header'),
13
- variant: makeProp(PROP_TYPE_STRING)
10
+ id: {
11
+ type: PROP_TYPE_STRING,
12
+ required: false,
13
+ default: undefined
14
+ },
15
+ tag: {
16
+ type: PROP_TYPE_STRING,
17
+ required: false,
18
+ default: 'header'
19
+ },
20
+ variant: {
21
+ type: PROP_TYPE_STRING,
22
+ required: false,
23
+ default: undefined
24
+ }
14
25
  }
15
26
 
16
27
  // --- Main component ---
@@ -2,23 +2,47 @@ import { extend } from '../../vue'
2
2
  import { NAME_DROPDOWN_ITEM_BUTTON } from '../../constants/components'
3
3
  import { EVENT_NAME_CLICK } from '../../constants/events'
4
4
  import {
5
- PROP_TYPE_ARRAY_OBJECT_STRING,
5
+ PROP_TYPE_ARRAY,
6
6
  PROP_TYPE_BOOLEAN,
7
+ PROP_TYPE_OBJECT,
7
8
  PROP_TYPE_STRING
8
9
  } from '../../constants/props'
9
- import { makeProp } from '../../utils/props'
10
10
  import { attrsMixin } from '../../mixins/attrs'
11
11
  import { normalizeSlotMixin } from '../../mixins/normalize-slot'
12
12
 
13
13
  // --- Props ---
14
14
 
15
15
  export const props = {
16
- active: makeProp(PROP_TYPE_BOOLEAN, false),
17
- activeClass: makeProp(PROP_TYPE_STRING, 'active'),
18
- buttonClass: makeProp(PROP_TYPE_ARRAY_OBJECT_STRING),
19
- disabled: makeProp(PROP_TYPE_BOOLEAN, false),
20
- variant: makeProp(PROP_TYPE_STRING),
21
- role: makeProp(PROP_TYPE_STRING, 'menuitem')
16
+ active: {
17
+ type: PROP_TYPE_BOOLEAN,
18
+ required: false,
19
+ default: false
20
+ },
21
+ activeClass: {
22
+ type: PROP_TYPE_STRING,
23
+ required: false,
24
+ default: 'active'
25
+ },
26
+ buttonClass: {
27
+ type: [PROP_TYPE_ARRAY, PROP_TYPE_OBJECT, PROP_TYPE_STRING],
28
+ required: false,
29
+ default: undefined
30
+ },
31
+ disabled: {
32
+ type: PROP_TYPE_BOOLEAN,
33
+ required: false,
34
+ default: false
35
+ },
36
+ variant: {
37
+ type: PROP_TYPE_STRING,
38
+ required: false,
39
+ default: undefined
40
+ },
41
+ role: {
42
+ type: PROP_TYPE_STRING,
43
+ required: false,
44
+ default: 'menuitem'
45
+ }
22
46
  }
23
47
 
24
48
  // --- Main component ---
@@ -1,19 +1,46 @@
1
1
  import { extend, mergeData } from '../../vue'
2
2
  import { NAME_FORM_INVALID_FEEDBACK } from '../../constants/components'
3
3
  import { PROP_TYPE_BOOLEAN, PROP_TYPE_STRING } from '../../constants/props'
4
- import { makeProp } from '../../utils/props'
5
4
 
6
5
  // --- Props ---
7
6
 
8
7
  export const props = {
9
- ariaLive: makeProp(PROP_TYPE_STRING),
10
- forceShow: makeProp(PROP_TYPE_BOOLEAN, false),
11
- id: makeProp(PROP_TYPE_STRING),
12
- role: makeProp(PROP_TYPE_STRING),
8
+ ariaLive: {
9
+ type: PROP_TYPE_STRING,
10
+ required: false,
11
+ default: undefined
12
+ },
13
+ forceShow: {
14
+ type: PROP_TYPE_BOOLEAN,
15
+ required: false,
16
+ default: false
17
+ },
18
+ id: {
19
+ type: PROP_TYPE_STRING,
20
+ required: false,
21
+ default: undefined
22
+ },
23
+ role: {
24
+ type: PROP_TYPE_STRING,
25
+ required: false,
26
+ default: undefined
27
+ },
13
28
  // Tri-state prop: `true`, `false`, or `null`
14
- state: makeProp(PROP_TYPE_BOOLEAN, null),
15
- tag: makeProp(PROP_TYPE_STRING, 'div'),
16
- tooltip: makeProp(PROP_TYPE_BOOLEAN, false)
29
+ state: {
30
+ type: PROP_TYPE_BOOLEAN,
31
+ required: false,
32
+ default: null
33
+ },
34
+ tag: {
35
+ type: PROP_TYPE_STRING,
36
+ required: false,
37
+ default: 'div'
38
+ },
39
+ tooltip: {
40
+ type: PROP_TYPE_BOOLEAN,
41
+ required: false,
42
+ default: false
43
+ }
17
44
  }
18
45
 
19
46
  // --- Main component ---
@@ -1,19 +1,46 @@
1
1
  import { extend, mergeData } from '../../vue'
2
2
  import { NAME_FORM_VALID_FEEDBACK } from '../../constants/components'
3
3
  import { PROP_TYPE_BOOLEAN, PROP_TYPE_STRING } from '../../constants/props'
4
- import { makeProp } from '../../utils/props'
5
4
 
6
5
  // --- Props ---
7
6
 
8
7
  export const props = {
9
- ariaLive: makeProp(PROP_TYPE_STRING),
10
- forceShow: makeProp(PROP_TYPE_BOOLEAN, false),
11
- id: makeProp(PROP_TYPE_STRING),
12
- role: makeProp(PROP_TYPE_STRING),
8
+ ariaLive: {
9
+ type: PROP_TYPE_STRING,
10
+ required: false,
11
+ default: undefined
12
+ },
13
+ forceShow: {
14
+ type: PROP_TYPE_BOOLEAN,
15
+ required: false,
16
+ default: false
17
+ },
18
+ id: {
19
+ type: PROP_TYPE_STRING,
20
+ required: false,
21
+ default: undefined
22
+ },
23
+ role: {
24
+ type: PROP_TYPE_STRING,
25
+ required: false,
26
+ default: undefined
27
+ },
13
28
  // Tri-state prop: `true`, `false`, or `null`
14
- state: makeProp(PROP_TYPE_BOOLEAN, null),
15
- tag: makeProp(PROP_TYPE_STRING, 'div'),
16
- tooltip: makeProp(PROP_TYPE_BOOLEAN, false)
29
+ state: {
30
+ type: PROP_TYPE_BOOLEAN,
31
+ required: false,
32
+ default: null
33
+ },
34
+ tag: {
35
+ type: PROP_TYPE_STRING,
36
+ required: false,
37
+ default: 'div'
38
+ },
39
+ tooltip: {
40
+ type: PROP_TYPE_BOOLEAN,
41
+ required: false,
42
+ default: false
43
+ }
17
44
  }
18
45
 
19
46
  // --- Main component ---