@3t-transform/threeteeui 0.2.86 → 0.2.87

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 (47) hide show
  1. package/dist/cjs/loader.cjs.js +1 -1
  2. package/dist/cjs/tttx-data-pattern.cjs.entry.js +25 -0
  3. package/dist/cjs/tttx-expander.cjs.entry.js +17 -6
  4. package/dist/cjs/{tttx-filter.cjs.entry.js → tttx-filter_4.cjs.entry.js} +209 -0
  5. package/dist/cjs/tttx.cjs.js +1 -1
  6. package/dist/collection/collection-manifest.json +2 -1
  7. package/dist/collection/components/molecules/tttx-expander/tttx-expander.css +13 -0
  8. package/dist/collection/components/molecules/tttx-expander/tttx-expander.js +26 -10
  9. package/dist/collection/components/molecules/tttx-expander/tttx-expander.stories.js +10 -10
  10. package/dist/collection/components/organisms/tttx-data-pattern/tttx-data-pattern.css +3 -0
  11. package/dist/collection/components/organisms/tttx-data-pattern/tttx-data-pattern.js +99 -0
  12. package/dist/collection/components/organisms/tttx-data-pattern/tttx-data-pattern.stories.js +35 -0
  13. package/dist/components/index.d.ts +1 -0
  14. package/dist/components/index.js +1 -0
  15. package/dist/components/tttx-data-pattern.d.ts +11 -0
  16. package/dist/components/tttx-data-pattern.js +86 -0
  17. package/dist/components/tttx-expander.js +20 -8
  18. package/dist/components/tttx-filter.js +1 -223
  19. package/dist/{esm/tttx-filter.entry.js → components/tttx-filter2.js} +44 -8
  20. package/dist/components/tttx-list.js +1 -92
  21. package/dist/{esm/tttx-list.entry.js → components/tttx-list2.js} +33 -9
  22. package/dist/components/tttx-sorter.js +1 -142
  23. package/dist/{esm/tttx-sorter.entry.js → components/tttx-sorter2.js} +38 -8
  24. package/dist/components/tttx-toolbar.js +1 -47
  25. package/dist/{esm/tttx-toolbar.entry.js → components/tttx-toolbar2.js} +25 -7
  26. package/dist/esm/loader.js +1 -1
  27. package/dist/esm/tttx-data-pattern.entry.js +21 -0
  28. package/dist/esm/tttx-expander.entry.js +17 -6
  29. package/dist/esm/tttx-filter_4.entry.js +395 -0
  30. package/dist/esm/tttx.js +1 -1
  31. package/dist/tttx/p-003798cb.entry.js +1 -0
  32. package/dist/tttx/p-02515882.entry.js +1 -0
  33. package/dist/tttx/p-1190c6e5.entry.js +1 -0
  34. package/dist/tttx/tttx.esm.js +1 -1
  35. package/dist/types/components/molecules/tttx-expander/tttx-expander.d.ts +9 -3
  36. package/dist/types/components/organisms/tttx-data-pattern/tttx-data-pattern.d.ts +7 -0
  37. package/dist/types/components/organisms/tttx-data-pattern/tttx-data-pattern.stories.d.ts +13 -0
  38. package/dist/types/components.d.ts +24 -3
  39. package/package.json +1 -1
  40. package/dist/cjs/tttx-list.cjs.entry.js +0 -74
  41. package/dist/cjs/tttx-sorter.cjs.entry.js +0 -118
  42. package/dist/cjs/tttx-toolbar.cjs.entry.js +0 -35
  43. package/dist/tttx/p-0343ca04.entry.js +0 -1
  44. package/dist/tttx/p-5ca83a07.entry.js +0 -1
  45. package/dist/tttx/p-7346c185.entry.js +0 -1
  46. package/dist/tttx/p-96d6a1ed.entry.js +0 -1
  47. package/dist/tttx/p-df198186.entry.js +0 -1
