@design.estate/dees-catalog 1.0.207 → 1.0.209
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 +101 -58
- package/dist_bundle/bundle.js.map +4 -4
- package/dist_ts_web/00_commitinfo_data.js +1 -1
- package/dist_ts_web/elements/dees-dataview-codebox.js +46 -3
- package/dist_ts_web/elements/dees-table.d.ts +4 -1
- package/dist_ts_web/elements/dees-table.js +28 -7
- package/dist_watch/bundle.js +122 -58
- package/dist_watch/bundle.js.map +3 -3
- package/package.json +4 -4
- package/ts_web/00_commitinfo_data.ts +1 -1
- package/ts_web/elements/dees-dataview-codebox.ts +45 -2
- package/ts_web/elements/dees-table.ts +32 -14
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.209",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "website for lossless.com",
|
|
6
6
|
"main": "dist_ts_web/index.js",
|
|
@@ -15,8 +15,8 @@
|
|
|
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.41",
|
|
19
|
+
"@design.estate/dees-element": "^2.0.29",
|
|
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",
|
|
@@ -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.6.
|
|
38
|
+
"@types/node": "^20.6.2"
|
|
39
39
|
},
|
|
40
40
|
"files": [
|
|
41
41
|
"ts/**/*",
|
|
@@ -67,6 +67,42 @@ export class DeesDataviewCodebox extends DeesElement {
|
|
|
67
67
|
line-height: 24px;
|
|
68
68
|
}
|
|
69
69
|
|
|
70
|
+
.appbar .macControls {
|
|
71
|
+
position: absolute;
|
|
72
|
+
top: 6px;
|
|
73
|
+
left: 20px;
|
|
74
|
+
width: 200px;
|
|
75
|
+
display: grid;
|
|
76
|
+
grid-template-columns: 24px 24px 24px;
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
.appbar .macControls div {
|
|
80
|
+
width: 12px;
|
|
81
|
+
height: 12px;
|
|
82
|
+
display: inline-block;
|
|
83
|
+
border-radius: 50%;
|
|
84
|
+
margin: 0px;
|
|
85
|
+
padding: 0px;
|
|
86
|
+
cursor: pointer;
|
|
87
|
+
background: #222222;
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
.appbar .macControls div.close {
|
|
91
|
+
background: #FF5F57;
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
.appbar .macControls div.toDock {
|
|
95
|
+
background: #FFBD2E;
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
.appbar .macControls div.minMax {
|
|
99
|
+
background: #27C93F;
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
.appbar .macControls div:hover {
|
|
103
|
+
background: #333333;
|
|
104
|
+
}
|
|
105
|
+
|
|
70
106
|
.appbar .fileName {
|
|
71
107
|
text-align: center;
|
|
72
108
|
}
|
|
@@ -76,13 +112,15 @@ export class DeesDataviewCodebox extends DeesElement {
|
|
|
76
112
|
background: #161616;
|
|
77
113
|
border-top: 1px solid #222222;
|
|
78
114
|
font-size: 12px;
|
|
79
|
-
color: #
|
|
115
|
+
color: #888;
|
|
80
116
|
font-family: 'Hubot Sans', 'monospace';
|
|
81
117
|
line-height: 24px;
|
|
118
|
+
text-align: right;
|
|
119
|
+
padding-right: 100px;
|
|
82
120
|
}
|
|
83
121
|
|
|
84
122
|
.languageLabel {
|
|
85
|
-
color: #
|
|
123
|
+
color: #ccc;
|
|
86
124
|
font-size: 12px;
|
|
87
125
|
line-height: 24px;
|
|
88
126
|
z-index: 10;
|
|
@@ -158,6 +196,11 @@ export class DeesDataviewCodebox extends DeesElement {
|
|
|
158
196
|
</style>
|
|
159
197
|
<div class="mainbox">
|
|
160
198
|
<div class="appbar">
|
|
199
|
+
<div class="macControls">
|
|
200
|
+
<div class="close"></div>
|
|
201
|
+
<div class="toDock"></div>
|
|
202
|
+
<div class="minMax"></div>
|
|
203
|
+
</div>
|
|
161
204
|
<div class="fileName">index.ts</div>
|
|
162
205
|
</div>
|
|
163
206
|
<div class="codegrid">
|
|
@@ -99,6 +99,11 @@ export class DeesTable<T> extends DeesElement {
|
|
|
99
99
|
})
|
|
100
100
|
public displayFunction: TDisplayFunction = (itemArg: T) => itemArg as any;
|
|
101
101
|
|
|
102
|
+
@property({
|
|
103
|
+
attribute: false,
|
|
104
|
+
})
|
|
105
|
+
public reverseDisplayFunction: (itemArg: any) => T = (itemArg: any) => itemArg as T;
|
|
106
|
+
|
|
102
107
|
@property({
|
|
103
108
|
type: Object,
|
|
104
109
|
})
|
|
@@ -112,6 +117,8 @@ export class DeesTable<T> extends DeesElement {
|
|
|
112
117
|
public files: File[] = [];
|
|
113
118
|
public fileWeakMap = new WeakMap();
|
|
114
119
|
|
|
120
|
+
public itemChangeSubject = new domtools.plugins.smartrx.rxjs.Subject();
|
|
121
|
+
|
|
115
122
|
constructor() {
|
|
116
123
|
super();
|
|
117
124
|
}
|
|
@@ -259,7 +266,7 @@ export class DeesTable<T> extends DeesElement {
|
|
|
259
266
|
font-family: inherit;
|
|
260
267
|
font-size: inherit;
|
|
261
268
|
font-weight: inherit;
|
|
262
|
-
padding: 0px 6px
|
|
269
|
+
padding: 0px 6px;
|
|
263
270
|
}
|
|
264
271
|
|
|
265
272
|
.action {
|
|
@@ -535,35 +542,34 @@ export class DeesTable<T> extends DeesElement {
|
|
|
535
542
|
// Get the table element
|
|
536
543
|
const table = this.shadowRoot.querySelector('table');
|
|
537
544
|
if (!table) return;
|
|
538
|
-
|
|
545
|
+
|
|
539
546
|
// Create a colgroup if it doesn't exist
|
|
540
547
|
let colgroup = table.querySelector('colgroup');
|
|
541
548
|
if (!colgroup) {
|
|
542
549
|
colgroup = document.createElement('colgroup');
|
|
543
550
|
table.insertBefore(colgroup, table.firstChild);
|
|
544
551
|
}
|
|
545
|
-
|
|
552
|
+
|
|
546
553
|
// Get the first row's cells to measure the widths
|
|
547
554
|
const cells = table.rows[0].cells;
|
|
548
|
-
|
|
555
|
+
|
|
549
556
|
for (let i = 0; i < cells.length; i++) {
|
|
550
557
|
const cell = cells[i];
|
|
551
|
-
|
|
558
|
+
|
|
552
559
|
// Get computed width
|
|
553
560
|
const width = window.getComputedStyle(cell).width;
|
|
554
|
-
|
|
561
|
+
|
|
555
562
|
// Check if there's already a <col> for this cell
|
|
556
563
|
let col = colgroup.children[i] as HTMLElement;
|
|
557
564
|
if (!col) {
|
|
558
565
|
col = document.createElement('col');
|
|
559
566
|
colgroup.appendChild(col);
|
|
560
567
|
}
|
|
561
|
-
|
|
568
|
+
|
|
562
569
|
// Set the width
|
|
563
570
|
col.style.width = width;
|
|
564
571
|
}
|
|
565
572
|
}
|
|
566
|
-
|
|
567
573
|
|
|
568
574
|
getActionsForType(typeArg: ITableAction['type'][0]) {
|
|
569
575
|
const actions: ITableAction[] = [];
|
|
@@ -574,22 +580,34 @@ export class DeesTable<T> extends DeesElement {
|
|
|
574
580
|
return actions;
|
|
575
581
|
}
|
|
576
582
|
|
|
577
|
-
handleCellEditing(event: Event,
|
|
583
|
+
handleCellEditing(event: Event, itemArg: T, key: string) {
|
|
578
584
|
const target = event.target as HTMLElement;
|
|
579
|
-
|
|
585
|
+
const transformedItem = this.displayFunction(itemArg);
|
|
586
|
+
const initialValue = (transformedItem[key] as unknown as string) || '';
|
|
580
587
|
// Create an input element
|
|
581
588
|
const input = document.createElement('input');
|
|
582
589
|
input.type = 'text';
|
|
583
|
-
input.value =
|
|
590
|
+
input.value = initialValue;
|
|
591
|
+
|
|
592
|
+
const blurInput = (blurArg = true, saveArg = false) => {
|
|
593
|
+
if (blurArg) {
|
|
594
|
+
input.blur();
|
|
595
|
+
}
|
|
596
|
+
if (saveArg) {
|
|
597
|
+
itemArg[key] = input.value as any; // Convert string to T (you might need better type casting depending on your data structure)
|
|
598
|
+
target.innerHTML = input.value; // Update the cell's display
|
|
599
|
+
} else {
|
|
600
|
+
target.innerHTML = initialValue;
|
|
601
|
+
}
|
|
602
|
+
};
|
|
584
603
|
|
|
585
604
|
// When the input loses focus or the Enter key is pressed, update the data
|
|
586
605
|
input.addEventListener('blur', () => {
|
|
587
|
-
|
|
588
|
-
target.innerHTML = input.value; // Update the cell's display
|
|
606
|
+
blurInput(false, false);
|
|
589
607
|
});
|
|
590
608
|
input.addEventListener('keydown', (e: KeyboardEvent) => {
|
|
591
609
|
if (e.key === 'Enter') {
|
|
592
|
-
|
|
610
|
+
blurInput(true, true); // This will trigger the blur event handler above
|
|
593
611
|
}
|
|
594
612
|
});
|
|
595
613
|
|