@coreui/coreui-pro
Advanced tools
Comparing version 5.5.0 to 5.6.0
/*! | ||
* CoreUI alert.js v5.5.0 (https://coreui.io) | ||
* CoreUI alert.js v5.6.0 (https://coreui.io) | ||
* Copyright 2024 The CoreUI Team (https://github.com/orgs/coreui/people) | ||
@@ -4,0 +4,0 @@ * Licensed under MIT (https://github.com/coreui/coreui/blob/main/LICENSE) |
/*! | ||
* CoreUI base-component.js v5.5.0 (https://coreui.io) | ||
* CoreUI base-component.js v5.6.0 (https://coreui.io) | ||
* Copyright 2024 The CoreUI Team (https://github.com/orgs/coreui/people) | ||
@@ -27,3 +27,3 @@ * Licensed under MIT (https://github.com/coreui/coreui/blob/main/LICENSE) | ||
const VERSION = '5.5.0'; | ||
const VERSION = '5.6.0'; | ||
@@ -30,0 +30,0 @@ /** |
/*! | ||
* CoreUI button.js v5.5.0 (https://coreui.io) | ||
* CoreUI button.js v5.6.0 (https://coreui.io) | ||
* Copyright 2024 The CoreUI Team (https://github.com/orgs/coreui/people) | ||
@@ -4,0 +4,0 @@ * Licensed under MIT (https://github.com/coreui/coreui/blob/main/LICENSE) |
/*! | ||
* CoreUI calendar.js v5.5.0 (https://coreui.io) | ||
* CoreUI calendar.js v5.6.0 (https://coreui.io) | ||
* Copyright 2024 The CoreUI Team (https://github.com/orgs/coreui/people) | ||
@@ -670,3 +670,3 @@ * Licensed under MIT (https://github.com/coreui/coreui/blob/main/LICENSE) | ||
return this.each(function () { | ||
const data = Calendar.getOrCreateInstance(this); | ||
const data = Calendar.getOrCreateInstance(this, config); | ||
if (typeof config !== 'string') { | ||
@@ -673,0 +673,0 @@ return; |
/*! | ||
* CoreUI carousel.js v5.5.0 (https://coreui.io) | ||
* CoreUI carousel.js v5.6.0 (https://coreui.io) | ||
* Copyright 2024 The CoreUI Team (https://github.com/orgs/coreui/people) | ||
@@ -4,0 +4,0 @@ * Licensed under MIT (https://github.com/coreui/coreui/blob/main/LICENSE) |
/*! | ||
* CoreUI collapse.js v5.5.0 (https://coreui.io) | ||
* CoreUI collapse.js v5.6.0 (https://coreui.io) | ||
* Copyright 2024 The CoreUI Team (https://github.com/orgs/coreui/people) | ||
@@ -4,0 +4,0 @@ * Licensed under MIT (https://github.com/coreui/coreui/blob/main/LICENSE) |
/*! | ||
* CoreUI date-picker.js v5.5.0 (https://coreui.io) | ||
* CoreUI date-picker.js v5.6.0 (https://coreui.io) | ||
* Copyright 2024 The CoreUI Team (https://github.com/orgs/coreui/people) | ||
@@ -94,3 +94,3 @@ * Licensed under MIT (https://github.com/coreui/coreui/blob/main/LICENSE) | ||
return this.each(function () { | ||
const data = DatePicker.getOrCreateInstance(this); | ||
const data = DatePicker.getOrCreateInstance(this, config); | ||
if (typeof config !== 'string') { | ||
@@ -97,0 +97,0 @@ return; |
/*! | ||
* CoreUI date-range-picker.js v5.5.0 (https://coreui.io) | ||
* CoreUI date-range-picker.js v5.6.0 (https://coreui.io) | ||
* Copyright 2024 The CoreUI Team (https://github.com/orgs/coreui/people) | ||
@@ -744,3 +744,3 @@ * Licensed under MIT (https://github.com/coreui/coreui/blob/main/LICENSE) | ||
return this.each(function () { | ||
const data = DateRangePicker.getOrCreateInstance(this); | ||
const data = DateRangePicker.getOrCreateInstance(this, config); | ||
if (typeof config !== 'string') { | ||
@@ -747,0 +747,0 @@ return; |
/*! | ||
* CoreUI data.js v5.5.0 (https://coreui.io) | ||
* CoreUI data.js v5.6.0 (https://coreui.io) | ||
* Copyright 2024 The CoreUI Team (https://github.com/orgs/coreui/people) | ||
@@ -4,0 +4,0 @@ * Licensed under MIT (https://github.com/coreui/coreui/blob/main/LICENSE) |
/*! | ||
* CoreUI event-handler.js v5.5.0 (https://coreui.io) | ||
* CoreUI event-handler.js v5.6.0 (https://coreui.io) | ||
* Copyright 2024 The CoreUI Team (https://github.com/orgs/coreui/people) | ||
@@ -4,0 +4,0 @@ * Licensed under MIT (https://github.com/coreui/coreui/blob/main/LICENSE) |
/*! | ||
* CoreUI manipulator.js v5.5.0 (https://coreui.io) | ||
* CoreUI manipulator.js v5.6.0 (https://coreui.io) | ||
* Copyright 2024 The CoreUI Team (https://github.com/orgs/coreui/people) | ||
@@ -4,0 +4,0 @@ * Licensed under MIT (https://github.com/coreui/coreui/blob/main/LICENSE) |
/*! | ||
* CoreUI selector-engine.js v5.5.0 (https://coreui.io) | ||
* CoreUI selector-engine.js v5.6.0 (https://coreui.io) | ||
* Copyright 2024 The CoreUI Team (https://github.com/orgs/coreui/people) | ||
@@ -4,0 +4,0 @@ * Licensed under MIT (https://github.com/coreui/coreui/blob/main/LICENSE) |
/*! | ||
* CoreUI dropdown.js v5.5.0 (https://coreui.io) | ||
* CoreUI dropdown.js v5.6.0 (https://coreui.io) | ||
* Copyright 2024 The CoreUI Team (https://github.com/orgs/coreui/people) | ||
@@ -4,0 +4,0 @@ * Licensed under MIT (https://github.com/coreui/coreui/blob/main/LICENSE) |
/*! | ||
* CoreUI loading-button.js v5.5.0 (https://coreui.io) | ||
* CoreUI loading-button.js v5.6.0 (https://coreui.io) | ||
* Copyright 2024 The CoreUI Team (https://github.com/orgs/coreui/people) | ||
@@ -4,0 +4,0 @@ * Licensed under MIT (https://github.com/coreui/coreui/blob/main/LICENSE) |
/*! | ||
* CoreUI modal.js v5.5.0 (https://coreui.io) | ||
* CoreUI modal.js v5.6.0 (https://coreui.io) | ||
* Copyright 2024 The CoreUI Team (https://github.com/orgs/coreui/people) | ||
@@ -4,0 +4,0 @@ * Licensed under MIT (https://github.com/coreui/coreui/blob/main/LICENSE) |
/*! | ||
* CoreUI multi-select.js v5.5.0 (https://coreui.io) | ||
* CoreUI multi-select.js v5.6.0 (https://coreui.io) | ||
* Copyright 2024 The CoreUI Team (https://github.com/orgs/coreui/people) | ||
@@ -49,6 +49,9 @@ * Licensed under MIT (https://github.com/coreui/coreui/blob/main/LICENSE) | ||
const DATA_API_KEY = '.data-api'; | ||
const ARROW_UP_KEY = 'ArrowUp'; | ||
const ARROW_DOWN_KEY = 'ArrowDown'; | ||
const BACKSPACE_KEY = 'Backspace'; | ||
const DELETE_KEY = 'Delete'; | ||
const ENTER_KEY = 'Enter'; | ||
const ESCAPE_KEY = 'Escape'; | ||
const TAB_KEY = 'Tab'; | ||
const ARROW_UP_KEY = 'ArrowUp'; | ||
const ARROW_DOWN_KEY = 'ArrowDown'; | ||
const RIGHT_MOUSE_BUTTON = 2; // MouseEvent.button value for the secondary button, usually the right button | ||
@@ -98,3 +101,5 @@ | ||
const Default = { | ||
ariaCleanerLabel: 'Clear all selections', | ||
cleaner: true, | ||
container: false, | ||
disabled: false, | ||
@@ -118,3 +123,5 @@ invalid: false, | ||
const DefaultType = { | ||
ariaCleanerLabel: 'string', | ||
cleaner: 'boolean', | ||
container: '(string|element|boolean)', | ||
disabled: 'boolean', | ||
@@ -129,3 +136,3 @@ invalid: 'boolean', | ||
required: 'boolean', | ||
search: 'boolean', | ||
search: '(boolean|string)', | ||
searchNoResultsLabel: 'string', | ||
@@ -192,2 +199,6 @@ selectAll: 'boolean', | ||
this._clone.setAttribute('aria-expanded', true); | ||
if (this._config.container) { | ||
this._menu.style.minWidth = `${this._clone.offsetWidth}px`; | ||
this._menu.classList.add(CLASS_NAME_SHOW); | ||
} | ||
EventHandler.trigger(this._element, EVENT_SHOWN); | ||
@@ -204,6 +215,11 @@ this._createPopper(); | ||
} | ||
this._searchElement.value = ''; | ||
if (this._config.search) { | ||
this._searchElement.value = ''; | ||
} | ||
this._onSearchChange(this._searchElement); | ||
this._clone.classList.remove(CLASS_NAME_SHOW); | ||
this._clone.setAttribute('aria-expanded', 'false'); | ||
if (this._config.container) { | ||
this._menu.classList.remove(CLASS_NAME_SHOW); | ||
} | ||
EventHandler.trigger(this._element, EVENT_HIDDEN); | ||
@@ -226,2 +242,3 @@ } | ||
this._selected = this._getSelectedOptions(this._options); | ||
this._menu.remove(); | ||
this._clone.remove(); | ||
@@ -272,4 +289,24 @@ this._element.innerHTML = ''; | ||
this.hide(); | ||
return; | ||
} | ||
if (this._config.search === 'global' && (event.key.length === 1 || event.key === BACKSPACE_KEY || event.key === DELETE_KEY)) { | ||
this._searchElement.focus(); | ||
} | ||
}); | ||
EventHandler.on(this._menu, EVENT_KEYDOWN, event => { | ||
if (this._config.search === 'global' && (event.key.length === 1 || event.key === BACKSPACE_KEY || event.key === DELETE_KEY)) { | ||
this._searchElement.focus(); | ||
} | ||
}); | ||
EventHandler.on(this._togglerElement, EVENT_KEYDOWN, event => { | ||
if (!this._isShown() && (event.key === ENTER_KEY || event.key === ARROW_DOWN_KEY)) { | ||
event.preventDefault(); | ||
this.show(); | ||
return; | ||
} | ||
if (this._isShown() && event.key === ARROW_DOWN_KEY) { | ||
event.preventDefault(); | ||
this._selectMenuItem(event); | ||
} | ||
}); | ||
EventHandler.on(this._indicatorElement, EVENT_CLICK, event => { | ||
@@ -284,4 +321,10 @@ event.preventDefault(); | ||
EventHandler.on(this._searchElement, EVENT_KEYDOWN, event => { | ||
const key = event.keyCode || event.charCode; | ||
if ((key === 8 || key === 46) && event.target.value.length === 0) { | ||
if (!this._isShown()) { | ||
this.show(); | ||
} | ||
if (event.key === ARROW_DOWN_KEY && this._searchElement.value.length === this._searchElement.selectionStart) { | ||
this._selectMenuItem(event); | ||
return; | ||
} | ||
if ((event.key === BACKSPACE_KEY || event.key === DELETE_KEY) && event.target.value.length === 0) { | ||
this._deselectLastOption(); | ||
@@ -309,4 +352,3 @@ } | ||
EventHandler.on(this._optionsElement, EVENT_KEYDOWN, event => { | ||
const key = event.keyCode || event.charCode; | ||
if (key === 13) { | ||
if (event.key === ENTER_KEY) { | ||
this._onOptionsClick(event.target); | ||
@@ -433,2 +475,5 @@ } | ||
this._togglerElement = togglerEl; | ||
if (!this._config.search && !this._config.disabled) { | ||
togglerEl.tabIndex = 0; | ||
} | ||
const selectionEl = document.createElement('div'); | ||
@@ -452,2 +497,3 @@ selectionEl.classList.add(CLASS_NAME_SELECTION); | ||
cleaner.style.display = 'none'; | ||
cleaner.setAttribute('aria-label', this._config.ariaCleanerLabel); | ||
buttons.append(cleaner); | ||
@@ -514,3 +560,11 @@ this._selectionCleanerElement = cleaner; | ||
dropdownDiv.append(optionsDiv); | ||
this._clone.append(dropdownDiv); | ||
const { | ||
container | ||
} = this._config; | ||
if (container) { | ||
// this._clone.parentNode.insertBefore(dropdownDiv, this._clone.nextSibling) | ||
index_js.getElement(container).append(dropdownDiv); | ||
} else { | ||
this._clone.append(dropdownDiv); | ||
} | ||
this._createOptions(optionsDiv, this._options); | ||
@@ -575,3 +629,3 @@ this._optionsElement = optionsDiv; | ||
text | ||
} = this._options.find(option => option.value === value); | ||
} = this._findOptionByValue(value); | ||
if (this._config.multiple && element.classList.contains(CLASS_NAME_SELECTED)) { | ||
@@ -590,2 +644,16 @@ this._deselectOption(value); | ||
} | ||
_findOptionByValue(value, options = this._options) { | ||
for (const option of options) { | ||
if (option.value === value) { | ||
return option; | ||
} | ||
if (option.options && Array.isArray(option.options)) { | ||
const found = this._findOptionByValue(value, option.options); | ||
if (found) { | ||
return found; | ||
} | ||
} | ||
} | ||
return null; | ||
} | ||
_selectOption(value, text) { | ||
@@ -746,3 +814,3 @@ if (!this._config.multiple) { | ||
_filterOptionsList() { | ||
const options = SelectorEngine.find(SELECTOR_OPTION, this._clone); | ||
const options = SelectorEngine.find(SELECTOR_OPTION, this._menu); | ||
let visibleOptions = 0; | ||
@@ -768,4 +836,4 @@ for (const option of options) { | ||
if (visibleOptions > 0) { | ||
if (SelectorEngine.findOne(SELECTOR_OPTIONS_EMPTY, this._clone)) { | ||
SelectorEngine.findOne(SELECTOR_OPTIONS_EMPTY, this._clone).remove(); | ||
if (SelectorEngine.findOne(SELECTOR_OPTIONS_EMPTY, this._menu)) { | ||
SelectorEngine.findOne(SELECTOR_OPTIONS_EMPTY, this._menu).remove(); | ||
} | ||
@@ -778,4 +846,4 @@ return; | ||
placeholder.innerHTML = this._config.searchNoResultsLabel; | ||
if (!SelectorEngine.findOne(SELECTOR_OPTIONS_EMPTY, this._clone)) { | ||
SelectorEngine.findOne(SELECTOR_OPTIONS, this._clone).append(placeholder); | ||
if (!SelectorEngine.findOne(SELECTOR_OPTIONS_EMPTY, this._menu)) { | ||
SelectorEngine.findOne(SELECTOR_OPTIONS, this._menu).append(placeholder); | ||
} | ||
@@ -782,0 +850,0 @@ } |
/*! | ||
* CoreUI navigation.js v5.5.0 (https://coreui.io) | ||
* CoreUI navigation.js v5.6.0 (https://coreui.io) | ||
* Copyright 2024 The CoreUI Team (https://github.com/orgs/coreui/people) | ||
@@ -4,0 +4,0 @@ * Licensed under MIT (https://github.com/coreui/coreui/blob/main/LICENSE) |
/*! | ||
* CoreUI offcanvas.js v5.5.0 (https://coreui.io) | ||
* CoreUI offcanvas.js v5.6.0 (https://coreui.io) | ||
* Copyright 2024 The CoreUI Team (https://github.com/orgs/coreui/people) | ||
@@ -4,0 +4,0 @@ * Licensed under MIT (https://github.com/coreui/coreui/blob/main/LICENSE) |
/*! | ||
* CoreUI popover.js v5.5.0 (https://coreui.io) | ||
* CoreUI popover.js v5.6.0 (https://coreui.io) | ||
* Copyright 2024 The CoreUI Team (https://github.com/orgs/coreui/people) | ||
@@ -4,0 +4,0 @@ * Licensed under MIT (https://github.com/coreui/coreui/blob/main/LICENSE) |
/*! | ||
* CoreUI rating.js v5.5.0 (https://coreui.io) | ||
* CoreUI rating.js v5.6.0 (https://coreui.io) | ||
* Copyright 2024 The CoreUI Team (https://github.com/orgs/coreui/people) | ||
@@ -46,2 +46,3 @@ * Licensed under MIT (https://github.com/coreui/coreui/blob/main/LICENSE) | ||
const CLASS_NAME_RATING_ITEM_LABEL = 'rating-item-label'; | ||
const CLASS_NAME_READONLY = 'readonly'; | ||
const SELECTOR_DATA_TOGGLE = '[data-coreui-toggle="rating"]'; | ||
@@ -313,2 +314,5 @@ const SELECTOR_RATING_ITEM_INPUT = '.rating-item-input'; | ||
} | ||
if (this._config.readOnly) { | ||
this._element.classList.add(CLASS_NAME_READONLY); | ||
} | ||
this._element.setAttribute('role', 'radiogroup'); | ||
@@ -428,3 +432,3 @@ Array.from({ | ||
return this.each(function () { | ||
const data = Rating.getOrCreateInstance(this); | ||
const data = Rating.getOrCreateInstance(this, config); | ||
if (typeof config !== 'string') { | ||
@@ -431,0 +435,0 @@ return; |
/*! | ||
* CoreUI scrollspy.js v5.5.0 (https://coreui.io) | ||
* CoreUI scrollspy.js v5.6.0 (https://coreui.io) | ||
* Copyright 2024 The CoreUI Team (https://github.com/orgs/coreui/people) | ||
@@ -4,0 +4,0 @@ * Licensed under MIT (https://github.com/coreui/coreui/blob/main/LICENSE) |
/*! | ||
* CoreUI sidebar.js v5.5.0 (https://coreui.io) | ||
* CoreUI sidebar.js v5.6.0 (https://coreui.io) | ||
* Copyright 2024 The CoreUI Team (https://github.com/orgs/coreui/people) | ||
@@ -4,0 +4,0 @@ * Licensed under MIT (https://github.com/coreui/coreui/blob/main/LICENSE) |
/*! | ||
* CoreUI tab.js v5.5.0 (https://coreui.io) | ||
* CoreUI tab.js v5.6.0 (https://coreui.io) | ||
* Copyright 2024 The CoreUI Team (https://github.com/orgs/coreui/people) | ||
@@ -4,0 +4,0 @@ * Licensed under MIT (https://github.com/coreui/coreui/blob/main/LICENSE) |
/*! | ||
* CoreUI time-picker.js v5.5.0 (https://coreui.io) | ||
* CoreUI time-picker.js v5.6.0 (https://coreui.io) | ||
* Copyright 2024 The CoreUI Team (https://github.com/orgs/coreui/people) | ||
@@ -632,3 +632,3 @@ * Licensed under MIT (https://github.com/coreui/coreui/blob/main/LICENSE) | ||
return this.each(function () { | ||
const data = TimePicker.getOrCreateInstance(this); | ||
const data = TimePicker.getOrCreateInstance(this, config); | ||
if (typeof config !== 'string') { | ||
@@ -635,0 +635,0 @@ return; |
/*! | ||
* CoreUI toast.js v5.5.0 (https://coreui.io) | ||
* CoreUI toast.js v5.6.0 (https://coreui.io) | ||
* Copyright 2024 The CoreUI Team (https://github.com/orgs/coreui/people) | ||
@@ -4,0 +4,0 @@ * Licensed under MIT (https://github.com/coreui/coreui/blob/main/LICENSE) |
/*! | ||
* CoreUI tooltip.js v5.5.0 (https://coreui.io) | ||
* CoreUI tooltip.js v5.6.0 (https://coreui.io) | ||
* Copyright 2024 The CoreUI Team (https://github.com/orgs/coreui/people) | ||
@@ -4,0 +4,0 @@ * Licensed under MIT (https://github.com/coreui/coreui/blob/main/LICENSE) |
/*! | ||
* CoreUI backdrop.js v5.5.0 (https://coreui.io) | ||
* CoreUI backdrop.js v5.6.0 (https://coreui.io) | ||
* Copyright 2024 The CoreUI Team (https://github.com/orgs/coreui/people) | ||
@@ -4,0 +4,0 @@ * Licensed under MIT (https://github.com/coreui/coreui/blob/main/LICENSE) |
/*! | ||
* CoreUI calendar.js v5.5.0 (https://coreui.io) | ||
* CoreUI calendar.js v5.6.0 (https://coreui.io) | ||
* Copyright 2024 The CoreUI Team (https://github.com/orgs/coreui/people) | ||
@@ -32,2 +32,7 @@ * Licensed under MIT (https://github.com/coreui/coreui/blob/main/LICENSE) | ||
} | ||
if (selectionType === 'month' || selectionType === 'year') { | ||
const _date = new Date(Date.parse(date)); | ||
const userTimezoneOffset = _date.getTimezoneOffset() * 60000; | ||
return new Date(_date.getTime() + userTimezoneOffset); | ||
} | ||
return new Date(Date.parse(date)); | ||
@@ -34,0 +39,0 @@ }; |
/*! | ||
* CoreUI component-functions.js v5.5.0 (https://coreui.io) | ||
* CoreUI component-functions.js v5.6.0 (https://coreui.io) | ||
* Copyright 2024 The CoreUI Team (https://github.com/orgs/coreui/people) | ||
@@ -4,0 +4,0 @@ * Licensed under MIT (https://github.com/coreui/coreui/blob/main/LICENSE) |
/*! | ||
* CoreUI config.js v5.5.0 (https://coreui.io) | ||
* CoreUI config.js v5.6.0 (https://coreui.io) | ||
* Copyright 2024 The CoreUI Team (https://github.com/orgs/coreui/people) | ||
@@ -4,0 +4,0 @@ * Licensed under MIT (https://github.com/coreui/coreui/blob/main/LICENSE) |
/*! | ||
* CoreUI focustrap.js v5.5.0 (https://coreui.io) | ||
* CoreUI focustrap.js v5.6.0 (https://coreui.io) | ||
* Copyright 2024 The CoreUI Team (https://github.com/orgs/coreui/people) | ||
@@ -4,0 +4,0 @@ * Licensed under MIT (https://github.com/coreui/coreui/blob/main/LICENSE) |
/*! | ||
* CoreUI index.js v5.5.0 (https://coreui.io) | ||
* CoreUI index.js v5.6.0 (https://coreui.io) | ||
* Copyright 2024 The CoreUI Team (https://github.com/orgs/coreui/people) | ||
@@ -4,0 +4,0 @@ * Licensed under MIT (https://github.com/coreui/coreui/blob/main/LICENSE) |
/*! | ||
* CoreUI sanitizer.js v5.5.0 (https://coreui.io) | ||
* CoreUI sanitizer.js v5.6.0 (https://coreui.io) | ||
* Copyright 2024 The CoreUI Team (https://github.com/orgs/coreui/people) | ||
@@ -4,0 +4,0 @@ * Licensed under MIT (https://github.com/coreui/coreui/blob/main/LICENSE) |
/*! | ||
* CoreUI scrollbar.js v5.5.0 (https://coreui.io) | ||
* CoreUI scrollbar.js v5.6.0 (https://coreui.io) | ||
* Copyright 2024 The CoreUI Team (https://github.com/orgs/coreui/people) | ||
@@ -4,0 +4,0 @@ * Licensed under MIT (https://github.com/coreui/coreui/blob/main/LICENSE) |
/*! | ||
* CoreUI swipe.js v5.5.0 (https://coreui.io) | ||
* CoreUI swipe.js v5.6.0 (https://coreui.io) | ||
* Copyright 2024 The CoreUI Team (https://github.com/orgs/coreui/people) | ||
@@ -4,0 +4,0 @@ * Licensed under MIT (https://github.com/coreui/coreui/blob/main/LICENSE) |
/*! | ||
* CoreUI template-factory.js v5.5.0 (https://coreui.io) | ||
* CoreUI template-factory.js v5.6.0 (https://coreui.io) | ||
* Copyright 2024 The CoreUI Team (https://github.com/orgs/coreui/people) | ||
@@ -4,0 +4,0 @@ * Licensed under MIT (https://github.com/coreui/coreui/blob/main/LICENSE) |
/*! | ||
* CoreUI time.js v5.5.0 (https://coreui.io) | ||
* CoreUI time.js v5.6.0 (https://coreui.io) | ||
* Copyright 2024 The CoreUI Team (https://github.com/orgs/coreui/people) | ||
@@ -4,0 +4,0 @@ * Licensed under MIT (https://github.com/coreui/coreui/blob/main/LICENSE) |
@@ -20,3 +20,3 @@ /** | ||
const VERSION = '5.5.0' | ||
const VERSION = '5.6.0' | ||
@@ -23,0 +23,0 @@ /** |
@@ -856,3 +856,3 @@ /* eslint-disable complexity, indent, multiline-ternary */ | ||
return this.each(function () { | ||
const data = Calendar.getOrCreateInstance(this) | ||
const data = Calendar.getOrCreateInstance(this, config) | ||
@@ -859,0 +859,0 @@ if (typeof config !== 'string') { |
@@ -99,3 +99,3 @@ /** | ||
return this.each(function () { | ||
const data = DatePicker.getOrCreateInstance(this) | ||
const data = DatePicker.getOrCreateInstance(this, config) | ||
@@ -102,0 +102,0 @@ if (typeof config !== 'string') { |
@@ -869,3 +869,3 @@ /** | ||
return this.each(function () { | ||
const data = DateRangePicker.getOrCreateInstance(this) | ||
const data = DateRangePicker.getOrCreateInstance(this, config) | ||
@@ -872,0 +872,0 @@ if (typeof config !== 'string') { |
@@ -16,2 +16,3 @@ /** | ||
getNextActiveElement, | ||
getElement, | ||
isVisible, | ||
@@ -32,6 +33,9 @@ isRTL | ||
const ARROW_UP_KEY = 'ArrowUp' | ||
const ARROW_DOWN_KEY = 'ArrowDown' | ||
const BACKSPACE_KEY = 'Backspace' | ||
const DELETE_KEY = 'Delete' | ||
const ENTER_KEY = 'Enter' | ||
const ESCAPE_KEY = 'Escape' | ||
const TAB_KEY = 'Tab' | ||
const ARROW_UP_KEY = 'ArrowUp' | ||
const ARROW_DOWN_KEY = 'ArrowDown' | ||
const RIGHT_MOUSE_BUTTON = 2 // MouseEvent.button value for the secondary button, usually the right button | ||
@@ -84,3 +88,5 @@ | ||
const Default = { | ||
ariaCleanerLabel: 'Clear all selections', | ||
cleaner: true, | ||
container: false, | ||
disabled: false, | ||
@@ -105,3 +111,5 @@ invalid: false, | ||
const DefaultType = { | ||
ariaCleanerLabel: 'string', | ||
cleaner: 'boolean', | ||
container: '(string|element|boolean)', | ||
disabled: 'boolean', | ||
@@ -116,3 +124,3 @@ invalid: 'boolean', | ||
required: 'boolean', | ||
search: 'boolean', | ||
search: '(boolean|string)', | ||
searchNoResultsLabel: 'string', | ||
@@ -187,2 +195,8 @@ selectAll: 'boolean', | ||
this._clone.setAttribute('aria-expanded', true) | ||
if (this._config.container) { | ||
this._menu.style.minWidth = `${this._clone.offsetWidth}px` | ||
this._menu.classList.add(CLASS_NAME_SHOW) | ||
} | ||
EventHandler.trigger(this._element, EVENT_SHOWN) | ||
@@ -204,6 +218,14 @@ | ||
this._searchElement.value = '' | ||
if (this._config.search) { | ||
this._searchElement.value = '' | ||
} | ||
this._onSearchChange(this._searchElement) | ||
this._clone.classList.remove(CLASS_NAME_SHOW) | ||
this._clone.setAttribute('aria-expanded', 'false') | ||
if (this._config.container) { | ||
this._menu.classList.remove(CLASS_NAME_SHOW) | ||
} | ||
EventHandler.trigger(this._element, EVENT_HIDDEN) | ||
@@ -230,2 +252,3 @@ } | ||
this._selected = this._getSelectedOptions(this._options) | ||
this._menu.remove() | ||
this._clone.remove() | ||
@@ -284,5 +307,29 @@ this._element.innerHTML = '' | ||
this.hide() | ||
return | ||
} | ||
if (this._config.search === 'global' && (event.key.length === 1 || event.key === BACKSPACE_KEY || event.key === DELETE_KEY)) { | ||
this._searchElement.focus() | ||
} | ||
}) | ||
EventHandler.on(this._menu, EVENT_KEYDOWN, event => { | ||
if (this._config.search === 'global' && (event.key.length === 1 || event.key === BACKSPACE_KEY || event.key === DELETE_KEY)) { | ||
this._searchElement.focus() | ||
} | ||
}) | ||
EventHandler.on(this._togglerElement, EVENT_KEYDOWN, event => { | ||
if (!this._isShown() && (event.key === ENTER_KEY || event.key === ARROW_DOWN_KEY)) { | ||
event.preventDefault() | ||
this.show() | ||
return | ||
} | ||
if (this._isShown() && event.key === ARROW_DOWN_KEY) { | ||
event.preventDefault() | ||
this._selectMenuItem(event) | ||
} | ||
}) | ||
EventHandler.on(this._indicatorElement, EVENT_CLICK, event => { | ||
@@ -299,5 +346,12 @@ event.preventDefault() | ||
EventHandler.on(this._searchElement, EVENT_KEYDOWN, event => { | ||
const key = event.keyCode || event.charCode | ||
if (!this._isShown()) { | ||
this.show() | ||
} | ||
if ((key === 8 || key === 46) && event.target.value.length === 0) { | ||
if (event.key === ARROW_DOWN_KEY && this._searchElement.value.length === this._searchElement.selectionStart) { | ||
this._selectMenuItem(event) | ||
return | ||
} | ||
if ((event.key === BACKSPACE_KEY || event.key === DELETE_KEY) && event.target.value.length === 0) { | ||
this._deselectLastOption() | ||
@@ -330,5 +384,3 @@ } | ||
EventHandler.on(this._optionsElement, EVENT_KEYDOWN, event => { | ||
const key = event.keyCode || event.charCode | ||
if (key === 13) { | ||
if (event.key === ENTER_KEY) { | ||
this._onOptionsClick(event.target) | ||
@@ -485,2 +537,6 @@ } | ||
if (!this._config.search && !this._config.disabled) { | ||
togglerEl.tabIndex = 0 | ||
} | ||
const selectionEl = document.createElement('div') | ||
@@ -509,2 +565,3 @@ selectionEl.classList.add(CLASS_NAME_SELECTION) | ||
cleaner.style.display = 'none' | ||
cleaner.setAttribute('aria-label', this._config.ariaCleanerLabel) | ||
@@ -550,2 +607,3 @@ buttons.append(cleaner) | ||
} | ||
this._popper = Popper.createPopper(this._togglerElement, this._menu, popperConfig) | ||
@@ -592,3 +650,9 @@ } | ||
this._clone.append(dropdownDiv) | ||
const { container } = this._config | ||
if (container) { | ||
// this._clone.parentNode.insertBefore(dropdownDiv, this._clone.nextSibling) | ||
getElement(container).append(dropdownDiv) | ||
} else { | ||
this._clone.append(dropdownDiv) | ||
} | ||
@@ -667,3 +731,3 @@ this._createOptions(optionsDiv, this._options) | ||
const value = String(element.dataset.value) | ||
const { text } = this._options.find(option => option.value === value) | ||
const { text } = this._findOptionByValue(value) | ||
@@ -685,2 +749,19 @@ if (this._config.multiple && element.classList.contains(CLASS_NAME_SELECTED)) { | ||
_findOptionByValue(value, options = this._options) { | ||
for (const option of options) { | ||
if (option.value === value) { | ||
return option | ||
} | ||
if (option.options && Array.isArray(option.options)) { | ||
const found = this._findOptionByValue(value, option.options) | ||
if (found) { | ||
return found | ||
} | ||
} | ||
} | ||
return null | ||
} | ||
_selectOption(value, text) { | ||
@@ -880,3 +961,3 @@ if (!this._config.multiple) { | ||
_filterOptionsList() { | ||
const options = SelectorEngine.find(SELECTOR_OPTION, this._clone) | ||
const options = SelectorEngine.find(SELECTOR_OPTION, this._menu) | ||
let visibleOptions = 0 | ||
@@ -905,4 +986,4 @@ | ||
if (visibleOptions > 0) { | ||
if (SelectorEngine.findOne(SELECTOR_OPTIONS_EMPTY, this._clone)) { | ||
SelectorEngine.findOne(SELECTOR_OPTIONS_EMPTY, this._clone).remove() | ||
if (SelectorEngine.findOne(SELECTOR_OPTIONS_EMPTY, this._menu)) { | ||
SelectorEngine.findOne(SELECTOR_OPTIONS_EMPTY, this._menu).remove() | ||
} | ||
@@ -918,4 +999,4 @@ | ||
if (!SelectorEngine.findOne(SELECTOR_OPTIONS_EMPTY, this._clone)) { | ||
SelectorEngine.findOne(SELECTOR_OPTIONS, this._clone).append(placeholder) | ||
if (!SelectorEngine.findOne(SELECTOR_OPTIONS_EMPTY, this._menu)) { | ||
SelectorEngine.findOne(SELECTOR_OPTIONS, this._menu).append(placeholder) | ||
} | ||
@@ -922,0 +1003,0 @@ } |
@@ -44,2 +44,3 @@ /** | ||
const CLASS_NAME_RATING_ITEM_LABEL = 'rating-item-label' | ||
const CLASS_NAME_READONLY = 'readonly' | ||
@@ -359,2 +360,6 @@ const SELECTOR_DATA_TOGGLE = '[data-coreui-toggle="rating"]' | ||
if (this._config.readOnly) { | ||
this._element.classList.add(CLASS_NAME_READONLY) | ||
} | ||
this._element.setAttribute('role', 'radiogroup') | ||
@@ -489,3 +494,3 @@ Array.from({ length: this._config.itemCount }, (_, index) => this._createRatingItem(index)) | ||
return this.each(function () { | ||
const data = Rating.getOrCreateInstance(this) | ||
const data = Rating.getOrCreateInstance(this, config) | ||
@@ -492,0 +497,0 @@ if (typeof config !== 'string') { |
@@ -816,3 +816,3 @@ /** | ||
return this.each(function () { | ||
const data = TimePicker.getOrCreateInstance(this) | ||
const data = TimePicker.getOrCreateInstance(this, config) | ||
@@ -819,0 +819,0 @@ if (typeof config !== 'string') { |
@@ -26,2 +26,8 @@ export const convertIsoWeekToDate = isoWeek => { | ||
if (selectionType === 'month' || selectionType === 'year') { | ||
const _date = new Date(Date.parse(date)) | ||
const userTimezoneOffset = _date.getTimezoneOffset() * 60_000 | ||
return new Date(_date.getTime() + userTimezoneOffset) | ||
} | ||
return new Date(Date.parse(date)) | ||
@@ -28,0 +34,0 @@ } |
{ | ||
"name": "@coreui/coreui-pro", | ||
"description": "The most popular front-end framework for developing responsive, mobile-first projects on the web rewritten by the CoreUI Team", | ||
"version": "5.5.0", | ||
"version": "5.6.0", | ||
"config": { | ||
"version_short": "5.5" | ||
"version_short": "5.6" | ||
}, | ||
@@ -97,9 +97,9 @@ "keywords": [ | ||
"devDependencies": { | ||
"@babel/cli": "^7.25.7", | ||
"@babel/core": "^7.25.7", | ||
"@babel/preset-env": "^7.25.7", | ||
"@babel/cli": "^7.25.9", | ||
"@babel/core": "^7.26.0", | ||
"@babel/preset-env": "^7.26.0", | ||
"@docsearch/js": "^3.6.2", | ||
"@popperjs/core": "^2.11.8", | ||
"@rollup/plugin-babel": "^6.0.4", | ||
"@rollup/plugin-commonjs": "^28.0.0", | ||
"@rollup/plugin-commonjs": "^28.0.1", | ||
"@rollup/plugin-node-resolve": "^15.3.0", | ||
@@ -122,5 +122,5 @@ "@rollup/plugin-replace": "^6.0.1", | ||
"hammer-simulator": "0.0.1", | ||
"hugo-bin": "^0.132.0", | ||
"hugo-bin": "^0.133.5", | ||
"ip": "^2.0.1", | ||
"jasmine": "^5.3.0", | ||
"jasmine": "^5.4.0", | ||
"jquery": "^3.7.1", | ||
@@ -142,12 +142,12 @@ "karma": "^6.4.4", | ||
"postcss-combine-duplicated-selectors": "^10.0.3", | ||
"rollup": "^4.24.0", | ||
"rollup": "^4.24.1", | ||
"rollup-plugin-istanbul": "^5.0.0", | ||
"rtlcss": "^4.3.0", | ||
"sass": "^1.79.4", | ||
"sass": "1.78.0", | ||
"sass-true": "^8.1.0", | ||
"shelljs": "^0.8.5", | ||
"stylelint": "^16.9.0", | ||
"stylelint": "^16.10.0", | ||
"stylelint-config-twbs-bootstrap": "^15.1.0", | ||
"terser": "5.34.1", | ||
"vnu-jar": "23.4.11" | ||
"terser": "5.36.0", | ||
"vnu-jar": "24.10.17" | ||
}, | ||
@@ -154,0 +154,0 @@ "files": [ |
@@ -46,7 +46,7 @@ <p align="center"> | ||
- [Download the latest release](https://github.com/coreui/coreui-pro/archive/v5.5.0.zip) | ||
- [Download the latest release](https://github.com/coreui/coreui-pro/archive/v5.6.0.zip) | ||
- Clone the repo: `git clone https://github.com/coreui/coreui-pro.git` | ||
- Install with [npm](https://www.npmjs.com/): `npm install @coreui/coreui-pro` | ||
- Install with [yarn](https://yarnpkg.com/): `yarn add @coreui/coreui-pro` | ||
- Install with [Composer](https://getcomposer.org/): `composer require coreui/coreui-pro:5.5.0` | ||
- Install with [Composer](https://getcomposer.org/): `composer require coreui/coreui-pro:5.6.0` | ||
@@ -53,0 +53,0 @@ Read the [Getting started page](https://coreui.io/docs/getting-started/introduction/) for information on the framework contents, templates and examples, and more. |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
28215396
159235
299