@design.estate/dees-catalog 1.0.188 → 1.0.190
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_bundle/bundle.js +284 -249
- package/dist_bundle/bundle.js.map +4 -4
- package/dist_ts_web/00_commitinfo_data.js +1 -1
- package/dist_ts_web/elements/dees-contextmenu.demo.d.ts +1 -0
- package/dist_ts_web/elements/dees-contextmenu.demo.js +56 -0
- package/dist_ts_web/elements/dees-contextmenu.js +12 -58
- package/dist_ts_web/elements/dees-simple-appdash.d.ts +13 -1
- package/dist_ts_web/elements/dees-simple-appdash.demo.d.ts +1 -0
- package/dist_ts_web/elements/dees-simple-appdash.demo.js +5 -0
- package/dist_ts_web/elements/dees-simple-appdash.js +70 -2
- package/dist_ts_web/elements/dees-simple-login.demo.d.ts +1 -0
- package/dist_ts_web/elements/dees-simple-login.demo.js +3 -0
- package/dist_ts_web/elements/dees-simple-login.js +3 -6
- package/dist_ts_web/elements/dees-table.d.ts +4 -3
- package/dist_ts_web/elements/dees-table.demo.d.ts +1 -0
- package/dist_ts_web/elements/dees-table.demo.js +113 -0
- package/dist_ts_web/elements/dees-table.js +34 -126
- package/dist_ts_web/elements/index.d.ts +1 -0
- package/dist_ts_web/elements/index.js +2 -1
- package/dist_watch/bundle.js +342 -255
- package/dist_watch/bundle.js.map +4 -4
- package/package.json +1 -1
- package/ts_web/00_commitinfo_data.ts +1 -1
- package/ts_web/elements/dees-contextmenu.demo.ts +57 -0
- package/ts_web/elements/dees-contextmenu.ts +12 -57
- package/ts_web/elements/dees-simple-appdash.demo.ts +5 -0
- package/ts_web/elements/dees-simple-appdash.ts +74 -0
- package/ts_web/elements/dees-simple-login.demo.ts +3 -0
- package/ts_web/elements/dees-simple-login.ts +3 -5
- package/ts_web/elements/dees-table.demo.ts +113 -0
- package/ts_web/elements/dees-table.ts +39 -130
- package/ts_web/elements/index.ts +1 -0
package/package.json
CHANGED
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import { html } from '@design.estate/dees-element';
|
|
2
|
+
import * as plugins from './plugins.js';
|
|
3
|
+
|
|
4
|
+
import { DeesContextmenu } from './dees-contextmenu.js';
|
|
5
|
+
|
|
6
|
+
export const demoFunc = () => html`
|
|
7
|
+
<style>
|
|
8
|
+
.withMargin {
|
|
9
|
+
display: block;
|
|
10
|
+
margin: 20px;
|
|
11
|
+
}
|
|
12
|
+
</style>
|
|
13
|
+
<dees-button @contextmenu=${(eventArg) => {
|
|
14
|
+
DeesContextmenu.openContextMenuWithOptions(eventArg, [
|
|
15
|
+
{
|
|
16
|
+
name: 'copy',
|
|
17
|
+
iconName: 'copySolid',
|
|
18
|
+
action: async () => {
|
|
19
|
+
return null;
|
|
20
|
+
},
|
|
21
|
+
},
|
|
22
|
+
{
|
|
23
|
+
name: 'edit',
|
|
24
|
+
iconName: 'penToSquare',
|
|
25
|
+
action: async () => {
|
|
26
|
+
return null;
|
|
27
|
+
},
|
|
28
|
+
},{
|
|
29
|
+
name: 'paste',
|
|
30
|
+
iconName: 'pasteSolid',
|
|
31
|
+
action: async () => {
|
|
32
|
+
return null;
|
|
33
|
+
},
|
|
34
|
+
},
|
|
35
|
+
]);
|
|
36
|
+
}}>Hello</dees-button>
|
|
37
|
+
<dees-contextmenu class="withMargin"></dees-contextmenu>
|
|
38
|
+
<dees-contextmenu
|
|
39
|
+
class="withMargin"
|
|
40
|
+
.menuItems=${[
|
|
41
|
+
{
|
|
42
|
+
name: 'copy',
|
|
43
|
+
iconName: 'copySolid',
|
|
44
|
+
action: async () => {},
|
|
45
|
+
},
|
|
46
|
+
{
|
|
47
|
+
name: 'edit',
|
|
48
|
+
iconName: 'penToSquare',
|
|
49
|
+
action: async () => {},
|
|
50
|
+
},{
|
|
51
|
+
name: 'paste',
|
|
52
|
+
iconName: 'pasteSolid',
|
|
53
|
+
action: async () => {},
|
|
54
|
+
},
|
|
55
|
+
] as plugins.tsclass.website.IMenuItem[]}
|
|
56
|
+
></dees-contextmenu>
|
|
57
|
+
`;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { demoFunc } from './dees-contextmenu.demo.js';
|
|
1
2
|
import * as plugins from './plugins.js';
|
|
2
3
|
import {
|
|
3
4
|
customElement,
|
|
@@ -23,58 +24,7 @@ declare global {
|
|
|
23
24
|
@customElement('dees-contextmenu')
|
|
24
25
|
export class DeesContextmenu extends DeesElement {
|
|
25
26
|
// DEMO
|
|
26
|
-
public static demo =
|
|
27
|
-
<style>
|
|
28
|
-
.withMargin {
|
|
29
|
-
display: block;
|
|
30
|
-
margin: 20px;
|
|
31
|
-
}
|
|
32
|
-
</style>
|
|
33
|
-
<dees-button @contextmenu=${(eventArg) => {
|
|
34
|
-
DeesContextmenu.openContextMenuWithOptions(eventArg, [
|
|
35
|
-
{
|
|
36
|
-
name: 'copy',
|
|
37
|
-
iconName: 'copySolid',
|
|
38
|
-
action: async () => {
|
|
39
|
-
return null;
|
|
40
|
-
},
|
|
41
|
-
},
|
|
42
|
-
{
|
|
43
|
-
name: 'edit',
|
|
44
|
-
iconName: 'penToSquare',
|
|
45
|
-
action: async () => {
|
|
46
|
-
return null;
|
|
47
|
-
},
|
|
48
|
-
},{
|
|
49
|
-
name: 'paste',
|
|
50
|
-
iconName: 'pasteSolid',
|
|
51
|
-
action: async () => {
|
|
52
|
-
return null;
|
|
53
|
-
},
|
|
54
|
-
},
|
|
55
|
-
]);
|
|
56
|
-
}}>Hello</dees-button>
|
|
57
|
-
<dees-contextmenu class="withMargin"></dees-contextmenu>
|
|
58
|
-
<dees-contextmenu
|
|
59
|
-
class="withMargin"
|
|
60
|
-
.menuItems=${[
|
|
61
|
-
{
|
|
62
|
-
name: 'copy',
|
|
63
|
-
iconName: 'copySolid',
|
|
64
|
-
action: async () => {},
|
|
65
|
-
},
|
|
66
|
-
{
|
|
67
|
-
name: 'edit',
|
|
68
|
-
iconName: 'penToSquare',
|
|
69
|
-
action: async () => {},
|
|
70
|
-
},{
|
|
71
|
-
name: 'paste',
|
|
72
|
-
iconName: 'pasteSolid',
|
|
73
|
-
action: async () => {},
|
|
74
|
-
},
|
|
75
|
-
] as plugins.tsclass.website.IMenuItem[]}
|
|
76
|
-
></dees-contextmenu>
|
|
77
|
-
`;
|
|
27
|
+
public static demo = demoFunc
|
|
78
28
|
|
|
79
29
|
// STATIC
|
|
80
30
|
public static async openContextMenuWithOptions(eventArg: MouseEvent, menuItemsArg: plugins.tsclass.website.IMenuItem[]) {
|
|
@@ -122,7 +72,7 @@ export class DeesContextmenu extends DeesElement {
|
|
|
122
72
|
font-size: 14px;
|
|
123
73
|
width: 200px;
|
|
124
74
|
border: 1px solid #444;
|
|
125
|
-
min-height:
|
|
75
|
+
min-height: 34px;
|
|
126
76
|
border-radius: 3px;
|
|
127
77
|
background: #222;
|
|
128
78
|
box-shadow: 0px 1px 4px #000;
|
|
@@ -163,15 +113,20 @@ export class DeesContextmenu extends DeesElement {
|
|
|
163
113
|
</div>
|
|
164
114
|
`;
|
|
165
115
|
})}
|
|
116
|
+
${this.menuItems.length === 0 ? html`
|
|
117
|
+
<div class="menuitem" @click=${() => {
|
|
118
|
+
alert('No menu items...')
|
|
119
|
+
}}>
|
|
120
|
+
<dees-icon .iconFA=${'xmark'}></dees-icon
|
|
121
|
+
>No menu item present...
|
|
122
|
+
</div>
|
|
123
|
+
` : html``}
|
|
166
124
|
</div>
|
|
167
125
|
`;
|
|
168
126
|
}
|
|
169
127
|
|
|
170
128
|
public async firstUpdated() {
|
|
171
|
-
|
|
172
|
-
const mainbox = this.shadowRoot.querySelector('.mainbox');
|
|
173
|
-
mainbox.textContent = 'no menu items present';
|
|
174
|
-
}
|
|
129
|
+
|
|
175
130
|
}
|
|
176
131
|
|
|
177
132
|
public async handleClick(menuItem: plugins.tsclass.website.IMenuItem) {
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
import { demoFunc } from './dees-simple-appdash.demo.js';
|
|
2
|
+
import {
|
|
3
|
+
customElement,
|
|
4
|
+
html,
|
|
5
|
+
DeesElement,
|
|
6
|
+
property,
|
|
7
|
+
type TemplateResult,
|
|
8
|
+
cssManager,
|
|
9
|
+
css,
|
|
10
|
+
unsafeCSS,
|
|
11
|
+
type CSSResult,
|
|
12
|
+
state,
|
|
13
|
+
} from '@design.estate/dees-element';
|
|
14
|
+
|
|
15
|
+
declare global {
|
|
16
|
+
interface HTMLElementTagNameMap {
|
|
17
|
+
'dees-simple-appdash': DeesSimpleAppDash;
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
@customElement('dees-simple-appdash')
|
|
22
|
+
export class DeesSimpleAppDash extends DeesElement {
|
|
23
|
+
// STATIC
|
|
24
|
+
public static demo = demoFunc;
|
|
25
|
+
// INSTANCE
|
|
26
|
+
|
|
27
|
+
@property()
|
|
28
|
+
public title = 'Dees Simple Login';
|
|
29
|
+
|
|
30
|
+
public static styles = [
|
|
31
|
+
cssManager.defaultStyles,
|
|
32
|
+
css`
|
|
33
|
+
:host {
|
|
34
|
+
color: ${cssManager.bdTheme('#333', '#fff')};
|
|
35
|
+
user-select: none;
|
|
36
|
+
}
|
|
37
|
+
.appbar {
|
|
38
|
+
position: absolute;
|
|
39
|
+
top: 0;
|
|
40
|
+
height: 40px;
|
|
41
|
+
width: 100%;
|
|
42
|
+
background: ${cssManager.bdTheme('#eeeeeb', '#000')};
|
|
43
|
+
border-bottom: 1px solid ${cssManager.bdTheme('#ccc', '#333')};
|
|
44
|
+
font-size: 14px;
|
|
45
|
+
line-height: 40px;
|
|
46
|
+
font-family: 'Hubot Sans', 'Inter', sans-serif;
|
|
47
|
+
padding: 0px 16px;
|
|
48
|
+
}
|
|
49
|
+
.appcontent {
|
|
50
|
+
position: absolute;
|
|
51
|
+
top: 40px;
|
|
52
|
+
bottom: 0;
|
|
53
|
+
width: 100%;
|
|
54
|
+
background: ${cssManager.bdTheme('#eeeeeb', '#000')};
|
|
55
|
+
}
|
|
56
|
+
`,
|
|
57
|
+
];
|
|
58
|
+
|
|
59
|
+
public render(): TemplateResult {
|
|
60
|
+
return html`
|
|
61
|
+
<div class="appbar">
|
|
62
|
+
configvault v1.2.3
|
|
63
|
+
</div>
|
|
64
|
+
<div class="appcontent">
|
|
65
|
+
<slot></slot>
|
|
66
|
+
</div>
|
|
67
|
+
`;
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
public async firstUpdated(_changedProperties): Promise<void> {
|
|
71
|
+
const domtools = await this.domtoolsPromise;
|
|
72
|
+
super.firstUpdated(_changedProperties);
|
|
73
|
+
}
|
|
74
|
+
}
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import { demoFunc } from './dees-simple-login.demo.js';
|
|
2
|
+
|
|
1
3
|
import {
|
|
2
4
|
customElement,
|
|
3
5
|
html,
|
|
@@ -20,11 +22,7 @@ declare global {
|
|
|
20
22
|
@customElement('dees-simple-login')
|
|
21
23
|
export class DeesSimpleLogin extends DeesElement {
|
|
22
24
|
// STATIC
|
|
23
|
-
public static demo =
|
|
24
|
-
<dees-simple-login>
|
|
25
|
-
Hello there
|
|
26
|
-
</dees-simple-login>
|
|
27
|
-
`;
|
|
25
|
+
public static demo = demoFunc
|
|
28
26
|
// INSTANCE
|
|
29
27
|
|
|
30
28
|
@property()
|
|
@@ -0,0 +1,113 @@
|
|
|
1
|
+
import { type ITableAction } from './dees-table.js';
|
|
2
|
+
import * as plugins from './plugins.js';
|
|
3
|
+
import { html } from '@design.estate/dees-element';
|
|
4
|
+
|
|
5
|
+
export const demoFunc = () => html`
|
|
6
|
+
<style>
|
|
7
|
+
.demoWrapper {
|
|
8
|
+
box-sizing: border-box;
|
|
9
|
+
position: absolute;
|
|
10
|
+
width: 100%;
|
|
11
|
+
height: 100%;
|
|
12
|
+
padding: 20px;
|
|
13
|
+
background: #000000;
|
|
14
|
+
}
|
|
15
|
+
</style>
|
|
16
|
+
<div class="demoWrapper">
|
|
17
|
+
<dees-table
|
|
18
|
+
heading1="Current Account Statement"
|
|
19
|
+
heading2="Bunq - Payment Account 2 - April 2021"
|
|
20
|
+
.data=${[
|
|
21
|
+
{
|
|
22
|
+
date: '2021-04-01',
|
|
23
|
+
amount: '2464.65 €',
|
|
24
|
+
description: 'Printing Paper (Office Supplies) - STAPLES BREMEN',
|
|
25
|
+
},
|
|
26
|
+
{
|
|
27
|
+
date: '2021-04-02',
|
|
28
|
+
amount: '165.65 €',
|
|
29
|
+
description: 'Logitech Mouse (Hardware) - logi.com OnlineShop',
|
|
30
|
+
},
|
|
31
|
+
{
|
|
32
|
+
date: '2021-04-03',
|
|
33
|
+
amount: '2999,00 €',
|
|
34
|
+
description: 'Macbook Pro 16inch (Hardware) - Apple.de OnlineShop',
|
|
35
|
+
},
|
|
36
|
+
{
|
|
37
|
+
date: '2021-04-01',
|
|
38
|
+
amount: '2464.65 €',
|
|
39
|
+
description: 'Office-Supplies - STAPLES BREMEN',
|
|
40
|
+
},
|
|
41
|
+
{
|
|
42
|
+
date: '2021-04-01',
|
|
43
|
+
amount: '2464.65 €',
|
|
44
|
+
description: 'Office-Supplies - STAPLES BREMEN',
|
|
45
|
+
},
|
|
46
|
+
]}
|
|
47
|
+
dataName="transactions"
|
|
48
|
+
.dataActions="${[
|
|
49
|
+
{
|
|
50
|
+
name: 'upload',
|
|
51
|
+
iconName: 'bell',
|
|
52
|
+
useTableBehaviour: 'upload',
|
|
53
|
+
type: ['inRow'],
|
|
54
|
+
actionFunc: async (itemArg: any) => {
|
|
55
|
+
alert(itemArg.amount);
|
|
56
|
+
},
|
|
57
|
+
},
|
|
58
|
+
{
|
|
59
|
+
name: 'visibility',
|
|
60
|
+
iconName: 'copy',
|
|
61
|
+
type: ['inRow'],
|
|
62
|
+
useTableBehaviour: 'preview',
|
|
63
|
+
actionFunc: async (itemArg: any) => {},
|
|
64
|
+
},
|
|
65
|
+
{
|
|
66
|
+
name: 'create new',
|
|
67
|
+
iconName: 'instagram',
|
|
68
|
+
type: ['header'],
|
|
69
|
+
useTableBehaviour: 'preview',
|
|
70
|
+
actionFunc: async (itemArg: any) => {},
|
|
71
|
+
},
|
|
72
|
+
{
|
|
73
|
+
name: 'to gallery',
|
|
74
|
+
iconName: 'message',
|
|
75
|
+
type: ['footer'],
|
|
76
|
+
useTableBehaviour: 'preview',
|
|
77
|
+
actionFunc: async (itemArg: any) => {},
|
|
78
|
+
},
|
|
79
|
+
{
|
|
80
|
+
name: 'copy',
|
|
81
|
+
iconName: 'copySolid',
|
|
82
|
+
type: ['contextmenu', 'inRow'],
|
|
83
|
+
action: async () => {
|
|
84
|
+
return null;
|
|
85
|
+
},
|
|
86
|
+
},
|
|
87
|
+
{
|
|
88
|
+
name: 'edit (from demo)',
|
|
89
|
+
iconName: 'penToSquare',
|
|
90
|
+
type: ['contextmenu'],
|
|
91
|
+
action: async () => {
|
|
92
|
+
return null;
|
|
93
|
+
},
|
|
94
|
+
},
|
|
95
|
+
{
|
|
96
|
+
name: 'paste',
|
|
97
|
+
iconName: 'pasteSolid',
|
|
98
|
+
type: ['contextmenu'],
|
|
99
|
+
action: async () => {
|
|
100
|
+
return null;
|
|
101
|
+
},
|
|
102
|
+
},
|
|
103
|
+
] as ITableAction[]}"
|
|
104
|
+
.displayFunction=${(itemArg) => {
|
|
105
|
+
return {
|
|
106
|
+
...itemArg,
|
|
107
|
+
onlyDisplayProp: 'onlyDisplay',
|
|
108
|
+
};
|
|
109
|
+
}}
|
|
110
|
+
>This is a slotted Text</dees-table
|
|
111
|
+
>
|
|
112
|
+
</div>
|
|
113
|
+
`;
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import * as plugins from './plugins.js';
|
|
2
|
+
import { demoFunc } from './dees-table.demo.js';
|
|
1
3
|
import {
|
|
2
4
|
customElement,
|
|
3
5
|
html,
|
|
@@ -12,7 +14,7 @@ import {
|
|
|
12
14
|
resolveExec,
|
|
13
15
|
} from '@design.estate/dees-element';
|
|
14
16
|
|
|
15
|
-
import { DeesContextmenu } from './dees-contextmenu.js'
|
|
17
|
+
import { DeesContextmenu } from './dees-contextmenu.js';
|
|
16
18
|
|
|
17
19
|
import * as domtools from '@design.estate/dees-domtools';
|
|
18
20
|
import { type TIconKey } from './dees-icon.js';
|
|
@@ -24,7 +26,7 @@ declare global {
|
|
|
24
26
|
}
|
|
25
27
|
|
|
26
28
|
// interfaces
|
|
27
|
-
export interface
|
|
29
|
+
export interface ITableAction<T = any> {
|
|
28
30
|
name: string;
|
|
29
31
|
iconName: TIconKey;
|
|
30
32
|
/**
|
|
@@ -35,7 +37,7 @@ export interface IDataAction<T = any> {
|
|
|
35
37
|
/**
|
|
36
38
|
* the type of the action
|
|
37
39
|
*/
|
|
38
|
-
type: 'inRow' | '
|
|
40
|
+
type: ('inRow' | 'contextmenu' | 'footer' | 'header' | 'preview' | 'keyCombination')[];
|
|
39
41
|
/**
|
|
40
42
|
* allows to check if the action is relevant for the given item
|
|
41
43
|
* @param itemArg
|
|
@@ -55,91 +57,7 @@ export type TDisplayFunction<T = any> = (itemArg: T) => object;
|
|
|
55
57
|
// the table implementation
|
|
56
58
|
@customElement('dees-table')
|
|
57
59
|
export class DeesTable<T> extends DeesElement {
|
|
58
|
-
public static demo =
|
|
59
|
-
<style>
|
|
60
|
-
.demoWrapper {
|
|
61
|
-
box-sizing: border-box;
|
|
62
|
-
position: absolute;
|
|
63
|
-
width: 100%;
|
|
64
|
-
height: 100%;
|
|
65
|
-
padding: 20px;
|
|
66
|
-
background: #000000;
|
|
67
|
-
}
|
|
68
|
-
</style>
|
|
69
|
-
<div class="demoWrapper">
|
|
70
|
-
<dees-table
|
|
71
|
-
heading1="Current Account Statement"
|
|
72
|
-
heading2="Bunq - Payment Account 2 - April 2021"
|
|
73
|
-
.data=${[
|
|
74
|
-
{
|
|
75
|
-
date: '2021-04-01',
|
|
76
|
-
amount: '2464.65 €',
|
|
77
|
-
description: 'Printing Paper (Office Supplies) - STAPLES BREMEN',
|
|
78
|
-
},
|
|
79
|
-
{
|
|
80
|
-
date: '2021-04-02',
|
|
81
|
-
amount: '165.65 €',
|
|
82
|
-
description: 'Logitech Mouse (Hardware) - logi.com OnlineShop',
|
|
83
|
-
},
|
|
84
|
-
{
|
|
85
|
-
date: '2021-04-03',
|
|
86
|
-
amount: '2999,00 €',
|
|
87
|
-
description: 'Macbook Pro 16inch (Hardware) - Apple.de OnlineShop',
|
|
88
|
-
},
|
|
89
|
-
{
|
|
90
|
-
date: '2021-04-01',
|
|
91
|
-
amount: '2464.65 €',
|
|
92
|
-
description: 'Office-Supplies - STAPLES BREMEN',
|
|
93
|
-
},
|
|
94
|
-
{
|
|
95
|
-
date: '2021-04-01',
|
|
96
|
-
amount: '2464.65 €',
|
|
97
|
-
description: 'Office-Supplies - STAPLES BREMEN',
|
|
98
|
-
},
|
|
99
|
-
]}
|
|
100
|
-
dataName="transactions"
|
|
101
|
-
.dataActions="${[
|
|
102
|
-
{
|
|
103
|
-
name: 'upload',
|
|
104
|
-
iconName: 'bell',
|
|
105
|
-
useTableBehaviour: 'upload',
|
|
106
|
-
type: 'inRow',
|
|
107
|
-
actionFunc: async (itemArg: any) => {
|
|
108
|
-
alert(itemArg.amount);
|
|
109
|
-
},
|
|
110
|
-
},
|
|
111
|
-
{
|
|
112
|
-
name: 'visibility',
|
|
113
|
-
iconName: 'copy',
|
|
114
|
-
type: 'inRow',
|
|
115
|
-
useTableBehaviour: 'preview',
|
|
116
|
-
actionFunc: async (itemArg: any) => {},
|
|
117
|
-
},
|
|
118
|
-
{
|
|
119
|
-
name: 'create new',
|
|
120
|
-
iconName: 'instagram',
|
|
121
|
-
type: 'header',
|
|
122
|
-
useTableBehaviour: 'preview',
|
|
123
|
-
actionFunc: async (itemArg: any) => {},
|
|
124
|
-
},
|
|
125
|
-
{
|
|
126
|
-
name: 'to gallery',
|
|
127
|
-
iconName: 'message',
|
|
128
|
-
type: 'footer',
|
|
129
|
-
useTableBehaviour: 'preview',
|
|
130
|
-
actionFunc: async (itemArg: any) => {},
|
|
131
|
-
},
|
|
132
|
-
] as IDataAction[]}"
|
|
133
|
-
.displayFunction=${(itemArg) => {
|
|
134
|
-
return {
|
|
135
|
-
...itemArg,
|
|
136
|
-
onlyDisplayProp: 'onlyDisplay',
|
|
137
|
-
};
|
|
138
|
-
}}
|
|
139
|
-
>This is a slotted Text</dees-table
|
|
140
|
-
>
|
|
141
|
-
</div>
|
|
142
|
-
`;
|
|
60
|
+
public static demo = demoFunc;
|
|
143
61
|
|
|
144
62
|
// INSTANCE
|
|
145
63
|
@property({
|
|
@@ -166,7 +84,7 @@ export class DeesTable<T> extends DeesElement {
|
|
|
166
84
|
@property({
|
|
167
85
|
type: Array,
|
|
168
86
|
})
|
|
169
|
-
public dataActions:
|
|
87
|
+
public dataActions: ITableAction[] = [];
|
|
170
88
|
|
|
171
89
|
@property({
|
|
172
90
|
attribute: false,
|
|
@@ -367,7 +285,7 @@ export class DeesTable<T> extends DeesElement {
|
|
|
367
285
|
${resolveExec(async () => {
|
|
368
286
|
const resultArray: TemplateResult[] = [];
|
|
369
287
|
for (const action of this.dataActions) {
|
|
370
|
-
if (action.type
|
|
288
|
+
if (!action.type.includes('header')) continue;
|
|
371
289
|
resultArray.push(
|
|
372
290
|
html`<div
|
|
373
291
|
class="headerAction"
|
|
@@ -465,28 +383,17 @@ export class DeesTable<T> extends DeesElement {
|
|
|
465
383
|
}
|
|
466
384
|
}}
|
|
467
385
|
@contextmenu=${async (eventArg: MouseEvent) => {
|
|
468
|
-
DeesContextmenu.openContextMenuWithOptions(eventArg,
|
|
469
|
-
{
|
|
470
|
-
name:
|
|
471
|
-
iconName:
|
|
472
|
-
action: async () => {
|
|
473
|
-
return null;
|
|
474
|
-
},
|
|
475
|
-
},
|
|
476
|
-
{
|
|
477
|
-
name: 'edit',
|
|
478
|
-
iconName: 'penToSquare',
|
|
386
|
+
DeesContextmenu.openContextMenuWithOptions(eventArg, this.getActionsForType('contextmenu').map(action => {
|
|
387
|
+
const menuItem: plugins.tsclass.website.IMenuItem = {
|
|
388
|
+
name: action.name,
|
|
389
|
+
iconName: action.iconName as any,
|
|
479
390
|
action: async () => {
|
|
391
|
+
await action.actionFunc(itemArg);
|
|
480
392
|
return null;
|
|
481
|
-
}
|
|
482
|
-
}
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
action: async () => {
|
|
486
|
-
return null;
|
|
487
|
-
},
|
|
488
|
-
},
|
|
489
|
-
])
|
|
393
|
+
}
|
|
394
|
+
}
|
|
395
|
+
return menuItem;
|
|
396
|
+
}));
|
|
490
397
|
}}
|
|
491
398
|
class="${itemArg === this.selectedDataRow ? 'selected' : ''}"
|
|
492
399
|
>
|
|
@@ -502,25 +409,18 @@ export class DeesTable<T> extends DeesElement {
|
|
|
502
409
|
return html`
|
|
503
410
|
<td>
|
|
504
411
|
<div class="innerCellContainer">
|
|
505
|
-
${((
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
`
|
|
518
|
-
: action.name}
|
|
519
|
-
</div>`
|
|
520
|
-
);
|
|
521
|
-
}
|
|
522
|
-
return actions;
|
|
523
|
-
})()}
|
|
412
|
+
${this.getActionsForType('inRow').map(
|
|
413
|
+
(actionArg) => html`<div
|
|
414
|
+
class="action"
|
|
415
|
+
@click=${() => actionArg.actionFunc(itemArg)}
|
|
416
|
+
>
|
|
417
|
+
${actionArg.iconName
|
|
418
|
+
? html`
|
|
419
|
+
<dees-icon .iconFA=${actionArg.iconName}></dees-icon>
|
|
420
|
+
`
|
|
421
|
+
: actionArg.name}
|
|
422
|
+
</div>`
|
|
423
|
+
)}
|
|
524
424
|
</div>
|
|
525
425
|
</td>
|
|
526
426
|
`;
|
|
@@ -543,7 +443,7 @@ export class DeesTable<T> extends DeesElement {
|
|
|
543
443
|
${resolveExec(async () => {
|
|
544
444
|
const resultArray: TemplateResult[] = [];
|
|
545
445
|
for (const action of this.dataActions) {
|
|
546
|
-
if (action.type
|
|
446
|
+
if (!action.type.includes('footer')) continue;
|
|
547
447
|
resultArray.push(
|
|
548
448
|
html`<div
|
|
549
449
|
class="footerAction"
|
|
@@ -567,4 +467,13 @@ export class DeesTable<T> extends DeesElement {
|
|
|
567
467
|
}
|
|
568
468
|
|
|
569
469
|
public async firstUpdated() {}
|
|
470
|
+
|
|
471
|
+
getActionsForType(typeArg: ITableAction['type'][0]) {
|
|
472
|
+
const actions: ITableAction[] = [];
|
|
473
|
+
for (const action of this.dataActions) {
|
|
474
|
+
if (!action.type.includes(typeArg)) continue;
|
|
475
|
+
actions.push(action);
|
|
476
|
+
}
|
|
477
|
+
return actions;
|
|
478
|
+
}
|
|
570
479
|
}
|
package/ts_web/elements/index.ts
CHANGED
|
@@ -15,6 +15,7 @@ export * from './dees-input-radio.js';
|
|
|
15
15
|
export * from './dees-input-text.js';
|
|
16
16
|
export * from './dees-mobilenavigation.js';
|
|
17
17
|
export * from './dees-pdf.js';
|
|
18
|
+
export * from './dees-simple-appdash.js';
|
|
18
19
|
export * from './dees-simple-login.js';
|
|
19
20
|
export * from './dees-speechbubble.js';
|
|
20
21
|
export * from './dees-spinner.js';
|