@3t-transform/threeteeui 0.0.23 → 0.0.24
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-2943e8f8.js → index-bc080fb4.js} +64 -89
- package/dist/cjs/loader.cjs.js +3 -4
- 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 +5 -8
- package/dist/cjs/tttx-list.cjs.entry.js +34 -0
- package/dist/cjs/tttx-loading-spinner.cjs.entry.js +1 -1
- package/dist/cjs/tttx-standalone-input.cjs.entry.js +1 -2
- package/dist/cjs/tttx-table.cjs.entry.js +60 -0
- package/dist/cjs/tttx.cjs.js +3 -7
- package/dist/collection/collection-manifest.json +5 -3
- package/dist/collection/components/atoms/tttx-button/test/tttx-button.e2e.js +9 -0
- package/dist/collection/components/atoms/tttx-button/test/tttx-button.spec.js +43 -0
- package/dist/collection/components/atoms/tttx-icon/test/tttx-icon.e2e.js +9 -0
- package/dist/collection/components/atoms/tttx-icon/test/tttx-icon.spec.js +16 -0
- package/dist/collection/components/atoms/tttx-keyvalue-block/test/tttx-keyvalue-block.spec.js +164 -0
- package/dist/collection/components/atoms/tttx-keyvalue-block/tttx-keyvalue-block.js +4 -7
- package/dist/collection/components/atoms/tttx-loading-spinner/Test/tttx-loading-spinner.spec.js +64 -0
- package/dist/collection/components/molecules/tttx-list/test/tttx-list.spec.js +151 -0
- package/dist/collection/components/molecules/tttx-list/tttx-list.css +53 -0
- package/dist/collection/components/molecules/tttx-list/tttx-list.js +79 -0
- package/dist/collection/components/molecules/tttx-list/tttx-list.stories.js +39 -0
- package/dist/collection/components/molecules/tttx-standalone-input/test/tttx-standalone-input.e2e.js +9 -0
- package/dist/collection/components/molecules/tttx-standalone-input/test/tttx-standalone-input.spec.js +146 -0
- package/dist/collection/components/molecules/tttx-standalone-input/tttx-standalone-input.js +0 -1
- package/dist/collection/components/molecules/tttx-table/test/tttx-table.e2e.js +9 -0
- package/dist/collection/components/molecules/tttx-table/tttx-table.css +166 -0
- package/dist/collection/components/molecules/tttx-table/tttx-table.js +174 -0
- package/dist/collection/components/molecules/tttx-table/tttx-table.stories.js +81 -0
- package/dist/components/index.d.ts +2 -9
- package/dist/components/index.js +3 -1
- package/dist/components/tttx-keyvalue-block.js +4 -7
- package/dist/components/tttx-list.d.ts +11 -0
- package/dist/components/tttx-list.js +56 -0
- package/dist/components/tttx-standalone-input.js +0 -1
- package/dist/components/tttx-table.d.ts +11 -0
- package/dist/components/tttx-table.js +85 -0
- package/dist/esm/{index-058a3cd0.js → index-901bfd55.js} +65 -89
- package/dist/esm/loader.js +3 -4
- package/dist/esm/polyfills/css-shim.js +1 -1
- 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 +5 -8
- package/dist/esm/tttx-list.entry.js +30 -0
- package/dist/esm/tttx-loading-spinner.entry.js +1 -1
- package/dist/esm/tttx-standalone-input.entry.js +1 -2
- package/dist/esm/tttx-table.entry.js +56 -0
- package/dist/esm/tttx.js +3 -4
- package/dist/tttx/{p-046868d9.entry.js → p-0ae51ec5.entry.js} +1 -1
- package/dist/tttx/p-1ec23160.entry.js +1 -0
- package/dist/tttx/p-300ff6a8.entry.js +1 -0
- package/dist/tttx/p-32ad02d3.entry.js +1 -0
- package/dist/tttx/p-80cf5236.entry.js +1 -0
- package/dist/tttx/{p-495cf4b3.entry.js → p-9a382959.entry.js} +1 -1
- package/dist/tttx/p-a1bd16a1.entry.js +1 -0
- package/dist/tttx/{p-1adb2b75.entry.js → p-a4077908.entry.js} +1 -1
- package/dist/tttx/p-a6953900.entry.js +1 -0
- package/dist/tttx/p-b46e3c59.entry.js +1 -0
- package/dist/tttx/p-c290160b.js +2 -0
- package/dist/tttx/p-dc179257.entry.js +1 -0
- package/dist/tttx/p-e19eb07e.entry.js +1 -0
- package/dist/tttx/p-e4341658.entry.js +1 -0
- package/dist/tttx/tttx.esm.js +1 -1
- package/dist/types/components/atoms/tttx-button/test/tttx-button.e2e.d.ts +1 -0
- package/dist/types/components/atoms/tttx-button/test/tttx-button.spec.d.ts +1 -0
- package/dist/types/components/atoms/tttx-icon/test/tttx-icon.e2e.d.ts +1 -0
- package/dist/types/components/atoms/tttx-icon/test/tttx-icon.spec.d.ts +1 -0
- package/dist/types/components/atoms/tttx-keyvalue-block/test/tttx-keyvalue-block.spec.d.ts +1 -0
- package/dist/types/components/atoms/tttx-loading-spinner/Test/tttx-loading-spinner.spec.d.ts +1 -0
- package/dist/types/components/molecules/tttx-list/interfaces.d.ts +4 -0
- package/dist/types/components/molecules/tttx-list/test/tttx-list.spec.d.ts +1 -0
- package/dist/types/components/molecules/tttx-list/tttx-list.d.ts +9 -0
- package/dist/types/components/molecules/tttx-list/tttx-list.stories.d.ts +7 -0
- package/dist/types/components/molecules/tttx-standalone-input/test/tttx-standalone-input.e2e.d.ts +1 -0
- package/dist/types/components/molecules/tttx-standalone-input/test/tttx-standalone-input.spec.d.ts +1 -0
- package/dist/types/components/molecules/tttx-standalone-input/tttx-standalone-input.d.ts +6 -6
- package/dist/types/components/molecules/tttx-table/test/tttx-table.e2e.d.ts +1 -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.d.ts +48 -0
- package/dist/types/stencil-public-runtime.d.ts +3 -59
- package/loader/index.d.ts +0 -9
- package/package.json +2 -1
- package/readme.md +20 -0
- package/dist/tttx/p-a4d9929a.entry.js +0 -1
- package/dist/tttx/p-ad637dde.entry.js +0 -1
- package/dist/tttx/p-bbb7dbf7.js +0 -2
|
@@ -63,18 +63,6 @@ const isComplexType = (o) => {
|
|
|
63
63
|
o = typeof o;
|
|
64
64
|
return o === 'object' || o === 'function';
|
|
65
65
|
};
|
|
66
|
-
/**
|
|
67
|
-
* Helper method for querying a `meta` tag that contains a nonce value
|
|
68
|
-
* out of a DOM's head.
|
|
69
|
-
*
|
|
70
|
-
* @param doc The DOM containing the `head` to query against
|
|
71
|
-
* @returns The content of the meta tag representing the nonce value, or `undefined` if no tag
|
|
72
|
-
* exists or the tag has no content.
|
|
73
|
-
*/
|
|
74
|
-
function queryNonceMetaTagContent(doc) {
|
|
75
|
-
var _a, _b, _c;
|
|
76
|
-
return (_c = (_b = (_a = doc.head) === null || _a === void 0 ? void 0 : _a.querySelector('meta[name="csp-nonce"]')) === null || _b === void 0 ? void 0 : _b.getAttribute('content')) !== null && _c !== void 0 ? _c : undefined;
|
|
77
|
-
}
|
|
78
66
|
/**
|
|
79
67
|
* Production h() function based on Preact by
|
|
80
68
|
* Jason Miller (@developit)
|
|
@@ -83,6 +71,7 @@ function queryNonceMetaTagContent(doc) {
|
|
|
83
71
|
*
|
|
84
72
|
* Modified for Stencil's compiler and vdom
|
|
85
73
|
*/
|
|
74
|
+
// const stack: any[] = [];
|
|
86
75
|
// export function h(nodeName: string | d.FunctionalComponent, vnodeData: d.PropsType, child?: d.ChildType): d.VNode;
|
|
87
76
|
// export function h(nodeName: string | d.FunctionalComponent, vnodeData: d.PropsType, ...children: d.ChildType[]): d.VNode;
|
|
88
77
|
const h = (nodeName, vnodeData, ...children) => {
|
|
@@ -133,14 +122,6 @@ const h = (nodeName, vnodeData, ...children) => {
|
|
|
133
122
|
}
|
|
134
123
|
return vnode;
|
|
135
124
|
};
|
|
136
|
-
/**
|
|
137
|
-
* A utility function for creating a virtual DOM node from a tag and some
|
|
138
|
-
* possible text content.
|
|
139
|
-
*
|
|
140
|
-
* @param tag the tag for this element
|
|
141
|
-
* @param text possible text content for the node
|
|
142
|
-
* @returns a newly-minted virtual DOM node
|
|
143
|
-
*/
|
|
144
125
|
const newVNode = (tag, text) => {
|
|
145
126
|
const vnode = {
|
|
146
127
|
$flags$: 0,
|
|
@@ -155,12 +136,6 @@ const newVNode = (tag, text) => {
|
|
|
155
136
|
return vnode;
|
|
156
137
|
};
|
|
157
138
|
const Host = {};
|
|
158
|
-
/**
|
|
159
|
-
* Check whether a given node is a Host node or not
|
|
160
|
-
*
|
|
161
|
-
* @param node the virtual DOM node to check
|
|
162
|
-
* @returns whether it's a Host node or not
|
|
163
|
-
*/
|
|
164
139
|
const isHost = (node) => node && node.$tag$ === Host;
|
|
165
140
|
/**
|
|
166
141
|
* Parse a new property value for a given property type.
|
|
@@ -193,6 +168,10 @@ const parsePropertyValue = (propValue, propType) => {
|
|
|
193
168
|
// but we'll cheat here and say that the string "false" is the boolean false
|
|
194
169
|
return propValue === 'false' ? false : propValue === '' || !!propValue;
|
|
195
170
|
}
|
|
171
|
+
if (propType & 2 /* MEMBER_FLAGS.Number */) {
|
|
172
|
+
// force it to be a number
|
|
173
|
+
return parseFloat(propValue);
|
|
174
|
+
}
|
|
196
175
|
if (propType & 1 /* MEMBER_FLAGS.String */) {
|
|
197
176
|
// could have been passed as a number or boolean
|
|
198
177
|
// but we still want it as a string
|
|
@@ -249,7 +228,6 @@ const registerStyle = (scopeId, cssText, allowCS) => {
|
|
|
249
228
|
styles.set(scopeId, style);
|
|
250
229
|
};
|
|
251
230
|
const addStyle = (styleContainerNode, cmpMeta, mode, hostElm) => {
|
|
252
|
-
var _a;
|
|
253
231
|
let scopeId = getScopeId(cmpMeta);
|
|
254
232
|
const style = styles.get(scopeId);
|
|
255
233
|
// if an element is NOT connected then getRootNode() will return the wrong root node
|
|
@@ -269,11 +247,6 @@ const addStyle = (styleContainerNode, cmpMeta, mode, hostElm) => {
|
|
|
269
247
|
styleElm = doc.createElement('style');
|
|
270
248
|
styleElm.innerHTML = style;
|
|
271
249
|
}
|
|
272
|
-
// Apply CSP nonce to the style tag if it exists
|
|
273
|
-
const nonce = (_a = plt.$nonce$) !== null && _a !== void 0 ? _a : queryNonceMetaTagContent(doc);
|
|
274
|
-
if (nonce != null) {
|
|
275
|
-
styleElm.setAttribute('nonce', nonce);
|
|
276
|
-
}
|
|
277
250
|
styleContainerNode.insertBefore(styleElm, styleContainerNode.querySelector('link'));
|
|
278
251
|
}
|
|
279
252
|
if (appliedStyles) {
|
|
@@ -475,21 +448,6 @@ const createElm = (oldParentVNode, newParentVNode, childIndex, parentElm) => {
|
|
|
475
448
|
}
|
|
476
449
|
return elm;
|
|
477
450
|
};
|
|
478
|
-
/**
|
|
479
|
-
* Create DOM nodes corresponding to a list of {@link d.Vnode} objects and
|
|
480
|
-
* add them to the DOM in the appropriate place.
|
|
481
|
-
*
|
|
482
|
-
* @param parentElm the DOM node which should be used as a parent for the new
|
|
483
|
-
* DOM nodes
|
|
484
|
-
* @param before a child of the `parentElm` which the new children should be
|
|
485
|
-
* inserted before (optional)
|
|
486
|
-
* @param parentVNode the parent virtual DOM node
|
|
487
|
-
* @param vnodes the new child virtual DOM nodes to produce DOM nodes for
|
|
488
|
-
* @param startIdx the index in the child virtual DOM nodes at which to start
|
|
489
|
-
* creating DOM nodes (inclusive)
|
|
490
|
-
* @param endIdx the index in the child virtual DOM nodes at which to stop
|
|
491
|
-
* creating DOM nodes (inclusive)
|
|
492
|
-
*/
|
|
493
451
|
const addVnodes = (parentElm, before, parentVNode, vnodes, startIdx, endIdx) => {
|
|
494
452
|
let containerElm = (parentElm);
|
|
495
453
|
let childNode;
|
|
@@ -506,19 +464,6 @@ const addVnodes = (parentElm, before, parentVNode, vnodes, startIdx, endIdx) =>
|
|
|
506
464
|
}
|
|
507
465
|
}
|
|
508
466
|
};
|
|
509
|
-
/**
|
|
510
|
-
* Remove the DOM elements corresponding to a list of {@link d.VNode} objects.
|
|
511
|
-
* This can be used to, for instance, clean up after a list of children which
|
|
512
|
-
* should no longer be shown.
|
|
513
|
-
*
|
|
514
|
-
* This function also handles some of Stencil's slot relocation logic.
|
|
515
|
-
*
|
|
516
|
-
* @param vnodes a list of virtual DOM nodes to remove
|
|
517
|
-
* @param startIdx the index at which to start removing nodes (inclusive)
|
|
518
|
-
* @param endIdx the index at which to stop removing nodes (inclusive)
|
|
519
|
-
* @param vnode a VNode
|
|
520
|
-
* @param elm an element
|
|
521
|
-
*/
|
|
522
467
|
const removeVnodes = (vnodes, startIdx, endIdx, vnode, elm) => {
|
|
523
468
|
for (; startIdx <= endIdx; ++startIdx) {
|
|
524
469
|
if ((vnode = vnodes[startIdx])) {
|
|
@@ -710,8 +655,7 @@ const updateChildren = (parentElm, oldCh, newVNode, newCh) => {
|
|
|
710
655
|
*
|
|
711
656
|
* So, in other words, if `key` attrs are not set on VNodes which may be
|
|
712
657
|
* changing order within a `children` array or something along those lines then
|
|
713
|
-
* we could obtain a false
|
|
714
|
-
* (i.e. we'd say two VNodes aren't equal when in fact they should be).
|
|
658
|
+
* we could obtain a false positive and then have to do needless re-rendering.
|
|
715
659
|
*
|
|
716
660
|
* @param leftVNode the first VNode to check
|
|
717
661
|
* @param rightVNode the second VNode to check
|
|
@@ -775,18 +719,6 @@ const patch = (oldVNode, newVNode) => {
|
|
|
775
719
|
elm.data = text;
|
|
776
720
|
}
|
|
777
721
|
};
|
|
778
|
-
/**
|
|
779
|
-
* The main entry point for Stencil's virtual DOM-based rendering engine
|
|
780
|
-
*
|
|
781
|
-
* Given a {@link d.HostRef} container and some virtual DOM nodes, this
|
|
782
|
-
* function will handle creating a virtual DOM tree with a single root, patching
|
|
783
|
-
* the current virtual DOM tree onto an old one (if any), dealing with slot
|
|
784
|
-
* relocation, and reflecting attributes.
|
|
785
|
-
*
|
|
786
|
-
* @param hostRef data needed to root and render the virtual DOM tree, such as
|
|
787
|
-
* the DOM node into which it should be rendered.
|
|
788
|
-
* @param renderFnResults the virtual DOM nodes to be rendered
|
|
789
|
-
*/
|
|
790
722
|
const renderVdom = (hostRef, renderFnResults) => {
|
|
791
723
|
const hostElm = hostRef.$hostElement$;
|
|
792
724
|
const oldVNode = hostRef.$vnode$ || newVNode(null, null);
|
|
@@ -827,6 +759,13 @@ const dispatchHooks = (hostRef, isInitialLoad) => {
|
|
|
827
759
|
const instance = hostRef.$lazyInstance$ ;
|
|
828
760
|
let promise;
|
|
829
761
|
if (isInitialLoad) {
|
|
762
|
+
{
|
|
763
|
+
hostRef.$flags$ |= 256 /* HOST_FLAGS.isListenReady */;
|
|
764
|
+
if (hostRef.$queuedListeners$) {
|
|
765
|
+
hostRef.$queuedListeners$.map(([methodName, event]) => safeCall(instance, methodName, event));
|
|
766
|
+
hostRef.$queuedListeners$ = null;
|
|
767
|
+
}
|
|
768
|
+
}
|
|
830
769
|
{
|
|
831
770
|
promise = safeCall(instance, 'componentWillLoad');
|
|
832
771
|
}
|
|
@@ -1188,16 +1127,27 @@ const connectedCallback = (elm) => {
|
|
|
1188
1127
|
initializeComponent(elm, hostRef, cmpMeta);
|
|
1189
1128
|
}
|
|
1190
1129
|
}
|
|
1130
|
+
else {
|
|
1131
|
+
// not the first time this has connected
|
|
1132
|
+
// reattach any event listeners to the host
|
|
1133
|
+
// since they would have been removed when disconnected
|
|
1134
|
+
addHostEventListeners(elm, hostRef, cmpMeta.$listeners$);
|
|
1135
|
+
}
|
|
1191
1136
|
endConnected();
|
|
1192
1137
|
}
|
|
1193
1138
|
};
|
|
1194
1139
|
const disconnectedCallback = (elm) => {
|
|
1195
1140
|
if ((plt.$flags$ & 1 /* PLATFORM_FLAGS.isTmpDisconnected */) === 0) {
|
|
1196
|
-
getHostRef(elm);
|
|
1141
|
+
const hostRef = getHostRef(elm);
|
|
1142
|
+
{
|
|
1143
|
+
if (hostRef.$rmListeners$) {
|
|
1144
|
+
hostRef.$rmListeners$.map((rmListener) => rmListener());
|
|
1145
|
+
hostRef.$rmListeners$ = undefined;
|
|
1146
|
+
}
|
|
1147
|
+
}
|
|
1197
1148
|
}
|
|
1198
1149
|
};
|
|
1199
1150
|
const bootstrapLazy = (lazyBundles, options = {}) => {
|
|
1200
|
-
var _a;
|
|
1201
1151
|
const endBootstrap = createTime();
|
|
1202
1152
|
const cmpTags = [];
|
|
1203
1153
|
const exclude = options.exclude || [];
|
|
@@ -1221,6 +1171,9 @@ const bootstrapLazy = (lazyBundles, options = {}) => {
|
|
|
1221
1171
|
{
|
|
1222
1172
|
cmpMeta.$members$ = compactMeta[2];
|
|
1223
1173
|
}
|
|
1174
|
+
{
|
|
1175
|
+
cmpMeta.$listeners$ = compactMeta[3];
|
|
1176
|
+
}
|
|
1224
1177
|
const tagName = cmpMeta.$tagName$;
|
|
1225
1178
|
const HostElement = class extends HTMLElement {
|
|
1226
1179
|
// StencilLazyHost
|
|
@@ -1271,11 +1224,6 @@ const bootstrapLazy = (lazyBundles, options = {}) => {
|
|
|
1271
1224
|
{
|
|
1272
1225
|
visibilityStyle.innerHTML = cmpTags + HYDRATED_CSS;
|
|
1273
1226
|
visibilityStyle.setAttribute('data-styles', '');
|
|
1274
|
-
// Apply CSP nonce to the style tag if it exists
|
|
1275
|
-
const nonce = (_a = plt.$nonce$) !== null && _a !== void 0 ? _a : queryNonceMetaTagContent(doc);
|
|
1276
|
-
if (nonce != null) {
|
|
1277
|
-
visibilityStyle.setAttribute('nonce', nonce);
|
|
1278
|
-
}
|
|
1279
1227
|
head.insertBefore(visibilityStyle, metaCharset ? metaCharset.nextSibling : head.firstChild);
|
|
1280
1228
|
}
|
|
1281
1229
|
// Process deferred connectedCallbacks now all components have been registered
|
|
@@ -1291,13 +1239,40 @@ const bootstrapLazy = (lazyBundles, options = {}) => {
|
|
|
1291
1239
|
// Fallback appLoad event
|
|
1292
1240
|
endBootstrap();
|
|
1293
1241
|
};
|
|
1294
|
-
|
|
1295
|
-
|
|
1296
|
-
|
|
1297
|
-
|
|
1298
|
-
|
|
1299
|
-
|
|
1300
|
-
|
|
1242
|
+
const addHostEventListeners = (elm, hostRef, listeners, attachParentListeners) => {
|
|
1243
|
+
if (listeners) {
|
|
1244
|
+
listeners.map(([flags, name, method]) => {
|
|
1245
|
+
const target = getHostListenerTarget(elm, flags) ;
|
|
1246
|
+
const handler = hostListenerProxy(hostRef, method);
|
|
1247
|
+
const opts = hostListenerOpts(flags);
|
|
1248
|
+
plt.ael(target, name, handler, opts);
|
|
1249
|
+
(hostRef.$rmListeners$ = hostRef.$rmListeners$ || []).push(() => plt.rel(target, name, handler, opts));
|
|
1250
|
+
});
|
|
1251
|
+
}
|
|
1252
|
+
};
|
|
1253
|
+
const hostListenerProxy = (hostRef, methodName) => (ev) => {
|
|
1254
|
+
try {
|
|
1255
|
+
{
|
|
1256
|
+
if (hostRef.$flags$ & 256 /* HOST_FLAGS.isListenReady */) {
|
|
1257
|
+
// instance is ready, let's call it's member method for this event
|
|
1258
|
+
hostRef.$lazyInstance$[methodName](ev);
|
|
1259
|
+
}
|
|
1260
|
+
else {
|
|
1261
|
+
(hostRef.$queuedListeners$ = hostRef.$queuedListeners$ || []).push([methodName, ev]);
|
|
1262
|
+
}
|
|
1263
|
+
}
|
|
1264
|
+
}
|
|
1265
|
+
catch (e) {
|
|
1266
|
+
consoleError(e);
|
|
1267
|
+
}
|
|
1268
|
+
};
|
|
1269
|
+
const getHostListenerTarget = (elm, flags) => {
|
|
1270
|
+
if (flags & 4 /* LISTENER_FLAGS.TargetDocument */)
|
|
1271
|
+
return doc;
|
|
1272
|
+
return elm;
|
|
1273
|
+
};
|
|
1274
|
+
// prettier-ignore
|
|
1275
|
+
const hostListenerOpts = (flags) => (flags & 2 /* LISTENER_FLAGS.Capture */) !== 0;
|
|
1301
1276
|
const hostRefs = /*@__PURE__*/ new WeakMap();
|
|
1302
1277
|
const getHostRef = (ref) => hostRefs.get(ref);
|
|
1303
1278
|
const registerInstance = (lazyInstance, hostRef) => hostRefs.set((hostRef.$lazyInstance$ = lazyInstance), hostRef);
|
|
@@ -1313,6 +1288,7 @@ const registerHost = (elm, cmpMeta) => {
|
|
|
1313
1288
|
elm['s-p'] = [];
|
|
1314
1289
|
elm['s-rc'] = [];
|
|
1315
1290
|
}
|
|
1291
|
+
addHostEventListeners(elm, hostRef, cmpMeta.$listeners$);
|
|
1316
1292
|
return hostRefs.set(elm, hostRef);
|
|
1317
1293
|
};
|
|
1318
1294
|
const isMemberInElement = (elm, memberName) => memberName in elm;
|
|
@@ -1410,4 +1386,3 @@ exports.createEvent = createEvent;
|
|
|
1410
1386
|
exports.h = h;
|
|
1411
1387
|
exports.promiseResolve = promiseResolve;
|
|
1412
1388
|
exports.registerInstance = registerInstance;
|
|
1413
|
-
exports.setNonce = setNonce;
|
package/dist/cjs/loader.cjs.js
CHANGED
|
@@ -2,10 +2,10 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
const index = require('./index-
|
|
5
|
+
const index = require('./index-bc080fb4.js');
|
|
6
6
|
|
|
7
7
|
/*
|
|
8
|
-
Stencil Client Patch Esm v2.
|
|
8
|
+
Stencil Client Patch Esm v2.20.0 | MIT Licensed | https://stenciljs.com
|
|
9
9
|
*/
|
|
10
10
|
const patchEsm = () => {
|
|
11
11
|
return index.promiseResolve();
|
|
@@ -14,9 +14,8 @@ 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-button.cjs",[[1,"tttx-button",{"notext":[4],"icon":[1],"iconposition":[1],"design":[1]}]]],["tttx-standalone-input.cjs",[[2,"tttx-standalone-input",{"label":[1],"showerrormsg":[4],"errormsg":[1],"iconleft":[1],"iconright":[1],"inputAutocapitalize":[1,"input-autocapitalize"],"inputAutofocus":[4,"input-autofocus"],"inputKeyhint":[1,"input-keyhint"],"inputIndex":[8,"input-index"],"inputTitle":[1,"input-title"],"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-
|
|
17
|
+
return index.bootstrapLazy([["tttx-icon.cjs",[[1,"tttx-icon",{"icon":[1],"color":[1]}]]],["tttx-button.cjs",[[1,"tttx-button",{"notext":[4],"icon":[1],"iconposition":[1],"design":[1]}]]],["tttx-list.cjs",[[1,"tttx-list",{"data":[1]}]]],["tttx-standalone-input.cjs",[[2,"tttx-standalone-input",{"label":[1],"showerrormsg":[4],"errormsg":[1],"iconleft":[1],"iconright":[1],"inputAutocapitalize":[1,"input-autocapitalize"],"inputAutofocus":[4,"input-autofocus"],"inputKeyhint":[1,"input-keyhint"],"inputIndex":[8,"input-index"],"inputTitle":[1,"input-title"],"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-table.cjs",[[1,"tttx-table",{"headers":[16],"data":[16],"loading":[4],"selected":[2]},[[4,"keydown","handleKeyDown"]]]]],["tttx-keyvalue-block.cjs",[[1,"tttx-keyvalue-block",{"keyvalues":[8],"horizontal":[4]}]]],["tttx-loading-spinner.cjs",[[1,"tttx-loading-spinner",{"loadingMessage":[1028,"loading-message"],"size":[1025]}]]]], options);
|
|
18
18
|
});
|
|
19
19
|
};
|
|
20
20
|
|
|
21
|
-
exports.setNonce = index.setNonce;
|
|
22
21
|
exports.defineCustomElements = defineCustomElements;
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
const index = require('./index-
|
|
5
|
+
const index = require('./index-bc080fb4.js');
|
|
6
6
|
|
|
7
7
|
const tttxButtonCss = ".material-symbols-rounded{font-variation-settings:\"FILL\" 1, \"wght\" 400, \"GRAD\" 0, \"opsz\" 24}.button{font-family:Roboto, serif;box-sizing:border-box;height:36px;min-width:36px;padding:0;margin:0;background:transparent;color:#212121;border:1px solid #c8c8c8;border-radius:4px;text-transform:uppercase;display:flex;justify-content:left;align-items:center;font-size:14px;font-weight:400}.button-content{display:block;padding:0 16px}.icon-left,.icon-right{margin-top:4px}.iconleft{padding-left:8px}.iconleft .button-content{padding-left:4px}.iconright{padding-right:8px}.iconright .button-content{padding-right:4px}.notext{padding:0 6px}.button:hover{background:rgba(17, 17, 17, 0.1);border:1px solid #D5D5D5}.button:active{background:rgba(17, 17, 17, 0.2);border:1px solid #D5D5D5}.primary{background:#1479c6;border:1px solid #1479c6;color:white}.primary:hover{background:#146EB3;border:1px solid #146EB3}.primary:active{background:#1464A2;border:1px solid #1464A2}.borderless{background:transparent;border:none;color:#212121}.borderless:hover{background:rgba(17, 17, 17, 0.1);border:none}.borderless:active{background:rgba(17, 17, 17, 0.2);border:none}.danger{background:#DC0000;border:1px solid #DC0000;color:white}.danger:hover{background:#C60000;border:1px solid #C60000}.danger:active{background:#B00000;border:1px solid #B00000}.disabled{background:#aeaeae;border:none;color:#4c4c4c;cursor:not-allowed}.disabled:hover{background:#aeaeae;border:none;color:#4c4c4c;cursor:not-allowed}.disabled:active{background:#aeaeae;border:none;color:#4c4c4c;cursor:not-allowed}:host{display:inline-block}.spacingleft{margin-left:8px}";
|
|
8
8
|
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
const index = require('./index-
|
|
5
|
+
const index = require('./index-bc080fb4.js');
|
|
6
6
|
|
|
7
7
|
const tttxIconCss = ".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:inline-block;cursor:default;user-select:none}.icon-size{width:24px;height:24px}.tooltip{background:#ffffff;color:#343434;font-weight:bold;padding:8px 16px;font-size:13px;border-radius:4px;box-shadow:0 0 5px 1px rgba(0, 0, 0, 0.3);display:none}.tooltip[data-show]{display:block}.arrow,.arrow::before{position:absolute;width:8px;height:8px;background:inherit}.arrow{visibility:hidden}.arrow::before{visibility:visible;content:\"\";transform:rotate(45deg)}.tooltip[data-popper-placement^=top]>.arrow{bottom:-4px}.tooltip[data-popper-placement^=bottom]>.arrow{top:-4px}.tooltip[data-popper-placement^=left]>.arrow{right:-4px}.tooltip[data-popper-placement^=right]>.arrow{left:-4px}.red{color:#dc0000}.orange{color:#f59500}.blue{color:#1479c6}.green{color:#a2bb31}.gray{color:#757575}.black{color:#212121}.white{color:white}";
|
|
8
8
|
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
const index = require('./index-
|
|
5
|
+
const index = require('./index-bc080fb4.js');
|
|
6
6
|
|
|
7
7
|
const tttxKeyvalueBlockCss = ":host{display:block}dl{margin:0;padding:0;font-family:\"Roboto\", sans-serif;cursor:default}dt{font-weight:400;line-height:21px;font-size:16px}dt,dt.subTitle{color:#757575}dt.mainTitle{color:#212121}dd{margin:0;font-weight:400;font-size:16px;color:#212121;line-height:21px;margin-bottom:18px}dl.horizontal{display:flex;flex-direction:row;width:100%}dl.horizontal div{flex-grow:1}@media (max-width: 769px){dl.horizontal{flex-wrap:wrap}dl.horizontal div{width:50%}}@media (max-width: 600px){dl.horizontal div{width:100%}}";
|
|
8
8
|
|
|
@@ -31,20 +31,17 @@ const TttxKeyvalueBlock = class {
|
|
|
31
31
|
for (let i = 0; i < values.length; i++) {
|
|
32
32
|
const value = values[i];
|
|
33
33
|
if (this.horizontal) {
|
|
34
|
-
elements.push(index.h("div", null, index.h("dt", { class:
|
|
34
|
+
elements.push(index.h("div", null, index.h("dt", { class: "mainTitle" }, value.title), index.h("dt", { class: "subTitle" }, value.subTitle), index.h("dd", null, value.data)));
|
|
35
35
|
}
|
|
36
36
|
else {
|
|
37
|
-
elements.push(index.h("dt", { class:
|
|
38
|
-
elements.push(index.h("dt", { class:
|
|
37
|
+
elements.push(index.h("dt", { class: "mainTitle" }, value.title));
|
|
38
|
+
elements.push(index.h("dt", { class: "subTitle" }, value.subTitle));
|
|
39
39
|
elements.push(index.h("dd", null, value.data));
|
|
40
40
|
}
|
|
41
41
|
}
|
|
42
42
|
return elements;
|
|
43
43
|
}
|
|
44
44
|
render() {
|
|
45
|
-
if (!this.keyvalues) {
|
|
46
|
-
return;
|
|
47
|
-
}
|
|
48
45
|
let values;
|
|
49
46
|
if (typeof this.keyvalues === 'string') {
|
|
50
47
|
values = JSON.parse(this.keyvalues);
|
|
@@ -59,7 +56,7 @@ const TttxKeyvalueBlock = class {
|
|
|
59
56
|
else {
|
|
60
57
|
elements = this.renderSingleElements(values);
|
|
61
58
|
}
|
|
62
|
-
return (index.h(index.Host, null, index.h("dl", { class: this.horizontal ?
|
|
59
|
+
return (index.h(index.Host, null, index.h("dl", { class: this.horizontal ? "horizontal" : null }, elements)));
|
|
63
60
|
}
|
|
64
61
|
};
|
|
65
62
|
TttxKeyvalueBlock.style = tttxKeyvalueBlockCss;
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
const index = require('./index-bc080fb4.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}.list{margin:0;padding:0}.item{list-style:none;margin:0;padding:0;border-bottom:1px solid #d5d5d5;height:36px;display:flex;align-items:center}.item:first-of-type{border-top:1px solid #d5d5d5}.align-right{margin-left:auto}.item-content{display:flex;align-items:center}";
|
|
8
|
+
|
|
9
|
+
const TttxList = class {
|
|
10
|
+
constructor(hostRef) {
|
|
11
|
+
index.registerInstance(this, hostRef);
|
|
12
|
+
this.listSelectedEvent = index.createEvent(this, "listItemClick", 7);
|
|
13
|
+
this.data = undefined;
|
|
14
|
+
}
|
|
15
|
+
renderListItem(item) {
|
|
16
|
+
// Onclick should return some row data. May need to rethink how we handle data, since we don't want to return a template
|
|
17
|
+
// Alternatively, could return some sort of row id/index instead
|
|
18
|
+
return index.h("li", { class: "item", onClick: () => { this.listSelectedEvent.emit({}); } }, item.element && index.h("span", { class: "item-content", innerHTML: item.element }), item.chevron && index.h("tttx-icon", { class: "align-right", icon: "chevron_right" }));
|
|
19
|
+
}
|
|
20
|
+
render() {
|
|
21
|
+
if (!this.data)
|
|
22
|
+
return;
|
|
23
|
+
if (typeof this.data === 'string') {
|
|
24
|
+
this._data = JSON.parse(this.data);
|
|
25
|
+
}
|
|
26
|
+
else {
|
|
27
|
+
this._data = this.data;
|
|
28
|
+
}
|
|
29
|
+
return (index.h("ul", { class: "list" }, this._data && this._data.map((item) => this.renderListItem(item))));
|
|
30
|
+
}
|
|
31
|
+
};
|
|
32
|
+
TttxList.style = tttxListCss;
|
|
33
|
+
|
|
34
|
+
exports.tttx_list = TttxList;
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
const index = require('./index-
|
|
5
|
+
const index = require('./index-bc080fb4.js');
|
|
6
6
|
|
|
7
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
8
|
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
const index = require('./index-
|
|
5
|
+
const index = require('./index-bc080fb4.js');
|
|
6
6
|
|
|
7
7
|
const tttxStandaloneInputCss = ".material-symbols-rounded.sc-tttx-standalone-input{font-variation-settings:\"FILL\" 1, \"wght\" 400, \"GRAD\" 0, \"opsz\" 24}.material-symbols-rounded.sc-tttx-standalone-input{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.sc-tttx-standalone-input,.icon-right.sc-tttx-standalone-input{flex-basis:24px}.icon-left.sc-tttx-standalone-input span.sc-tttx-standalone-input,.icon-right.sc-tttx-standalone-input span.sc-tttx-standalone-input{font-size:24px;line-height:24px;text-align:center;display:block;width:24px;height:24px;margin-top:4px}.icon-left.sc-tttx-standalone-input span.sc-tttx-standalone-input{margin-left:4px}.icon-right.sc-tttx-standalone-input span.sc-tttx-standalone-input{margin-right:4px}.icon-right.sc-tttx-standalone-input{margin-top:5px;margin-right:4px}.icon-left.sc-tttx-standalone-input{margin-top:5px;margin-left:4px}.iconleft.sc-tttx-standalone-input .input.sc-tttx-standalone-input{padding-left:4px}.iconright.sc-tttx-standalone-input .input.sc-tttx-standalone-input{padding-right:4px}.focused.sc-tttx-standalone-input{border-color:#1479c6}.errormsg.sc-tttx-standalone-input{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.sc-tttx-standalone-input .validationicon.sc-tttx-standalone-input{width:16px;height:16px;font-size:16px;margin-right:4px;vertical-align:middle;color:#dc0000}.danger.sc-tttx-standalone-input{color:#dc0000}.optional.sc-tttx-standalone-input{color:#757575;font-weight:normal}label.inputBlock.sc-tttx-standalone-input{display:block;position:relative;line-height:21px}label.sc-tttx-standalone-input{font-weight:500;font-size:16px}input.sc-tttx-standalone-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].sc-tttx-standalone-input{background:white;display:block;min-width:calc(100% - 18px);line-height:37px}input.invalid.sc-tttx-standalone-input:invalid,input.standalone.invalid.sc-tttx-standalone-input{border:1px solid #dc0000}input.sc-tttx-standalone-input~.errorBubble.sc-tttx-standalone-input{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.sc-tttx-standalone-input~.errorBubble.sc-tttx-standalone-input:not(.visible){visibility:hidden}input.sc-tttx-standalone-input~.errorBubble.sc-tttx-standalone-input span.sc-tttx-standalone-input{color:#dc0000;font-size:16px;margin-right:4px;height:16px}input.invalid.sc-tttx-standalone-input:invalid~.errorBubble.sc-tttx-standalone-input{position:relative;font-size:14px;font-weight:normal;width:100%;font-family:\"Roboto\", sans-serif;color:#dc0000;visibility:visible}input.sc-tttx-standalone-input:focus{border-color:#1479c6}.sc-tttx-standalone-input-h{display:block}";
|
|
8
8
|
|
|
@@ -53,7 +53,6 @@ const TttxInput = class {
|
|
|
53
53
|
this.blurChanged.emit(target.value);
|
|
54
54
|
}
|
|
55
55
|
handleInvalid(event) {
|
|
56
|
-
event.preventDefault();
|
|
57
56
|
const target = event.target;
|
|
58
57
|
this.invalidChanged.emit(target.value);
|
|
59
58
|
}
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
const index = require('./index-bc080fb4.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;
|
package/dist/cjs/tttx.cjs.js
CHANGED
|
@@ -1,11 +1,9 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
const index = require('./index-2943e8f8.js');
|
|
3
|
+
const index = require('./index-bc080fb4.js');
|
|
6
4
|
|
|
7
5
|
/*
|
|
8
|
-
Stencil Client Patch Browser v2.
|
|
6
|
+
Stencil Client Patch Browser v2.20.0 | MIT Licensed | https://stenciljs.com
|
|
9
7
|
*/
|
|
10
8
|
const patchBrowser = () => {
|
|
11
9
|
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));
|
|
@@ -17,7 +15,5 @@ const patchBrowser = () => {
|
|
|
17
15
|
};
|
|
18
16
|
|
|
19
17
|
patchBrowser().then(options => {
|
|
20
|
-
return index.bootstrapLazy([["tttx-button.cjs",[[1,"tttx-button",{"notext":[4],"icon":[1],"iconposition":[1],"design":[1]}]]],["tttx-standalone-input.cjs",[[2,"tttx-standalone-input",{"label":[1],"showerrormsg":[4],"errormsg":[1],"iconleft":[1],"iconright":[1],"inputAutocapitalize":[1,"input-autocapitalize"],"inputAutofocus":[4,"input-autofocus"],"inputKeyhint":[1,"input-keyhint"],"inputIndex":[8,"input-index"],"inputTitle":[1,"input-title"],"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-
|
|
18
|
+
return index.bootstrapLazy([["tttx-icon.cjs",[[1,"tttx-icon",{"icon":[1],"color":[1]}]]],["tttx-button.cjs",[[1,"tttx-button",{"notext":[4],"icon":[1],"iconposition":[1],"design":[1]}]]],["tttx-list.cjs",[[1,"tttx-list",{"data":[1]}]]],["tttx-standalone-input.cjs",[[2,"tttx-standalone-input",{"label":[1],"showerrormsg":[4],"errormsg":[1],"iconleft":[1],"iconright":[1],"inputAutocapitalize":[1,"input-autocapitalize"],"inputAutofocus":[4,"input-autofocus"],"inputKeyhint":[1,"input-keyhint"],"inputIndex":[8,"input-index"],"inputTitle":[1,"input-title"],"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-table.cjs",[[1,"tttx-table",{"headers":[16],"data":[16],"loading":[4],"selected":[2]},[[4,"keydown","handleKeyDown"]]]]],["tttx-keyvalue-block.cjs",[[1,"tttx-keyvalue-block",{"keyvalues":[8],"horizontal":[4]}]]],["tttx-loading-spinner.cjs",[[1,"tttx-loading-spinner",{"loadingMessage":[1028,"loading-message"],"size":[1025]}]]]], options);
|
|
21
19
|
});
|
|
22
|
-
|
|
23
|
-
exports.setNonce = index.setNonce;
|
|
@@ -4,12 +4,14 @@
|
|
|
4
4
|
"./components/atoms/tttx-button/tttx-button.js",
|
|
5
5
|
"./components/atoms/tttx-icon/tttx-icon.js",
|
|
6
6
|
"./components/atoms/tttx-keyvalue-block/tttx-keyvalue-block.js",
|
|
7
|
-
"./components/atoms/tttx-loading-spinner/tttx-loading-spinner.js"
|
|
7
|
+
"./components/atoms/tttx-loading-spinner/tttx-loading-spinner.js",
|
|
8
|
+
"./components/molecules/tttx-list/tttx-list.js",
|
|
9
|
+
"./components/molecules/tttx-table/tttx-table.js"
|
|
8
10
|
],
|
|
9
11
|
"compiler": {
|
|
10
12
|
"name": "@stencil/core",
|
|
11
|
-
"version": "2.
|
|
12
|
-
"typescriptVersion": "4.
|
|
13
|
+
"version": "2.20.0",
|
|
14
|
+
"typescriptVersion": "4.8.4"
|
|
13
15
|
},
|
|
14
16
|
"collections": [],
|
|
15
17
|
"bundles": []
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { newE2EPage } from '@stencil/core/testing';
|
|
2
|
+
describe('tttx-button', () => {
|
|
3
|
+
it('renders', async () => {
|
|
4
|
+
const page = await newE2EPage();
|
|
5
|
+
await page.setContent('<tttx-button></tttx-button>');
|
|
6
|
+
const element = await page.find('tttx-button');
|
|
7
|
+
expect(element).toHaveClass('hydrated');
|
|
8
|
+
});
|
|
9
|
+
});
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { newSpecPage } from '@stencil/core/testing';
|
|
2
|
+
import { TttxButton } from '../tttx-button';
|
|
3
|
+
describe('tttx-button', () => {
|
|
4
|
+
it('renders', async () => {
|
|
5
|
+
const page = await newSpecPage({
|
|
6
|
+
components: [TttxButton],
|
|
7
|
+
html: '<tttx-button></tttx-button>',
|
|
8
|
+
});
|
|
9
|
+
expect(page.root).toEqualHtml(`
|
|
10
|
+
<tttx-button>
|
|
11
|
+
<mock:shadow-root>
|
|
12
|
+
<button class="button default">
|
|
13
|
+
<div class="button-content">
|
|
14
|
+
<slot></slot>
|
|
15
|
+
</div>
|
|
16
|
+
</button>
|
|
17
|
+
</mock:shadow-root>
|
|
18
|
+
</tttx-button>
|
|
19
|
+
`);
|
|
20
|
+
});
|
|
21
|
+
it('clicks', async () => {
|
|
22
|
+
const page = await newSpecPage({
|
|
23
|
+
components: [TttxButton],
|
|
24
|
+
html: '<tttx-button></tttx-button>',
|
|
25
|
+
});
|
|
26
|
+
expect(page.root).toEqualHtml(`
|
|
27
|
+
<tttx-button>
|
|
28
|
+
<mock:shadow-root>
|
|
29
|
+
<button class="button default">
|
|
30
|
+
<div class="button-content">
|
|
31
|
+
<slot></slot>
|
|
32
|
+
</div>
|
|
33
|
+
</button>
|
|
34
|
+
</mock:shadow-root>
|
|
35
|
+
</tttx-button>
|
|
36
|
+
`);
|
|
37
|
+
const callbackFn = jest.fn();
|
|
38
|
+
// add an event listener directly to the tttx-button host and click it
|
|
39
|
+
page.root.addEventListener('click', callbackFn);
|
|
40
|
+
page.root.click();
|
|
41
|
+
expect(callbackFn).toHaveBeenCalled();
|
|
42
|
+
});
|
|
43
|
+
});
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { newE2EPage } from '@stencil/core/testing';
|
|
2
|
+
describe('tttx-icon', () => {
|
|
3
|
+
it('renders', async () => {
|
|
4
|
+
const page = await newE2EPage();
|
|
5
|
+
await page.setContent('<tttx-icon></tttx-icon>');
|
|
6
|
+
const element = await page.find('tttx-icon');
|
|
7
|
+
expect(element).toHaveClass('hydrated');
|
|
8
|
+
});
|
|
9
|
+
});
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { newSpecPage } from '@stencil/core/testing';
|
|
2
|
+
import { TttxIcon } from '../tttx-icon';
|
|
3
|
+
describe('tttx-icon', () => {
|
|
4
|
+
it('renders', async () => {
|
|
5
|
+
const page = await newSpecPage({
|
|
6
|
+
components: [TttxIcon],
|
|
7
|
+
html: '<tttx-icon color="danger" icon="warning"></tttx-icon>',
|
|
8
|
+
});
|
|
9
|
+
expect(page.root).toEqualHtml(`
|
|
10
|
+
<tttx-icon color="danger" icon="warning">
|
|
11
|
+
<mock:shadow-root>
|
|
12
|
+
<span class="material-symbols-rounded danger">warning</span>
|
|
13
|
+
</mock:shadow-root>
|
|
14
|
+
</tttx-icon>`);
|
|
15
|
+
});
|
|
16
|
+
});
|