@@ -0,0 +1,99 @@
1
+ import { Host, h } from '@stencil/core';
2
+ export class TttxDataPattern {
3
+ constructor() {
4
+ this.data = undefined;
5
+ this.sorteroptions = undefined;
6
+ this.filteroptions = undefined;
7
+ this.filterheader = 'Filter';
8
+ }
9
+ render() {
10
+ return (h(Host, null, h("div", { class: "container" }, h("tttx-toolbar", { border: true }, h("span", { slot: "before" }, h("tttx-sorter", { sorterKey: "data-pattern-list", fieldOptionsData: this.sorteroptions, defaultOption: "Sort by" }), h("tttx-filter", { "filter-options": JSON.stringify(this.filteroptions), showSelectAll: false, "show-option-icons": true, "filter-header": this.filterheader, "filter-key": "data-pattern-list" })), h("span", { slot: "after" }, h("tttx-standalone-input", { class: "qualifications-filter", showerrorbubble: false, inputicon: "search", inline: true, required: true, placeholder: "Search", type: "text",
11
+ // onInput={this.debounceFilter.bind(this)}
12
+ maxlength: 30 }))), h("tttx-toolbar", { border: false }, h("span", { slot: "before" }, h("tttx-button", { design: "primary", icon: "add" }, "Add"))), h("tttx-list", { data: this.data }))));
13
+ }
14
+ static get is() { return "tttx-data-pattern"; }
15
+ static get encapsulation() { return "shadow"; }
16
+ static get originalStyleUrls() {
17
+ return {
18
+ "$": ["tttx-data-pattern.css"]
19
+ };
20
+ }
21
+ static get styleUrls() {
22
+ return {
23
+ "$": ["tttx-data-pattern.css"]
24
+ };
25
+ }
26
+ static get properties() {
27
+ return {
28
+ "data": {
29
+ "type": "string",
30
+ "mutable": false,
31
+ "complexType": {
32
+ "original": "string",
33
+ "resolved": "string",
34
+ "references": {}
35
+ },
36
+ "required": false,
37
+ "optional": false,
38
+ "docs": {
39
+ "tags": [],
40
+ "text": ""
41
+ },
42
+ "attribute": "data",
43
+ "reflect": false
44
+ },
45
+ "sorteroptions": {
46
+ "type": "string",
47
+ "mutable": false,
48
+ "complexType": {
49
+ "original": "string",
50
+ "resolved": "string",
51
+ "references": {}
52
+ },
53
+ "required": false,
54
+ "optional": false,
55
+ "docs": {
56
+ "tags": [],
57
+ "text": ""
58
+ },
59
+ "attribute": "sorteroptions",
60
+ "reflect": false
61
+ },
62
+ "filteroptions": {
63
+ "type": "string",
64
+ "mutable": false,
65
+ "complexType": {
66
+ "original": "string",
67
+ "resolved": "string",
68
+ "references": {}
69
+ },
70
+ "required": false,
71
+ "optional": false,
72
+ "docs": {
73
+ "tags": [],
74
+ "text": ""
75
+ },
76
+ "attribute": "filteroptions",
77
+ "reflect": false
78
+ },
79
+ "filterheader": {
80
+ "type": "string",
81
+ "mutable": false,
82
+ "complexType": {
83
+ "original": "string",
84
+ "resolved": "string",
85
+ "references": {}
86
+ },
87
+ "required": false,
88
+ "optional": false,
89
+ "docs": {
90
+ "tags": [],
91
+ "text": ""
92
+ },
93
+ "attribute": "filterheader",
94
+ "reflect": false,
95
+ "defaultValue": "'Filter'"
96
+ }
97
+ };
98
+ }
99
+ }
@@ -0,0 +1,35 @@
1
+ export default {
2
+ title: 'organisms/Data Pattern',
3
+ component: 'data-pattern',
4
+ argTypes: {
5
+ border: {
6
+ control: { type: 'boolean' }
7
+ },
8
+ },
9
+ };
10
+ const Default = ({ data, sorterOptions, filterOptions }) => `
11
+ <tttx-data-pattern id="datapatternlist"></tttx-data-pattern>
12
+ <script>
13
+ const element = document.getElementById('datapatternlist');
14
+ element.data = ${JSON.stringify(data)};
15
+ element.sorteroptions = ${JSON.stringify(sorterOptions)};
16
+ element.filteroptions = ${JSON.stringify(filterOptions)};
17
+ </script>
18
+ `;
19
+ export const WIPDefaultDataPattern = Default.bind({});
20
+ WIPDefaultDataPattern.args = {
21
+ data: [
22
+ { icon: 'chevron_right', element: '<span><tttx-icon icon="egg" /></span> Demulon 1,000,000' },
23
+ { icon: 'chevron_right', element: '<span><tttx-icon icon="egg" color="red" /></span> Patrick' },
24
+ { icon: 'chevron_right', element: '<span><tttx-icon icon="add" /></span> Lee' },
25
+ { icon: 'chevron_right', element: '<span><tttx-icon icon="egg" /></span> Ben' },
26
+ ],
27
+ sorterOptions: {
28
+ sorterOptions: [{ optionLabel: 'Name' }, { optionLabel: 'Age' }],
29
+ },
30
+ filterOptions: [
31
+ { optionIcon: 'cancel', optionIconColor: 'exit', optionText: 'MAGICAL' },
32
+ { optionIcon: 'warning', optionIconColor: 'orange', optionText: 'Expiring soon' },
33
+ { optionIcon: 'check_circle', optionIconColor: 'green', optionText: 'Active' },
34
+ ]
35
+ };
@@ -1,5 +1,6 @@
1
1
  /* tttx custom elements */
