@3t-transform/threeteeui 0.0.11 → 0.0.12

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.
Files changed (52) hide show
  1. package/dist/cjs/{index-bf39be87.js → index-61cd741f.js} +2 -88
  2. package/dist/cjs/loader.cjs.js +3 -4
  3. package/dist/cjs/tttx-button.cjs.entry.js +1 -1
  4. package/dist/cjs/tttx-checkbox.cjs.entry.js +1 -1
  5. package/dist/cjs/tttx-form.cjs.entry.js +1 -1
  6. package/dist/cjs/tttx-icon.cjs.entry.js +1 -1
  7. package/dist/cjs/tttx-list.cjs.entry.js +198 -0
  8. package/dist/cjs/tttx-loading-spinner.cjs.entry.js +1 -1
  9. package/dist/cjs/tttx-popover-content.cjs.entry.js +1 -1
  10. package/dist/cjs/tttx-standalone-input.cjs.entry.js +1 -1
  11. package/dist/cjs/tttx.cjs.js +3 -7
  12. package/dist/collection/collection-manifest.json +4 -3
  13. package/dist/collection/components/molecules/tttx-list/tttx-list.css +56 -0
  14. package/dist/collection/components/molecules/tttx-list/tttx-list.js +311 -0
  15. package/dist/collection/components/molecules/tttx-list/tttx-list.stories.js +37 -0
  16. package/dist/components/index.d.ts +1 -9
  17. package/dist/components/index.js +2 -1
  18. package/dist/components/tttx-list.d.ts +11 -0
  19. package/dist/components/tttx-list.js +225 -0
  20. package/dist/components/tttx-loading-spinner.js +1 -38
  21. package/dist/components/tttx-loading-spinner2.js +40 -0
  22. package/dist/esm/{index-63c4d25e.js → index-d8718abe.js} +3 -88
  23. package/dist/esm/loader.js +3 -4
  24. package/dist/esm/polyfills/css-shim.js +1 -1
  25. package/dist/esm/tttx-button.entry.js +1 -1
  26. package/dist/esm/tttx-checkbox.entry.js +1 -1
  27. package/dist/esm/tttx-form.entry.js +1 -1
  28. package/dist/esm/tttx-icon.entry.js +1 -1
  29. package/dist/esm/tttx-list.entry.js +194 -0
  30. package/dist/esm/tttx-loading-spinner.entry.js +1 -1
  31. package/dist/esm/tttx-popover-content.entry.js +1 -1
  32. package/dist/esm/tttx-standalone-input.entry.js +1 -1
  33. package/dist/esm/tttx.js +3 -4
  34. package/dist/tttx/p-1b6b4223.entry.js +1 -0
  35. package/dist/tttx/{p-338b3976.entry.js → p-1ea7e424.entry.js} +1 -1
  36. package/dist/tttx/{p-1a4eb1f3.entry.js → p-629411bc.entry.js} +1 -1
  37. package/dist/tttx/{p-2d54f8aa.entry.js → p-7d84c410.entry.js} +1 -1
  38. package/dist/tttx/p-80bbe164.js +2 -0
  39. package/dist/tttx/{p-ad0c3fe4.entry.js → p-daa82b1b.entry.js} +1 -1
  40. package/dist/tttx/{p-95a29e09.entry.js → p-db1f56ba.entry.js} +1 -1
  41. package/dist/tttx/p-dee50f14.entry.js +1 -0
  42. package/dist/tttx/{p-4c57bcbd.entry.js → p-e5c02c27.entry.js} +1 -1
  43. package/dist/tttx/tttx.esm.js +1 -1
  44. package/dist/types/components/molecules/tttx-list/tttx-list.d.ts +51 -0
  45. package/dist/types/components/molecules/tttx-list/tttx-list.stories.d.ts +13 -0
  46. package/dist/types/components/molecules/tttx-standalone-input/tttx-standalone-input.d.ts +6 -6
  47. package/dist/types/components.d.ts +24 -0
  48. package/dist/types/stencil-public-runtime.d.ts +3 -59
  49. package/loader/index.d.ts +0 -9
  50. package/package.json +1 -1
  51. package/dist/tttx/p-709246f5.entry.js +0 -1
  52. package/dist/tttx/p-bec472d8.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.
@@ -249,7 +224,6 @@ const registerStyle = (scopeId, cssText, allowCS) => {
249
224
  styles.set(scopeId, style);
250
225
  };
