@3t-transform/threeteeui 0.1.37 → 0.1.41

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 (125) hide show
  1. package/dist/cjs/domsanitiser.options-277161b9.js +1667 -0
  2. package/dist/cjs/{index-457ca775.js → index-76f14107.js} +2 -88
  3. package/dist/cjs/loader.cjs.js +2 -3
  4. package/dist/cjs/tttx-button.cjs.entry.js +25 -25
  5. package/dist/cjs/tttx-filter.cjs.entry.js +159 -159
  6. package/dist/cjs/tttx-form.cjs.entry.js +457 -373
  7. package/dist/cjs/tttx-icon.cjs.entry.js +11 -11
  8. package/dist/cjs/tttx-keyvalue-block.cjs.entry.js +59 -59
  9. package/dist/cjs/tttx-list.cjs.entry.js +32 -1694
  10. package/dist/cjs/tttx-loading-spinner.cjs.entry.js +16 -16
  11. package/dist/cjs/tttx-sorter.cjs.entry.js +102 -102
  12. package/dist/cjs/tttx-standalone-input.cjs.entry.js +79 -79
  13. package/dist/cjs/tttx-toolbar.cjs.entry.js +10 -10
  14. package/dist/cjs/tttx.cjs.js +2 -6
  15. package/dist/collection/collection-manifest.json +2 -2
  16. package/dist/collection/components/atoms/tttx-button/tttx-button.css +4 -4
  17. package/dist/collection/components/atoms/tttx-button/tttx-button.js +110 -110
  18. package/dist/collection/components/atoms/tttx-button/tttx-button.stories.js +14 -14
  19. package/dist/collection/components/atoms/tttx-icon/tttx-icon.js +62 -62
  20. package/dist/collection/components/atoms/tttx-icon/tttx-icon.stories.js +22 -22
  21. package/dist/collection/components/atoms/tttx-keyvalue-block/tttx-keyvalue-block.js +109 -109
  22. package/dist/collection/components/atoms/tttx-keyvalue-block/tttx-keyvalue-block.stories.js +38 -38
  23. package/dist/collection/components/atoms/tttx-loading-spinner/tttx-loading-spinner.js +67 -67
  24. package/dist/collection/components/atoms/tttx-loading-spinner/tttx-loading-spinner.stories.js +17 -17
  25. package/dist/collection/components/molecules/tttx-filter/tttx-filter.js +334 -334
  26. package/dist/collection/components/molecules/tttx-filter/tttx-filter.stories.js +62 -62
  27. package/dist/collection/components/molecules/tttx-form/lib/setErrorState.js +37 -37
  28. package/dist/collection/components/molecules/tttx-form/lib/validityCheck.js +61 -58
  29. package/dist/collection/components/molecules/tttx-form/tttx-form.css +98 -2
  30. package/dist/collection/components/molecules/tttx-form/tttx-form.js +477 -393
  31. package/dist/collection/components/molecules/tttx-form/tttx-form.stories.js +274 -218
  32. package/dist/collection/components/molecules/tttx-list/tttx-list.js +105 -105
  33. package/dist/collection/components/molecules/tttx-list/tttx-list.stories.js +43 -43
  34. package/dist/collection/components/molecules/tttx-sorter/tttx-sorter.js +224 -224
  35. package/dist/collection/components/molecules/tttx-sorter/tttx-sorter.stories.js +42 -42
  36. package/dist/collection/components/molecules/tttx-standalone-input/tttx-standalone-input.js +759 -759
  37. package/dist/collection/components/molecules/tttx-standalone-input/tttx-standalone-input.stories.js +172 -172
  38. package/dist/collection/components/molecules/tttx-toolbar/tttx-toolbar.js +44 -44
  39. package/dist/collection/components/molecules/tttx-toolbar/tttx-toolbar.stories.js +14 -14
  40. package/dist/collection/components/palette.stories.js +7 -7
  41. package/dist/collection/docs/gettingstarted-developer.stories.js +5 -5
  42. package/dist/collection/icons.js +2838 -2838
  43. package/dist/collection/index.js +1 -1
  44. package/dist/collection/shared/domsanitiser.options.js +14 -14
  45. package/dist/components/domsanitiser.options.js +1664 -0
  46. package/dist/components/index.d.ts +0 -9
  47. package/dist/components/index.js +1 -1
  48. package/dist/components/tttx-button.js +49 -49
  49. package/dist/components/tttx-filter.js +191 -191
  50. package/dist/components/tttx-form.js +475 -391
  51. package/dist/components/tttx-icon2.js +28 -28
  52. package/dist/components/tttx-keyvalue-block.js +76 -76
  53. package/dist/components/tttx-list.js +54 -1716
  54. package/dist/components/tttx-loading-spinner.js +33 -33
  55. package/dist/components/tttx-sorter.js +130 -130
  56. package/dist/components/tttx-standalone-input.js +130 -130
  57. package/dist/components/tttx-toolbar.js +26 -26
  58. package/dist/esm/domsanitiser.options-cc420431.js +1664 -0
  59. package/dist/esm/{index-d784fb3e.js → index-9cde46a5.js} +3 -88
  60. package/dist/esm/loader.js +2 -3
  61. package/dist/esm/polyfills/core-js.js +0 -0
  62. package/dist/esm/polyfills/css-shim.js +1 -1
  63. package/dist/esm/polyfills/dom.js +0 -0
  64. package/dist/esm/polyfills/es5-html-element.js +0 -0
  65. package/dist/esm/polyfills/index.js +0 -0
  66. package/dist/esm/polyfills/system.js +0 -0
  67. package/dist/esm/tttx-button.entry.js +25 -25
  68. package/dist/esm/tttx-filter.entry.js +159 -159
  69. package/dist/esm/tttx-form.entry.js +457 -373
  70. package/dist/esm/tttx-icon.entry.js +11 -11
  71. package/dist/esm/tttx-keyvalue-block.entry.js +59 -59
  72. package/dist/esm/tttx-list.entry.js +32 -1694
  73. package/dist/esm/tttx-loading-spinner.entry.js +16 -16
  74. package/dist/esm/tttx-sorter.entry.js +102 -102
  75. package/dist/esm/tttx-standalone-input.entry.js +79 -79
  76. package/dist/esm/tttx-toolbar.entry.js +10 -10
  77. package/dist/esm/tttx.js +2 -3
  78. package/dist/tttx/{p-400868f1.entry.js → p-3b1be372.entry.js} +1 -1
  79. package/dist/tttx/{p-563605b2.entry.js → p-561224f5.entry.js} +1 -1
  80. package/dist/tttx/{p-b720c4ad.entry.js → p-9f1e9cc1.entry.js} +1 -1
  81. package/dist/tttx/{p-798a098a.entry.js → p-aef96333.entry.js} +1 -1
  82. package/dist/tttx/p-b4290a5b.js +3 -0
  83. package/dist/tttx/p-bd1edaed.entry.js +1 -0
  84. package/dist/tttx/p-d0ff9ad0.entry.js +1 -0
  85. package/dist/tttx/{p-cac26a1b.entry.js → p-d2f1aa8e.entry.js} +1 -1
  86. package/dist/tttx/p-db059a69.js +2 -0
  87. package/dist/tttx/p-dc2a37b0.entry.js +1 -0
  88. package/dist/tttx/{p-ab6ce9f6.entry.js → p-e53c7f9d.entry.js} +1 -1
  89. package/dist/tttx/{p-92cade7f.entry.js → p-f885f17a.entry.js} +1 -1
  90. package/dist/tttx/tttx.esm.js +1 -1
  91. package/dist/types/components/atoms/tttx-button/tttx-button.d.ts +10 -10
  92. package/dist/types/components/atoms/tttx-button/tttx-button.stories.d.ts +10 -10
  93. package/dist/types/components/atoms/tttx-icon/tttx-icon.d.ts +5 -5
  94. package/dist/types/components/atoms/tttx-icon/tttx-icon.stories.d.ts +20 -20
  95. package/dist/types/components/atoms/tttx-keyvalue-block/tttx-keyvalue-block.d.ts +7 -7
  96. package/dist/types/components/atoms/tttx-keyvalue-block/tttx-keyvalue-block.stories.d.ts +9 -9
  97. package/dist/types/components/atoms/tttx-loading-spinner/tttx-loading-spinner.d.ts +6 -6
  98. package/dist/types/components/atoms/tttx-loading-spinner/tttx-loading-spinner.stories.d.ts +17 -17
  99. package/dist/types/components/molecules/tttx-filter/tttx-filter.d.ts +39 -39
  100. package/dist/types/components/molecules/tttx-filter/tttx-filter.stories.d.ts +68 -68
  101. package/dist/types/components/molecules/tttx-form/lib/setErrorState.d.ts +13 -13
  102. package/dist/types/components/molecules/tttx-form/lib/validityCheck.d.ts +17 -17
  103. package/dist/types/components/molecules/tttx-form/tttx-form.d.ts +133 -111
  104. package/dist/types/components/molecules/tttx-form/tttx-form.stories.d.ts +278 -13
  105. package/dist/types/components/molecules/tttx-list/tttx-list.d.ts +11 -11
  106. package/dist/types/components/molecules/tttx-list/tttx-list.stories.d.ts +14 -14
  107. package/dist/types/components/molecules/tttx-sorter/tttx-sorter.d.ts +19 -19
  108. package/dist/types/components/molecules/tttx-sorter/tttx-sorter.stories.d.ts +30 -30
  109. package/dist/types/components/molecules/tttx-standalone-input/tttx-standalone-input.d.ts +69 -69
  110. package/dist/types/components/molecules/tttx-standalone-input/tttx-standalone-input.stories.d.ts +143 -143
  111. package/dist/types/components/molecules/tttx-toolbar/tttx-toolbar.d.ts +4 -4
  112. package/dist/types/components/molecules/tttx-toolbar/tttx-toolbar.stories.d.ts +13 -13
  113. package/dist/types/components/palette.stories.d.ts +6 -6
  114. package/dist/types/components.d.ts +1 -1
  115. package/dist/types/docs/gettingstarted-developer.stories.d.ts +5 -5
  116. package/dist/types/icons.d.ts +2 -2
  117. package/dist/types/index.d.ts +1 -1
  118. package/dist/types/shared/domsanitiser.options.d.ts +10 -10
  119. package/dist/types/stencil-public-runtime.d.ts +3 -59
  120. package/loader/index.d.ts +0 -9
  121. package/package.json +1 -1
  122. package/dist/tttx/p-0ebffdfc.js +0 -2
  123. package/dist/tttx/p-72e7f7dd.entry.js +0 -3
  124. package/dist/tttx/p-c4162029.entry.js +0 -1
  125. package/dist/tttx/p-eb126fd0.entry.js +0 -1
