@eturnity/eturnity_reusable_components 9.25.15 → 9.25.17
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/package.json
CHANGED
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
2
|
+
<path d="M11.4961 8.68262C11.4961 8.94088 11.5489 9.16727 11.6543 9.3623C11.765 9.55206 11.9173 9.70274 12.1123 9.81348C12.3074 9.91895 12.532 9.97168 12.7852 9.97168C13.0435 9.97167 13.2707 9.91894 13.4658 9.81348C13.666 9.70275 13.8184 9.55205 13.9238 9.3623C14.0292 9.16727 14.082 8.94087 14.082 8.68262V5.16992H15V8.68262C15 9.10959 14.9081 9.48408 14.7236 9.80566C14.5443 10.1274 14.2857 10.3783 13.9482 10.5576C13.6161 10.7316 13.223 10.8183 12.7695 10.8184C12.3319 10.8184 11.9465 10.7316 11.6143 10.5576C11.2873 10.3783 11.0313 10.1274 10.8467 9.80566C10.6674 9.48406 10.5782 9.10963 10.5781 8.68262V5.16992H11.4961V8.68262ZM4.40918 6.00879H1.91797V7.47949H4.11719V8.30273H1.91797V9.86914H4.43359V10.707H1V5.16992H4.40918V6.00879ZM7.50098 9.63184L9.26562 5.16992H10.2461L8.00781 10.707H7.00293L4.76465 5.16992H5.7373L7.50098 9.63184Z" fill="#263238"/>
|
|
3
|
+
</svg>
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
2
|
+
<path d="M9.59233 2.09407L4.4078 8.34331C4.2456 8.53883 4.38465 8.83486 4.63869 8.83486H6.85299C7.05209 8.83486 7.19596 9.02525 7.14159 9.21678L5.88818 13.6325C5.7996 13.9445 6.20054 14.1556 6.40767 13.9059L11.5922 7.65669C11.7544 7.46117 11.6154 7.16514 11.3613 7.16514H9.14701C8.94791 7.16514 8.80404 6.97475 8.85841 6.78322L10.1118 2.36754C10.2004 2.05547 9.79946 1.8444 9.59233 2.09407Z" fill="#263238"/>
|
|
3
|
+
</svg>
|
|
@@ -382,8 +382,9 @@
|
|
|
382
382
|
position: absolute;
|
|
383
383
|
z-index: 99;
|
|
384
384
|
top: 8px;
|
|
385
|
-
left
|
|
386
|
-
|
|
385
|
+
/* Anchor to the trigger's left and grow rightward; clampBoxToViewport()
|
|
386
|
+
shifts it back in when wide content would overflow the viewport. */
|
|
387
|
+
left: 0;
|
|
387
388
|
width: max-content;
|
|
388
389
|
max-width: calc(100vw - 32px);
|
|
389
390
|
background-color: ${(props) => props.theme.colors.white};
|
|
@@ -501,6 +502,7 @@
|
|
|
501
502
|
data() {
|
|
502
503
|
return {
|
|
503
504
|
isOptionsVisible: false,
|
|
505
|
+
boxResizeObserver: null,
|
|
504
506
|
}
|
|
505
507
|
},
|
|
506
508
|
computed: {
|
|
@@ -514,10 +516,63 @@
|
|
|
514
516
|
return getDateFormat(this.activeLanguage)
|
|
515
517
|
},
|
|
516
518
|
},
|
|
519
|
+
watch: {
|
|
520
|
+
// Keep the filter box on screen: clamp on open and whenever its content
|
|
521
|
+
// resizes (e.g. a wide value is selected) or the window resizes.
|
|
522
|
+
isOptionsVisible(visible) {
|
|
523
|
+
if (visible) {
|
|
524
|
+
this.$nextTick(() => {
|
|
525
|
+
this.clampBoxToViewport()
|
|
526
|
+
this.observeBoxResize()
|
|
527
|
+
window.addEventListener('resize', this.clampBoxToViewport)
|
|
528
|
+
})
|
|
529
|
+
} else {
|
|
530
|
+
this.teardownBoxObservers()
|
|
531
|
+
}
|
|
532
|
+
},
|
|
533
|
+
},
|
|
517
534
|
beforeUnmount() {
|
|
518
535
|
document.removeEventListener('click', this.handleClickOutside)
|
|
536
|
+
this.teardownBoxObservers()
|
|
519
537
|
},
|
|
520
538
|
methods: {
|
|
539
|
+
// Shift the absolutely-positioned filter box left when its right edge
|
|
540
|
+
// would overflow the viewport, then clamp so the left edge stays visible.
|
|
541
|
+
clampBoxToViewport() {
|
|
542
|
+
const el = this.$refs.boxContainer?.$el
|
|
543
|
+
if (!el) {
|
|
544
|
+
return
|
|
545
|
+
}
|
|
546
|
+
el.style.transform = 'none'
|
|
547
|
+
const rect = el.getBoundingClientRect()
|
|
548
|
+
const margin = 16
|
|
549
|
+
const viewportWidth = window.innerWidth
|
|
550
|
+
let shift = 0
|
|
551
|
+
if (rect.right > viewportWidth - margin) {
|
|
552
|
+
shift = viewportWidth - margin - rect.right
|
|
553
|
+
}
|
|
554
|
+
if (rect.left + shift < margin) {
|
|
555
|
+
shift = margin - rect.left
|
|
556
|
+
}
|
|
557
|
+
el.style.transform = shift !== 0 ? `translateX(${shift}px)` : 'none'
|
|
558
|
+
},
|
|
559
|
+
observeBoxResize() {
|
|
560
|
+
const el = this.$refs.boxContainer?.$el
|
|
561
|
+
if (!el || typeof ResizeObserver === 'undefined') {
|
|
562
|
+
return
|
|
563
|
+
}
|
|
564
|
+
this.boxResizeObserver = new ResizeObserver(() =>
|
|
565
|
+
this.clampBoxToViewport()
|
|
566
|
+
)
|
|
567
|
+
this.boxResizeObserver.observe(el)
|
|
568
|
+
},
|
|
569
|
+
teardownBoxObservers() {
|
|
570
|
+
if (this.boxResizeObserver) {
|
|
571
|
+
this.boxResizeObserver.disconnect()
|
|
572
|
+
this.boxResizeObserver = null
|
|
573
|
+
}
|
|
574
|
+
window.removeEventListener('resize', this.clampBoxToViewport)
|
|
575
|
+
},
|
|
521
576
|
isDateColumn(column) {
|
|
522
577
|
if (column === 'updated') {
|
|
523
578
|
return true
|