@3t-transform/threeteeui 0.2.72 → 0.2.73

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.
@@ -14,7 +14,7 @@ const patchEsm = () => {
14
14
  const defineCustomElements = (win, options) => {
15
15
  if (typeof window === 'undefined') return Promise.resolve();
16
16
  return patchEsm().then(() => {
17
- return index.bootstrapLazy([["tttx-dialog-box.cjs",[[1,"tttx-dialog-box",{"data":[1025],"size":[1],"open":[1028],"allowOverflow":[4,"allow-overflow"],"elementSize":[32]},[[9,"resize","handleResize"]]]]],["tttx-select-box.cjs",[[1,"tttx-select-box",{"optionsData":[1,"options-data"],"label":[1],"inline":[4],"placeholder":[1],"searchEnabled":[4,"search-enabled"],"selectedValue":[1,"selected-value"],"open":[32],"selectedItem":[32],"searchTerm":[32]},[[0,"closeSelectBox","handleCloseSelectBox"],[0,"blur","handleBlur"]]]]],["tttx-tree-view.cjs",[[1,"tttx-tree-view",{"data":[1040],"treeData":[32]}]]],["tttx-filter.cjs",[[1,"tttx-filter",{"filterKey":[1,"filter-key"],"filterOptions":[1,"filter-options"],"showSelectAll":[4,"show-select-all"],"showSearchField":[4,"show-search-field"],"showOptionIcons":[4,"show-option-icons"],"filterButtonStyle":[1,"filter-button-style"],"filterHeader":[1,"filter-header"],"defaultFilterOptions":[1,"default-filter-options"],"popoverWidth":[1,"popover-width"],"showPopover":[32],"displayedFilterSettings":[32],"selectedFilters":[32],"filterSearchTerm":[32],"allSelected":[32]},[[0,"closeFilter","handleCloseFilter"]]]]],["tttx-list.cjs",[[1,"tttx-list",{"data":[1025],"name":[1],"_data":[32]}]]],["tttx-sorter.cjs",[[1,"tttx-sorter",{"sorterKey":[1,"sorter-key"],"defaultSortDirection":[1,"default-sort-direction"],"fieldOptionsData":[1,"field-options-data"],"defaultOption":[1,"default-option"],"selectedField":[32],"sortDirection":[32],"dropdownExpand":[32],"dropdownOptions":[32]},[[0,"closeSorter","handleCloseSorter"]]]]],["tttx-form.cjs",[[1,"tttx-form",{"formschema":[1032],"data":[1032],"submit":[64]}]]],["tttx-keyvalue-block.cjs",[[1,"tttx-keyvalue-block",{"keyvalues":[8],"horizontal":[4]}]]],["tttx-loading-spinner.cjs",[[1,"tttx-loading-spinner",{"loadingMessage":[1028,"loading-message"],"size":[1025]}]]],["tttx-qrcode.cjs",[[1,"tttx-qrcode",{"link":[1025],"size":[1026]}]]],["tttx-tag.cjs",[[1,"tttx-tag",{"text":[1],"color":[1]}]]],["tttx-toolbar.cjs",[[1,"tttx-toolbar",{"border":[4],"viewSize":[32]},[[9,"resize","handleResize"]]]]],["tttx-icon.cjs",[[1,"tttx-icon",{"icon":[1],"color":[1]}]]],["tttx-standalone-input.cjs",[[2,"tttx-standalone-input",{"label":[1],"secondarylabel":[1],"showerrormsg":[4],"showerrorbubble":[4],"errormsg":[1],"iconleft":[1],"iconleftcolor":[1],"iconright":[1],"iconrightcolor":[1],"inputicon":[1],"inputiconcolor":[1],"inline":[4],"inputautocapitalize":[1],"inputautofocus":[4],"inputkeyhint":[1],"inputindex":[8],"inputtitle":[1],"autocomplete":[1],"checked":[4],"disabled":[4],"max":[8],"maxlength":[8],"min":[8],"minlength":[8],"name":[1],"pattern":[1],"placeholder":[1],"readonly":[8],"required":[4],"step":[8],"type":[1],"value":[1032]}]]],["tttx-button.cjs",[[1,"tttx-button",{"notext":[4],"icon":[1],"iconposition":[1],"iconcolor":[1025],"design":[1]}]]]], options);
17
+ return index.bootstrapLazy([["tttx-dialog-box.cjs",[[1,"tttx-dialog-box",{"data":[1025],"size":[1],"open":[1028],"allowOverflow":[4,"allow-overflow"],"elementSize":[32]},[[9,"resize","handleResize"]]]]],["tttx-select-box.cjs",[[1,"tttx-select-box",{"optionsData":[1,"options-data"],"label":[1],"inline":[4],"placeholder":[1],"searchEnabled":[4,"search-enabled"],"selectedValue":[1,"selected-value"],"open":[32],"selectedItem":[32],"searchTerm":[32]},[[0,"closeSelectBox","handleCloseSelectBox"],[0,"blur","handleBlur"]]]]],["tttx-tree-view.cjs",[[1,"tttx-tree-view",{"data":[1040],"treeData":[32]}]]],["tttx-filter.cjs",[[1,"tttx-filter",{"filterKey":[1,"filter-key"],"filterOptions":[1,"filter-options"],"showSelectAll":[4,"show-select-all"],"showSearchField":[4,"show-search-field"],"showOptionIcons":[4,"show-option-icons"],"filterButtonStyle":[1,"filter-button-style"],"filterHeader":[1,"filter-header"],"defaultFilterOptions":[1,"default-filter-options"],"popoverWidth":[1,"popover-width"],"showPopover":[32],"displayedFilterSettings":[32],"selectedFilters":[32],"filterSearchTerm":[32],"allSelected":[32]},[[0,"closeFilter","handleCloseFilter"]]]]],["tttx-list.cjs",[[1,"tttx-list",{"data":[1025],"name":[1],"_data":[32]}]]],["tttx-sorter.cjs",[[1,"tttx-sorter",{"sorterKey":[1,"sorter-key"],"defaultSortDirection":[1,"default-sort-direction"],"fieldOptionsData":[1,"field-options-data"],"defaultOption":[1,"default-option"],"selectedField":[32],"sortDirection":[32],"dropdownExpand":[32],"dropdownOptions":[32]},[[0,"closeSorter","handleCloseSorter"]]]]],["tttx-tabs.cjs",[[2,"tttx-tabs",{"tabsName":[1,"tabs-name"],"navigation":[4],"wide":[4],"tabs":[1],"_tabs":[32]},[[0,"keydown","handleKeyDown"]]]]],["tttx-form.cjs",[[1,"tttx-form",{"formschema":[1032],"data":[1032],"submit":[64]}]]],["tttx-keyvalue-block.cjs",[[1,"tttx-keyvalue-block",{"keyvalues":[8],"horizontal":[4]}]]],["tttx-loading-spinner.cjs",[[1,"tttx-loading-spinner",{"loadingMessage":[1028,"loading-message"],"size":[1025]}]]],["tttx-qrcode.cjs",[[1,"tttx-qrcode",{"link":[1025],"size":[1026]}]]],["tttx-tag.cjs",[[1,"tttx-tag",{"text":[1],"color":[1]}]]],["tttx-toolbar.cjs",[[1,"tttx-toolbar",{"border":[4],"viewSize":[32]},[[9,"resize","handleResize"]]]]],["tttx-icon.cjs",[[1,"tttx-icon",{"icon":[1],"color":[1]}]]],["tttx-standalone-input.cjs",[[2,"tttx-standalone-input",{"label":[1],"secondarylabel":[1],"showerrormsg":[4],"showerrorbubble":[4],"errormsg":[1],"iconleft":[1],"iconleftcolor":[1],"iconright":[1],"iconrightcolor":[1],"inputicon":[1],"inputiconcolor":[1],"inline":[4],"inputautocapitalize":[1],"inputautofocus":[4],"inputkeyhint":[1],"inputindex":[8],"inputtitle":[1],"autocomplete":[1],"checked":[4],"disabled":[4],"max":[8],"maxlength":[8],"min":[8],"minlength":[8],"name":[1],"pattern":[1],"placeholder":[1],"readonly":[8],"required":[4],"step":[8],"type":[1],"value":[1032]}]]],["tttx-button.cjs",[[1,"tttx-button",{"notext":[4],"icon":[1],"iconposition":[1],"iconcolor":[1025],"design":[1]}]]]], options);
18
18
  });
19
19
  };
20
20
 
@@ -0,0 +1,97 @@
1
+ 'use strict';
2
+
3
+ Object.defineProperty(exports, '__esModule', { value: true });
4
+
5
+ const index = require('./index-4cfa8e25.js');
6
+ const domsanitiser_options = require('./domsanitiser.options-1dfa7205.js');
7
+ require('./_commonjsHelpers-537d719a.js');
8
+
9
+ const tttxTabsCss = ".material-symbols-rounded.sc-tttx-tabs{font-variation-settings:\"FILL\" 1, \"wght\" 400, \"GRAD\" 0, \"opsz\" 24}.sc-tttx-tabs-h{display:block}.tab-bar.sc-tttx-tabs{display:flex;height:52px}.tab-bar.sc-tttx-tabs>.left-navigation.sc-tttx-tabs,.tab-bar.sc-tttx-tabs>.right-navigation.sc-tttx-tabs{padding:14px 8px;cursor:pointer}.tab-bar.sc-tttx-tabs>.left-navigation.sc-tttx-tabs>*.sc-tttx-tabs,.tab-bar.sc-tttx-tabs>.right-navigation.sc-tttx-tabs>*.sc-tttx-tabs{height:24px;width:24px;cursor:pointer}.tab-bar.sc-tttx-tabs>.tabs-container.sc-tttx-tabs{display:flex;border-bottom:1px solid #d5d5d5}.tab-bar.sc-tttx-tabs>.tabs-container.wide.sc-tttx-tabs{flex-grow:1}.tab-bar.sc-tttx-tabs>.tabs-container.sc-tttx-tabs>*[role=tab].sc-tttx-tabs{padding:18px 16px;line-height:16px;font-size:14px;font-weight:500;text-transform:uppercase;user-select:none;color:#757575;cursor:pointer}.tab-bar.sc-tttx-tabs>.tabs-container.sc-tttx-tabs>*[role=tab].sc-tttx-tabs:hover{background-color:rgba(17, 17, 17, 0.05)}.tab-bar.sc-tttx-tabs>.tabs-container.sc-tttx-tabs>*[role=tab][aria-selected].sc-tttx-tabs{color:#212121;cursor:default;border-bottom:3px solid #1579c6}";
10
+
11
+ const TttxTabs = class {
12
+ constructor(hostRef) {
13
+ index.registerInstance(this, hostRef);
14
+ this.tabClick = index.createEvent(this, "tabClick", 7);
15
+ this.leftNavigation = index.createEvent(this, "leftNavigation", 7);
16
+ this.rightNavigation = index.createEvent(this, "rightNavigation", 7);
17
+ this.tabFocus = 0;
18
+ this.tabsName = undefined;
19
+ this.navigation = undefined;
20
+ this.wide = undefined;
21
+ this.tabs = undefined;
22
+ this._tabs = undefined;
23
+ }
24
+ onDataChange() {
25
+ if (!this.tabs) {
26
+ return;
27
+ }
28
+ if (typeof this.tabs === 'string') {
29
+ this._tabs = JSON.parse(this.tabs);
30
+ }
31
+ else {
32
+ this._tabs = [...this.tabs];
33
+ }
34
+ this.tabFocus = this._tabs.findIndex(tab => tab.tabIndex !== -1);
35
+ }
36
+ componentWillLoad() {
37
+ // dynamic constructor: any props can be added later
38
+ this.onDataChange();
39
+ }
40
+ handleTabClick(tab) {
41
+ this.tabClick.emit({ tabId: tab.id });
42
+ }
43
+ handleLeftNavigation() {
44
+ this.leftNavigation.emit();
45
+ }
46
+ handleRightNavigation() {
47
+ this.rightNavigation.emit();
48
+ }
49
+ handleKeyDown(event) {
50
+ const orientation = this.tabList.getAttribute('aria-orientation'); // horizontal by default
51
+ const previous = orientation && orientation === 'vertical' ? 'ArrowUp' : 'ArrowLeft';
52
+ const next = orientation && orientation === 'vertical' ? 'ArrowDown' : 'ArrowRight';
53
+ if (event.key === previous || event.key === next) {
54
+ // Make the previous tab deselectable
55
+ this._tabs[this.tabFocus].tabIndex = -1;
56
+ if (event.key === previous) {
57
+ this.tabFocus--;
58
+ // If we're at the start, move to the end
59
+ if (this.tabFocus < 0) {
60
+ this.tabFocus = this._tabs.length - 1;
61
+ }
62
+ }
63
+ else if (event.key === next) {
64
+ this.tabFocus++;
65
+ // If we're at the end, go to the start
66
+ if (this.tabFocus >= this._tabs.length) {
67
+ this.tabFocus = 0;
68
+ }
69
+ }
70
+ // Make the next tab selectable
71
+ this._tabs[this.tabFocus].tabIndex = 0;
72
+ this.tabList.querySelectorAll('[role="tab"]')[this.tabFocus].focus();
73
+ this._tabs = [...this._tabs];
74
+ }
75
+ else if (event.code === 'Space' || event.code === 'Enter') {
76
+ this.tabClick.emit({ tabId: this._tabs[this.tabFocus].id });
77
+ }
78
+ }
79
+ render() {
80
+ if (!this.tabs || this.tabs.length == 0) {
81
+ return;
82
+ }
83
+ return (index.h(index.Host, null, index.h("div", null, index.h("div", { class: "tab-bar", role: "tablist", "aria-label": this.tabsName, ref: el => (this.tabList = el) }, this.navigation && (index.h("div", { class: "left-navigation", tabindex: "0", onClick: this.handleLeftNavigation.bind(this) }, index.h("tttx-icon", { icon: "navigate_before", color: "black" }))), index.h("div", { class: 'tabs-container' + (this.wide ? ' wide' : '') }, this._tabs.map(tab => {
84
+ return (index.h("a", { key: tab.id, id: tab.id, role: "tab", "aria-controls": tab.controls, tabindex: tab.tabIndex, "aria-selected": tab.selected, onClick: () => {
85
+ this.handleTabClick(tab);
86
+ } }, tab.tabName));
87
+ })), this.navigation && (index.h("div", { class: "right-navigation", tabindex: "0", onClick: this.handleRightNavigation.bind(this) }, index.h("tttx-icon", { icon: "navigate_next", color: "black" })))), this._tabs.map(tab => {
88
+ return (index.h("article", { key: tab.id, id: tab.controls, role: "tabpanel", tabindex: "0", "aria-labelledby": tab.id, "aria-expanded": tab.selected, innerHTML: domsanitiser_options.purify.sanitize(tab.pageContent, domsanitiser_options.domSanitiserOptions), hidden: !tab.selected }));
89
+ }))));
90
+ }
91
+ static get watchers() { return {
92
+ "tabs": ["onDataChange"]
93
+ }; }
94
+ };
95
+ TttxTabs.style = tttxTabsCss;
96
+
97
+ exports.tttx_tabs = TttxTabs;
@@ -17,7 +17,7 @@ const patchBrowser = () => {
17
17
  };
18
18
 
19
19
  patchBrowser().then(options => {
20
- return index.bootstrapLazy([["tttx-dialog-box.cjs",[[1,"tttx-dialog-box",{"data":[1025],"size":[1],"open":[1028],"allowOverflow":[4,"allow-overflow"],"elementSize":[32]},[[9,"resize","handleResize"]]]]],["tttx-select-box.cjs",[[1,"tttx-select-box",{"optionsData":[1,"options-data"],"label":[1],"inline":[4],"placeholder":[1],"searchEnabled":[4,"search-enabled"],"selectedValue":[1,"selected-value"],"open":[32],"selectedItem":[32],"searchTerm":[32]},[[0,"closeSelectBox","handleCloseSelectBox"],[0,"blur","handleBlur"]]]]],["tttx-tree-view.cjs",[[1,"tttx-tree-view",{"data":[1040],"treeData":[32]}]]],["tttx-filter.cjs",[[1,"tttx-filter",{"filterKey":[1,"filter-key"],"filterOptions":[1,"filter-options"],"showSelectAll":[4,"show-select-all"],"showSearchField":[4,"show-search-field"],"showOptionIcons":[4,"show-option-icons"],"filterButtonStyle":[1,"filter-button-style"],"filterHeader":[1,"filter-header"],"defaultFilterOptions":[1,"default-filter-options"],"popoverWidth":[1,"popover-width"],"showPopover":[32],"displayedFilterSettings":[32],"selectedFilters":[32],"filterSearchTerm":[32],"allSelected":[32]},[[0,"closeFilter","handleCloseFilter"]]]]],["tttx-list.cjs",[[1,"tttx-list",{"data":[1025],"name":[1],"_data":[32]}]]],["tttx-sorter.cjs",[[1,"tttx-sorter",{"sorterKey":[1,"sorter-key"],"defaultSortDirection":[1,"default-sort-direction"],"fieldOptionsData":[1,"field-options-data"],"defaultOption":[1,"default-option"],"selectedField":[32],"sortDirection":[32],"dropdownExpand":[32],"dropdownOptions":[32]},[[0,"closeSorter","handleCloseSorter"]]]]],["tttx-form.cjs",[[1,"tttx-form",{"formschema":[1032],"data":[1032],"submit":[64]}]]],["tttx-keyvalue-block.cjs",[[1,"tttx-keyvalue-block",{"keyvalues":[8],"horizontal":[4]}]]],["tttx-loading-spinner.cjs",[[1,"tttx-loading-spinner",{"loadingMessage":[1028,"loading-message"],"size":[1025]}]]],["tttx-qrcode.cjs",[[1,"tttx-qrcode",{"link":[1025],"size":[1026]}]]],["tttx-tag.cjs",[[1,"tttx-tag",{"text":[1],"color":[1]}]]],["tttx-toolbar.cjs",[[1,"tttx-toolbar",{"border":[4],"viewSize":[32]},[[9,"resize","handleResize"]]]]],["tttx-icon.cjs",[[1,"tttx-icon",{"icon":[1],"color":[1]}]]],["tttx-standalone-input.cjs",[[2,"tttx-standalone-input",{"label":[1],"secondarylabel":[1],"showerrormsg":[4],"showerrorbubble":[4],"errormsg":[1],"iconleft":[1],"iconleftcolor":[1],"iconright":[1],"iconrightcolor":[1],"inputicon":[1],"inputiconcolor":[1],"inline":[4],"inputautocapitalize":[1],"inputautofocus":[4],"inputkeyhint":[1],"inputindex":[8],"inputtitle":[1],"autocomplete":[1],"checked":[4],"disabled":[4],"max":[8],"maxlength":[8],"min":[8],"minlength":[8],"name":[1],"pattern":[1],"placeholder":[1],"readonly":[8],"required":[4],"step":[8],"type":[1],"value":[1032]}]]],["tttx-button.cjs",[[1,"tttx-button",{"notext":[4],"icon":[1],"iconposition":[1],"iconcolor":[1025],"design":[1]}]]]], options);
20
+ return index.bootstrapLazy([["tttx-dialog-box.cjs",[[1,"tttx-dialog-box",{"data":[1025],"size":[1],"open":[1028],"allowOverflow":[4,"allow-overflow"],"elementSize":[32]},[[9,"resize","handleResize"]]]]],["tttx-select-box.cjs",[[1,"tttx-select-box",{"optionsData":[1,"options-data"],"label":[1],"inline":[4],"placeholder":[1],"searchEnabled":[4,"search-enabled"],"selectedValue":[1,"selected-value"],"open":[32],"selectedItem":[32],"searchTerm":[32]},[[0,"closeSelectBox","handleCloseSelectBox"],[0,"blur","handleBlur"]]]]],["tttx-tree-view.cjs",[[1,"tttx-tree-view",{"data":[1040],"treeData":[32]}]]],["tttx-filter.cjs",[[1,"tttx-filter",{"filterKey":[1,"filter-key"],"filterOptions":[1,"filter-options"],"showSelectAll":[4,"show-select-all"],"showSearchField":[4,"show-search-field"],"showOptionIcons":[4,"show-option-icons"],"filterButtonStyle":[1,"filter-button-style"],"filterHeader":[1,"filter-header"],"defaultFilterOptions":[1,"default-filter-options"],"popoverWidth":[1,"popover-width"],"showPopover":[32],"displayedFilterSettings":[32],"selectedFilters":[32],"filterSearchTerm":[32],"allSelected":[32]},[[0,"closeFilter","handleCloseFilter"]]]]],["tttx-list.cjs",[[1,"tttx-list",{"data":[1025],"name":[1],"_data":[32]}]]],["tttx-sorter.cjs",[[1,"tttx-sorter",{"sorterKey":[1,"sorter-key"],"defaultSortDirection":[1,"default-sort-direction"],"fieldOptionsData":[1,"field-options-data"],"defaultOption":[1,"default-option"],"selectedField":[32],"sortDirection":[32],"dropdownExpand":[32],"dropdownOptions":[32]},[[0,"closeSorter","handleCloseSorter"]]]]],["tttx-tabs.cjs",[[2,"tttx-tabs",{"tabsName":[1,"tabs-name"],"navigation":[4],"wide":[4],"tabs":[1],"_tabs":[32]},[[0,"keydown","handleKeyDown"]]]]],["tttx-form.cjs",[[1,"tttx-form",{"formschema":[1032],"data":[1032],"submit":[64]}]]],["tttx-keyvalue-block.cjs",[[1,"tttx-keyvalue-block",{"keyvalues":[8],"horizontal":[4]}]]],["tttx-loading-spinner.cjs",[[1,"tttx-loading-spinner",{"loadingMessage":[1028,"loading-message"],"size":[1025]}]]],["tttx-qrcode.cjs",[[1,"tttx-qrcode",{"link":[1025],"size":[1026]}]]],["tttx-tag.cjs",[[1,"tttx-tag",{"text":[1],"color":[1]}]]],["tttx-toolbar.cjs",[[1,"tttx-toolbar",{"border":[4],"viewSize":[32]},[[9,"resize","handleResize"]]]]],["tttx-icon.cjs",[[1,"tttx-icon",{"icon":[1],"color":[1]}]]],["tttx-standalone-input.cjs",[[2,"tttx-standalone-input",{"label":[1],"secondarylabel":[1],"showerrormsg":[4],"showerrorbubble":[4],"errormsg":[1],"iconleft":[1],"iconleftcolor":[1],"iconright":[1],"iconrightcolor":[1],"inputicon":[1],"inputiconcolor":[1],"inline":[4],"inputautocapitalize":[1],"inputautofocus":[4],"inputkeyhint":[1],"inputindex":[8],"inputtitle":[1],"autocomplete":[1],"checked":[4],"disabled":[4],"max":[8],"maxlength":[8],"min":[8],"minlength":[8],"name":[1],"pattern":[1],"placeholder":[1],"readonly":[8],"required":[4],"step":[8],"type":[1],"value":[1032]}]]],["tttx-button.cjs",[[1,"tttx-button",{"notext":[4],"icon":[1],"iconposition":[1],"iconcolor":[1025],"design":[1]}]]]], options);
21
21
  });
22
22
 
23
23
  exports.setNonce = index.setNonce;
@@ -13,6 +13,7 @@
13
13
  "./components/molecules/tttx-list/tttx-list.js",
14
14
  "./components/molecules/tttx-select-box/tttx-select-box.js",
15
15
  "./components/molecules/tttx-sorter/tttx-sorter.js",
16
+ "./components/molecules/tttx-tabs/tttx-tabs.js",
16
17
  "./components/molecules/tttx-toolbar/tttx-toolbar.js",
17
18
  "./components/molecules/tttx-tree-view/tttx-tree-view.js"
18
19
  ],