@@ -22,15 +22,6 @@ export { TttxToolbar as TttxToolbar } from '../types/components/molecules/tttx-t
22
22
  */
23
23
  export declare const setAssetPath: (path: string) => void;
24
24
 
25
- /**
26
- * Used to specify a nonce value that corresponds with an application's CSP.
27
- * When set, the nonce will be added to all dynamically created script and style tags at runtime.
28
- * Alternatively, the nonce value can be set on a meta tag in the DOM head
29
- * (<meta name="csp-nonce" content="{ nonce value here }" />) which
30
- * will result in the same behavior.
31
- */
32
- export declare const setNonce: (nonce: string) => void
33
-
34
25
  export interface SetPlatformOptions {
35
26
  raf?: (c: FrameRequestCallback) => number;
36
27
  ael?: (el: EventTarget, eventName: string, listener: EventListenerOrEventListenerObject, options: boolean | AddEventListenerOptions) => void;
@@ -1,4 +1,4 @@
1
- export { setAssetPath, setNonce, setPlatformOptions } from '@stencil/core/internal/client';
1
+ export { setAssetPath, setPlatformOptions } from '@stencil/core/internal/client';
2
2
  export { TttxButton, defineCustomElement as defineCustomElementTttxButton } from './tttx-button.js';
3
3
  export { TttxFilter, defineCustomElement as defineCustomElementTttxFilter } from './tttx-filter.js';
4
4
  export { TttxForm, defineCustomElement as defineCustomElementTttxForm } from './tttx-form.js';
@@ -1,56 +1,56 @@
1
1
  import { proxyCustomElement, HTMLElement, h, Host } from '@stencil/core/internal/client';
2
2
  import { d as defineCustomElement$2 } from './tttx-icon2.js';
3
3
 
4
- 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}button{cursor:pointer}tttx-icon{cursor:inherit}.spacingleft{margin-left:8px}";
4
+ const tttxButtonCss = ".material-symbols-rounded{font-variation-settings:\"FILL\" 1, \"wght\" 400, \"GRAD\" 0, \"opsz\" 24}button{cursor:pointer}.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}tttx-icon{cursor:inherit}.spacingleft{margin-left:8px}";
5
5
 
