@aquera/nile-elements 0.1.31 → 0.1.32-beta-1.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/README.md +21 -5
- package/demo/index.html +5 -9
- package/dist/axe.min-5bf06036.esm.js +12 -0
- package/dist/axe.min-ff35bfba.cjs.js +12 -0
- package/dist/axe.min-ff35bfba.cjs.js.map +1 -0
- package/dist/{fixture-161dee0b.cjs.js → fixture-3acb409b.cjs.js} +2 -2
- package/dist/{fixture-161dee0b.cjs.js.map → fixture-3acb409b.cjs.js.map} +1 -1
- package/dist/{fixture-372df3b0.esm.js → fixture-db35a8ae.esm.js} +1 -1
- package/dist/index.cjs.js +1 -1
- package/dist/index.esm.js +1 -1
- package/dist/internal/animate.cjs.js +1 -1
- package/dist/internal/animate.cjs.js.map +1 -1
- package/dist/internal/animate.esm.js +1 -1
- package/dist/nile-accordion/nile-accordian.test.cjs.js +1 -1
- package/dist/nile-accordion/nile-accordian.test.esm.js +1 -1
- package/dist/nile-accordion/nile-accordion.cjs.js +1 -1
- package/dist/nile-accordion/nile-accordion.cjs.js.map +1 -1
- package/dist/nile-accordion/nile-accordion.css.cjs.js +1 -1
- package/dist/nile-accordion/nile-accordion.css.cjs.js.map +1 -1
- package/dist/nile-accordion/nile-accordion.css.esm.js +1 -1
- package/dist/nile-accordion/nile-accordion.esm.js +4 -4
- package/dist/nile-auto-complete/nile-auto-complete.test.cjs.js +1 -1
- package/dist/nile-auto-complete/nile-auto-complete.test.esm.js +1 -1
- package/dist/nile-avatar/nile-avatar.test.cjs.js +1 -1
- package/dist/nile-avatar/nile-avatar.test.esm.js +1 -1
- package/dist/nile-badge/nile-badge.test.cjs.js +1 -1
- package/dist/nile-badge/nile-badge.test.esm.js +1 -1
- package/dist/nile-button/nile-button.test.cjs.js +1 -1
- package/dist/nile-button/nile-button.test.esm.js +1 -1
- package/dist/nile-button-toggle-group/nile-button-toggle-group.test.cjs.js +1 -1
- package/dist/nile-button-toggle-group/nile-button-toggle-group.test.esm.js +1 -1
- package/dist/nile-calendar/nile-calendar.test.cjs.js +1 -1
- package/dist/nile-calendar/nile-calendar.test.esm.js +1 -1
- package/dist/nile-card/nile-card.test.cjs.js +1 -1
- package/dist/nile-card/nile-card.test.esm.js +1 -1
- package/dist/nile-checkbox/nile-checkbox.test.cjs.js +1 -1
- package/dist/nile-checkbox/nile-checkbox.test.esm.js +1 -1
- package/dist/nile-chip/nile-chip.test.cjs.js +1 -1
- package/dist/nile-chip/nile-chip.test.esm.js +1 -1
- package/dist/nile-circular-progressbar/nile-circular-progressbar.css.cjs.js +1 -1
- package/dist/nile-circular-progressbar/nile-circular-progressbar.css.cjs.js.map +1 -1
- package/dist/nile-circular-progressbar/nile-circular-progressbar.css.esm.js +49 -49
- package/dist/nile-code-editor/extensionSetup.cjs.js +7 -7
- package/dist/nile-code-editor/extensionSetup.cjs.js.map +1 -1
- package/dist/nile-code-editor/extensionSetup.esm.js +1 -1
- package/dist/nile-code-editor/nile-code-editor.cjs.js +2 -2
- package/dist/nile-code-editor/nile-code-editor.cjs.js.map +1 -1
- package/dist/nile-code-editor/nile-code-editor.esm.js +2 -2
- package/dist/nile-dialog/nile-dialog.test.cjs.js +1 -1
- package/dist/nile-dialog/nile-dialog.test.esm.js +1 -1
- package/dist/nile-drawer/nile-drawer.test.cjs.js +1 -1
- package/dist/nile-drawer/nile-drawer.test.esm.js +1 -1
- package/dist/nile-dropdown/nile-dropdown.test.cjs.js +1 -1
- package/dist/nile-dropdown/nile-dropdown.test.esm.js +1 -1
- package/dist/nile-empty-state/nile-empty-state.test.cjs.js +1 -1
- package/dist/nile-empty-state/nile-empty-state.test.esm.js +1 -1
- package/dist/nile-error-message/nile-error-message.test.cjs.js +1 -1
- package/dist/nile-error-message/nile-error-message.test.esm.js +1 -1
- package/dist/nile-form-group/nile-form-group.test.cjs.js +1 -1
- package/dist/nile-form-group/nile-form-group.test.esm.js +1 -1
- package/dist/nile-form-help-text/nile-form-help-text.test.cjs.js +1 -1
- package/dist/nile-form-help-text/nile-form-help-text.test.esm.js +1 -1
- package/dist/nile-hero/nile-hero.test.cjs.js +1 -1
- package/dist/nile-hero/nile-hero.test.esm.js +1 -1
- package/dist/nile-icon/nile-icon.test.cjs.js +1 -1
- package/dist/nile-icon/nile-icon.test.esm.js +1 -1
- package/dist/nile-input/nile-input.test.cjs.js +1 -1
- package/dist/nile-input/nile-input.test.esm.js +1 -1
- package/dist/nile-link/nile-link.test.cjs.js +1 -1
- package/dist/nile-link/nile-link.test.esm.js +1 -1
- package/dist/nile-loader/nile-loader.test.cjs.js +1 -1
- package/dist/nile-loader/nile-loader.test.esm.js +1 -1
- package/dist/nile-popover/nile-popover.test.cjs.js +1 -1
- package/dist/nile-popover/nile-popover.test.esm.js +1 -1
- package/dist/nile-popup/nile-popup.test.cjs.js +1 -1
- package/dist/nile-popup/nile-popup.test.esm.js +1 -1
- package/dist/nile-progress-bar/nile-progress-bar.test.cjs.js +1 -1
- package/dist/nile-progress-bar/nile-progress-bar.test.esm.js +1 -1
- package/dist/nile-radio/nile-radio.test.cjs.js +1 -1
- package/dist/nile-radio/nile-radio.test.esm.js +1 -1
- package/dist/nile-radio-group/nile-radio-group.test.cjs.js +1 -1
- package/dist/nile-radio-group/nile-radio-group.test.esm.js +1 -1
- package/dist/nile-select/nile-select.test.cjs.js +1 -1
- package/dist/nile-select/nile-select.test.esm.js +1 -1
- package/dist/nile-slide-toggle/nile-slide-toggle.test.cjs.js +1 -1
- package/dist/nile-slide-toggle/nile-slide-toggle.test.esm.js +1 -1
- package/dist/nile-tab-group/nile-tab-group.test.cjs.js +1 -1
- package/dist/nile-tab-group/nile-tab-group.test.esm.js +1 -1
- package/dist/nile-table/index.cjs.js +2 -0
- package/dist/nile-table/index.cjs.js.map +1 -0
- package/dist/nile-table/index.esm.js +1 -0
- package/dist/nile-table/nile-table.cjs.js +2 -0
- package/dist/nile-table/nile-table.cjs.js.map +1 -0
- package/dist/nile-table/nile-table.css.cjs.js +2 -0
- package/dist/nile-table/nile-table.css.cjs.js.map +1 -0
- package/dist/nile-table/nile-table.css.esm.js +6 -0
- package/dist/nile-table/nile-table.esm.js +3 -0
- package/dist/nile-table-body/nile-table-body.cjs.js +1 -1
- package/dist/nile-table-body/nile-table-body.cjs.js.map +1 -1
- package/dist/nile-table-body/nile-table-body.esm.js +2 -2
- package/dist/nile-table-cell-item/nile-table-cell-item.css.cjs.js +1 -1
- package/dist/nile-table-cell-item/nile-table-cell-item.css.cjs.js.map +1 -1
- package/dist/nile-table-cell-item/nile-table-cell-item.css.esm.js +4 -2
- package/dist/nile-table-header-item/nile-table-header-item.css.cjs.js +1 -1
- package/dist/nile-table-header-item/nile-table-header-item.css.cjs.js.map +1 -1
- package/dist/nile-table-header-item/nile-table-header-item.css.esm.js +2 -0
- package/dist/nile-table-row/nile-table-row.cjs.js.map +1 -1
- package/dist/nile-textarea/nile-textarea.test.cjs.js +1 -1
- package/dist/nile-textarea/nile-textarea.test.esm.js +1 -1
- package/dist/nile-tooltip/index.cjs.js +1 -1
- package/dist/nile-tooltip/index.esm.js +1 -1
- package/dist/nile-tooltip/nile-tooltip.cjs.js +1 -1
- package/dist/nile-tooltip/nile-tooltip.cjs.js.map +1 -1
- package/dist/nile-tooltip/nile-tooltip.css.cjs.js +1 -1
- package/dist/nile-tooltip/nile-tooltip.css.cjs.js.map +1 -1
- package/dist/nile-tooltip/nile-tooltip.css.esm.js +115 -56
- package/dist/nile-tooltip/nile-tooltip.esm.js +13 -30
- package/dist/src/index.d.ts +1 -0
- package/dist/src/index.js +1 -0
- package/dist/src/index.js.map +1 -1
- package/dist/src/nile-accordion/nile-accordion.css.js +1 -1
- package/dist/src/nile-accordion/nile-accordion.css.js.map +1 -1
- package/dist/src/nile-accordion/nile-accordion.d.ts +6 -5
- package/dist/src/nile-accordion/nile-accordion.js +21 -8
- package/dist/src/nile-accordion/nile-accordion.js.map +1 -1
- package/dist/src/nile-circular-progressbar/nile-circular-progressbar.css.js +49 -49
- package/dist/src/nile-circular-progressbar/nile-circular-progressbar.css.js.map +1 -1
- package/dist/src/nile-table/index.d.ts +1 -0
- package/dist/src/nile-table/index.js +2 -0
- package/dist/src/nile-table/index.js.map +1 -0
- package/dist/src/nile-table/nile-table.css.d.ts +12 -0
- package/dist/src/nile-table/nile-table.css.js +18 -0
- package/dist/src/nile-table/nile-table.css.js.map +1 -0
- package/dist/src/nile-table/nile-table.d.ts +47 -0
- package/dist/src/nile-table/nile-table.js +137 -0
- package/dist/src/nile-table/nile-table.js.map +1 -0
- package/dist/src/nile-table-body/nile-table-body.d.ts +3 -1
- package/dist/src/nile-table-body/nile-table-body.js +9 -1
- package/dist/src/nile-table-body/nile-table-body.js.map +1 -1
- package/dist/src/nile-table-cell-item/nile-table-cell-item.css.js +4 -2
- package/dist/src/nile-table-cell-item/nile-table-cell-item.css.js.map +1 -1
- package/dist/src/nile-table-header-item/nile-table-header-item.css.js +2 -0
- package/dist/src/nile-table-header-item/nile-table-header-item.css.js.map +1 -1
- package/dist/src/nile-table-row/nile-table-row.js.map +1 -1
- package/dist/src/nile-tooltip/nile-tooltip.css.js +113 -54
- package/dist/src/nile-tooltip/nile-tooltip.css.js.map +1 -1
- package/dist/src/nile-tooltip/nile-tooltip.d.ts +22 -62
- package/dist/src/nile-tooltip/nile-tooltip.js +180 -244
- package/dist/src/nile-tooltip/nile-tooltip.js.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +3 -3
- package/src/index.ts +2 -1
- package/src/nile-accordion/nile-accordion.css.ts +1 -1
- package/src/nile-accordion/nile-accordion.ts +15 -4
- package/src/nile-circular-progressbar/nile-circular-progressbar.css.ts +55 -56
- package/src/nile-table/index.ts +1 -0
- package/src/nile-table/nile-table.css.ts +20 -0
- package/src/nile-table/nile-table.ts +154 -0
- package/src/nile-table-body/nile-table-body.ts +8 -2
- package/src/nile-table-cell-item/nile-table-cell-item.css.ts +4 -2
- package/src/nile-table-header-item/nile-table-header-item.css.ts +2 -0
- package/src/nile-table-row/nile-table-row.ts +1 -2
- package/src/nile-tooltip/nile-tooltip.css.ts +113 -54
- package/src/nile-tooltip/nile-tooltip.ts +207 -269
- package/vscode-html-custom-data.json +36 -18
- package/dist/axe.min-2b379f29.cjs.js +0 -12
- package/dist/axe.min-2b379f29.cjs.js.map +0 -1
- package/dist/axe.min-c2cd8733.esm.js +0 -12
package/package.json
CHANGED
@@ -3,7 +3,7 @@
|
|
3
3
|
"description": "Webcomponent nile-elements following open-wc recommendations",
|
4
4
|
"license": "MIT",
|
5
5
|
"author": "nile-elements",
|
6
|
-
"version": "0.1.
|
6
|
+
"version": "0.1.32-beta-1.1",
|
7
7
|
"main": "dist/src/index.js",
|
8
8
|
"type": "module",
|
9
9
|
"module": "dist/src/index.js",
|
@@ -84,7 +84,7 @@
|
|
84
84
|
"./nile-section-message": "./dist/src/nile-section-message/index.js",
|
85
85
|
"./nile-toolbar": "./dist/src/nile-toolbar/index.js",
|
86
86
|
"./nile-inline-edit": "./dist/src/nile-inline-edit/index.js",
|
87
|
-
"./nile-
|
87
|
+
"./nile-table": "./dist/src/nile-table/index.js"
|
88
88
|
},
|
89
89
|
"scripts": {
|
90
90
|
"analyze": "cem analyze --litelement",
|
@@ -188,4 +188,4 @@
|
|
188
188
|
"prettier --write"
|
189
189
|
]
|
190
190
|
}
|
191
|
-
}
|
191
|
+
}
|
package/src/index.ts
CHANGED
@@ -74,4 +74,5 @@ export { NileDivider } from './nile-divider';
|
|
74
74
|
export { NileTitle } from './nile-title';
|
75
75
|
export { NileSectionMessage } from './nile-section-message';
|
76
76
|
export { NileToolbar } from './nile-toolbar';
|
77
|
-
export { NileInlineEdit } from './nile-inline-edit';
|
77
|
+
export { NileInlineEdit } from './nile-inline-edit';
|
78
|
+
export { NileTable } from './nile-table';
|
@@ -1,4 +1,4 @@
|
|
1
|
-
/**
|
1
|
+
/**
|
2
2
|
* Copyright Aquera Inc 2023
|
3
3
|
*
|
4
4
|
* This source code is licensed under the BSD-3-Clause license found in the
|
@@ -57,6 +57,7 @@ static styles: CSSResultGroup = styles;
|
|
57
57
|
@query('.accordian__header') header: HTMLElement;
|
58
58
|
@query('.accordian__body') body: HTMLElement;
|
59
59
|
@query('.accordian__expand-icon-slot') expandIconSlot: HTMLSlotElement;
|
60
|
+
@query('slot[name="summary"]') summarySlot: HTMLSlotElement;
|
60
61
|
|
61
62
|
/**
|
62
63
|
* Indicates whether or not the accordian is open. You can toggle this attribute to show and hide the accordian, or you
|
@@ -93,7 +94,17 @@ firstUpdated() {
|
|
93
94
|
this.body.style.height = this.open ? 'auto' : '0';
|
94
95
|
}
|
95
96
|
|
96
|
-
private handleSummaryClick() {
|
97
|
+
private handleSummaryClick(event: MouseEvent) {
|
98
|
+
const path = event.composedPath();
|
99
|
+
const slotIndex = path.indexOf(this.summarySlot);
|
100
|
+
if (slotIndex !== -1) {
|
101
|
+
for (let i = 0; i < slotIndex; i++) {
|
102
|
+
const el = path[i];
|
103
|
+
if (el instanceof Element && el.matches('input, button, select, textarea, a, label')) {
|
104
|
+
return;
|
105
|
+
}
|
106
|
+
}
|
107
|
+
}
|
97
108
|
if (!this.disabled) {
|
98
109
|
if (this.open) {
|
99
110
|
this.hide();
|
@@ -219,10 +230,10 @@ render() {
|
|
219
230
|
|
220
231
|
<span part="summary-icon" class="accordian__summary-icon">
|
221
232
|
<slot name="expand-icon">
|
222
|
-
<nile-icon name="
|
233
|
+
<nile-icon name="arrowdown"></nile-icon>
|
223
234
|
</slot>
|
224
235
|
<slot name="collapse-icon">
|
225
|
-
<nile-icon name="
|
236
|
+
<nile-icon name="arrowup"></nile-icon>
|
226
237
|
</slot>
|
227
238
|
</span>
|
228
239
|
</div>
|
@@ -5,60 +5,59 @@
|
|
5
5
|
* LICENSE file in the root directory of this source tree.
|
6
6
|
*/
|
7
7
|
|
8
|
-
|
8
|
+
import { css } from 'lit';
|
9
9
|
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
10
|
+
/**
|
11
|
+
* Progressbar CSS
|
12
|
+
*/
|
13
|
+
export const styles = css`
|
14
|
+
|
15
|
+
:host {
|
16
|
+
display: inline-block;
|
17
|
+
|
18
|
+
}
|
19
|
+
|
20
|
+
.track {
|
21
|
+
stroke-width: 3px;
|
22
|
+
stroke: var(--nile-circular-progress-bar-track-color-stroke);
|
23
|
+
opacity: 0.5;
|
24
|
+
fill: none;
|
25
|
+
}
|
26
|
+
|
27
|
+
.progress {
|
28
|
+
stroke-width: 3px;
|
29
|
+
stroke: var(--nile-circular-progress-bar-progress-color-stroke);
|
30
|
+
stroke-linecap: round;
|
31
|
+
fill: none;
|
32
|
+
transform: rotate(270deg);
|
33
|
+
transform-origin: center;
|
34
|
+
transition: stroke-dashoffset 0.8s ease-in-out;
|
35
|
+
}
|
36
|
+
|
37
|
+
.circle__text {
|
38
|
+
fill: var(--nile-circular-progress-bar-circle-color-text);
|
39
|
+
text-align: center;
|
40
|
+
font-size: var(--nile-type-scale-1);
|
41
|
+
font-style: normal;
|
42
|
+
font-weight: var(--nile-font-weight-regular);
|
43
|
+
line-height: var(--nile-type-scale-1);
|
44
|
+
letter-spacing: 0.2px;
|
45
|
+
}
|
46
|
+
|
47
|
+
.nile-progress-bar__status {
|
48
|
+
display: flex;
|
49
|
+
justify-content: space-between;
|
50
|
+
align-items: center;
|
51
|
+
margin-bottom: 4px;
|
52
|
+
}
|
53
|
+
|
54
|
+
.nile-progress-bar__message {
|
55
|
+
flex-grow: 1;
|
56
|
+
}
|
57
|
+
|
58
|
+
.nile-progress-bar__percentage {
|
59
|
+
white-space: nowrap;
|
60
|
+
}
|
61
|
+
|
62
|
+
`
|
63
|
+
export default [styles];
|
@@ -0,0 +1 @@
|
|
1
|
+
export { NileTable } from './nile-table';
|
@@ -0,0 +1,20 @@
|
|
1
|
+
/**
|
2
|
+
* Copyright Aquera Inc 2023
|
3
|
+
*
|
4
|
+
* This source code is licensed under the BSD-3-Clause license found in the
|
5
|
+
* LICENSE file in the root directory of this source tree.
|
6
|
+
*/
|
7
|
+
|
8
|
+
import {css} from 'lit';
|
9
|
+
|
10
|
+
/**
|
11
|
+
* Table CSS
|
12
|
+
*/
|
13
|
+
export const styles = css`
|
14
|
+
:host {
|
15
|
+
display:block;
|
16
|
+
width:100%;
|
17
|
+
}
|
18
|
+
`;
|
19
|
+
|
20
|
+
export default [styles];
|
@@ -0,0 +1,154 @@
|
|
1
|
+
/**
|
2
|
+
* Copyright Aquera Inc 2023
|
3
|
+
*
|
4
|
+
* This source code is licensed under the BSD-3-Clause license found in the
|
5
|
+
* LICENSE file in the root directory of this source tree.
|
6
|
+
*/
|
7
|
+
|
8
|
+
import {LitElement, html, CSSResultArray, TemplateResult, PropertyValues} from 'lit';
|
9
|
+
import { customElement, property, query, state} from 'lit/decorators.js';
|
10
|
+
import {styles} from './nile-table.css';
|
11
|
+
import NileElement from '../internal/nile-element';
|
12
|
+
import { NileTableBody } from '../nile-table-body';
|
13
|
+
import { NileTableCellItem } from '../nile-table-cell-item';
|
14
|
+
import { NileTableHeaderItem } from '../nile-table-header-item';
|
15
|
+
|
16
|
+
|
17
|
+
/**
|
18
|
+
* Nile table component.
|
19
|
+
*
|
20
|
+
* @tag nile-table
|
21
|
+
*
|
22
|
+
*/
|
23
|
+
@customElement('nile-table')
|
24
|
+
export class NileTable extends NileElement {
|
25
|
+
@query('slot') defaultSlot: HTMLSlotElement;
|
26
|
+
private rows:Array<NileTableBody>=[];
|
27
|
+
private primaryRowWidths:Array<number>=[]
|
28
|
+
private resizeObserver:ResizeObserver ;
|
29
|
+
|
30
|
+
|
31
|
+
/**
|
32
|
+
* The styles for nile-table
|
33
|
+
* @remarks If you are extending this class you can extend the base styles with super. Eg `return [super(), myCustomStyles]`
|
34
|
+
*/
|
35
|
+
public static get styles(): CSSResultArray {
|
36
|
+
return [styles];
|
37
|
+
}
|
38
|
+
connectedCallback(): void {
|
39
|
+
super.connectedCallback()
|
40
|
+
this.addEventListener('nile-body-load',this.handleRows)
|
41
|
+
}
|
42
|
+
|
43
|
+
protected firstUpdated(_changedProperties: PropertyValues): void {
|
44
|
+
this.updateComplete.then(()=>{
|
45
|
+
this.handleResizeObserver();
|
46
|
+
})
|
47
|
+
}
|
48
|
+
|
49
|
+
|
50
|
+
/* #endregion */
|
51
|
+
|
52
|
+
/* #region Methods */
|
53
|
+
|
54
|
+
/**
|
55
|
+
* Render method
|
56
|
+
* @slot This is a slot test
|
57
|
+
*/
|
58
|
+
public render(): TemplateResult {
|
59
|
+
return html`
|
60
|
+
<slot @slotchange="${this.repaintTable}"></slot>
|
61
|
+
`;
|
62
|
+
}
|
63
|
+
|
64
|
+
repaintTable(){
|
65
|
+
this.realignStructure();
|
66
|
+
this.handleBodyCssUpdate();
|
67
|
+
}
|
68
|
+
|
69
|
+
handleRows(e:CustomEvent){
|
70
|
+
this.rows=[...this.rows,e.detail.comp]
|
71
|
+
}
|
72
|
+
|
73
|
+
handleBodyCssUpdate(){
|
74
|
+
if (this.rows.length<2) return;
|
75
|
+
const tableBodies = this.rows;
|
76
|
+
const firstEl=tableBodies[0].shadowRoot?.querySelector<HTMLDivElement>('div.base')
|
77
|
+
if(firstEl) {
|
78
|
+
firstEl.style.borderTopRightRadius="var(--nile-radius-radius-xl)";
|
79
|
+
firstEl.style.borderTopLeftRadius = 'var(--nile-radius-radius-xl)';
|
80
|
+
firstEl.style.borderBottomRightRadius="0px";
|
81
|
+
firstEl.style.borderBottomLeftRadius = '0px';
|
82
|
+
firstEl.style.borderBottom = 'none';
|
83
|
+
}
|
84
|
+
tableBodies.forEach((tb,i)=>{
|
85
|
+
if(i>0 && i<tableBodies.length-1){
|
86
|
+
const el=tb.shadowRoot?.querySelector<HTMLDivElement>('div.base')
|
87
|
+
if(el) {
|
88
|
+
el.style.borderTopRightRadius="0px";
|
89
|
+
el.style.borderTopLeftRadius = "0px";
|
90
|
+
el.style.borderBottomRightRadius="0px";
|
91
|
+
el.style.borderBottomLeftRadius = "0px";
|
92
|
+
el.style.borderBottom = 'none';
|
93
|
+
}
|
94
|
+
}
|
95
|
+
})
|
96
|
+
const lastEl=tableBodies[tableBodies.length - 1].shadowRoot?.querySelector<HTMLDivElement>('div.base')
|
97
|
+
if(lastEl){
|
98
|
+
lastEl.style.borderTopRightRadius="0px";
|
99
|
+
lastEl.style.borderTopLeftRadius = '0px';
|
100
|
+
lastEl.style.borderBottomRightRadius="var(--nile-radius-radius-xl)";
|
101
|
+
lastEl.style.borderBottomLeftRadius = 'var(--nile-radius-radius-xl)';
|
102
|
+
}
|
103
|
+
}
|
104
|
+
|
105
|
+
getPrimaryColumnWidths(){
|
106
|
+
const primaryTb=this.rows.find(tb=>tb.type=='primary')!;
|
107
|
+
const widthArray=this.getTableCellFetchQuery(primaryTb).map((e:LitElement)=>e.clientWidth) as Array<number>
|
108
|
+
return widthArray;
|
109
|
+
}
|
110
|
+
|
111
|
+
realignStructure(){
|
112
|
+
if (this.rows.length<2) return;
|
113
|
+
const primaryRowWidths=this.getPrimaryColumnWidths();
|
114
|
+
const secondaryRows=this.rows.filter(tb=>tb.type!='primary');
|
115
|
+
secondaryRows.forEach((row)=>{
|
116
|
+
let elements=this.getTableCellFetchQuery(row)
|
117
|
+
elements?.forEach((el:NileTableCellItem|NileTableHeaderItem,ind)=>{
|
118
|
+
el.style.setProperty('--cell-width',primaryRowWidths.at(ind)+'px')
|
119
|
+
})
|
120
|
+
})
|
121
|
+
}
|
122
|
+
|
123
|
+
getTableCellFetchQuery(row:NileTableBody):Array<Element>{
|
124
|
+
return row?.shadowRoot?.
|
125
|
+
querySelector<HTMLSlotElement>('slot:not([name])')?.
|
126
|
+
assignedElements()[0]
|
127
|
+
.shadowRoot?.querySelector<HTMLSlotElement>('slot')?.
|
128
|
+
assignedElements()!
|
129
|
+
}
|
130
|
+
|
131
|
+
handleResizeObserver(){
|
132
|
+
const onResize = (entries:ResizeObserverEntry[]): void=> {
|
133
|
+
for (let entry of entries) {
|
134
|
+
this.realignStructure();
|
135
|
+
}
|
136
|
+
};
|
137
|
+
this.resizeObserver=new ResizeObserver(onResize)
|
138
|
+
this.resizeObserver.observe(this);
|
139
|
+
}
|
140
|
+
|
141
|
+
disconnectedCallback(): void {
|
142
|
+
this.resizeObserver.disconnect()
|
143
|
+
super.disconnectedCallback()
|
144
|
+
}
|
145
|
+
/* #endregion */
|
146
|
+
}
|
147
|
+
|
148
|
+
export default NileTable;
|
149
|
+
|
150
|
+
declare global {
|
151
|
+
interface HTMLElementTagNameMap {
|
152
|
+
'nile-table': NileTable;
|
153
|
+
}
|
154
|
+
}
|
@@ -10,6 +10,7 @@ import {
|
|
10
10
|
html,
|
11
11
|
CSSResultArray,
|
12
12
|
TemplateResult,
|
13
|
+
PropertyValues,
|
13
14
|
} from 'lit';
|
14
15
|
import {
|
15
16
|
customElement,
|
@@ -38,8 +39,8 @@ export class NileTableBody extends NileElement {
|
|
38
39
|
*/
|
39
40
|
|
40
41
|
@query('slot') defaultSlot: HTMLSlotElement;
|
41
|
-
@queryAssignedNodes({ flatten: true })
|
42
|
-
|
42
|
+
@queryAssignedNodes({ flatten: true }) _childNodes!: Array<HTMLElement>;
|
43
|
+
@property() type: 'primary' | 'secondary' = 'primary';
|
43
44
|
|
44
45
|
@state() private rows_data: any[] = [];
|
45
46
|
@state() private header_rows_data: any[] = [];
|
@@ -50,6 +51,10 @@ export class NileTableBody extends NileElement {
|
|
50
51
|
return [styles];
|
51
52
|
}
|
52
53
|
|
54
|
+
protected firstUpdated(_changedProperties: PropertyValues): void {
|
55
|
+
this.emit('nile-body-load', { value: this.type, comp:this },true,false)
|
56
|
+
}
|
57
|
+
|
53
58
|
/* #endregion */
|
54
59
|
|
55
60
|
/* #region Methods */
|
@@ -63,6 +68,7 @@ export class NileTableBody extends NileElement {
|
|
63
68
|
}
|
64
69
|
|
65
70
|
handleSlotchange(e: any) {
|
71
|
+
this.emit('nile-body-content-changed', { value: this.type, comp:this },true,false)
|
66
72
|
let row_data: any = [];
|
67
73
|
this._childNodes.forEach((child: any) => {
|
68
74
|
if (child.tagName && child?.tagName?.toLowerCase() === 'nile-table-row') {
|
@@ -12,17 +12,19 @@ import { css } from 'lit';
|
|
12
12
|
*/
|
13
13
|
export const styles = css`
|
14
14
|
:host {
|
15
|
+
--cell-width:auto;
|
16
|
+
--min--height: 52px;
|
17
|
+
--max--cell-width: auto;
|
15
18
|
box-sizing: border-box;
|
16
19
|
display: table-cell;
|
17
20
|
vertical-align: middle;
|
18
|
-
--min--height: 52px;
|
19
|
-
--max--cell-width: auto;
|
20
21
|
max-width: var(--max--cell-width);
|
21
22
|
padding: 16px 24px;
|
22
23
|
min-height: var(--min--height);
|
23
24
|
}
|
24
25
|
|
25
26
|
.column {
|
27
|
+
min-width:var(--cell-width);
|
26
28
|
height: 100%;
|
27
29
|
color: var(--nile-colors-gray-light-mode-600);
|
28
30
|
font-family: var(--nile-font-family-serif);
|
@@ -12,11 +12,13 @@ import { css } from 'lit';
|
|
12
12
|
*/
|
13
13
|
export const styles = css`
|
14
14
|
:host {
|
15
|
+
--cell-width:auto;
|
15
16
|
display: table-cell;
|
16
17
|
box-sizing: border-box;
|
17
18
|
}
|
18
19
|
|
19
20
|
.header__item__wrapper{
|
21
|
+
min-width:var(--cell-width);
|
20
22
|
display:flex;
|
21
23
|
align-items:center;
|
22
24
|
box-sizing: border-box;
|
@@ -47,8 +47,7 @@ export class NileTableRow extends NileElement {
|
|
47
47
|
];
|
48
48
|
for (let i = 0; i < header_items.length; i++) {
|
49
49
|
const header = header_items[i];
|
50
|
-
const haveIcon =
|
51
|
-
header.textContent == event.detail.value.curr_sort_string;
|
50
|
+
const haveIcon = header.textContent == event.detail.value.curr_sort_string;
|
52
51
|
if (!haveIcon) {
|
53
52
|
header.sorting_ct = 0;
|
54
53
|
}
|
@@ -11,60 +11,119 @@ import { css } from 'lit';
|
|
11
11
|
* Tooltip CSS
|
12
12
|
*/
|
13
13
|
export const styles = css`
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
14
|
+
|
15
|
+
|
16
|
+
:host {
|
17
|
+
position: relative;
|
18
|
+
display: inline-block;
|
19
|
+
}
|
20
|
+
|
21
|
+
.tooltip {
|
22
|
+
position: fixed;
|
23
|
+
z-index: 1000;
|
24
|
+
background-color: var(--nile-tooltip-color-background, #333);
|
25
|
+
color: var(--nile-colors-white-base, #fff);
|
26
|
+
padding: 6px 10px;
|
27
|
+
border-radius: 4px;
|
28
|
+
font-size: var(--nile-tooltip-font-size-sm, 14px);
|
29
|
+
line-height: var(--nile-tooltip-line-height-sm, 1.5);
|
30
|
+
opacity: 0;
|
31
|
+
transition: opacity 0.2s, transform 0.2s;
|
32
|
+
pointer-events: none;
|
33
|
+
white-space: nowrap;
|
34
|
+
visibility: hidden;
|
35
|
+
transform: scale(0.95);
|
36
|
+
transition: opacity 0.2s ease-out, transform 0.2s ease-out;
|
37
|
+
}
|
38
|
+
|
39
|
+
.tooltip[open] {
|
40
|
+
opacity: 1;
|
41
|
+
transform: scale(1);
|
42
|
+
}
|
43
|
+
|
44
|
+
:host([open]) .tooltip {
|
45
|
+
opacity: 1;
|
46
|
+
visibility: visible;
|
47
|
+
pointer-events: auto;
|
48
|
+
}
|
49
|
+
|
50
|
+
.tooltip__body--large {
|
51
|
+
font-size: var(--nile-type-scale-4, 16px);
|
52
|
+
line-height: var(--nile-tooltip-line-height-lg, 1.75);
|
53
|
+
}
|
54
|
+
|
55
|
+
/* Tooltip Arrow */
|
56
|
+
.tooltip::after {
|
57
|
+
content: '';
|
58
|
+
position: absolute;
|
59
|
+
width: 0;
|
60
|
+
height: 0;
|
61
|
+
border-style: solid;
|
62
|
+
}
|
63
|
+
|
64
|
+
/* Basic Arrow Positions */
|
65
|
+
.tooltip[data-placement^="top"]::after {
|
66
|
+
bottom: -6px;
|
67
|
+
border-width: 6px 6px 0 6px;
|
68
|
+
border-color: var(--nile-tooltip-color-background, #333) transparent transparent transparent;
|
69
|
+
}
|
70
|
+
|
71
|
+
.tooltip[data-placement^="bottom"]::after {
|
72
|
+
top: -6px;
|
73
|
+
border-width: 0 6px 6px 6px;
|
74
|
+
border-color: transparent transparent var(--nile-tooltip-color-background, #333) transparent;
|
75
|
+
}
|
76
|
+
|
77
|
+
.tooltip[data-placement^="left"]::after {
|
78
|
+
right: -6px;
|
79
|
+
border-width: 6px 0 6px 6px;
|
80
|
+
border-color: transparent transparent transparent var(--nile-tooltip-color-background, #333);
|
81
|
+
}
|
82
|
+
|
83
|
+
.tooltip[data-placement^="right"]::after {
|
84
|
+
left: -6px;
|
85
|
+
border-width: 6px 6px 6px 0;
|
86
|
+
border-color: transparent var(--nile-tooltip-color-background, #333) transparent transparent;
|
87
|
+
}
|
88
|
+
|
89
|
+
/* Arrow Horizontal Alignment for top/bottom placements */
|
90
|
+
.tooltip[data-placement="top"]::after,
|
91
|
+
.tooltip[data-placement="bottom"]::after {
|
92
|
+
left: 50%;
|
93
|
+
transform: translateX(-50%);
|
94
|
+
}
|
95
|
+
|
96
|
+
.tooltip[data-placement="top-start"]::after,
|
97
|
+
.tooltip[data-placement="bottom-start"]::after {
|
98
|
+
left: 12px;
|
99
|
+
}
|
100
|
+
|
101
|
+
.tooltip[data-placement="top-end"]::after,
|
102
|
+
.tooltip[data-placement="bottom-end"]::after {
|
103
|
+
right: 12px;
|
104
|
+
left: auto;
|
105
|
+
}
|
106
|
+
|
107
|
+
/* Arrow Vertical Alignment for left/right placements */
|
108
|
+
.tooltip[data-placement="left"]::after,
|
109
|
+
.tooltip[data-placement="right"]::after {
|
110
|
+
top: 50%;
|
111
|
+
transform: translateY(-50%);
|
112
|
+
}
|
113
|
+
|
114
|
+
.tooltip[data-placement="left-start"]::after,
|
115
|
+
.tooltip[data-placement="right-start"]::after {
|
116
|
+
top: 12px;
|
117
|
+
transform: none;
|
118
|
+
}
|
119
|
+
|
120
|
+
.tooltip[data-placement="left-end"]::after,
|
121
|
+
.tooltip[data-placement="right-end"]::after {
|
122
|
+
bottom: 12px;
|
123
|
+
top: auto;
|
124
|
+
transform: none;
|
125
|
+
}
|
126
|
+
|
68
127
|
`;
|
69
128
|
|
70
129
|
export default [styles];
|