@@ -0,0 +1,46 @@
1
+ .material-symbols-rounded {
2
+ font-variation-settings: "FILL" 1, "wght" 400, "GRAD" 0, "opsz" 24;
3
+ }
4
+
5
+ :host {
6
+ display: block;
7
+ }
8
+
9
+ .tab-bar {
10
+ display: flex;
11
+ height: 52px;
12
+ }
13
+ .tab-bar > .left-navigation, .tab-bar > .right-navigation {
14
+ padding: 14px 8px;
15
+ cursor: pointer;
16
+ }
17
+ .tab-bar > .left-navigation > *, .tab-bar > .right-navigation > * {
18
+ height: 24px;
19
+ width: 24px;
20
+ cursor: pointer;
21
+ }
22
+ .tab-bar > .tabs-container {
23
+ display: flex;
24
+ border-bottom: 1px solid #d5d5d5;
25
+ }
26
+ .tab-bar > .tabs-container.wide {
27
+ flex-grow: 1;
28
+ }
29
+ .tab-bar > .tabs-container > *[role=tab] {
30
+ padding: 18px 16px;
31
+ line-height: 16px;
32
+ font-size: 14px;
33
+ font-weight: 500;
34
+ text-transform: uppercase;
35
+ user-select: none;
36
+ color: #757575;
37
+ cursor: pointer;
38
+ }
39
+ .tab-bar > .tabs-container > *[role=tab]:hover {
40
+ background-color: rgba(17, 17, 17, 0.05);
41
+ }
42
+ .tab-bar > .tabs-container > *[role=tab][aria-selected] {
43
+ color: #212121;
44
+ cursor: default;
45
+ border-bottom: 3px solid #1579c6;
46
+ }
@@ -0,0 +1,237 @@
1
+ import { Host, h } from '@stencil/core';
2
+ import * as DOMPurify from 'dompurify';
3
+ import domSanitiserOptions from '../../../shared/domsanitiser.options';
4
+ export class TttxTabs {
5
+ constructor() {
6
+ this.tabFocus = 0;
7
+ this.tabsName = undefined;
8
+ this.navigation = undefined;
9
+ this.wide = undefined;
10
+ this.tabs = undefined;
11
+ this._tabs = undefined;
12
+ }
13
+ onDataChange() {
14
+ if (!this.tabs) {
15
+ return;
16
+ }
17
+ if (typeof this.tabs === 'string') {
18
+ this._tabs = JSON.parse(this.tabs);
19
+ }
20
+ else {
21
+ this._tabs = [...this.tabs];
22
+ }
23
+ this.tabFocus = this._tabs.findIndex(tab => tab.tabIndex !== -1);
24
+ }
25
+ componentWillLoad() {
26
+ // dynamic constructor: any props can be added later
27
+ this.onDataChange();
28
+ }
29
+ handleTabClick(tab) {
30
+ this.tabClick.emit({ tabId: tab.id });
31
+ }
32
+ handleLeftNavigation() {
33
+ this.leftNavigation.emit();
34
+ }
35
+ handleRightNavigation() {
36
+ this.rightNavigation.emit();
37
+ }
38
+ handleKeyDown(event) {
39
+ const orientation = this.tabList.getAttribute('aria-orientation'); // horizontal by default
40
+ const previous = orientation && orientation === 'vertical' ? 'ArrowUp' : 'ArrowLeft';
41
+ const next = orientation && orientation === 'vertical' ? 'ArrowDown' : 'ArrowRight';
42
+ if (event.key === previous || event.key === next) {
43
+ // Make the previous tab deselectable
44
+ this._tabs[this.tabFocus].tabIndex = -1;
45
+ if (event.key === previous) {
46
+ this.tabFocus--;
47
+ // If we're at the start, move to the end
48
+ if (this.tabFocus < 0) {
49
+ this.tabFocus = this._tabs.length - 1;
50
+ }
51
+ }
52
+ else if (event.key === next) {
53
+ this.tabFocus++;
54
+ // If we're at the end, go to the start
55
+ if (this.tabFocus >= this._tabs.length) {
56
+ this.tabFocus = 0;
57
+ }
58
+ }
59
+ // Make the next tab selectable
60
+ this._tabs[this.tabFocus].tabIndex = 0;
61
+ this.tabList.querySelectorAll('[role="tab"]')[this.tabFocus].focus();
62
+ this._tabs = [...this._tabs];
63
+ }
64
+ else if (event.code === 'Space' || event.code === 'Enter') {
65
+ this.tabClick.emit({ tabId: this._tabs[this.tabFocus].id });
66
+ }
67
+ }
68
+ render() {
69
+ if (!this.tabs || this.tabs.length == 0) {
70
+ return;
71
+ }
72
+ return (h(Host, null, h("div", null, h("div", { class: "tab-bar", role: "tablist", "aria-label": this.tabsName, ref: el => (this.tabList = el) }, this.navigation && (h("div", { class: "left-navigation", tabindex: "0", onClick: this.handleLeftNavigation.bind(this) }, h("tttx-icon", { icon: "navigate_before", color: "black" }))), h("div", { class: 'tabs-container' + (this.wide ? ' wide' : '') }, this._tabs.map(tab => {
73
+ return (h("a", { key: tab.id, id: tab.id, role: "tab", "aria-controls": tab.controls, tabindex: tab.tabIndex, "aria-selected": tab.selected, onClick: () => {
74
+ this.handleTabClick(tab);
75
+ } }, tab.tabName));
76
+ })), this.navigation && (h("div", { class: "right-navigation", tabindex: "0", onClick: this.handleRightNavigation.bind(this) }, h("tttx-icon", { icon: "navigate_next", color: "black" })))), this._tabs.map(tab => {
77
+ return (h("article", { key: tab.id, id: tab.controls, role: "tabpanel", tabindex: "0", "aria-labelledby": tab.id, "aria-expanded": tab.selected, innerHTML: DOMPurify.sanitize(tab.pageContent, domSanitiserOptions), hidden: !tab.selected }));
78
+ }))));
79
+ }
80
+ static get is() { return "tttx-tabs"; }
81
+ static get encapsulation() { return "scoped"; }
82
+ static get originalStyleUrls() {
83
+ return {
84
+ "$": ["tttx-tabs.scss"]
85
+ };
86
+ }
87
+ static get styleUrls() {
88
+ return {
89
+ "$": ["tttx-tabs.css"]
90
+ };
91
+ }
92
+ static get properties() {
93
+ return {
94
+ "tabsName": {
95
+ "type": "string",
96
+ "mutable": false,
97
+ "complexType": {
98
+ "original": "string",
99
+ "resolved": "string",
100
+ "references": {}
101
+ },
102
+ "required": false,
103
+ "optional": false,
104
+ "docs": {
105
+ "tags": [],
106
+ "text": ""
107
+ },
108
+ "attribute": "tabs-name",
109
+ "reflect": false
110
+ },
111
+ "navigation": {
112
+ "type": "boolean",
113
+ "mutable": false,
114
+ "complexType": {
115
+ "original": "boolean",
116
+ "resolved": "boolean",
117
+ "references": {}
118
+ },
119
+ "required": false,
120
+ "optional": false,
121
+ "docs": {
122
+ "tags": [],
123
+ "text": ""
124
+ },
125
+ "attribute": "navigation",
126
+ "reflect": false
127
+ },
128
+ "wide": {
129
+ "type": "boolean",
130
+ "mutable": false,
131
+ "complexType": {
132
+ "original": "boolean",
133
+ "resolved": "boolean",
134
+ "references": {}
135
+ },
136
+ "required": false,
137
+ "optional": false,
138
+ "docs": {
139
+ "tags": [],
140
+ "text": ""
141
+ },
142
+ "attribute": "wide",
143
+ "reflect": false
144
+ },
145
+ "tabs": {
146
+ "type": "string",
147
+ "mutable": false,
148
+ "complexType": {
149
+ "original": "string | Tab[]",
150
+ "resolved": "Tab[] | string",
151
+ "references": {
152
+ "Tab": {
153
+ "location": "import",
154
+ "path": "./interfaces"
155
+ }
156
+ }
157
+ },
158
+ "required": false,
159
+ "optional": false,
160
+ "docs": {
161
+ "tags": [],
162
+ "text": ""
163
+ },
164
+ "attribute": "tabs",
165
+ "reflect": false
166
+ }
167
+ };
168
+ }
169
+ static get states() {
170
+ return {
171
+ "_tabs": {}
172
+ };
173
+ }
174
+ static get events() {
175
+ return [{
176
+ "method": "tabClick",
177
+ "name": "tabClick",
178
+ "bubbles": true,
179
+ "cancelable": true,
180
+ "composed": true,
181
+ "docs": {
182
+ "tags": [],
183
+ "text": ""
184
+ },
185
+ "complexType": {
186
+ "original": "{ tabId: string }",
187
+ "resolved": "{ tabId: string; }",
188
+ "references": {}
189
+ }
190
+ }, {
191
+ "method": "leftNavigation",
192
+ "name": "leftNavigation",
193
+ "bubbles": true,
194
+ "cancelable": true,
195
+ "composed": true,
196
+ "docs": {
197
+ "tags": [],
198
+ "text": ""
199
+ },
200
+ "complexType": {
201
+ "original": "any",
202
+ "resolved": "any",
203
+ "references": {}
204
+ }
205
+ }, {
206
+ "method": "rightNavigation",
207
+ "name": "rightNavigation",
208
+ "bubbles": true,
209
+ "cancelable": true,
210
+ "composed": true,
211
+ "docs": {
212
+ "tags": [],
213
+ "text": ""
214
+ },
215
+ "complexType": {
216
+ "original": "any",
217
+ "resolved": "any",
218
+ "references": {}
219
+ }
220
+ }];
221
+ }
222
+ static get watchers() {
223
+ return [{
224
+ "propName": "tabs",
225
+ "methodName": "onDataChange"
226
+ }];
227
+ }
228
+ static get listeners() {
229
+ return [{
230
+ "name": "keydown",
231
+ "method": "handleKeyDown",
232
+ "target": undefined,
233
+ "capture": false,
234
+ "passive": false
235
+ }];
236
+ }
237
+ }
@@ -0,0 +1,91 @@
1
+ import { withActions } from '@storybook/addon-actions/decorator';
2
+ export default {
3
+ title: 'molecules/Tabs',
4
+ component: 'tttx-tabs',
5
+ parameters: {
6
+ actions: {
7
+ handles: ['tabClick', 'leftNavigation', 'rightNavigation'],
8
+ },
9
+ },
10
+ decorators: [withActions],
11
+ };
12
+ const Default = ({ tabsName, navigation, wide, tabs }) => `
13
+ <tttx-tabs
14
+ tabsName='${tabsName}'
15
+ navigation='${navigation}'
16
+ wide='${wide}'
17
+ tabs='${JSON.stringify(tabs)}'
18
+ ></tttx-tabs>
19
+ `;
20
+ export const DefaultTabs = Default.bind({});
21
+ DefaultTabs.args = {
22
+ tabsName: 'Default tabs',
23
+ navigation: false,
24
+ wide: true,
25
+ tabs: [
26
+ {
27
+ id: 'profileTab',
28
+ tabName: 'Profile',
29
+ controls: 'profile',
30
+ selected: true,
31
+ tabIndex: 0,
32
+ pageContent: '<h1>Profile page / component</h1>',
33
+ },
34
+ {
35
+ id: 'complianceTab',
36
+ tabName: 'Compliance',
37
+ controls: 'compliance',
38
+ selected: false,
39
+ tabIndex: -1,
40
+ pageContent: '<h1>Compliance page / component</h1>',
41
+ },
42
+ {
43
+ id: 'competenceTab',
44
+ tabName: 'Competence',
45
+ controls: 'competence',
46
+ selected: false,
47
+ tabIndex: -1,
48
+ pageContent: '<h1>Competence page / component</h1>',
49
+ },
50
+ ],
51
+ };
52
+ const TabsWithNavigation = ({ tabsName, navigation, wide, tabs }) => `
53
+ <tttx-tabs
54
+ tabsName='${tabsName}'
55
+ navigation='${navigation}'
56
+ wide='${wide}'
57
+ tabs='${JSON.stringify(tabs)}'
58
+ ></tttx-tabs>
59
+ `;
60
+ export const NavigationTabs = TabsWithNavigation.bind({});
61
+ NavigationTabs.args = {
62
+ tabsName: 'Navigation tabs',
63
+ navigation: true,
64
+ wide: false,
65
+ tabs: [
66
+ {
67
+ id: 'firstTab',
68
+ tabName: 'Tab one',
69
+ controls: 'one',
70
+ selected: true,
71
+ tabIndex: 0,
72
+ pageContent: '',
73
+ },
74
+ {
75
+ id: 'secondTab',
76
+ tabName: 'Tab two',
77
+ controls: 'two',
78
+ selected: false,
79
+ tabIndex: -1,
80
+ pageContent: '',
81
+ },
82
+ {
83
+ id: 'thirdTab',
84
+ tabName: 'Tab three',
85
+ controls: 'three',
86
+ selected: false,
87
+ tabIndex: -1,
88
+ pageContent: '',
89
+ },
90
+ ],
91
+ };
@@ -11,6 +11,7 @@ export { TttxQrCode as TttxQrcode } from '../types/components/atoms/tttx-qrcode/
11
11
  export { TttxSelectBox as TttxSelectBox } from '../types/components/molecules/tttx-select-box/tttx-select-box';