6
- const TttxButton$1 = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
7
- constructor() {
8
- super();
9
- this.__registerHost();
10
- this.__attachShadow();
11
- this._iconcolor = 'black';
12
- this.notext = undefined;
13
- this.icon = undefined;
14
- this.iconposition = 'left';
15
- this.design = 'default';
16
- }
17
- componentWillLoad() {
18
- this._design = this.design;
19
- const designs = ['primary', 'default', 'disabled', 'danger', 'borderless'];
20
- if (!designs.includes(this.design)) {
21
- this._design = 'default';
22
- }
23
- if (this._design === 'primary' || this._design === 'danger') {
24
- this._iconcolor = 'white';
25
- }
26
- }
27
- render() {
28
- return (h(Host, null, h("button", { class: `button ${this._design} ${this.icon ? 'withicon' : ''} ${this.icon && this.iconposition ? 'icon' + this.iconposition : ''} ${this.notext ? 'notext' : ''}` }, this.icon && this.iconposition === 'left' && (h("div", { class: "icon-left" }, h("tttx-icon", { icon: this.icon, color: this._iconcolor }))), !this.notext && h("div", { class: "button-content" }, h("slot", null)), this.icon && this.iconposition === 'right' && (h("div", { class: "icon-right" }, h("tttx-icon", { icon: this.icon, color: this._iconcolor }))))));
29
- }
30
- static get style() { return tttxButtonCss; }
31
- }, [1, "tttx-button", {
32
- "notext": [4],
33
- "icon": [1],
34
- "iconposition": [1],
35
- "design": [1]
36
- }]);
37
- function defineCustomElement$1() {
38
- if (typeof customElements === "undefined") {
39
- return;
40
- }
41
- const components = ["tttx-button", "tttx-icon"];
42
- components.forEach(tagName => { switch (tagName) {
43
- case "tttx-button":
44
- if (!customElements.get(tagName)) {
45
- customElements.define(tagName, TttxButton$1);
46
- }
47
- break;
48
- case "tttx-icon":
49
- if (!customElements.get(tagName)) {
50
- defineCustomElement$2();
51
- }
52
- break;
53
- } });
6
+ const TttxButton$1 = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
7
+ constructor() {
8
+ super();
9
+ this.__registerHost();
10
+ this.__attachShadow();
11
+ this._iconcolor = 'black';
12
+ this.notext = undefined;
13
+ this.icon = undefined;
14
+ this.iconposition = 'left';
15
+ this.design = 'default';
16
+ }
17
+ componentWillLoad() {
18
+ this._design = this.design;
19
+ const designs = ['primary', 'default', 'disabled', 'danger', 'borderless'];
20
+ if (!designs.includes(this.design)) {
21
+ this._design = 'default';
22
+ }
23
+ if (this._design === 'primary' || this._design === 'danger') {
24
+ this._iconcolor = 'white';
25
+ }
26
+ }
27
+ render() {
28
+ return (h(Host, null, h("button", { class: `button ${this._design} ${this.icon ? 'withicon' : ''} ${this.icon && this.iconposition ? 'icon' + this.iconposition : ''} ${this.notext ? 'notext' : ''}` }, this.icon && this.iconposition === 'left' && (h("div", { class: "icon-left" }, h("tttx-icon", { icon: this.icon, color: this._iconcolor }))), !this.notext && h("div", { class: "button-content" }, h("slot", null)), this.icon && this.iconposition === 'right' && (h("div", { class: "icon-right" }, h("tttx-icon", { icon: this.icon, color: this._iconcolor }))))));
29
+ }
30
+ static get style() { return tttxButtonCss; }
31
+ }, [1, "tttx-button", {
32
+ "notext": [4],
33
+ "icon": [1],
34
+ "iconposition": [1],
35
+ "design": [1]
36
+ }]);
37
+ function defineCustomElement$1() {
38
+ if (typeof customElements === "undefined") {
39
+ return;
40
+ }
41
+ const components = ["tttx-button", "tttx-icon"];
42
+ components.forEach(tagName => { switch (tagName) {
43
+ case "tttx-button":
44
+ if (!customElements.get(tagName)) {
45
+ customElements.define(tagName, TttxButton$1);
46
+ }
47
+ break;
48
+ case "tttx-icon":
49
+ if (!customElements.get(tagName)) {
50
+ defineCustomElement$2();
51
+ }
52
+ break;
53
+ } });
54
54
  }
