forstok-ui-lib 6.2.10 → 6.2.12
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.ts +4 -1
- package/dist/index.js +1018 -420
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +1067 -469
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
- package/src/assets/javascripts/function.ts +33 -0
- package/src/assets/stylesheets/shares.styles.ts +821 -253
package/package.json
CHANGED
|
@@ -646,4 +646,37 @@ export const isTablet = () => {
|
|
|
646
646
|
|
|
647
647
|
export const isMobile = () => {
|
|
648
648
|
return document.body.clientWidth < 768 ? true : false;
|
|
649
|
+
}
|
|
650
|
+
|
|
651
|
+
export const evCloseDropdown = (currentTarget: EventTarget & HTMLElement) => {
|
|
652
|
+
const containerEl = currentTarget.closest('._refContainer') as HTMLElement
|
|
653
|
+
const isOpen = containerEl ? containerEl.classList.contains('is-shown') : false
|
|
654
|
+
if (isOpen) {
|
|
655
|
+
const containerRefs = document.getElementsByClassName('_refContainer is-shown') as HTMLCollectionOf<HTMLElement>
|
|
656
|
+
if (containerRefs?.length) {
|
|
657
|
+
for (let i = 0; i < containerRefs.length; i++) {
|
|
658
|
+
const overlay = containerRefs[i].querySelector(`._refDropdownOverlay`) as HTMLElement
|
|
659
|
+
overlay && (overlay.style.display = 'none')
|
|
660
|
+
containerRefs[i].classList.remove('is-shown')
|
|
661
|
+
}
|
|
662
|
+
}
|
|
663
|
+
const refScrollContainerEl = document.querySelector('._refScrollContainer') as HTMLElement
|
|
664
|
+
const bodyEl = document.getElementsByTagName('BODY')[0] as HTMLBodyElement
|
|
665
|
+
bodyEl.classList.remove('is-immuned')
|
|
666
|
+
if (refScrollContainerEl) {
|
|
667
|
+
refScrollContainerEl.style.overflow = 'auto'
|
|
668
|
+
const child = refScrollContainerEl.firstChild as HTMLElement
|
|
669
|
+
child.style.overflowY = 'unset'
|
|
670
|
+
}
|
|
671
|
+
}
|
|
672
|
+
}
|
|
673
|
+
|
|
674
|
+
export const evSetTotal = (totalCount: number, totalEl: HTMLSpanElement, callback?: () => void) => {
|
|
675
|
+
if (totalCount && totalEl) {
|
|
676
|
+
totalEl.innerText =`(${totalCount})`
|
|
677
|
+
totalEl.removeAttribute('hidden')
|
|
678
|
+
}
|
|
679
|
+
if (callback && typeof(callback) == "function") {
|
|
680
|
+
callback()
|
|
681
|
+
}
|
|
649
682
|
}
|