@design.estate/dees-catalog 1.0.183 → 1.0.185
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 +302 -209
- 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.d.ts +2 -0
- package/dist_ts_web/elements/dees-contextmenu.js +9 -1
- package/dist_ts_web/elements/dees-icon.d.ts +1 -0
- package/dist_ts_web/elements/dees-icon.js +1 -1
- package/dist_ts_web/elements/dees-mobilenavigation.js +11 -17
- package/dist_ts_web/elements/dees-table.d.ts +24 -3
- package/dist_ts_web/elements/dees-table.js +269 -82
- package/dist_ts_web/elements/dees-windowlayer.d.ts +2 -0
- package/dist_ts_web/elements/dees-windowlayer.js +19 -3
- package/dist_watch/bundle.js +4063 -2401
- package/dist_watch/bundle.js.map +4 -4
- package/package.json +5 -5
- package/ts_web/00_commitinfo_data.ts +1 -1
- package/ts_web/elements/dees-contextmenu.ts +9 -0
- package/ts_web/elements/dees-icon.ts +2 -0
- package/ts_web/elements/dees-mobilenavigation.ts +8 -14
- package/ts_web/elements/dees-table.ts +261 -51
- package/ts_web/elements/dees-windowlayer.ts +17 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@design.estate/dees-catalog",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.185",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "website for lossless.com",
|
|
6
6
|
"main": "dist_ts_web/index.js",
|
|
@@ -15,15 +15,15 @@
|
|
|
15
15
|
"author": "Lossless GmbH",
|
|
16
16
|
"license": "MIT",
|
|
17
17
|
"dependencies": {
|
|
18
|
-
"@design.estate/dees-domtools": "^2.0.
|
|
19
|
-
"@design.estate/dees-element": "^2.0.
|
|
18
|
+
"@design.estate/dees-domtools": "^2.0.39",
|
|
19
|
+
"@design.estate/dees-element": "^2.0.27",
|
|
20
20
|
"@design.estate/dees-wcctools": "^1.0.78",
|
|
21
21
|
"@fortawesome/fontawesome-svg-core": "^6.4.2",
|
|
22
22
|
"@fortawesome/free-brands-svg-icons": "^6.4.2",
|
|
23
23
|
"@fortawesome/free-regular-svg-icons": "^6.4.2",
|
|
24
24
|
"@fortawesome/free-solid-svg-icons": "^6.4.2",
|
|
25
25
|
"@push.rocks/smartpromise": "^4.0.3",
|
|
26
|
-
"@push.rocks/smartstring": "^4.0.
|
|
26
|
+
"@push.rocks/smartstring": "^4.0.9",
|
|
27
27
|
"@tsclass/tsclass": "^4.0.42",
|
|
28
28
|
"highlight.js": "11.8.0",
|
|
29
29
|
"pdfjs-dist": "^2.16.105"
|
|
@@ -35,7 +35,7 @@
|
|
|
35
35
|
"@gitzone/tswatch": "^2.0.7",
|
|
36
36
|
"@push.rocks/projectinfo": "^5.0.2",
|
|
37
37
|
"@push.rocks/tapbundle": "^5.0.15",
|
|
38
|
-
"@types/node": "^20.5.
|
|
38
|
+
"@types/node": "^20.5.9"
|
|
39
39
|
},
|
|
40
40
|
"files": [
|
|
41
41
|
"ts/**/*",
|
|
@@ -81,12 +81,17 @@ export class DeesContextmenu extends DeesElement {
|
|
|
81
81
|
eventArg.preventDefault();
|
|
82
82
|
const contextMenu = new DeesContextmenu();
|
|
83
83
|
contextMenu.style.position = 'absolute';
|
|
84
|
+
contextMenu.style.zIndex = '2000';
|
|
84
85
|
contextMenu.style.top = `${eventArg.clientY.toString()}px`;
|
|
85
86
|
contextMenu.style.left = `${eventArg.clientX.toString()}px`;
|
|
86
87
|
contextMenu.style.opacity = '0';
|
|
87
88
|
contextMenu.style.transform = 'scale(0.95,0.95)';
|
|
88
89
|
contextMenu.style.transformOrigin = 'top left';
|
|
89
90
|
contextMenu.menuItems = menuItemsArg;
|
|
91
|
+
contextMenu.windowLayer = await DeesWindowLayer.createAndShow();
|
|
92
|
+
contextMenu.windowLayer.addEventListener('click', async () => {
|
|
93
|
+
await contextMenu.destroy();
|
|
94
|
+
})
|
|
90
95
|
document.body.append(contextMenu);
|
|
91
96
|
await domtools.plugins.smartdelay.delayFor(0);
|
|
92
97
|
contextMenu.style.opacity = '1';
|
|
@@ -97,6 +102,7 @@ export class DeesContextmenu extends DeesElement {
|
|
|
97
102
|
type: Array,
|
|
98
103
|
})
|
|
99
104
|
public menuItems: plugins.tsclass.website.IMenuItem[] = [];
|
|
105
|
+
windowLayer: DeesWindowLayer;
|
|
100
106
|
|
|
101
107
|
constructor() {
|
|
102
108
|
super();
|
|
@@ -173,6 +179,9 @@ export class DeesContextmenu extends DeesElement {
|
|
|
173
179
|
}
|
|
174
180
|
|
|
175
181
|
public async destroy() {
|
|
182
|
+
if (this.windowLayer) {
|
|
183
|
+
this.windowLayer.destroy();
|
|
184
|
+
}
|
|
176
185
|
this.style.opacity = '0';
|
|
177
186
|
this.style.transform = 'scale(0.95,0,95)';
|
|
178
187
|
await domtools.plugins.smartdelay.delayFor(100);
|
|
@@ -15,22 +15,16 @@ import { DeesWindowLayer } from './dees-windowlayer.js';
|
|
|
15
15
|
export class DeesMobilenavigation extends DeesElement {
|
|
16
16
|
// STATIC
|
|
17
17
|
public static demo = () => html`
|
|
18
|
-
<dees-
|
|
19
|
-
.
|
|
18
|
+
<dees-button @click=${() => {
|
|
19
|
+
DeesMobilenavigation.createAndInit([
|
|
20
20
|
{
|
|
21
|
-
name: '
|
|
22
|
-
action:
|
|
21
|
+
name: 'Test',
|
|
22
|
+
action: () => {
|
|
23
|
+
alert('test');
|
|
24
|
+
},
|
|
23
25
|
},
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
action: async () => {},
|
|
27
|
-
},
|
|
28
|
-
{
|
|
29
|
-
name: 'hello3',
|
|
30
|
-
action: async () => {},
|
|
31
|
-
},
|
|
32
|
-
]}"
|
|
33
|
-
></dees-mobilenavigation>
|
|
26
|
+
]);
|
|
27
|
+
}}></dees-button>
|
|
34
28
|
`;
|
|
35
29
|
|
|
36
30
|
private static singletonRef: DeesMobilenavigation;
|
|
@@ -9,9 +9,13 @@ import {
|
|
|
9
9
|
unsafeCSS,
|
|
10
10
|
type CSSResult,
|
|
11
11
|
state,
|
|
12
|
+
resolveExec,
|
|
12
13
|
} from '@design.estate/dees-element';
|
|
13
14
|
|
|
15
|
+
import { DeesContextmenu } from './dees-contextmenu.js'
|
|
16
|
+
|
|
14
17
|
import * as domtools from '@design.estate/dees-domtools';
|
|
18
|
+
import { type TIconKey } from './dees-icon.js';
|
|
15
19
|
|
|
16
20
|
declare global {
|
|
17
21
|
interface HTMLElementTagNameMap {
|
|
@@ -19,13 +23,36 @@ declare global {
|
|
|
19
23
|
}
|
|
20
24
|
}
|
|
21
25
|
|
|
26
|
+
// interfaces
|
|
22
27
|
export interface IDataAction<T = any> {
|
|
23
28
|
name: string;
|
|
24
|
-
iconName:
|
|
29
|
+
iconName: TIconKey;
|
|
30
|
+
/**
|
|
31
|
+
* the table behaviour to use for this action
|
|
32
|
+
* e.g. upload: allows to upload files to the table
|
|
33
|
+
*/
|
|
25
34
|
useTableBehaviour?: 'upload' | 'cancelUpload' | 'none';
|
|
35
|
+
/**
|
|
36
|
+
* the type of the action
|
|
37
|
+
*/
|
|
38
|
+
type: 'inRow' | 'rightClick' | 'footer' | 'header' | 'preview' | 'keyCombination';
|
|
39
|
+
/**
|
|
40
|
+
* allows to check if the action is relevant for the given item
|
|
41
|
+
* @param itemArg
|
|
42
|
+
* @returns
|
|
43
|
+
*/
|
|
44
|
+
actionRelevancyCheckFunc?: (itemArg: T) => boolean;
|
|
45
|
+
/**
|
|
46
|
+
* the actual action function implementation
|
|
47
|
+
* @param itemArg
|
|
48
|
+
* @returns
|
|
49
|
+
*/
|
|
26
50
|
actionFunc: (itemArg: T) => Promise<any>;
|
|
27
51
|
}
|
|
28
52
|
|
|
53
|
+
export type TDisplayFunction<T = any> = (itemArg: T) => object;
|
|
54
|
+
|
|
55
|
+
// the table implementation
|
|
29
56
|
@customElement('dees-table')
|
|
30
57
|
export class DeesTable<T> extends DeesElement {
|
|
31
58
|
public static demo = () => html`
|
|
@@ -70,22 +97,47 @@ export class DeesTable<T> extends DeesElement {
|
|
|
70
97
|
description: 'Office-Supplies - STAPLES BREMEN',
|
|
71
98
|
},
|
|
72
99
|
]}
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
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
|
+
},
|
|
79
110
|
},
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
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) => {},
|
|
86
124
|
},
|
|
87
|
-
|
|
88
|
-
|
|
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
|
+
>
|
|
89
141
|
</div>
|
|
90
142
|
`;
|
|
91
143
|
|
|
@@ -106,24 +158,25 @@ export class DeesTable<T> extends DeesElement {
|
|
|
106
158
|
public data: T[] = [];
|
|
107
159
|
|
|
108
160
|
@property({
|
|
109
|
-
type:
|
|
161
|
+
type: String,
|
|
162
|
+
reflect: true,
|
|
110
163
|
})
|
|
111
|
-
public
|
|
164
|
+
public dataName: string;
|
|
112
165
|
|
|
113
166
|
@property({
|
|
114
|
-
type:
|
|
167
|
+
type: Array,
|
|
115
168
|
})
|
|
116
|
-
public
|
|
169
|
+
public dataActions: IDataAction[] = [];
|
|
117
170
|
|
|
118
171
|
@property({
|
|
119
|
-
|
|
172
|
+
attribute: false,
|
|
120
173
|
})
|
|
121
|
-
public
|
|
174
|
+
public displayFunction: TDisplayFunction = (itemArg: T) => itemArg as any;
|
|
122
175
|
|
|
123
176
|
@property({
|
|
124
|
-
type:
|
|
177
|
+
type: Object,
|
|
125
178
|
})
|
|
126
|
-
public
|
|
179
|
+
public selectedDataRow: T;
|
|
127
180
|
|
|
128
181
|
public files: File[] = [];
|
|
129
182
|
public fileWeakMap = new WeakMap();
|
|
@@ -150,11 +203,49 @@ export class DeesTable<T> extends DeesElement {
|
|
|
150
203
|
box-shadow: 0px 1px 4px rgba(0, 0, 0, 0.3);
|
|
151
204
|
overflow-x: auto;
|
|
152
205
|
}
|
|
206
|
+
|
|
207
|
+
.header {
|
|
208
|
+
display: flex;
|
|
209
|
+
justify-content: flex-end;
|
|
210
|
+
align-items: center;
|
|
211
|
+
}
|
|
212
|
+
|
|
213
|
+
.headingContainer {
|
|
214
|
+
}
|
|
215
|
+
|
|
216
|
+
.heading {
|
|
217
|
+
font-family: 'Hubot Sans', 'Inter', sans-serif;
|
|
218
|
+
}
|
|
219
|
+
|
|
220
|
+
.heading1 {
|
|
221
|
+
font-weight: 600;
|
|
222
|
+
}
|
|
223
|
+
.heading2 {
|
|
224
|
+
opacity: 0.6;
|
|
225
|
+
}
|
|
226
|
+
|
|
153
227
|
.headingSeparation {
|
|
154
228
|
margin-top: 7px;
|
|
155
229
|
border-bottom: 1px solid ${cssManager.bdTheme('#bcbcbc', '#bcbcbc')};
|
|
156
230
|
}
|
|
157
231
|
|
|
232
|
+
.headerActions {
|
|
233
|
+
margin-left: auto;
|
|
234
|
+
cursor: pointer;
|
|
235
|
+
}
|
|
236
|
+
.headerAction {
|
|
237
|
+
display: flex;
|
|
238
|
+
color: ${cssManager.bdTheme('#333', '#ccc')};
|
|
239
|
+
}
|
|
240
|
+
|
|
241
|
+
.headerAction:hover {
|
|
242
|
+
color: ${cssManager.bdTheme('#555', '#fff')};
|
|
243
|
+
}
|
|
244
|
+
|
|
245
|
+
.headerAction dees-icon {
|
|
246
|
+
margin-right: 8px;
|
|
247
|
+
}
|
|
248
|
+
|
|
158
249
|
table,
|
|
159
250
|
.noDataSet {
|
|
160
251
|
margin-top: 16px;
|
|
@@ -186,7 +277,7 @@ export class DeesTable<T> extends DeesElement {
|
|
|
186
277
|
background: none;
|
|
187
278
|
}
|
|
188
279
|
tr.selected .innerCellContainer {
|
|
189
|
-
background: ${cssManager.bdTheme('#22222220', '#
|
|
280
|
+
background: ${cssManager.bdTheme('#22222220', '#ffffff40')};
|
|
190
281
|
}
|
|
191
282
|
th {
|
|
192
283
|
text-transform: uppercase;
|
|
@@ -228,14 +319,37 @@ export class DeesTable<T> extends DeesElement {
|
|
|
228
319
|
background: ${cssManager.bdTheme('#CCC', '#111')};
|
|
229
320
|
}
|
|
230
321
|
|
|
231
|
-
.
|
|
232
|
-
|
|
233
|
-
font-size: 12px;
|
|
322
|
+
.footer {
|
|
323
|
+
font-size: 14px;
|
|
234
324
|
color: ${cssManager.bdTheme('#111', '#ffffff90')};
|
|
235
325
|
background: ${cssManager.bdTheme('#eeeeeb', '#00000050')};
|
|
236
326
|
margin: 16px -16px -16px -16px;
|
|
237
327
|
border-bottom-left-radius: 3px;
|
|
238
328
|
border-bottom-right-radius: 3px;
|
|
329
|
+
display: flex;
|
|
330
|
+
}
|
|
331
|
+
|
|
332
|
+
.tableStatistics {
|
|
333
|
+
padding: 8px 16px;
|
|
334
|
+
}
|
|
335
|
+
|
|
336
|
+
.footerActions {
|
|
337
|
+
margin-left: auto;
|
|
338
|
+
}
|
|
339
|
+
|
|
340
|
+
.footerActions .footerAction {
|
|
341
|
+
cursor: pointer;
|
|
342
|
+
padding: 8px 16px;
|
|
343
|
+
display: flex;
|
|
344
|
+
}
|
|
345
|
+
|
|
346
|
+
.footerActions .footerAction:hover {
|
|
347
|
+
background: ${cssManager.bdTheme('#CCC', '#111')};
|
|
348
|
+
}
|
|
349
|
+
|
|
350
|
+
.footerActions dees-icon {
|
|
351
|
+
display: flex;
|
|
352
|
+
margin-right: 8px;
|
|
239
353
|
}
|
|
240
354
|
`,
|
|
241
355
|
];
|
|
@@ -244,15 +358,44 @@ export class DeesTable<T> extends DeesElement {
|
|
|
244
358
|
return html`
|
|
245
359
|
<div class="mainbox">
|
|
246
360
|
<!-- the heading part -->
|
|
247
|
-
<div
|
|
248
|
-
|
|
361
|
+
<div class="header">
|
|
362
|
+
<div class="headingContainer">
|
|
363
|
+
<div class="heading heading1">${this.heading1}</div>
|
|
364
|
+
<div class="heading heading2">${this.heading2}</div>
|
|
365
|
+
</div>
|
|
366
|
+
<div class="headerActions">
|
|
367
|
+
${resolveExec(async () => {
|
|
368
|
+
const resultArray: TemplateResult[] = [];
|
|
369
|
+
for (const action of this.dataActions) {
|
|
370
|
+
if (action.type !== 'header') continue;
|
|
371
|
+
resultArray.push(
|
|
372
|
+
html`<div
|
|
373
|
+
class="headerAction"
|
|
374
|
+
@click=${() => {
|
|
375
|
+
action.actionFunc(this.selectedDataRow);
|
|
376
|
+
}}
|
|
377
|
+
>
|
|
378
|
+
${action.iconName
|
|
379
|
+
? html`<dees-icon .iconSize=${14} .iconFA=${action.iconName}></dees-icon>
|
|
380
|
+
${action.name}`
|
|
381
|
+
: action.name}
|
|
382
|
+
</div>`
|
|
383
|
+
);
|
|
384
|
+
}
|
|
385
|
+
return resultArray;
|
|
386
|
+
})}
|
|
387
|
+
</div>
|
|
388
|
+
</div>
|
|
249
389
|
<div class="headingSeparation"></div>
|
|
250
390
|
|
|
251
391
|
<!-- the actual table -->
|
|
252
392
|
<style></style>
|
|
253
393
|
${this.data.length > 0
|
|
254
394
|
? (() => {
|
|
255
|
-
|
|
395
|
+
// Only pick up the keys from the first transformed data object
|
|
396
|
+
// as all data objects are assumed to have the same structure
|
|
397
|
+
const firstTransformedItem = this.displayFunction(this.data[0]);
|
|
398
|
+
const headings: string[] = Object.keys(firstTransformedItem);
|
|
256
399
|
return html`
|
|
257
400
|
<table>
|
|
258
401
|
<tr>
|
|
@@ -273,32 +416,42 @@ export class DeesTable<T> extends DeesElement {
|
|
|
273
416
|
}
|
|
274
417
|
})()}
|
|
275
418
|
</tr>
|
|
276
|
-
${this.data.map(
|
|
277
|
-
(itemArg)
|
|
419
|
+
${this.data.map((itemArg) => {
|
|
420
|
+
const transformedItem = this.displayFunction(itemArg);
|
|
421
|
+
const getTr = (elementArg: HTMLElement): HTMLElement => {
|
|
422
|
+
if (elementArg.tagName === 'TR') {
|
|
423
|
+
return elementArg;
|
|
424
|
+
} else {
|
|
425
|
+
return getTr(elementArg.parentElement);
|
|
426
|
+
}
|
|
427
|
+
};
|
|
428
|
+
return html`
|
|
278
429
|
<tr
|
|
279
430
|
@click=${() => {
|
|
280
431
|
this.selectedDataRow = itemArg;
|
|
281
432
|
}}
|
|
282
433
|
@dragenter=${async (eventArg: DragEvent) => {
|
|
283
|
-
console.log((eventArg.target as HTMLElement).tagName)
|
|
284
|
-
console.log('dragenter');
|
|
285
434
|
eventArg.preventDefault();
|
|
286
435
|
eventArg.stopPropagation();
|
|
287
|
-
(eventArg.target as HTMLElement)
|
|
436
|
+
const realTarget = getTr(eventArg.target as HTMLElement);
|
|
437
|
+
console.log('dragenter');
|
|
438
|
+
console.log(realTarget);
|
|
439
|
+
setTimeout(() => {
|
|
440
|
+
realTarget.style.background = 'green';
|
|
441
|
+
}, 0);
|
|
288
442
|
}}
|
|
289
443
|
@dragleave=${async (eventArg: DragEvent) => {
|
|
290
|
-
console.log((eventArg.target as HTMLElement).tagName)
|
|
291
|
-
console.log('dragleave');
|
|
292
444
|
eventArg.preventDefault();
|
|
293
445
|
eventArg.stopPropagation();
|
|
294
|
-
(eventArg.target as HTMLElement)
|
|
446
|
+
const realTarget = getTr(eventArg.target as HTMLElement);
|
|
447
|
+
realTarget.style.background = 'none';
|
|
295
448
|
}}
|
|
296
449
|
@dragover=${async (eventArg: DragEvent) => {
|
|
297
450
|
eventArg.preventDefault();
|
|
298
451
|
}}
|
|
299
452
|
@drop=${async (eventArg: DragEvent) => {
|
|
300
453
|
eventArg.preventDefault();
|
|
301
|
-
const newFiles = []
|
|
454
|
+
const newFiles = [];
|
|
302
455
|
for (const file of Array.from(eventArg.dataTransfer.files)) {
|
|
303
456
|
this.files.push(file);
|
|
304
457
|
newFiles.push(file);
|
|
@@ -306,17 +459,41 @@ export class DeesTable<T> extends DeesElement {
|
|
|
306
459
|
}
|
|
307
460
|
const result: File[] = this.fileWeakMap.get(itemArg as object);
|
|
308
461
|
if (!result) {
|
|
309
|
-
this.fileWeakMap.set(itemArg as object, newFiles)
|
|
462
|
+
this.fileWeakMap.set(itemArg as object, newFiles);
|
|
310
463
|
} else {
|
|
311
464
|
result.push(...newFiles);
|
|
312
465
|
}
|
|
313
466
|
}}
|
|
467
|
+
@contextmenu=${async (eventArg: MouseEvent) => {
|
|
468
|
+
DeesContextmenu.openContextMenuWithOptions(eventArg, [
|
|
469
|
+
{
|
|
470
|
+
name: 'copy',
|
|
471
|
+
iconName: 'copySolid',
|
|
472
|
+
action: async () => {
|
|
473
|
+
return null;
|
|
474
|
+
},
|
|
475
|
+
},
|
|
476
|
+
{
|
|
477
|
+
name: 'edit',
|
|
478
|
+
iconName: 'penToSquare',
|
|
479
|
+
action: async () => {
|
|
480
|
+
return null;
|
|
481
|
+
},
|
|
482
|
+
},{
|
|
483
|
+
name: 'paste',
|
|
484
|
+
iconName: 'pasteSolid',
|
|
485
|
+
action: async () => {
|
|
486
|
+
return null;
|
|
487
|
+
},
|
|
488
|
+
},
|
|
489
|
+
])
|
|
490
|
+
}}
|
|
314
491
|
class="${itemArg === this.selectedDataRow ? 'selected' : ''}"
|
|
315
492
|
>
|
|
316
493
|
${headings.map(
|
|
317
494
|
(headingArg) => html`
|
|
318
495
|
<td>
|
|
319
|
-
<div class="innerCellContainer">${
|
|
496
|
+
<div class="innerCellContainer">${transformedItem[headingArg]}</div>
|
|
320
497
|
</td>
|
|
321
498
|
`
|
|
322
499
|
)}
|
|
@@ -328,9 +505,19 @@ export class DeesTable<T> extends DeesElement {
|
|
|
328
505
|
${(() => {
|
|
329
506
|
const actions: TemplateResult[] = [];
|
|
330
507
|
for (const action of this.dataActions) {
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
508
|
+
if (action.type !== 'inRow') continue;
|
|
509
|
+
actions.push(
|
|
510
|
+
html`<div
|
|
511
|
+
class="action"
|
|
512
|
+
@click=${() => action.actionFunc(itemArg)}
|
|
513
|
+
>
|
|
514
|
+
${action.iconName
|
|
515
|
+
? html`
|
|
516
|
+
<dees-icon .iconFA=${action.iconName}></dees-icon>
|
|
517
|
+
`
|
|
518
|
+
: action.name}
|
|
519
|
+
</div>`
|
|
520
|
+
);
|
|
334
521
|
}
|
|
335
522
|
return actions;
|
|
336
523
|
})()}
|
|
@@ -340,17 +527,40 @@ export class DeesTable<T> extends DeesElement {
|
|
|
340
527
|
}
|
|
341
528
|
})()}
|
|
342
529
|
</tr>
|
|
343
|
-
|
|
344
|
-
)}
|
|
530
|
+
`;
|
|
531
|
+
})}
|
|
345
532
|
</table>
|
|
346
533
|
`;
|
|
347
534
|
})()
|
|
348
535
|
: html` <div class="noDataSet">No data set!</div> `}
|
|
349
|
-
<div class="
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
?
|
|
353
|
-
|
|
536
|
+
<div class="footer">
|
|
537
|
+
<div class="tableStatistics">
|
|
538
|
+
${this.data.length} ${this.dataName || 'data rows'} (total) |
|
|
539
|
+
${this.selectedDataRow ? '# ' + `${this.data.indexOf(this.selectedDataRow) + 1}` : `No`}
|
|
540
|
+
selected
|
|
541
|
+
</div>
|
|
542
|
+
<div class="footerActions">
|
|
543
|
+
${resolveExec(async () => {
|
|
544
|
+
const resultArray: TemplateResult[] = [];
|
|
545
|
+
for (const action of this.dataActions) {
|
|
546
|
+
if (action.type !== 'footer') continue;
|
|
547
|
+
resultArray.push(
|
|
548
|
+
html`<div
|
|
549
|
+
class="footerAction"
|
|
550
|
+
@click=${() => {
|
|
551
|
+
action.actionFunc(this.selectedDataRow);
|
|
552
|
+
}}
|
|
553
|
+
>
|
|
554
|
+
${action.iconName
|
|
555
|
+
? html`<dees-icon .iconSize=${14} .iconFA=${action.iconName}></dees-icon>
|
|
556
|
+
${action.name}`
|
|
557
|
+
: action.name}
|
|
558
|
+
</div>`
|
|
559
|
+
);
|
|
560
|
+
}
|
|
561
|
+
return resultArray;
|
|
562
|
+
})}
|
|
563
|
+
</div>
|
|
354
564
|
</div>
|
|
355
565
|
</div>
|
|
356
566
|
`;
|
|
@@ -13,6 +13,15 @@ export class DeesWindowLayer extends DeesElement {
|
|
|
13
13
|
// STATIC
|
|
14
14
|
public static demo = () => html`<dees-windowlayer></dees-windowlayer>`;
|
|
15
15
|
|
|
16
|
+
public static async createAndShow() {
|
|
17
|
+
const domtoolsInstance = domtools.DomTools.getGlobalDomToolsSync();
|
|
18
|
+
const windowLayer = new DeesWindowLayer();
|
|
19
|
+
document.body.append(windowLayer);
|
|
20
|
+
await domtoolsInstance.convenience.smartdelay.delayFor(0);
|
|
21
|
+
windowLayer.show();
|
|
22
|
+
return windowLayer;
|
|
23
|
+
}
|
|
24
|
+
|
|
16
25
|
// INSTANCE
|
|
17
26
|
@property({
|
|
18
27
|
type: Boolean
|
|
@@ -29,7 +38,7 @@ export class DeesWindowLayer extends DeesElement {
|
|
|
29
38
|
${domtools.elementBasic.styles}
|
|
30
39
|
<style>
|
|
31
40
|
.windowOverlay {
|
|
32
|
-
transition: all 0.
|
|
41
|
+
transition: all 0.2s;
|
|
33
42
|
will-change: transform;
|
|
34
43
|
position: fixed;
|
|
35
44
|
top: 0px;
|
|
@@ -82,4 +91,11 @@ export class DeesWindowLayer extends DeesElement {
|
|
|
82
91
|
await domtools.convenience.smartdelay.delayFor(0);
|
|
83
92
|
this.visible = false;
|
|
84
93
|
}
|
|
94
|
+
|
|
95
|
+
public async destroy() {
|
|
96
|
+
const domtools = await this.domtoolsPromise;
|
|
97
|
+
await this.hide();
|
|
98
|
+
await domtools.convenience.smartdelay.delayFor(300);
|
|
99
|
+
this.remove();
|
|
100
|
+
}
|
|
85
101
|
}
|