Compare commits

...

14 Commits

Author SHA1 Message Date
c5598f95ef 1.0.235 2023-12-08 18:26:40 +01:00
13d0cf729c fix(core): update 2023-12-08 18:26:40 +01:00
032e928dde 1.0.234 2023-12-08 18:22:19 +01:00
14ab3682f2 fix(core): update 2023-12-08 18:22:18 +01:00
c554e730a6 1.0.233 2023-12-08 18:15:40 +01:00
4d5a490e80 fix(core): update 2023-12-08 18:15:40 +01:00
7708c89fe1 1.0.232 2023-11-29 20:39:18 +01:00
0a0be3e357 fix(core): update 2023-11-29 20:39:17 +01:00
7b7c469fab 1.0.231 2023-11-29 17:20:33 +01:00
d852186888 fix(core): update 2023-11-29 17:20:32 +01:00
6cfda1ebf3 1.0.230 2023-10-31 13:44:19 +01:00
8e0062fdd5 fix(core): update 2023-10-31 13:44:18 +01:00
844cc30551 1.0.229 2023-10-24 14:18:04 +02:00
64074e37fc fix(core): update 2023-10-24 14:18:03 +02:00
15 changed files with 1532 additions and 1436 deletions

View File

@ -119,6 +119,6 @@ jobs:
run: |
npmci node install stable
npmci npm install
pnpm install -g @gitzone/tsdoc
pnpm install -g @git.zone/tsdoc
npmci command tsdoc
continue-on-error: true

View File

