@3t-transform/threeteeui 0.1.21 → 0.1.22

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 (120) hide show
  1. package/dist/cjs/{index-b8a62ede.js → index-dc6cc829.js} +2 -88
  2. package/dist/cjs/loader.cjs.js +3 -4
  3. package/dist/cjs/tttx-button.cjs.entry.js +24 -24
  4. package/dist/cjs/tttx-filter.cjs.entry.js +152 -152
  5. package/dist/cjs/tttx-form.cjs.entry.js +363 -363
  6. package/dist/cjs/tttx-icon.cjs.entry.js +11 -11
  7. package/dist/cjs/tttx-keyvalue-block.cjs.entry.js +59 -59
  8. package/dist/cjs/tttx-list.cjs.entry.js +43 -43
  9. package/dist/cjs/tttx-loading-spinner.cjs.entry.js +16 -16
  10. package/dist/cjs/tttx-sorter.cjs.entry.js +112 -0
  11. package/dist/cjs/tttx-standalone-input.cjs.entry.js +60 -60
  12. package/dist/cjs/tttx-toolbar.cjs.entry.js +10 -10
  13. package/dist/cjs/tttx.cjs.js +3 -7
  14. package/dist/collection/collection-manifest.json +3 -2
  15. package/dist/collection/components/atoms/tttx-button/tttx-button.js +110 -110
  16. package/dist/collection/components/atoms/tttx-button/tttx-button.stories.js +14 -14
  17. package/dist/collection/components/atoms/tttx-icon/tttx-icon.js +62 -62
  18. package/dist/collection/components/atoms/tttx-icon/tttx-icon.stories.js +22 -22
  19. package/dist/collection/components/atoms/tttx-keyvalue-block/tttx-keyvalue-block.js +109 -109
  20. package/dist/collection/components/atoms/tttx-keyvalue-block/tttx-keyvalue-block.stories.js +38 -38
  21. package/dist/collection/components/atoms/tttx-loading-spinner/tttx-loading-spinner.js +67 -67
  22. package/dist/collection/components/atoms/tttx-loading-spinner/tttx-loading-spinner.stories.js +17 -17
  23. package/dist/collection/components/molecules/tttx-filter/tttx-filter.js +325 -325
  24. package/dist/collection/components/molecules/tttx-filter/tttx-filter.stories.js +89 -89
  25. package/dist/collection/components/molecules/tttx-form/lib/setErrorState.js +35 -35
  26. package/dist/collection/components/molecules/tttx-form/lib/validityCheck.js +58 -58
  27. package/dist/collection/components/molecules/tttx-form/tttx-form.js +364 -364
  28. package/dist/collection/components/molecules/tttx-form/tttx-form.stories.js +127 -127
  29. package/dist/collection/components/molecules/tttx-list/tttx-list.js +105 -105
  30. package/dist/collection/components/molecules/tttx-list/tttx-list.stories.js +43 -43
  31. package/dist/collection/components/molecules/tttx-sorter/tttx-sorter.css +116 -0
  32. package/dist/collection/components/molecules/tttx-sorter/tttx-sorter.js +224 -0
  33. package/dist/collection/components/molecules/tttx-sorter/tttx-sorter.stories.js +47 -0
  34. package/dist/collection/components/molecules/tttx-standalone-input/tttx-standalone-input.js +627 -627
  35. package/dist/collection/components/molecules/tttx-standalone-input/tttx-standalone-input.stories.js +157 -157
  36. package/dist/collection/components/molecules/tttx-toolbar/tttx-toolbar.js +44 -44
  37. package/dist/collection/components/molecules/tttx-toolbar/tttx-toolbar.stories.js +14 -14
  38. package/dist/collection/components/palette.stories.js +7 -7
  39. package/dist/collection/docs/gettingstarted-developer.stories.js +5 -5
  40. package/dist/collection/icons.js +2838 -2838
  41. package/dist/collection/index.js +1 -1
  42. package/dist/collection/shared/domsanitiser.options.js +14 -14
  43. package/dist/components/index.d.ts +1 -9
  44. package/dist/components/index.js +2 -1
  45. package/dist/components/tttx-button.js +48 -48
  46. package/dist/components/tttx-filter.js +184 -184
  47. package/dist/components/tttx-form.js +380 -380
  48. package/dist/components/tttx-icon2.js +28 -28
  49. package/dist/components/tttx-keyvalue-block.js +76 -76
  50. package/dist/components/tttx-list.js +65 -65
  51. package/dist/components/tttx-loading-spinner.js +33 -33
  52. package/dist/components/tttx-sorter.d.ts +11 -0
  53. package/dist/components/tttx-sorter.js +141 -0
  54. package/dist/components/tttx-standalone-input.js +107 -107
  55. package/dist/components/tttx-toolbar.js +26 -26
  56. package/dist/esm/{index-e888a5f4.js → index-86faeaab.js} +3 -88
  57. package/dist/esm/loader.js +3 -4
  58. package/dist/esm/polyfills/core-js.js +0 -0
  59. package/dist/esm/polyfills/css-shim.js +1 -1
  60. package/dist/esm/polyfills/dom.js +0 -0
  61. package/dist/esm/polyfills/es5-html-element.js +0 -0
  62. package/dist/esm/polyfills/index.js +0 -0
  63. package/dist/esm/polyfills/system.js +0 -0
  64. package/dist/esm/tttx-button.entry.js +24 -24
  65. package/dist/esm/tttx-filter.entry.js +152 -152
  66. package/dist/esm/tttx-form.entry.js +363 -363
  67. package/dist/esm/tttx-icon.entry.js +11 -11
  68. package/dist/esm/tttx-keyvalue-block.entry.js +59 -59
  69. package/dist/esm/tttx-list.entry.js +43 -43
  70. package/dist/esm/tttx-loading-spinner.entry.js +16 -16
  71. package/dist/esm/tttx-sorter.entry.js +108 -0
  72. package/dist/esm/tttx-standalone-input.entry.js +60 -60
  73. package/dist/esm/tttx-toolbar.entry.js +10 -10
  74. package/dist/esm/tttx.js +3 -4
  75. package/dist/tttx/p-12fc0b16.entry.js +3 -0
  76. package/dist/tttx/p-52a47b7c.js +2 -0
  77. package/dist/tttx/p-5d9b6bc0.entry.js +1 -0
  78. package/dist/tttx/{p-41f5b296.entry.js → p-603f6ebe.entry.js} +1 -1
  79. package/dist/tttx/{p-e145951b.entry.js → p-72b4c98a.entry.js} +1 -1
  80. package/dist/tttx/{p-043f9b8a.entry.js → p-8f3badad.entry.js} +1 -1
  81. package/dist/tttx/{p-4cf3e1e0.entry.js → p-ae48fe5a.entry.js} +1 -1
  82. package/dist/tttx/{p-01f4628e.entry.js → p-bdb054b2.entry.js} +1 -1
  83. package/dist/tttx/{p-dc5c356b.entry.js → p-c72d1a03.entry.js} +1 -1
  84. package/dist/tttx/{p-96bbf1ed.entry.js → p-e25d5fe2.entry.js} +1 -1
  85. package/dist/tttx/{p-b3a03986.entry.js → p-f1d7eb35.entry.js} +1 -1
  86. package/dist/tttx/tttx.esm.js +1 -1
  87. package/dist/types/components/atoms/tttx-button/tttx-button.d.ts +10 -10
  88. package/dist/types/components/atoms/tttx-button/tttx-button.stories.d.ts +10 -10
  89. package/dist/types/components/atoms/tttx-icon/tttx-icon.d.ts +5 -5
  90. package/dist/types/components/atoms/tttx-icon/tttx-icon.stories.d.ts +20 -20
  91. package/dist/types/components/atoms/tttx-keyvalue-block/tttx-keyvalue-block.d.ts +7 -7
  92. package/dist/types/components/atoms/tttx-keyvalue-block/tttx-keyvalue-block.stories.d.ts +9 -9
  93. package/dist/types/components/atoms/tttx-loading-spinner/tttx-loading-spinner.d.ts +6 -6
  94. package/dist/types/components/atoms/tttx-loading-spinner/tttx-loading-spinner.stories.d.ts +17 -17
  95. package/dist/types/components/molecules/tttx-filter/tttx-filter.d.ts +37 -37
  96. package/dist/types/components/molecules/tttx-filter/tttx-filter.stories.d.ts +43 -43
  97. package/dist/types/components/molecules/tttx-form/lib/setErrorState.d.ts +13 -13
  98. package/dist/types/components/molecules/tttx-form/lib/validityCheck.d.ts +17 -17
  99. package/dist/types/components/molecules/tttx-form/tttx-form.d.ts +114 -114
  100. package/dist/types/components/molecules/tttx-form/tttx-form.stories.d.ts +13 -13
  101. package/dist/types/components/molecules/tttx-list/tttx-list.d.ts +11 -11
  102. package/dist/types/components/molecules/tttx-list/tttx-list.stories.d.ts +14 -14
  103. package/dist/types/components/molecules/tttx-sorter/interfaces.d.ts +9 -0
  104. package/dist/types/components/molecules/tttx-sorter/tttx-sorter.d.ts +19 -0
  105. package/dist/types/components/molecules/tttx-sorter/tttx-sorter.stories.d.ts +30 -0
  106. package/dist/types/components/molecules/tttx-standalone-input/tttx-standalone-input.d.ts +56 -56
  107. package/dist/types/components/molecules/tttx-standalone-input/tttx-standalone-input.stories.d.ts +123 -123
  108. package/dist/types/components/molecules/tttx-toolbar/tttx-toolbar.d.ts +4 -4
  109. package/dist/types/components/molecules/tttx-toolbar/tttx-toolbar.stories.d.ts +13 -13
  110. package/dist/types/components/palette.stories.d.ts +6 -6
  111. package/dist/types/components.d.ts +27 -0
  112. package/dist/types/docs/gettingstarted-developer.stories.d.ts +5 -5
  113. package/dist/types/icons.d.ts +2 -2
  114. package/dist/types/index.d.ts +1 -1
  115. package/dist/types/shared/domsanitiser.options.d.ts +10 -10
  116. package/dist/types/stencil-public-runtime.d.ts +3 -59
  117. package/loader/index.d.ts +0 -9
  118. package/package.json +1 -1
  119. package/dist/tttx/p-6dff6b5a.entry.js +0 -3
  120. package/dist/tttx/p-f764ffc4.js +0 -2
