Compare commits
4 Commits
Author | SHA1 | Date | |
---|---|---|---|
7b7c469fab | |||
d852186888 | |||
6cfda1ebf3 | |||
8e0062fdd5 |
@ -119,6 +119,6 @@ jobs:
|
|||||||
run: |
|
run: |
|
||||||
npmci node install stable
|
npmci node install stable
|
||||||
npmci npm install
|
npmci npm install
|
||||||
pnpm install -g @gitzone/tsdoc
|
pnpm install -g @git.zone/tsdoc
|
||||||
npmci command tsdoc
|
npmci command tsdoc
|
||||||
continue-on-error: true
|
continue-on-error: true
|
||||||
|
24
package.json
24
package.json
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@design.estate/dees-catalog",
|
"name": "@design.estate/dees-catalog",
|
||||||
"version": "1.0.229",
|
"version": "1.0.231",
|
||||||
"private": false,
|
"private": false,
|
||||||
"description": "website for lossless.com",
|
"description": "website for lossless.com",
|
||||||
"main": "dist_ts_web/index.js",
|
"main": "dist_ts_web/index.js",
|
||||||
@ -16,28 +16,28 @@
|
|||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@design.estate/dees-domtools": "^2.0.55",
|
"@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",
|
"@design.estate/dees-wcctools": "^1.0.81",
|
||||||
"@fortawesome/fontawesome-svg-core": "^6.4.2",
|
"@fortawesome/fontawesome-svg-core": "^6.5.0",
|
||||||
"@fortawesome/free-brands-svg-icons": "^6.4.2",
|
"@fortawesome/free-brands-svg-icons": "^6.5.0",
|
||||||
"@fortawesome/free-regular-svg-icons": "^6.4.2",
|
"@fortawesome/free-regular-svg-icons": "^6.5.0",
|
||||||
"@fortawesome/free-solid-svg-icons": "^6.4.2",
|
"@fortawesome/free-solid-svg-icons": "^6.5.0",
|
||||||
"@push.rocks/smarti18n": "^1.0.4",
|
"@push.rocks/smarti18n": "^1.0.4",
|
||||||
"@push.rocks/smartpromise": "^4.0.3",
|
"@push.rocks/smartpromise": "^4.0.3",
|
||||||
"@push.rocks/smartstring": "^4.0.9",
|
"@push.rocks/smartstring": "^4.0.9",
|
||||||
"@tsclass/tsclass": "^4.0.46",
|
"@tsclass/tsclass": "^4.0.46",
|
||||||
"highlight.js": "11.9.0",
|
"highlight.js": "11.9.0",
|
||||||
"ibantools": "^4.3.5",
|
"ibantools": "^4.3.6",
|
||||||
"pdfjs-dist": "^3.11.174"
|
"pdfjs-dist": "^3.11.174"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@gitzone/tsbuild": "^2.1.66",
|
"@git.zone/tsbuild": "^2.1.66",
|
||||||
"@gitzone/tsbundle": "^2.0.8",
|
"@git.zone/tsbundle": "^2.0.8",
|
||||||
"@gitzone/tstest": "^1.0.77",
|
"@git.zone/tstest": "^1.0.77",
|
||||||
"@gitzone/tswatch": "^2.0.7",
|
"@git.zone/tswatch": "^2.0.7",
|
||||||
"@push.rocks/projectinfo": "^5.0.2",
|
"@push.rocks/projectinfo": "^5.0.2",
|
||||||
"@push.rocks/tapbundle": "^5.0.15",
|
"@push.rocks/tapbundle": "^5.0.15",
|
||||||
"@types/node": "^20.8.7"
|
"@types/node": "^20.10.0"
|
||||||
},
|
},
|
||||||
"files": [
|
"files": [
|
||||||
"ts/**/*",
|
"ts/**/*",
|
||||||
|
2330
pnpm-lock.yaml
generated
2330
pnpm-lock.yaml
generated
File diff suppressed because it is too large
Load Diff
@ -3,6 +3,6 @@
|
|||||||
*/
|
*/
|
||||||
export const commitinfo = {
|
export const commitinfo = {
|
||||||
name: '@design.estate/dees-catalog',
|
name: '@design.estate/dees-catalog',
|
||||||
version: '1.0.229',
|
version: '1.0.231',
|
||||||
description: 'website for lossless.com'
|
description: 'website for lossless.com'
|
||||||
}
|
}
|
||||||
|
@ -22,6 +22,7 @@ export const demoFunc = () => html`
|
|||||||
></dees-chips>
|
></dees-chips>
|
||||||
<dees-chips
|
<dees-chips
|
||||||
selectionMode="single"
|
selectionMode="single"
|
||||||
|
chipsAreRemovable
|
||||||
.selectableChips=${[
|
.selectableChips=${[
|
||||||
{ key: 'account1', value: 'Payment Account 1' },
|
{ key: 'account1', value: 'Payment Account 1' },
|
||||||
{ key: 'account2', value: 'PaymentAccount2' },
|
{ key: 'account2', value: 'PaymentAccount2' },
|
||||||
|
@ -19,7 +19,7 @@ declare global {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
type Tag = { key: string, value: string };
|
type Tag = { key: string; value: string };
|
||||||
|
|
||||||
@customElement('dees-chips')
|
@customElement('dees-chips')
|
||||||
export class DeesChips extends DeesElement {
|
export class DeesChips extends DeesElement {
|
||||||
@ -29,7 +29,12 @@ export class DeesChips extends DeesElement {
|
|||||||
public selectionMode: 'none' | 'single' | 'multiple' = 'single';
|
public selectionMode: 'none' | 'single' | 'multiple' = 'single';
|
||||||
|
|
||||||
@property({
|
@property({
|
||||||
type: Array
|
type: Boolean,
|
||||||
|
})
|
||||||
|
public chipsAreRemovable: boolean = false;
|
||||||
|
|
||||||
|
@property({
|
||||||
|
type: Array,
|
||||||
})
|
})
|
||||||
public selectableChips: Tag[] = [];
|
public selectableChips: Tag[] = [];
|
||||||
|
|
||||||
@ -37,11 +42,10 @@ export class DeesChips extends DeesElement {
|
|||||||
public selectedChip: Tag = null;
|
public selectedChip: Tag = null;
|
||||||
|
|
||||||
@property({
|
@property({
|
||||||
type: Array
|
type: Array,
|
||||||
})
|
})
|
||||||
public selectedChips: Tag[] = [];
|
public selectedChips: Tag[] = [];
|
||||||
|
|
||||||
|
|
||||||
constructor() {
|
constructor() {
|
||||||
super();
|
super();
|
||||||
}
|
}
|
||||||
@ -49,7 +53,6 @@ export class DeesChips extends DeesElement {
|
|||||||
public static styles = [
|
public static styles = [
|
||||||
cssManager.defaultStyles,
|
cssManager.defaultStyles,
|
||||||
css`
|
css`
|
||||||
|
|
||||||
:host {
|
:host {
|
||||||
display: block;
|
display: block;
|
||||||
box-sizing: border-box;
|
box-sizing: border-box;
|
||||||
@ -82,7 +85,7 @@ export class DeesChips extends DeesElement {
|
|||||||
}
|
}
|
||||||
|
|
||||||
.chip.selected {
|
.chip.selected {
|
||||||
background: #00A3FF;
|
background: #00a3ff;
|
||||||
}
|
}
|
||||||
|
|
||||||
.chipKey {
|
.chipKey {
|
||||||
@ -95,17 +98,43 @@ export class DeesChips extends DeesElement {
|
|||||||
margin-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 {
|
public render(): TemplateResult {
|
||||||
return html`
|
return html`
|
||||||
<div class="mainbox">
|
<div class="mainbox">
|
||||||
${this.selectableChips.map(chip => html`
|
${this.selectableChips.map(
|
||||||
<div @click=${() => this.selectChip(chip)} class="chip ${this.isSelected(chip) ? 'selected' : ''}">
|
(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}
|
${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>
|
||||||
`)}
|
`
|
||||||
|
)}
|
||||||
</div>
|
</div>
|
||||||
`;
|
`;
|
||||||
}
|
}
|
||||||
@ -121,7 +150,7 @@ export class DeesChips extends DeesElement {
|
|||||||
if (this.selectionMode === 'single') {
|
if (this.selectionMode === 'single') {
|
||||||
return this.selectedChip?.key === chip.key;
|
return this.selectedChip?.key === chip.key;
|
||||||
} else {
|
} else {
|
||||||
return this.selectedChips.some(selected => selected.key === chip.key);
|
return this.selectedChips.some((selected) => selected.key === chip.key);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -140,7 +169,7 @@ export class DeesChips extends DeesElement {
|
|||||||
}
|
}
|
||||||
} else if (this.selectionMode === 'multiple') {
|
} else if (this.selectionMode === 'multiple') {
|
||||||
if (this.isSelected(chip)) {
|
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 {
|
} else {
|
||||||
this.selectedChips = [...this.selectedChips, chip];
|
this.selectedChips = [...this.selectedChips, chip];
|
||||||
}
|
}
|
||||||
@ -148,4 +177,20 @@ export class DeesChips extends DeesElement {
|
|||||||
}
|
}
|
||||||
console.log(this.selectedChips);
|
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();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
11
ts_web/elements/dees-input-dropdown.demo.ts
Normal file
11
ts_web/elements/dees-input-dropdown.demo.ts
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
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>
|
||||||
|
`
|
@ -1,5 +1,6 @@
|
|||||||
import { customElement, DeesElement, type TemplateResult, property, html, css, cssManager, type CSSResult, } from '@design.estate/dees-element';
|
import { customElement, DeesElement, type TemplateResult, property, html, css, cssManager, type CSSResult, } from '@design.estate/dees-element';
|
||||||
import * as domtools from '@design.estate/dees-domtools';
|
import * as domtools from '@design.estate/dees-domtools';
|
||||||
|
import { demoFunc } from './dees-input-dropdown.demo.js';
|
||||||
|
|
||||||
declare global {
|
declare global {
|
||||||
interface HTMLElementTagNameMap {
|
interface HTMLElementTagNameMap {
|
||||||
@ -9,15 +10,7 @@ declare global {
|
|||||||
|
|
||||||
@customElement('dees-input-dropdown')
|
@customElement('dees-input-dropdown')
|
||||||
export class DeesInputDropdown extends DeesElement {
|
export class DeesInputDropdown extends DeesElement {
|
||||||
public static demo = () => html`
|
public static demo = demoFunc
|
||||||
<dees-input-dropdown
|
|
||||||
.options=${[
|
|
||||||
{option: 'option 1', key: 'option1'},
|
|
||||||
{option: 'option 2', key: 'option2'},
|
|
||||||
{option: 'option 3', key: 'option3'}
|
|
||||||
]}
|
|
||||||
></dees-input-dropdown>
|
|
||||||
`
|
|
||||||
|
|
||||||
// INSTANCE
|
// INSTANCE
|
||||||
public changeSubject = new domtools.plugins.smartrx.rxjs.Subject();
|
public changeSubject = new domtools.plugins.smartrx.rxjs.Subject();
|
||||||
@ -100,12 +93,11 @@ export class DeesInputDropdown extends DeesElement {
|
|||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
transition: all 0.2s ease;
|
transition: all 0.2s ease;
|
||||||
opacity: 0;
|
opacity: 0;
|
||||||
position: relative;
|
position: absolute;
|
||||||
background: ${cssManager.bdTheme('#ffffff', '#222222')};
|
background: ${cssManager.bdTheme('#ffffff', '#222222')};
|
||||||
max-width: 420px;
|
max-width: 420px;
|
||||||
box-shadow: 0px 0px 5px rgba(0,0,0,0.2);
|
box-shadow: 0px 0px 5px rgba(0,0,0,0.2);
|
||||||
min-height: 40px;
|
min-height: 40px;
|
||||||
margin-top: -40px;
|
|
||||||
z-index: 100;
|
z-index: 100;
|
||||||
border-radius: 3px;
|
border-radius: 3px;
|
||||||
padding: 4px;
|
padding: 4px;
|
||||||
@ -135,12 +127,8 @@ export class DeesInputDropdown extends DeesElement {
|
|||||||
|
|
||||||
public render(): TemplateResult {
|
public render(): TemplateResult {
|
||||||
return html`
|
return html`
|
||||||
${domtools.elementBasic.styles}
|
|
||||||
<style>
|
|
||||||
|
|
||||||
</style>
|
|
||||||
<div class="maincontainer">
|
<div class="maincontainer">
|
||||||
<div class="selectedBox show" @click="${event => {this.toggleSelectionBox();}}">
|
<div class="selectedBox show" @click="${event => {this.openSelectionBox();}}">
|
||||||
${this.selectedOption?.option}
|
${this.selectedOption?.option}
|
||||||
</div>
|
</div>
|
||||||
<div class="selectionBox">
|
<div class="selectionBox">
|
||||||
@ -165,12 +153,16 @@ export class DeesInputDropdown extends DeesElement {
|
|||||||
detail: selectedOption,
|
detail: selectedOption,
|
||||||
bubbles: true
|
bubbles: true
|
||||||
}));
|
}));
|
||||||
this.toggleSelectionBox();
|
this.openSelectionBox();
|
||||||
this.changeSubject.next(this);
|
this.changeSubject.next(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
public toggleSelectionBox() {
|
public openSelectionBox() {
|
||||||
this.shadowRoot.querySelector('.selectedBox').classList.toggle('show');
|
this.shadowRoot.querySelector('.selectedBox').classList.toggle('show');
|
||||||
this.shadowRoot.querySelector('.selectionBox').classList.toggle('show');
|
this.shadowRoot.querySelector('.selectionBox').classList.toggle('show');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public closeSelectionBox() {
|
||||||
|
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -71,6 +71,7 @@ export class DeesModal extends DeesElement {
|
|||||||
:host {
|
:host {
|
||||||
font-family: 'Roboto', 'Inter', sans-serif;
|
font-family: 'Roboto', 'Inter', sans-serif;
|
||||||
color: ${cssManager.bdTheme('#333', '#fff')};
|
color: ${cssManager.bdTheme('#333', '#fff')};
|
||||||
|
will-change: transform;
|
||||||
}
|
}
|
||||||
.modalContainer {
|
.modalContainer {
|
||||||
display: flex;
|
display: flex;
|
||||||
|
@ -66,14 +66,22 @@ export class DeesWindowLayer extends DeesElement {
|
|||||||
pointer-events: none;
|
pointer-events: none;
|
||||||
z-index: 200;
|
z-index: 200;
|
||||||
}
|
}
|
||||||
|
.slotContent {
|
||||||
|
height: 100vh;
|
||||||
|
width: 100vw;
|
||||||
|
display: flex;
|
||||||
|
justify-content: center;
|
||||||
|
align-items: center;
|
||||||
|
}
|
||||||
|
|
||||||
.visible {
|
.visible {
|
||||||
background: rgba(0, 0, 0, 0.2);
|
background: rgba(0, 0, 0, 0.2);
|
||||||
backdrop-filter: brightness(0.9) ${this.options.blur ? 'blur(2px)' : ''};
|
backdrop-filter: brightness(0.9) ${this.options.blur ? 'blur(2px)' : ''};
|
||||||
pointer-events: all;
|
|
||||||
}
|
}
|
||||||
</style>
|
</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>
|
<slot></slot>
|
||||||
</div>
|
</div>
|
||||||
`;
|
`;
|
||||||
|
@ -3,8 +3,8 @@
|
|||||||
"experimentalDecorators": true,
|
"experimentalDecorators": true,
|
||||||
"useDefineForClassFields": false,
|
"useDefineForClassFields": false,
|
||||||
"target": "ES2022",
|
"target": "ES2022",
|
||||||
"module": "ES2022",
|
"module": "NodeNext",
|
||||||
"moduleResolution": "nodenext",
|
"moduleResolution": "NodeNext",
|
||||||
"esModuleInterop": true,
|
"esModuleInterop": true,
|
||||||
"verbatimModuleSyntax": true
|
"verbatimModuleSyntax": true
|
||||||
},
|
},
|
||||||
|
Reference in New Issue
Block a user