@luzmo/lucero 1.0.1-alpha.14 → 1.0.1-alpha.16
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/components/accordion/index.cjs +183 -6
- package/components/accordion/index.js +136 -88
- package/components/action-bar/index.cjs +85 -4
- package/components/action-bar/index.js +72 -50
- package/components/action-button/index.cjs +205 -3
- package/components/action-button/index.js +167 -93
- package/components/action-group/index.cjs +7 -1
- package/components/action-group/index.js +12 -8
- package/components/action-group-DHp8RHDf.js +392 -0
- package/components/action-group-MPf19RPV.cjs +391 -0
- package/components/action-menu/index.cjs +91 -11
- package/components/action-menu/index.js +66 -47
- package/components/avatar/index.cjs +63 -3
- package/components/avatar/index.js +54 -42
- package/components/base-COw9n7UR.cjs +119 -0
- package/components/base-DmeVy0cq.js +120 -0
- package/components/button/index.cjs +134 -2
- package/components/button/index.js +106 -72
- package/components/button-base-7Ak55xFd.cjs +206 -0
- package/components/button-base-C3kf6BTK.js +207 -0
- package/components/button-group/index.cjs +45 -1
- package/components/button-group/index.js +37 -25
- package/components/calendar/index.cjs +632 -1
- package/components/calendar/index.js +637 -7
- package/components/checkbox/index.cjs +111 -4
- package/components/checkbox/index.js +98 -53
- package/components/checkbox-mixin-8cL-vfDy.js +84 -0
- package/components/checkbox-mixin-CE7dJj3J.cjs +83 -0
- package/components/clear-button-Co6oKSgl.js +59 -0
- package/components/clear-button-X_HDY2eH.cjs +58 -0
- package/components/close-button-DPBK6Kpu.cjs +59 -0
- package/components/close-button-Miw9ZjoJ.js +60 -0
- package/components/color-area/index.cjs +440 -13
- package/components/color-area/index.js +322 -187
- package/components/color-controller-BjDZaxhX.js +491 -0
- package/components/color-controller-C3c_vb2P.cjs +490 -0
- package/components/color-field/index.cjs +95 -2
- package/components/color-field/index.js +77 -41
- package/components/color-handle/index.cjs +64 -3
- package/components/color-handle/index.js +58 -37
- package/components/color-loupe/index.cjs +7 -1
- package/components/color-loupe/index.js +12 -8
- package/components/color-loupe-BQqNR8YD.cjs +88 -0
- package/components/color-loupe-B_DDFv8l.js +89 -0
- package/components/color-menu/index.cjs +217 -12
- package/components/color-menu/index.js +187 -93
- package/components/color-palette/index.cjs +89 -1
- package/components/color-palette/index.js +78 -51
- package/components/color-palette-group/index.cjs +259 -3
- package/components/color-palette-group/index.js +193 -105
- package/components/color-picker/index.cjs +114 -6
- package/components/color-picker/index.js +92 -72
- package/components/color-slider/index.cjs +585 -1
- package/components/color-slider/index.js +590 -7
- package/components/{directive-oAbCiebi.js → condition-attribute-with-id-Cn815e9W.js} +22 -22
- package/components/condition-attribute-with-id-DEc2Yjne.cjs +43 -0
- package/components/date-time-picker/index.cjs +1357 -31
- package/components/date-time-picker/index.js +951 -637
- package/components/dependency-manger-CcIE1uvQ.cjs +63 -0
- package/components/{dependency-manger-CEXvGQUV.js → dependency-manger-XHpQjFgK.js} +24 -14
- package/components/divider/index.cjs +54 -1
- package/components/divider/index.js +49 -30
- package/components/divider.module-Cm5LcDRV.cjs +20 -0
- package/components/divider.module-DauH6k2_.js +21 -0
- package/components/element-resolution-DCsrhGZO.cjs +112 -0
- package/components/element-resolution-nMlmW4Jy.js +113 -0
- package/components/field-group/index.cjs +7 -1
- package/components/field-group/index.js +12 -8
- package/components/field-group-DNmY8W9v.cjs +86 -0
- package/components/field-group-DVdAWCQF.js +87 -0
- package/components/field-label/index.cjs +7 -1
- package/components/field-label/index.js +12 -8
- package/components/field-label-CKH9EXpR.cjs +156 -0
- package/components/field-label-Dpsecoc6.js +157 -0
- package/components/focus-group-BqDAk9Is.js +337 -0
- package/components/focus-group-DFzOlalL.cjs +336 -0
- package/components/focus-visible-B-B8-P9R.cjs +104 -0
- package/components/focus-visible-BUPRWlsh.js +105 -0
- package/components/focusable-BPrTcZPd.cjs +262 -0
- package/components/focusable-ChCLg1k4.js +263 -0
- package/components/{directive-C7oCP5Bh.cjs → focusable-selectors-D0t_5P7C.cjs} +16 -5
- package/components/{focusable-selectors-B4YgbghQ.js → focusable-selectors-IltOAOd9.js} +7 -4
- package/components/icon/index.cjs +90 -1
- package/components/icon/index.js +74 -46
- package/components/index.cjs +174 -1
- package/components/index.js +174 -172
- package/components/infield-button/index.cjs +46 -2
- package/components/infield-button/index.js +41 -30
- package/components/label/index.cjs +37 -1
- package/components/label/index.js +36 -24
- package/components/{language-resolution-8yZa5r_P.js → language-resolution-BSGJAWiQ.js} +21 -16
- package/components/language-resolution-iN9EImbb.cjs +57 -0
- package/components/like-anchor-D62faRNG.cjs +79 -0
- package/components/like-anchor-v3cJ9RWM.js +80 -0
- package/components/manage-help-text-BYx84zZR.cjs +125 -0
- package/components/manage-help-text-DOuMTGht.js +126 -0
- package/components/menu/index.cjs +1297 -29
- package/components/menu/index.js +954 -499
- package/components/multi-language-field/index.cjs +132 -2
- package/components/multi-language-field/index.js +118 -88
- package/components/number-field/index.cjs +613 -10
- package/components/number-field/index.js +442 -243
- package/components/observe-slot-presence-9AwLGUQ_.cjs +78 -0
- package/components/observe-slot-presence-DcMdoumP.js +79 -0
- package/components/observe-slot-text-CSofZeeF.cjs +104 -0
- package/components/observe-slot-text-CjnkkBPn.js +105 -0
- package/components/options/index.cjs +693 -60
- package/components/options/index.js +519 -953
- package/components/overlay/index.cjs +367 -21
- package/components/overlay/index.js +273 -189
- package/components/overlay-CN8ISP1F.js +2485 -0
- package/components/overlay-LViy9VWM.cjs +2484 -0
- package/components/{pending-state-DTX7ggyF.js → pending-state-CXbe-Xul.js} +28 -13
- package/components/pending-state-e4RbXe9u.cjs +75 -0
- package/components/picker/index.cjs +9 -1
- package/components/picker/index.js +15 -11
- package/components/picker-DNde3awt.cjs +672 -0
- package/components/picker-PfUAF05y.js +673 -0
- package/components/picker-button/index.cjs +56 -4
- package/components/picker-button/index.js +45 -34
- package/components/platform-CxDar3Dn.cjs +68 -0
- package/components/platform-Cxn0WbyT.js +69 -0
- package/components/popover/index.cjs +7 -1
- package/components/popover/index.js +12 -8
- package/components/popover-BkbYhl3i.js +74 -0
- package/components/popover-BkgUf0kL.cjs +74 -0
- package/components/progress-circle/index.cjs +7 -1
- package/components/progress-circle/index.js +12 -8
- package/components/progress-circle-Hu_ivPHf.js +133 -0
- package/components/progress-circle-_Etqsj9f.cjs +132 -0
- package/components/radio/index.cjs +244 -2
- package/components/radio/index.js +192 -110
- package/components/{when-CDK1Tt5Y.js → random-id-BE6HA503.cjs} +7 -10
- package/components/{random-id-ByCz1xaq.js → random-id-BEc6QIUL.js} +3 -3
- package/components/roving-tabindex-AsmAh2In.cjs +95 -0
- package/components/roving-tabindex-DPF9NmrH.js +96 -0
- package/components/search/index.cjs +115 -8
- package/components/search/index.js +96 -66
- package/components/select/index.cjs +720 -51
- package/components/select/index.js +563 -347
- package/components/sized-mixin-DmkrNdWB.js +80 -0
- package/components/sized-mixin-UaTVa-AE.cjs +79 -0
- package/components/slider/index.cjs +119 -1
- package/components/slider/index.js +100 -1113
- package/components/{condition-attribute-with-id-Dv4lSRbe.js → slottable-request-event-CANixJnR.cjs} +15 -13
- package/components/{slottable-request-event-DggLA4Rx.js → slottable-request-event-D9WzrdWv.js} +12 -9
- package/components/strategies-DlMlaSJR.cjs +317 -0
- package/components/strategies-DlPQoTFE.js +318 -0
- package/components/streaming-listener-D4sHaMub.cjs +145 -0
- package/components/streaming-listener-cAz5zJyk.js +146 -0
- package/components/swatch/index.cjs +436 -7
- package/components/swatch/index.js +350 -205
- package/components/switch/index.cjs +61 -2
- package/components/switch/index.js +51 -34
- package/components/tabs/index.cjs +693 -26
- package/components/tabs/index.js +521 -388
- package/components/tags/index.cjs +201 -4
- package/components/tags/index.js +152 -87
- package/components/text-field/index.cjs +49 -3
- package/components/text-field/index.js +44 -30
- package/components/text-field-11tcnftU.cjs +338 -0
- package/components/text-field-Chi9J2Cz.js +339 -0
- package/components/text-field.module-CMBS0jSL.js +21 -0
- package/components/text-field.module-DIJdV_sA.cjs +20 -0
- package/components/toast/index.cjs +177 -12
- package/components/toast/index.js +145 -73
- package/components/tooltip/index.cjs +221 -6
- package/components/tooltip/index.js +156 -109
- package/components/unit-input/index.cjs +232 -8
- package/components/unit-input/index.js +201 -108
- package/components/utils.cjs +25 -1
- package/components/utils.js +22 -22
- package/package.json +1 -1
- package/components/NumberFormatter-DewVDY5w.cjs +0 -18
- package/components/NumberFormatter-DgOUVrge.js +0 -136
- package/components/NumberParser-Dik4a0h-.cjs +0 -18
- package/components/NumberParser-ci9J5EKv.js +0 -173
- package/components/action-group-DBImibFn.js +0 -258
- package/components/action-group-DJGMcRHb.cjs +0 -20
- package/components/async-directive-BX1T1e1_.cjs +0 -22
- package/components/async-directive-BfcqVjDp.js +0 -82
- package/components/base-BjTwmyRF.cjs +0 -22
- package/components/base-CBCg3yyw.cjs +0 -40
- package/components/base-D76d76ww.js +0 -26
- package/components/base-WsynuqaS.js +0 -677
- package/components/button-base-DbkDzb71.js +0 -144
- package/components/button-base-XgPLmwP-.cjs +0 -25
- package/components/checkbox-mixin-BDN0dBtS.cjs +0 -27
- package/components/checkbox-mixin-Do7EgtpQ.js +0 -70
- package/components/class-map-Di1D_rCm.cjs +0 -22
- package/components/class-map-NbVXqBU0.js +0 -51
- package/components/clear-button-DQcRdcUa.js +0 -53
- package/components/clear-button-OFUFFe7G.cjs +0 -18
- package/components/close-button-Cbnb7XXj.cjs +0 -18
- package/components/close-button-CqHYZhum.js +0 -51
- package/components/color-controller-B0uX6Zso.js +0 -3230
- package/components/color-controller-CoUL5f9K.cjs +0 -18
- package/components/color-loupe-CaA_Lfkk.cjs +0 -56
- package/components/color-loupe-CmMsXbjT.js +0 -81
- package/components/condition-attribute-with-id-DrQYZzFS.cjs +0 -18
- package/components/dependency-manger-C5HCkMMB.cjs +0 -18
- package/components/directive-helpers-Cm6gitnu.js +0 -62
- package/components/directive-helpers-DyIRTWwA.cjs +0 -22
- package/components/divider.module-DDvBo9zo.cjs +0 -18
- package/components/divider.module-DoQWQEIJ.js +0 -21
- package/components/element-resolution-BvRLGqIU.cjs +0 -18
- package/components/element-resolution-FCUT-wql.js +0 -91
- package/components/field-group-DXfBWrkO.js +0 -66
- package/components/field-group-DkGst3r5.cjs +0 -23
- package/components/field-label-CZ2zzChK.js +0 -106
- package/components/field-label-mO1AkUgR.cjs +0 -25
- package/components/flow-D-0MTYCm.js +0 -527
- package/components/flow-DM3dNAKs.cjs +0 -30
- package/components/focus-group-DHeTq18L.js +0 -218
- package/components/focus-group-DnxZUBhQ.cjs +0 -18
- package/components/focus-visible-B0P9aY_G.cjs +0 -18
- package/components/focus-visible-DBlJGoEW.js +0 -74
- package/components/focusable-BxtpnzWp.js +0 -153
- package/components/focusable-EbipgXRh.cjs +0 -18
- package/components/focusable-selectors-BgFlyFcY.cjs +0 -18
- package/components/if-defined-C9YGdo33.cjs +0 -22
- package/components/if-defined-DOaE2coe.js +0 -27
- package/components/index-BwxgAdzi.cjs +0 -57
- package/components/index-Cl54m8Yh.js +0 -1490
- package/components/index-HjQa8tew.js +0 -1174
- package/components/index-Wq3qZJGh.cjs +0 -113
- package/components/language-resolution-DJzmyzZq.cjs +0 -18
- package/components/like-anchor-Bvn_vLQ8.js +0 -69
- package/components/like-anchor-sod1C1fR.cjs +0 -32
- package/components/luzmo-icons-4nDFv1Lq.js +0 -229
- package/components/luzmo-icons-D4IvHgVd.cjs +0 -29
- package/components/manage-help-text-DhgARkZX.cjs +0 -30
- package/components/manage-help-text-syYnjKGL.js +0 -92
- package/components/mutation-controller-DH7YOCyj.js +0 -52
- package/components/mutation-controller-DkOMCW-c.cjs +0 -22
- package/components/observe-slot-presence-CmVi0zTc.js +0 -68
- package/components/observe-slot-presence-bc9chhsi.cjs +0 -18
- package/components/observe-slot-text-BPfIQQtz.js +0 -87
- package/components/observe-slot-text-Ceb7SvYT.cjs +0 -18
- package/components/overlay-Cig9r6uU.js +0 -2747
- package/components/overlay-KSKMzzkh.cjs +0 -47
- package/components/pending-state-CaH1si5b.cjs +0 -26
- package/components/picker-BfBP7XJN.js +0 -461
- package/components/picker-xIphqE6d.cjs +0 -123
- package/components/platform-BM-uMWpX.js +0 -69
- package/components/platform-BiXhwqk3.cjs +0 -18
- package/components/popover-DjX0aAnY.js +0 -67
- package/components/popover-KFfO0IYL.cjs +0 -30
- package/components/progress-circle-BvRJNuNo.cjs +0 -33
- package/components/progress-circle-DXH9z8-6.js +0 -97
- package/components/query-BL-TJj7K.cjs +0 -22
- package/components/query-D_KR_GUc.js +0 -51
- package/components/query-assigned-elements-DjfhL1cl.js +0 -36
- package/components/query-assigned-elements-DsKsfk7G.cjs +0 -22
- package/components/query-assigned-nodes-BcKWmGzy.cjs +0 -22
- package/components/query-assigned-nodes-C76XVPWY.js +0 -36
- package/components/random-id-CqvckpWe.cjs +0 -18
- package/components/roving-tabindex-By_fCy_e.cjs +0 -18
- package/components/roving-tabindex-DOg4z6ZU.js +0 -66
- package/components/sized-mixin-CPxE5C96.cjs +0 -18
- package/components/sized-mixin-D4ACoVUr.js +0 -63
- package/components/slottable-request-event-BfUUt1Mh.cjs +0 -18
- package/components/state-D8JEtYqe.cjs +0 -22
- package/components/state-Deh-vKYE.js +0 -29
- package/components/strategies-9indNIEb.js +0 -195
- package/components/strategies-BACP6MhR.cjs +0 -18
- package/components/streaming-listener-B00MvALi.cjs +0 -18
- package/components/streaming-listener-CP-JE6Fa.js +0 -91
- package/components/style-map-CeilmSgs.cjs +0 -22
- package/components/style-map-IgqIKvlE.js +0 -53
- package/components/text-field-CeG75PPO.cjs +0 -85
- package/components/text-field-DCl-AFM-.js +0 -314
- package/components/text-field.module-C2KVUJcX.js +0 -21
- package/components/text-field.module-DXhFA9G-.cjs +0 -18
- package/components/when-CDZyJPvd.cjs +0 -22
package/components/tabs/index.js
CHANGED
|
@@ -15,43 +15,56 @@
|
|
|
15
15
|
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
16
16
|
* SOFTWARE.
|
|
17
17
|
* */
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
import { e as p } from "../class-map-NbVXqBU0.js";
|
|
25
|
-
import { o as k } from "../if-defined-DOaE2coe.js";
|
|
26
|
-
import { S as T } from "../sized-mixin-D4ACoVUr.js";
|
|
27
|
-
import { F as U } from "../focusable-BxtpnzWp.js";
|
|
28
|
-
import { R as B } from "../roving-tabindex-DOg4z6ZU.js";
|
|
29
|
-
import { k as F, S as O } from "../luzmo-icons-4nDFv1Lq.js";
|
|
30
|
-
import { r as R } from "../state-Deh-vKYE.js";
|
|
31
|
-
import { o as D } from "../query-assigned-elements-DjfhL1cl.js";
|
|
32
|
-
import "../action-button/index.js";
|
|
33
|
-
import "../icon/index.js";
|
|
34
|
-
const E = () => {
|
|
35
|
-
if (typeof document < "u" && !document.querySelector("style[data-luzmo-vars]")) {
|
|
36
|
-
const r = document.createElement("style");
|
|
37
|
-
r.setAttribute("data-luzmo-vars", ""), r.textContent = 'html{--luzmo-animation-duration: 0.15s;--luzmo-border-color: rgba(var(--luzmo-border-color-rgb), 0.1);--luzmo-border-color-hover: rgba(var(--luzmo-border-color-rgb), 0.15);--luzmo-border-color-down: rgba(var(--luzmo-border-color-rgb), 0.3);--luzmo-border-color-focus: rgba(var(--luzmo-border-color-rgb), 0.15);--luzmo-border-color-rgb: 0, 0, 0;--luzmo-border-color-full: rgb(180, 180, 180);--luzmo-border-color-full-hover: rgb(140, 140, 140);--luzmo-border-color-full-down: rgb(110, 110, 110);--luzmo-border-color-full-focus: rgb(140, 140, 140);--luzmo-border-color-disabled: #dddddd;--luzmo-border-radius: 6px;--luzmo-border-radius-s: 4px;--luzmo-border-radius-l: 8px;--luzmo-border-radius-xl: 12px;--luzmo-border-radius-full: 999rem;--luzmo-background-color: #ffffff;--luzmo-background-color-rgb: 255, 255, 255;--luzmo-background-color-disabled: #eeeeee;--luzmo-background-color-hover: #f0f0fc;--luzmo-background-color-down: #f1f1ff;--luzmo-background-color-focus: #f0f0fc;--luzmo-background-color-highlight: rgb(240, 240, 240);--luzmo-background-color-highlight-disabled: rgb(245, 245, 245);--luzmo-background-color-highlight-hover: rgb(225, 225, 225);--luzmo-background-color-highlight-down: rgb(215, 215, 215);--luzmo-background-color-highlight-focus: rgb(225, 225, 225);--luzmo-border-width: 1px;--luzmo-font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", Helvetica, Arial, sans-serif;--luzmo-font-size-xs: 10px;--luzmo-font-size-s: 12px;--luzmo-font-size-m: 14px;--luzmo-font-size: 14px;--luzmo-font-size-l: 16px;--luzmo-font-size-xl: 18px;--luzmo-font-size-xxl: 20px;--luzmo-font-style: normal;--luzmo-line-height: normal;--luzmo-font-weight: 400;--luzmo-font-weight-semibold: 500;--luzmo-font-weight-bold: 600;--luzmo-font-color: #333;--luzmo-font-color-hard: #000;--luzmo-font-color-disabled: var(--luzmo-disabled-color);--luzmo-font-color-extra-dimmed: #888;--luzmo-font-color-hover: #333;--luzmo-font-color-down: #111;--luzmo-font-color-focus: #333;--luzmo-primary: #4434ff;--luzmo-primary-hover: #4234e4;--luzmo-primary-down: #392cc7;--luzmo-primary-focus: #4234e4;--luzmo-primary-inverse-color: #ffffff;--luzmo-primary-rgb: 68, 52, 255;--luzmo-secondary: #ff00ff;--luzmo-secondary-hover: #e309e3;--luzmo-secondary-down: #c711c7;--luzmo-secondary-focus: #e309e3;--luzmo-secondary-inverse-color: #ffffff;--luzmo-secondary-rgb: 255, 0, 255;--luzmo-negative-color: #ca221c;--luzmo-negative-color-hover: #b3241f;--luzmo-negative-color-down: #9f231f;--luzmo-negative-color-focus: #b3241f;--luzmo-negative-color-rgb: 202, 34, 28;--luzmo-positive-color: rgb(20, 150, 101);--luzmo-positive-color-hover: rgb(17, 128, 86);--luzmo-positive-color-down: rgb(16, 105, 71);--luzmo-positive-color-focus: rgb(17, 128, 86);--luzmo-positive-color-rgb: 20, 150, 101;--luzmo-selected-color: rgb(110, 110, 110);--luzmo-selected-color-hover: rgb(70, 70, 70);--luzmo-selected-color-down: rgb(40, 40, 40);--luzmo-selected-color-focus: rgb(70, 70, 70);--luzmo-selected-color-hard: #1e1e1e;--luzmo-selected-color-hard-hover: rgb(0, 0, 0);--luzmo-selected-color-hard-down: rgb(0, 0, 0);--luzmo-selected-color-hard-focus: rgb(0, 0, 0);--luzmo-informative-color: #1a77e9;--luzmo-informative-color-rgb: 26, 119, 233;--luzmo-disabled-color: #aaaaaa;--luzmo-spacing-1: 2px;--luzmo-spacing-2: 4px;--luzmo-spacing-3: 8px;--luzmo-spacing-4: 12px;--luzmo-spacing-5: 16px;--luzmo-indicator-gap: 2px;--luzmo-indicator-width: 1px;--luzmo-indicator-color: var(--luzmo-primary);--luzmo-component-height-xxs: 20px;--luzmo-component-height-xs: 24px;--luzmo-component-height-s: 28px;--luzmo-component-height: 32px;--luzmo-component-height-l: 40px;--luzmo-component-height-xl: 48px;--luzmo-component-height-xxl: 64px;--luzmo-icon-size-xxs: 12px;--luzmo-icon-size-xs: 14px;--luzmo-icon-size-s: 16px;--luzmo-icon-size-m: 18px;--luzmo-icon-size-l: 20px;--luzmo-icon-size-xl: 22px;--luzmo-icon-size-xxl: 32px}', document.head.appendChild(r);
|
|
18
|
+
const initializeGlobalLuzmoCSSVariables = () => {
|
|
19
|
+
if (typeof document !== "undefined" && !document.querySelector("style[data-luzmo-vars]")) {
|
|
20
|
+
const styleElement = document.createElement("style");
|
|
21
|
+
styleElement.setAttribute("data-luzmo-vars", "");
|
|
22
|
+
styleElement.textContent = `html{--luzmo-animation-duration: 0.15s;--luzmo-border-color: rgba(var(--luzmo-border-color-rgb), 0.1);--luzmo-border-color-hover: rgba(var(--luzmo-border-color-rgb), 0.15);--luzmo-border-color-down: rgba(var(--luzmo-border-color-rgb), 0.3);--luzmo-border-color-focus: rgba(var(--luzmo-border-color-rgb), 0.15);--luzmo-border-color-rgb: 0, 0, 0;--luzmo-border-color-full: rgb(180, 180, 180);--luzmo-border-color-full-hover: rgb(140, 140, 140);--luzmo-border-color-full-down: rgb(110, 110, 110);--luzmo-border-color-full-focus: rgb(140, 140, 140);--luzmo-border-color-disabled: #dddddd;--luzmo-border-radius: 6px;--luzmo-border-radius-s: 4px;--luzmo-border-radius-l: 8px;--luzmo-border-radius-xl: 12px;--luzmo-border-radius-full: 999rem;--luzmo-background-color: #ffffff;--luzmo-background-color-rgb: 255, 255, 255;--luzmo-background-color-disabled: #eeeeee;--luzmo-background-color-hover: #f0f0fc;--luzmo-background-color-down: #f1f1ff;--luzmo-background-color-focus: #f0f0fc;--luzmo-background-color-highlight: rgb(240, 240, 240);--luzmo-background-color-highlight-disabled: rgb(245, 245, 245);--luzmo-background-color-highlight-hover: rgb(225, 225, 225);--luzmo-background-color-highlight-down: rgb(215, 215, 215);--luzmo-background-color-highlight-focus: rgb(225, 225, 225);--luzmo-border-width: 1px;--luzmo-font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", Helvetica, Arial, sans-serif;--luzmo-font-size-xs: 10px;--luzmo-font-size-s: 12px;--luzmo-font-size-m: 14px;--luzmo-font-size: 14px;--luzmo-font-size-l: 16px;--luzmo-font-size-xl: 18px;--luzmo-font-size-xxl: 20px;--luzmo-font-style: normal;--luzmo-line-height: normal;--luzmo-font-weight: 400;--luzmo-font-weight-semibold: 500;--luzmo-font-weight-bold: 600;--luzmo-font-color: #333;--luzmo-font-color-hard: #000;--luzmo-font-color-disabled: var(--luzmo-disabled-color);--luzmo-font-color-extra-dimmed: #888;--luzmo-font-color-hover: #333;--luzmo-font-color-down: #111;--luzmo-font-color-focus: #333;--luzmo-primary: #4434ff;--luzmo-primary-hover: #4234e4;--luzmo-primary-down: #392cc7;--luzmo-primary-focus: #4234e4;--luzmo-primary-inverse-color: #ffffff;--luzmo-primary-rgb: 68, 52, 255;--luzmo-secondary: #ff00ff;--luzmo-secondary-hover: #e309e3;--luzmo-secondary-down: #c711c7;--luzmo-secondary-focus: #e309e3;--luzmo-secondary-inverse-color: #ffffff;--luzmo-secondary-rgb: 255, 0, 255;--luzmo-negative-color: #ca221c;--luzmo-negative-color-hover: #b3241f;--luzmo-negative-color-down: #9f231f;--luzmo-negative-color-focus: #b3241f;--luzmo-negative-color-rgb: 202, 34, 28;--luzmo-positive-color: rgb(20, 150, 101);--luzmo-positive-color-hover: rgb(17, 128, 86);--luzmo-positive-color-down: rgb(16, 105, 71);--luzmo-positive-color-focus: rgb(17, 128, 86);--luzmo-positive-color-rgb: 20, 150, 101;--luzmo-selected-color: rgb(110, 110, 110);--luzmo-selected-color-hover: rgb(70, 70, 70);--luzmo-selected-color-down: rgb(40, 40, 40);--luzmo-selected-color-focus: rgb(70, 70, 70);--luzmo-selected-color-hard: #1e1e1e;--luzmo-selected-color-hard-hover: rgb(0, 0, 0);--luzmo-selected-color-hard-down: rgb(0, 0, 0);--luzmo-selected-color-hard-focus: rgb(0, 0, 0);--luzmo-informative-color: #1a77e9;--luzmo-informative-color-rgb: 26, 119, 233;--luzmo-disabled-color: #aaaaaa;--luzmo-spacing-1: 2px;--luzmo-spacing-2: 4px;--luzmo-spacing-3: 8px;--luzmo-spacing-4: 12px;--luzmo-spacing-5: 16px;--luzmo-indicator-gap: 2px;--luzmo-indicator-width: 1px;--luzmo-indicator-color: var(--luzmo-primary);--luzmo-component-height-xxs: 20px;--luzmo-component-height-xs: 24px;--luzmo-component-height-s: 28px;--luzmo-component-height: 32px;--luzmo-component-height-l: 40px;--luzmo-component-height-xl: 48px;--luzmo-component-height-xxl: 64px;--luzmo-icon-size-xxs: 12px;--luzmo-icon-size-xs: 14px;--luzmo-icon-size-s: 16px;--luzmo-icon-size-m: 18px;--luzmo-icon-size-l: 20px;--luzmo-icon-size-xl: 22px;--luzmo-icon-size-xxl: 32px}`;
|
|
23
|
+
document.head.appendChild(styleElement);
|
|
38
24
|
}
|
|
39
25
|
};
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
26
|
+
initializeGlobalLuzmoCSSVariables();
|
|
27
|
+
import { unsafeCSS, nothing, html, css } from "lit";
|
|
28
|
+
import { property } from "lit/decorators/property.js";
|
|
29
|
+
import { a as LuzmoElement } from "../base-DmeVy0cq.js";
|
|
30
|
+
import { F as FocusVisiblePolyfillMixin } from "../focus-visible-BUPRWlsh.js";
|
|
31
|
+
import { O as ObserveSlotPresence } from "../observe-slot-presence-DcMdoumP.js";
|
|
32
|
+
import { O as ObserveSlotText } from "../observe-slot-text-CjnkkBPn.js";
|
|
33
|
+
import { r as randomID } from "../random-id-BEc6QIUL.js";
|
|
34
|
+
import { IntersectionController } from "@lit-labs/observers/intersection-controller.js";
|
|
35
|
+
import { ResizeController } from "@lit-labs/observers/resize-controller.js";
|
|
36
|
+
import { property as property$1, query, state, queryAssignedElements } from "lit/decorators.js";
|
|
37
|
+
import { classMap } from "lit/directives/class-map.js";
|
|
38
|
+
import { ifDefined } from "lit/directives/if-defined.js";
|
|
39
|
+
import { S as SizedMixin } from "../sized-mixin-DmkrNdWB.js";
|
|
40
|
+
import { F as Focusable } from "../focusable-ChCLg1k4.js";
|
|
41
|
+
import { R as RovingTabindexController } from "../roving-tabindex-DPF9NmrH.js";
|
|
42
|
+
import { luzmoAngleLeft, luzmoAngleRight } from "@luzmo/icons";
|
|
43
|
+
import "../action-button/index.js";
|
|
44
|
+
import "../icon/index.js";
|
|
45
|
+
const tabItemStyles = ':host{font-family:var(--luzmo-tab-font-family, var(--luzmo-font-family));box-sizing:border-box;block-size:calc(var(--luzmo-tabs-item-height, var(--tabs-item-height)) - var(--luzmo-tabs-divider-size, var(--tabs-divider-size)));z-index:1;white-space:nowrap;color:var(--highcontrast-tabs-color, var(--luzmo-tabs-color, var(--tabs-color)));transition:color var(--luzmo-tabs-animation-duration, var(--tabs-animation-duration)) ease-out;cursor:pointer;outline:none;-webkit-text-decoration:none;text-decoration:none;position:relative}::slotted([slot=icon]){block-size:var(--luzmo-tabs-icon-size, var(--tabs-icon-size));inline-size:var(--luzmo-tabs-icon-size, var(--tabs-icon-size));margin-block-start:var(--luzmo-tabs-top-to-icon, var(--tabs-top-to-icon))}[name=icon]+#item-label{margin-inline-start:var(--luzmo-tabs-icon-to-text, var(--tabs-icon-to-text))}:host:before{content:"";box-sizing:border-box;block-size:calc(100% - var(--luzmo-tabs-top-to-text, var(--tabs-top-to-text)));inline-size:calc(100% + var(--luzmo-tabs-focus-indicator-gap, var(--tabs-focus-indicator-gap)) * 2);border:var(--luzmo-tabs-focus-indicator-width, var(--tabs-focus-indicator-width)) solid transparent;border-radius:var(--luzmo-tabs-focus-indicator-border-radius, var(--tabs-focus-indicator-border-radius));pointer-events:none;position:absolute;inset-block-start:calc(var(--luzmo-tabs-top-to-text, var(--tabs-top-to-text)) / 2);inset-inline-start:calc(var(--luzmo-tabs-focus-indicator-gap, var(--tabs-focus-indicator-gap)) * -1);inset-inline-end:calc(var(--luzmo-tabs-focus-indicator-gap, var(--tabs-focus-indicator-gap)) * -1)}@media (hover: hover){:host(:hover){color:var(--highcontrast-tabs-color-hover, var(--luzmo-tabs-color-hover, var(--tabs-color-hover)))}}:host([selected]){color:var(--highcontrast-tabs-color-selected, var(--luzmo-tabs-color-selected, var(--tabs-color-selected)))}:host([disabled]){cursor:default;color:var(--highcontrast-tabs-color-disabled, var(--luzmo-tabs-color-disabled, var(--tabs-color-disabled)))}:host([disabled]) #item-label{cursor:default}:host(:focus-visible){color:var(--highcontrast-tabs-color-key-focus, var(--luzmo-tabs-color-key-focus, var(--tabs-color-key-focus)))}:host(:focus-visible):before{border-color:var(--highcontrast-tabs-focus-indicator-color, var(--luzmo-tabs-focus-indicator-color, var(--tabs-focus-indicator-color)))}#item-label{cursor:pointer;vertical-align:top;font-family:var(--luzmo-tabs-font-family, var(--tabs-font-family));font-style:var(--luzmo-tabs-font-style, var(--tabs-font-style));font-size:var(--luzmo-tabs-font-size, var(--tabs-font-size));font-weight:var(--luzmo-tabs-font-weight, var(--tabs-font-weight));line-height:var(--luzmo-tabs-line-height, var(--tabs-line-height));margin-block-start:var(--luzmo-tabs-top-to-text, var(--tabs-top-to-text));margin-block-end:var(--luzmo-tabs-bottom-to-text, var(--tabs-bottom-to-text));-webkit-text-decoration:none;text-decoration:none;display:inline-block}#item-label:empty{display:none}:host{scroll-margin-inline:var(--luzmo-tabs-item-horizontal-spacing, var(--tabs-item-horizontal-spacing))}:host([disabled]){pointer-events:none}#item-label[hidden]{display:none}@media (forced-colors: active){:host:before{background-color:ButtonFace}:host ::slotted([slot=icon]){z-index:1;position:relative;color:inherit}#item-label{position:relative;z-index:1}:host([selected]){color:HighlightText}:host([selected]) ::slotted([slot=icon]){color:HighlightText}:host([selected]) #item-label{color:HighlightText}}:host([vertical]){display:flex;flex-direction:column;justify-content:center;align-items:center;height:auto}:host([dir][vertical]) slot[name=icon]+#item-label{margin-inline-start:0;margin-block:calc(var(--luzmo-tabs-top-to-text, var(--tabs-top-to-text)) / 2) calc(var(--luzmo-tabs-bottom-to-text, var(--tabs-bottom-to-text)) / 2)}:host([vertical]) ::slotted([slot=icon]){margin-block-start:calc(var(--luzmo-tabs-top-to-icon, var(--tabs-top-to-icon)) / 2)}';
|
|
46
|
+
var __defProp$3 = Object.defineProperty;
|
|
47
|
+
var __decorateClass$3 = (decorators, target, key, kind) => {
|
|
48
|
+
var result = void 0;
|
|
49
|
+
for (var i = decorators.length - 1, decorator; i >= 0; i--)
|
|
50
|
+
if (decorator = decorators[i])
|
|
51
|
+
result = decorator(target, key, result) || result;
|
|
52
|
+
if (result) __defProp$3(target, key, result);
|
|
53
|
+
return result;
|
|
46
54
|
};
|
|
47
|
-
class
|
|
48
|
-
|
|
55
|
+
class LuzmoTab extends FocusVisiblePolyfillMixin(
|
|
56
|
+
ObserveSlotText(ObserveSlotPresence(LuzmoElement, '[slot="icon"]'), "")
|
|
49
57
|
) {
|
|
50
58
|
constructor() {
|
|
51
|
-
super(...arguments)
|
|
59
|
+
super(...arguments);
|
|
60
|
+
this.disabled = false;
|
|
61
|
+
this.label = "";
|
|
62
|
+
this.selected = false;
|
|
63
|
+
this.vertical = false;
|
|
64
|
+
this.value = "";
|
|
52
65
|
}
|
|
53
66
|
static get styles() {
|
|
54
|
-
return [
|
|
67
|
+
return [unsafeCSS(tabItemStyles)];
|
|
55
68
|
}
|
|
56
69
|
get hasIcon() {
|
|
57
70
|
return this.slotContentIsPresent;
|
|
@@ -60,48 +73,69 @@ class h extends _(
|
|
|
60
73
|
return !!this.label || this.slotHasContent;
|
|
61
74
|
}
|
|
62
75
|
render() {
|
|
63
|
-
return
|
|
64
|
-
${this.hasIcon ?
|
|
76
|
+
return html`
|
|
77
|
+
${this.hasIcon ? html` <slot name="icon"></slot> ` : nothing}
|
|
65
78
|
<label id="item-label" ?hidden=${!this.hasLabel}>
|
|
66
|
-
${this.slotHasContent ?
|
|
79
|
+
${this.slotHasContent ? nothing : this.label}
|
|
67
80
|
<slot>${this.label}</slot>
|
|
68
81
|
</label>
|
|
69
82
|
`;
|
|
70
83
|
}
|
|
71
|
-
firstUpdated(
|
|
72
|
-
super.firstUpdated(
|
|
84
|
+
firstUpdated(changes) {
|
|
85
|
+
super.firstUpdated(changes);
|
|
86
|
+
this.setAttribute("role", "tab");
|
|
87
|
+
if (!this.hasAttribute("id")) {
|
|
88
|
+
this.id = `luzmo-tab-${randomID()}`;
|
|
89
|
+
}
|
|
73
90
|
}
|
|
74
|
-
updated(
|
|
75
|
-
super.updated(
|
|
91
|
+
updated(changes) {
|
|
92
|
+
super.updated(changes);
|
|
93
|
+
if (changes.has("selected")) {
|
|
94
|
+
this.setAttribute("aria-selected", this.selected ? "true" : "false");
|
|
95
|
+
this.setAttribute("tabindex", this.selected ? "0" : "-1");
|
|
96
|
+
}
|
|
97
|
+
if (changes.has("disabled")) {
|
|
98
|
+
if (this.disabled) {
|
|
99
|
+
this.setAttribute("aria-disabled", "true");
|
|
100
|
+
} else {
|
|
101
|
+
this.removeAttribute("aria-disabled");
|
|
102
|
+
}
|
|
103
|
+
}
|
|
76
104
|
}
|
|
77
105
|
}
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
],
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
],
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
],
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
],
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
],
|
|
93
|
-
const
|
|
94
|
-
var
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
106
|
+
__decorateClass$3([
|
|
107
|
+
property({ type: Boolean, reflect: true })
|
|
108
|
+
], LuzmoTab.prototype, "disabled");
|
|
109
|
+
__decorateClass$3([
|
|
110
|
+
property({ reflect: true })
|
|
111
|
+
], LuzmoTab.prototype, "label");
|
|
112
|
+
__decorateClass$3([
|
|
113
|
+
property({ type: Boolean, reflect: true })
|
|
114
|
+
], LuzmoTab.prototype, "selected");
|
|
115
|
+
__decorateClass$3([
|
|
116
|
+
property({ type: Boolean, reflect: true })
|
|
117
|
+
], LuzmoTab.prototype, "vertical");
|
|
118
|
+
__decorateClass$3([
|
|
119
|
+
property({ type: String, reflect: true })
|
|
120
|
+
], LuzmoTab.prototype, "value");
|
|
121
|
+
const panelStyles = ":host{display:inline-flex;font-family:var(--luzmo-tab-panel-font-family, var(--luzmo-font-family))}:host(:not([selected])){display:none}:host(:focus-visible){outline:var(--luzmo-tab-panel-indicator-color, var(--luzmo-indicator-color)) solid var(--luzmo-tab-panel-indicator-width, var(--luzmo-indicator-width))}";
|
|
122
|
+
var __defProp$2 = Object.defineProperty;
|
|
123
|
+
var __decorateClass$2 = (decorators, target, key, kind) => {
|
|
124
|
+
var result = void 0;
|
|
125
|
+
for (var i = decorators.length - 1, decorator; i >= 0; i--)
|
|
126
|
+
if (decorator = decorators[i])
|
|
127
|
+
result = decorator(target, key, result) || result;
|
|
128
|
+
if (result) __defProp$2(target, key, result);
|
|
129
|
+
return result;
|
|
98
130
|
};
|
|
99
|
-
class
|
|
131
|
+
class LuzmoTabPanel extends LuzmoElement {
|
|
100
132
|
constructor() {
|
|
101
|
-
super(...arguments)
|
|
133
|
+
super(...arguments);
|
|
134
|
+
this.selected = false;
|
|
135
|
+
this.value = "";
|
|
102
136
|
}
|
|
103
137
|
static get styles() {
|
|
104
|
-
return [
|
|
138
|
+
return [unsafeCSS(panelStyles)];
|
|
105
139
|
}
|
|
106
140
|
handleFocusin() {
|
|
107
141
|
this.removeAttribute("tabindex");
|
|
@@ -110,7 +144,7 @@ class w extends g {
|
|
|
110
144
|
this.tabIndex = this.selected ? 0 : -1;
|
|
111
145
|
}
|
|
112
146
|
render() {
|
|
113
|
-
return
|
|
147
|
+
return html`
|
|
114
148
|
<slot
|
|
115
149
|
@focusin=${this.handleFocusin}
|
|
116
150
|
@focusout=${this.handleFocusout}
|
|
@@ -118,107 +152,55 @@ class w extends g {
|
|
|
118
152
|
`;
|
|
119
153
|
}
|
|
120
154
|
firstUpdated() {
|
|
121
|
-
this.slot = "tab-panel"
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
}
|
|
127
|
-
L([
|
|
128
|
-
l({ type: Boolean, reflect: !0 })
|
|
129
|
-
], w.prototype, "selected");
|
|
130
|
-
L([
|
|
131
|
-
l({ type: String, reflect: !0 })
|
|
132
|
-
], w.prototype, "value");
|
|
133
|
-
/**
|
|
134
|
-
* @license
|
|
135
|
-
* Copyright 2021 Google LLC
|
|
136
|
-
* SPDX-License-Identifier: BSD-3-Clause
|
|
137
|
-
*/
|
|
138
|
-
class N {
|
|
139
|
-
constructor(t, { target: o, config: i, callback: e, skipInitial: a }) {
|
|
140
|
-
this.t = /* @__PURE__ */ new Set(), this.o = !1, this.i = !1, this.h = t, o !== null && this.t.add(o ?? t), this.o = a ?? this.o, this.callback = e, window.IntersectionObserver ? (this.u = new IntersectionObserver((s) => {
|
|
141
|
-
const f = this.i;
|
|
142
|
-
this.i = !1, this.o && f || (this.handleChanges(s), this.h.requestUpdate());
|
|
143
|
-
}, i), t.addController(this)) : console.warn("IntersectionController error: browser does not support IntersectionObserver.");
|
|
144
|
-
}
|
|
145
|
-
handleChanges(t) {
|
|
146
|
-
var o;
|
|
147
|
-
this.value = (o = this.callback) == null ? void 0 : o.call(this, t, this.u);
|
|
148
|
-
}
|
|
149
|
-
hostConnected() {
|
|
150
|
-
for (const t of this.t) this.observe(t);
|
|
151
|
-
}
|
|
152
|
-
hostDisconnected() {
|
|
153
|
-
this.disconnect();
|
|
154
|
-
}
|
|
155
|
-
async hostUpdated() {
|
|
156
|
-
const t = this.u.takeRecords();
|
|
157
|
-
t.length && this.handleChanges(t);
|
|
158
|
-
}
|
|
159
|
-
observe(t) {
|
|
160
|
-
this.t.add(t), this.u.observe(t), this.i = !0;
|
|
161
|
-
}
|
|
162
|
-
unobserve(t) {
|
|
163
|
-
this.t.delete(t), this.u.unobserve(t);
|
|
164
|
-
}
|
|
165
|
-
disconnect() {
|
|
166
|
-
this.u.disconnect();
|
|
167
|
-
}
|
|
168
|
-
}
|
|
169
|
-
/**
|
|
170
|
-
* @license
|
|
171
|
-
* Copyright 2021 Google LLC
|
|
172
|
-
* SPDX-License-Identifier: BSD-3-Clause
|
|
173
|
-
*/
|
|
174
|
-
class $ {
|
|
175
|
-
constructor(t, { target: o, config: i, callback: e, skipInitial: a }) {
|
|
176
|
-
this.t = /* @__PURE__ */ new Set(), this.o = !1, this.i = !1, this.h = t, o !== null && this.t.add(o ?? t), this.l = i, this.o = a ?? this.o, this.callback = e, window.ResizeObserver ? (this.u = new ResizeObserver((s) => {
|
|
177
|
-
this.handleChanges(s), this.h.requestUpdate();
|
|
178
|
-
}), t.addController(this)) : console.warn("ResizeController error: browser does not support ResizeObserver.");
|
|
179
|
-
}
|
|
180
|
-
handleChanges(t) {
|
|
181
|
-
var o;
|
|
182
|
-
this.value = (o = this.callback) == null ? void 0 : o.call(this, t, this.u);
|
|
183
|
-
}
|
|
184
|
-
hostConnected() {
|
|
185
|
-
for (const t of this.t) this.observe(t);
|
|
186
|
-
}
|
|
187
|
-
hostDisconnected() {
|
|
188
|
-
this.disconnect();
|
|
189
|
-
}
|
|
190
|
-
async hostUpdated() {
|
|
191
|
-
!this.o && this.i && this.handleChanges([]), this.i = !1;
|
|
192
|
-
}
|
|
193
|
-
observe(t) {
|
|
194
|
-
this.t.add(t), this.u.observe(t, this.l), this.i = !0, this.h.requestUpdate();
|
|
195
|
-
}
|
|
196
|
-
unobserve(t) {
|
|
197
|
-
this.t.delete(t), this.u.unobserve(t);
|
|
155
|
+
this.slot = "tab-panel";
|
|
156
|
+
this.setAttribute("role", "tabpanel");
|
|
157
|
+
this.tabIndex = 0;
|
|
158
|
+
if (!this.hasAttribute("id")) {
|
|
159
|
+
this.id = `luzmo-tab-panel-${randomID()}`;
|
|
160
|
+
}
|
|
198
161
|
}
|
|
199
|
-
|
|
200
|
-
|
|
162
|
+
updated(changes) {
|
|
163
|
+
if (changes.has("selected")) {
|
|
164
|
+
if (this.selected) {
|
|
165
|
+
this.removeAttribute("aria-hidden");
|
|
166
|
+
this.tabIndex = 0;
|
|
167
|
+
} else {
|
|
168
|
+
this.setAttribute("aria-hidden", "true");
|
|
169
|
+
this.tabIndex = -1;
|
|
170
|
+
}
|
|
171
|
+
}
|
|
201
172
|
}
|
|
202
173
|
}
|
|
203
|
-
const I = "#list{--tabs-item-height: calc( var(--luzmo-component-height) + var(--luzmo-spacing-5) );--tabs-item-horizontal-spacing: calc( var(--luzmo-spacing-5) + var(--luzmo-spacing-3) );--tabs-item-vertical-spacing: var(--luzmo-spacing-2);--tabs-start-to-edge: var(--luzmo-spacing-4);--tabs-top-to-text: calc(var(--luzmo-spacing-4) + var(--luzmo-spacing-1));--tabs-bottom-to-text: calc(var(--luzmo-spacing-4) + var(--luzmo-spacing-1));--tabs-icon-size: var(--luzmo-icon-size-s);--tabs-icon-to-text: var(--luzmo-spacing-3);--tabs-top-to-icon: var(--luzmo-spacing-4);--tabs-focus-indicator-gap: var(--luzmo-spacing-3);--tabs-font-size: var(--luzmo-font-size)}:host([size=s]) #list{--tabs-item-height: calc( var(--luzmo-component-height-s) + var(--luzmo-spacing-4) );--tabs-item-horizontal-spacing: calc( var(--luzmo-spacing-5) + var(--luzmo-spacing-2) );--tabs-item-vertical-spacing: var(--luzmo-spacing-2);--tabs-start-to-edge: var(--luzmo-spacing-4);--tabs-top-to-text: calc(var(--luzmo-spacing-4) + var(--luzmo-spacing-1));--tabs-bottom-to-text: var(--luzmo-spacing-4);--tabs-icon-size: var(--luzmo-icon-size-xs);--tabs-icon-to-text: var(--luzmo-spacing-3);--tabs-top-to-icon: var(--luzmo-spacing-4);--tabs-focus-indicator-gap: var(--luzmo-spacing-3);--tabs-font-size: var(--luzmo-font-size-s)}:host([size=l]) #list{--tabs-item-height: calc( var(--luzmo-component-height-l) + var(--luzmo-spacing-5) );--tabs-item-horizontal-spacing: calc( var(--luzmo-spacing-5) + var(--luzmo-spacing-4) );--tabs-item-vertical-spacing: var(--luzmo-spacing-2);--tabs-start-to-edge: calc(var(--luzmo-spacing-4) + var(--luzmo-spacing-1));--tabs-top-to-text: calc(var(--luzmo-spacing-5) + var(--luzmo-spacing-1));--tabs-bottom-to-text: calc(var(--luzmo-spacing-5) + var(--luzmo-spacing-1));--tabs-icon-size: var(--luzmo-icon-size-m);--tabs-icon-to-text: calc(var(--luzmo-spacing-3) + var(--luzmo-spacing-1));--tabs-top-to-icon: var(--luzmo-spacing-5);--tabs-focus-indicator-gap: calc( var(--luzmo-spacing-3) + var(--luzmo-spacing-1) );--tabs-font-size: var(--luzmo-font-size-l)}:host([size=xl]) #list{--tabs-item-height: calc( var(--luzmo-component-height-xl) + var(--luzmo-spacing-5) );--tabs-item-horizontal-spacing: calc( var(--luzmo-spacing-5) + var(--luzmo-spacing-4) );--tabs-item-vertical-spacing: var(--luzmo-spacing-2);--tabs-start-to-edge: calc(var(--luzmo-spacing-4) + var(--luzmo-spacing-1));--tabs-top-to-text: calc(var(--luzmo-spacing-5) + var(--luzmo-spacing-1));--tabs-bottom-to-text: calc(var(--luzmo-spacing-5) + var(--luzmo-spacing-1));--tabs-icon-size: var(--luzmo-icon-size-l);--tabs-icon-to-text: calc(var(--luzmo-spacing-3) + var(--luzmo-spacing-1));--tabs-top-to-icon: var(--luzmo-spacing-5);--tabs-focus-indicator-gap: calc( var(--luzmo-spacing-3) + var(--luzmo-spacing-1) );--tabs-font-size: var(--luzmo-font-size-xl)}:host([compact]) #list{--luzmo-tabs-item-height: var( --luzmo-tabs-item-height-compact, var(--luzmo-component-height) );--luzmo-tabs-top-to-text: var( --luzmo-tabs-top-to-text-compact, calc(var(--luzmo-spacing-2) + var(--luzmo-spacing-1)) );--luzmo-tabs-bottom-to-text: var( --luzmo-tabs-bottom-to-text-compact, calc(var(--luzmo-spacing-2) + var(--luzmo-spacing-1)) );--luzmo-tabs-top-to-icon: var( --luzmo-tabs-top-to-icon-compact, var(--luzmo-spacing-2) )}:host([size=s][compact]) #list{--luzmo-tabs-item-height: var( --luzmo-tabs-item-height-compact, var(--luzmo-component-height-s) );--luzmo-tabs-top-to-text: var( --luzmo-tabs-top-to-text-compact, var(--luzmo-spacing-2) );--luzmo-tabs-bottom-to-text: var( --luzmo-tabs-bottom-to-text-compact, var(--luzmo-spacing-2) );--luzmo-tabs-top-to-icon: var( --luzmo-tabs-top-to-icon-compact, var(--luzmo-spacing-1) )}:host([size=l][compact]) #list{--luzmo-tabs-item-height: var( --luzmo-tabs-item-height-compact, var(--luzmo-component-height-l) );--luzmo-tabs-top-to-text: var( --luzmo-tabs-top-to-text-compact, calc(var(--luzmo-spacing-3) + var(--luzmo-spacing-1)) );--luzmo-tabs-bottom-to-text: var( --luzmo-tabs-bottom-to-text-compact, calc(var(--luzmo-spacing-3) + var(--luzmo-spacing-1)) );--luzmo-tabs-top-to-icon: var( --luzmo-tabs-top-to-icon-compact, calc(var(--luzmo-spacing-3)) )}:host([size=xl][compact]) #list{--luzmo-tabs-item-height: var( --luzmo-tabs-item-height-compact, var(--luzmo-component-height-xl) );--luzmo-tabs-top-to-text: var( --luzmo-tabs-top-to-text-compact, var(--luzmo-spacing-4) );--luzmo-tabs-bottom-to-text: var( --luzmo-tabs-bottom-to-text-compact, var(--luzmo-spacing-4) );--luzmo-tabs-top-to-icon: var( --luzmo-tabs-top-to-icon-compact, calc(var(--luzmo-spacing-3) + var(--luzmo-spacing-1)) )}", X = "#list{--tabs-color: var(--luzmo-font-color);--tabs-color-selected: var(--luzmo-font-color-down);--tabs-color-hover: var(--luzmo-font-color-hover);--tabs-color-key-focus: var(--luzmo-font-color-focus);--tabs-color-disabled: var(--luzmo-disabled-color);--tabs-font-family: var(--luzmo-font-family);--tabs-font-style: var(--luzmo-font-style);--tabs-font-size: var(--luzmo-font-size);--tabs-line-height: var(--luzmo-line-height);--tabs-focus-indicator-width: var(--luzmo-indicator-width);--tabs-focus-indicator-border-radius: var(--luzmo-border-radius);--tabs-focus-indicator-color: var(--luzmo-indicator-color);--tabs-selection-indicator-color: var(--luzmo-font-color-down);--tabs-list-background-direction: top;--tabs-divider-size: 2px;--tabs-divider-border-radius: 1px;--tabs-animation-duration: var(--luzmo-animation-duration);--tabs-animation-ease: ease-in-out}:host([emphasized]) #list{--luzmo-tabs-color-selected: var( --luzmo-tabs-color-selected-emphasized, var(--luzmo-primary) );--luzmo-tabs-color-hover: var( --luzmo-tabs-color-hover-emphasized, var(--luzmo-primary-hover) );--luzmo-tabs-color-key-focus: var( --luzmo-tabs-color-key-focus-emphasized, var(--luzmo-primary-focus) );--luzmo-tabs-selection-indicator-color: var( --luzmo-tabs-selection-indicator-color-emphasized, var(--luzmo-primary-down) )}:host([direction^=vertical]) #list{--luzmo-tabs-list-background-direction: var( --luzmo-tabs-list-background-direction-vertical, right )}:host([direction^=vertical-right]) #list{--luzmo-tabs-list-background-direction: var( --luzmo-tabs-list-background-direction-vertical-right, left )}:host([direction^=vertical]) #list:dir(rtl),:host([dir=rtl][direction^=vertical]) #list{--luzmo-tabs-list-background-direction: var( --luzmo-tabs-list-background-direction-vertical, left )}:host([direction^=vertical-right]) #list:dir(rtl),:host([dir=rtl][direction^=vertical-right]) #list{--luzmo-tabs-list-background-direction: var( --luzmo-tabs-list-background-direction-vertical, right )}#list{z-index:0;vertical-align:top;background:linear-gradient(to var(--luzmo-tabs-list-background-direction, var(--tabs-list-background-direction)),var(--highcontrast-tabs-divider-background-color, var(--luzmo-tabs-divider-background-color, var(--tabs-divider-background-color))) 0 var(--luzmo-tabs-divider-size, var(--tabs-divider-size)),transparent var(--luzmo-tabs-divider-size, var(--tabs-divider-size)));margin:0;padding-block:0;display:flex;position:relative}::slotted([selected]:not([slot])){color:var(--highcontrast-tabs-color-selected, var(--luzmo-tabs-color-selected, var(--tabs-color-selected)))}::slotted([disabled]:not([slot])){cursor:default;color:var(--highcontrast-tabs-color-disabled, var(--luzmo-tabs-color-disabled, var(--tabs-color-disabled)))}#selection-indicator{background-color:var(--highcontrast-tabs-selection-indicator-color, var(--luzmo-tabs-selection-indicator-color, var(--tabs-selection-indicator-color)));z-index:0;transition:transform var(--luzmo-tabs-animation-duration, var(--tabs-animation-duration)) var(--luzmo-tabs-animation-ease, var(--tabs-animation-ease));transform-origin:0 0;border-radius:var(--luzmo-tabs-divider-border-radius, var(--tabs-divider-border-radius));position:absolute;inset-inline-start:0}:host([direction^=horizontal]) #list{align-items:center}:host([direction^=horizontal]) #list ::slotted(:not([slot])){vertical-align:top}:host([direction^=horizontal]) ::slotted(:not(:first-child)){margin-inline-start:var(--luzmo-tabs-item-horizontal-spacing, var(--tabs-item-horizontal-spacing))}:host([direction^=horizontal]) #list #selection-indicator{block-size:var(--luzmo-tabs-divider-size, var(--tabs-divider-size));position:absolute;inset-block-end:0}:host([direction^=horizontal][compact]) #list{box-sizing:initial;align-items:end}:host([quiet]) #list{background:none;border-color:transparent;display:inline-flex}:host([quiet]) #selection-indicator{padding-inline-start:var(--luzmo-tabs-start-to-item-quiet)}:host([direction^=vertical]) #list,:host([direction^=vertical-right]) #list{flex-direction:column;padding:0;display:inline-flex}:host([direction^=vertical-right][quiet]) #list,:host([direction^=vertical][quiet]) #list{border-color:transparent}:host([direction^=vertical]) #list ::slotted(:not([slot])),:host([direction^=vertical-right]) #list ::slotted(:not([slot])){block-size:var(--luzmo-tabs-item-height, var(--tabs-item-height));line-height:var(--luzmo-tabs-item-height, var(--tabs-item-height));margin-block-end:var(--luzmo-tabs-item-vertical-spacing, var(--tabs-item-vertical-spacing));margin-inline-start:var(--luzmo-tabs-start-to-edge, var(--tabs-start-to-edge));margin-inline-end:var(--luzmo-tabs-start-to-edge, var(--tabs-start-to-edge));padding-block:0}:host([direction^=vertical]) #list ::slotted(:not([slot])):before,:host([direction^=vertical-right]) #list ::slotted(:not([slot])):before{inset-inline-start:calc(var(--luzmo-tabs-focus-indicator-gap, var(--tabs-focus-indicator-gap)) * -1)}:host([direction^=vertical]) #list #selection-indicator,:host([direction^=vertical-right]) #list #selection-indicator{inline-size:var(--luzmo-tabs-divider-size, var(--tabs-divider-size));position:absolute;inset-block-start:0;inset-inline-start:0}:host([direction^=vertical-right]) #list #selection-indicator{inset-inline:auto 0}@media (forced-colors: active){#list{--highcontrast-tabs-divider-background-color: var(--luzmo-border-color);--highcontrast-tabs-selection-indicator-color: Highlight;--highcontrast-tabs-focus-indicator-color: CanvasText;--highcontrast-tabs-focus-indicator-background-color: Highlight;--highcontrast-tabs-color: ButtonText;--highcontrast-tabs-color-hover: ButtonText;--highcontrast-tabs-color-selected: HighlightText;--highcontrast-tabs-color-key-focus: ButtonText;--highcontrast-tabs-color-disabled: GrayText;forced-color-adjust:none}#list ::slotted([selected]:not([slot])):before{background-color:var(--highcontrast-tabs-focus-indicator-background-color)}:host([direction^=vertical][compact]) #list #list ::slotted(:not([slot])):before{block-size:100%;inset-block-start:0}:host([quiet]) #list{background:linear-gradient(to var(--luzmo-tabs-list-background-direction, var(--tabs-list-background-direction)),var(--highcontrast-tabs-divider-background-color, var(--luzmo-tabs-divider-background-color, var(--tabs-divider-background-color))) 0 var(--luzmo-tabs-divider-size, var(--tabs-divider-size)),transparent var(--luzmo-tabs-divider-size, var(--tabs-divider-size)))}}#list{--tabs-font-weight: var(--luzmo-font-weight);--tabs-divider-background-color: var(--luzmo-border-color)}:host{display:grid;grid-template-columns:100%;position:relative}:host(:not([direction^=vertical])){grid-template-rows:auto 1fr}:host([direction^=vertical]){grid-template-columns:auto 1fr}:host([dir=rtl]) #selection-indicator{left:0;right:auto}:host([direction=vertical-right]) #list #selection-indicator{inset-inline:auto 0}#list{justify-content:var(--luzmo-tabs-list-justify-content)}:host([disabled]) #list{pointer-events:none}:host([disabled]) #list #selection-indicator{background-color:var(--luzmo-tabs-color-disabled, var(--tabs-color-disabled))}:host([disabled]) ::slotted(sp-tab){color:var(--luzmo-tabs-color-disabled, var(--tabs-color-disabled))}:host([direction=vertical-right]) #list #selection-indicator,:host([direction=vertical]) #list #selection-indicator{inset-block-start:0}#selection-indicator.first-position{transition:none}:host([dir][direction=horizontal]) #list.scroll{scrollbar-width:none;overflow:auto hidden}:host([dir][direction=horizontal]) #list.scroll::-webkit-scrollbar{display:none}";
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
174
|
+
__decorateClass$2([
|
|
175
|
+
property({ type: Boolean, reflect: true })
|
|
176
|
+
], LuzmoTabPanel.prototype, "selected");
|
|
177
|
+
__decorateClass$2([
|
|
178
|
+
property({ type: String, reflect: true })
|
|
179
|
+
], LuzmoTabPanel.prototype, "value");
|
|
180
|
+
const tabSizes = "#list{--tabs-item-height: calc( var(--luzmo-component-height) + var(--luzmo-spacing-5) );--tabs-item-horizontal-spacing: calc( var(--luzmo-spacing-5) + var(--luzmo-spacing-3) );--tabs-item-vertical-spacing: var(--luzmo-spacing-2);--tabs-start-to-edge: var(--luzmo-spacing-4);--tabs-top-to-text: calc(var(--luzmo-spacing-4) + var(--luzmo-spacing-1));--tabs-bottom-to-text: calc(var(--luzmo-spacing-4) + var(--luzmo-spacing-1));--tabs-icon-size: var(--luzmo-icon-size-s);--tabs-icon-to-text: var(--luzmo-spacing-3);--tabs-top-to-icon: var(--luzmo-spacing-4);--tabs-focus-indicator-gap: var(--luzmo-spacing-3);--tabs-font-size: var(--luzmo-font-size)}:host([size=s]) #list{--tabs-item-height: calc( var(--luzmo-component-height-s) + var(--luzmo-spacing-4) );--tabs-item-horizontal-spacing: calc( var(--luzmo-spacing-5) + var(--luzmo-spacing-2) );--tabs-item-vertical-spacing: var(--luzmo-spacing-2);--tabs-start-to-edge: var(--luzmo-spacing-4);--tabs-top-to-text: calc(var(--luzmo-spacing-4) + var(--luzmo-spacing-1));--tabs-bottom-to-text: var(--luzmo-spacing-4);--tabs-icon-size: var(--luzmo-icon-size-xs);--tabs-icon-to-text: var(--luzmo-spacing-3);--tabs-top-to-icon: var(--luzmo-spacing-4);--tabs-focus-indicator-gap: var(--luzmo-spacing-3);--tabs-font-size: var(--luzmo-font-size-s)}:host([size=l]) #list{--tabs-item-height: calc( var(--luzmo-component-height-l) + var(--luzmo-spacing-5) );--tabs-item-horizontal-spacing: calc( var(--luzmo-spacing-5) + var(--luzmo-spacing-4) );--tabs-item-vertical-spacing: var(--luzmo-spacing-2);--tabs-start-to-edge: calc(var(--luzmo-spacing-4) + var(--luzmo-spacing-1));--tabs-top-to-text: calc(var(--luzmo-spacing-5) + var(--luzmo-spacing-1));--tabs-bottom-to-text: calc(var(--luzmo-spacing-5) + var(--luzmo-spacing-1));--tabs-icon-size: var(--luzmo-icon-size-m);--tabs-icon-to-text: calc(var(--luzmo-spacing-3) + var(--luzmo-spacing-1));--tabs-top-to-icon: var(--luzmo-spacing-5);--tabs-focus-indicator-gap: calc( var(--luzmo-spacing-3) + var(--luzmo-spacing-1) );--tabs-font-size: var(--luzmo-font-size-l)}:host([size=xl]) #list{--tabs-item-height: calc( var(--luzmo-component-height-xl) + var(--luzmo-spacing-5) );--tabs-item-horizontal-spacing: calc( var(--luzmo-spacing-5) + var(--luzmo-spacing-4) );--tabs-item-vertical-spacing: var(--luzmo-spacing-2);--tabs-start-to-edge: calc(var(--luzmo-spacing-4) + var(--luzmo-spacing-1));--tabs-top-to-text: calc(var(--luzmo-spacing-5) + var(--luzmo-spacing-1));--tabs-bottom-to-text: calc(var(--luzmo-spacing-5) + var(--luzmo-spacing-1));--tabs-icon-size: var(--luzmo-icon-size-l);--tabs-icon-to-text: calc(var(--luzmo-spacing-3) + var(--luzmo-spacing-1));--tabs-top-to-icon: var(--luzmo-spacing-5);--tabs-focus-indicator-gap: calc( var(--luzmo-spacing-3) + var(--luzmo-spacing-1) );--tabs-font-size: var(--luzmo-font-size-xl)}:host([compact]) #list{--luzmo-tabs-item-height: var( --luzmo-tabs-item-height-compact, var(--luzmo-component-height) );--luzmo-tabs-top-to-text: var( --luzmo-tabs-top-to-text-compact, calc(var(--luzmo-spacing-2) + var(--luzmo-spacing-1)) );--luzmo-tabs-bottom-to-text: var( --luzmo-tabs-bottom-to-text-compact, calc(var(--luzmo-spacing-2) + var(--luzmo-spacing-1)) );--luzmo-tabs-top-to-icon: var( --luzmo-tabs-top-to-icon-compact, var(--luzmo-spacing-2) )}:host([size=s][compact]) #list{--luzmo-tabs-item-height: var( --luzmo-tabs-item-height-compact, var(--luzmo-component-height-s) );--luzmo-tabs-top-to-text: var( --luzmo-tabs-top-to-text-compact, var(--luzmo-spacing-2) );--luzmo-tabs-bottom-to-text: var( --luzmo-tabs-bottom-to-text-compact, var(--luzmo-spacing-2) );--luzmo-tabs-top-to-icon: var( --luzmo-tabs-top-to-icon-compact, var(--luzmo-spacing-1) )}:host([size=l][compact]) #list{--luzmo-tabs-item-height: var( --luzmo-tabs-item-height-compact, var(--luzmo-component-height-l) );--luzmo-tabs-top-to-text: var( --luzmo-tabs-top-to-text-compact, calc(var(--luzmo-spacing-3) + var(--luzmo-spacing-1)) );--luzmo-tabs-bottom-to-text: var( --luzmo-tabs-bottom-to-text-compact, calc(var(--luzmo-spacing-3) + var(--luzmo-spacing-1)) );--luzmo-tabs-top-to-icon: var( --luzmo-tabs-top-to-icon-compact, calc(var(--luzmo-spacing-3)) )}:host([size=xl][compact]) #list{--luzmo-tabs-item-height: var( --luzmo-tabs-item-height-compact, var(--luzmo-component-height-xl) );--luzmo-tabs-top-to-text: var( --luzmo-tabs-top-to-text-compact, var(--luzmo-spacing-4) );--luzmo-tabs-bottom-to-text: var( --luzmo-tabs-bottom-to-text-compact, var(--luzmo-spacing-4) );--luzmo-tabs-top-to-icon: var( --luzmo-tabs-top-to-icon-compact, calc(var(--luzmo-spacing-3) + var(--luzmo-spacing-1)) )}";
|
|
181
|
+
const tabStyles = "#list{--tabs-color: var(--luzmo-font-color);--tabs-color-selected: var(--luzmo-font-color-down);--tabs-color-hover: var(--luzmo-font-color-hover);--tabs-color-key-focus: var(--luzmo-font-color-focus);--tabs-color-disabled: var(--luzmo-disabled-color);--tabs-font-family: var(--luzmo-font-family);--tabs-font-style: var(--luzmo-font-style);--tabs-font-size: var(--luzmo-font-size);--tabs-line-height: var(--luzmo-line-height);--tabs-focus-indicator-width: var(--luzmo-indicator-width);--tabs-focus-indicator-border-radius: var(--luzmo-border-radius);--tabs-focus-indicator-color: var(--luzmo-indicator-color);--tabs-selection-indicator-color: var(--luzmo-font-color-down);--tabs-list-background-direction: top;--tabs-divider-size: 2px;--tabs-divider-border-radius: 1px;--tabs-animation-duration: var(--luzmo-animation-duration);--tabs-animation-ease: ease-in-out}:host([emphasized]) #list{--luzmo-tabs-color-selected: var( --luzmo-tabs-color-selected-emphasized, var(--luzmo-primary) );--luzmo-tabs-color-hover: var( --luzmo-tabs-color-hover-emphasized, var(--luzmo-primary-hover) );--luzmo-tabs-color-key-focus: var( --luzmo-tabs-color-key-focus-emphasized, var(--luzmo-primary-focus) );--luzmo-tabs-selection-indicator-color: var( --luzmo-tabs-selection-indicator-color-emphasized, var(--luzmo-primary-down) )}:host([direction^=vertical]) #list{--luzmo-tabs-list-background-direction: var( --luzmo-tabs-list-background-direction-vertical, right )}:host([direction^=vertical-right]) #list{--luzmo-tabs-list-background-direction: var( --luzmo-tabs-list-background-direction-vertical-right, left )}:host([direction^=vertical]) #list:dir(rtl),:host([dir=rtl][direction^=vertical]) #list{--luzmo-tabs-list-background-direction: var( --luzmo-tabs-list-background-direction-vertical, left )}:host([direction^=vertical-right]) #list:dir(rtl),:host([dir=rtl][direction^=vertical-right]) #list{--luzmo-tabs-list-background-direction: var( --luzmo-tabs-list-background-direction-vertical, right )}#list{z-index:0;vertical-align:top;background:linear-gradient(to var(--luzmo-tabs-list-background-direction, var(--tabs-list-background-direction)),var(--highcontrast-tabs-divider-background-color, var(--luzmo-tabs-divider-background-color, var(--tabs-divider-background-color))) 0 var(--luzmo-tabs-divider-size, var(--tabs-divider-size)),transparent var(--luzmo-tabs-divider-size, var(--tabs-divider-size)));margin:0;padding-block:0;display:flex;position:relative}::slotted([selected]:not([slot])){color:var(--highcontrast-tabs-color-selected, var(--luzmo-tabs-color-selected, var(--tabs-color-selected)))}::slotted([disabled]:not([slot])){cursor:default;color:var(--highcontrast-tabs-color-disabled, var(--luzmo-tabs-color-disabled, var(--tabs-color-disabled)))}#selection-indicator{background-color:var(--highcontrast-tabs-selection-indicator-color, var(--luzmo-tabs-selection-indicator-color, var(--tabs-selection-indicator-color)));z-index:0;transition:transform var(--luzmo-tabs-animation-duration, var(--tabs-animation-duration)) var(--luzmo-tabs-animation-ease, var(--tabs-animation-ease));transform-origin:0 0;border-radius:var(--luzmo-tabs-divider-border-radius, var(--tabs-divider-border-radius));position:absolute;inset-inline-start:0}:host([direction^=horizontal]) #list{align-items:center}:host([direction^=horizontal]) #list ::slotted(:not([slot])){vertical-align:top}:host([direction^=horizontal]) ::slotted(:not(:first-child)){margin-inline-start:var(--luzmo-tabs-item-horizontal-spacing, var(--tabs-item-horizontal-spacing))}:host([direction^=horizontal]) #list #selection-indicator{block-size:var(--luzmo-tabs-divider-size, var(--tabs-divider-size));position:absolute;inset-block-end:0}:host([direction^=horizontal][compact]) #list{box-sizing:initial;align-items:end}:host([quiet]) #list{background:none;border-color:transparent;display:inline-flex}:host([quiet]) #selection-indicator{padding-inline-start:var(--luzmo-tabs-start-to-item-quiet)}:host([direction^=vertical]) #list,:host([direction^=vertical-right]) #list{flex-direction:column;padding:0;display:inline-flex}:host([direction^=vertical-right][quiet]) #list,:host([direction^=vertical][quiet]) #list{border-color:transparent}:host([direction^=vertical]) #list ::slotted(:not([slot])),:host([direction^=vertical-right]) #list ::slotted(:not([slot])){block-size:var(--luzmo-tabs-item-height, var(--tabs-item-height));line-height:var(--luzmo-tabs-item-height, var(--tabs-item-height));margin-block-end:var(--luzmo-tabs-item-vertical-spacing, var(--tabs-item-vertical-spacing));margin-inline-start:var(--luzmo-tabs-start-to-edge, var(--tabs-start-to-edge));margin-inline-end:var(--luzmo-tabs-start-to-edge, var(--tabs-start-to-edge));padding-block:0}:host([direction^=vertical]) #list ::slotted(:not([slot])):before,:host([direction^=vertical-right]) #list ::slotted(:not([slot])):before{inset-inline-start:calc(var(--luzmo-tabs-focus-indicator-gap, var(--tabs-focus-indicator-gap)) * -1)}:host([direction^=vertical]) #list #selection-indicator,:host([direction^=vertical-right]) #list #selection-indicator{inline-size:var(--luzmo-tabs-divider-size, var(--tabs-divider-size));position:absolute;inset-block-start:0;inset-inline-start:0}:host([direction^=vertical-right]) #list #selection-indicator{inset-inline:auto 0}@media (forced-colors: active){#list{--highcontrast-tabs-divider-background-color: var(--luzmo-border-color);--highcontrast-tabs-selection-indicator-color: Highlight;--highcontrast-tabs-focus-indicator-color: CanvasText;--highcontrast-tabs-focus-indicator-background-color: Highlight;--highcontrast-tabs-color: ButtonText;--highcontrast-tabs-color-hover: ButtonText;--highcontrast-tabs-color-selected: HighlightText;--highcontrast-tabs-color-key-focus: ButtonText;--highcontrast-tabs-color-disabled: GrayText;forced-color-adjust:none}#list ::slotted([selected]:not([slot])):before{background-color:var(--highcontrast-tabs-focus-indicator-background-color)}:host([direction^=vertical][compact]) #list #list ::slotted(:not([slot])):before{block-size:100%;inset-block-start:0}:host([quiet]) #list{background:linear-gradient(to var(--luzmo-tabs-list-background-direction, var(--tabs-list-background-direction)),var(--highcontrast-tabs-divider-background-color, var(--luzmo-tabs-divider-background-color, var(--tabs-divider-background-color))) 0 var(--luzmo-tabs-divider-size, var(--tabs-divider-size)),transparent var(--luzmo-tabs-divider-size, var(--tabs-divider-size)))}}#list{--tabs-font-weight: var(--luzmo-font-weight);--tabs-divider-background-color: var(--luzmo-border-color)}:host{display:grid;grid-template-columns:100%;position:relative}:host(:not([direction^=vertical])){grid-template-rows:auto 1fr}:host([direction^=vertical]){grid-template-columns:auto 1fr}:host([dir=rtl]) #selection-indicator{left:0;right:auto}:host([direction=vertical-right]) #list #selection-indicator{inset-inline:auto 0}#list{justify-content:var(--luzmo-tabs-list-justify-content)}:host([disabled]) #list{pointer-events:none}:host([disabled]) #list #selection-indicator{background-color:var(--luzmo-tabs-color-disabled, var(--tabs-color-disabled))}:host([disabled]) ::slotted(sp-tab){color:var(--luzmo-tabs-color-disabled, var(--tabs-color-disabled))}:host([direction=vertical-right]) #list #selection-indicator,:host([direction=vertical]) #list #selection-indicator{inset-block-start:0}#selection-indicator.first-position{transition:none}:host([dir][direction=horizontal]) #list.scroll{scrollbar-width:none;overflow:auto hidden}:host([dir][direction=horizontal]) #list.scroll::-webkit-scrollbar{display:none}";
|
|
182
|
+
var __defProp$1 = Object.defineProperty;
|
|
183
|
+
var __decorateClass$1 = (decorators, target, key, kind) => {
|
|
184
|
+
var result = void 0;
|
|
185
|
+
for (var i = decorators.length - 1, decorator; i >= 0; i--)
|
|
186
|
+
if (decorator = decorators[i])
|
|
187
|
+
result = decorator(target, key, result) || result;
|
|
188
|
+
if (result) __defProp$1(target, key, result);
|
|
189
|
+
return result;
|
|
208
190
|
};
|
|
209
|
-
const
|
|
191
|
+
const ScaledIndicator = {
|
|
210
192
|
baseSize: 100,
|
|
211
193
|
noSelectionStyle: "transform: translateX(0px) scaleX(0) scaleY(0)",
|
|
212
|
-
transformX(
|
|
213
|
-
const
|
|
214
|
-
return `transform: translateX(${
|
|
194
|
+
transformX(left, width) {
|
|
195
|
+
const scale = width / this.baseSize;
|
|
196
|
+
return `transform: translateX(${left}px) scaleX(${scale});`;
|
|
215
197
|
},
|
|
216
|
-
transformY(
|
|
217
|
-
const
|
|
218
|
-
return `transform: translateY(${
|
|
198
|
+
transformY(top, height) {
|
|
199
|
+
const scale = height / this.baseSize;
|
|
200
|
+
return `transform: translateY(${top}px) scaleY(${scale});`;
|
|
219
201
|
},
|
|
220
202
|
baseStyles() {
|
|
221
|
-
return
|
|
203
|
+
return css`
|
|
222
204
|
:host([direction='vertical-right']) #selection-indicator,
|
|
223
205
|
:host([direction='vertical']) #selection-indicator {
|
|
224
206
|
height: ${this.baseSize}px;
|
|
@@ -229,77 +211,118 @@ const m = {
|
|
|
229
211
|
`;
|
|
230
212
|
}
|
|
231
213
|
};
|
|
232
|
-
function
|
|
233
|
-
const
|
|
234
|
-
|
|
214
|
+
function calculateScrollTargetForRightSide(index, direction, tabs, container) {
|
|
215
|
+
const nextIndex = index + (direction === "rtl" ? -1 : 1);
|
|
216
|
+
const nextTab = tabs[nextIndex];
|
|
217
|
+
const viewportEnd = container.scrollLeft + container.offsetWidth;
|
|
218
|
+
return nextTab ? nextTab.offsetLeft - container.offsetWidth : viewportEnd;
|
|
235
219
|
}
|
|
236
|
-
function
|
|
237
|
-
const
|
|
238
|
-
|
|
220
|
+
function calculateScrollTargetForLeftSide(index, direction, tabs, container) {
|
|
221
|
+
const prevIndex = index + (direction === "rtl" ? 1 : -1);
|
|
222
|
+
const prevTab = tabs[prevIndex];
|
|
223
|
+
const leftmostElement = direction === "rtl" ? -container.offsetWidth : 0;
|
|
224
|
+
return prevTab ? prevTab.offsetLeft + prevTab.offsetWidth : leftmostElement;
|
|
239
225
|
}
|
|
240
|
-
class
|
|
226
|
+
class LuzmoTabs extends SizedMixin(Focusable, { noDefaultSize: true }) {
|
|
241
227
|
constructor() {
|
|
242
|
-
super()
|
|
228
|
+
super();
|
|
229
|
+
this.auto = false;
|
|
230
|
+
this.compact = false;
|
|
231
|
+
this.direction = "horizontal";
|
|
232
|
+
this.emphasized = false;
|
|
233
|
+
this.label = "";
|
|
234
|
+
this.enableTabsScroll = false;
|
|
235
|
+
this.quiet = false;
|
|
236
|
+
this.selectionIndicatorStyle = ScaledIndicator.noSelectionStyle;
|
|
237
|
+
this.shouldAnimate = false;
|
|
238
|
+
this.selected = "";
|
|
239
|
+
this._tabs = [];
|
|
240
|
+
this.resizeController = new ResizeController(this, {
|
|
243
241
|
callback: () => {
|
|
244
242
|
this.updateSelectionIndicator();
|
|
245
243
|
}
|
|
246
|
-
})
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
244
|
+
});
|
|
245
|
+
this.rovingTabindexController = new RovingTabindexController(this, {
|
|
246
|
+
focusInIndex: (elements) => {
|
|
247
|
+
let focusInIndex = 0;
|
|
248
|
+
const firstFocusableElement = elements.find((el, index) => {
|
|
249
|
+
const focusInElement = this.selected ? el.value === this.selected : !el.disabled;
|
|
250
|
+
focusInIndex = index;
|
|
251
|
+
return focusInElement;
|
|
252
|
+
});
|
|
253
|
+
return firstFocusableElement ? focusInIndex : -1;
|
|
253
254
|
},
|
|
254
255
|
direction: () => "both",
|
|
255
|
-
elementEnterAction: (
|
|
256
|
-
|
|
256
|
+
elementEnterAction: (el) => {
|
|
257
|
+
if (!this.auto) return;
|
|
258
|
+
this.shouldAnimate = true;
|
|
259
|
+
this.selectTarget(el);
|
|
257
260
|
},
|
|
258
261
|
elements: () => this.tabs,
|
|
259
|
-
isFocusableElement: (
|
|
262
|
+
isFocusableElement: (el) => !this.disabled && !el.disabled,
|
|
260
263
|
listenerScope: () => this.tabList
|
|
261
|
-
})
|
|
264
|
+
});
|
|
265
|
+
this.onTabsScroll = () => {
|
|
262
266
|
this.dispatchEvent(
|
|
263
267
|
new Event("luzmo-tabs-scroll", {
|
|
264
|
-
bubbles:
|
|
265
|
-
composed:
|
|
268
|
+
bubbles: true,
|
|
269
|
+
composed: true
|
|
266
270
|
})
|
|
267
271
|
);
|
|
268
|
-
}
|
|
269
|
-
|
|
272
|
+
};
|
|
273
|
+
this.onClick = (event) => {
|
|
274
|
+
if (this.disabled) {
|
|
275
|
+
return;
|
|
276
|
+
}
|
|
277
|
+
const target = event.composedPath().find((el) => el.parentElement === this);
|
|
278
|
+
if (!target || target.disabled) {
|
|
270
279
|
return;
|
|
271
|
-
const o = t.composedPath().find((i) => i.parentElement === this);
|
|
272
|
-
!o || o.disabled || (this.shouldAnimate = !0, this.selectTarget(o));
|
|
273
|
-
}, this.onKeyDown = (t) => {
|
|
274
|
-
if (t.code === "Enter" || t.code === "Space") {
|
|
275
|
-
t.preventDefault();
|
|
276
|
-
const o = t.target;
|
|
277
|
-
o && this.selectTarget(o);
|
|
278
280
|
}
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
281
|
+
this.shouldAnimate = true;
|
|
282
|
+
this.selectTarget(target);
|
|
283
|
+
};
|
|
284
|
+
this.onKeyDown = (event) => {
|
|
285
|
+
if (event.code === "Enter" || event.code === "Space") {
|
|
286
|
+
event.preventDefault();
|
|
287
|
+
const target = event.target;
|
|
288
|
+
if (target) {
|
|
289
|
+
this.selectTarget(target);
|
|
290
|
+
}
|
|
291
|
+
}
|
|
292
|
+
};
|
|
293
|
+
this.updateCheckedState = () => {
|
|
294
|
+
this.tabs.forEach((element) => {
|
|
295
|
+
element.removeAttribute("selected");
|
|
296
|
+
});
|
|
297
|
+
if (this.selected) {
|
|
298
|
+
const currentChecked = this.tabs.find((el) => el.value === this.selected);
|
|
299
|
+
if (currentChecked) {
|
|
300
|
+
currentChecked.selected = true;
|
|
301
|
+
} else {
|
|
302
|
+
this.selected = "";
|
|
303
|
+
}
|
|
285
304
|
} else {
|
|
286
|
-
const
|
|
287
|
-
|
|
305
|
+
const firstTab = this.tabs[0];
|
|
306
|
+
if (firstTab) {
|
|
307
|
+
firstTab.setAttribute("tabindex", "0");
|
|
308
|
+
}
|
|
288
309
|
}
|
|
289
310
|
this.updateSelectionIndicator();
|
|
290
|
-
}
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
311
|
+
};
|
|
312
|
+
this.updateSelectionIndicator = async () => {
|
|
313
|
+
const selectedElement = this.tabs.find((el) => el.selected);
|
|
314
|
+
if (!selectedElement) {
|
|
315
|
+
this.selectionIndicatorStyle = ScaledIndicator.noSelectionStyle;
|
|
294
316
|
return;
|
|
295
317
|
}
|
|
296
318
|
await Promise.all([
|
|
297
|
-
|
|
319
|
+
selectedElement.updateComplete,
|
|
298
320
|
document.fonts ? document.fonts.ready : Promise.resolve()
|
|
299
321
|
]);
|
|
300
|
-
const { width
|
|
301
|
-
this.selectionIndicatorStyle = this.direction === "horizontal" ?
|
|
302
|
-
}
|
|
322
|
+
const { width, height } = selectedElement.getBoundingClientRect();
|
|
323
|
+
this.selectionIndicatorStyle = this.direction === "horizontal" ? ScaledIndicator.transformX(selectedElement.offsetLeft, width) : ScaledIndicator.transformY(selectedElement.offsetTop, height);
|
|
324
|
+
};
|
|
325
|
+
new IntersectionController(this, {
|
|
303
326
|
config: {
|
|
304
327
|
root: null,
|
|
305
328
|
rootMargin: "0px",
|
|
@@ -312,17 +335,21 @@ class n extends T(U, { noDefaultSize: !0 }) {
|
|
|
312
335
|
}
|
|
313
336
|
static get styles() {
|
|
314
337
|
return [
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
338
|
+
unsafeCSS(tabSizes),
|
|
339
|
+
unsafeCSS(tabStyles),
|
|
340
|
+
ScaledIndicator.baseStyles()
|
|
318
341
|
];
|
|
319
342
|
}
|
|
320
|
-
set tabs(
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
343
|
+
set tabs(tabs) {
|
|
344
|
+
if (tabs === this.tabs) return;
|
|
345
|
+
this._tabs.forEach((tab) => {
|
|
346
|
+
this.resizeController.unobserve(tab);
|
|
347
|
+
});
|
|
348
|
+
tabs.forEach((tab) => {
|
|
349
|
+
this.resizeController.observe(tab);
|
|
350
|
+
});
|
|
351
|
+
this._tabs = tabs;
|
|
352
|
+
this.rovingTabindexController.clearElementCache();
|
|
326
353
|
}
|
|
327
354
|
get tabs() {
|
|
328
355
|
return this._tabs;
|
|
@@ -333,80 +360,117 @@ class n extends T(U, { noDefaultSize: !0 }) {
|
|
|
333
360
|
get focusElement() {
|
|
334
361
|
return this.rovingTabindexController.focusInElement || this;
|
|
335
362
|
}
|
|
336
|
-
limitDeltaToInterval(
|
|
337
|
-
return (
|
|
363
|
+
limitDeltaToInterval(min, max) {
|
|
364
|
+
return (delta) => {
|
|
365
|
+
if (delta < min) return min;
|
|
366
|
+
if (delta > max) return max;
|
|
367
|
+
return delta;
|
|
368
|
+
};
|
|
338
369
|
}
|
|
339
370
|
/**
|
|
340
371
|
* Scrolls through the tabs component, on the X-axis, by a given ammount of pixels/ delta. The given delta is limited to the scrollable area of the tabs component.
|
|
341
372
|
* @param delta - The ammount of pixels to scroll by. If the value is positive, the tabs will scroll to the right. If the value is negative, the tabs will scroll to the left.
|
|
342
373
|
* @param behavior - The scroll behavior to use. Defaults to 'smooth'.
|
|
343
374
|
*/
|
|
344
|
-
scrollTabs(
|
|
345
|
-
var
|
|
346
|
-
if (
|
|
347
|
-
const { scrollLeft
|
|
348
|
-
|
|
349
|
-
|
|
375
|
+
scrollTabs(delta, behavior = "smooth") {
|
|
376
|
+
var _a;
|
|
377
|
+
if (delta === 0) return;
|
|
378
|
+
const { scrollLeft, clientWidth, scrollWidth } = this.tabList;
|
|
379
|
+
const dirLimit = scrollWidth - clientWidth - Math.abs(scrollLeft);
|
|
380
|
+
const limitDelta = this.dir === "ltr" ? this.limitDeltaToInterval(-scrollLeft, dirLimit) : this.limitDeltaToInterval(-dirLimit, Math.abs(scrollLeft));
|
|
381
|
+
(_a = this.tabList) == null ? void 0 : _a.scrollBy({
|
|
382
|
+
left: limitDelta(delta),
|
|
350
383
|
top: 0,
|
|
351
|
-
behavior
|
|
384
|
+
behavior
|
|
352
385
|
});
|
|
353
386
|
}
|
|
354
387
|
get scrollState() {
|
|
355
388
|
if (this.tabList) {
|
|
356
|
-
const { scrollLeft
|
|
389
|
+
const { scrollLeft, clientWidth, scrollWidth } = this.tabList;
|
|
390
|
+
const canScrollLeft = Math.abs(scrollLeft) > 0;
|
|
391
|
+
const canScrollRight = Math.ceil(Math.abs(scrollLeft)) < scrollWidth - clientWidth;
|
|
357
392
|
return {
|
|
358
|
-
canScrollLeft: this.dir === "ltr" ?
|
|
359
|
-
canScrollRight: this.dir === "ltr" ?
|
|
393
|
+
canScrollLeft: this.dir === "ltr" ? canScrollLeft : canScrollRight,
|
|
394
|
+
canScrollRight: this.dir === "ltr" ? canScrollRight : canScrollLeft
|
|
360
395
|
};
|
|
361
396
|
}
|
|
362
397
|
return {};
|
|
363
398
|
}
|
|
364
399
|
async getUpdateComplete() {
|
|
365
|
-
const
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
400
|
+
const complete = await super.getUpdateComplete();
|
|
401
|
+
const tabs = [...this.children];
|
|
402
|
+
const tabUpdateCompletes = tabs.map((tab) => {
|
|
403
|
+
if (tab.updateComplete !== void 0) {
|
|
404
|
+
return tab.updateComplete;
|
|
405
|
+
}
|
|
406
|
+
return Promise.resolve(true);
|
|
407
|
+
});
|
|
408
|
+
await Promise.all(tabUpdateCompletes);
|
|
409
|
+
return complete;
|
|
410
|
+
}
|
|
411
|
+
getNecessaryAutoScroll(index) {
|
|
412
|
+
const selectedTab = this.tabs[index];
|
|
413
|
+
const selectionEnd = selectedTab.offsetLeft + selectedTab.offsetWidth;
|
|
414
|
+
const viewportEnd = this.tabList.scrollLeft + this.tabList.offsetWidth;
|
|
415
|
+
const selectionStart = selectedTab.offsetLeft;
|
|
416
|
+
const viewportStart = this.tabList.scrollLeft;
|
|
417
|
+
if (selectionEnd > viewportEnd) {
|
|
418
|
+
return calculateScrollTargetForRightSide(
|
|
419
|
+
index,
|
|
420
|
+
this.dir,
|
|
421
|
+
this.tabs,
|
|
422
|
+
this.tabList
|
|
423
|
+
);
|
|
424
|
+
} else if (selectionStart < viewportStart) {
|
|
425
|
+
return calculateScrollTargetForLeftSide(
|
|
426
|
+
index,
|
|
427
|
+
this.dir,
|
|
428
|
+
this.tabs,
|
|
429
|
+
this.tabList
|
|
430
|
+
);
|
|
431
|
+
}
|
|
432
|
+
return -1;
|
|
381
433
|
}
|
|
382
434
|
async scrollToSelection() {
|
|
383
|
-
if (!this.enableTabsScroll || !this.selected)
|
|
435
|
+
if (!this.enableTabsScroll || !this.selected) {
|
|
384
436
|
return;
|
|
437
|
+
}
|
|
385
438
|
await this.updateComplete;
|
|
386
|
-
const
|
|
387
|
-
(
|
|
439
|
+
const selectedIndex = this.tabs.findIndex(
|
|
440
|
+
(tab) => tab.value === this.selected
|
|
388
441
|
);
|
|
389
|
-
if (
|
|
390
|
-
const
|
|
391
|
-
|
|
442
|
+
if (selectedIndex !== -1 && this.tabList) {
|
|
443
|
+
const scrollTarget = this.getNecessaryAutoScroll(selectedIndex);
|
|
444
|
+
if (scrollTarget !== -1) {
|
|
445
|
+
this.tabList.scrollTo({ left: scrollTarget });
|
|
446
|
+
}
|
|
392
447
|
}
|
|
393
448
|
}
|
|
394
|
-
updated(
|
|
395
|
-
super.updated(
|
|
449
|
+
updated(changedProperties) {
|
|
450
|
+
super.updated(changedProperties);
|
|
451
|
+
if (changedProperties.has("selected")) {
|
|
452
|
+
this.scrollToSelection();
|
|
453
|
+
}
|
|
396
454
|
}
|
|
397
455
|
managePanels({
|
|
398
|
-
target
|
|
456
|
+
target
|
|
399
457
|
}) {
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
458
|
+
const panels = target.assignedElements();
|
|
459
|
+
panels.map((panel) => {
|
|
460
|
+
const { value, id } = panel;
|
|
461
|
+
const tab = this.querySelector(`[role="tab"][value="${value}"]`);
|
|
462
|
+
if (tab) {
|
|
463
|
+
tab.setAttribute("aria-controls", id);
|
|
464
|
+
panel.setAttribute("aria-labelledby", tab.id);
|
|
465
|
+
}
|
|
466
|
+
panel.selected = value === this.selected;
|
|
403
467
|
});
|
|
404
468
|
}
|
|
405
469
|
render() {
|
|
406
|
-
return
|
|
470
|
+
return html`
|
|
407
471
|
<div
|
|
408
|
-
class=${
|
|
409
|
-
aria-label=${
|
|
472
|
+
class=${classMap({ scroll: this.enableTabsScroll })}
|
|
473
|
+
aria-label=${ifDefined(this.label ?? void 0)}
|
|
410
474
|
@click=${this.onClick}
|
|
411
475
|
@keydown=${this.onKeyDown}
|
|
412
476
|
@scroll=${this.onTabsScroll}
|
|
@@ -417,7 +481,7 @@ class n extends T(U, { noDefaultSize: !0 }) {
|
|
|
417
481
|
<slot @slotchange=${this.onSlotChange}></slot>
|
|
418
482
|
<div
|
|
419
483
|
id="selection-indicator"
|
|
420
|
-
class=${
|
|
484
|
+
class=${ifDefined(this.shouldAnimate ? void 0 : "first-position")}
|
|
421
485
|
style=${this.selectionIndicatorStyle}
|
|
422
486
|
role="presentation"
|
|
423
487
|
></div>
|
|
@@ -425,99 +489,147 @@ class n extends T(U, { noDefaultSize: !0 }) {
|
|
|
425
489
|
<slot name="tab-panel" @slotchange=${this.managePanels}></slot>
|
|
426
490
|
`;
|
|
427
491
|
}
|
|
428
|
-
willUpdate(
|
|
492
|
+
willUpdate(changes) {
|
|
429
493
|
if (!this.hasUpdated) {
|
|
430
|
-
const
|
|
494
|
+
const selectedChild = this.querySelector(
|
|
431
495
|
":scope > [selected]"
|
|
432
496
|
);
|
|
433
|
-
|
|
497
|
+
if (selectedChild) {
|
|
498
|
+
this.selectTarget(selectedChild);
|
|
499
|
+
}
|
|
434
500
|
}
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
501
|
+
super.willUpdate(changes);
|
|
502
|
+
if (changes.has("selected")) {
|
|
503
|
+
if (this.tabs.length > 0) {
|
|
504
|
+
this.updateCheckedState();
|
|
505
|
+
}
|
|
506
|
+
if (changes.get("selected")) {
|
|
507
|
+
const previous = this.querySelector(
|
|
508
|
+
`[role="tabpanel"][value="${changes.get("selected")}"]`
|
|
439
509
|
);
|
|
440
|
-
|
|
510
|
+
if (previous) previous.selected = false;
|
|
441
511
|
}
|
|
442
|
-
const
|
|
512
|
+
const next = this.querySelector(
|
|
443
513
|
`[role="tabpanel"][value="${this.selected}"]`
|
|
444
514
|
);
|
|
445
|
-
|
|
515
|
+
if (next) next.selected = true;
|
|
516
|
+
}
|
|
517
|
+
if (changes.has("direction")) {
|
|
518
|
+
if (this.direction === "horizontal") {
|
|
519
|
+
this.removeAttribute("aria-orientation");
|
|
520
|
+
} else {
|
|
521
|
+
this.setAttribute("aria-orientation", "vertical");
|
|
522
|
+
}
|
|
523
|
+
}
|
|
524
|
+
if (changes.has("dir")) {
|
|
525
|
+
this.updateSelectionIndicator();
|
|
526
|
+
}
|
|
527
|
+
if (changes.has("disabled")) {
|
|
528
|
+
if (this.disabled) {
|
|
529
|
+
this.setAttribute("aria-disabled", "true");
|
|
530
|
+
} else {
|
|
531
|
+
this.removeAttribute("aria-disabled");
|
|
532
|
+
}
|
|
533
|
+
}
|
|
534
|
+
if (!this.shouldAnimate && changes.get("shouldAnimate") !== void 0) {
|
|
535
|
+
this.shouldAnimate = true;
|
|
446
536
|
}
|
|
447
|
-
t.has("direction") && (this.direction === "horizontal" ? this.removeAttribute("aria-orientation") : this.setAttribute("aria-orientation", "vertical")), t.has("dir") && this.updateSelectionIndicator(), t.has("disabled") && (this.disabled ? this.setAttribute("aria-disabled", "true") : this.removeAttribute("aria-disabled")), !this.shouldAnimate && t.get("shouldAnimate") !== void 0 && (this.shouldAnimate = !0);
|
|
448
537
|
}
|
|
449
|
-
selectTarget(
|
|
450
|
-
const
|
|
451
|
-
if (
|
|
452
|
-
const
|
|
453
|
-
this.selected =
|
|
538
|
+
selectTarget(target) {
|
|
539
|
+
const value = target.getAttribute("value");
|
|
540
|
+
if (value) {
|
|
541
|
+
const selected = this.selected;
|
|
542
|
+
this.selected = value;
|
|
543
|
+
const applyDefault = this.dispatchEvent(
|
|
454
544
|
new Event("change", {
|
|
455
|
-
cancelable:
|
|
545
|
+
cancelable: true
|
|
456
546
|
})
|
|
457
|
-
)
|
|
547
|
+
);
|
|
548
|
+
if (!applyDefault) {
|
|
549
|
+
this.selected = selected;
|
|
550
|
+
}
|
|
458
551
|
}
|
|
459
552
|
}
|
|
460
553
|
onSlotChange() {
|
|
461
|
-
this.tabs = this.slotEl.assignedElements().filter((
|
|
554
|
+
this.tabs = this.slotEl.assignedElements().filter((el) => el.getAttribute("role") === "tab");
|
|
555
|
+
this.updateCheckedState();
|
|
462
556
|
}
|
|
463
557
|
connectedCallback() {
|
|
464
|
-
super.connectedCallback()
|
|
558
|
+
super.connectedCallback();
|
|
559
|
+
window.addEventListener("resize", this.updateSelectionIndicator);
|
|
560
|
+
if ("fonts" in document) {
|
|
561
|
+
document.fonts.addEventListener("loadingdone", this.updateSelectionIndicator);
|
|
562
|
+
}
|
|
465
563
|
}
|
|
466
564
|
disconnectedCallback() {
|
|
467
|
-
window.removeEventListener("resize", this.updateSelectionIndicator)
|
|
565
|
+
window.removeEventListener("resize", this.updateSelectionIndicator);
|
|
566
|
+
if ("fonts" in document) {
|
|
567
|
+
document.fonts.removeEventListener("loadingdone", this.updateSelectionIndicator);
|
|
568
|
+
}
|
|
569
|
+
super.disconnectedCallback();
|
|
468
570
|
}
|
|
469
571
|
}
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
],
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
],
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
],
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
],
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
],
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
],
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
],
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
],
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
],
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
],
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
],
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
],
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
],
|
|
509
|
-
const
|
|
510
|
-
var
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
572
|
+
__decorateClass$1([
|
|
573
|
+
property$1({ type: Boolean })
|
|
574
|
+
], LuzmoTabs.prototype, "auto");
|
|
575
|
+
__decorateClass$1([
|
|
576
|
+
property$1({ type: Boolean, reflect: true })
|
|
577
|
+
], LuzmoTabs.prototype, "compact");
|
|
578
|
+
__decorateClass$1([
|
|
579
|
+
property$1({ reflect: true })
|
|
580
|
+
], LuzmoTabs.prototype, "dir");
|
|
581
|
+
__decorateClass$1([
|
|
582
|
+
property$1({ reflect: true })
|
|
583
|
+
], LuzmoTabs.prototype, "direction");
|
|
584
|
+
__decorateClass$1([
|
|
585
|
+
property$1({ type: Boolean, reflect: true })
|
|
586
|
+
], LuzmoTabs.prototype, "emphasized");
|
|
587
|
+
__decorateClass$1([
|
|
588
|
+
property$1()
|
|
589
|
+
], LuzmoTabs.prototype, "label");
|
|
590
|
+
__decorateClass$1([
|
|
591
|
+
property$1({ type: Boolean })
|
|
592
|
+
], LuzmoTabs.prototype, "enableTabsScroll");
|
|
593
|
+
__decorateClass$1([
|
|
594
|
+
property$1({ type: Boolean, reflect: true })
|
|
595
|
+
], LuzmoTabs.prototype, "quiet");
|
|
596
|
+
__decorateClass$1([
|
|
597
|
+
property$1({ attribute: false })
|
|
598
|
+
], LuzmoTabs.prototype, "selectionIndicatorStyle");
|
|
599
|
+
__decorateClass$1([
|
|
600
|
+
property$1({ attribute: false })
|
|
601
|
+
], LuzmoTabs.prototype, "shouldAnimate");
|
|
602
|
+
__decorateClass$1([
|
|
603
|
+
query("slot")
|
|
604
|
+
], LuzmoTabs.prototype, "slotEl");
|
|
605
|
+
__decorateClass$1([
|
|
606
|
+
query("#list")
|
|
607
|
+
], LuzmoTabs.prototype, "tabList");
|
|
608
|
+
__decorateClass$1([
|
|
609
|
+
property$1({ reflect: true })
|
|
610
|
+
], LuzmoTabs.prototype, "selected");
|
|
611
|
+
const styles = ':host{top:0;right:0;bottom:0;left:0;width:100%;--tabs-divider-size: 2px;--tab-item-height-m: calc( var(--luzmo-component-height) + var(--luzmo-spacing-5) );--tabs-overflow-button-height: calc( var(--tab-item-height-m) - var( --luzmo-tabs-divider-size, var(--tabs-divider-size) ) );--tabs-overflow-button-size: var(--tab-item-height-m);--tabs-overflow-icon-color: var(--luzmo-font-color-focus);--tabs-overflow-shadow-color: var(--luzmo-background-color);--tabs-overflow-shadow-width: 50px;--luzmo-action-button-icon-size: var(--luzmo-font-size);--tabs-overflow-next-button-right: calc(-1 * var(--luzmo-spacing-4));--tabs-overflow-previous-button-left: calc(-1 * var(--luzmo-spacing-4))}:host([size=s]){--tab-item-height-s: calc( var(--luzmo-component-height-s) + var(--luzmo-spacing-4) );--tabs-overflow-button-height: calc( var(--tab-item-height-s) - var( --luzmo-tabs-divider-size, var(--tabs-divider-size) ) );--tabs-overflow-button-size: var(--tab-item-height-s);--luzmo-action-button-icon-size: var(--luzmo-font-size-s);--tabs-overflow-next-button-right: calc(-1 * var(--luzmo-spacing-3));--tabs-overflow-previous-button-left: calc(-1 * var(--luzmo-spacing-3))}:host([size=l]){--tab-item-height-l: calc( var(--luzmo-component-height-l) + var(--luzmo-spacing-5) );--tabs-overflow-button-height: calc( var(--tab-item-height-l) - var( --luzmo-tabs-divider-size, var(--tabs-divider-size) ) );--tabs-overflow-button-size: var(--tab-item-height-l);--luzmo-action-button-icon-size: var(--luzmo-font-size-l);--tabs-overflow-next-button-right: calc( -1 * calc(var(--luzmo-spacing-4) + var(--luzmo-spacing-1)) );--tabs-overflow-previous-button-left: calc( -1 * calc(var(--luzmo-spacing-4) + var(--luzmo-spacing-1)) )}:host([size=xl]){--tab-item-height-xl: calc( var(--luzmo-component-height-xl) + var(--luzmo-spacing-5) );--tabs-overflow-button-height: calc( var(--tab-item-height-xl) - var( --luzmo-tabs-divider-size, var(--tabs-divider-size) ) );--tabs-overflow-button-size: var(--tab-item-height-xl);--luzmo-action-button-icon-size: var(--luzmo-font-size-xl);--tabs-overflow-next-button-right: calc( -1 * calc(var(--luzmo-spacing-4) + var(--luzmo-spacing-2)) );--tabs-overflow-previous-button-left: calc( -1 * calc(var(--luzmo-spacing-4) + var(--luzmo-spacing-2)) )}:host([compact]){--tabs-overflow-button-height: calc( var(--tab-item-compact-height-m) - var( --luzmo-tabs-divider-size, var(--tabs-divider-size) ) );--luzmo-action-button-icon-size: var(--luzmo-font-size-s)}luzmo-action-button{width:var(--luzmo-tabs-overflow-button-size, var(--tabs-overflow-button-size));height:var(--luzmo-tabs-overflow-button-height, var(--tabs-overflow-button-height));position:absolute;z-index:2;border:none;text-align:center;box-shadow:none;background:transparent;color:var(--luzmo-tabs-overflow-icon-color, var(--tabs-overflow-icon-color))}luzmo-action-button.left-scroll{visibility:hidden;left:var(--luzmo-tabs-overflow-previous-button-left, var(--tabs-overflow-previous-button-left))}luzmo-action-button.right-scroll{visibility:hidden;right:var(--luzmo-tabs-overflow-next-button-right, var(--tabs-overflow-next-button-right))}luzmo-action-button.left-scroll.show,luzmo-action-button.right-scroll.show{visibility:visible}.tabs-overflow-container{position:relative}.tabs-overflow-container:before,.tabs-overflow-container:after{content:"";visibility:hidden;position:absolute;z-index:1;height:var(--luzmo-tabs-overflow-button-height, var(--tabs-overflow-button-height));width:var(--luzmo-tabs-overflow-shadow-width, var(--tabs-overflow-shadow-width));pointer-events:none;inset-block-start:0}.tabs-overflow-container:before{background:transparent linear-gradient(270deg,transparent,var(--luzmo-tabs-overflow-shadow-color, var(--tabs-overflow-shadow-color))) 0 0 no-repeat padding-box;left:0}.tabs-overflow-container:after{background:transparent linear-gradient(90deg,transparent,var(--luzmo-tabs-overflow-shadow-color, var(--tabs-overflow-shadow-color))) 0 0 no-repeat padding-box;right:0}.tabs-overflow-container.left-shadow:before,.tabs-overflow-container.right-shadow:after{visibility:visible}';
|
|
612
|
+
var __defProp = Object.defineProperty;
|
|
613
|
+
var __decorateClass = (decorators, target, key, kind) => {
|
|
614
|
+
var result = void 0;
|
|
615
|
+
for (var i = decorators.length - 1, decorator; i >= 0; i--)
|
|
616
|
+
if (decorator = decorators[i])
|
|
617
|
+
result = decorator(target, key, result) || result;
|
|
618
|
+
if (result) __defProp(target, key, result);
|
|
619
|
+
return result;
|
|
514
620
|
};
|
|
515
|
-
class
|
|
621
|
+
class LuzmoTabsOverflow extends SizedMixin(LuzmoElement) {
|
|
516
622
|
constructor() {
|
|
517
|
-
super()
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
623
|
+
super();
|
|
624
|
+
this.compact = false;
|
|
625
|
+
this.labelPrevious = "Scroll to previous tabs";
|
|
626
|
+
this.labelNext = "Scroll to next tabs";
|
|
627
|
+
this.overflowState = {
|
|
628
|
+
canScrollLeft: false,
|
|
629
|
+
canScrollRight: false
|
|
630
|
+
};
|
|
631
|
+
this.scrollFactor = 0.5;
|
|
632
|
+
this.resizeController = new ResizeController(this, {
|
|
521
633
|
target: this,
|
|
522
634
|
callback: () => {
|
|
523
635
|
this._updateScrollState();
|
|
@@ -525,75 +637,88 @@ class u extends T(g) {
|
|
|
525
637
|
});
|
|
526
638
|
}
|
|
527
639
|
static get styles() {
|
|
528
|
-
return [
|
|
640
|
+
return [unsafeCSS(styles), unsafeCSS(tabSizes)];
|
|
529
641
|
}
|
|
530
642
|
get scrollContent() {
|
|
531
643
|
return this.tabs;
|
|
532
644
|
}
|
|
533
|
-
firstUpdated(
|
|
534
|
-
super.firstUpdated(
|
|
535
|
-
const [
|
|
536
|
-
|
|
645
|
+
firstUpdated(changes) {
|
|
646
|
+
super.firstUpdated(changes);
|
|
647
|
+
const [tabs] = this.scrollContent;
|
|
648
|
+
if (tabs) {
|
|
649
|
+
tabs.enableTabsScroll = true;
|
|
650
|
+
}
|
|
651
|
+
this.resizeController.observe(this.overflowContainer);
|
|
537
652
|
}
|
|
538
653
|
async _handleSlotChange() {
|
|
539
|
-
const [
|
|
540
|
-
await (
|
|
654
|
+
const [tabsElement] = this.scrollContent;
|
|
655
|
+
await (tabsElement == null ? void 0 : tabsElement.updateComplete);
|
|
656
|
+
this._updateScrollState();
|
|
541
657
|
}
|
|
542
658
|
_updateScrollState() {
|
|
543
|
-
const { scrollContent
|
|
544
|
-
if (
|
|
545
|
-
const [
|
|
546
|
-
|
|
547
|
-
|
|
659
|
+
const { scrollContent, overflowState } = this;
|
|
660
|
+
if (scrollContent) {
|
|
661
|
+
const [tabsElement] = this.scrollContent;
|
|
662
|
+
const { canScrollLeft, canScrollRight } = (tabsElement == null ? void 0 : tabsElement.scrollState) || {
|
|
663
|
+
canScrollLeft: false,
|
|
664
|
+
canScrollRight: false
|
|
548
665
|
};
|
|
549
666
|
this.overflowState = {
|
|
550
|
-
...
|
|
551
|
-
canScrollLeft
|
|
552
|
-
canScrollRight
|
|
667
|
+
...overflowState,
|
|
668
|
+
canScrollLeft,
|
|
669
|
+
canScrollRight
|
|
553
670
|
};
|
|
554
671
|
}
|
|
555
672
|
}
|
|
556
|
-
_handleScrollClick(
|
|
557
|
-
const
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
673
|
+
_handleScrollClick(event) {
|
|
674
|
+
const currentTarget = event.currentTarget;
|
|
675
|
+
const [tabsElement] = this.scrollContent;
|
|
676
|
+
const dist = tabsElement.clientWidth * this.scrollFactor;
|
|
677
|
+
const left = currentTarget.classList.contains("left-scroll") ? -dist : dist;
|
|
678
|
+
tabsElement.scrollTabs(left, "smooth");
|
|
679
|
+
}
|
|
680
|
+
updated(changedProperties) {
|
|
681
|
+
super.updated(changedProperties);
|
|
682
|
+
if (changedProperties.has("dir")) {
|
|
683
|
+
this._updateScrollState();
|
|
684
|
+
}
|
|
562
685
|
}
|
|
563
686
|
render() {
|
|
564
|
-
const { canScrollRight
|
|
565
|
-
|
|
687
|
+
const { canScrollRight, canScrollLeft } = this.overflowState;
|
|
688
|
+
const ariaLabelPrevious = this.labelPrevious;
|
|
689
|
+
const ariaLabelNext = this.labelNext;
|
|
690
|
+
return html`
|
|
566
691
|
<div
|
|
567
|
-
class=${
|
|
568
|
-
"tabs-overflow-container":
|
|
569
|
-
"left-shadow":
|
|
570
|
-
"right-shadow":
|
|
692
|
+
class=${classMap({
|
|
693
|
+
"tabs-overflow-container": true,
|
|
694
|
+
"left-shadow": canScrollLeft,
|
|
695
|
+
"right-shadow": canScrollRight
|
|
571
696
|
})}
|
|
572
697
|
>
|
|
573
698
|
<luzmo-action-button
|
|
574
|
-
class=${
|
|
575
|
-
"left-scroll":
|
|
576
|
-
show:
|
|
699
|
+
class=${classMap({
|
|
700
|
+
"left-scroll": true,
|
|
701
|
+
show: canScrollLeft
|
|
577
702
|
})}
|
|
578
|
-
aria-label=${
|
|
703
|
+
aria-label=${ariaLabelPrevious}
|
|
579
704
|
quiet
|
|
580
705
|
dir="rtl"
|
|
581
706
|
tabindex="-1"
|
|
582
707
|
@click=${this._handleScrollClick}
|
|
583
708
|
>
|
|
584
|
-
<luzmo-icon slot="icon" .icon=${
|
|
709
|
+
<luzmo-icon slot="icon" .icon=${luzmoAngleLeft}></luzmo-icon>
|
|
585
710
|
</luzmo-action-button>
|
|
586
711
|
<luzmo-action-button
|
|
587
|
-
class=${
|
|
588
|
-
"right-scroll":
|
|
589
|
-
show:
|
|
712
|
+
class=${classMap({
|
|
713
|
+
"right-scroll": true,
|
|
714
|
+
show: canScrollRight
|
|
590
715
|
})}
|
|
591
|
-
aria-label=${
|
|
716
|
+
aria-label=${ariaLabelNext}
|
|
592
717
|
quiet
|
|
593
718
|
tabindex="-1"
|
|
594
719
|
@click=${this._handleScrollClick}
|
|
595
720
|
>
|
|
596
|
-
<luzmo-icon slot="icon" .icon=${
|
|
721
|
+
<luzmo-icon slot="icon" .icon=${luzmoAngleRight}></luzmo-icon>
|
|
597
722
|
</luzmo-action-button>
|
|
598
723
|
<slot
|
|
599
724
|
@slotchange=${this._handleSlotChange}
|
|
@@ -603,34 +728,42 @@ class u extends T(g) {
|
|
|
603
728
|
`;
|
|
604
729
|
}
|
|
605
730
|
}
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
],
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
],
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
],
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
],
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
],
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
],
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
],
|
|
627
|
-
customElements.get("luzmo-tab")
|
|
628
|
-
customElements.
|
|
629
|
-
|
|
630
|
-
customElements.get("luzmo-tabs
|
|
731
|
+
__decorateClass([
|
|
732
|
+
property$1({ type: Boolean, reflect: true })
|
|
733
|
+
], LuzmoTabsOverflow.prototype, "compact");
|
|
734
|
+
__decorateClass([
|
|
735
|
+
property$1({ type: String, attribute: "label-previous" })
|
|
736
|
+
], LuzmoTabsOverflow.prototype, "labelPrevious");
|
|
737
|
+
__decorateClass([
|
|
738
|
+
property$1({ type: String, attribute: "label-next" })
|
|
739
|
+
], LuzmoTabsOverflow.prototype, "labelNext");
|
|
740
|
+
__decorateClass([
|
|
741
|
+
property$1({ reflect: true })
|
|
742
|
+
], LuzmoTabsOverflow.prototype, "dir");
|
|
743
|
+
__decorateClass([
|
|
744
|
+
state()
|
|
745
|
+
], LuzmoTabsOverflow.prototype, "overflowState");
|
|
746
|
+
__decorateClass([
|
|
747
|
+
queryAssignedElements({ selector: "luzmo-tabs", flatten: true })
|
|
748
|
+
], LuzmoTabsOverflow.prototype, "tabs");
|
|
749
|
+
__decorateClass([
|
|
750
|
+
query(".tabs-overflow-container")
|
|
751
|
+
], LuzmoTabsOverflow.prototype, "overflowContainer");
|
|
752
|
+
if (!customElements.get("luzmo-tab")) {
|
|
753
|
+
customElements.define("luzmo-tab", LuzmoTab);
|
|
754
|
+
}
|
|
755
|
+
if (!customElements.get("luzmo-tabs")) {
|
|
756
|
+
customElements.define("luzmo-tabs", LuzmoTabs);
|
|
757
|
+
}
|
|
758
|
+
if (!customElements.get("luzmo-tab-panel")) {
|
|
759
|
+
customElements.define("luzmo-tab-panel", LuzmoTabPanel);
|
|
760
|
+
}
|
|
761
|
+
if (!customElements.get("luzmo-tabs-overflow")) {
|
|
762
|
+
customElements.define("luzmo-tabs-overflow", LuzmoTabsOverflow);
|
|
763
|
+
}
|
|
631
764
|
export {
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
|
|
765
|
+
LuzmoTab,
|
|
766
|
+
LuzmoTabPanel,
|
|
767
|
+
LuzmoTabs,
|
|
768
|
+
LuzmoTabsOverflow
|
|
636
769
|
};
|