@eturnity/eturnity_reusable_components 9.31.1 → 9.31.3

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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@eturnity/eturnity_reusable_components",
3
- "version": "9.31.1",
3
+ "version": "9.31.3",
4
4
  "files": [
5
5
  "dist",
6
6
  "src"
@@ -0,0 +1,3 @@
1
+ <svg width="14" height="14" viewBox="0 0 14 14" fill="none" xmlns="http://www.w3.org/2000/svg">
2
+ <path d="M12 0C13.1046 0 14 0.895431 14 2V12C14 13.1046 13.1046 14 12 14H2C0.89543 14 1.61064e-08 13.1046 0 12V2C0 0.89543 0.895431 1.61064e-08 2 0H12ZM2 1C1.44772 1 1 1.44772 1 2V12L1.00488 12.1025C1.05278 12.573 1.42703 12.9472 1.89746 12.9951L2 13H12L12.1025 12.9951C12.6067 12.9438 13 12.5177 13 12V2C13 1.44772 12.5523 1 12 1H2ZM5 8C5 8.27614 5.22386 8.5 5.5 8.5H8V7.2002C8 7.08974 8.08974 7 8.2002 7H10.7998C10.9103 7 11 7.08974 11 7.2002V10.7998C11 10.9103 10.9103 11 10.7998 11H8.2002C8.08974 11 8 10.9103 8 10.7998V9.5H5.5C4.67157 9.5 4 8.82843 4 8V7H3.2002C3.08974 7 3 6.91026 3 6.7998V3.2002C3 3.08974 3.08974 3 3.2002 3H5.7998C5.91026 3 6 3.08974 6 3.2002V6.7998C6 6.91026 5.91026 7 5.7998 7H5V8Z" fill="#263238"/>
3
+ </svg>
@@ -0,0 +1,3 @@
1
+ <svg width="14" height="10" viewBox="0 0 14 10" fill="none" xmlns="http://www.w3.org/2000/svg">
2
+ <path d="M13.1025 0.00488281C13.6067 0.0562146 14 0.482323 14 1V9L13.9951 9.10254C13.9472 9.57297 13.573 9.94722 13.1025 9.99512L13 10H1C0.482323 10 0.0562145 9.60667 0.00488281 9.10254L0 9V1C1.28852e-07 0.447715 0.447715 2.41596e-08 1 0H13L13.1025 0.00488281ZM1 9H12.2139L8.15625 5.45117C7.88358 5.21208 7.88332 4.78677 8.15625 4.54785L12.2139 1H1V9ZM9.16016 4.99902L13 8.3584V1.63965L9.16016 4.99902Z" fill="#263238"/>
3
+ </svg>
@@ -1055,10 +1055,16 @@
1055
1055
  this.handleSetDropdownOffet()
1056
1056
  this.refreshOptionLength()
1057
1057
  if (!this.isFixedDropdownPosition) this.calculateSelectTopPosition()
1058
+ // Teleported menus live in <body>, so they aren't clipped by a
1059
+ // scrollable ancestor (e.g. the filter modal). Close on outside
1060
+ // scroll to avoid the menu floating free of its trigger.
1061
+ if (this.shouldUseTeleport)
1062
+ document.addEventListener('scroll', this.handleScrollClose, true)
1058
1063
  // Deferred dropdown slot content mounts after initial open in some hosts.
1059
1064
  this.$nextTick(() => this.refreshOptionLength())
1060
1065
  } else {
1061
1066
  this.$emit('on-dropdown-close')
1067
+ document.removeEventListener('scroll', this.handleScrollClose, true)
1062
1068
  this.dropdownPosition.left = null
1063
1069
  this.optionLengthCount = 0
1064
1070
  if (this.animationFrameId) {
@@ -1139,6 +1145,7 @@
1139
1145
  this.clickOutside,
1140
1146
  CLICK_OUTSIDE_CAPTURE
1141
1147
  )
1148
+ document.removeEventListener('scroll', this.handleScrollClose, true)
1142
1149
  },
1143
1150
  methods: {
1144
1151
  getDropdownTopScrollYOffset() {
@@ -1162,6 +1169,14 @@
1162
1169
  this.clearSearch()
1163
1170
  this.isDropdownOpen = false
1164
1171
  },
1172
+ handleScrollClose(e) {
1173
+ // Ignore scrolling within the menu itself (e.g. a long option list);
1174
+ // only close when a surrounding container scrolls. The menu is
1175
+ // teleported to <body>, so check the teleported dropdown element.
1176
+ const menuEl = this.$refs.dropdown?.$el
1177
+ if (menuEl && (menuEl === e.target || menuEl.contains(e.target))) return
1178
+ this.closeDropdown()
1179
+ },
1165
1180
  clearSearch() {
1166
1181
  this.textSearch = ''
1167
1182
  this.searchChange('')