@umbraco-ui/uui-tabs 1.17.3 → 1.18.1

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.
Files changed (2) hide show
  1. package/lib/index.js +20 -4
  2. package/package.json +6 -6
package/lib/index.js CHANGED
@@ -196,13 +196,13 @@ __decorateClass$1([
196
196
  property({ type: Boolean, reflect: true })
197
197
  ], UUITabElement.prototype, "disabled", 2);
198
198
  __decorateClass$1([
199
- property({ type: String })
199
+ property({ type: String, reflect: true })
200
200
  ], UUITabElement.prototype, "href", 2);
201
201
  __decorateClass$1([
202
- property({ type: String })
202
+ property({ type: String, reflect: true })
203
203
  ], UUITabElement.prototype, "target", 2);
204
204
  __decorateClass$1([
205
- property({ type: String })
205
+ property({ type: String, reflect: true })
206
206
  ], UUITabElement.prototype, "rel", 2);
207
207
  __decorateClass$1([
208
208
  property({ type: String, reflect: true })
@@ -229,7 +229,7 @@ var __privateGet = (obj, member, getter) => (__accessCheck(obj, member, "read fr
229
229
  var __privateAdd = (obj, member, value) => member.has(obj) ? __typeError("Cannot add the same private member more than once") : member instanceof WeakSet ? member.add(obj) : member.set(obj, value);
230
230
  var __privateSet = (obj, member, value, setter) => (__accessCheck(obj, member, "write to private field"), member.set(obj, value), value);
231
231
  var __privateMethod = (obj, member, method) => (__accessCheck(obj, member, "access private method"), method);
232
- var _currentGap, _tabElements, _hiddenTabElements, _hiddenTabElementsMap, _visibilityBreakpoints, _resizeObserver, _tabResizeObservers, _breakPointCalculationInProgress, _UUITabGroupElement_instances, initialize_fn, onResize_fn, cleanupTabs_fn, onSlotChange_fn, _onTabClicked, calculateBreakPoints_fn, setTabArray_fn, updateCollapsibleTabs_fn, isElementTabLike_fn;
232
+ var _currentGap, _tabElements, _hiddenTabElements, _hiddenTabElementsMap, _visibilityBreakpoints, _resizeObserver, _tabResizeObservers, _breakPointCalculationInProgress, _UUITabGroupElement_instances, initialize_fn, onResize_fn, cleanupTabs_fn, onSlotChange_fn, _onTabClicked, calculateBreakPoints_fn, setTabArray_fn, updateCollapsibleTabs_fn, isElementTabLike_fn, isElementHrefLike_fn;
233
233
  let UUITabGroupElement = class extends LitElement {
234
234
  constructor() {
235
235
  super(...arguments);
@@ -246,6 +246,19 @@ let UUITabGroupElement = class extends LitElement {
246
246
  __privateAdd(this, _breakPointCalculationInProgress, false);
247
247
  __privateAdd(this, _onTabClicked, (e) => {
248
248
  const selectedElement = e.currentTarget;
249
+ const isCtrlClick = e.ctrlKey || e.metaKey;
250
+ if (__privateMethod(this, _UUITabGroupElement_instances, isElementHrefLike_fn).call(this, selectedElement) && isCtrlClick) {
251
+ return;
252
+ }
253
+ if (selectedElement.classList.contains("hidden-tab") && __privateMethod(this, _UUITabGroupElement_instances, isElementTabLike_fn).call(this, selectedElement)) {
254
+ const original = __privateGet(this, _hiddenTabElementsMap).get(selectedElement);
255
+ if (original) {
256
+ original.click();
257
+ this._moreButtonElement.classList.add("active-inside");
258
+ this._popoverContainerElement.hidePopover();
259
+ }
260
+ return;
261
+ }
249
262
  if (__privateMethod(this, _UUITabGroupElement_instances, isElementTabLike_fn).call(this, selectedElement)) {
250
263
  selectedElement.active = true;
251
264
  const linkedElement = __privateGet(this, _hiddenTabElementsMap).get(selectedElement);
@@ -428,6 +441,9 @@ updateCollapsibleTabs_fn = function(containerWidth) {
428
441
  isElementTabLike_fn = function(el) {
429
442
  return typeof el === "object" && "active" in el && typeof el.active === "boolean";
430
443
  };
444
+ isElementHrefLike_fn = function(el) {
445
+ return typeof el === "object" && "href" in el && typeof el.href === "string" && el.href;
446
+ };
431
447
  UUITabGroupElement.styles = [
432
448
  css`
433
449
  :host {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@umbraco-ui/uui-tabs",
3
- "version": "1.17.3",
3
+ "version": "1.18.1",
4
4
  "license": "MIT",
5
5
  "keywords": [
6
6
  "Umbraco",
@@ -30,10 +30,10 @@
30
30
  "custom-elements.json"
31
31
  ],
32
32
  "dependencies": {
33
- "@umbraco-ui/uui-base": "1.17.3",
34
- "@umbraco-ui/uui-button": "1.17.3",
35
- "@umbraco-ui/uui-popover-container": "1.17.3",
36
- "@umbraco-ui/uui-symbol-more": "1.17.3"
33
+ "@umbraco-ui/uui-base": "1.18.1",
34
+ "@umbraco-ui/uui-button": "1.18.1",
35
+ "@umbraco-ui/uui-popover-container": "1.18.1",
36
+ "@umbraco-ui/uui-symbol-more": "1.18.1"
37
37
  },
38
38
  "scripts": {
39
39
  "build": "npm run analyze && tsc --build && rollup -c rollup.config.js",
@@ -44,5 +44,5 @@
44
44
  "access": "public"
45
45
  },
46
46
  "homepage": "https://uui.umbraco.com/?path=/story/uui-tabs",
47
- "gitHead": "6ace9a5889a8e18bc47404563b70b4d8b263aac9"
47
+ "gitHead": "74fa7fd1b5009e695bdcaa7012b55dc097aecae2"
48
48
  }