251
226
  const addStyle = (styleContainerNode, cmpMeta, mode, hostElm) => {
252
- var _a;
253
227
  let scopeId = getScopeId(cmpMeta);
254
228
  const style = styles.get(scopeId);
255
229
  // if an element is NOT connected then getRootNode() will return the wrong root node
@@ -269,11 +243,6 @@ const addStyle = (styleContainerNode, cmpMeta, mode, hostElm) => {
269
243
  styleElm = doc.createElement('style');
270
244
  styleElm.innerHTML = style;
271
245
  }
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
246
  styleContainerNode.insertBefore(styleElm, styleContainerNode.querySelector('link'));
278
247
  }
279
248
  if (appliedStyles) {
@@ -481,21 +450,6 @@ const createElm = (oldParentVNode, newParentVNode, childIndex, parentElm) => {
481
450
  }
482
451
  return elm;
483
452
  };
484
- /**
485
- * Create DOM nodes corresponding to a list of {@link d.Vnode} objects and
486
- * add them to the DOM in the appropriate place.
487
- *
488
- * @param parentElm the DOM node which should be used as a parent for the new
489
- * DOM nodes
490
- * @param before a child of the `parentElm` which the new children should be
491
- * inserted before (optional)
492
- * @param parentVNode the parent virtual DOM node
493
- * @param vnodes the new child virtual DOM nodes to produce DOM nodes for
494
- * @param startIdx the index in the child virtual DOM nodes at which to start
495
- * creating DOM nodes (inclusive)
496
- * @param endIdx the index in the child virtual DOM nodes at which to stop
497
- * creating DOM nodes (inclusive)
498
- */
499
453
  const addVnodes = (parentElm, before, parentVNode, vnodes, startIdx, endIdx) => {
500
454
  let containerElm = (parentElm);
501
455
  let childNode;
@@ -512,19 +466,6 @@ const addVnodes = (parentElm, before, parentVNode, vnodes, startIdx, endIdx) =>
512
466
  }
513
467
  }
514
468
  };
