@3t-transform/threeteeui 0.2.92 → 0.2.94
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/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/tttx-dialog.cjs.entry.js +81 -0
- package/dist/cjs/tttx-form.cjs.entry.js +5 -0
- package/dist/cjs/tttx-tabs.cjs.entry.js +5 -3
- package/dist/cjs/tttx.cjs.js +1 -1
- package/dist/collection/collection-manifest.json +1 -0
- package/dist/collection/components/molecules/tttx-dialog/icon-types.js +6 -0
- package/dist/collection/components/molecules/tttx-dialog/tttx-dialog.css +147 -0
- package/dist/collection/components/molecules/tttx-dialog/tttx-dialog.js +218 -0
- package/dist/collection/components/molecules/tttx-dialog/tttx-dialog.stories.js +98 -0
- package/dist/collection/components/molecules/tttx-form/lib/validityCheck.js +5 -0
- package/dist/collection/components/molecules/tttx-tabs/tttx-tabs.js +5 -3
- package/dist/components/index.d.ts +1 -0
- package/dist/components/index.js +1 -0
- package/dist/components/tttx-dialog.d.ts +11 -0
- package/dist/components/tttx-dialog.js +109 -0
- package/dist/components/tttx-form.js +5 -0
- package/dist/components/tttx-tabs.js +5 -3
- package/dist/esm/loader.js +1 -1
- package/dist/esm/tttx-dialog.entry.js +77 -0
- package/dist/esm/tttx-form.entry.js +5 -0
- package/dist/esm/tttx-tabs.entry.js +5 -3
- package/dist/esm/tttx.js +1 -1
- package/dist/tttx/p-a19ad838.entry.js +1 -0
- package/dist/tttx/p-cdac34b5.entry.js +1 -0
- package/dist/tttx/p-feea36cb.entry.js +1 -0
- package/dist/tttx/tttx.esm.js +1 -1
- package/dist/types/components/molecules/tttx-dialog/icon-types.d.ts +18 -0
- package/dist/types/components/molecules/tttx-dialog/tttx-dialog.d.ts +27 -0
- package/dist/types/components/molecules/tttx-dialog/tttx-dialog.stories.d.ts +42 -0
- package/dist/types/components.d.ts +30 -0
- package/package.json +1 -1
- package/dist/tttx/p-b189ca0f.entry.js +0 -1
- package/dist/tttx/p-e2dda35e.entry.js +0 -1
package/dist/cjs/loader.cjs.js
CHANGED
|
@@ -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-data-pattern.cjs",[[1,"tttx-data-pattern",{"data":[1],"sorteroptions":[1],"filteroptions":[1],"filterheader":[1]}]]],["tttx-multiselect-box.cjs",[[1,"tttx-multiselect-box",{"optionsData":[1,"options-data"],"label":[1],"inline":[4],"placeholder":[1],"searchEnabled":[4,"search-enabled"],"htmlVisibleValue":[4,"html-visible-value"],"visibleValue":[1,"visible-value"],"open":[32],"unsavedSelectedItems":[32],"searchTerm":[32]},[[0,"closeSelectBox","handleCloseSelectBox"],[0,"blur","handleBlur"]]]]],["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],"selectedId":[32]}]]],["tttx-checkbox.cjs",[[0,"tttx-checkbox",{"checkboxId":[1,"checkbox-id"],"label":[1],"inline":[4],"indeterminate":[4],"checked":[4]}]]],["tttx-expander.cjs",[[1,"tttx-expander",{"name":[1],"open":[4],"lefticon":[1],"lefticoncolor":[1],"isExpanded":[32]}]]],["tttx-tabs.cjs",[[2,"tttx-tabs",{"tabsName":[1,"tabs-name"],"navigation":[4],"wide":[4],"tabs":[1],"_tabs":[32]},[[0,"keydown","handleKeyDown"]]]]],["tttx-checkbox-group.cjs",[[1,"tttx-checkbox-group"]]],["tttx-checkbox-group-caption.cjs",[[4,"tttx-checkbox-group-caption"]]],["tttx-checkbox-group-heading.cjs",[[4,"tttx-checkbox-group-heading"]]],["tttx-form.cjs",[[1,"tttx-form",{"formschema":[1025],"data":[1032],"submit":[64]}]]],["tttx-keyvalue-block.cjs",[[1,"tttx-keyvalue-block",{"keyvalues":[1],"horizontal":[4],"spacedout":[4],"_elements":[32]}]]],["tttx-loading-spinner.cjs",[[1,"tttx-loading-spinner",{"loadingMessage":[1028,"loading-message"],"size":[1025]}]]],["tttx-percentage-bar.cjs",[[2,"tttx-percentage-bar",{"percentage":[8],"thresholds":[1],"color":[1],"min":[1],"labelid":[1],"_percentage":[32],"_ranges":[32],"_min":[32]}]]],["tttx-qrcode.cjs",[[1,"tttx-qrcode",{"link":[1025],"size":[1026]}]]],["tttx-tag.cjs",[[1,"tttx-tag",{"text":[1],"color":[1],"textColor":[1,"text-color"]}]]],["tttx-textarea.cjs",[[2,"tttx-textarea",{"label":[1],"secondarylabel":[1],"showerrormsg":[4],"showerrorbubble":[4],"errormsg":[1],"rows":[2],"textareaautofocus":[4],"inputkeyhint":[1],"inputindex":[8],"inputtitle":[1],"disabled":[4],"maxlength":[8],"name":[1],"placeholder":[1],"readonly":[8],"required":[4],"value":[1032]}]]],["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-filter_4.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"]]],[1,"tttx-list",{"data":[1025],"name":[1],"_data":[32]}],[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"]]],[1,"tttx-toolbar",{"border":[4],"viewSize":[32]},[[9,"resize","handleResize"]]]]],["tttx-button.cjs",[[1,"tttx-button",{"notext":[4],"icon":[1],"iconposition":[1],"iconcolor":[1025],"design":[1]}]]]], options);
|
|
17
|
+
return index.bootstrapLazy([["tttx-data-pattern.cjs",[[1,"tttx-data-pattern",{"data":[1],"sorteroptions":[1],"filteroptions":[1],"filterheader":[1]}]]],["tttx-multiselect-box.cjs",[[1,"tttx-multiselect-box",{"optionsData":[1,"options-data"],"label":[1],"inline":[4],"placeholder":[1],"searchEnabled":[4,"search-enabled"],"htmlVisibleValue":[4,"html-visible-value"],"visibleValue":[1,"visible-value"],"open":[32],"unsavedSelectedItems":[32],"searchTerm":[32]},[[0,"closeSelectBox","handleCloseSelectBox"],[0,"blur","handleBlur"]]]]],["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],"selectedId":[32]}]]],["tttx-checkbox.cjs",[[0,"tttx-checkbox",{"checkboxId":[1,"checkbox-id"],"label":[1],"inline":[4],"indeterminate":[4],"checked":[4]}]]],["tttx-dialog.cjs",[[1,"tttx-dialog",{"header":[1],"type":[1],"size":[1],"open":[4],"allowOverflow":[4,"allow-overflow"],"closeEnabled":[4,"close-enabled"],"elementSize":[32]},[[9,"resize","handleResize"]]]]],["tttx-expander.cjs",[[1,"tttx-expander",{"name":[1],"open":[4],"lefticon":[1],"lefticoncolor":[1],"isExpanded":[32]}]]],["tttx-tabs.cjs",[[2,"tttx-tabs",{"tabsName":[1,"tabs-name"],"navigation":[4],"wide":[4],"tabs":[1],"_tabs":[32]},[[0,"keydown","handleKeyDown"]]]]],["tttx-checkbox-group.cjs",[[1,"tttx-checkbox-group"]]],["tttx-checkbox-group-caption.cjs",[[4,"tttx-checkbox-group-caption"]]],["tttx-checkbox-group-heading.cjs",[[4,"tttx-checkbox-group-heading"]]],["tttx-form.cjs",[[1,"tttx-form",{"formschema":[1025],"data":[1032],"submit":[64]}]]],["tttx-keyvalue-block.cjs",[[1,"tttx-keyvalue-block",{"keyvalues":[1],"horizontal":[4],"spacedout":[4],"_elements":[32]}]]],["tttx-loading-spinner.cjs",[[1,"tttx-loading-spinner",{"loadingMessage":[1028,"loading-message"],"size":[1025]}]]],["tttx-percentage-bar.cjs",[[2,"tttx-percentage-bar",{"percentage":[8],"thresholds":[1],"color":[1],"min":[1],"labelid":[1],"_percentage":[32],"_ranges":[32],"_min":[32]}]]],["tttx-qrcode.cjs",[[1,"tttx-qrcode",{"link":[1025],"size":[1026]}]]],["tttx-tag.cjs",[[1,"tttx-tag",{"text":[1],"color":[1],"textColor":[1,"text-color"]}]]],["tttx-textarea.cjs",[[2,"tttx-textarea",{"label":[1],"secondarylabel":[1],"showerrormsg":[4],"showerrorbubble":[4],"errormsg":[1],"rows":[2],"textareaautofocus":[4],"inputkeyhint":[1],"inputindex":[8],"inputtitle":[1],"disabled":[4],"maxlength":[8],"name":[1],"placeholder":[1],"readonly":[8],"required":[4],"value":[1032]}]]],["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-filter_4.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"]]],[1,"tttx-list",{"data":[1025],"name":[1],"_data":[32]}],[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"]]],[1,"tttx-toolbar",{"border":[4],"viewSize":[32]},[[9,"resize","handleResize"]]]]],["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,81 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
const index = require('./index-992a9fb3.js');
|
|
6
|
+
|
|
7
|
+
const ICON_TYPES = {
|
|
8
|
+
critical: { iconName: 'report', iconColor: 'red' },
|
|
9
|
+
info: { iconName: 'info', iconColor: 'blue' },
|
|
10
|
+
success: { iconName: 'check_circle', iconColor: 'green' },
|
|
11
|
+
warning: { iconName: 'warning', iconColor: 'orange' },
|
|
12
|
+
};
|
|
13
|
+
|
|
14
|
+
const tttxDialogCss = ".material-symbols-rounded{font-variation-settings:\"FILL\" 1, \"wght\" 400, \"GRAD\" 0, \"opsz\" 24}.material-symbols-rounded{font-family:\"Material Symbols Rounded\", sans-serif;font-weight:400;font-style:normal;font-size:24px;line-height:1;letter-spacing:normal;text-transform:none;display:inline-block;white-space:nowrap;word-wrap:normal;direction:ltr;text-rendering:optimizeLegibility;-webkit-font-smoothing:antialiased;color:#9e9e9e}h3{margin-block-start:0em;margin-block-end:0em}.dialog-box{background-color:#ffffff;border:1px solid #d5d5d5;border-radius:4px;box-shadow:0px 1px 5px #1111114d;padding:0}.dialog-box.small{width:400px;min-height:200px}.dialog-box.regular{width:600px;min-height:200px}.dialog-box.large{width:900px;min-height:200px}.dialog-box.mobile{max-width:424px;width:calc(100vw - 20px)}.overflow-visible{overflow:visible}.overflow-hidden{overflow:hidden}dialog::backdrop{background-color:#75757580}.clickable{cursor:pointer}.contents{display:flex;flex-direction:column;min-height:inherit}.padding{padding:8px 16px}.align-right{margin-left:auto;display:flex}.header{border-bottom:1px solid #d5d5d5;display:flex;flex-direction:row;align-items:center;height:36px}.title{font-size:18;font-weight:500;font-family:\"Roboto\", serif}.icon{padding-right:8px;width:24px;height:24px}.icon-close{margin-left:auto;padding-top:3px;width:24px;height:24px}.body-content{font-size:16;font-weight:400;font-family:\"Roboto\", serif}.body{text-overflow:ellipsis;padding:16px}.footer{display:flex;flex-direction:row;margin-top:auto;border-top:1px solid #d5d5d5;height:36px}::slotted([slot=buttons]){display:flex;gap:8px}.header.info{border-bottom:1px solid #1479c6}.header.success{border-bottom:1px solid #a2bb31}.header.warning{border-bottom:1px solid #f59500}.header.critical{border-bottom:1px solid #dc0000}";
|
|
15
|
+
|
|
16
|
+
const TttxDialog = class {
|
|
17
|
+
constructor(hostRef) {
|
|
18
|
+
index.registerInstance(this, hostRef);
|
|
19
|
+
this.closeButtonClick = index.createEvent(this, "closeButtonClick", 6);
|
|
20
|
+
this.header = undefined;
|
|
21
|
+
this.type = undefined;
|
|
22
|
+
this.size = 'regular';
|
|
23
|
+
this.open = false;
|
|
24
|
+
this.allowOverflow = false;
|
|
25
|
+
this.closeEnabled = true;
|
|
26
|
+
this.elementSize = undefined;
|
|
27
|
+
}
|
|
28
|
+
handleResize() {
|
|
29
|
+
if (window.innerWidth < 698) {
|
|
30
|
+
this.elementSize = 'mobile';
|
|
31
|
+
}
|
|
32
|
+
else {
|
|
33
|
+
this.elementSize = this.size;
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
preventCancelOnDialog(event) {
|
|
37
|
+
event.preventDefault();
|
|
38
|
+
}
|
|
39
|
+
componentDidLoad() {
|
|
40
|
+
this.dialog.addEventListener('cancel', this.preventCancelOnDialog);
|
|
41
|
+
}
|
|
42
|
+
onCloseClickHandler() {
|
|
43
|
+
this.closeButtonClick.emit();
|
|
44
|
+
}
|
|
45
|
+
headerIconDetails(iconEnabled) {
|
|
46
|
+
if (!iconEnabled)
|
|
47
|
+
return { iconName: undefined, iconColor: undefined };
|
|
48
|
+
return ICON_TYPES[this.type];
|
|
49
|
+
}
|
|
50
|
+
renderHeader() {
|
|
51
|
+
const iconEnabled = typeof this.type !== 'undefined';
|
|
52
|
+
const { iconName, iconColor } = this.headerIconDetails(iconEnabled);
|
|
53
|
+
return (index.h("div", { class: `padding header ${this.type || ''}` }, iconEnabled && index.h("tttx-icon", { class: "icon", icon: iconName, color: iconColor }), index.h("h3", { class: "title" }, this.header), this.closeEnabled && (index.h("div", { class: "align-right close-button", onClick: () => this.onCloseClickHandler() }, index.h("tttx-icon", { class: "icon-close clickable", icon: "close", color: "black" })))));
|
|
54
|
+
}
|
|
55
|
+
body() {
|
|
56
|
+
return (index.h("div", { class: `body ${!this.allowOverflow ? 'overflow-hidden' : ''}` }, index.h("span", { class: "body-content" }, index.h("slot", null))));
|
|
57
|
+
}
|
|
58
|
+
footer() {
|
|
59
|
+
if (!this.el.querySelector('[slot="buttons"]'))
|
|
60
|
+
return;
|
|
61
|
+
return (index.h("div", { class: "padding footer" }, index.h("div", { class: "align-right" }, index.h("slot", { name: "buttons" }))));
|
|
62
|
+
}
|
|
63
|
+
componentDidRender() {
|
|
64
|
+
if (!this.open) {
|
|
65
|
+
this.dialog.close();
|
|
66
|
+
return;
|
|
67
|
+
}
|
|
68
|
+
if (!this.dialog.open)
|
|
69
|
+
this.dialog.showModal();
|
|
70
|
+
}
|
|
71
|
+
componentWillLoad() {
|
|
72
|
+
this.handleResize();
|
|
73
|
+
}
|
|
74
|
+
render() {
|
|
75
|
+
return (index.h("dialog", { ref: (el) => this.dialog = el, class: `dialog-box ${this.allowOverflow ? 'overflow-visible' : ''} ${this.elementSize}` }, index.h("div", { class: "contents" }, this.renderHeader(), this.body(), this.footer())));
|
|
76
|
+
}
|
|
77
|
+
get el() { return index.getElement(this); }
|
|
78
|
+
};
|
|
79
|
+
TttxDialog.style = tttxDialogCss;
|
|
80
|
+
|
|
81
|
+
exports.tttx_dialog = TttxDialog;
|
|
@@ -65,6 +65,11 @@ function validityCheck(event) {
|
|
|
65
65
|
default:
|
|
66
66
|
hasError = false;
|
|
67
67
|
}
|
|
68
|
+
//handle whitespace-only input
|
|
69
|
+
if (!target.value.replace(/\s/g, '').length && target.value.length !== 0) {
|
|
70
|
+
errorMessage = 'Whitespace-only not allowed';
|
|
71
|
+
hasError = true;
|
|
72
|
+
}
|
|
68
73
|
// Return the error state
|
|
69
74
|
return { target, hasError, errorMessage };
|
|
70
75
|
}
|
|
@@ -80,13 +80,15 @@ const TttxTabs = class {
|
|
|
80
80
|
if (!this.tabs || this.tabs.length == 0) {
|
|
81
81
|
return;
|
|
82
82
|
}
|
|
83
|
+
let currentTab = this._tabs[0];
|
|
84
|
+
if (this.tabFocus > -1) {
|
|
85
|
+
currentTab = this._tabs[this.tabFocus];
|
|
86
|
+
}
|
|
83
87
|
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
88
|
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
89
|
this.handleTabClick(tab);
|
|
86
90
|
} }, 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" })))),
|
|
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
|
-
}))));
|
|
91
|
+
})), this.navigation && (index.h("div", { class: "right-navigation", tabindex: "0", onClick: this.handleRightNavigation.bind(this) }, index.h("tttx-icon", { icon: "navigate_next", color: "black" })))), index.h("article", { key: currentTab.id, id: currentTab.controls, role: "tabpanel", tabindex: "0", "aria-labelledby": currentTab.id, "aria-expanded": currentTab.selected, innerHTML: domsanitiser_options.purify.sanitize(currentTab.pageContent, domsanitiser_options.domSanitiserOptions), hidden: !currentTab.selected }))));
|
|
90
92
|
}
|
|
91
93
|
static get watchers() { return {
|
|
92
94
|
"tabs": ["onDataChange"]
|
package/dist/cjs/tttx.cjs.js
CHANGED
|
@@ -17,7 +17,7 @@ const patchBrowser = () => {
|
|
|
17
17
|
};
|
|
18
18
|
|
|
19
19
|
patchBrowser().then(options => {
|
|
20
|
-
return index.bootstrapLazy([["tttx-data-pattern.cjs",[[1,"tttx-data-pattern",{"data":[1],"sorteroptions":[1],"filteroptions":[1],"filterheader":[1]}]]],["tttx-multiselect-box.cjs",[[1,"tttx-multiselect-box",{"optionsData":[1,"options-data"],"label":[1],"inline":[4],"placeholder":[1],"searchEnabled":[4,"search-enabled"],"htmlVisibleValue":[4,"html-visible-value"],"visibleValue":[1,"visible-value"],"open":[32],"unsavedSelectedItems":[32],"searchTerm":[32]},[[0,"closeSelectBox","handleCloseSelectBox"],[0,"blur","handleBlur"]]]]],["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],"selectedId":[32]}]]],["tttx-checkbox.cjs",[[0,"tttx-checkbox",{"checkboxId":[1,"checkbox-id"],"label":[1],"inline":[4],"indeterminate":[4],"checked":[4]}]]],["tttx-expander.cjs",[[1,"tttx-expander",{"name":[1],"open":[4],"lefticon":[1],"lefticoncolor":[1],"isExpanded":[32]}]]],["tttx-tabs.cjs",[[2,"tttx-tabs",{"tabsName":[1,"tabs-name"],"navigation":[4],"wide":[4],"tabs":[1],"_tabs":[32]},[[0,"keydown","handleKeyDown"]]]]],["tttx-checkbox-group.cjs",[[1,"tttx-checkbox-group"]]],["tttx-checkbox-group-caption.cjs",[[4,"tttx-checkbox-group-caption"]]],["tttx-checkbox-group-heading.cjs",[[4,"tttx-checkbox-group-heading"]]],["tttx-form.cjs",[[1,"tttx-form",{"formschema":[1025],"data":[1032],"submit":[64]}]]],["tttx-keyvalue-block.cjs",[[1,"tttx-keyvalue-block",{"keyvalues":[1],"horizontal":[4],"spacedout":[4],"_elements":[32]}]]],["tttx-loading-spinner.cjs",[[1,"tttx-loading-spinner",{"loadingMessage":[1028,"loading-message"],"size":[1025]}]]],["tttx-percentage-bar.cjs",[[2,"tttx-percentage-bar",{"percentage":[8],"thresholds":[1],"color":[1],"min":[1],"labelid":[1],"_percentage":[32],"_ranges":[32],"_min":[32]}]]],["tttx-qrcode.cjs",[[1,"tttx-qrcode",{"link":[1025],"size":[1026]}]]],["tttx-tag.cjs",[[1,"tttx-tag",{"text":[1],"color":[1],"textColor":[1,"text-color"]}]]],["tttx-textarea.cjs",[[2,"tttx-textarea",{"label":[1],"secondarylabel":[1],"showerrormsg":[4],"showerrorbubble":[4],"errormsg":[1],"rows":[2],"textareaautofocus":[4],"inputkeyhint":[1],"inputindex":[8],"inputtitle":[1],"disabled":[4],"maxlength":[8],"name":[1],"placeholder":[1],"readonly":[8],"required":[4],"value":[1032]}]]],["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-filter_4.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"]]],[1,"tttx-list",{"data":[1025],"name":[1],"_data":[32]}],[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"]]],[1,"tttx-toolbar",{"border":[4],"viewSize":[32]},[[9,"resize","handleResize"]]]]],["tttx-button.cjs",[[1,"tttx-button",{"notext":[4],"icon":[1],"iconposition":[1],"iconcolor":[1025],"design":[1]}]]]], options);
|
|
20
|
+
return index.bootstrapLazy([["tttx-data-pattern.cjs",[[1,"tttx-data-pattern",{"data":[1],"sorteroptions":[1],"filteroptions":[1],"filterheader":[1]}]]],["tttx-multiselect-box.cjs",[[1,"tttx-multiselect-box",{"optionsData":[1,"options-data"],"label":[1],"inline":[4],"placeholder":[1],"searchEnabled":[4,"search-enabled"],"htmlVisibleValue":[4,"html-visible-value"],"visibleValue":[1,"visible-value"],"open":[32],"unsavedSelectedItems":[32],"searchTerm":[32]},[[0,"closeSelectBox","handleCloseSelectBox"],[0,"blur","handleBlur"]]]]],["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],"selectedId":[32]}]]],["tttx-checkbox.cjs",[[0,"tttx-checkbox",{"checkboxId":[1,"checkbox-id"],"label":[1],"inline":[4],"indeterminate":[4],"checked":[4]}]]],["tttx-dialog.cjs",[[1,"tttx-dialog",{"header":[1],"type":[1],"size":[1],"open":[4],"allowOverflow":[4,"allow-overflow"],"closeEnabled":[4,"close-enabled"],"elementSize":[32]},[[9,"resize","handleResize"]]]]],["tttx-expander.cjs",[[1,"tttx-expander",{"name":[1],"open":[4],"lefticon":[1],"lefticoncolor":[1],"isExpanded":[32]}]]],["tttx-tabs.cjs",[[2,"tttx-tabs",{"tabsName":[1,"tabs-name"],"navigation":[4],"wide":[4],"tabs":[1],"_tabs":[32]},[[0,"keydown","handleKeyDown"]]]]],["tttx-checkbox-group.cjs",[[1,"tttx-checkbox-group"]]],["tttx-checkbox-group-caption.cjs",[[4,"tttx-checkbox-group-caption"]]],["tttx-checkbox-group-heading.cjs",[[4,"tttx-checkbox-group-heading"]]],["tttx-form.cjs",[[1,"tttx-form",{"formschema":[1025],"data":[1032],"submit":[64]}]]],["tttx-keyvalue-block.cjs",[[1,"tttx-keyvalue-block",{"keyvalues":[1],"horizontal":[4],"spacedout":[4],"_elements":[32]}]]],["tttx-loading-spinner.cjs",[[1,"tttx-loading-spinner",{"loadingMessage":[1028,"loading-message"],"size":[1025]}]]],["tttx-percentage-bar.cjs",[[2,"tttx-percentage-bar",{"percentage":[8],"thresholds":[1],"color":[1],"min":[1],"labelid":[1],"_percentage":[32],"_ranges":[32],"_min":[32]}]]],["tttx-qrcode.cjs",[[1,"tttx-qrcode",{"link":[1025],"size":[1026]}]]],["tttx-tag.cjs",[[1,"tttx-tag",{"text":[1],"color":[1],"textColor":[1,"text-color"]}]]],["tttx-textarea.cjs",[[2,"tttx-textarea",{"label":[1],"secondarylabel":[1],"showerrormsg":[4],"showerrorbubble":[4],"errormsg":[1],"rows":[2],"textareaautofocus":[4],"inputkeyhint":[1],"inputindex":[8],"inputtitle":[1],"disabled":[4],"maxlength":[8],"name":[1],"placeholder":[1],"readonly":[8],"required":[4],"value":[1032]}]]],["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-filter_4.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"]]],[1,"tttx-list",{"data":[1025],"name":[1],"_data":[32]}],[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"]]],[1,"tttx-toolbar",{"border":[4],"viewSize":[32]},[[9,"resize","handleResize"]]]]],["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-checkbox-group/tttx-checkbox-group.js",
|
|
14
14
|
"./components/molecules/tttx-checkbox-group/components/tttx-checkbox-group-caption.js",
|
|
15
15
|
"./components/molecules/tttx-checkbox-group/components/tttx-checkbox-group-heading.js",
|
|
16
|
+
"./components/molecules/tttx-dialog/tttx-dialog.js",
|
|
16
17
|
"./components/molecules/tttx-dialog-box/tttx-dialog-box.js",
|
|
17
18
|
"./components/molecules/tttx-expander/tttx-expander.js",
|
|
18
19
|
"./components/molecules/tttx-form/tttx-form.js",
|
|
@@ -0,0 +1,147 @@
|
|
|
1
|
+
.material-symbols-rounded {
|
|
2
|
+
font-variation-settings: "FILL" 1, "wght" 400, "GRAD" 0, "opsz" 24;
|
|
3
|
+
}
|
|
4
|
+
|
|
5
|
+
.material-symbols-rounded {
|
|
6
|
+
font-family: "Material Symbols Rounded", sans-serif;
|
|
7
|
+
font-weight: 400;
|
|
8
|
+
font-style: normal;
|
|
9
|
+
font-size: 24px;
|
|
10
|
+
line-height: 1;
|
|
11
|
+
letter-spacing: normal;
|
|
12
|
+
text-transform: none;
|
|
13
|
+
display: inline-block;
|
|
14
|
+
white-space: nowrap;
|
|
15
|
+
word-wrap: normal;
|
|
16
|
+
direction: ltr;
|
|
17
|
+
text-rendering: optimizeLegibility;
|
|
18
|
+
-webkit-font-smoothing: antialiased;
|
|
19
|
+
color: #9e9e9e;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
h3 {
|
|
23
|
+
margin-block-start: 0em;
|
|
24
|
+
margin-block-end: 0em;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
.dialog-box {
|
|
28
|
+
background-color: #ffffff;
|
|
29
|
+
border: 1px solid #d5d5d5;
|
|
30
|
+
border-radius: 4px;
|
|
31
|
+
box-shadow: 0px 1px 5px #1111114d;
|
|
32
|
+
padding: 0;
|
|
33
|
+
}
|
|
34
|
+
.dialog-box.small {
|
|
35
|
+
width: 400px;
|
|
36
|
+
min-height: 200px;
|
|
37
|
+
}
|
|
38
|
+
.dialog-box.regular {
|
|
39
|
+
width: 600px;
|
|
40
|
+
min-height: 200px;
|
|
41
|
+
}
|
|
42
|
+
.dialog-box.large {
|
|
43
|
+
width: 900px;
|
|
44
|
+
min-height: 200px;
|
|
45
|
+
}
|
|
46
|
+
.dialog-box.mobile {
|
|
47
|
+
max-width: 424px;
|
|
48
|
+
width: calc(100vw - 20px);
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
.overflow-visible {
|
|
52
|
+
overflow: visible;
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
.overflow-hidden {
|
|
56
|
+
overflow: hidden;
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
dialog::backdrop {
|
|
60
|
+
background-color: #75757580;
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
.clickable {
|
|
64
|
+
cursor: pointer;
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
.contents {
|
|
68
|
+
display: flex;
|
|
69
|
+
flex-direction: column;
|
|
70
|
+
min-height: inherit;
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
.padding {
|
|
74
|
+
padding: 8px 16px;
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
.align-right {
|
|
78
|
+
margin-left: auto;
|
|
79
|
+
display: flex;
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
.header {
|
|
83
|
+
border-bottom: 1px solid #d5d5d5;
|
|
84
|
+
display: flex;
|
|
85
|
+
flex-direction: row;
|
|
86
|
+
align-items: center;
|
|
87
|
+
height: 36px;
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
.title {
|
|
91
|
+
font-size: 18;
|
|
92
|
+
font-weight: 500;
|
|
93
|
+
font-family: "Roboto", serif;
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
.icon {
|
|
97
|
+
padding-right: 8px;
|
|
98
|
+
width: 24px;
|
|
99
|
+
height: 24px;
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
.icon-close {
|
|
103
|
+
margin-left: auto;
|
|
104
|
+
padding-top: 3px;
|
|
105
|
+
width: 24px;
|
|
106
|
+
height: 24px;
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
.body-content {
|
|
110
|
+
font-size: 16;
|
|
111
|
+
font-weight: 400;
|
|
112
|
+
font-family: "Roboto", serif;
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
.body {
|
|
116
|
+
text-overflow: ellipsis;
|
|
117
|
+
padding: 16px;
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
.footer {
|
|
121
|
+
display: flex;
|
|
122
|
+
flex-direction: row;
|
|
123
|
+
margin-top: auto;
|
|
124
|
+
border-top: 1px solid #d5d5d5;
|
|
125
|
+
height: 36px;
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
::slotted([slot=buttons]) {
|
|
129
|
+
display: flex;
|
|
130
|
+
gap: 8px;
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
.header.info {
|
|
134
|
+
border-bottom: 1px solid #1479c6;
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
.header.success {
|
|
138
|
+
border-bottom: 1px solid #a2bb31;
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
.header.warning {
|
|
142
|
+
border-bottom: 1px solid #f59500;
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
.header.critical {
|
|
146
|
+
border-bottom: 1px solid #dc0000;
|
|
147
|
+
}
|
|
@@ -0,0 +1,218 @@
|
|
|
1
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
2
|
+
import { h } from '@stencil/core';
|
|
3
|
+
import { ICON_TYPES } from './icon-types';
|
|
4
|
+
export class TttxDialog {
|
|
5
|
+
constructor() {
|
|
6
|
+
this.header = undefined;
|
|
7
|
+
this.type = undefined;
|
|
8
|
+
this.size = 'regular';
|
|
9
|
+
this.open = false;
|
|
10
|
+
this.allowOverflow = false;
|
|
11
|
+
this.closeEnabled = true;
|
|
12
|
+
this.elementSize = undefined;
|
|
13
|
+
}
|
|
14
|
+
handleResize() {
|
|
15
|
+
if (window.innerWidth < 698) {
|
|
16
|
+
this.elementSize = 'mobile';
|
|
17
|
+
}
|
|
18
|
+
else {
|
|
19
|
+
this.elementSize = this.size;
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
preventCancelOnDialog(event) {
|
|
23
|
+
event.preventDefault();
|
|
24
|
+
}
|
|
25
|
+
componentDidLoad() {
|
|
26
|
+
this.dialog.addEventListener('cancel', this.preventCancelOnDialog);
|
|
27
|
+
}
|
|
28
|
+
onCloseClickHandler() {
|
|
29
|
+
this.closeButtonClick.emit();
|
|
30
|
+
}
|
|
31
|
+
headerIconDetails(iconEnabled) {
|
|
32
|
+
if (!iconEnabled)
|
|
33
|
+
return { iconName: undefined, iconColor: undefined };
|
|
34
|
+
return ICON_TYPES[this.type];
|
|
35
|
+
}
|
|
36
|
+
renderHeader() {
|
|
37
|
+
const iconEnabled = typeof this.type !== 'undefined';
|
|
38
|
+
const { iconName, iconColor } = this.headerIconDetails(iconEnabled);
|
|
39
|
+
return (h("div", { class: `padding header ${this.type || ''}` }, iconEnabled && h("tttx-icon", { class: "icon", icon: iconName, color: iconColor }), h("h3", { class: "title" }, this.header), this.closeEnabled && (h("div", { class: "align-right close-button", onClick: () => this.onCloseClickHandler() }, h("tttx-icon", { class: "icon-close clickable", icon: "close", color: "black" })))));
|
|
40
|
+
}
|
|
41
|
+
body() {
|
|
42
|
+
return (h("div", { class: `body ${!this.allowOverflow ? 'overflow-hidden' : ''}` }, h("span", { class: "body-content" }, h("slot", null))));
|
|
43
|
+
}
|
|
44
|
+
footer() {
|
|
45
|
+
if (!this.el.querySelector('[slot="buttons"]'))
|
|
46
|
+
return;
|
|
47
|
+
return (h("div", { class: "padding footer" }, h("div", { class: "align-right" }, h("slot", { name: "buttons" }))));
|
|
48
|
+
}
|
|
49
|
+
componentDidRender() {
|
|
50
|
+
if (!this.open) {
|
|
51
|
+
this.dialog.close();
|
|
52
|
+
return;
|
|
53
|
+
}
|
|
54
|
+
if (!this.dialog.open)
|
|
55
|
+
this.dialog.showModal();
|
|
56
|
+
}
|
|
57
|
+
componentWillLoad() {
|
|
58
|
+
this.handleResize();
|
|
59
|
+
}
|
|
60
|
+
render() {
|
|
61
|
+
return (h("dialog", { ref: (el) => this.dialog = el, class: `dialog-box ${this.allowOverflow ? 'overflow-visible' : ''} ${this.elementSize}` }, h("div", { class: "contents" }, this.renderHeader(), this.body(), this.footer())));
|
|
62
|
+
}
|
|
63
|
+
static get is() { return "tttx-dialog"; }
|
|
64
|
+
static get encapsulation() { return "shadow"; }
|
|
65
|
+
static get originalStyleUrls() {
|
|
66
|
+
return {
|
|
67
|
+
"$": ["tttx-dialog.scss"]
|
|
68
|
+
};
|
|
69
|
+
}
|
|
70
|
+
static get styleUrls() {
|
|
71
|
+
return {
|
|
72
|
+
"$": ["tttx-dialog.css"]
|
|
73
|
+
};
|
|
74
|
+
}
|
|
75
|
+
static get properties() {
|
|
76
|
+
return {
|
|
77
|
+
"header": {
|
|
78
|
+
"type": "string",
|
|
79
|
+
"mutable": false,
|
|
80
|
+
"complexType": {
|
|
81
|
+
"original": "string",
|
|
82
|
+
"resolved": "string",
|
|
83
|
+
"references": {}
|
|
84
|
+
},
|
|
85
|
+
"required": false,
|
|
86
|
+
"optional": false,
|
|
87
|
+
"docs": {
|
|
88
|
+
"tags": [],
|
|
89
|
+
"text": ""
|
|
90
|
+
},
|
|
91
|
+
"attribute": "header",
|
|
92
|
+
"reflect": false
|
|
93
|
+
},
|
|
94
|
+
"type": {
|
|
95
|
+
"type": "string",
|
|
96
|
+
"mutable": false,
|
|
97
|
+
"complexType": {
|
|
98
|
+
"original": "'info' | 'success' | 'warning' | 'critical' | undefined",
|
|
99
|
+
"resolved": "\"critical\" | \"info\" | \"success\" | \"warning\"",
|
|
100
|
+
"references": {}
|
|
101
|
+
},
|
|
102
|
+
"required": false,
|
|
103
|
+
"optional": false,
|
|
104
|
+
"docs": {
|
|
105
|
+
"tags": [],
|
|
106
|
+
"text": ""
|
|
107
|
+
},
|
|
108
|
+
"attribute": "type",
|
|
109
|
+
"reflect": false
|
|
110
|
+
},
|
|
111
|
+
"size": {
|
|
112
|
+
"type": "string",
|
|
113
|
+
"mutable": false,
|
|
114
|
+
"complexType": {
|
|
115
|
+
"original": "'regular' | 'mobile' | 'large' | 'small'",
|
|
116
|
+
"resolved": "\"large\" | \"mobile\" | \"regular\" | \"small\"",
|
|
117
|
+
"references": {}
|
|
118
|
+
},
|
|
119
|
+
"required": false,
|
|
120
|
+
"optional": false,
|
|
121
|
+
"docs": {
|
|
122
|
+
"tags": [],
|
|
123
|
+
"text": ""
|
|
124
|
+
},
|
|
125
|
+
"attribute": "size",
|
|
126
|
+
"reflect": false,
|
|
127
|
+
"defaultValue": "'regular'"
|
|
128
|
+
},
|
|
129
|
+
"open": {
|
|
130
|
+
"type": "boolean",
|
|
131
|
+
"mutable": false,
|
|
132
|
+
"complexType": {
|
|
133
|
+
"original": "boolean",
|
|
134
|
+
"resolved": "boolean",
|
|
135
|
+
"references": {}
|
|
136
|
+
},
|
|
137
|
+
"required": false,
|
|
138
|
+
"optional": false,
|
|
139
|
+
"docs": {
|
|
140
|
+
"tags": [],
|
|
141
|
+
"text": ""
|
|
142
|
+
},
|
|
143
|
+
"attribute": "open",
|
|
144
|
+
"reflect": false,
|
|
145
|
+
"defaultValue": "false"
|
|
146
|
+
},
|
|
147
|
+
"allowOverflow": {
|
|
148
|
+
"type": "boolean",
|
|
149
|
+
"mutable": false,
|
|
150
|
+
"complexType": {
|
|
151
|
+
"original": "boolean",
|
|
152
|
+
"resolved": "boolean",
|
|
153
|
+
"references": {}
|
|
154
|
+
},
|
|
155
|
+
"required": false,
|
|
156
|
+
"optional": false,
|
|
157
|
+
"docs": {
|
|
158
|
+
"tags": [],
|
|
159
|
+
"text": ""
|
|
160
|
+
},
|
|
161
|
+
"attribute": "allow-overflow",
|
|
162
|
+
"reflect": false,
|
|
163
|
+
"defaultValue": "false"
|
|
164
|
+
},
|
|
165
|
+
"closeEnabled": {
|
|
166
|
+
"type": "boolean",
|
|
167
|
+
"mutable": false,
|
|
168
|
+
"complexType": {
|
|
169
|
+
"original": "boolean",
|
|
170
|
+
"resolved": "boolean",
|
|
171
|
+
"references": {}
|
|
172
|
+
},
|
|
173
|
+
"required": false,
|
|
174
|
+
"optional": false,
|
|
175
|
+
"docs": {
|
|
176
|
+
"tags": [],
|
|
177
|
+
"text": ""
|
|
178
|
+
},
|
|
179
|
+
"attribute": "close-enabled",
|
|
180
|
+
"reflect": false,
|
|
181
|
+
"defaultValue": "true"
|
|
182
|
+
}
|
|
183
|
+
};
|
|
184
|
+
}
|
|
185
|
+
static get states() {
|
|
186
|
+
return {
|
|
187
|
+
"elementSize": {}
|
|
188
|
+
};
|
|
189
|
+
}
|
|
190
|
+
static get events() {
|
|
191
|
+
return [{
|
|
192
|
+
"method": "closeButtonClick",
|
|
193
|
+
"name": "closeButtonClick",
|
|
194
|
+
"bubbles": true,
|
|
195
|
+
"cancelable": false,
|
|
196
|
+
"composed": true,
|
|
197
|
+
"docs": {
|
|
198
|
+
"tags": [],
|
|
199
|
+
"text": ""
|
|
200
|
+
},
|
|
201
|
+
"complexType": {
|
|
202
|
+
"original": "any",
|
|
203
|
+
"resolved": "any",
|
|
204
|
+
"references": {}
|
|
205
|
+
}
|
|
206
|
+
}];
|
|
207
|
+
}
|
|
208
|
+
static get elementRef() { return "el"; }
|
|
209
|
+
static get listeners() {
|
|
210
|
+
return [{
|
|
211
|
+
"name": "resize",
|
|
212
|
+
"method": "handleResize",
|
|
213
|
+
"target": "window",
|
|
214
|
+
"capture": false,
|
|
215
|
+
"passive": true
|
|
216
|
+
}];
|
|
217
|
+
}
|
|
218
|
+
}
|
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
import { withActions } from '@storybook/addon-actions/decorator';
|
|
2
|
+
export default {
|
|
3
|
+
title: 'molecules/Dialog V2',
|
|
4
|
+
component: 'tttx-dialog',
|
|
5
|
+
argTypes: {
|
|
6
|
+
header: {
|
|
7
|
+
control: { type: 'text' },
|
|
8
|
+
},
|
|
9
|
+
type: {
|
|
10
|
+
control: { type: 'select' },
|
|
11
|
+
options: ['info', 'success', 'warning', 'critical', undefined],
|
|
12
|
+
},
|
|
13
|
+
size: {
|
|
14
|
+
control: { type: 'select' },
|
|
15
|
+
options: ['regular', 'mobile', 'large', 'small', undefined]
|
|
16
|
+
},
|
|
17
|
+
closeEnabled: {
|
|
18
|
+
control: { type: 'switch' }
|
|
19
|
+
}
|
|
20
|
+
},
|
|
21
|
+
parameters: {
|
|
22
|
+
actions: {
|
|
23
|
+
handles: ['closeButtonClick'],
|
|
24
|
+
},
|
|
25
|
+
docs: {
|
|
26
|
+
description: {
|
|
27
|
+
component: 'A second version of the dialog component, which uses slots instead of html strings.',
|
|
28
|
+
},
|
|
29
|
+
},
|
|
30
|
+
},
|
|
31
|
+
decorators: [withActions],
|
|
32
|
+
};
|
|
33
|
+
const TttxDialogStory = (args) => `
|
|
34
|
+
<button onclick="openDialog()">Open</button>
|
|
35
|
+
<tttx-dialog
|
|
36
|
+
id='dialog'
|
|
37
|
+
header='${args.header}'
|
|
38
|
+
close-enabled='${args.closeEnabled}'
|
|
39
|
+
${args.type ? `type='${args.type}'` : ''}
|
|
40
|
+
${args.size ? `size='${args.size}'` : ''}
|
|
41
|
+
>
|
|
42
|
+
This is the default dialog
|
|
43
|
+
<div slot="buttons">
|
|
44
|
+
<tttx-button design="primary">Primary</tttx-button>
|
|
45
|
+
<tttx-button onClick="closeDialog()">Cancel</tttx-button>
|
|
46
|
+
</div>
|
|
47
|
+
</tttx-dialog>
|
|
48
|
+
<script>
|
|
49
|
+
if(!openDialog) {
|
|
50
|
+
function openDialog() {
|
|
51
|
+
dialog.open = true;
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
if(!closeDialog) {
|
|
55
|
+
function closeDialog() {
|
|
56
|
+
dialog.open = false
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
dialog.removeEventListener('closeButtonClick', closeDialog)
|
|
60
|
+
dialog.addEventListener('closeButtonClick', closeDialog)
|
|
61
|
+
</script>
|
|
62
|
+
`;
|
|
63
|
+
export const Default = TttxDialogStory.bind({});
|
|
64
|
+
Default.args = {
|
|
65
|
+
header: 'Dialog Title',
|
|
66
|
+
closeEnabled: true
|
|
67
|
+
};
|
|
68
|
+
const TttxDialogWithoutFooterStory = (args) => `
|
|
69
|
+
<button onclick="openDialogNoFooter()">Open</button>
|
|
70
|
+
<tttx-dialog
|
|
71
|
+
id='dialogNoFooter'
|
|
72
|
+
header='${args.header}'
|
|
73
|
+
close-enabled='${args.closeEnabled}'
|
|
74
|
+
${args.type ? `type='${args.type}'` : ''}
|
|
75
|
+
${args.size ? `size='${args.size}'` : ''}
|
|
76
|
+
>
|
|
77
|
+
This dialog has no footer
|
|
78
|
+
</tttx-dialog>
|
|
79
|
+
<script>
|
|
80
|
+
if(!openDialogNoFooter) {
|
|
81
|
+
function openDialogNoFooter() {
|
|
82
|
+
dialogNoFooter.open = true;
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
if(!closeDialogNoFooter) {
|
|
86
|
+
function closeDialogNoFooter() {
|
|
87
|
+
dialogNoFooter.open = false
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
dialogNoFooter.removeEventListener('closeButtonClick', closeDialogNoFooter)
|
|
91
|
+
dialogNoFooter.addEventListener('closeButtonClick', closeDialogNoFooter)
|
|
92
|
+
</script>
|
|
93
|
+
`;
|
|
94
|
+
export const WithoutFooter = TttxDialogWithoutFooterStory.bind({});
|
|
95
|
+
WithoutFooter.args = {
|
|
96
|
+
header: 'Dialog Title',
|
|
97
|
+
closeEnabled: true
|
|
98
|
+
};
|