2
2
  export { TttxButton as TttxButton } from '../types/components/atoms/tttx-button/tttx-button';
3
+ export { TttxDataPattern as TttxDataPattern } from '../types/components/organisms/tttx-data-pattern/tttx-data-pattern';
3
4
  export { TttxDialogBox as TttxDialogBox } from '../types/components/molecules/tttx-dialog-box/tttx-dialog-box';
4
5
  export { TttxExpander as TttxExpander } from '../types/components/molecules/tttx-expander/tttx-expander';
5
6
  export { TttxFilter as TttxFilter } from '../types/components/molecules/tttx-filter/tttx-filter';
@@ -1,5 +1,6 @@
1
1
  export { setAssetPath, setNonce, setPlatformOptions } from '@stencil/core/internal/client';
2
2
  export { TttxButton, defineCustomElement as defineCustomElementTttxButton } from './tttx-button.js';
3
+ export { TttxDataPattern, defineCustomElement as defineCustomElementTttxDataPattern } from './tttx-data-pattern.js';
3
4
  export { TttxDialogBox, defineCustomElement as defineCustomElementTttxDialogBox } from './tttx-dialog-box.js';
4
5
  export { TttxExpander, defineCustomElement as defineCustomElementTttxExpander } from './tttx-expander.js';
5
6
  export { TttxFilter, defineCustomElement as defineCustomElementTttxFilter } from './tttx-filter.js';