515
- /**
516
- * Remove the DOM elements corresponding to a list of {@link d.VNode} objects.
517
- * This can be used to, for instance, clean up after a list of children which
518
- * should no longer be shown.
519
- *
520
- * This function also handles some of Stencil's slot relocation logic.
521
- *
522
- * @param vnodes a list of virtual DOM nodes to remove
523
- * @param startIdx the index at which to start removing nodes (inclusive)
524
- * @param endIdx the index at which to stop removing nodes (inclusive)
525
- * @param vnode a VNode
526
- * @param elm an element
527
- */
528
469
  const removeVnodes = (vnodes, startIdx, endIdx, vnode, elm) => {
529
470
  for (; startIdx <= endIdx; ++startIdx) {
530
471
  if ((vnode = vnodes[startIdx])) {
@@ -717,8 +658,7 @@ const updateChildren = (parentElm, oldCh, newVNode, newCh) => {
717
658
  *
718
659
  * So, in other words, if `key` attrs are not set on VNodes which may be
719
660
  * changing order within a `children` array or something along those lines then
720
- * we could obtain a false negative and then have to do needless re-rendering
721
- * (i.e. we'd say two VNodes aren't equal when in fact they should be).
661
+ * we could obtain a false positive and then have to do needless re-rendering.
722
662
  *
723
663
  * @param leftVNode the first VNode to check
724
664
  * @param rightVNode the second VNode to check
@@ -788,18 +728,6 @@ const callNodeRefs = (vNode) => {
788
728
  vNode.$children$ && vNode.$children$.map(callNodeRefs);
789
729
  }
790
730
  };
791
- /**
792
- * The main entry point for Stencil's virtual DOM-based rendering engine
793
- *
794
- * Given a {@link d.HostRef} container and some virtual DOM nodes, this
795
- * function will handle creating a virtual DOM tree with a single root, patching
796
- * the current virtual DOM tree onto an old one (if any), dealing with slot
797
- * relocation, and reflecting attributes.
798
- *
799
- * @param hostRef data needed to root and render the virtual DOM tree, such as
800
- * the DOM node into which it should be rendered.
801
- * @param renderFnResults the virtual DOM nodes to be rendered
802
- */
803
731
  const renderVdom = (hostRef, renderFnResults) => {
804
732
  const hostElm = hostRef.$hostElement$;
805
733
  const oldVNode = hostRef.$vnode$ || newVNode(null, null);
@@ -1272,7 +1200,6 @@ const disconnectedCallback = (elm) => {
1272
1200
  }
1273
1201
  };
1274
1202
  const bootstrapLazy = (lazyBundles, options = {}) => {
1275
- var _a;
1276
1203
  const endBootstrap = createTime();
1277
1204
  const cmpTags = [];
1278
1205
  const exclude = options.exclude || [];
@@ -1352,11 +1279,6 @@ const bootstrapLazy = (lazyBundles, options = {}) => {
1352
1279
  {
1353
1280
  visibilityStyle.innerHTML = cmpTags + HYDRATED_CSS;
1354
1281
  visibilityStyle.setAttribute('data-styles', '');
1355
- // Apply CSP nonce to the style tag if it exists
1356
- const nonce = (_a = plt.$nonce$) !== null && _a !== void 0 ? _a : queryNonceMetaTagContent(doc);
1357
- if (nonce != null) {
1358
- visibilityStyle.setAttribute('nonce', nonce);
1359
- }
1360
1282
  head.insertBefore(visibilityStyle, metaCharset ? metaCharset.nextSibling : head.firstChild);
1361
1283
  }
1362
1284
  // Process deferred connectedCallbacks now all components have been registered
@@ -1406,13 +1328,6 @@ const getHostListenerTarget = (elm, flags) => {
1406
1328
  };
1407
1329
  // prettier-ignore
1408
1330
  const hostListenerOpts = (flags) => (flags & 2 /* LISTENER_FLAGS.Capture */) !== 0;
1409
- /**
1410
- * Assigns the given value to the nonce property on the runtime platform object.
1411
- * During runtime, this value is used to set the nonce attribute on all dynamically created script and style tags.
1412
- * @param nonce The value to be assigned to the platform nonce property.
1413
- * @returns void
1414
- */
1415
- const setNonce = (nonce) => (plt.$nonce$ = nonce);
1416
1331
  const hostRefs = /*@__PURE__*/ new WeakMap();
1417
1332
  const getHostRef = (ref) => hostRefs.get(ref);
1418
1333
  const registerInstance = (lazyInstance, hostRef) => hostRefs.set((hostRef.$lazyInstance$ = lazyInstance), hostRef);
@@ -1527,4 +1442,3 @@ exports.getElement = getElement;
1527
1442
  exports.h = h;
1528
1443
  exports.promiseResolve = promiseResolve;
1529
1444
  exports.registerInstance = registerInstance;
1530
- exports.setNonce = setNonce;
@@ -2,10 +2,10 @@
2
2
 
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
- const index = require('./index-bf39be87.js');
5
+ const index = require('./index-61cd741f.js');
6
6
 
7
7
  /*
8
- Stencil Client Patch Esm v2.22.3 | MIT Licensed | https://stenciljs.com
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-standalone-input.cjs",[[2,"tttx-standalone-input",{"label":[1],"valid":[4],"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],"isfocused":[32]}]]],["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);
17
+ return index.bootstrapLazy([["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",[[2,"tttx-standalone-input",{"label":[1],"valid":[4],"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],"isfocused":[32]}]]],["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-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"]]]]],["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-bf39be87.js');
5
+ const index = require('./index-61cd741f.js');
6
6
 
7
7
  const tttxButtonCss = ".material-symbols-rounded{font-variation-settings:\"FILL\" 1, \"wght\" 400, \"GRAD\" 0, \"opsz\" 24}.button{height:36px;padding:8px 16px;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:hover{background:#f0f0f0}.button:active{background:#e3e3e3}.primary-blue{background:#1479c6;border:1px solid #1479c6;color:white}.primary-blue:hover{background:#1169ba}.primary-blue:active{background:#0951a8}.secondary-white{background:white;border:1px solid #212121}:host{display:inline-block}.spacingleft{margin-left:8px}.font-white{color:white}.font-black{color:#212121}";
8
8
 
@@ -2,7 +2,7 @@
2
2
 
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
- const index = require('./index-bf39be87.js');
5
+ const index = require('./index-61cd741f.js');
6
6
 
7
7
  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}";
8
8
 
@@ -2,7 +2,7 @@
2
2
 
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
- const index = require('./index-bf39be87.js');
5
+ const index = require('./index-61cd741f.js');
6
6
 
7
7
  const tttxFormCss = ".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}.button{height:36px;padding:8px 16px;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:hover{background:#f0f0f0}.button:active{background:#e3e3e3}.primary-blue{background:#1479c6;border:1px solid #1479c6;color:white}.primary-blue:hover{background:#1169ba}.primary-blue:active{background:#0951a8}.secondary-white{background:white;border:1px solid #212121}:host{display:block}fieldset{margin:0;padding:0;border:none}input[type=submit]{margin-left:auto}";
8
8
 
@@ -2,7 +2,7 @@
2
2
 
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
- const index = require('./index-bf39be87.js');
5
+ const index = require('./index-61cd741f.js');
6
6
 
7
7
  var top = 'top';
8
8
  var bottom = 'bottom';
@@ -0,0 +1,198 @@
1
+ 'use strict';
2
+
3
+ Object.defineProperty(exports, '__esModule', { value: true });
4
+
5
+ const index = require('./index-61cd741f.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;
@@ -2,7 +2,7 @@
2
2
 
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
- const index = require('./index-bf39be87.js');
5
+ const index = require('./index-61cd741f.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-bf39be87.js');
5
+ const index = require('./index-61cd741f.js');
6
6
 
7
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
8
 
@@ -2,7 +2,7 @@
2
2
 
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
- const index = require('./index-bf39be87.js');
5
+ const index = require('./index-61cd741f.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
 
@@ -1,11 +1,9 @@
1
1
  'use strict';
2
2
 
3
- Object.defineProperty(exports, '__esModule', { value: true });
4
-
5
- const index = require('./index-bf39be87.js');
3
+ const index = require('./index-61cd741f.js');
6
4
 
7
5
  /*
8
- Stencil Client Patch Browser v2.22.3 | MIT Licensed | https://stenciljs.com
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-standalone-input.cjs",[[2,"tttx-standalone-input",{"label":[1],"valid":[4],"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],"isfocused":[32]}]]],["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);
18
+ return index.bootstrapLazy([["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",[[2,"tttx-standalone-input",{"label":[1],"valid":[4],"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],"isfocused":[32]}]]],["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-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"]]]]],["tttx-loading-spinner.cjs",[[1,"tttx-loading-spinner",{"loadingMessage":[1028,"loading-message"],"size":[1025]}]]]], options);
21
19
  });
22
-
23
- exports.setNonce = index.setNonce;
@@ -6,12 +6,13 @@
6
6
  "./components/atoms/tttx-loading-spinner/tttx-loading-spinner.js",
7
7
  "./components/atoms/tttx-popover-content/tttx-popover-content.js",
8
8
  "./components/atoms/ttx-checkbox/tttx-checkbox.js",
9
- "./components/molecules/tttx-form/tttx-form.js"
9
+ "./components/molecules/tttx-form/tttx-form.js",
10
+ "./components/molecules/tttx-list/tttx-list.js"
10
11
  ],
11
12
  "compiler": {
12
13
  "name": "@stencil/core",
13
- "version": "2.22.3",
14
- "typescriptVersion": "4.9.4"
14
+ "version": "2.20.0",
15
+ "typescriptVersion": "4.8.4"
15
16
  },
16
17
  "collections": [],
17
18
  "bundles": []
@@ -0,0 +1,56 @@
1
+ .material-symbols-rounded {
2
+ font-variation-settings: "FILL" 1, "wght" 400, "GRAD" 0, "opsz" 24;
3
+ }
4
+
5
+ .material-symbols-rounded {
6
+ font-family: "Material Symbols Rounded", sans-serif;
7
+ font-weight: 400;
8
+ font-style: normal;
9
+ font-size: 24px;
10
+ line-height: 1;
11
+ letter-spacing: normal;
12
+ text-transform: none;
13
+ display: inline-block;
14
+ white-space: nowrap;
15
+ word-wrap: normal;
16
+ direction: ltr;
17
+ text-rendering: optimizeLegibility;
18
+ -webkit-font-smoothing: antialiased;
19
+ color: #9e9e9e;
20
+ }
21
+
22
+ :host {
23
+ display: flex;
24
+ flex-direction: column;
25
+ }
26
+
27
+ .tttx-list__row {
28
+ min-height: 52px;
29
+ line-height: 36px;
30
+ padding: 8px;
31
+ display: flex;
32
+ flex-direction: row;
33
+ align-items: center;
34
+ cursor: pointer;
35
+ border-bottom: 1px solid #d5d5d5;
36
+ }
37
+ .tttx-list__row .generic-template__content {
38
+ width: 100%;
39
+ display: flex;
40
+ align-items: center;
41
+ gap: 8px;
42
+ }
43
+ .tttx-list__row:first-of-type {
44
+ border-top: 1px solid #d5d5d5;
45
+ }
46
+ .tttx-list__row:focus, .tttx-list__row:active {
47
+ background-color: #e6e6e6;
48
+ }
49
+ .tttx-list__row.selected {
50
+ background-color: #e7f1f9;
51
+ }
52
+
53
+ .load-indicator {
54
+ display: flex;
55
+ justify-content: center;
56
+ }