@gitlab/ui 132.0.3 → 132.2.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/dist/components/base/accordion/accordion_item.js +1 -3
- package/dist/components/base/avatar/avatar.js +76 -5
- package/dist/components/base/badge/badge.js +5 -7
- package/dist/components/base/button/button.js +1 -3
- package/dist/components/base/collapse/collapse.js +2 -6
- package/dist/components/base/datepicker/datepicker.js +4 -5
- package/dist/components/base/daterange_picker/daterange_picker.js +2 -4
- package/dist/components/base/dropdown/dropdown_item.js +3 -4
- package/dist/components/base/filtered_search/filtered_search.js +55 -7
- package/dist/components/base/filtered_search/filtered_search_token.js +6 -14
- package/dist/components/base/filtered_search/filtered_search_token_segment.js +39 -19
- package/dist/components/base/filtered_search/filtered_search_utils.js +57 -7
- package/dist/components/base/form/form_checkbox/form_checkbox.js +13 -26
- package/dist/components/base/form/form_checkbox/form_checkbox_group.js +1 -3
- package/dist/components/base/form/form_fields/form_fields_loop.js +57 -6
- package/dist/components/base/form/form_group/form_group.js +1 -3
- package/dist/components/base/form/form_input/form_input.js +95 -41
- package/dist/components/base/form/form_input_group/form_input_group.js +2 -4
- package/dist/components/base/form/form_radio/form_radio.js +5 -9
- package/dist/components/base/form/form_radio_group/form_radio_group.js +1 -3
- package/dist/components/base/form/form_select/form_select.js +76 -5
- package/dist/components/base/infinite_scroll/infinite_scroll.js +7 -14
- package/dist/components/base/link/link.js +26 -7
- package/dist/components/base/new_dropdowns/base_dropdown/base_dropdown.js +93 -32
- package/dist/components/base/new_dropdowns/disclosure/disclosure_dropdown.js +2 -6
- package/dist/components/base/new_dropdowns/disclosure/disclosure_dropdown_item.js +2 -6
- package/dist/components/base/new_dropdowns/listbox/listbox.js +5 -13
- package/dist/components/base/new_dropdowns/listbox/listbox_item.js +1 -3
- package/dist/components/base/new_dropdowns/listbox/mock_data.js +2 -6
- package/dist/components/base/new_dropdowns/listbox/utils.js +6 -11
- package/dist/components/base/path/path.js +1 -5
- package/dist/components/base/search_box_by_type/search_box_by_type.js +2 -6
- package/dist/components/base/skeleton_loader/skeleton_loader.js +3 -5
- package/dist/components/base/table/table.js +32 -21
- package/dist/components/base/table_lite/table_lite.js +1 -3
- package/dist/components/base/tabs/tab/tab.js +1 -3
- package/dist/components/base/tabs/tabs/scrollable_tabs.js +1 -5
- package/dist/components/base/token_selector/token_selector.js +2 -6
- package/dist/components/charts/area/area.js +6 -7
- package/dist/components/charts/column/column.js +11 -15
- package/dist/components/charts/discrete_scatter/discrete_scatter.js +57 -5
- package/dist/components/charts/gauge/gauge.js +13 -21
- package/dist/components/charts/heatmap/heatmap.js +66 -18
- package/dist/components/charts/legend/legend.js +59 -13
- package/dist/components/charts/line/line.js +6 -7
- package/dist/components/charts/shared/tooltip/tooltip.js +11 -18
- package/dist/components/charts/sparkline/sparkline.js +72 -19
- package/dist/components/charts/stacked_column/stacked_column.js +18 -31
- package/dist/components/dashboards/dashboard_layout/grid_layout/grid_layout.js +40 -24
- package/dist/components/utilities/friendly_wrap/friendly_wrap.js +3 -7
- package/dist/components/utilities/intersperse/intersperse.js +6 -11
- package/dist/components/utilities/sprintf/sprintf.js +58 -7
- package/dist/components/utilities/truncate/truncate.js +2 -4
- package/dist/components/utilities/truncate_text/truncate_text.js +1 -3
- package/dist/config.js +3 -4
- package/dist/directives/hover_load/hover_load.js +1 -3
- package/dist/directives/outside/outside.js +9 -16
- package/dist/directives/resize_observer/resize_observer.js +6 -8
- package/dist/directives/safe_html/safe_html.js +1 -3
- package/dist/directives/safe_link/safe_link.js +11 -14
- package/dist/index.css +2 -2
- package/dist/index.css.map +1 -1
- package/dist/tokens/build/js/tokens.dark.js +95 -95
- package/dist/tokens/build/js/tokens.js +74 -74
- package/dist/tokens/common_story_options.js +7 -8
- package/dist/utils/charts/config.js +122 -90
- package/dist/utils/constants.js +26 -1
- package/dist/utils/data_utils.js +28 -1
- package/dist/utils/form_options_utils.js +4 -6
- package/dist/utils/is_slot_empty.js +3 -5
- package/dist/utils/stories_utils.js +8 -8
- package/dist/utils/use_mock_intersection_observer.js +63 -12
- package/dist/utils/utils.js +76 -19
- package/dist/vendor/bootstrap-vue/src/components/button/button-close.js +8 -11
- package/dist/vendor/bootstrap-vue/src/components/button/button.js +12 -17
- package/dist/vendor/bootstrap-vue/src/components/dropdown/dropdown-divider.js +3 -6
- package/dist/vendor/bootstrap-vue/src/components/dropdown/dropdown-form.js +6 -9
- package/dist/vendor/bootstrap-vue/src/components/dropdown/dropdown-group.js +14 -19
- package/dist/vendor/bootstrap-vue/src/components/dropdown/dropdown-header.js +8 -13
- package/dist/vendor/bootstrap-vue/src/components/dropdown/dropdown-item-button.js +9 -12
- package/dist/vendor/bootstrap-vue/src/components/dropdown/dropdown-item.js +8 -11
- package/dist/vendor/bootstrap-vue/src/components/dropdown/dropdown-text.js +9 -14
- package/dist/vendor/bootstrap-vue/src/components/dropdown/dropdown.js +34 -43
- package/dist/vendor/bootstrap-vue/src/components/form/form-invalid-feedback.js +5 -9
- package/dist/vendor/bootstrap-vue/src/components/form/form-text.js +7 -10
- package/dist/vendor/bootstrap-vue/src/components/form/form-valid-feedback.js +5 -9
- package/dist/vendor/bootstrap-vue/src/components/form/form.js +7 -10
- package/dist/vendor/bootstrap-vue/src/components/form-group/form-group.js +77 -33
- package/dist/vendor/bootstrap-vue/src/components/form-select/form-select-option-group.js +6 -11
- package/dist/vendor/bootstrap-vue/src/components/form-select/form-select-option.js +6 -12
- package/dist/vendor/bootstrap-vue/src/components/form-select/form-select.js +28 -29
- package/dist/vendor/bootstrap-vue/src/components/form-textarea/form-textarea.js +7 -10
- package/dist/vendor/bootstrap-vue/src/components/layout/col.js +7 -11
- package/dist/vendor/bootstrap-vue/src/components/layout/form-row.js +3 -5
- package/dist/vendor/bootstrap-vue/src/components/link/link.js +19 -31
- package/dist/vendor/bootstrap-vue/src/components/modal/helpers/modal-manager.js +3 -4
- package/dist/vendor/bootstrap-vue/src/components/modal/modal.js +59 -68
- package/dist/vendor/bootstrap-vue/src/components/popover/helpers/bv-popover-template.js +2 -4
- package/dist/vendor/bootstrap-vue/src/components/popover/popover.js +4 -5
- package/dist/vendor/bootstrap-vue/src/components/table/helpers/default-sort-compare.js +11 -7
- package/dist/vendor/bootstrap-vue/src/components/table/helpers/mixin-bottom-row.js +4 -6
- package/dist/vendor/bootstrap-vue/src/components/table/helpers/mixin-busy.js +3 -6
- package/dist/vendor/bootstrap-vue/src/components/table/helpers/mixin-caption.js +4 -7
- package/dist/vendor/bootstrap-vue/src/components/table/helpers/mixin-colgroup.js +1 -3
- package/dist/vendor/bootstrap-vue/src/components/table/helpers/mixin-empty.js +16 -20
- package/dist/vendor/bootstrap-vue/src/components/table/helpers/mixin-filtering.js +14 -25
- package/dist/vendor/bootstrap-vue/src/components/table/helpers/mixin-items.js +23 -35
- package/dist/vendor/bootstrap-vue/src/components/table/helpers/mixin-pagination.js +6 -8
- package/dist/vendor/bootstrap-vue/src/components/table/helpers/mixin-provider.js +8 -10
- package/dist/vendor/bootstrap-vue/src/components/table/helpers/mixin-selectable.js +8 -15
- package/dist/vendor/bootstrap-vue/src/components/table/helpers/mixin-sorting.js +33 -41
- package/dist/vendor/bootstrap-vue/src/components/table/helpers/mixin-stacked.js +3 -8
- package/dist/vendor/bootstrap-vue/src/components/table/helpers/mixin-table-renderer.js +38 -50
- package/dist/vendor/bootstrap-vue/src/components/table/helpers/mixin-tbody-row.js +19 -31
- package/dist/vendor/bootstrap-vue/src/components/table/helpers/mixin-tbody.js +13 -23
- package/dist/vendor/bootstrap-vue/src/components/table/helpers/mixin-tfoot.js +5 -6
- package/dist/vendor/bootstrap-vue/src/components/table/helpers/mixin-thead.js +17 -21
- package/dist/vendor/bootstrap-vue/src/components/table/helpers/mixin-top-row.js +4 -6
- package/dist/vendor/bootstrap-vue/src/components/table/helpers/sanitize-row.js +1 -3
- package/dist/vendor/bootstrap-vue/src/components/table/tbody.js +3 -6
- package/dist/vendor/bootstrap-vue/src/components/table/td.js +9 -14
- package/dist/vendor/bootstrap-vue/src/components/table/tfoot.js +1 -2
- package/dist/vendor/bootstrap-vue/src/components/table/thead.js +1 -2
- package/dist/vendor/bootstrap-vue/src/components/table/tr.js +2 -5
- package/dist/vendor/bootstrap-vue/src/components/tabs/tab.js +19 -36
- package/dist/vendor/bootstrap-vue/src/components/tabs/tabs.js +66 -81
- package/dist/vendor/bootstrap-vue/src/components/tooltip/helpers/bv-popper.js +2 -6
- package/dist/vendor/bootstrap-vue/src/components/tooltip/helpers/bv-tooltip-template.js +5 -11
- package/dist/vendor/bootstrap-vue/src/components/tooltip/helpers/bv-tooltip.js +8 -14
- package/dist/vendor/bootstrap-vue/src/components/tooltip/tooltip.js +19 -22
- package/dist/vendor/bootstrap-vue/src/components/transition/bv-transition.js +7 -10
- package/dist/vendor/bootstrap-vue/src/components/transporter/transporter.js +7 -14
- package/dist/vendor/bootstrap-vue/src/directives/modal/modal.js +4 -5
- package/dist/vendor/bootstrap-vue/src/directives/visible/visible.js +5 -9
- package/dist/vendor/bootstrap-vue/src/mixins/dropdown.js +17 -29
- package/dist/vendor/bootstrap-vue/src/mixins/form-control.js +6 -7
- package/dist/vendor/bootstrap-vue/src/mixins/form-custom.js +1 -2
- package/dist/vendor/bootstrap-vue/src/mixins/form-options.js +5 -6
- package/dist/vendor/bootstrap-vue/src/mixins/form-size.js +1 -2
- package/dist/vendor/bootstrap-vue/src/mixins/form-state.js +1 -2
- package/dist/vendor/bootstrap-vue/src/mixins/form-text.js +29 -43
- package/dist/vendor/bootstrap-vue/src/mixins/id.js +1 -2
- package/dist/vendor/bootstrap-vue/src/utils/create-new-child-component.js +62 -15
- package/dist/vendor/bootstrap-vue/src/utils/dom.js +3 -9
- package/dist/vendor/bootstrap-vue/src/utils/events.js +7 -5
- package/dist/vendor/bootstrap-vue/src/utils/plugins.js +4 -5
- package/dist/vendor/bootstrap-vue/src/utils/router.js +9 -13
- package/package.json +10 -8
- package/src/components/dashboards/dashboard_layout/grid_layout/grid_layout.vue +21 -19
- package/src/scss/gitlab_ui.scss +3 -0
- package/src/scss/storybook.scss +3 -0
- package/src/scss/themes.scss +84 -0
- package/src/tokens/build/css/tokens.css +142 -142
- package/src/tokens/build/css/tokens.dark.css +138 -138
- package/src/tokens/build/docs/tokens-tailwind-docs.dark.json +580 -580
- package/src/tokens/build/docs/tokens-tailwind-docs.json +495 -495
- package/src/tokens/build/figma/constants.dark.json +799 -799
- package/src/tokens/build/figma/constants.json +799 -799
- package/src/tokens/build/js/tokens.dark.js +95 -95
- package/src/tokens/build/js/tokens.js +74 -74
- package/src/tokens/build/json/tokens.dark.json +1668 -1668
- package/src/tokens/build/json/tokens.json +1647 -1647
- package/src/tokens/build/scss/_tokens.dark.scss +138 -138
- package/src/tokens/build/scss/_tokens.scss +142 -142
- package/src/tokens/build/scss/_tokens_custom_properties.scss +73 -73
- package/src/tokens/constant/color.blue.tokens.json +182 -0
- package/src/tokens/constant/color.brand.tokens.json +252 -0
- package/src/tokens/constant/color.data.tokens.json +894 -0
- package/src/tokens/constant/color.green.tokens.json +182 -0
- package/src/tokens/constant/color.neutral.tokens.json +230 -0
- package/src/tokens/constant/color.orange.tokens.json +182 -0
- package/src/tokens/constant/color.purple.tokens.json +182 -0
- package/src/tokens/constant/color.red.tokens.json +182 -0
- package/src/tokens/constant/color.theme.tokens.json +1168 -0
- package/src/tokens/deprecated/deprecated.color.tokens.json +134 -1340
- package/src/utils/constants.js +9 -0
- package/src/vendor/bootstrap-vue/src/components/button/button-close.js +4 -5
- package/src/vendor/bootstrap-vue/src/components/button/button.js +7 -8
- package/src/vendor/bootstrap-vue/src/components/dropdown/dropdown-divider.js +1 -2
- package/src/vendor/bootstrap-vue/src/components/dropdown/dropdown-form.js +2 -8
- package/src/vendor/bootstrap-vue/src/components/dropdown/dropdown-group.js +6 -7
- package/src/vendor/bootstrap-vue/src/components/dropdown/dropdown-header.js +3 -4
- package/src/vendor/bootstrap-vue/src/components/dropdown/dropdown-item-button.js +6 -12
- package/src/vendor/bootstrap-vue/src/components/dropdown/dropdown-item.js +2 -3
- package/src/vendor/bootstrap-vue/src/components/dropdown/dropdown-text.js +3 -4
- package/src/vendor/bootstrap-vue/src/components/dropdown/dropdown.js +19 -26
- package/src/vendor/bootstrap-vue/src/components/form/form-text.js +4 -6
- package/src/vendor/bootstrap-vue/src/components/form/form.js +4 -6
- package/src/vendor/bootstrap-vue/src/components/form-group/form-group.js +66 -19
- package/src/vendor/bootstrap-vue/src/components/form-select/form-select-option-group.js +1 -2
- package/src/vendor/bootstrap-vue/src/components/form-select/form-select-option.js +1 -4
- package/src/vendor/bootstrap-vue/src/components/form-select/form-select.js +13 -14
- package/src/vendor/bootstrap-vue/src/components/form-textarea/form-textarea.js +5 -6
- package/src/vendor/bootstrap-vue/src/components/modal/modal.js +53 -62
- package/src/vendor/bootstrap-vue/src/components/popover/popover.js +4 -10
- package/src/vendor/bootstrap-vue/src/components/table/helpers/mixin-busy.js +1 -2
- package/src/vendor/bootstrap-vue/src/components/table/helpers/mixin-caption.js +2 -3
- package/src/vendor/bootstrap-vue/src/components/table/helpers/mixin-empty.js +5 -6
- package/src/vendor/bootstrap-vue/src/components/table/helpers/mixin-filtering.js +5 -13
- package/src/vendor/bootstrap-vue/src/components/table/helpers/mixin-items.js +12 -21
- package/src/vendor/bootstrap-vue/src/components/table/helpers/mixin-pagination.js +2 -3
- package/src/vendor/bootstrap-vue/src/components/table/helpers/mixin-provider.js +5 -11
- package/src/vendor/bootstrap-vue/src/components/table/helpers/mixin-selectable.js +4 -5
- package/src/vendor/bootstrap-vue/src/components/table/helpers/mixin-sorting.js +14 -21
- package/src/vendor/bootstrap-vue/src/components/table/helpers/mixin-stacked.js +1 -2
- package/src/vendor/bootstrap-vue/src/components/table/helpers/mixin-table-renderer.js +14 -20
- package/src/vendor/bootstrap-vue/src/components/table/helpers/mixin-tbody-row.js +3 -9
- package/src/vendor/bootstrap-vue/src/components/table/helpers/mixin-tbody.js +1 -2
- package/src/vendor/bootstrap-vue/src/components/table/helpers/mixin-tfoot.js +5 -11
- package/src/vendor/bootstrap-vue/src/components/table/helpers/mixin-thead.js +4 -5
- package/src/vendor/bootstrap-vue/src/components/table/tbody.js +2 -3
- package/src/vendor/bootstrap-vue/src/components/table/td.js +5 -6
- package/src/vendor/bootstrap-vue/src/components/table/tfoot.js +1 -2
- package/src/vendor/bootstrap-vue/src/components/table/thead.js +1 -2
- package/src/vendor/bootstrap-vue/src/components/table/tr.js +1 -2
- package/src/vendor/bootstrap-vue/src/components/tabs/tab.js +10 -16
- package/src/vendor/bootstrap-vue/src/components/tabs/tabs.js +33 -39
- package/src/vendor/bootstrap-vue/src/components/tooltip/tooltip.js +17 -25
- package/src/vendor/bootstrap-vue/src/components/transition/bv-transition.js +4 -5
- package/src/vendor/bootstrap-vue/src/components/transporter/transporter.js +4 -10
- package/src/vendor/bootstrap-vue/src/mixins/dropdown.js +9 -15
- package/src/vendor/bootstrap-vue/src/mixins/form-control.js +6 -7
- package/src/vendor/bootstrap-vue/src/mixins/form-custom.js +1 -2
- package/src/vendor/bootstrap-vue/src/mixins/form-options.js +5 -6
- package/src/vendor/bootstrap-vue/src/mixins/form-size.js +1 -2
- package/src/vendor/bootstrap-vue/src/mixins/form-state.js +1 -2
- package/src/vendor/bootstrap-vue/src/mixins/form-text.js +21 -33
- package/src/vendor/bootstrap-vue/src/mixins/id.js +1 -2
- package/dist/vendor/bootstrap-vue/src/mixins/model.js +0 -10
- package/dist/vendor/bootstrap-vue/src/utils/model.js +0 -33
- package/src/tokens/constant/color.tokens.json +0 -3422
- package/src/vendor/bootstrap-vue/src/mixins/model.js +0 -5
- package/src/vendor/bootstrap-vue/src/utils/model.js +0 -29
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { extend } from '../../../vue';
|
|
2
2
|
import { MODEL_EVENT_NAME_PREFIX } from '../../../constants/events';
|
|
3
|
-
import { PROP_TYPE_BOOLEAN } from '../../../constants/props';
|
|
4
3
|
import { SLOT_NAME_TABLE_BUSY } from '../../../constants/slots';
|
|
5
4
|
import { stopEvent } from '../../../utils/events';
|
|
6
5
|
import { isFunction } from '../../../utils/inspect';
|
|
@@ -16,7 +15,7 @@ const MODEL_EVENT_NAME_BUSY = MODEL_EVENT_NAME_PREFIX + MODEL_PROP_NAME_BUSY;
|
|
|
16
15
|
|
|
17
16
|
const props = {
|
|
18
17
|
[MODEL_PROP_NAME_BUSY]: {
|
|
19
|
-
type:
|
|
18
|
+
type: Boolean,
|
|
20
19
|
required: false,
|
|
21
20
|
default: false
|
|
22
21
|
}
|
|
@@ -56,10 +55,8 @@ const busyMixin = extend({
|
|
|
56
55
|
},
|
|
57
56
|
// Render the busy indicator or return `null` if not busy
|
|
58
57
|
renderBusy() {
|
|
59
|
-
const
|
|
60
|
-
|
|
61
|
-
tbodyTrAttr
|
|
62
|
-
} = this;
|
|
58
|
+
const tbodyTrClass = this.tbodyTrClass,
|
|
59
|
+
tbodyTrAttr = this.tbodyTrAttr;
|
|
63
60
|
const h = this.$createElement;
|
|
64
61
|
|
|
65
62
|
// Return a busy indicator row, or `null` if not busy
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { extend } from '../../../vue';
|
|
2
|
-
import { PROP_TYPE_STRING } from '../../../constants/props';
|
|
3
2
|
import { SLOT_NAME_TABLE_CAPTION } from '../../../constants/slots';
|
|
4
3
|
import { htmlOrText } from '../../../utils/html';
|
|
5
4
|
|
|
@@ -7,12 +6,12 @@ import { htmlOrText } from '../../../utils/html';
|
|
|
7
6
|
|
|
8
7
|
const props = {
|
|
9
8
|
caption: {
|
|
10
|
-
type:
|
|
9
|
+
type: String,
|
|
11
10
|
required: false,
|
|
12
11
|
default: undefined
|
|
13
12
|
},
|
|
14
13
|
captionHtml: {
|
|
15
|
-
type:
|
|
14
|
+
type: String,
|
|
16
15
|
required: false,
|
|
17
16
|
default: undefined
|
|
18
17
|
}
|
|
@@ -32,10 +31,8 @@ const captionMixin = extend({
|
|
|
32
31
|
},
|
|
33
32
|
methods: {
|
|
34
33
|
renderCaption() {
|
|
35
|
-
const
|
|
36
|
-
|
|
37
|
-
captionHtml
|
|
38
|
-
} = this;
|
|
34
|
+
const caption = this.caption,
|
|
35
|
+
captionHtml = this.captionHtml;
|
|
39
36
|
const h = this.$createElement;
|
|
40
37
|
let $caption = h();
|
|
41
38
|
const hasCaptionSlot = this.hasNormalizedSlot(SLOT_NAME_TABLE_CAPTION);
|
|
@@ -11,9 +11,7 @@ const props = {};
|
|
|
11
11
|
const colgroupMixin = extend({
|
|
12
12
|
methods: {
|
|
13
13
|
renderColgroup() {
|
|
14
|
-
const
|
|
15
|
-
computedFields: fields
|
|
16
|
-
} = this;
|
|
14
|
+
const fields = this.computedFields;
|
|
17
15
|
const h = this.$createElement;
|
|
18
16
|
let $colgroup = h();
|
|
19
17
|
if (this.hasNormalizedSlot(SLOT_NAME_TABLE_COLGROUP)) {
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { extend } from '../../../vue';
|
|
2
|
-
import { PROP_TYPE_STRING, PROP_TYPE_BOOLEAN } from '../../../constants/props';
|
|
3
2
|
import { SLOT_NAME_TABLE_BUSY, SLOT_NAME_EMPTYFILTERED, SLOT_NAME_EMPTY } from '../../../constants/slots';
|
|
4
3
|
import { htmlOrText } from '../../../utils/html';
|
|
5
4
|
import { isFunction } from '../../../utils/inspect';
|
|
@@ -11,27 +10,27 @@ import { BTd } from '../td';
|
|
|
11
10
|
|
|
12
11
|
const props = {
|
|
13
12
|
emptyFilteredHtml: {
|
|
14
|
-
type:
|
|
13
|
+
type: String,
|
|
15
14
|
required: false,
|
|
16
15
|
default: undefined
|
|
17
16
|
},
|
|
18
17
|
emptyFilteredText: {
|
|
19
|
-
type:
|
|
18
|
+
type: String,
|
|
20
19
|
required: false,
|
|
21
20
|
default: 'There are no records matching your request'
|
|
22
21
|
},
|
|
23
22
|
emptyHtml: {
|
|
24
|
-
type:
|
|
23
|
+
type: String,
|
|
25
24
|
required: false,
|
|
26
25
|
default: undefined
|
|
27
26
|
},
|
|
28
27
|
emptyText: {
|
|
29
|
-
type:
|
|
28
|
+
type: String,
|
|
30
29
|
required: false,
|
|
31
30
|
default: 'There are no records to show'
|
|
32
31
|
},
|
|
33
32
|
showEmpty: {
|
|
34
|
-
type:
|
|
33
|
+
type: Boolean,
|
|
35
34
|
required: false,
|
|
36
35
|
default: false
|
|
37
36
|
}
|
|
@@ -44,23 +43,20 @@ const emptyMixin = extend({
|
|
|
44
43
|
props,
|
|
45
44
|
methods: {
|
|
46
45
|
renderEmpty() {
|
|
47
|
-
const
|
|
48
|
-
computedItems
|
|
49
|
-
computedBusy
|
|
50
|
-
} = safeVueInstance(this);
|
|
46
|
+
const _safeVueInstance = safeVueInstance(this),
|
|
47
|
+
items = _safeVueInstance.computedItems,
|
|
48
|
+
computedBusy = _safeVueInstance.computedBusy;
|
|
51
49
|
const h = this.$createElement;
|
|
52
50
|
let $empty = h();
|
|
53
51
|
if (this.showEmpty && (!items || items.length === 0) && !(computedBusy && this.hasNormalizedSlot(SLOT_NAME_TABLE_BUSY))) {
|
|
54
|
-
const
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
tbodyTrAttr
|
|
63
|
-
} = this;
|
|
52
|
+
const fields = this.computedFields,
|
|
53
|
+
isFiltered = this.isFiltered,
|
|
54
|
+
emptyText = this.emptyText,
|
|
55
|
+
emptyHtml = this.emptyHtml,
|
|
56
|
+
emptyFilteredText = this.emptyFilteredText,
|
|
57
|
+
emptyFilteredHtml = this.emptyFilteredHtml,
|
|
58
|
+
tbodyTrClass = this.tbodyTrClass,
|
|
59
|
+
tbodyTrAttr = this.tbodyTrAttr;
|
|
64
60
|
$empty = this.normalizeSlot(isFiltered ? SLOT_NAME_EMPTYFILTERED : SLOT_NAME_EMPTY, {
|
|
65
61
|
emptyFilteredHtml,
|
|
66
62
|
emptyFilteredText,
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { extend } from '../../../vue';
|
|
2
2
|
import { NAME_TABLE } from '../../../constants/components';
|
|
3
3
|
import { EVENT_NAME_FILTERED } from '../../../constants/events';
|
|
4
|
-
import { PROP_TYPE_ARRAY, PROP_TYPE_OBJECT, PROP_TYPE_STRING, PROP_TYPE_REG_EXP, PROP_TYPE_NUMBER, PROP_TYPE_FUNCTION } from '../../../constants/props';
|
|
5
4
|
import { RX_SPACES, RX_DIGITS } from '../../../constants/regex';
|
|
6
5
|
import { concat } from '../../../utils/array';
|
|
7
6
|
import { cloneDeep } from '../../../utils/clone-deep';
|
|
@@ -21,28 +20,28 @@ const DEBOUNCE_DEPRECATED_MSG = 'Prop "filter-debounce" is deprecated. Use the d
|
|
|
21
20
|
|
|
22
21
|
const props = {
|
|
23
22
|
filter: {
|
|
24
|
-
type: [
|
|
23
|
+
type: [Array, Object, String, RegExp],
|
|
25
24
|
required: false,
|
|
26
25
|
default: undefined
|
|
27
26
|
},
|
|
28
27
|
filterDebounce: {
|
|
29
|
-
type: [
|
|
28
|
+
type: [Number, String],
|
|
30
29
|
required: false,
|
|
31
30
|
default: 0,
|
|
32
31
|
validator: value => RX_DIGITS.test(String(value))
|
|
33
32
|
},
|
|
34
33
|
filterFunction: {
|
|
35
|
-
type:
|
|
34
|
+
type: Function,
|
|
36
35
|
required: false,
|
|
37
36
|
default: undefined
|
|
38
37
|
},
|
|
39
38
|
filterIgnoredFields: {
|
|
40
|
-
type:
|
|
39
|
+
type: Array,
|
|
41
40
|
required: false,
|
|
42
41
|
default: () => []
|
|
43
42
|
},
|
|
44
43
|
filterIncludedFields: {
|
|
45
|
-
type:
|
|
44
|
+
type: Array,
|
|
46
45
|
required: false,
|
|
47
46
|
default: () => []
|
|
48
47
|
}
|
|
@@ -82,11 +81,9 @@ const filteringMixin = extend({
|
|
|
82
81
|
},
|
|
83
82
|
// For watching changes to `filteredItems` vs `localItems`
|
|
84
83
|
filteredCheck() {
|
|
85
|
-
const
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
localFilter
|
|
89
|
-
} = this;
|
|
84
|
+
const filteredItems = this.filteredItems,
|
|
85
|
+
localItems = this.localItems,
|
|
86
|
+
localFilter = this.localFilter;
|
|
90
87
|
return {
|
|
91
88
|
filteredItems,
|
|
92
89
|
localItems,
|
|
@@ -96,9 +93,7 @@ const filteringMixin = extend({
|
|
|
96
93
|
// Sanitized/normalize filter-function prop
|
|
97
94
|
localFilterFn() {
|
|
98
95
|
// Return `null` to signal to use internal filter function
|
|
99
|
-
const
|
|
100
|
-
filterFunction
|
|
101
|
-
} = this;
|
|
96
|
+
const filterFunction = this.filterFunction;
|
|
102
97
|
// `filterFunction` is an optional Function prop with no default
|
|
103
98
|
return isFunction(filterFunction) ? filterFunction : null;
|
|
104
99
|
},
|
|
@@ -106,10 +101,8 @@ const filteringMixin = extend({
|
|
|
106
101
|
// Returns the original `localItems` array if not sorting
|
|
107
102
|
filteredItems() {
|
|
108
103
|
// Note the criteria is debounced and sanitized
|
|
109
|
-
const
|
|
110
|
-
|
|
111
|
-
localFilter: criteria
|
|
112
|
-
} = this;
|
|
104
|
+
const items = this.localItems,
|
|
105
|
+
criteria = this.localFilter;
|
|
113
106
|
|
|
114
107
|
// Resolve the filtering function, when requested
|
|
115
108
|
// We prefer the provided filtering function and fallback to the internal one
|
|
@@ -150,10 +143,8 @@ const filteringMixin = extend({
|
|
|
150
143
|
// Watch for changes to the filter criteria and filtered items vs `localItems`
|
|
151
144
|
// Set visual state and emit events as required
|
|
152
145
|
filteredCheck(_ref) {
|
|
153
|
-
let
|
|
154
|
-
|
|
155
|
-
localFilter
|
|
156
|
-
} = _ref;
|
|
146
|
+
let filteredItems = _ref.filteredItems,
|
|
147
|
+
localFilter = _ref.localFilter;
|
|
157
148
|
// Determine if the dataset is filtered or not
|
|
158
149
|
let isFiltered = false;
|
|
159
150
|
if (!localFilter) {
|
|
@@ -179,9 +170,7 @@ const filteringMixin = extend({
|
|
|
179
170
|
if (newValue === false && oldValue === true) {
|
|
180
171
|
// We need to emit a filtered event if `isFiltered` transitions from `true` to
|
|
181
172
|
// `false` so that users can update their pagination controls
|
|
182
|
-
const
|
|
183
|
-
localItems
|
|
184
|
-
} = this;
|
|
173
|
+
const localItems = this.localItems;
|
|
185
174
|
this.$emit(EVENT_NAME_FILTERED, localItems, localItems.length);
|
|
186
175
|
// Clear selection on filter change if selectable (defined in mixin-selectable.js)
|
|
187
176
|
if (this.hasSelectableRowClick) {
|
|
@@ -1,11 +1,9 @@
|
|
|
1
1
|
import { extend } from '../../../vue';
|
|
2
|
-
import { EVENT_NAME_CONTEXT_CHANGED } from '../../../constants/events';
|
|
3
|
-
import { PROP_TYPE_ARRAY, PROP_TYPE_STRING } from '../../../constants/props';
|
|
2
|
+
import { EVENT_NAME_CONTEXT_CHANGED, EVENT_NAME_INPUT } from '../../../constants/events';
|
|
4
3
|
import { useParentMixin } from '../../../mixins/use-parent';
|
|
5
4
|
import { isArray, isString, isFunction } from '../../../utils/inspect';
|
|
6
5
|
import { looseEqual } from '../../../utils/loose-equal';
|
|
7
6
|
import { mathMax } from '../../../utils/math';
|
|
8
|
-
import { makeModelMixin } from '../../../utils/model';
|
|
9
7
|
import { toInteger } from '../../../utils/number';
|
|
10
8
|
import { sortKeys, clone } from '../../../utils/object';
|
|
11
9
|
import { safeVueInstance } from '../../../utils/safe-vue-instance';
|
|
@@ -13,41 +11,33 @@ import { normalizeFields } from './normalize-fields';
|
|
|
13
11
|
|
|
14
12
|
// --- Constants ---
|
|
15
13
|
|
|
16
|
-
const
|
|
17
|
-
|
|
18
|
-
props: modelProps,
|
|
19
|
-
prop: MODEL_PROP_NAME,
|
|
20
|
-
event: MODEL_EVENT_NAME
|
|
21
|
-
} = makeModelMixin('value', {
|
|
22
|
-
type: PROP_TYPE_ARRAY,
|
|
23
|
-
defaultValue: []
|
|
24
|
-
});
|
|
14
|
+
const MODEL_PROP_NAME = 'value';
|
|
15
|
+
const MODEL_EVENT_NAME = EVENT_NAME_INPUT;
|
|
25
16
|
|
|
26
17
|
// --- Props ---
|
|
27
18
|
|
|
28
19
|
const props = sortKeys({
|
|
29
|
-
...modelProps,
|
|
30
20
|
fields: {
|
|
31
|
-
type:
|
|
21
|
+
type: Array,
|
|
32
22
|
required: false,
|
|
33
23
|
default: null
|
|
34
24
|
},
|
|
35
25
|
// Provider mixin adds in `Function` type
|
|
36
26
|
items: {
|
|
37
|
-
type:
|
|
27
|
+
type: Array,
|
|
38
28
|
required: false,
|
|
39
29
|
default: () => []
|
|
40
30
|
},
|
|
41
31
|
// Primary key for record
|
|
42
32
|
// If provided the value in each row must be unique!
|
|
43
33
|
primaryKey: {
|
|
44
|
-
type:
|
|
34
|
+
type: String,
|
|
45
35
|
required: false,
|
|
46
36
|
default: undefined
|
|
47
37
|
},
|
|
48
38
|
// `v-model` for retrieving the current displayed rows
|
|
49
39
|
[MODEL_PROP_NAME]: {
|
|
50
|
-
type:
|
|
40
|
+
type: Array,
|
|
51
41
|
required: false,
|
|
52
42
|
default: () => []
|
|
53
43
|
}
|
|
@@ -57,12 +47,14 @@ const props = sortKeys({
|
|
|
57
47
|
|
|
58
48
|
// @vue/component
|
|
59
49
|
const itemsMixin = extend({
|
|
60
|
-
mixins: [
|
|
50
|
+
mixins: [useParentMixin],
|
|
51
|
+
model: {
|
|
52
|
+
prop: MODEL_PROP_NAME,
|
|
53
|
+
event: MODEL_EVENT_NAME
|
|
54
|
+
},
|
|
61
55
|
props,
|
|
62
56
|
data() {
|
|
63
|
-
const
|
|
64
|
-
items
|
|
65
|
-
} = this;
|
|
57
|
+
const items = this.items;
|
|
66
58
|
return {
|
|
67
59
|
// Our local copy of the items
|
|
68
60
|
// Must be an array
|
|
@@ -80,9 +72,7 @@ const itemsMixin = extend({
|
|
|
80
72
|
// Mainly for formatter lookup and use in `scopedSlots` for convenience
|
|
81
73
|
// If the field has a formatter, it normalizes formatter to a
|
|
82
74
|
// function ref or `undefined` if no formatter
|
|
83
|
-
const
|
|
84
|
-
bvParent
|
|
85
|
-
} = this;
|
|
75
|
+
const bvParent = this.bvParent;
|
|
86
76
|
return this.computedFields.reduce((obj, f) => {
|
|
87
77
|
// We use object spread here so we don't mutate the original field object
|
|
88
78
|
obj[f.key] = clone(f);
|
|
@@ -102,21 +92,19 @@ const itemsMixin = extend({
|
|
|
102
92
|
}, {});
|
|
103
93
|
},
|
|
104
94
|
computedItems() {
|
|
105
|
-
const
|
|
106
|
-
paginatedItems,
|
|
107
|
-
sortedItems,
|
|
108
|
-
filteredItems,
|
|
109
|
-
localItems
|
|
110
|
-
} = safeVueInstance(this);
|
|
95
|
+
const _safeVueInstance = safeVueInstance(this),
|
|
96
|
+
paginatedItems = _safeVueInstance.paginatedItems,
|
|
97
|
+
sortedItems = _safeVueInstance.sortedItems,
|
|
98
|
+
filteredItems = _safeVueInstance.filteredItems,
|
|
99
|
+
localItems = _safeVueInstance.localItems;
|
|
111
100
|
// Fallback if various mixins not provided
|
|
112
101
|
return (paginatedItems || sortedItems || filteredItems || localItems || /* istanbul ignore next */
|
|
113
102
|
[]).slice();
|
|
114
103
|
},
|
|
115
104
|
context() {
|
|
116
|
-
const
|
|
117
|
-
perPage,
|
|
118
|
-
currentPage
|
|
119
|
-
} = safeVueInstance(this);
|
|
105
|
+
const _safeVueInstance2 = safeVueInstance(this),
|
|
106
|
+
perPage = _safeVueInstance2.perPage,
|
|
107
|
+
currentPage = _safeVueInstance2.currentPage;
|
|
120
108
|
// Current state of sorting, filtering and pagination props/values
|
|
121
109
|
return {
|
|
122
110
|
filter: this.localFilter,
|
|
@@ -166,4 +154,4 @@ const itemsMixin = extend({
|
|
|
166
154
|
}
|
|
167
155
|
});
|
|
168
156
|
|
|
169
|
-
export {
|
|
157
|
+
export { itemsMixin, props };
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { extend } from '../../../vue';
|
|
2
|
-
import { PROP_TYPE_NUMBER, PROP_TYPE_STRING } from '../../../constants/props';
|
|
3
2
|
import { mathMax } from '../../../utils/math';
|
|
4
3
|
import { toInteger } from '../../../utils/number';
|
|
5
4
|
import { safeVueInstance } from '../../../utils/safe-vue-instance';
|
|
@@ -8,12 +7,12 @@ import { safeVueInstance } from '../../../utils/safe-vue-instance';
|
|
|
8
7
|
|
|
9
8
|
const props = {
|
|
10
9
|
currentPage: {
|
|
11
|
-
type: [
|
|
10
|
+
type: [Number, String],
|
|
12
11
|
required: false,
|
|
13
12
|
default: 1
|
|
14
13
|
},
|
|
15
14
|
perPage: {
|
|
16
|
-
type: [
|
|
15
|
+
type: [Number, String],
|
|
17
16
|
required: false,
|
|
18
17
|
default: 0
|
|
19
18
|
}
|
|
@@ -29,11 +28,10 @@ const paginationMixin = extend({
|
|
|
29
28
|
return this.hasProvider ? !!this.noProviderPaging : true;
|
|
30
29
|
},
|
|
31
30
|
paginatedItems() {
|
|
32
|
-
const
|
|
33
|
-
sortedItems,
|
|
34
|
-
filteredItems,
|
|
35
|
-
localItems
|
|
36
|
-
} = safeVueInstance(this);
|
|
31
|
+
const _safeVueInstance = safeVueInstance(this),
|
|
32
|
+
sortedItems = _safeVueInstance.sortedItems,
|
|
33
|
+
filteredItems = _safeVueInstance.filteredItems,
|
|
34
|
+
localItems = _safeVueInstance.localItems;
|
|
37
35
|
let items = sortedItems || filteredItems || localItems || [];
|
|
38
36
|
const currentPage = mathMax(toInteger(this.currentPage, 1), 1);
|
|
39
37
|
const perPage = mathMax(toInteger(this.perPage, 0), 0);
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { extend } from '../../../vue';
|
|
2
2
|
import { NAME_TABLE } from '../../../constants/components';
|
|
3
3
|
import { EVENT_NAME_REFRESHED, EVENT_NAME_REFRESH } from '../../../constants/events';
|
|
4
|
-
import { PROP_TYPE_STRING, PROP_TYPE_ARRAY, PROP_TYPE_FUNCTION, PROP_TYPE_BOOLEAN } from '../../../constants/props';
|
|
5
4
|
import { getRootEventName, getRootActionEventName } from '../../../utils/events';
|
|
6
5
|
import { isFunction, isArray, isPromise } from '../../../utils/inspect';
|
|
7
6
|
import { looseEqual } from '../../../utils/loose-equal';
|
|
@@ -21,28 +20,28 @@ const props = {
|
|
|
21
20
|
// Passed to the context object
|
|
22
21
|
// Not used by `<b-table>` directly
|
|
23
22
|
apiUrl: {
|
|
24
|
-
type:
|
|
23
|
+
type: String,
|
|
25
24
|
required: false,
|
|
26
25
|
default: undefined
|
|
27
26
|
},
|
|
28
27
|
// Adds in 'Function' support
|
|
29
28
|
items: {
|
|
30
|
-
type: [
|
|
29
|
+
type: [Array, Function],
|
|
31
30
|
required: false,
|
|
32
31
|
default: () => []
|
|
33
32
|
},
|
|
34
33
|
noProviderFiltering: {
|
|
35
|
-
type:
|
|
34
|
+
type: Boolean,
|
|
36
35
|
required: false,
|
|
37
36
|
default: false
|
|
38
37
|
},
|
|
39
38
|
noProviderPaging: {
|
|
40
|
-
type:
|
|
39
|
+
type: Boolean,
|
|
41
40
|
required: false,
|
|
42
41
|
default: false
|
|
43
42
|
},
|
|
44
43
|
noProviderSorting: {
|
|
45
|
-
type:
|
|
44
|
+
type: Boolean,
|
|
46
45
|
required: false,
|
|
47
46
|
default: false
|
|
48
47
|
}
|
|
@@ -116,10 +115,9 @@ const providerMixin = extend({
|
|
|
116
115
|
},
|
|
117
116
|
methods: {
|
|
118
117
|
refresh() {
|
|
119
|
-
const
|
|
120
|
-
items,
|
|
121
|
-
computedBusy
|
|
122
|
-
} = safeVueInstance(this);
|
|
118
|
+
const _safeVueInstance = safeVueInstance(this),
|
|
119
|
+
items = _safeVueInstance.items,
|
|
120
|
+
computedBusy = _safeVueInstance.computedBusy;
|
|
123
121
|
|
|
124
122
|
// Public Method: Force a refresh of the provider function
|
|
125
123
|
this.$_pendingRefresh = false;
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { extend } from '../../../vue';
|
|
2
2
|
import { EVENT_NAME_ROW_SELECTED } from '../../../constants/events';
|
|
3
|
-
import { PROP_TYPE_BOOLEAN, PROP_TYPE_STRING } from '../../../constants/props';
|
|
4
3
|
import { createArray } from '../../../utils/array';
|
|
5
4
|
import { identity } from '../../../utils/identity';
|
|
6
5
|
import { isArray, isNumber } from '../../../utils/inspect';
|
|
@@ -19,23 +18,23 @@ const ROLE_GRID = 'grid';
|
|
|
19
18
|
const props = {
|
|
20
19
|
// Disable use of click handlers for row selection
|
|
21
20
|
noSelectOnClick: {
|
|
22
|
-
type:
|
|
21
|
+
type: Boolean,
|
|
23
22
|
required: false,
|
|
24
23
|
default: false
|
|
25
24
|
},
|
|
26
25
|
selectMode: {
|
|
27
|
-
type:
|
|
26
|
+
type: String,
|
|
28
27
|
required: false,
|
|
29
28
|
default: 'multi',
|
|
30
29
|
validator: value => SELECT_MODES.includes(value)
|
|
31
30
|
},
|
|
32
31
|
selectable: {
|
|
33
|
-
type:
|
|
32
|
+
type: Boolean,
|
|
34
33
|
required: false,
|
|
35
34
|
default: false
|
|
36
35
|
},
|
|
37
36
|
selectedVariant: {
|
|
38
|
-
type:
|
|
37
|
+
type: String,
|
|
39
38
|
required: false,
|
|
40
39
|
default: 'active'
|
|
41
40
|
}
|
|
@@ -63,18 +62,14 @@ const selectableMixin = extend({
|
|
|
63
62
|
return true;
|
|
64
63
|
},
|
|
65
64
|
selectableHasSelection() {
|
|
66
|
-
const
|
|
67
|
-
selectedRows
|
|
68
|
-
} = this;
|
|
65
|
+
const selectedRows = this.selectedRows;
|
|
69
66
|
return this.isSelectable && selectedRows && selectedRows.length > 0 && selectedRows.some(identity);
|
|
70
67
|
},
|
|
71
68
|
selectableIsMultiSelect() {
|
|
72
69
|
return this.isSelectable && ['range', 'multi'].includes(this.selectMode);
|
|
73
70
|
},
|
|
74
71
|
selectableTableClasses() {
|
|
75
|
-
const
|
|
76
|
-
isSelectable
|
|
77
|
-
} = this;
|
|
72
|
+
const isSelectable = this.isSelectable;
|
|
78
73
|
return {
|
|
79
74
|
'b-table-selectable': isSelectable,
|
|
80
75
|
[`b-table-select-${this.selectMode}`]: isSelectable,
|
|
@@ -193,10 +188,8 @@ const selectableMixin = extend({
|
|
|
193
188
|
this.clearSelected();
|
|
194
189
|
return;
|
|
195
190
|
}
|
|
196
|
-
const
|
|
197
|
-
|
|
198
|
-
selectedLastRow
|
|
199
|
-
} = this;
|
|
191
|
+
const selectMode = this.selectMode,
|
|
192
|
+
selectedLastRow = this.selectedLastRow;
|
|
200
193
|
let selectedRows = this.selectedRows.slice();
|
|
201
194
|
let selected = !selectedRows[index];
|
|
202
195
|
// Note 'multi' mode needs no special event handling
|