From 89e9f8cb659b7990af1b6f7eb188b1fd8b665479 Mon Sep 17 00:00:00 2001 From: Troy Morehouse Date: Wed, 8 Apr 2020 13:55:59 -0300 Subject: [PATCH 01/40] chore(b-calendar, b-form-datepicker): minor updates to structure and styling --- src/components/calendar/calendar.js | 19 ++++++++----------- 1 file changed, 8 insertions(+), 11 deletions(-) diff --git a/src/components/calendar/calendar.js b/src/components/calendar/calendar.js index 98b469027a2..3f3e240b731 100644 --- a/src/components/calendar/calendar.js +++ b/src/components/calendar/calendar.js @@ -734,15 +734,10 @@ export const BCalendar = Vue.extend({ return h() } - const isRTL = this.isRTL + const { isLive, isRTL, activeYMD, selectedYMD, safeId } = this const hideDecadeNav = !this.showDecadeNav const todayYMD = formatYMD(this.getToday()) - const selectedYMD = this.selectedYMD - const activeYMD = this.activeYMD const highlightToday = !this.noHighlightToday - const safeId = this.safeId - // Flag for making the `aria-live` regions live - const isLive = this.isLive // Pre-compute some IDs // This should be computed props const idValue = safeId() @@ -757,7 +752,7 @@ export const BCalendar = Vue.extend({ let $header = h( 'output', { - staticClass: 'd-block text-center rounded border small p-1 mb-1', + staticClass: 'form-control form-control-sm text-center', class: { 'text-muted': this.disabled, readonly: this.readonly || this.disabled }, attrs: { id: idValue, @@ -791,13 +786,15 @@ export const BCalendar = Vue.extend({ $header = h( 'header', { - class: this.hideHeader ? 'sr-only' : 'mb-1', + staticClass: 'b-calendar-header', + class: { 'sr-only': this.hideHeader }, attrs: { title: this.selectedDate ? this.labelSelectedDate || null : null } }, [$header] ) // Content for the date navigation buttons + // TODO: add slots for the nav button content const $prevDecadeIcon = h(BIconChevronBarLeft, { props: { shiftV: 0.5, flipH: isRTL } }) const $prevYearIcon = h(BIconChevronDoubleLeft, { props: { shiftV: 0.5, flipH: isRTL } }) const $prevMonthIcon = h(BIconChevronLeft, { props: { shiftV: 0.5, flipH: isRTL } }) @@ -811,7 +808,7 @@ export const BCalendar = Vue.extend({ return h( 'button', { - staticClass: 'btn btn-sm btn-outline-secondary border-0 flex-fill p-1 mx-1', + staticClass: 'btn btn-sm btn-outline-secondary border-0 flex-fill', class: { disabled: btnDisabled }, attrs: { title: label || null, @@ -830,7 +827,7 @@ export const BCalendar = Vue.extend({ const $nav = h( 'div', { - staticClass: 'b-calendar-nav d-flex mx-n1 mb-1', + staticClass: 'b-calendar-nav d-flex', attrs: { id: idNav, role: 'group', @@ -901,7 +898,7 @@ export const BCalendar = Vue.extend({ 'header', { key: 'grid-caption', - staticClass: 'text-center font-weight-bold p-1 m-0', + staticClass: 'b-calendar-caption text-center font-weight-bold', class: { 'text-muted': this.disabled }, attrs: { id: idGridCaption, From ec260a29a2b33db95863d763e1d8de12c4762435 Mon Sep 17 00:00:00 2001 From: Troy Morehouse Date: Wed, 8 Apr 2020 14:23:59 -0300 Subject: [PATCH 02/40] Update calendar.js --- src/components/calendar/calendar.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/calendar/calendar.js b/src/components/calendar/calendar.js index 3f3e240b731..5963187484a 100644 --- a/src/components/calendar/calendar.js +++ b/src/components/calendar/calendar.js @@ -1054,7 +1054,7 @@ export const BCalendar = Vue.extend({ // Optional bottom slot let $slot = this.normalizeSlot('default') - $slot = $slot ? h('footer', { staticClass: 'mt-2' }, $slot) : h() + $slot = $slot ? h('footer', { staticClass: 'b-calendar-footer' }, $slot) : h() const $widget = h( 'div', From b18b393f0c42a695d095a127531519382e8ea8b5 Mon Sep 17 00:00:00 2001 From: Troy Morehouse Date: Wed, 8 Apr 2020 14:25:11 -0300 Subject: [PATCH 03/40] Update _calendar.scss --- src/components/calendar/_calendar.scss | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/src/components/calendar/_calendar.scss b/src/components/calendar/_calendar.scss index aa5b2980f94..9f715390655 100644 --- a/src/components/calendar/_calendar.scss +++ b/src/components/calendar/_calendar.scss @@ -6,17 +6,30 @@ min-width: 250px; } + .b-calendar-header, + .b-calendar-nav { + margin-bottom: 0.25rem; + } + output.readonly { background-color: $input-disabled-bg; opacity: 1; } + .b-calendar-footer { + margin-top: 0.5rem; + } + .form-control[role="application"] { // Easy rounded corners on contained elements, // specifically the footer of the calendar grid overflow: hidden; } + .b-calendar-caption { + padding: 0.25rem; + } + .b-calendar-grid-body { .col[data-date] { // We hard code the sizes in `px` to fit From 343f54bfe46ebc3069cfced0bf8158fcc8479394 Mon Sep 17 00:00:00 2001 From: Troy Morehouse Date: Wed, 8 Apr 2020 14:42:14 -0300 Subject: [PATCH 04/40] Update calendar.js --- src/components/calendar/calendar.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/calendar/calendar.js b/src/components/calendar/calendar.js index 5963187484a..a50c7deae6b 100644 --- a/src/components/calendar/calendar.js +++ b/src/components/calendar/calendar.js @@ -1016,7 +1016,7 @@ export const BCalendar = Vue.extend({ const $gridHelp = h( 'footer', { - staticClass: 'border-top small text-muted text-center bg-light', + staticClass: 'b-calendar-grid-help border-top small text-muted text-center bg-light', attrs: { id: idGridHelp } From 2000285020682df128bc53b837cc010c8360083a Mon Sep 17 00:00:00 2001 From: Troy Morehouse Date: Wed, 8 Apr 2020 14:48:55 -0300 Subject: [PATCH 05/40] Update _calendar.scss --- src/components/calendar/_calendar.scss | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/components/calendar/_calendar.scss b/src/components/calendar/_calendar.scss index 9f715390655..995be96f364 100644 --- a/src/components/calendar/_calendar.scss +++ b/src/components/calendar/_calendar.scss @@ -11,6 +11,10 @@ margin-bottom: 0.25rem; } + .b-calendar-nav .btn { + padding: 0.25rem; + } + output.readonly { background-color: $input-disabled-bg; opacity: 1; @@ -26,7 +30,7 @@ overflow: hidden; } - .b-calendar-caption { + .b-calendar-grid-caption { padding: 0.25rem; } From 3ebefc9f9cec033306e3a3cffe809831fdfcbbfc Mon Sep 17 00:00:00 2001 From: Troy Morehouse Date: Wed, 8 Apr 2020 14:53:50 -0300 Subject: [PATCH 06/40] Update _calendar.scss --- src/components/calendar/_calendar.scss | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/components/calendar/_calendar.scss b/src/components/calendar/_calendar.scss index 995be96f364..84c11384371 100644 --- a/src/components/calendar/_calendar.scss +++ b/src/components/calendar/_calendar.scss @@ -24,7 +24,9 @@ margin-top: 0.5rem; } - .form-control[role="application"] { + .b-calendar-grid { + padding: 0; + margin: 0; // Easy rounded corners on contained elements, // specifically the footer of the calendar grid overflow: hidden; From 2b8778ff0d9906e71fecaa0750ae31833cec8a89 Mon Sep 17 00:00:00 2001 From: Troy Morehouse Date: Wed, 8 Apr 2020 14:54:02 -0300 Subject: [PATCH 07/40] Update calendar.js --- src/components/calendar/calendar.js | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/components/calendar/calendar.js b/src/components/calendar/calendar.js index a50c7deae6b..9ea2b4fa097 100644 --- a/src/components/calendar/calendar.js +++ b/src/components/calendar/calendar.js @@ -898,7 +898,7 @@ export const BCalendar = Vue.extend({ 'header', { key: 'grid-caption', - staticClass: 'b-calendar-caption text-center font-weight-bold', + staticClass: 'b-calendar-grid-caption text-center font-weight-bold', class: { 'text-muted': this.disabled }, attrs: { id: idGridCaption, @@ -912,7 +912,10 @@ export const BCalendar = Vue.extend({ // Calendar weekday headings const $gridWeekDays = h( 'div', - { staticClass: 'row no-gutters border-bottom', attrs: { 'aria-hidden': 'true' } }, + { + staticClass: 'b-calendar-grid-weekdays row no-gutters border-bottom', + attrs: { 'aria-hidden': 'true' } + }, this.calendarHeadings.map((d, idx) => { return h( 'small', @@ -1028,7 +1031,7 @@ export const BCalendar = Vue.extend({ 'div', { ref: 'grid', - staticClass: 'form-control h-auto text-center p-0 mb-0', + staticClass: 'b-calendar-grid form-control h-auto text-center', attrs: { id: idGrid, role: 'application', From 86cb1a0a641afba6532e4d0302d31c4f5fd6c26b Mon Sep 17 00:00:00 2001 From: Troy Morehouse Date: Wed, 8 Apr 2020 15:43:36 -0300 Subject: [PATCH 08/40] Update _calendar.scss --- src/components/calendar/_calendar.scss | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/src/components/calendar/_calendar.scss b/src/components/calendar/_calendar.scss index 84c11384371..ce5c4961031 100644 --- a/src/components/calendar/_calendar.scss +++ b/src/components/calendar/_calendar.scss @@ -12,12 +12,17 @@ } .b-calendar-nav .btn { + border: 0; padding: 0.25rem; } - output.readonly { - background-color: $input-disabled-bg; - opacity: 1; + output { + padding: 0.25rem; + + &.readonly { + background-color: $input-disabled-bg; + opacity: 1; + } } .b-calendar-footer { From 034080a3f223d057e58b8cd0ba82d7bb40635aea Mon Sep 17 00:00:00 2001 From: Troy Morehouse Date: Wed, 8 Apr 2020 15:46:15 -0300 Subject: [PATCH 09/40] Update _calendar.scss --- src/components/calendar/_calendar.scss | 1 - 1 file changed, 1 deletion(-) diff --git a/src/components/calendar/_calendar.scss b/src/components/calendar/_calendar.scss index ce5c4961031..beaf7d90f3d 100644 --- a/src/components/calendar/_calendar.scss +++ b/src/components/calendar/_calendar.scss @@ -12,7 +12,6 @@ } .b-calendar-nav .btn { - border: 0; padding: 0.25rem; } From 0c33c05d6078ff2b62f8353f46a3e641399f4209 Mon Sep 17 00:00:00 2001 From: Troy Morehouse Date: Wed, 8 Apr 2020 15:48:15 -0300 Subject: [PATCH 10/40] Update _calendar.scss --- src/components/calendar/_calendar.scss | 1 + 1 file changed, 1 insertion(+) diff --git a/src/components/calendar/_calendar.scss b/src/components/calendar/_calendar.scss index beaf7d90f3d..85abf4496d6 100644 --- a/src/components/calendar/_calendar.scss +++ b/src/components/calendar/_calendar.scss @@ -17,6 +17,7 @@ output { padding: 0.25rem; + font-size: 80%; &.readonly { background-color: $input-disabled-bg; From 4a413909a90d55997e2bb8200bcf6e4fe2ccbfa6 Mon Sep 17 00:00:00 2001 From: Troy Morehouse Date: Wed, 8 Apr 2020 16:03:28 -0300 Subject: [PATCH 11/40] Update _custom-controls.scss --- src/_custom-controls.scss | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/_custom-controls.scss b/src/_custom-controls.scss index f88e1adeb43..bb99c3cb425 100644 --- a/src/_custom-controls.scss +++ b/src/_custom-controls.scss @@ -65,10 +65,15 @@ color: $form-feedback-invalid-color; } + > .dropdown-menu { + padding: 0.5rem; + } + > label { // Unfortunately this is not supported by all browsers :( // text-align: end; outline: 0; + padding-left: 0.25rem; @if $enable-pointer-cursor-for-buttons { cursor: pointer; } @@ -86,6 +91,7 @@ } } + // Disabled and read-only styling &[aria-disabled="true"], &[aria-readonly="true"] { From 655897a532823de39c97465f59607e6c33d128e9 Mon Sep 17 00:00:00 2001 From: Troy Morehouse Date: Wed, 8 Apr 2020 16:05:55 -0300 Subject: [PATCH 12/40] Update bv-form-btn-label-control.js --- src/utils/bv-form-btn-label-control.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/utils/bv-form-btn-label-control.js b/src/utils/bv-form-btn-label-control.js index e44fe4cffca..079b68abd57 100644 --- a/src/utils/bv-form-btn-label-control.js +++ b/src/utils/bv-form-btn-label-control.js @@ -225,7 +225,7 @@ export const BVFormBtnLabelControl = /*#__PURE__*/ Vue.extend({ 'div', { ref: 'menu', - staticClass: 'dropdown-menu p-2', + staticClass: 'dropdown-menu', class: [ this.menuClass, { @@ -251,7 +251,7 @@ export const BVFormBtnLabelControl = /*#__PURE__*/ Vue.extend({ const $label = h( 'label', { - staticClass: 'form-control text-break text-wrap border-0 bg-transparent h-auto pl-1 m-0', + staticClass: 'form-control text-break text-wrap border-0 bg-transparent h-auto', class: { // Hidden in button only mode 'sr-only': buttonOnly, From 4b9df2d02bae96d6924db43d8f18eae3dd4a4c5b Mon Sep 17 00:00:00 2001 From: Troy Morehouse Date: Wed, 8 Apr 2020 16:06:48 -0300 Subject: [PATCH 13/40] Update _custom-controls.scss --- src/_custom-controls.scss | 1 + 1 file changed, 1 insertion(+) diff --git a/src/_custom-controls.scss b/src/_custom-controls.scss index bb99c3cb425..1bedec084dd 100644 --- a/src/_custom-controls.scss +++ b/src/_custom-controls.scss @@ -74,6 +74,7 @@ // text-align: end; outline: 0; padding-left: 0.25rem; + margin: 0; @if $enable-pointer-cursor-for-buttons { cursor: pointer; } From 025733a6c7b0050265db667116e70263cb1f30a5 Mon Sep 17 00:00:00 2001 From: Troy Morehouse Date: Wed, 8 Apr 2020 16:19:19 -0300 Subject: [PATCH 14/40] Update bv-form-btn-label-control.js --- src/utils/bv-form-btn-label-control.js | 1 - 1 file changed, 1 deletion(-) diff --git a/src/utils/bv-form-btn-label-control.js b/src/utils/bv-form-btn-label-control.js index 079b68abd57..038da2b9fc4 100644 --- a/src/utils/bv-form-btn-label-control.js +++ b/src/utils/bv-form-btn-label-control.js @@ -176,7 +176,6 @@ export const BVFormBtnLabelControl = /*#__PURE__*/ Vue.extend({ [`btn-${size}`]: !!size, 'border-0': !buttonOnly, 'h-auto': !buttonOnly, - 'py-0': !buttonOnly, // `dropdown-toggle` is needed for proper // corner rounding in button only mode 'dropdown-toggle': buttonOnly, From c61d83908f5a0b7057f79d4bd076e7a6b124b62e Mon Sep 17 00:00:00 2001 From: Troy Morehouse Date: Wed, 8 Apr 2020 16:30:58 -0300 Subject: [PATCH 15/40] Update _custom-controls.scss --- src/_custom-controls.scss | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/_custom-controls.scss b/src/_custom-controls.scss index 1bedec084dd..ebebf51e676 100644 --- a/src/_custom-controls.scss +++ b/src/_custom-controls.scss @@ -31,9 +31,11 @@ // Shared BVFormBtnLabelControl styling // Currently used by BFormTimepicker and BFormDatepicker +// Does not apply to button-only styling .b-form-btn-label-control { // Remove background validation images from main wrapper background-image: none; + padding: 0; @at-root { // Prevent the button/label from reversing order on in horizontal RTL mode @@ -51,6 +53,7 @@ line-height: 1; font-size: inherit; box-shadow: none !important; + border: 0; &:disabled { pointer-events: none; @@ -70,11 +73,10 @@ } > label { - // Unfortunately this is not supported by all browsers :( - // text-align: end; outline: 0; padding-left: 0.25rem; margin: 0; + border: 0; @if $enable-pointer-cursor-for-buttons { cursor: pointer; } From 0e59b4ea65b8ea29ee230bc78bd7850d06092fda Mon Sep 17 00:00:00 2001 From: Troy Morehouse Date: Wed, 8 Apr 2020 16:33:46 -0300 Subject: [PATCH 16/40] Update bv-form-btn-label-control.js --- src/utils/bv-form-btn-label-control.js | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/utils/bv-form-btn-label-control.js b/src/utils/bv-form-btn-label-control.js index 038da2b9fc4..54875eaf863 100644 --- a/src/utils/bv-form-btn-label-control.js +++ b/src/utils/bv-form-btn-label-control.js @@ -174,7 +174,6 @@ export const BVFormBtnLabelControl = /*#__PURE__*/ Vue.extend({ class: { [`btn-${buttonVariant}`]: buttonOnly, [`btn-${size}`]: !!size, - 'border-0': !buttonOnly, 'h-auto': !buttonOnly, // `dropdown-toggle` is needed for proper // corner rounding in button only mode @@ -250,7 +249,7 @@ export const BVFormBtnLabelControl = /*#__PURE__*/ Vue.extend({ const $label = h( 'label', { - staticClass: 'form-control text-break text-wrap border-0 bg-transparent h-auto', + staticClass: 'form-control text-break text-wrap bg-transparent h-auto', class: { // Hidden in button only mode 'sr-only': buttonOnly, @@ -293,7 +292,6 @@ export const BVFormBtnLabelControl = /*#__PURE__*/ Vue.extend({ 'form-control': !buttonOnly, [`form-control-${size}`]: !!size && !buttonOnly, 'd-flex': !buttonOnly, - 'p-0': !buttonOnly, 'h-auto': !buttonOnly, 'align-items-stretch': !buttonOnly, focus: hasFocus && !buttonOnly, From 885d60944601f4a6dd0a2a6d377029f8a9b9577f Mon Sep 17 00:00:00 2001 From: Troy Morehouse Date: Wed, 8 Apr 2020 16:38:24 -0300 Subject: [PATCH 17/40] Update calendar.js --- src/components/calendar/calendar.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/components/calendar/calendar.js b/src/components/calendar/calendar.js index 9ea2b4fa097..c3a52740a7a 100644 --- a/src/components/calendar/calendar.js +++ b/src/components/calendar/calendar.js @@ -1097,9 +1097,9 @@ export const BCalendar = Vue.extend({ 'div', { staticClass: 'b-calendar', - // We use a style here rather than class `d-inline-block` so that users can + // We use a style here rather than class `d-inline-flex` so that users can // override the display value (`d-*` classes use the `!important` flag) - style: this.block ? {} : { display: 'inline-block' } + style: this.block ? {} : { display: 'inline-flex' } }, [$widget] ) From 5add1b52d13e7d959490e8b17556c892f85bd5c1 Mon Sep 17 00:00:00 2001 From: Troy Morehouse Date: Wed, 8 Apr 2020 17:37:55 -0300 Subject: [PATCH 18/40] Update _calendar.scss --- src/components/calendar/_calendar.scss | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/components/calendar/_calendar.scss b/src/components/calendar/_calendar.scss index 85abf4496d6..3483932f95d 100644 --- a/src/components/calendar/_calendar.scss +++ b/src/components/calendar/_calendar.scss @@ -1,6 +1,8 @@ // BCalendar custom styles .b-calendar { + display: inline-flex; + .b-calendar-inner { // Prevent calendar from going below this width min-width: 250px; From b97a65d7023b6db3429dcab63597542dfb4f9cd8 Mon Sep 17 00:00:00 2001 From: Troy Morehouse Date: Wed, 8 Apr 2020 17:41:33 -0300 Subject: [PATCH 19/40] Update calendar.js --- src/components/calendar/calendar.js | 12 +----------- 1 file changed, 1 insertion(+), 11 deletions(-) diff --git a/src/components/calendar/calendar.js b/src/components/calendar/calendar.js index c3a52740a7a..204ae8be9e4 100644 --- a/src/components/calendar/calendar.js +++ b/src/components/calendar/calendar.js @@ -1063,7 +1063,6 @@ export const BCalendar = Vue.extend({ 'div', { staticClass: 'b-calendar-inner', - class: this.block ? 'd-block' : 'd-inline-block', style: this.block ? {} : { width: this.width }, attrs: { id: idWidget, @@ -1093,15 +1092,6 @@ export const BCalendar = Vue.extend({ ) // Wrap in an outer div that can be styled - return h( - 'div', - { - staticClass: 'b-calendar', - // We use a style here rather than class `d-inline-flex` so that users can - // override the display value (`d-*` classes use the `!important` flag) - style: this.block ? {} : { display: 'inline-flex' } - }, - [$widget] - ) + return h('div', { staticClass: 'b-calendar', class: { 'd-block': this.block } }, [$widget]) } }) From 7c18f770400a751602050b65a67fc03d7dcb42ed Mon Sep 17 00:00:00 2001 From: Troy Morehouse Date: Wed, 8 Apr 2020 17:59:18 -0300 Subject: [PATCH 20/40] Update _time.scss --- src/components/time/_time.scss | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/components/time/_time.scss b/src/components/time/_time.scss index e72e4845f20..651f24e1065 100644 --- a/src/components/time/_time.scss +++ b/src/components/time/_time.scss @@ -21,4 +21,8 @@ flex-direction: row-reverse; } } + + .b-time-ampm { + margin-left: .5rem; + } } From 691d41f2b63b1c08517eb731329cd13b2397234f Mon Sep 17 00:00:00 2001 From: Troy Morehouse Date: Wed, 8 Apr 2020 18:10:19 -0300 Subject: [PATCH 21/40] Update _time.scss --- src/components/time/_time.scss | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/src/components/time/_time.scss b/src/components/time/_time.scss index 651f24e1065..86d76b70f9b 100644 --- a/src/components/time/_time.scss +++ b/src/components/time/_time.scss @@ -22,6 +22,19 @@ } } + .b-time-header { + margin-bottom: 0.5rem; + + output { + padding: 0.25rem; + font-size: 80%; + } + } + + .b-time-footer { + margin-top: 0.5rem; + } + .b-time-ampm { margin-left: .5rem; } From b14db743d2eee73e979869a9dbc14f83b6540391 Mon Sep 17 00:00:00 2001 From: Troy Morehouse Date: Wed, 8 Apr 2020 18:10:23 -0300 Subject: [PATCH 22/40] Update time.js --- src/components/time/time.js | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/components/time/time.js b/src/components/time/time.js index 649b9a76be2..edba83d7310 100644 --- a/src/components/time/time.js +++ b/src/components/time/time.js @@ -512,7 +512,7 @@ export const BTime = /*#__PURE__*/ Vue.extend({ // Hours $spinners.push( - makeSpinbutton(this.setHours, 'hours', '', { + makeSpinbutton(this.setHours, 'hours', 'b-time-hours', { value: this.modelHours, max: 23, step: 1, @@ -526,7 +526,7 @@ export const BTime = /*#__PURE__*/ Vue.extend({ // Minutes $spinners.push( - makeSpinbutton(this.setMinutes, 'minutes', '', { + makeSpinbutton(this.setMinutes, 'minutes', 'b-time-minutes', { value: this.modelMinutes, max: 59, step: this.minutesStep || 1, @@ -540,7 +540,7 @@ export const BTime = /*#__PURE__*/ Vue.extend({ $spinners.push(makeColon()) // Seconds $spinners.push( - makeSpinbutton(this.setSeconds, 'seconds', '', { + makeSpinbutton(this.setSeconds, 'seconds', 'b-time-seconds', { value: this.modelSeconds, max: 59, step: this.secondsStep || 1, @@ -557,7 +557,7 @@ export const BTime = /*#__PURE__*/ Vue.extend({ // And switch class `ml-2` to `mr-2` // Note some LTR locales (i.e. zh) also place AM/PM to the left $spinners.push( - makeSpinbutton(this.setAmpm, 'ampm', 'ml-2', { + makeSpinbutton(this.setAmpm, 'ampm', 'b-time-ampm', { value: this.modelAmpm, max: 1, formatterFn: this.formatAmpm, @@ -594,7 +594,7 @@ export const BTime = /*#__PURE__*/ Vue.extend({ const $value = h( 'output', { - staticClass: 'border rounded d-block p-1 small text-center', + staticClass: 'form-control form-control-sm text-center', class: { disabled: this.disabled || this.readonly }, @@ -619,13 +619,13 @@ export const BTime = /*#__PURE__*/ Vue.extend({ ) const $header = h( 'header', - { class: { 'sr-only': this.hideHeader, 'mb-2': !this.hideHeader } }, + { staticClass: 'b-time-header', class: { 'sr-only': this.hideHeader } }, [$value] ) // Optional bottom slot let $slot = this.normalizeSlot('default') - $slot = $slot ? h('footer', { staticClass: 'mt-2' }, $slot) : h() + $slot = $slot ? h('footer', { staticClass: 'b-time-footer' }, $slot) : h() return h( 'div', From 63c50fee0f389fd4223dfda9603d0d5f68fb5ea8 Mon Sep 17 00:00:00 2001 From: Troy Morehouse Date: Wed, 8 Apr 2020 18:36:28 -0300 Subject: [PATCH 23/40] Update form-timepicker.js --- src/components/form-timepicker/form-timepicker.js | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/src/components/form-timepicker/form-timepicker.js b/src/components/form-timepicker/form-timepicker.js index ff552dc9170..564e5b71663 100644 --- a/src/components/form-timepicker/form-timepicker.js +++ b/src/components/form-timepicker/form-timepicker.js @@ -331,9 +331,7 @@ export const BFormTimepicker = /*#__PURE__*/ Vue.extend({ } }, render(h) { - const localHMS = this.localHMS - const disabled = this.disabled - const readonly = this.readonly + const { localHMS, disabled, readonly} = this const placeholder = isUndefinedOrNull(this.placeholder) ? this.labelNoTimeSelected : this.placeholder @@ -347,7 +345,6 @@ export const BFormTimepicker = /*#__PURE__*/ Vue.extend({ h( BButton, { - staticClass: 'mx-1', props: { size: 'sm', disabled: disabled || readonly, variant: this.nowButtonVariant }, attrs: { 'aria-label': label || null }, on: { click: this.onNowButton } @@ -363,7 +360,6 @@ export const BFormTimepicker = /*#__PURE__*/ Vue.extend({ h( BButton, { - staticClass: 'mx-1', props: { size: 'sm', disabled: disabled || readonly, variant: this.resetButtonVariant }, attrs: { 'aria-label': label || null }, on: { click: this.onResetButton } @@ -379,7 +375,6 @@ export const BFormTimepicker = /*#__PURE__*/ Vue.extend({ h( BButton, { - staticClass: 'mx-1', props: { size: 'sm', disabled, variant: this.closeButtonVariant }, attrs: { 'aria-label': label || null }, on: { click: this.onCloseButton } @@ -394,7 +389,7 @@ export const BFormTimepicker = /*#__PURE__*/ Vue.extend({ h( 'div', { - staticClass: 'b-form-date-controls d-flex flex-wrap mx-n1', + staticClass: 'b-form-date-controls d-flex flex-wrap', class: { 'justify-content-between': $footer.length > 1, 'justify-content-end': $footer.length < 2 From 5fc8e42e7d65d6307f17502f50316e5c08487b06 Mon Sep 17 00:00:00 2001 From: Troy Morehouse Date: Wed, 8 Apr 2020 18:38:55 -0300 Subject: [PATCH 24/40] lint --- src/components/form-timepicker/form-timepicker.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/form-timepicker/form-timepicker.js b/src/components/form-timepicker/form-timepicker.js index 564e5b71663..ce4c301cf67 100644 --- a/src/components/form-timepicker/form-timepicker.js +++ b/src/components/form-timepicker/form-timepicker.js @@ -331,7 +331,7 @@ export const BFormTimepicker = /*#__PURE__*/ Vue.extend({ } }, render(h) { - const { localHMS, disabled, readonly} = this + const { localHMS, disabled, readonly } = this const placeholder = isUndefinedOrNull(this.placeholder) ? this.labelNoTimeSelected : this.placeholder From 3a996e737c19f405e20d1ac0be64184e198103ba Mon Sep 17 00:00:00 2001 From: Troy Morehouse Date: Wed, 8 Apr 2020 18:51:30 -0300 Subject: [PATCH 25/40] Update form-spinbutton.js --- src/components/form-spinbutton/form-spinbutton.js | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/src/components/form-spinbutton/form-spinbutton.js b/src/components/form-spinbutton/form-spinbutton.js index 57f95b86302..978f63c54e8 100644 --- a/src/components/form-spinbutton/form-spinbutton.js +++ b/src/components/form-spinbutton/form-spinbutton.js @@ -516,9 +516,6 @@ export const BFormSpinbutton = /*#__PURE__*/ Vue.extend({ 'd-flex': isVertical, 'align-self-center': !isVertical, 'align-items-center': isVertical, - 'py-1': isVertical, - 'px-1': !isVertical, - 'mx-1': isVertical, 'border-top': isVertical, 'border-bottom': isVertical, 'border-left': !isVertical, @@ -551,7 +548,7 @@ export const BFormSpinbutton = /*#__PURE__*/ Vue.extend({ return h( 'div', { - staticClass: 'b-form-spinbutton form-control p-0', + staticClass: 'b-form-spinbutton form-control', class: { disabled: isDisabled, readonly: isReadonly, From 963248a8766fe02f20249690e4788b8807fbfa7d Mon Sep 17 00:00:00 2001 From: Troy Morehouse Date: Wed, 8 Apr 2020 18:51:36 -0300 Subject: [PATCH 26/40] Update _spinbutton.scss --- src/components/form-spinbutton/_spinbutton.scss | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/src/components/form-spinbutton/_spinbutton.scss b/src/components/form-spinbutton/_spinbutton.scss index fad6b00a283..d0c0353a0b4 100644 --- a/src/components/form-spinbutton/_spinbutton.scss +++ b/src/components/form-spinbutton/_spinbutton.scss @@ -1,13 +1,12 @@ -.b-form-spinbutton.form-control { +.b-form-spinbutton { text-align: center; // Quick way to get end buttons rounded on outside edges overflow: hidden; // Hide validation icon, as there is no room for it background-image: none; + padding: 0; &.flex-column { - height: auto; - width: auto; } @at-root { @@ -23,6 +22,8 @@ outline: 0; border: 0; background-color: transparent; + margin: 0; + padding: 0 0.25rem; > div, > bdi { @@ -33,6 +34,16 @@ } } + &.flex-column { + height: auto; + width: auto; + + output { + margin: 0 0.25rem; + padding: 0.25rem 0; + } + } + &.d-inline-flex:not(.flex-column) { &, output { From 5e17088af6b0de4f1f412e283b1a8952673e49a9 Mon Sep 17 00:00:00 2001 From: Troy Morehouse Date: Wed, 8 Apr 2020 18:53:19 -0300 Subject: [PATCH 27/40] Update _spinbutton.scss --- src/components/form-spinbutton/_spinbutton.scss | 3 --- 1 file changed, 3 deletions(-) diff --git a/src/components/form-spinbutton/_spinbutton.scss b/src/components/form-spinbutton/_spinbutton.scss index d0c0353a0b4..4c7df502fff 100644 --- a/src/components/form-spinbutton/_spinbutton.scss +++ b/src/components/form-spinbutton/_spinbutton.scss @@ -6,9 +6,6 @@ background-image: none; padding: 0; - &.flex-column { - } - @at-root { // Prevent the buttons from reversing order on in horizontal RTL mode [dir="rtl"] &:not(.flex-column), From b78f1e15e1aa16b396aaadb3bbb582cd694c3ea9 Mon Sep 17 00:00:00 2001 From: Troy Morehouse Date: Wed, 8 Apr 2020 19:46:50 -0300 Subject: [PATCH 28/40] Update README.md --- src/components/form-spinbutton/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/form-spinbutton/README.md b/src/components/form-spinbutton/README.md index ace16b2bb2d..84c27ad8f9e 100644 --- a/src/components/form-spinbutton/README.md +++ b/src/components/form-spinbutton/README.md @@ -403,7 +403,7 @@ Note the the `repeat-delay`, `repeat-threshold` and `repeat-interval` only appli ## Implementation notes -`` uses a mixture of Bootstrap v4 utility classes (margin, padding, and flex), +`` uses a mixture of Bootstrap v4 utility classes (border, alignment, flex), form-control and button classes, along with additional custom BootstrapVue SCSS/CSS. ## See also From 5092cee293752044eb605cc82fefac852320a36b Mon Sep 17 00:00:00 2001 From: Troy Morehouse Date: Wed, 8 Apr 2020 19:59:31 -0300 Subject: [PATCH 29/40] Update _spinbutton.scss --- src/components/form-spinbutton/_spinbutton.scss | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/src/components/form-spinbutton/_spinbutton.scss b/src/components/form-spinbutton/_spinbutton.scss index 4c7df502fff..6c716979e60 100644 --- a/src/components/form-spinbutton/_spinbutton.scss +++ b/src/components/form-spinbutton/_spinbutton.scss @@ -19,6 +19,7 @@ outline: 0; border: 0; background-color: transparent; + width: auto; margin: 0; padding: 0 0.25rem; @@ -41,13 +42,16 @@ } } - &.d-inline-flex:not(.flex-column) { - &, - output { - width: auto; + &:not(.d-inline-flex):not(.flex-column) { + output: { + width: 100%; } } + &.d-inline-flex:not(.flex-column) { + width: auto; + } + .btn { line-height: 1; box-shadow: none !important; From e49517b8c9c6365174533195118e9be81d879fa8 Mon Sep 17 00:00:00 2001 From: Troy Morehouse Date: Wed, 8 Apr 2020 19:59:37 -0300 Subject: [PATCH 30/40] Update form-spinbutton.js --- src/components/form-spinbutton/form-spinbutton.js | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/components/form-spinbutton/form-spinbutton.js b/src/components/form-spinbutton/form-spinbutton.js index 978f63c54e8..8f2fece996e 100644 --- a/src/components/form-spinbutton/form-spinbutton.js +++ b/src/components/form-spinbutton/form-spinbutton.js @@ -512,7 +512,6 @@ export const BFormSpinbutton = /*#__PURE__*/ Vue.extend({ key: 'output', staticClass: 'flex-grow-1', class: { - 'w-100': !isVertical && !isInline, 'd-flex': isVertical, 'align-self-center': !isVertical, 'align-items-center': isVertical, @@ -542,7 +541,7 @@ export const BFormSpinbutton = /*#__PURE__*/ Vue.extend({ 'aria-valuetext': hasValue ? formatter(value) : null } }, - [h('bdi', { staticClass: 'w-100' }, hasValue ? formatter(value) : this.placeholder || '')] + [h('bdi', {}, hasValue ? formatter(value) : this.placeholder || '')] ) return h( From b0ebe5e03bdd0fddf8b8d7c6939e69adccf0b0aa Mon Sep 17 00:00:00 2001 From: Troy Morehouse Date: Wed, 8 Apr 2020 20:42:46 -0300 Subject: [PATCH 31/40] Update form-timepicker.js --- src/components/form-timepicker/form-timepicker.js | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/components/form-timepicker/form-timepicker.js b/src/components/form-timepicker/form-timepicker.js index ce4c301cf67..1052feebfde 100644 --- a/src/components/form-timepicker/form-timepicker.js +++ b/src/components/form-timepicker/form-timepicker.js @@ -355,6 +355,9 @@ export const BFormTimepicker = /*#__PURE__*/ Vue.extend({ } if (this.resetButton) { + if ($footer.length > 0) { + $footer.push(' ') + } const label = this.labelResetButton $footer.push( h( @@ -370,6 +373,9 @@ export const BFormTimepicker = /*#__PURE__*/ Vue.extend({ } if (!this.noCloseButton) { + if ($footer.length > 0) { + $footer.push(' ') + } const label = this.labelCloseButton $footer.push( h( From dbb06e765787b61952762864b39c466b08cd47a7 Mon Sep 17 00:00:00 2001 From: Troy Morehouse Date: Wed, 8 Apr 2020 21:22:41 -0300 Subject: [PATCH 32/40] Update form-timepicker.js --- src/components/form-timepicker/form-timepicker.js | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/components/form-timepicker/form-timepicker.js b/src/components/form-timepicker/form-timepicker.js index 1052feebfde..1e91aa1b2b0 100644 --- a/src/components/form-timepicker/form-timepicker.js +++ b/src/components/form-timepicker/form-timepicker.js @@ -345,6 +345,7 @@ export const BFormTimepicker = /*#__PURE__*/ Vue.extend({ h( BButton, { + key: 'now-btn', props: { size: 'sm', disabled: disabled || readonly, variant: this.nowButtonVariant }, attrs: { 'aria-label': label || null }, on: { click: this.onNowButton } @@ -356,13 +357,14 @@ export const BFormTimepicker = /*#__PURE__*/ Vue.extend({ if (this.resetButton) { if ($footer.length > 0) { - $footer.push(' ') + $footer.push(h('span', ' ')) } const label = this.labelResetButton $footer.push( h( BButton, { + key: 'reset-btn', props: { size: 'sm', disabled: disabled || readonly, variant: this.resetButtonVariant }, attrs: { 'aria-label': label || null }, on: { click: this.onResetButton } @@ -374,13 +376,14 @@ export const BFormTimepicker = /*#__PURE__*/ Vue.extend({ if (!this.noCloseButton) { if ($footer.length > 0) { - $footer.push(' ') + $footer.push(h('span', ' ')) } const label = this.labelCloseButton $footer.push( h( BButton, { + key: 'close-btn', props: { size: 'sm', disabled, variant: this.closeButtonVariant }, attrs: { 'aria-label': label || null }, on: { click: this.onCloseButton } From a0d4528b84ca527c4d548a08a3f3e3e95e797a0a Mon Sep 17 00:00:00 2001 From: Troy Morehouse Date: Wed, 8 Apr 2020 21:42:56 -0300 Subject: [PATCH 33/40] Update form-timepicker.js --- src/components/form-timepicker/form-timepicker.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/components/form-timepicker/form-timepicker.js b/src/components/form-timepicker/form-timepicker.js index 1e91aa1b2b0..d894eb93781 100644 --- a/src/components/form-timepicker/form-timepicker.js +++ b/src/components/form-timepicker/form-timepicker.js @@ -357,7 +357,8 @@ export const BFormTimepicker = /*#__PURE__*/ Vue.extend({ if (this.resetButton) { if ($footer.length > 0) { - $footer.push(h('span', ' ')) + // Add a "spacer" betwen buttons (' ') + $footer.push(h('span', '\u00a0')) } const label = this.labelResetButton $footer.push( @@ -376,7 +377,8 @@ export const BFormTimepicker = /*#__PURE__*/ Vue.extend({ if (!this.noCloseButton) { if ($footer.length > 0) { - $footer.push(h('span', ' ')) + // Add a "spacer" betwen buttons (' ') + $footer.push(h('span', '\u00a0')) } const label = this.labelCloseButton $footer.push( From 5dbba43bc07487ee86d62c52b9ef861a38509adc Mon Sep 17 00:00:00 2001 From: Troy Morehouse Date: Wed, 8 Apr 2020 22:26:49 -0300 Subject: [PATCH 34/40] Update README.md --- src/components/calendar/README.md | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/components/calendar/README.md b/src/components/calendar/README.md index 02d8cdbd0fd..bcae22f01a3 100644 --- a/src/components/calendar/README.md +++ b/src/components/calendar/README.md @@ -661,9 +661,8 @@ the best possible accessibility to _all_ users. ## Implementation notes -`` uses Bootstrap's margin, padding, border, and flex utility classes, along with button -(`btn-*`) classes and the `form-control` class. BootstrapVue's custom SCSS/CSS is also required for -proper styling. +`` uses Bootstrap's border and flex utility classes, along with button (`btn-*`) classes +and the `form-control` class. BootstrapVue's custom SCSS/CSS is also required for proper styling. Accessibility-wise, we chose _not_ to use the ARIA role `grid` for the calendar to minimize verbosity and to provide consistency across various screen readers (NVDA, when encountering role From 6dce6e24d39873654cd7b548c44b00819db323c5 Mon Sep 17 00:00:00 2001 From: Troy Morehouse Date: Wed, 8 Apr 2020 22:27:49 -0300 Subject: [PATCH 35/40] Update README.md --- src/components/form-datepicker/README.md | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/components/form-datepicker/README.md b/src/components/form-datepicker/README.md index e13671d0dcc..253d5533b4d 100644 --- a/src/components/form-datepicker/README.md +++ b/src/components/form-datepicker/README.md @@ -590,10 +590,8 @@ details. `` is based upon the components [``](/docs/components/calendar) and [``](/docs/components/dropdown). -`` uses Bootstrap's margin, padding, border, and flex utility classes, along with -button (`btn-*`) classes, dropdown (`dropdown*`) classes, and the `form-control*` (plus validation) -classes. - +`` uses Bootstrap's border and flex utility classes, along with button (`btn-*`) +classes, dropdown (`dropdown*`) classes, and the `form-control*` (plus validation) classes. BootstrapVue's Custom SCSS/CSS is also required for proper styling of the date picker and calendar. ## See also From ac5f6ed8b68e90d97aa871e1026a9850c7294ebe Mon Sep 17 00:00:00 2001 From: Troy Morehouse Date: Wed, 8 Apr 2020 22:28:44 -0300 Subject: [PATCH 36/40] Update README.md --- src/components/form-timepicker/README.md | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/components/form-timepicker/README.md b/src/components/form-timepicker/README.md index 40d34fce18b..5dcec9597c5 100644 --- a/src/components/form-timepicker/README.md +++ b/src/components/form-timepicker/README.md @@ -426,10 +426,8 @@ Refer to the [``](/docs/components/time#accessibility) documentation for `` is based upon the components [``](/docs/components/time) and [``](/docs/components/dropdown). -`` uses Bootstrap's margin, padding, border, and flex utility classes, along with -button (`btn-*`) classes, dropdown (`dropdown*`) classes, and the `form-control*` (plus validation) -classes. - +`` uses Bootstrap's border and flex utility classes, along with button (`btn-*`) +classes, dropdown (`dropdown*`) classes, and the `form-control*` (plus validation) classes. BootstrapVue's Custom SCSS/CSS is also required for proper styling of the time picker and popup. ## See also From e315cab70de5ee4ca96155409cd301d65de36474 Mon Sep 17 00:00:00 2001 From: Troy Morehouse Date: Wed, 8 Apr 2020 22:29:34 -0300 Subject: [PATCH 37/40] Update README.md --- src/components/time/README.md | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/components/time/README.md b/src/components/time/README.md index 20f52195f6d..0bfcba3b5d5 100644 --- a/src/components/time/README.md +++ b/src/components/time/README.md @@ -409,9 +409,8 @@ prompts and descriptions. The `` component is based upon the custom BootstrapVue component [``](/docs/components/form-spinbutton). -`` uses Bootstrap's margin, padding, border, and flex utility classes, along with button -(`btn-*`) classes and the `form-control` class. BootstrapVue's custom SCSS/CSS is also required for -proper styling. +`` uses Bootstrap's border and flex utility classes, along with button (`btn-*`) classes and +the `form-control` class. BootstrapVue's custom SCSS/CSS is also required for proper styling. ## See also From 7e4892fd5d02a2d0bfe2fc63a197e9aadff51c1e Mon Sep 17 00:00:00 2001 From: Troy Morehouse Date: Thu, 9 Apr 2020 04:47:36 -0300 Subject: [PATCH 38/40] Update README.md --- src/components/avatar/README.md | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/components/avatar/README.md b/src/components/avatar/README.md index d7e915f75f3..690418c0555 100644 --- a/src/components/avatar/README.md +++ b/src/components/avatar/README.md @@ -7,9 +7,8 @@ ## Overview -Avatars are lightweight functional components, which render inline by default, so that they are -vertically centered beside any adjoining plain text. They also can be used as children of other -components. +Avatars are lightweight components, which render inline by default, so that they are vertically +centered beside any adjoining plain text. They also can be used as children of other components. ```html