bank20baht-ui 0.2.2 → 0.2.3
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.
|
@@ -40,5 +40,5 @@ export declare abstract class BahtFieldBase extends BahtElement {
|
|
|
40
40
|
protected get describedBy(): string | typeof nothing;
|
|
41
41
|
/** 'true' while the field is in error, else absent (styles hook on [aria-invalid]). */
|
|
42
42
|
protected get invalid(): string | typeof nothing;
|
|
43
|
-
protected render(): TemplateResult;
|
|
43
|
+
protected render(): TemplateResult | typeof nothing;
|
|
44
44
|
}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { TemplateResult } from 'lit';
|
|
1
|
+
import { nothing, TemplateResult } from 'lit';
|
|
2
2
|
import { BahtElement } from '../base.js';
|
|
3
3
|
import { FieldDescriptor } from '../../core/types.js';
|
|
4
4
|
/** Section divider (`type: "section"`): heading + rule, no value, no emits. */
|
|
5
5
|
export declare class BahtSection extends BahtElement {
|
|
6
6
|
field: FieldDescriptor;
|
|
7
|
-
protected render(): TemplateResult;
|
|
7
|
+
protected render(): TemplateResult | typeof nothing;
|
|
8
8
|
}
|
|
9
9
|
declare global {
|
|
10
10
|
interface HTMLElementTagNameMap {
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { TemplateResult } from 'lit';
|
|
1
|
+
import { nothing, TemplateResult } from 'lit';
|
|
2
2
|
import { BahtElement } from '../base.js';
|
|
3
3
|
import { FieldDescriptor } from '../../core/types.js';
|
|
4
4
|
/** Static text block (`type: "label"`): no value, no emits. */
|
|
5
5
|
export declare class BahtText extends BahtElement {
|
|
6
6
|
field: FieldDescriptor;
|
|
7
|
-
protected render(): TemplateResult;
|
|
7
|
+
protected render(): TemplateResult | typeof nothing;
|
|
8
8
|
}
|
package/dist/index.js
CHANGED
|
@@ -66,12 +66,12 @@ class g extends c {
|
|
|
66
66
|
return this.error ? "true" : h;
|
|
67
67
|
}
|
|
68
68
|
render() {
|
|
69
|
-
return n`
|
|
69
|
+
return this.field ? n`
|
|
70
70
|
${this.renderLabel()}
|
|
71
71
|
${this.renderControl()}
|
|
72
72
|
${this.field.help ? n`<div class="baht-help" id=${this.helpId}>${this.field.help}</div>` : h}
|
|
73
73
|
${this.error ? n`<div class="baht-error" id=${this.errorId} role="alert">${this.error}</div>` : h}
|
|
74
|
-
|
|
74
|
+
` : h;
|
|
75
75
|
}
|
|
76
76
|
}
|
|
77
77
|
et([
|
|
@@ -1891,6 +1891,7 @@ var Es = Object.defineProperty, Bs = Object.getOwnPropertyDescriptor, ae = (t, e
|
|
|
1891
1891
|
};
|
|
1892
1892
|
let It = class extends c {
|
|
1893
1893
|
render() {
|
|
1894
|
+
if (!this.field) return h;
|
|
1894
1895
|
const t = this.field.variant ?? "body";
|
|
1895
1896
|
return n`<div class="baht-text baht-text--${t}">${this.field.text ?? this.field.label ?? ""}</div>`;
|
|
1896
1897
|
}
|
|
@@ -1908,9 +1909,9 @@ var js = Object.defineProperty, Ss = Object.getOwnPropertyDescriptor, ie = (t, e
|
|
|
1908
1909
|
};
|
|
1909
1910
|
let qt = class extends c {
|
|
1910
1911
|
render() {
|
|
1911
|
-
return n`<div class="baht-section">
|
|
1912
|
+
return this.field ? n`<div class="baht-section">
|
|
1912
1913
|
<span class="baht-section-label">${this.field.text ?? this.field.label ?? ""}</span>
|
|
1913
|
-
</div
|
|
1914
|
+
</div>` : h;
|
|
1914
1915
|
}
|
|
1915
1916
|
};
|
|
1916
1917
|
ie([
|
package/dist/web-types.json
CHANGED