@@ -0,0 +1,11 @@
1
+ import type { Components, JSX } from "../types/components";
2
+
3
+ interface TttxDataPattern extends Components.TttxDataPattern, HTMLElement {}
4
+ export const TttxDataPattern: {
5
+ prototype: TttxDataPattern;
6
+ new (): TttxDataPattern;
7
+ };
8
+ /**
9
+ * Used to define this component and all nested components recursively.
10
+ */
11
+ export const defineCustomElement: () => void;
@@ -0,0 +1,86 @@
1
+ import { proxyCustomElement, HTMLElement, h, Host } from '@stencil/core/internal/client';
2
+ import { d as defineCustomElement$8 } from './tttx-button2.js';
3
+ import { d as defineCustomElement$7 } from './tttx-filter2.js';
4
+ import { d as defineCustomElement$6 } from './tttx-icon2.js';
5
+ import { d as defineCustomElement$5 } from './tttx-list2.js';
6
+ import { d as defineCustomElement$4 } from './tttx-sorter2.js';
7
+ import { d as defineCustomElement$3 } from './tttx-standalone-input2.js';
8
+ import { d as defineCustomElement$2 } from './tttx-toolbar2.js';
9
+
10
+ const tttxDataPatternCss = ":host{display:block}";
11
+
12
+ const TttxDataPattern$1 = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
13
+ constructor() {
14
+ super();
15
+ this.__registerHost();
16
+ this.__attachShadow();
17
+ this.data = undefined;
18
+ this.sorteroptions = undefined;
19
+ this.filteroptions = undefined;
20
+ this.filterheader = 'Filter';
21
+ }
22
+ render() {
23
+ return (h(Host, null, h("div", { class: "container" }, h("tttx-toolbar", { border: true }, h("span", { slot: "before" }, h("tttx-sorter", { sorterKey: "data-pattern-list", fieldOptionsData: this.sorteroptions, defaultOption: "Sort by" }), h("tttx-filter", { "filter-options": JSON.stringify(this.filteroptions), showSelectAll: false, "show-option-icons": true, "filter-header": this.filterheader, "filter-key": "data-pattern-list" })), h("span", { slot: "after" }, h("tttx-standalone-input", { class: "qualifications-filter", showerrorbubble: false, inputicon: "search", inline: true, required: true, placeholder: "Search", type: "text",
24
+ // onInput={this.debounceFilter.bind(this)}
25
+ maxlength: 30 }))), h("tttx-toolbar", { border: false }, h("span", { slot: "before" }, h("tttx-button", { design: "primary", icon: "add" }, "Add"))), h("tttx-list", { data: this.data }))));
26
+ }
27
+ static get style() { return tttxDataPatternCss; }
28
+ }, [1, "tttx-data-pattern", {
29
+ "data": [1],
30
+ "sorteroptions": [1],
31
+ "filteroptions": [1],
32
+ "filterheader": [1]
33
+ }]);
34
+ function defineCustomElement$1() {
35
+ if (typeof customElements === "undefined") {
36
+ return;
37
+ }
38
+ const components = ["tttx-data-pattern", "tttx-button", "tttx-filter", "tttx-icon", "tttx-list", "tttx-sorter", "tttx-standalone-input", "tttx-toolbar"];
39
+ components.forEach(tagName => { switch (tagName) {
40
+ case "tttx-data-pattern":
41
+ if (!customElements.get(tagName)) {
42
+ customElements.define(tagName, TttxDataPattern$1);
43
+ }
44
+ break;
45
+ case "tttx-button":
46
+ if (!customElements.get(tagName)) {
47
+ defineCustomElement$8();
48
+ }
49
+ break;
50
+ case "tttx-filter":
51
+ if (!customElements.get(tagName)) {
52
+ defineCustomElement$7();
53
+ }
54
+ break;
55
+ case "tttx-icon":
56
+ if (!customElements.get(tagName)) {
57
+ defineCustomElement$6();
58
+ }
59
+ break;
60
+ case "tttx-list":
61
+ if (!customElements.get(tagName)) {
62
+ defineCustomElement$5();
63
+ }
64
+ break;
65
+ case "tttx-sorter":
66
+ if (!customElements.get(tagName)) {
67
+ defineCustomElement$4();
68
+ }
69
+ break;
70
+ case "tttx-standalone-input":
71
+ if (!customElements.get(tagName)) {
72
+ defineCustomElement$3();
73
+ }
74
+ break;
75
+ case "tttx-toolbar":
76
+ if (!customElements.get(tagName)) {
77
+ defineCustomElement$2();
78
+ }
79
+ break;
80
+ } });
81
+ }
82
+
83
+ const TttxDataPattern = TttxDataPattern$1;
84
+ const defineCustomElement = defineCustomElement$1;
85
+
86
+ export { TttxDataPattern, defineCustomElement };
@@ -1,31 +1,43 @@
1
1
  import { proxyCustomElement, HTMLElement, createEvent, h, Host } from '@stencil/core/internal/client';
2
2
  import { d as defineCustomElement$2 } from './tttx-icon2.js';
3
3
 
4
- const tttxExpanderCss = ".material-symbols-rounded{font-variation-settings:\"FILL\" 1, \"wght\" 400, \"GRAD\" 0, \"opsz\" 24}:host{display:block}.expander{border-bottom:1px solid #d5d5d5}.expander .panel{display:flex;gap:4px;height:36px;align-items:center;justify-content:space-between;cursor:pointer}.expander .panel .panel-frame{display:flex;gap:4px;height:36px;align-items:center}.expander .panel .panel-frame .name{font-size:16px;font-weight:500;color:#212121}.expander .panel .left-icons,.expander .panel .expand-button{display:flex;height:36px;width:36px;align-items:center;justify-content:center}.expander .panel .left-icons>tttx-icon,.expander .panel .expand-button>tttx-icon{height:24px;cursor:inherit}.expander .content{margin-top:8px;margin-bottom:8px}";
4
+ const tttxExpanderCss = ".material-symbols-rounded{font-variation-settings:\"FILL\" 1, \"wght\" 400, \"GRAD\" 0, \"opsz\" 24}:host{display:block}.expander{border-bottom:1px solid #d5d5d5}.expander[open] .panel .open{display:initial}.expander[open] .panel .closed{display:none}.expander:not([open]) .panel .open{display:none}.expander:not([open]) .panel .closed{display:initial}.expander .panel{display:flex;gap:4px;height:36px;align-items:center;justify-content:space-between;cursor:pointer;user-select:none}.expander .panel .panel-frame{display:flex;gap:4px;height:36px;align-items:center}.expander .panel .panel-frame .name{font-size:16px;font-weight:500;color:#212121}.expander .panel .left-icons,.expander .panel .expand-button{display:flex;height:36px;width:36px;align-items:center;justify-content:center}.expander .panel .left-icons>tttx-icon,.expander .panel .expand-button>tttx-icon{height:24px;cursor:inherit}.expander .content{margin-top:8px;margin-bottom:8px}";
5
5
 