55
55
 
56
56
  const TttxButton = TttxButton$1;
@@ -3,197 +3,197 @@ import { d as defineCustomElement$2 } from './tttx-icon2.js';
3
3
 
4
4
  const tttxFilterCss = ".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}.filter-container{background-color:white;position:relative}.filter-container .filter-button{display:inline-flex;justify-content:center;align-items:center;font-size:14px;font-weight:400;font-family:\"Roboto\", serif;text-transform:uppercase;color:#212121;border:1px solid #d5d5d5;border-radius:4px;background:transparent;height:36px;width:95px;margin:0;padding-right:16px}@media (max-width: 475px){.filter-container .filter-button{padding-left:4px}}.filter-container .filter-button .filter-icon{padding-left:8px;padding-right:4px}.filter-container .filter-button.--list-icon{font-size:0;width:36px;height:36px;padding:0}.filter-container .filter-button.--list-icon .filter-icon{padding:0}.filter-container .filter-button.--list-icon:hover{background:#e3e3e3}.filter-container .filter-button.--table-icon{font-size:0;width:36px;height:36px;padding:0;border:none}.filter-container .filter-button.--table-icon .filter-icon{padding:0;width:24px;height:24px}.filter-container .filter-button.--table-icon:hover{background:#e3e3e3;border-radius:50%;width:36px;height:36px}.filter-container .filter-button:hover{background:#e3e3e3}.filter-container .filter-popover-container{display:flex;flex-direction:column;gap:8px;border-radius:4px;box-shadow:0px 1px 5px #1111114D;position:absolute;top:36px;left:0px;background-color:white;padding:0 16px}.filter-container .filter-popover-container .filter-header{color:#757575;text-transform:uppercase;font-size:14px;font-weight:500;font-family:\"Roboto\", serif;padding:12px 0}.filter-container .filter-popover-container .filter-options-container{display:flex;flex-direction:column;gap:4px;border-top:1px solid #d5d5d5;border-bottom:1px solid #d5d5d5}.filter-container .filter-popover-container .filter-option{display:flex;flex-direction:row;align-items:center;min-height:36px;padding-left:8px}.filter-container .filter-popover-container .filter-option .select-all-icon{padding-right:6px}.filter-container .filter-popover-container .filter-option .checkbox-icon{padding-right:8px}.filter-container .filter-popover-container .filter-option .filter-label{padding-left:8px;padding-bottom:3px;font-size:16px;font-weight:500;font-family:\"Roboto\", serif}.filter-container .filter-popover-container .filter-option:first-child{padding-top:8px}.filter-container .filter-popover-container .filter-popover-button-container{display:flex;justify-content:flex-end;align-items:center;padding-bottom:8px}.filter-container .filter-popover-container .filter-popover-button-container .close-button{height:36px;width:74px;background-color:white;border:1px solid #d5d5d5;border-radius:4px;text-transform:uppercase;margin-right:8px;font-size:14px;font-weight:400;font-family:\"Roboto\", serif;color:#212121}.filter-container .filter-popover-container .filter-popover-button-container .apply-button{height:36px;width:73px;background-color:#1479c6;color:white;border-radius:4px;border:none;text-transform:uppercase;font-size:14px;font-weight:400;font-family:\"Roboto\", serif}.filter-container .filter-popover-container.--with-search-field .filter-header{border-bottom:1px solid #d5d5d5}.filter-container .filter-popover-container.--with-search-field .search-field-container{position:relative;color:#d5d5d5;height:36px}.filter-container .filter-popover-container.--with-search-field .search-field-container .search-icon{position:absolute;top:6px;left:8px}.filter-container .filter-popover-container.--with-search-field .search-field-container .search-input{padding-left:36px;border:1px solid #d5d5d5;border-radius:4px;height:36px;font-size:16px;font-family:\"Roboto\", serif;font-weight:500;box-sizing:border-box}.filter-container .filter-popover-container.--with-search-field .search-field-container .search-input:focus-visible,.filter-container .filter-popover-container.--with-search-field .search-field-container .search-input:focus{outline:none;border:1px solid #1479c6}.filter-container .filter-popover-container.--with-search-field .search-field-container .search-input::placeholder{color:#9e9e9e;font-size:16px;font-family:\"Roboto\", serif;font-weight:500}";
