tuix-webcomponents 0.62.0 → 0.64.0
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/README.md +2 -2
- package/dist/addon-visual-tests-assets/visual-test-illustration.mp4 +0 -0
- package/dist/assets/Color-AVL7NMMY-IH_JbDEF.js +1 -0
- package/dist/assets/DocsRenderer-PQXLIZUC-C0ZKNA9m.js +1286 -0
- package/dist/{src/tuix-icon/TuixIcon.icons.js → assets/TuixIconButton-eQtxZNXh.js} +203 -126
- package/dist/assets/TuixModal-BZFIHTi_.js +78 -0
- package/dist/assets/TuixToast-BhxwZIGo.js +62 -0
- package/dist/assets/_commonjsHelpers-CqkleIqs.js +1 -0
- package/dist/assets/axe-C59a3kt3.js +30 -0
- package/dist/assets/iframe-ClsPaEIM.js +1057 -0
- package/dist/assets/index-DBzYXxxs.js +1554 -0
- package/dist/assets/index-TjhCmV-u.js +1 -0
- package/dist/assets/matchers-7Z3WT2CE-CcSi9QFY.js +14 -0
- package/dist/assets/screenSizes.enum-C1IhC_dy.js +13 -0
- package/dist/assets/state-CLjydI9z.js +13 -0
- package/dist/assets/tuix-button.stories-Dm_yifox.js +30 -0
- package/dist/assets/tuix-checkbox.stories-DmzoygjC.js +44 -0
- package/dist/assets/tuix-dropdown-object-list.stories-Neeajtj-.js +56 -0
- package/dist/assets/tuix-dropdown.stories-B7ea8QAz.js +28 -0
- package/dist/assets/tuix-icon-button.stories-CgbOSRO4.js +21 -0
- package/dist/assets/tuix-icon.enums-DYTtwLZl.js +1 -0
- package/dist/assets/tuix-icon.stories-CjN2XsKx.js +19 -0
- package/dist/assets/tuix-input.stories-CD7onvw2.js +33 -0
- package/dist/assets/tuix-link.stories-CT7pzGlx.js +35 -0
- package/dist/assets/tuix-modal.stories-B6v3cOPq.js +39 -0
- package/dist/assets/tuix-paper.enum-DhmlUJB7.js +1 -0
- package/dist/assets/tuix-paper.stories-CLnRPHNK.js +31 -0
- package/dist/assets/tuix-radio-button.stories-BwkKC3a9.js +35 -0
- package/dist/assets/tuix-table.stories-Bn-aZa0J.js +65 -0
- package/dist/assets/tuix-text.enums-Ck8cVqZZ.js +1 -0
- package/dist/assets/tuix-text.stories-BNIqPsGD.js +29 -0
- package/dist/assets/tuix-toast.stories-CRYiLiHK.js +21 -0
- package/dist/assets/tuix-toggle-button.stories-CY6wlDnA.js +40 -0
- package/dist/favicon-wrapper.svg +46 -0
- package/dist/favicon.svg +1 -0
- package/dist/iframe.html +685 -0
- package/dist/index.html +160 -0
- package/dist/index.json +1 -0
- package/dist/nunito-sans-bold-italic.woff2 +0 -0
- package/dist/nunito-sans-bold.woff2 +0 -0
- package/dist/nunito-sans-italic.woff2 +0 -0
- package/dist/nunito-sans-regular.woff2 +0 -0
- package/dist/project.json +1 -0
- package/dist/sb-addons/a11y-3/manager-bundle.js +5 -0
- package/dist/sb-addons/a11y-3/manager-bundle.js.LEGAL.txt +0 -0
- package/dist/sb-addons/chromatic-com-storybook-1/manager-bundle.js +356 -0
- package/dist/sb-addons/chromatic-com-storybook-1/manager-bundle.js.LEGAL.txt +40 -0
- package/dist/sb-addons/docs-2/manager-bundle.js +151 -0
- package/dist/sb-addons/docs-2/manager-bundle.js.LEGAL.txt +0 -0
- package/dist/sb-addons/storybook-core-server-presets-0/common-manager-bundle.js +971 -0
- package/dist/sb-addons/storybook-core-server-presets-0/common-manager-bundle.js.LEGAL.txt +0 -0
- package/dist/sb-addons/vitest-4/manager-bundle.js +3 -0
- package/dist/sb-addons/vitest-4/manager-bundle.js.LEGAL.txt +0 -0
- package/dist/sb-common-assets/favicon-wrapper.svg +46 -0
- package/dist/sb-common-assets/favicon.svg +1 -0
- package/dist/sb-common-assets/nunito-sans-bold-italic.woff2 +0 -0
- package/dist/sb-common-assets/nunito-sans-bold.woff2 +0 -0
- package/dist/sb-common-assets/nunito-sans-italic.woff2 +0 -0
- package/dist/sb-common-assets/nunito-sans-regular.woff2 +0 -0
- package/dist/sb-manager/globals-module-info.js +797 -0
- package/dist/sb-manager/globals-runtime.js +69679 -0
- package/dist/sb-manager/globals.js +34 -0
- package/dist/sb-manager/runtime.js +13195 -0
- package/package.json +77 -53
- package/dist/assets/tuix-styles.css +0 -58
- package/dist/src/index.d.ts +0 -36
- package/dist/src/index.js +0 -43
- package/dist/src/index.js.map +0 -1
- package/dist/src/tuix-button/TuixBaseButton.d.ts +0 -17
- package/dist/src/tuix-button/TuixBaseButton.js +0 -62
- package/dist/src/tuix-button/TuixBaseButton.js.map +0 -1
- package/dist/src/tuix-button/TuixButton.d.ts +0 -11
- package/dist/src/tuix-button/TuixButton.js +0 -85
- package/dist/src/tuix-button/TuixButton.js.map +0 -1
- package/dist/src/tuix-button/TuixButton.styles.d.ts +0 -3
- package/dist/src/tuix-button/TuixButton.styles.js +0 -108
- package/dist/src/tuix-button/TuixButton.styles.js.map +0 -1
- package/dist/src/tuix-button/enums/tuix-button.enums.d.ts +0 -2
- package/dist/src/tuix-button/enums/tuix-button.enums.js +0 -7
- package/dist/src/tuix-button/enums/tuix-button.enums.js.map +0 -1
- package/dist/src/tuix-button/interfaces/tuix-button.interface.d.ts +0 -1
- package/dist/src/tuix-button/interfaces/tuix-button.interface.js +0 -2
- package/dist/src/tuix-button/interfaces/tuix-button.interface.js.map +0 -1
- package/dist/src/tuix-checkbox/TuixCheckbox.d.ts +0 -15
- package/dist/src/tuix-checkbox/TuixCheckbox.js +0 -107
- package/dist/src/tuix-checkbox/TuixCheckbox.js.map +0 -1
- package/dist/src/tuix-checkbox/TuixCheckbox.styles.d.ts +0 -4
- package/dist/src/tuix-checkbox/TuixCheckbox.styles.js +0 -133
- package/dist/src/tuix-checkbox/TuixCheckbox.styles.js.map +0 -1
- package/dist/src/tuix-checkbox/enums/tuix-checkbox.enums.d.ts +0 -21
- package/dist/src/tuix-checkbox/enums/tuix-checkbox.enums.js +0 -24
- package/dist/src/tuix-checkbox/enums/tuix-checkbox.enums.js.map +0 -1
- package/dist/src/tuix-checkbox/interfaces/tuix-checkbox.interface.d.ts +0 -5
- package/dist/src/tuix-checkbox/interfaces/tuix-checkbox.interface.js +0 -2
- package/dist/src/tuix-checkbox/interfaces/tuix-checkbox.interface.js.map +0 -1
- package/dist/src/tuix-dropdown/TuixDropdown.d.ts +0 -55
- package/dist/src/tuix-dropdown/TuixDropdown.js +0 -368
- package/dist/src/tuix-dropdown/TuixDropdown.js.map +0 -1
- package/dist/src/tuix-dropdown/TuixDropdown.styles.d.ts +0 -3
- package/dist/src/tuix-dropdown/TuixDropdown.styles.js +0 -126
- package/dist/src/tuix-dropdown/TuixDropdown.styles.js.map +0 -1
- package/dist/src/tuix-dropdown/enums/tuix-dropdown.enums.d.ts +0 -4
- package/dist/src/tuix-dropdown/enums/tuix-dropdown.enums.js +0 -6
- package/dist/src/tuix-dropdown/enums/tuix-dropdown.enums.js.map +0 -1
- package/dist/src/tuix-dropdown/interfaces/tuix-dropdown.interface.d.ts +0 -15
- package/dist/src/tuix-dropdown/interfaces/tuix-dropdown.interface.js +0 -2
- package/dist/src/tuix-dropdown/interfaces/tuix-dropdown.interface.js.map +0 -1
- package/dist/src/tuix-icon/TuixIcon.d.ts +0 -15
- package/dist/src/tuix-icon/TuixIcon.icons.d.ts +0 -6
- package/dist/src/tuix-icon/TuixIcon.icons.js.map +0 -1
- package/dist/src/tuix-icon/TuixIcon.js +0 -81
- package/dist/src/tuix-icon/TuixIcon.js.map +0 -1
- package/dist/src/tuix-icon/enums/tuix-icon.enums.d.ts +0 -62
- package/dist/src/tuix-icon/enums/tuix-icon.enums.js +0 -70
- package/dist/src/tuix-icon/enums/tuix-icon.enums.js.map +0 -1
- package/dist/src/tuix-icon-button/TuixIconButton.d.ts +0 -9
- package/dist/src/tuix-icon-button/TuixIconButton.js +0 -52
- package/dist/src/tuix-icon-button/TuixIconButton.js.map +0 -1
- package/dist/src/tuix-input/TuixInput.d.ts +0 -52
- package/dist/src/tuix-input/TuixInput.js +0 -374
- package/dist/src/tuix-input/TuixInput.js.map +0 -1
- package/dist/src/tuix-input/TuixInput.styles.d.ts +0 -8
- package/dist/src/tuix-input/TuixInput.styles.js +0 -296
- package/dist/src/tuix-input/TuixInput.styles.js.map +0 -1
- package/dist/src/tuix-input/enums/tuix-input.enums.d.ts +0 -38
- package/dist/src/tuix-input/enums/tuix-input.enums.js +0 -42
- package/dist/src/tuix-input/enums/tuix-input.enums.js.map +0 -1
- package/dist/src/tuix-input/interfaces/tuix-input.interface.d.ts +0 -17
- package/dist/src/tuix-input/interfaces/tuix-input.interface.js +0 -7
- package/dist/src/tuix-input/interfaces/tuix-input.interface.js.map +0 -1
- package/dist/src/tuix-link/TuixLink.d.ts +0 -15
- package/dist/src/tuix-link/TuixLink.js +0 -72
- package/dist/src/tuix-link/TuixLink.js.map +0 -1
- package/dist/src/tuix-link/TuixLink.styles.d.ts +0 -2
- package/dist/src/tuix-link/TuixLink.styles.js +0 -56
- package/dist/src/tuix-link/TuixLink.styles.js.map +0 -1
- package/dist/src/tuix-link/enums/linkTarget.enum.d.ts +0 -6
- package/dist/src/tuix-link/enums/linkTarget.enum.js +0 -8
- package/dist/src/tuix-link/enums/linkTarget.enum.js.map +0 -1
- package/dist/src/tuix-modal/TuixModal.d.ts +0 -9
- package/dist/src/tuix-modal/TuixModal.js +0 -64
- package/dist/src/tuix-modal/TuixModal.js.map +0 -1
- package/dist/src/tuix-modal/TuixModal.styles.d.ts +0 -2
- package/dist/src/tuix-modal/TuixModal.styles.js +0 -56
- package/dist/src/tuix-modal/TuixModal.styles.js.map +0 -1
- package/dist/src/tuix-paper/TuixPaper.d.ts +0 -10
- package/dist/src/tuix-paper/TuixPaper.js +0 -47
- package/dist/src/tuix-paper/TuixPaper.js.map +0 -1
- package/dist/src/tuix-paper/TuixPaper.styles.d.ts +0 -1
- package/dist/src/tuix-paper/TuixPaper.styles.js +0 -31
- package/dist/src/tuix-paper/TuixPaper.styles.js.map +0 -1
- package/dist/src/tuix-paper/enums/tuix-paper.enum.d.ts +0 -13
- package/dist/src/tuix-paper/enums/tuix-paper.enum.js +0 -16
- package/dist/src/tuix-paper/enums/tuix-paper.enum.js.map +0 -1
- package/dist/src/tuix-radio-button/TuixRadioButton.d.ts +0 -16
- package/dist/src/tuix-radio-button/TuixRadioButton.js +0 -96
- package/dist/src/tuix-radio-button/TuixRadioButton.js.map +0 -1
- package/dist/src/tuix-radio-button/TuixRadioButton.styles.d.ts +0 -5
- package/dist/src/tuix-radio-button/TuixRadioButton.styles.js +0 -136
- package/dist/src/tuix-radio-button/TuixRadioButton.styles.js.map +0 -1
- package/dist/src/tuix-radio-button/interfaces/tuix-radio-button.interface.d.ts +0 -3
- package/dist/src/tuix-radio-button/interfaces/tuix-radio-button.interface.js +0 -2
- package/dist/src/tuix-radio-button/interfaces/tuix-radio-button.interface.js.map +0 -1
- package/dist/src/tuix-table/TuixTable.d.ts +0 -46
- package/dist/src/tuix-table/TuixTable.js +0 -373
- package/dist/src/tuix-table/TuixTable.js.map +0 -1
- package/dist/src/tuix-table/TuixTable.styles.d.ts +0 -2
- package/dist/src/tuix-table/TuixTable.styles.js +0 -198
- package/dist/src/tuix-table/TuixTable.styles.js.map +0 -1
- package/dist/src/tuix-table/interfaces/tuix-table.interface.d.ts +0 -45
- package/dist/src/tuix-table/interfaces/tuix-table.interface.js +0 -2
- package/dist/src/tuix-table/interfaces/tuix-table.interface.js.map +0 -1
- package/dist/src/tuix-text/TuixText.d.ts +0 -12
- package/dist/src/tuix-text/TuixText.js +0 -67
- package/dist/src/tuix-text/TuixText.js.map +0 -1
- package/dist/src/tuix-text/TuixText.styles.d.ts +0 -2
- package/dist/src/tuix-text/TuixText.styles.js +0 -159
- package/dist/src/tuix-text/TuixText.styles.js.map +0 -1
- package/dist/src/tuix-text/enums/tuix-text.enums.d.ts +0 -31
- package/dist/src/tuix-text/enums/tuix-text.enums.js +0 -64
- package/dist/src/tuix-text/enums/tuix-text.enums.js.map +0 -1
- package/dist/src/tuix-toast/TuixToast.d.ts +0 -15
- package/dist/src/tuix-toast/TuixToast.js +0 -101
- package/dist/src/tuix-toast/TuixToast.js.map +0 -1
- package/dist/src/tuix-toast/TuixToast.styles.d.ts +0 -3
- package/dist/src/tuix-toast/TuixToast.styles.js +0 -44
- package/dist/src/tuix-toast/TuixToast.styles.js.map +0 -1
- package/dist/src/tuix-toast/enums/tuix-toast.enums.d.ts +0 -20
- package/dist/src/tuix-toast/enums/tuix-toast.enums.js +0 -60
- package/dist/src/tuix-toast/enums/tuix-toast.enums.js.map +0 -1
- package/dist/src/tuix-toggle-button/TuixToggleButton.d.ts +0 -13
- package/dist/src/tuix-toggle-button/TuixToggleButton.js +0 -86
- package/dist/src/tuix-toggle-button/TuixToggleButton.js.map +0 -1
- package/dist/src/tuix-toggle-button/TuixToggleButton.styles.d.ts +0 -5
- package/dist/src/tuix-toggle-button/TuixToggleButton.styles.js +0 -135
- package/dist/src/tuix-toggle-button/TuixToggleButton.styles.js.map +0 -1
- package/dist/src/tuix-toggle-button/interfaces/tuix-toggle.interface.d.ts +0 -2
- package/dist/src/tuix-toggle-button/interfaces/tuix-toggle.interface.js +0 -2
- package/dist/src/tuix-toggle-button/interfaces/tuix-toggle.interface.js.map +0 -1
- package/dist/src/utils/colors.d.ts +0 -29
- package/dist/src/utils/colors.js +0 -31
- package/dist/src/utils/colors.js.map +0 -1
- package/dist/src/utils/darkColors.d.ts +0 -31
- package/dist/src/utils/darkColors.js +0 -33
- package/dist/src/utils/darkColors.js.map +0 -1
- package/dist/src/utils/hex-rgb.d.ts +0 -5
- package/dist/src/utils/hex-rgb.js +0 -16
- package/dist/src/utils/hex-rgb.js.map +0 -1
- package/dist/src/utils/interfaces/detail-value.interface.d.ts +0 -3
- package/dist/src/utils/interfaces/detail-value.interface.js +0 -2
- package/dist/src/utils/interfaces/detail-value.interface.js.map +0 -1
- package/dist/src/utils/mainVariant.enum.d.ts +0 -4
- package/dist/src/utils/mainVariant.enum.js +0 -6
- package/dist/src/utils/mainVariant.enum.js.map +0 -1
- package/dist/src/utils/screenSizes.enum.d.ts +0 -4
- package/dist/src/utils/screenSizes.enum.js +0 -6
- package/dist/src/utils/screenSizes.enum.js.map +0 -1
- package/dist/src/utils/slottedClassName.d.ts +0 -2
- package/dist/src/utils/slottedClassName.js +0 -2
- package/dist/src/utils/slottedClassName.js.map +0 -1
- package/dist/tsconfig.publish.tsbuildinfo +0 -1
|
@@ -0,0 +1,1554 @@
|
|
|
1
|
+
import{r as l,i as u,T as It,s as H,x as d,A as z,m as zt,f as K,c as nt,p as ft,a as Mt}from"./iframe-ClsPaEIM.js";import{e as St,i as Et,t as Ot,o as dt,a as Y}from"./state-CLjydI9z.js";import{S as g,n as a,e as M}from"./screenSizes.enum-C1IhC_dy.js";import{T as p,M as Q,a as N,c as Dt,b as Bt}from"./tuix-text.enums-Ck8cVqZZ.js";import{s as b,b as Rt,h as Nt,a as Vt,T as jt}from"./TuixIconButton-eQtxZNXh.js";import{P as c,D as h,a as st,I as k}from"./tuix-icon.enums-DYTtwLZl.js";import{P as Z,B as Ht}from"./tuix-paper.enum-DhmlUJB7.js";import"./TuixToast-BhxwZIGo.js";import"./TuixModal-BZFIHTi_.js";/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright 2017 Google LLC
|
|
4
|
+
* SPDX-License-Identifier: BSD-3-Clause
|
|
5
|
+
*/const Yt=({finisher:t,descriptor:e})=>(o,n)=>{var i;if(n===void 0){const r=(i=o.originalKey)!==null&&i!==void 0?i:o.key,s=e!=null?{kind:"method",placement:"prototype",key:r,descriptor:e(o.key)}:{...o,key:r};return t!=null&&(s.finisher=function(O){t(O,r)}),s}{const r=o.constructor;e!==void 0&&Object.defineProperty(o,n,e(n)),t?.(r,n)}};/**
|
|
6
|
+
* @license
|
|
7
|
+
* Copyright 2017 Google LLC
|
|
8
|
+
* SPDX-License-Identifier: BSD-3-Clause
|
|
9
|
+
*/function _t(t,e){return Yt({descriptor:o=>({get(){var i,r;return(r=(i=this.renderRoot)===null||i===void 0?void 0:i.querySelector(t))!==null&&r!==void 0?r:null},enumerable:!0,configurable:!0})})}const At=u`
|
|
10
|
+
${l(`
|
|
11
|
+
${b(p.Link)} {
|
|
12
|
+
font-family: 'Rubik', sans-serif;
|
|
13
|
+
font-size: 1rem;
|
|
14
|
+
font-weight: 400;
|
|
15
|
+
line-height: 1.25rem;
|
|
16
|
+
}
|
|
17
|
+
@media only screen and (max-width: ${g.TABLET}px) {
|
|
18
|
+
${b(p.Link)} {
|
|
19
|
+
font-size: 0.938rem;
|
|
20
|
+
line-height: 1.125rem;
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
@media only screen and (max-width: ${g.MOBILE}px) {
|
|
24
|
+
${b(p.Link)} {
|
|
25
|
+
font-size: 0.875rem;
|
|
26
|
+
line-height: 1rem;
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
`)}
|
|
30
|
+
`,Ft=u`
|
|
31
|
+
${l(`
|
|
32
|
+
${b(p.XL)} {
|
|
33
|
+
font-size: 3.375rem;
|
|
34
|
+
font-weight: 600;
|
|
35
|
+
line-height: 3.688rem;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
${b(p.L)} {
|
|
39
|
+
font-size: 2.813rem;
|
|
40
|
+
font-weight: 600;
|
|
41
|
+
line-height: 3.375rem;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
${b(p.M)} {
|
|
45
|
+
font-size: 2.313rem;
|
|
46
|
+
font-weight: 600;
|
|
47
|
+
line-height: 2.75rem;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
${b(p.S)} {
|
|
51
|
+
font-size: 1.938rem;
|
|
52
|
+
font-weight: 600;
|
|
53
|
+
line-height: 2.313rem;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
${b(p.XS)} {
|
|
57
|
+
font-size: 1.313rem;
|
|
58
|
+
font-weight: 600;
|
|
59
|
+
line-height: 1.563rem;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
${b(p.Body1)} {
|
|
63
|
+
font-size: 1.125rem;
|
|
64
|
+
font-weight: 300;
|
|
65
|
+
line-height: 1.688rem;
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
${b(p.Body2)} {
|
|
69
|
+
font-size: 0.938rem;
|
|
70
|
+
font-weight: 300;
|
|
71
|
+
line-height: 1.313rem;
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
${b(p.Field1)} {
|
|
75
|
+
font-size: 1rem;
|
|
76
|
+
font-weight: 300;
|
|
77
|
+
line-height: 1.25rem;
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
${b(p.Field2)} {
|
|
81
|
+
font-size: 0.75rem;
|
|
82
|
+
font-weight: 300;
|
|
83
|
+
line-height: 0.875rem;
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
@media only screen and (max-width: ${g.TABLET}px) {
|
|
87
|
+
${b(p.XL)} {
|
|
88
|
+
font-size: 3rem;
|
|
89
|
+
line-height: 3.313rem;
|
|
90
|
+
}
|
|
91
|
+
${b(p.L)} {
|
|
92
|
+
font-size: 2.5rem;
|
|
93
|
+
line-height: 3rem;
|
|
94
|
+
}
|
|
95
|
+
${b(p.M)} {
|
|
96
|
+
font-size: 2.063rem;
|
|
97
|
+
line-height: 2.5rem;
|
|
98
|
+
}
|
|
99
|
+
${b(p.S)} {
|
|
100
|
+
font-size: 1.75rem;
|
|
101
|
+
line-height: 2.125rem;
|
|
102
|
+
}
|
|
103
|
+
${b(p.XS)} {
|
|
104
|
+
font-size: 1.188rem;
|
|
105
|
+
line-height: 1.438rem;
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
${b(p.Body1)} {
|
|
109
|
+
font-size: 1rem;
|
|
110
|
+
line-height: 1.5rem;
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
${b(p.Body2)} {
|
|
114
|
+
font-size: 0.875rem;
|
|
115
|
+
line-height: 1.125rem;
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
${b(p.Field1)} {
|
|
119
|
+
font-size: 0.938rem;
|
|
120
|
+
line-height: 1.125rem;
|
|
121
|
+
}
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
@media only screen and (max-width: ${g.MOBILE}px) {
|
|
125
|
+
${b(p.Body1)} {
|
|
126
|
+
font-size: 0.875rem;
|
|
127
|
+
font-weight: 300;
|
|
128
|
+
line-height: 1.313rem;
|
|
129
|
+
}
|
|
130
|
+
${b(p.Body2)} {
|
|
131
|
+
font-size: 0.75rem;
|
|
132
|
+
line-height: 1rem;
|
|
133
|
+
}
|
|
134
|
+
${b(p.Field1)} {
|
|
135
|
+
font-size: 0.875rem;
|
|
136
|
+
font-weight: 300;
|
|
137
|
+
line-height: 1rem;
|
|
138
|
+
}
|
|
139
|
+
${b(p.XL)} {
|
|
140
|
+
font-size: 2.625rem;
|
|
141
|
+
line-height: 2.875rem;
|
|
142
|
+
}
|
|
143
|
+
${b(p.L)} {
|
|
144
|
+
font-size: 2.188rem;
|
|
145
|
+
line-height: 2.438rem;
|
|
146
|
+
}
|
|
147
|
+
${b(p.M)} {
|
|
148
|
+
font-size: 1.813rem;
|
|
149
|
+
line-height: 2rem;
|
|
150
|
+
}
|
|
151
|
+
${b(p.S)} {
|
|
152
|
+
font-size: 1.5rem;
|
|
153
|
+
line-height: 1.625rem;
|
|
154
|
+
}
|
|
155
|
+
${b(p.XS)} {
|
|
156
|
+
font-size: 1.063rem;
|
|
157
|
+
line-height: 1.188rem;
|
|
158
|
+
}
|
|
159
|
+
}
|
|
160
|
+
`)}
|
|
161
|
+
`;/**
|
|
162
|
+
* @license
|
|
163
|
+
* Copyright 2018 Google LLC
|
|
164
|
+
* SPDX-License-Identifier: BSD-3-Clause
|
|
165
|
+
*/const E=St(class extends Et{constructor(t){var e;if(super(t),t.type!==Ot.ATTRIBUTE||t.name!=="class"||((e=t.strings)===null||e===void 0?void 0:e.length)>2)throw Error("`classMap()` can only be used in the `class` attribute and must be the only part in the attribute.")}render(t){return" "+Object.keys(t).filter((e=>t[e])).join(" ")+" "}update(t,[e]){var o,n;if(this.it===void 0){this.it=new Set,t.strings!==void 0&&(this.nt=new Set(t.strings.join(" ").split(/\s/).filter((r=>r!==""))));for(const r in e)e[r]&&!(!((o=this.nt)===null||o===void 0)&&o.has(r))&&this.it.add(r);return this.render(e)}const i=t.element.classList;this.it.forEach((r=>{r in e||(i.remove(r),this.it.delete(r))}));for(const r in e){const s=!!e[r];s===this.it.has(r)||!((n=this.nt)===null||n===void 0)&&n.has(r)||(s?(i.add(r),this.it.add(r)):(i.remove(r),this.it.delete(r)))}return It}}),B="--t-link-text-color",Ut=u`
|
|
166
|
+
${l(`
|
|
167
|
+
:host {
|
|
168
|
+
--t-link-border-color: ${c.MAIN};
|
|
169
|
+
${B}: ${c.MAIN}
|
|
170
|
+
}
|
|
171
|
+
|
|
172
|
+
:host([dark]) {
|
|
173
|
+
--t-link-border-color: ${h.MAIN};
|
|
174
|
+
${B}: ${h.MAIN}
|
|
175
|
+
}
|
|
176
|
+
|
|
177
|
+
:host([variant=${Q.SECONDARY}]) {
|
|
178
|
+
--t-link-border-color: ${c.WHITE};
|
|
179
|
+
${B}: ${c.WHITE}
|
|
180
|
+
}
|
|
181
|
+
|
|
182
|
+
:host([variant=${Q.SECONDARY}][dark]) {
|
|
183
|
+
--t-link-border-color: ${h.WHITE};
|
|
184
|
+
${B}: ${h.WHITE}
|
|
185
|
+
}
|
|
186
|
+
|
|
187
|
+
:host([disabled]) .link.disabled {
|
|
188
|
+
--t-link-border-color: ${c.PRIMARY_300};
|
|
189
|
+
${B}: ${c.PRIMARY_300}
|
|
190
|
+
}
|
|
191
|
+
|
|
192
|
+
.link {
|
|
193
|
+
text-decoration: none;
|
|
194
|
+
display: inline;
|
|
195
|
+
color: var(${B});
|
|
196
|
+
border-bottom: solid 1px var(--t-link-border-active-color, transparent);
|
|
197
|
+
}
|
|
198
|
+
.link:hover {
|
|
199
|
+
border-bottom: solid 1px var(--t-link-border-color);
|
|
200
|
+
cursor: pointer;
|
|
201
|
+
}
|
|
202
|
+
.link.secondary {
|
|
203
|
+
color: var(${B});
|
|
204
|
+
}
|
|
205
|
+
.link.secondary:hover {
|
|
206
|
+
border-bottom: solid 1px var(--t-link-border-color);
|
|
207
|
+
}
|
|
208
|
+
.link.disabled {
|
|
209
|
+
border-bottom: solid 1px var(--t-link-border-color);
|
|
210
|
+
color: var(${B});
|
|
211
|
+
cursor: not-allowed;
|
|
212
|
+
}
|
|
213
|
+
`)}
|
|
214
|
+
`;var Xt=Object.defineProperty,Wt=Object.getOwnPropertyDescriptor,ht=(t,e,o,n)=>{for(var i=n>1?void 0:n?Wt(e,o):e,r=t.length-1,s;r>=0;r--)(s=t[r])&&(i=(n?s(e,o,i):s(i))||i);return n&&i&&Xt(e,o,i),i};let tt=class extends H{constructor(){super(...arguments),this.size=p.Body1,this.color=N.PRIMARY,this.dark=!1,this._getStyleMap=()=>({color:`var(${B}, ${this._getTextColor()})`}),this._getClassMap=()=>({text:!0,[this.size]:!0})}_getTextColor(){return(this.dark?Dt:Bt)[this.color||N.PRIMARY]}render(){return d` <div
|
|
215
|
+
class="${E(this._getClassMap())}"
|
|
216
|
+
style="${dt(this._getStyleMap())}"
|
|
217
|
+
>
|
|
218
|
+
<slot></slot>
|
|
219
|
+
</div>`}};tt.styles=[u`
|
|
220
|
+
${l(b("text"))} {
|
|
221
|
+
font-family: 'Rubik', sans-serif;
|
|
222
|
+
display: inline;
|
|
223
|
+
margin: 0;
|
|
224
|
+
}
|
|
225
|
+
`,Ft,At,Rt];ht([a({type:p})],tt.prototype,"size",2);ht([a({type:N})],tt.prototype,"color",2);ht([a({type:Boolean,reflect:!0})],tt.prototype,"dark",2);tt=ht([M("tuix-text")],tt);var Kt=Object.defineProperty,Gt=Object.getOwnPropertyDescriptor,ut=(t,e,o,n)=>{for(var i=n>1?void 0:n?Gt(e,o):e,r=t.length-1,s;r>=0;r--)(s=t[r])&&(i=(n?s(e,o,i):s(i))||i);return n&&i&&Kt(e,o,i),i};let et=class extends jt{constructor(){super(...arguments),this.full=!1}_updateIconColor(){!this.iconLeft&&!this.iconRight||(this.iconColor=this._getTextColor())}_buttonContent(){let t=st.MEDIUM;return screen.width<=g.TABLET&&(t=st.SMALL),d` <div class="container">
|
|
226
|
+
${this.iconLeft?this._iconTemplate(this.iconLeft,t):z}
|
|
227
|
+
<slot></slot>
|
|
228
|
+
${this.iconRight?this._iconTemplate(this.iconRight,t):z}
|
|
229
|
+
</div>`}};et.styles=[u`
|
|
230
|
+
:host([full]) .button {
|
|
231
|
+
width: 100%;
|
|
232
|
+
}
|
|
233
|
+
.button {
|
|
234
|
+
padding: 16px 32px;
|
|
235
|
+
border-radius: 4px;
|
|
236
|
+
border: none;
|
|
237
|
+
font-family: 'Rubik', sans-serif;
|
|
238
|
+
}
|
|
239
|
+
|
|
240
|
+
@media only screen and (max-width: ${g.TABLET}px) {
|
|
241
|
+
.button {
|
|
242
|
+
padding: 14px 32px;
|
|
243
|
+
}
|
|
244
|
+
}
|
|
245
|
+
|
|
246
|
+
@media only screen and (max-width: ${g.MOBILE}px) {
|
|
247
|
+
.button {
|
|
248
|
+
padding: 12px 24px;
|
|
249
|
+
}
|
|
250
|
+
}
|
|
251
|
+
|
|
252
|
+
.container {
|
|
253
|
+
display: flex;
|
|
254
|
+
flex-direction: row;
|
|
255
|
+
justify-content: center;
|
|
256
|
+
align-items: center;
|
|
257
|
+
gap: 8px;
|
|
258
|
+
}
|
|
259
|
+
|
|
260
|
+
@media only screen and (max-width: ${g.MOBILE}px) {
|
|
261
|
+
.container {
|
|
262
|
+
gap: 6px;
|
|
263
|
+
}
|
|
264
|
+
}
|
|
265
|
+
`,Nt,Vt,Rt];ut([a({type:Boolean,reflect:!0})],et.prototype,"full",2);ut([a({type:k})],et.prototype,"iconRight",2);ut([a({type:k})],et.prototype,"iconLeft",2);et=ut([M("tuix-button")],et);const qt=Object.values(Z).slice(1,-1).map((t,e)=>`
|
|
266
|
+
.elevation.variant_${t} {
|
|
267
|
+
box-shadow: 0px ${2**e}px ${2**(e+2)}px ${c.SHADOW};
|
|
268
|
+
}
|
|
269
|
+
.elevation.dark_${t} {
|
|
270
|
+
background-color:rgb(${23+3*e},${23+3*e},${26+5*e});
|
|
271
|
+
}`).join(`
|
|
272
|
+
`),Jt=u`
|
|
273
|
+
${l(`
|
|
274
|
+
.elevation {
|
|
275
|
+
background-color: ${c.WHITE};
|
|
276
|
+
}
|
|
277
|
+
.elevation.dark_${Z.VARIANT_0} {
|
|
278
|
+
background-color: ${c.BLACK};
|
|
279
|
+
}
|
|
280
|
+
${qt}
|
|
281
|
+
.elevation.variant_${Z.VARIANT_4} {
|
|
282
|
+
box-shadow: 0px 7px 24px ${c.SHADOW};
|
|
283
|
+
}
|
|
284
|
+
.elevation.dark_${Z.VARIANT_4} {
|
|
285
|
+
background-color: rgb(33, 33, 40);
|
|
286
|
+
}
|
|
287
|
+
`)}
|
|
288
|
+
`;var Qt=Object.defineProperty,Zt=Object.getOwnPropertyDescriptor,bt=(t,e,o,n)=>{for(var i=n>1?void 0:n?Zt(e,o):e,r=t.length-1,s;r>=0;r--)(s=t[r])&&(i=(n?s(e,o,i):s(i))||i);return n&&i&&Qt(e,o,i),i};let it=class extends H{constructor(){super(...arguments),this.elevation=Z.VARIANT_1,this.borderRadius=Ht.NONE,this.dark=!1}_getOptionalClasses(){const t=`variant_${this.elevation}`,e=`dark_${this.elevation}`;return{elevation:!0,[t]:!this.dark,[e]:this.dark}}render(){return d` <div
|
|
289
|
+
class="${E(this._getOptionalClasses())}"
|
|
290
|
+
style="${dt({borderRadius:this.borderRadius})}"
|
|
291
|
+
>
|
|
292
|
+
<slot></slot>
|
|
293
|
+
</div>`}};it.styles=[Jt];bt([a({type:Z})],it.prototype,"elevation",2);bt([a({type:String,attribute:"border-radius"})],it.prototype,"borderRadius",2);bt([a({type:Boolean,reflect:!0})],it.prototype,"dark",2);it=bt([M("tuix-paper")],it);var pt=(t=>(t.BLANK="_blank",t.SELF="_self",t.PARENT="_parent",t.TOP="_top",t))(pt||{}),te=Object.defineProperty,ee=Object.getOwnPropertyDescriptor,ot=(t,e,o,n)=>{for(var i=n>1?void 0:n?ee(e,o):e,r=t.length-1,s;r>=0;r--)(s=t[r])&&(i=(n?s(e,o,i):s(i))||i);return n&&i&&te(e,o,i),i};let U=class extends H{constructor(){super(...arguments),this.target=pt.BLANK,this.variant=Q.PRIMARY,this.disabled=!1,this.dark=!1}_getClassMap(){return{link:!0,disabled:this.disabled,[Q.SECONDARY]:this.variant===Q.SECONDARY}}_anchorTemplate(){return d`
|
|
294
|
+
<a
|
|
295
|
+
target="${this.disabled?pt.SELF:this.target}"
|
|
296
|
+
class="${E(this._getClassMap())}"
|
|
297
|
+
href="${this.disabled?"javascript:void(0)":this.href}"
|
|
298
|
+
>
|
|
299
|
+
<slot></slot>
|
|
300
|
+
</a>
|
|
301
|
+
`}_divTemplate(){return d`
|
|
302
|
+
<div class="${E(this._getClassMap())}">
|
|
303
|
+
<slot></slot>
|
|
304
|
+
</div>
|
|
305
|
+
`}render(){return this.href&&!this.disabled?this._anchorTemplate():this._divTemplate()}};U.styles=[Ut,At];ot([a({type:String})],U.prototype,"href",2);ot([a({type:pt})],U.prototype,"target",2);ot([a({type:Q,reflect:!0})],U.prototype,"variant",2);ot([a({type:Boolean,reflect:!0})],U.prototype,"disabled",2);ot([a({type:Boolean,reflect:!0})],U.prototype,"dark",2);U=ot([M("tuix-link")],U);const Pt=t=>{const o=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(t);return o?{r:parseInt(o[1],16),g:parseInt(o[2],16),b:parseInt(o[3],16)}:{r:0,g:0,b:0}},F={gapX:"10px",iconDesktopSize:"1.5rem",iconMobileSize:"1rem"},mt=Pt(h.VALIDATION),vt=Pt(h.ERROR),Lt=u`
|
|
306
|
+
:host {
|
|
307
|
+
--t-field-color-form: ${l(c.PRIMARY_50)};
|
|
308
|
+
--t-field-color-title: ${l(c.PRIMARY_600)};
|
|
309
|
+
--t-field-color-text: ${l(c.BLACK)};
|
|
310
|
+
--t-field-color-description: ${l(c.NEUTRAL_600)};
|
|
311
|
+
--t-field-color-stroke-hover: ${l(c.PRIMARY_300)};
|
|
312
|
+
--t-field-color-stroke-focus: ${l(c.MAIN)};
|
|
313
|
+
--t-field-color-text-disabled: ${l(c.PRIMARY_300)};
|
|
314
|
+
--t-field-color-stroke-validation: ${l(c.VALIDATION_200)};
|
|
315
|
+
--t-field-color-bg-validation: ${l(c.VALIDATION_50)};
|
|
316
|
+
--t-field-color-stroke-loading: ${l(c.PRIMARY_300)};
|
|
317
|
+
--t-field-color-bg-error: ${l(c.ERROR_50)};
|
|
318
|
+
--t-field-color-stroke-error: ${l(c.ERROR_200)};
|
|
319
|
+
--t-field-input-cursor: auto;
|
|
320
|
+
--t-field-font-size: 1rem;
|
|
321
|
+
--t-field-font-weight: 300;
|
|
322
|
+
--t-field-line-height: 1.25rem;
|
|
323
|
+
--t-field-padding-x: 1.25rem;
|
|
324
|
+
--t-field-padding-y: 1.125rem;
|
|
325
|
+
--t-field-padding-top: 1.625rem;
|
|
326
|
+
--t-field-padding-bottom: 0.625rem;
|
|
327
|
+
--t-field-title-left-position: 1.25rem;
|
|
328
|
+
}
|
|
329
|
+
:host([dark]) {
|
|
330
|
+
--t-field-color-form: ${l(h.PRIMARY_950)};
|
|
331
|
+
--t-field-color-text: ${l(h.PRIMARY_100)};
|
|
332
|
+
--t-field-color-description: ${l(h.NEUTRAL_200)};
|
|
333
|
+
--t-field-color-stroke-focus: ${l(h.SECONDARY)};
|
|
334
|
+
--t-field-color-text-disabled: ${l(h.PRIMARY_800)};
|
|
335
|
+
--t-field-color-stroke-validation: ${l(h.VALIDATION_200)};
|
|
336
|
+
--t-field-color-bg-validation: rgba(
|
|
337
|
+
${mt.r},
|
|
338
|
+
${mt.g},
|
|
339
|
+
${mt.b},
|
|
340
|
+
0.2
|
|
341
|
+
);
|
|
342
|
+
--t-field-color-bg-error: rgba(
|
|
343
|
+
${vt.r},
|
|
344
|
+
${vt.g},
|
|
345
|
+
${vt.b},
|
|
346
|
+
0.2
|
|
347
|
+
);
|
|
348
|
+
--t-field-color-stroke-error: ${l(h.ERROR_200)};
|
|
349
|
+
}
|
|
350
|
+
`,ie=u`
|
|
351
|
+
.t-textarea-main-container {
|
|
352
|
+
display: flex;
|
|
353
|
+
flex-direction: column;
|
|
354
|
+
width: 100%;
|
|
355
|
+
height: 100%;
|
|
356
|
+
}
|
|
357
|
+
.t-input-container {
|
|
358
|
+
position: relative;
|
|
359
|
+
--t-padding-x-desktop-with-icon: calc(
|
|
360
|
+
var(--t-field-padding-x) + ${l(F.iconDesktopSize)} +
|
|
361
|
+
${l(F.gapX)}
|
|
362
|
+
);
|
|
363
|
+
--t-padding-x-mobile-with-icon: calc(
|
|
364
|
+
var(--t-field-padding-x) + ${l(F.iconMobileSize)} +
|
|
365
|
+
${l(F.gapX)}
|
|
366
|
+
);
|
|
367
|
+
--t-border-size: 1px;
|
|
368
|
+
}
|
|
369
|
+
.t-input-container.t-textarea-container {
|
|
370
|
+
height: 100%;
|
|
371
|
+
}
|
|
372
|
+
.t-input {
|
|
373
|
+
padding: calc(var(--t-field-padding-y) - var(--t-border-size))
|
|
374
|
+
var(--t-field-padding-x);
|
|
375
|
+
border-radius: 4px;
|
|
376
|
+
font-family: 'Rubik', sans-serif;
|
|
377
|
+
cursor: var(--t-field-input-cursor);
|
|
378
|
+
width: 100%;
|
|
379
|
+
box-sizing: border-box;
|
|
380
|
+
}
|
|
381
|
+
.t-input.t-textarea {
|
|
382
|
+
height: 100%;
|
|
383
|
+
display: block;
|
|
384
|
+
}
|
|
385
|
+
.t-input.with-title {
|
|
386
|
+
padding-top: calc(var(--t-field-padding-top) - var(--t-border-size));
|
|
387
|
+
padding-bottom: calc(var(--t-field-padding-bottom) - var(--t-border-size));
|
|
388
|
+
}
|
|
389
|
+
.t-input.with-icon-right {
|
|
390
|
+
padding-right: var(--t-padding-x-desktop-with-icon);
|
|
391
|
+
}
|
|
392
|
+
@media only screen and (max-width: ${g.MOBILE}px) {
|
|
393
|
+
.t-input.with-icon-right {
|
|
394
|
+
padding-right: var(--t-padding-x-mobile-with-icon);
|
|
395
|
+
}
|
|
396
|
+
}
|
|
397
|
+
`,oe=u`
|
|
398
|
+
.t-input::placeholder,
|
|
399
|
+
.t-input,
|
|
400
|
+
.t-title {
|
|
401
|
+
font-size: var(--t-field-font-size);
|
|
402
|
+
font-weight: var(--t-field-font-weight);
|
|
403
|
+
line-height: var(--t-field-line-height);
|
|
404
|
+
}
|
|
405
|
+
@media only screen and (max-width: ${g.TABLET}px) {
|
|
406
|
+
:host {
|
|
407
|
+
--t-field-font-size: 0.813rem;
|
|
408
|
+
--t-field-line-height: 1.125rem;
|
|
409
|
+
--t-field-padding-y: 1.063rem;
|
|
410
|
+
--t-field-padding-top: 1.5rem;
|
|
411
|
+
}
|
|
412
|
+
}
|
|
413
|
+
@media only screen and (max-width: ${g.MOBILE}px) {
|
|
414
|
+
:host {
|
|
415
|
+
--t-field-font-size: 0.813rem;
|
|
416
|
+
--t-field-line-height: 1rem;
|
|
417
|
+
--t-field-padding-y: 1rem;
|
|
418
|
+
--t-field-padding-top: 1.375rem;
|
|
419
|
+
}
|
|
420
|
+
}
|
|
421
|
+
`,re=u`
|
|
422
|
+
.t-input {
|
|
423
|
+
background-color: var(--t-field-color-form);
|
|
424
|
+
border: 1px solid var(--t-field-color-form);
|
|
425
|
+
color: var(--t-field-color-text);
|
|
426
|
+
}
|
|
427
|
+
.t-input-container:hover .t-input,
|
|
428
|
+
.t-input:hover {
|
|
429
|
+
border: 1px solid var(--t-field-color-stroke-hover);
|
|
430
|
+
}
|
|
431
|
+
.t-input:focus {
|
|
432
|
+
border: 1px solid var(--t-field-color-stroke-focus);
|
|
433
|
+
outline: 1px solid var(--t-field-color-stroke-focus);
|
|
434
|
+
}
|
|
435
|
+
.t-input[disabled]:disabled {
|
|
436
|
+
cursor: not-allowed;
|
|
437
|
+
border: 1px solid var(--t-field-color-form);
|
|
438
|
+
color: var(--t-field-color-text-disabled);
|
|
439
|
+
}
|
|
440
|
+
.t-input.with-title::placeholder {
|
|
441
|
+
color: transparent;
|
|
442
|
+
}
|
|
443
|
+
.t-input::placeholder,
|
|
444
|
+
.t-input.with-title:focus::placeholder {
|
|
445
|
+
color: var(--t-field-color-title);
|
|
446
|
+
}
|
|
447
|
+
.t-input.with-warning {
|
|
448
|
+
border: 1px solid var(--t-field-color-stroke-validation);
|
|
449
|
+
background-color: var(--t-field-color-bg-validation);
|
|
450
|
+
}
|
|
451
|
+
.t-input.with-error {
|
|
452
|
+
border: 1px solid var(--t-field-color-stroke-error);
|
|
453
|
+
background-color: var(--t-field-color-bg-error);
|
|
454
|
+
}
|
|
455
|
+
.t-input.with-loading {
|
|
456
|
+
border: 1px solid var(--t-field-color-stroke-loading);
|
|
457
|
+
}
|
|
458
|
+
`,ne=u`
|
|
459
|
+
.t-title {
|
|
460
|
+
position: absolute;
|
|
461
|
+
top: 50%;
|
|
462
|
+
left: var(--t-field-title-left-position);
|
|
463
|
+
font-family: 'Rubik', sans-serif;
|
|
464
|
+
color: var(--t-field-color-title);
|
|
465
|
+
transform: translateY(-50%);
|
|
466
|
+
transition-duration: 0.3s;
|
|
467
|
+
pointer-events: none;
|
|
468
|
+
-webkit-user-select: none;
|
|
469
|
+
-moz-user-select: none;
|
|
470
|
+
-ms-user-select: none;
|
|
471
|
+
user-select: none;
|
|
472
|
+
}
|
|
473
|
+
.t-textarea-container .t-title {
|
|
474
|
+
top: 1rem;
|
|
475
|
+
transform: none;
|
|
476
|
+
}
|
|
477
|
+
.t-input.with-title:focus + .t-title,
|
|
478
|
+
.t-input.with-title:not(:placeholder-shown) + .t-title {
|
|
479
|
+
font-size: 0.75rem;
|
|
480
|
+
font-weight: 300;
|
|
481
|
+
line-height: 0.875rem;
|
|
482
|
+
transform: translateY(0);
|
|
483
|
+
top: 0.5rem;
|
|
484
|
+
}
|
|
485
|
+
`,se=u`
|
|
486
|
+
.t-input-container .t-icon-set-container {
|
|
487
|
+
height: ${l(F.iconDesktopSize)};
|
|
488
|
+
width: ${l(F.iconDesktopSize)};
|
|
489
|
+
cursor: var(--t-field-input-cursor);
|
|
490
|
+
}
|
|
491
|
+
.t-icon-set-container.t-icon-click {
|
|
492
|
+
cursor: pointer;
|
|
493
|
+
}
|
|
494
|
+
.t-input-container .t-icon-set-container.t-icon-right {
|
|
495
|
+
position: absolute;
|
|
496
|
+
top: 50%;
|
|
497
|
+
right: var(--t-field-padding-x);
|
|
498
|
+
transform: translateY(-50%);
|
|
499
|
+
}
|
|
500
|
+
.t-input-container .t-icon-set-container.t-icon-left {
|
|
501
|
+
position: absolute;
|
|
502
|
+
top: 50%;
|
|
503
|
+
left: var(--t-field-padding-x);
|
|
504
|
+
transform: translateY(-50%);
|
|
505
|
+
}
|
|
506
|
+
.t-icon-inactive {
|
|
507
|
+
display: inline;
|
|
508
|
+
}
|
|
509
|
+
.t-icon-active {
|
|
510
|
+
display: none;
|
|
511
|
+
}
|
|
512
|
+
.t-icon-disabled {
|
|
513
|
+
display: none;
|
|
514
|
+
}
|
|
515
|
+
.t-input-container:hover .t-icon-set-container .t-icon-inactive,
|
|
516
|
+
.t-input:hover ~ .t-icon-set-container .t-icon-inactive,
|
|
517
|
+
.t-input:focus ~ .t-icon-set-container .t-icon-inactive {
|
|
518
|
+
display: none;
|
|
519
|
+
}
|
|
520
|
+
.t-input-container:hover .t-icon-set-container .t-icon-active,
|
|
521
|
+
.t-input:hover ~ .t-icon-set-container .t-icon-active,
|
|
522
|
+
.t-input:focus ~ .t-icon-set-container .t-icon-active {
|
|
523
|
+
display: inline;
|
|
524
|
+
}
|
|
525
|
+
.t-input[disabled] ~ .t-icon-set-container .t-icon-active {
|
|
526
|
+
display: none;
|
|
527
|
+
}
|
|
528
|
+
.t-input[disabled] ~ .t-icon-set-container .t-icon-inactive {
|
|
529
|
+
display: none;
|
|
530
|
+
}
|
|
531
|
+
.t-input[disabled] ~ .t-icon-set-container .t-icon-disabled {
|
|
532
|
+
display: inline;
|
|
533
|
+
cursor: not-allowed;
|
|
534
|
+
}
|
|
535
|
+
@media only screen and (max-width: ${g.MOBILE}px) {
|
|
536
|
+
.t-input-container .t-icon-set-container {
|
|
537
|
+
height: ${l(F.iconMobileSize)};
|
|
538
|
+
width: ${l(F.iconMobileSize)};
|
|
539
|
+
}
|
|
540
|
+
}
|
|
541
|
+
`,ae=u`
|
|
542
|
+
.t-input[type='search'] {
|
|
543
|
+
padding-left: var(--t-padding-x-desktop-with-icon);
|
|
544
|
+
}
|
|
545
|
+
.t-input[type='search'] + .t-title {
|
|
546
|
+
left: var(--t-padding-x-desktop-with-icon);
|
|
547
|
+
}
|
|
548
|
+
@media only screen and (max-width: ${g.MOBILE}px) {
|
|
549
|
+
.t-input[type='search'] {
|
|
550
|
+
padding-left: var(--t-padding-x-mobile-with-icon);
|
|
551
|
+
}
|
|
552
|
+
.t-input[type='search'] + .t-title {
|
|
553
|
+
left: var(--t-padding-x-mobile-with-icon);
|
|
554
|
+
}
|
|
555
|
+
}
|
|
556
|
+
input[type='search']::-webkit-search-decoration,
|
|
557
|
+
input[type='search']::-webkit-search-cancel-button,
|
|
558
|
+
input[type='search']::-webkit-search-results-button,
|
|
559
|
+
input[type='search']::-webkit-search-results-decoration {
|
|
560
|
+
display: none;
|
|
561
|
+
}
|
|
562
|
+
`,le=u`
|
|
563
|
+
.t-input-description-container {
|
|
564
|
+
margin-top: 0.5rem;
|
|
565
|
+
font-family: 'Rubik', sans-serif;
|
|
566
|
+
font-size: 0.75rem;
|
|
567
|
+
line-height: 1rem;
|
|
568
|
+
color: var(--t-field-color-description);
|
|
569
|
+
display: flex;
|
|
570
|
+
justify-content: space-between;
|
|
571
|
+
}
|
|
572
|
+
.t-input-description-container .t-letter-counter {
|
|
573
|
+
align-self: flex-end;
|
|
574
|
+
}
|
|
575
|
+
.t-input-description-container .t-input-description {
|
|
576
|
+
display: flex;
|
|
577
|
+
gap: 0.5rem;
|
|
578
|
+
}
|
|
579
|
+
`;var f=(t=>(t.TEXT="text",t.SEARCH="search",t.PASSWORD="password",t.TEXT_AREA="textarea",t))(f||{}),yt=(t=>(t.LEFT="left",t.RIGHT="right",t))(yt||{}),w=(t=>(t.TEXT="text",t.WARNING="warning",t.ERROR="error",t.SUCCESS="success",t.LOADING="loading",t))(w||{});const ce={warning:k.TRIANGLE_EXCLAMATION,error:k.CIRCLE_X,success:k.CIRCLE_CHECK,loading:k.LOADER},de={warning:c.VALIDATION,error:c.ERROR,success:c.SUCCESS,loading:c.PRIMARY_300},pe={warning:h.VALIDATION,error:h.ERROR,success:h.SUCCESS,loading:h.PRIMARY_300},A={INACTIVE:"inactive",ACTIVE:"active",DISABLED:"disabled"};var _=[];for(var xt=0;xt<256;++xt)_.push((xt+256).toString(16).slice(1));function he(t,e=0){return(_[t[e+0]]+_[t[e+1]]+_[t[e+2]]+_[t[e+3]]+"-"+_[t[e+4]]+_[t[e+5]]+"-"+_[t[e+6]]+_[t[e+7]]+"-"+_[t[e+8]]+_[t[e+9]]+"-"+_[t[e+10]]+_[t[e+11]]+_[t[e+12]]+_[t[e+13]]+_[t[e+14]]+_[t[e+15]]).toLowerCase()}var lt,ue=new Uint8Array(16);function be(){if(!lt&&(lt=typeof crypto<"u"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!lt))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return lt(ue)}var ge=typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto);const Tt={randomUUID:ge};function fe(t,e,o){if(Tt.randomUUID&&!t)return Tt.randomUUID();t=t||{};var n=t.random||(t.rng||be)();return n[6]=n[6]&15|64,n[8]=n[8]&63|128,he(n)}var me=Object.defineProperty,ve=Object.getOwnPropertyDescriptor,T=(t,e,o,n)=>{for(var i=n>1?void 0:n?ve(e,o):e,r=t.length-1,s;r>=0;r--)(s=t[r])&&(i=(n?s(e,o,i):s(i))||i);return n&&i&&me(e,o,i),i};let x=class extends H{constructor(){super(...arguments),this._inputId=this._setIdInput(),this.disabled=!1,this.value="",this.placeholder="",this.title="",this.type=f.TEXT,this.descriptionType=w.TEXT,this.dark=!1,this.readonly=!1,this.autofocus=!1,this._type=this.type,this._letterCounter=this.value?.length||0,this._previousType=this.type,this._previousValue="",this._generalIconColorsLight={[A.INACTIVE]:c.BLACK,[A.ACTIVE]:c.MAIN,[A.DISABLED]:c.PRIMARY_300},this._generalIconColorsDark={[A.INACTIVE]:h.PRIMARY_100,[A.ACTIVE]:h.MAIN,[A.DISABLED]:h.PRIMARY_800}}_handleInputBase(t,e){this.dispatchEvent(new CustomEvent(e,{detail:{value:(t.target instanceof HTMLInputElement||t.target instanceof HTMLTextAreaElement)&&t.target.value},bubbles:!0}))}_handleClickOnInput(){this.disabled||this.dispatchEvent(new CustomEvent("on-click",{bubbles:!0}))}_handleInput(t){this._handleInputBase(t,"on-change"),this._updateLetterCounter()}_handleBlur(t){this._handleInputBase(t,"on-blur")}_handlePasswordIconClick(){this._type===f.PASSWORD?(this._type=f.TEXT,this._inputElement.setAttribute("type",f.TEXT)):(this._type=f.PASSWORD,this._inputElement.setAttribute("type",f.PASSWORD))}_formatIconSet({iconName:t,colorByState:e,location:o=yt.RIGHT,clickHandler:n=void 0}){const i={"t-icon-set-container":!0,"t-icon-click":!!n,[`t-icon-${o}`]:!0};return d`<div
|
|
580
|
+
class="${E(i)}"
|
|
581
|
+
@click="${n}"
|
|
582
|
+
>
|
|
583
|
+
${Object.entries(e).map(([r,s])=>d`<tuix-icon
|
|
584
|
+
size="${st.FULL}"
|
|
585
|
+
name="${t}"
|
|
586
|
+
color="${s}"
|
|
587
|
+
class="t-icon-${r}"
|
|
588
|
+
></tuix-icon>`)}
|
|
589
|
+
</div>`}_updateLetterCounter(){this.maxlength!=null&&this.type===f.TEXT_AREA&&(this._letterCounter=Number(this._inputElement.value?.length))}_getInputTextFeatureTemplate(){return d`${this.iconRight?this._formatIconSet({iconName:this.iconRight,colorByState:this.dark?this._generalIconColorsDark:this._generalIconColorsLight}):z}`}_getInputSearchFeatureTemplate(){const t={[A.INACTIVE]:c.BLACK,[A.ACTIVE]:c.BLACK,[A.DISABLED]:c.PRIMARY_300},e={[A.INACTIVE]:h.PRIMARY_100,[A.ACTIVE]:h.PRIMARY_100,[A.DISABLED]:h.PRIMARY_800};return d`${this._formatIconSet({iconName:k.SEARCH,colorByState:this.dark?e:t,location:yt.LEFT})}`}_getInputPasswordFeatureTemplate(){return d`${this._formatIconSet({iconName:this._type===f.PASSWORD?k.EYE_CLOSE_LINE:k.EYE_ON,colorByState:this.dark?this._generalIconColorsDark:this._generalIconColorsLight,clickHandler:this._handlePasswordIconClick})} `}_getFeatureTemplateByInputType(){switch(this.type){case f.SEARCH:return this._getInputSearchFeatureTemplate();case f.TEXT:return this._getInputTextFeatureTemplate();case f.PASSWORD:return this._getInputPasswordFeatureTemplate();default:return d`${z}`}}_getInputElementClasses(){const t=this.type===f.PASSWORD||this.type===f.TEXT?!!this.iconRight:!1;return{"t-input":!0,"t-textarea":this.type===f.TEXT_AREA,"with-title":!!this.title,"with-icon-right":t,[`with-${this.descriptionType}`]:this.descriptionType!==w.TEXT}}_getInputContainerClasses(){return{"t-input-container":!0,"t-textarea-container":this.type===f.TEXT_AREA}}_getMainContainerClasses(){return{"t-textarea-main-container":this.type===f.TEXT_AREA}}_setIdInput(){return fe()}_getInputTemplate(){return d`<input
|
|
590
|
+
id=${this._inputId}
|
|
591
|
+
type="text"
|
|
592
|
+
class="${E(this._getInputElementClasses())}"
|
|
593
|
+
?disabled="${this.disabled}"
|
|
594
|
+
?readonly="${this.readonly}"
|
|
595
|
+
.value="${this.value}"
|
|
596
|
+
.type="${this.type}"
|
|
597
|
+
placeholder="${this.placeholder||" "}"
|
|
598
|
+
maxlength="${this.maxlength}"
|
|
599
|
+
@input="${this._handleInput}"
|
|
600
|
+
@blur="${this._handleBlur}"
|
|
601
|
+
>
|
|
602
|
+
</input>
|
|
603
|
+
${this.title?d`<label for=${this._inputId} class="t-title"
|
|
604
|
+
>${this.title}</label
|
|
605
|
+
>`:z}
|
|
606
|
+
${this._getFeatureTemplateByInputType()}
|
|
607
|
+
`}_getLetterCounterTemplate(){return this._hasLetterCounter()?d`<div class="t-letter-counter">
|
|
608
|
+
${this.maxlength?d`${this._letterCounter}/${this.maxlength}`:z}
|
|
609
|
+
</div> `:d`${z}`}_hasLetterCounter(){return this.type===f.TEXT_AREA&&typeof this.maxlength=="number"&&this.maxlength>=0}_getTextAreaTemplate(){return d`<textarea
|
|
610
|
+
id="${this._inputId}"
|
|
611
|
+
class="${E(this._getInputElementClasses())}"
|
|
612
|
+
?disabled="${this.disabled}"
|
|
613
|
+
?readonly="${this.readonly}"
|
|
614
|
+
.value="${this.value}"
|
|
615
|
+
placeholder="${this.placeholder}"
|
|
616
|
+
maxlength="${this.maxlength}"
|
|
617
|
+
@input="${this._handleInput}"
|
|
618
|
+
@blur="${this._handleBlur}"
|
|
619
|
+
></textarea>
|
|
620
|
+
${this.title?d`<label for=${this._inputId} class="t-title"
|
|
621
|
+
>${this.title}</label
|
|
622
|
+
>`:z} `}_getIconDescriptionTemplate(){return!this.descriptionType||this.descriptionType===w.TEXT?d`${z}`:d`<tuix-icon
|
|
623
|
+
size="${st.SMALL}"
|
|
624
|
+
name="${ce[this.descriptionType]}"
|
|
625
|
+
color="${this.dark?pe[this.descriptionType]:de[this.descriptionType]}"
|
|
626
|
+
>
|
|
627
|
+
</tuix-icon>`}_getDescriptionTemplate(){if(!this._hasValidDescriptionType())return d`<div></div>`;const e={[w.WARNING]:"Warning",[w.ERROR]:"Error",[w.SUCCESS]:"Success",[w.LOADING]:"Loading",[w.TEXT]:""};return d`<div class="t-input-description">
|
|
628
|
+
${this._getIconDescriptionTemplate()}
|
|
629
|
+
<span
|
|
630
|
+
>${this.description??e[this.descriptionType]}</span
|
|
631
|
+
>
|
|
632
|
+
</div>`}_hasValidDescriptionType(){return Object.values(w).includes(this.descriptionType)}_getDescriptionContainerTemplate(){const t=this._hasLetterCounter(),e=this._hasValidDescriptionType()&&(this.descriptionType===w.TEXT?!!this.description:!0);return!t&&!e?d`${z}`:d`<div class="t-input-description-container">
|
|
633
|
+
${this._getDescriptionTemplate()} ${this._getLetterCounterTemplate()}
|
|
634
|
+
</div>`}render(){return this._previousType!==this.type&&(this._previousType=this.type,this._type=this.type),this._previousValue!==this.value&&(this._previousValue=this.value,this._letterCounter=this.value.length),d`<div class="${E(this._getMainContainerClasses())}">
|
|
635
|
+
<div
|
|
636
|
+
class="${E(this._getInputContainerClasses())}"
|
|
637
|
+
@click="${this._handleClickOnInput}"
|
|
638
|
+
>
|
|
639
|
+
${this.type===f.TEXT_AREA?this._getTextAreaTemplate():this._getInputTemplate()}
|
|
640
|
+
</div>
|
|
641
|
+
${this._getDescriptionContainerTemplate()}
|
|
642
|
+
</div>`}updated(t){for(const[e]of t){if(this.disabled||this.readonly)break;String(e)==="autofocus"&&this.autofocus&&this._inputElement.focus()}}};x.styles=[Lt,ie,oe,re,ne,se,ae,le];T([a({type:Boolean,reflect:!0})],x.prototype,"disabled",2);T([a({type:k})],x.prototype,"iconRight",2);T([a({type:String})],x.prototype,"value",2);T([a({type:String})],x.prototype,"placeholder",2);T([a({type:String})],x.prototype,"title",2);T([a({type:f})],x.prototype,"type",2);T([a({type:Number})],x.prototype,"maxlength",2);T([a({type:String})],x.prototype,"description",2);T([a({type:w})],x.prototype,"descriptionType",2);T([a({type:Boolean,reflect:!0})],x.prototype,"dark",2);T([a({type:Boolean})],x.prototype,"readonly",2);T([a({type:Boolean,reflect:!0})],x.prototype,"autofocus",2);T([_t(".t-input-container .t-input")],x.prototype,"_inputElement",2);T([Y()],x.prototype,"_type",2);T([Y()],x.prototype,"_letterCounter",2);x=T([M("tuix-input")],x);const xe=u`
|
|
643
|
+
${Lt}
|
|
644
|
+
:host {
|
|
645
|
+
--t-field-color-option: ${l(c.WHITE)};
|
|
646
|
+
--t-field-color-main: ${l(c.MAIN)};
|
|
647
|
+
}
|
|
648
|
+
|
|
649
|
+
:host .t-input-dropdown {
|
|
650
|
+
--t-field-font-weight: 300;
|
|
651
|
+
--t-field-font-size: 1rem;
|
|
652
|
+
--t-field-padding-x: 1rem;
|
|
653
|
+
--t-field-title-left-position: 1rem;
|
|
654
|
+
}
|
|
655
|
+
|
|
656
|
+
@media only screen and (max-width: ${g.TABLET}px) {
|
|
657
|
+
:host .t-input-dropdown {
|
|
658
|
+
--t-field-font-size: 0.938rem;
|
|
659
|
+
--t-field-line-height: 1.125rem;
|
|
660
|
+
}
|
|
661
|
+
}
|
|
662
|
+
|
|
663
|
+
@media only screen and (max-width: ${g.MOBILE}px) {
|
|
664
|
+
:host .t-input-dropdown {
|
|
665
|
+
--t-field-font-size: 0.813rem;
|
|
666
|
+
--t-field-line-height: 1rem;
|
|
667
|
+
}
|
|
668
|
+
}
|
|
669
|
+
|
|
670
|
+
:host([dark]) {
|
|
671
|
+
--t-field-color-option: ${l(h.ELEVATION_2)};
|
|
672
|
+
}
|
|
673
|
+
`,ye=u`
|
|
674
|
+
.t-dropdown-full-container {
|
|
675
|
+
position: relative;
|
|
676
|
+
font-family: 'Rubik', sans-serif;
|
|
677
|
+
}
|
|
678
|
+
.t-dropdown-container .t-input-dropdown {
|
|
679
|
+
--t-field-input-cursor: pointer;
|
|
680
|
+
}
|
|
681
|
+
`,_e=u`
|
|
682
|
+
.t-options-container {
|
|
683
|
+
width: 100%;
|
|
684
|
+
position: absolute;
|
|
685
|
+
top: calc(100% + 2px);
|
|
686
|
+
left: 0;
|
|
687
|
+
border: none;
|
|
688
|
+
border-radius: 0 0 5px 5px;
|
|
689
|
+
background-color: var(--t-field-color-option);
|
|
690
|
+
visibility: collapse;
|
|
691
|
+
overflow-y: auto;
|
|
692
|
+
max-height: 250px;
|
|
693
|
+
color: var(--t-field-color-text);
|
|
694
|
+
box-shadow: 0px 2px 8px 0px ${l(c.SHADOW)};
|
|
695
|
+
z-index: 9999;
|
|
696
|
+
}
|
|
697
|
+
.t-options-container::-webkit-scrollbar {
|
|
698
|
+
width: 0.75rem;
|
|
699
|
+
}
|
|
700
|
+
.t-options-container::-webkit-scrollbar-track {
|
|
701
|
+
background-color: transparent;
|
|
702
|
+
}
|
|
703
|
+
.t-options-container::-webkit-scrollbar-thumb {
|
|
704
|
+
background-color: ${l(c.PRIMARY_100)};
|
|
705
|
+
border-radius: 0.25rem;
|
|
706
|
+
border: 0.188rem solid transparent;
|
|
707
|
+
background-clip: content-box;
|
|
708
|
+
}
|
|
709
|
+
.t-options-container.show {
|
|
710
|
+
visibility: visible;
|
|
711
|
+
}
|
|
712
|
+
.t-options-container.show.t-with-description {
|
|
713
|
+
top: calc(100% + 2px - 1.5rem);
|
|
714
|
+
}
|
|
715
|
+
@media only screen and (max-height: 500px) {
|
|
716
|
+
.t-options-container {
|
|
717
|
+
max-height: 50vh;
|
|
718
|
+
}
|
|
719
|
+
}
|
|
720
|
+
.t-dropdown-option {
|
|
721
|
+
padding: var(--t-field-padding-y) 1rem;
|
|
722
|
+
cursor: pointer;
|
|
723
|
+
font-size: 1rem;
|
|
724
|
+
line-height: 1.25rem;
|
|
725
|
+
font-weight: 300;
|
|
726
|
+
-webkit-user-select: none;
|
|
727
|
+
-moz-user-select: none;
|
|
728
|
+
-ms-user-select: none;
|
|
729
|
+
user-select: none;
|
|
730
|
+
}
|
|
731
|
+
.t-dropdown-option.t-option-hover {
|
|
732
|
+
background-color: var(--t-field-color-form);
|
|
733
|
+
}
|
|
734
|
+
.t-dropdown-option.t-option-selected {
|
|
735
|
+
color: var(--t-field-color-main);
|
|
736
|
+
}
|
|
737
|
+
.t-dropdown-option.t-option-filtered {
|
|
738
|
+
display: none;
|
|
739
|
+
}
|
|
740
|
+
.t-dropdown-option:focus {
|
|
741
|
+
outline: none;
|
|
742
|
+
}
|
|
743
|
+
@media only screen and (max-width: ${g.TABLET}px) {
|
|
744
|
+
.t-dropdown-option {
|
|
745
|
+
font-size: 0.938rem;
|
|
746
|
+
line-height: 1.125rem;
|
|
747
|
+
--t-field-padding-y: 1.063rem;
|
|
748
|
+
--t-field-padding-top: 1.5rem;
|
|
749
|
+
}
|
|
750
|
+
}
|
|
751
|
+
@media only screen and (max-width: ${g.MOBILE}px) {
|
|
752
|
+
.t-dropdown-option {
|
|
753
|
+
font-size: 0.813rem;
|
|
754
|
+
line-height: 1rem;
|
|
755
|
+
--t-field-padding-y: 1rem;
|
|
756
|
+
--t-field-padding-top: 1.375rem;
|
|
757
|
+
}
|
|
758
|
+
}
|
|
759
|
+
`;var L=(t=>(t.SINGLE="single",t.SEARCH="search",t))(L||{}),$e=Object.defineProperty,we=Object.getOwnPropertyDescriptor,C=(t,e,o,n)=>{for(var i=n>1?void 0:n?we(e,o):e,r=t.length-1,s;r>=0;r--)(s=t[r])&&(i=(n?s(e,o,i):s(i))||i);return n&&i&&$e(e,o,i),i};let y=class extends H{constructor(){super(...arguments),this.value=void 0,this.options=[],this.placeholder="",this.title="",this.disabled=!1,this.dark=!1,this.descriptionType=w.TEXT,this.type=L.SINGLE,this._value="",this._isOptionsVisible=!1,this._searchingOption=!1,this._extendedOptions=[],this._previousSelectedOption=null,this._previousFocusedOption=null,this._handleClickOutside=t=>{t.composedPath().includes(this)||(this._isOptionsVisible=!1)}}connectedCallback(){super.connectedCallback(),window.addEventListener("click",this._handleClickOutside),this.addEventListener("blur",this._handleBlur.bind(this))}disconnectedCallback(){window.removeEventListener("click",this._handleClickOutside),super.disconnectedCallback()}_onEnterPress(t){t.key==="Enter"&&this._toggleOptions()}_onKeyDownOption(t){switch(t.key){case"ArrowDown":return this._handleArrowDown();case"ArrowUp":return this._handleArrowUp();case"Escape":this._isOptionsVisible=!1;break}}_onKeyPressOption(t){t.key==="Enter"&&this._onClickOption(t)}_onMouseOverOption(t){const e=t.target;this._focusTargetOption(e)}_onClickOption(t){const e=t.target;this._value=e.innerText,this._isOptionsVisible=!1,this._unselectPreviousOption(),e.classList.add("t-option-selected"),this._previousSelectedOption=e,this._handleSelectEvent(t)}_onInputSingle(t){this._handleInputBase(t,"input-single")}_handleSelectEvent(t){const e=t.target.getAttribute("data-value"),o=this.options[Number(e)];this.dispatchEvent(new CustomEvent("select",{detail:{value:this._getOptionValue(o)},bubbles:!0})),this.type===L.SEARCH&&(this._extendOptionsList(this._getOptionName(o)),this._searchingOption=!1)}_handleBlur(){if(this.type===L.SEARCH&&this._searchingOption){const t=this._previousSelectedOption?.getAttribute("data-value"),e=typeof t=="string"?this.options[Number(t)]:"";this._value=this._getOptionName(e),this._extendOptionsList()}}_getOptionName(t){return String(typeof t=="object"?t?.name:t)}_getOptionValue(t){return typeof t=="object"?t.value:t}_findIndex(t){return this._extendedOptions.findIndex(e=>e.value===this._getOptionValue(t))}_handleInputBase(t,e){this._searchingOption||(this._searchingOption=!0),this._extendOptionsList(t.detail.value),this._isOptionsVisible=!0,this.dispatchEvent(new CustomEvent(e,{detail:{value:t.detail.value},bubbles:!0})),this._value=t.detail.value}_extendOptionsList(t=""){t=t.trim(),this._extendedOptions=this.options.map(e=>{const o=this._getOptionName(e);return{name:o,value:this._getOptionValue(e),filtered:this.type===L.SEARCH&&t!==""&&!o.toLowerCase().includes(t.toLowerCase())}})}_handleArrowDown(){const t=this._previousFocusedOption?.nextElementSibling;t&&this._focusTargetOption(t)}_handleArrowUp(){const t=this._previousFocusedOption?.previousElementSibling;t&&this._focusTargetOption(t)}_focusTargetOption(t,e=!0){this._previousFocusedOption?.classList?.remove("t-option-hover"),t?.classList.add("t-option-hover"),e&&t?.focus(),this._previousFocusedOption=t}_toggleOptions(){this.disabled||(this._isOptionsVisible=!this._isOptionsVisible,this._isOptionsVisible&&this.type===L.SEARCH&&this._previousSelectedOption&&(this._optionsContainer?.scrollTo({top:this._previousSelectedOption.offsetTop,behavior:"auto"}),this._inputDropdown?.shadowRoot?.querySelector("input")?.select()))}_focusOptionsContainer(){if(this.type===L.SEARCH){this._previousSelectedOption&&this._focusTargetOption(this._previousSelectedOption,!1);return}if(!this._isOptionsVisible||!this._optionsContainer){this._inputDropdown?.shadowRoot?.querySelector("input")?.focus();return}if(this._previousSelectedOption)this._focusTargetOption(this._previousSelectedOption);else{const t=this._optionsContainer.firstElementChild;t&&this._focusTargetOption(t)}}_unselectPreviousOption(){this._previousSelectedOption&&(this._previousSelectedOption.classList?.remove("t-option-selected"),this._previousSelectedOption=null)}_hasCompleteDescription(){return Object.values(w).includes(this.descriptionType)&&(this.descriptionType===w.TEXT?!!this.description:!0)}_getOptionsContainerClasses(){return{"t-options-container":!0,show:this._isOptionsVisible,"t-with-description":this._hasCompleteDescription()}}_triggerUpdateByExternalValueChange(){if(this._unselectPreviousOption(),!this.value){this._value="",this._extendOptionsList();return}const t=this._findIndex(this.value);if(this.type===L.SEARCH&&this._extendOptionsList(""),t<0){this._value="";return}const e=this._optionsContainer?.children[t];e?.classList.add("t-option-selected"),this._previousSelectedOption=e||null,this._value=e?this._getOptionName(this.options[t]):""}_resetPreviousSelection(){this._value="",this._unselectPreviousOption()}_getOptionsTemplate(){return(this.type===L.SINGLE||this._searchingOption===!1)&&this._extendOptionsList(),this._extendedOptions?.map((t,e)=>d`<div
|
|
760
|
+
class="${E({"t-dropdown-option":!0,"t-option-filtered":t.filtered})}"
|
|
761
|
+
@click="${this._onClickOption}"
|
|
762
|
+
data-value="${e}"
|
|
763
|
+
tabindex="0"
|
|
764
|
+
@keydown="${this._onKeyDownOption}"
|
|
765
|
+
@keypress="${this._onKeyPressOption}"
|
|
766
|
+
@mouseover="${this._onMouseOverOption}"
|
|
767
|
+
>
|
|
768
|
+
${t.name}
|
|
769
|
+
</div>`)}updated(t){t.has("_isOptionsVisible")?this._focusOptionsContainer():t.has("value")&&this._triggerUpdateByExternalValueChange()}willUpdate(t){t.has("options")&&this._resetPreviousSelection()}firstUpdated(t){super.firstUpdated(t),this._triggerUpdateByExternalValueChange()}render(){return d`<div class="t-dropdown-full-container">
|
|
770
|
+
<div class="t-dropdown-container">
|
|
771
|
+
<tuix-input
|
|
772
|
+
.value="${this._value}"
|
|
773
|
+
class="t-input-dropdown"
|
|
774
|
+
iconRight="${this._isOptionsVisible?k.CHEVRON_UP:k.CHEVRON_DOWN}"
|
|
775
|
+
placeholder="${this.placeholder}"
|
|
776
|
+
title="${this.title}"
|
|
777
|
+
.description="${this.description}"
|
|
778
|
+
descriptionType="${this.descriptionType}"
|
|
779
|
+
?disabled="${this.disabled}"
|
|
780
|
+
?dark="${this.dark}"
|
|
781
|
+
?readonly="${this.type!==L.SEARCH}"
|
|
782
|
+
@on-click="${this._toggleOptions}"
|
|
783
|
+
@keypress="${this._onEnterPress}"
|
|
784
|
+
@on-change="${this._onInputSingle}"
|
|
785
|
+
>
|
|
786
|
+
</tuix-input>
|
|
787
|
+
</div>
|
|
788
|
+
<div class="${E(this._getOptionsContainerClasses())}">
|
|
789
|
+
${this._getOptionsTemplate()}
|
|
790
|
+
</div>
|
|
791
|
+
</div>`}};y.styles=[xe,ye,_e];C([a({type:Object})],y.prototype,"value",2);C([a({type:Array})],y.prototype,"options",2);C([a({type:String})],y.prototype,"placeholder",2);C([a({type:String})],y.prototype,"title",2);C([a({type:Boolean,reflect:!0})],y.prototype,"disabled",2);C([a({type:Boolean,reflect:!0})],y.prototype,"dark",2);C([a({type:String})],y.prototype,"description",2);C([a({type:w})],y.prototype,"descriptionType",2);C([a({type:String})],y.prototype,"type",2);C([Y()],y.prototype,"_value",2);C([Y()],y.prototype,"_isOptionsVisible",2);C([Y()],y.prototype,"_searchingOption",2);C([Y()],y.prototype,"_extendedOptions",2);C([_t(".t-options-container")],y.prototype,"_optionsContainer",2);C([_t(".t-dropdown-container .t-input-dropdown")],y.prototype,"_inputDropdown",2);y=C([M("tuix-dropdown")],y);const $t=u`
|
|
792
|
+
:host {
|
|
793
|
+
--t-main-color-tuix: ${l(c.MAIN)};
|
|
794
|
+
--t-bg-color-primary: ${l(c.WHITE)};
|
|
795
|
+
--t-bg-color-disabled: ${l(c.PRIMARY_100)};
|
|
796
|
+
--t-text-color-error: ${l(c.ERROR)};
|
|
797
|
+
--t-stroke-color-focus: ${l(c.SECONDARY)};
|
|
798
|
+
--t-stroke-color-grey: ${l(c.PRIMARY_300)};
|
|
799
|
+
--t-text-color-label: ${l(c.BLACK)};
|
|
800
|
+
--t-label-right-default-justify: flex-start;
|
|
801
|
+
--t-label-left-default-justify: space-between;
|
|
802
|
+
}
|
|
803
|
+
:host([dark]) {
|
|
804
|
+
--t-main-color-tuix: ${l(h.MAIN)};
|
|
805
|
+
--t-bg-color-primary: ${l(h.BLACK)};
|
|
806
|
+
--t-bg-color-disabled: ${l(h.PRIMARY_800)};
|
|
807
|
+
--t-text-color-error: ${l(h.ERROR)};
|
|
808
|
+
--t-stroke-color-focus: ${l(h.SECONDARY)};
|
|
809
|
+
--t-stroke-color-grey: ${l(h.PRIMARY_100)};
|
|
810
|
+
--t-text-color-label: ${l(h.WHITE)};
|
|
811
|
+
}
|
|
812
|
+
`,ke=u`
|
|
813
|
+
.t-checkbox-full-container {
|
|
814
|
+
display: flex;
|
|
815
|
+
justify-content: var(--t-label-right-default-justify, flex-start);
|
|
816
|
+
cursor: pointer;
|
|
817
|
+
-webkit-user-select: none;
|
|
818
|
+
-moz-user-select: none;
|
|
819
|
+
-ms-user-select: none;
|
|
820
|
+
user-select: none;
|
|
821
|
+
}
|
|
822
|
+
:host([disabled]) .t-checkbox-full-container {
|
|
823
|
+
cursor: not-allowed;
|
|
824
|
+
}
|
|
825
|
+
.t-checkbox-container {
|
|
826
|
+
--t-checkbox-size-box: 1.5rem;
|
|
827
|
+
--t-checkbox-shadow-width: 2px;
|
|
828
|
+
--t-checkbox-border-radius: 0.25rem;
|
|
829
|
+
display: block;
|
|
830
|
+
position: relative;
|
|
831
|
+
height: var(--t-checkbox-size-box);
|
|
832
|
+
width: var(--t-checkbox-size-box);
|
|
833
|
+
min-width: var(--t-checkbox-size-box);
|
|
834
|
+
}
|
|
835
|
+
.t-checkbox-container .t-checkbox {
|
|
836
|
+
position: absolute;
|
|
837
|
+
opacity: 0;
|
|
838
|
+
height: 0;
|
|
839
|
+
width: 0;
|
|
840
|
+
}
|
|
841
|
+
@media only screen and (max-width: ${g.MOBILE}px) {
|
|
842
|
+
.t-checkbox-container {
|
|
843
|
+
--t-checkbox-size-box: 1rem;
|
|
844
|
+
--t-checkbox-shadow-width: 1px;
|
|
845
|
+
--t-checkbox-border-radius: 0.125rem;
|
|
846
|
+
margin-top: 1px;
|
|
847
|
+
}
|
|
848
|
+
}
|
|
849
|
+
`,Te=u`
|
|
850
|
+
.t-checkbox-container .t-checkbox-checkmark {
|
|
851
|
+
position: absolute;
|
|
852
|
+
top: 0;
|
|
853
|
+
left: 0;
|
|
854
|
+
display: flex;
|
|
855
|
+
height: var(--t-checkbox-size-box);
|
|
856
|
+
width: var(--t-checkbox-size-box);
|
|
857
|
+
border-radius: var(--t-checkbox-border-radius);
|
|
858
|
+
background-color: var(--t-bg-color-primary);
|
|
859
|
+
border: 1px solid var(--t-stroke-color-grey);
|
|
860
|
+
box-sizing: border-box;
|
|
861
|
+
}
|
|
862
|
+
.t-checkbox-container .t-checkbox-checkmark tuix-icon {
|
|
863
|
+
margin: auto;
|
|
864
|
+
display: none;
|
|
865
|
+
width: calc(var(--t-checkbox-size-box) - 0.5rem);
|
|
866
|
+
height: calc(var(--t-checkbox-size-box) - 0.5rem);
|
|
867
|
+
}
|
|
868
|
+
.t-checkbox-container .t-checkbox:checked ~ .t-checkbox-checkmark {
|
|
869
|
+
background-color: var(--t-main-color-tuix);
|
|
870
|
+
border: none;
|
|
871
|
+
}
|
|
872
|
+
.t-checkbox-container .t-checkbox:focus ~ .t-checkbox-checkmark {
|
|
873
|
+
box-shadow: 0 0 0px var(--t-checkbox-shadow-width)
|
|
874
|
+
var(--t-stroke-color-focus);
|
|
875
|
+
border: 1px solid var(--t-main-color-tuix);
|
|
876
|
+
}
|
|
877
|
+
.t-checkbox-container .t-checkbox:checked ~ .t-checkbox-checkmark tuix-icon {
|
|
878
|
+
display: block;
|
|
879
|
+
}
|
|
880
|
+
.t-checkbox-full-container:hover .t-checkbox-container .t-checkbox-checkmark {
|
|
881
|
+
border: 1px solid var(--t-main-color-tuix);
|
|
882
|
+
}
|
|
883
|
+
.t-checkbox-full-container.t-with-error
|
|
884
|
+
.t-checkbox-container
|
|
885
|
+
.t-checkbox-checkmark {
|
|
886
|
+
border: 1px solid var(--t-text-color-error);
|
|
887
|
+
}
|
|
888
|
+
.t-checkbox-full-container.t-with-error
|
|
889
|
+
.t-checkbox-container
|
|
890
|
+
.t-checkbox:checked
|
|
891
|
+
~ .t-checkbox-checkmark {
|
|
892
|
+
background-color: var(--t-text-color-error);
|
|
893
|
+
border: none;
|
|
894
|
+
}
|
|
895
|
+
|
|
896
|
+
.t-checkbox-container .t-checkbox:disabled ~ .t-checkbox-checkmark {
|
|
897
|
+
background-color: var(--t-bg-color-disabled);
|
|
898
|
+
border: none;
|
|
899
|
+
box-shadow: none;
|
|
900
|
+
}
|
|
901
|
+
`,Ce=u`
|
|
902
|
+
.t-checkbox-label {
|
|
903
|
+
display: block;
|
|
904
|
+
color: var(--t-text-color-label);
|
|
905
|
+
margin-left: 0.625rem;
|
|
906
|
+
}
|
|
907
|
+
.t-checkbox-full-container.t-with-label-left {
|
|
908
|
+
flex-direction: row-reverse;
|
|
909
|
+
justify-content: var(--t-label-left-default-justify, space-between);
|
|
910
|
+
}
|
|
911
|
+
.t-checkbox-full-container.t-with-label-left .t-checkbox-label {
|
|
912
|
+
margin-right: 0.625rem;
|
|
913
|
+
margin-left: 0;
|
|
914
|
+
}
|
|
915
|
+
`;var ct=(t=>(t.DEFAULT="default",t.DISABLED="disabled",t.ERROR="error",t))(ct||{}),G=(t=>(t.LEFT="left",t.RIGHT="right",t))(G||{});const Ie={default:c.WHITE,disabled:c.PRIMARY_300,error:c.WHITE},Se={default:h.WHITE,disabled:h.PRIMARY_100,error:h.WHITE};var Ee=Object.defineProperty,Oe=Object.getOwnPropertyDescriptor,q=(t,e,o,n)=>{for(var i=n>1?void 0:n?Oe(e,o):e,r=t.length-1,s;r>=0;r--)(s=t[r])&&(i=(n?s(e,o,i):s(i))||i);return n&&i&&Ee(e,o,i),i};let V=class extends H{constructor(){super(...arguments),this.checked=!1,this.disabled=!1,this.dark=!1,this.error=!1,this.label="",this.labelSide=G.RIGHT}_onCheckboxChange(t){this.dispatchEvent(new CustomEvent("change",{detail:{value:t.target.checked,label:this.label},bubbles:!0}))}_getIconMode(){return this.disabled?ct.DISABLED:this.error?ct.ERROR:ct.DEFAULT}_getFullContainerClasses(){return{"t-checkbox-full-container":!0,"t-with-error":this.error&&!this.disabled,"t-with-label-left":this.labelSide===G.LEFT}}render(){return d`<label class="${E(this._getFullContainerClasses())}">
|
|
916
|
+
<div class="t-checkbox-container">
|
|
917
|
+
<input
|
|
918
|
+
type="checkbox"
|
|
919
|
+
class="t-checkbox"
|
|
920
|
+
.checked="${this.checked}"
|
|
921
|
+
?disabled="${this.disabled}"
|
|
922
|
+
@change="${this._onCheckboxChange}"
|
|
923
|
+
/>
|
|
924
|
+
<div class="t-checkbox-checkmark">
|
|
925
|
+
<tuix-icon
|
|
926
|
+
size="${st.FULL}"
|
|
927
|
+
name="${k.CHECK}"
|
|
928
|
+
color="${this.dark?Se[this._getIconMode()]:Ie[this._getIconMode()]}"
|
|
929
|
+
>
|
|
930
|
+
</tuix-icon>
|
|
931
|
+
</div>
|
|
932
|
+
</div>
|
|
933
|
+
<div class="t-checkbox-label">
|
|
934
|
+
<slot>
|
|
935
|
+
<tuix-text
|
|
936
|
+
size="${p.Field1}"
|
|
937
|
+
color="${N.PRIMARY}"
|
|
938
|
+
?dark="${this.dark}"
|
|
939
|
+
>
|
|
940
|
+
${this.label}
|
|
941
|
+
</tuix-text>
|
|
942
|
+
</slot>
|
|
943
|
+
</div>
|
|
944
|
+
</label>`}};V.styles=[$t,ke,Te,Ce];q([a({type:Boolean})],V.prototype,"checked",2);q([a({type:Boolean,reflect:!0})],V.prototype,"disabled",2);q([a({type:Boolean,reflect:!0})],V.prototype,"dark",2);q([a({type:Boolean,reflect:!0})],V.prototype,"error",2);q([a({type:String})],V.prototype,"label",2);q([a({type:String})],V.prototype,"labelSide",2);V=q([M("tuix-checkbox")],V);const Re=u`
|
|
945
|
+
${$t}
|
|
946
|
+
:host {
|
|
947
|
+
--t-margin-between-radio-buttons: 1rem;
|
|
948
|
+
--t-radio-button-inner-color-disabled: ${l(c.PRIMARY_300)};
|
|
949
|
+
}
|
|
950
|
+
`,Ae=u`
|
|
951
|
+
.t-radio-button-full-container {
|
|
952
|
+
display: flex;
|
|
953
|
+
justify-content: var(--t-label-right-default-justify, flex-start);
|
|
954
|
+
cursor: pointer;
|
|
955
|
+
-webkit-user-select: none;
|
|
956
|
+
-moz-user-select: none;
|
|
957
|
+
-ms-user-select: none;
|
|
958
|
+
user-select: none;
|
|
959
|
+
}
|
|
960
|
+
:host([disabled]) .t-radio-button-full-container {
|
|
961
|
+
cursor: not-allowed;
|
|
962
|
+
}
|
|
963
|
+
.t-radio-button-container {
|
|
964
|
+
--t-radio-button-size-box: 1.5rem;
|
|
965
|
+
--t-radio-button-shadow-width: 2px;
|
|
966
|
+
display: block;
|
|
967
|
+
position: relative;
|
|
968
|
+
height: var(--t-radio-button-size-box);
|
|
969
|
+
width: var(--t-radio-button-size-box);
|
|
970
|
+
min-width: var(--t-radio-button-size-box);
|
|
971
|
+
}
|
|
972
|
+
.t-radio-button-container .t-radio-button {
|
|
973
|
+
position: absolute;
|
|
974
|
+
opacity: 0;
|
|
975
|
+
height: 0;
|
|
976
|
+
width: 0;
|
|
977
|
+
}
|
|
978
|
+
@media only screen and (max-width: ${g.MOBILE}px) {
|
|
979
|
+
.t-radio-button-container {
|
|
980
|
+
--t-radio-button-size-box: 1rem;
|
|
981
|
+
--t-radio-button-shadow-width: 1px;
|
|
982
|
+
margin-top: 1px;
|
|
983
|
+
}
|
|
984
|
+
}
|
|
985
|
+
`,Pe=u`
|
|
986
|
+
.t-radio-button-full-container.t-multiple-options {
|
|
987
|
+
margin-bottom: var(--t-margin-between-radio-buttons);
|
|
988
|
+
}
|
|
989
|
+
.t-radio-button-container .t-radio-button-checkmark {
|
|
990
|
+
position: absolute;
|
|
991
|
+
top: 0;
|
|
992
|
+
left: 0;
|
|
993
|
+
display: flex;
|
|
994
|
+
height: var(--t-radio-button-size-box);
|
|
995
|
+
width: var(--t-radio-button-size-box);
|
|
996
|
+
background-color: var(--t-bg-color-primary);
|
|
997
|
+
border: 1px solid var(--t-stroke-color-grey);
|
|
998
|
+
box-sizing: border-box;
|
|
999
|
+
border-radius: 50%;
|
|
1000
|
+
}
|
|
1001
|
+
.t-radio-button-container
|
|
1002
|
+
.t-radio-button:checked
|
|
1003
|
+
~ .t-radio-button-checkmark {
|
|
1004
|
+
border: 1px solid var(--t-main-color-tuix);
|
|
1005
|
+
}
|
|
1006
|
+
.t-radio-button-container .t-radio-button:focus ~ .t-radio-button-checkmark {
|
|
1007
|
+
box-shadow: 0 0 0px var(--t-radio-button-shadow-width)
|
|
1008
|
+
var(--t-stroke-color-focus);
|
|
1009
|
+
}
|
|
1010
|
+
.t-radio-button-full-container:hover
|
|
1011
|
+
.t-radio-button-container
|
|
1012
|
+
.t-radio-button-checkmark {
|
|
1013
|
+
border: 1px solid var(--t-main-color-tuix);
|
|
1014
|
+
}
|
|
1015
|
+
.t-radio-button-full-container.t-with-error
|
|
1016
|
+
.t-radio-button-container
|
|
1017
|
+
.t-radio-button-checkmark {
|
|
1018
|
+
border: 1px solid var(--t-text-color-error);
|
|
1019
|
+
}
|
|
1020
|
+
|
|
1021
|
+
.t-radio-button-container
|
|
1022
|
+
.t-radio-button:disabled
|
|
1023
|
+
~ .t-radio-button-checkmark {
|
|
1024
|
+
background-color: var(--t-bg-color-disabled);
|
|
1025
|
+
border: none;
|
|
1026
|
+
box-shadow: none;
|
|
1027
|
+
}
|
|
1028
|
+
`,Le=u`
|
|
1029
|
+
.t-radio-button-container .t-radio-button-checkmark .t-radio-button-inner {
|
|
1030
|
+
background-color: var(--t-main-color-tuix);
|
|
1031
|
+
margin: auto;
|
|
1032
|
+
height: calc(var(--t-radio-button-size-box) / 2 - 2px);
|
|
1033
|
+
width: calc(var(--t-radio-button-size-box) / 2 - 2px);
|
|
1034
|
+
border-radius: 50%;
|
|
1035
|
+
display: none;
|
|
1036
|
+
}
|
|
1037
|
+
.t-radio-button-container
|
|
1038
|
+
.t-radio-button:checked
|
|
1039
|
+
~ .t-radio-button-checkmark
|
|
1040
|
+
.t-radio-button-inner {
|
|
1041
|
+
display: block;
|
|
1042
|
+
}
|
|
1043
|
+
:host([error])
|
|
1044
|
+
.t-radio-button-container
|
|
1045
|
+
.t-radio-button-checkmark
|
|
1046
|
+
.t-radio-button-inner {
|
|
1047
|
+
background-color: var(--t-text-color-error);
|
|
1048
|
+
}
|
|
1049
|
+
:host([disabled])
|
|
1050
|
+
.t-radio-button-container
|
|
1051
|
+
.t-radio-button-checkmark
|
|
1052
|
+
.t-radio-button-inner {
|
|
1053
|
+
background-color: var(--t-radio-button-inner-color-disabled);
|
|
1054
|
+
cursor: not-allowed;
|
|
1055
|
+
}
|
|
1056
|
+
`,ze=u`
|
|
1057
|
+
.t-radio-button-label {
|
|
1058
|
+
display: block;
|
|
1059
|
+
color: var(--t-text-color-label);
|
|
1060
|
+
margin-left: 0.625rem;
|
|
1061
|
+
}
|
|
1062
|
+
.t-radio-button-full-container.t-with-label-left {
|
|
1063
|
+
flex-direction: row-reverse;
|
|
1064
|
+
justify-content: var(--t-label-left-default-justify, space-between);
|
|
1065
|
+
}
|
|
1066
|
+
.t-radio-button-full-container.t-with-label-left .t-radio-button-label {
|
|
1067
|
+
margin-right: 0.625rem;
|
|
1068
|
+
margin-left: 0;
|
|
1069
|
+
}
|
|
1070
|
+
`;var Me=Object.defineProperty,De=Object.getOwnPropertyDescriptor,J=(t,e,o,n)=>{for(var i=n>1?void 0:n?De(e,o):e,r=t.length-1,s;r>=0;r--)(s=t[r])&&(i=(n?s(e,o,i):s(i))||i);return n&&i&&Me(e,o,i),i};let j=class extends H{constructor(){super(...arguments),this.disabled=!1,this.dark=!1,this.error=!1,this.options=[],this.labelSide=G.RIGHT,this.selectedOption=null}_onRadioButtonChange(t){this.dispatchEvent(new CustomEvent("change",{detail:{value:t.target.value},bubbles:!0}))}_getFullContainerClasses(){return{"t-radio-button-full-container":!0,"t-with-error":this.error&&!this.disabled,"t-with-label-left":this.labelSide===G.LEFT,"t-multiple-options":this.options.length>1}}_formatTemplate(t,e){return d`<label class="${E(this._getFullContainerClasses())}">
|
|
1071
|
+
<div class="t-radio-button-container">
|
|
1072
|
+
<input
|
|
1073
|
+
type="radio"
|
|
1074
|
+
class="t-radio-button"
|
|
1075
|
+
?disabled="${this.disabled}"
|
|
1076
|
+
.value="${t}"
|
|
1077
|
+
name="tuix-radio-button"
|
|
1078
|
+
?checked="${this.selectedOption===t}"
|
|
1079
|
+
@change="${this._onRadioButtonChange}"
|
|
1080
|
+
/>
|
|
1081
|
+
<div class="t-radio-button-checkmark">
|
|
1082
|
+
<div class="t-radio-button-inner"></div>
|
|
1083
|
+
</div>
|
|
1084
|
+
</div>
|
|
1085
|
+
<div class="t-radio-button-label">
|
|
1086
|
+
<slot name="label-${e}">
|
|
1087
|
+
<tuix-text
|
|
1088
|
+
size="${p.Field1}"
|
|
1089
|
+
color="${N.PRIMARY}"
|
|
1090
|
+
?dark="${this.dark}"
|
|
1091
|
+
>
|
|
1092
|
+
${t}
|
|
1093
|
+
</tuix-text>
|
|
1094
|
+
</slot>
|
|
1095
|
+
</div>
|
|
1096
|
+
</label>`}render(){return d`${this.options.map((t,e)=>this._formatTemplate(t,e))}`}};j.styles=[Re,Ae,Pe,Le,ze];J([a({type:Boolean,reflect:!0})],j.prototype,"disabled",2);J([a({type:Boolean,reflect:!0})],j.prototype,"dark",2);J([a({type:Boolean,reflect:!0})],j.prototype,"error",2);J([a({type:Array})],j.prototype,"options",2);J([a({type:String})],j.prototype,"labelSide",2);J([a({type:String})],j.prototype,"selectedOption",2);j=J([M("tuix-radio-button")],j);const Be=u`
|
|
1097
|
+
${$t}
|
|
1098
|
+
:host {
|
|
1099
|
+
--t-bg-color-primary: ${l(c.PRIMARY_300)};
|
|
1100
|
+
--t-bg-color-disabled: ${l(c.PRIMARY_100)};
|
|
1101
|
+
--t-toggle-shadow-color-focus: rgba(142, 141, 208, 0.16);
|
|
1102
|
+
}
|
|
1103
|
+
:host([dark]) {
|
|
1104
|
+
--t-bg-color-primary: ${l(h.PRIMARY_800)};
|
|
1105
|
+
--t-bg-color-disabled: ${l(h.PRIMARY_800)};
|
|
1106
|
+
--t-bg-color-inner: ${l(h.WHITE)};
|
|
1107
|
+
}
|
|
1108
|
+
:host([dark][disabled]) {
|
|
1109
|
+
--t-bg-color-inner: ${l(h.MAIN)};
|
|
1110
|
+
}
|
|
1111
|
+
`,Ne=u`
|
|
1112
|
+
.t-toggle-button-full-container {
|
|
1113
|
+
display: flex;
|
|
1114
|
+
justify-content: var(--t-label-right-default-justify, flex-start);
|
|
1115
|
+
cursor: pointer;
|
|
1116
|
+
-webkit-user-select: none;
|
|
1117
|
+
-moz-user-select: none;
|
|
1118
|
+
-ms-user-select: none;
|
|
1119
|
+
user-select: none;
|
|
1120
|
+
}
|
|
1121
|
+
:host([disabled]) .t-toggle-button-full-container {
|
|
1122
|
+
cursor: not-allowed;
|
|
1123
|
+
}
|
|
1124
|
+
.t-toggle-button-container {
|
|
1125
|
+
--t-toggle-button-size-box: 3rem;
|
|
1126
|
+
--t-toggle-button-shadow-width: 2px;
|
|
1127
|
+
--t-toggle-inner-radio: 1rem;
|
|
1128
|
+
display: block;
|
|
1129
|
+
position: relative;
|
|
1130
|
+
height: calc(var(--t-toggle-button-size-box) / 2);
|
|
1131
|
+
width: var(--t-toggle-button-size-box);
|
|
1132
|
+
min-width: var(--t-toggle-button-size-box);
|
|
1133
|
+
}
|
|
1134
|
+
.t-toggle-button-container .t-toggle-button {
|
|
1135
|
+
position: absolute;
|
|
1136
|
+
opacity: 0;
|
|
1137
|
+
height: 0;
|
|
1138
|
+
width: 0;
|
|
1139
|
+
}
|
|
1140
|
+
.t-radio-button-full-container:not(.t-with-label-left) {
|
|
1141
|
+
justify-content: flex-start;
|
|
1142
|
+
}
|
|
1143
|
+
@media only screen and (max-width: ${g.MOBILE}px) {
|
|
1144
|
+
.t-toggle-button-container {
|
|
1145
|
+
--t-toggle-button-size-box: 2rem;
|
|
1146
|
+
--t-toggle-button-shadow-width: 1px;
|
|
1147
|
+
--t-toggle-inner-radio: 0.75rem;
|
|
1148
|
+
margin-top: 1px;
|
|
1149
|
+
}
|
|
1150
|
+
}
|
|
1151
|
+
`,Ve=u`
|
|
1152
|
+
.t-toggle-button-container .t-toggle-button-checkmark {
|
|
1153
|
+
position: absolute;
|
|
1154
|
+
top: 0;
|
|
1155
|
+
left: 0;
|
|
1156
|
+
display: flex;
|
|
1157
|
+
height: calc(var(--t-toggle-button-size-box) / 2);
|
|
1158
|
+
width: var(--t-toggle-button-size-box);
|
|
1159
|
+
border-radius: 0.75rem;
|
|
1160
|
+
background-color: var(--t-bg-color-primary);
|
|
1161
|
+
box-sizing: border-box;
|
|
1162
|
+
}
|
|
1163
|
+
.t-toggle-button-container
|
|
1164
|
+
.t-toggle-button:checked
|
|
1165
|
+
~ .t-toggle-button-checkmark {
|
|
1166
|
+
background-color: var(--t-main-color-tuix);
|
|
1167
|
+
}
|
|
1168
|
+
.t-toggle-button-full-container:hover
|
|
1169
|
+
.t-toggle-button-container
|
|
1170
|
+
.t-toggle-button-checkmark {
|
|
1171
|
+
box-shadow: 0px 4px 4px 0px var(--t-toggle-shadow-color-focus);
|
|
1172
|
+
}
|
|
1173
|
+
.t-toggle-button-container
|
|
1174
|
+
.t-toggle-button:focus
|
|
1175
|
+
~ .t-toggle-button-checkmark {
|
|
1176
|
+
box-shadow: 0 0 0px var(--t-toggle-button-shadow-width)
|
|
1177
|
+
var(--t-stroke-color-focus);
|
|
1178
|
+
}
|
|
1179
|
+
.t-toggle-button-container
|
|
1180
|
+
.t-toggle-button:disabled
|
|
1181
|
+
~ .t-toggle-button-checkmark {
|
|
1182
|
+
background-color: var(--t-bg-color-disabled);
|
|
1183
|
+
box-shadow: none;
|
|
1184
|
+
}
|
|
1185
|
+
`,je=u`
|
|
1186
|
+
.t-toggle-button-container .t-toggle-button-checkmark .t-toggle-button-inner {
|
|
1187
|
+
background-color: var(--t-bg-color-inner, ${l(c.WHITE)});
|
|
1188
|
+
margin: auto auto auto calc(var(--t-toggle-button-shadow-width) * 2);
|
|
1189
|
+
height: var(--t-toggle-inner-radio);
|
|
1190
|
+
width: var(--t-toggle-inner-radio);
|
|
1191
|
+
border-radius: 50%;
|
|
1192
|
+
display: block;
|
|
1193
|
+
transition: 0.3s;
|
|
1194
|
+
}
|
|
1195
|
+
.t-toggle-button-container
|
|
1196
|
+
.t-toggle-button:checked
|
|
1197
|
+
~ .t-toggle-button-checkmark
|
|
1198
|
+
.t-toggle-button-inner {
|
|
1199
|
+
transform: translateX(
|
|
1200
|
+
calc(
|
|
1201
|
+
var(--t-toggle-button-size-box) - var(--t-toggle-inner-radio) -
|
|
1202
|
+
var(--t-toggle-button-shadow-width) * 4
|
|
1203
|
+
)
|
|
1204
|
+
);
|
|
1205
|
+
}
|
|
1206
|
+
`,He=u`
|
|
1207
|
+
.t-toggle-button-label {
|
|
1208
|
+
display: block;
|
|
1209
|
+
color: var(--t-text-color-label);
|
|
1210
|
+
margin-left: 0.625rem;
|
|
1211
|
+
}
|
|
1212
|
+
.t-toggle-button-full-container.t-with-label-left {
|
|
1213
|
+
flex-direction: row-reverse;
|
|
1214
|
+
justify-content: var(--t-label-left-default-justify, space-between);
|
|
1215
|
+
}
|
|
1216
|
+
.t-toggle-button-full-container.t-with-label-left .t-toggle-button-label {
|
|
1217
|
+
margin-right: 0.625rem;
|
|
1218
|
+
margin-left: 0;
|
|
1219
|
+
}
|
|
1220
|
+
`;var Ye=Object.defineProperty,Fe=Object.getOwnPropertyDescriptor,rt=(t,e,o,n)=>{for(var i=n>1?void 0:n?Fe(e,o):e,r=t.length-1,s;r>=0;r--)(s=t[r])&&(i=(n?s(e,o,i):s(i))||i);return n&&i&&Ye(e,o,i),i};let X=class extends H{constructor(){super(...arguments),this.checked=!1,this.disabled=!1,this.dark=!1,this.label="",this.labelSide=G.RIGHT}_onToggleButtonChange(t){this.dispatchEvent(new CustomEvent("change",{detail:{value:t.target.checked,label:this.label},bubbles:!0}))}_getFullContainerClasses(){return{"t-toggle-button-full-container":!0,"t-with-label-left":this.labelSide===G.LEFT}}render(){return d`<label class="${E(this._getFullContainerClasses())}">
|
|
1221
|
+
<div class="t-toggle-button-container">
|
|
1222
|
+
<input
|
|
1223
|
+
type="checkbox"
|
|
1224
|
+
class="t-toggle-button"
|
|
1225
|
+
.checked="${this.checked}"
|
|
1226
|
+
?disabled="${this.disabled}"
|
|
1227
|
+
@change="${this._onToggleButtonChange}"
|
|
1228
|
+
/>
|
|
1229
|
+
<div class="t-toggle-button-checkmark">
|
|
1230
|
+
<div class="t-toggle-button-inner"></div>
|
|
1231
|
+
</div>
|
|
1232
|
+
</div>
|
|
1233
|
+
<div class="t-toggle-button-label">
|
|
1234
|
+
<slot>
|
|
1235
|
+
<tuix-text
|
|
1236
|
+
size="${p.Field1}"
|
|
1237
|
+
color="${N.PRIMARY}"
|
|
1238
|
+
?dark="${this.dark}"
|
|
1239
|
+
>
|
|
1240
|
+
${this.label}
|
|
1241
|
+
</tuix-text>
|
|
1242
|
+
</slot>
|
|
1243
|
+
</div>
|
|
1244
|
+
</label>`}};X.styles=[Be,Ne,Ve,je,He];rt([a({type:Boolean})],X.prototype,"checked",2);rt([a({type:Boolean,reflect:!0})],X.prototype,"disabled",2);rt([a({type:Boolean,reflect:!0})],X.prototype,"dark",2);rt([a({type:String})],X.prototype,"label",2);rt([a({type:String})],X.prototype,"labelSide",2);X=rt([M("tuix-toggle-button")],X);/**
|
|
1245
|
+
* @license
|
|
1246
|
+
* Copyright 2017 Google LLC
|
|
1247
|
+
* SPDX-License-Identifier: BSD-3-Clause
|
|
1248
|
+
*/const Ct=(t,e,o)=>{const n=new Map;for(let i=e;i<=o;i++)n.set(t[i],i);return n},Ue=St(class extends Et{constructor(t){if(super(t),t.type!==Ot.CHILD)throw Error("repeat() can only be used in text expressions")}ct(t,e,o){let n;o===void 0?o=e:e!==void 0&&(n=e);const i=[],r=[];let s=0;for(const O of t)i[s]=n?n(O,s):s,r[s]=o(O,s),s++;return{values:r,keys:i}}render(t,e,o){return this.ct(t,e,o).values}update(t,[e,o,n]){var i;const r=zt(t),{values:s,keys:O}=this.ct(e,o,n);if(!Array.isArray(r))return this.ut=O,s;const W=(i=this.ut)!==null&&i!==void 0?i:this.ut=[],P=[];let at,wt,m=0,I=r.length-1,v=0,R=s.length-1;for(;m<=I&&v<=R;)if(r[m]===null)m++;else if(r[I]===null)I--;else if(W[m]===O[v])P[v]=K(r[m],s[v]),m++,v++;else if(W[I]===O[R])P[R]=K(r[I],s[R]),I--,R--;else if(W[m]===O[R])P[R]=K(r[m],s[R]),nt(t,P[R+1],r[m]),m++,R--;else if(W[I]===O[v])P[v]=K(r[I],s[v]),nt(t,r[m],r[I]),I--,v++;else if(at===void 0&&(at=Ct(O,v,R),wt=Ct(W,m,I)),at.has(W[m]))if(at.has(W[I])){const D=wt.get(O[v]),gt=D!==void 0?r[D]:null;if(gt===null){const kt=nt(t,r[m]);K(kt,s[v]),P[v]=kt}else P[v]=K(gt,s[v]),nt(t,r[m],gt),r[D]=null;v++}else ft(r[I]),I--;else ft(r[m]),m++;for(;v<=R;){const D=nt(t,P[R+1]);K(D,s[v]),P[v++]=D}for(;m<=I;){const D=r[m++];D!==null&&ft(D)}return this.ut=O,Mt(t,P),It}}),Xe=u`
|
|
1249
|
+
:host {
|
|
1250
|
+
display: block;
|
|
1251
|
+
width: 100%;
|
|
1252
|
+
}
|
|
1253
|
+
|
|
1254
|
+
.table_wrapper {
|
|
1255
|
+
width: 100%;
|
|
1256
|
+
overflow-x: auto;
|
|
1257
|
+
}
|
|
1258
|
+
|
|
1259
|
+
table {
|
|
1260
|
+
min-width: 650px;
|
|
1261
|
+
table-layout: fixed;
|
|
1262
|
+
width: 100%;
|
|
1263
|
+
border-collapse: collapse;
|
|
1264
|
+
}
|
|
1265
|
+
|
|
1266
|
+
thead th {
|
|
1267
|
+
box-sizing: border-box;
|
|
1268
|
+
padding: 8px;
|
|
1269
|
+
text-align: left;
|
|
1270
|
+
overflow: hidden;
|
|
1271
|
+
text-overflow: ellipsis;
|
|
1272
|
+
white-space: nowrap;
|
|
1273
|
+
}
|
|
1274
|
+
|
|
1275
|
+
tbody tr td {
|
|
1276
|
+
box-sizing: border-box;
|
|
1277
|
+
height: 52px;
|
|
1278
|
+
padding: 6px 8px;
|
|
1279
|
+
text-align: left;
|
|
1280
|
+
overflow: hidden;
|
|
1281
|
+
text-overflow: ellipsis;
|
|
1282
|
+
white-space: nowrap;
|
|
1283
|
+
}
|
|
1284
|
+
|
|
1285
|
+
::slotted(*) {
|
|
1286
|
+
display: inline-flex;
|
|
1287
|
+
align-items: center;
|
|
1288
|
+
margin-right: 8px;
|
|
1289
|
+
gap: 10px;
|
|
1290
|
+
}
|
|
1291
|
+
|
|
1292
|
+
.dropdown_container {
|
|
1293
|
+
position: relative;
|
|
1294
|
+
border-radius: 4px;
|
|
1295
|
+
}
|
|
1296
|
+
|
|
1297
|
+
.dropdown_container .items-per-page-dropdown {
|
|
1298
|
+
width: 55px;
|
|
1299
|
+
border: none;
|
|
1300
|
+
background-color: transparent;
|
|
1301
|
+
padding: 8px;
|
|
1302
|
+
cursor: pointer;
|
|
1303
|
+
-webkit-appearance: none;
|
|
1304
|
+
-moz-appearance: none;
|
|
1305
|
+
appearance: none;
|
|
1306
|
+
}
|
|
1307
|
+
|
|
1308
|
+
.dropdown_container .items-per-page-dropdown:focus-visible {
|
|
1309
|
+
border: none;
|
|
1310
|
+
outline: none;
|
|
1311
|
+
}
|
|
1312
|
+
|
|
1313
|
+
.dropdown_container .arrow-icon {
|
|
1314
|
+
position: absolute;
|
|
1315
|
+
right: 8px;
|
|
1316
|
+
bottom: 8px;
|
|
1317
|
+
cursor: pointer;
|
|
1318
|
+
pointer-events: none;
|
|
1319
|
+
}
|
|
1320
|
+
|
|
1321
|
+
footer.table_footer {
|
|
1322
|
+
height: 48px;
|
|
1323
|
+
padding: 8px;
|
|
1324
|
+
width: 100%;
|
|
1325
|
+
display: flex;
|
|
1326
|
+
justify-content: space-between;
|
|
1327
|
+
align-items: center;
|
|
1328
|
+
box-sizing: border-box;
|
|
1329
|
+
}
|
|
1330
|
+
|
|
1331
|
+
footer.table_footer .items-per-page {
|
|
1332
|
+
display: flex;
|
|
1333
|
+
align-items: center;
|
|
1334
|
+
gap: 8px;
|
|
1335
|
+
}
|
|
1336
|
+
|
|
1337
|
+
footer.table_footer .navigation {
|
|
1338
|
+
display: flex;
|
|
1339
|
+
align-items: center;
|
|
1340
|
+
gap: 8px;
|
|
1341
|
+
}
|
|
1342
|
+
|
|
1343
|
+
footer.table_footer .navigation .buttons {
|
|
1344
|
+
display: flex;
|
|
1345
|
+
gap: 8px;
|
|
1346
|
+
cursor: pointer;
|
|
1347
|
+
}
|
|
1348
|
+
|
|
1349
|
+
.mobile_table {
|
|
1350
|
+
display: none;
|
|
1351
|
+
}
|
|
1352
|
+
|
|
1353
|
+
@media only screen and (max-width: ${g.TABLET}px) {
|
|
1354
|
+
.mobile_table {
|
|
1355
|
+
display: block;
|
|
1356
|
+
}
|
|
1357
|
+
|
|
1358
|
+
footer.table_footer {
|
|
1359
|
+
align-items: flex-start;
|
|
1360
|
+
gap: 8px;
|
|
1361
|
+
}
|
|
1362
|
+
|
|
1363
|
+
.mobile_table .table_row {
|
|
1364
|
+
display: flex;
|
|
1365
|
+
min-height: 40px;
|
|
1366
|
+
}
|
|
1367
|
+
|
|
1368
|
+
.mobile_table .table_row > * {
|
|
1369
|
+
padding: 0 16px;
|
|
1370
|
+
width: 50%;
|
|
1371
|
+
text-overflow: ellipsis;
|
|
1372
|
+
overflow: hidden;
|
|
1373
|
+
display: flex;
|
|
1374
|
+
align-items: center;
|
|
1375
|
+
}
|
|
1376
|
+
}
|
|
1377
|
+
`,We=u`
|
|
1378
|
+
.tuix-spinner-wrapper {
|
|
1379
|
+
display: flex;
|
|
1380
|
+
justify-content: center;
|
|
1381
|
+
align-items: center;
|
|
1382
|
+
padding: 24px 0;
|
|
1383
|
+
}
|
|
1384
|
+
|
|
1385
|
+
.three-dots-wrapper {
|
|
1386
|
+
display: inline-flex;
|
|
1387
|
+
gap: calc(var(--dot-size) * 0.5);
|
|
1388
|
+
align-items: center;
|
|
1389
|
+
justify-content: center;
|
|
1390
|
+
position: relative;
|
|
1391
|
+
}
|
|
1392
|
+
.three-dots-wrapper .dot {
|
|
1393
|
+
width: var(--dot-size);
|
|
1394
|
+
height: var(--dot-size);
|
|
1395
|
+
background: var(--dot-color);
|
|
1396
|
+
border-radius: 50%;
|
|
1397
|
+
display: inline-block;
|
|
1398
|
+
animation: threeDots 0.9s infinite ease-in-out both;
|
|
1399
|
+
}
|
|
1400
|
+
.three-dots-wrapper .dot:nth-child(2) {
|
|
1401
|
+
animation-delay: 0.15s;
|
|
1402
|
+
}
|
|
1403
|
+
.three-dots-wrapper .dot:nth-child(3) {
|
|
1404
|
+
animation-delay: 0.3s;
|
|
1405
|
+
}
|
|
1406
|
+
|
|
1407
|
+
@keyframes threeDots {
|
|
1408
|
+
0%,
|
|
1409
|
+
80%,
|
|
1410
|
+
100% {
|
|
1411
|
+
transform: scale(0.6);
|
|
1412
|
+
opacity: 0.6;
|
|
1413
|
+
}
|
|
1414
|
+
40% {
|
|
1415
|
+
transform: scale(1);
|
|
1416
|
+
opacity: 1;
|
|
1417
|
+
}
|
|
1418
|
+
}
|
|
1419
|
+
|
|
1420
|
+
.sr-only {
|
|
1421
|
+
border: 0;
|
|
1422
|
+
clip: rect(1px, 1px, 1px, 1px);
|
|
1423
|
+
-webkit-clip-path: inset(50%);
|
|
1424
|
+
clip-path: inset(50%);
|
|
1425
|
+
height: 1px;
|
|
1426
|
+
margin: -1px;
|
|
1427
|
+
overflow: hidden;
|
|
1428
|
+
padding: 0;
|
|
1429
|
+
position: absolute;
|
|
1430
|
+
width: 1px;
|
|
1431
|
+
white-space: nowrap;
|
|
1432
|
+
}
|
|
1433
|
+
|
|
1434
|
+
.clientsLoader,
|
|
1435
|
+
.mobileClientsLoader,
|
|
1436
|
+
.tabletClientsLoader {
|
|
1437
|
+
display: flex;
|
|
1438
|
+
justify-content: center;
|
|
1439
|
+
padding: 16px 0;
|
|
1440
|
+
}
|
|
1441
|
+
`;var Ke=Object.defineProperty,Ge=Object.getOwnPropertyDescriptor,S=(t,e,o,n)=>{for(var i=n>1?void 0:n?Ge(e,o):e,r=t.length-1,s;r>=0;r--)(s=t[r])&&(i=(n?s(e,o,i):s(i))||i);return n&&i&&Ke(e,o,i),i};let $=class extends H{constructor(){super(...arguments),this.paginated=!1,this.disableMobileTable=!1,this.showMobileTableInTablet=!1,this.data=[],this.headers=[],this.pageSizeOptions=[5,10,20],this.isLoadingData=!1,this._isTabletView=!1,this._isMobileView=!1,this._headerPercents=[],this._onScreenSizeChange=()=>{this._isTabletView=!!this._mqTablet?.matches,this._isMobileView=!!this._mqMobile?.matches},this._nextPage=()=>{if(this.currentPage===this.totalPages)return;const e={page:Math.min(this.totalPages,this._effectiveCurrentPage+1),pageSize:this._effectivePageSize};this.dispatchEvent(new CustomEvent("next-page",{detail:e,bubbles:!0,composed:!0}))},this._prevPage=()=>{if(this.currentPage===1)return;const e={page:Math.max(1,this._effectiveCurrentPage-1),pageSize:this._effectivePageSize};this.dispatchEvent(new CustomEvent("previous-page",{detail:e,bubbles:!0,composed:!0}))},this._setPageSize=t=>{const n={page:1,pageSize:Math.max(1,Math.floor(t))};this.dispatchEvent(new CustomEvent("page-size-change",{detail:n,bubbles:!0,composed:!0}))}}connectedCallback(){super.connectedCallback(),this._mqTablet=window.matchMedia(`(max-width:${g.TABLET}px)`),this._mqMobile=window.matchMedia(`(max-width:${g.MOBILE}px)`),this._onScreenSizeChange(),this._mqTablet.addEventListener("change",this._onScreenSizeChange),this._mqMobile.addEventListener("change",this._onScreenSizeChange),this._computeHeaderPercents()}disconnectedCallback(){super.disconnectedCallback(),this._mqTablet?.removeEventListener("change",this._onScreenSizeChange),this._mqMobile?.removeEventListener("change",this._onScreenSizeChange)}updated(t){t.has("headers")&&this._computeHeaderPercents()}get _effectiveTotalItems(){return this.totalItems??this.data.length}get _effectiveCurrentPage(){return this.currentPage??1}get _effectivePageSize(){return this.currentSize??this.pageSizeOptions[0]}get totalPages(){const t=this._effectivePageSize;return Math.max(1,Math.ceil(this._effectiveTotalItems/t))}get _paginationProps(){const t=this._effectiveTotalItems,e=this._effectivePageSize,o=t?(this._effectiveCurrentPage-1)*e+1:0,n=Math.min(this._effectiveCurrentPage*e,t);return{totalItems:t,currentPage:this._effectiveCurrentPage,itemsPerPage:e,startItem:o,endItem:n,onNextPage:this._nextPage,onPreviousPage:this._prevPage,onItemsPerPageChange:this._setPageSize,isLoading:this.isLoadingData}}_computeHeaderPercents(){const t=this.headers.reduce((e,o)=>e+o.width,0);this._headerPercents=t===0?this.headers.map(()=>100/this.headers.length):this.headers.map(e=>e.width/t*100)}_cellStyleString(){return`border-bottom:1px solid ${c.NEUTRAL_200};`}_textVariantColor(t,e){return t.cellColor?t.cellColor(e):N.PRIMARY}_renderHeaderCells(){return d`<tr>
|
|
1442
|
+
${this.headers.map((t,e)=>d`<th
|
|
1443
|
+
style=${dt({width:`${this._headerPercents[e]}%`,color:c.WHITE})}
|
|
1444
|
+
>
|
|
1445
|
+
<tuix-text size=${p.Body1} color=${N.SECONDARY}
|
|
1446
|
+
>${t.name}</tuix-text
|
|
1447
|
+
>
|
|
1448
|
+
</th>`)}
|
|
1449
|
+
</tr>`}_renderCell(t,e){if(t.isSlot){const n=`${t.slotName}-${e.id}`;return d`<td style="${this._cellStyleString()}">
|
|
1450
|
+
<slot name=${n}></slot>
|
|
1451
|
+
</td>`}const o=e[t.dataKey];return d`<td style="${this._cellStyleString()}">
|
|
1452
|
+
<tuix-text
|
|
1453
|
+
size=${p.Body1}
|
|
1454
|
+
color=${this._textVariantColor(t,e)}
|
|
1455
|
+
>${o}</tuix-text
|
|
1456
|
+
>
|
|
1457
|
+
</td>`}_renderRows(){const t=this.data;return Ue(t,e=>e.id,e=>d`<tr>
|
|
1458
|
+
${this.headers.map(o=>this._renderCell(o,e))}
|
|
1459
|
+
</tr>`)}_onPageSizeChange(t){const e=parseInt(t.target.value);this._setPageSize(e)}_renderPageSizeOptions(){return this.pageSizeOptions.map(t=>d`<option value=${t}>${t}</option>`)}_renderSpinner(){const t={size:"14px",color:c.MAIN,visible:!0,ariaLabel:"Loading",wrapperStyle:{width:"100%",display:"flex",justifyContent:"center",padding:"48px 0"},...this.loader};if(!t.visible)return null;const e={"--dot-size":t.size,"--dot-color":t.color,...t.wrapperStyle},o=t.ariaLabel;return d`<div class="tuix-spinner-wrapper">
|
|
1460
|
+
<div
|
|
1461
|
+
class="three-dots-wrapper"
|
|
1462
|
+
role="status"
|
|
1463
|
+
aria-label=${o}
|
|
1464
|
+
style=${dt(e)}
|
|
1465
|
+
>
|
|
1466
|
+
<span class="dot" aria-hidden="true"></span>
|
|
1467
|
+
<span class="dot" aria-hidden="true"></span>
|
|
1468
|
+
<span class="dot" aria-hidden="true"></span>
|
|
1469
|
+
<span class="sr-only">${o}</span>
|
|
1470
|
+
</div>
|
|
1471
|
+
</div>`}_renderPagination(){const{totalItems:t,startItem:e,endItem:o,itemsPerPage:n,isLoading:i}=this._paginationProps;return d`<footer
|
|
1472
|
+
style="background-color:${c.SECTION_BG};"
|
|
1473
|
+
class="table_footer sticky"
|
|
1474
|
+
>
|
|
1475
|
+
<div class="items-per-page">
|
|
1476
|
+
<tuix-text size=${p.Body2}>Items per page</tuix-text>
|
|
1477
|
+
<div
|
|
1478
|
+
style="outline: 1px solid ${c.NEUTRAL_200};"
|
|
1479
|
+
class="dropdown_container"
|
|
1480
|
+
>
|
|
1481
|
+
<select
|
|
1482
|
+
class="items-per-page-dropdown"
|
|
1483
|
+
.value=${String(n)}
|
|
1484
|
+
@change=${this._onPageSizeChange}
|
|
1485
|
+
?disabled=${i}
|
|
1486
|
+
>
|
|
1487
|
+
${this._renderPageSizeOptions()}
|
|
1488
|
+
</select>
|
|
1489
|
+
<tuix-icon
|
|
1490
|
+
class="arrow-icon"
|
|
1491
|
+
name=${k.CHEVRON_DOWN}
|
|
1492
|
+
></tuix-icon>
|
|
1493
|
+
</div>
|
|
1494
|
+
</div>
|
|
1495
|
+
|
|
1496
|
+
<div class="navigation">
|
|
1497
|
+
<tuix-text size=${p.Body2}
|
|
1498
|
+
>${e} - ${o} of ${t}</tuix-text
|
|
1499
|
+
>
|
|
1500
|
+
<div class="buttons">
|
|
1501
|
+
<tuix-icon
|
|
1502
|
+
class="arrow-icon"
|
|
1503
|
+
name=${k.CHEVRON_LEFT}
|
|
1504
|
+
@click=${this._prevPage}
|
|
1505
|
+
></tuix-icon>
|
|
1506
|
+
<tuix-icon
|
|
1507
|
+
class="arrow-icon"
|
|
1508
|
+
name=${k.CHEVRON_RIGHT}
|
|
1509
|
+
@click=${this._nextPage}
|
|
1510
|
+
></tuix-icon>
|
|
1511
|
+
</div>
|
|
1512
|
+
</div>
|
|
1513
|
+
</footer>`}_renderTable(){return d`<table>
|
|
1514
|
+
<thead style="background-color: ${c.MAIN}">
|
|
1515
|
+
${this._renderHeaderCells()}
|
|
1516
|
+
</thead>
|
|
1517
|
+
${this.isLoadingData?d`<tbody>
|
|
1518
|
+
<tr>
|
|
1519
|
+
<td colspan=${this.headers.length}>${this._renderSpinner()}</td>
|
|
1520
|
+
</tr>
|
|
1521
|
+
</tbody>`:d`<tbody>
|
|
1522
|
+
${this._renderRows()}
|
|
1523
|
+
</tbody>`}
|
|
1524
|
+
</table>
|
|
1525
|
+
${this.paginated?this._renderPagination():null}`}_renderCards(){const t=this.data;return d`<div class="mobile_table">
|
|
1526
|
+
${this.isLoadingData?this._renderSpinner():t.map(e=>d`<div
|
|
1527
|
+
style="border-bottom: 2px solid ${c.MAIN};"
|
|
1528
|
+
class="table_entity"
|
|
1529
|
+
>
|
|
1530
|
+
${this.headers.map(o=>d`<div
|
|
1531
|
+
class="table_row"
|
|
1532
|
+
style="border-bottom:1px solid ${c.NEUTRAL_200};"
|
|
1533
|
+
>
|
|
1534
|
+
<div
|
|
1535
|
+
class="header"
|
|
1536
|
+
style="background-color:${c.SECTION_BG};"
|
|
1537
|
+
>
|
|
1538
|
+
<tuix-text
|
|
1539
|
+
size=${p.Body1}
|
|
1540
|
+
color=${N.PRIMARY}
|
|
1541
|
+
>${o.name}</tuix-text
|
|
1542
|
+
>
|
|
1543
|
+
</div>
|
|
1544
|
+
<div class="content">
|
|
1545
|
+
${o.isSlot?d`<slot
|
|
1546
|
+
name="${o.slotName}-${e.id}"
|
|
1547
|
+
></slot>`:d`<tuix-text size=${p.Body1}
|
|
1548
|
+
>${e[o.dataKey]}</tuix-text
|
|
1549
|
+
>`}
|
|
1550
|
+
</div>
|
|
1551
|
+
</div>`)}
|
|
1552
|
+
</div>`)}
|
|
1553
|
+
</div>
|
|
1554
|
+
${this.paginated?this._renderPagination():null}`}render(){return!this.disableMobileTable&&(this._isMobileView||this._isTabletView&&this.showMobileTableInTablet)?d`${this._renderCards()}`:d`${this._renderTable()}`}};$.styles=[Xe,We];S([a({type:Boolean})],$.prototype,"paginated",2);S([a({type:Boolean})],$.prototype,"disableMobileTable",2);S([a({type:Boolean})],$.prototype,"showMobileTableInTablet",2);S([a({type:Object})],$.prototype,"loader",2);S([a({type:Array})],$.prototype,"data",2);S([a({type:Array})],$.prototype,"headers",2);S([a({type:Array})],$.prototype,"pageSizeOptions",2);S([a({type:Number})],$.prototype,"totalItems",2);S([a({type:Number})],$.prototype,"currentPage",2);S([a({type:Number})],$.prototype,"currentSize",2);S([a({type:Boolean})],$.prototype,"isLoadingData",2);S([Y()],$.prototype,"_isTabletView",2);S([Y()],$.prototype,"_isMobileView",2);S([Y()],$.prototype,"_headerPercents",2);$=S([M("tuix-table")],$);function ni(){const t=document.createElement("link");t.rel="preconnect",t.href="https://fonts.googleapis.com";const e=document.createElement("link");e.rel="preconnect",e.href="https://fonts.gstatic.com";const o=document.createElement("link");o.rel="stylesheet",o.href="https://fonts.googleapis.com/css2?family=Rubik:ital,wght@0,300;0,400;0,500;0,600;0,700;0,800;0,900;1,300;1,400;1,500;1,600;1,700;1,800;1,900&display=swap",document.head.appendChild(t),document.head.appendChild(e),document.head.appendChild(o)}export{G as C,L as D,f as I,pt as L,w as a,ni as l};
|