@3t-transform/threeteeui 0.1.65 → 0.1.67
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/tttx-list.cjs.entry.js +51 -10
- package/dist/cjs/tttx-tag.cjs.entry.js +21 -0
- package/dist/cjs/tttx.cjs.js +1 -1
- package/dist/collection/collection-manifest.json +1 -0
- package/dist/collection/components/atoms/tttx-tag/tttx-tag.css +180 -0
- package/dist/collection/components/atoms/tttx-tag/tttx-tag.js +62 -0
- package/dist/collection/components/atoms/tttx-tag/tttx-tag.stories.js +39 -0
- package/dist/collection/components/molecules/tttx-list/tttx-list.css +29 -8
- package/dist/collection/components/molecules/tttx-list/tttx-list.js +97 -11
- package/dist/collection/components/molecules/tttx-list/tttx-list.stories.js +78 -3
- package/dist/components/index.d.ts +1 -0
- package/dist/components/index.js +1 -0
- package/dist/components/tttx-list.js +54 -11
- package/dist/components/tttx-tag.d.ts +11 -0
- package/dist/components/tttx-tag.js +38 -0
- package/dist/esm/loader.js +1 -1
- package/dist/esm/tttx-list.entry.js +51 -10
- package/dist/esm/tttx-tag.entry.js +17 -0
- package/dist/esm/tttx.js +1 -1
- package/dist/tttx/p-40c66a2e.entry.js +1 -0
- package/dist/tttx/p-68680d65.entry.js +1 -0
- package/dist/tttx/tttx.esm.js +1 -1
- package/dist/types/components/atoms/tttx-tag/tttx-tag.d.ts +5 -0
- package/dist/types/components/atoms/tttx-tag/tttx-tag.stories.d.ts +21 -0
- package/dist/types/components/molecules/tttx-list/interfaces.d.ts +7 -4
- package/dist/types/components/molecules/tttx-list/tttx-list.d.ts +16 -2
- package/dist/types/components/molecules/tttx-list/tttx-list.stories.d.ts +1 -0
- package/dist/types/components.d.ts +20 -1
- package/package.json +1 -1
- package/dist/tttx/p-cec36804.entry.js +0 -1
|
@@ -4,7 +4,7 @@ export default {
|
|
|
4
4
|
component: 'tttx-list',
|
|
5
5
|
parameters: {
|
|
6
6
|
actions: {
|
|
7
|
-
handles: ['listRowClick'],
|
|
7
|
+
handles: ['listRowClick', 'listRowCheckboxClick'],
|
|
8
8
|
},
|
|
9
9
|
},
|
|
10
10
|
decorators: [withActions],
|
|
@@ -21,7 +21,7 @@ BasicStringList.args = {
|
|
|
21
21
|
data: [
|
|
22
22
|
{ icon: 'chevron_right', element: '<span><tttx-icon icon="egg" color="green" /></span> Demulon 1,000,000' },
|
|
23
23
|
{ icon: 'chevron_right', element: '<span><tttx-icon icon="egg" color="green" /></span> Patrick' },
|
|
24
|
-
{ icon: 'chevron_right', element: '<span><tttx-icon icon="egg" color="orange" /></span> Lee' },
|
|
24
|
+
{ icon: 'chevron_right', element: '<span><tttx-icon icon="egg" color="orange" /></span> Lee', clickable: true },
|
|
25
25
|
{ element: '<span><tttx-icon icon="egg" color="red" /></span> Ben' },
|
|
26
26
|
],
|
|
27
27
|
};
|
|
@@ -61,7 +61,12 @@ const TemplateClickableList = ({ data }) => `
|
|
|
61
61
|
export const BasicClickableList = TemplateClickableList.bind({});
|
|
62
62
|
BasicClickableList.args = {
|
|
63
63
|
data: [
|
|
64
|
-
{
|
|
64
|
+
{
|
|
65
|
+
clickable: true,
|
|
66
|
+
icon: 'chevron_right',
|
|
67
|
+
element: '<span><tttx-icon icon="egg" /></span> Demulon 1,000,000',
|
|
68
|
+
rowData: '[{ "name": "Demulon 1,000,000" }]',
|
|
69
|
+
},
|
|
65
70
|
{ clickable: true, icon: 'chevron_right', element: '<span><tttx-icon icon="egg" color="red" /></span> Emma', rowData: [{ name: 'Emma' }] },
|
|
66
71
|
{ clickable: true, icon: 'chevron_right', element: '<span><tttx-icon icon="egg" color="green" /></span> Eulogio', rowData: 'Eulogio' },
|
|
67
72
|
{ clickable: true, icon: 'chevron_right', element: '<span><tttx-icon icon="egg" color="red" /></span> Patrick' },
|
|
@@ -69,3 +74,73 @@ BasicClickableList.args = {
|
|
|
69
74
|
{ icon: 'chevron_right', element: '<span><tttx-icon icon="egg" /></span> Ben' },
|
|
70
75
|
],
|
|
71
76
|
};
|
|
77
|
+
const TemplateWorkerList = ({ data }) => `
|
|
78
|
+
<tttx-list
|
|
79
|
+
id='workersList'
|
|
80
|
+
name='workersList'
|
|
81
|
+
></tttx-list>
|
|
82
|
+
<script>
|
|
83
|
+
if(!workersList) {
|
|
84
|
+
const workersList = document.getElementId('workersList');
|
|
85
|
+
}
|
|
86
|
+
workersList.data = ${JSON.stringify(data)};
|
|
87
|
+
</script>
|
|
88
|
+
`;
|
|
89
|
+
export const WorkerList = TemplateWorkerList.bind({});
|
|
90
|
+
WorkerList.args = {
|
|
91
|
+
data: [
|
|
92
|
+
{
|
|
93
|
+
key: '54c5b6fd-12d1-4794-92cb-93f4c2e1a892',
|
|
94
|
+
hasCheckbox: true,
|
|
95
|
+
clickable: true,
|
|
96
|
+
icon: 'chevron_right',
|
|
97
|
+
element: `
|
|
98
|
+
<div style="display: flex; flex-direction: row; align-items: flex-start;">
|
|
99
|
+
<label>
|
|
100
|
+
<ul style="list-style-type: none; padding: 0; margin: 0;">
|
|
101
|
+
<li>
|
|
102
|
+
<span style="padding: 8px; display: inline-flex; align-items: center;">
|
|
103
|
+
<a style="font-weight: 500; color: #146EB3; text-decoration: none;" href>Worker name</a>
|
|
104
|
+
</span>
|
|
105
|
+
<span style="padding: 8px; display: inline-flex; align-items: center; gap: 4px;">
|
|
106
|
+
<span style="color: #757575;">ID:</span> <span style="color: #212121;">9125</span>
|
|
107
|
+
</span>
|
|
108
|
+
</li>
|
|
109
|
+
<li>
|
|
110
|
+
<span style="padding: 8px; display: inline-flex; align-items: center; gap: 8px;">
|
|
111
|
+
<tttx-tag text="Driller" color="#EABFFF"></tttx-tag>
|
|
112
|
+
<tttx-tag text="Offshore" color="#9BE8D5"></tttx-tag>
|
|
113
|
+
<tttx-tag text="3t Transform" color="#B9CCF5"></tttx-tag>
|
|
114
|
+
</span>
|
|
115
|
+
</li>
|
|
116
|
+
<li>
|
|
117
|
+
<span style="padding: 8px; display: inline-flex; align-items: center; gap: 8px;">
|
|
118
|
+
<span><tttx-icon icon="school" color="gray" /></span><span><tttx-icon icon="check_circle" color="green" /></span> 80%
|
|
119
|
+
</span>
|
|
120
|
+
<span style="padding: 8px; display: inline-flex; align-items: center; gap: 8px;">
|
|
121
|
+
<span><tttx-icon icon="verified_user" color="gray" /></span><span><tttx-icon icon="warning" color="orange" /></span> 60%
|
|
122
|
+
</span>
|
|
123
|
+
</li>
|
|
124
|
+
</ul>
|
|
125
|
+
</label>
|
|
126
|
+
</div>
|
|
127
|
+
`,
|
|
128
|
+
rowData: '{ "name": "Worker name", "id": 9125, "groups": ["Driller", "Offshore", "3t Transform"], "compliance": 80, "competence": 60 }',
|
|
129
|
+
},
|
|
130
|
+
{
|
|
131
|
+
key: 'a5df3398-2bd0-4e16-83a1-b962b74dc712',
|
|
132
|
+
clickable: true,
|
|
133
|
+
icon: 'chevron_right',
|
|
134
|
+
element: `
|
|
135
|
+
<div style="display: flex; flex-direction: row; align-items: center; gap: 8px;">
|
|
136
|
+
<span><tttx-icon icon="check_circle" color="green" /></span>
|
|
137
|
+
Qualification row
|
|
138
|
+
<tttx-tag text="Vantage" color="#D5D5D5"></tttx-tag>
|
|
139
|
+
<span style="color: #757575;">Awarded:</span> <span style="color: #212121;">10 Jan 2022</span>
|
|
140
|
+
<span style="color: #757575;">Expiry:</span> <span style="color: #212121;">10 Jan 2023</span>
|
|
141
|
+
</div>
|
|
142
|
+
`,
|
|
143
|
+
rowData: 'any data',
|
|
144
|
+
},
|
|
145
|
+
],
|
|
146
|
+
};
|
|
@@ -11,6 +11,7 @@ export { TttxQrCode as TttxQrcode } from '../types/components/atoms/tttx-qrcode/
|
|
|
11
11
|
export { TttxSelectBox as TttxSelectBox } from '../types/components/molecules/tttx-select-box/tttx-select-box';
|
|
12
12
|
export { TttxSorter as TttxSorter } from '../types/components/molecules/tttx-sorter/tttx-sorter';
|
|
13
13
|
export { TttxInput as TttxStandaloneInput } from '../types/components/molecules/tttx-standalone-input/tttx-standalone-input';
|
|
14
|
+
export { TttxTag as TttxTag } from '../types/components/atoms/tttx-tag/tttx-tag';
|
|
14
15
|
export { TttxToolbar as TttxToolbar } from '../types/components/molecules/tttx-toolbar/tttx-toolbar';
|
|
15
16
|
export { TttxTreeView as TttxTreeView } from '../types/components/molecules/tttx-tree-view/tttx-tree-view';
|
|
16
17
|
|
package/dist/components/index.js
CHANGED
|
@@ -11,5 +11,6 @@ export { TttxQrcode, defineCustomElement as defineCustomElementTttxQrcode } from
|
|
|
11
11
|
export { TttxSelectBox, defineCustomElement as defineCustomElementTttxSelectBox } from './tttx-select-box.js';
|
|
12
12
|
export { TttxSorter, defineCustomElement as defineCustomElementTttxSorter } from './tttx-sorter.js';
|
|
13
13
|
export { TttxStandaloneInput, defineCustomElement as defineCustomElementTttxStandaloneInput } from './tttx-standalone-input.js';
|
|
14
|
+
export { TttxTag, defineCustomElement as defineCustomElementTttxTag } from './tttx-tag.js';
|
|
14
15
|
export { TttxToolbar, defineCustomElement as defineCustomElementTttxToolbar } from './tttx-toolbar.js';
|
|
15
16
|
export { TttxTreeView, defineCustomElement as defineCustomElementTttxTreeView } from './tttx-tree-view.js';
|
|
@@ -2,7 +2,7 @@ import { proxyCustomElement, HTMLElement, createEvent, h } from '@stencil/core/i
|
|
|
2
2
|
import { p as purify, d as domSanitiserOptions } from './domsanitiser.options.js';
|
|
3
3
|
import { d as defineCustomElement$2 } from './tttx-icon2.js';
|
|
4
4
|
|
|
5
|
-
const tttxListCss = ".material-symbols-rounded{font-variation-settings:\"FILL\" 1, \"wght\" 400, \"GRAD\" 0, \"opsz\" 24}.material-symbols-rounded{font-family:\"Material Symbols Rounded\", sans-serif;font-weight:400;font-style:normal;font-size:24px;line-height:1;letter-spacing:normal;text-transform:none;display:inline-block;white-space:nowrap;word-wrap:normal;direction:ltr;text-rendering:optimizeLegibility;-webkit-font-smoothing:antialiased;color:#9e9e9e}:host{display:flex;flex-direction:column}.list{margin:0;padding:0}.item{list-style:none;margin:0;padding:8px;border-bottom:1px solid #d5d5d5;min-height:36px
|
|
5
|
+
const tttxListCss = ".material-symbols-rounded{font-variation-settings:\"FILL\" 1, \"wght\" 400, \"GRAD\" 0, \"opsz\" 24}.material-symbols-rounded{font-family:\"Material Symbols Rounded\", sans-serif;font-weight:400;font-style:normal;font-size:24px;line-height:1;letter-spacing:normal;text-transform:none;display:inline-block;white-space:nowrap;word-wrap:normal;direction:ltr;text-rendering:optimizeLegibility;-webkit-font-smoothing:antialiased;color:#9e9e9e}:host{display:flex;flex-direction:column}.list{margin:0;padding:0}li{display:flex;align-items:flex-start}li.item{list-style:none;margin:0;padding:8px;border-bottom:1px solid #d5d5d5;min-height:36px}li.item:first-of-type{border-top:1px solid #d5d5d5}li.item.clickable:hover{cursor:pointer}li.item.clickable:active{background-color:#e6e6e6}li.item .icons{display:flex;justify-content:flex-end;flex-grow:1;align-items:center;height:36px}li.item .icons tttx-icon:hover{cursor:pointer}li.item .icons *{display:flex}li:hover{background-color:#1111110D}.align-right{margin-left:auto}.item-content{display:flex;align-items:center;flex-grow:2;min-height:36px}.checkbox{padding:6px;margin-left:-8px}";
|
|
6
6
|
|
|
7
7
|
const TttxList$1 = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
|
|
8
8
|
constructor() {
|
|
@@ -10,35 +10,78 @@ const TttxList$1 = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
|
|
|
10
10
|
this.__registerHost();
|
|
11
11
|
this.__attachShadow();
|
|
12
12
|
this.rowClick = createEvent(this, "listRowClick", 7);
|
|
13
|
+
this.rowCheckboxClick = createEvent(this, "listRowCheckboxClick", 7);
|
|
13
14
|
this.data = undefined;
|
|
15
|
+
this._data = undefined;
|
|
14
16
|
this.name = undefined;
|
|
15
17
|
}
|
|
18
|
+
onDataChange() {
|
|
19
|
+
if (!this.data) {
|
|
20
|
+
return;
|
|
21
|
+
}
|
|
22
|
+
if (typeof this.data === 'string') {
|
|
23
|
+
this._data = JSON.parse(this.data);
|
|
24
|
+
}
|
|
25
|
+
else {
|
|
26
|
+
this._data = [...this.data];
|
|
27
|
+
}
|
|
28
|
+
for (const data of this._data) {
|
|
29
|
+
if (data.hasCheckbox && data.checked === undefined) {
|
|
30
|
+
data.checked = false;
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
componentWillLoad() {
|
|
35
|
+
// dynamic constructor: any props can be added later
|
|
36
|
+
this.onDataChange();
|
|
37
|
+
}
|
|
38
|
+
onRowCheckboxHandler(event, item) {
|
|
39
|
+
event.stopPropagation();
|
|
40
|
+
if (!item.rowData)
|
|
41
|
+
return;
|
|
42
|
+
if (item.hasCheckbox) {
|
|
43
|
+
item.checked = !item.checked;
|
|
44
|
+
}
|
|
45
|
+
// re-render component by updating its state
|
|
46
|
+
this._data = [...this._data];
|
|
47
|
+
this.rowCheckboxClick.emit({ key: item.key, name: this.name, data: item.rowData, checked: item.checked });
|
|
48
|
+
}
|
|
16
49
|
onRowClickHandler(item) {
|
|
17
50
|
if (!item.clickable || !item.rowData)
|
|
18
51
|
return;
|
|
19
|
-
this.rowClick.emit({ name: this.name, data: item.rowData });
|
|
52
|
+
this.rowClick.emit({ key: item.key, name: this.name, data: item.rowData });
|
|
53
|
+
}
|
|
54
|
+
async setAllCheckboxes(check) {
|
|
55
|
+
for (const data of this._data) {
|
|
56
|
+
if (data.hasCheckbox) {
|
|
57
|
+
data.checked = check;
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
// re-render component by updating its state
|
|
61
|
+
this._data = [...this._data];
|
|
20
62
|
}
|
|
21
63
|
renderListItem(item) {
|
|
22
64
|
const cleanHTML = purify.sanitize(item.element, domSanitiserOptions);
|
|
23
65
|
return (h("li", { class: `item ${item.clickable ? 'clickable' : ''}`, onClick: () => {
|
|
24
66
|
this.onRowClickHandler(item);
|
|
25
|
-
} }, item.
|
|
67
|
+
} }, item.hasCheckbox && (h("div", { class: "checkbox" }, h("tttx-icon", { icon: item.checked ? 'check_box' : 'check_box_outline_blank', color: item.checked ? 'blue' : 'grey', onClick: event => {
|
|
68
|
+
this.onRowCheckboxHandler(event, item);
|
|
69
|
+
} }))), item.element && h("span", { class: "item-content", innerHTML: cleanHTML }), item.icon && (h("span", { class: "icons" }, h("tttx-icon", { class: "align-right", icon: item.icon, color: 'black' })))));
|
|
26
70
|
}
|
|
27
71
|
render() {
|
|
28
|
-
if (!this.
|
|
72
|
+
if (!this._data)
|
|
29
73
|
return;
|
|
30
|
-
if (typeof this.data === 'string') {
|
|
31
|
-
this._data = JSON.parse(this.data);
|
|
32
|
-
}
|
|
33
|
-
else {
|
|
34
|
-
this._data = this.data;
|
|
35
|
-
}
|
|
36
74
|
return h("ul", { class: "list" }, this._data.map((item) => this.renderListItem(item)));
|
|
37
75
|
}
|
|
76
|
+
static get watchers() { return {
|
|
77
|
+
"data": ["onDataChange"]
|
|
78
|
+
}; }
|
|
38
79
|
static get style() { return tttxListCss; }
|
|
39
80
|
}, [1, "tttx-list", {
|
|
40
81
|
"data": [1025],
|
|
41
|
-
"name": [1]
|
|
82
|
+
"name": [1],
|
|
83
|
+
"_data": [32],
|
|
84
|
+
"setAllCheckboxes": [64]
|
|
42
85
|
}]);
|
|
43
86
|
function defineCustomElement$1() {
|
|
44
87
|
if (typeof customElements === "undefined") {
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { Components, JSX } from "../types/components";
|
|
2
|
+
|
|
3
|
+
interface TttxTag extends Components.TttxTag, HTMLElement {}
|
|
4
|
+
export const TttxTag: {
|
|
5
|
+
prototype: TttxTag;
|
|
6
|
+
new (): TttxTag;
|
|
7
|
+
};
|
|
8
|
+
/**
|
|
9
|
+
* Used to define this component and all nested components recursively.
|
|
10
|
+
*/
|
|
11
|
+
export const defineCustomElement: () => void;
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { proxyCustomElement, HTMLElement, h, Host } from '@stencil/core/internal/client';
|
|
2
|
+
|
|
3
|
+
const tttxTagCss = ".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:active{background:rgba(17, 17, 17, 0.2);border:1px solid #d5d5d5}.primary{background:#1479c6;border:1px solid #1479c6;color:white}.primary:active{background:#1464a2;border:1px solid #1464a2}.borderless{background:transparent;border:none;color:#212121}.borderless:active{background:rgba(17, 17, 17, 0.2);border:none}.borderless-circle{background:transparent;border:none;color:#212121;border-radius:50%}.borderless-circle:active{border:none}.borderless-circle:focus{border-color:transparent}.danger{background:#dc0000;border:1px solid #dc0000;color:white}.danger:active{background:#b00000;border:1px solid #b00000}.disabled{background:#aeaeae;border:none;color:#4c4c4c;cursor:not-allowed}.disabled:active{background:#aeaeae;border:none;color:#4c4c4c;cursor:not-allowed}@media (hover: hover){.button:hover{background:rgba(17, 17, 17, 0.1);border:1px solid #d5d5d5}.primary:hover{background:#146eb3;border:1px solid #146eb3}.borderless:hover{background:rgba(17, 17, 17, 0.1);border:none}.borderless-circle:hover{background:rgba(17, 17, 17, 0.1);border:none}.danger:hover{background:#c60000;border:1px solid #c60000}.disabled:hover{background:#aeaeae;border:none;color:#4c4c4c;cursor:not-allowed}}:host{display:inline-block}.tag{border-radius:20px;padding:4px;font-family:\"Roboto\", sans-serif;font-size:14px;font-weight:400}.tag span{margin-left:4px;margin-right:4px;color:#212121}.icon{height:18px;width:18px;font-weight:400}";
|
|
4
|
+
|
|
5
|
+
const TttxTag$1 = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
|
|
6
|
+
constructor() {
|
|
7
|
+
super();
|
|
8
|
+
this.__registerHost();
|
|
9
|
+
this.__attachShadow();
|
|
10
|
+
this.text = undefined;
|
|
11
|
+
this.color = '#d5d5d5';
|
|
12
|
+
}
|
|
13
|
+
render() {
|
|
14
|
+
return (h(Host, null, h("div", { class: "tag", style: { 'background-color': this.color } }, h("span", null, this.text))));
|
|
15
|
+
}
|
|
16
|
+
static get style() { return tttxTagCss; }
|
|
17
|
+
}, [1, "tttx-tag", {
|
|
18
|
+
"text": [1],
|
|
19
|
+
"color": [1]
|
|
20
|
+
}]);
|
|
21
|
+
function defineCustomElement$1() {
|
|
22
|
+
if (typeof customElements === "undefined") {
|
|
23
|
+
return;
|
|
24
|
+
}
|
|
25
|
+
const components = ["tttx-tag"];
|
|
26
|
+
components.forEach(tagName => { switch (tagName) {
|
|
27
|
+
case "tttx-tag":
|
|
28
|
+
if (!customElements.get(tagName)) {
|
|
29
|
+
customElements.define(tagName, TttxTag$1);
|
|
30
|
+
}
|
|
31
|
+
break;
|
|
32
|
+
} });
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
const TttxTag = TttxTag$1;
|
|
36
|
+
const defineCustomElement = defineCustomElement$1;
|
|
37
|
+
|
|
38
|
+
export { TttxTag, defineCustomElement };
|
package/dist/esm/loader.js
CHANGED
|
@@ -11,7 +11,7 @@ const patchEsm = () => {
|
|
|
11
11
|
const defineCustomElements = (win, options) => {
|
|
12
12
|
if (typeof window === 'undefined') return Promise.resolve();
|
|
13
13
|
return patchEsm().then(() => {
|
|
14
|
-
return bootstrapLazy([["tttx-dialog-box",[[1,"tttx-dialog-box",{"data":[1025],"size":[1],"open":[1028],"elementSize":[32]},[[9,"resize","handleResize"]]]]],["tttx-select-box",[[1,"tttx-select-box",{"optionsData":[1,"options-data"],"label":[1],"inline":[4],"placeholder":[1],"searchEnabled":[4,"search-enabled"],"open":[32],"selectedItem":[32],"searchTerm":[32]},[[0,"closeSelectBox","handleCloseSelectBox"],[0,"blur","handleBlur"]]]]],["tttx-tree-view",[[1,"tttx-tree-view",{"data":[1040],"treeData":[32]}]]],["tttx-filter",[[1,"tttx-filter",{"filterKey":[1,"filter-key"],"filterOptions":[1,"filter-options"],"showSelectAll":[4,"show-select-all"],"showSearchField":[4,"show-search-field"],"showOptionIcons":[4,"show-option-icons"],"filterButtonStyle":[1,"filter-button-style"],"filterHeader":[1,"filter-header"],"defaultFilterOptions":[1,"default-filter-options"],"popoverWidth":[1,"popover-width"],"showPopover":[32],"displayedFilterSettings":[32],"selectedFilters":[32],"filterSearchTerm":[32],"allSelected":[32]},[[0,"closeFilter","handleCloseFilter"]]]]],["tttx-list",[[1,"tttx-list",{"data":[1025],"name":[1]}]]],["tttx-sorter",[[1,"tttx-sorter",{"sorterKey":[1,"sorter-key"],"defaultSortDirection":[1,"default-sort-direction"],"fieldOptionsData":[1,"field-options-data"],"defaultOption":[1,"default-option"],"selectedField":[32],"sortDirection":[32],"dropdownExpand":[32],"dropdownOptions":[32]},[[0,"closeSorter","handleCloseSorter"]]]]],["tttx-form",[[1,"tttx-form",{"formschema":[1032],"data":[1032],"submit":[64]}]]],["tttx-keyvalue-block",[[1,"tttx-keyvalue-block",{"keyvalues":[8],"horizontal":[4]}]]],["tttx-loading-spinner",[[1,"tttx-loading-spinner",{"loadingMessage":[1028,"loading-message"],"size":[1025]}]]],["tttx-qrcode",[[1,"tttx-qrcode",{"link":[1025],"size":[1026]}]]],["tttx-toolbar",[[1,"tttx-toolbar",{"border":[4]}]]],["tttx-icon",[[1,"tttx-icon",{"icon":[1],"color":[1]}]]],["tttx-standalone-input",[[2,"tttx-standalone-input",{"label":[1],"secondarylabel":[1],"showerrormsg":[4],"showerrorbubble":[4],"errormsg":[1],"iconleft":[1],"iconleftcolor":[1],"iconright":[1],"iconrightcolor":[1],"inputicon":[1],"inputiconcolor":[1],"inline":[4],"inputautocapitalize":[1],"inputautofocus":[4],"inputkeyhint":[1],"inputindex":[8],"inputtitle":[1],"autocomplete":[1],"checked":[4],"disabled":[4],"max":[8],"maxlength":[8],"min":[8],"minlength":[8],"name":[1],"pattern":[1],"placeholder":[1],"readonly":[8],"required":[4],"step":[8],"type":[1],"value":[1032]}]]],["tttx-button",[[1,"tttx-button",{"notext":[4],"icon":[1],"iconposition":[1],"iconcolor":[1025],"design":[1]}]]]], options);
|
|
14
|
+
return bootstrapLazy([["tttx-dialog-box",[[1,"tttx-dialog-box",{"data":[1025],"size":[1],"open":[1028],"elementSize":[32]},[[9,"resize","handleResize"]]]]],["tttx-select-box",[[1,"tttx-select-box",{"optionsData":[1,"options-data"],"label":[1],"inline":[4],"placeholder":[1],"searchEnabled":[4,"search-enabled"],"open":[32],"selectedItem":[32],"searchTerm":[32]},[[0,"closeSelectBox","handleCloseSelectBox"],[0,"blur","handleBlur"]]]]],["tttx-tree-view",[[1,"tttx-tree-view",{"data":[1040],"treeData":[32]}]]],["tttx-filter",[[1,"tttx-filter",{"filterKey":[1,"filter-key"],"filterOptions":[1,"filter-options"],"showSelectAll":[4,"show-select-all"],"showSearchField":[4,"show-search-field"],"showOptionIcons":[4,"show-option-icons"],"filterButtonStyle":[1,"filter-button-style"],"filterHeader":[1,"filter-header"],"defaultFilterOptions":[1,"default-filter-options"],"popoverWidth":[1,"popover-width"],"showPopover":[32],"displayedFilterSettings":[32],"selectedFilters":[32],"filterSearchTerm":[32],"allSelected":[32]},[[0,"closeFilter","handleCloseFilter"]]]]],["tttx-list",[[1,"tttx-list",{"data":[1025],"name":[1],"_data":[32],"setAllCheckboxes":[64]}]]],["tttx-sorter",[[1,"tttx-sorter",{"sorterKey":[1,"sorter-key"],"defaultSortDirection":[1,"default-sort-direction"],"fieldOptionsData":[1,"field-options-data"],"defaultOption":[1,"default-option"],"selectedField":[32],"sortDirection":[32],"dropdownExpand":[32],"dropdownOptions":[32]},[[0,"closeSorter","handleCloseSorter"]]]]],["tttx-form",[[1,"tttx-form",{"formschema":[1032],"data":[1032],"submit":[64]}]]],["tttx-keyvalue-block",[[1,"tttx-keyvalue-block",{"keyvalues":[8],"horizontal":[4]}]]],["tttx-loading-spinner",[[1,"tttx-loading-spinner",{"loadingMessage":[1028,"loading-message"],"size":[1025]}]]],["tttx-qrcode",[[1,"tttx-qrcode",{"link":[1025],"size":[1026]}]]],["tttx-tag",[[1,"tttx-tag",{"text":[1],"color":[1]}]]],["tttx-toolbar",[[1,"tttx-toolbar",{"border":[4]}]]],["tttx-icon",[[1,"tttx-icon",{"icon":[1],"color":[1]}]]],["tttx-standalone-input",[[2,"tttx-standalone-input",{"label":[1],"secondarylabel":[1],"showerrormsg":[4],"showerrorbubble":[4],"errormsg":[1],"iconleft":[1],"iconleftcolor":[1],"iconright":[1],"iconrightcolor":[1],"inputicon":[1],"inputiconcolor":[1],"inline":[4],"inputautocapitalize":[1],"inputautofocus":[4],"inputkeyhint":[1],"inputindex":[8],"inputtitle":[1],"autocomplete":[1],"checked":[4],"disabled":[4],"max":[8],"maxlength":[8],"min":[8],"minlength":[8],"name":[1],"pattern":[1],"placeholder":[1],"readonly":[8],"required":[4],"step":[8],"type":[1],"value":[1032]}]]],["tttx-button",[[1,"tttx-button",{"notext":[4],"icon":[1],"iconposition":[1],"iconcolor":[1025],"design":[1]}]]]], options);
|
|
15
15
|
});
|
|
16
16
|
};
|
|
17
17
|
|
|
@@ -2,37 +2,78 @@ import { r as registerInstance, c as createEvent, h } from './index-1c711ead.js'
|
|
|
2
2
|
import { p as purify, d as domSanitiserOptions } from './domsanitiser.options-97a33389.js';
|
|
3
3
|
import './_commonjsHelpers-9943807e.js';
|
|
4
4
|
|
|
5
|
-
const tttxListCss = ".material-symbols-rounded{font-variation-settings:\"FILL\" 1, \"wght\" 400, \"GRAD\" 0, \"opsz\" 24}.material-symbols-rounded{font-family:\"Material Symbols Rounded\", sans-serif;font-weight:400;font-style:normal;font-size:24px;line-height:1;letter-spacing:normal;text-transform:none;display:inline-block;white-space:nowrap;word-wrap:normal;direction:ltr;text-rendering:optimizeLegibility;-webkit-font-smoothing:antialiased;color:#9e9e9e}:host{display:flex;flex-direction:column}.list{margin:0;padding:0}.item{list-style:none;margin:0;padding:8px;border-bottom:1px solid #d5d5d5;min-height:36px
|
|
5
|
+
const tttxListCss = ".material-symbols-rounded{font-variation-settings:\"FILL\" 1, \"wght\" 400, \"GRAD\" 0, \"opsz\" 24}.material-symbols-rounded{font-family:\"Material Symbols Rounded\", sans-serif;font-weight:400;font-style:normal;font-size:24px;line-height:1;letter-spacing:normal;text-transform:none;display:inline-block;white-space:nowrap;word-wrap:normal;direction:ltr;text-rendering:optimizeLegibility;-webkit-font-smoothing:antialiased;color:#9e9e9e}:host{display:flex;flex-direction:column}.list{margin:0;padding:0}li{display:flex;align-items:flex-start}li.item{list-style:none;margin:0;padding:8px;border-bottom:1px solid #d5d5d5;min-height:36px}li.item:first-of-type{border-top:1px solid #d5d5d5}li.item.clickable:hover{cursor:pointer}li.item.clickable:active{background-color:#e6e6e6}li.item .icons{display:flex;justify-content:flex-end;flex-grow:1;align-items:center;height:36px}li.item .icons tttx-icon:hover{cursor:pointer}li.item .icons *{display:flex}li:hover{background-color:#1111110D}.align-right{margin-left:auto}.item-content{display:flex;align-items:center;flex-grow:2;min-height:36px}.checkbox{padding:6px;margin-left:-8px}";
|
|
6
6
|
|
|
7
7
|
const TttxList = class {
|
|
8
8
|
constructor(hostRef) {
|
|
9
9
|
registerInstance(this, hostRef);
|
|
10
10
|
this.rowClick = createEvent(this, "listRowClick", 7);
|
|
11
|
+
this.rowCheckboxClick = createEvent(this, "listRowCheckboxClick", 7);
|
|
11
12
|
this.data = undefined;
|
|
13
|
+
this._data = undefined;
|
|
12
14
|
this.name = undefined;
|
|
13
15
|
}
|
|
16
|
+
onDataChange() {
|
|
17
|
+
if (!this.data) {
|
|
18
|
+
return;
|
|
19
|
+
}
|
|
20
|
+
if (typeof this.data === 'string') {
|
|
21
|
+
this._data = JSON.parse(this.data);
|
|
22
|
+
}
|
|
23
|
+
else {
|
|
24
|
+
this._data = [...this.data];
|
|
25
|
+
}
|
|
26
|
+
for (const data of this._data) {
|
|
27
|
+
if (data.hasCheckbox && data.checked === undefined) {
|
|
28
|
+
data.checked = false;
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
componentWillLoad() {
|
|
33
|
+
// dynamic constructor: any props can be added later
|
|
34
|
+
this.onDataChange();
|
|
35
|
+
}
|
|
36
|
+
onRowCheckboxHandler(event, item) {
|
|
37
|
+
event.stopPropagation();
|
|
38
|
+
if (!item.rowData)
|
|
39
|
+
return;
|
|
40
|
+
if (item.hasCheckbox) {
|
|
41
|
+
item.checked = !item.checked;
|
|
42
|
+
}
|
|
43
|
+
// re-render component by updating its state
|
|
44
|
+
this._data = [...this._data];
|
|
45
|
+
this.rowCheckboxClick.emit({ key: item.key, name: this.name, data: item.rowData, checked: item.checked });
|
|
46
|
+
}
|
|
14
47
|
onRowClickHandler(item) {
|
|
15
48
|
if (!item.clickable || !item.rowData)
|
|
16
49
|
return;
|
|
17
|
-
this.rowClick.emit({ name: this.name, data: item.rowData });
|
|
50
|
+
this.rowClick.emit({ key: item.key, name: this.name, data: item.rowData });
|
|
51
|
+
}
|
|
52
|
+
async setAllCheckboxes(check) {
|
|
53
|
+
for (const data of this._data) {
|
|
54
|
+
if (data.hasCheckbox) {
|
|
55
|
+
data.checked = check;
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
// re-render component by updating its state
|
|
59
|
+
this._data = [...this._data];
|
|
18
60
|
}
|
|
19
61
|
renderListItem(item) {
|
|
20
62
|
const cleanHTML = purify.sanitize(item.element, domSanitiserOptions);
|
|
21
63
|
return (h("li", { class: `item ${item.clickable ? 'clickable' : ''}`, onClick: () => {
|
|
22
64
|
this.onRowClickHandler(item);
|
|
23
|
-
} }, item.
|
|
65
|
+
} }, item.hasCheckbox && (h("div", { class: "checkbox" }, h("tttx-icon", { icon: item.checked ? 'check_box' : 'check_box_outline_blank', color: item.checked ? 'blue' : 'grey', onClick: event => {
|
|
66
|
+
this.onRowCheckboxHandler(event, item);
|
|
67
|
+
} }))), item.element && h("span", { class: "item-content", innerHTML: cleanHTML }), item.icon && (h("span", { class: "icons" }, h("tttx-icon", { class: "align-right", icon: item.icon, color: 'black' })))));
|
|
24
68
|
}
|
|
25
69
|
render() {
|
|
26
|
-
if (!this.
|
|
70
|
+
if (!this._data)
|
|
27
71
|
return;
|
|
28
|
-
if (typeof this.data === 'string') {
|
|
29
|
-
this._data = JSON.parse(this.data);
|
|
30
|
-
}
|
|
31
|
-
else {
|
|
32
|
-
this._data = this.data;
|
|
33
|
-
}
|
|
34
72
|
return h("ul", { class: "list" }, this._data.map((item) => this.renderListItem(item)));
|
|
35
73
|
}
|
|
74
|
+
static get watchers() { return {
|
|
75
|
+
"data": ["onDataChange"]
|
|
76
|
+
}; }
|
|
36
77
|
};
|
|
37
78
|
TttxList.style = tttxListCss;
|
|
38
79
|
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { r as registerInstance, h, H as Host } from './index-1c711ead.js';
|
|
2
|
+
|
|
3
|
+
const tttxTagCss = ".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:active{background:rgba(17, 17, 17, 0.2);border:1px solid #d5d5d5}.primary{background:#1479c6;border:1px solid #1479c6;color:white}.primary:active{background:#1464a2;border:1px solid #1464a2}.borderless{background:transparent;border:none;color:#212121}.borderless:active{background:rgba(17, 17, 17, 0.2);border:none}.borderless-circle{background:transparent;border:none;color:#212121;border-radius:50%}.borderless-circle:active{border:none}.borderless-circle:focus{border-color:transparent}.danger{background:#dc0000;border:1px solid #dc0000;color:white}.danger:active{background:#b00000;border:1px solid #b00000}.disabled{background:#aeaeae;border:none;color:#4c4c4c;cursor:not-allowed}.disabled:active{background:#aeaeae;border:none;color:#4c4c4c;cursor:not-allowed}@media (hover: hover){.button:hover{background:rgba(17, 17, 17, 0.1);border:1px solid #d5d5d5}.primary:hover{background:#146eb3;border:1px solid #146eb3}.borderless:hover{background:rgba(17, 17, 17, 0.1);border:none}.borderless-circle:hover{background:rgba(17, 17, 17, 0.1);border:none}.danger:hover{background:#c60000;border:1px solid #c60000}.disabled:hover{background:#aeaeae;border:none;color:#4c4c4c;cursor:not-allowed}}:host{display:inline-block}.tag{border-radius:20px;padding:4px;font-family:\"Roboto\", sans-serif;font-size:14px;font-weight:400}.tag span{margin-left:4px;margin-right:4px;color:#212121}.icon{height:18px;width:18px;font-weight:400}";
|
|
4
|
+
|
|
5
|
+
const TttxTag = class {
|
|
6
|
+
constructor(hostRef) {
|
|
7
|
+
registerInstance(this, hostRef);
|
|
8
|
+
this.text = undefined;
|
|
9
|
+
this.color = '#d5d5d5';
|
|
10
|
+
}
|
|
11
|
+
render() {
|
|
12
|
+
return (h(Host, null, h("div", { class: "tag", style: { 'background-color': this.color } }, h("span", null, this.text))));
|
|
13
|
+
}
|
|
14
|
+
};
|
|
15
|
+
TttxTag.style = tttxTagCss;
|
|
16
|
+
|
|
17
|
+
export { TttxTag as tttx_tag };
|
package/dist/esm/tttx.js
CHANGED
|
@@ -14,5 +14,5 @@ const patchBrowser = () => {
|
|
|
14
14
|
};
|
|
15
15
|
|
|
16
16
|
patchBrowser().then(options => {
|
|
17
|
-
return bootstrapLazy([["tttx-dialog-box",[[1,"tttx-dialog-box",{"data":[1025],"size":[1],"open":[1028],"elementSize":[32]},[[9,"resize","handleResize"]]]]],["tttx-select-box",[[1,"tttx-select-box",{"optionsData":[1,"options-data"],"label":[1],"inline":[4],"placeholder":[1],"searchEnabled":[4,"search-enabled"],"open":[32],"selectedItem":[32],"searchTerm":[32]},[[0,"closeSelectBox","handleCloseSelectBox"],[0,"blur","handleBlur"]]]]],["tttx-tree-view",[[1,"tttx-tree-view",{"data":[1040],"treeData":[32]}]]],["tttx-filter",[[1,"tttx-filter",{"filterKey":[1,"filter-key"],"filterOptions":[1,"filter-options"],"showSelectAll":[4,"show-select-all"],"showSearchField":[4,"show-search-field"],"showOptionIcons":[4,"show-option-icons"],"filterButtonStyle":[1,"filter-button-style"],"filterHeader":[1,"filter-header"],"defaultFilterOptions":[1,"default-filter-options"],"popoverWidth":[1,"popover-width"],"showPopover":[32],"displayedFilterSettings":[32],"selectedFilters":[32],"filterSearchTerm":[32],"allSelected":[32]},[[0,"closeFilter","handleCloseFilter"]]]]],["tttx-list",[[1,"tttx-list",{"data":[1025],"name":[1]}]]],["tttx-sorter",[[1,"tttx-sorter",{"sorterKey":[1,"sorter-key"],"defaultSortDirection":[1,"default-sort-direction"],"fieldOptionsData":[1,"field-options-data"],"defaultOption":[1,"default-option"],"selectedField":[32],"sortDirection":[32],"dropdownExpand":[32],"dropdownOptions":[32]},[[0,"closeSorter","handleCloseSorter"]]]]],["tttx-form",[[1,"tttx-form",{"formschema":[1032],"data":[1032],"submit":[64]}]]],["tttx-keyvalue-block",[[1,"tttx-keyvalue-block",{"keyvalues":[8],"horizontal":[4]}]]],["tttx-loading-spinner",[[1,"tttx-loading-spinner",{"loadingMessage":[1028,"loading-message"],"size":[1025]}]]],["tttx-qrcode",[[1,"tttx-qrcode",{"link":[1025],"size":[1026]}]]],["tttx-toolbar",[[1,"tttx-toolbar",{"border":[4]}]]],["tttx-icon",[[1,"tttx-icon",{"icon":[1],"color":[1]}]]],["tttx-standalone-input",[[2,"tttx-standalone-input",{"label":[1],"secondarylabel":[1],"showerrormsg":[4],"showerrorbubble":[4],"errormsg":[1],"iconleft":[1],"iconleftcolor":[1],"iconright":[1],"iconrightcolor":[1],"inputicon":[1],"inputiconcolor":[1],"inline":[4],"inputautocapitalize":[1],"inputautofocus":[4],"inputkeyhint":[1],"inputindex":[8],"inputtitle":[1],"autocomplete":[1],"checked":[4],"disabled":[4],"max":[8],"maxlength":[8],"min":[8],"minlength":[8],"name":[1],"pattern":[1],"placeholder":[1],"readonly":[8],"required":[4],"step":[8],"type":[1],"value":[1032]}]]],["tttx-button",[[1,"tttx-button",{"notext":[4],"icon":[1],"iconposition":[1],"iconcolor":[1025],"design":[1]}]]]], options);
|
|
17
|
+
return bootstrapLazy([["tttx-dialog-box",[[1,"tttx-dialog-box",{"data":[1025],"size":[1],"open":[1028],"elementSize":[32]},[[9,"resize","handleResize"]]]]],["tttx-select-box",[[1,"tttx-select-box",{"optionsData":[1,"options-data"],"label":[1],"inline":[4],"placeholder":[1],"searchEnabled":[4,"search-enabled"],"open":[32],"selectedItem":[32],"searchTerm":[32]},[[0,"closeSelectBox","handleCloseSelectBox"],[0,"blur","handleBlur"]]]]],["tttx-tree-view",[[1,"tttx-tree-view",{"data":[1040],"treeData":[32]}]]],["tttx-filter",[[1,"tttx-filter",{"filterKey":[1,"filter-key"],"filterOptions":[1,"filter-options"],"showSelectAll":[4,"show-select-all"],"showSearchField":[4,"show-search-field"],"showOptionIcons":[4,"show-option-icons"],"filterButtonStyle":[1,"filter-button-style"],"filterHeader":[1,"filter-header"],"defaultFilterOptions":[1,"default-filter-options"],"popoverWidth":[1,"popover-width"],"showPopover":[32],"displayedFilterSettings":[32],"selectedFilters":[32],"filterSearchTerm":[32],"allSelected":[32]},[[0,"closeFilter","handleCloseFilter"]]]]],["tttx-list",[[1,"tttx-list",{"data":[1025],"name":[1],"_data":[32],"setAllCheckboxes":[64]}]]],["tttx-sorter",[[1,"tttx-sorter",{"sorterKey":[1,"sorter-key"],"defaultSortDirection":[1,"default-sort-direction"],"fieldOptionsData":[1,"field-options-data"],"defaultOption":[1,"default-option"],"selectedField":[32],"sortDirection":[32],"dropdownExpand":[32],"dropdownOptions":[32]},[[0,"closeSorter","handleCloseSorter"]]]]],["tttx-form",[[1,"tttx-form",{"formschema":[1032],"data":[1032],"submit":[64]}]]],["tttx-keyvalue-block",[[1,"tttx-keyvalue-block",{"keyvalues":[8],"horizontal":[4]}]]],["tttx-loading-spinner",[[1,"tttx-loading-spinner",{"loadingMessage":[1028,"loading-message"],"size":[1025]}]]],["tttx-qrcode",[[1,"tttx-qrcode",{"link":[1025],"size":[1026]}]]],["tttx-tag",[[1,"tttx-tag",{"text":[1],"color":[1]}]]],["tttx-toolbar",[[1,"tttx-toolbar",{"border":[4]}]]],["tttx-icon",[[1,"tttx-icon",{"icon":[1],"color":[1]}]]],["tttx-standalone-input",[[2,"tttx-standalone-input",{"label":[1],"secondarylabel":[1],"showerrormsg":[4],"showerrorbubble":[4],"errormsg":[1],"iconleft":[1],"iconleftcolor":[1],"iconright":[1],"iconrightcolor":[1],"inputicon":[1],"inputiconcolor":[1],"inline":[4],"inputautocapitalize":[1],"inputautofocus":[4],"inputkeyhint":[1],"inputindex":[8],"inputtitle":[1],"autocomplete":[1],"checked":[4],"disabled":[4],"max":[8],"maxlength":[8],"min":[8],"minlength":[8],"name":[1],"pattern":[1],"placeholder":[1],"readonly":[8],"required":[4],"step":[8],"type":[1],"value":[1032]}]]],["tttx-button",[[1,"tttx-button",{"notext":[4],"icon":[1],"iconposition":[1],"iconcolor":[1025],"design":[1]}]]]], options);
|
|
18
18
|
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{r as i,c as t,h as e}from"./p-c544551b.js";import{p as o,d as s}from"./p-5ed38d61.js";import"./p-112455b1.js";const n=class{constructor(e){i(this,e),this.rowClick=t(this,"listRowClick",7),this.rowCheckboxClick=t(this,"listRowCheckboxClick",7),this.data=void 0,this._data=void 0,this.name=void 0}onDataChange(){if(this.data){this._data="string"==typeof this.data?JSON.parse(this.data):[...this.data];for(const i of this._data)i.hasCheckbox&&void 0===i.checked&&(i.checked=!1)}}componentWillLoad(){this.onDataChange()}onRowCheckboxHandler(i,t){i.stopPropagation(),t.rowData&&(t.hasCheckbox&&(t.checked=!t.checked),this._data=[...this._data],this.rowCheckboxClick.emit({key:t.key,name:this.name,data:t.rowData,checked:t.checked}))}onRowClickHandler(i){i.clickable&&i.rowData&&this.rowClick.emit({key:i.key,name:this.name,data:i.rowData})}async setAllCheckboxes(i){for(const t of this._data)t.hasCheckbox&&(t.checked=i);this._data=[...this._data]}renderListItem(i){const t=o.sanitize(i.element,s);return e("li",{class:"item "+(i.clickable?"clickable":""),onClick:()=>{this.onRowClickHandler(i)}},i.hasCheckbox&&e("div",{class:"checkbox"},e("tttx-icon",{icon:i.checked?"check_box":"check_box_outline_blank",color:i.checked?"blue":"grey",onClick:t=>{this.onRowCheckboxHandler(t,i)}})),i.element&&e("span",{class:"item-content",innerHTML:t}),i.icon&&e("span",{class:"icons"},e("tttx-icon",{class:"align-right",icon:i.icon,color:"black"})))}render(){if(this._data)return e("ul",{class:"list"},this._data.map((i=>this.renderListItem(i))))}static get watchers(){return{data:["onDataChange"]}}};n.style='.material-symbols-rounded{font-variation-settings:"FILL" 1, "wght" 400, "GRAD" 0, "opsz" 24}.material-symbols-rounded{font-family:"Material Symbols Rounded", sans-serif;font-weight:400;font-style:normal;font-size:24px;line-height:1;letter-spacing:normal;text-transform:none;display:inline-block;white-space:nowrap;word-wrap:normal;direction:ltr;text-rendering:optimizeLegibility;-webkit-font-smoothing:antialiased;color:#9e9e9e}:host{display:flex;flex-direction:column}.list{margin:0;padding:0}li{display:flex;align-items:flex-start}li.item{list-style:none;margin:0;padding:8px;border-bottom:1px solid #d5d5d5;min-height:36px}li.item:first-of-type{border-top:1px solid #d5d5d5}li.item.clickable:hover{cursor:pointer}li.item.clickable:active{background-color:#e6e6e6}li.item .icons{display:flex;justify-content:flex-end;flex-grow:1;align-items:center;height:36px}li.item .icons tttx-icon:hover{cursor:pointer}li.item .icons *{display:flex}li:hover{background-color:#1111110D}.align-right{margin-left:auto}.item-content{display:flex;align-items:center;flex-grow:2;min-height:36px}.checkbox{padding:6px;margin-left:-8px}';export{n as tttx_list}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{r,h as o,H as e}from"./p-c544551b.js";const n=class{constructor(o){r(this,o),this.text=void 0,this.color="#d5d5d5"}render(){return o(e,null,o("div",{class:"tag",style:{"background-color":this.color}},o("span",null,this.text)))}};n.style='.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:active{background:rgba(17, 17, 17, 0.2);border:1px solid #d5d5d5}.primary{background:#1479c6;border:1px solid #1479c6;color:white}.primary:active{background:#1464a2;border:1px solid #1464a2}.borderless{background:transparent;border:none;color:#212121}.borderless:active{background:rgba(17, 17, 17, 0.2);border:none}.borderless-circle{background:transparent;border:none;color:#212121;border-radius:50%}.borderless-circle:active{border:none}.borderless-circle:focus{border-color:transparent}.danger{background:#dc0000;border:1px solid #dc0000;color:white}.danger:active{background:#b00000;border:1px solid #b00000}.disabled{background:#aeaeae;border:none;color:#4c4c4c;cursor:not-allowed}.disabled:active{background:#aeaeae;border:none;color:#4c4c4c;cursor:not-allowed}@media (hover: hover){.button:hover{background:rgba(17, 17, 17, 0.1);border:1px solid #d5d5d5}.primary:hover{background:#146eb3;border:1px solid #146eb3}.borderless:hover{background:rgba(17, 17, 17, 0.1);border:none}.borderless-circle:hover{background:rgba(17, 17, 17, 0.1);border:none}.danger:hover{background:#c60000;border:1px solid #c60000}.disabled:hover{background:#aeaeae;border:none;color:#4c4c4c;cursor:not-allowed}}:host{display:inline-block}.tag{border-radius:20px;padding:4px;font-family:"Roboto", sans-serif;font-size:14px;font-weight:400}.tag span{margin-left:4px;margin-right:4px;color:#212121}.icon{height:18px;width:18px;font-weight:400}';export{n as tttx_tag}
|
package/dist/tttx/tttx.esm.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{p as e,b as t}from"./p-c544551b.js";export{s as setNonce}from"./p-c544551b.js";(()=>{const t=import.meta.url,o={};return""!==t&&(o.resourcesUrl=new URL(".",t).href),e(o)})().then((e=>t([["p-64479f02",[[1,"tttx-dialog-box",{data:[1025],size:[1],open:[1028],elementSize:[32]},[[9,"resize","handleResize"]]]]],["p-ff38d9f3",[[1,"tttx-select-box",{optionsData:[1,"options-data"],label:[1],inline:[4],placeholder:[1],searchEnabled:[4,"search-enabled"],open:[32],selectedItem:[32],searchTerm:[32]},[[0,"closeSelectBox","handleCloseSelectBox"],[0,"blur","handleBlur"]]]]],["p-2f066b53",[[1,"tttx-tree-view",{data:[1040],treeData:[32]}]]],["p-a658e1ac",[[1,"tttx-filter",{filterKey:[1,"filter-key"],filterOptions:[1,"filter-options"],showSelectAll:[4,"show-select-all"],showSearchField:[4,"show-search-field"],showOptionIcons:[4,"show-option-icons"],filterButtonStyle:[1,"filter-button-style"],filterHeader:[1,"filter-header"],defaultFilterOptions:[1,"default-filter-options"],popoverWidth:[1,"popover-width"],showPopover:[32],displayedFilterSettings:[32],selectedFilters:[32],filterSearchTerm:[32],allSelected:[32]},[[0,"closeFilter","handleCloseFilter"]]]]],["p-
|
|
1
|
+
import{p as e,b as t}from"./p-c544551b.js";export{s as setNonce}from"./p-c544551b.js";(()=>{const t=import.meta.url,o={};return""!==t&&(o.resourcesUrl=new URL(".",t).href),e(o)})().then((e=>t([["p-64479f02",[[1,"tttx-dialog-box",{data:[1025],size:[1],open:[1028],elementSize:[32]},[[9,"resize","handleResize"]]]]],["p-ff38d9f3",[[1,"tttx-select-box",{optionsData:[1,"options-data"],label:[1],inline:[4],placeholder:[1],searchEnabled:[4,"search-enabled"],open:[32],selectedItem:[32],searchTerm:[32]},[[0,"closeSelectBox","handleCloseSelectBox"],[0,"blur","handleBlur"]]]]],["p-2f066b53",[[1,"tttx-tree-view",{data:[1040],treeData:[32]}]]],["p-a658e1ac",[[1,"tttx-filter",{filterKey:[1,"filter-key"],filterOptions:[1,"filter-options"],showSelectAll:[4,"show-select-all"],showSearchField:[4,"show-search-field"],showOptionIcons:[4,"show-option-icons"],filterButtonStyle:[1,"filter-button-style"],filterHeader:[1,"filter-header"],defaultFilterOptions:[1,"default-filter-options"],popoverWidth:[1,"popover-width"],showPopover:[32],displayedFilterSettings:[32],selectedFilters:[32],filterSearchTerm:[32],allSelected:[32]},[[0,"closeFilter","handleCloseFilter"]]]]],["p-40c66a2e",[[1,"tttx-list",{data:[1025],name:[1],_data:[32],setAllCheckboxes:[64]}]]],["p-225e6fa6",[[1,"tttx-sorter",{sorterKey:[1,"sorter-key"],defaultSortDirection:[1,"default-sort-direction"],fieldOptionsData:[1,"field-options-data"],defaultOption:[1,"default-option"],selectedField:[32],sortDirection:[32],dropdownExpand:[32],dropdownOptions:[32]},[[0,"closeSorter","handleCloseSorter"]]]]],["p-57621fdb",[[1,"tttx-form",{formschema:[1032],data:[1032],submit:[64]}]]],["p-f80ab1d8",[[1,"tttx-keyvalue-block",{keyvalues:[8],horizontal:[4]}]]],["p-3467c62e",[[1,"tttx-loading-spinner",{loadingMessage:[1028,"loading-message"],size:[1025]}]]],["p-cff962bf",[[1,"tttx-qrcode",{link:[1025],size:[1026]}]]],["p-68680d65",[[1,"tttx-tag",{text:[1],color:[1]}]]],["p-4879a614",[[1,"tttx-toolbar",{border:[4]}]]],["p-53fa8b4d",[[1,"tttx-icon",{icon:[1],color:[1]}]]],["p-e6bbdae3",[[2,"tttx-standalone-input",{label:[1],secondarylabel:[1],showerrormsg:[4],showerrorbubble:[4],errormsg:[1],iconleft:[1],iconleftcolor:[1],iconright:[1],iconrightcolor:[1],inputicon:[1],inputiconcolor:[1],inline:[4],inputautocapitalize:[1],inputautofocus:[4],inputkeyhint:[1],inputindex:[8],inputtitle:[1],autocomplete:[1],checked:[4],disabled:[4],max:[8],maxlength:[8],min:[8],minlength:[8],name:[1],pattern:[1],placeholder:[1],readonly:[8],required:[4],step:[8],type:[1],value:[1032]}]]],["p-3c7e11d9",[[1,"tttx-button",{notext:[4],icon:[1],iconposition:[1],iconcolor:[1025],design:[1]}]]]],e)));
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
declare const _default: {
|
|
2
|
+
title: string;
|
|
3
|
+
component: string;
|
|
4
|
+
argTypes: {
|
|
5
|
+
text: {
|
|
6
|
+
control: {
|
|
7
|
+
type: string;
|
|
8
|
+
};
|
|
9
|
+
default: string;
|
|
10
|
+
};
|
|
11
|
+
color: {
|
|
12
|
+
control: {
|
|
13
|
+
type: string;
|
|
14
|
+
};
|
|
15
|
+
default: string;
|
|
16
|
+
};
|
|
17
|
+
};
|
|
18
|
+
};
|
|
19
|
+
export default _default;
|
|
20
|
+
export declare const tag: any;
|
|
21
|
+
export declare const tags: any;
|
|
@@ -2,10 +2,24 @@ import { EventEmitter } from '../../../stencil-public-runtime';
|
|
|
2
2
|
import { ListItem } from './interfaces';
|
|
3
3
|
export declare class TttxList {
|
|
4
4
|
data: string | ListItem[];
|
|
5
|
+
_data: ListItem[];
|
|
5
6
|
name: string;
|
|
6
|
-
|
|
7
|
-
|
|
7
|
+
onDataChange(): void;
|
|
8
|
+
componentWillLoad(): void;
|
|
9
|
+
rowClick: EventEmitter<{
|
|
10
|
+
key: string;
|
|
11
|
+
name: string;
|
|
12
|
+
data: any;
|
|
13
|
+
}>;
|
|
14
|
+
rowCheckboxClick: EventEmitter<{
|
|
15
|
+
key: string;
|
|
16
|
+
name: string;
|
|
17
|
+
data: any;
|
|
18
|
+
checked: boolean;
|
|
19
|
+
}>;
|
|
20
|
+
onRowCheckboxHandler(event: PointerEvent, item: ListItem): void;
|
|
8
21
|
onRowClickHandler(item: ListItem): void;
|
|
22
|
+
setAllCheckboxes(check: boolean): Promise<void>;
|
|
9
23
|
renderListItem(item: ListItem): any;
|
|
10
24
|
render(): any;
|
|
11
25
|
}
|
|
@@ -52,6 +52,7 @@ export namespace Components {
|
|
|
52
52
|
interface TttxList {
|
|
53
53
|
"data": string | ListItem[];
|
|
54
54
|
"name": string;
|
|
55
|
+
"setAllCheckboxes": (check: boolean) => Promise<void>;
|
|
55
56
|
}
|
|
56
57
|
interface TttxLoadingSpinner {
|
|
57
58
|
"loadingMessage": boolean;
|
|
@@ -119,6 +120,10 @@ export namespace Components {
|
|
|
119
120
|
"type": string;
|
|
120
121
|
"value": string | number;
|
|
121
122
|
}
|
|
123
|
+
interface TttxTag {
|
|
124
|
+
"color": string;
|
|
125
|
+
"text": string;
|
|
126
|
+
}
|
|
122
127
|
interface TttxToolbar {
|
|
123
128
|
"border": boolean;
|
|
124
129
|
}
|
|
@@ -231,6 +236,12 @@ declare global {
|
|
|
231
236
|
prototype: HTMLTttxStandaloneInputElement;
|
|
232
237
|
new (): HTMLTttxStandaloneInputElement;
|
|
233
238
|
};
|
|
239
|
+
interface HTMLTttxTagElement extends Components.TttxTag, HTMLStencilElement {
|
|
240
|
+
}
|
|
241
|
+
var HTMLTttxTagElement: {
|
|
242
|
+
prototype: HTMLTttxTagElement;
|
|
243
|
+
new (): HTMLTttxTagElement;
|
|
244
|
+
};
|
|
234
245
|
interface HTMLTttxToolbarElement extends Components.TttxToolbar, HTMLStencilElement {
|
|
235
246
|
}
|
|
236
247
|
var HTMLTttxToolbarElement: {
|
|
@@ -256,6 +267,7 @@ declare global {
|
|
|
256
267
|
"tttx-select-box": HTMLTttxSelectBoxElement;
|
|
257
268
|
"tttx-sorter": HTMLTttxSorterElement;
|
|
258
269
|
"tttx-standalone-input": HTMLTttxStandaloneInputElement;
|
|
270
|
+
"tttx-tag": HTMLTttxTagElement;
|
|
259
271
|
"tttx-toolbar": HTMLTttxToolbarElement;
|
|
260
272
|
"tttx-tree-view": HTMLTttxTreeViewElement;
|
|
261
273
|
}
|
|
@@ -305,7 +317,8 @@ declare namespace LocalJSX {
|
|
|
305
317
|
interface TttxList {
|
|
306
318
|
"data"?: string | ListItem[];
|
|
307
319
|
"name"?: string;
|
|
308
|
-
"
|
|
320
|
+
"onListRowCheckboxClick"?: (event: TttxListCustomEvent<{ key: string; name: string; data: any; checked: boolean }>) => void;
|
|
321
|
+
"onListRowClick"?: (event: TttxListCustomEvent<{ key: string; name: string; data: any }>) => void;
|
|
309
322
|
}
|
|
310
323
|
interface TttxLoadingSpinner {
|
|
311
324
|
"loadingMessage"?: boolean;
|
|
@@ -384,6 +397,10 @@ declare namespace LocalJSX {
|
|
|
384
397
|
"type"?: string;
|
|
385
398
|
"value"?: string | number;
|
|
386
399
|
}
|
|
400
|
+
interface TttxTag {
|
|
401
|
+
"color"?: string;
|
|
402
|
+
"text"?: string;
|
|
403
|
+
}
|
|
387
404
|
interface TttxToolbar {
|
|
388
405
|
"border"?: boolean;
|
|
389
406
|
}
|
|
@@ -404,6 +421,7 @@ declare namespace LocalJSX {
|
|
|
404
421
|
"tttx-select-box": TttxSelectBox;
|
|
405
422
|
"tttx-sorter": TttxSorter;
|
|
406
423
|
"tttx-standalone-input": TttxStandaloneInput;
|
|
424
|
+
"tttx-tag": TttxTag;
|
|
407
425
|
"tttx-toolbar": TttxToolbar;
|
|
408
426
|
"tttx-tree-view": TttxTreeView;
|
|
409
427
|
}
|
|
@@ -424,6 +442,7 @@ declare module "@stencil/core" {
|
|
|
424
442
|
"tttx-select-box": LocalJSX.TttxSelectBox & JSXBase.HTMLAttributes<HTMLTttxSelectBoxElement>;
|
|
425
443
|
"tttx-sorter": LocalJSX.TttxSorter & JSXBase.HTMLAttributes<HTMLTttxSorterElement>;
|
|
426
444
|
"tttx-standalone-input": LocalJSX.TttxStandaloneInput & JSXBase.HTMLAttributes<HTMLTttxStandaloneInputElement>;
|
|
445
|
+
"tttx-tag": LocalJSX.TttxTag & JSXBase.HTMLAttributes<HTMLTttxTagElement>;
|
|
427
446
|
"tttx-toolbar": LocalJSX.TttxToolbar & JSXBase.HTMLAttributes<HTMLTttxToolbarElement>;
|
|
428
447
|
"tttx-tree-view": LocalJSX.TttxTreeView & JSXBase.HTMLAttributes<HTMLTttxTreeViewElement>;
|
|
429
448
|
}
|