godown 3.2.0 → 3.4.0
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/build/godown+lit.iife.js +12 -12
- package/build/godown+lit.iife.js.map +1 -1
- package/build/godown+lit.js +12 -12
- package/build/godown+lit.js.map +1 -1
- package/build/godown+lit.umd.js +12 -12
- package/build/godown+lit.umd.js.map +1 -1
- package/build/godown.iife.js +10 -10
- package/build/godown.js +10 -10
- package/build/godown.js.map +1 -1
- package/build/godown.umd.js +10 -10
- package/build/godown.umd.js.map +1 -1
- package/components/alert.d.ts +1 -3
- package/components/alert.d.ts.map +1 -1
- package/components/alert.js +1 -1
- package/components/alert.js.map +1 -1
- package/components/avatar.d.ts +5 -4
- package/components/avatar.d.ts.map +1 -1
- package/components/avatar.js +1 -1
- package/components/avatar.js.map +1 -1
- package/components/badge.d.ts +10 -2
- package/components/badge.d.ts.map +1 -1
- package/components/badge.js.map +1 -1
- package/components/breath.d.ts +2 -3
- package/components/breath.d.ts.map +1 -1
- package/components/breath.js +1 -1
- package/components/breath.js.map +1 -1
- package/components/button.d.ts +8 -3
- package/components/button.d.ts.map +1 -1
- package/components/button.js +1 -1
- package/components/button.js.map +1 -1
- package/components/card.d.ts +6 -0
- package/components/card.d.ts.map +1 -1
- package/components/card.js +1 -1
- package/components/card.js.map +1 -1
- package/components/carousel.d.ts +7 -13
- package/components/carousel.d.ts.map +1 -1
- package/components/carousel.js +1 -1
- package/components/carousel.js.map +1 -1
- package/components/details.d.ts +3 -3
- package/components/details.d.ts.map +1 -1
- package/components/dialog.d.ts +9 -6
- package/components/dialog.d.ts.map +1 -1
- package/components/dialog.js +1 -1
- package/components/dialog.js.map +1 -1
- package/components/divider.d.ts +1 -1
- package/components/heading.d.ts +2 -0
- package/components/heading.d.ts.map +1 -1
- package/components/heading.js.map +1 -1
- package/components/input.d.ts +2 -2
- package/components/input.d.ts.map +1 -1
- package/components/input.js +1 -1
- package/components/input.js.map +1 -1
- package/components/link.d.ts +1 -1
- package/components/link.d.ts.map +1 -1
- package/components/link.js +1 -1
- package/components/link.js.map +1 -1
- package/components/progress.d.ts +0 -7
- package/components/progress.d.ts.map +1 -1
- package/components/progress.js +1 -1
- package/components/progress.js.map +1 -1
- package/components/range.d.ts +48 -19
- package/components/range.d.ts.map +1 -1
- package/components/range.js +1 -1
- package/components/range.js.map +1 -1
- package/components/rotate.d.ts +6 -4
- package/components/rotate.d.ts.map +1 -1
- package/components/rotate.js.map +1 -1
- package/components/router.d.ts.map +1 -1
- package/components/router.js +1 -1
- package/components/router.js.map +1 -1
- package/components/select.d.ts +4 -2
- package/components/select.d.ts.map +1 -1
- package/components/select.js +1 -1
- package/components/select.js.map +1 -1
- package/components/split.d.ts +2 -1
- package/components/split.d.ts.map +1 -1
- package/components/split.js +1 -1
- package/components/split.js.map +1 -1
- package/components/switch.d.ts +5 -7
- package/components/switch.d.ts.map +1 -1
- package/components/switch.js +1 -1
- package/components/switch.js.map +1 -1
- package/components/text.js +1 -1
- package/components/text.js.map +1 -1
- package/components/time.d.ts +2 -5
- package/components/time.d.ts.map +1 -1
- package/components/time.js +1 -1
- package/components/time.js.map +1 -1
- package/components/tooltip.d.ts +3 -2
- package/components/tooltip.d.ts.map +1 -1
- package/components/tooltip.js +1 -1
- package/components/tooltip.js.map +1 -1
- package/components/typewriter.d.ts.map +1 -1
- package/components/typewriter.js +1 -1
- package/components/typewriter.js.map +1 -1
- package/core/direction.d.ts +27 -0
- package/core/direction.d.ts.map +1 -0
- package/core/direction.js +2 -0
- package/core/direction.js.map +1 -0
- package/core/global-style.d.ts +1 -2
- package/core/global-style.d.ts.map +1 -1
- package/core/global-style.js +1 -1
- package/core/global-style.js.map +1 -1
- package/core/outline.d.ts +20 -0
- package/core/outline.d.ts.map +1 -0
- package/core/outline.js +2 -0
- package/core/outline.js.map +1 -0
- package/core/super-anchor.d.ts +2 -2
- package/core/super-anchor.d.ts.map +1 -1
- package/core/super-anchor.js +1 -1
- package/core/super-anchor.js.map +1 -1
- package/core/super-input.d.ts +2 -0
- package/core/super-input.d.ts.map +1 -1
- package/core/super-input.js +1 -1
- package/core/super-input.js.map +1 -1
- package/core/super-openable.d.ts +0 -4
- package/core/super-openable.d.ts.map +1 -1
- package/custom-elements.json +1 -1
- package/dev/components/alert.d.ts +1 -3
- package/dev/components/alert.d.ts.map +1 -1
- package/dev/components/alert.js +33 -57
- package/dev/components/alert.js.map +1 -1
- package/dev/components/avatar.d.ts +5 -4
- package/dev/components/avatar.d.ts.map +1 -1
- package/dev/components/avatar.js +5 -4
- package/dev/components/avatar.js.map +1 -1
- package/dev/components/badge.d.ts +10 -2
- package/dev/components/badge.d.ts.map +1 -1
- package/dev/components/badge.js +8 -0
- package/dev/components/badge.js.map +1 -1
- package/dev/components/breath.d.ts +2 -3
- package/dev/components/breath.d.ts.map +1 -1
- package/dev/components/breath.js +3 -14
- package/dev/components/breath.js.map +1 -1
- package/dev/components/button.d.ts +8 -3
- package/dev/components/button.d.ts.map +1 -1
- package/dev/components/button.js +19 -5
- package/dev/components/button.js.map +1 -1
- package/dev/components/card.d.ts +6 -0
- package/dev/components/card.d.ts.map +1 -1
- package/dev/components/card.js +11 -11
- package/dev/components/card.js.map +1 -1
- package/dev/components/carousel.d.ts +7 -13
- package/dev/components/carousel.d.ts.map +1 -1
- package/dev/components/carousel.js +40 -39
- package/dev/components/carousel.js.map +1 -1
- package/dev/components/details.d.ts +3 -3
- package/dev/components/details.d.ts.map +1 -1
- package/dev/components/details.js +3 -3
- package/dev/components/details.js.map +1 -1
- package/dev/components/dialog.d.ts +9 -6
- package/dev/components/dialog.d.ts.map +1 -1
- package/dev/components/dialog.js +58 -62
- package/dev/components/dialog.js.map +1 -1
- package/dev/components/divider.d.ts +1 -1
- package/dev/components/divider.js +1 -1
- package/dev/components/heading.d.ts +2 -0
- package/dev/components/heading.d.ts.map +1 -1
- package/dev/components/heading.js +2 -0
- package/dev/components/heading.js.map +1 -1
- package/dev/components/input.d.ts +2 -2
- package/dev/components/input.d.ts.map +1 -1
- package/dev/components/input.js +30 -9
- package/dev/components/input.js.map +1 -1
- package/dev/components/link.d.ts +1 -1
- package/dev/components/link.d.ts.map +1 -1
- package/dev/components/link.js +2 -2
- package/dev/components/link.js.map +1 -1
- package/dev/components/progress.d.ts +0 -7
- package/dev/components/progress.d.ts.map +1 -1
- package/dev/components/progress.js +4 -25
- package/dev/components/progress.js.map +1 -1
- package/dev/components/range.d.ts +48 -19
- package/dev/components/range.d.ts.map +1 -1
- package/dev/components/range.js +83 -61
- package/dev/components/range.js.map +1 -1
- package/dev/components/rotate.d.ts +6 -4
- package/dev/components/rotate.d.ts.map +1 -1
- package/dev/components/rotate.js +6 -4
- package/dev/components/rotate.js.map +1 -1
- package/dev/components/router.d.ts.map +1 -1
- package/dev/components/router.js +2 -3
- package/dev/components/router.js.map +1 -1
- package/dev/components/select.d.ts +4 -2
- package/dev/components/select.d.ts.map +1 -1
- package/dev/components/select.js +27 -24
- package/dev/components/select.js.map +1 -1
- package/dev/components/split.d.ts +2 -1
- package/dev/components/split.d.ts.map +1 -1
- package/dev/components/split.js +11 -7
- package/dev/components/split.js.map +1 -1
- package/dev/components/switch.d.ts +5 -7
- package/dev/components/switch.d.ts.map +1 -1
- package/dev/components/switch.js +23 -45
- package/dev/components/switch.js.map +1 -1
- package/dev/components/text.js +2 -2
- package/dev/components/time.d.ts +2 -5
- package/dev/components/time.d.ts.map +1 -1
- package/dev/components/time.js +6 -20
- package/dev/components/time.js.map +1 -1
- package/dev/components/tooltip.d.ts +3 -2
- package/dev/components/tooltip.d.ts.map +1 -1
- package/dev/components/tooltip.js +7 -19
- package/dev/components/tooltip.js.map +1 -1
- package/dev/components/typewriter.d.ts.map +1 -1
- package/dev/components/typewriter.js +2 -2
- package/dev/components/typewriter.js.map +1 -1
- package/dev/core/direction.d.ts +27 -0
- package/dev/core/direction.d.ts.map +1 -0
- package/dev/core/direction.js +56 -0
- package/dev/core/direction.js.map +1 -0
- package/dev/core/global-style.d.ts +1 -2
- package/dev/core/global-style.d.ts.map +1 -1
- package/dev/core/global-style.js +11 -11
- package/dev/core/global-style.js.map +1 -1
- package/dev/core/outline.d.ts +20 -0
- package/dev/core/outline.d.ts.map +1 -0
- package/dev/core/outline.js +44 -0
- package/dev/core/outline.js.map +1 -0
- package/dev/core/super-anchor.d.ts +2 -2
- package/dev/core/super-anchor.d.ts.map +1 -1
- package/dev/core/super-anchor.js +0 -1
- package/dev/core/super-anchor.js.map +1 -1
- package/dev/core/super-input.d.ts +2 -0
- package/dev/core/super-input.d.ts.map +1 -1
- package/dev/core/super-input.js +19 -30
- package/dev/core/super-input.js.map +1 -1
- package/dev/core/super-openable.d.ts +0 -4
- package/dev/core/super-openable.d.ts.map +1 -1
- package/package.json +3 -3
- package/src/components/alert.ts +34 -65
- package/src/components/avatar.ts +7 -5
- package/src/components/badge.ts +10 -3
- package/src/components/breath.ts +5 -17
- package/src/components/button.ts +19 -6
- package/src/components/card.ts +11 -11
- package/src/components/carousel.ts +45 -44
- package/src/components/details.ts +3 -3
- package/src/components/dialog.ts +66 -65
- package/src/components/divider.ts +1 -1
- package/src/components/heading.ts +2 -0
- package/src/components/input.ts +30 -9
- package/src/components/link.ts +2 -2
- package/src/components/progress.ts +4 -25
- package/src/components/range.ts +92 -70
- package/src/components/rotate.ts +6 -4
- package/src/components/router.ts +2 -3
- package/src/components/select.ts +33 -26
- package/src/components/split.ts +12 -7
- package/src/components/switch.ts +26 -41
- package/src/components/text.ts +2 -2
- package/src/components/time.ts +10 -25
- package/src/components/tooltip.ts +8 -20
- package/src/components/typewriter.ts +9 -7
- package/src/core/direction.ts +65 -0
- package/src/core/global-style.ts +12 -14
- package/src/core/outline.ts +54 -0
- package/src/core/super-anchor.ts +3 -2
- package/src/core/super-input.ts +22 -30
- package/src/core/super-openable.ts +0 -8
- package/vscode.html-custom-data.json +1 -1
- package/web-types.json +1 -1
@@ -0,0 +1,44 @@
|
|
1
|
+
import { css, unsafeCSS } from "lit";
|
2
|
+
/**
|
3
|
+
* The `OutlineBuilder` class is responsible for generating CSS styles for various types of outlines.
|
4
|
+
*/
|
5
|
+
export class OutlineBuilder {
|
6
|
+
/**
|
7
|
+
* @param vars.width The width variable of the outline.
|
8
|
+
* @param vars.color The color variable of the outline.
|
9
|
+
*/
|
10
|
+
constructor(vars) {
|
11
|
+
const width = unsafeCSS(vars.width);
|
12
|
+
const color = unsafeCSS(vars.color);
|
13
|
+
this.css = css `
|
14
|
+
[outline-type="outline"],
|
15
|
+
[outline-type="outline-inset"] {
|
16
|
+
outline-width: var(${width});
|
17
|
+
outline-color: var(${color});
|
18
|
+
outline-style: solid;
|
19
|
+
}
|
20
|
+
|
21
|
+
[outline-type="outline-inset"] {
|
22
|
+
outline-offset: calc(-1 * var(${width}));
|
23
|
+
}
|
24
|
+
|
25
|
+
[outline-type="box-shadow"] {
|
26
|
+
box-shadow: 0 0 0 var(${width}) var(${color});
|
27
|
+
}
|
28
|
+
|
29
|
+
[outline-type="box-shadow-inset"] {
|
30
|
+
box-shadow: inset 0 0 0 var(${width}) var(${color});
|
31
|
+
}
|
32
|
+
|
33
|
+
[outline-type="border"] {
|
34
|
+
border-width: var(${width});
|
35
|
+
border-color: var(${color});
|
36
|
+
border-style: solid;
|
37
|
+
}
|
38
|
+
`;
|
39
|
+
}
|
40
|
+
get styleSheet() {
|
41
|
+
return this.css.styleSheet;
|
42
|
+
}
|
43
|
+
}
|
44
|
+
//# sourceMappingURL=outline.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"outline.js","sourceRoot":"","sources":["../../src/core/outline.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,SAAS,EAAkB,MAAM,KAAK,CAAC;AAOrD;;GAEG;AACH,MAAM,OAAO,cAAc;IAGzB;;;OAGG;IACH,YAAY,IAAiB;QAC3B,MAAM,KAAK,GAAG,SAAS,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;QACpC,MAAM,KAAK,GAAG,SAAS,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;QACpC,IAAI,CAAC,GAAG,GAAG,GAAG,CAAA;;;6BAGW,KAAK;6BACL,KAAK;;;;;wCAKM,KAAK;;;;gCAIb,KAAK,SAAS,KAAK;;;;sCAIb,KAAK,SAAS,KAAK;;;;4BAI7B,KAAK;4BACL,KAAK;;;KAG5B,CAAC;IACJ,CAAC;IAED,IAAI,UAAU;QACZ,OAAO,IAAI,CAAC,GAAG,CAAC,UAAU,CAAC;IAC7B,CAAC;CACF"}
|
@@ -1,6 +1,6 @@
|
|
1
1
|
import { type TemplateResult } from "lit";
|
2
2
|
import { GlobalStyle } from "./global-style.js";
|
3
|
-
declare class SuperAnchor extends GlobalStyle {
|
3
|
+
declare abstract class SuperAnchor extends GlobalStyle {
|
4
4
|
/**
|
5
5
|
* A element href.
|
6
6
|
*/
|
@@ -11,7 +11,7 @@ declare class SuperAnchor extends GlobalStyle {
|
|
11
11
|
target: "_blank" | "_self" | "_parent" | "_top";
|
12
12
|
get pathname(): string;
|
13
13
|
protected render(): TemplateResult<1>;
|
14
|
-
protected _handleClick(_: MouseEvent): void;
|
14
|
+
protected abstract _handleClick(_: MouseEvent): void;
|
15
15
|
}
|
16
16
|
export default SuperAnchor;
|
17
17
|
export { SuperAnchor };
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"super-anchor.d.ts","sourceRoot":"","sources":["../../src/core/super-anchor.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,cAAc,EAAsB,MAAM,KAAK,CAAC;AAG9D,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAEhD,
|
1
|
+
{"version":3,"file":"super-anchor.d.ts","sourceRoot":"","sources":["../../src/core/super-anchor.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,cAAc,EAAsB,MAAM,KAAK,CAAC;AAG9D,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAEhD,uBAmBe,WAAY,SAAQ,WAAW;IAC5C;;OAEG;IAEH,IAAI,EAAE,MAAM,CAAC;IAEb;;OAEG;IAEH,MAAM,EAAE,QAAQ,GAAG,OAAO,GAAG,SAAS,GAAG,MAAM,CAAW;IAE1D,IAAI,QAAQ,IAAI,MAAM,CAErB;IAED,SAAS,CAAC,MAAM,IAAI,cAAc,CAAC,CAAC,CAAC;IAcrC,SAAS,CAAC,QAAQ,CAAC,YAAY,CAAC,CAAC,EAAE,UAAU,GAAG,IAAI;CACrD;AAED,eAAe,WAAW,CAAC;AAC3B,OAAO,EAAE,WAAW,EAAE,CAAC"}
|
package/dev/core/super-anchor.js
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"super-anchor.js","sourceRoot":"","sources":["../../src/core/super-anchor.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,EAAE,MAAM,iBAAiB,CAAC;AACzD,OAAO,EAAuB,GAAG,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,KAAK,CAAC;AAC9D,OAAO,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAE7C,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAqBhD,
|
1
|
+
{"version":3,"file":"super-anchor.js","sourceRoot":"","sources":["../../src/core/super-anchor.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,EAAE,MAAM,iBAAiB,CAAC;AACzD,OAAO,EAAuB,GAAG,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,KAAK,CAAC;AAC9D,OAAO,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAE7C,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAqBhD,IAAe,WAAW,GAA1B,MAAe,WAAY,SAAQ,WAAW;IAA9C;;QAOE;;WAEG;QAEH,WAAM,GAA4C,OAAO,CAAC;IAqB5D,CAAC;IAnBC,IAAI,QAAQ;QACV,OAAO,IAAI,GAAG,CAAC,IAAI,CAAC,IAAI,EAAE,QAAQ,CAAC,IAAI,CAAC,CAAC,QAAQ,CAAC;IACpD,CAAC;IAES,MAAM;QACd,OAAO,IAAI,CAAA;;;UAGL,IAAI,CAAC,IAAI,CAAC,cAAc,CAAC;gBACnB,IAAI,CAAC,IAAI,IAAI,OAAO;kBAClB,IAAI,CAAC,MAAM;iBACZ,IAAI,CAAC,YAAY;;UAExB,QAAQ,EAAE;;KAEf,CAAC;IACJ,CAAC;CAGF,CAAA;AA3BC;IADC,QAAQ,EAAE;yCACE;AAMb;IADC,QAAQ,EAAE;2CAC+C;AAX7C,WAAW;IAnBzB,MAAM,CAAC,GAAG,CAAA;;;;;;;;;;;;;;;;;;CAkBV,CAAC;GACa,WAAW,CAgCzB;AAED,eAAe,WAAW,CAAC;AAC3B,OAAO,EAAE,WAAW,EAAE,CAAC"}
|
@@ -1,9 +1,11 @@
|
|
1
1
|
import { type HandlerEvent } from "@godown/element";
|
2
2
|
import { type TemplateResult } from "lit";
|
3
3
|
import { GlobalStyle } from "./global-style.js";
|
4
|
+
import { type OutlineType } from "./outline.js";
|
4
5
|
declare class SuperInput extends GlobalStyle {
|
5
6
|
autofocus: boolean;
|
6
7
|
autocomplete: string | boolean;
|
8
|
+
outlineType: OutlineType;
|
7
9
|
disabled: boolean;
|
8
10
|
type: InputType;
|
9
11
|
placeholder: string;
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"super-input.d.ts","sourceRoot":"","sources":["../../src/core/super-input.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,YAAY,EAAgC,MAAM,iBAAiB,CAAC;
|
1
|
+
{"version":3,"file":"super-input.d.ts","sourceRoot":"","sources":["../../src/core/super-input.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,YAAY,EAAgC,MAAM,iBAAiB,CAAC;AAClF,OAAO,EAAE,KAAK,cAAc,EAAa,MAAM,KAAK,CAAC;AAGrD,OAAO,EAAE,W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AAI,cAAc,CAAC,CAAC,CAAC;IAW5C,SAAS,CAAC,aAAa,IAAI,cAAc,CAAC,CAAC,CAAC;CAU7C;AAED,eAAe,UAAU,CAAC;AAC1B,OAAO,EAAE,UAAU,EAAE,CAAC;AAEtB,KAAK,SAAS,GACV,QAAQ,GACR,MAAM,GACN,QAAQ,GACR,KAAK,GACL,KAAK,GACL,OAAO,GACP,UAAU,GACV,UAAU,GACV,MAAM,GACN,OAAO,GACP,MAAM,GACN,MAAM,GACN,gBAAgB,GAChB,QAAQ,GACR,OAAO,GACP,OAAO,GACP,UAAU,GACV,OAAO,GACP,MAAM,GACN,OAAO,CAAC"}
|
package/dev/core/super-input.js
CHANGED
@@ -1,11 +1,12 @@
|
|
1
1
|
import { __decorate } from "tslib";
|
2
2
|
import { htmlSlot, omit, part, styles } from "@godown/element";
|
3
|
-
import iconEyeSlashFill from "@godown/f7-icon/icons/eye-slash-fill.js";
|
4
3
|
import { css, html } from "lit";
|
5
4
|
import { property } from "lit/decorators.js";
|
6
5
|
import { GlobalStyle, cssGlobalVars } from "./global-style.js";
|
6
|
+
import { OutlineBuilder } from "./outline.js";
|
7
7
|
const fieldStyle = css `
|
8
8
|
.input-field {
|
9
|
+
--space: var(${cssGlobalVars.input}-space);
|
9
10
|
display: flex;
|
10
11
|
position: relative;
|
11
12
|
align-items: center;
|
@@ -14,16 +15,11 @@ const fieldStyle = css `
|
|
14
15
|
}
|
15
16
|
|
16
17
|
.input-field [part="input"] {
|
17
|
-
background:
|
18
|
+
background: none;
|
18
19
|
height: 100%;
|
19
20
|
width: 100%;
|
20
21
|
color: inherit;
|
21
|
-
padding: 0 var(
|
22
|
-
}
|
23
|
-
|
24
|
-
.input-field:focus-within,
|
25
|
-
.input-field.outline {
|
26
|
-
box-shadow: var(${cssGlobalVars.input}-box-shadow);
|
22
|
+
padding: 0 var(--space);
|
27
23
|
}
|
28
24
|
|
29
25
|
.input-field [part="icon"] {
|
@@ -39,11 +35,11 @@ const fieldStyle = css `
|
|
39
35
|
}
|
40
36
|
|
41
37
|
.input-field [part="suffix"] [part="icon"] {
|
42
|
-
padding-inline-end: var(
|
38
|
+
padding-inline-end: var(--space);
|
43
39
|
}
|
44
40
|
|
45
41
|
.input-field [part="prefix"] [part="icon"] {
|
46
|
-
padding-inline-start: var(
|
42
|
+
padding-inline-start: var(--space);
|
47
43
|
}
|
48
44
|
`;
|
49
45
|
const inputStyle = css `
|
@@ -51,12 +47,10 @@ const inputStyle = css `
|
|
51
47
|
${cssGlobalVars.input}-width: 10em;
|
52
48
|
${cssGlobalVars.input}-height: 1.6em;
|
53
49
|
${cssGlobalVars.input}-space: 0.2em;
|
54
|
-
${cssGlobalVars.input}-
|
55
|
-
${cssGlobalVars.input}-
|
56
|
-
${cssGlobalVars.input}-
|
57
|
-
|
58
|
-
${cssGlobalVars.input}-box-shadow: 0px 0px 0px .1em var(${cssGlobalVars.active});
|
59
|
-
border-radius: var(${cssGlobalVars.input}-radius);
|
50
|
+
${cssGlobalVars.input}-control: currentColor;
|
51
|
+
${cssGlobalVars.input}-outline-width: .075em;
|
52
|
+
${cssGlobalVars.input}-outline-color: var(${cssGlobalVars.passive});
|
53
|
+
border-radius: 0.2em;
|
60
54
|
}
|
61
55
|
|
62
56
|
:host([disabled]) {
|
@@ -77,6 +71,7 @@ let SuperInput = class SuperInput extends GlobalStyle {
|
|
77
71
|
constructor() {
|
78
72
|
super(...arguments);
|
79
73
|
this.autofocus = false;
|
74
|
+
this.outlineType = "border";
|
80
75
|
this.disabled = false;
|
81
76
|
/**
|
82
77
|
* Returns true when the input is compositing.
|
@@ -154,24 +149,12 @@ let SuperInput = class SuperInput extends GlobalStyle {
|
|
154
149
|
`;
|
155
150
|
}
|
156
151
|
_renderSuffix() {
|
157
|
-
const PASSWORD = "password";
|
158
152
|
return html `
|
159
153
|
<label
|
160
154
|
for=${this.makeId}
|
161
155
|
part="suffix"
|
162
156
|
>
|
163
|
-
${
|
164
|
-
? html `
|
165
|
-
<i
|
166
|
-
part="icon"
|
167
|
-
@mousedown="${() => this._changeInputType("text")}"
|
168
|
-
@mouseup="${() => this._changeInputType(PASSWORD)}"
|
169
|
-
@mouseleave="${() => this._changeInputType(PASSWORD)}"
|
170
|
-
>
|
171
|
-
${iconEyeSlashFill()}
|
172
|
-
</i>
|
173
|
-
`
|
174
|
-
: htmlSlot("suffix")}
|
157
|
+
${htmlSlot("suffix")}
|
175
158
|
</label>
|
176
159
|
`;
|
177
160
|
}
|
@@ -179,6 +162,9 @@ let SuperInput = class SuperInput extends GlobalStyle {
|
|
179
162
|
__decorate([
|
180
163
|
property()
|
181
164
|
], SuperInput.prototype, "autocomplete", void 0);
|
165
|
+
__decorate([
|
166
|
+
property({ attribute: "outline-type" })
|
167
|
+
], SuperInput.prototype, "outlineType", void 0);
|
182
168
|
__decorate([
|
183
169
|
property({ type: Boolean, reflect: true })
|
184
170
|
], SuperInput.prototype, "disabled", void 0);
|
@@ -201,7 +187,10 @@ __decorate([
|
|
201
187
|
part("input")
|
202
188
|
], SuperInput.prototype, "_input", void 0);
|
203
189
|
SuperInput = __decorate([
|
204
|
-
styles(fieldStyle,
|
190
|
+
styles(fieldStyle, new OutlineBuilder({
|
191
|
+
width: `${cssGlobalVars.input}-outline-width`,
|
192
|
+
color: `${cssGlobalVars.input}-outline-color`,
|
193
|
+
}).styleSheet, inputStyle)
|
205
194
|
], SuperInput);
|
206
195
|
export default SuperInput;
|
207
196
|
export { SuperInput };
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"super-input.js","sourceRoot":"","sources":["../../src/core/super-input.ts"],"names":[],"mappings":";AAAA,OAAO,EAAqB,QAAQ,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,iBAAiB,CAAC;AAClF,OAAO,
|
1
|
+
{"version":3,"file":"super-input.js","sourceRoot":"","sources":["../../src/core/super-input.ts"],"names":[],"mappings":";AAAA,OAAO,EAAqB,QAAQ,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,EAAE,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AAGhB;IADC,QAAQ,CAAC,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;+CACR;AAGpB;IADC,QAAQ,CAAC,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;wCACf;AAGb;IADC,QAAQ,EAAE;yCACA;AAUX;IADC,QAAQ,EAAE;2CACE;AAGH;IADT,IAAI,CAAC,OAAO,CAAC;0CACqB;AAlC/B,UAAU;IARf,MAAM,CACL,UAAU,EACV,IAAI,cAAc,CAAC;QACjB,KAAK,EAAE,GAAG,aAAa,CAAC,KAAK,gBAAgB;QAC7C,KAAK,EAAE,GAAG,aAAa,CAAC,KAAK,gBAAgB;KAC9C,CAAC,CAAC,UAAU,EACb,UAAU,CACX;GACK,UAAU,CAsIf;AAED,eAAe,UAAU,CAAC;AAC1B,OAAO,EAAE,UAAU,EAAE,CAAC"}
|
@@ -13,8 +13,4 @@ declare class SuperOpenable extends GlobalStyle {
|
|
13
13
|
}
|
14
14
|
export default SuperOpenable;
|
15
15
|
export { SuperOpenable };
|
16
|
-
export type Direction4 = "left" | "right" | "top" | "bottom";
|
17
|
-
export type Direction5 = Direction4 | "center";
|
18
|
-
export type Direction8 = Direction4 | "top-left" | "top-right" | "bottom-left" | "bottom-right";
|
19
|
-
export type Direction9 = Direction8 | Direction5;
|
20
16
|
//# sourceMappingURL=super-openable.d.ts.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"super-openable.d.ts","sourceRoot":"","sources":["../../src/core/super-openable.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,KAAK,CAAC;AAG5C,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAEhD,cAAM,aAAc,SAAQ,WAAW;IACrC;;OAEG;IAEH,IAAI,UAAS;IAEb,MAAM,CAAC,EAAE,GAAE,OAAsC,GAAG,IAAI;IAIxD,KAAK,IAAI,IAAI;IAIb,IAAI,IAAI,IAAI;IAIZ,SAAS,CAAC,OAAO,CAAC,iBAAiB,EAAE,gBAAgB,CAAC,IAAI,CAAC,GAAG,IAAI;IAOlE,SAAS,CAAC,YAAY,CAAC,CAAC,EAAE,UAAU,GAAG,IAAI;CAG5C;AAED,eAAe,aAAa,CAAC;AAC7B,OAAO,EAAE,aAAa,EAAE,CAAC
|
1
|
+
{"version":3,"file":"super-openable.d.ts","sourceRoot":"","sources":["../../src/core/super-openable.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,KAAK,CAAC;AAG5C,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAEhD,cAAM,aAAc,SAAQ,WAAW;IACrC;;OAEG;IAEH,IAAI,UAAS;IAEb,MAAM,CAAC,EAAE,GAAE,OAAsC,GAAG,IAAI;IAIxD,KAAK,IAAI,IAAI;IAIb,IAAI,IAAI,IAAI;IAIZ,SAAS,CAAC,OAAO,CAAC,iBAAiB,EAAE,gBAAgB,CAAC,IAAI,CAAC,GAAG,IAAI;IAOlE,SAAS,CAAC,YAAY,CAAC,CAAC,EAAE,UAAU,GAAG,IAAI;CAG5C;AAED,eAAe,aAAa,CAAC;AAC7B,OAAO,EAAE,aAAa,EAAE,CAAC"}
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "godown",
|
3
|
-
"version": "3.
|
3
|
+
"version": "3.4.0",
|
4
4
|
"description": "Non Composite Web Components Library",
|
5
5
|
"type": "module",
|
6
6
|
"main": "index.js",
|
@@ -33,8 +33,8 @@
|
|
33
33
|
"lit": "^3.0.0",
|
34
34
|
"tslib": "^2.7.0",
|
35
35
|
"@godown/colors": "^1.0.0",
|
36
|
-
"@godown/element": "^1.
|
37
|
-
"@godown/f7-icon": "^1.0.
|
36
|
+
"@godown/element": "^1.3.0",
|
37
|
+
"@godown/f7-icon": "^1.0.3"
|
38
38
|
},
|
39
39
|
"publishConfig": {
|
40
40
|
"access": "public"
|
package/src/components/alert.ts
CHANGED
@@ -40,32 +40,6 @@ const darkStyles = constructCSSObject(
|
|
40
40
|
(prop) => toVar(prop),
|
41
41
|
);
|
42
42
|
|
43
|
-
const genLight = (key: string) => {
|
44
|
-
return [cssGlobalVars._colors[key][6], cssGlobalVars._colors[key][0]];
|
45
|
-
};
|
46
|
-
|
47
|
-
/**
|
48
|
-
* @deprecated
|
49
|
-
*/
|
50
|
-
const lightStyles = constructCSSObject(
|
51
|
-
vars,
|
52
|
-
{
|
53
|
-
green: genLight("green"),
|
54
|
-
blue: genLight("blue"),
|
55
|
-
orange: genLight("orange"),
|
56
|
-
red: genLight("red"),
|
57
|
-
yellow: genLight("yellow"),
|
58
|
-
purple: genLight("purple"),
|
59
|
-
teal: genLight("teal"),
|
60
|
-
pink: genLight("pink"),
|
61
|
-
gray: [cssGlobalVars._colors.darkgray[5], cssGlobalVars._colors.lightgray[7]],
|
62
|
-
white: [cssGlobalVars._colors.lightgray[0], cssGlobalVars._colors.darkgray[0]],
|
63
|
-
black: [cssGlobalVars._colors.darkgray[7], cssGlobalVars._colors.lightgray[3]],
|
64
|
-
},
|
65
|
-
() => ":host",
|
66
|
-
(prop) => toVar(prop),
|
67
|
-
);
|
68
|
-
|
69
43
|
const calls = {
|
70
44
|
tip: {
|
71
45
|
color: "teal",
|
@@ -116,67 +90,58 @@ const calls = {
|
|
116
90
|
@styles(css`
|
117
91
|
:host,
|
118
92
|
:where(:host([contents]) [part="root"]) {
|
119
|
-
|
120
|
-
${cssScope}--border-radius: .25em;
|
93
|
+
${cssScope}--border-radius: .2em;
|
121
94
|
${cssScope}--border-width: .075em;
|
122
95
|
${cssScope}--blockquote-width: .2em;
|
123
|
-
${cssScope}--
|
96
|
+
${cssScope}--blockquote-background: transparent;
|
97
|
+
${cssScope}--gap: .5em;
|
98
|
+
border-radius: var(${cssScope}--border-radius);
|
124
99
|
display: block;
|
125
100
|
width: 100%;
|
126
101
|
}
|
127
102
|
|
128
103
|
[part="root"] {
|
129
|
-
|
130
|
-
|
131
|
-
|
132
|
-
|
133
|
-
|
134
|
-
|
135
|
-
padding: var(${cssScope}--padding);
|
104
|
+
color: var(${cssScope}--color, currentColor);
|
105
|
+
display: grid;
|
106
|
+
align-items: center;
|
107
|
+
grid-template-columns: auto 1fr auto;
|
108
|
+
grid-template-rows: auto 1fr;
|
109
|
+
border-color: currentColor;
|
136
110
|
border-radius: inherit;
|
137
|
-
border:
|
111
|
+
border-style: solid;
|
112
|
+
border-width: var(${cssScope}--border-width);
|
113
|
+
padding: var(${cssScope}--gap);
|
138
114
|
background: var(${cssScope}--background);
|
139
115
|
}
|
140
116
|
|
141
117
|
[variant="blockquote"] {
|
142
118
|
border-radius: 0;
|
143
|
-
border-
|
144
|
-
border-
|
145
|
-
|
146
|
-
border-top: none;
|
147
|
-
background: transparent;
|
119
|
+
border-width: 0;
|
120
|
+
border-left-width: var(${cssScope}--blockquote-width);
|
121
|
+
background: var(${cssScope}--blockquote-background);
|
148
122
|
}
|
149
123
|
|
150
|
-
[part
|
151
|
-
color: var(--color);
|
152
|
-
}
|
153
|
-
|
154
|
-
[part="root"] {
|
124
|
+
[part~="icon"] {
|
155
125
|
display: grid;
|
156
126
|
align-items: center;
|
157
|
-
|
158
|
-
grid-template-rows: auto 1fr;
|
127
|
+
height: 2em;
|
159
128
|
}
|
160
129
|
|
161
|
-
|
162
|
-
|
130
|
+
.start svg {
|
131
|
+
margin-inline-end: var(${cssScope}--gap);
|
163
132
|
}
|
164
133
|
|
165
|
-
|
166
|
-
|
167
|
-
align-items: center;
|
168
|
-
height: 2em;
|
134
|
+
.end svg {
|
135
|
+
margin-inline-start: var(${cssScope}--gap);
|
169
136
|
}
|
170
137
|
|
171
|
-
|
172
|
-
margin-right: 0.5em;
|
138
|
+
svg {
|
173
139
|
width: 1.25em;
|
174
140
|
height: 1.25em;
|
175
141
|
}
|
176
142
|
|
177
143
|
[part="content"] {
|
178
144
|
grid-row: span 2 / span 2;
|
179
|
-
line-height: 1.5em;
|
180
145
|
}
|
181
146
|
`)
|
182
147
|
class Alert extends GlobalStyle {
|
@@ -235,11 +200,9 @@ class Alert extends GlobalStyle {
|
|
235
200
|
* Alert variant, if set to `blockquote`, the alert will be rendered as a blockquote.
|
236
201
|
*
|
237
202
|
* If variant is `"blockquote"`, hide the close button.
|
238
|
-
*
|
239
|
-
* ! __"light" will be deprecated__ in the future.
|
240
203
|
*/
|
241
204
|
@property()
|
242
|
-
variant: "blockquote" | "dark"
|
205
|
+
variant: "blockquote" | "dark" = "dark";
|
243
206
|
|
244
207
|
protected render(): TemplateResult<1> {
|
245
208
|
const color = calls[this.call]?.color || this.color;
|
@@ -249,7 +212,12 @@ class Alert extends GlobalStyle {
|
|
249
212
|
part="root"
|
250
213
|
${attr(this.observedRecord)}
|
251
214
|
>
|
252
|
-
<div
|
215
|
+
<div
|
216
|
+
part="icon"
|
217
|
+
class="start"
|
218
|
+
>
|
219
|
+
${icon}
|
220
|
+
</div>
|
253
221
|
<div part="content">
|
254
222
|
<strong part="title">${this.title || htmlSlot("title")}</strong>
|
255
223
|
${this.content || htmlSlot()}
|
@@ -258,14 +226,15 @@ class Alert extends GlobalStyle {
|
|
258
226
|
? ""
|
259
227
|
: html`
|
260
228
|
<div
|
261
|
-
part="close"
|
229
|
+
part="icon close"
|
230
|
+
class="end"
|
262
231
|
tabindex="0"
|
263
232
|
@click="${this.close}"
|
264
233
|
>
|
265
234
|
${iconXmark()}
|
266
235
|
</div>
|
267
236
|
`}
|
268
|
-
${htmlStyle(
|
237
|
+
${htmlStyle(darkStyles[color])}
|
269
238
|
</div>
|
270
239
|
`;
|
271
240
|
}
|
@@ -277,7 +246,7 @@ class Alert extends GlobalStyle {
|
|
277
246
|
|
278
247
|
protected firstUpdated(): void {
|
279
248
|
if (this.autoclose) {
|
280
|
-
setTimeout(() => this.close(), this.autoclose);
|
249
|
+
this.timeouts.add(setTimeout(() => this.close(), this.autoclose));
|
281
250
|
}
|
282
251
|
}
|
283
252
|
|
package/src/components/avatar.ts
CHANGED
@@ -23,6 +23,7 @@ const cssScope = scopePrefix(protoName);
|
|
23
23
|
width: var(${cssScope}--size);
|
24
24
|
height: var(${cssScope}--size);
|
25
25
|
vertical-align: bottom;
|
26
|
+
border-radius: 0.2em;
|
26
27
|
}
|
27
28
|
|
28
29
|
:host,
|
@@ -58,19 +59,20 @@ const cssScope = scopePrefix(protoName);
|
|
58
59
|
`)
|
59
60
|
class Avatar extends GlobalStyle {
|
60
61
|
/**
|
61
|
-
*
|
62
|
+
* The `src` property specifies the URL of the avatar image.
|
63
|
+
* If `src` is not provided, the component will display the `name` property instead.
|
62
64
|
*/
|
63
65
|
@property()
|
64
66
|
src: string | undefined | null;
|
65
67
|
|
66
68
|
/**
|
67
|
-
*
|
69
|
+
* Specifies the name or initials to display if no `src` is provided
|
68
70
|
*/
|
69
71
|
@property()
|
70
72
|
name = "";
|
71
73
|
|
72
74
|
/**
|
73
|
-
*
|
75
|
+
* If `true`, will make the avatar display as a circle.
|
74
76
|
*/
|
75
77
|
@property({ type: Boolean })
|
76
78
|
round = false;
|
@@ -99,13 +101,13 @@ class Avatar extends GlobalStyle {
|
|
99
101
|
}
|
100
102
|
if (this.name) {
|
101
103
|
return html`
|
102
|
-
<span part="name">${this.
|
104
|
+
<span part="name">${this.formatName()}</span>
|
103
105
|
`;
|
104
106
|
}
|
105
107
|
return htmlSlot();
|
106
108
|
}
|
107
109
|
|
108
|
-
|
110
|
+
formatName(): string {
|
109
111
|
return this.name;
|
110
112
|
}
|
111
113
|
|
package/src/components/badge.ts
CHANGED
@@ -3,8 +3,7 @@ import { type TemplateResult, css, html } from "lit";
|
|
3
3
|
import { property } from "lit/decorators.js";
|
4
4
|
|
5
5
|
import { GlobalStyle, cssGlobalVars, scopePrefix } from "../core/global-style.js";
|
6
|
-
|
7
|
-
type Position = "top-right" | "top-left" | "bottom-right" | "bottom-left";
|
6
|
+
import { DirectionCorner } from "../core/direction.js";
|
8
7
|
|
9
8
|
const protoName = "badge";
|
10
9
|
const cssScope = scopePrefix(protoName);
|
@@ -70,8 +69,12 @@ const cssScope = scopePrefix(protoName);
|
|
70
69
|
}
|
71
70
|
`)
|
72
71
|
class Badge extends GlobalStyle {
|
72
|
+
/**
|
73
|
+
* The position of the badge relative to its parent element.
|
74
|
+
* Possible values are `"top-left"`, `"top-right"`, `"bottom-left"`, and `"bottom-right"`.
|
75
|
+
*/
|
73
76
|
@property()
|
74
|
-
position:
|
77
|
+
position: DirectionCorner = "top-right";
|
75
78
|
|
76
79
|
@property({ type: Number })
|
77
80
|
value = 0;
|
@@ -82,6 +85,10 @@ class Badge extends GlobalStyle {
|
|
82
85
|
@property({ type: Boolean })
|
83
86
|
dot = false;
|
84
87
|
|
88
|
+
/**
|
89
|
+
* The maximum value that can be displayed in the badge
|
90
|
+
* Values greater than this will be displayed as `max+` by default.
|
91
|
+
*/
|
85
92
|
@property({ type: Number })
|
86
93
|
max = 99;
|
87
94
|
|
package/src/components/breath.ts
CHANGED
@@ -101,10 +101,10 @@ class Breath extends GlobalStyle {
|
|
101
101
|
content: string | string[];
|
102
102
|
|
103
103
|
/**
|
104
|
-
* Effect duration
|
104
|
+
* Effect duration.
|
105
105
|
*/
|
106
|
-
@property()
|
107
|
-
duration:
|
106
|
+
@property({ type: Number })
|
107
|
+
duration: number;
|
108
108
|
|
109
109
|
protected render(): TemplateResult<1> {
|
110
110
|
const texts = this.getTexts();
|
@@ -135,29 +135,17 @@ class Breath extends GlobalStyle {
|
|
135
135
|
|
136
136
|
protected _computeStyle(len: number): string {
|
137
137
|
const gap = 100 / 2 / len;
|
138
|
-
const duration = this.
|
138
|
+
const duration = this.duration || (len * 2 + 2) * 1000;
|
139
139
|
let style1 = "";
|
140
140
|
for (let number = 1; number <= len; number++) {
|
141
141
|
const delay = (-duration / len) * (len - number + 1);
|
142
142
|
const defaultNumber = ((number - 1) % 3) + 1;
|
143
143
|
style1 += `.rel:nth-child(${number}) .colorful{animation-delay:${delay}s;background:var(${cssScope}--${number},var(${cssScope}--${defaultNumber}));}`;
|
144
144
|
}
|
145
|
-
return `.colorful{animation-duration:${duration}
|
145
|
+
return `.colorful{animation-duration:${duration}ms;}@keyframes colorfulN{0%,${gap * 3}%{opacity:0;}${gap}%,${
|
146
146
|
gap * 2
|
147
147
|
}%{opacity:1;}}${style1}`;
|
148
148
|
}
|
149
|
-
|
150
|
-
parseDuration(): number | undefined {
|
151
|
-
const { duration } = this;
|
152
|
-
if (duration) {
|
153
|
-
if (duration.endsWith("s")) {
|
154
|
-
return Number.parseFloat(duration.slice(0, -1));
|
155
|
-
}
|
156
|
-
if (duration.endsWith("ms")) {
|
157
|
-
return Number.parseFloat(duration.slice(0, -2)) / 1000;
|
158
|
-
}
|
159
|
-
}
|
160
|
-
}
|
161
149
|
}
|
162
150
|
|
163
151
|
export default Breath;
|
package/src/components/button.ts
CHANGED
@@ -110,6 +110,11 @@ const colors: Record<Colors, string> = constructCSSObject(
|
|
110
110
|
color: var(${cssScope}--ghost-color);
|
111
111
|
background: transparent;
|
112
112
|
}
|
113
|
+
|
114
|
+
:host([plain]) {
|
115
|
+
${cssScope}--gradients: unset;
|
116
|
+
${cssScope}--focus-scale: unset;
|
117
|
+
}
|
113
118
|
`,
|
114
119
|
css`
|
115
120
|
:host {
|
@@ -127,9 +132,8 @@ const colors: Record<Colors, string> = constructCSSObject(
|
|
127
132
|
var(${cssScope}--background),
|
128
133
|
var(${cssScope}--gradients, var(${cssScope}--background))
|
129
134
|
);
|
130
|
-
border-radius: 0.
|
135
|
+
border-radius: 0.2em;
|
131
136
|
width: fit-content;
|
132
|
-
transition: 0.1s;
|
133
137
|
display: block;
|
134
138
|
overflow: hidden;
|
135
139
|
text-align: center;
|
@@ -183,13 +187,20 @@ const colors: Record<Colors, string> = constructCSSObject(
|
|
183
187
|
)
|
184
188
|
class Button extends GlobalStyle {
|
185
189
|
/**
|
186
|
-
*
|
190
|
+
* If true, remove gradient, modal animation, focus scale.
|
191
|
+
*/
|
192
|
+
@property({ type: Boolean, reflect: true })
|
193
|
+
plain = false;
|
194
|
+
|
195
|
+
/**
|
196
|
+
* Whether this element is disabled or not.
|
187
197
|
*/
|
188
198
|
@property({ type: Boolean, reflect: true })
|
189
199
|
disabled = false;
|
190
200
|
|
191
201
|
/**
|
192
|
-
*
|
202
|
+
* Whether this element should be rendered as a "ghost" button.
|
203
|
+
* A ghost button is a button with a transparent background and a border.
|
193
204
|
*/
|
194
205
|
@property({ type: Boolean, reflect: true })
|
195
206
|
ghost = false;
|
@@ -249,7 +260,7 @@ class Button extends GlobalStyle {
|
|
249
260
|
super.blur();
|
250
261
|
}
|
251
262
|
|
252
|
-
firstUpdated(): void {
|
263
|
+
protected firstUpdated(): void {
|
253
264
|
this.events.add(this, "click", this._handelClick, true);
|
254
265
|
}
|
255
266
|
|
@@ -259,7 +270,9 @@ class Button extends GlobalStyle {
|
|
259
270
|
e.preventDefault();
|
260
271
|
return;
|
261
272
|
}
|
262
|
-
this.
|
273
|
+
if (!this.plain) {
|
274
|
+
this._handleModal(e);
|
275
|
+
}
|
263
276
|
}
|
264
277
|
|
265
278
|
protected _handleModal(e: MouseEvent): void {
|