@@ -1 +1 @@
1
- export {};
1
+ export {};
@@ -1,14 +1,14 @@
1
- function tagRegXp(tagName) {
2
- return RegExp(/^tttx-/).exec(tagName);
3
- }
4
- function attributeNameCheck() {
5
- return true;
6
- }
7
- const domSanitiserOptions = {
8
- CUSTOM_ELEMENT_HANDLING: {
9
- tagNameCheck: tagRegXp,
10
- attributeNameCheck: attributeNameCheck,
11
- allowCustomizedBuiltInElements: false, // customized built-ins are not allowed
12
- }
13
- };
14
- export default domSanitiserOptions;
1
+ function tagRegXp(tagName) {
2
+ return RegExp(/^tttx-/).exec(tagName);
3
+ }
4
+ function attributeNameCheck() {
5
+ return true;
6
+ }
7
+ const domSanitiserOptions = {
8
+ CUSTOM_ELEMENT_HANDLING: {
9
+ tagNameCheck: tagRegXp,
10
+ attributeNameCheck: attributeNameCheck,
11
+ allowCustomizedBuiltInElements: false, // customized built-ins are not allowed
12
+ }
13
+ };
14
+ export default domSanitiserOptions;
@@ -6,6 +6,7 @@ export { TttxIcon as TttxIcon } from '../types/components/atoms/tttx-icon/tttx-i
6
6
  export { TttxKeyvalueBlock as TttxKeyvalueBlock } from '../types/components/atoms/tttx-keyvalue-block/tttx-keyvalue-block';