12
12
  export { TttxSorter as TttxSorter } from '../types/components/molecules/tttx-sorter/tttx-sorter';
13
13
  export { TttxInput as TttxStandaloneInput } from '../types/components/molecules/tttx-standalone-input/tttx-standalone-input';
14
+ export { TttxTabs as TttxTabs } from '../types/components/molecules/tttx-tabs/tttx-tabs';
14
15
  export { TttxTag as TttxTag } from '../types/components/atoms/tttx-tag/tttx-tag';
15
16
  export { TttxToolbar as TttxToolbar } from '../types/components/molecules/tttx-toolbar/tttx-toolbar';
16
17
  export { TttxTreeView as TttxTreeView } from '../types/components/molecules/tttx-tree-view/tttx-tree-view';
@@ -11,6 +11,7 @@ export { TttxQrcode, defineCustomElement as defineCustomElementTttxQrcode } from
11
11
  export { TttxSelectBox, defineCustomElement as defineCustomElementTttxSelectBox } from './tttx-select-box.js';
12
12
  export { TttxSorter, defineCustomElement as defineCustomElementTttxSorter } from './tttx-sorter.js';
13
13
  export { TttxStandaloneInput, defineCustomElement as defineCustomElementTttxStandaloneInput } from './tttx-standalone-input.js';
