@3t-transform/threeteeui 0.0.21 → 0.0.23
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-bf777121.js → index-2943e8f8.js} +1 -122
- package/dist/cjs/loader.cjs.js +2 -2
- package/dist/cjs/tttx-button.cjs.entry.js +1 -1
- package/dist/cjs/tttx-icon.cjs.entry.js +1 -1
- package/dist/cjs/tttx-keyvalue-block.cjs.entry.js +8 -5
- package/dist/cjs/tttx-loading-spinner.cjs.entry.js +1 -1
- package/dist/cjs/tttx-standalone-input.cjs.entry.js +6 -4
- package/dist/cjs/tttx.cjs.js +2 -2
- package/dist/collection/collection-manifest.json +1 -7
- package/dist/collection/components/atoms/tttx-keyvalue-block/tttx-keyvalue-block.js +7 -4
- package/dist/collection/components/molecules/tttx-standalone-input/tttx-standalone-input.js +28 -9
- package/dist/components/index.d.ts +0 -6
- package/dist/components/index.js +0 -6
- package/dist/components/tttx-button.js +54 -1
- package/dist/components/tttx-keyvalue-block.js +7 -4
- package/dist/components/tttx-loading-spinner.js +38 -1
- package/dist/components/tttx-standalone-input.js +8 -5
- package/dist/esm/{index-a05bd606.js → index-058a3cd0.js} +2 -122
- package/dist/esm/loader.js +3 -3
- package/dist/esm/tttx-button.entry.js +1 -1
- package/dist/esm/tttx-icon.entry.js +1 -1
- package/dist/esm/tttx-keyvalue-block.entry.js +8 -5
- package/dist/esm/tttx-loading-spinner.entry.js +1 -1
- package/dist/esm/tttx-standalone-input.entry.js +6 -4
- package/dist/esm/tttx.js +3 -3
- package/dist/tttx/{p-68ff0f39.entry.js → p-046868d9.entry.js} +1 -1
- package/dist/tttx/{p-93763d3c.entry.js → p-1adb2b75.entry.js} +1 -1
- package/dist/tttx/{p-a5808741.entry.js → p-495cf4b3.entry.js} +1 -1
- package/dist/tttx/p-a4d9929a.entry.js +1 -0
- package/dist/tttx/p-ad637dde.entry.js +1 -0
- package/dist/tttx/p-bbb7dbf7.js +2 -0
- package/dist/tttx/tttx.esm.js +1 -1
- package/dist/types/components/molecules/tttx-standalone-input/tttx-standalone-input.d.ts +3 -2
- package/dist/types/components.d.ts +6 -140
- package/package.json +2 -2
- package/dist/cjs/tttx-checkbox.cjs.entry.js +0 -28
- package/dist/cjs/tttx-form.cjs.entry.js +0 -374
- package/dist/cjs/tttx-input-calendar.cjs.entry.js +0 -125
- package/dist/cjs/tttx-list.cjs.entry.js +0 -198
- package/dist/cjs/tttx-popover-content.cjs.entry.js +0 -23
- package/dist/cjs/tttx-table.cjs.entry.js +0 -60
- package/dist/collection/components/atoms/tttx-popover-content/tttx-popover-content.css +0 -30
- package/dist/collection/components/atoms/tttx-popover-content/tttx-popover-content.js +0 -97
- package/dist/collection/components/atoms/tttx-popover-content/tttx-popover-content.stories.js +0 -23
- package/dist/collection/components/atoms/ttx-checkbox/tttx-checkbox.css +0 -181
- package/dist/collection/components/atoms/ttx-checkbox/tttx-checkbox.js +0 -102
- package/dist/collection/components/atoms/ttx-checkbox/tttx-checkbox.stories.js +0 -13
- package/dist/collection/components/molecules/tttx-form/tttx-form.css +0 -314
- package/dist/collection/components/molecules/tttx-form/tttx-form.js +0 -452
- package/dist/collection/components/molecules/tttx-form/tttx-form.stories.js +0 -109
- package/dist/collection/components/molecules/tttx-input-calendar/tttx-input-calendar.css +0 -93
- package/dist/collection/components/molecules/tttx-input-calendar/tttx-input-calendar.js +0 -174
- package/dist/collection/components/molecules/tttx-input-calendar/tttx-input-calendar.stories.js +0 -27
- package/dist/collection/components/molecules/tttx-list/tttx-list.css +0 -56
- package/dist/collection/components/molecules/tttx-list/tttx-list.js +0 -312
- package/dist/collection/components/molecules/tttx-list/tttx-list.stories.js +0 -37
- package/dist/collection/components/molecules/tttx-table/tttx-table.css +0 -166
- package/dist/collection/components/molecules/tttx-table/tttx-table.js +0 -174
- package/dist/collection/components/molecules/tttx-table/tttx-table.stories.js +0 -81
- package/dist/components/tttx-button2.js +0 -56
- package/dist/components/tttx-checkbox.d.ts +0 -11
- package/dist/components/tttx-checkbox.js +0 -46
- package/dist/components/tttx-form.d.ts +0 -11
- package/dist/components/tttx-form.js +0 -391
- package/dist/components/tttx-input-calendar.d.ts +0 -11
- package/dist/components/tttx-input-calendar.js +0 -157
- package/dist/components/tttx-list.d.ts +0 -11
- package/dist/components/tttx-list.js +0 -225
- package/dist/components/tttx-loading-spinner2.js +0 -40
- package/dist/components/tttx-popover-content.d.ts +0 -11
- package/dist/components/tttx-popover-content.js +0 -6
- package/dist/components/tttx-popover-content2.js +0 -39
- package/dist/components/tttx-table.d.ts +0 -11
- package/dist/components/tttx-table.js +0 -91
- package/dist/esm/tttx-checkbox.entry.js +0 -24
- package/dist/esm/tttx-form.entry.js +0 -370
- package/dist/esm/tttx-input-calendar.entry.js +0 -121
- package/dist/esm/tttx-list.entry.js +0 -194
- package/dist/esm/tttx-popover-content.entry.js +0 -19
- package/dist/esm/tttx-table.entry.js +0 -56
- package/dist/tttx/p-037d286f.entry.js +0 -1
- package/dist/tttx/p-07b134af.js +0 -2
- package/dist/tttx/p-1b63f16a.entry.js +0 -1
- package/dist/tttx/p-45afb84c.entry.js +0 -1
- package/dist/tttx/p-74061060.entry.js +0 -1
- package/dist/tttx/p-9536b8c4.entry.js +0 -1
- package/dist/tttx/p-a92ca87e.entry.js +0 -1
- package/dist/tttx/p-a96ca037.entry.js +0 -1
- package/dist/tttx/p-f579ed1e.entry.js +0 -1
- package/dist/types/components/atoms/tttx-popover-content/tttx-popover-content.d.ts +0 -7
- package/dist/types/components/atoms/tttx-popover-content/tttx-popover-content.stories.d.ts +0 -18
- package/dist/types/components/atoms/ttx-checkbox/tttx-checkbox.d.ts +0 -9
- package/dist/types/components/atoms/ttx-checkbox/tttx-checkbox.stories.d.ts +0 -6
- package/dist/types/components/molecules/tttx-form/tttx-form.d.ts +0 -134
- package/dist/types/components/molecules/tttx-form/tttx-form.stories.d.ts +0 -12
- package/dist/types/components/molecules/tttx-input-calendar/tttx-input-calendar.d.ts +0 -19
- package/dist/types/components/molecules/tttx-input-calendar/tttx-input-calendar.stories.d.ts +0 -26
- package/dist/types/components/molecules/tttx-list/tttx-list.d.ts +0 -51
- package/dist/types/components/molecules/tttx-list/tttx-list.stories.d.ts +0 -13
- package/dist/types/components/molecules/tttx-table/tttx-table.d.ts +0 -15
- package/dist/types/components/molecules/tttx-table/tttx-table.stories.d.ts +0 -21
|
@@ -1,225 +0,0 @@
|
|
|
1
|
-
import { proxyCustomElement, HTMLElement, createEvent, h, Host } from '@stencil/core/internal/client';
|
|
2
|
-
import { d as defineCustomElement$2 } from './tttx-loading-spinner2.js';
|
|
3
|
-
|
|
4
|
-
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}";
|
|
5
|
-
|
|
6
|
-
const TttxList$1 = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
|
|
7
|
-
constructor() {
|
|
8
|
-
super();
|
|
9
|
-
this.__registerHost();
|
|
10
|
-
this.__attachShadow();
|
|
11
|
-
this.listPaginate = createEvent(this, "listPaginate", 7);
|
|
12
|
-
this.listSelectedEvent = createEvent(this, "listSelectedEvent", 7);
|
|
13
|
-
this.listItemClick = createEvent(this, "listItemClick", 7);
|
|
14
|
-
this.rowCount = 0;
|
|
15
|
-
this.name = undefined;
|
|
16
|
-
this.selectable = undefined;
|
|
17
|
-
this.items = [];
|
|
18
|
-
this.selectedIds = [];
|
|
19
|
-
this.loading = true;
|
|
20
|
-
this.lastPage = false;
|
|
21
|
-
}
|
|
22
|
-
listLoadHandler(event) {
|
|
23
|
-
if (event.detail.name !== this.name)
|
|
24
|
-
return;
|
|
25
|
-
this.items = [...this.items, ...event.detail.items];
|
|
26
|
-
this.loading = false;
|
|
27
|
-
this.lastPage = event.detail.lastPage;
|
|
28
|
-
this.renderRows(event.detail.items);
|
|
29
|
-
if (this.scrollableParent.clientHeight === this.scrollableParent.scrollHeight)
|
|
30
|
-
this.listPaginateHandler();
|
|
31
|
-
}
|
|
32
|
-
listPaginateHandler() {
|
|
33
|
-
// 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
|
|
34
|
-
if (this.lastPage || this.loading)
|
|
35
|
-
return;
|
|
36
|
-
this.loading = true;
|
|
37
|
-
this.listPaginate.emit({ name: this.name });
|
|
38
|
-
}
|
|
39
|
-
listClearDataCacheHandler(event) {
|
|
40
|
-
if (event.detail.name !== this.name)
|
|
41
|
-
return;
|
|
42
|
-
this.items = [];
|
|
43
|
-
this.selectedIds = [];
|
|
44
|
-
this.listItemContainer()
|
|
45
|
-
.querySelectorAll('.tttx-list__row')
|
|
46
|
-
.forEach((node) => {
|
|
47
|
-
node.remove();
|
|
48
|
-
});
|
|
49
|
-
this.rowCount = 0;
|
|
50
|
-
this.lastPage = false;
|
|
51
|
-
this.loading = false;
|
|
52
|
-
}
|
|
53
|
-
listActionSelectedEventHandler(event) {
|
|
54
|
-
if (event.detail.name !== this.name || !this.selectable || this.selectedIds.length === 0)
|
|
55
|
-
return;
|
|
56
|
-
const selectedRows = this.selectedIds.map(id => {
|
|
57
|
-
return this.items[id];
|
|
58
|
-
});
|
|
59
|
-
if (event.detail.removeRows)
|
|
60
|
-
this.removeSelectedRows();
|
|
61
|
-
this.listSelectedEvent.emit({
|
|
62
|
-
name: this.name,
|
|
63
|
-
eventName: event.detail.eventName,
|
|
64
|
-
selectedRows,
|
|
65
|
-
});
|
|
66
|
-
}
|
|
67
|
-
removeSelectedRows() {
|
|
68
|
-
const orderedSelectedIds = [...this.selectedIds].sort((a, b) => {
|
|
69
|
-
return b - a;
|
|
70
|
-
});
|
|
71
|
-
orderedSelectedIds.forEach(itemIndex => {
|
|
72
|
-
this.items.splice(itemIndex, 1);
|
|
73
|
-
this.listItemContainer().removeChild(this.listItemContainer().querySelector(`[data-row-id="${itemIndex}"]`));
|
|
74
|
-
// If this removes the scrollbar and we're not on the last page, load in a new page
|
|
75
|
-
if (this.scrollableParent.clientHeight === this.scrollableParent.scrollHeight)
|
|
76
|
-
this.listPaginateHandler();
|
|
77
|
-
});
|
|
78
|
-
// Empty selected ids with mutation rather than assignment to avoid unecessary component rerender
|
|
79
|
-
this.selectedIds.splice(0, this.selectedIds.length);
|
|
80
|
-
}
|
|
81
|
-
listItemClickHandler(itemData) {
|
|
82
|
-
if (this.selectedIds.length !== 0)
|
|
83
|
-
return;
|
|
84
|
-
this.listItemClick.emit({ itemData, name: this.name });
|
|
85
|
-
}
|
|
86
|
-
componentWillLoad() {
|
|
87
|
-
this.template = this.host.querySelector('template');
|
|
88
|
-
this.scrollableParent = this.getScrollableParent(this.host);
|
|
89
|
-
const scrollableContext = this.scrollableParent === document.scrollingElement ? document : this.scrollableParent;
|
|
90
|
-
scrollableContext.addEventListener('scroll', this.scrollHandler.bind(this));
|
|
91
|
-
window.addEventListener('resize', this.scrollHandler.bind(this));
|
|
92
|
-
}
|
|
93
|
-
componentDidLoad() {
|
|
94
|
-
// Emit event to load first page
|
|
95
|
-
this.listPaginate.emit({ name: this.name });
|
|
96
|
-
}
|
|
97
|
-
listItemContainer() {
|
|
98
|
-
return this.host.shadowRoot.querySelector('.list-item-container');
|
|
99
|
-
}
|
|
100
|
-
async scrollHandler() {
|
|
101
|
-
const { clientHeight, scrollTop, scrollHeight } = this.scrollableParent;
|
|
102
|
-
if (Math.abs(scrollHeight - clientHeight - scrollTop) < 26)
|
|
103
|
-
this.listPaginateHandler();
|
|
104
|
-
}
|
|
105
|
-
isScrollable(node) {
|
|
106
|
-
const hasScrollbar = ['scroll', 'auto'].includes(node.style.overflowY);
|
|
107
|
-
return hasScrollbar;
|
|
108
|
-
}
|
|
109
|
-
getScrollableParent(node) {
|
|
110
|
-
if (!node || node === document.body) {
|
|
111
|
-
return document.scrollingElement;
|
|
112
|
-
}
|
|
113
|
-
else {
|
|
114
|
-
return this.isScrollable(node) ? node : this.getScrollableParent(node.parentElement);
|
|
115
|
-
}
|
|
116
|
-
}
|
|
117
|
-
appendRowCheckbox(rowContainer) {
|
|
118
|
-
if (!this.selectable)
|
|
119
|
-
return;
|
|
120
|
-
const rowId = this.rowCount;
|
|
121
|
-
const checkbox = document.createElement('input');
|
|
122
|
-
checkbox.setAttribute('type', 'checkbox');
|
|
123
|
-
checkbox.addEventListener('click', e => {
|
|
124
|
-
e.stopPropagation();
|
|
125
|
-
if (e.target.checked) {
|
|
126
|
-
this.selectedIds = [...this.selectedIds, rowId];
|
|
127
|
-
rowContainer.classList.add('selected');
|
|
128
|
-
}
|
|
129
|
-
else {
|
|
130
|
-
this.selectedIds = this.selectedIds.filter(id => {
|
|
131
|
-
return id !== rowId;
|
|
132
|
-
});
|
|
133
|
-
rowContainer.classList.remove('selected');
|
|
134
|
-
}
|
|
135
|
-
});
|
|
136
|
-
rowContainer.setAttribute('data-row-id', `${rowId}`);
|
|
137
|
-
this.rowCount++;
|
|
138
|
-
rowContainer.appendChild(checkbox);
|
|
139
|
-
}
|
|
140
|
-
appendSeededTemplate(rowData, rowContainer) {
|
|
141
|
-
this.template.childNodes.forEach(child => {
|
|
142
|
-
const clone = child.cloneNode(false);
|
|
143
|
-
if (clone.getAttribute('data-fields')) {
|
|
144
|
-
const fields = clone.getAttribute('data-fields').replace(/\s/g, '').split(',');
|
|
145
|
-
const filteredRowData = Object.fromEntries(fields.map((field) => {
|
|
146
|
-
return [field, rowData[field]];
|
|
147
|
-
}));
|
|
148
|
-
clone.setAttribute('row-data', JSON.stringify(filteredRowData));
|
|
149
|
-
}
|
|
150
|
-
else {
|
|
151
|
-
clone.setAttribute('row-data', JSON.stringify(rowData));
|
|
152
|
-
}
|
|
153
|
-
rowContainer.appendChild(clone);
|
|
154
|
-
});
|
|
155
|
-
}
|
|
156
|
-
appendGenericTemplate(rowData, rowContainer) {
|
|
157
|
-
const row = document.createElement('div');
|
|
158
|
-
row.classList.add('generic-template__content');
|
|
159
|
-
row.textContent = rowData.text;
|
|
160
|
-
rowContainer.appendChild(row);
|
|
161
|
-
if (!rowData.icon)
|
|
162
|
-
return;
|
|
163
|
-
const icon = document.createElement('span');
|
|
164
|
-
icon.classList.add('material-symbols-rounded');
|
|
165
|
-
icon.textContent = rowData.icon;
|
|
166
|
-
if (rowData.iconColor)
|
|
167
|
-
icon.style['color'] = rowData.iconColor;
|
|
168
|
-
row.prepend(icon);
|
|
169
|
-
}
|
|
170
|
-
row(rowData) {
|
|
171
|
-
const rowContainer = document.createElement('div');
|
|
172
|
-
rowContainer.classList.add('tttx-list__row');
|
|
173
|
-
rowContainer.addEventListener('click', () => {
|
|
174
|
-
this.listItemClickHandler(rowData);
|
|
175
|
-
});
|
|
176
|
-
this.appendRowCheckbox(rowContainer);
|
|
177
|
-
this.template ? this.appendSeededTemplate(rowData, rowContainer) : this.appendGenericTemplate(rowData, rowContainer);
|
|
178
|
-
return rowContainer;
|
|
179
|
-
}
|
|
180
|
-
renderRows(batchData) {
|
|
181
|
-
batchData.forEach(rowData => {
|
|
182
|
-
this.listItemContainer().appendChild(this.row(rowData));
|
|
183
|
-
});
|
|
184
|
-
}
|
|
185
|
-
loadIndicator() {
|
|
186
|
-
if (!this.loading)
|
|
187
|
-
return;
|
|
188
|
-
return h("div", { class: "load-indicator" }, h("tttx-loading-spinner", { size: 'large' }));
|
|
189
|
-
}
|
|
190
|
-
render() {
|
|
191
|
-
return (h(Host, null, h("div", { class: "list-item-container", tabindex: "0" }, !this.loading && this.items.length === 0 ? 'No data to display' : undefined), this.loadIndicator()));
|
|
192
|
-
}
|
|
193
|
-
get host() { return this; }
|
|
194
|
-
static get style() { return tttxListCss; }
|
|
195
|
-
}, [1, "tttx-list", {
|
|
196
|
-
"name": [1],
|
|
197
|
-
"selectable": [4],
|
|
198
|
-
"items": [32],
|
|
199
|
-
"selectedIds": [32],
|
|
200
|
-
"loading": [32],
|
|
201
|
-
"lastPage": [32]
|
|
202
|
-
}, [[4, "listPageLoad", "listLoadHandler"], [4, "listClearDataCache", "listClearDataCacheHandler"], [4, "listActionSelectedEvent", "listActionSelectedEventHandler"]]]);
|
|
203
|
-
function defineCustomElement$1() {
|
|
204
|
-
if (typeof customElements === "undefined") {
|
|
205
|
-
return;
|
|
206
|
-
}
|
|
207
|
-
const components = ["tttx-list", "tttx-loading-spinner"];
|
|
208
|
-
components.forEach(tagName => { switch (tagName) {
|
|
209
|
-
case "tttx-list":
|
|
210
|
-
if (!customElements.get(tagName)) {
|
|
211
|
-
customElements.define(tagName, TttxList$1);
|
|
212
|
-
}
|
|
213
|
-
break;
|
|
214
|
-
case "tttx-loading-spinner":
|
|
215
|
-
if (!customElements.get(tagName)) {
|
|
216
|
-
defineCustomElement$2();
|
|
217
|
-
}
|
|
218
|
-
break;
|
|
219
|
-
} });
|
|
220
|
-
}
|
|
221
|
-
|
|
222
|
-
const TttxList = TttxList$1;
|
|
223
|
-
const defineCustomElement = defineCustomElement$1;
|
|
224
|
-
|
|
225
|
-
export { TttxList, defineCustomElement };
|
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
import { proxyCustomElement, HTMLElement, h } from '@stencil/core/internal/client';
|
|
2
|
-
|
|
3
|
-
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)}}";
|
|
4
|
-
|
|
5
|
-
const TttxLoadingSpinner = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
|
|
6
|
-
constructor() {
|
|
7
|
-
super();
|
|
8
|
-
this.__registerHost();
|
|
9
|
-
this.__attachShadow();
|
|
10
|
-
this.loadingMessage = undefined;
|
|
11
|
-
this.size = 'large';
|
|
12
|
-
}
|
|
13
|
-
renderLoadingMessage() {
|
|
14
|
-
if (!this.loadingMessage)
|
|
15
|
-
return '';
|
|
16
|
-
return h("div", { class: "loading-text" }, "Loading, please wait...");
|
|
17
|
-
}
|
|
18
|
-
render() {
|
|
19
|
-
return (h("div", { class: "spinner-container" }, h("div", { class: "loading-box" }, h("span", { class: `spinner ${this.size}` })), this.renderLoadingMessage()));
|
|
20
|
-
}
|
|
21
|
-
static get style() { return tttxLoadingSpinnerCss; }
|
|
22
|
-
}, [1, "tttx-loading-spinner", {
|
|
23
|
-
"loadingMessage": [1028, "loading-message"],
|
|
24
|
-
"size": [1025]
|
|
25
|
-
}]);
|
|
26
|
-
function defineCustomElement() {
|
|
27
|
-
if (typeof customElements === "undefined") {
|
|
28
|
-
return;
|
|
29
|
-
}
|
|
30
|
-
const components = ["tttx-loading-spinner"];
|
|
31
|
-
components.forEach(tagName => { switch (tagName) {
|
|
32
|
-
case "tttx-loading-spinner":
|
|
33
|
-
if (!customElements.get(tagName)) {
|
|
34
|
-
customElements.define(tagName, TttxLoadingSpinner);
|
|
35
|
-
}
|
|
36
|
-
break;
|
|
37
|
-
} });
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
export { TttxLoadingSpinner as T, defineCustomElement as d };
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import type { Components, JSX } from "../types/components";
|
|
2
|
-
|
|
3
|
-
interface TttxPopoverContent extends Components.TttxPopoverContent, HTMLElement {}
|
|
4
|
-
export const TttxPopoverContent: {
|
|
5
|
-
prototype: TttxPopoverContent;
|
|
6
|
-
new (): TttxPopoverContent;
|
|
7
|
-
};
|
|
8
|
-
/**
|
|
9
|
-
* Used to define this component and all nested components recursively.
|
|
10
|
-
*/
|
|
11
|
-
export const defineCustomElement: () => void;
|
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
import { proxyCustomElement, HTMLElement, h, Host } from '@stencil/core/internal/client';
|
|
2
|
-
|
|
3
|
-
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}";
|
|
4
|
-
|
|
5
|
-
const TttxPopoverContent = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
|
|
6
|
-
constructor() {
|
|
7
|
-
super();
|
|
8
|
-
this.__registerHost();
|
|
9
|
-
this.__attachShadow();
|
|
10
|
-
this.header = undefined;
|
|
11
|
-
this.body = undefined;
|
|
12
|
-
this.linkcontext = undefined;
|
|
13
|
-
this.linktext = undefined;
|
|
14
|
-
}
|
|
15
|
-
render() {
|
|
16
|
-
return (h(Host, null, this.header && h("h4", null, this.header), this.body && h("p", null, this.body), this.linkcontext && (h("span", { class: "linky", onClick: evt => console.log(this.linkcontext, evt) }, this.linktext || 'More Information'))));
|
|
17
|
-
}
|
|
18
|
-
static get style() { return tttxPopoverContentCss; }
|
|
19
|
-
}, [1, "tttx-popover-content", {
|
|
20
|
-
"header": [1],
|
|
21
|
-
"body": [1],
|
|
22
|
-
"linkcontext": [1],
|
|
23
|
-
"linktext": [1]
|
|
24
|
-
}]);
|
|
25
|
-
function defineCustomElement() {
|
|
26
|
-
if (typeof customElements === "undefined") {
|
|
27
|
-
return;
|
|
28
|
-
}
|
|
29
|
-
const components = ["tttx-popover-content"];
|
|
30
|
-
components.forEach(tagName => { switch (tagName) {
|
|
31
|
-
case "tttx-popover-content":
|
|
32
|
-
if (!customElements.get(tagName)) {
|
|
33
|
-
customElements.define(tagName, TttxPopoverContent);
|
|
34
|
-
}
|
|
35
|
-
break;
|
|
36
|
-
} });
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
export { TttxPopoverContent as T, defineCustomElement as d };
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import type { Components, JSX } from "../types/components";
|
|
2
|
-
|
|
3
|
-
interface TttxTable extends Components.TttxTable, HTMLElement {}
|
|
4
|
-
export const TttxTable: {
|
|
5
|
-
prototype: TttxTable;
|
|
6
|
-
new (): TttxTable;
|
|
7
|
-
};
|
|
8
|
-
/**
|
|
9
|
-
* Used to define this component and all nested components recursively.
|
|
10
|
-
*/
|
|
11
|
-
export const defineCustomElement: () => void;
|
|
@@ -1,91 +0,0 @@
|
|
|
1
|
-
import { proxyCustomElement, HTMLElement, createEvent, h, Host } from '@stencil/core/internal/client';
|
|
2
|
-
import { d as defineCustomElement$3 } from './tttx-icon2.js';
|
|
3
|
-
import { d as defineCustomElement$2 } from './tttx-popover-content2.js';
|
|
4
|
-
|
|
5
|
-
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}";
|
|
6
|
-
|
|
7
|
-
const TttxTable$1 = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
|
|
8
|
-
constructor() {
|
|
9
|
-
super();
|
|
10
|
-
this.__registerHost();
|
|
11
|
-
this.__attachShadow();
|
|
12
|
-
this.rowSelected = createEvent(this, "rowSelected", 7);
|
|
13
|
-
this.headerClicked = 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 (h(Host, null, h("table", null, h("thead", null, h("tr", null, this.loading ?
|
|
52
|
-
[1, 2, 3].map(() => (h("th", null, h("div", { class: "skeleton" })))) :
|
|
53
|
-
this.headers && this.headers.map((header) => (h("th", { scope: "col", onClick: () => this.headerClickedHandler(header.key) }, header.label))))), h("tbody", null, this.loading ?
|
|
54
|
-
[1, 2, 3].map(() => (h("tr", null, h("td", null, h("div", { class: "skeleton" })), h("td", null, h("div", { class: "skeleton" })), h("td", null, h("div", { class: "skeleton" }))))) :
|
|
55
|
-
Object.keys(this.data).map((key, index) => (h("tr", { class: index === this.selected ? 'selected' : '', onClick: () => this.rowSelectedHandler(this.data[key]) }, this.headers.map((header) => (h("td", null, this.data[key][header.key], " ", header.actions && h("tttx-icon", { class: "align-right", icon: "more_vert" }, h("div", { slot: "popover" }, 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
|
-
static get style() { return tttxTableCss; }
|
|
58
|
-
}, [1, "tttx-table", {
|
|
59
|
-
"headers": [16],
|
|
60
|
-
"data": [16],
|
|
61
|
-
"loading": [4],
|
|
62
|
-
"selected": [2]
|
|
63
|
-
}, [[4, "keydown", "handleKeyDown"]]]);
|
|
64
|
-
function defineCustomElement$1() {
|
|
65
|
-
if (typeof customElements === "undefined") {
|
|
66
|
-
return;
|
|
67
|
-
}
|
|
68
|
-
const components = ["tttx-table", "tttx-icon", "tttx-popover-content"];
|
|
69
|
-
components.forEach(tagName => { switch (tagName) {
|
|
70
|
-
case "tttx-table":
|
|
71
|
-
if (!customElements.get(tagName)) {
|
|
72
|
-
customElements.define(tagName, TttxTable$1);
|
|
73
|
-
}
|
|
74
|
-
break;
|
|
75
|
-
case "tttx-icon":
|
|
76
|
-
if (!customElements.get(tagName)) {
|
|
77
|
-
defineCustomElement$3();
|
|
78
|
-
}
|
|
79
|
-
break;
|
|
80
|
-
case "tttx-popover-content":
|
|
81
|
-
if (!customElements.get(tagName)) {
|
|
82
|
-
defineCustomElement$2();
|
|
83
|
-
}
|
|
84
|
-
break;
|
|
85
|
-
} });
|
|
86
|
-
}
|
|
87
|
-
|
|
88
|
-
const TttxTable = TttxTable$1;
|
|
89
|
-
const defineCustomElement = defineCustomElement$1;
|
|
90
|
-
|
|
91
|
-
export { TttxTable, defineCustomElement };
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
import { r as registerInstance, c as createEvent, h, H as Host } from './index-a05bd606.js';
|
|
2
|
-
|
|
3
|
-
const tttxCheckboxCss = ".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}.spacing{margin-bottom:16px}";
|
|
4
|
-
|
|
5
|
-
const TttxCheckbox = class {
|
|
6
|
-
constructor(hostRef) {
|
|
7
|
-
registerInstance(this, hostRef);
|
|
8
|
-
this.valueChanged = createEvent(this, "valueChanged", 7);
|
|
9
|
-
this.value = undefined;
|
|
10
|
-
this.label = undefined;
|
|
11
|
-
this.required = undefined;
|
|
12
|
-
}
|
|
13
|
-
handleClick(event) {
|
|
14
|
-
const target = event.target;
|
|
15
|
-
this.value = target.checked;
|
|
16
|
-
this.valueChanged.emit(target.checked);
|
|
17
|
-
}
|
|
18
|
-
render() {
|
|
19
|
-
return (h(Host, null, h("div", { class: "field spacing" }, this.label && (h("label", { class: "label" }, this.label, !this.required ? h("span", { class: "optional" }, " (optional)") : '')), h("input", { type: "checkbox", class: "input", onChange: event => this.handleClick(event), checked: this.value }))));
|
|
20
|
-
}
|
|
21
|
-
};
|
|
22
|
-
TttxCheckbox.style = tttxCheckboxCss;
|
|
23
|
-
|
|
24
|
-
export { TttxCheckbox as tttx_checkbox };
|