@maggioli-design-system/mds-table-row 4.8.1 → 5.0.1
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/{index-19c36c53.js → index-cb928c36.js} +201 -136
- package/dist/cjs/loader.cjs.js +2 -2
- package/dist/cjs/mds-table-row.cjs.entry.js +893 -10
- package/dist/cjs/mds-table-row.cjs.js +3 -3
- package/dist/collection/collection-manifest.json +1 -1
- package/dist/collection/common/floating-controller.js +180 -0
- package/dist/collection/common/slot.js +19 -0
- package/dist/collection/components/mds-table-row/mds-table-row.css +31 -16
- package/dist/collection/components/mds-table-row/mds-table-row.js +118 -23
- package/dist/collection/dictionary/animation.js +5 -0
- package/dist/collection/dictionary/file-extensions.js +6 -59
- package/dist/collection/dictionary/tree.js +13 -0
- package/dist/collection/fixtures/filenames.js +62 -1
- package/dist/collection/type/animation.js +1 -0
- package/dist/collection/type/tree.js +1 -0
- package/dist/collection/type/variant-file-format.js +5 -0
- package/dist/components/mds-table-row.js +900 -12
- package/dist/documentation.d.ts +8 -0
- package/dist/documentation.json +121 -16
- package/dist/esm/{index-a948f479.js → index-8134a00a.js} +201 -136
- package/dist/esm/loader.js +3 -3
- package/dist/esm/mds-table-row.entry.js +893 -10
- package/dist/esm/mds-table-row.js +4 -4
- package/dist/esm-es5/index-8134a00a.js +1 -0
- package/dist/esm-es5/loader.js +1 -1
- package/dist/esm-es5/mds-table-row.entry.js +6 -1
- package/dist/esm-es5/mds-table-row.js +1 -1
- package/dist/mds-table-row/mds-table-row.esm.js +1 -1
- package/dist/mds-table-row/mds-table-row.js +1 -1
- package/dist/mds-table-row/p-11048c96.system.js +1 -0
- package/dist/mds-table-row/p-22d4881a.js +2 -0
- package/dist/mds-table-row/p-827e2f31.entry.js +6 -0
- package/dist/mds-table-row/p-88f814c9.system.js +2 -0
- package/dist/mds-table-row/p-ed03fa5e.system.entry.js +6 -0
- package/dist/stats.json +267 -70
- package/dist/types/common/floating-controller.d.ts +46 -0
- package/dist/types/common/slot.d.ts +3 -0
- package/dist/types/components/mds-table-row/mds-table-row.d.ts +9 -3
- package/dist/types/components.d.ts +8 -1
- package/dist/types/dictionary/animation.d.ts +2 -0
- package/dist/types/dictionary/tree.d.ts +4 -0
- package/dist/types/fixtures/filenames.d.ts +62 -1
- package/dist/types/type/animation.d.ts +1 -0
- package/dist/types/type/file-types.d.ts +1 -1
- package/dist/types/type/tree.d.ts +3 -0
- package/dist/types/type/variant-file-format.d.ts +1 -1
- package/documentation.json +170 -29
- package/package.json +4 -4
- package/readme.md +24 -4
- package/src/common/floating-controller.ts +263 -0
- package/src/common/slot.ts +24 -0
- package/src/components/mds-table-row/css/mds-table-row-actions.css +10 -3
- package/src/components/mds-table-row/css/mds-table-row-interactive.css +6 -0
- package/src/components/mds-table-row/css/mds-table-row-selected.css +5 -0
- package/src/components/mds-table-row/css/mds-table-row-sorted.css +11 -0
- package/src/components/mds-table-row/mds-table-row.css +11 -26
- package/src/components/mds-table-row/mds-table-row.tsx +38 -9
- package/src/components/mds-table-row/meta/locale.el.json +4 -0
- package/src/components/mds-table-row/meta/locale.en.json +4 -0
- package/src/components/mds-table-row/meta/locale.es.json +4 -0
- package/src/components/mds-table-row/meta/locale.it.json +4 -0
- package/src/components/mds-table-row/readme.md +20 -4
- package/src/components.d.ts +8 -1
- package/src/dictionary/animation.ts +8 -0
- package/src/dictionary/file-extensions.ts +6 -60
- package/src/dictionary/tree.ts +21 -0
- package/src/fixtures/filenames.ts +63 -0
- package/src/fixtures/icons.json +21 -0
- package/src/fixtures/iconsauce.json +6 -0
- package/src/meta/file-format/locale.el.json +26 -21
- package/src/meta/file-format/locale.en.json +26 -21
- package/src/meta/file-format/locale.es.json +26 -21
- package/src/meta/file-format/locale.it.json +26 -21
- package/src/type/animation.ts +3 -0
- package/src/type/file-types.ts +6 -0
- package/src/type/tree.ts +12 -0
- package/src/type/variant-file-format.ts +6 -0
- package/www/build/mds-table-row.esm.js +1 -1
- package/www/build/mds-table-row.js +1 -1
- package/www/build/p-11048c96.system.js +1 -0
- package/www/build/p-22d4881a.js +2 -0
- package/www/build/p-827e2f31.entry.js +6 -0
- package/www/build/p-88f814c9.system.js +2 -0
- package/www/build/p-ed03fa5e.system.entry.js +6 -0
- package/dist/esm-es5/index-a948f479.js +0 -1
- package/dist/mds-table-row/p-5ab8c209.system.entry.js +0 -1
- package/dist/mds-table-row/p-98955251.system.js +0 -1
- package/dist/mds-table-row/p-bfa177c6.system.js +0 -2
- package/dist/mds-table-row/p-d906e5c7.entry.js +0 -1
- package/dist/mds-table-row/p-faec61cc.js +0 -2
- package/www/build/p-5ab8c209.system.entry.js +0 -1
- package/www/build/p-98955251.system.js +0 -1
- package/www/build/p-bfa177c6.system.js +0 -2
- package/www/build/p-d906e5c7.entry.js +0 -1
- package/www/build/p-faec61cc.js +0 -2
|
@@ -2,11 +2,11 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
const index = require('./index-
|
|
5
|
+
const index = require('./index-cb928c36.js');
|
|
6
6
|
const appGlobals = require('./app-globals-3a1e7e63.js');
|
|
7
7
|
|
|
8
8
|
/*
|
|
9
|
-
Stencil Client Patch Browser v4.
|
|
9
|
+
Stencil Client Patch Browser v4.25.1 | MIT Licensed | https://stenciljs.com
|
|
10
10
|
*/
|
|
11
11
|
var patchBrowser = () => {
|
|
12
12
|
const importMeta = (typeof document === 'undefined' ? new (require('u' + 'rl').URL)('file:' + __filename).href : (document.currentScript && document.currentScript.src || new URL('mds-table-row.cjs.js', document.baseURI).href));
|
|
@@ -19,7 +19,7 @@ var patchBrowser = () => {
|
|
|
19
19
|
|
|
20
20
|
patchBrowser().then(async (options) => {
|
|
21
21
|
await appGlobals.globalScripts();
|
|
22
|
-
return index.bootstrapLazy([["mds-table-row.cjs",[[1,"mds-table-row",{"interactive":[
|
|
22
|
+
return index.bootstrapLazy([["mds-table-row.cjs",[[1,"mds-table-row",{"interactive":[516],"overlayActions":[516,"overlay-actions"],"selectable":[516],"selected":[1540],"value":[520],"language":[32],"updateLang":[64]}]]]], options);
|
|
23
23
|
});
|
|
24
24
|
|
|
25
25
|
exports.setNonce = index.setNonce;
|
|
@@ -0,0 +1,180 @@
|
|
|
1
|
+
import { arrow, autoPlacement, autoUpdate, computePosition, flip, offset, shift, } from "@floating-ui/dom";
|
|
2
|
+
import { cssDurationToMilliseconds } from "./unit";
|
|
3
|
+
import { setAttributeIfEmpty } from "./aria";
|
|
4
|
+
export class FloatingController {
|
|
5
|
+
constructor(host, arrowEl) {
|
|
6
|
+
this.arrowInset = (middleware, arrowPosition) => {
|
|
7
|
+
const { arrow } = middleware;
|
|
8
|
+
const inset = { bottom: '', left: '', right: '', top: '' };
|
|
9
|
+
if (arrow === undefined) {
|
|
10
|
+
return {};
|
|
11
|
+
}
|
|
12
|
+
switch (arrowPosition) {
|
|
13
|
+
case 'bottom':
|
|
14
|
+
inset.left = arrow.x !== null ? `${arrow.x}px` : '';
|
|
15
|
+
inset.top = '100%';
|
|
16
|
+
break;
|
|
17
|
+
case 'left':
|
|
18
|
+
inset.right = '100%';
|
|
19
|
+
inset.top = arrow.y !== null ? `${arrow.y}px` : '';
|
|
20
|
+
break;
|
|
21
|
+
case 'right':
|
|
22
|
+
inset.left = '100%';
|
|
23
|
+
inset.top = arrow.y !== null ? `${arrow.y}px` : '';
|
|
24
|
+
break;
|
|
25
|
+
case 'top':
|
|
26
|
+
inset.left = arrow.x !== null ? `${arrow.x}px` : '';
|
|
27
|
+
inset.top = '';
|
|
28
|
+
break;
|
|
29
|
+
default:
|
|
30
|
+
break;
|
|
31
|
+
}
|
|
32
|
+
return inset;
|
|
33
|
+
};
|
|
34
|
+
this.arrowTransform = (arrowPosition) => {
|
|
35
|
+
let transformProps = this._host.arrow && this._host.visible ? 'scale(1)' : 'scale(0)';
|
|
36
|
+
switch (arrowPosition) {
|
|
37
|
+
case 'bottom':
|
|
38
|
+
transformProps = `rotate(180deg) ${transformProps} translate(0, -100%)`;
|
|
39
|
+
break;
|
|
40
|
+
case 'left':
|
|
41
|
+
transformProps = `rotate(-90deg) ${transformProps} translate(50%, -50%)`;
|
|
42
|
+
break;
|
|
43
|
+
case 'right':
|
|
44
|
+
transformProps = `rotate(90deg) ${transformProps} translate(-50%, -50%)`;
|
|
45
|
+
break;
|
|
46
|
+
case 'top':
|
|
47
|
+
transformProps = `rotate(0deg) ${transformProps} translate(0, 0)`;
|
|
48
|
+
break;
|
|
49
|
+
default:
|
|
50
|
+
break;
|
|
51
|
+
}
|
|
52
|
+
return { transform: transformProps };
|
|
53
|
+
};
|
|
54
|
+
this.arrowTransformOrigin = (arrowPosition) => {
|
|
55
|
+
switch (arrowPosition) {
|
|
56
|
+
case 'bottom':
|
|
57
|
+
return { transformOrigin: 'center top' };
|
|
58
|
+
case 'left':
|
|
59
|
+
return { transformOrigin: 'right center' };
|
|
60
|
+
case 'right':
|
|
61
|
+
return { transformOrigin: 'left center' };
|
|
62
|
+
case 'top':
|
|
63
|
+
return { transformOrigin: 'center bottom' };
|
|
64
|
+
default:
|
|
65
|
+
return { transformOrigin: 'center top' };
|
|
66
|
+
}
|
|
67
|
+
};
|
|
68
|
+
this.calculatePosition = () => {
|
|
69
|
+
if (!this._caller)
|
|
70
|
+
return;
|
|
71
|
+
const middleware = new Array();
|
|
72
|
+
const config = {};
|
|
73
|
+
if (this._host.shiftPadding) {
|
|
74
|
+
config.padding = this._host.shiftPadding;
|
|
75
|
+
}
|
|
76
|
+
if (this._host.autoPlacement) {
|
|
77
|
+
middleware.push(autoPlacement());
|
|
78
|
+
}
|
|
79
|
+
if (this._host.offset) {
|
|
80
|
+
middleware.push(offset(this._host.offset));
|
|
81
|
+
}
|
|
82
|
+
if (!this._host.autoPlacement && this._host.flip) {
|
|
83
|
+
middleware.push(flip(config));
|
|
84
|
+
}
|
|
85
|
+
if (this._host.shift) {
|
|
86
|
+
middleware.push(shift(config));
|
|
87
|
+
}
|
|
88
|
+
if (this.arrowEl && this._host.arrow) {
|
|
89
|
+
middleware.push(arrow({
|
|
90
|
+
element: this.arrowEl,
|
|
91
|
+
padding: this._host.arrowPadding,
|
|
92
|
+
}));
|
|
93
|
+
}
|
|
94
|
+
computePosition(this._caller, this._host, {
|
|
95
|
+
middleware,
|
|
96
|
+
placement: this._host.placement,
|
|
97
|
+
strategy: this._host.strategy,
|
|
98
|
+
}).then(({ x, y, placement, middlewareData }) => {
|
|
99
|
+
Object.assign(this._host.style, {
|
|
100
|
+
left: `${x}px`,
|
|
101
|
+
top: `${y}px`,
|
|
102
|
+
});
|
|
103
|
+
const arrowStyle = {};
|
|
104
|
+
const arrowPosition = {
|
|
105
|
+
top: 'bottom',
|
|
106
|
+
right: 'left',
|
|
107
|
+
bottom: 'top',
|
|
108
|
+
left: 'right',
|
|
109
|
+
}[placement.split('-')[0]];
|
|
110
|
+
if (arrowPosition && this.arrowEl) {
|
|
111
|
+
Object.assign(arrowStyle, this.arrowTransform(arrowPosition));
|
|
112
|
+
Object.assign(arrowStyle, this.arrowInset(middlewareData, arrowPosition));
|
|
113
|
+
Object.assign(arrowStyle, this.arrowTransformOrigin(arrowPosition));
|
|
114
|
+
Object.assign(this.arrowEl.style, arrowStyle);
|
|
115
|
+
}
|
|
116
|
+
});
|
|
117
|
+
};
|
|
118
|
+
this._host = host;
|
|
119
|
+
this.arrowEl = arrowEl;
|
|
120
|
+
}
|
|
121
|
+
updateCaller(target) {
|
|
122
|
+
var _a, _b, _c;
|
|
123
|
+
// search caller in document or rootNode of host (if target is in shadowDOM)
|
|
124
|
+
const caller = (_c = (_b = (_a = this._host.parentElement) === null || _a === void 0 ? void 0 : _a.shadowRoot) === null || _b === void 0 ? void 0 : _b.querySelector(target)) !== null && _c !== void 0 ? _c : this._host.getRootNode().querySelector(target);
|
|
125
|
+
if (!caller) {
|
|
126
|
+
throw Error(`Target not found: ${target}`);
|
|
127
|
+
}
|
|
128
|
+
this._caller = caller;
|
|
129
|
+
setAttributeIfEmpty(this._caller, 'aria-haspopup', 'true');
|
|
130
|
+
setAttributeIfEmpty(this._caller, 'aria-controls', target);
|
|
131
|
+
setAttributeIfEmpty(this._host, 'role', 'menu');
|
|
132
|
+
setAttributeIfEmpty(this._host, 'aria-labelledby', target);
|
|
133
|
+
return caller;
|
|
134
|
+
}
|
|
135
|
+
updatePosition() {
|
|
136
|
+
if (this.cleanupAutoUpdate)
|
|
137
|
+
this.cleanupAutoUpdate();
|
|
138
|
+
this.cleanupAutoUpdate = autoUpdate(this._caller, this._host, this.calculatePosition);
|
|
139
|
+
}
|
|
140
|
+
dismiss() {
|
|
141
|
+
this.cleanupAutoUpdate();
|
|
142
|
+
}
|
|
143
|
+
}
|
|
144
|
+
export class Backdrop {
|
|
145
|
+
constructor(backdropId) {
|
|
146
|
+
this.defaultBackdropId = 'mds-backdrop';
|
|
147
|
+
this.backdropBackgroundVisible = 'rgba(var(--magma-backdrop-color, 0 0 0) / var(--magma-backdrop-opacity, 0.1))';
|
|
148
|
+
this.backdropBackgroundHidden = 'rgba(var(--magma-backdrop-color, 0 0 0) / 0)';
|
|
149
|
+
this.backdropId = backdropId !== null && backdropId !== void 0 ? backdropId : this.defaultBackdropId;
|
|
150
|
+
this.cssBackdropZIndex = `var(--${this.backdropId}-z-index)`;
|
|
151
|
+
this.cssBackdropDuration = `var(--${this.backdropId}-duration)`;
|
|
152
|
+
}
|
|
153
|
+
attachBackdrop() {
|
|
154
|
+
if (!this.backdropEl) {
|
|
155
|
+
this.backdropEl = document.createElement('div');
|
|
156
|
+
this.backdropEl.className = this.backdropId;
|
|
157
|
+
this.backdropEl.style.inset = '0';
|
|
158
|
+
this.backdropEl.style.pointerEvents = 'none';
|
|
159
|
+
this.backdropEl.style.position = 'fixed';
|
|
160
|
+
this.backdropEl.style.transition = `background-color ${this.cssBackdropDuration} ease-out`;
|
|
161
|
+
this.backdropEl.style.zIndex = this.cssBackdropZIndex;
|
|
162
|
+
}
|
|
163
|
+
this.backdropEl.style.backgroundColor = this.backdropBackgroundHidden;
|
|
164
|
+
document.body.appendChild(this.backdropEl);
|
|
165
|
+
clearTimeout(this.backdropTimer);
|
|
166
|
+
this.backdropTimer = setTimeout(() => {
|
|
167
|
+
this.backdropEl.style.backgroundColor = this.backdropBackgroundVisible;
|
|
168
|
+
}, 1);
|
|
169
|
+
}
|
|
170
|
+
detachBackdrop() {
|
|
171
|
+
if (!this.backdropEl) {
|
|
172
|
+
return;
|
|
173
|
+
}
|
|
174
|
+
this.backdropEl.style.backgroundColor = 'transparent';
|
|
175
|
+
clearTimeout(this.backdropTimer);
|
|
176
|
+
this.backdropTimer = setTimeout(() => {
|
|
177
|
+
this.backdropEl.remove();
|
|
178
|
+
}, cssDurationToMilliseconds(this.cssBackdropDuration));
|
|
179
|
+
}
|
|
180
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
const hasSlottedElements = (el, name) => {
|
|
2
|
+
var _a;
|
|
3
|
+
const query = name ? `slot[name="${name}"]` : 'slot:not([name])';
|
|
4
|
+
const slot = (_a = el.shadowRoot) === null || _a === void 0 ? void 0 : _a.querySelector(query);
|
|
5
|
+
if (slot) {
|
|
6
|
+
return slot.assignedElements({ flatten: true }).length > 0;
|
|
7
|
+
}
|
|
8
|
+
return false;
|
|
9
|
+
};
|
|
10
|
+
const hasSlottedNodes = (el, name) => {
|
|
11
|
+
var _a;
|
|
12
|
+
const query = name ? `slot[name="${name}"]` : 'slot:not([name])';
|
|
13
|
+
const slot = (_a = el.shadowRoot) === null || _a === void 0 ? void 0 : _a.querySelector(query);
|
|
14
|
+
if (slot) {
|
|
15
|
+
return slot.assignedNodes().length > 0;
|
|
16
|
+
}
|
|
17
|
+
return false;
|
|
18
|
+
};
|
|
19
|
+
export { hasSlottedElements, hasSlottedNodes, };
|
|
@@ -2,8 +2,10 @@
|
|
|
2
2
|
|
|
3
3
|
:host {
|
|
4
4
|
|
|
5
|
-
--mds-table-row-color-hover: var(--mds-table-color
|
|
6
|
-
--mds-table-row-color: var(--mds-table-color, rgb(var(--tone-neutral-
|
|
5
|
+
--mds-table-row-color-hover: var(--mds-table-color, rgb(var(--tone-neutral-02)));
|
|
6
|
+
--mds-table-row-color-alt: var(--mds-table-color-alt, rgb(var(--tone-neutral-02)));
|
|
7
|
+
--mds-table-row-background-hover: var(--mds-table-background, rgb(var(--tone-neutral)));
|
|
8
|
+
--mds-table-row-background-alt: var(--mds-table-background-alt, rgb(var(--tone-neutral)));
|
|
7
9
|
--mds-table-row-actions-gap: var(--mds-table-actions-gap, 1rem);
|
|
8
10
|
transition-duration: 200ms;
|
|
9
11
|
transition-timing-function: cubic-bezier(0, 0, 0.2, 1);
|
|
@@ -15,31 +17,37 @@
|
|
|
15
17
|
|
|
16
18
|
}
|
|
17
19
|
|
|
18
|
-
|
|
20
|
+
.selection-cell {
|
|
21
|
+
vertical-align: middle;
|
|
22
|
+
}
|
|
19
23
|
|
|
20
|
-
|
|
24
|
+
.checkbox-wrapper {
|
|
25
|
+
display: flex;
|
|
21
26
|
}
|
|
22
27
|
|
|
23
|
-
:host([
|
|
28
|
+
:host([interactive]:hover) {
|
|
24
29
|
|
|
25
|
-
--mds-table-
|
|
30
|
+
--mds-table-row-actions-background: var(--mds-table-row-background-hover);
|
|
31
|
+
--mds-table-row-background: var(--mds-table-row-background-hover);
|
|
32
|
+
--mds-table-row-color: var(--mds-table-row-color-hover);
|
|
26
33
|
}
|
|
27
34
|
|
|
28
|
-
:host([
|
|
35
|
+
:host([selected]) {
|
|
29
36
|
|
|
30
|
-
--mds-table-
|
|
37
|
+
--mds-table-row-background: var(--mds-table-row-background-hover);
|
|
31
38
|
--mds-table-row-color: var(--mds-table-row-color-hover);
|
|
32
39
|
}
|
|
33
40
|
|
|
41
|
+
:host([sorted]) {
|
|
34
42
|
|
|
35
|
-
:
|
|
36
|
-
|
|
37
|
-
--mds-table-cell-background: var(--mds-table-cell-background-hover);
|
|
43
|
+
--mds-table-row-background: var(--mds-table-row-background-alt);
|
|
44
|
+
--mds-table-row-color: var(--mds-table-row-color-alt);
|
|
38
45
|
}
|
|
39
46
|
|
|
40
|
-
:host([sorted]
|
|
47
|
+
:host([sorted][selected]) {
|
|
41
48
|
|
|
42
|
-
--mds-table-
|
|
49
|
+
--mds-table-row-background: var(--mds-table-row-background-hover);
|
|
50
|
+
--mds-table-row-color: var(--mds-table-row-color-hover);
|
|
43
51
|
}
|
|
44
52
|
|
|
45
53
|
.actions-view {
|
|
@@ -52,8 +60,11 @@
|
|
|
52
60
|
}
|
|
53
61
|
|
|
54
62
|
.actions {
|
|
63
|
+
|
|
64
|
+
--mds-table-row-actions-background: var(--mds-table-row-background);
|
|
65
|
+
|
|
55
66
|
align-items: center;
|
|
56
|
-
background-color: var(--mds-table-
|
|
67
|
+
background-color: var(--mds-table-row-actions-background);
|
|
57
68
|
display: inline-flex;
|
|
58
69
|
gap: var(--mds-table-row-actions-gap);
|
|
59
70
|
inset: 0;
|
|
@@ -72,12 +83,16 @@
|
|
|
72
83
|
transform: translateX(100%);
|
|
73
84
|
}
|
|
74
85
|
|
|
75
|
-
|
|
86
|
+
|
|
87
|
+
:host([overlay-actions]) .actions {
|
|
76
88
|
padding-right: var(--mds-table-cell-padding);
|
|
77
89
|
transform: translateX(100%);
|
|
78
90
|
}
|
|
79
91
|
|
|
80
|
-
:host([overlay-actions]:
|
|
92
|
+
:host([overlay-actions]:hover) .actions {
|
|
93
|
+
|
|
94
|
+
--mds-table-row-actions-background: var(--mds-table-row-background);
|
|
95
|
+
|
|
81
96
|
transform: translateX(0);
|
|
82
97
|
}
|
|
83
98
|
|
|
@@ -1,18 +1,33 @@
|
|
|
1
1
|
import { Host, h } from "@stencil/core";
|
|
2
|
-
|
|
3
|
-
|
|
2
|
+
import { Locale } from "../../common/locale";
|
|
3
|
+
import localeEl from "./meta/locale.el.json";
|
|
4
|
+
import localeEn from "./meta/locale.en.json";
|
|
5
|
+
import localeEs from "./meta/locale.es.json";
|
|
6
|
+
import localeIt from "./meta/locale.it.json";
|
|
4
7
|
/**
|
|
5
8
|
* @slot default - Put `mds-table-cell` element/s.
|
|
6
9
|
*/
|
|
7
10
|
export class MdsTableRow {
|
|
8
11
|
constructor() {
|
|
9
|
-
this.
|
|
10
|
-
|
|
12
|
+
this.t = new Locale({
|
|
13
|
+
el: localeEl,
|
|
14
|
+
en: localeEn,
|
|
15
|
+
es: localeEs,
|
|
16
|
+
it: localeIt,
|
|
17
|
+
});
|
|
18
|
+
this.selectable = undefined;
|
|
19
|
+
this.handleSelectionChange = (e) => {
|
|
20
|
+
var _a;
|
|
21
|
+
this.selected = e.detail.checked;
|
|
22
|
+
(_a = this.host.closest('mds-table')) === null || _a === void 0 ? void 0 : _a.updateSelection();
|
|
23
|
+
};
|
|
11
24
|
}
|
|
12
|
-
|
|
13
|
-
this.
|
|
25
|
+
async updateLang() {
|
|
26
|
+
this.language = this.t.lang(this.host);
|
|
27
|
+
this.t.update();
|
|
14
28
|
}
|
|
15
29
|
componentWillLoad() {
|
|
30
|
+
this.language = this.t.lang(this.host);
|
|
16
31
|
this.hasActions = this.host.querySelector('[slot="action"]') !== null;
|
|
17
32
|
}
|
|
18
33
|
componentDidLoad() {
|
|
@@ -23,14 +38,15 @@ export class MdsTableRow {
|
|
|
23
38
|
}
|
|
24
39
|
}
|
|
25
40
|
render() {
|
|
26
|
-
return (h(Host, { key: '
|
|
27
|
-
h("mds-table-cell", { key: '
|
|
41
|
+
return (h(Host, { key: '4905591b94a0af846d25e3cf55fe5805ecec76be', role: "row" }, this.selectable &&
|
|
42
|
+
h("mds-table-cell", { key: '07f8596969f20148250cc42fde0a806435825274', class: "selection-cell" }, h("div", { key: '2d0bb74f3f5edaf6180c68a60457b374dcd7a4bd', class: "checkbox-wrapper" }, h("mds-input-switch", { key: 'e04fafd6a53ed1c6a4208b0317419fe21d08f28e', title: this.t.get(this.selected ? 'unselectRow' : 'selectRow'), lang: this.language, type: "checkbox", checked: this.selected, onMdsInputSwitchChange: this.handleSelectionChange }))), h("slot", { key: 'd71c2ec9e675fd8190eeeb7d816a5e2566c6afc4' }), this.hasActions &&
|
|
43
|
+
h("mds-table-cell", { key: '0ede2c5f98d7541920c4170d70c21f9f61ac93cb', class: "actions-cell" }, h("div", { key: '8a097d4b04bd594778f51bedfe438fe1fd3479b3', class: "actions-sizer", style: {
|
|
28
44
|
minHeight: '1px',
|
|
29
45
|
maxWidth: this.sizerWidth,
|
|
30
46
|
minWidth: this.sizerWidth,
|
|
31
|
-
} }), h("div", { key: '
|
|
47
|
+
} }), h("div", { key: '31f1fe8d7e4ee01f33f1c6a5b76e23fd875dfd82', class: "actions-view" }, h("div", { key: '762785e31a306ba3c1e7654218bdf8cb33044cd3', class: "actions", style: {
|
|
32
48
|
marginRight: `calc(${this.sizerWidth} + var(--mds-table-cell-padding))`,
|
|
33
|
-
} }, h("slot", { key: '
|
|
49
|
+
} }, h("slot", { key: '05ea2b5edc71e58859e55e52c1ab65ca0c5354f8', name: "action" }))))));
|
|
34
50
|
}
|
|
35
51
|
static get is() { return "mds-table-row"; }
|
|
36
52
|
static get encapsulation() { return "shadow"; }
|
|
@@ -48,24 +64,26 @@ export class MdsTableRow {
|
|
|
48
64
|
return {
|
|
49
65
|
"interactive": {
|
|
50
66
|
"type": "boolean",
|
|
51
|
-
"mutable":
|
|
67
|
+
"mutable": false,
|
|
52
68
|
"complexType": {
|
|
53
69
|
"original": "boolean",
|
|
54
|
-
"resolved": "boolean",
|
|
70
|
+
"resolved": "boolean | undefined",
|
|
55
71
|
"references": {}
|
|
56
72
|
},
|
|
57
73
|
"required": false,
|
|
58
|
-
"optional":
|
|
74
|
+
"optional": true,
|
|
59
75
|
"docs": {
|
|
60
76
|
"tags": [],
|
|
61
77
|
"text": ""
|
|
62
78
|
},
|
|
79
|
+
"getter": false,
|
|
80
|
+
"setter": false,
|
|
63
81
|
"attribute": "interactive",
|
|
64
82
|
"reflect": true
|
|
65
83
|
},
|
|
66
84
|
"overlayActions": {
|
|
67
85
|
"type": "boolean",
|
|
68
|
-
"mutable":
|
|
86
|
+
"mutable": false,
|
|
69
87
|
"complexType": {
|
|
70
88
|
"original": "boolean",
|
|
71
89
|
"resolved": "boolean",
|
|
@@ -77,19 +95,96 @@ export class MdsTableRow {
|
|
|
77
95
|
"tags": [],
|
|
78
96
|
"text": ""
|
|
79
97
|
},
|
|
98
|
+
"getter": false,
|
|
99
|
+
"setter": false,
|
|
80
100
|
"attribute": "overlay-actions",
|
|
81
101
|
"reflect": true
|
|
102
|
+
},
|
|
103
|
+
"selectable": {
|
|
104
|
+
"type": "boolean",
|
|
105
|
+
"mutable": false,
|
|
106
|
+
"complexType": {
|
|
107
|
+
"original": "boolean",
|
|
108
|
+
"resolved": "boolean | undefined",
|
|
109
|
+
"references": {}
|
|
110
|
+
},
|
|
111
|
+
"required": false,
|
|
112
|
+
"optional": true,
|
|
113
|
+
"docs": {
|
|
114
|
+
"tags": [],
|
|
115
|
+
"text": ""
|
|
116
|
+
},
|
|
117
|
+
"getter": false,
|
|
118
|
+
"setter": false,
|
|
119
|
+
"attribute": "selectable",
|
|
120
|
+
"reflect": true,
|
|
121
|
+
"defaultValue": "undefined"
|
|
122
|
+
},
|
|
123
|
+
"selected": {
|
|
124
|
+
"type": "boolean",
|
|
125
|
+
"mutable": true,
|
|
126
|
+
"complexType": {
|
|
127
|
+
"original": "boolean",
|
|
128
|
+
"resolved": "boolean | undefined",
|
|
129
|
+
"references": {}
|
|
130
|
+
},
|
|
131
|
+
"required": false,
|
|
132
|
+
"optional": true,
|
|
133
|
+
"docs": {
|
|
134
|
+
"tags": [],
|
|
135
|
+
"text": ""
|
|
136
|
+
},
|
|
137
|
+
"getter": false,
|
|
138
|
+
"setter": false,
|
|
139
|
+
"attribute": "selected",
|
|
140
|
+
"reflect": true
|
|
141
|
+
},
|
|
142
|
+
"value": {
|
|
143
|
+
"type": "any",
|
|
144
|
+
"mutable": false,
|
|
145
|
+
"complexType": {
|
|
146
|
+
"original": "string | number",
|
|
147
|
+
"resolved": "number | string | undefined",
|
|
148
|
+
"references": {}
|
|
149
|
+
},
|
|
150
|
+
"required": false,
|
|
151
|
+
"optional": true,
|
|
152
|
+
"docs": {
|
|
153
|
+
"tags": [],
|
|
154
|
+
"text": ""
|
|
155
|
+
},
|
|
156
|
+
"getter": false,
|
|
157
|
+
"setter": false,
|
|
158
|
+
"attribute": "value",
|
|
159
|
+
"reflect": true
|
|
82
160
|
}
|
|
83
161
|
};
|
|
84
162
|
}
|
|
85
|
-
static get
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
163
|
+
static get states() {
|
|
164
|
+
return {
|
|
165
|
+
"language": {}
|
|
166
|
+
};
|
|
167
|
+
}
|
|
168
|
+
static get methods() {
|
|
169
|
+
return {
|
|
170
|
+
"updateLang": {
|
|
171
|
+
"complexType": {
|
|
172
|
+
"signature": "() => Promise<void>",
|
|
173
|
+
"parameters": [],
|
|
174
|
+
"references": {
|
|
175
|
+
"Promise": {
|
|
176
|
+
"location": "global",
|
|
177
|
+
"id": "global::Promise"
|
|
178
|
+
}
|
|
179
|
+
},
|
|
180
|
+
"return": "Promise<void>"
|
|
181
|
+
},
|
|
182
|
+
"docs": {
|
|
183
|
+
"text": "",
|
|
184
|
+
"tags": []
|
|
185
|
+
}
|
|
186
|
+
}
|
|
187
|
+
};
|
|
94
188
|
}
|
|
189
|
+
static get elementRef() { return "host"; }
|
|
95
190
|
}
|
|
@@ -14,8 +14,8 @@ const fileExtensionsDictionary = {
|
|
|
14
14
|
exe: { format: 'executable', description: 'fileEXE' },
|
|
15
15
|
flac: { format: 'audio', description: 'uncompressedAudio' },
|
|
16
16
|
gif: { format: 'image', description: 'compressedImage', preview: true },
|
|
17
|
-
htm: { format: 'markup', description: 'documentWeb' },
|
|
18
17
|
heic: { format: 'image', description: 'imageHEFF' },
|
|
18
|
+
htm: { format: 'markup', description: 'documentWeb' },
|
|
19
19
|
html: { format: 'markup', description: 'documentWeb' },
|
|
20
20
|
jpe: { format: 'image', description: 'compressedImage', preview: true },
|
|
21
21
|
jpeg: { format: 'image', description: 'compressedImage', preview: true },
|
|
@@ -32,9 +32,12 @@ const fileExtensionsDictionary = {
|
|
|
32
32
|
mpg4: { format: 'video', description: 'videoSD' },
|
|
33
33
|
mpg: { format: 'video', description: 'videoSD' },
|
|
34
34
|
mpga: { format: 'audio', description: 'compressedAudio' },
|
|
35
|
+
odf: { format: 'document', description: 'openDocumentFormat' },
|
|
35
36
|
odp: { format: 'slide', description: 'slideLO' },
|
|
36
37
|
ods: { format: 'spreadsheet', description: 'spreadsheetLO' },
|
|
37
38
|
odt: { format: 'text', description: 'documentLO' },
|
|
39
|
+
ole: { format: 'document', description: 'objectLinkingAndEmbedding' },
|
|
40
|
+
p7m: { format: 'certificate', description: 'documentDigitalSingnature' },
|
|
38
41
|
pdf: { format: 'document', description: 'documentAdobe' },
|
|
39
42
|
php: { format: 'code', description: 'filePHP' },
|
|
40
43
|
png: { format: 'image', description: 'imagePNG', preview: true },
|
|
@@ -47,6 +50,7 @@ const fileExtensionsDictionary = {
|
|
|
47
50
|
tar: { format: 'archive', description: 'uncompressedArchive' },
|
|
48
51
|
tiff: { format: 'image', description: 'imageTIFF' },
|
|
49
52
|
ts: { format: 'code', description: 'fileTS' },
|
|
53
|
+
tsd: { format: 'certificate', description: 'certificateTSD' },
|
|
50
54
|
tsx: { format: 'code', description: 'fileTSX' },
|
|
51
55
|
txt: { format: 'text', description: 'documentTXT' },
|
|
52
56
|
wav: { format: 'audio', description: 'uncompressedAudio' },
|
|
@@ -54,66 +58,9 @@ const fileExtensionsDictionary = {
|
|
|
54
58
|
xar: { format: 'archive', description: 'compressedArchive' },
|
|
55
59
|
xls: { format: 'spreadsheet', description: 'spreadsheetMS' },
|
|
56
60
|
xlsx: { format: 'spreadsheet', description: 'spreadsheetMS' },
|
|
61
|
+
xml: { format: 'markup', description: 'extensibleMarkupLanguage' },
|
|
57
62
|
zip: { format: 'archive', description: 'compressedArchive' },
|
|
58
63
|
};
|
|
59
|
-
// const fileExtensionsDictionary: FileExtenstion = {
|
|
60
|
-
// '7z': { format: 'archive', description: 'Archivio compresso' },
|
|
61
|
-
// ace: { format: 'archive', description: 'Archivio compresso' },
|
|
62
|
-
// ai: { format: 'vector', description: 'Vettoriale Adobe Illustrator' },
|
|
63
|
-
// dart: { format: 'code', description: 'Dart' },
|
|
64
|
-
// db: { format: 'data', description: 'File di database' },
|
|
65
|
-
// default: { format: 'attachment', description: 'Formato sconosciuto' },
|
|
66
|
-
// dmg: { format: 'executable', description: 'Apple Disk Image' },
|
|
67
|
-
// doc: { format: 'text', description: 'Documento Microsoft Word' },
|
|
68
|
-
// docm: { format: 'text', description: 'Documento Microsoft Word' },
|
|
69
|
-
// docx: { format: 'text', description: 'Documento Microsoft Word Compresso' },
|
|
70
|
-
// eml: { format: 'email', description: 'E-mail di posta elettronica' },
|
|
71
|
-
// eps: { format: 'vector', description: 'Vettoriale Corel Draw' },
|
|
72
|
-
// exe: { format: 'executable', description: 'File eseguibile Windows' },
|
|
73
|
-
// flac: { format: 'audio', description: 'Audio non compresso' },
|
|
74
|
-
// gif: { format: 'image', description: 'Immagine compressa', preview: true },
|
|
75
|
-
// htm: { format: 'markup', description: 'Pagina web' },
|
|
76
|
-
// heic: { format: 'image', description: 'High Efficiency Image File Format' },
|
|
77
|
-
// html: { format: 'markup', description: 'Pagina web' },
|
|
78
|
-
// jpe: { format: 'image', description: 'Immagine compressa', preview: true },
|
|
79
|
-
// jpeg: { format: 'image', description: 'Immagine compressa', preview: true },
|
|
80
|
-
// jpg: { format: 'image', description: 'Immagine compressa', preview: true },
|
|
81
|
-
// js: { format: 'code', description: 'JavaScript' },
|
|
82
|
-
// json: { format: 'data', description: 'JavaScript Object Notation' },
|
|
83
|
-
// jsx: { format: 'code', description: 'JavaScript' },
|
|
84
|
-
// m2v: { format: 'video', description: 'Filmato SD' },
|
|
85
|
-
// mp2: { format: 'audio', description: 'Audio compresso' },
|
|
86
|
-
// mp3: { format: 'audio', description: 'Audio compresso' },
|
|
87
|
-
// mp4: { format: 'video', description: 'Filmato HD' },
|
|
88
|
-
// mp4v: { format: 'video', description: 'Filmato HD' },
|
|
89
|
-
// mpeg: { format: 'video', description: 'Filmato SD' },
|
|
90
|
-
// mpg4: { format: 'video', description: 'Filmato SD' },
|
|
91
|
-
// mpg: { format: 'video', description: 'Filmato SD' },
|
|
92
|
-
// mpga: { format: 'audio', description: 'Audio compresso' },
|
|
93
|
-
// odp: { format: 'slide', description: 'Slide di presentazione LibreOffice' },
|
|
94
|
-
// ods: { format: 'spreadsheet', description: 'Foglio di calcolo LibreOffice' },
|
|
95
|
-
// odt: { format: 'text', description: 'File di testo LibreOffice' },
|
|
96
|
-
// pdf: { format: 'document', description: 'Documento Adobe' },
|
|
97
|
-
// php: { format: 'code', description: 'Hypertext Preprocessor' },
|
|
98
|
-
// png: { format: 'image', description: 'Immagine Portable Network Graphics', preview: true },
|
|
99
|
-
// ppt: { format: 'slide', description: 'Slide di presentazione PowerPoint' },
|
|
100
|
-
// rar: { format: 'archive', description: 'Archivio compresso' },
|
|
101
|
-
// rtf: { format: 'text', description: 'Documento di testo Rich Text Format' },
|
|
102
|
-
// sass: { format: 'code', description: 'Syntactically Awesome StyleSheets' },
|
|
103
|
-
// shtml: { format: 'markup', description: 'Pagina web' },
|
|
104
|
-
// svg: { format: 'vector', description: 'Scalable Vector Graphics', preview: true },
|
|
105
|
-
// tar: { format: 'archive', description: 'Archivio non compresso' },
|
|
106
|
-
// tiff: { format: 'image', description: 'Tag Image File Format' },
|
|
107
|
-
// ts: { format: 'code', description: 'TypeScript' },
|
|
108
|
-
// tsx: { format: 'code', description: 'TypeScript Extended Syntax' },
|
|
109
|
-
// txt: { format: 'text', description: 'Documento di testo non formattato' },
|
|
110
|
-
// wav: { format: 'audio', description: 'Audio non compresso' },
|
|
111
|
-
// webp: { format: 'image', description: 'Immagine Web Picture', preview: true },
|
|
112
|
-
// xar: { format: 'archive', description: 'Archivio compresso' },
|
|
113
|
-
// xls: { format: 'spreadsheet', description: 'Foglio di calcolo Office' },
|
|
114
|
-
// xlsx: { format: 'spreadsheet', description: 'Foglio di calcolo Office' },
|
|
115
|
-
// zip: { format: 'archive', description: 'Archivio compresso' },
|
|
116
|
-
// }
|
|
117
64
|
const genericMimeToExt = new Map([
|
|
118
65
|
['image', ['.png', '.jpg', '.jpeg', '.tiff', '.webp', '.jpe', '.gif', '.heic']],
|
|
119
66
|
['audio', ['.mp2', '.mp3', '.mpga', '.wav', '.flac']],
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
const treeActionsDictionary = [
|
|
2
|
+
'auto',
|
|
3
|
+
'visible',
|
|
4
|
+
];
|
|
5
|
+
const treeAppearanceDictionary = [
|
|
6
|
+
'depth',
|
|
7
|
+
'none',
|
|
8
|
+
];
|
|
9
|
+
const treeIconDictionary = [
|
|
10
|
+
'folder',
|
|
11
|
+
'chevron',
|
|
12
|
+
];
|
|
13
|
+
export { treeActionsDictionary, treeAppearanceDictionary, treeIconDictionary, };
|