14
+ export { TttxTabs, defineCustomElement as defineCustomElementTttxTabs } from './tttx-tabs.js';
14
15
  export { TttxTag, defineCustomElement as defineCustomElementTttxTag } from './tttx-tag.js';
15
16
  export { TttxToolbar, defineCustomElement as defineCustomElementTttxToolbar } from './tttx-toolbar.js';
16
17
  export { TttxTreeView, defineCustomElement as defineCustomElementTttxTreeView } from './tttx-tree-view.js';
@@ -0,0 +1,11 @@
1
+ import type { Components, JSX } from "../types/components";
2
+
3
+ interface TttxTabs extends Components.TttxTabs, HTMLElement {}
4
+ export const TttxTabs: {
5
+ prototype: TttxTabs;
6
+ new (): TttxTabs;
7
+ };
8
+ /**
9
+ * Used to define this component and all nested components recursively.
10
+ */
11
+ export const defineCustomElement: () => void;
@@ -0,0 +1,121 @@
1
+ import { proxyCustomElement, HTMLElement, createEvent, h, Host } from '@stencil/core/internal/client';
2
+ import { p as purify, d as domSanitiserOptions } from './domsanitiser.options.js';
3
+ import { d as defineCustomElement$2 } from './tttx-icon2.js';
4
+
5
+ const tttxTabsCss = ".material-symbols-rounded.sc-tttx-tabs{font-variation-settings:\"FILL\" 1, \"wght\" 400, \"GRAD\" 0, \"opsz\" 24}.sc-tttx-tabs-h{display:block}.tab-bar.sc-tttx-tabs{display:flex;height:52px}.tab-bar.sc-tttx-tabs>.left-navigation.sc-tttx-tabs,.tab-bar.sc-tttx-tabs>.right-navigation.sc-tttx-tabs{padding:14px 8px;cursor:pointer}.tab-bar.sc-tttx-tabs>.left-navigation.sc-tttx-tabs>*.sc-tttx-tabs,.tab-bar.sc-tttx-tabs>.right-navigation.sc-tttx-tabs>*.sc-tttx-tabs{height:24px;width:24px;cursor:pointer}.tab-bar.sc-tttx-tabs>.tabs-container.sc-tttx-tabs{display:flex;border-bottom:1px solid #d5d5d5}.tab-bar.sc-tttx-tabs>.tabs-container.wide.sc-tttx-tabs{flex-grow:1}.tab-bar.sc-tttx-tabs>.tabs-container.sc-tttx-tabs>*[role=tab].sc-tttx-tabs{padding:18px 16px;line-height:16px;font-size:14px;font-weight:500;text-transform:uppercase;user-select:none;color:#757575;cursor:pointer}.tab-bar.sc-tttx-tabs>.tabs-container.sc-tttx-tabs>*[role=tab].sc-tttx-tabs:hover{background-color:rgba(17, 17, 17, 0.05)}.tab-bar.sc-tttx-tabs>.tabs-container.sc-tttx-tabs>*[role=tab][aria-selected].sc-tttx-tabs{color:#212121;cursor:default;border-bottom:3px solid #1579c6}";
6
+
7
+ const TttxTabs$1 = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
8
+ constructor() {
9
+ super();
10
+ this.__registerHost();
11
+ this.tabClick = createEvent(this, "tabClick", 7);
12
+ this.leftNavigation = createEvent(this, "leftNavigation", 7);
13
+ this.rightNavigation = createEvent(this, "rightNavigation", 7);
14
+ this.tabFocus = 0;
15
+ this.tabsName = undefined;
16
+ this.navigation = undefined;
17
+ this.wide = undefined;
18
+ this.tabs = undefined;
19
+ this._tabs = undefined;
20
+ }
21
+ onDataChange() {
22
+ if (!this.tabs) {
23
+ return;
24
+ }
25
+ if (typeof this.tabs === 'string') {
26
+ this._tabs = JSON.parse(this.tabs);
27
+ }
28
+ else {
29
+ this._tabs = [...this.tabs];
30
+ }
31
+ this.tabFocus = this._tabs.findIndex(tab => tab.tabIndex !== -1);
32
+ }
33
+ componentWillLoad() {
34
+ // dynamic constructor: any props can be added later
35
+ this.onDataChange();
36
+ }
37
+ handleTabClick(tab) {
38
+ this.tabClick.emit({ tabId: tab.id });
39
+ }
40
+ handleLeftNavigation() {
41
+ this.leftNavigation.emit();
42
+ }
43
+ handleRightNavigation() {
44
+ this.rightNavigation.emit();
45
+ }
46
+ handleKeyDown(event) {
47
+ const orientation = this.tabList.getAttribute('aria-orientation'); // horizontal by default
48
+ const previous = orientation && orientation === 'vertical' ? 'ArrowUp' : 'ArrowLeft';
49
+ const next = orientation && orientation === 'vertical' ? 'ArrowDown' : 'ArrowRight';
50
+ if (event.key === previous || event.key === next) {
51
+ // Make the previous tab deselectable
52
+ this._tabs[this.tabFocus].tabIndex = -1;
53
+ if (event.key === previous) {
54
+ this.tabFocus--;
55
+ // If we're at the start, move to the end
56
+ if (this.tabFocus < 0) {
57
+ this.tabFocus = this._tabs.length - 1;
58
+ }
59
+ }
60
+ else if (event.key === next) {
61
+ this.tabFocus++;
62
+ // If we're at the end, go to the start
63
+ if (this.tabFocus >= this._tabs.length) {
64
+ this.tabFocus = 0;
65
+ }
66
+ }
67
+ // Make the next tab selectable
68
+ this._tabs[this.tabFocus].tabIndex = 0;
69
+ this.tabList.querySelectorAll('[role="tab"]')[this.tabFocus].focus();
70
+ this._tabs = [...this._tabs];
71
+ }
72
+ else if (event.code === 'Space' || event.code === 'Enter') {
73
+ this.tabClick.emit({ tabId: this._tabs[this.tabFocus].id });
74
+ }
75
+ }
76
+ render() {
77
+ if (!this.tabs || this.tabs.length == 0) {
78
+ return;
79
+ }
80
+ return (h(Host, null, h("div", null, h("div", { class: "tab-bar", role: "tablist", "aria-label": this.tabsName, ref: el => (this.tabList = el) }, this.navigation && (h("div", { class: "left-navigation", tabindex: "0", onClick: this.handleLeftNavigation.bind(this) }, h("tttx-icon", { icon: "navigate_before", color: "black" }))), h("div", { class: 'tabs-container' + (this.wide ? ' wide' : '') }, this._tabs.map(tab => {
81
+ return (h("a", { key: tab.id, id: tab.id, role: "tab", "aria-controls": tab.controls, tabindex: tab.tabIndex, "aria-selected": tab.selected, onClick: () => {
82
+ this.handleTabClick(tab);
83
+ } }, tab.tabName));
84
+ })), this.navigation && (h("div", { class: "right-navigation", tabindex: "0", onClick: this.handleRightNavigation.bind(this) }, h("tttx-icon", { icon: "navigate_next", color: "black" })))), this._tabs.map(tab => {
85
+ return (h("article", { key: tab.id, id: tab.controls, role: "tabpanel", tabindex: "0", "aria-labelledby": tab.id, "aria-expanded": tab.selected, innerHTML: purify.sanitize(tab.pageContent, domSanitiserOptions), hidden: !tab.selected }));
86
+ }))));
87
+ }
88
+ static get watchers() { return {
89
+ "tabs": ["onDataChange"]
90
+ }; }
91
+ static get style() { return tttxTabsCss; }
92
+ }, [2, "tttx-tabs", {
93
+ "tabsName": [1, "tabs-name"],
94
+ "navigation": [4],
95
+ "wide": [4],
96
+ "tabs": [1],
97
+ "_tabs": [32]
98
+ }, [[0, "keydown", "handleKeyDown"]]]);
99
+ function defineCustomElement$1() {
100
+ if (typeof customElements === "undefined") {
101
+ return;
102
+ }
103
+ const components = ["tttx-tabs", "tttx-icon"];
104
+ components.forEach(tagName => { switch (tagName) {
105
+ case "tttx-tabs":
106
+ if (!customElements.get(tagName)) {
107
+ customElements.define(tagName, TttxTabs$1);
108
+ }
109
+ break;
110
+ case "tttx-icon":
111
+ if (!customElements.get(tagName)) {
112
+ defineCustomElement$2();
113
+ }
114
+ break;
115
+ } });
116
+ }
117
+
118
+ const TttxTabs = TttxTabs$1;
119
+ const defineCustomElement = defineCustomElement$1;
120
+
121
+ export { TttxTabs, defineCustomElement };
@@ -11,7 +11,7 @@ const patchEsm = () => {
11
11
  const defineCustomElements = (win, options) => {
12
12
  if (typeof window === 'undefined') return Promise.resolve();
13
13
  return patchEsm().then(() => {
14
- return bootstrapLazy([["tttx-dialog-box",[[1,"tttx-dialog-box",{"data":[1025],"size":[1],"open":[1028],"allowOverflow":[4,"allow-overflow"],"elementSize":[32]},[[9,"resize","handleResize"]]]]],["tttx-select-box",[[1,"tttx-select-box",{"optionsData":[1,"options-data"],"label":[1],"inline":[4],"placeholder":[1],"searchEnabled":[4,"search-enabled"],"selectedValue":[1,"selected-value"],"open":[32],"selectedItem":[32],"searchTerm":[32]},[[0,"closeSelectBox","handleCloseSelectBox"],[0,"blur","handleBlur"]]]]],["tttx-tree-view",[[1,"tttx-tree-view",{"data":[1040],"treeData":[32]}]]],["tttx-filter",[[1,"tttx-filter",{"filterKey":[1,"filter-key"],"filterOptions":[1,"filter-options"],"showSelectAll":[4,"show-select-all"],"showSearchField":[4,"show-search-field"],"showOptionIcons":[4,"show-option-icons"],"filterButtonStyle":[1,"filter-button-style"],"filterHeader":[1,"filter-header"],"defaultFilterOptions":[1,"default-filter-options"],"popoverWidth":[1,"popover-width"],"showPopover":[32],"displayedFilterSettings":[32],"selectedFilters":[32],"filterSearchTerm":[32],"allSelected":[32]},[[0,"closeFilter","handleCloseFilter"]]]]],["tttx-list",[[1,"tttx-list",{"data":[1025],"name":[1],"_data":[32]}]]],["tttx-sorter",[[1,"tttx-sorter",{"sorterKey":[1,"sorter-key"],"defaultSortDirection":[1,"default-sort-direction"],"fieldOptionsData":[1,"field-options-data"],"defaultOption":[1,"default-option"],"selectedField":[32],"sortDirection":[32],"dropdownExpand":[32],"dropdownOptions":[32]},[[0,"closeSorter","handleCloseSorter"]]]]],["tttx-form",[[1,"tttx-form",{"formschema":[1032],"data":[1032],"submit":[64]}]]],["tttx-keyvalue-block",[[1,"tttx-keyvalue-block",{"keyvalues":[8],"horizontal":[4]}]]],["tttx-loading-spinner",[[1,"tttx-loading-spinner",{"loadingMessage":[1028,"loading-message"],"size":[1025]}]]],["tttx-qrcode",[[1,"tttx-qrcode",{"link":[1025],"size":[1026]}]]],["tttx-tag",[[1,"tttx-tag",{"text":[1],"color":[1]}]]],["tttx-toolbar",[[1,"tttx-toolbar",{"border":[4],"viewSize":[32]},[[9,"resize","handleResize"]]]]],["tttx-icon",[[1,"tttx-icon",{"icon":[1],"color":[1]}]]],["tttx-standalone-input",[[2,"tttx-standalone-input",{"label":[1],"secondarylabel":[1],"showerrormsg":[4],"showerrorbubble":[4],"errormsg":[1],"iconleft":[1],"iconleftcolor":[1],"iconright":[1],"iconrightcolor":[1],"inputicon":[1],"inputiconcolor":[1],"inline":[4],"inputautocapitalize":[1],"inputautofocus":[4],"inputkeyhint":[1],"inputindex":[8],"inputtitle":[1],"autocomplete":[1],"checked":[4],"disabled":[4],"max":[8],"maxlength":[8],"min":[8],"minlength":[8],"name":[1],"pattern":[1],"placeholder":[1],"readonly":[8],"required":[4],"step":[8],"type":[1],"value":[1032]}]]],["tttx-button",[[1,"tttx-button",{"notext":[4],"icon":[1],"iconposition":[1],"iconcolor":[1025],"design":[1]}]]]], options);
14
+ return bootstrapLazy([["tttx-dialog-box",[[1,"tttx-dialog-box",{"data":[1025],"size":[1],"open":[1028],"allowOverflow":[4,"allow-overflow"],"elementSize":[32]},[[9,"resize","handleResize"]]]]],["tttx-select-box",[[1,"tttx-select-box",{"optionsData":[1,"options-data"],"label":[1],"inline":[4],"placeholder":[1],"searchEnabled":[4,"search-enabled"],"selectedValue":[1,"selected-value"],"open":[32],"selectedItem":[32],"searchTerm":[32]},[[0,"closeSelectBox","handleCloseSelectBox"],[0,"blur","handleBlur"]]]]],["tttx-tree-view",[[1,"tttx-tree-view",{"data":[1040],"treeData":[32]}]]],["tttx-filter",[[1,"tttx-filter",{"filterKey":[1,"filter-key"],"filterOptions":[1,"filter-options"],"showSelectAll":[4,"show-select-all"],"showSearchField":[4,"show-search-field"],"showOptionIcons":[4,"show-option-icons"],"filterButtonStyle":[1,"filter-button-style"],"filterHeader":[1,"filter-header"],"defaultFilterOptions":[1,"default-filter-options"],"popoverWidth":[1,"popover-width"],"showPopover":[32],"displayedFilterSettings":[32],"selectedFilters":[32],"filterSearchTerm":[32],"allSelected":[32]},[[0,"closeFilter","handleCloseFilter"]]]]],["tttx-list",[[1,"tttx-list",{"data":[1025],"name":[1],"_data":[32]}]]],["tttx-sorter",[[1,"tttx-sorter",{"sorterKey":[1,"sorter-key"],"defaultSortDirection":[1,"default-sort-direction"],"fieldOptionsData":[1,"field-options-data"],"defaultOption":[1,"default-option"],"selectedField":[32],"sortDirection":[32],"dropdownExpand":[32],"dropdownOptions":[32]},[[0,"closeSorter","handleCloseSorter"]]]]],["tttx-tabs",[[2,"tttx-tabs",{"tabsName":[1,"tabs-name"],"navigation":[4],"wide":[4],"tabs":[1],"_tabs":[32]},[[0,"keydown","handleKeyDown"]]]]],["tttx-form",[[1,"tttx-form",{"formschema":[1032],"data":[1032],"submit":[64]}]]],["tttx-keyvalue-block",[[1,"tttx-keyvalue-block",{"keyvalues":[8],"horizontal":[4]}]]],["tttx-loading-spinner",[[1,"tttx-loading-spinner",{"loadingMessage":[1028,"loading-message"],"size":[1025]}]]],["tttx-qrcode",[[1,"tttx-qrcode",{"link":[1025],"size":[1026]}]]],["tttx-tag",[[1,"tttx-tag",{"text":[1],"color":[1]}]]],["tttx-toolbar",[[1,"tttx-toolbar",{"border":[4],"viewSize":[32]},[[9,"resize","handleResize"]]]]],["tttx-icon",[[1,"tttx-icon",{"icon":[1],"color":[1]}]]],["tttx-standalone-input",[[2,"tttx-standalone-input",{"label":[1],"secondarylabel":[1],"showerrormsg":[4],"showerrorbubble":[4],"errormsg":[1],"iconleft":[1],"iconleftcolor":[1],"iconright":[1],"iconrightcolor":[1],"inputicon":[1],"inputiconcolor":[1],"inline":[4],"inputautocapitalize":[1],"inputautofocus":[4],"inputkeyhint":[1],"inputindex":[8],"inputtitle":[1],"autocomplete":[1],"checked":[4],"disabled":[4],"max":[8],"maxlength":[8],"min":[8],"minlength":[8],"name":[1],"pattern":[1],"placeholder":[1],"readonly":[8],"required":[4],"step":[8],"type":[1],"value":[1032]}]]],["tttx-button",[[1,"tttx-button",{"notext":[4],"icon":[1],"iconposition":[1],"iconcolor":[1025],"design":[1]}]]]], options);
15
15
  });
16
16
  };
17
17
 
@@ -0,0 +1,93 @@
1
+ import { r as registerInstance, c as createEvent, h, H as Host } from './index-6a372ea6.js';
2
+ import { p as purify, d as domSanitiserOptions } from './domsanitiser.options-97a33389.js';
3
+ import './_commonjsHelpers-9943807e.js';
4
+
5
+ const tttxTabsCss = ".material-symbols-rounded.sc-tttx-tabs{font-variation-settings:\"FILL\" 1, \"wght\" 400, \"GRAD\" 0, \"opsz\" 24}.sc-tttx-tabs-h{display:block}.tab-bar.sc-tttx-tabs{display:flex;height:52px}.tab-bar.sc-tttx-tabs>.left-navigation.sc-tttx-tabs,.tab-bar.sc-tttx-tabs>.right-navigation.sc-tttx-tabs{padding:14px 8px;cursor:pointer}.tab-bar.sc-tttx-tabs>.left-navigation.sc-tttx-tabs>*.sc-tttx-tabs,.tab-bar.sc-tttx-tabs>.right-navigation.sc-tttx-tabs>*.sc-tttx-tabs{height:24px;width:24px;cursor:pointer}.tab-bar.sc-tttx-tabs>.tabs-container.sc-tttx-tabs{display:flex;border-bottom:1px solid #d5d5d5}.tab-bar.sc-tttx-tabs>.tabs-container.wide.sc-tttx-tabs{flex-grow:1}.tab-bar.sc-tttx-tabs>.tabs-container.sc-tttx-tabs>*[role=tab].sc-tttx-tabs{padding:18px 16px;line-height:16px;font-size:14px;font-weight:500;text-transform:uppercase;user-select:none;color:#757575;cursor:pointer}.tab-bar.sc-tttx-tabs>.tabs-container.sc-tttx-tabs>*[role=tab].sc-tttx-tabs:hover{background-color:rgba(17, 17, 17, 0.05)}.tab-bar.sc-tttx-tabs>.tabs-container.sc-tttx-tabs>*[role=tab][aria-selected].sc-tttx-tabs{color:#212121;cursor:default;border-bottom:3px solid #1579c6}";
6
+
7
+ const TttxTabs = class {
8
+ constructor(hostRef) {
9
+ registerInstance(this, hostRef);
10
+ this.tabClick = createEvent(this, "tabClick", 7);
11
+ this.leftNavigation = createEvent(this, "leftNavigation", 7);
12
+ this.rightNavigation = createEvent(this, "rightNavigation", 7);
13
+ this.tabFocus = 0;
14
+ this.tabsName = undefined;
15
+ this.navigation = undefined;
16
+ this.wide = undefined;
17
+ this.tabs = undefined;
18
+ this._tabs = undefined;
19
+ }
20
+ onDataChange() {
21
+ if (!this.tabs) {
22
+ return;
23
+ }
24
+ if (typeof this.tabs === 'string') {
25
+ this._tabs = JSON.parse(this.tabs);
26
+ }
27
+ else {
28
+ this._tabs = [...this.tabs];
29
+ }
30
+ this.tabFocus = this._tabs.findIndex(tab => tab.tabIndex !== -1);
31
+ }
32
+ componentWillLoad() {
33
+ // dynamic constructor: any props can be added later
34
+ this.onDataChange();
35
+ }
36
+ handleTabClick(tab) {
37
+ this.tabClick.emit({ tabId: tab.id });
38
+ }
39
+ handleLeftNavigation() {
40
+ this.leftNavigation.emit();
41
+ }
42
+ handleRightNavigation() {
43
+ this.rightNavigation.emit();
44
+ }
45
+ handleKeyDown(event) {
46
+ const orientation = this.tabList.getAttribute('aria-orientation'); // horizontal by default
47
+ const previous = orientation && orientation === 'vertical' ? 'ArrowUp' : 'ArrowLeft';
48
+ const next = orientation && orientation === 'vertical' ? 'ArrowDown' : 'ArrowRight';
49
+ if (event.key === previous || event.key === next) {
50
+ // Make the previous tab deselectable
51
+ this._tabs[this.tabFocus].tabIndex = -1;
52
+ if (event.key === previous) {
53
+ this.tabFocus--;
54
+ // If we're at the start, move to the end
55
+ if (this.tabFocus < 0) {
56
+ this.tabFocus = this._tabs.length - 1;
57
+ }
58
+ }
59
+ else if (event.key === next) {
60
+ this.tabFocus++;
61
+ // If we're at the end, go to the start
62
+ if (this.tabFocus >= this._tabs.length) {
63
+ this.tabFocus = 0;
64
+ }
65
+ }
66
+ // Make the next tab selectable
67
+ this._tabs[this.tabFocus].tabIndex = 0;
68
+ this.tabList.querySelectorAll('[role="tab"]')[this.tabFocus].focus();
69
+ this._tabs = [...this._tabs];
70
+ }
71
+ else if (event.code === 'Space' || event.code === 'Enter') {
72
+ this.tabClick.emit({ tabId: this._tabs[this.tabFocus].id });
73
+ }
74
+ }
75
+ render() {
76
+ if (!this.tabs || this.tabs.length == 0) {
77
+ return;
78
+ }
79
+ return (h(Host, null, h("div", null, h("div", { class: "tab-bar", role: "tablist", "aria-label": this.tabsName, ref: el => (this.tabList = el) }, this.navigation && (h("div", { class: "left-navigation", tabindex: "0", onClick: this.handleLeftNavigation.bind(this) }, h("tttx-icon", { icon: "navigate_before", color: "black" }))), h("div", { class: 'tabs-container' + (this.wide ? ' wide' : '') }, this._tabs.map(tab => {
80
+ return (h("a", { key: tab.id, id: tab.id, role: "tab", "aria-controls": tab.controls, tabindex: tab.tabIndex, "aria-selected": tab.selected, onClick: () => {
81
+ this.handleTabClick(tab);
82
+ } }, tab.tabName));
83
+ })), this.navigation && (h("div", { class: "right-navigation", tabindex: "0", onClick: this.handleRightNavigation.bind(this) }, h("tttx-icon", { icon: "navigate_next", color: "black" })))), this._tabs.map(tab => {
84
+ return (h("article", { key: tab.id, id: tab.controls, role: "tabpanel", tabindex: "0", "aria-labelledby": tab.id, "aria-expanded": tab.selected, innerHTML: purify.sanitize(tab.pageContent, domSanitiserOptions), hidden: !tab.selected }));
85
+ }))));
86
+ }
87
+ static get watchers() { return {
88
+ "tabs": ["onDataChange"]
89
+ }; }
90
+ };
91
+ TttxTabs.style = tttxTabsCss;
92
+
93
+ export { TttxTabs as tttx_tabs };
package/dist/esm/tttx.js CHANGED
@@ -14,5 +14,5 @@ const patchBrowser = () => {
14
14
  };
15
15
 
16
16
  patchBrowser().then(options => {
17
- return bootstrapLazy([["tttx-dialog-box",[[1,"tttx-dialog-box",{"data":[1025],"size":[1],"open":[1028],"allowOverflow":[4,"allow-overflow"],"elementSize":[32]},[[9,"resize","handleResize"]]]]],["tttx-select-box",[[1,"tttx-select-box",{"optionsData":[1,"options-data"],"label":[1],"inline":[4],"placeholder":[1],"searchEnabled":[4,"search-enabled"],"selectedValue":[1,"selected-value"],"open":[32],"selectedItem":[32],"searchTerm":[32]},[[0,"closeSelectBox","handleCloseSelectBox"],[0,"blur","handleBlur"]]]]],["tttx-tree-view",[[1,"tttx-tree-view",{"data":[1040],"treeData":[32]}]]],["tttx-filter",[[1,"tttx-filter",{"filterKey":[1,"filter-key"],"filterOptions":[1,"filter-options"],"showSelectAll":[4,"show-select-all"],"showSearchField":[4,"show-search-field"],"showOptionIcons":[4,"show-option-icons"],"filterButtonStyle":[1,"filter-button-style"],"filterHeader":[1,"filter-header"],"defaultFilterOptions":[1,"default-filter-options"],"popoverWidth":[1,"popover-width"],"showPopover":[32],"displayedFilterSettings":[32],"selectedFilters":[32],"filterSearchTerm":[32],"allSelected":[32]},[[0,"closeFilter","handleCloseFilter"]]]]],["tttx-list",[[1,"tttx-list",{"data":[1025],"name":[1],"_data":[32]}]]],["tttx-sorter",[[1,"tttx-sorter",{"sorterKey":[1,"sorter-key"],"defaultSortDirection":[1,"default-sort-direction"],"fieldOptionsData":[1,"field-options-data"],"defaultOption":[1,"default-option"],"selectedField":[32],"sortDirection":[32],"dropdownExpand":[32],"dropdownOptions":[32]},[[0,"closeSorter","handleCloseSorter"]]]]],["tttx-form",[[1,"tttx-form",{"formschema":[1032],"data":[1032],"submit":[64]}]]],["tttx-keyvalue-block",[[1,"tttx-keyvalue-block",{"keyvalues":[8],"horizontal":[4]}]]],["tttx-loading-spinner",[[1,"tttx-loading-spinner",{"loadingMessage":[1028,"loading-message"],"size":[1025]}]]],["tttx-qrcode",[[1,"tttx-qrcode",{"link":[1025],"size":[1026]}]]],["tttx-tag",[[1,"tttx-tag",{"text":[1],"color":[1]}]]],["tttx-toolbar",[[1,"tttx-toolbar",{"border":[4],"viewSize":[32]},[[9,"resize","handleResize"]]]]],["tttx-icon",[[1,"tttx-icon",{"icon":[1],"color":[1]}]]],["tttx-standalone-input",[[2,"tttx-standalone-input",{"label":[1],"secondarylabel":[1],"showerrormsg":[4],"showerrorbubble":[4],"errormsg":[1],"iconleft":[1],"iconleftcolor":[1],"iconright":[1],"iconrightcolor":[1],"inputicon":[1],"inputiconcolor":[1],"inline":[4],"inputautocapitalize":[1],"inputautofocus":[4],"inputkeyhint":[1],"inputindex":[8],"inputtitle":[1],"autocomplete":[1],"checked":[4],"disabled":[4],"max":[8],"maxlength":[8],"min":[8],"minlength":[8],"name":[1],"pattern":[1],"placeholder":[1],"readonly":[8],"required":[4],"step":[8],"type":[1],"value":[1032]}]]],["tttx-button",[[1,"tttx-button",{"notext":[4],"icon":[1],"iconposition":[1],"iconcolor":[1025],"design":[1]}]]]], options);
17
+ return bootstrapLazy([["tttx-dialog-box",[[1,"tttx-dialog-box",{"data":[1025],"size":[1],"open":[1028],"allowOverflow":[4,"allow-overflow"],"elementSize":[32]},[[9,"resize","handleResize"]]]]],["tttx-select-box",[[1,"tttx-select-box",{"optionsData":[1,"options-data"],"label":[1],"inline":[4],"placeholder":[1],"searchEnabled":[4,"search-enabled"],"selectedValue":[1,"selected-value"],"open":[32],"selectedItem":[32],"searchTerm":[32]},[[0,"closeSelectBox","handleCloseSelectBox"],[0,"blur","handleBlur"]]]]],["tttx-tree-view",[[1,"tttx-tree-view",{"data":[1040],"treeData":[32]}]]],["tttx-filter",[[1,"tttx-filter",{"filterKey":[1,"filter-key"],"filterOptions":[1,"filter-options"],"showSelectAll":[4,"show-select-all"],"showSearchField":[4,"show-search-field"],"showOptionIcons":[4,"show-option-icons"],"filterButtonStyle":[1,"filter-button-style"],"filterHeader":[1,"filter-header"],"defaultFilterOptions":[1,"default-filter-options"],"popoverWidth":[1,"popover-width"],"showPopover":[32],"displayedFilterSettings":[32],"selectedFilters":[32],"filterSearchTerm":[32],"allSelected":[32]},[[0,"closeFilter","handleCloseFilter"]]]]],["tttx-list",[[1,"tttx-list",{"data":[1025],"name":[1],"_data":[32]}]]],["tttx-sorter",[[1,"tttx-sorter",{"sorterKey":[1,"sorter-key"],"defaultSortDirection":[1,"default-sort-direction"],"fieldOptionsData":[1,"field-options-data"],"defaultOption":[1,"default-option"],"selectedField":[32],"sortDirection":[32],"dropdownExpand":[32],"dropdownOptions":[32]},[[0,"closeSorter","handleCloseSorter"]]]]],["tttx-tabs",[[2,"tttx-tabs",{"tabsName":[1,"tabs-name"],"navigation":[4],"wide":[4],"tabs":[1],"_tabs":[32]},[[0,"keydown","handleKeyDown"]]]]],["tttx-form",[[1,"tttx-form",{"formschema":[1032],"data":[1032],"submit":[64]}]]],["tttx-keyvalue-block",[[1,"tttx-keyvalue-block",{"keyvalues":[8],"horizontal":[4]}]]],["tttx-loading-spinner",[[1,"tttx-loading-spinner",{"loadingMessage":[1028,"loading-message"],"size":[1025]}]]],["tttx-qrcode",[[1,"tttx-qrcode",{"link":[1025],"size":[1026]}]]],["tttx-tag",[[1,"tttx-tag",{"text":[1],"color":[1]}]]],["tttx-toolbar",[[1,"tttx-toolbar",{"border":[4],"viewSize":[32]},[[9,"resize","handleResize"]]]]],["tttx-icon",[[1,"tttx-icon",{"icon":[1],"color":[1]}]]],["tttx-standalone-input",[[2,"tttx-standalone-input",{"label":[1],"secondarylabel":[1],"showerrormsg":[4],"showerrorbubble":[4],"errormsg":[1],"iconleft":[1],"iconleftcolor":[1],"iconright":[1],"iconrightcolor":[1],"inputicon":[1],"inputiconcolor":[1],"inline":[4],"inputautocapitalize":[1],"inputautofocus":[4],"inputkeyhint":[1],"inputindex":[8],"inputtitle":[1],"autocomplete":[1],"checked":[4],"disabled":[4],"max":[8],"maxlength":[8],"min":[8],"minlength":[8],"name":[1],"pattern":[1],"placeholder":[1],"readonly":[8],"required":[4],"step":[8],"type":[1],"value":[1032]}]]],["tttx-button",[[1,"tttx-button",{"notext":[4],"icon":[1],"iconposition":[1],"iconcolor":[1025],"design":[1]}]]]], options);
18
18
  });
@@ -0,0 +1 @@
1
+ import{r as t,c as s,h as a,H as i}from"./p-3f1b6013.js";import{p as o,d as r}from"./p-5ed38d61.js";import"./p-112455b1.js";const e=class{constructor(a){t(this,a),this.tabClick=s(this,"tabClick",7),this.leftNavigation=s(this,"leftNavigation",7),this.rightNavigation=s(this,"rightNavigation",7),this.tabFocus=0,this.tabsName=void 0,this.navigation=void 0,this.wide=void 0,this.tabs=void 0,this._tabs=void 0}onDataChange(){this.tabs&&(this._tabs="string"==typeof this.tabs?JSON.parse(this.tabs):[...this.tabs],this.tabFocus=this._tabs.findIndex((t=>-1!==t.tabIndex)))}componentWillLoad(){this.onDataChange()}handleTabClick(t){this.tabClick.emit({tabId:t.id})}handleLeftNavigation(){this.leftNavigation.emit()}handleRightNavigation(){this.rightNavigation.emit()}handleKeyDown(t){const s=this.tabList.getAttribute("aria-orientation"),a=s&&"vertical"===s?"ArrowUp":"ArrowLeft",i=s&&"vertical"===s?"ArrowDown":"ArrowRight";t.key===a||t.key===i?(this._tabs[this.tabFocus].tabIndex=-1,t.key===a?(this.tabFocus--,this.tabFocus<0&&(this.tabFocus=this._tabs.length-1)):t.key===i&&(this.tabFocus++,this.tabFocus>=this._tabs.length&&(this.tabFocus=0)),this._tabs[this.tabFocus].tabIndex=0,this.tabList.querySelectorAll('[role="tab"]')[this.tabFocus].focus(),this._tabs=[...this._tabs]):"Space"!==t.code&&"Enter"!==t.code||this.tabClick.emit({tabId:this._tabs[this.tabFocus].id})}render(){if(this.tabs&&0!=this.tabs.length)return a(i,null,a("div",null,a("div",{class:"tab-bar",role:"tablist","aria-label":this.tabsName,ref:t=>this.tabList=t},this.navigation&&a("div",{class:"left-navigation",tabindex:"0",onClick:this.handleLeftNavigation.bind(this)},a("tttx-icon",{icon:"navigate_before",color:"black"})),a("div",{class:"tabs-container"+(this.wide?" wide":"")},this._tabs.map((t=>a("a",{key:t.id,id:t.id,role:"tab","aria-controls":t.controls,tabindex:t.tabIndex,"aria-selected":t.selected,onClick:()=>{this.handleTabClick(t)}},t.tabName)))),this.navigation&&a("div",{class:"right-navigation",tabindex:"0",onClick:this.handleRightNavigation.bind(this)},a("tttx-icon",{icon:"navigate_next",color:"black"}))),this._tabs.map((t=>a("article",{key:t.id,id:t.controls,role:"tabpanel",tabindex:"0","aria-labelledby":t.id,"aria-expanded":t.selected,innerHTML:o.sanitize(t.pageContent,r),hidden:!t.selected})))))}static get watchers(){return{tabs:["onDataChange"]}}};e.style='.material-symbols-rounded.sc-tttx-tabs{font-variation-settings:"FILL" 1, "wght" 400, "GRAD" 0, "opsz" 24}.sc-tttx-tabs-h{display:block}.tab-bar.sc-tttx-tabs{display:flex;height:52px}.tab-bar.sc-tttx-tabs>.left-navigation.sc-tttx-tabs,.tab-bar.sc-tttx-tabs>.right-navigation.sc-tttx-tabs{padding:14px 8px;cursor:pointer}.tab-bar.sc-tttx-tabs>.left-navigation.sc-tttx-tabs>*.sc-tttx-tabs,.tab-bar.sc-tttx-tabs>.right-navigation.sc-tttx-tabs>*.sc-tttx-tabs{height:24px;width:24px;cursor:pointer}.tab-bar.sc-tttx-tabs>.tabs-container.sc-tttx-tabs{display:flex;border-bottom:1px solid #d5d5d5}.tab-bar.sc-tttx-tabs>.tabs-container.wide.sc-tttx-tabs{flex-grow:1}.tab-bar.sc-tttx-tabs>.tabs-container.sc-tttx-tabs>*[role=tab].sc-tttx-tabs{padding:18px 16px;line-height:16px;font-size:14px;font-weight:500;text-transform:uppercase;user-select:none;color:#757575;cursor:pointer}.tab-bar.sc-tttx-tabs>.tabs-container.sc-tttx-tabs>*[role=tab].sc-tttx-tabs:hover{background-color:rgba(17, 17, 17, 0.05)}.tab-bar.sc-tttx-tabs>.tabs-container.sc-tttx-tabs>*[role=tab][aria-selected].sc-tttx-tabs{color:#212121;cursor:default;border-bottom:3px solid #1579c6}';export{e as tttx_tabs}
@@ -1 +1 @@
1
- import{p as e,b as t}from"./p-3f1b6013.js";export{s as setNonce}from"./p-3f1b6013.js";(()=>{const t=import.meta.url,o={};return""!==t&&(o.resourcesUrl=new URL(".",t).href),e(o)})().then((e=>t([["p-f34bface",[[1,"tttx-dialog-box",{data:[1025],size:[1],open:[1028],allowOverflow:[4,"allow-overflow"],elementSize:[32]},[[9,"resize","handleResize"]]]]],["p-d9444b12",[[1,"tttx-select-box",{optionsData:[1,"options-data"],label:[1],inline:[4],placeholder:[1],searchEnabled:[4,"search-enabled"],selectedValue:[1,"selected-value"],open:[32],selectedItem:[32],searchTerm:[32]},[[0,"closeSelectBox","handleCloseSelectBox"],[0,"blur","handleBlur"]]]]],["p-75c31e23",[[1,"tttx-tree-view",{data:[1040],treeData:[32]}]]],["p-c714f7c0",[[1,"tttx-filter",{filterKey:[1,"filter-key"],filterOptions:[1,"filter-options"],showSelectAll:[4,"show-select-all"],showSearchField:[4,"show-search-field"],showOptionIcons:[4,"show-option-icons"],filterButtonStyle:[1,"filter-button-style"],filterHeader:[1,"filter-header"],defaultFilterOptions:[1,"default-filter-options"],popoverWidth:[1,"popover-width"],showPopover:[32],displayedFilterSettings:[32],selectedFilters:[32],filterSearchTerm:[32],allSelected:[32]},[[0,"closeFilter","handleCloseFilter"]]]]],["p-750cf31b",[[1,"tttx-list",{data:[1025],name:[1],_data:[32]}]]],["p-5290db99",[[1,"tttx-sorter",{sorterKey:[1,"sorter-key"],defaultSortDirection:[1,"default-sort-direction"],fieldOptionsData:[1,"field-options-data"],defaultOption:[1,"default-option"],selectedField:[32],sortDirection:[32],dropdownExpand:[32],dropdownOptions:[32]},[[0,"closeSorter","handleCloseSorter"]]]]],["p-895526aa",[[1,"tttx-form",{formschema:[1032],data:[1032],submit:[64]}]]],["p-6fe0af4e",[[1,"tttx-keyvalue-block",{keyvalues:[8],horizontal:[4]}]]],["p-e55a967b",[[1,"tttx-loading-spinner",{loadingMessage:[1028,"loading-message"],size:[1025]}]]],["p-50cdce65",[[1,"tttx-qrcode",{link:[1025],size:[1026]}]]],["p-a6582ab0",[[1,"tttx-tag",{text:[1],color:[1]}]]],["p-c0c022cd",[[1,"tttx-toolbar",{border:[4],viewSize:[32]},[[9,"resize","handleResize"]]]]],["p-e89b053f",[[1,"tttx-icon",{icon:[1],color:[1]}]]],["p-818574fe",[[2,"tttx-standalone-input",{label:[1],secondarylabel:[1],showerrormsg:[4],showerrorbubble:[4],errormsg:[1],iconleft:[1],iconleftcolor:[1],iconright:[1],iconrightcolor:[1],inputicon:[1],inputiconcolor:[1],inline:[4],inputautocapitalize:[1],inputautofocus:[4],inputkeyhint:[1],inputindex:[8],inputtitle:[1],autocomplete:[1],checked:[4],disabled:[4],max:[8],maxlength:[8],min:[8],minlength:[8],name:[1],pattern:[1],placeholder:[1],readonly:[8],required:[4],step:[8],type:[1],value:[1032]}]]],["p-5b7b8539",[[1,"tttx-button",{notext:[4],icon:[1],iconposition:[1],iconcolor:[1025],design:[1]}]]]],e)));
1
+ import{p as e,b as t}from"./p-3f1b6013.js";export{s as setNonce}from"./p-3f1b6013.js";(()=>{const t=import.meta.url,o={};return""!==t&&(o.resourcesUrl=new URL(".",t).href),e(o)})().then((e=>t([["p-f34bface",[[1,"tttx-dialog-box",{data:[1025],size:[1],open:[1028],allowOverflow:[4,"allow-overflow"],elementSize:[32]},[[9,"resize","handleResize"]]]]],["p-d9444b12",[[1,"tttx-select-box",{optionsData:[1,"options-data"],label:[1],inline:[4],placeholder:[1],searchEnabled:[4,"search-enabled"],selectedValue:[1,"selected-value"],open:[32],selectedItem:[32],searchTerm:[32]},[[0,"closeSelectBox","handleCloseSelectBox"],[0,"blur","handleBlur"]]]]],["p-75c31e23",[[1,"tttx-tree-view",{data:[1040],treeData:[32]}]]],["p-c714f7c0",[[1,"tttx-filter",{filterKey:[1,"filter-key"],filterOptions:[1,"filter-options"],showSelectAll:[4,"show-select-all"],showSearchField:[4,"show-search-field"],showOptionIcons:[4,"show-option-icons"],filterButtonStyle:[1,"filter-button-style"],filterHeader:[1,"filter-header"],defaultFilterOptions:[1,"default-filter-options"],popoverWidth:[1,"popover-width"],showPopover:[32],displayedFilterSettings:[32],selectedFilters:[32],filterSearchTerm:[32],allSelected:[32]},[[0,"closeFilter","handleCloseFilter"]]]]],["p-750cf31b",[[1,"tttx-list",{data:[1025],name:[1],_data:[32]}]]],["p-5290db99",[[1,"tttx-sorter",{sorterKey:[1,"sorter-key"],defaultSortDirection:[1,"default-sort-direction"],fieldOptionsData:[1,"field-options-data"],defaultOption:[1,"default-option"],selectedField:[32],sortDirection:[32],dropdownExpand:[32],dropdownOptions:[32]},[[0,"closeSorter","handleCloseSorter"]]]]],["p-67c342d7",[[2,"tttx-tabs",{tabsName:[1,"tabs-name"],navigation:[4],wide:[4],tabs:[1],_tabs:[32]},[[0,"keydown","handleKeyDown"]]]]],["p-895526aa",[[1,"tttx-form",{formschema:[1032],data:[1032],submit:[64]}]]],["p-6fe0af4e",[[1,"tttx-keyvalue-block",{keyvalues:[8],horizontal:[4]}]]],["p-e55a967b",[[1,"tttx-loading-spinner",{loadingMessage:[1028,"loading-message"],size:[1025]}]]],["p-50cdce65",[[1,"tttx-qrcode",{link:[1025],size:[1026]}]]],["p-a6582ab0",[[1,"tttx-tag",{text:[1],color:[1]}]]],["p-c0c022cd",[[1,"tttx-toolbar",{border:[4],viewSize:[32]},[[9,"resize","handleResize"]]]]],["p-e89b053f",[[1,"tttx-icon",{icon:[1],color:[1]}]]],["p-818574fe",[[2,"tttx-standalone-input",{label:[1],secondarylabel:[1],showerrormsg:[4],showerrorbubble:[4],errormsg:[1],iconleft:[1],iconleftcolor:[1],iconright:[1],iconrightcolor:[1],inputicon:[1],inputiconcolor:[1],inline:[4],inputautocapitalize:[1],inputautofocus:[4],inputkeyhint:[1],inputindex:[8],inputtitle:[1],autocomplete:[1],checked:[4],disabled:[4],max:[8],maxlength:[8],min:[8],minlength:[8],name:[1],pattern:[1],placeholder:[1],readonly:[8],required:[4],step:[8],type:[1],value:[1032]}]]],["p-5b7b8539",[[1,"tttx-button",{notext:[4],icon:[1],iconposition:[1],iconcolor:[1025],design:[1]}]]]],e)));
@@ -0,0 +1,8 @@
1
+ export interface Tab {
2
+ id: string;
3
+ tabName: string;
4
+ controls: string;
5
+ selected: boolean;
6
+ tabIndex: number;
7
+ pageContent: string;
8
+ }
@@ -0,0 +1,23 @@
1
+ import { EventEmitter } from '../../../stencil-public-runtime';
2
+ import { Tab } from './interfaces';
3
+ export declare class TttxTabs {
4
+ tabsName: string;
5
+ navigation: boolean;
6
+ wide: boolean;
7
+ tabs: string | Tab[];
8
+ _tabs: Tab[];
9
+ private tabList;
10
+ private tabFocus;
11
+ onDataChange(): void;
12
+ componentWillLoad(): void;
13
+ tabClick: EventEmitter<{
14
+ tabId: string;
15
+ }>;
16
+ handleTabClick(tab: Tab): void;
17
+ leftNavigation: EventEmitter;
18
+ handleLeftNavigation(): void;
19
+ rightNavigation: EventEmitter;
20
+ handleRightNavigation(): void;
21
+ handleKeyDown(event: KeyboardEvent): void;
22
+ render(): any;
23
+ }
@@ -0,0 +1,13 @@
1
+ declare const _default: {
2
+ title: string;
3
+ component: string;
4
+ parameters: {
5
+ actions: {
6
+ handles: string[];
7
+ };
8
+ };
9
+ decorators: (<T extends import("@storybook/types").Renderer>(storyFn: import("@storybook/types").PartialStoryFn<T, import("@storybook/types").Args>) => T["storyResult"])[];
10
+ };
11
+ export default _default;
12
+ export declare const DefaultTabs: any;
13
+ export declare const NavigationTabs: any;
@@ -11,6 +11,7 @@ import { ListItem } from "./components/molecules/tttx-list/interfaces";
11
11
  import { SelectItem } from "./components/molecules/tttx-select-box/interfaces";
12
12
  import { SorterChangeEvent, SorterData } from "./components/molecules/tttx-sorter/interfaces";
13
13
  import { MinMaxDates } from "./components/molecules/tttx-standalone-input/tttx-standalone-input";
14
+ import { Tab } from "./components/molecules/tttx-tabs/interfaces";
14
15
  import { TreeViewItem } from "./components/molecules/tttx-tree-view/helper/helper";
15
16
  export namespace Components {
16
17
  interface TttxButton {
@@ -121,6 +122,12 @@ export namespace Components {
121
122
  "type": string;
122
123
  "value": string | number;
123
124
  }
125
+ interface TttxTabs {
126
+ "navigation": boolean;
127
+ "tabs": string | Tab[];
128
+ "tabsName": string;
129
+ "wide": boolean;
130
+ }
124
131
  interface TttxTag {
125
132
  "color": string;
126
133
  "text": string;
@@ -160,6 +167,10 @@ export interface TttxStandaloneInputCustomEvent<T> extends CustomEvent<T> {
160
167
  detail: T;
161
168
  target: HTMLTttxStandaloneInputElement;
162
169
  }
170
+ export interface TttxTabsCustomEvent<T> extends CustomEvent<T> {
171
+ detail: T;
172
+ target: HTMLTttxTabsElement;
173
+ }
163
174
  export interface TttxTreeViewCustomEvent<T> extends CustomEvent<T> {
164
175
  detail: T;
165
176
  target: HTMLTttxTreeViewElement;
@@ -237,6 +248,12 @@ declare global {
237
248
  prototype: HTMLTttxStandaloneInputElement;
238
249
  new (): HTMLTttxStandaloneInputElement;
239
250
  };
251
+ interface HTMLTttxTabsElement extends Components.TttxTabs, HTMLStencilElement {
252
+ }
253
+ var HTMLTttxTabsElement: {
254
+ prototype: HTMLTttxTabsElement;
255
+ new (): HTMLTttxTabsElement;
256
+ };
240
257
  interface HTMLTttxTagElement extends Components.TttxTag, HTMLStencilElement {
241
258
  }
242
259
  var HTMLTttxTagElement: {
@@ -268,6 +285,7 @@ declare global {
268
285
  "tttx-select-box": HTMLTttxSelectBoxElement;
269
286
  "tttx-sorter": HTMLTttxSorterElement;
270
287
  "tttx-standalone-input": HTMLTttxStandaloneInputElement;
288
+ "tttx-tabs": HTMLTttxTabsElement;
271
289
  "tttx-tag": HTMLTttxTagElement;
272
290
  "tttx-toolbar": HTMLTttxToolbarElement;
273
291
  "tttx-tree-view": HTMLTttxTreeViewElement;
@@ -400,6 +418,15 @@ declare namespace LocalJSX {
400
418
  "type"?: string;
401
419
  "value"?: string | number;
402
420
  }
421
+ interface TttxTabs {
422
+ "navigation"?: boolean;
423
+ "onLeftNavigation"?: (event: TttxTabsCustomEvent<any>) => void;
424
+ "onRightNavigation"?: (event: TttxTabsCustomEvent<any>) => void;
425
+ "onTabClick"?: (event: TttxTabsCustomEvent<{ tabId: string }>) => void;
426
+ "tabs"?: string | Tab[];
427
+ "tabsName"?: string;
428
+ "wide"?: boolean;
429
+ }
403
430
  interface TttxTag {
404
431
  "color"?: string;
405
432
  "text"?: string;
@@ -424,6 +451,7 @@ declare namespace LocalJSX {
424
451
  "tttx-select-box": TttxSelectBox;
425
452
  "tttx-sorter": TttxSorter;
426
453
  "tttx-standalone-input": TttxStandaloneInput;
454
+ "tttx-tabs": TttxTabs;
427
455
  "tttx-tag": TttxTag;
428
456
  "tttx-toolbar": TttxToolbar;
429
457
  "tttx-tree-view": TttxTreeView;
@@ -445,6 +473,7 @@ declare module "@stencil/core" {
445
473
  "tttx-select-box": LocalJSX.TttxSelectBox & JSXBase.HTMLAttributes<HTMLTttxSelectBoxElement>;
446
474
  "tttx-sorter": LocalJSX.TttxSorter & JSXBase.HTMLAttributes<HTMLTttxSorterElement>;
447
475
  "tttx-standalone-input": LocalJSX.TttxStandaloneInput & JSXBase.HTMLAttributes<HTMLTttxStandaloneInputElement>;
476
+ "tttx-tabs": LocalJSX.TttxTabs & JSXBase.HTMLAttributes<HTMLTttxTabsElement>;
448
477
  "tttx-tag": LocalJSX.TttxTag & JSXBase.HTMLAttributes<HTMLTttxTagElement>;
449
478
  "tttx-toolbar": LocalJSX.TttxToolbar & JSXBase.HTMLAttributes<HTMLTttxToolbarElement>;
450
479
  "tttx-tree-view": LocalJSX.TttxTreeView & JSXBase.HTMLAttributes<HTMLTttxTreeViewElement>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@3t-transform/threeteeui",
3
- "version": "0.2.72",
3
+ "version": "0.2.73",
4
4
  "description": "3t Design System",
5
5
  "main": "dist/index.cjs.js",
6
6
  "module": "dist/index.js",