@3t-transform/threeteeui 0.0.15 → 0.0.16
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/index-864b7110.js +1531 -0
- package/dist/cjs/index.cjs.js +2 -0
- package/dist/cjs/loader.cjs.js +22 -0
- package/dist/cjs/tttx-button.cjs.entry.js +28 -0
- package/dist/cjs/tttx-checkbox.cjs.entry.js +28 -0
- package/dist/cjs/tttx-form.cjs.entry.js +374 -0
- package/dist/cjs/tttx-icon.cjs.entry.js +1863 -0
- package/dist/cjs/tttx-list.cjs.entry.js +198 -0
- package/dist/cjs/tttx-loading-spinner.cjs.entry.js +26 -0
- package/dist/cjs/tttx-popover-content.cjs.entry.js +23 -0
- package/dist/cjs/tttx-standalone-input.cjs.entry.js +136 -0
- package/dist/cjs/tttx-table.cjs.entry.js +60 -0
- package/dist/cjs/tttx.cjs.js +23 -0
- package/dist/collection/collection-manifest.json +20 -0
- package/dist/collection/components/atoms/tttx-button/tttx-button.css +62 -0
- package/dist/collection/components/atoms/tttx-button/tttx-button.js +93 -0
- package/dist/collection/components/atoms/tttx-button/tttx-button.stories.js +27 -0
- package/dist/collection/components/atoms/tttx-icon/tttx-icon.css +105 -0
- package/dist/collection/components/atoms/tttx-icon/tttx-icon.js +116 -0
- package/dist/collection/components/atoms/tttx-icon/tttx-icon.stories.js +47 -0
- package/dist/collection/components/atoms/tttx-loading-spinner/tttx-loading-spinner.css +48 -0
- package/dist/collection/components/atoms/tttx-loading-spinner/tttx-loading-spinner.js +66 -0
- package/dist/collection/components/atoms/tttx-loading-spinner/tttx-loading-spinner.stories.js +17 -0
- package/dist/collection/components/atoms/tttx-popover-content/tttx-popover-content.css +30 -0
- package/dist/collection/components/atoms/tttx-popover-content/tttx-popover-content.js +96 -0
- package/dist/collection/components/atoms/tttx-popover-content/tttx-popover-content.stories.js +23 -0
- package/dist/collection/components/atoms/ttx-checkbox/tttx-checkbox.css +181 -0
- package/dist/collection/components/atoms/ttx-checkbox/tttx-checkbox.js +101 -0
- package/dist/collection/components/atoms/ttx-checkbox/tttx-checkbox.stories.js +13 -0
- package/dist/collection/components/molecules/tttx-form/tttx-form.css +230 -0
- package/dist/collection/components/molecules/tttx-form/tttx-form.js +451 -0
- package/dist/collection/components/molecules/tttx-form/tttx-form.stories.js +109 -0
- package/dist/collection/components/molecules/tttx-list/tttx-list.css +56 -0
- package/dist/collection/components/molecules/tttx-list/tttx-list.js +311 -0
- package/dist/collection/components/molecules/tttx-list/tttx-list.stories.js +37 -0
- package/dist/collection/components/molecules/tttx-standalone-input/tttx-standalone-input.css +177 -0
- package/dist/collection/components/molecules/tttx-standalone-input/tttx-standalone-input.js +569 -0
- package/dist/collection/components/molecules/tttx-standalone-input/tttx-standalone-input.stories.js +156 -0
- package/dist/collection/components/molecules/tttx-table/tttx-table.css +166 -0
- package/dist/collection/components/molecules/tttx-table/tttx-table.js +177 -0
- package/dist/collection/components/molecules/tttx-table/tttx-table.stories.js +81 -0
- package/dist/collection/components/palette.stories.js +88 -0
- package/dist/collection/docs/gettingstarted-developer.stories.js +9 -0
- package/dist/collection/icons.js +2838 -0
- package/dist/collection/index.js +1 -0
- package/dist/components/index.d.ts +39 -0
- package/dist/components/index.js +10 -0
- package/dist/components/tttx-button.d.ts +11 -0
- package/dist/components/tttx-button.js +45 -0
- package/dist/components/tttx-checkbox.d.ts +11 -0
- package/dist/components/tttx-checkbox.js +46 -0
- package/dist/components/tttx-form.d.ts +11 -0
- package/dist/components/tttx-form.js +391 -0
- package/dist/components/tttx-icon.d.ts +11 -0
- package/dist/components/tttx-icon.js +6 -0
- package/dist/components/tttx-icon2.js +1877 -0
- package/dist/components/tttx-list.d.ts +11 -0
- package/dist/components/tttx-list.js +225 -0
- package/dist/components/tttx-loading-spinner.d.ts +11 -0
- package/dist/components/tttx-loading-spinner.js +6 -0
- package/dist/components/tttx-loading-spinner2.js +40 -0
- package/dist/components/tttx-popover-content.d.ts +11 -0
- package/dist/components/tttx-popover-content.js +6 -0
- package/dist/components/tttx-popover-content2.js +39 -0
- package/dist/components/tttx-standalone-input.d.ts +11 -0
- package/dist/components/tttx-standalone-input.js +179 -0
- package/dist/components/tttx-table.d.ts +11 -0
- package/dist/components/tttx-table.js +91 -0
- package/dist/esm/index-232e347b.js +1502 -0
- package/dist/esm/index.js +1 -0
- package/dist/esm/loader.js +18 -0
- package/dist/esm/polyfills/core-js.js +11 -0
- package/dist/esm/polyfills/css-shim.js +1 -0
- package/dist/esm/polyfills/dom.js +79 -0
- package/dist/esm/polyfills/es5-html-element.js +1 -0
- package/dist/esm/polyfills/index.js +34 -0
- package/dist/esm/polyfills/system.js +6 -0
- package/dist/esm/tttx-button.entry.js +24 -0
- package/dist/esm/tttx-checkbox.entry.js +24 -0
- package/dist/esm/tttx-form.entry.js +370 -0
- package/dist/esm/tttx-icon.entry.js +1859 -0
- package/dist/esm/tttx-list.entry.js +194 -0
- package/dist/esm/tttx-loading-spinner.entry.js +22 -0
- package/dist/esm/tttx-popover-content.entry.js +19 -0
- package/dist/esm/tttx-standalone-input.entry.js +132 -0
- package/dist/esm/tttx-table.entry.js +56 -0
- package/dist/esm/tttx.js +18 -0
- package/dist/index.cjs.js +1 -0
- package/dist/index.js +1 -0
- package/dist/tttx/index.esm.js +0 -0
- package/dist/tttx/p-01e1894e.entry.js +1 -0
- package/dist/tttx/p-10316ff1.entry.js +1 -0
- package/dist/tttx/p-125f06b3.entry.js +1 -0
- package/dist/tttx/p-184c4fae.js +2 -0
- package/dist/tttx/p-3973b7dd.entry.js +1 -0
- package/dist/tttx/p-5ce1ba22.entry.js +1 -0
- package/dist/tttx/p-6828fe6f.entry.js +1 -0
- package/dist/tttx/p-b1c22f5f.entry.js +1 -0
- package/dist/tttx/p-c7f9be65.entry.js +1 -0
- package/dist/tttx/p-fe4c70b2.entry.js +1 -0
- package/dist/tttx/tttx.esm.js +1 -0
- package/dist/types/components/atoms/tttx-button/tttx-button.d.ts +9 -0
- package/dist/types/components/atoms/tttx-button/tttx-button.stories.d.ts +20 -0
- package/dist/types/components/atoms/tttx-icon/tttx-icon.d.ts +14 -0
- package/dist/types/components/atoms/tttx-icon/tttx-icon.stories.d.ts +21 -0
- package/dist/types/components/atoms/tttx-loading-spinner/tttx-loading-spinner.d.ts +6 -0
- package/dist/types/components/atoms/tttx-loading-spinner/tttx-loading-spinner.stories.d.ts +17 -0
- package/dist/types/components/atoms/tttx-popover-content/tttx-popover-content.d.ts +7 -0
- package/dist/types/components/atoms/tttx-popover-content/tttx-popover-content.stories.d.ts +18 -0
- package/dist/types/components/atoms/ttx-checkbox/tttx-checkbox.d.ts +9 -0
- package/dist/types/components/atoms/ttx-checkbox/tttx-checkbox.stories.d.ts +6 -0
- package/dist/types/components/molecules/tttx-form/tttx-form.d.ts +134 -0
- package/dist/types/components/molecules/tttx-form/tttx-form.stories.d.ts +12 -0
- package/dist/types/components/molecules/tttx-list/tttx-list.d.ts +51 -0
- package/dist/types/components/molecules/tttx-list/tttx-list.stories.d.ts +13 -0
- package/dist/types/components/molecules/tttx-standalone-input/tttx-standalone-input.d.ts +38 -0
- package/dist/types/components/molecules/tttx-standalone-input/tttx-standalone-input.stories.d.ts +106 -0
- package/dist/types/components/molecules/tttx-table/tttx-table.d.ts +15 -0
- package/dist/types/components/molecules/tttx-table/tttx-table.stories.d.ts +21 -0
- package/dist/types/components/palette.stories.d.ts +6 -0
- package/dist/types/components.d.ts +264 -0
- package/dist/types/docs/gettingstarted-developer.stories.d.ts +5 -0
- package/dist/types/icons.d.ts +2 -0
- package/dist/types/index.d.ts +1 -0
- package/dist/types/stencil-public-runtime.d.ts +1637 -0
- package/loader/cdn.js +3 -0
- package/loader/index.cjs.js +3 -0
- package/loader/index.d.ts +21 -0
- package/loader/index.es2017.js +3 -0
- package/loader/index.js +4 -0
- package/loader/package.json +11 -0
- package/package.json +1 -1
|
@@ -0,0 +1,198 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
const index = require('./index-864b7110.js');
|
|
6
|
+
|
|
7
|
+
const tttxListCss = ".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}:host{display:flex;flex-direction:column}.tttx-list__row{min-height:52px;line-height:36px;padding:8px;display:flex;flex-direction:row;align-items:center;cursor:pointer;border-bottom:1px solid #d5d5d5}.tttx-list__row .generic-template__content{width:100%;display:flex;align-items:center;gap:8px}.tttx-list__row:first-of-type{border-top:1px solid #d5d5d5}.tttx-list__row:focus,.tttx-list__row:active{background-color:#e6e6e6}.tttx-list__row.selected{background-color:#e7f1f9}.load-indicator{display:flex;justify-content:center}";
|
|
8
|
+
|
|
9
|
+
const TttxList = class {
|
|
10
|
+
constructor(hostRef) {
|
|
11
|
+
index.registerInstance(this, hostRef);
|
|
12
|
+
this.listPaginate = index.createEvent(this, "listPaginate", 7);
|
|
13
|
+
this.listSelectedEvent = index.createEvent(this, "listSelectedEvent", 7);
|
|
14
|
+
this.listItemClick = index.createEvent(this, "listItemClick", 7);
|
|
15
|
+
this.rowCount = 0;
|
|
16
|
+
this.name = undefined;
|
|
17
|
+
this.selectable = undefined;
|
|
18
|
+
this.items = [];
|
|
19
|
+
this.selectedIds = [];
|
|
20
|
+
this.loading = true;
|
|
21
|
+
this.lastPage = false;
|
|
22
|
+
}
|
|
23
|
+
listLoadHandler(event) {
|
|
24
|
+
if (event.detail.name !== this.name)
|
|
25
|
+
return;
|
|
26
|
+
this.items = [...this.items, ...event.detail.items];
|
|
27
|
+
this.loading = false;
|
|
28
|
+
this.lastPage = event.detail.lastPage;
|
|
29
|
+
this.renderRows(event.detail.items);
|
|
30
|
+
if (this.scrollableParent.clientHeight === this.scrollableParent.scrollHeight)
|
|
31
|
+
this.listPaginateHandler();
|
|
32
|
+
}
|
|
33
|
+
listPaginateHandler() {
|
|
34
|
+
// We don't want to emit an event to load the next page if this is the last page, or if we're already loading
|
|
35
|
+
if (this.lastPage || this.loading)
|
|
36
|
+
return;
|
|
37
|
+
this.loading = true;
|
|
38
|
+
this.listPaginate.emit({ name: this.name });
|
|
39
|
+
}
|
|
40
|
+
listClearDataCacheHandler(event) {
|
|
41
|
+
if (event.detail.name !== this.name)
|
|
42
|
+
return;
|
|
43
|
+
this.items = [];
|
|
44
|
+
this.selectedIds = [];
|
|
45
|
+
this.listItemContainer()
|
|
46
|
+
.querySelectorAll(".tttx-list__row")
|
|
47
|
+
.forEach((node) => {
|
|
48
|
+
node.remove();
|
|
49
|
+
});
|
|
50
|
+
this.rowCount = 0;
|
|
51
|
+
this.lastPage = false;
|
|
52
|
+
this.loading = false;
|
|
53
|
+
}
|
|
54
|
+
listActionSelectedEventHandler(event) {
|
|
55
|
+
if (event.detail.name !== this.name || !this.selectable || this.selectedIds.length === 0)
|
|
56
|
+
return;
|
|
57
|
+
const selectedRows = this.selectedIds.map(id => {
|
|
58
|
+
return this.items[id];
|
|
59
|
+
});
|
|
60
|
+
if (event.detail.removeRows)
|
|
61
|
+
this.removeSelectedRows();
|
|
62
|
+
this.listSelectedEvent.emit({
|
|
63
|
+
name: this.name,
|
|
64
|
+
eventName: event.detail.eventName,
|
|
65
|
+
selectedRows,
|
|
66
|
+
});
|
|
67
|
+
}
|
|
68
|
+
removeSelectedRows() {
|
|
69
|
+
const orderedSelectedIds = [...this.selectedIds].sort((a, b) => {
|
|
70
|
+
return b - a;
|
|
71
|
+
});
|
|
72
|
+
orderedSelectedIds.forEach(itemIndex => {
|
|
73
|
+
this.items.splice(itemIndex, 1);
|
|
74
|
+
this.listItemContainer().removeChild(this.listItemContainer().querySelector(`[data-row-id="${itemIndex}"]`));
|
|
75
|
+
// If this removes the scrollbar and we're not on the last page, load in a new page
|
|
76
|
+
if (this.scrollableParent.clientHeight === this.scrollableParent.scrollHeight)
|
|
77
|
+
this.listPaginateHandler();
|
|
78
|
+
});
|
|
79
|
+
// Empty selected ids with mutation rather than assignment to avoid unecessary component rerender
|
|
80
|
+
this.selectedIds.splice(0, this.selectedIds.length);
|
|
81
|
+
}
|
|
82
|
+
listItemClickHandler(itemData) {
|
|
83
|
+
if (this.selectedIds.length !== 0)
|
|
84
|
+
return;
|
|
85
|
+
this.listItemClick.emit({ itemData, name: this.name });
|
|
86
|
+
}
|
|
87
|
+
componentWillLoad() {
|
|
88
|
+
this.template = this.host.querySelector("template");
|
|
89
|
+
this.scrollableParent = this.getScrollableParent(this.host);
|
|
90
|
+
const scrollableContext = this.scrollableParent === document.scrollingElement ? document : this.scrollableParent;
|
|
91
|
+
scrollableContext.addEventListener("scroll", this.scrollHandler.bind(this));
|
|
92
|
+
window.addEventListener("resize", this.scrollHandler.bind(this));
|
|
93
|
+
}
|
|
94
|
+
componentDidLoad() {
|
|
95
|
+
// Emit event to load first page
|
|
96
|
+
this.listPaginate.emit({ name: this.name });
|
|
97
|
+
}
|
|
98
|
+
listItemContainer() {
|
|
99
|
+
return this.host.shadowRoot.querySelector(".list-item-container");
|
|
100
|
+
}
|
|
101
|
+
async scrollHandler() {
|
|
102
|
+
const { clientHeight, scrollTop, scrollHeight } = this.scrollableParent;
|
|
103
|
+
if (Math.abs(scrollHeight - clientHeight - scrollTop) < 26)
|
|
104
|
+
this.listPaginateHandler();
|
|
105
|
+
}
|
|
106
|
+
isScrollable(node) {
|
|
107
|
+
const hasScrollbar = ["scroll", "auto"].includes(node.style.overflowY);
|
|
108
|
+
return hasScrollbar;
|
|
109
|
+
}
|
|
110
|
+
getScrollableParent(node) {
|
|
111
|
+
if (!node || node === document.body) {
|
|
112
|
+
return document.scrollingElement;
|
|
113
|
+
}
|
|
114
|
+
else {
|
|
115
|
+
return this.isScrollable(node) ? node : this.getScrollableParent(node.parentElement);
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
appendRowCheckbox(rowContainer) {
|
|
119
|
+
if (!this.selectable)
|
|
120
|
+
return;
|
|
121
|
+
const rowId = this.rowCount;
|
|
122
|
+
const checkbox = document.createElement("input");
|
|
123
|
+
checkbox.setAttribute("type", "checkbox");
|
|
124
|
+
checkbox.addEventListener("click", e => {
|
|
125
|
+
e.stopPropagation();
|
|
126
|
+
if (e.target.checked) {
|
|
127
|
+
this.selectedIds = [...this.selectedIds, rowId];
|
|
128
|
+
rowContainer.classList.add("selected");
|
|
129
|
+
}
|
|
130
|
+
else {
|
|
131
|
+
this.selectedIds = this.selectedIds.filter(id => {
|
|
132
|
+
return id !== rowId;
|
|
133
|
+
});
|
|
134
|
+
rowContainer.classList.remove("selected");
|
|
135
|
+
}
|
|
136
|
+
});
|
|
137
|
+
rowContainer.setAttribute("data-row-id", `${rowId}`);
|
|
138
|
+
this.rowCount++;
|
|
139
|
+
rowContainer.appendChild(checkbox);
|
|
140
|
+
}
|
|
141
|
+
appendSeededTemplate(rowData, rowContainer) {
|
|
142
|
+
this.template.childNodes.forEach(child => {
|
|
143
|
+
const clone = child.cloneNode(false);
|
|
144
|
+
if (clone.getAttribute("data-fields")) {
|
|
145
|
+
const fields = clone.getAttribute("data-fields").replace(/\s/g, "").split(",");
|
|
146
|
+
const filteredRowData = Object.fromEntries(fields.map((field) => {
|
|
147
|
+
return [field, rowData[field]];
|
|
148
|
+
}));
|
|
149
|
+
clone.setAttribute("row-data", JSON.stringify(filteredRowData));
|
|
150
|
+
}
|
|
151
|
+
else {
|
|
152
|
+
clone.setAttribute("row-data", JSON.stringify(rowData));
|
|
153
|
+
}
|
|
154
|
+
rowContainer.appendChild(clone);
|
|
155
|
+
});
|
|
156
|
+
}
|
|
157
|
+
appendGenericTemplate(rowData, rowContainer) {
|
|
158
|
+
const row = document.createElement("div");
|
|
159
|
+
row.classList.add("generic-template__content");
|
|
160
|
+
row.textContent = rowData.text;
|
|
161
|
+
rowContainer.appendChild(row);
|
|
162
|
+
if (!rowData.icon)
|
|
163
|
+
return;
|
|
164
|
+
const icon = document.createElement("span");
|
|
165
|
+
icon.classList.add("material-symbols-rounded");
|
|
166
|
+
icon.textContent = rowData.icon;
|
|
167
|
+
if (rowData.iconColor)
|
|
168
|
+
icon.style["color"] = rowData.iconColor;
|
|
169
|
+
row.prepend(icon);
|
|
170
|
+
}
|
|
171
|
+
row(rowData) {
|
|
172
|
+
const rowContainer = document.createElement("div");
|
|
173
|
+
rowContainer.classList.add("tttx-list__row");
|
|
174
|
+
rowContainer.addEventListener("click", () => {
|
|
175
|
+
this.listItemClickHandler(rowData);
|
|
176
|
+
});
|
|
177
|
+
this.appendRowCheckbox(rowContainer);
|
|
178
|
+
this.template ? this.appendSeededTemplate(rowData, rowContainer) : this.appendGenericTemplate(rowData, rowContainer);
|
|
179
|
+
return rowContainer;
|
|
180
|
+
}
|
|
181
|
+
renderRows(batchData) {
|
|
182
|
+
batchData.forEach(rowData => {
|
|
183
|
+
this.listItemContainer().appendChild(this.row(rowData));
|
|
184
|
+
});
|
|
185
|
+
}
|
|
186
|
+
loadIndicator() {
|
|
187
|
+
if (!this.loading)
|
|
188
|
+
return;
|
|
189
|
+
return index.h("div", { class: "load-indicator" }, index.h("tttx-loading-spinner", { size: 'large' }));
|
|
190
|
+
}
|
|
191
|
+
render() {
|
|
192
|
+
return (index.h(index.Host, null, index.h("div", { class: "list-item-container", tabindex: "0" }, !this.loading && this.items.length === 0 ? "No data to display" : undefined), this.loadIndicator()));
|
|
193
|
+
}
|
|
194
|
+
get host() { return index.getElement(this); }
|
|
195
|
+
};
|
|
196
|
+
TttxList.style = tttxListCss;
|
|
197
|
+
|
|
198
|
+
exports.tttx_list = TttxList;
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
const index = require('./index-864b7110.js');
|
|
6
|
+
|
|
7
|
+
const tttxLoadingSpinnerCss = ".material-symbols-rounded{font-variation-settings:\"FILL\" 1, \"wght\" 400, \"GRAD\" 0, \"opsz\" 24}.spinner-container{position:absolute}.loading-box{display:flex;align-items:center;justify-content:center}.loading-text{font-size:16px;font-weight:400;padding-top:10px;text-align:center}.spinner{border:solid #1479c6;border-bottom-color:#d5d5d5;border-radius:50%;position:relative;box-sizing:border-box;animation:rotation 1s linear infinite}.spinner.small{height:20px;width:20px;border-width:4px}.spinner.large{height:60px;width:60px;border-width:8px}@keyframes rotation{0%{transform:rotate(0deg)}100%{transform:rotate(360deg)}}";
|
|
8
|
+
|
|
9
|
+
const TttxLoadingSpinner = class {
|
|
10
|
+
constructor(hostRef) {
|
|
11
|
+
index.registerInstance(this, hostRef);
|
|
12
|
+
this.loadingMessage = undefined;
|
|
13
|
+
this.size = 'large';
|
|
14
|
+
}
|
|
15
|
+
renderLoadingMessage() {
|
|
16
|
+
if (!this.loadingMessage)
|
|
17
|
+
return '';
|
|
18
|
+
return index.h("div", { class: "loading-text" }, "Loading, please wait...");
|
|
19
|
+
}
|
|
20
|
+
render() {
|
|
21
|
+
return (index.h("div", { class: "spinner-container" }, index.h("div", { class: "loading-box" }, index.h("span", { class: `spinner ${this.size}` })), this.renderLoadingMessage()));
|
|
22
|
+
}
|
|
23
|
+
};
|
|
24
|
+
TttxLoadingSpinner.style = tttxLoadingSpinnerCss;
|
|
25
|
+
|
|
26
|
+
exports.tttx_loading_spinner = TttxLoadingSpinner;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
const index = require('./index-864b7110.js');
|
|
6
|
+
|
|
7
|
+
const tttxPopoverContentCss = ".material-symbols-rounded{font-variation-settings:\"FILL\" 1, \"wght\" 400, \"GRAD\" 0, \"opsz\" 24}:host{display:block;max-width:400px}h4{margin:0;font-size:15px;font-weight:700;color:black;margin-bottom:4px}p{margin:0;font-size:14px;font-weight:normal;color:black;margin-bottom:4px}.linky{color:#1479c6;text-decoration:none;cursor:pointer}";
|
|
8
|
+
|
|
9
|
+
const TttxPopoverContent = class {
|
|
10
|
+
constructor(hostRef) {
|
|
11
|
+
index.registerInstance(this, hostRef);
|
|
12
|
+
this.header = undefined;
|
|
13
|
+
this.body = undefined;
|
|
14
|
+
this.linkcontext = undefined;
|
|
15
|
+
this.linktext = undefined;
|
|
16
|
+
}
|
|
17
|
+
render() {
|
|
18
|
+
return (index.h(index.Host, null, this.header && index.h("h4", null, this.header), this.body && index.h("p", null, this.body), this.linkcontext && (index.h("span", { class: "linky", onClick: evt => console.log(this.linkcontext, evt) }, this.linktext || 'More Information'))));
|
|
19
|
+
}
|
|
20
|
+
};
|
|
21
|
+
TttxPopoverContent.style = tttxPopoverContentCss;
|
|
22
|
+
|
|
23
|
+
exports.tttx_popover_content = TttxPopoverContent;
|
|
@@ -0,0 +1,136 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
const index = require('./index-864b7110.js');
|
|
6
|
+
|
|
7
|
+
const tttxStandaloneInputCss = ".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}.icon-left,.icon-right{flex-basis:24px}.icon-left span,.icon-right span{font-size:24px;line-height:24px;text-align:center;display:block;width:24px;height:24px;margin-top:4px}.icon-left span{margin-left:4px}.icon-right span{margin-right:4px}.icon-right{margin-top:5px;margin-right:4px}.icon-left{margin-top:5px;margin-left:4px}.iconleft .input{padding-left:4px}.iconright .input{padding-right:4px}.focused{border-color:#1479c6}.errormsg{display:flex;justify-content:center;align-items:center;float:left;margin-bottom:16px;box-sizing:border-box;background-color:transparent;height:26px;font-size:14px;border-radius:none;z-index:2;color:#dc0000}.errormsg .validationicon{width:16px;height:16px;font-size:16px;margin-right:4px;vertical-align:middle;color:#dc0000}.danger{color:#dc0000}.optional{color:#757575;font-weight:normal}label.inputBlock{display:block;position:relative;line-height:21px}label{font-weight:500;font-size:16px}input:not([type=submit]){font-family:\"Roboto\", serif;box-sizing:border-box;width:100%;height:36px;padding:0 16px;font-size:16px;border:1px solid #d5d5d5;border-radius:4px;margin-top:4px}input[type=date]{background:white;display:block;min-width:calc(100% - 18px);line-height:37px}input.invalid:invalid,input.standalone.invalid{border:1px solid #dc0000}input~.errorBubble{min-height:27px;position:relative;font-size:14px;font-weight:normal;width:100%;font-family:\"Roboto\", sans-serif;color:#dc0000;display:flex;align-content:center;align-items:center;justify-items:center}input~.errorBubble:not(.visible){visibility:hidden}input~.errorBubble span{color:#dc0000;font-size:16px;margin-right:4px;height:16px}input.invalid:invalid~.errorBubble{position:relative;font-size:14px;font-weight:normal;width:100%;font-family:\"Roboto\", sans-serif;color:#dc0000;visibility:visible}input:focus{border-color:#1479c6}:host{display:block}";
|
|
8
|
+
|
|
9
|
+
const TttxInput = class {
|
|
10
|
+
constructor(hostRef) {
|
|
11
|
+
index.registerInstance(this, hostRef);
|
|
12
|
+
this.valueChanged = index.createEvent(this, "valueChanged", 7);
|
|
13
|
+
this.focusChanged = index.createEvent(this, "focusChanged", 7);
|
|
14
|
+
this.blurChanged = index.createEvent(this, "blurChanged", 7);
|
|
15
|
+
this.label = undefined;
|
|
16
|
+
this.showerrormsg = undefined;
|
|
17
|
+
this.errormsg = undefined;
|
|
18
|
+
this.iconleft = undefined;
|
|
19
|
+
this.iconright = undefined;
|
|
20
|
+
this.autocapitalize = undefined;
|
|
21
|
+
this.autocomplete = undefined;
|
|
22
|
+
this.autofocus = undefined;
|
|
23
|
+
this.checked = undefined;
|
|
24
|
+
this.disabled = undefined;
|
|
25
|
+
this.max = undefined;
|
|
26
|
+
this.maxlength = undefined;
|
|
27
|
+
this.min = undefined;
|
|
28
|
+
this.minlength = undefined;
|
|
29
|
+
this.name = undefined;
|
|
30
|
+
this.pattern = undefined;
|
|
31
|
+
this.placeholder = undefined;
|
|
32
|
+
this.readonly = undefined;
|
|
33
|
+
this.required = undefined;
|
|
34
|
+
this.step = undefined;
|
|
35
|
+
this.type = 'text';
|
|
36
|
+
this.value = undefined;
|
|
37
|
+
}
|
|
38
|
+
handleChange(event) {
|
|
39
|
+
const target = event.target;
|
|
40
|
+
this.value = target.value;
|
|
41
|
+
this.valueChanged.emit(target.value);
|
|
42
|
+
}
|
|
43
|
+
handleFocus(event) {
|
|
44
|
+
const target = event.target;
|
|
45
|
+
this.focusChanged.emit(target.value);
|
|
46
|
+
}
|
|
47
|
+
handleBlur(event) {
|
|
48
|
+
const target = event.target;
|
|
49
|
+
this.blurChanged.emit(target.value);
|
|
50
|
+
}
|
|
51
|
+
render() {
|
|
52
|
+
const classNames = ['standalone', this.showerrormsg ? 'invalid' : ''].join(' ');
|
|
53
|
+
return (index.h(index.Host, null, index.h("label", { class: 'inputBlock' }, this.label, !this.required ? index.h("span", { class: "optional" }, "\u00A0(optional)") : '', this.iconleft && (index.h("div", { class: "icon-left" }, index.h("tttx-icon", { icon: this.iconleft, colour: "grey" }))), index.h("input", { class: classNames, autocapitalize: this.type === 'url' || this.type === 'email' || this.type === 'password' ? this.autocapitalize : null, autofocus: this.autofocus, autocomplete: this.type === 'text' ||
|
|
54
|
+
this.type === 'search' ||
|
|
55
|
+
this.type === 'url' ||
|
|
56
|
+
this.type === 'tel' ||
|
|
57
|
+
this.type === 'email' ||
|
|
58
|
+
this.type === 'password' ||
|
|
59
|
+
this.type === 'datepickers' ||
|
|
60
|
+
this.type === 'range' ||
|
|
61
|
+
this.type === 'color'
|
|
62
|
+
? this.autocomplete
|
|
63
|
+
: null, checked: this.type === 'checkbox' || this.type === 'radio' ? this.checked : null, disabled: !this.required ? this.disabled : null, max: this.type === 'date' ||
|
|
64
|
+
this.type === 'month' ||
|
|
65
|
+
this.type === 'week' ||
|
|
66
|
+
this.type === 'time' ||
|
|
67
|
+
this.type === 'datetime-local' ||
|
|
68
|
+
this.type === 'number' ||
|
|
69
|
+
this.type === 'range'
|
|
70
|
+
? this.max
|
|
71
|
+
: null, maxlength: this.maxlength, min: this.type === 'date' ||
|
|
72
|
+
this.type === 'month' ||
|
|
73
|
+
this.type === 'week' ||
|
|
74
|
+
this.type === 'time' ||
|
|
75
|
+
this.type === 'datetime-local' ||
|
|
76
|
+
this.type === 'number' ||
|
|
77
|
+
this.type === 'range'
|
|
78
|
+
? this.min
|
|
79
|
+
: null, minlength: this.minlength, name: this.name, pattern: this.type === 'text' ||
|
|
80
|
+
this.type === 'date' ||
|
|
81
|
+
this.type === 'search' ||
|
|
82
|
+
this.type === 'url' ||
|
|
83
|
+
this.type === 'tel' ||
|
|
84
|
+
this.type === 'email' ||
|
|
85
|
+
this.type === 'password'
|
|
86
|
+
? this.pattern
|
|
87
|
+
: null, placeholder: this.type === 'text' ||
|
|
88
|
+
this.type === 'tel' ||
|
|
89
|
+
this.type === 'email' ||
|
|
90
|
+
this.type === 'url' ||
|
|
91
|
+
this.type === 'password' ||
|
|
92
|
+
this.type === 'search'
|
|
93
|
+
? this.placeholder
|
|
94
|
+
: null, readonly: this.type === 'text' ||
|
|
95
|
+
this.type === 'search' ||
|
|
96
|
+
this.type === 'url' ||
|
|
97
|
+
this.type === 'tel' ||
|
|
98
|
+
this.type === 'email' ||
|
|
99
|
+
this.type === 'password' ||
|
|
100
|
+
this.type === 'date' ||
|
|
101
|
+
this.type === 'month' ||
|
|
102
|
+
this.type === 'week' ||
|
|
103
|
+
this.type === 'time' ||
|
|
104
|
+
this.type === 'datetime-local' ||
|
|
105
|
+
this.type === 'number'
|
|
106
|
+
? this.readonly
|
|
107
|
+
: null, required: this.type === 'text' ||
|
|
108
|
+
this.type === 'search' ||
|
|
109
|
+
this.type === 'url' ||
|
|
110
|
+
this.type === 'tel' ||
|
|
111
|
+
this.type === 'email' ||
|
|
112
|
+
this.type === 'password' ||
|
|
113
|
+
this.type === 'date' ||
|
|
114
|
+
this.type === 'month' ||
|
|
115
|
+
this.type === 'week' ||
|
|
116
|
+
this.type === 'time' ||
|
|
117
|
+
this.type === 'datetime-local' ||
|
|
118
|
+
this.type === 'number' ||
|
|
119
|
+
this.type === 'checkbox' ||
|
|
120
|
+
this.type === 'radio' ||
|
|
121
|
+
this.type === 'file'
|
|
122
|
+
? this.required
|
|
123
|
+
: null, step: this.type === 'date' ||
|
|
124
|
+
this.type === 'month' ||
|
|
125
|
+
this.type === 'week' ||
|
|
126
|
+
this.type === 'time' ||
|
|
127
|
+
this.type === 'datetime-local' ||
|
|
128
|
+
this.type === 'number' ||
|
|
129
|
+
this.type === 'range'
|
|
130
|
+
? this.step
|
|
131
|
+
: null, type: this.type, value: this.value, onBlur: this.handleBlur.bind(this), onFocus: this.handleFocus.bind(this), onInput: this.handleChange.bind(this) }), this.iconright && (index.h("div", { class: "icon-right" }, index.h("tttx-icon", { icon: this.iconright, colour: "grey" }))), index.h("span", { class: ['errorBubble', this.showerrormsg && this.errormsg ? 'visible' : ''].join(' ') }, index.h("span", { class: "material-symbols-rounded validationicon" }, "warning"), " ", this.errormsg))));
|
|
132
|
+
}
|
|
133
|
+
};
|
|
134
|
+
TttxInput.style = tttxStandaloneInputCss;
|
|
135
|
+
|
|
136
|
+
exports.tttx_standalone_input = TttxInput;
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
const index = require('./index-864b7110.js');
|
|
6
|
+
|
|
7
|
+
const tttxTableCss = "// SPACING $spacing-unit: 4px; // REGULAR $horizontal-spacing: $spacing-unit * 4; $vertical-spacing: $spacing-unit * 2; $base-padding: $vertical-spacing $horizontal-spacing; $base-height: $spacing-unit * 9; $component-spacing: $spacing-unit * 4; // SMALL $horizontal-spacing-sm: $spacing-unit * 2; $vertical-spacing-sm: $spacing-unit * 1; $base-padding-sm: $vertical-spacing-sm $horizontal-spacing-sm; $base-height-sm: $spacing-unit * 7; // COLOURS $grey-0: #212121; $grey-1: #363636; $grey-2: #4c4c4c; $grey-3: #636363; $grey-4: #757575; $grey-5: #9e9e9e; $grey-6: #aeaeae; $grey-7: #c8c8c8; $grey-8: #e3e3e3; $grey-9: #f0f0f0; $white: white; $black: $grey-0; $transparent: transparent; $blue-0: #00187c; $blue-1: #032e8c; $blue-2: #0849a3; $blue-3: #0951a8; $blue-4: #1169ba; $blue-5: #1479c6; $blue-6: #5194d2; $blue-7: #7aacdd; $blue-8: #b9d5ed; $blue-9: #e7f1f9; $red-0: #7c0000; $red-1: #8c0000; $red-2: #a30000; $red-3: #a80000; $red-4: #ba0000; $red-5: #dc0000; $red-6: #d25151; $red-7: #dd7a7a; $red-8: #edc1c1; $red-9: #f9e7e7; $black-1: #e6e6e6; $brand: $blue-0; $accent: $blue-5; $accent-selected: $blue-9; $error: $red-5; $severity-critical: #dc0000; $severity-warning: #f59500; $severity-success: #a2bb31; $severity-info: $accent; $ui-primary: $black; $ui-secondary: $grey-4; $ui-disabled: $grey-2; $ui-placeholder: $grey-5; $ui-background: $grey-9; $ui-sheet: $white; $ui-border: #d5d5d5; // BORDERS $ui-border-radius: 4px; $ui-border-width: 1px; // TYPOGRAPHY $font-size-default: 16px; $font-size-small: 14px; .material-symbols-rounded{font-variation-settings:'FILL' 1, 'wght' 400, 'GRAD' 0, 'opsz' 24}.skeleton{animation:skeleton-loading 1s linear infinite alternate;border-radius:4px;width:100%}@keyframes skeleton-loading{0%{background-color:hsl(200, 20%, 80%)}100%{background-color:hsl(200, 20%, 95%)}}:host{display:block}table{box-sizing:border-box;width:100%;border-collapse:collapse;border-spacing:0;border:1px solid #ddd;border-bottom:none}thead tr{height:52px;color:#757575}tbody tr{height:48px;color:#212121}tr{font-family:'Roboto', sans-serif;font-weight:400;font-size:16px;display:flex;align-items:center;border-bottom:1px solid #ddd}.selected{background-color:#F0F0F0}.checked{background-color:#e7f1f9}td,th{min-width:300px;margin-left:16px;display:flex;align-items:left}.skeleton{height:24px;display:block}.align-right{margin-left:auto}";
|
|
8
|
+
|
|
9
|
+
const TttxTable = class {
|
|
10
|
+
constructor(hostRef) {
|
|
11
|
+
index.registerInstance(this, hostRef);
|
|
12
|
+
this.rowSelected = index.createEvent(this, "rowSelected", 7);
|
|
13
|
+
this.headerClicked = index.createEvent(this, "headerClicked", 7);
|
|
14
|
+
this.headers = [];
|
|
15
|
+
this.data = {};
|
|
16
|
+
this.loading = false;
|
|
17
|
+
this.selected = -1;
|
|
18
|
+
}
|
|
19
|
+
handleKeyDown(ev) {
|
|
20
|
+
if (ev.key === 'ArrowDown' || ev.key === 'ArrowUp') {
|
|
21
|
+
this.updateSelectedIndex(ev.key);
|
|
22
|
+
this.emitRowSelected();
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
updateSelectedIndex(key) {
|
|
26
|
+
if (this.selected === -1) {
|
|
27
|
+
this.selected = 0;
|
|
28
|
+
}
|
|
29
|
+
else {
|
|
30
|
+
const isArrowDown = key === 'ArrowDown';
|
|
31
|
+
const isArrowUp = key === 'ArrowUp';
|
|
32
|
+
if (isArrowDown && this.selected < this.data.length - 1) {
|
|
33
|
+
this.selected++;
|
|
34
|
+
}
|
|
35
|
+
else if (isArrowUp && this.selected > 0) {
|
|
36
|
+
this.selected--;
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
emitRowSelected() {
|
|
41
|
+
this.rowSelected.emit(this.data[this.selected]);
|
|
42
|
+
}
|
|
43
|
+
rowSelectedHandler(row) {
|
|
44
|
+
this.rowSelected.emit(row);
|
|
45
|
+
this.selected = this.data.findIndex((item) => item === row);
|
|
46
|
+
}
|
|
47
|
+
headerClickedHandler(key) {
|
|
48
|
+
this.headerClicked.emit(key);
|
|
49
|
+
}
|
|
50
|
+
render() {
|
|
51
|
+
return (index.h(index.Host, null, index.h("table", null, index.h("thead", null, index.h("tr", null, this.loading ?
|
|
52
|
+
[1, 2, 3].map(() => (index.h("th", null, index.h("div", { class: "skeleton" })))) :
|
|
53
|
+
this.headers && this.headers.map((header) => (index.h("th", { scope: "col", onClick: () => this.headerClickedHandler(header.key) }, header.label))))), index.h("tbody", null, this.loading ?
|
|
54
|
+
[1, 2, 3].map(() => (index.h("tr", null, index.h("td", null, index.h("div", { class: "skeleton" })), index.h("td", null, index.h("div", { class: "skeleton" })), index.h("td", null, index.h("div", { class: "skeleton" }))))) :
|
|
55
|
+
Object.keys(this.data).map((key, index$1) => (index.h("tr", { class: index$1 === this.selected ? 'selected' : '', onClick: () => this.rowSelectedHandler(this.data[key]) }, this.headers.map((header) => (index.h("td", null, this.data[key][header.key], " ", header.actions && index.h("tttx-icon", { class: "align-right", icon: "more_vert" }, index.h("div", { slot: "popover" }, index.h("tttx-popover-content", { header: "The humble egg", body: "Most arthropods such as insects, vertebrates (excluding live-bearing mammals), and mollusks lay eggs, although some, such as scorpions, do not.", linkcontext: "Wikipedia_egg", linktext: "Learn more about eggs" })))))))))))));
|
|
56
|
+
}
|
|
57
|
+
};
|
|
58
|
+
TttxTable.style = tttxTableCss;
|
|
59
|
+
|
|
60
|
+
exports.tttx_table = TttxTable;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
const index = require('./index-864b7110.js');
|
|
6
|
+
|
|
7
|
+
/*
|
|
8
|
+
Stencil Client Patch Browser v2.22.3 | MIT Licensed | https://stenciljs.com
|
|
9
|
+
*/
|
|
10
|
+
const patchBrowser = () => {
|
|
11
|
+
const importMeta = (typeof document === 'undefined' ? new (require('u' + 'rl').URL)('file:' + __filename).href : (document.currentScript && document.currentScript.src || new URL('tttx.cjs.js', document.baseURI).href));
|
|
12
|
+
const opts = {};
|
|
13
|
+
if (importMeta !== '') {
|
|
14
|
+
opts.resourcesUrl = new URL('.', importMeta).href;
|
|
15
|
+
}
|
|
16
|
+
return index.promiseResolve(opts);
|
|
17
|
+
};
|
|
18
|
+
|
|
19
|
+
patchBrowser().then(options => {
|
|
20
|
+
return index.bootstrapLazy([["tttx-table.cjs",[[1,"tttx-table",{"headers":[8],"data":[8],"loading":[4],"selected":[2]},[[4,"keydown","handleKeyDown"]]]]],["tttx-list.cjs",[[1,"tttx-list",{"name":[1],"selectable":[4],"items":[32],"selectedIds":[32],"loading":[32],"lastPage":[32]},[[4,"listPageLoad","listLoadHandler"],[4,"listClearDataCache","listClearDataCacheHandler"],[4,"listActionSelectedEvent","listActionSelectedEventHandler"]]]]],["tttx-standalone-input.cjs",[[1,"tttx-standalone-input",{"label":[1],"showerrormsg":[4],"errormsg":[1],"iconleft":[1],"iconright":[1],"autocapitalize":[1],"autocomplete":[1],"autofocus":[4],"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",{"fontColor":[1,"font-color"],"buttonStyle":[1,"button-style"]},[[0,"clickEvent","onClicked"]]]]],["tttx-checkbox.cjs",[[1,"tttx-checkbox",{"value":[4],"label":[1],"required":[4]}]]],["tttx-form.cjs",[[1,"tttx-form",{"formschema":[8],"submitValue":[8,"submit-value"]}]]],["tttx-loading-spinner.cjs",[[1,"tttx-loading-spinner",{"loadingMessage":[1028,"loading-message"],"size":[1025]}]]],["tttx-popover-content.cjs",[[1,"tttx-popover-content",{"header":[1],"body":[1],"linkcontext":[1],"linktext":[1]}]]],["tttx-icon.cjs",[[1,"tttx-icon",{"icon":[1],"colour":[1]},[[4,"click","handleDocumentClick"]]]]]], options);
|
|
21
|
+
});
|
|
22
|
+
|
|
23
|
+
exports.setNonce = index.setNonce;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
{
|
|
2
|
+
"entries": [
|
|
3
|
+
"./components/molecules/tttx-standalone-input/tttx-standalone-input.js",
|
|
4
|
+
"./components/atoms/tttx-button/tttx-button.js",
|
|
5
|
+
"./components/atoms/tttx-icon/tttx-icon.js",
|
|
6
|
+
"./components/atoms/tttx-loading-spinner/tttx-loading-spinner.js",
|
|
7
|
+
"./components/atoms/tttx-popover-content/tttx-popover-content.js",
|
|
8
|
+
"./components/atoms/ttx-checkbox/tttx-checkbox.js",
|
|
9
|
+
"./components/molecules/tttx-form/tttx-form.js",
|
|
10
|
+
"./components/molecules/tttx-list/tttx-list.js",
|
|
11
|
+
"./components/molecules/tttx-table/tttx-table.js"
|
|
12
|
+
],
|
|
13
|
+
"compiler": {
|
|
14
|
+
"name": "@stencil/core",
|
|
15
|
+
"version": "2.22.3",
|
|
16
|
+
"typescriptVersion": "4.9.4"
|
|
17
|
+
},
|
|
18
|
+
"collections": [],
|
|
19
|
+
"bundles": []
|
|
20
|
+
}
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
.material-symbols-rounded {
|
|
2
|
+
font-variation-settings: "FILL" 1, "wght" 400, "GRAD" 0, "opsz" 24;
|
|
3
|
+
}
|
|
4
|
+
|
|
5
|
+
.button {
|
|
6
|
+
height: 36px;
|
|
7
|
+
padding: 8px 16px;
|
|
8
|
+
margin: 0;
|
|
9
|
+
background: transparent;
|
|
10
|
+
color: #212121;
|
|
11
|
+
border: 1px solid #c8c8c8;
|
|
12
|
+
border-radius: 4px;
|
|
13
|
+
text-transform: uppercase;
|
|
14
|
+
display: flex;
|
|
15
|
+
justify-content: left;
|
|
16
|
+
align-items: center;
|
|
17
|
+
font-size: 14px;
|
|
18
|
+
font-weight: 400;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
.button:hover {
|
|
22
|
+
background: #f0f0f0;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
.button:active {
|
|
26
|
+
background: #e3e3e3;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
.primary-blue {
|
|
30
|
+
background: #1479c6;
|
|
31
|
+
border: 1px solid #1479c6;
|
|
32
|
+
color: white;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
.primary-blue:hover {
|
|
36
|
+
background: #1169ba;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
.primary-blue:active {
|
|
40
|
+
background: #0951a8;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
.secondary-white {
|
|
44
|
+
background: white;
|
|
45
|
+
border: 1px solid #212121;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
:host {
|
|
49
|
+
display: inline-block;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
.spacingleft {
|
|
53
|
+
margin-left: 8px;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
.font-white {
|
|
57
|
+
color: white;
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
.font-black {
|
|
61
|
+
color: #212121;
|
|
62
|
+
}
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
import { Host, h } from '@stencil/core';
|
|
2
|
+
export class TttxButton {
|
|
3
|
+
constructor() {
|
|
4
|
+
this.fontColor = undefined;
|
|
5
|
+
this.buttonStyle = undefined;
|
|
6
|
+
}
|
|
7
|
+
onClick() {
|
|
8
|
+
this.clickEvent.emit('clicked');
|
|
9
|
+
}
|
|
10
|
+
onClicked(event) {
|
|
11
|
+
console.log('Picked up a clickEvent', event);
|
|
12
|
+
}
|
|
13
|
+
render() {
|
|
14
|
+
return (h(Host, null, h("button", { onClick: this.onClick.bind(this), class: `button ${this.fontColor} ${this.buttonStyle}` }, h("span", null, h("slot", null)))));
|
|
15
|
+
}
|
|
16
|
+
static get is() { return "tttx-button"; }
|
|
17
|
+
static get encapsulation() { return "shadow"; }
|
|
18
|
+
static get originalStyleUrls() {
|
|
19
|
+
return {
|
|
20
|
+
"$": ["tttx-button.scss"]
|
|
21
|
+
};
|
|
22
|
+
}
|
|
23
|
+
static get styleUrls() {
|
|
24
|
+
return {
|
|
25
|
+
"$": ["tttx-button.css"]
|
|
26
|
+
};
|
|
27
|
+
}
|
|
28
|
+
static get properties() {
|
|
29
|
+
return {
|
|
30
|
+
"fontColor": {
|
|
31
|
+
"type": "string",
|
|
32
|
+
"mutable": false,
|
|
33
|
+
"complexType": {
|
|
34
|
+
"original": "string",
|
|
35
|
+
"resolved": "string",
|
|
36
|
+
"references": {}
|
|
37
|
+
},
|
|
38
|
+
"required": false,
|
|
39
|
+
"optional": false,
|
|
40
|
+
"docs": {
|
|
41
|
+
"tags": [],
|
|
42
|
+
"text": ""
|
|
43
|
+
},
|
|
44
|
+
"attribute": "font-color",
|
|
45
|
+
"reflect": false
|
|
46
|
+
},
|
|
47
|
+
"buttonStyle": {
|
|
48
|
+
"type": "string",
|
|
49
|
+
"mutable": false,
|
|
50
|
+
"complexType": {
|
|
51
|
+
"original": "string",
|
|
52
|
+
"resolved": "string",
|
|
53
|
+
"references": {}
|
|
54
|
+
},
|
|
55
|
+
"required": false,
|
|
56
|
+
"optional": false,
|
|
57
|
+
"docs": {
|
|
58
|
+
"tags": [],
|
|
59
|
+
"text": ""
|
|
60
|
+
},
|
|
61
|
+
"attribute": "button-style",
|
|
62
|
+
"reflect": false
|
|
63
|
+
}
|
|
64
|
+
};
|
|
65
|
+
}
|
|
66
|
+
static get events() {
|
|
67
|
+
return [{
|
|
68
|
+
"method": "clickEvent",
|
|
69
|
+
"name": "clickEvent",
|
|
70
|
+
"bubbles": true,
|
|
71
|
+
"cancelable": true,
|
|
72
|
+
"composed": true,
|
|
73
|
+
"docs": {
|
|
74
|
+
"tags": [],
|
|
75
|
+
"text": ""
|
|
76
|
+
},
|
|
77
|
+
"complexType": {
|
|
78
|
+
"original": "string",
|
|
79
|
+
"resolved": "string",
|
|
80
|
+
"references": {}
|
|
81
|
+
}
|
|
82
|
+
}];
|
|
83
|
+
}
|
|
84
|
+
static get listeners() {
|
|
85
|
+
return [{
|
|
86
|
+
"name": "clickEvent",
|
|
87
|
+
"method": "onClicked",
|
|
88
|
+
"target": undefined,
|
|
89
|
+
"capture": false,
|
|
90
|
+
"passive": false
|
|
91
|
+
}];
|
|
92
|
+
}
|
|
93
|
+
}
|