6
6
  const TttxExpander$1 = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
7
7
  constructor() {
8
8
  super();
9
9
  this.__registerHost();
10
10
  this.__attachShadow();
11
- this.contentExpanded = createEvent(this, "contentExpanded", 7);
11
+ this.toggleExpander = createEvent(this, "toggleExpander", 7);
12
12
  this.name = undefined;
13
- this.expanded = false;
13
+ this.open = false;
14
14
  this.lefticon = undefined;
15
15
  this.lefticoncolor = undefined;
16
+ this.isExpanded = false;
16
17
  }
17
- handleExpandedClick() {
18
- this.contentExpanded.emit(this.expanded);
18
+ componentWillRender() {
19
+ this.isExpanded = this.open;
20
+ }
21
+ handleExpand() {
22
+ // pre-render logic, so the attribute check is reversed
23
+ if (this.expander.getAttribute('open') === null) {
24
+ this.isExpanded = true;
25
+ }
26
+ else {
27
+ this.isExpanded = false;
28
+ }
29
+ this.toggleExpander.emit({ open: this.isExpanded, name: this.name });
19
30
  }
20
31
  render() {
21
- return (h(Host, null, h("div", { class: "expander" }, h("div", { class: "panel", onClick: this.handleExpandedClick.bind(this), "aria-expanded": `${this.expanded}` }, h("span", { class: "panel-frame" }, this.lefticon && (h("span", { class: "left-icons" }, h("tttx-icon", { icon: this.lefticon, color: this.lefticoncolor }))), h("span", { class: "name" }, this.name)), h("span", { class: "expand-button" }, h("tttx-icon", { icon: this.expanded ? 'expand_more' : 'chevron_right', color: "black" }))), this.expanded && (h("div", { class: "content" }, h("slot", null))))));
32
+ return (h(Host, null, h("details", { class: "expander", open: this.open, "aria-owns": "expanderContent", "aria-expanded": `${this.isExpanded}`, onClick: this.handleExpand.bind(this), ref: el => (this.expander = el) }, h("summary", { class: "panel" }, h("span", { class: "panel-frame" }, this.lefticon && (h("span", { class: "left-icons" }, h("tttx-icon", { icon: this.lefticon, color: this.lefticoncolor }))), h("span", { class: "name" }, this.name)), h("span", { class: "expand-button" }, h("tttx-icon", { class: "open", icon: "expand_more", color: "black" }), h("tttx-icon", { class: "closed", icon: "chevron_right", color: "black" }))), h("div", { id: "expanderContent", class: "content", tabindex: "0" }, h("slot", null)))));
22
33
  }
23
34
  static get style() { return tttxExpanderCss; }
24
35
  }, [1, "tttx-expander", {
25
36
  "name": [1],
26
- "expanded": [4],
37
+ "open": [4],
27
38
  "lefticon": [1],
28
- "lefticoncolor": [1]
39
+ "lefticoncolor": [1],
40
+ "isExpanded": [32]
29
41
  }]);
