@coreui/coreui-pro
Advanced tools
Comparing version 5.1.0 to 5.2.0
/*! | ||
* CoreUI alert.js v5.1.0 (https://coreui.io) | ||
* CoreUI alert.js v5.2.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.1.0 (https://coreui.io) | ||
* CoreUI base-component.js v5.2.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.1.0'; | ||
const VERSION = '5.2.0'; | ||
@@ -30,0 +30,0 @@ /** |
/*! | ||
* CoreUI button.js v5.1.0 (https://coreui.io) | ||
* CoreUI button.js v5.2.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.1.0 (https://coreui.io) | ||
* CoreUI calendar.js v5.2.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 carousel.js v5.1.0 (https://coreui.io) | ||
* CoreUI carousel.js v5.2.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.1.0 (https://coreui.io) | ||
* CoreUI collapse.js v5.2.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.1.0 (https://coreui.io) | ||
* CoreUI date-picker.js v5.2.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-range-picker.js v5.1.0 (https://coreui.io) | ||
* CoreUI date-range-picker.js v5.2.0 (https://coreui.io) | ||
* Copyright 2024 The CoreUI Team (https://github.com/orgs/coreui/people) | ||
@@ -47,2 +47,3 @@ * Licensed under MIT (https://github.com/coreui/coreui/blob/main/LICENSE) | ||
const DATA_API_KEY = '.data-api'; | ||
const ESCAPE_KEY = 'Escape'; | ||
const TAB_KEY = 'Tab'; | ||
@@ -55,2 +56,3 @@ const RIGHT_MOUSE_BUTTON = 2; | ||
const EVENT_INPUT = 'input'; | ||
const EVENT_KEYDOWN = `keydown${EVENT_KEY}`; | ||
const EVENT_RESIZE = 'resize'; | ||
@@ -317,2 +319,7 @@ const EVENT_SHOW = `show${EVENT_KEY}`; | ||
}); | ||
EventHandler.on(this._element, EVENT_KEYDOWN, event => { | ||
if (event.key === ESCAPE_KEY) { | ||
this.hide(); | ||
} | ||
}); | ||
EventHandler.on(this._startInput, EVENT_CLICK, () => { | ||
@@ -319,0 +326,0 @@ this._selectEndDate = false; |
/*! | ||
* CoreUI data.js v5.1.0 (https://coreui.io) | ||
* CoreUI data.js v5.2.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.1.0 (https://coreui.io) | ||
* CoreUI event-handler.js v5.2.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.1.0 (https://coreui.io) | ||
* CoreUI manipulator.js v5.2.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.1.0 (https://coreui.io) | ||
* CoreUI selector-engine.js v5.2.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.1.0 (https://coreui.io) | ||
* CoreUI dropdown.js v5.2.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.1.0 (https://coreui.io) | ||
* CoreUI loading-button.js v5.2.0 (https://coreui.io) | ||
* Copyright 2024 The CoreUI Team (https://github.com/orgs/coreui/people) | ||
@@ -32,2 +32,3 @@ * Licensed under MIT (https://github.com/coreui/coreui/blob/main/LICENSE) | ||
const CLASS_NAME_IS_LOADING = 'is-loading'; | ||
const CLASS_NAME_LOADING_BUTTON = 'btn-loading'; | ||
const CLASS_NAME_LOADING_BUTTON_SPINNER = 'btn-loading-spinner'; | ||
@@ -62,2 +63,3 @@ const SELECTOR_DATA_TOGGLE = '[data-coreui-toggle="loading-button"]'; | ||
} | ||
this._createButton(); | ||
} | ||
@@ -117,2 +119,5 @@ | ||
} | ||
_createButton() { | ||
this._element.classList.add(CLASS_NAME_LOADING_BUTTON); | ||
} | ||
_createSpinner() { | ||
@@ -119,0 +124,0 @@ if (this._config.spinner) { |
/*! | ||
* CoreUI modal.js v5.1.0 (https://coreui.io) | ||
* CoreUI modal.js v5.2.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.1.0 (https://coreui.io) | ||
* CoreUI multi-select.js v5.2.0 (https://coreui.io) | ||
* Copyright 2024 The CoreUI Team (https://github.com/orgs/coreui/people) | ||
@@ -49,4 +49,8 @@ * Licensed under MIT (https://github.com/coreui/coreui/blob/main/LICENSE) | ||
const DATA_API_KEY = '.data-api'; | ||
const ESCAPE_KEY = 'Escape'; | ||
const TAB_KEY = 'Tab'; | ||
const RIGHT_MOUSE_BUTTON = 2; | ||
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 | ||
const SELECTOR_CLEANER = '.form-multi-select-cleaner'; | ||
@@ -60,2 +64,3 @@ const SELECTOR_OPTGROUP = '.form-multi-select-optgroup'; | ||
const SELECTOR_SELECTION = '.form-multi-select-selection'; | ||
const SELECTOR_VISIBLE_ITEMS = '.form-multi-select-options .form-multi-select-option:not(.disabled):not(:disabled)'; | ||
const EVENT_CHANGED = `changed${EVENT_KEY}`; | ||
@@ -196,2 +201,4 @@ const EVENT_CLICK = `click${EVENT_KEY}`; | ||
} | ||
this._searchElement.value = ''; | ||
this._onSearchChange(this._searchElement); | ||
this._clone.classList.remove(CLASS_NAME_SHOW); | ||
@@ -258,2 +265,7 @@ this._clone.setAttribute('aria-expanded', 'false'); | ||
}); | ||
EventHandler.on(this._clone, EVENT_KEYDOWN, event => { | ||
if (event.key === ESCAPE_KEY) { | ||
this.hide(); | ||
} | ||
}); | ||
EventHandler.on(this._indicatorElement, EVENT_CLICK, event => { | ||
@@ -295,6 +307,7 @@ event.preventDefault(); | ||
this._onOptionsClick(event.target); | ||
if (this._config.search) { | ||
SelectorEngine.findOne(SELECTOR_SEARCH, this._clone).focus(); | ||
} | ||
} | ||
if ([ARROW_UP_KEY, ARROW_DOWN_KEY].includes(event.key)) { | ||
event.preventDefault(); | ||
this._selectMenuItem(event); | ||
} | ||
}); | ||
@@ -530,2 +543,3 @@ } | ||
const closeBtn = document.createElement('button'); | ||
closeBtn.type = 'button'; | ||
closeBtn.classList.add(CLASS_NAME_TAG_DELETE); | ||
@@ -753,3 +767,16 @@ closeBtn.setAttribute('aria-label', 'Close'); | ||
} | ||
_selectMenuItem({ | ||
key, | ||
target | ||
}) { | ||
const items = SelectorEngine.find(SELECTOR_VISIBLE_ITEMS, this._menu).filter(element => index_js.isVisible(element)); | ||
if (!items.length) { | ||
return; | ||
} | ||
// if target isn't included in items (e.g. when expanding the dropdown) | ||
// allow cycling to get the last item in case key equals ARROW_UP_KEY | ||
index_js.getNextActiveElement(items, target, key === ARROW_DOWN_KEY, !items.includes(target)).focus(); | ||
} | ||
// Static | ||
@@ -756,0 +783,0 @@ |
/*! | ||
* CoreUI navigation.js v5.1.0 (https://coreui.io) | ||
* CoreUI navigation.js v5.2.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.1.0 (https://coreui.io) | ||
* CoreUI offcanvas.js v5.2.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.1.0 (https://coreui.io) | ||
* CoreUI popover.js v5.2.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.1.0 (https://coreui.io) | ||
* CoreUI rating.js v5.2.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 scrollspy.js v5.1.0 (https://coreui.io) | ||
* CoreUI scrollspy.js v5.2.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.1.0 (https://coreui.io) | ||
* CoreUI sidebar.js v5.2.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.1.0 (https://coreui.io) | ||
* CoreUI tab.js v5.2.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.1.0 (https://coreui.io) | ||
* CoreUI time-picker.js v5.2.0 (https://coreui.io) | ||
* Copyright 2024 The CoreUI Team (https://github.com/orgs/coreui/people) | ||
@@ -48,2 +48,3 @@ * Licensed under MIT (https://github.com/coreui/coreui/blob/main/LICENSE) | ||
const ENTER_KEY = 'Enter'; | ||
const ESCAPE_KEY = 'Escape'; | ||
const SPACE_KEY = 'Space'; | ||
@@ -56,2 +57,3 @@ const TAB_KEY = 'Tab'; | ||
const EVENT_INPUT = 'input'; | ||
const EVENT_KEYDOWN = `keydown${EVENT_KEY}`; | ||
const EVENT_SHOW = `show${EVENT_KEY}`; | ||
@@ -276,2 +278,7 @@ const EVENT_SHOWN = `shown${EVENT_KEY}`; | ||
}); | ||
EventHandler.on(this._element, EVENT_KEYDOWN, event => { | ||
if (event.key === ESCAPE_KEY) { | ||
this.hide(); | ||
} | ||
}); | ||
EventHandler.on(this._element, 'timeChange.coreui.time-picker', () => { | ||
@@ -278,0 +285,0 @@ if (this._config.variant === 'roll') { |
/*! | ||
* CoreUI toast.js v5.1.0 (https://coreui.io) | ||
* CoreUI toast.js v5.2.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.1.0 (https://coreui.io) | ||
* CoreUI tooltip.js v5.2.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.1.0 (https://coreui.io) | ||
* CoreUI backdrop.js v5.2.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.1.0 (https://coreui.io) | ||
* CoreUI calendar.js v5.2.0 (https://coreui.io) | ||
* Copyright 2024 The CoreUI Team (https://github.com/orgs/coreui/people) | ||
@@ -32,3 +32,5 @@ * Licensed under MIT (https://github.com/coreui/coreui/blob/main/LICENSE) | ||
} | ||
return new Date(Date.parse(date)); | ||
const _date = new Date(Date.parse(date)); | ||
const userTimezoneOffset = _date.getTimezoneOffset() * 60000; | ||
return new Date(_date.getTime() + userTimezoneOffset); | ||
}; | ||
@@ -45,9 +47,9 @@ const convertToLocalDate = (d, locale, options = {}) => d.toLocaleDateString(locale, options); | ||
if (order !== 0 && view === 'days') { | ||
return new Date(Date.UTC(calendarDate.getFullYear(), calendarDate.getMonth() + order, 1)); | ||
return new Date(calendarDate.getFullYear(), calendarDate.getMonth() + order, 1); | ||
} | ||
if (order !== 0 && view === 'months') { | ||
return new Date(Date.UTC(calendarDate.getFullYear() + order, calendarDate.getMonth(), 1)); | ||
return new Date(calendarDate.getFullYear() + order, calendarDate.getMonth(), 1); | ||
} | ||
if (order !== 0 && view === 'years') { | ||
return new Date(Date.UTC(calendarDate.getFullYear() + 12 * order, calendarDate.getMonth(), 1)); | ||
return new Date(calendarDate.getFullYear() + 12 * order, calendarDate.getMonth(), 1); | ||
} | ||
@@ -222,3 +224,6 @@ return calendarDate; | ||
const isDateInRange = (date, start, end) => { | ||
return start && end && start <= date && date <= end; | ||
const _date = removeTimeFromDate(date); | ||
const _start = start ? removeTimeFromDate(start) : null; | ||
const _end = end ? removeTimeFromDate(end) : null; | ||
return _start && _end && _start <= _date && _date <= _end; | ||
}; | ||
@@ -257,2 +262,3 @@ const isDateSelected = (date, start, end) => { | ||
}; | ||
const removeTimeFromDate = date => new Date(date.getFullYear(), date.getMonth(), date.getDate()); | ||
@@ -285,2 +291,3 @@ exports.convertIsoWeekToDate = convertIsoWeekToDate; | ||
exports.isValidDate = isValidDate; | ||
exports.removeTimeFromDate = removeTimeFromDate; | ||
@@ -287,0 +294,0 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); |
/*! | ||
* CoreUI component-functions.js v5.1.0 (https://coreui.io) | ||
* CoreUI component-functions.js v5.2.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.1.0 (https://coreui.io) | ||
* CoreUI config.js v5.2.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.1.0 (https://coreui.io) | ||
* CoreUI focustrap.js v5.2.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.1.0 (https://coreui.io) | ||
* CoreUI index.js v5.2.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.1.0 (https://coreui.io) | ||
* CoreUI sanitizer.js v5.2.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.1.0 (https://coreui.io) | ||
* CoreUI scrollbar.js v5.2.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.1.0 (https://coreui.io) | ||
* CoreUI swipe.js v5.2.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.1.0 (https://coreui.io) | ||
* CoreUI template-factory.js v5.2.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.1.0 (https://coreui.io) | ||
* CoreUI time.js v5.2.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.1.0' | ||
const VERSION = '5.2.0' | ||
@@ -23,0 +23,0 @@ /** |
@@ -27,2 +27,3 @@ /** | ||
const ESCAPE_KEY = 'Escape' | ||
const TAB_KEY = 'Tab' | ||
@@ -36,2 +37,3 @@ const RIGHT_MOUSE_BUTTON = 2 | ||
const EVENT_INPUT = 'input' | ||
const EVENT_KEYDOWN = `keydown${EVENT_KEY}` | ||
const EVENT_RESIZE = 'resize' | ||
@@ -332,2 +334,8 @@ const EVENT_SHOW = `show${EVENT_KEY}` | ||
EventHandler.on(this._element, EVENT_KEYDOWN, event => { | ||
if (event.key === ESCAPE_KEY) { | ||
this.hide() | ||
} | ||
}) | ||
EventHandler.on(this._startInput, EVENT_CLICK, () => { | ||
@@ -334,0 +342,0 @@ this._selectEndDate = false |
@@ -27,2 +27,3 @@ /** | ||
const CLASS_NAME_IS_LOADING = 'is-loading' | ||
const CLASS_NAME_LOADING_BUTTON = 'btn-loading' | ||
const CLASS_NAME_LOADING_BUTTON_SPINNER = 'btn-loading-spinner' | ||
@@ -62,2 +63,4 @@ | ||
} | ||
this._createButton() | ||
} | ||
@@ -129,2 +132,6 @@ | ||
_createButton() { | ||
this._element.classList.add(CLASS_NAME_LOADING_BUTTON) | ||
} | ||
_createSpinner() { | ||
@@ -131,0 +138,0 @@ if (this._config.spinner) { |
@@ -13,3 +13,8 @@ /** | ||
import SelectorEngine from './dom/selector-engine.js' | ||
import { defineJQueryPlugin, isRTL } from './util/index.js' | ||
import { | ||
defineJQueryPlugin, | ||
getNextActiveElement, | ||
isVisible, | ||
isRTL | ||
} from './util/index.js' | ||
@@ -27,4 +32,7 @@ /** | ||
const ESCAPE_KEY = 'Escape' | ||
const TAB_KEY = 'Tab' | ||
const RIGHT_MOUSE_BUTTON = 2 | ||
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 | ||
@@ -39,2 +47,3 @@ const SELECTOR_CLEANER = '.form-multi-select-cleaner' | ||
const SELECTOR_SELECTION = '.form-multi-select-selection' | ||
const SELECTOR_VISIBLE_ITEMS = '.form-multi-select-options .form-multi-select-option:not(.disabled):not(:disabled)' | ||
@@ -192,2 +201,4 @@ const EVENT_CHANGED = `changed${EVENT_KEY}` | ||
this._searchElement.value = '' | ||
this._onSearchChange(this._searchElement) | ||
this._clone.classList.remove(CLASS_NAME_SHOW) | ||
@@ -266,2 +277,8 @@ this._clone.setAttribute('aria-expanded', 'false') | ||
EventHandler.on(this._clone, EVENT_KEYDOWN, event => { | ||
if (event.key === ESCAPE_KEY) { | ||
this.hide() | ||
} | ||
}) | ||
EventHandler.on(this._indicatorElement, EVENT_CLICK, event => { | ||
@@ -312,6 +329,8 @@ event.preventDefault() | ||
this._onOptionsClick(event.target) | ||
if (this._config.search) { | ||
SelectorEngine.findOne(SELECTOR_SEARCH, this._clone).focus() | ||
} | ||
} | ||
if ([ARROW_UP_KEY, ARROW_DOWN_KEY].includes(event.key)) { | ||
event.preventDefault() | ||
this._selectMenuItem(event) | ||
} | ||
}) | ||
@@ -610,2 +629,3 @@ } | ||
const closeBtn = document.createElement('button') | ||
closeBtn.type = 'button' | ||
closeBtn.classList.add(CLASS_NAME_TAG_DELETE) | ||
@@ -888,2 +908,14 @@ closeBtn.setAttribute('aria-label', 'Close') | ||
_selectMenuItem({ key, target }) { | ||
const items = SelectorEngine.find(SELECTOR_VISIBLE_ITEMS, this._menu).filter(element => isVisible(element)) | ||
if (!items.length) { | ||
return | ||
} | ||
// if target isn't included in items (e.g. when expanding the dropdown) | ||
// allow cycling to get the last item in case key equals ARROW_UP_KEY | ||
getNextActiveElement(items, target, key === ARROW_DOWN_KEY, !items.includes(target)).focus() | ||
} | ||
// Static | ||
@@ -957,3 +989,2 @@ | ||
}) | ||
EventHandler.on(document, EVENT_CLICK_DATA_API, MultiSelect.clearMenus) | ||
@@ -960,0 +991,0 @@ EventHandler.on(document, EVENT_KEYUP_DATA_API, MultiSelect.clearMenus) |
@@ -33,2 +33,3 @@ /** | ||
const ENTER_KEY = 'Enter' | ||
const ESCAPE_KEY = 'Escape' | ||
const SPACE_KEY = 'Space' | ||
@@ -42,2 +43,3 @@ const TAB_KEY = 'Tab' | ||
const EVENT_INPUT = 'input' | ||
const EVENT_KEYDOWN = `keydown${EVENT_KEY}` | ||
const EVENT_SHOW = `show${EVENT_KEY}` | ||
@@ -262,2 +264,8 @@ const EVENT_SHOWN = `shown${EVENT_KEY}` | ||
EventHandler.on(this._element, EVENT_KEYDOWN, event => { | ||
if (event.key === ESCAPE_KEY) { | ||
this.hide() | ||
} | ||
}) | ||
EventHandler.on(this._element, 'timeChange.coreui.time-picker', () => { | ||
@@ -264,0 +272,0 @@ if (this._config.variant === 'roll') { |
@@ -26,3 +26,6 @@ export const convertIsoWeekToDate = isoWeek => { | ||
return new Date(Date.parse(date)) | ||
const _date = new Date(Date.parse(date)) | ||
const userTimezoneOffset = _date.getTimezoneOffset() * 60_000 | ||
return new Date(_date.getTime() + userTimezoneOffset) | ||
} | ||
@@ -45,11 +48,11 @@ | ||
if (order !== 0 && view === 'days') { | ||
return new Date(Date.UTC(calendarDate.getFullYear(), calendarDate.getMonth() + order, 1)) | ||
return new Date(calendarDate.getFullYear(), calendarDate.getMonth() + order, 1) | ||
} | ||
if (order !== 0 && view === 'months') { | ||
return new Date(Date.UTC(calendarDate.getFullYear() + order, calendarDate.getMonth(), 1)) | ||
return new Date(calendarDate.getFullYear() + order, calendarDate.getMonth(), 1) | ||
} | ||
if (order !== 0 && view === 'years') { | ||
return new Date(Date.UTC(calendarDate.getFullYear() + (12 * order), calendarDate.getMonth(), 1)) | ||
return new Date(calendarDate.getFullYear() + (12 * order), calendarDate.getMonth(), 1) | ||
} | ||
@@ -206,6 +209,3 @@ | ||
// eslint-disable-next-line no-mixed-operators | ||
((date.getTime() - week1.getTime()) / 86400000 - | ||
3 + | ||
((week1.getDay() + 6) % 7)) / | ||
7 | ||
((date.getTime() - week1.getTime()) / 86_400_000 - 3 + ((week1.getDay() + 6) % 7)) / 7 | ||
) | ||
@@ -290,3 +290,7 @@ ) | ||
export const isDateInRange = (date, start, end) => { | ||
return start && end && start <= date && date <= end | ||
const _date = removeTimeFromDate(date) | ||
const _start = start ? removeTimeFromDate(start) : null | ||
const _end = end ? removeTimeFromDate(end) : null | ||
return _start && _end && _start <= _date && _date <= _end | ||
} | ||
@@ -345,1 +349,4 @@ | ||
} | ||
export const removeTimeFromDate = date => | ||
new Date(date.getFullYear(), date.getMonth(), date.getDate()) |
{ | ||
"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.1.0", | ||
"version": "5.2.0", | ||
"config": { | ||
@@ -97,8 +97,8 @@ "version_short": "5.0" | ||
"devDependencies": { | ||
"@babel/cli": "^7.24.5", | ||
"@babel/core": "^7.24.5", | ||
"@babel/preset-env": "^7.24.5", | ||
"@babel/cli": "^7.24.6", | ||
"@babel/core": "^7.24.6", | ||
"@babel/preset-env": "^7.24.6", | ||
"@popperjs/core": "^2.11.8", | ||
"@rollup/plugin-babel": "^6.0.4", | ||
"@rollup/plugin-commonjs": "^25.0.7", | ||
"@rollup/plugin-commonjs": "^25.0.8", | ||
"@rollup/plugin-node-resolve": "^15.2.3", | ||
@@ -120,3 +120,3 @@ "@rollup/plugin-replace": "^5.0.5", | ||
"hammer-simulator": "0.0.1", | ||
"hugo-bin": "^0.122.7", | ||
"hugo-bin": "^0.123.1", | ||
"ip": "^2.0.1", | ||
@@ -135,3 +135,3 @@ "jasmine": "^5.1.0", | ||
"lockfile-lint": "^4.13.2", | ||
"nodemon": "^3.1.0", | ||
"nodemon": "^3.1.1", | ||
"npm-run-all": "^4.1.5", | ||
@@ -141,9 +141,9 @@ "postcss": "^8.4.38", | ||
"postcss-combine-duplicated-selectors": "^10.0.3", | ||
"rollup": "^4.17.2", | ||
"rollup": "^4.18.0", | ||
"rollup-plugin-istanbul": "^5.0.0", | ||
"rtlcss": "^4.1.1", | ||
"sass": "^1.76.0", | ||
"sass": "^1.77.2", | ||
"sass-true": "^8.0.0", | ||
"shelljs": "^0.8.5", | ||
"stylelint": "^16.5.0", | ||
"stylelint": "^16.6.0", | ||
"stylelint-config-twbs-bootstrap": "^14.1.0", | ||
@@ -150,0 +150,0 @@ "terser": "5.31.0", |
@@ -46,7 +46,7 @@ <p align="center"> | ||
- [Download the latest release](https://github.com/coreui/coreui-pro/archive/v5.1.0.zip) | ||
- Clone the repo: `git clone https://github.com/coreui/coreui.git` | ||
- Install with [npm](https://www.npmjs.com/): `npm install @coreui/coreui` | ||
- Install with [yarn](https://yarnpkg.com/): `yarn add @coreui/coreui` | ||
- Install with [Composer](https://getcomposer.org/): `composer require coreui/coreui:5.1.0` | ||
- [Download the latest release](https://github.com/coreui/coreui-pro/archive/v5.2.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.2.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 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
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
21176767
129283