Compare commits

...

2 Commits

Author SHA1 Message Date
963edbffa3 1.0.222 2023-10-17 20:07:46 +02:00
f3687f724f fix(core): update 2023-10-17 20:07:45 +02:00
5 changed files with 36 additions and 8 deletions

View File

@@ -1,6 +1,6 @@
{ {
"name": "@design.estate/dees-catalog", "name": "@design.estate/dees-catalog",
"version": "1.0.221", "version": "1.0.222",
"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",

View File

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

View File

@@ -6,16 +6,18 @@ import { DeesInputText } from './dees-input-text.js';
import { DeesInputQuantitySelector } from './dees-input-quantityselector.js'; import { DeesInputQuantitySelector } from './dees-input-quantityselector.js';
import { DeesInputRadio } from './dees-input-radio.js'; import { DeesInputRadio } from './dees-input-radio.js';
import { DeesFormSubmit } from './dees-form-submit.js'; import { DeesFormSubmit } from './dees-form-submit.js';
import { DeesTable } from './dees-table.js';
// Unified set for form input types // Unified set for form input types
const FORM_INPUT_TYPES = [ const FORM_INPUT_TYPES = [
DeesInputCheckbox, DeesInputCheckbox,
DeesInputText, DeesInputText,
DeesInputQuantitySelector, DeesInputQuantitySelector,
DeesInputRadio DeesInputRadio,
DeesTable,
]; ];
export type TFormInputElement = DeesInputCheckbox | DeesInputText | DeesInputQuantitySelector | DeesInputRadio; export type TFormInputElement = DeesInputCheckbox | DeesInputText | DeesInputQuantitySelector | DeesInputRadio | DeesTable<any>;
declare global { declare global {
interface HTMLElementTagNameMap { interface HTMLElementTagNameMap {
@@ -102,7 +104,7 @@ export class DeesForm extends DeesElement {
public async collectFormData() { public async collectFormData() {
const children = this.getFormElements(); const children = this.getFormElements();
const valueObject: { [key: string]: string | number | boolean } = {}; const valueObject: { [key: string]: string | number | boolean | any [] } = {};
for (const child of children) { for (const child of children) {
if (!child.key) { if (!child.key) {
console.log(`form element with label "${child.label}" has no key. skipping.`); console.log(`form element with label "${child.label}" has no key. skipping.`);

View File

@@ -16,7 +16,6 @@ export class DeesInputText extends DeesElement {
// INSTANCE // INSTANCE
public changeSubject = new domtools.rxjs.Subject<DeesInputText>(); public changeSubject = new domtools.rxjs.Subject<DeesInputText>();
public valueChangeSubject = new domtools.rxjs.Subject<string>();
@property({ @property({
type: String type: String
@@ -143,7 +142,6 @@ export class DeesInputText extends DeesElement {
const target: any = eventArg.target; const target: any = eventArg.target;
this.value = target.value; this.value = target.value;
this.changeSubject.next(this); this.changeSubject.next(this);
this.valueChangeSubject.next(this.value);
} }
public async freeze() { public async freeze() {

View File

@@ -88,6 +88,34 @@ export class DeesTable<T> extends DeesElement {
}) })
public data: T[] = []; public data: T[] = [];
// dees-form compatibility -----------------------------------------
@property({
type: String,
})
public key: string;
@property({
type: String,
})
public label: string;
@property({
type: Boolean,
})
public disabled: boolean = false;
@property({
type: Boolean,
})
public required: boolean = false;
get value() {
return this.data;
}
set value(valueArg) {}
public changeSubject = new domtools.rxjs.Subject<DeesTable<T>>();
// end dees-form compatibility -----------------------------------------
@property({ @property({
type: String, type: String,
reflect: true, reflect: true,
@@ -335,7 +363,7 @@ export class DeesTable<T> extends DeesElement {
<!-- the heading part --> <!-- the heading part -->
<div class="header"> <div class="header">
<div class="headingContainer"> <div class="headingContainer">
<div class="heading heading1">${this.heading1}</div> <div class="heading heading1">${this.label || this.heading1}</div>
<div class="heading heading2">${this.heading2}</div> <div class="heading heading2">${this.heading2}</div>
</div> </div>
<div class="headerActions"> <div class="headerActions">