tinkiet 0.7.6 → 0.8.2
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/accordion/accordion.d.ts +18 -0
- package/accordion/accordion.js +94 -0
- package/accordion/accordion.scss.js +4 -0
- package/accordion/index.d.ts +1 -0
- package/accordion/index.js +1 -0
- package/badge/badge.d.ts +15 -0
- package/badge/badge.js +27 -0
- package/badge/badge.scss.js +4 -0
- package/badge/index.d.ts +1 -0
- package/badge/index.js +1 -0
- package/box/box.d.ts +56 -0
- package/box/box.js +182 -0
- package/box/box.scss.js +4 -0
- package/box/focusable-box.d.ts +13 -0
- package/box/focusable-box.js +30 -0
- package/box/index.d.ts +1 -0
- package/box/index.js +1 -0
- package/button/button.d.ts +39 -0
- package/button/button.js +125 -0
- package/button/button.scss.js +4 -0
- package/button/index.d.ts +1 -0
- package/button/index.js +1 -0
- package/checkbox/checkbox.d.ts +21 -0
- package/checkbox/checkbox.js +83 -0
- package/checkbox/checkbox.scss.js +4 -0
- package/checkbox/index.d.ts +1 -0
- package/checkbox/index.js +1 -0
- package/dialog/dialog.d.ts +18 -0
- package/dialog/dialog.js +58 -0
- package/dialog/dialog.scss.js +4 -0
- package/dialog/index.d.ts +1 -0
- package/dialog/index.js +1 -0
- package/form/form.d.ts +15 -0
- package/form/form.js +57 -0
- package/form/index.d.ts +1 -0
- package/form/index.js +1 -0
- package/icon/icon.d.ts +17 -0
- package/icon/icon.js +77 -0
- package/icon/icon.scss.js +4 -0
- package/icon/icons.d.ts +7 -0
- package/icon/icons.js +24 -0
- package/icon/index.d.ts +2 -0
- package/icon/index.js +2 -0
- package/index.d.ts +23 -0
- package/index.d.ts.map +1 -0
- package/index.js +45 -0
- package/list-item/index.d.ts +1 -0
- package/list-item/index.js +1 -0
- package/list-item/list-item.d.ts +20 -0
- package/list-item/list-item.js +72 -0
- package/list-item/list-item.scss.js +4 -0
- package/loading/index.d.ts +1 -0
- package/loading/index.js +1 -0
- package/loading/loading.d.ts +14 -0
- package/loading/loading.js +61 -0
- package/loading/loading.scss.js +4 -0
- package/navbar/index.d.ts +1 -0
- package/navbar/index.js +1 -0
- package/navbar/navbar.d.ts +11 -0
- package/navbar/navbar.js +33 -0
- package/navbar/navbar.scss.js +4 -0
- package/notie/index.d.ts +1 -0
- package/notie/index.js +1 -0
- package/notie/notie.d.ts +69 -0
- package/notie/notie.js +193 -0
- package/notie/notie.scss.js +4 -0
- package/package.json +4 -9
- package/pages/index.d.ts +1 -0
- package/pages/index.js +1 -0
- package/pages/pages.d.ts +18 -0
- package/pages/pages.js +75 -0
- package/pages/pages.scss.js +4 -0
- package/radio/index.d.ts +1 -0
- package/radio/index.js +1 -0
- package/radio/radio.d.ts +24 -0
- package/radio/radio.js +98 -0
- package/radio/radio.scss.js +4 -0
- package/select/index.d.ts +1 -0
- package/select/index.js +1 -0
- package/select/select.d.ts +32 -0
- package/select/select.js +132 -0
- package/select/select.scss.js +4 -0
- package/slider/index.d.ts +1 -0
- package/slider/index.js +1 -0
- package/slider/slider.d.ts +30 -0
- package/slider/slider.js +135 -0
- package/slider/slider.scss.js +4 -0
- package/switch/index.d.ts +1 -0
- package/switch/index.js +1 -0
- package/switch/switch.d.ts +24 -0
- package/switch/switch.js +99 -0
- package/switch/switch.scss.js +4 -0
- package/tab-group/index.d.ts +1 -0
- package/tab-group/index.js +1 -0
- package/tab-group/tab-group.d.ts +21 -0
- package/tab-group/tab-group.js +97 -0
- package/tab-group/tab-group.scss.js +4 -0
- package/tag/index.d.ts +1 -0
- package/tag/index.js +1 -0
- package/tag/tag.d.ts +11 -0
- package/tag/tag.js +20 -0
- package/tag/tag.scss.js +4 -0
- package/textarea/index.d.ts +1 -0
- package/textarea/index.js +1 -0
- package/textarea/textarea.d.ts +33 -0
- package/textarea/textarea.js +133 -0
- package/textarea/textarea.scss.js +4 -0
- package/textfield/index.d.ts +1 -0
- package/textfield/index.js +1 -0
- package/textfield/textfield.d.ts +34 -0
- package/textfield/textfield.js +136 -0
- package/textfield/textfield.scss.js +4 -0
- package/theme/index.d.ts +1 -0
- package/theme/index.js +1 -0
- package/theme/theme.d.ts +33 -0
- package/theme/theme.js +187 -0
- package/theme/theme.scss.js +4 -0
- package/umd/tinkiet.min.d.ts +3 -30
- package/umd/tinkiet.min.d.ts.map +1 -1
- package/umd/tinkiet.min.js +1 -1
- package/utils/unique.d.ts +7 -0
- package/utils/unique.js +12 -0
package/button/button.js
ADDED
|
@@ -0,0 +1,125 @@
|
|
|
1
|
+
import { __decorate } from 'tslib';
|
|
2
|
+
import { css, unsafeCSS, html } from 'lit';
|
|
3
|
+
import { property, query, customElement } from 'lit/decorators.js';
|
|
4
|
+
import { ifDefined } from 'lit/directives/if-defined.js';
|
|
5
|
+
import '../box/index.js';
|
|
6
|
+
import { uniqueID } from '../utils/unique.js';
|
|
7
|
+
import css_248z from './button.scss.js';
|
|
8
|
+
import { TkBox } from '../box/box.js';
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* A button web component
|
|
12
|
+
*
|
|
13
|
+
* @cssprop --tk-badge-color - Color of widget
|
|
14
|
+
* @cssprop [--tk-badge-color=--primary]
|
|
15
|
+
* @cssprop --tk-badge-text-color - Text color of widget to --on-primary-color
|
|
16
|
+
*
|
|
17
|
+
* @attr {Boolean} accent - accent colors
|
|
18
|
+
* @attr {Boolean} disabled - Disable this element
|
|
19
|
+
* @attr {Boolean} inverted - color and text-color are inverted
|
|
20
|
+
* @attr {Boolean} outlined - outlined
|
|
21
|
+
* @attr {Boolean} pill - rounded corner
|
|
22
|
+
* @attr {Boolean} ripple - display ripple when active
|
|
23
|
+
* @attr {Boolean} small - mini button
|
|
24
|
+
*/
|
|
25
|
+
let TkButton = class TkButton extends TkBox {
|
|
26
|
+
constructor() {
|
|
27
|
+
super(...arguments);
|
|
28
|
+
this._id = uniqueID();
|
|
29
|
+
this.href = null;
|
|
30
|
+
this.type = "button";
|
|
31
|
+
this.disabled = false;
|
|
32
|
+
}
|
|
33
|
+
static get styles() {
|
|
34
|
+
return [
|
|
35
|
+
...TkBox.styles,
|
|
36
|
+
css `
|
|
37
|
+
${unsafeCSS(css_248z)}
|
|
38
|
+
`
|
|
39
|
+
];
|
|
40
|
+
}
|
|
41
|
+
render() {
|
|
42
|
+
return html `
|
|
43
|
+
<div class="before">
|
|
44
|
+
<slot name="before"></slot>
|
|
45
|
+
</div>
|
|
46
|
+
<div class="content">
|
|
47
|
+
<slot></slot>
|
|
48
|
+
</div>
|
|
49
|
+
<div class="after">
|
|
50
|
+
<slot name="after"></slot>
|
|
51
|
+
</div>
|
|
52
|
+
<div class="badge-in">
|
|
53
|
+
<slot name="badge-in"></slot>
|
|
54
|
+
</div>
|
|
55
|
+
<div class="badge-out">
|
|
56
|
+
<slot name="badge-out"></slot>
|
|
57
|
+
</div>
|
|
58
|
+
${this.href
|
|
59
|
+
? html `
|
|
60
|
+
<a tabindex="-1" hidden id="ahref" href="${this.href}" target="${ifDefined(this.target)}" rel="noreferrer"></a>
|
|
61
|
+
`
|
|
62
|
+
: ""}
|
|
63
|
+
<button id=${this._id} hidden type="${ifDefined(this.type)}"></button>
|
|
64
|
+
`;
|
|
65
|
+
}
|
|
66
|
+
connectedCallback() {
|
|
67
|
+
super.connectedCallback();
|
|
68
|
+
this.addEventListener("click", this.handleClick.bind(this));
|
|
69
|
+
this.addEventListener("keydown", this.onKeyDown.bind(this));
|
|
70
|
+
}
|
|
71
|
+
disconnectedCallback() {
|
|
72
|
+
super.disconnectedCallback();
|
|
73
|
+
this.removeEventListener("click", this.handleClick);
|
|
74
|
+
this.removeEventListener("keydown", this.onKeyDown);
|
|
75
|
+
}
|
|
76
|
+
updated(props) {
|
|
77
|
+
this.tabIndex = this.disabled ? -1 : 0;
|
|
78
|
+
super.updated(props);
|
|
79
|
+
}
|
|
80
|
+
onKeyDown(e) {
|
|
81
|
+
if (e.code === "Space" || e.code === "Enter") {
|
|
82
|
+
e.preventDefault();
|
|
83
|
+
e.stopPropagation();
|
|
84
|
+
this.click();
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
firstUpdated() {
|
|
88
|
+
if (this.type == "submit" || this.type == "reset")
|
|
89
|
+
this.appendChild(this.$button);
|
|
90
|
+
}
|
|
91
|
+
handleClick(e) {
|
|
92
|
+
var _a;
|
|
93
|
+
if (this.href && e.isTrusted) {
|
|
94
|
+
e.stopPropagation();
|
|
95
|
+
e.preventDefault();
|
|
96
|
+
this.$ahref.click();
|
|
97
|
+
}
|
|
98
|
+
else if (e.isTrusted && this.type == "submit" || this.type == "reset") {
|
|
99
|
+
(_a = this.querySelector("button")) === null || _a === void 0 ? void 0 : _a.click();
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
};
|
|
103
|
+
__decorate([
|
|
104
|
+
property()
|
|
105
|
+
], TkButton.prototype, "href", void 0);
|
|
106
|
+
__decorate([
|
|
107
|
+
property()
|
|
108
|
+
], TkButton.prototype, "target", void 0);
|
|
109
|
+
__decorate([
|
|
110
|
+
property()
|
|
111
|
+
], TkButton.prototype, "type", void 0);
|
|
112
|
+
__decorate([
|
|
113
|
+
property({ type: Boolean })
|
|
114
|
+
], TkButton.prototype, "disabled", void 0);
|
|
115
|
+
__decorate([
|
|
116
|
+
query("#ahref")
|
|
117
|
+
], TkButton.prototype, "$ahref", void 0);
|
|
118
|
+
__decorate([
|
|
119
|
+
query("button")
|
|
120
|
+
], TkButton.prototype, "$button", void 0);
|
|
121
|
+
TkButton = __decorate([
|
|
122
|
+
customElement("tk-button")
|
|
123
|
+
], TkButton);
|
|
124
|
+
|
|
125
|
+
export { TkButton };
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
var css_248z = "*{-webkit-tap-highlight-color:rgba(0,0,0,0);-webkit-tap-highlight-color:transparent;box-sizing:border-box}:host{--color:var(--primary,hsl(var(--primary-h,258.987),var(--primary-s,38.1643%),var(--primary-l,59.4118%)));--color-darker:var(--primary-darker,hsl(var(--primary-h,258.987),var(--primary-s,38.1643%),calc(var(--primary-l, 59.4118%)*0.7)));--text:var(--on-primary,hsl(var(--on-primary-h,0),var(--on-primary-s,0%),var(--on-primary-l,100%)));align-items:center;background-color:var(--color);border:1px solid var(--color);border-radius:var(--border-radius-medium,.25rem);box-sizing:border-box;color:var(--text);cursor:pointer;display:inline-flex;flex-direction:row;font-family:Roboto,sans-serif;justify-content:center;letter-spacing:.8px;padding:var(--spacing-s,.5rem) var(--spacing-m,1rem);position:relative;text-align:center;text-decoration:none;text-overflow:ellipsis;user-select:none;vertical-align:middle}:host .content{align-items:center;display:flex;pointer-events:none}:host .before{align-items:center;display:flex}:host .before ::slotted(*){margin-right:var(--spacing-s,.5rem)}:host .after{align-items:center;display:flex}:host .after ::slotted(*){margin-left:var(--spacing-s,.5rem)}:host .badge-out{display:flex;pointer-events:none;position:absolute;right:-.8em;top:-.7em}:host .badge-in{display:flex;pointer-events:none;position:absolute;right:2px;top:2px}:host(:focus){outline:none}:host(:focus),:host(:hover){--color:var(--primary-light,hsl(var(--primary-h,258.987),var(--primary-s,38.1643%),calc(var(--primary-l, 59.4118%)*1.15)))}:host(:active){--color:var(--primary,hsl(var(--primary-h,258.987),var(--primary-s,38.1643%),var(--primary-l,59.4118%)))}:host([inverted]){--color:var(--on-primary,hsl(var(--on-primary-h,0),var(--on-primary-s,0%),var(--on-primary-l,100%)));--text:var(--primary,hsl(var(--primary-h,258.987),var(--primary-s,38.1643%),var(--primary-l,59.4118%)))}:host([inverted]:focus),:host([inverted]:hover){--color:#0000001a}:host([inverted]:active){--color:var(--on-primary,hsl(var(--on-primary-h,0),var(--on-primary-s,0%),var(--on-primary-l,100%)))}:host([accent]){--color:var(--accent,hsl(var(--accent-h,8.76404),var(--accent-s,64.0288%),var(--accent-l,72.7451%)));--color-darker:var(--accent,hsl(var(--accent-h,8.76404),var(--accent-s,64.0288%),var(--accent-l,72.7451%)))}:host([accent]:focus),:host([accent]:hover){--color:var(--accent-light,hsl(var(--accent-h,8.76404),var(--accent-s,64.0288%),calc(var(--accent-l, 72.7451%)*1.15)))}:host([accent]:active){--color:var(--accent,hsl(var(--accent-h,8.76404),var(--accent-s,64.0288%),var(--accent-l,72.7451%)))}:host([accent][inverted]){--color:var(--on-accent,hsl(var(--on-accent-h,0),var(--on-accent-s,0%),var(--on-accent-l,100%)));--text:var(--accent,hsl(var(--accent-h,8.76404),var(--accent-s,64.0288%),var(--accent-l,72.7451%)))}:host([accent][inverted]:focus),:host([accent][inverted]:hover){--color:#0000001a}:host([accent][inverted]:active){--color:var(--on-accent,hsl(var(--on-accent-h,0),var(--on-accent-s,0%),var(--on-accent-l,100%)))}:host([outlined]){background:var(--background,#f7f7f7) radial-gradient(circle,#0000 1%,var(--background,#f7f7f7) 1%) center/15000%;color:var(--color)}:host([pill]){border-radius:var(--border-radius-pill,9999px)}:host([small]){font-size:.8em;height:28px;line-height:.9em;padding:0 var(--spacing-s,.5rem)}:host([small]) .before ::slotted(*){margin-right:var(--spacing-xs,.25rem)}:host([small]) .after ::slotted(*){margin-left:var(--spacing-xs,.25rem)}:host([fab]){align-items:center;border-radius:50%;box-shadow:var(--elevation-1,0 1px 2px var(--shadow));height:40px;justify-content:center;line-height:normal;overflow:hidden;padding:0;width:40px}:host([fab]):hover{box-shadow:var(--elevation-3,0 4px 8px var(--shadow))}:host([fab][small]){font-size:.75em;height:30px;width:30px}:host([flat]){box-shadow:none}:host([flat]):hover{box-shadow:none}:host([disabled]),:host([disabled][accent]){--text:var(--button-color-disabled,var(--shade-lighter));--color:var(--button-bg-disabled,var(--shade,hsl(var(--shade-h,0),var(--shade-s,0%),var(--shade-l,66.6667%))));box-shadow:none;cursor:default;pointer-events:none}";
|
|
2
|
+
var stylesheet="*{-webkit-tap-highlight-color:rgba(0,0,0,0);-webkit-tap-highlight-color:transparent;box-sizing:border-box}:host{--color:var(--primary,hsl(var(--primary-h,258.987),var(--primary-s,38.1643%),var(--primary-l,59.4118%)));--color-darker:var(--primary-darker,hsl(var(--primary-h,258.987),var(--primary-s,38.1643%),calc(var(--primary-l, 59.4118%)*0.7)));--text:var(--on-primary,hsl(var(--on-primary-h,0),var(--on-primary-s,0%),var(--on-primary-l,100%)));align-items:center;background-color:var(--color);border:1px solid var(--color);border-radius:var(--border-radius-medium,.25rem);box-sizing:border-box;color:var(--text);cursor:pointer;display:inline-flex;flex-direction:row;font-family:Roboto,sans-serif;justify-content:center;letter-spacing:.8px;padding:var(--spacing-s,.5rem) var(--spacing-m,1rem);position:relative;text-align:center;text-decoration:none;text-overflow:ellipsis;user-select:none;vertical-align:middle}:host .content{align-items:center;display:flex;pointer-events:none}:host .before{align-items:center;display:flex}:host .before ::slotted(*){margin-right:var(--spacing-s,.5rem)}:host .after{align-items:center;display:flex}:host .after ::slotted(*){margin-left:var(--spacing-s,.5rem)}:host .badge-out{display:flex;pointer-events:none;position:absolute;right:-.8em;top:-.7em}:host .badge-in{display:flex;pointer-events:none;position:absolute;right:2px;top:2px}:host(:focus){outline:none}:host(:focus),:host(:hover){--color:var(--primary-light,hsl(var(--primary-h,258.987),var(--primary-s,38.1643%),calc(var(--primary-l, 59.4118%)*1.15)))}:host(:active){--color:var(--primary,hsl(var(--primary-h,258.987),var(--primary-s,38.1643%),var(--primary-l,59.4118%)))}:host([inverted]){--color:var(--on-primary,hsl(var(--on-primary-h,0),var(--on-primary-s,0%),var(--on-primary-l,100%)));--text:var(--primary,hsl(var(--primary-h,258.987),var(--primary-s,38.1643%),var(--primary-l,59.4118%)))}:host([inverted]:focus),:host([inverted]:hover){--color:#0000001a}:host([inverted]:active){--color:var(--on-primary,hsl(var(--on-primary-h,0),var(--on-primary-s,0%),var(--on-primary-l,100%)))}:host([accent]){--color:var(--accent,hsl(var(--accent-h,8.76404),var(--accent-s,64.0288%),var(--accent-l,72.7451%)));--color-darker:var(--accent,hsl(var(--accent-h,8.76404),var(--accent-s,64.0288%),var(--accent-l,72.7451%)))}:host([accent]:focus),:host([accent]:hover){--color:var(--accent-light,hsl(var(--accent-h,8.76404),var(--accent-s,64.0288%),calc(var(--accent-l, 72.7451%)*1.15)))}:host([accent]:active){--color:var(--accent,hsl(var(--accent-h,8.76404),var(--accent-s,64.0288%),var(--accent-l,72.7451%)))}:host([accent][inverted]){--color:var(--on-accent,hsl(var(--on-accent-h,0),var(--on-accent-s,0%),var(--on-accent-l,100%)));--text:var(--accent,hsl(var(--accent-h,8.76404),var(--accent-s,64.0288%),var(--accent-l,72.7451%)))}:host([accent][inverted]:focus),:host([accent][inverted]:hover){--color:#0000001a}:host([accent][inverted]:active){--color:var(--on-accent,hsl(var(--on-accent-h,0),var(--on-accent-s,0%),var(--on-accent-l,100%)))}:host([outlined]){background:var(--background,#f7f7f7) radial-gradient(circle,#0000 1%,var(--background,#f7f7f7) 1%) center/15000%;color:var(--color)}:host([pill]){border-radius:var(--border-radius-pill,9999px)}:host([small]){font-size:.8em;height:28px;line-height:.9em;padding:0 var(--spacing-s,.5rem)}:host([small]) .before ::slotted(*){margin-right:var(--spacing-xs,.25rem)}:host([small]) .after ::slotted(*){margin-left:var(--spacing-xs,.25rem)}:host([fab]){align-items:center;border-radius:50%;box-shadow:var(--elevation-1,0 1px 2px var(--shadow));height:40px;justify-content:center;line-height:normal;overflow:hidden;padding:0;width:40px}:host([fab]):hover{box-shadow:var(--elevation-3,0 4px 8px var(--shadow))}:host([fab][small]){font-size:.75em;height:30px;width:30px}:host([flat]){box-shadow:none}:host([flat]):hover{box-shadow:none}:host([disabled]),:host([disabled][accent]){--text:var(--button-color-disabled,var(--shade-lighter));--color:var(--button-bg-disabled,var(--shade,hsl(var(--shade-h,0),var(--shade-s,0%),var(--shade-l,66.6667%))));box-shadow:none;cursor:default;pointer-events:none}";
|
|
3
|
+
|
|
4
|
+
export { css_248z as default, stylesheet };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./button";
|
package/button/index.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { TkButton } from './button.js';
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { LitElement } from "lit";
|
|
2
|
+
declare class TkCheckbox extends LitElement {
|
|
3
|
+
static styles: import("lit").CSSResult;
|
|
4
|
+
private _id;
|
|
5
|
+
name: string;
|
|
6
|
+
value: string;
|
|
7
|
+
checked: boolean;
|
|
8
|
+
private $input;
|
|
9
|
+
render(): import("lit-html").TemplateResult<1>;
|
|
10
|
+
connectedCallback(): void;
|
|
11
|
+
disconnectedCallback(): void;
|
|
12
|
+
firstUpdated(): void;
|
|
13
|
+
protected onKeyDown(e: KeyboardEvent): void;
|
|
14
|
+
protected handleClick(): void;
|
|
15
|
+
}
|
|
16
|
+
declare global {
|
|
17
|
+
interface HTMLElementTagNameMap {
|
|
18
|
+
"tk-checkbox": TkCheckbox;
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
export { TkCheckbox };
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
import { __decorate } from 'tslib';
|
|
2
|
+
import { LitElement, html, css, unsafeCSS } from 'lit';
|
|
3
|
+
import { property, query, customElement } from 'lit/decorators.js';
|
|
4
|
+
import { ifDefined } from 'lit/directives/if-defined.js';
|
|
5
|
+
import '../box/index.js';
|
|
6
|
+
import { uniqueID } from '../utils/unique.js';
|
|
7
|
+
import css_248z from './checkbox.scss.js';
|
|
8
|
+
|
|
9
|
+
let TkCheckbox = class TkCheckbox extends LitElement {
|
|
10
|
+
constructor() {
|
|
11
|
+
super(...arguments);
|
|
12
|
+
this._id = uniqueID();
|
|
13
|
+
this.checked = false;
|
|
14
|
+
}
|
|
15
|
+
render() {
|
|
16
|
+
return html `
|
|
17
|
+
<tk-box direction="row" align-items="center">
|
|
18
|
+
<div tabindex="0" class="checkbox">
|
|
19
|
+
<svg id="checkmark" xmlns="http://www.w3.org/2000/svg" width="100%" height="100%" preserveAspectRatio="none" viewBox="0 0 24 24">
|
|
20
|
+
<path id="checkmark-path" fill="none" d="M1.73,12.91 8.1,19.28 22.79,4.59"></path>
|
|
21
|
+
<line id="indeterminate-path" fill="none" x1="0" y1="12.5" x2="24" y2="12.5" />
|
|
22
|
+
</svg>
|
|
23
|
+
</div>
|
|
24
|
+
<span class="label"><slot></slot></span>
|
|
25
|
+
</tk-box>
|
|
26
|
+
<input
|
|
27
|
+
id=${this._id}
|
|
28
|
+
slot="none"
|
|
29
|
+
style="display: none;"
|
|
30
|
+
?checked=${this.checked}
|
|
31
|
+
type="checkbox"
|
|
32
|
+
name="${ifDefined(this.name)}"
|
|
33
|
+
value="${ifDefined(this.value)}"
|
|
34
|
+
aria-hidden="true"
|
|
35
|
+
tabindex="-1"
|
|
36
|
+
/>
|
|
37
|
+
`;
|
|
38
|
+
}
|
|
39
|
+
connectedCallback() {
|
|
40
|
+
super.connectedCallback();
|
|
41
|
+
this.addEventListener("click", this.handleClick.bind(this));
|
|
42
|
+
this.addEventListener("keydown", this.onKeyDown.bind(this));
|
|
43
|
+
}
|
|
44
|
+
disconnectedCallback() {
|
|
45
|
+
super.disconnectedCallback();
|
|
46
|
+
this.removeEventListener("click", this.handleClick);
|
|
47
|
+
this.removeEventListener("keydown", this.onKeyDown);
|
|
48
|
+
}
|
|
49
|
+
firstUpdated() {
|
|
50
|
+
this.appendChild(this.$input);
|
|
51
|
+
}
|
|
52
|
+
onKeyDown(e) {
|
|
53
|
+
if (e.code === "Space" || e.code === "Enter") {
|
|
54
|
+
e.preventDefault();
|
|
55
|
+
e.stopPropagation();
|
|
56
|
+
this.click();
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
handleClick() {
|
|
60
|
+
this.checked = !this.checked;
|
|
61
|
+
setTimeout(() => this.dispatchEvent(new Event("change", { bubbles: true, composed: true })));
|
|
62
|
+
}
|
|
63
|
+
};
|
|
64
|
+
TkCheckbox.styles = css `
|
|
65
|
+
${unsafeCSS(css_248z)}
|
|
66
|
+
`;
|
|
67
|
+
__decorate([
|
|
68
|
+
property({ attribute: true, type: String })
|
|
69
|
+
], TkCheckbox.prototype, "name", void 0);
|
|
70
|
+
__decorate([
|
|
71
|
+
property({ attribute: true, type: String })
|
|
72
|
+
], TkCheckbox.prototype, "value", void 0);
|
|
73
|
+
__decorate([
|
|
74
|
+
property({ attribute: true, type: Boolean, reflect: true })
|
|
75
|
+
], TkCheckbox.prototype, "checked", void 0);
|
|
76
|
+
__decorate([
|
|
77
|
+
query("input")
|
|
78
|
+
], TkCheckbox.prototype, "$input", void 0);
|
|
79
|
+
TkCheckbox = __decorate([
|
|
80
|
+
customElement("tk-checkbox")
|
|
81
|
+
], TkCheckbox);
|
|
82
|
+
|
|
83
|
+
export { TkCheckbox };
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
var css_248z = "*{-webkit-tap-highlight-color:rgba(0,0,0,0);-webkit-tap-highlight-color:transparent;box-sizing:border-box}:host{--_checkbox-bg:var(--checkbox-bg,#0000);--_checkbox-color:var(--checkbox-color,var(--shade,hsl(var(--shade-h,0),var(--shade-s,0%),var(--shade-l,66.6667%))));display:inline-flex}:host .checkbox{align-items:center;background:var(--_checkbox-bg);border:var(--checkbox-border-config,.125rem solid) currentColor;border-radius:var(--checkbox-border-radius,.375rem);color:var(--_checkbox-color);display:inline-flex;height:var(--checkbox-size,1.25rem);justify-content:center;margin:0 5px;min-width:var(--checkbox-size,1.25rem);outline:none;position:relative;transition:var(--checkbox-transition,background var(--transition-duration-fast,.12s) var(--transition-timing-function-deceleration-curve,cubic-bezier(0,0,.2,1)),border-color var(--transition-duration-fast,.12s) var(--transition-timing-function-deceleration-curve,cubic-bezier(0,0,.2,1)));-webkit-user-select:none;user-select:none;width:var(--checkbox-size,1.25rem)}:host .label{font-size:1.1em}:host(:not([disabled])){cursor:pointer}:host([checked]),:host([indeterminate]){--_checkbox-bg:var(--checkbox-bg-checked,var(--primary,hsl(var(--primary-h,258.987),var(--primary-s,38.1643%),var(--primary-l,59.4118%))));--_checkbox-color:var(--checkbox-color-checked,var(--primary,hsl(var(--primary-h,258.987),var(--primary-s,38.1643%),var(--primary-l,59.4118%))))}:host([checked]:not([indeterminate])) #checkmark-path,:host([indeterminate]) #indeterminate-path{stroke-dashoffset:0}:host(:focus),:host(:hover){will-change:border,background}:host(:focus) #checkmark-path,:host(:hover) #checkmark-path{will-change:stroke-dashoffset}:host([disabled]){--_checkbox-bg:var(--checkbox-bg-disabled,#0000);--_checkbox-color:var(--checkbox-color-disabled,var(--shade,hsl(var(--shade-h,0),var(--shade-s,0%),var(--shade-l,66.6667%))));color:var(--shade,hsl(var(--shade-h,0),var(--shade-s,0%),var(--shade-l,66.6667%)));pointer-events:none}:host([disabled][checked]),:host([disabled][indeterminate]){--_checkbox-bg:var(--checkbox-bg-disabled-checked,var(--shade,hsl(var(--shade-h,0),var(--shade-s,0%),var(--shade-l,66.6667%))));--_checkbox-color:var(--checkbox-color-disabled-checked,var(--shade-lighter,hsl(var(--shade-h,0),var(--shade-s,0%),calc(var(--shade-l, 66.6667%)*1.3))))}#checkmark{height:var(--checkbox-checkmark-size,.75rem);width:var(--checkbox-checkmark-size,.75rem)}#checkmark-path,#indeterminate-path{stroke-width:var(--checkbox-checkmark-path-width,.3rem);stroke:var(--checkbox-checkmark-stroke-color,var(--on-primary,hsl(var(--on-primary-h,0),var(--on-primary-s,0%),var(--on-primary-l,100%))));stroke-dasharray:var(--checkbox-checkmark-path-dasharray,30);stroke-dashoffset:var(--checkbox-checkmark-path-dasharray,30);transition:var(--checkbox-checkmark-transition,stroke-dashoffset var(--transition-duration-medium,.18s) var(--transition-timing-function-deceleration-curve,cubic-bezier(0,0,.2,1)))}#checkmark-path{transition-delay:var(--checkbox-checkmark-path-delay,50ms)}#ripple{transform:var(--checkbox-ripple-transform,translate(-50%,-50%) scale(1.8))}";
|
|
2
|
+
var stylesheet="*{-webkit-tap-highlight-color:rgba(0,0,0,0);-webkit-tap-highlight-color:transparent;box-sizing:border-box}:host{--_checkbox-bg:var(--checkbox-bg,#0000);--_checkbox-color:var(--checkbox-color,var(--shade,hsl(var(--shade-h,0),var(--shade-s,0%),var(--shade-l,66.6667%))));display:inline-flex}:host .checkbox{align-items:center;background:var(--_checkbox-bg);border:var(--checkbox-border-config,.125rem solid) currentColor;border-radius:var(--checkbox-border-radius,.375rem);color:var(--_checkbox-color);display:inline-flex;height:var(--checkbox-size,1.25rem);justify-content:center;margin:0 5px;min-width:var(--checkbox-size,1.25rem);outline:none;position:relative;transition:var(--checkbox-transition,background var(--transition-duration-fast,.12s) var(--transition-timing-function-deceleration-curve,cubic-bezier(0,0,.2,1)),border-color var(--transition-duration-fast,.12s) var(--transition-timing-function-deceleration-curve,cubic-bezier(0,0,.2,1)));-webkit-user-select:none;user-select:none;width:var(--checkbox-size,1.25rem)}:host .label{font-size:1.1em}:host(:not([disabled])){cursor:pointer}:host([checked]),:host([indeterminate]){--_checkbox-bg:var(--checkbox-bg-checked,var(--primary,hsl(var(--primary-h,258.987),var(--primary-s,38.1643%),var(--primary-l,59.4118%))));--_checkbox-color:var(--checkbox-color-checked,var(--primary,hsl(var(--primary-h,258.987),var(--primary-s,38.1643%),var(--primary-l,59.4118%))))}:host([checked]:not([indeterminate])) #checkmark-path,:host([indeterminate]) #indeterminate-path{stroke-dashoffset:0}:host(:focus),:host(:hover){will-change:border,background}:host(:focus) #checkmark-path,:host(:hover) #checkmark-path{will-change:stroke-dashoffset}:host([disabled]){--_checkbox-bg:var(--checkbox-bg-disabled,#0000);--_checkbox-color:var(--checkbox-color-disabled,var(--shade,hsl(var(--shade-h,0),var(--shade-s,0%),var(--shade-l,66.6667%))));color:var(--shade,hsl(var(--shade-h,0),var(--shade-s,0%),var(--shade-l,66.6667%)));pointer-events:none}:host([disabled][checked]),:host([disabled][indeterminate]){--_checkbox-bg:var(--checkbox-bg-disabled-checked,var(--shade,hsl(var(--shade-h,0),var(--shade-s,0%),var(--shade-l,66.6667%))));--_checkbox-color:var(--checkbox-color-disabled-checked,var(--shade-lighter,hsl(var(--shade-h,0),var(--shade-s,0%),calc(var(--shade-l, 66.6667%)*1.3))))}#checkmark{height:var(--checkbox-checkmark-size,.75rem);width:var(--checkbox-checkmark-size,.75rem)}#checkmark-path,#indeterminate-path{stroke-width:var(--checkbox-checkmark-path-width,.3rem);stroke:var(--checkbox-checkmark-stroke-color,var(--on-primary,hsl(var(--on-primary-h,0),var(--on-primary-s,0%),var(--on-primary-l,100%))));stroke-dasharray:var(--checkbox-checkmark-path-dasharray,30);stroke-dashoffset:var(--checkbox-checkmark-path-dasharray,30);transition:var(--checkbox-checkmark-transition,stroke-dashoffset var(--transition-duration-medium,.18s) var(--transition-timing-function-deceleration-curve,cubic-bezier(0,0,.2,1)))}#checkmark-path{transition-delay:var(--checkbox-checkmark-path-delay,50ms)}#ripple{transform:var(--checkbox-ripple-transform,translate(-50%,-50%) scale(1.8))}";
|
|
3
|
+
|
|
4
|
+
export { css_248z as default, stylesheet };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./checkbox";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { TkCheckbox } from './checkbox.js';
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { LitElement } from "lit";
|
|
2
|
+
declare class TkDialog extends LitElement {
|
|
3
|
+
static styles: import("lit").CSSResult;
|
|
4
|
+
modal: boolean;
|
|
5
|
+
open: boolean;
|
|
6
|
+
blurOverlay: boolean;
|
|
7
|
+
private resolve;
|
|
8
|
+
render(): import("lit-html").TemplateResult<1>;
|
|
9
|
+
updated(props: any): void;
|
|
10
|
+
show(): Promise<string | boolean | null>;
|
|
11
|
+
hide(value?: boolean | string | null): void;
|
|
12
|
+
}
|
|
13
|
+
declare global {
|
|
14
|
+
interface HTMLElementTagNameMap {
|
|
15
|
+
"tk-dialog": TkDialog;
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
export { TkDialog };
|
package/dialog/dialog.js
ADDED
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import { __decorate } from 'tslib';
|
|
2
|
+
import { LitElement, html, css, unsafeCSS } from 'lit';
|
|
3
|
+
import { property, customElement } from 'lit/decorators.js';
|
|
4
|
+
import css_248z from './dialog.scss.js';
|
|
5
|
+
|
|
6
|
+
let TkDialog = class TkDialog extends LitElement {
|
|
7
|
+
constructor() {
|
|
8
|
+
super(...arguments);
|
|
9
|
+
this.modal = false;
|
|
10
|
+
this.open = false;
|
|
11
|
+
this.blurOverlay = false;
|
|
12
|
+
}
|
|
13
|
+
render() {
|
|
14
|
+
return html `
|
|
15
|
+
${this.open
|
|
16
|
+
? html `
|
|
17
|
+
<div class="overlay ${this.blurOverlay ? "blur" : ""}" @click=${() => (this.modal ? null : this.hide())}></div>
|
|
18
|
+
<div class="container">
|
|
19
|
+
<slot></slot>
|
|
20
|
+
</div>
|
|
21
|
+
`
|
|
22
|
+
: ""}
|
|
23
|
+
`;
|
|
24
|
+
}
|
|
25
|
+
updated(props) {
|
|
26
|
+
if (props.has("open") && this.open)
|
|
27
|
+
this.dispatchEvent(new Event("did-show"));
|
|
28
|
+
if (props.has("open") && !this.open)
|
|
29
|
+
this.dispatchEvent(new Event("did-close"));
|
|
30
|
+
}
|
|
31
|
+
show() {
|
|
32
|
+
this.open = true;
|
|
33
|
+
return new Promise(resolve => {
|
|
34
|
+
this.resolve = resolve;
|
|
35
|
+
});
|
|
36
|
+
}
|
|
37
|
+
hide(value = null) {
|
|
38
|
+
this.open = false;
|
|
39
|
+
this.resolve(value);
|
|
40
|
+
}
|
|
41
|
+
};
|
|
42
|
+
TkDialog.styles = css `
|
|
43
|
+
${unsafeCSS(css_248z)}
|
|
44
|
+
`;
|
|
45
|
+
__decorate([
|
|
46
|
+
property({ type: Boolean, attribute: true })
|
|
47
|
+
], TkDialog.prototype, "modal", void 0);
|
|
48
|
+
__decorate([
|
|
49
|
+
property({ type: Boolean, attribute: true, reflect: true })
|
|
50
|
+
], TkDialog.prototype, "open", void 0);
|
|
51
|
+
__decorate([
|
|
52
|
+
property({ type: Boolean, attribute: "blur-overlay" })
|
|
53
|
+
], TkDialog.prototype, "blurOverlay", void 0);
|
|
54
|
+
TkDialog = __decorate([
|
|
55
|
+
customElement("tk-dialog")
|
|
56
|
+
], TkDialog);
|
|
57
|
+
|
|
58
|
+
export { TkDialog };
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
var css_248z = "*{-webkit-tap-highlight-color:rgba(0,0,0,0);-webkit-tap-highlight-color:transparent;box-sizing:border-box}:host{display:none;outline:none;position:relative}:host([open]){align-items:center;display:flex;height:100%;justify-content:center;left:0;position:fixed;top:0;width:100%;z-index:var(--dialog-z-index,300)}:host([open]) .overlay{background-color:#00000080;bottom:0;left:0;position:absolute;right:0;top:0}:host([open]) .overlay.blur{backdrop-filter:blur(2px)}:host([open]) .container{animation:fade-in .3s forwards;border-radius:var(--border-radius-medium,.25rem);height:100%;margin:0;max-width:100%;overflow-y:auto;overscroll-behavior:contain;padding:1rem;position:fixed;width:fit-content;will-change:transform,opacity}@keyframes fade-in{0%{opacity:0}to{opacity:1}}@media (max-width:400px){:host([open]) .container{padding:.1rem}}";
|
|
2
|
+
var stylesheet="*{-webkit-tap-highlight-color:rgba(0,0,0,0);-webkit-tap-highlight-color:transparent;box-sizing:border-box}:host{display:none;outline:none;position:relative}:host([open]){align-items:center;display:flex;height:100%;justify-content:center;left:0;position:fixed;top:0;width:100%;z-index:var(--dialog-z-index,300)}:host([open]) .overlay{background-color:#00000080;bottom:0;left:0;position:absolute;right:0;top:0}:host([open]) .overlay.blur{backdrop-filter:blur(2px)}:host([open]) .container{animation:fade-in .3s forwards;border-radius:var(--border-radius-medium,.25rem);height:100%;margin:0;max-width:100%;overflow-y:auto;overscroll-behavior:contain;padding:1rem;position:fixed;width:fit-content;will-change:transform,opacity}@keyframes fade-in{0%{opacity:0}to{opacity:1}}@media (max-width:400px){:host([open]) .container{padding:.1rem}}";
|
|
3
|
+
|
|
4
|
+
export { css_248z as default, stylesheet };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./dialog";
|
package/dialog/index.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { TkDialog } from './dialog.js';
|
package/form/form.d.ts
ADDED
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { LitElement } from "lit";
|
|
2
|
+
declare class TkForm extends LitElement {
|
|
3
|
+
value: any;
|
|
4
|
+
protected createRenderRoot(): Element | ShadowRoot;
|
|
5
|
+
connectedCallback(): void;
|
|
6
|
+
disconnectedCallback(): void;
|
|
7
|
+
submit(e: Event): void;
|
|
8
|
+
getFormDataAsObject(): any;
|
|
9
|
+
}
|
|
10
|
+
declare global {
|
|
11
|
+
interface HTMLElementTagNameMap {
|
|
12
|
+
"tk-form": TkForm;
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
export { TkForm };
|
package/form/form.js
ADDED
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import { __decorate } from 'tslib';
|
|
2
|
+
import { LitElement } from 'lit';
|
|
3
|
+
import { property, customElement } from 'lit/decorators.js';
|
|
4
|
+
|
|
5
|
+
let TkForm = class TkForm extends LitElement {
|
|
6
|
+
createRenderRoot() {
|
|
7
|
+
return this;
|
|
8
|
+
}
|
|
9
|
+
connectedCallback() {
|
|
10
|
+
super.connectedCallback();
|
|
11
|
+
this.addEventListener("submit", this.submit);
|
|
12
|
+
}
|
|
13
|
+
disconnectedCallback() {
|
|
14
|
+
super.disconnectedCallback();
|
|
15
|
+
this.removeEventListener("submit", this.submit);
|
|
16
|
+
}
|
|
17
|
+
submit(e) {
|
|
18
|
+
e.preventDefault();
|
|
19
|
+
const result = this.getFormDataAsObject();
|
|
20
|
+
this.dispatchEvent(new CustomEvent("fulfill", { detail: result }));
|
|
21
|
+
}
|
|
22
|
+
getFormDataAsObject() {
|
|
23
|
+
const $form = this.querySelector("form");
|
|
24
|
+
const result = {};
|
|
25
|
+
const data = new FormData($form);
|
|
26
|
+
data.forEach((value, key) => {
|
|
27
|
+
var _a;
|
|
28
|
+
const $inputElement = this.querySelector(`[name=${key}]`);
|
|
29
|
+
if ($inputElement.tagName == "TK-SLIDER") {
|
|
30
|
+
value = Number(value);
|
|
31
|
+
}
|
|
32
|
+
if ($inputElement.tagName == "TK-CHECKBOX" && (value == "on" || value == "true")) {
|
|
33
|
+
value = true;
|
|
34
|
+
}
|
|
35
|
+
if ($inputElement.tagName == "TK-RADIO" && (value == "on" || value == "true")) {
|
|
36
|
+
value = true;
|
|
37
|
+
}
|
|
38
|
+
if (key.indexOf("-") > 0) {
|
|
39
|
+
const _ks = key.split("-");
|
|
40
|
+
result[_ks[0]] = (_a = result[_ks[0]]) !== null && _a !== void 0 ? _a : {};
|
|
41
|
+
result[_ks[0]][_ks[1]] = value;
|
|
42
|
+
}
|
|
43
|
+
else {
|
|
44
|
+
result[key] = value;
|
|
45
|
+
}
|
|
46
|
+
});
|
|
47
|
+
return result;
|
|
48
|
+
}
|
|
49
|
+
};
|
|
50
|
+
__decorate([
|
|
51
|
+
property()
|
|
52
|
+
], TkForm.prototype, "value", void 0);
|
|
53
|
+
TkForm = __decorate([
|
|
54
|
+
customElement("tk-form")
|
|
55
|
+
], TkForm);
|
|
56
|
+
|
|
57
|
+
export { TkForm };
|
package/form/index.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { TkForm } from "./form";
|
package/form/index.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { TkForm } from './form.js';
|
package/icon/icon.d.ts
ADDED
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { TkBox } from "../box/index";
|
|
2
|
+
declare class TkIcon extends TkBox {
|
|
3
|
+
static get styles(): import("lit").CSSResult[];
|
|
4
|
+
name: string;
|
|
5
|
+
library: string;
|
|
6
|
+
path: string;
|
|
7
|
+
private svg;
|
|
8
|
+
render(): import("lit-html").TemplateResult<1>;
|
|
9
|
+
updated(props: any): void;
|
|
10
|
+
loadIcon(): Promise<void>;
|
|
11
|
+
}
|
|
12
|
+
declare global {
|
|
13
|
+
interface HTMLElementTagNameMap {
|
|
14
|
+
"tk-icon": TkIcon;
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
export { TkIcon };
|
package/icon/icon.js
ADDED
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
import { __awaiter, __decorate } from 'tslib';
|
|
2
|
+
import { css, unsafeCSS, html } from 'lit';
|
|
3
|
+
import { property, customElement } from 'lit/decorators.js';
|
|
4
|
+
import { unsafeHTML } from 'lit/directives/unsafe-html.js';
|
|
5
|
+
import '../box/index.js';
|
|
6
|
+
import css_248z from './icon.scss.js';
|
|
7
|
+
import { TkBox } from '../box/box.js';
|
|
8
|
+
|
|
9
|
+
let TkIcon = class TkIcon extends TkBox {
|
|
10
|
+
constructor() {
|
|
11
|
+
super(...arguments);
|
|
12
|
+
this.svg = "";
|
|
13
|
+
}
|
|
14
|
+
static get styles() {
|
|
15
|
+
return [
|
|
16
|
+
...TkBox.styles,
|
|
17
|
+
css `
|
|
18
|
+
${unsafeCSS(css_248z)}
|
|
19
|
+
`
|
|
20
|
+
];
|
|
21
|
+
}
|
|
22
|
+
render() {
|
|
23
|
+
return html `
|
|
24
|
+
${this.path
|
|
25
|
+
? html `
|
|
26
|
+
<svg viewBox="0 0 24 24"><path d="${this.path}"></path></svg>
|
|
27
|
+
`
|
|
28
|
+
: html `
|
|
29
|
+
${unsafeHTML(this.svg)}
|
|
30
|
+
`}
|
|
31
|
+
`;
|
|
32
|
+
}
|
|
33
|
+
updated(props) {
|
|
34
|
+
if (props.has("name") && this.name)
|
|
35
|
+
this.loadIcon();
|
|
36
|
+
}
|
|
37
|
+
loadIcon() {
|
|
38
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
39
|
+
const resolver = this.library
|
|
40
|
+
? document.querySelector(`tk-icons[library=${this.library}]`)
|
|
41
|
+
: document.querySelector("tk-icons");
|
|
42
|
+
if (resolver) {
|
|
43
|
+
this.svg = yield fetch(resolver.resolve(this.name))
|
|
44
|
+
.then(response => {
|
|
45
|
+
return response.blob().then(blob => {
|
|
46
|
+
return {
|
|
47
|
+
contentType: response.headers.get("Content-Type"),
|
|
48
|
+
raw: blob
|
|
49
|
+
};
|
|
50
|
+
});
|
|
51
|
+
})
|
|
52
|
+
.then(data => {
|
|
53
|
+
if (data.contentType && /svg/.test(data.contentType))
|
|
54
|
+
return data.raw.text();
|
|
55
|
+
return "";
|
|
56
|
+
});
|
|
57
|
+
}
|
|
58
|
+
});
|
|
59
|
+
}
|
|
60
|
+
};
|
|
61
|
+
__decorate([
|
|
62
|
+
property()
|
|
63
|
+
], TkIcon.prototype, "name", void 0);
|
|
64
|
+
__decorate([
|
|
65
|
+
property()
|
|
66
|
+
], TkIcon.prototype, "library", void 0);
|
|
67
|
+
__decorate([
|
|
68
|
+
property()
|
|
69
|
+
], TkIcon.prototype, "path", void 0);
|
|
70
|
+
__decorate([
|
|
71
|
+
property()
|
|
72
|
+
], TkIcon.prototype, "svg", void 0);
|
|
73
|
+
TkIcon = __decorate([
|
|
74
|
+
customElement("tk-icon")
|
|
75
|
+
], TkIcon);
|
|
76
|
+
|
|
77
|
+
export { TkIcon };
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
var css_248z = "*{-webkit-tap-highlight-color:rgba(0,0,0,0);-webkit-tap-highlight-color:transparent;box-sizing:border-box}:host{--color:var(--tk-icon-color,currentColor);display:inline-flex;height:1.5em;width:1.5em}:host svg{fill:var(--color);display:block;height:100%;width:100%}";
|
|
2
|
+
var stylesheet="*{-webkit-tap-highlight-color:rgba(0,0,0,0);-webkit-tap-highlight-color:transparent;box-sizing:border-box}:host{--color:var(--tk-icon-color,currentColor);display:inline-flex;height:1.5em;width:1.5em}:host svg{fill:var(--color);display:block;height:100%;width:100%}";
|
|
3
|
+
|
|
4
|
+
export { css_248z as default, stylesheet };
|
package/icon/icons.d.ts
ADDED
package/icon/icons.js
ADDED
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { __decorate } from 'tslib';
|
|
2
|
+
import { LitElement } from 'lit';
|
|
3
|
+
import { property, customElement } from 'lit/decorators.js';
|
|
4
|
+
|
|
5
|
+
let TkIcons = class TkIcons extends LitElement {
|
|
6
|
+
constructor() {
|
|
7
|
+
super(...arguments);
|
|
8
|
+
this.library = "default";
|
|
9
|
+
}
|
|
10
|
+
firstUpdated() {
|
|
11
|
+
window.document.body.appendChild(this);
|
|
12
|
+
}
|
|
13
|
+
};
|
|
14
|
+
__decorate([
|
|
15
|
+
property({ attribute: false })
|
|
16
|
+
], TkIcons.prototype, "resolve", void 0);
|
|
17
|
+
__decorate([
|
|
18
|
+
property({ reflect: true })
|
|
19
|
+
], TkIcons.prototype, "library", void 0);
|
|
20
|
+
TkIcons = __decorate([
|
|
21
|
+
customElement("tk-icons")
|
|
22
|
+
], TkIcons);
|
|
23
|
+
|
|
24
|
+
export { TkIcons };
|
package/icon/index.d.ts
ADDED
package/icon/index.js
ADDED
package/index.d.ts
ADDED
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
export * from "./accordion/index";
|
|
2
|
+
export * from "./badge/index";
|
|
3
|
+
export * from "./box/index";
|
|
4
|
+
export * from "./button/index";
|
|
5
|
+
export * from "./checkbox/index";
|
|
6
|
+
export * from "./dialog/index";
|
|
7
|
+
export * from "./form/index";
|
|
8
|
+
export * from "./icon/index";
|
|
9
|
+
export * from "./list-item/index";
|
|
10
|
+
export * from "./loading/index";
|
|
11
|
+
export * from "./navbar/index";
|
|
12
|
+
export * from "./notie/index";
|
|
13
|
+
export * from "./pages/index";
|
|
14
|
+
export * from "./radio/index";
|
|
15
|
+
export * from "./select/index";
|
|
16
|
+
export * from "./slider/index";
|
|
17
|
+
export * from "./switch/index";
|
|
18
|
+
export * from "./tab-group/index";
|
|
19
|
+
export * from "./tag/index";
|
|
20
|
+
export * from "./textarea/index";
|
|
21
|
+
export * from "./textfield/index";
|
|
22
|
+
export * from "./theme/index";
|
|
23
|
+
//# sourceMappingURL=index.d.ts.map
|
package/index.d.ts.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../tinkiet/index.ts"],"names":[],"mappings":"AAAA,kCAA4B;AAC5B,8BAAwB;AACxB,4BAAsB;AACtB,+BAAyB;AACzB,iCAA2B;AAC3B,+BAAyB;AAEzB,6BAAuB;AACvB,6BAAuB;AACvB,kCAA4B;AAC5B,gCAA0B;AAC1B,+BAAyB;AACzB,8BAAwB;AACxB,8BAAwB;AACxB,8BAAwB;AACxB,+BAAyB;AACzB,+BAAyB;AACzB,+BAAyB;AACzB,kCAA4B;AAC5B,4BAAsB;AACtB,iCAA2B;AAC3B,kCAA4B;AAC5B,8BAAwB"}
|