Skip to content

Commit

Permalink
Re-ordering js default objects
Browse files Browse the repository at this point in the history
  • Loading branch information
louismaximepiton authored and mdo committed Jun 2, 2022
1 parent 824c5a0 commit 4804a31
Show file tree
Hide file tree
Showing 10 changed files with 69 additions and 69 deletions.
2 changes: 1 addition & 1 deletion js/src/carousel.js
Original file line number Diff line number Diff line change
Expand Up @@ -80,8 +80,8 @@ const Default = {
const DefaultType = {
interval: '(number|boolean)',
keyboard: 'boolean',
ride: '(boolean|string)',
pause: '(string|boolean)',
ride: '(boolean|string)',
touch: 'boolean',
wrap: 'boolean'
}
Expand Down
8 changes: 4 additions & 4 deletions js/src/collapse.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,13 +45,13 @@ const SELECTOR_ACTIVES = '.collapse.show, .collapse.collapsing'
const SELECTOR_DATA_TOGGLE = '[data-bs-toggle="collapse"]'

const Default = {
toggle: true,
parent: null
parent: null,
toggle: true
}

const DefaultType = {
toggle: 'boolean',
parent: '(null|element)'
parent: '(null|element)',
toggle: 'boolean'
}

/**
Expand Down
12 changes: 6 additions & 6 deletions js/src/dropdown.js
Original file line number Diff line number Diff line change
Expand Up @@ -68,21 +68,21 @@ const PLACEMENT_TOPCENTER = 'top'
const PLACEMENT_BOTTOMCENTER = 'bottom'

const Default = {
offset: [0, 2],
autoClose: true,
boundary: 'clippingParents',
reference: 'toggle',
display: 'dynamic',
offset: [0, 2],
popperConfig: null,
autoClose: true
reference: 'toggle'
}

const DefaultType = {
offset: '(array|string|function)',
autoClose: '(boolean|string)',
boundary: '(string|element)',
reference: '(string|element|object)',
display: 'string',
offset: '(array|string|function)',
popperConfig: '(null|object|function)',
autoClose: '(boolean|string)'
reference: '(string|element|object)'
}

/**
Expand Down
8 changes: 4 additions & 4 deletions js/src/modal.js
Original file line number Diff line number Diff line change
Expand Up @@ -46,14 +46,14 @@ const SELECTOR_DATA_TOGGLE = '[data-bs-toggle="modal"]'

const Default = {
backdrop: true,
keyboard: true,
focus: true
focus: true,
keyboard: true
}

const DefaultType = {
backdrop: '(boolean|string)',
keyboard: 'boolean',
focus: 'boolean'
focus: 'boolean',
keyboard: 'boolean'
}

/**
Expand Down
14 changes: 7 additions & 7 deletions js/src/popover.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,15 +19,15 @@ const SELECTOR_CONTENT = '.popover-body'

const Default = {
...Tooltip.Default,
placement: 'right',
offset: [0, 8],
trigger: 'click',
content: '',
offset: [0, 8],
placement: 'right',
template: '<div class="popover" role="tooltip">' +
'<div class="popover-arrow"></div>' +
'<h3 class="popover-header"></h3>' +
'<div class="popover-body"></div>' +
'</div>'
'<div class="popover-arrow"></div>' +
'<h3 class="popover-header"></h3>' +
'<div class="popover-body"></div>' +
'</div>',
trigger: 'click'
}

const DefaultType = {
Expand Down
50 changes: 25 additions & 25 deletions js/src/tooltip.js
Original file line number Diff line number Diff line change
Expand Up @@ -54,46 +54,46 @@ const AttachmentMap = {
}

const Default = {
allowList: DefaultAllowlist,
animation: true,
template: '<div class="tooltip" role="tooltip">' +
'<div class="tooltip-arrow"></div>' +
'<div class="tooltip-inner"></div>' +
'</div>',
trigger: 'hover focus',
title: '',
boundary: 'clippingParents',
container: false,
customClass: '',
delay: 0,
fallbackPlacements: ['top', 'right', 'bottom', 'left'],
html: false,
selector: false,
placement: 'top',
offset: [0, 0],
container: false,
fallbackPlacements: ['top', 'right', 'bottom', 'left'],
boundary: 'clippingParents',
customClass: '',
placement: 'top',
popperConfig: null,
sanitize: true,
sanitizeFn: null,
allowList: DefaultAllowlist,
popperConfig: null
selector: false,
template: '<div class="tooltip" role="tooltip">' +
'<div class="tooltip-arrow"></div>' +
'<div class="tooltip-inner"></div>' +
'</div>',
title: '',
trigger: 'hover focus'
}

const DefaultType = {
allowList: 'object',
animation: 'boolean',
template: 'string',
title: '(string|element|function)',
trigger: 'string',
boundary: '(string|element)',
container: '(string|element|boolean)',
customClass: '(string|function)',
delay: '(number|object)',
fallbackPlacements: 'array',
html: 'boolean',
selector: '(string|boolean)',
placement: '(string|function)',
offset: '(array|string|function)',
container: '(string|element|boolean)',
fallbackPlacements: 'array',
boundary: '(string|element)',
customClass: '(string|function)',
placement: '(string|function)',
popperConfig: '(null|object|function)',
sanitize: 'boolean',
sanitizeFn: '(null|function)',
allowList: 'object',
popperConfig: '(null|object|function)'
selector: '(string|boolean)',
template: 'string',
title: '(string|element|function)',
trigger: 'string'
}

/**
Expand Down
12 changes: 6 additions & 6 deletions js/src/util/backdrop.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,18 +20,18 @@ const EVENT_MOUSEDOWN = `mousedown.bs.${NAME}`

const Default = {
className: 'modal-backdrop',
isVisible: true, // if false, we use the backdrop helper without adding any element to the dom
clickCallback: null,
isAnimated: false,
rootElement: 'body', // give the choice to place backdrop under different elements
clickCallback: null
isVisible: true, // if false, we use the backdrop helper without adding any element to the dom
rootElement: 'body' // give the choice to place backdrop under different elements
}

const DefaultType = {
className: 'string',
isVisible: 'boolean',
clickCallback: '(function|null)',
isAnimated: 'boolean',
rootElement: '(element|string)',
clickCallback: '(function|null)'
isVisible: 'boolean',
rootElement: '(element|string)'
}

/**
Expand Down
8 changes: 4 additions & 4 deletions js/src/util/focustrap.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,13 +24,13 @@ const TAB_NAV_FORWARD = 'forward'
const TAB_NAV_BACKWARD = 'backward'

const Default = {
trapElement: null, // The element to trap focus inside of
autofocus: true
autofocus: true,
trapElement: null // The element to trap focus inside of
}

const DefaultType = {
trapElement: 'element',
autofocus: 'boolean'
autofocus: 'boolean',
trapElement: 'element'
}

/**
Expand Down
8 changes: 4 additions & 4 deletions js/src/util/swipe.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,15 +26,15 @@ const CLASS_NAME_POINTER_EVENT = 'pointer-event'
const SWIPE_THRESHOLD = 40

const Default = {
endCallback: null,
leftCallback: null,
rightCallback: null,
endCallback: null
rightCallback: null
}

const DefaultType = {
endCallback: '(function|null)',
leftCallback: '(function|null)',
rightCallback: '(function|null)',
endCallback: '(function|null)'
rightCallback: '(function|null)'
}

/**
Expand Down
16 changes: 8 additions & 8 deletions js/src/util/template-factory.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,28 +17,28 @@ import Config from './config'
const NAME = 'TemplateFactory'

const Default = {
extraClass: '',
template: '<div></div>',
allowList: DefaultAllowlist,
content: {}, // { selector : text , selector2 : text2 , }
extraClass: '',
html: false,
sanitize: true,
sanitizeFn: null,
allowList: DefaultAllowlist
template: '<div></div>'
}

const DefaultType = {
extraClass: '(string|function)',
template: 'string',
allowList: 'object',
content: 'object',
extraClass: '(string|function)',
html: 'boolean',
sanitize: 'boolean',
sanitizeFn: '(null|function)',
allowList: 'object'
template: 'string'
}

const DefaultContentType = {
selector: '(string|element)',
entry: '(string|element|function|null)'
entry: '(string|element|function|null)',
selector: '(string|element)'
}

/**
Expand Down

0 comments on commit 4804a31

Please sign in to comment.