@ -1,6 +1,6 @@
{
"name": "@design.estate/dees-catalog",
"version": "1.0.228",
"version": "1.0.235",
"private": false,
"description": "website for lossless.com",
"main": "dist_ts_web/index.js",
@ -16,28 +16,28 @@
"license": "MIT",
"dependencies": {
"@design.estate/dees-domtools": "^2.0.55",
"@design.estate/dees-element": "^2.0.31",
"@design.estate/dees-element": "^2.0.33",
"@design.estate/dees-wcctools": "^1.0.81",
"@fortawesome/fontawesome-svg-core": "^6.4.2",
"@fortawesome/free-brands-svg-icons": "^6.4.2",
"@fortawesome/free-regular-svg-icons": "^6.4.2",
"@fortawesome/free-solid-svg-icons": "^6.4.2",
"@fortawesome/fontawesome-svg-core": "^6.5.0",
"@fortawesome/free-brands-svg-icons": "^6.5.0",
"@fortawesome/free-regular-svg-icons": "^6.5.0",
"@fortawesome/free-solid-svg-icons": "^6.5.0",
"@push.rocks/smarti18n": "^1.0.4",
"@push.rocks/smartpromise": "^4.0.3",
"@push.rocks/smartstring": "^4.0.9",
"@tsclass/tsclass": "^4.0.46",
"highlight.js": "11.9.0",
"ibantools": "^4.3.5",
"ibantools": "^4.3.6",
"pdfjs-dist": "^3.11.174"
},
"devDependencies": {
"@gitzone/tsbuild": "^2.1.66",
"@gitzone/tsbundle": "^2.0.8",
"@gitzone/tstest": "^1.0.77",
"@gitzone/tswatch": "^2.0.7",
"@git.zone/tsbuild": "^2.1.66",
"@git.zone/tsbundle": "^2.0.8",
"@git.zone/tstest": "^1.0.77",
"@git.zone/tswatch": "^2.0.7",
"@push.rocks/projectinfo": "^5.0.2",
"@push.rocks/tapbundle": "^5.0.15",
"@types/node": "^20.8.7"
"@types/node": "^20.10.0"
},
"files": [
"ts/**/*",

2330
pnpm-lock.yaml generated

File diff suppressed because it is too large Load Diff

View File

@ -3,6 +3,6 @@
*/
export const commitinfo = {
name: '@design.estate/dees-catalog',
version: '1.0.228',
version: '1.0.235',
description: 'website for lossless.com'
}

View File

@ -1,28 +1,41 @@
import { html } from '@design.estate/dees-element';
export const demoFunc = () => html`
<dees-chips
selectionMode="none"
.selectableChips=${[
{ key: 'account1', value: 'Payment Account 1' },
{ key: 'account2', value: 'PaymentAccount2' },
{ key: 'account3', value: 'Payment Account 3' }
]}
></dees-chips>
<dees-chips
selectionMode="single"
.selectableChips=${[
{ key: 'account1', value: 'Payment Account 1' },
{ key: 'account2', value: 'PaymentAccount2' },
{ key: 'account3', value: 'Payment Account 3' }
]}
></dees-chips>
<dees-chips
selectionMode="multiple"
.selectableChips=${[
{ key: 'account1', value: 'Payment Account 1' },
{ key: 'account2', value: 'PaymentAccount2' },
{ key: 'account3', value: 'Payment Account 3' }
]}
></dees-chips>
<style>
.demoContainer {
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
height: 100%;
background: #222;
}
</style>
<div class="demoContainer">
<dees-chips
selectionMode="none"
.selectableChips=${[
{ key: 'account1', value: 'Payment Account 1' },
{ key: 'account2', value: 'PaymentAccount2' },
{ key: 'account3', value: 'Payment Account 3' },
]}
></dees-chips>
<dees-chips
selectionMode="single"
chipsAreRemovable
.selectableChips=${[
{ key: 'account1', value: 'Payment Account 1' },
{ key: 'account2', value: 'PaymentAccount2' },
{ key: 'account3', value: 'Payment Account 3' },
]}
></dees-chips>
<dees-chips
selectionMode="multiple"
.selectableChips=${[
{ key: 'account1', value: 'Payment Account 1' },
{ key: 'account2', value: 'PaymentAccount2' },
{ key: 'account3', value: 'Payment Account 3' },
]}
></dees-chips>
</div>
`;

View File

@ -19,7 +19,7 @@ declare global {
}
}
type Tag = { key: string, value: string };
type Tag = { key: string; value: string };
@customElement('dees-chips')
export class DeesChips extends DeesElement {
@ -29,7 +29,12 @@ export class DeesChips extends DeesElement {
public selectionMode: 'none' | 'single' | 'multiple' = 'single';
@property({
type: Array
type: Boolean,
})
public chipsAreRemovable: boolean = false;
@property({
type: Array,
})
public selectableChips: Tag[] = [];
@ -37,10 +42,9 @@ export class DeesChips extends DeesElement {
public selectedChip: Tag = null;
@property({
type: Array
type: Array,
})
public selectedChips: Tag[] = [];
constructor() {
super();
@ -49,7 +53,6 @@ export class DeesChips extends DeesElement {
public static styles = [
cssManager.defaultStyles,
css`
:host {
display: block;
box-sizing: border-box;
@ -70,22 +73,23 @@ export class DeesChips extends DeesElement {
color: #fff;
border-radius: 40px;
margin-right: 4px;
margin-bottom: 8px;
margin-bottom: 4px;
position: relative;
overflow: hidden;
box-shadow: 0px 1px 2px rgba(0, 0, 0, 0.3);
}
.chip:hover {
background: #666666;
cursor: pointer;
cursor: pointer;
}
.chip.selected {
background: #00A3FF;
background: #00a3ff;
}
.chipKey {
background: rgba(0,0,0,0.3);
background: rgba(0, 0, 0, 0.3);
height: 100%;
display: inline-block;
margin-left: -8px;
@ -93,18 +97,44 @@ export class DeesChips extends DeesElement {
padding-right: 8px;
margin-right: 8px;
}
dees-icon {
padding: 0px 6px 0px 4px;
margin-left: 4px;
margin-right: -8px;
background: rgba(0, 0, 0, 0.3);
}
dees-icon:hover {
background: #e4002b;
}
`,
];
public render(): TemplateResult {
return html`
<div class="mainbox">
${this.selectableChips.map(chip => html`
<div @click=${() => this.selectChip(chip)} class="chip ${this.isSelected(chip) ? 'selected' : ''}">
${chip.key ? html`<div class="chipKey">${chip.key}</div>` : html``}${chip.value}
</div>
`)}
${this.selectableChips.map(
(chip) => html`
<div
@click=${() => this.selectChip(chip)}
class="chip ${this.isSelected(chip) ? 'selected' : ''}"
>
${chip.key ? html`<div class="chipKey">${chip.key}</div>` : html``} ${chip.value}
${this.chipsAreRemovable
? html`
<dees-icon
@click=${(event: Event) => {
event.stopPropagation(); // prevent the selectChip event from being triggered
this.removeChip(chip);
}}
.iconFA=${'xmark'}
></dees-icon>
`
: html``}
</div>
`
)}
</div>
`;
}
@ -120,7 +150,7 @@ export class DeesChips extends DeesElement {
if (this.selectionMode === 'single') {
return this.selectedChip?.key === chip.key;
} else {
return this.selectedChips.some(selected => selected.key === chip.key);
return this.selectedChips.some((selected) => selected.key === chip.key);
}
}
@ -137,9 +167,9 @@ export class DeesChips extends DeesElement {
this.selectedChip = chip;
this.selectedChips = [chip];
}
} else if(this.selectionMode === 'multiple') {
} else if (this.selectionMode === 'multiple') {
if (this.isSelected(chip)) {
this.selectedChips = this.selectedChips.filter(selected => selected.key !== chip.key);
this.selectedChips = this.selectedChips.filter((selected) => selected.key !== chip.key);
} else {
this.selectedChips = [...this.selectedChips, chip];
}
@ -147,4 +177,20 @@ export class DeesChips extends DeesElement {
}
console.log(this.selectedChips);
}
public removeChip(chipToRemove: Tag): void {
// Remove the chip from selectableChips
this.selectableChips = this.selectableChips.filter((chip) => chip.key !== chipToRemove.key);
// Remove the chip from selectedChips if present
this.selectedChips = this.selectedChips.filter((chip) => chip.key !== chipToRemove.key);
// If the removed chip was the selectedChip, set selectedChip to null
if (this.selectedChip && this.selectedChip.key === chipToRemove.key) {
this.selectedChip = null;
}
// Trigger an update to re-render the component
this.requestUpdate();
}
}

View File

@ -27,7 +27,42 @@ export class DeesContextmenu extends DeesElement {
public static demo = demoFunc
// STATIC
// This will store all the accumulated menu items
public static contextMenuDeactivated = false;
public static accumulatedMenuItems: plugins.tsclass.website.IMenuItem[] = [];
// Add a global event listener for the right-click context menu
public static initializeGlobalListener() {
document.addEventListener('contextmenu', (event: MouseEvent) => {
if (this.contextMenuDeactivated) {
return;
}
event.preventDefault();
// Get the target element of the right-click
let target: EventTarget | null = event.target;
// Clear previously accumulated items
DeesContextmenu.accumulatedMenuItems = [];
// Traverse up the DOM tree to accumulate menu items
while (target) {
if ((target as any).getContextMenuItems) {
DeesContextmenu.accumulatedMenuItems.push(...(target as any).getContextMenuItems());
}
target = (target as Node).parentNode;
}
// Open the context menu with the accumulated items
DeesContextmenu.openContextMenuWithOptions(event, DeesContextmenu.accumulatedMenuItems);
});
}
// allows opening of a contextmenu with options
public static async openContextMenuWithOptions(eventArg: MouseEvent, menuItemsArg: plugins.tsclass.website.IMenuItem[]) {
if (this.contextMenuDeactivated) {
return;
}
eventArg.preventDefault();
eventArg.stopPropagation();
const contextMenu = new DeesContextmenu();
@ -49,6 +84,7 @@ export class DeesContextmenu extends DeesElement {
contextMenu.style.transform = 'scale(1,1)';
}
// INSTANCE
@property({
type: Array,
})
@ -59,6 +95,9 @@ export class DeesContextmenu extends DeesElement {
super();
}
/**
* STATIC STYLES
*/
public static styles = [
cssManager.defaultStyles,
css`
@ -115,10 +154,11 @@ export class DeesContextmenu extends DeesElement {
})}
${this.menuItems.length === 0 ? html`
<div class="menuitem" @click=${() => {
alert('No menu items...')
DeesContextmenu.contextMenuDeactivated = true;
this.destroy();
}}>
<dees-icon .iconFA=${'xmark'}></dees-icon
>No menu item present...
>Deactivate Contextmenu globally.
</div>
` : html``}
</div>
@ -144,3 +184,5 @@ export class DeesContextmenu extends DeesElement {
this.parentElement.removeChild(this);
}
}
DeesContextmenu.initializeGlobalListener();

View File

@ -20,9 +20,22 @@ export const demoFunc = () => html`
form.setStatus('success', 'authenticated!');
}}
>
<dees-input-dropdown
.label=${'title'}
.options=${[
{ option: 'option 1', key: 'option1' },
{ option: 'option 2', key: 'option2' },
{ option: 'option 3', key: 'option3' },
]}
></dees-input-dropdown>
<dees-input-text .required="${true}" key="hello1" label="a text"></dees-input-text>
<dees-input-text .required="${true}" key="hello2" label="also a text"></dees-input-text>
<dees-input-text .required="${true}" key="hello3" label="a password" isPasswordBool></dees-input-text>
<dees-input-text
.required="${true}"
key="hello3"
label="a password"
isPasswordBool
></dees-input-text>
<dees-input-checkbox
.required="${true}"
key="hello3"

View File

@ -0,0 +1,27 @@
import { html } from '@design.estate/dees-element';
export const demoFunc = () => html`
<dees-input-dropdown
.options=${[
{option: 'option 1', key: 'option1'},
{option: 'option 2', key: 'option2'},
{option: 'option 3', key: 'option3'}
]}
></dees-input-dropdown>
<dees-input-dropdown
.enableSearch=${false}
.options=${[
{option: 'option 1', key: 'option1'},
{option: 'option 2', key: 'option2'},
{option: 'option 3', key: 'option3'}
]}
></dees-input-dropdown>
<div style="height: 300px"></div>
<dees-input-dropdown
.options=${[
{option: 'option 1', key: 'option1'},
{option: 'option 2', key: 'option2'},
{option: 'option 3', key: 'option3'}
]}
></dees-input-dropdown>
`

View File

@ -1,5 +1,17 @@
import { customElement, DeesElement, type TemplateResult, property, html, css, cssManager, type CSSResult, } from '@design.estate/dees-element';
import {
customElement,
DeesElement,
type TemplateResult,
property,
state,
html,
css,
cssManager,
type CSSResult,
} from '@design.estate/dees-element';
import * as domtools from '@design.estate/dees-domtools';
import { demoFunc } from './dees-input-dropdown.demo.js';
import { DeesWindowLayer } from './dees-windowlayer.js';
declare global {
interface HTMLElementTagNameMap {
@ -9,15 +21,7 @@ declare global {
@customElement('dees-input-dropdown')
export class DeesInputDropdown extends DeesElement {
public static demo = () => html`
<dees-input-dropdown
.options=${[
{option: 'option 1', key: 'option1'},
{option: 'option 2', key: 'option2'},
{option: 'option 3', key: 'option3'}
]}
></dees-input-dropdown>
`
public static demo = demoFunc;
// INSTANCE
public changeSubject = new domtools.plugins.smartrx.rxjs.Subject();
@ -32,145 +36,266 @@ export class DeesInputDropdown extends DeesElement {
public key: string;
@property()
public options: {option: string, key: string, payload?: any}[] = [];
public options: { option: string; key: string; payload?: any }[] = [];
@property()
public selectedOption: {option: string, key: string, payload?: any} = {
key: null,
option: null,
payload: null
};
public selectedOption: { option: string; key: string; payload?: any } = null;
@property({
type: Boolean
type: Boolean,
})
public required: boolean = false;
@property({
type: Boolean
type: Boolean,
})
public enableSearch: boolean = true;
@property({
type: Boolean,
})
public disabled: boolean = false;
@state()
public opensToTop: boolean = false;
public static styles = [
cssManager.defaultStyles,
css`
* {
box-sizing: border-box;
}
box-sizing: border-box;
}
:host {
position: relative;
display: block;
height: 40px;
color: ${cssManager.bdTheme('#222', '#fff')};
}
:host {
font-family: Roboto;
position: relative;
display: block;
color: ${cssManager.bdTheme('#222', '#fff')};
margin-bottom: 24px;
}
.maincontainer {
display: block;
}
.maincontainer {
display: block;
}
.label {
font-size: 14px;
margin-bottom: 15px;
}
.label {
font-size: 14px;
margin-bottom: 4px;
}
.selectedBox {
cursor: pointer;
position: relative;
max-width: 420px;
height: 40px;
line-height: 40px;
padding: 0px 8px;
z-index: 0px;
background: ${cssManager.bdTheme('#ffffff', '#333333')};
box-shadow: ${cssManager.bdTheme('0px 1px 4px rgba(0,0,0,0.3)', 'none')};
border-radius: 3px;
border-top: 1px solid #CCCCCC00;
border-bottom: 1px solid #66666600;
}
.selectedBox {
user-select: none;
cursor: pointer;
position: relative;
max-width: 420px;
height: 40px;
line-height: 40px;
padding: 0px 8px;
background: ${cssManager.bdTheme('#fafafa', '#222')};
box-shadow: ${cssManager.bdTheme('0px 1px 4px rgba(0,0,0,0.3)', 'none')};
border-radius: 3px;
border-top: ${cssManager.bdTheme('1px solid #CCC', '1px solid #444')};
border-bottom: ${cssManager.bdTheme('1px solid #CCC', '1px solid #333')};
transition: all 0.2s ease;
}
.selectedBox.show {
border-top: 1px solid ${cssManager.bdTheme('#ffffff', '#666666')};
border-bottom: 1px solid ${cssManager.bdTheme('#fafafa', '#222222')};
}
.accentTop {
border-top: 1px solid #e4002b;
}
.selectionBox {
will-change:transform;
pointer-events: none;
cursor: pointer;
transition: all 0.2s ease;
opacity: 0;
position: relative;
background: ${cssManager.bdTheme('#ffffff', '#222222')};
max-width: 420px;
box-shadow: 0px 0px 5px rgba(0,0,0,0.2);
min-height: 40px;
margin-top: -40px;
z-index: 100;
border-radius: 3px;
padding: 4px;
transform: scale(0.99,0.99);
}
.accentBottom {
border-bottom: 1px solid #e4002b;
}
.selectionBox.show {
pointer-events: all;
opacity: 1;
transform: scale(1,1);
}
.selectionBox {
will-change: transform;
pointer-events: none;
cursor: pointer;
transition: all 0.2s ease;
opacity: 0;
background: ${cssManager.bdTheme('#ffffff', '#222222')};
max-width: 420px;
box-shadow: 0px 0px 5px rgba(0, 0, 0, 0.2);
min-height: 40px;
border-radius: 3px;
padding: 4px;
transform: scale(0.99, 0.99);
position: absolute;
}
.option {
transition: all 0.1s;
line-height: 40px;
padding: 0px 4px;
border-radius: 3px;
}
.selectionBox.show {
pointer-events: all;
opacity: 1;
transform: scale(1, 1);
}
.option:hover {
color: #fff;
padding-left: 8px;
background: #0277bd;
}
`
]
.option {
transition: all 0.1s;
line-height: 40px;
padding: 0px 4px;
border-radius: 3px;
}
.option:hover {
color: #fff;
padding-left: 8px;
background: #0277bd;
}
.search {
padding: 8px;
}
.search input {
display: block;
width: 80%;
background: none;
border: none;
height: 24px;
color: inherit;
text-align: center;
font-size: 12px;
font-weight: 600;
background: ${cssManager.bdTheme('#00000010', '#ffffff08')};
border-radius: 16px;
margin: auto;
}
.search input:focus {
border: none;
outline: none;
}
`,
];
public render(): TemplateResult {
return html`
${domtools.elementBasic.styles}
<style>
</style>
<div class="maincontainer">
<div class="selectedBox show" @click="${event => {this.toggleSelectionBox();}}">
${this.selectedOption?.option}
</div>
${this.label ? html`<div class="label">${this.label}</div>` : html``}
<div class="selectionBox">
${this.options.map(option => {
${this.enableSearch && !this.opensToTop
? html`
<div class="search">
<input type="text" placeholder="Search" />
</div>
`
: null}
${this.options.map((option) => {
return html`
<div class="option" @click=${() => {this.updateSelection(option);}}>${option.option}</div>
`
<div
class="option"
@click=${() => {
this.updateSelection(option);
}}
>
${option.option}
</div>
`;
})}
${this.enableSearch && this.opensToTop
? html`
<div class="search">
<input type="text" placeholder="Search" />
</div>
`
: null}
</div>
<div
class="selectedBox"
@click="${(event) => {
if (!this.isElevated) {
this.toggleSelectionBox();
} else {
this.updateSelection(this.selectedOption);
}
}}"
>
${this.selectedOption?.option}
</div>
</div>
`;
}
firstUpdated() {
this.selectedOption = this.options[0] || null;
this.selectedOption = this.selectedOption || this.options[0] || null;
}
public async updateSelection(selectedOption) {
this.selectedOption = selectedOption;
this.dispatchEvent(new CustomEvent('selectedOption', {
detail: selectedOption,
bubbles: true
}));
this.toggleSelectionBox();
this.dispatchEvent(
new CustomEvent('selectedOption', {
detail: selectedOption,
bubbles: true,
})
);
if (this.isElevated) {
this.toggleSelectionBox();
}
this.changeSubject.next(this);
}
public toggleSelectionBox() {
this.shadowRoot.querySelector('.selectedBox').classList.toggle('show');
this.shadowRoot.querySelector('.selectionBox').classList.toggle('show');
private isElevated: boolean = false;
private windowOverlay: DeesWindowLayer;
public async toggleSelectionBox() {
const domtoolsInstance = await this.domtoolsPromise;
const selectedBox: HTMLElement = this.shadowRoot.querySelector('.selectedBox');
const selectionBox: HTMLElement = this.shadowRoot.querySelector('.selectionBox');
if (!this.isElevated) {
this.windowOverlay = await DeesWindowLayer.createAndShow({
blur: false,
});
const elevatedDropdown = new DeesInputDropdown();
elevatedDropdown.isElevated = true;
elevatedDropdown.label = this.label;
elevatedDropdown.enableSearch = this.enableSearch;
elevatedDropdown.required = this.required;
elevatedDropdown.disabled = this.disabled;
elevatedDropdown.style.position = 'fixed';
elevatedDropdown.style.top = this.getBoundingClientRect().top + 'px';
elevatedDropdown.style.left = this.getBoundingClientRect().left + 'px';
elevatedDropdown.style.width = this.clientWidth + 'px';
elevatedDropdown.options = this.options;
elevatedDropdown.selectedOption = this.selectedOption;
console.log(elevatedDropdown.selectedOption);
this.windowOverlay.appendChild(elevatedDropdown);
await domtoolsInstance.convenience.smartdelay.delayFor(0);
elevatedDropdown.toggleSelectionBox();
const destroyOverlay = async () => {
(elevatedDropdown.shadowRoot.querySelector('.selectionBox') as HTMLElement).style.opacity =
'0';
elevatedDropdown.removeEventListener('selectedOption', handleSelection);
this.windowOverlay.removeEventListener('clicked', destroyOverlay);
this.windowOverlay.destroy();
};
const handleSelection = async (event) => {
await this.updateSelection(elevatedDropdown.selectedOption);
destroyOverlay();
};
elevatedDropdown.addEventListener('selectedOption', handleSelection);
this.windowOverlay.addEventListener('clicked', destroyOverlay);
} else {
if (!selectionBox.classList.contains('show')) {
selectionBox.style.width = selectedBox.clientWidth + 'px';
selectionBox.classList.add('show');
const spaceData = selectedBox.getBoundingClientRect();
if (300 > window.innerHeight - spaceData.bottom) {
this.opensToTop = true;
selectedBox.classList.add('accentTop');
selectionBox.style.bottom = selectedBox.clientHeight + 2 + 'px';
} else {
selectedBox.classList.add('accentBottom');
this.opensToTop = false;
const labelOffset = this.label ? 24 : 0;
selectionBox.style.top = selectedBox.clientHeight + labelOffset + 'px';
}
await domtoolsInstance.convenience.smartdelay.delayFor(0);
const searchInput = selectionBox.querySelector('input');
searchInput.focus();
} else {
selectedBox.style.pointerEvents = 'none';
selectionBox.classList.remove('show');
selectedBox.style.opacity = '0';
}
}
}
}

View File

@ -143,6 +143,7 @@ export class DeesInputText extends DeesElement {
border-radius: 7px;
padding: 4px 0px;
width: 40px;
z-index: 3;
}
.showPassword:hover {
@ -169,7 +170,7 @@ export class DeesInputText extends DeesElement {
return html`
<style>
input {
font-family: ${this.isPasswordBool ? 'monospace' : 'Inter'};
font-family: ${this.isPasswordBool ? 'monospace' : 'Roboto'};
letter-spacing: ${this.isPasswordBool ? '1px' : 'normal'};
color: ${this.goBright ? '#333' : '#ccc'};
}

View File

@ -71,6 +71,7 @@ export class DeesModal extends DeesElement {
:host {
font-family: 'Roboto', 'Inter', sans-serif;
color: ${cssManager.bdTheme('#333', '#fff')};
will-change: transform;
}
.modalContainer {
display: flex;

View File

@ -61,8 +61,8 @@ export interface ITableAction<T = any> {
}
export interface ITableActionDataArg<T> {
item: T,
table: DeesTable<T>,
item: T;
table: DeesTable<T>;
}
export type TDisplayFunction<T = any> = (itemArg: T) => object;
@ -396,6 +396,8 @@ export class DeesTable<T> extends DeesElement {
</div>
<div class="headingSeparation"></div>
<dees-input-text></dees-input-text>
<!-- the actual table -->
<style></style>
${this.data.length > 0
@ -524,10 +526,11 @@ export class DeesTable<T> extends DeesElement {
${this.getActionsForType('inRow').map(
(actionArg) => html`<div
class="action"
@click=${() => actionArg.actionFunc({
item: itemArg,
table: this,
})}
@click=${() =>
actionArg.actionFunc({
item: itemArg,
table: this,
})}
>
${actionArg.iconName
? html`
@ -584,8 +587,7 @@ export class DeesTable<T> extends DeesElement {
`;
}
public async firstUpdated() {
}
public async firstUpdated() {}
public async updated(changedProperties: Map<string | number | symbol, unknown>): Promise<void> {
super.updated(changedProperties);
@ -609,7 +611,8 @@ export class DeesTable<T> extends DeesElement {
// Get computed width
const width = window.getComputedStyle(cell).width;
if (cell.textContent.includes('Actions')) {
const neededWidth = this.dataActions.filter(actionArg => actionArg.type.includes('inRow')).length * 35;
const neededWidth =
this.dataActions.filter((actionArg) => actionArg.type.includes('inRow')).length * 35;
cell.style.width = `${Math.max(neededWidth, 68)}px`;
} else {
cell.style.width = width;
@ -620,7 +623,7 @@ export class DeesTable<T> extends DeesElement {
});
await done.promise;
}
}
};
if (cells[cells.length - 1].textContent.includes('Actions')) {
await handleColumnByIndex(cells.length - 1, true);

View File

@ -66,6 +66,15 @@ export class DeesWindowLayer extends DeesElement {
pointer-events: none;
z-index: 200;
}
.slotContent {
position: fixed;
height: 100vh;
width: 100vw;
display: flex;
justify-content: center;
align-items: center;
z-index: 201;
}
.visible {
background: rgba(0, 0, 0, 0.2);
@ -73,7 +82,9 @@ export class DeesWindowLayer extends DeesElement {
pointer-events: all;
}
</style>
<div @click=${this.dispatchClicked} class="windowOverlay ${this.visible ? 'visible' : null}">
<div class="windowOverlay ${this.visible ? 'visible' : null}">
</div>
<div @click=${this.dispatchClicked} class="slotContent">
<slot></slot>
</div>
`;

View File

@ -3,8 +3,8 @@
"experimentalDecorators": true,
"useDefineForClassFields": false,
"target": "ES2022",
"module": "ES2022",
"moduleResolution": "nodenext",
"module": "NodeNext",
"moduleResolution": "NodeNext",
"esModuleInterop": true,
"verbatimModuleSyntax": true
},