5
5
 
6
- const TttxFilter$1 = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
7
- constructor() {
8
- super();
9
- this.__registerHost();
10
- this.__attachShadow();
11
- this.filterChangeEvent = createEvent(this, "filterChangeEvent", 7);
12
- this.filterKey = undefined;
13
- this.filterOptions = [
14
- { optionIcon: 'cancel', optionIconColor: 'darkred', optionText: 'Expired' },
15
- { optionIcon: 'warning', optionIconColor: 'orange', optionText: 'Expiring soon' },
16
- { optionIcon: 'check_circle', optionIconColor: 'green', optionText: 'Active' },
17
- ];
18
- this.showSelectAll = true;
19
- this.showSearchField = false;
20
- this.showOptionIcons = true;
21
- this.filterButtonStyle = 'list filter';
22
- this.filterHeader = 'Qualification status';
23
- this.showPopover = false;
24
- this.displayedFilterSettings = undefined;
25
- this.selectedFilters = undefined;
26
- this.filterSearchTerm = '';
27
- this.allSelected = true;
28
- }
29
- emitFilterEvent() {
30
- this.filterChangeEvent.emit({
31
- selectedFilters: this.selectedFilters,
32
- filterKey: this.filterKey,
33
- allSelected: this.allSelected,
34
- });
35
- }
36
- onFilterButtonClick() {
37
- this.togglePopover();
38
- }
39
- onCloseButtonClick() {
40
- this.togglePopover();
41
- }
42
- onApplyFilterButtonClick() {
43
- this.emitFilterEvent();
44
- this.togglePopover();
45
- }
46
- onFilterOptionSelected(selectedOption) {
47
- this.allSelected = false;
48
- if (this.selectedFilters.includes(selectedOption)) {
49
- this.selectedFilters = this.selectedFilters.filter((filter) => filter != selectedOption);
50
- }
51
- else {
52
- this.selectedFilters = [...this.selectedFilters, selectedOption];
53
- }
54
- }
55
- componentWillLoad() {
56
- this.displayedFilterSettings = this.parseFilterOptions();
57
- this.selectedFilters = this.displayedFilterSettings.map((filterOption) => filterOption.optionText);
58
- }
59
- togglePopover() {
60
- this.showPopover = !this.showPopover;
61
- // if(!this.showPopover) {
62
- // // this._focussedElementIndex = -1;
63
- // }
64
- }
65
- // Commented out keyboard interaction for now
66
- // @Listen('keyup')
67
- // handleKeyUp(event: KeyboardEvent) {
68
- // const keyboardEventValue = event.key;
69
- // if (document.activeElement.id != `filter__${this.filterKey}`) return;
70
- // if (event.key == " " || event.code == "Space" || event.keyCode == 32) {
71
- // if (this._focussedElementIndex == 0) {
72
- // this.onSelectAllClick()
73
- // } else {
74
- // const options = this.el.shadowRoot.querySelectorAll('.filter-option') as HTMLElement[];
75
- // this.onFilterOptionSelected(options[this._focussedElementIndex].textContent)
76
- // }
77
- // return;
78
- // }
79
- // switch (keyboardEventValue) {
80
- // case 'Enter':
81
- // if(!this.showPopover) {
82
- // this.showPopover=true
83
- // } else {
84
- // this.emitFilterEvent()
85
- // }
86
- // break;
87
- // case 'Escape':
88
- // this.showPopover = false;
89
- // this._focussedElementIndex = -1;
90
- // break;
91
- // case 'ArrowDown':
92
- // this.showPopover = true;
93
- // if (this._focussedElementIndex == -1) {
94
- // this._focussedElementIndex = 0;
95
- // } else {
96
- // const options = this.el.shadowRoot.querySelectorAll('.filter-option') as HTMLElement[];
97
- // const currentOption = options[this._focussedElementIndex] as HTMLElement;
98
- // currentOption.blur();
99
- // // options[this._focussedElementIndex].focus();
100
- // this._focussedElementIndex + 1 < options.length ? this._focussedElementIndex++ : (this._focussedElementIndex = 0);
101
- // }
102
- // break;
103
- // case 'ArrowUp':
104
- // if (this._focussedElementIndex == -1) {
105
- // this.showPopover = true;
106
- // this._focussedElementIndex = 0;
107
- // } else {
108
- // const options = this.el.shadowRoot.querySelectorAll('.filter-option') as HTMLElement[];
109
- // const currentOption = options[this._focussedElementIndex] as HTMLElement;
110
- // currentOption.blur();
111
- // // options[this._focussedElementIndex].focus();
112
- // this._focussedElementIndex > 0 ? this._focussedElementIndex-- : (this._focussedElementIndex = options.length - 1);
113
- // }
114
- // break;
115
- // }
116
- // }
117
- handleFilterChange(event) {
118
- const target = event.target;
119
- this.filterSearchTerm = target.value;
120
- const filteredResults = this.parseFilterOptions().filter((filterOption) => {
121
- const lowercaseOption = filterOption.optionText.toLowerCase();
122
- const filterTerm = this.filterSearchTerm.toLowerCase();
123
- return lowercaseOption.includes(filterTerm);
124
- });
125
- this.displayedFilterSettings = filteredResults;
126
- }
127
- onSelectAllClick() {
128
- this.allSelected = !this.allSelected;
129
- if (this.allSelected) {
130
- this.displayedFilterSettings.forEach((filterSetting) => { this.selectedFilters = [...this.selectedFilters, filterSetting.optionText]; });
131
- }
132
- else {
133
- this.selectedFilters = [];
134
- }
135
- }
136
- getFilterButtonClassName(buttonStyle) {
137
- switch (buttonStyle) {
138
- case 'table icon': {
139
- return '--table-icon';
140
- }
141
- case 'list icon': {
142
- return '--list-icon';
143
- }
144
- default: {
145
- return '';
146
- }
147
- }
148
- }
149
- parseFilterOptions() {
150
- return typeof this.filterOptions === 'string' ? JSON.parse(this.filterOptions) : this.filterOptions;
151
- }
152
- render() {
153
- const filterPopoverContainerClassNameModifier = this.showSearchField ? '--with-search-field' : '';
154
- const selectAllCheckboxIcon = this.allSelected ? 'check_box' : 'check_box_outline_blank';
155
- const selectAllCheckboxColor = this.allSelected ? 'blue' : 'grey';
156
- const buttonStyleClassNameModifier = this.getFilterButtonClassName(this.filterButtonStyle);
157
- const filterKey = `filter__${this.filterKey}`;
158
- return (h(Host, { id: filterKey }, h("div", { class: 'filter-container' }, h("button", { class: `filter-button ${buttonStyleClassNameModifier}`, type: 'button', onClick: this.onFilterButtonClick.bind(this) }, h("tttx-icon", { icon: 'filter_list', class: 'filter-icon', color: 'black' }), "Filter"), this.showPopover && (h("div", { class: `filter-popover-container ${filterPopoverContainerClassNameModifier}` }, h("div", { class: 'filter-header' }, this.filterHeader), this.showSearchField ? (h("div", { class: 'search-field-container' }, h("tttx-icon", { icon: 'search', class: 'search-icon' }), h("input", { type: 'text', class: 'search-input', placeholder: 'Search', value: this.filterSearchTerm, onInput: this.handleFilterChange.bind(this) }))) : (''), h("div", { class: 'filter-options-container' }, this.showSelectAll ? (h("div", { class: 'filter-option', tabIndex: -1, onClick: this.onSelectAllClick.bind(this) }, h("tttx-icon", { icon: selectAllCheckboxIcon, color: selectAllCheckboxColor, class: 'select-all-icon' }), h("label", { class: 'filter-label' }, "Select all"))) : (''), this.displayedFilterSettings.map((option) => {
159
- const checkboxIcon = this.selectedFilters.includes(option.optionText) ? 'check_box' : 'check_box_outline_blank';
160
- const checkboxColor = this.selectedFilters.includes(option.optionText) ? 'blue' : 'grey';
161
- return h("div", { class: 'filter-option', tabIndex: -1, onClick: () => this.onFilterOptionSelected(option.optionText), key: option.optionText }, h("tttx-icon", { icon: checkboxIcon, color: checkboxColor, class: 'checkbox-icon' }), this.showOptionIcons && h("tttx-icon", { icon: option.optionIcon, color: option.optionIconColor }), h("label", { class: 'filter-label' }, option.optionText));
162
- })), h("div", { class: 'filter-popover-button-container' }, h("button", { type: 'button', class: 'close-button', onClick: this.onCloseButtonClick.bind(this) }, "Close"), h("button", { type: 'button', class: 'apply-button', onClick: this.onApplyFilterButtonClick.bind(this) }, "Apply")))))));
163
- }
164
- get el() { return this; }
165
- static get style() { return tttxFilterCss; }
166
- }, [1, "tttx-filter", {
167
- "filterKey": [1, "filter-key"],
168
- "filterOptions": [1, "filter-options"],
169
- "showSelectAll": [4, "show-select-all"],
170
- "showSearchField": [4, "show-search-field"],
171
- "showOptionIcons": [4, "show-option-icons"],
172
- "filterButtonStyle": [1, "filter-button-style"],
173
- "filterHeader": [1, "filter-header"],
174
- "showPopover": [32],
175
- "displayedFilterSettings": [32],
176
- "selectedFilters": [32],
177
- "filterSearchTerm": [32],
178
- "allSelected": [32]
179
- }]);
180
- function defineCustomElement$1() {
181
- if (typeof customElements === "undefined") {
182
- return;
183
- }
184
- const components = ["tttx-filter", "tttx-icon"];
185
- components.forEach(tagName => { switch (tagName) {
186
- case "tttx-filter":
187
- if (!customElements.get(tagName)) {
188
- customElements.define(tagName, TttxFilter$1);
189
- }
190
- break;
191
- case "tttx-icon":
192
- if (!customElements.get(tagName)) {
193
- defineCustomElement$2();
194
- }
195
- break;
196
- } });
6
+ const TttxFilter$1 = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
7
+ constructor() {
8
+ super();
9
+ this.__registerHost();
10
+ this.__attachShadow();
11
+ this.filterChangeEvent = createEvent(this, "filterChangeEvent", 7);
12
+ this.filterKey = undefined;
13
+ this.filterOptions = [
14
+ { optionIcon: 'cancel', optionIconColor: 'darkred', optionText: 'Expired' },
15
+ { optionIcon: 'warning', optionIconColor: 'orange', optionText: 'Expiring soon' },
16
+ { optionIcon: 'check_circle', optionIconColor: 'green', optionText: 'Active' },
17
+ ];
18
+ this.showSelectAll = true;
19
+ this.showSearchField = false;
20
+ this.showOptionIcons = true;
21
+ this.filterButtonStyle = 'list filter';
22
+ this.filterHeader = 'Qualification status';
23
+ this.showPopover = false;
24
+ this.displayedFilterSettings = undefined;
25
+ this.selectedFilters = undefined;
26
+ this.filterSearchTerm = '';
27
+ this.allSelected = true;
28
+ }
29
+ emitFilterEvent() {
30
+ this.filterChangeEvent.emit({
31
+ selectedFilters: this.selectedFilters,
32
+ filterKey: this.filterKey,
33
+ allSelected: this.allSelected,
34
+ });
35
+ }
36
+ onFilterButtonClick() {
37
+ this.togglePopover();
38
+ }
39
+ onCloseButtonClick() {
40
+ this.togglePopover();
41
+ }
42
+ onApplyFilterButtonClick() {
43
+ this.emitFilterEvent();
44
+ this.togglePopover();
45
+ }
46
+ onFilterOptionSelected(selectedOption) {
47
+ this.allSelected = false;
48
+ if (this.selectedFilters.includes(selectedOption)) {
49
+ this.selectedFilters = this.selectedFilters.filter((filter) => filter != selectedOption);
50
+ }
51
+ else {
52
+ this.selectedFilters = [...this.selectedFilters, selectedOption];
53
+ }
54
+ }
55
+ componentWillLoad() {
56
+ this.displayedFilterSettings = this.parseFilterOptions();
57
+ this.selectedFilters = this.displayedFilterSettings.map((filterOption) => filterOption.optionText);
58
+ }
59
+ togglePopover() {
60
+ this.showPopover = !this.showPopover;
61
+ // if(!this.showPopover) {
62
+ // // this._focussedElementIndex = -1;
63
+ // }
64
+ }
65
+ // Commented out keyboard interaction for now
66
+ // @Listen('keyup')
67
+ // handleKeyUp(event: KeyboardEvent) {
68
+ // const keyboardEventValue = event.key;
69
+ // if (document.activeElement.id != `filter__${this.filterKey}`) return;
70
+ // if (event.key == " " || event.code == "Space" || event.keyCode == 32) {
71
+ // if (this._focussedElementIndex == 0) {
72
+ // this.onSelectAllClick()
73
+ // } else {
74
+ // const options = this.el.shadowRoot.querySelectorAll('.filter-option') as HTMLElement[];
75
+ // this.onFilterOptionSelected(options[this._focussedElementIndex].textContent)
76
+ // }
77
+ // return;
78
+ // }
79
+ // switch (keyboardEventValue) {
80
+ // case 'Enter':
81
+ // if(!this.showPopover) {
82
+ // this.showPopover=true
83
+ // } else {
84
+ // this.emitFilterEvent()
85
+ // }
86
+ // break;
87
+ // case 'Escape':
88
+ // this.showPopover = false;
89
+ // this._focussedElementIndex = -1;
90
+ // break;
91
+ // case 'ArrowDown':
92
+ // this.showPopover = true;
93
+ // if (this._focussedElementIndex == -1) {
94
+ // this._focussedElementIndex = 0;
95
+ // } else {
96
+ // const options = this.el.shadowRoot.querySelectorAll('.filter-option') as HTMLElement[];
97
+ // const currentOption = options[this._focussedElementIndex] as HTMLElement;
98
+ // currentOption.blur();
99
+ // // options[this._focussedElementIndex].focus();
100
+ // this._focussedElementIndex + 1 < options.length ? this._focussedElementIndex++ : (this._focussedElementIndex = 0);
101
+ // }
102
+ // break;
103
+ // case 'ArrowUp':
104
+ // if (this._focussedElementIndex == -1) {
105
+ // this.showPopover = true;
106
+ // this._focussedElementIndex = 0;
107
+ // } else {
108
+ // const options = this.el.shadowRoot.querySelectorAll('.filter-option') as HTMLElement[];
109
+ // const currentOption = options[this._focussedElementIndex] as HTMLElement;
110
+ // currentOption.blur();
111
+ // // options[this._focussedElementIndex].focus();
112
+ // this._focussedElementIndex > 0 ? this._focussedElementIndex-- : (this._focussedElementIndex = options.length - 1);
113
+ // }
114
+ // break;
115
+ // }
116
+ // }
117
+ handleFilterChange(event) {
118
+ const target = event.target;
119
+ this.filterSearchTerm = target.value;
120
+ const filteredResults = this.parseFilterOptions().filter((filterOption) => {
121
+ const lowercaseOption = filterOption.optionText.toLowerCase();
122
+ const filterTerm = this.filterSearchTerm.toLowerCase();
123
+ return lowercaseOption.includes(filterTerm);
124
+ });
125
+ this.displayedFilterSettings = filteredResults;
126
+ }
127
+ onSelectAllClick() {
128
+ this.allSelected = !this.allSelected;
129
+ if (this.allSelected) {
130
+ this.displayedFilterSettings.forEach((filterSetting) => { this.selectedFilters = [...this.selectedFilters, filterSetting.optionText]; });
131
+ }
132
+ else {
133
+ this.selectedFilters = [];
134
+ }
135
+ }
136
+ getFilterButtonClassName(buttonStyle) {
137
+ switch (buttonStyle) {
138
+ case 'table icon': {
139
+ return '--table-icon';
140
+ }
141
+ case 'list icon': {
142
+ return '--list-icon';
143
+ }
144
+ default: {
145
+ return '';
146
+ }
147
+ }
148
+ }
149
+ parseFilterOptions() {
150
+ return typeof this.filterOptions === 'string' ? JSON.parse(this.filterOptions) : this.filterOptions;
151
+ }
152
+ render() {
153
+ const filterPopoverContainerClassNameModifier = this.showSearchField ? '--with-search-field' : '';
154
+ const selectAllCheckboxIcon = this.allSelected ? 'check_box' : 'check_box_outline_blank';
155
+ const selectAllCheckboxColor = this.allSelected ? 'blue' : 'grey';
156
+ const buttonStyleClassNameModifier = this.getFilterButtonClassName(this.filterButtonStyle);
157
+ const filterKey = `filter__${this.filterKey}`;
158
+ return (h(Host, { id: filterKey }, h("div", { class: 'filter-container' }, h("button", { class: `filter-button ${buttonStyleClassNameModifier}`, type: 'button', onClick: this.onFilterButtonClick.bind(this) }, h("tttx-icon", { icon: 'filter_list', class: 'filter-icon', color: 'black' }), "Filter"), this.showPopover && (h("div", { class: `filter-popover-container ${filterPopoverContainerClassNameModifier}` }, h("div", { class: 'filter-header' }, this.filterHeader), this.showSearchField ? (h("div", { class: 'search-field-container' }, h("tttx-icon", { icon: 'search', class: 'search-icon' }), h("input", { type: 'text', class: 'search-input', placeholder: 'Search', value: this.filterSearchTerm, onInput: this.handleFilterChange.bind(this) }))) : (''), h("div", { class: 'filter-options-container' }, this.showSelectAll ? (h("div", { class: 'filter-option', tabIndex: -1, onClick: this.onSelectAllClick.bind(this) }, h("tttx-icon", { icon: selectAllCheckboxIcon, color: selectAllCheckboxColor, class: 'select-all-icon' }), h("label", { class: 'filter-label' }, "Select all"))) : (''), this.displayedFilterSettings.map((option) => {
159
+ const checkboxIcon = this.selectedFilters.includes(option.optionText) ? 'check_box' : 'check_box_outline_blank';
160
+ const checkboxColor = this.selectedFilters.includes(option.optionText) ? 'blue' : 'grey';
161
+ return h("div", { class: 'filter-option', tabIndex: -1, onClick: () => this.onFilterOptionSelected(option.optionText), key: option.optionText }, h("tttx-icon", { icon: checkboxIcon, color: checkboxColor, class: 'checkbox-icon' }), this.showOptionIcons && h("tttx-icon", { icon: option.optionIcon, color: option.optionIconColor }), h("label", { class: 'filter-label' }, option.optionText));
162
+ })), h("div", { class: 'filter-popover-button-container' }, h("button", { type: 'button', class: 'close-button', onClick: this.onCloseButtonClick.bind(this) }, "Close"), h("button", { type: 'button', class: 'apply-button', onClick: this.onApplyFilterButtonClick.bind(this) }, "Apply")))))));
163
+ }
164
+ get el() { return this; }
165
+ static get style() { return tttxFilterCss; }
166
+ }, [1, "tttx-filter", {
167
+ "filterKey": [1, "filter-key"],
168
+ "filterOptions": [1, "filter-options"],
169
+ "showSelectAll": [4, "show-select-all"],
170
+ "showSearchField": [4, "show-search-field"],
171
+ "showOptionIcons": [4, "show-option-icons"],
172
+ "filterButtonStyle": [1, "filter-button-style"],
173
+ "filterHeader": [1, "filter-header"],
174
+ "showPopover": [32],
175
+ "displayedFilterSettings": [32],
176
+ "selectedFilters": [32],
177
+ "filterSearchTerm": [32],
178
+ "allSelected": [32]
179
+ }]);
180
+ function defineCustomElement$1() {
181
+ if (typeof customElements === "undefined") {
182
+ return;
183
+ }
184
+ const components = ["tttx-filter", "tttx-icon"];
185
+ components.forEach(tagName => { switch (tagName) {
186
+ case "tttx-filter":
187
+ if (!customElements.get(tagName)) {
188
+ customElements.define(tagName, TttxFilter$1);
189
+ }
190
+ break;
191
+ case "tttx-icon":
192
+ if (!customElements.get(tagName)) {
193
+ defineCustomElement$2();
194
+ }
195
+ break;
196
+ } });
197
197
  }
198
198
 
199
199
  const TttxFilter = TttxFilter$1;