@design.estate/dees-catalog 1.0.225 → 1.0.227
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_bundle/bundle.js +313 -228
- package/dist_bundle/bundle.js.map +4 -4
- package/dist_ts_web/00_commitinfo_data.js +1 -1
- package/dist_ts_web/elements/dees-form.d.ts +2 -1
- package/dist_ts_web/elements/dees-form.demo.d.ts +1 -0
- package/dist_ts_web/elements/dees-form.demo.js +34 -0
- package/dist_ts_web/elements/dees-form.js +8 -20
- package/dist_ts_web/elements/dees-input-checkbox.js +2 -2
- package/dist_ts_web/elements/dees-input-dropdown.js +2 -2
- package/dist_ts_web/elements/dees-input-fileupload.d.ts +1 -2
- package/dist_ts_web/elements/dees-input-fileupload.js +3 -4
- package/dist_ts_web/elements/dees-input-iban.d.ts +15 -0
- package/dist_ts_web/elements/dees-input-iban.demo.d.ts +1 -0
- package/dist_ts_web/elements/dees-input-iban.demo.js +3 -0
- package/dist_ts_web/elements/dees-input-iban.js +113 -0
- package/dist_ts_web/elements/dees-input-phone.d.ts +10 -0
- package/dist_ts_web/elements/dees-input-phone.demo.d.ts +1 -0
- package/dist_ts_web/elements/dees-input-phone.demo.js +3 -0
- package/dist_ts_web/elements/dees-input-phone.js +20 -0
- package/dist_ts_web/elements/dees-input-quantityselector.js +2 -2
- package/dist_ts_web/elements/dees-input-radio.js +2 -2
- package/dist_ts_web/elements/dees-input-searchselect.d.ts +1 -0
- package/dist_ts_web/elements/dees-input-searchselect.js +2 -0
- package/dist_ts_web/elements/dees-input-tags.d.ts +1 -0
- package/dist_ts_web/elements/dees-input-tags.js +2 -0
- package/dist_ts_web/elements/dees-input-text.d.ts +6 -1
- package/dist_ts_web/elements/dees-input-text.js +141 -72
- package/dist_ts_web/elements/dees-table.js +2 -2
- package/dist_ts_web/elements/index.d.ts +2 -0
- package/dist_ts_web/elements/index.js +3 -1
- package/dist_watch/bundle.js +2183 -913
- package/dist_watch/bundle.js.map +4 -4
- package/package.json +8 -6
- package/ts_web/00_commitinfo_data.ts +1 -1
- package/ts_web/elements/dees-form.demo.ts +35 -0
- package/ts_web/elements/dees-form.ts +23 -24
- package/ts_web/elements/dees-input-checkbox.ts +1 -1
- package/ts_web/elements/dees-input-dropdown.ts +1 -1
- package/ts_web/elements/dees-input-fileupload.ts +2 -3
- package/ts_web/elements/dees-input-iban.demo.ts +3 -0
- package/ts_web/elements/dees-input-iban.ts +98 -0
- package/ts_web/elements/dees-input-phone.demo.ts +3 -0
- package/ts_web/elements/dees-input-phone.ts +29 -0
- package/ts_web/elements/dees-input-quantityselector.ts +1 -1
- package/ts_web/elements/dees-input-radio.ts +1 -1
- package/ts_web/elements/dees-input-searchselect.ts +0 -0
- package/ts_web/elements/dees-input-tags.ts +0 -0
- package/ts_web/elements/dees-input-text.ts +154 -77
- package/ts_web/elements/dees-table.ts +1 -1
- package/ts_web/elements/index.ts +2 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@design.estate/dees-catalog",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.227",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "website for lossless.com",
|
|
6
6
|
"main": "dist_ts_web/index.js",
|
|
@@ -15,17 +15,19 @@
|
|
|
15
15
|
"author": "Lossless GmbH",
|
|
16
16
|
"license": "MIT",
|
|
17
17
|
"dependencies": {
|
|
18
|
-
"@design.estate/dees-domtools": "^2.0.
|
|
19
|
-
"@design.estate/dees-element": "^2.0.
|
|
18
|
+
"@design.estate/dees-domtools": "^2.0.55",
|
|
19
|
+
"@design.estate/dees-element": "^2.0.31",
|
|
20
20
|
"@design.estate/dees-wcctools": "^1.0.81",
|
|
21
21
|
"@fortawesome/fontawesome-svg-core": "^6.4.2",
|
|
22
22
|
"@fortawesome/free-brands-svg-icons": "^6.4.2",
|
|
23
23
|
"@fortawesome/free-regular-svg-icons": "^6.4.2",
|
|
24
24
|
"@fortawesome/free-solid-svg-icons": "^6.4.2",
|
|
25
|
+
"@push.rocks/smarti18n": "^1.0.4",
|
|
25
26
|
"@push.rocks/smartpromise": "^4.0.3",
|
|
26
27
|
"@push.rocks/smartstring": "^4.0.9",
|
|
27
|
-
"@tsclass/tsclass": "^4.0.
|
|
28
|
-
"highlight.js": "11.
|
|
28
|
+
"@tsclass/tsclass": "^4.0.46",
|
|
29
|
+
"highlight.js": "11.9.0",
|
|
30
|
+
"ibantools": "^4.3.5",
|
|
29
31
|
"pdfjs-dist": "^3.11.174"
|
|
30
32
|
},
|
|
31
33
|
"devDependencies": {
|
|
@@ -35,7 +37,7 @@
|
|
|
35
37
|
"@gitzone/tswatch": "^2.0.7",
|
|
36
38
|
"@push.rocks/projectinfo": "^5.0.2",
|
|
37
39
|
"@push.rocks/tapbundle": "^5.0.15",
|
|
38
|
-
"@types/node": "^20.8.
|
|
40
|
+
"@types/node": "^20.8.7"
|
|
39
41
|
},
|
|
40
42
|
"files": [
|
|
41
43
|
"ts/**/*",
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { html, domtools } from '@design.estate/dees-element';
|
|
2
|
+
import type { DeesForm } from './dees-form.js';
|
|
3
|
+
|
|
4
|
+
export const demoFunc = () => html`
|
|
5
|
+
<style>
|
|
6
|
+
.demoContainer {
|
|
7
|
+
max-width: 400px;
|
|
8
|
+
margin: auto;
|
|
9
|
+
padding: 16px;
|
|
10
|
+
background: #111;
|
|
11
|
+
}
|
|
12
|
+
</style>
|
|
13
|
+
<div class="demoContainer">
|
|
14
|
+
<dees-form
|
|
15
|
+
style="display: block; margin:auto; max-width: 500px; padding: 20px"
|
|
16
|
+
@formData=${async (eventArg) => {
|
|
17
|
+
const form: DeesForm = eventArg.currentTarget;
|
|
18
|
+
form.setStatus('pending', 'authenticating...');
|
|
19
|
+
await domtools.plugins.smartdelay.delayFor(1000);
|
|
20
|
+
form.setStatus('success', 'authenticated!');
|
|
21
|
+
}}
|
|
22
|
+
>
|
|
23
|
+
<dees-input-text .required="${true}" key="hello1" label="a text"></dees-input-text>
|
|
24
|
+
<dees-input-text .required="${true}" key="hello2" label="also a text"></dees-input-text>
|
|
25
|
+
<dees-input-text .required="${true}" key="hello3" label="a password" isPasswordBool></dees-input-text>
|
|
26
|
+
<dees-input-checkbox
|
|
27
|
+
.required="${true}"
|
|
28
|
+
key="hello3"
|
|
29
|
+
label="another text"
|
|
30
|
+
></dees-input-checkbox>
|
|
31
|
+
<dees-input-iban></dees-input-iban>
|
|
32
|
+
<dees-form-submit>Submit</dees-form-submit>
|
|
33
|
+
</dees-form>
|
|
34
|
+
</div>
|
|
35
|
+
`;
|
|
@@ -1,4 +1,10 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import {
|
|
2
|
+
customElement,
|
|
3
|
+
html,
|
|
4
|
+
type TemplateResult,
|
|
5
|
+
DeesElement,
|
|
6
|
+
type CSSResult,
|
|
7
|
+
} from '@design.estate/dees-element';
|
|
2
8
|
import * as domtools from '@design.estate/dees-domtools';
|
|
3
9
|
|
|
4
10
|
import { DeesInputCheckbox } from './dees-input-checkbox.js';
|
|
@@ -7,17 +13,26 @@ import { DeesInputQuantitySelector } from './dees-input-quantityselector.js';
|
|
|
7
13
|
import { DeesInputRadio } from './dees-input-radio.js';
|
|
8
14
|
import { DeesFormSubmit } from './dees-form-submit.js';
|
|
9
15
|
import { DeesTable } from './dees-table.js';
|
|
16
|
+
import { demoFunc } from './dees-form.demo.js';
|
|
17
|
+
import { DeesInputIban } from './dees-input-iban.js';
|
|
10
18
|
|
|
11
19
|
// Unified set for form input types
|
|
12
20
|
const FORM_INPUT_TYPES = [
|
|
13
21
|
DeesInputCheckbox,
|
|
22
|
+
DeesInputIban,
|
|
14
23
|
DeesInputText,
|
|
15
24
|
DeesInputQuantitySelector,
|
|
16
25
|
DeesInputRadio,
|
|
17
26
|
DeesTable,
|
|
18
27
|
];
|
|
19
28
|
|
|
20
|
-
export type TFormInputElement =
|
|
29
|
+
export type TFormInputElement =
|
|
30
|
+
| DeesInputCheckbox
|
|
31
|
+
| DeesInputIban
|
|
32
|
+
| DeesInputText
|
|
33
|
+
| DeesInputQuantitySelector
|
|
34
|
+
| DeesInputRadio
|
|
35
|
+
| DeesTable<any>;
|
|
21
36
|
|
|
22
37
|
declare global {
|
|
23
38
|
interface HTMLElementTagNameMap {
|
|
@@ -27,26 +42,10 @@ declare global {
|
|
|
27
42
|
|
|
28
43
|
@customElement('dees-form')
|
|
29
44
|
export class DeesForm extends DeesElement {
|
|
30
|
-
|
|
31
|
-
public static demo = () => html`
|
|
32
|
-
<dees-form
|
|
33
|
-
style="display: block; margin:auto; max-width: 500px; padding: 20px"
|
|
34
|
-
@formData=${async (eventArg) => {
|
|
35
|
-
const form: DeesForm = eventArg.currentTarget;
|
|
36
|
-
form.setStatus('pending', 'authenticating...');
|
|
37
|
-
await domtools.plugins.smartdelay.delayFor(1000);
|
|
38
|
-
form.setStatus('success', 'authenticated!');
|
|
39
|
-
}}
|
|
40
|
-
>
|
|
41
|
-
<dees-input-text .required="${true}" key="hello1" label="a text"></dees-input-text>
|
|
42
|
-
<dees-input-text .required="${true}" key="hello2" label="also a text"></dees-input-text>
|
|
43
|
-
<dees-input-checkbox .required="${true}" key="hello3" label="another text"></dees-input-checkbox>
|
|
44
|
-
<dees-form-submit>Submit</dees-form-submit>
|
|
45
|
-
</dees-form>
|
|
46
|
-
`;
|
|
45
|
+
public static demo = demoFunc;
|
|
47
46
|
|
|
48
47
|
public name: string = 'myform';
|
|
49
|
-
public changeSubject = new domtools.rxjs.Subject();
|
|
48
|
+
public changeSubject = new domtools.plugins.smartrx.rxjs.Subject();
|
|
50
49
|
public readyDeferred = domtools.plugins.smartpromise.defer();
|
|
51
50
|
|
|
52
51
|
public render(): TemplateResult {
|
|
@@ -77,14 +76,14 @@ export class DeesForm extends DeesElement {
|
|
|
77
76
|
}
|
|
78
77
|
|
|
79
78
|
public getFormElements(): Array<TFormInputElement> {
|
|
80
|
-
return
|
|
79
|
+
return Array.from(this.children).filter((child) =>
|
|
81
80
|
FORM_INPUT_TYPES.includes(child.constructor as any)
|
|
82
81
|
) as unknown as TFormInputElement[];
|
|
83
82
|
}
|
|
84
83
|
|
|
85
84
|
public getSubmitButton(): DeesFormSubmit | undefined {
|
|
86
|
-
return Array.from(this.children).find(
|
|
87
|
-
child instanceof DeesFormSubmit
|
|
85
|
+
return Array.from(this.children).find(
|
|
86
|
+
(child) => child instanceof DeesFormSubmit
|
|
88
87
|
) as DeesFormSubmit;
|
|
89
88
|
}
|
|
90
89
|
|
|
@@ -104,7 +103,7 @@ export class DeesForm extends DeesElement {
|
|
|
104
103
|
|
|
105
104
|
public async collectFormData() {
|
|
106
105
|
const children = this.getFormElements();
|
|
107
|
-
const valueObject: { [key: string]: string | number | boolean | any
|
|
106
|
+
const valueObject: { [key: string]: string | number | boolean | any[] } = {};
|
|
108
107
|
for (const child of children) {
|
|
109
108
|
if (!child.key) {
|
|
110
109
|
console.log(`form element with label "${child.label}" has no key. skipping.`);
|
|
@@ -22,7 +22,7 @@ export class DeesInputCheckbox extends DeesElement {
|
|
|
22
22
|
public static demo = () => html`<dees-input-checkbox></dees-input-checkbox>`;
|
|
23
23
|
|
|
24
24
|
// INSTANCE
|
|
25
|
-
public changeSubject = new domtools.rxjs.Subject();
|
|
25
|
+
public changeSubject = new domtools.plugins.smartrx.rxjs.Subject();
|
|
26
26
|
|
|
27
27
|
@property({
|
|
28
28
|
type: String,
|
|
@@ -8,10 +8,9 @@ import {
|
|
|
8
8
|
unsafeCSS,
|
|
9
9
|
cssManager,
|
|
10
10
|
type CSSResult,
|
|
11
|
+
domtools,
|
|
11
12
|
} from '@design.estate/dees-element';
|
|
12
13
|
|
|
13
|
-
import * as domtools from '@design.estate/dees-domtools';
|
|
14
|
-
|
|
15
14
|
declare global {
|
|
16
15
|
interface HTMLElementTagNameMap {
|
|
17
16
|
'dees-input-fileupload': DeesInputFileupload;
|
|
@@ -23,7 +22,7 @@ export class DeesInputFileupload extends DeesElement {
|
|
|
23
22
|
public static demo = () => html`<dees-input-fileupload .label=${'Attachments'}></dees-input-fileupload>`;
|
|
24
23
|
|
|
25
24
|
// INSTANCE
|
|
26
|
-
public changeSubject = new domtools.rxjs.Subject();
|
|
25
|
+
public changeSubject = new domtools.plugins.smartrx.rxjs.Subject();
|
|
27
26
|
|
|
28
27
|
@property({
|
|
29
28
|
type: String,
|
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
import {
|
|
2
|
+
customElement,
|
|
3
|
+
DeesElement,
|
|
4
|
+
type TemplateResult,
|
|
5
|
+
state,
|
|
6
|
+
html,
|
|
7
|
+
domtools,
|
|
8
|
+
property,
|
|
9
|
+
} from '@design.estate/dees-element';
|
|
10
|
+
|
|
11
|
+
import * as ibantools from 'ibantools';
|
|
12
|
+
import { demoFunc } from './dees-input-iban.demo.js';
|
|
13
|
+
|
|
14
|
+
@customElement('dees-input-iban')
|
|
15
|
+
export class DeesInputIban extends DeesElement {
|
|
16
|
+
// STATIC
|
|
17
|
+
public static demo = demoFunc;
|
|
18
|
+
|
|
19
|
+
// INSTANCE
|
|
20
|
+
@state()
|
|
21
|
+
enteredString: string = '';
|
|
22
|
+
|
|
23
|
+
@state()
|
|
24
|
+
enteredIbanIsValid: boolean = false;
|
|
25
|
+
|
|
26
|
+
@property({
|
|
27
|
+
type: Boolean,
|
|
28
|
+
})
|
|
29
|
+
public disabled = false;
|
|
30
|
+
|
|
31
|
+
@property({
|
|
32
|
+
type: Boolean,
|
|
33
|
+
})
|
|
34
|
+
public required = false;
|
|
35
|
+
|
|
36
|
+
@property({
|
|
37
|
+
type: String,
|
|
38
|
+
})
|
|
39
|
+
public label = '';
|
|
40
|
+
|
|
41
|
+
@property({
|
|
42
|
+
type: String,
|
|
43
|
+
})
|
|
44
|
+
public key = '';
|
|
45
|
+
|
|
46
|
+
@property({
|
|
47
|
+
type: String,
|
|
48
|
+
})
|
|
49
|
+
public value = '';
|
|
50
|
+
|
|
51
|
+
public changeSubject = new domtools.plugins.smartrx.rxjs.Subject<DeesInputIban>();
|
|
52
|
+
|
|
53
|
+
public render(): TemplateResult {
|
|
54
|
+
return html`
|
|
55
|
+
<style>
|
|
56
|
+
input[type='text'] {
|
|
57
|
+
line-height: 20px;
|
|
58
|
+
padding: 5px;
|
|
59
|
+
width: 250px;
|
|
60
|
+
}
|
|
61
|
+
</style>
|
|
62
|
+
<dees-input-text
|
|
63
|
+
.label=${'IBAN'}
|
|
64
|
+
.value=${this.value}
|
|
65
|
+
@input=${(eventArg: InputEvent) => {
|
|
66
|
+
this.validateIban(eventArg);
|
|
67
|
+
}}
|
|
68
|
+
></dees-input-text>
|
|
69
|
+
`;
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
public async firstUpdated() {
|
|
73
|
+
const deesInputText = this.shadowRoot.querySelector('dees-input-text');
|
|
74
|
+
deesInputText.disabled = this.disabled;
|
|
75
|
+
deesInputText.required = this.required;
|
|
76
|
+
deesInputText.changeSubject.subscribe(valueArg => {
|
|
77
|
+
this.value = valueArg.value;
|
|
78
|
+
this.changeSubject.next(this);
|
|
79
|
+
})
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
public async validateIban(eventArg: InputEvent): Promise<void> {
|
|
83
|
+
const inputElement: HTMLInputElement = eventArg.target as HTMLInputElement;
|
|
84
|
+
let enteredString = inputElement?.value;
|
|
85
|
+
enteredString = enteredString || '';
|
|
86
|
+
if (this.enteredString !== enteredString) {
|
|
87
|
+
this.enteredString = ibantools.friendlyFormatIBAN(enteredString) || '';
|
|
88
|
+
if (inputElement) {
|
|
89
|
+
inputElement.value = this.enteredString;
|
|
90
|
+
this.value = this.enteredString;
|
|
91
|
+
this.changeSubject.next(this);
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
this.enteredIbanIsValid = ibantools.isValidIBAN(this.enteredString.replace(/ /g, ''));
|
|
95
|
+
const deesInputText = this.shadowRoot.querySelector('dees-input-text');
|
|
96
|
+
deesInputText.validationText = `IBAN is valid: ${this.enteredIbanIsValid}`;
|
|
97
|
+
}
|
|
98
|
+
}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import {
|
|
2
|
+
customElement,
|
|
3
|
+
DeesElement,
|
|
4
|
+
type TemplateResult,
|
|
5
|
+
property,
|
|
6
|
+
html,
|
|
7
|
+
css,
|
|
8
|
+
unsafeCSS,
|
|
9
|
+
cssManager,
|
|
10
|
+
type CSSResult,
|
|
11
|
+
} from '@design.estate/dees-element';
|
|
12
|
+
import { demoFunc } from './dees-input-phone.demo.js';
|
|
13
|
+
|
|
14
|
+
declare global {
|
|
15
|
+
interface HTMLElementTagNameMap {
|
|
16
|
+
'dees-input-phone': DeesInputPhone;
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
@customElement('dees-input-phone')
|
|
21
|
+
export class DeesInputPhone extends DeesElement {
|
|
22
|
+
// STATIC
|
|
23
|
+
public static demo = demoFunc;
|
|
24
|
+
|
|
25
|
+
// INSTANCE
|
|
26
|
+
public render() {
|
|
27
|
+
return html`<div>Phone Input</div>`;
|
|
28
|
+
}
|
|
29
|
+
}
|
|
@@ -12,7 +12,7 @@ export class DeesInputQuantitySelector extends DeesElement {
|
|
|
12
12
|
public static demo = () => html`<dees-input-quantityselector></dees-input-quantityselector>`;
|
|
13
13
|
|
|
14
14
|
// INSTANCE
|
|
15
|
-
public changeSubject = new domtools.rxjs.Subject();
|
|
15
|
+
public changeSubject = new domtools.plugins.smartrx.rxjs.Subject();
|
|
16
16
|
|
|
17
17
|
@property()
|
|
18
18
|
public label: string = 'Label';
|
|
@@ -12,7 +12,7 @@ export class DeesInputRadio extends DeesElement {
|
|
|
12
12
|
public static demo = () => html`<dees-input-radio></dees-input-radio>`;
|
|
13
13
|
|
|
14
14
|
// INSTANCE
|
|
15
|
-
public changeSubject = new domtools.rxjs.Subject();
|
|
15
|
+
public changeSubject = new domtools.plugins.smartrx.rxjs.Subject();
|
|
16
16
|
|
|
17
17
|
@property({
|
|
18
18
|
type: String,
|
|
File without changes
|
|
File without changes
|
|
@@ -1,4 +1,13 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import {
|
|
2
|
+
customElement,
|
|
3
|
+
DeesElement,
|
|
4
|
+
type TemplateResult,
|
|
5
|
+
property,
|
|
6
|
+
html,
|
|
7
|
+
cssManager,
|
|
8
|
+
css,
|
|
9
|
+
type CSSResult,
|
|
10
|
+
} from '@design.estate/dees-element';
|
|
2
11
|
import * as domtools from '@design.estate/dees-domtools';
|
|
3
12
|
|
|
4
13
|
declare global {
|
|
@@ -15,10 +24,10 @@ export class DeesInputText extends DeesElement {
|
|
|
15
24
|
`;
|
|
16
25
|
|
|
17
26
|
// INSTANCE
|
|
18
|
-
public changeSubject = new domtools.rxjs.Subject<DeesInputText>();
|
|
27
|
+
public changeSubject = new domtools.plugins.smartrx.rxjs.Subject<DeesInputText>();
|
|
19
28
|
|
|
20
29
|
@property({
|
|
21
|
-
type: String
|
|
30
|
+
type: String,
|
|
22
31
|
})
|
|
23
32
|
public label: string;
|
|
24
33
|
|
|
@@ -35,12 +44,12 @@ export class DeesInputText extends DeesElement {
|
|
|
35
44
|
public value: string = '';
|
|
36
45
|
|
|
37
46
|
@property({
|
|
38
|
-
type: Boolean
|
|
47
|
+
type: Boolean,
|
|
39
48
|
})
|
|
40
49
|
public required: boolean = false;
|
|
41
50
|
|
|
42
51
|
@property({
|
|
43
|
-
type: Boolean
|
|
52
|
+
type: Boolean,
|
|
44
53
|
})
|
|
45
54
|
public disabled: boolean = false;
|
|
46
55
|
|
|
@@ -56,88 +65,156 @@ export class DeesInputText extends DeesElement {
|
|
|
56
65
|
})
|
|
57
66
|
public showPasswordBool = false;
|
|
58
67
|
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
}
|
|
65
|
-
|
|
66
|
-
:host {
|
|
67
|
-
position: relative;
|
|
68
|
-
display: grid;
|
|
69
|
-
margin: 10px 0px;
|
|
70
|
-
margin-bottom: 24px;
|
|
71
|
-
}
|
|
72
|
-
|
|
73
|
-
.maincontainer {
|
|
74
|
-
color: ${this.goBright ? '#333' : '#ccc'};
|
|
75
|
-
}
|
|
68
|
+
@property({
|
|
69
|
+
type: Boolean,
|
|
70
|
+
reflect: true,
|
|
71
|
+
})
|
|
72
|
+
public validationState: 'valid' | 'warn' | 'invalid';
|
|
76
73
|
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
74
|
+
@property({
|
|
75
|
+
reflect: true,
|
|
76
|
+
})
|
|
77
|
+
public validationText: string = '';
|
|
78
|
+
|
|
79
|
+
@property({})
|
|
80
|
+
validationFunction: (value: string) => boolean;
|
|
81
|
+
|
|
82
|
+
public static styles = [
|
|
83
|
+
cssManager.defaultStyles,
|
|
84
|
+
css`
|
|
85
|
+
* {
|
|
86
|
+
box-sizing: border-box;
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
:host {
|
|
90
|
+
position: relative;
|
|
91
|
+
display: grid;
|
|
92
|
+
margin: 8px 0px;
|
|
93
|
+
margin-bottom: 24px;
|
|
94
|
+
z-index: auto;
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
.maincontainer {
|
|
98
|
+
color: ${cssManager.bdTheme('#333', '#ccc')};
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
.label {
|
|
102
|
+
font-size: 14px;
|
|
103
|
+
margin-bottom: 4px;
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
input {
|
|
107
|
+
margin-top: 5px;
|
|
108
|
+
background: ${cssManager.bdTheme('#fafafa', '#222')};
|
|
109
|
+
border-top: ${cssManager.bdTheme('1px solid #CCC', '1px solid #444')};
|
|
110
|
+
border-bottom: ${cssManager.bdTheme('1px solid #CCC', '1px solid #333')};
|
|
111
|
+
border-right: ${cssManager.bdTheme('1px solid #CCC', 'none')};
|
|
112
|
+
border-left: ${cssManager.bdTheme('1px solid #CCC', 'none')};
|
|
113
|
+
padding-left: 10px;
|
|
114
|
+
padding-right: 10px;
|
|
115
|
+
border-radius: 2px;
|
|
116
|
+
width: 100%;
|
|
117
|
+
line-height: 36px;
|
|
118
|
+
transition: all 0.2s;
|
|
119
|
+
outline: none;
|
|
120
|
+
font-size: 16px;
|
|
121
|
+
position: relative;
|
|
122
|
+
z-index: 2;
|
|
123
|
+
// see template for more
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
input:disabled {
|
|
127
|
+
background: ${cssManager.bdTheme('#ffffff00', '#11111100')};
|
|
128
|
+
border: 1px dashed ${cssManager.bdTheme('#666666', '#666666')};
|
|
129
|
+
color: #9b9b9e;
|
|
130
|
+
cursor: default;
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
input:focus {
|
|
134
|
+
outline: none;
|
|
135
|
+
border-bottom: 1px solid #e4002b;
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
.showPassword {
|
|
139
|
+
position: absolute;
|
|
140
|
+
bottom: 7px;
|
|
141
|
+
right: 10px;
|
|
142
|
+
border: 1px dashed #444;
|
|
143
|
+
border-radius: 7px;
|
|
144
|
+
padding: 4px 0px;
|
|
145
|
+
width: 40px;
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
.showPassword:hover {
|
|
149
|
+
cursor: pointer;
|
|
150
|
+
background: ${cssManager.bdTheme('#00000010', '#ffffff10')};
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
.validationContainer {
|
|
154
|
+
text-align: center;
|
|
155
|
+
padding: 6px 2px 2px 2px;
|
|
156
|
+
margin-top: -4px;
|
|
157
|
+
font-size: 12px;
|
|
158
|
+
color: #fff;
|
|
159
|
+
background: #e4002b;
|
|
160
|
+
position: relative;
|
|
161
|
+
z-index: 1;
|
|
162
|
+
border-radius: 3px;
|
|
163
|
+
transition: all 0.2s;
|
|
164
|
+
}
|
|
165
|
+
`,
|
|
166
|
+
];
|
|
81
167
|
|
|
168
|
+
public render(): TemplateResult {
|
|
169
|
+
return html`
|
|
170
|
+
<style>
|
|
82
171
|
input {
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
border-top: ${this.goBright ? '1px solid #CCC' : '1px solid #444'};
|
|
86
|
-
border-bottom: ${this.goBright ? '1px solid #CCC' : '1px solid #333'};
|
|
87
|
-
border-right: ${this.goBright ? '1px solid #CCC' : 'none'};
|
|
88
|
-
border-left: ${this.goBright ? '1px solid #CCC' : 'none'};
|
|
89
|
-
padding-left:10px;
|
|
90
|
-
padding-right: 10px;
|
|
91
|
-
border-radius: 2px;
|
|
92
|
-
width: 100%;
|
|
93
|
-
line-height: 48px;
|
|
94
|
-
transition: all 0.2s;
|
|
95
|
-
outline: none;
|
|
96
|
-
font-size: 16px;
|
|
97
|
-
font-family: ${this.isPasswordBool ? 'monospace': 'Inter'};
|
|
98
|
-
letter-spacing: ${this.isPasswordBool ? '1px': 'normal'};
|
|
172
|
+
font-family: ${this.isPasswordBool ? 'monospace' : 'Inter'};
|
|
173
|
+
letter-spacing: ${this.isPasswordBool ? '1px' : 'normal'};
|
|
99
174
|
color: ${this.goBright ? '#333' : '#ccc'};
|
|
100
175
|
}
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
}
|
|
113
|
-
|
|
114
|
-
.showPassword {
|
|
115
|
-
position: absolute;
|
|
116
|
-
bottom: 8px;
|
|
117
|
-
right: 10px;
|
|
118
|
-
border: 1px dashed #444;
|
|
119
|
-
border-radius: 7px;
|
|
120
|
-
padding: 8px 0px;
|
|
121
|
-
width: 40px;
|
|
122
|
-
}
|
|
123
|
-
|
|
124
|
-
.showPassword:hover {
|
|
125
|
-
cursor: pointer;
|
|
126
|
-
background: ${cssManager.bdTheme('#00000010', '#ffffff10')};
|
|
127
|
-
}
|
|
176
|
+
${this.validationText ? css`
|
|
177
|
+
.validationContainer {
|
|
178
|
+
height: 22px;
|
|
179
|
+
opacity: 1;
|
|
180
|
+
}
|
|
181
|
+
` : css`
|
|
182
|
+
.validationContainer {
|
|
183
|
+
height: 4px;
|
|
184
|
+
padding: 2px !important;
|
|
185
|
+
opacity: 0;
|
|
186
|
+
}
|
|
187
|
+
`}
|
|
128
188
|
</style>
|
|
129
189
|
<div class="maincontainer">
|
|
130
190
|
${this.label ? html`<div class="label">${this.label}</div>` : html``}
|
|
131
|
-
<input
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
191
|
+
<input
|
|
192
|
+
type="${this.isPasswordBool && !this.showPasswordBool ? 'password' : 'text'}"
|
|
193
|
+
.value=${this.value}
|
|
194
|
+
@input="${this.updateValue}"
|
|
195
|
+
.disabled=${this.disabled}
|
|
196
|
+
/>
|
|
197
|
+
<div class="validationContainer">
|
|
198
|
+
${this.validationText}
|
|
199
|
+
</div>
|
|
200
|
+
${this.isPasswordBool
|
|
201
|
+
? html`
|
|
202
|
+
<div class="showPassword" @click=${this.togglePasswordView}>
|
|
203
|
+
<dees-icon .iconFA=${this.showPasswordBool ? 'eye' : 'eyeSlash'}></dees-icon>
|
|
204
|
+
</div>
|
|
205
|
+
`
|
|
206
|
+
: html``}
|
|
137
207
|
</div>
|
|
138
208
|
`;
|
|
139
209
|
}
|
|
140
210
|
|
|
211
|
+
firstUpdated() {
|
|
212
|
+
const input = this.shadowRoot.querySelector('input');
|
|
213
|
+
input.addEventListener('input', (eventArg: InputEvent) => {
|
|
214
|
+
|
|
215
|
+
});
|
|
216
|
+
}
|
|
217
|
+
|
|
141
218
|
public async updateValue(eventArg: Event) {
|
|
142
219
|
const target: any = eventArg.target;
|
|
143
220
|
this.value = target.value;
|
|
@@ -152,10 +229,10 @@ export class DeesInputText extends DeesElement {
|
|
|
152
229
|
this.disabled = false;
|
|
153
230
|
}
|
|
154
231
|
|
|
155
|
-
public async togglePasswordView
|
|
232
|
+
public async togglePasswordView() {
|
|
156
233
|
const domtools = await this.domtoolsPromise;
|
|
157
234
|
this.showPasswordBool = !this.showPasswordBool;
|
|
158
|
-
console.log(`this.showPasswordBool is: ${this.showPasswordBool}`)
|
|
235
|
+
console.log(`this.showPasswordBool is: ${this.showPasswordBool}`);
|
|
159
236
|
}
|
|
160
237
|
|
|
161
238
|
public async focus() {
|
|
@@ -113,7 +113,7 @@ export class DeesTable<T> extends DeesElement {
|
|
|
113
113
|
return this.data;
|
|
114
114
|
}
|
|
115
115
|
set value(valueArg) {}
|
|
116
|
-
public changeSubject = new domtools.rxjs.Subject<DeesTable<T>>();
|
|
116
|
+
public changeSubject = new domtools.plugins.smartrx.rxjs.Subject<DeesTable<T>>();
|
|
117
117
|
// end dees-form compatibility -----------------------------------------
|
|
118
118
|
|
|
119
119
|
@property({
|