tuix-webcomponents 0.72.0 → 0.73.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/assets/tuix-styles.css +0 -13
- package/dist/src/index.d.ts +8 -8
- package/dist/src/index.js +1 -0
- package/dist/src/index.js.map +1 -0
- package/dist/src/tuix-button/TuixBaseButton.d.ts +1 -1
- package/dist/src/tuix-button/TuixBaseButton.js +3 -1
- package/dist/src/tuix-button/TuixBaseButton.js.map +1 -0
- package/dist/src/tuix-button/TuixButton.d.ts +1 -1
- package/dist/src/tuix-button/TuixButton.js +24 -23
- package/dist/src/tuix-button/TuixButton.js.map +1 -0
- package/dist/src/tuix-button/TuixButton.styles.js +1 -0
- package/dist/src/tuix-button/TuixButton.styles.js.map +1 -0
- package/dist/src/tuix-button/enums/tuix-button.enums.js +1 -0
- package/dist/src/tuix-button/enums/tuix-button.enums.js.map +1 -0
- package/dist/src/tuix-button/interfaces/tuix-button.interface.js +1 -0
- package/dist/src/tuix-button/interfaces/tuix-button.interface.js.map +1 -0
- package/dist/src/tuix-checkbox/TuixCheckbox.d.ts +1 -1
- package/dist/src/tuix-checkbox/TuixCheckbox.js +7 -6
- package/dist/src/tuix-checkbox/TuixCheckbox.js.map +1 -0
- package/dist/src/tuix-checkbox/TuixCheckbox.styles.js +1 -0
- package/dist/src/tuix-checkbox/TuixCheckbox.styles.js.map +1 -0
- package/dist/src/tuix-checkbox/enums/tuix-checkbox.enums.js +1 -0
- package/dist/src/tuix-checkbox/enums/tuix-checkbox.enums.js.map +1 -0
- package/dist/src/tuix-checkbox/interfaces/tuix-checkbox.interface.d.ts +1 -1
- package/dist/src/tuix-checkbox/interfaces/tuix-checkbox.interface.js +1 -0
- package/dist/src/tuix-checkbox/interfaces/tuix-checkbox.interface.js.map +1 -0
- package/dist/src/tuix-dropdown/TuixDropdown.d.ts +2 -2
- package/dist/src/tuix-dropdown/TuixDropdown.js +30 -22
- package/dist/src/tuix-dropdown/TuixDropdown.js.map +1 -0
- package/dist/src/tuix-dropdown/TuixDropdown.styles.js +1 -0
- package/dist/src/tuix-dropdown/TuixDropdown.styles.js.map +1 -0
- package/dist/src/tuix-dropdown/enums/tuix-dropdown.enums.js +1 -0
- package/dist/src/tuix-dropdown/enums/tuix-dropdown.enums.js.map +1 -0
- package/dist/src/tuix-dropdown/interfaces/tuix-dropdown.interface.d.ts +2 -2
- package/dist/src/tuix-dropdown/interfaces/tuix-dropdown.interface.js +1 -0
- package/dist/src/tuix-dropdown/interfaces/tuix-dropdown.interface.js.map +1 -0
- package/dist/src/tuix-icon/TuixIcon.icons.d.ts +2 -2
- package/dist/src/tuix-icon/TuixIcon.icons.js +11 -1
- package/dist/src/tuix-icon/TuixIcon.icons.js.map +1 -0
- package/dist/src/tuix-icon/TuixIcon.js +16 -14
- package/dist/src/tuix-icon/TuixIcon.js.map +1 -0
- package/dist/src/tuix-icon/enums/tuix-icon.enums.d.ts +4 -1
- package/dist/src/tuix-icon/enums/tuix-icon.enums.js +4 -0
- package/dist/src/tuix-icon/enums/tuix-icon.enums.js.map +1 -0
- package/dist/src/tuix-icon-button/TuixIconButton.d.ts +1 -1
- package/dist/src/tuix-icon-button/TuixIconButton.js +15 -14
- package/dist/src/tuix-icon-button/TuixIconButton.js.map +1 -0
- package/dist/src/tuix-input/TuixInput.d.ts +1 -1
- package/dist/src/tuix-input/TuixInput.js +17 -13
- package/dist/src/tuix-input/TuixInput.js.map +1 -0
- package/dist/src/tuix-input/TuixInput.styles.js +1 -0
- package/dist/src/tuix-input/TuixInput.styles.js.map +1 -0
- package/dist/src/tuix-input/enums/tuix-input.enums.js +1 -0
- package/dist/src/tuix-input/enums/tuix-input.enums.js.map +1 -0
- package/dist/src/tuix-input/interfaces/tuix-input.interface.d.ts +6 -7
- package/dist/src/tuix-input/interfaces/tuix-input.interface.js +7 -5
- package/dist/src/tuix-input/interfaces/tuix-input.interface.js.map +1 -0
- package/dist/src/tuix-link/TuixLink.d.ts +1 -1
- package/dist/src/tuix-link/TuixLink.js +2 -1
- package/dist/src/tuix-link/TuixLink.js.map +1 -0
- package/dist/src/tuix-link/TuixLink.styles.js +1 -0
- package/dist/src/tuix-link/TuixLink.styles.js.map +1 -0
- package/dist/src/tuix-link/enums/linkTarget.enum.js +1 -0
- package/dist/src/tuix-link/enums/linkTarget.enum.js.map +1 -0
- package/dist/src/tuix-modal/TuixModal.js +2 -1
- package/dist/src/tuix-modal/TuixModal.js.map +1 -0
- package/dist/src/tuix-modal/TuixModal.styles.js +1 -0
- package/dist/src/tuix-modal/TuixModal.styles.js.map +1 -0
- package/dist/src/tuix-paper/TuixPaper.d.ts +1 -1
- package/dist/src/tuix-paper/TuixPaper.js +2 -1
- package/dist/src/tuix-paper/TuixPaper.js.map +1 -0
- package/dist/src/tuix-paper/TuixPaper.styles.js +1 -0
- package/dist/src/tuix-paper/TuixPaper.styles.js.map +1 -0
- package/dist/src/tuix-paper/enums/tuix-paper.enum.js +1 -0
- package/dist/src/tuix-paper/enums/tuix-paper.enum.js.map +1 -0
- package/dist/src/tuix-radio-button/TuixRadioButton.d.ts +1 -1
- package/dist/src/tuix-radio-button/TuixRadioButton.js +8 -7
- package/dist/src/tuix-radio-button/TuixRadioButton.js.map +1 -0
- package/dist/src/tuix-radio-button/TuixRadioButton.styles.js +1 -0
- package/dist/src/tuix-radio-button/TuixRadioButton.styles.js.map +1 -0
- package/dist/src/tuix-radio-button/interfaces/tuix-radio-button.interface.d.ts +1 -1
- package/dist/src/tuix-radio-button/interfaces/tuix-radio-button.interface.js +1 -0
- package/dist/src/tuix-radio-button/interfaces/tuix-radio-button.interface.js.map +1 -0
- package/dist/src/tuix-table/TuixTable.js +14 -8
- package/dist/src/tuix-table/TuixTable.js.map +1 -0
- package/dist/src/tuix-table/TuixTable.styles.js +1 -0
- package/dist/src/tuix-table/TuixTable.styles.js.map +1 -0
- package/dist/src/tuix-table/interfaces/tuix-table.interface.js +1 -0
- package/dist/src/tuix-table/interfaces/tuix-table.interface.js.map +1 -0
- package/dist/src/tuix-text/TuixText.js +13 -12
- package/dist/src/tuix-text/TuixText.js.map +1 -0
- package/dist/src/tuix-text/TuixText.styles.js +1 -0
- package/dist/src/tuix-text/TuixText.styles.js.map +1 -0
- package/dist/src/tuix-text/enums/tuix-text.enums.js +1 -0
- package/dist/src/tuix-text/enums/tuix-text.enums.js.map +1 -0
- package/dist/src/tuix-toast/TuixToast.d.ts +2 -2
- package/dist/src/tuix-toast/TuixToast.js +2 -1
- package/dist/src/tuix-toast/TuixToast.js.map +1 -0
- package/dist/src/tuix-toast/TuixToast.styles.js +1 -0
- package/dist/src/tuix-toast/TuixToast.styles.js.map +1 -0
- package/dist/src/tuix-toast/enums/tuix-toast.enums.js +1 -0
- package/dist/src/tuix-toast/enums/tuix-toast.enums.js.map +1 -0
- package/dist/src/tuix-toggle-button/TuixToggleButton.js +8 -7
- package/dist/src/tuix-toggle-button/TuixToggleButton.js.map +1 -0
- package/dist/src/tuix-toggle-button/TuixToggleButton.styles.js +1 -0
- package/dist/src/tuix-toggle-button/TuixToggleButton.styles.js.map +1 -0
- package/dist/src/tuix-toggle-button/interfaces/tuix-toggle.interface.d.ts +1 -1
- package/dist/src/tuix-toggle-button/interfaces/tuix-toggle.interface.js +1 -0
- package/dist/src/tuix-toggle-button/interfaces/tuix-toggle.interface.js.map +1 -0
- package/dist/src/utils/colors.js +1 -0
- package/dist/src/utils/colors.js.map +1 -0
- package/dist/src/utils/darkColors.js +1 -0
- package/dist/src/utils/darkColors.js.map +1 -0
- package/dist/src/utils/hex-rgb.js +1 -0
- package/dist/src/utils/hex-rgb.js.map +1 -0
- package/dist/src/utils/interfaces/detail-value.interface.js +1 -0
- package/dist/src/utils/interfaces/detail-value.interface.js.map +1 -0
- package/dist/src/utils/mainVariant.enum.js +1 -0
- package/dist/src/utils/mainVariant.enum.js.map +1 -0
- package/dist/src/utils/screenSizes.enum.js +1 -0
- package/dist/src/utils/screenSizes.enum.js.map +1 -0
- package/dist/src/utils/slottedClassName.js +1 -0
- package/dist/src/utils/slottedClassName.js.map +1 -0
- package/dist/tsconfig.publish.tsbuildinfo +1 -1
- package/package.json +52 -77
package/README.md
CHANGED
|
@@ -12,8 +12,8 @@ npm i tuix-webcomponents
|
|
|
12
12
|
|
|
13
13
|
### Webbundle version
|
|
14
14
|
|
|
15
|
-
Webbundle Link: https://tuix-webcomponents.s3.eu-central-1.amazonaws.com/build-
|
|
16
|
-
Styles Link: https://tuix-webcomponents.s3.eu-central-1.amazonaws.com/build-
|
|
15
|
+
Webbundle Link: https://tuix-webcomponents.s3.eu-central-1.amazonaws.com/build-c1c2572@0.73.0.js
|
|
16
|
+
Styles Link: https://tuix-webcomponents.s3.eu-central-1.amazonaws.com/build-c1c2572@0.73.0.css
|
|
17
17
|
|
|
18
18
|
### React .tsx with SSR
|
|
19
19
|
|
|
@@ -27,32 +27,20 @@
|
|
|
27
27
|
--tuix-light-color-section-bg: #FAFAFA;
|
|
28
28
|
--tuix-light-color-shadow: rgba(66, 79, 101, 0.16);
|
|
29
29
|
--tuix-dark-color-primary-50: #F5F5FA;
|
|
30
|
-
--tuix-dark-color-#f5f5fa: PRIMARY_50;
|
|
31
30
|
--tuix-dark-color-primary-100: #EBEAF4;
|
|
32
|
-
--tuix-dark-color-#ebeaf4: PRIMARY_100;
|
|
33
31
|
--tuix-dark-color-primary-200: #D1D1E6;
|
|
34
|
-
--tuix-dark-color-#d1d1e6: PRIMARY_200;
|
|
35
32
|
--tuix-dark-color-primary-300: #A8A9D1;
|
|
36
|
-
--tuix-dark-color-#a8a9d1: PRIMARY_300;
|
|
37
33
|
--tuix-dark-color-main: #7A7CB6;
|
|
38
34
|
--tuix-dark-color-dark-main: #33355B;
|
|
39
|
-
--tuix-dark-color-#33355b: DARK_MAIN;
|
|
40
35
|
--tuix-dark-color-primary-600: #454584;
|
|
41
|
-
--tuix-dark-color-#454584: PRIMARY_600;
|
|
42
36
|
--tuix-dark-color-primary-700: #3A396B;
|
|
43
|
-
--tuix-dark-color-#3a396b: PRIMARY_700;
|
|
44
37
|
--tuix-dark-color-primary-800: #32325A;
|
|
45
|
-
--tuix-dark-color-#32325a: PRIMARY_800;
|
|
46
38
|
--tuix-dark-color-primary-900: #2E2D4D;
|
|
47
|
-
--tuix-dark-color-#2e2d4d: PRIMARY_900;
|
|
48
39
|
--tuix-dark-color-primary-950: #1F1E33;
|
|
49
|
-
--tuix-dark-color-#1f1e33: PRIMARY_950;
|
|
50
40
|
--tuix-dark-color-secondary: #BBADFF;
|
|
51
|
-
--tuix-dark-color-#bbadff: SECONDARY;
|
|
52
41
|
--tuix-dark-color-white: rgba(255, 255, 255, 0.87);
|
|
53
42
|
--tuix-dark-color-black: #121212;
|
|
54
43
|
--tuix-dark-color-neutral-200: #C9C8D3;
|
|
55
|
-
--tuix-dark-color-#c9c8d3: NEUTRAL_200;
|
|
56
44
|
--tuix-dark-color-neutral-600: rgba(255, 255, 255, 0.60);
|
|
57
45
|
--tuix-dark-color-success: #82C5A9;
|
|
58
46
|
--tuix-dark-color-success-50: rgba(241, 249, 245, 0.30);
|
|
@@ -62,7 +50,6 @@
|
|
|
62
50
|
--tuix-dark-color-error: #FF8486;
|
|
63
51
|
--tuix-dark-color-error-50: rgba(255, 132, 134, 0.20);
|
|
64
52
|
--tuix-dark-color-error-200: #FFD8D8;
|
|
65
|
-
--tuix-dark-color-#ffd8d8: ERROR_200;
|
|
66
53
|
--tuix-dark-color-section-bg: #0E0E0E;
|
|
67
54
|
--tuix-dark-color-elevation-1: #17171A;
|
|
68
55
|
--tuix-dark-color-elevation-2: #1A1A1F;
|
package/dist/src/index.d.ts
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
export {
|
|
2
|
-
export
|
|
3
|
-
export
|
|
4
|
-
export
|
|
5
|
-
export
|
|
6
|
-
export
|
|
7
|
-
export
|
|
1
|
+
export { CustomEventTuixButton } from './tuix-button/interfaces/tuix-button.interface.js';
|
|
2
|
+
export { CustomEventTuixCheckbox, DetailValueCheckbox, } from './tuix-checkbox/interfaces/tuix-checkbox.interface.js';
|
|
3
|
+
export { CustomEventTuixDropdownInput, CustomEventTuixDropdownSelect, TuixDropdownOption, TuixDropdownObjectOption, TuixDropdownPlainOption, } from './tuix-dropdown/interfaces/tuix-dropdown.interface.js';
|
|
4
|
+
export { CustomEventTuixInput } from './tuix-input/interfaces/tuix-input.interface.js';
|
|
5
|
+
export { CustomEventTuixRadioButton } from './tuix-radio-button/interfaces/tuix-radio-button.interface.js';
|
|
6
|
+
export { CustomEventTuixToggle } from './tuix-toggle-button/interfaces/tuix-toggle.interface.js';
|
|
7
|
+
export { DetailValue } from './utils/interfaces/detail-value.interface.js';
|
|
8
8
|
export { TuixText } from './tuix-text/TuixText.js';
|
|
9
9
|
export { TuixIcon } from './tuix-icon/TuixIcon.js';
|
|
10
10
|
export { TuixButton } from './tuix-button/TuixButton.js';
|
|
@@ -17,7 +17,7 @@ export { TuixCheckbox } from './tuix-checkbox/TuixCheckbox.js';
|
|
|
17
17
|
export { TuixRadioButton } from './tuix-radio-button/TuixRadioButton.js';
|
|
18
18
|
export { TuixToggleButton } from './tuix-toggle-button/TuixToggleButton.js';
|
|
19
19
|
export { TuixTable } from './tuix-table/TuixTable.js';
|
|
20
|
-
export
|
|
20
|
+
export { IDataTableHeader, TuixTableElement, } from './tuix-table/interfaces/tuix-table.interface.js';
|
|
21
21
|
export { TuixToast } from './tuix-toast/TuixToast.js';
|
|
22
22
|
export { TuixModal } from './tuix-modal/TuixModal.js';
|
|
23
23
|
export { ToastType } from './tuix-toast/enums/tuix-toast.enums.js';
|
package/dist/src/index.js
CHANGED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAgBA,OAAO,EAAE,QAAQ,EAAE,MAAM,yBAAyB,CAAC;AACnD,OAAO,EAAE,QAAQ,EAAE,MAAM,yBAAyB,CAAC;AACnD,OAAO,EAAE,UAA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AuC,CAAC;AAC1E,OAAO,EAAE,WAAW,EAAE,MAAM,6BAA6B,CAAC;AAE1D,MAAM,UAAU,SAAS;IACvB,MAAM,KAAK,GAAG,QAAQ,CAAC,aAAa,CAAC,MAAM,CAAC,CAAC;IAC7C,KAAK,CAAC,GAAG,GAAG,YAAY,CAAC;IACzB,KAAK,CAAC,IAAI,GAAG,8BAA8B,CAAC;IAC5C,MAAM,KAAK,GAAG,QAAQ,CAAC,aAAa,CAAC,MAAM,CAAC,CAAC;IAC7C,KAAK,CAAC,GAAG,GAAG,YAAY,CAAC;IACzB,KAAK,CAAC,IAAI,GAAG,2BAA2B,CAAC;IACzC,MAAM,KAAK,GAAG,QAAQ,CAAC,aAAa,CAAC,MAAM,CAAC,CAAC;IAC7C,KAAK,CAAC,GAAG,GAAG,YAAY,CAAC;IACzB,KAAK,CAAC,IAAI;QACR,2JAA2J,CAAC;IAC9J,QAAQ,CAAC,IAAI,CAAC,WAAW,CAAC,KAAK,CAAC,CAAC;IACjC,QAAQ,CAAC,IAAI,CAAC,WAAW,CAAC,KAAK,CAAC,CAAC;IACjC,QAAQ,CAAC,IAAI,CAAC,WAAW,CAAC,KAAK,CAAC,CAAC;AACnC,CAAC","sourcesContent":["export { CustomEventTuixButton } from './tuix-button/interfaces/tuix-button.interface.js';\nexport {\n CustomEventTuixCheckbox,\n DetailValueCheckbox,\n} from './tuix-checkbox/interfaces/tuix-checkbox.interface.js';\nexport {\n CustomEventTuixDropdownInput,\n CustomEventTuixDropdownSelect,\n TuixDropdownOption,\n TuixDropdownObjectOption,\n TuixDropdownPlainOption,\n} from './tuix-dropdown/interfaces/tuix-dropdown.interface.js';\nexport { CustomEventTuixInput } from './tuix-input/interfaces/tuix-input.interface.js';\nexport { CustomEventTuixRadioButton } from './tuix-radio-button/interfaces/tuix-radio-button.interface.js';\nexport { CustomEventTuixToggle } from './tuix-toggle-button/interfaces/tuix-toggle.interface.js';\nexport { DetailValue } from './utils/interfaces/detail-value.interface.js';\nexport { TuixText } from './tuix-text/TuixText.js';\nexport { TuixIcon } from './tuix-icon/TuixIcon.js';\nexport { TuixButton } from './tuix-button/TuixButton.js';\nexport { TuixPaper } from './tuix-paper/TuixPaper.js';\nexport { TuixIconButton } from './tuix-icon-button/TuixIconButton.js';\nexport { TuixLink } from './tuix-link/TuixLink.js';\nexport { TuixInput } from './tuix-input/TuixInput.js';\nexport { TuixDropdown } from './tuix-dropdown/TuixDropdown.js';\nexport { TuixCheckbox } from './tuix-checkbox/TuixCheckbox.js';\nexport { TuixRadioButton } from './tuix-radio-button/TuixRadioButton.js';\nexport { TuixToggleButton } from './tuix-toggle-button/TuixToggleButton.js';\nexport { TuixTable } from './tuix-table/TuixTable.js';\nexport {\n IDataTableHeader,\n TuixTableElement,\n} from './tuix-table/interfaces/tuix-table.interface.js';\nexport { TuixToast } from './tuix-toast/TuixToast.js';\nexport { TuixModal } from './tuix-modal/TuixModal.js';\nexport { ToastType } from './tuix-toast/enums/tuix-toast.enums.js';\nexport { TextSize, TextVariant } from './tuix-text/enums/tuix-text.enums.js';\nexport { MainVariant } from './utils/mainVariant.enum.js';\nexport { CheckboxLabelSide } from './tuix-checkbox/enums/tuix-checkbox.enums.js';\nexport { PaperElevation } from './tuix-paper/enums/tuix-paper.enum.js';\nexport { LinkTarget } from './tuix-link/enums/linkTarget.enum.js';\nexport {\n IconName,\n IconSizeVariant,\n} from './tuix-icon/enums/tuix-icon.enums.js';\nexport {\n DescriptionType,\n InputType,\n} from './tuix-input/enums/tuix-input.enums.js';\nexport { Palette } from './utils/colors.js';\nexport { DarkPalette } from './utils/darkColors.js';\nexport { DropdownType } from './tuix-dropdown/enums/tuix-dropdown.enums.js';\nexport { BorderRadiusPaper } from './tuix-paper/enums/tuix-paper.enum.js';\nexport { ScreenSizes } from './utils/screenSizes.enum.js';\n\nexport function loadFonts() {\n const link1 = document.createElement('link');\n link1.rel = 'preconnect';\n link1.href = 'https://fonts.googleapis.com';\n const link2 = document.createElement('link');\n link2.rel = 'preconnect';\n link2.href = 'https://fonts.gstatic.com';\n const link3 = document.createElement('link');\n link3.rel = 'stylesheet';\n link3.href =\n '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';\n document.head.appendChild(link1);\n document.head.appendChild(link2);\n document.head.appendChild(link3);\n}\n"]}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { LitElement,
|
|
1
|
+
import { LitElement, TemplateResult } from 'lit';
|
|
2
2
|
import { MainVariant } from '../utils/mainVariant.enum.js';
|
|
3
3
|
import { IconName, IconSizeVariant } from '../tuix-icon/enums/tuix-icon.enums.js';
|
|
4
4
|
import '../tuix-icon/TuixIcon.js';
|
|
@@ -16,7 +16,8 @@ export class TuixBaseButton extends LitElement {
|
|
|
16
16
|
this._updateIconColor();
|
|
17
17
|
}
|
|
18
18
|
_getTextColor() {
|
|
19
|
-
|
|
19
|
+
var _a;
|
|
20
|
+
const element = (_a = this.shadowRoot) === null || _a === void 0 ? void 0 : _a.querySelector('.button');
|
|
20
21
|
if (!element)
|
|
21
22
|
return buttonTextColor[this.variant];
|
|
22
23
|
const computedStyle = getComputedStyle(element);
|
|
@@ -58,3 +59,4 @@ __decorate([
|
|
|
58
59
|
__decorate([
|
|
59
60
|
state()
|
|
60
61
|
], TuixBaseButton.prototype, "iconColor", void 0);
|
|
62
|
+
//# sourceMappingURL=TuixBaseButton.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TuixBaseButton.js","sourceRoot":"","sources":["../../../src/tuix-button/TuixBaseButton.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,UAAU,EAAkB,IAAI,EAAE,MAAM,KAAK,CAAC;AACvD,OAAO,EAAE,WAAW,EAAE,MAAM,2BAA2B,CAAC;AACxD,OAAO,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAC;AACpD,OAAO,EAAE,eA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;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;gDAC1B;AAGjB;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;4CAC9B;AAGH;IADT,KAAK,EAAE;iDACiB","sourcesContent":["import { LitElement, TemplateResult, html } from 'lit';\nimport { MainVariant } from '../utils/mainVariant.enum';\nimport { property, state } from 'lit/decorators.js';\nimport { buttonTextColor } from './enums/tuix-button.enums';\nimport { IconName, IconSizeVariant } from '../tuix-icon/enums/tuix-icon.enums';\nimport '../tuix-icon/TuixIcon.js';\n\nexport abstract class TuixBaseButton extends LitElement {\n @property({ type: MainVariant, reflect: true })\n variant = MainVariant.PRIMARY;\n\n @property({ type: Boolean, reflect: true })\n disabled = false;\n\n @property({ type: Boolean, reflect: true })\n dark = false;\n\n @state()\n protected iconColor = '';\n\n updated() {\n this._updateIconColor();\n }\n\n protected _getTextColor() {\n const element = this.shadowRoot?.querySelector('.button');\n if (!element) return buttonTextColor[this.variant];\n const computedStyle = getComputedStyle(element);\n return computedStyle.color;\n }\n\n protected abstract _updateIconColor(): void;\n\n protected _handleClick() {\n this.dispatchEvent(new CustomEvent('customClick', { bubbles: true }));\n }\n\n protected _iconTemplate(\n iconName: IconName,\n iconSize: IconSizeVariant\n ): TemplateResult {\n this._updateIconColor();\n return html`<tuix-icon\n size=\"${iconSize}\"\n name=\"${iconName}\"\n color=\"${this.iconColor}\"\n ></tuix-icon>`;\n }\n\n protected abstract _buttonContent(): TemplateResult;\n\n protected render(): TemplateResult {\n return html`<button\n @click=${this._handleClick}\n @mouseenter=${this._updateIconColor}\n @mouseleave=${this._updateIconColor}\n @blur=${this._updateIconColor}\n ?disabled=\"${this.disabled}\"\n class=\"button\"\n >\n ${this._buttonContent()}\n </button>`;\n }\n}\n"]}
|
|
@@ -10,8 +10,25 @@ let TuixButton = class TuixButton extends TuixBaseButton {
|
|
|
10
10
|
super(...arguments);
|
|
11
11
|
this.full = false;
|
|
12
12
|
}
|
|
13
|
-
|
|
14
|
-
|
|
13
|
+
_updateIconColor() {
|
|
14
|
+
if (!this.iconLeft && !this.iconRight)
|
|
15
|
+
return;
|
|
16
|
+
this.iconColor = this._getTextColor();
|
|
17
|
+
}
|
|
18
|
+
_buttonContent() {
|
|
19
|
+
let iconSize = IconSizeVariant.MEDIUM;
|
|
20
|
+
if (screen.width <= ScreenSizes.TABLET) {
|
|
21
|
+
iconSize = IconSizeVariant.SMALL;
|
|
22
|
+
}
|
|
23
|
+
return html ` <div class="container">
|
|
24
|
+
${this.iconLeft ? this._iconTemplate(this.iconLeft, iconSize) : nothing}
|
|
25
|
+
<slot></slot>
|
|
26
|
+
${this.iconRight ? this._iconTemplate(this.iconRight, iconSize) : nothing}
|
|
27
|
+
</div>`;
|
|
28
|
+
}
|
|
29
|
+
};
|
|
30
|
+
TuixButton.styles = [
|
|
31
|
+
css `
|
|
15
32
|
:host([full]) .button {
|
|
16
33
|
width: 100%;
|
|
17
34
|
}
|
|
@@ -48,27 +65,10 @@ let TuixButton = class TuixButton extends TuixBaseButton {
|
|
|
48
65
|
}
|
|
49
66
|
}
|
|
50
67
|
`,
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
_updateIconColor() {
|
|
56
|
-
if (!this.iconLeft && !this.iconRight)
|
|
57
|
-
return;
|
|
58
|
-
this.iconColor = this._getTextColor();
|
|
59
|
-
}
|
|
60
|
-
_buttonContent() {
|
|
61
|
-
let iconSize = IconSizeVariant.MEDIUM;
|
|
62
|
-
if (screen.width <= ScreenSizes.TABLET) {
|
|
63
|
-
iconSize = IconSizeVariant.SMALL;
|
|
64
|
-
}
|
|
65
|
-
return html ` <div class="container">
|
|
66
|
-
${this.iconLeft ? this._iconTemplate(this.iconLeft, iconSize) : nothing}
|
|
67
|
-
<slot></slot>
|
|
68
|
-
${this.iconRight ? this._iconTemplate(this.iconRight, iconSize) : nothing}
|
|
69
|
-
</div>`;
|
|
70
|
-
}
|
|
71
|
-
};
|
|
68
|
+
hostButtonStyles,
|
|
69
|
+
buttonColorStyles,
|
|
70
|
+
buttonSizeStyles,
|
|
71
|
+
];
|
|
72
72
|
__decorate([
|
|
73
73
|
property({ type: Boolean, reflect: true })
|
|
74
74
|
], TuixButton.prototype, "full", void 0);
|
|
@@ -82,3 +82,4 @@ TuixButton = __decorate([
|
|
|
82
82
|
customElement('tuix-button')
|
|
83
83
|
], TuixButton);
|
|
84
84
|
export { TuixButton };
|
|
85
|
+
//# sourceMappingURL=TuixButton.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TuixButton.js","sourceRoot":"","sources":["../../../src/tuix-button/TuixButton.ts"],"names":[],"mappings":";AAAA,OAAO,EAAkB,GAAG,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,KAAK,CAAC;AACzD,OAAO,EAAE,QAAQ,EAAE,eAAe,EAAE,MAAM,oCAAoC,CAAC;AAC/E,OAAO,EACL,gBAAgB,EAChB,iBAAiB,EACjB,gBAAgB,GACjB,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAC5D,OAAO,EAAE,WAAW,EAAE,MAAM,2BAA2B,CAAC;AACxD,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAGlD,IAAa,UAAU,GAAvB,MAAa,UAAW,SAAQ,cAAc;IAA9C;;QA6CE,SAAI,GAAG,KAAK,CAAC;IAyBf,CAAC;IAjBoB,gBAAgB;QACjC,IAAI,CAAC,IAAI,CAAC,QAAQ,IAAI,CAAC,IAAI,CAAC,SAAS;YAAE,OAAO;QAC9C,IAAI,CAAC,SAAS,GAAG,IAAI,CAAC,aAAa,EAAE,CAAC;IACxC,CAAC;IAEkB,cAAc;QAC/B,IAAI,QAAQ,GAAG,eAAe,CAAC,MAAM,CAAC;QAEtC,IAAI,MAAM,CAAC,KAAK,IAAI,WAAW,CAAC,MAAM,EAAE;YACtC,QAAQ,GAAG,eAAe,CAAC,KAAK,CAAC;SAClC;QACD,OAAO,IAAI,CAAA;QACP,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC,IAAI,CAAC,aAAa,CAAC,IAAI,CAAC,QAAQ,EAAE,QAAQ,CAAC,CAAC,CAAC,CAAC,OAAO;;QAErE,IAAI,CAAC,SAAS,CAAC,CAAC,CAAC,IAAI,CAAC,aAAa,CAAC,IAAI,CAAC,SAAS,EAAE,QAAQ,CAAC,CAAC,CAAC,CAAC,OAAO;WACpE,CAAC;IACV,CAAC;;AApEM,iBAAM,GAAG;IACd,GAAG,CAAA;;;;;;;;;;;2CAWoC,WAAW,CAAC,MAAM;;;;;;2CAMlB,WAAW,CAAC,MAAM;;;;;;;;;;;;;;2CAclB,WAAW,CAAC,MAAM;;;;;KAKxD;IACD,gBAAgB;IAChB,iBAAiB;IACjB,gBAAgB;CACjB,AAzCY,CAyCX;AAGF;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;wCAC9B;AAGb;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,QAAQ,EAAE,CAAC;6CACR;AAGrB;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,QAAQ,EAAE,CAAC;4CACT;AAnDT,UAAU;IADtB,aAAa,CAAC,aAAa,CAAC;GAChB,UAAU,CAsEtB;SAtEY,UAAU","sourcesContent":["import { TemplateResult, css, html, nothing } from 'lit';\nimport { IconName, IconSizeVariant } from '../tuix-icon/enums/tuix-icon.enums';\nimport {\n buttonSizeStyles,\n buttonColorStyles,\n hostButtonStyles,\n} from './TuixButton.styles';\nimport { customElement, property } from 'lit/decorators.js';\nimport { ScreenSizes } from '../utils/screenSizes.enum';\nimport { TuixBaseButton } from './TuixBaseButton';\n\n@customElement('tuix-button')\nexport class TuixButton extends TuixBaseButton {\n static styles = [\n css`\n :host([full]) .button {\n width: 100%;\n }\n .button {\n padding: 16px 32px;\n border-radius: 4px;\n border: none;\n font-family: 'Rubik', sans-serif;\n }\n\n @media only screen and (max-width: ${ScreenSizes.TABLET}px) {\n .button {\n padding: 14px 32px;\n }\n }\n\n @media only screen and (max-width: ${ScreenSizes.MOBILE}px) {\n .button {\n padding: 12px 24px;\n }\n }\n\n .container {\n display: flex;\n flex-direction: row;\n justify-content: center;\n align-items: center;\n gap: 8px;\n }\n\n @media only screen and (max-width: ${ScreenSizes.MOBILE}px) {\n .container {\n gap: 6px;\n }\n }\n `,\n hostButtonStyles,\n buttonColorStyles,\n buttonSizeStyles,\n ];\n\n @property({ type: Boolean, reflect: true })\n full = false;\n\n @property({ type: IconName })\n iconRight?: IconName;\n\n @property({ type: IconName })\n iconLeft?: IconName;\n\n protected override _updateIconColor() {\n if (!this.iconLeft && !this.iconRight) return;\n this.iconColor = this._getTextColor();\n }\n\n protected override _buttonContent(): TemplateResult {\n let iconSize = IconSizeVariant.MEDIUM;\n\n if (screen.width <= ScreenSizes.TABLET) {\n iconSize = IconSizeVariant.SMALL;\n }\n return html` <div class=\"container\">\n ${this.iconLeft ? this._iconTemplate(this.iconLeft, iconSize) : nothing}\n <slot></slot>\n ${this.iconRight ? this._iconTemplate(this.iconRight, iconSize) : nothing}\n </div>`;\n }\n}\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TuixButton.styles.js","sourceRoot":"","sources":["../../../src/tuix-button/TuixButton.styles.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,SAAS,EAAE,MAAM,KAAK,CAAC;AACrC,OAAO,EAAE,OAAO,EAAE,MAAM,iBAAiB,CAAC;AAC1C,OAAO,EAAE,WAAW,EAAE,MAAM,2BAA2B,CAAC;AACxD,OAAO,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAClD,OAAO,EAAE,WAAW,EAAE,MAAM,2BAA2B,CAAC;AACxD,OAAO,gBAAgB,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CAAC,MAAM;MACnD,gBAAgB,CAAC,QAAQ,CAAC,MAAM,CAAC;;;;;;CAMtC,CAAC;CACD,CAAC;AAEF,MAAM,CAAC,MAAM,iBAAiB,GAAG,GAAG,CAAA;oBAChB,SAAS,CAAC,WAAW,CAAC,OAAO,CAAC;;;;;oBAK9B,SAAS,CAAC,WAAW,CAAC,OAAO,CAAC;;;;oBAI9B,SAAS,CAAC,WAAW,CAAC,OAAO,CAAC;;;;oBAI9B,SAAS,CAAC,WAAW,CAAC,OAAO,CAAC;;;;;oBAK9B,SAAS,CAAC,WAAW,CAAC,SAAS,CAAC;;;;;oBAKhC,SAAS,CAAC,WAAW,CAAC,SAAS,CAAC;;;;;;oBAMhC,SAAS,CAAC,WAAW,CAAC,SAAS,CAAC;;;;;oBAKhC,SAAS,CAAC,WAAW,CAAC,SAAS,CAAC;;;;;oBAKhC,SAAS,CAAC,WAAW,CAAC,SAAS,CAAC;;;;oBAIhC,SAAS,CAAC,WAAW,CAAC,SAAS,CAAC;oBAChC,SAAS,CAAC,WAAW,CAAC,OAAO,CAAC;;;;;CAKjD,CAAC","sourcesContent":["import { css, unsafeCSS } from 'lit';\nimport { Palette } from '../utils/colors';\nimport { ScreenSizes } from '../utils/screenSizes.enum';\nimport { DarkPalette } from '../utils/darkColors';\nimport { MainVariant } from '../utils/mainVariant.enum';\nimport slottedClassName from '../utils/slottedClassName';\nimport { TextSize } from '../tuix-text/enums/tuix-text.enums';\n\nexport const hostButtonStyles = css`\n :host {\n --t-button-primary-color: ${unsafeCSS(Palette.MAIN)};\n --t-button-secondary-color: ${unsafeCSS(Palette.WHITE)};\n --t-button-accent-color: ${unsafeCSS(Palette.SECONDARY)};\n --t-button-text-color: ${unsafeCSS(Palette.WHITE)};\n --t-button-text-secondary-color: ${unsafeCSS(Palette.MAIN)};\n --t-button-text-muted-color: ${unsafeCSS(Palette.PRIMARY_300)};\n --t-button-disabled-bg-color: ${unsafeCSS(Palette.PRIMARY_100)};\n --t-button-hover-primary-color: ${unsafeCSS(Palette.PRIMARY_600)};\n --t-button-active-primary-color: ${unsafeCSS(Palette.PRIMARY_800)};\n --t-button-hover-secondary-color: ${unsafeCSS(Palette.PRIMARY_100)};\n --t-button-active-secondary-color: ${unsafeCSS(Palette.PRIMARY_200)};\n }\n :host([dark]) {\n --t-button-primary-color: ${unsafeCSS(DarkPalette.MAIN)};\n --t-button-text-color: ${unsafeCSS(DarkPalette.WHITE)};\n --t-button-text-muted-color: ${unsafeCSS(Palette.PRIMARY_800)};\n --t-button-disabled-bg-color: ${unsafeCSS(Palette.PRIMARY_950)};\n --t-button-hover-primary-color: ${unsafeCSS(Palette.MAIN)};\n --t-button-active-primary-color: ${unsafeCSS(Palette.PRIMARY_600)};\n --t-button-secondary-color: ${unsafeCSS(Palette.BLACK)};\n --t-button-hover-secondary-color: ${unsafeCSS(Palette.PRIMARY_950)};\n --t-button-active-secondary-color: ${unsafeCSS(Palette.PRIMARY_800)};\n }\n`;\n\nexport const buttonSizeStyles = css`\n ${unsafeCSS(`\n ${slottedClassName(TextSize.Button)} {\n font-size: 1rem;\n font-weight: 400;\n line-height: 1.2rem;\n }\n @media only screen and (max-width: ${ScreenSizes.TABLET}px) {\n ${slottedClassName(TextSize.Button)} {\n font-size: 0.888rem;\n font-weight: 400;\n line-height: 1.065rem;\n }\n }\n @media only screen and (max-width: ${ScreenSizes.MOBILE}px) {\n ${slottedClassName(TextSize.Button)} {\n font-size: 0.875rem;\n font-weight: 400;\n line-height: 1rem;\n }\n }\n`)}\n`;\n\nexport const buttonColorStyles = css`\n :host([variant='${unsafeCSS(MainVariant.PRIMARY)}']) .button {\n background-color: var(--t-button-primary-color);\n outline: none;\n color: var(--t-button-text-color);\n }\n :host([variant='${unsafeCSS(MainVariant.PRIMARY)}']) .button:hover {\n background-color: var(--t-button-hover-primary-color);\n cursor: pointer;\n }\n :host([variant='${unsafeCSS(MainVariant.PRIMARY)}']) .button:focus {\n background-color: var(--t-button-hover-primary-color);\n outline: 2px solid var(--t-button-accent-color);\n }\n :host([variant='${unsafeCSS(MainVariant.PRIMARY)}']) .button:active {\n background-color: var(--t-button-active-primary-color);\n outline: none;\n }\n\n :host([variant='${unsafeCSS(MainVariant.SECONDARY)}']) .button {\n background-color: var(--t-button-secondary-color);\n outline: 1px solid var(--t-button-hover-primary-color);\n color: var(--t-button-text-secondary-color);\n }\n :host([variant='${unsafeCSS(MainVariant.SECONDARY)}']) .button:hover {\n background-color: var(--t-button-hover-secondary-color);\n outline: 1px solid var(--t-button-primary-color);\n color: var(--t-button-primary-color);\n cursor: pointer;\n }\n :host([variant='${unsafeCSS(MainVariant.SECONDARY)}']) .button:focus {\n background-color: var(--t-button-hover-secondary-color);\n outline: 2px solid var(--t-button-accent-color);\n color: var(--t-button-primary-color);\n }\n :host([variant='${unsafeCSS(MainVariant.SECONDARY)}']) .button:active {\n background-color: var(--t-button-active-secondary-color);\n outline: 1px solid var(--t-button-primary-color);\n color: var(--t-button-primary-color);\n }\n :host([variant='${unsafeCSS(MainVariant.SECONDARY)}']) .button:disabled {\n outline: 1px solid var(--t-button-text-muted-color);\n }\n\n :host([variant='${unsafeCSS(MainVariant.SECONDARY)}'][disabled]) .button,\n :host([variant='${unsafeCSS(MainVariant.PRIMARY)}'][disabled]) .button {\n background-color: var(--t-button-disabled-bg-color);\n color: var(--t-button-text-muted-color);\n cursor: not-allowed;\n }\n`;\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tuix-button.enums.js","sourceRoot":"","sources":["../../../../src/tuix-button/enums/tuix-button.enums.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,oBAAoB,CAAC;AAC7C,OAAO,EAAE,WAAW,EAAE,MAAM,8BAA8B,CAAC;AAE3D,MAAM,CAAC,MAAM,eAAe,GAAgC;IAC1D,CAAC,WAAW,CAAC,OAAO,CAAC,EAAE,OAAO,CAAC,KAAK;IACpC,CAAC,WAAW,CAAC,SAAS,CAAC,EAAE,OAAO,CAAC,IAAI;CACtC,CAAC","sourcesContent":["import { Palette } from '../../utils/colors';\nimport { MainVariant } from '../../utils/mainVariant.enum';\n\nexport const buttonTextColor: Record<MainVariant, string> = {\n [MainVariant.PRIMARY]: Palette.WHITE,\n [MainVariant.SECONDARY]: Palette.MAIN,\n};\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tuix-button.interface.js","sourceRoot":"","sources":["../../../../src/tuix-button/interfaces/tuix-button.interface.ts"],"names":[],"mappings":"","sourcesContent":["export type CustomEventTuixButton = CustomEvent<undefined>;\n"]}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { LitElement,
|
|
1
|
+
import { LitElement, TemplateResult } from 'lit';
|
|
2
2
|
import { CheckboxLabelSide } from './enums/tuix-checkbox.enums.js';
|
|
3
3
|
export declare class TuixCheckbox extends LitElement {
|
|
4
4
|
static styles: import("lit").CSSResult[];
|
|
@@ -16,12 +16,6 @@ let TuixCheckbox = class TuixCheckbox extends LitElement {
|
|
|
16
16
|
this.label = '';
|
|
17
17
|
this.labelSide = CheckboxLabelSide.RIGHT;
|
|
18
18
|
}
|
|
19
|
-
static { this.styles = [
|
|
20
|
-
hostStyles,
|
|
21
|
-
checkboxContainerStyles,
|
|
22
|
-
checkboxCheckmarkStyles,
|
|
23
|
-
checkboxLabelStyles,
|
|
24
|
-
]; }
|
|
25
19
|
_onCheckboxChange(event) {
|
|
26
20
|
this.dispatchEvent(new CustomEvent('change', {
|
|
27
21
|
detail: {
|
|
@@ -82,6 +76,12 @@ let TuixCheckbox = class TuixCheckbox extends LitElement {
|
|
|
82
76
|
</label>`;
|
|
83
77
|
}
|
|
84
78
|
};
|
|
79
|
+
TuixCheckbox.styles = [
|
|
80
|
+
hostStyles,
|
|
81
|
+
checkboxContainerStyles,
|
|
82
|
+
checkboxCheckmarkStyles,
|
|
83
|
+
checkboxLabelStyles,
|
|
84
|
+
];
|
|
85
85
|
__decorate([
|
|
86
86
|
property({ type: Boolean })
|
|
87
87
|
], TuixCheckbox.prototype, "checked", void 0);
|
|
@@ -104,3 +104,4 @@ TuixCheckbox = __decorate([
|
|
|
104
104
|
customElement('tuix-checkbox')
|
|
105
105
|
], TuixCheckbox);
|
|
106
106
|
export { TuixCheckbox };
|
|
107
|
+
//# sourceMappingURL=TuixCheckbox.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TuixCheckbox.js","sourceRoot":"","sources":["../../../src/tuix-checkbox/TuixCheckbox.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,UAAU,EAAkB,IAAI,EAAE,MAAM,KAAK,CAAC;AACvD,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAC5D,OAAO,EAAa,QAAQ,EAAE,MAAM,6BAA6B,CAAC;AAClE,OAAO,EAAE,QAAQ,EAAE,eAAe,EAAE,MAAM,oCAAoC,CAAC;AAC/E,OAAO,EAAE,QAAQ,EAAE,WAAW,EAAE,MAAM,oCAAoC,CAAC;AAC3E,OAAO,EACL,uBAAuB,EACvB,uBAAuB,EACvB,mBAAmB,EACnB,UAAU,GACX,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EACL,qBAAqB,EACrB,sBAAsB,EACtB,gBAAgB,EAChB,iBAAiB,GAClB,MAAM,6BAA6B,CAAC;AAGrC,IAAa,YAAY,GAAzB,MAAa,YAAa,SAAQ,UAAU;IAA5C;;QASE,YAAO,GAAG,KAAK,CAAC;QAGhB,aAAQ,GAAG,KAAK,CAAC;QAGjB,SAAI,GAAG,KAAK,CAAC;QAGb,UAAK,GAAG,KAAK,CAAC;QAGd,UAAK,GAAG,EAAE,CAAC;QAGX,cAAS,GAAG,iBAAiB,CAAC,KAAK,CAAC;IAkEtC,CAAC;IAhES,iBAAiB,CAAC,KAAiB;QACzC,IAAI,CAAC,aAAa,CAChB,IAAI,WAAW,CAAC,QAAQ,EAAE;YACxB,MAAM,EAAE;gBACN,KAAK,EAAG,KAAK,C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Z;AAGhB;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;8CAC1B;AAGjB;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;0CAC9B;AAGb;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;2CAC7B;AAGd;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;2CAChB;AAGX;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;+CACS;AAxBzB,YAAY;IADxB,aAAa,CAAC,eAAe,CAAC;GAClB,YAAY,CA0FxB;SA1FY,YAAY","sourcesContent":["import { LitElement, TemplateResult, html } from 'lit';\nimport { customElement, property } from 'lit/decorators.js';\nimport { ClassInfo, classMap } from 'lit/directives/class-map.js';\nimport { IconName, IconSizeVariant } from '../tuix-icon/enums/tuix-icon.enums';\nimport { TextSize, TextVariant } from '../tuix-text/enums/tuix-text.enums';\nimport {\n checkboxCheckmarkStyles,\n checkboxContainerStyles,\n checkboxLabelStyles,\n hostStyles,\n} from './TuixCheckbox.styles';\nimport {\n CheckboxIconColorDark,\n CheckboxIconColorLight,\n CheckboxIconMode,\n CheckboxLabelSide,\n} from './enums/tuix-checkbox.enums';\n\n@customElement('tuix-checkbox')\nexport class TuixCheckbox extends LitElement {\n static styles = [\n hostStyles,\n checkboxContainerStyles,\n checkboxCheckmarkStyles,\n checkboxLabelStyles,\n ];\n\n @property({ type: Boolean })\n checked = false;\n\n @property({ type: Boolean, reflect: true })\n disabled = false;\n\n @property({ type: Boolean, reflect: true })\n dark = false;\n\n @property({ type: Boolean, reflect: true })\n error = false;\n\n @property({ type: String })\n label = '';\n\n @property({ type: String })\n labelSide = CheckboxLabelSide.RIGHT;\n\n private _onCheckboxChange(event: InputEvent) {\n this.dispatchEvent(\n new CustomEvent('change', {\n detail: {\n value: (event.target as HTMLInputElement).checked,\n label: this.label,\n },\n bubbles: true,\n })\n );\n }\n\n private _getIconMode() {\n if (this.disabled) {\n return CheckboxIconMode.DISABLED;\n }\n if (this.error) {\n return CheckboxIconMode.ERROR;\n }\n return CheckboxIconMode.DEFAULT;\n }\n\n private _getFullContainerClasses(): ClassInfo {\n return {\n 't-checkbox-full-container': true,\n 't-with-error': this.error && !this.disabled,\n 't-with-label-left': this.labelSide === CheckboxLabelSide.LEFT,\n };\n }\n\n protected render(): TemplateResult {\n return html`<label class=\"${classMap(this._getFullContainerClasses())}\">\n <div class=\"t-checkbox-container\">\n <input\n type=\"checkbox\"\n class=\"t-checkbox\"\n .checked=\"${this.checked}\"\n ?disabled=\"${this.disabled}\"\n @change=\"${this._onCheckboxChange}\"\n />\n <div class=\"t-checkbox-checkmark\">\n <tuix-icon\n size=\"${IconSizeVariant.FULL}\"\n name=\"${IconName.CHECK}\"\n color=\"${this.dark\n ? CheckboxIconColorDark[this._getIconMode()]\n : CheckboxIconColorLight[this._getIconMode()]}\"\n >\n </tuix-icon>\n </div>\n </div>\n <div class=\"t-checkbox-label\">\n <slot>\n <tuix-text\n size=\"${TextSize.Field1}\"\n color=\"${TextVariant.PRIMARY}\"\n ?dark=\"${this.dark}\"\n >\n ${this.label}\n </tuix-text>\n </slot>\n </div>\n </label>`;\n }\n}\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TuixCheckbox.styles.js","sourceRoot":"","sources":["../../../src/tuix-checkbox/TuixCheckbox.styles.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,SAAS,EAAE,MAAM,KAAK,CAAC;AACrC,OAAO,EAAE,OAAO,EAAE,MAAM,iBAAiB,CAAC;AAC1C,OAAO,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAClD,OAAO,EAAE,WAAW,EAAE,MAAM,2BAA2B,CAAC;AAExD,MAAM,CAAC,MAAM,UAAU,GAAG,GAAG,CAAA;;2BAEF,SAAS,CAAC,OAAO,CAAC,IAAI,CAAC;4BACtB,SAAS,CAAC,OAAO,CAAC,KAAK,CAAC;6BACvB,SAAS,CAAC,OAAO,CAAC,WAAW,CAAC;4BAC/B,SAAS,CAAC,OAAO,CAAC,KAAK,CAAC;8BACtB,SAAS,CAAC,OAAO,CAAC,SAAS,CAAC;6BAC7B,SAAS,CAAC,OAAO,CAAC,WAAW,CAAC;4BAC/B,SAAS,CAAC,OAAO,CAAC,KAAK,CAAC;;;;;2BAKzB,SAAS,CAAC,WAAW,CAAC,IAAI,CAAC;4BAC1B,SAAS,CAAC,WAAW,CAAC,KAAK,CAAC;6BAC3B,SAAS,CAAC,WAAW,CAAC,WAAW,CAAC;4BACnC,SAAS,CAAC,WAAW,CAAC,KAAK,CAAC;8BAC1B,SAAS,CAAC,WAAW,CAAC,SAAS,CAAC;6BACjC,SAAS,CAAC,WAAW,CAAC,WAAW,CAAC;4BACnC,SAAS,CAAC,WAAW,CAAC,KAAK,CAAC;;CAEvD,CAAC;AAEF,MAAM,CAAC,MAAM,uBAAuB,GAAG,GAAG,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;uCA6BH,WAAW,CAAC,MAAM;;;;;;;;CAQxD,CAAC;AAEF,MAAM,CAAC,MAAM,uBAAuB,GAAG,GAAG,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAoDzC,CAAC;AAEF,MAAM,CAAC,MAAM,mBAAmB,GAAG,GAAG,CAAA;;;;;;;;;;;;;;CAcrC,CAAC","sourcesContent":["import { css, unsafeCSS } from 'lit';\nimport { Palette } from '../utils/colors';\nimport { DarkPalette } from '../utils/darkColors';\nimport { ScreenSizes } from '../utils/screenSizes.enum';\n\nexport const hostStyles = css`\n :host {\n --t-main-color-tuix: ${unsafeCSS(Palette.MAIN)};\n --t-bg-color-primary: ${unsafeCSS(Palette.WHITE)};\n --t-bg-color-disabled: ${unsafeCSS(Palette.PRIMARY_100)};\n --t-text-color-error: ${unsafeCSS(Palette.ERROR)};\n --t-stroke-color-focus: ${unsafeCSS(Palette.SECONDARY)};\n --t-stroke-color-grey: ${unsafeCSS(Palette.PRIMARY_300)};\n --t-text-color-label: ${unsafeCSS(Palette.BLACK)};\n --t-label-right-default-justify: flex-start;\n --t-label-left-default-justify: space-between;\n }\n :host([dark]) {\n --t-main-color-tuix: ${unsafeCSS(DarkPalette.MAIN)};\n --t-bg-color-primary: ${unsafeCSS(DarkPalette.BLACK)};\n --t-bg-color-disabled: ${unsafeCSS(DarkPalette.PRIMARY_800)};\n --t-text-color-error: ${unsafeCSS(DarkPalette.ERROR)};\n --t-stroke-color-focus: ${unsafeCSS(DarkPalette.SECONDARY)};\n --t-stroke-color-grey: ${unsafeCSS(DarkPalette.PRIMARY_100)};\n --t-text-color-label: ${unsafeCSS(DarkPalette.WHITE)};\n }\n`;\n\nexport const checkboxContainerStyles = css`\n .t-checkbox-full-container {\n display: flex;\n justify-content: var(--t-label-right-default-justify, flex-start);\n cursor: pointer;\n -webkit-user-select: none;\n -moz-user-select: none;\n -ms-user-select: none;\n user-select: none;\n }\n :host([disabled]) .t-checkbox-full-container {\n cursor: not-allowed;\n }\n .t-checkbox-container {\n --t-checkbox-size-box: 1.5rem;\n --t-checkbox-shadow-width: 2px;\n --t-checkbox-border-radius: 0.25rem;\n display: block;\n position: relative;\n height: var(--t-checkbox-size-box);\n width: var(--t-checkbox-size-box);\n min-width: var(--t-checkbox-size-box);\n }\n .t-checkbox-container .t-checkbox {\n position: absolute;\n opacity: 0;\n height: 0;\n width: 0;\n }\n @media only screen and (max-width: ${ScreenSizes.MOBILE}px) {\n .t-checkbox-container {\n --t-checkbox-size-box: 1rem;\n --t-checkbox-shadow-width: 1px;\n --t-checkbox-border-radius: 0.125rem;\n margin-top: 1px;\n }\n }\n`;\n\nexport const checkboxCheckmarkStyles = css`\n .t-checkbox-container .t-checkbox-checkmark {\n position: absolute;\n top: 0;\n left: 0;\n display: flex;\n height: var(--t-checkbox-size-box);\n width: var(--t-checkbox-size-box);\n border-radius: var(--t-checkbox-border-radius);\n background-color: var(--t-bg-color-primary);\n border: 1px solid var(--t-stroke-color-grey);\n box-sizing: border-box;\n }\n .t-checkbox-container .t-checkbox-checkmark tuix-icon {\n margin: auto;\n display: none;\n width: calc(var(--t-checkbox-size-box) - 0.5rem);\n height: calc(var(--t-checkbox-size-box) - 0.5rem);\n }\n .t-checkbox-container .t-checkbox:checked ~ .t-checkbox-checkmark {\n background-color: var(--t-main-color-tuix);\n border: none;\n }\n .t-checkbox-container .t-checkbox:focus ~ .t-checkbox-checkmark {\n box-shadow: 0 0 0px var(--t-checkbox-shadow-width)\n var(--t-stroke-color-focus);\n border: 1px solid var(--t-main-color-tuix);\n }\n .t-checkbox-container .t-checkbox:checked ~ .t-checkbox-checkmark tuix-icon {\n display: block;\n }\n .t-checkbox-full-container:hover .t-checkbox-container .t-checkbox-checkmark {\n border: 1px solid var(--t-main-color-tuix);\n }\n .t-checkbox-full-container.t-with-error\n .t-checkbox-container\n .t-checkbox-checkmark {\n border: 1px solid var(--t-text-color-error);\n }\n .t-checkbox-full-container.t-with-error\n .t-checkbox-container\n .t-checkbox:checked\n ~ .t-checkbox-checkmark {\n background-color: var(--t-text-color-error);\n border: none;\n }\n\n .t-checkbox-container .t-checkbox:disabled ~ .t-checkbox-checkmark {\n background-color: var(--t-bg-color-disabled);\n border: none;\n box-shadow: none;\n }\n`;\n\nexport const checkboxLabelStyles = css`\n .t-checkbox-label {\n display: block;\n color: var(--t-text-color-label);\n margin-left: 0.625rem;\n }\n .t-checkbox-full-container.t-with-label-left {\n flex-direction: row-reverse;\n justify-content: var(--t-label-left-default-justify, space-between);\n }\n .t-checkbox-full-container.t-with-label-left .t-checkbox-label {\n margin-right: 0.625rem;\n margin-left: 0;\n }\n`;\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tuix-checkbox.enums.js","sourceRoot":"","sources":["../../../../src/tuix-checkbox/enums/tuix-checkbox.enums.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,oBAAoB,CAAC;AAC7C,OAAO,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAC;AAErD,MAAM,CAAN,IAAY,gBAIX;AAJD,WAAY,gBAAgB;IAC1B,uCAAmB,CAAA;IACnB,yCAAqB,CAAA;IACrB,mCAAe,CAAA;AACjB,CAAC,EAJW,gBAAgB,KAAhB,gBAAgB,QAI3B;AAED,MAAM,CAAN,IAAY,iBAGX;AAHD,WAAY,iBAAiB;IAC3B,kCAAa,CAAA;IACb,oCAAe,CAAA;AACjB,CAAC,EAHW,iBAAiB,KAAjB,iBAAiB,QAG5B;AAED,MAAM,CAAC,MAAM,sBAAsB,GAAG;IACpC,CAAC,gBAAgB,CAAC,OAAO,CAAC,EAAE,OAAO,CAAC,KAAK;IACzC,CAAC,gBAAgB,CAAC,QAAQ,CAAC,EAAE,OAAO,CAAC,WAAW;IAChD,CAAC,gBAAgB,CAAC,KAAK,CAAC,EAAE,OAAO,CAAC,KAAK;CACxC,CAAC;AAEF,MAAM,CAAC,MAAM,qBAAqB,GAAG;IACnC,CAAC,gBAAgB,CAAC,OAAO,CAAC,EAAE,WAAW,CAAC,KAAK;IAC7C,CAAC,gBAAgB,CAAC,QAAQ,CAAC,EAAE,WAAW,CAAC,WAAW;IACpD,CAAC,gBAAgB,CAAC,KAAK,CAAC,EAAE,WAAW,CAAC,KAAK;CAC5C,CAAC","sourcesContent":["import { Palette } from '../../utils/colors';\nimport { DarkPalette } from '../../utils/darkColors';\n\nexport enum CheckboxIconMode {\n DEFAULT = 'default',\n DISABLED = 'disabled',\n ERROR = 'error',\n}\n\nexport enum CheckboxLabelSide {\n LEFT = 'left',\n RIGHT = 'right',\n}\n\nexport const CheckboxIconColorLight = {\n [CheckboxIconMode.DEFAULT]: Palette.WHITE,\n [CheckboxIconMode.DISABLED]: Palette.PRIMARY_300,\n [CheckboxIconMode.ERROR]: Palette.WHITE,\n};\n\nexport const CheckboxIconColorDark = {\n [CheckboxIconMode.DEFAULT]: DarkPalette.WHITE,\n [CheckboxIconMode.DISABLED]: DarkPalette.PRIMARY_100,\n [CheckboxIconMode.ERROR]: DarkPalette.WHITE,\n};\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tuix-checkbox.interface.js","sourceRoot":"","sources":["../../../../src/tuix-checkbox/interfaces/tuix-checkbox.interface.ts"],"names":[],"mappings":"","sourcesContent":["import { DetailValue } from '../../utils/interfaces/detail-value.interface';\n\nexport interface DetailValueCheckbox extends DetailValue<boolean> {\n label?: string;\n}\n\nexport type CustomEventTuixCheckbox = CustomEvent<DetailValueCheckbox>;\n"]}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { LitElement,
|
|
2
|
-
import
|
|
1
|
+
import { LitElement, PropertyValues, TemplateResult } from 'lit';
|
|
2
|
+
import { TuixDropdownExtendedOption, TuixDropdownOption } from './interfaces/tuix-dropdown.interface.js';
|
|
3
3
|
import { DescriptionType } from '../tuix-input/enums/tuix-input.enums.js';
|
|
4
4
|
import { DropdownType } from './enums/tuix-dropdown.enums.js';
|
|
5
5
|
export declare class TuixDropdown extends LitElement {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { __decorate } from "tslib";
|
|
2
|
-
import { LitElement, html
|
|
2
|
+
import { LitElement, html } from 'lit';
|
|
3
3
|
import { customElement, property, query, state } from 'lit/decorators.js';
|
|
4
4
|
import { classMap } from 'lit/directives/class-map.js';
|
|
5
5
|
import { IconName } from '../tuix-icon/enums/tuix-icon.enums.js';
|
|
@@ -29,11 +29,6 @@ let TuixDropdown = class TuixDropdown extends LitElement {
|
|
|
29
29
|
}
|
|
30
30
|
};
|
|
31
31
|
}
|
|
32
|
-
static { this.styles = [
|
|
33
|
-
dropdownHostStyles,
|
|
34
|
-
dropdownMainContainerStyles,
|
|
35
|
-
dropdownOptionStyles,
|
|
36
|
-
]; }
|
|
37
32
|
connectedCallback() {
|
|
38
33
|
super.connectedCallback();
|
|
39
34
|
window.addEventListener('click', this._handleClickOutside);
|
|
@@ -95,8 +90,9 @@ let TuixDropdown = class TuixDropdown extends LitElement {
|
|
|
95
90
|
}
|
|
96
91
|
}
|
|
97
92
|
_handleBlur() {
|
|
93
|
+
var _a;
|
|
98
94
|
if (this.type === DropdownType.SEARCH && this._searchingOption) {
|
|
99
|
-
const optionIndex = this._previousSelectedOption
|
|
95
|
+
const optionIndex = (_a = this._previousSelectedOption) === null || _a === void 0 ? void 0 : _a.getAttribute('data-value');
|
|
100
96
|
const selectedValue = typeof optionIndex === 'string'
|
|
101
97
|
? this.options[Number(optionIndex)]
|
|
102
98
|
: '';
|
|
@@ -105,7 +101,7 @@ let TuixDropdown = class TuixDropdown extends LitElement {
|
|
|
105
101
|
}
|
|
106
102
|
}
|
|
107
103
|
_getOptionName(option) {
|
|
108
|
-
return String(typeof option === 'object' ? option
|
|
104
|
+
return String(typeof option === 'object' ? option === null || option === void 0 ? void 0 : option.name : option);
|
|
109
105
|
}
|
|
110
106
|
_getOptionValue(option) {
|
|
111
107
|
return typeof option === 'object' ? option.value : option;
|
|
@@ -141,28 +137,30 @@ let TuixDropdown = class TuixDropdown extends LitElement {
|
|
|
141
137
|
});
|
|
142
138
|
}
|
|
143
139
|
_handleArrowDown() {
|
|
144
|
-
|
|
145
|
-
|
|
140
|
+
var _a;
|
|
141
|
+
const nextOption = (_a = this._previousFocusedOption) === null || _a === void 0 ? void 0 : _a.nextElementSibling;
|
|
146
142
|
if (nextOption) {
|
|
147
143
|
this._focusTargetOption(nextOption);
|
|
148
144
|
}
|
|
149
145
|
}
|
|
150
146
|
_handleArrowUp() {
|
|
151
|
-
|
|
152
|
-
|
|
147
|
+
var _a;
|
|
148
|
+
const previousOption = (_a = this._previousFocusedOption) === null || _a === void 0 ? void 0 : _a.previousElementSibling;
|
|
153
149
|
if (previousOption) {
|
|
154
150
|
this._focusTargetOption(previousOption);
|
|
155
151
|
}
|
|
156
152
|
}
|
|
157
153
|
_focusTargetOption(targetOption, extrict = true) {
|
|
158
|
-
|
|
159
|
-
|
|
154
|
+
var _a, _b;
|
|
155
|
+
(_b = (_a = this._previousFocusedOption) === null || _a === void 0 ? void 0 : _a.classList) === null || _b === void 0 ? void 0 : _b.remove('t-option-hover');
|
|
156
|
+
targetOption === null || targetOption === void 0 ? void 0 : targetOption.classList.add('t-option-hover');
|
|
160
157
|
if (extrict) {
|
|
161
|
-
targetOption
|
|
158
|
+
targetOption === null || targetOption === void 0 ? void 0 : targetOption.focus();
|
|
162
159
|
}
|
|
163
160
|
this._previousFocusedOption = targetOption;
|
|
164
161
|
}
|
|
165
162
|
_toggleOptions() {
|
|
163
|
+
var _a, _b, _c, _d;
|
|
166
164
|
if (this.disabled) {
|
|
167
165
|
return;
|
|
168
166
|
}
|
|
@@ -170,14 +168,15 @@ let TuixDropdown = class TuixDropdown extends LitElement {
|
|
|
170
168
|
if (this._isOptionsVisible &&
|
|
171
169
|
this.type === DropdownType.SEARCH &&
|
|
172
170
|
this._previousSelectedOption) {
|
|
173
|
-
this._optionsContainer
|
|
171
|
+
(_a = this._optionsContainer) === null || _a === void 0 ? void 0 : _a.scrollTo({
|
|
174
172
|
top: this._previousSelectedOption.offsetTop,
|
|
175
173
|
behavior: 'auto',
|
|
176
174
|
});
|
|
177
|
-
this._inputDropdown
|
|
175
|
+
(_d = (_c = (_b = this._inputDropdown) === null || _b === void 0 ? void 0 : _b.shadowRoot) === null || _c === void 0 ? void 0 : _c.querySelector('input')) === null || _d === void 0 ? void 0 : _d.select();
|
|
178
176
|
}
|
|
179
177
|
}
|
|
180
178
|
_focusOptionsContainer() {
|
|
179
|
+
var _a, _b, _c;
|
|
181
180
|
if (this.type === DropdownType.SEARCH) {
|
|
182
181
|
if (this._previousSelectedOption) {
|
|
183
182
|
this._focusTargetOption(this._previousSelectedOption, false);
|
|
@@ -185,7 +184,7 @@ let TuixDropdown = class TuixDropdown extends LitElement {
|
|
|
185
184
|
return;
|
|
186
185
|
}
|
|
187
186
|
if (!this._isOptionsVisible || !this._optionsContainer) {
|
|
188
|
-
this._inputDropdown
|
|
187
|
+
(_c = (_b = (_a = this._inputDropdown) === null || _a === void 0 ? void 0 : _a.shadowRoot) === null || _b === void 0 ? void 0 : _b.querySelector('input')) === null || _c === void 0 ? void 0 : _c.focus();
|
|
189
188
|
return;
|
|
190
189
|
}
|
|
191
190
|
if (this._previousSelectedOption) {
|
|
@@ -200,8 +199,9 @@ let TuixDropdown = class TuixDropdown extends LitElement {
|
|
|
200
199
|
}
|
|
201
200
|
}
|
|
202
201
|
_unselectPreviousOption() {
|
|
202
|
+
var _a;
|
|
203
203
|
if (this._previousSelectedOption) {
|
|
204
|
-
this._previousSelectedOption.classList
|
|
204
|
+
(_a = this._previousSelectedOption.classList) === null || _a === void 0 ? void 0 : _a.remove('t-option-selected');
|
|
205
205
|
this._previousSelectedOption = null;
|
|
206
206
|
}
|
|
207
207
|
}
|
|
@@ -220,6 +220,7 @@ let TuixDropdown = class TuixDropdown extends LitElement {
|
|
|
220
220
|
};
|
|
221
221
|
}
|
|
222
222
|
_triggerUpdateByExternalValueChange() {
|
|
223
|
+
var _a;
|
|
223
224
|
this._unselectPreviousOption();
|
|
224
225
|
if (!this.value) {
|
|
225
226
|
this._value = '';
|
|
@@ -234,8 +235,8 @@ let TuixDropdown = class TuixDropdown extends LitElement {
|
|
|
234
235
|
this._value = '';
|
|
235
236
|
return;
|
|
236
237
|
}
|
|
237
|
-
const optionTarget = this._optionsContainer
|
|
238
|
-
optionTarget
|
|
238
|
+
const optionTarget = (_a = this._optionsContainer) === null || _a === void 0 ? void 0 : _a.children[index];
|
|
239
|
+
optionTarget === null || optionTarget === void 0 ? void 0 : optionTarget.classList.add('t-option-selected');
|
|
239
240
|
this._previousSelectedOption = optionTarget || null;
|
|
240
241
|
this._value = optionTarget ? this._getOptionName(this.options[index]) : '';
|
|
241
242
|
}
|
|
@@ -244,10 +245,11 @@ let TuixDropdown = class TuixDropdown extends LitElement {
|
|
|
244
245
|
this._unselectPreviousOption();
|
|
245
246
|
}
|
|
246
247
|
_getOptionsTemplate() {
|
|
248
|
+
var _a;
|
|
247
249
|
if (this.type === DropdownType.SINGLE || this._searchingOption === false) {
|
|
248
250
|
this._extendOptionsList();
|
|
249
251
|
}
|
|
250
|
-
return this._extendedOptions
|
|
252
|
+
return (_a = this._extendedOptions) === null || _a === void 0 ? void 0 : _a.map((option, index) => {
|
|
251
253
|
return html `<div
|
|
252
254
|
class="${classMap({
|
|
253
255
|
't-dropdown-option': true,
|
|
@@ -309,6 +311,11 @@ let TuixDropdown = class TuixDropdown extends LitElement {
|
|
|
309
311
|
</div>`;
|
|
310
312
|
}
|
|
311
313
|
};
|
|
314
|
+
TuixDropdown.styles = [
|
|
315
|
+
dropdownHostStyles,
|
|
316
|
+
dropdownMainContainerStyles,
|
|
317
|
+
dropdownOptionStyles,
|
|
318
|
+
];
|
|
312
319
|
__decorate([
|
|
313
320
|
property({ type: Object })
|
|
314
321
|
], TuixDropdown.prototype, "value", void 0);
|
|
@@ -358,3 +365,4 @@ TuixDropdown = __decorate([
|
|
|
358
365
|
customElement('tuix-dropdown')
|
|
359
366
|
], TuixDropdown);
|
|
360
367
|
export { TuixDropdown };
|
|
368
|
+
//# sourceMappingURL=TuixDropdown.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TuixDropdown.js","sourceRoot":"","sources":["../../../src/tuix-dropdown/TuixDropdown.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,UAAU,EAAkC,IAAI,EAAE,MAAM,KAAK,CAAC;AACvE,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,KAAK,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAC;AAC1E,OAAO,EAAa,QAAQ,EAAE,MAAM,6BAA6B,CAAC;AAClE,OAAO,EAAE,QAAQ,EAAE,MAAM,oCAAoC,CAAC;AAC9D,OAAO,E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IAAI,EAAE,MAAM,EAAE,CAAC;0CACA;AAGnB;IADP,KAAK,EAAE;4CACY;AAGZ;IADP,KAAK,EAAE;uDAC0B;AAG1B;IADP,KAAK,EAAE;sDACyB;AAGjC;IADC,KAAK,EAAE;sDAC4C;AAG5C;IADP,KAAK,CAAC,sBAAsB,CAAC;uDACqB;AAG3C;IADP,KAAK,CAAC,yCAAyC,CAAC;oDACD;AAlDrC,YAAY;IADxB,aAAa,CAAC,eAAe,CAAC;GAClB,YAAY,CA4XxB;SA5XY,YAAY","sourcesContent":["import { LitElement, PropertyValues, TemplateResult, html } from 'lit';\nimport { customElement, property, query, state } from 'lit/decorators.js';\nimport { ClassInfo, classMap } from 'lit/directives/class-map.js';\nimport { IconName } from '../tuix-icon/enums/tuix-icon.enums';\nimport {\n dropdownHostStyles,\n dropdownMainContainerStyles,\n dropdownOptionStyles,\n} from './TuixDropdown.styles';\nimport {\n TuixDropdownExtendedOption,\n TuixDropdownOption,\n TuixDropdownPlainOption,\n} from './interfaces/tuix-dropdown.interface';\nimport { DescriptionType } from '../tuix-input/enums/tuix-input.enums';\nimport { DropdownType } from './enums/tuix-dropdown.enums';\n\n@customElement('tuix-dropdown')\nexport class TuixDropdown extends LitElement {\n static styles = [\n dropdownHostStyles,\n dropdownMainContainerStyles,\n dropdownOptionStyles,\n ];\n\n @property({ type: Object })\n value?: TuixDropdownOption = undefined;\n\n @property({ type: Array })\n options: TuixDropdownOption[] = [];\n\n @property({ type: String })\n placeholder = '';\n\n @property({ type: String })\n title = '';\n\n @property({ type: Boolean, reflect: true })\n disabled = false;\n\n @property({ type: Boolean, reflect: true })\n dark = false;\n\n @property({ type: String })\n description?: string;\n\n @property({ type: DescriptionType })\n descriptionType = DescriptionType.TEXT;\n\n @property({ type: String })\n type = DropdownType.SINGLE;\n\n @state()\n private _value = '';\n\n @state()\n private _isOptionsVisible = false;\n\n @state()\n private _searchingOption = false;\n\n @state()\n _extendedOptions: TuixDropdownExtendedOption[] = [];\n\n @query('.t-options-container')\n private _optionsContainer: HTMLElement | undefined;\n\n @query('.t-dropdown-container .t-input-dropdown')\n private _inputDropdown: HTMLElement | undefined;\n\n private _previousSelectedOption: HTMLElement | null = null;\n\n private _previousFocusedOption: HTMLElement | null = null;\n\n connectedCallback() {\n super.connectedCallback();\n window.addEventListener('click', this._handleClickOutside);\n this.addEventListener('blur', this._handleBlur.bind(this));\n }\n\n disconnectedCallback() {\n window.removeEventListener('click', this._handleClickOutside);\n super.disconnectedCallback();\n }\n\n private _onEnterPress(event: KeyboardEvent) {\n if (event.key === 'Enter') {\n this._toggleOptions();\n }\n }\n\n private _onKeyDownOption(event: KeyboardEvent) {\n switch (event.key) {\n case 'ArrowDown':\n return this._handleArrowDown();\n case 'ArrowUp':\n return this._handleArrowUp();\n case 'Escape':\n this._isOptionsVisible = false;\n break;\n }\n }\n\n private _onKeyPressOption(event: KeyboardEvent) {\n if (event.key === 'Enter') {\n this._onClickOption(event);\n }\n }\n\n private _onMouseOverOption(event: MouseEvent) {\n const optionTarget = event.target as HTMLElement;\n this._focusTargetOption(optionTarget);\n }\n\n private _onClickOption(event: MouseEvent | KeyboardEvent) {\n const optionTarget = event.target as HTMLElement;\n this._value = optionTarget.innerText;\n this._isOptionsVisible = false;\n this._unselectPreviousOption();\n optionTarget.classList.add('t-option-selected');\n this._previousSelectedOption = optionTarget;\n this._handleSelectEvent(event);\n }\n\n protected _onInputSingle(e: CustomEvent) {\n this._handleInputBase(e, 'input-single');\n }\n\n protected _handleSelectEvent(event: MouseEvent | KeyboardEvent) {\n const optionIndex = (event.target as HTMLOptionElement).getAttribute(\n 'data-value'\n );\n const selectedValue = this.options[Number(optionIndex)];\n this.dispatchEvent(\n new CustomEvent('select', {\n detail: {\n value: this._getOptionValue(selectedValue),\n },\n bubbles: true,\n })\n );\n if (this.type === DropdownType.SEARCH) {\n this._extendOptionsList(this._getOptionName(selectedValue));\n this._searchingOption = false;\n }\n }\n\n private _handleBlur() {\n if (this.type === DropdownType.SEARCH && this._searchingOption) {\n const optionIndex =\n this._previousSelectedOption?.getAttribute('data-value');\n const selectedValue =\n typeof optionIndex === 'string'\n ? this.options[Number(optionIndex)]\n : '';\n this._value = this._getOptionName(selectedValue);\n this._extendOptionsList();\n }\n }\n\n private _getOptionName(option: TuixDropdownOption): string {\n return String(typeof option === 'object' ? option?.name : option);\n }\n\n private _getOptionValue(option: TuixDropdownOption): TuixDropdownPlainOption {\n return typeof option === 'object' ? option.value : option;\n }\n\n private _findIndex(option: TuixDropdownOption): number {\n return this._extendedOptions.findIndex(\n opt => opt.value === this._getOptionValue(option)\n );\n }\n\n private _handleInputBase(e: CustomEvent, eventName: string) {\n if (!this._searchingOption) {\n this._searchingOption = true;\n }\n this._extendOptionsList(e.detail.value);\n this._isOptionsVisible = true;\n this.dispatchEvent(\n new CustomEvent(eventName, {\n detail: {\n value: e.detail.value,\n },\n bubbles: true,\n })\n );\n this._value = e.detail.value;\n }\n\n private _extendOptionsList(value = '') {\n value = value.trim();\n this._extendedOptions = this.options.map(option => {\n const optionName = this._getOptionName(option);\n return {\n name: optionName,\n value: this._getOptionValue(option),\n filtered:\n this.type === DropdownType.SEARCH &&\n value !== '' &&\n !optionName.toLowerCase().includes(value.toLowerCase()),\n };\n });\n }\n\n private _handleArrowDown() {\n const nextOption = this._previousFocusedOption\n ?.nextElementSibling as HTMLElement;\n if (nextOption) {\n this._focusTargetOption(nextOption);\n }\n }\n\n private _handleArrowUp() {\n const previousOption = this._previousFocusedOption\n ?.previousElementSibling as HTMLElement;\n if (previousOption) {\n this._focusTargetOption(previousOption);\n }\n }\n\n private _handleClickOutside = (event: MouseEvent) => {\n if (!event.composedPath().includes(this)) {\n this._isOptionsVisible = false;\n }\n };\n\n private _focusTargetOption(targetOption: HTMLElement, extrict = true) {\n this._previousFocusedOption?.classList?.remove('t-option-hover');\n targetOption?.classList.add('t-option-hover');\n if (extrict) {\n targetOption?.focus();\n }\n this._previousFocusedOption = targetOption;\n }\n\n private _toggleOptions() {\n if (this.disabled) {\n return;\n }\n this._isOptionsVisible = !this._isOptionsVisible;\n if (\n this._isOptionsVisible &&\n this.type === DropdownType.SEARCH &&\n this._previousSelectedOption\n ) {\n this._optionsContainer?.scrollTo({\n top: this._previousSelectedOption.offsetTop,\n behavior: 'auto',\n });\n this._inputDropdown?.shadowRoot?.querySelector('input')?.select();\n }\n }\n\n private _focusOptionsContainer() {\n if (this.type === DropdownType.SEARCH) {\n if (this._previousSelectedOption) {\n this._focusTargetOption(this._previousSelectedOption, false);\n }\n return;\n }\n if (!this._isOptionsVisible || !this._optionsContainer) {\n this._inputDropdown?.shadowRoot?.querySelector('input')?.focus();\n return;\n }\n if (this._previousSelectedOption) {\n this._focusTargetOption(this._previousSelectedOption);\n } else {\n const firstOption = this._optionsContainer\n .firstElementChild as HTMLElement;\n if (firstOption) {\n this._focusTargetOption(firstOption);\n }\n }\n }\n\n private _unselectPreviousOption() {\n if (this._previousSelectedOption) {\n this._previousSelectedOption.classList?.remove('t-option-selected');\n this._previousSelectedOption = null;\n }\n }\n\n private _hasCompleteDescription(): boolean {\n const isValidDescriptionType = Object.values(DescriptionType).includes(\n this.descriptionType\n );\n return (\n isValidDescriptionType &&\n (this.descriptionType === DescriptionType.TEXT\n ? !!this.description\n : true)\n );\n }\n\n private _getOptionsContainerClasses(): ClassInfo {\n return {\n 't-options-container': true,\n show: this._isOptionsVisible,\n 't-with-description': this._hasCompleteDescription(),\n };\n }\n\n private _triggerUpdateByExternalValueChange() {\n this._unselectPreviousOption();\n if (!this.value) {\n this._value = '';\n this._extendOptionsList();\n return;\n }\n const index = this._findIndex(this.value);\n if (this.type === DropdownType.SEARCH) {\n this._extendOptionsList('');\n }\n if (index < 0) {\n this._value = '';\n return;\n }\n const optionTarget = this._optionsContainer?.children[index] as HTMLElement;\n optionTarget?.classList.add('t-option-selected');\n this._previousSelectedOption = optionTarget || null;\n this._value = optionTarget ? this._getOptionName(this.options[index]) : '';\n }\n\n private _resetPreviousSelection() {\n this._value = '';\n this._unselectPreviousOption();\n }\n\n private _getOptionsTemplate(): TemplateResult[] {\n if (this.type === DropdownType.SINGLE || this._searchingOption === false) {\n this._extendOptionsList();\n }\n return this._extendedOptions?.map((option, index) => {\n return html`<div\n class=\"${classMap({\n 't-dropdown-option': true,\n 't-option-filtered': option.filtered,\n })}\"\n @click=\"${this._onClickOption}\"\n data-value=\"${index}\"\n tabindex=\"0\"\n @keydown=\"${this._onKeyDownOption}\"\n @keypress=\"${this._onKeyPressOption}\"\n @mouseover=\"${this._onMouseOverOption}\"\n >\n ${option.name}\n </div>`;\n });\n }\n\n protected updated(changedProperties: Map<string, any>) {\n if (changedProperties.has('_isOptionsVisible')) {\n this._focusOptionsContainer();\n } else if (changedProperties.has('value')) {\n this._triggerUpdateByExternalValueChange();\n }\n }\n\n protected willUpdate(changedProperties: PropertyValues<this>) {\n if (changedProperties.has('options')) {\n this._resetPreviousSelection();\n }\n }\n\n protected firstUpdated(changedProperties: PropertyValues<this>) {\n super.firstUpdated(changedProperties);\n this._triggerUpdateByExternalValueChange();\n }\n\n protected render(): TemplateResult {\n return html`<div class=\"t-dropdown-full-container\">\n <div class=\"t-dropdown-container\">\n <tuix-input\n .value=\"${this._value}\"\n class=\"t-input-dropdown\"\n iconRight=\"${this._isOptionsVisible\n ? IconName.CHEVRON_UP\n : IconName.CHEVRON_DOWN}\"\n placeholder=\"${this.placeholder}\"\n title=\"${this.title}\"\n .description=\"${this.description}\"\n descriptionType=\"${this.descriptionType}\"\n ?disabled=\"${this.disabled}\"\n ?dark=\"${this.dark}\"\n ?readonly=\"${this.type !== DropdownType.SEARCH}\"\n @on-click=\"${this._toggleOptions}\"\n @keypress=\"${this._onEnterPress}\"\n @on-change=\"${this._onInputSingle}\"\n >\n </tuix-input>\n </div>\n <div class=\"${classMap(this._getOptionsContainerClasses())}\">\n ${this._getOptionsTemplate()}\n </div>\n </div>`;\n }\n}\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TuixDropdown.styles.js","sourceRoot":"","sources":["../../../src/tuix-dropdown/TuixDropdown.styles.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,SAAS,EAAE,MAAM,KAAK,CAAC;AACrC,OAAO,EAAE,UAAU,EAAE,MAAM,gCAAgC,CAAC;AAC5D,OAAO,EAAE,OAAO,EAAE,MAAM,iBAAiB,CAAC;AAC1C,OAAO,EAAE,WAAW,EAAE,MAAM,2BAA2B,CAAC;AACxD,OAAO,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAElD,MAAM,CAAC,MAAM,kBAAkB,GAAG,GAAG,CAAA;IACjC,UAAU;;8BAEgB,SAAS,CAAC,OAAO,CAAC,KAAK,CAAC;4BAC1B,SAAS,CAAC,OAAO,CAAC,IAAI,CAAC;;;;;;;;;;uCAUZ,WAAW,CAAC,MAAM;;;;;;;uCAOlB,WAAW,CAAC,MAAM;;;;;;;;8BAQ3B,SAAS,CAAC,WAAW,CAAC,WAAW,CAAC;;CAE/D,CAAC;AAEF,MAAM,CAAC,MAAM,2BAA2B,GAAG,GAAG,CAAA;;;;;;;;CAQ7C,CAAC;AAEF,MAAM,CAAC,MAAM,oBAAoB,GAAG,GAAG,CAAA;;;;;;;;;;;;;kCAaL,SAAS,CAAC,OAAO,CAAC,MAAM,CAAC;;;;;;;;;;wBAUnC,SAAS,CAAC,OAAO,CAAC,WAAW,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;uCAuCf,WAAW,CAAC,MAAM;;;;;;;;uCAQlB,WAAW,CAAC,MAAM;;;;;;;;CAQxD,CAAC","sourcesContent":["import { css, unsafeCSS } from 'lit';\nimport { hostStyles } from '../tuix-input/TuixInput.styles';\nimport { Palette } from '../utils/colors';\nimport { ScreenSizes } from '../utils/screenSizes.enum';\nimport { DarkPalette } from '../utils/darkColors';\n\nexport const dropdownHostStyles = css`\n ${hostStyles}\n :host {\n --t-field-color-option: ${unsafeCSS(Palette.WHITE)};\n --t-field-color-main: ${unsafeCSS(Palette.MAIN)};\n }\n\n :host .t-input-dropdown {\n --t-field-font-weight: 300;\n --t-field-font-size: 1rem;\n --t-field-padding-x: 1rem;\n --t-field-title-left-position: 1rem;\n }\n\n @media only screen and (max-width: ${ScreenSizes.TABLET}px) {\n :host .t-input-dropdown {\n --t-field-font-size: 0.938rem;\n --t-field-line-height: 1.125rem;\n }\n }\n\n @media only screen and (max-width: ${ScreenSizes.MOBILE}px) {\n :host .t-input-dropdown {\n --t-field-font-size: 0.813rem;\n --t-field-line-height: 1rem;\n }\n }\n\n :host([dark]) {\n --t-field-color-option: ${unsafeCSS(DarkPalette.ELEVATION_2)};\n }\n`;\n\nexport const dropdownMainContainerStyles = css`\n .t-dropdown-full-container {\n position: relative;\n font-family: 'Rubik', sans-serif;\n }\n .t-dropdown-container .t-input-dropdown {\n --t-field-input-cursor: pointer;\n }\n`;\n\nexport const dropdownOptionStyles = css`\n .t-options-container {\n width: 100%;\n position: absolute;\n top: calc(100% + 2px);\n left: 0;\n border: none;\n border-radius: 0 0 5px 5px;\n background-color: var(--t-field-color-option);\n visibility: collapse;\n overflow-y: auto;\n max-height: 250px;\n color: var(--t-field-color-text);\n box-shadow: 0px 2px 8px 0px ${unsafeCSS(Palette.SHADOW)};\n z-index: 9999;\n }\n .t-options-container::-webkit-scrollbar {\n width: 0.75rem;\n }\n .t-options-container::-webkit-scrollbar-track {\n background-color: transparent;\n }\n .t-options-container::-webkit-scrollbar-thumb {\n background-color: ${unsafeCSS(Palette.PRIMARY_100)};\n border-radius: 0.25rem;\n border: 0.188rem solid transparent;\n background-clip: content-box;\n }\n .t-options-container.show {\n visibility: visible;\n }\n .t-options-container.show.t-with-description {\n top: calc(100% + 2px - 1.5rem);\n }\n @media only screen and (max-height: 500px) {\n .t-options-container {\n max-height: 50vh;\n }\n }\n .t-dropdown-option {\n padding: var(--t-field-padding-y) 1rem;\n cursor: pointer;\n font-size: 1rem;\n line-height: 1.25rem;\n font-weight: 300;\n -webkit-user-select: none;\n -moz-user-select: none;\n -ms-user-select: none;\n user-select: none;\n }\n .t-dropdown-option.t-option-hover {\n background-color: var(--t-field-color-form);\n }\n .t-dropdown-option.t-option-selected {\n color: var(--t-field-color-main);\n }\n .t-dropdown-option.t-option-filtered {\n display: none;\n }\n .t-dropdown-option:focus {\n outline: none;\n }\n @media only screen and (max-width: ${ScreenSizes.TABLET}px) {\n .t-dropdown-option {\n font-size: 0.938rem;\n line-height: 1.125rem;\n --t-field-padding-y: 1.063rem;\n --t-field-padding-top: 1.5rem;\n }\n }\n @media only screen and (max-width: ${ScreenSizes.MOBILE}px) {\n .t-dropdown-option {\n font-size: 0.813rem;\n line-height: 1rem;\n --t-field-padding-y: 1rem;\n --t-field-padding-top: 1.375rem;\n }\n }\n`;\n"]}
|