7
7
  export { TttxList as TttxList } from '../types/components/molecules/tttx-list/tttx-list';
8
8
  export { TttxLoadingSpinner as TttxLoadingSpinner } from '../types/components/atoms/tttx-loading-spinner/tttx-loading-spinner';
9
+ export { TttxSorter as TttxSorter } from '../types/components/molecules/tttx-sorter/tttx-sorter';
9
10
  export { TttxInput as TttxStandaloneInput } from '../types/components/molecules/tttx-standalone-input/tttx-standalone-input';
10
11
  export { TttxToolbar as TttxToolbar } from '../types/components/molecules/tttx-toolbar/tttx-toolbar';
11
12
 
@@ -21,15 +22,6 @@ export { TttxToolbar as TttxToolbar } from '../types/components/molecules/tttx-t
21
22
  */
22
23
  export declare const setAssetPath: (path: string) => void;
23
24
 
24
- /**
25
- * Used to specify a nonce value that corresponds with an application's CSP.
26
- * When set, the nonce will be added to all dynamically created script and style tags at runtime.
27
- * Alternatively, the nonce value can be set on a meta tag in the DOM head
28
- * (<meta name="csp-nonce" content="{ nonce value here }" />) which
29
- * will result in the same behavior.
30
- */
31
- export declare const setNonce: (nonce: string) => void
32
-
33
25
  export interface SetPlatformOptions {
34
26
  raf?: (c: FrameRequestCallback) => number;
35
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';
@@ -6,5 +6,6 @@ export { TttxIcon, defineCustomElement as defineCustomElementTttxIcon } from './
6
6
  export { TttxKeyvalueBlock, defineCustomElement as defineCustomElementTttxKeyvalueBlock } from './tttx-keyvalue-block.js';
7
7
  export { TttxList, defineCustomElement as defineCustomElementTttxList } from './tttx-list.js';
8
8
  export { TttxLoadingSpinner, defineCustomElement as defineCustomElementTttxLoadingSpinner } from './tttx-loading-spinner.js';
9
+ export { TttxSorter, defineCustomElement as defineCustomElementTttxSorter } from './tttx-sorter.js';
9
10
  export { TttxStandaloneInput, defineCustomElement as defineCustomElementTttxStandaloneInput } from './tttx-standalone-input.js';
10
11
  export { TttxToolbar, defineCustomElement as defineCustomElementTttxToolbar } from './tttx-toolbar.js';
@@ -3,54 +3,54 @@ import { d as defineCustomElement$2 } from './tttx-icon2.js';
3
3
 
4
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}";
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,190 +3,190 @@ 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 .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}.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:block;width:196px;border-radius:4px;box-shadow:0px 1px 5px #1111114D;position:absolute}.filter-container .filter-popover-container .filter-header{color:#757575;text-transform:uppercase;font-size:14px;font-weight:500;font-family:\"Roboto\", serif;padding-left:16px;padding-top:12px;padding-bottom:12px;margin:0}.filter-container .filter-popover-container .popover-divider{border:none;width:164px;display:flex;margin-left:auto;margin-right:auto;margin-top:0;margin-bottom:8px;height:1px;background-color:#d5d5d5}.filter-container .filter-popover-container .filter-option{display:flex;flex-direction:row;align-items:center;height:36px;padding-left:22px;padding-bottom:4px}.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{margin-top:8px}.filter-container .filter-popover-container .filter-option:last-child{margin-bottom: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}.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;margin-right:16px;font-size:14px;font-weight:400;font-family:\"Roboto\", serif}.filter-container .filter-popover-container.--with-search-field{width:252px}.filter-container .filter-popover-container.--with-search-field .popover-divider{width:220px}.filter-container .filter-popover-container.--with-search-field .popover-divider:first-child{top:44px}.filter-container .filter-popover-container.--with-search-field .search-field-container{position:relative;color:#d5d5d5;width:220px;height:36px;padding:0 16px}.filter-container .filter-popover-container.--with-search-field .search-field-container .search-icon{position:absolute;top:50%;padding-left:8px;padding-bottom:9.2px;height:17px;width:17px;transform:translateY(-50%)}.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;width:220px;font-size:16px;font-family:\"Roboto\", serif;font-weight:500;color:#9e9e9e;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}.filter-container .filter-popover-container.--with-search-field .search-field-container .popover-divider{margin-top:8px}.filter-container .filter-popover-container.--with-search-field .filter-option:first-child{padding-top:8px}";
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.selectedFilters = this.filterOptions.map((filterOption) => filterOption.optionText);
25
- this.filterSearchTerm = '';
26
- this.displayedFilterSettings = this.filterOptions;
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
- togglePopover() {
56
- this.showPopover = !this.showPopover;
57
- // if(!this.showPopover) {
58
- // // this._focussedElementIndex = -1;
59
- // }
60
- }
61
- // Commented out keyboard interaction for now
62
- // @Listen('keyup')
63
- // handleKeyUp(event: KeyboardEvent) {
64
- // const keyboardEventValue = event.key;
65
- // if (document.activeElement.id != `filter__${this.filterKey}`) return;
66
- // if (event.key == " " || event.code == "Space" || event.keyCode == 32) {
67
- // if (this._focussedElementIndex == 0) {
68
- // this.onSelectAllClick()
69
- // } else {
70
- // const options = this.el.shadowRoot.querySelectorAll('.filter-option') as HTMLElement[];
71
- // this.onFilterOptionSelected(options[this._focussedElementIndex].textContent)
72
- // }
73
- // return;
74
- // }
75
- // switch (keyboardEventValue) {
76
- // case 'Enter':
77
- // if(!this.showPopover) {
78
- // this.showPopover=true
79
- // } else {
80
- // this.emitFilterEvent()
81
- // }
82
- // break;
83
- // case 'Escape':
84
- // this.showPopover = false;
85
- // this._focussedElementIndex = -1;
86
- // break;
87
- // case 'ArrowDown':
88
- // this.showPopover = true;
89
- // if (this._focussedElementIndex == -1) {
90
- // this._focussedElementIndex = 0;
91
- // } else {
92
- // const options = this.el.shadowRoot.querySelectorAll('.filter-option') as HTMLElement[];
93
- // const currentOption = options[this._focussedElementIndex] as HTMLElement;
94
- // currentOption.blur();
95
- // // options[this._focussedElementIndex].focus();
96
- // this._focussedElementIndex + 1 < options.length ? this._focussedElementIndex++ : (this._focussedElementIndex = 0);
97
- // }
98
- // break;
99
- // case 'ArrowUp':
100
- // if (this._focussedElementIndex == -1) {
101
- // this.showPopover = true;
102
- // this._focussedElementIndex = 0;
103
- // } else {
104
- // const options = this.el.shadowRoot.querySelectorAll('.filter-option') as HTMLElement[];
105
- // const currentOption = options[this._focussedElementIndex] as HTMLElement;
106
- // currentOption.blur();
107
- // // options[this._focussedElementIndex].focus();
108
- // this._focussedElementIndex > 0 ? this._focussedElementIndex-- : (this._focussedElementIndex = options.length - 1);
109
- // }
110
- // break;
111
- // }
112
- // }
113
- handleFilterChange(event) {
114
- const target = event.target;
115
- this.filterSearchTerm = target.value;
116
- const filteredResults = this.filterOptions.filter((filterOption) => {
117
- const lowercaseOption = filterOption.optionText.toLowerCase();
118
- const filterTerm = this.filterSearchTerm.toLowerCase();
119
- return lowercaseOption.includes(filterTerm);
120
- });
121
- this.displayedFilterSettings = filteredResults;
122
- }
123
- onSelectAllClick() {
124
- this.allSelected = !this.allSelected;
125
- if (this.allSelected) {
126
- this.displayedFilterSettings.forEach((filterSetting) => { this.selectedFilters = [...this.selectedFilters, filterSetting.optionText]; });
127
- }
128
- else {
129
- this.selectedFilters = [];
130
- }
131
- }
132
- getFilterButtonClassName(buttonStyle) {
133
- switch (buttonStyle) {
134
- case 'table icon': {
135
- return '--table-icon';
136
- }
137
- case 'list icon': {
138
- return '--list-icon';
139
- }
140
- default: {
141
- return '';
142
- }
143
- }
144
- }
145
- render() {
146
- const filterPopoverContainerClassNameModifier = this.showSearchField ? '--with-search-field' : '';
147
- const selectAllCheckboxIcon = this.allSelected ? 'check_box' : 'check_box_outline_blank';
148
- const selectAllCheckboxColor = this.allSelected ? 'blue' : 'grey';
149
- const buttonStyleClassNameModifier = this.getFilterButtonClassName(this.filterButtonStyle);
150
- const filterKey = `filter__${this.filterKey}`;
151
- 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("h4", { class: 'filter-header' }, this.filterHeader), h("hr", { class: 'popover-divider' }), 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("hr", { class: 'popover-divider' }))) : (''), 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) => {
152
- const checkboxIcon = this.selectedFilters.includes(option.optionText) ? 'check_box' : 'check_box_outline_blank';
153
- const checkboxColor = this.selectedFilters.includes(option.optionText) ? 'blue' : 'grey';
154
- 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));
155
- })), h("hr", { class: 'popover-divider' }), 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")))))));
156
- }
157
- get el() { return this; }
158
- static get style() { return tttxFilterCss; }
159
- }, [1, "tttx-filter", {
160
- "filterKey": [1, "filter-key"],
161
- "filterOptions": [16],
162
- "showSelectAll": [4, "show-select-all"],
163
- "showSearchField": [4, "show-search-field"],
164
- "showOptionIcons": [4, "show-option-icons"],
165
- "filterButtonStyle": [1, "filter-button-style"],
166
- "filterHeader": [1, "filter-header"],
167
- "showPopover": [32],
168
- "selectedFilters": [32],
169
- "filterSearchTerm": [32],
170
- "displayedFilterSettings": [32],
171
- "allSelected": [32]
172
- }]);
173
- function defineCustomElement$1() {
174
- if (typeof customElements === "undefined") {
175
- return;
176
- }
177
- const components = ["tttx-filter", "tttx-icon"];
178
- components.forEach(tagName => { switch (tagName) {
179
- case "tttx-filter":
180
- if (!customElements.get(tagName)) {
181
- customElements.define(tagName, TttxFilter$1);
182
- }
183
- break;
184
- case "tttx-icon":
185
- if (!customElements.get(tagName)) {
186
- defineCustomElement$2();
187
- }
188
- break;
189
- } });
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.selectedFilters = this.filterOptions.map((filterOption) => filterOption.optionText);
25
+ this.filterSearchTerm = '';
26
+ this.displayedFilterSettings = this.filterOptions;
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
+ togglePopover() {
56
+ this.showPopover = !this.showPopover;
57
+ // if(!this.showPopover) {
58
+ // // this._focussedElementIndex = -1;
59
+ // }
60
+ }
61
+ // Commented out keyboard interaction for now
62
+ // @Listen('keyup')
63
+ // handleKeyUp(event: KeyboardEvent) {
64
+ // const keyboardEventValue = event.key;
65
+ // if (document.activeElement.id != `filter__${this.filterKey}`) return;
66
+ // if (event.key == " " || event.code == "Space" || event.keyCode == 32) {
67
+ // if (this._focussedElementIndex == 0) {
68
+ // this.onSelectAllClick()
69
+ // } else {
70
+ // const options = this.el.shadowRoot.querySelectorAll('.filter-option') as HTMLElement[];
71
+ // this.onFilterOptionSelected(options[this._focussedElementIndex].textContent)
72
+ // }
73
+ // return;
74
+ // }
75
+ // switch (keyboardEventValue) {
76
+ // case 'Enter':
77
+ // if(!this.showPopover) {
78
+ // this.showPopover=true
79
+ // } else {
80
+ // this.emitFilterEvent()
81
+ // }
82
+ // break;
83
+ // case 'Escape':
84
+ // this.showPopover = false;
85
+ // this._focussedElementIndex = -1;
86
+ // break;
87
+ // case 'ArrowDown':
88
+ // this.showPopover = true;
89
+ // if (this._focussedElementIndex == -1) {
90
+ // this._focussedElementIndex = 0;
91
+ // } else {
92
+ // const options = this.el.shadowRoot.querySelectorAll('.filter-option') as HTMLElement[];
93
+ // const currentOption = options[this._focussedElementIndex] as HTMLElement;
94
+ // currentOption.blur();
95
+ // // options[this._focussedElementIndex].focus();
96
+ // this._focussedElementIndex + 1 < options.length ? this._focussedElementIndex++ : (this._focussedElementIndex = 0);
97
+ // }
98
+ // break;
99
+ // case 'ArrowUp':
100
+ // if (this._focussedElementIndex == -1) {
101
+ // this.showPopover = true;
102
+ // this._focussedElementIndex = 0;
103
+ // } else {
104
+ // const options = this.el.shadowRoot.querySelectorAll('.filter-option') as HTMLElement[];
105
+ // const currentOption = options[this._focussedElementIndex] as HTMLElement;
106
+ // currentOption.blur();
107
+ // // options[this._focussedElementIndex].focus();
108
+ // this._focussedElementIndex > 0 ? this._focussedElementIndex-- : (this._focussedElementIndex = options.length - 1);
109
+ // }
110
+ // break;
111
+ // }
112
+ // }
113
+ handleFilterChange(event) {
114
+ const target = event.target;
115
+ this.filterSearchTerm = target.value;
116
+ const filteredResults = this.filterOptions.filter((filterOption) => {
117
+ const lowercaseOption = filterOption.optionText.toLowerCase();
118
+ const filterTerm = this.filterSearchTerm.toLowerCase();
119
+ return lowercaseOption.includes(filterTerm);
120
+ });
121
+ this.displayedFilterSettings = filteredResults;
122
+ }
123
+ onSelectAllClick() {
124
+ this.allSelected = !this.allSelected;
125
+ if (this.allSelected) {
126
+ this.displayedFilterSettings.forEach((filterSetting) => { this.selectedFilters = [...this.selectedFilters, filterSetting.optionText]; });
127
+ }
128
+ else {
129
+ this.selectedFilters = [];
130
+ }
131
+ }
132
+ getFilterButtonClassName(buttonStyle) {
133
+ switch (buttonStyle) {
134
+ case 'table icon': {
135
+ return '--table-icon';
136
+ }
137
+ case 'list icon': {
138
+ return '--list-icon';
139
+ }
140
+ default: {
141
+ return '';
142
+ }
143
+ }
144
+ }
145
+ render() {
146
+ const filterPopoverContainerClassNameModifier = this.showSearchField ? '--with-search-field' : '';
147
+ const selectAllCheckboxIcon = this.allSelected ? 'check_box' : 'check_box_outline_blank';
148
+ const selectAllCheckboxColor = this.allSelected ? 'blue' : 'grey';
149
+ const buttonStyleClassNameModifier = this.getFilterButtonClassName(this.filterButtonStyle);
150
+ const filterKey = `filter__${this.filterKey}`;
151
+ 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("h4", { class: 'filter-header' }, this.filterHeader), h("hr", { class: 'popover-divider' }), 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("hr", { class: 'popover-divider' }))) : (''), 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) => {
152
+ const checkboxIcon = this.selectedFilters.includes(option.optionText) ? 'check_box' : 'check_box_outline_blank';
153
+ const checkboxColor = this.selectedFilters.includes(option.optionText) ? 'blue' : 'grey';
154
+ 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));
155
+ })), h("hr", { class: 'popover-divider' }), 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")))))));
156
+ }
157
+ get el() { return this; }
158
+ static get style() { return tttxFilterCss; }
159
+ }, [1, "tttx-filter", {
160
+ "filterKey": [1, "filter-key"],
161
+ "filterOptions": [16],
162
+ "showSelectAll": [4, "show-select-all"],
163
+ "showSearchField": [4, "show-search-field"],
164
+ "showOptionIcons": [4, "show-option-icons"],
165
+ "filterButtonStyle": [1, "filter-button-style"],
166
+ "filterHeader": [1, "filter-header"],
167
+ "showPopover": [32],
168
+ "selectedFilters": [32],
169
+ "filterSearchTerm": [32],
170
+ "displayedFilterSettings": [32],
171
+ "allSelected": [32]
172
+ }]);
173
+ function defineCustomElement$1() {
174
+ if (typeof customElements === "undefined") {
175
+ return;
176
+ }
177
+ const components = ["tttx-filter", "tttx-icon"];
178
+ components.forEach(tagName => { switch (tagName) {
179
+ case "tttx-filter":
180
+ if (!customElements.get(tagName)) {
181
+ customElements.define(tagName, TttxFilter$1);
182
+ }
183
+ break;
184
+ case "tttx-icon":
185
+ if (!customElements.get(tagName)) {
186
+ defineCustomElement$2();
187
+ }
188
+ break;
189
+ } });
190
190
  }
191
191
 
192
192
  const TttxFilter = TttxFilter$1;