@blockquote-web-components/blockquote-tabs 1.4.4 → 1.4.5
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/define/blockquote-tab.js +1 -1
- package/define/blockquote-tabpanel.js +1 -1
- package/define/blockquote-tabs.js +1 -1
- package/package.json +7 -7
- package/src/BlockquoteTabs.js +18 -18
- package/src/index.js +3 -3
- package/src/tab/BlockquoteTab.js +6 -6
- package/src/tabpanel/BlockquoteTabPanel.js +2 -2
package/define/blockquote-tab.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@blockquote-web-components/blockquote-tabs",
|
|
3
|
-
"version": "1.4.
|
|
3
|
+
"version": "1.4.5",
|
|
4
4
|
"description": "Webcomponent blockquote-tabs following open-wc recommendations",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"lit",
|
|
@@ -89,12 +89,12 @@
|
|
|
89
89
|
]
|
|
90
90
|
},
|
|
91
91
|
"prettier": {
|
|
92
|
-
"arrowParens": "avoid",
|
|
93
92
|
"bracketSameLine": true,
|
|
93
|
+
"bracketSpacing": false,
|
|
94
94
|
"htmlWhitespaceSensitivity": "ignore",
|
|
95
95
|
"printWidth": 100,
|
|
96
96
|
"singleQuote": true,
|
|
97
|
-
"trailingComma": "
|
|
97
|
+
"trailingComma": "es5",
|
|
98
98
|
"overrides": [
|
|
99
99
|
{
|
|
100
100
|
"files": "*.{scss,css}",
|
|
@@ -115,19 +115,19 @@
|
|
|
115
115
|
}
|
|
116
116
|
},
|
|
117
117
|
"dependencies": {
|
|
118
|
-
"@blockquote-web-components/blockquote-mixin-slot-content": "^1.7.
|
|
118
|
+
"@blockquote-web-components/blockquote-mixin-slot-content": "^1.7.2",
|
|
119
119
|
"@juggle/resize-observer": "^3.4.0",
|
|
120
120
|
"@lit-labs/observers": "^2.0.0",
|
|
121
121
|
"lit": "^3.1.1"
|
|
122
122
|
},
|
|
123
123
|
"devDependencies": {
|
|
124
124
|
"@blockquote-web-components/blockquote-base-common-dev-dependencies": "^1.9.1",
|
|
125
|
-
"@blockquote-web-components/blockquote-base-embedded-webview": "^1.11.
|
|
126
|
-
"@blockquote-web-components/blockquote-foundations-sass": "^1.1.
|
|
125
|
+
"@blockquote-web-components/blockquote-base-embedded-webview": "^1.11.2",
|
|
126
|
+
"@blockquote-web-components/blockquote-foundations-sass": "^1.1.4"
|
|
127
127
|
},
|
|
128
128
|
"publishConfig": {
|
|
129
129
|
"access": "public"
|
|
130
130
|
},
|
|
131
131
|
"customElements": "custom-elements.json",
|
|
132
|
-
"gitHead": "
|
|
132
|
+
"gitHead": "0d8e9582b65cca369553640cc72d2ca93f2c0a61"
|
|
133
133
|
}
|
package/src/BlockquoteTabs.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
1
|
+
import {html, LitElement, nothing} from 'lit';
|
|
2
|
+
import {ref, createRef} from 'lit/directives/ref.js';
|
|
3
|
+
import {ResizeObserver as ResizeObserverPolyfill} from '@juggle/resize-observer';
|
|
4
|
+
import {ResizeController} from '@lit-labs/observers/resize-controller.js';
|
|
5
|
+
import {BlockquoteMixinSlotContent} from '@blockquote-web-components/blockquote-mixin-slot-content';
|
|
6
|
+
import {styles} from './styles/blockquote-tabs-styles.css.js';
|
|
7
7
|
|
|
8
8
|
/* A minimal library which polyfills the ResizeObserver */
|
|
9
9
|
window.ResizeObserver || /* c8 ignore next */ (window.ResizeObserver = ResizeObserverPolyfill);
|
|
@@ -179,13 +179,13 @@ export class BlockquoteTabs extends BlockquoteMixinSlotContent(LitElement) {
|
|
|
179
179
|
}
|
|
180
180
|
}
|
|
181
181
|
|
|
182
|
-
_onSlotChanges = ev => {
|
|
182
|
+
_onSlotChanges = (ev) => {
|
|
183
183
|
ev.stopPropagation();
|
|
184
184
|
ev.preventDefault();
|
|
185
185
|
|
|
186
186
|
this._slotChangesCount += 1;
|
|
187
187
|
|
|
188
|
-
const {
|
|
188
|
+
const {detail} = ev;
|
|
189
189
|
const assignedNodesList = detail.assignedNodesContent.assignedNodes;
|
|
190
190
|
|
|
191
191
|
if (detail.assignedSlotContent.slotName === 'tab') {
|
|
@@ -256,18 +256,18 @@ export class BlockquoteTabs extends BlockquoteMixinSlotContent(LitElement) {
|
|
|
256
256
|
`;
|
|
257
257
|
}
|
|
258
258
|
|
|
259
|
-
_scrollEdge({
|
|
259
|
+
_scrollEdge({target = this._scrollContentRef.value} = {}) {
|
|
260
260
|
// @ts-ignore
|
|
261
|
-
const {
|
|
261
|
+
const {scrollLeft, scrollWidth, offsetWidth} = target;
|
|
262
262
|
const overflowingWidth = scrollWidth - offsetWidth;
|
|
263
263
|
this._hasScrollLeftIndicator = scrollLeft > 0;
|
|
264
264
|
this._hasScrollRightIndicator = scrollLeft < overflowingWidth;
|
|
265
265
|
}
|
|
266
266
|
|
|
267
|
-
_onTabClick = ev => {
|
|
267
|
+
_onTabClick = (ev) => {
|
|
268
268
|
const findSelectedTab = ev
|
|
269
269
|
.composedPath()
|
|
270
|
-
.find(tab => tab instanceof Element && tab.slot === 'tab');
|
|
270
|
+
.find((tab) => tab instanceof Element && tab.slot === 'tab');
|
|
271
271
|
|
|
272
272
|
const findSelectedTabIdxFromOne = this._tabList.indexOf(findSelectedTab) + 1;
|
|
273
273
|
|
|
@@ -278,7 +278,7 @@ export class BlockquoteTabs extends BlockquoteMixinSlotContent(LitElement) {
|
|
|
278
278
|
this.selected = findSelectedTabIdxFromOne;
|
|
279
279
|
};
|
|
280
280
|
|
|
281
|
-
_onTabKeyDown = ev => {
|
|
281
|
+
_onTabKeyDown = (ev) => {
|
|
282
282
|
let idx = '';
|
|
283
283
|
|
|
284
284
|
switch (ev.key) {
|
|
@@ -349,23 +349,23 @@ export class BlockquoteTabs extends BlockquoteMixinSlotContent(LitElement) {
|
|
|
349
349
|
|
|
350
350
|
_scrollIntoViewWithOffset(
|
|
351
351
|
tabScroller = this._selectedTab,
|
|
352
|
-
behavior = this._observeScrollBehavior ? 'smooth' : 'auto'
|
|
352
|
+
behavior = this._observeScrollBehavior ? 'smooth' : 'auto'
|
|
353
353
|
) {
|
|
354
354
|
const scrollContentNode = this._scrollContentRef.value;
|
|
355
355
|
if (!scrollContentNode) {
|
|
356
356
|
return;
|
|
357
357
|
}
|
|
358
358
|
const [rootA, rootB] = this._indicators || [];
|
|
359
|
-
const {
|
|
360
|
-
const {
|
|
359
|
+
const {right: boundaryight} = scrollContentNode.getBoundingClientRect();
|
|
360
|
+
const {offsetLeft: scrollerLeft} = tabScroller;
|
|
361
361
|
const {
|
|
362
362
|
left: tabScrollerXLeft,
|
|
363
363
|
right: tabScrollerXRight,
|
|
364
364
|
width: tabScrollerWidth,
|
|
365
365
|
} = tabScroller.getBoundingClientRect();
|
|
366
366
|
|
|
367
|
-
const {
|
|
368
|
-
const {
|
|
367
|
+
const {right: rootARight} = rootA.getBoundingClientRect();
|
|
368
|
+
const {width: rootBWidth, left: rootBLeft} = rootB.getBoundingClientRect();
|
|
369
369
|
|
|
370
370
|
if (tabScrollerXRight > rootBLeft || tabScrollerXLeft < rootARight) {
|
|
371
371
|
const left =
|
package/src/index.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export {
|
|
2
|
-
export {
|
|
3
|
-
export {
|
|
1
|
+
export {BlockquoteTabs} from './BlockquoteTabs.js';
|
|
2
|
+
export {BlockquoteTab} from './tab/BlockquoteTab.js';
|
|
3
|
+
export {BlockquoteTabPanel} from './tabpanel/BlockquoteTabPanel.js';
|
package/src/tab/BlockquoteTab.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
1
|
+
import {html, LitElement} from 'lit';
|
|
2
|
+
import {BlockquoteMixinSlotContent} from '@blockquote-web-components/blockquote-mixin-slot-content';
|
|
3
|
+
import {styles} from './styles/blockquote-tab-styles.css.js';
|
|
4
4
|
|
|
5
5
|
/**
|
|
6
6
|
* 
|
|
@@ -58,12 +58,12 @@ export class BlockquoteTab extends BlockquoteMixinSlotContent(LitElement) {
|
|
|
58
58
|
}
|
|
59
59
|
}
|
|
60
60
|
|
|
61
|
-
_onSlotChanges = ev => {
|
|
62
|
-
const {
|
|
61
|
+
_onSlotChanges = (ev) => {
|
|
62
|
+
const {detail} = ev;
|
|
63
63
|
ev.stopPropagation();
|
|
64
64
|
ev.preventDefault();
|
|
65
65
|
const assignedNodesList = detail.assignedSlotContent.assignedSlot;
|
|
66
|
-
Object.assign(assignedNodesList.dataset, {
|
|
66
|
+
Object.assign(assignedNodesList.dataset, {text: this.textContent});
|
|
67
67
|
};
|
|
68
68
|
|
|
69
69
|
render() {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import {html, LitElement} from 'lit';
|
|
2
|
+
import {styles} from './styles/blockquote-tabpanel-styles.css.js';
|
|
3
3
|
|
|
4
4
|
/**
|
|
5
5
|
* 
|