30
42
  function defineCustomElement$1() {
31
43
  if (typeof customElements === "undefined") {
@@ -1,226 +1,4 @@
1
- import { proxyCustomElement, HTMLElement, createEvent, h, Host } from '@stencil/core/internal/client';
2
- import { d as defineCustomElement$2 } from './tttx-icon2.js';
3
-
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;cursor:pointer}@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:8px 16px}.filter-container .filter-popover-container .filter-header{color:#757575;text-transform:uppercase;font-size:14px;font-weight:500;font-family:\"Roboto\", serif;padding-top:4px;padding-bottom:5px}.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;padding-bottom:8px}.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}.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;width:100%;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
-
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.toggleFilter = createEvent(this, "toggleFilter", 7);
13
- this.filterKey = undefined;
14
- this.filterOptions = [
15
- { optionIcon: 'cancel', optionIconColor: 'darkred', optionText: 'Expired' },
16
- { optionIcon: 'warning', optionIconColor: 'orange', optionText: 'Expiring soon' },
17
- { optionIcon: 'check_circle', optionIconColor: 'green', optionText: 'Active' },
18
- ];
19
- this.showSelectAll = true;
20
- this.showSearchField = false;
21
- this.showOptionIcons = true;
22
- this.filterButtonStyle = 'list filter';
23
- this.filterHeader = 'Qualification status';
24
- this.defaultFilterOptions = undefined;
25
- this.popoverWidth = '193px';
26
- this.showPopover = false;
27
- this.displayedFilterSettings = undefined;
28
- this.selectedFilters = undefined;
29
- this.filterSearchTerm = '';
30
- this.allSelected = undefined;
31
- }
32
- handleCloseFilter() {
33
- this.showPopover = false;
34
- }
35
- emitFilterEvent() {
36
- this.filterChangeEvent.emit({
37
- selectedFilters: this.selectedFilters,
38
- filterKey: this.filterKey,
39
- allSelected: this.allSelected,
40
- });
41
- }
42
- onFilterButtonClick() {
43
- this.togglePopover();
44
- }
45
- onCloseButtonClick() {
46
- this.togglePopover();
47
- }
48
- onApplyFilterButtonClick() {
49
- this.emitFilterEvent();
50
- this.togglePopover();
51
- }
52
- onFilterOptionSelected(selectedOption) {
53
- this.allSelected = false;
54
- if (this.selectedFilters.includes(selectedOption)) {
55
- this.selectedFilters = this.selectedFilters.filter((filter) => filter != selectedOption);
56
- }
57
- else {
58
- this.selectedFilters = [...this.selectedFilters, selectedOption];
59
- }
60
- }
61
- componentWillLoad() {
62
- this.displayedFilterSettings = this.parseFilterOptions();
63
- if (this.defaultFilterOptions !== undefined) {
64
- const parsedDefaultFilterOptions = this.parseDefaultFilterOptions();
65
- this.selectedFilters = parsedDefaultFilterOptions;
66
- let allSelected = true;
67
- this.parseFilterOptions().map(filterOption => {
68
- if (!this.selectedFilters.includes(filterOption.optionText)) {
69
- allSelected = false;
70
- }
71
- });
72
- this.allSelected = allSelected;
73
- }
74
- else {
75
- this.allSelected = true;
76
- this.selectedFilters = this.displayedFilterSettings.map((filterOption) => filterOption.optionText);
77
- }
78
- }
79
- togglePopover() {
80
- this.showPopover = !this.showPopover;
81
- this.toggleFilter.emit(this.showPopover);
82
- // if(!this.showPopover) {
83
- // // this._focussedElementIndex = -1;
84
- // }
85
- }
86
- // Commented out keyboard interaction for now
87
- // @Listen('keyup')
88
- // handleKeyUp(event: KeyboardEvent) {
89
- // const keyboardEventValue = event.key;
90
- // if (document.activeElement.id != `filter__${this.filterKey}`) return;
91
- // if (event.key == " " || event.code == "Space" || event.keyCode == 32) {
92
- // if (this._focussedElementIndex == 0) {
93
- // this.onSelectAllClick()
94
- // } else {
95
- // const options = this.el.shadowRoot.querySelectorAll('.filter-option') as HTMLElement[];
96
- // this.onFilterOptionSelected(options[this._focussedElementIndex].textContent)
97
- // }
98
- // return;
99
- // }
100
- // switch (keyboardEventValue) {
101
- // case 'Enter':
102
- // if(!this.showPopover) {
103
- // this.showPopover=true
104
- // } else {
105
- // this.emitFilterEvent()
106
- // }
107
- // break;
108
- // case 'Escape':
109
- // this.showPopover = false;
110
- // this._focussedElementIndex = -1;
111
- // break;
112
- // case 'ArrowDown':
113
- // this.showPopover = true;
114
- // if (this._focussedElementIndex == -1) {
115
- // this._focussedElementIndex = 0;
116
- // } else {
117
- // const options = this.el.shadowRoot.querySelectorAll('.filter-option') as HTMLElement[];
118
- // const currentOption = options[this._focussedElementIndex] as HTMLElement;
119
- // currentOption.blur();
120
- // // options[this._focussedElementIndex].focus();
121
- // this._focussedElementIndex + 1 < options.length ? this._focussedElementIndex++ : (this._focussedElementIndex = 0);
122
- // }
123
- // break;
124
- // case 'ArrowUp':
125
- // if (this._focussedElementIndex == -1) {
126
- // this.showPopover = true;
127
- // this._focussedElementIndex = 0;
128
- // } else {
129
- // const options = this.el.shadowRoot.querySelectorAll('.filter-option') as HTMLElement[];
130
- // const currentOption = options[this._focussedElementIndex] as HTMLElement;
131
- // currentOption.blur();
132
- // // options[this._focussedElementIndex].focus();
133
- // this._focussedElementIndex > 0 ? this._focussedElementIndex-- : (this._focussedElementIndex = options.length - 1);
134
- // }
135
- // break;
136
- // }
137
- // }
138
- handleFilterChange(event) {
139
- const target = event.target;
140
- this.filterSearchTerm = target.value;
141
- const filteredResults = this.parseFilterOptions().filter((filterOption) => {
142
- const lowercaseOption = filterOption.optionText.toLowerCase();
143
- const filterTerm = this.filterSearchTerm.toLowerCase();
144
- return lowercaseOption.includes(filterTerm);
145
- });
146
- this.displayedFilterSettings = filteredResults;
147
- }
148
- onSelectAllClick() {
149
- this.allSelected = !this.allSelected;
150
- if (this.allSelected) {
151
- this.displayedFilterSettings.forEach((filterSetting) => { this.selectedFilters = [...this.selectedFilters, filterSetting.optionText]; });
152
- }
153
- else {
154
- this.selectedFilters = [];
155
- }
156
- }
157
- getFilterButtonClassName(buttonStyle) {
158
- switch (buttonStyle) {
159
- case 'table icon': {
160
- return '--table-icon';
161
- }
162
- case 'list icon': {
163
- return '--list-icon';
164
- }
165
- default: {
166
- return '';
167
- }
168
- }
169
- }
170
- parseFilterOptions() {
171
- return typeof this.filterOptions === 'string' ? JSON.parse(this.filterOptions) : this.filterOptions;
172
- }
173
- parseDefaultFilterOptions() {
174
- return typeof this.defaultFilterOptions === 'string' ? JSON.parse(this.defaultFilterOptions) : this.defaultFilterOptions;
175
- }
176
- render() {
177
- const filterPopoverContainerClassNameModifier = this.showSearchField ? '--with-search-field' : '';
178
- const selectAllCheckboxIcon = this.allSelected ? 'check_box' : 'check_box_outline_blank';
179
- const selectAllCheckboxColor = this.allSelected ? 'blue' : 'grey';
180
- const buttonStyleClassNameModifier = this.getFilterButtonClassName(this.filterButtonStyle);
181
- const filterKey = `filter__${this.filterKey}`;
182
- 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}`, style: { width: this.popoverWidth } }, 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) => {
183
- const checkboxIcon = this.selectedFilters.includes(option.optionText) ? 'check_box' : 'check_box_outline_blank';
184
- const checkboxColor = this.selectedFilters.includes(option.optionText) ? 'blue' : 'grey';
185
- 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));
186
- })), 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")))))));
187
- }
188
- get el() { return this; }
189
- static get style() { return tttxFilterCss; }
190
- }, [1, "tttx-filter", {
191
- "filterKey": [1, "filter-key"],
192
- "filterOptions": [1, "filter-options"],
193
- "showSelectAll": [4, "show-select-all"],
194
- "showSearchField": [4, "show-search-field"],
195
- "showOptionIcons": [4, "show-option-icons"],
196
- "filterButtonStyle": [1, "filter-button-style"],
197
- "filterHeader": [1, "filter-header"],
198
- "defaultFilterOptions": [1, "default-filter-options"],
199
- "popoverWidth": [1, "popover-width"],
200
- "showPopover": [32],
201
- "displayedFilterSettings": [32],
202
- "selectedFilters": [32],
203
- "filterSearchTerm": [32],
204
- "allSelected": [32]
205
- }, [[0, "closeFilter", "handleCloseFilter"]]]);
206
- function defineCustomElement$1() {
207
- if (typeof customElements === "undefined") {
208
- return;
209
- }
210
- const components = ["tttx-filter", "tttx-icon"];
211
- components.forEach(tagName => { switch (tagName) {
212
- case "tttx-filter":
213
- if (!customElements.get(tagName)) {
214
- customElements.define(tagName, TttxFilter$1);
215
- }
216
- break;
217
- case "tttx-icon":
218
- if (!customElements.get(tagName)) {
219
- defineCustomElement$2();
220
- }
221
- break;
222
- } });
223
- }
1
+ import { T as TttxFilter$1, d as defineCustomElement$1 } from './tttx-filter2.js';
224
2
 
225
3
  const TttxFilter = TttxFilter$1;
226
4
  const defineCustomElement = defineCustomElement$1;
@@ -1,10 +1,13 @@
1
- import { r as registerInstance, c as createEvent, h, H as Host, g as getElement } from './index-65b1e0d1.js';
1
+ import { proxyCustomElement, HTMLElement, createEvent, h, Host } from '@stencil/core/internal/client';
2
+ import { d as defineCustomElement$1 } from './tttx-icon2.js';
2
3
 
3
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;cursor:pointer}@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:8px 16px}.filter-container .filter-popover-container .filter-header{color:#757575;text-transform:uppercase;font-size:14px;font-weight:500;font-family:\"Roboto\", serif;padding-top:4px;padding-bottom:5px}.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;padding-bottom:8px}.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}.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;width:100%;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}";
4
5
 
5
- const TttxFilter = class {
6
- constructor(hostRef) {
7
- registerInstance(this, hostRef);
6
+ const TttxFilter = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
7
+ constructor() {
8
+ super();
9
+ this.__registerHost();
10
+ this.__attachShadow();
8
11
  this.filterChangeEvent = createEvent(this, "filterChangeEvent", 7);
9
12
  this.toggleFilter = createEvent(this, "toggleFilter", 7);
10
13
  this.filterKey = undefined;
@@ -182,8 +185,41 @@ const TttxFilter = class {
182
185
  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));
183
186
  })), 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")))))));
184
187
  }
185
- get el() { return getElement(this); }
186
- };
187
- TttxFilter.style = tttxFilterCss;
188
+ get el() { return this; }
189
+ static get style() { return tttxFilterCss; }
190
+ }, [1, "tttx-filter", {
191
+ "filterKey": [1, "filter-key"],
192
+ "filterOptions": [1, "filter-options"],
193
+ "showSelectAll": [4, "show-select-all"],
194
+ "showSearchField": [4, "show-search-field"],
195
+ "showOptionIcons": [4, "show-option-icons"],
196
+ "filterButtonStyle": [1, "filter-button-style"],
197
+ "filterHeader": [1, "filter-header"],
198
+ "defaultFilterOptions": [1, "default-filter-options"],
199
+ "popoverWidth": [1, "popover-width"],
200
+ "showPopover": [32],
201
+ "displayedFilterSettings": [32],
202
+ "selectedFilters": [32],
203
+ "filterSearchTerm": [32],
204
+ "allSelected": [32]
205
+ }, [[0, "closeFilter", "handleCloseFilter"]]]);
206
+ function defineCustomElement() {
207
+ if (typeof customElements === "undefined") {
208
+ return;
209
+ }
210
+ const components = ["tttx-filter", "tttx-icon"];
211
+ components.forEach(tagName => { switch (tagName) {
212
+ case "tttx-filter":
213
+ if (!customElements.get(tagName)) {
214
+ customElements.define(tagName, TttxFilter);
215
+ }
216
+ break;
217
+ case "tttx-icon":
218
+ if (!customElements.get(tagName)) {
219
+ defineCustomElement$1();
220
+ }
221
+ break;
222
+ } });
223
+ }
188
224
 
189
- export { TttxFilter as tttx_filter };
225
+ export { TttxFilter as T, defineCustomElement as d };