tinkiet 0.9.12 → 0.10.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/accordion/accordion.d.ts +3 -4
- package/accordion/index.d.ts +1 -1
- package/accordion/index.js +491 -1
- package/badge/badge.d.ts +2 -3
- package/badge/index.d.ts +1 -1
- package/badge/index.js +134 -1
- package/box/box.d.ts +3 -3
- package/box/focusable-box.d.ts +2 -3
- package/box/index.d.ts +1 -1
- package/box/index.js +289 -1
- package/button/button.d.ts +3 -4
- package/button/index.d.ts +1 -1
- package/button/index.js +502 -1
- package/checkbox/checkbox.d.ts +3 -3
- package/checkbox/index.d.ts +1 -1
- package/checkbox/index.js +450 -1
- package/chip/chip.d.ts +2 -3
- package/chip/index.d.ts +1 -1
- package/chip/index.js +123 -1
- package/dialog/dialog.d.ts +2 -3
- package/dialog/index.d.ts +1 -1
- package/dialog/index.js +162 -1
- package/drawer/drawer.d.ts +2 -3
- package/drawer/index.d.ts +1 -1
- package/drawer/index.js +272 -1
- package/form/form.d.ts +1 -2
- package/form/index.d.ts +1 -1
- package/form/index.js +149 -1
- package/icon/icon.d.ts +3 -4
- package/icon/icons.d.ts +1 -2
- package/icon/index.d.ts +2 -2
- package/icon/index.js +457 -2
- package/index.d.ts +52 -26
- package/index.js +3682 -52
- package/list-item/index.d.ts +1 -1
- package/list-item/index.js +414 -1
- package/list-item/list-item.d.ts +3 -4
- package/loading/index.d.ts +1 -1
- package/loading/index.js +389 -1
- package/loading/loading.d.ts +3 -4
- package/navigation/index.d.ts +2 -2
- package/navigation/index.js +201 -2
- package/navigation/navigation-bar.d.ts +2 -3
- package/navigation/navigation-item.d.ts +2 -3
- package/notie/index.d.ts +1 -1
- package/notie/index.js +744 -1
- package/notie/notie.d.ts +12 -11
- package/package.json +8 -5
- package/pages/index.d.ts +1 -1
- package/pages/index.js +178 -1
- package/pages/pages.d.ts +2 -3
- package/radio/index.d.ts +1 -1
- package/radio/index.js +466 -1
- package/radio/radio.d.ts +3 -3
- package/select/index.d.ts +1 -1
- package/select/index.js +493 -1
- package/select/select.d.ts +3 -3
- package/slider/index.d.ts +1 -1
- package/slider/index.js +274 -1
- package/slider/slider.d.ts +2 -3
- package/snackbar/index.d.ts +1 -0
- package/snackbar/snackbar.d.ts +34 -0
- package/switch/index.d.ts +1 -1
- package/switch/index.js +462 -1
- package/switch/switch.d.ts +3 -3
- package/tab-group/index.d.ts +1 -1
- package/tab-group/index.js +182 -1
- package/tab-group/tab-group.d.ts +2 -3
- package/tab-group/tab-item.d.ts +7 -0
- package/textarea/index.d.ts +1 -1
- package/textarea/index.js +272 -1
- package/textarea/textarea.d.ts +2 -3
- package/textfield/index.d.ts +1 -1
- package/textfield/index.js +278 -1
- package/textfield/textfield.d.ts +2 -3
- package/theme/index.d.ts +1 -1
- package/theme/index.js +240 -1
- package/theme/theme.d.ts +2 -3
- package/tooltip/index.d.ts +1 -1
- package/tooltip/index.js +136 -1
- package/tooltip/tooltip.d.ts +2 -3
- package/topbar/index.d.ts +1 -1
- package/topbar/index.js +358 -1
- package/topbar/topbar.d.ts +3 -4
- package/umd/tinkiet.min.js +420 -1
- package/utils/aria.d.ts +11 -0
- package/utils/unique.d.ts +1 -2
- package/accordion/accordion.js +0 -94
- package/accordion/accordion.scss.js +0 -4
- package/badge/badge.js +0 -31
- package/badge/badge.scss.js +0 -4
- package/box/box.js +0 -186
- package/box/box.scss.js +0 -4
- package/box/focusable-box.js +0 -30
- package/button/button.js +0 -141
- package/button/button.scss.js +0 -4
- package/checkbox/checkbox.js +0 -89
- package/checkbox/checkbox.scss.js +0 -4
- package/chip/chip.js +0 -20
- package/chip/chip.scss.js +0 -4
- package/dialog/dialog.js +0 -59
- package/dialog/dialog.scss.js +0 -4
- package/drawer/drawer.js +0 -168
- package/drawer/drawer.scss.js +0 -4
- package/form/form.js +0 -54
- package/icon/icon.js +0 -77
- package/icon/icon.scss.js +0 -4
- package/icon/icons.js +0 -24
- package/index.d.ts.map +0 -1
- package/list-item/list-item.js +0 -86
- package/list-item/list-item.scss.js +0 -4
- package/loading/loading.js +0 -61
- package/loading/loading.scss.js +0 -4
- package/navigation/navigation-bar.js +0 -20
- package/navigation/navigation-bar.scss.js +0 -4
- package/navigation/navigation-item.js +0 -51
- package/navigation/navigation-item.scss.js +0 -4
- package/notie/notie.js +0 -201
- package/notie/notie.scss.js +0 -4
- package/pages/pages.js +0 -75
- package/pages/pages.scss.js +0 -4
- package/radio/radio.js +0 -105
- package/radio/radio.scss.js +0 -4
- package/select/select.js +0 -132
- package/select/select.scss.js +0 -4
- package/slider/slider.js +0 -135
- package/slider/slider.scss.js +0 -4
- package/switch/switch.js +0 -101
- package/switch/switch.scss.js +0 -4
- package/tab-group/tab-group.js +0 -79
- package/tab-group/tab-group.scss.js +0 -4
- package/textarea/textarea.js +0 -133
- package/textarea/textarea.scss.js +0 -4
- package/textfield/textfield.js +0 -138
- package/textfield/textfield.scss.js +0 -4
- package/theme/theme.js +0 -137
- package/theme/theme.scss.js +0 -4
- package/tooltip/tooltip.js +0 -33
- package/tooltip/tooltip.scss.js +0 -4
- package/topbar/topbar.js +0 -33
- package/topbar/topbar.scss.js +0 -4
- package/umd/tinkiet.min.d.ts +0 -660
- package/umd/tinkiet.min.d.ts.map +0 -1
- package/utils/unique.js +0 -12
package/button/button.scss.js
DELETED
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
var css_248z = "*{-webkit-tap-highlight-color:rgba(0,0,0,0);-webkit-tap-highlight-color:transparent;box-sizing:border-box}:host{align-items:center;border-radius:20px;color:hsl(var(--primary));cursor:pointer;display:inline-flex;flex-direction:row;flex-shrink:0;height:40px;justify-content:center;overflow:hidden;position:relative;text-align:center;text-decoration:none;text-overflow:ellipsis;user-select:none;vertical-align:middle;width:40px}:host tk-icon{height:24px;width:24px}:host([extended]){width:auto}:host([extended]) .content{align-items:center;display:flex;font-family:Roboto,sans-serif;font-size:var(--font-size,14px);font-weight:500;line-height:20px;margin:0 24px;pointer-events:none}:host([extended]) .content.has-icon{margin:0 24px 0 8px}:host([extended]) tk-icon{height:18px;margin-left:16px;width:18px}:host(:focus),:host(:hover){background-color:hsla(var(--primary),.3);outline:none}:host([elevated]){background-color:hsl(var(--surface-container-low));box-shadow:0 1px 2px 0 #0000004d,0 1px 3px 1px #00000026;color:hsl(var(--primary))}:host([elevated]:focus),:host([elevated]:hover){background-color:hsl(var(--surface-container-high));box-shadow:0 1px 2px 0 #0000004d,0 2px 6px 2px #00000026;outline:none}:host([filled]){background-color:hsl(var(--primary));color:hsl(var(--on-primary))}:host([filled]:hover){background-color:hsla(var(--primary),.6);box-shadow:0 1px 2px 0 #0000004d,0 1px 3px 1px #00000026}:host([filled]:focus){background-color:hsla(var(--primary),.6);outline:none}:host([tonal]){background-color:hsl(var(--secondary-container));color:hsl(var(--on-secondary-container))}:host([tonal]:hover){background-color:hsla(var(--on-secondary-container),.3);box-shadow:0 1px 2px 0 #0000004d,0 1px 3px 1px #00000026}:host([tonal]:focus){background-color:hsla(var(--on-secondary-container),.3);outline:none}:host([outlined]){background-color:initial;border:1px solid hsl(var(--outline));color:hsl(var(--primary))}:host([outlined]:hover){background-color:hsla(var(--primary),.08);color:hsl(var(--primary))}:host([outlined]:focus){background-color:hsla(var(--primary),.12);border-color:hsl(var(--primary));outline:none}:host([fab]){align-items:center;background-color:hsl(var(--primary));border-radius:16px;box-shadow:0 1px 3px 0 #0000004d,0 4px 8px 3px #00000026;color:hsl(var(--on-primary));display:inline-flex;height:56px;justify-content:center;padding:12px;width:56px}:host([fab]) tk-icon{height:24px;margin-left:0;width:24px}:host([fab]) .content{margin:0}:host([fab][extended]){min-width:80px;width:auto}:host([fab][extended]) .content{margin:0 24px}:host([fab][extended]) .content.has-icon{margin:0 24px 0 8px}:host([fab][extended]) tk-icon{margin-left:16px}:host([fab]:hover){background-color:hsla(var(--on-primary-container),.3)}:host([fab]:focus){background-color:hsla(var(--on-primary-container),.3);box-shadow:0 1px 3px 0 #0000004d,0 4px 8px 3px #00000026;outline:none}:host([fab][small]){border-radius:12px;height:40px;width:40px}:host([fab][small]) tk-icon{height:24px;width:24px}:host([fab][large]){border-radius:28px;height:96px;width:96px}:host([fab][large]) tk-icon{height:36px;width:36px}:host([disabled]){background-color:hsla(var(--on-surface),.12);box-shadow:none;cursor:not-allowed;pointer-events:none}:host([disabled]) .content{color:hsl(var(--on-surface));opacity:.38}";
|
|
2
|
-
var stylesheet="*{-webkit-tap-highlight-color:rgba(0,0,0,0);-webkit-tap-highlight-color:transparent;box-sizing:border-box}:host{align-items:center;border-radius:20px;color:hsl(var(--primary));cursor:pointer;display:inline-flex;flex-direction:row;flex-shrink:0;height:40px;justify-content:center;overflow:hidden;position:relative;text-align:center;text-decoration:none;text-overflow:ellipsis;user-select:none;vertical-align:middle;width:40px}:host tk-icon{height:24px;width:24px}:host([extended]){width:auto}:host([extended]) .content{align-items:center;display:flex;font-family:Roboto,sans-serif;font-size:var(--font-size,14px);font-weight:500;line-height:20px;margin:0 24px;pointer-events:none}:host([extended]) .content.has-icon{margin:0 24px 0 8px}:host([extended]) tk-icon{height:18px;margin-left:16px;width:18px}:host(:focus),:host(:hover){background-color:hsla(var(--primary),.3);outline:none}:host([elevated]){background-color:hsl(var(--surface-container-low));box-shadow:0 1px 2px 0 #0000004d,0 1px 3px 1px #00000026;color:hsl(var(--primary))}:host([elevated]:focus),:host([elevated]:hover){background-color:hsl(var(--surface-container-high));box-shadow:0 1px 2px 0 #0000004d,0 2px 6px 2px #00000026;outline:none}:host([filled]){background-color:hsl(var(--primary));color:hsl(var(--on-primary))}:host([filled]:hover){background-color:hsla(var(--primary),.6);box-shadow:0 1px 2px 0 #0000004d,0 1px 3px 1px #00000026}:host([filled]:focus){background-color:hsla(var(--primary),.6);outline:none}:host([tonal]){background-color:hsl(var(--secondary-container));color:hsl(var(--on-secondary-container))}:host([tonal]:hover){background-color:hsla(var(--on-secondary-container),.3);box-shadow:0 1px 2px 0 #0000004d,0 1px 3px 1px #00000026}:host([tonal]:focus){background-color:hsla(var(--on-secondary-container),.3);outline:none}:host([outlined]){background-color:initial;border:1px solid hsl(var(--outline));color:hsl(var(--primary))}:host([outlined]:hover){background-color:hsla(var(--primary),.08);color:hsl(var(--primary))}:host([outlined]:focus){background-color:hsla(var(--primary),.12);border-color:hsl(var(--primary));outline:none}:host([fab]){align-items:center;background-color:hsl(var(--primary));border-radius:16px;box-shadow:0 1px 3px 0 #0000004d,0 4px 8px 3px #00000026;color:hsl(var(--on-primary));display:inline-flex;height:56px;justify-content:center;padding:12px;width:56px}:host([fab]) tk-icon{height:24px;margin-left:0;width:24px}:host([fab]) .content{margin:0}:host([fab][extended]){min-width:80px;width:auto}:host([fab][extended]) .content{margin:0 24px}:host([fab][extended]) .content.has-icon{margin:0 24px 0 8px}:host([fab][extended]) tk-icon{margin-left:16px}:host([fab]:hover){background-color:hsla(var(--on-primary-container),.3)}:host([fab]:focus){background-color:hsla(var(--on-primary-container),.3);box-shadow:0 1px 3px 0 #0000004d,0 4px 8px 3px #00000026;outline:none}:host([fab][small]){border-radius:12px;height:40px;width:40px}:host([fab][small]) tk-icon{height:24px;width:24px}:host([fab][large]){border-radius:28px;height:96px;width:96px}:host([fab][large]) tk-icon{height:36px;width:36px}:host([disabled]){background-color:hsla(var(--on-surface),.12);box-shadow:none;cursor:not-allowed;pointer-events:none}:host([disabled]) .content{color:hsl(var(--on-surface));opacity:.38}";
|
|
3
|
-
|
|
4
|
-
export { css_248z as default, stylesheet };
|
package/checkbox/checkbox.js
DELETED
|
@@ -1,89 +0,0 @@
|
|
|
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
|
-
this.disabled = false;
|
|
15
|
-
}
|
|
16
|
-
render() {
|
|
17
|
-
return html `
|
|
18
|
-
<tk-box direction="row" align-items="center">
|
|
19
|
-
<tk-box ripple tabindex="${this.disabled ? -1 : 0}" class="state">
|
|
20
|
-
<div class="checkbox">
|
|
21
|
-
<svg id="checkmark" xmlns="http://www.w3.org/2000/svg" width="100%" height="100%" preserveAspectRatio="none" viewBox="0 0 24 24">
|
|
22
|
-
<path id="checkmark-path" fill="none" d="M1.73,12.91 8.1,19.28 22.79,4.59"></path>
|
|
23
|
-
<line id="indeterminate-path" fill="none" x1="0" y1="12.5" x2="24" y2="12.5" />
|
|
24
|
-
</svg>
|
|
25
|
-
</div>
|
|
26
|
-
</tk-box>
|
|
27
|
-
<span class="label"><slot></slot></span>
|
|
28
|
-
</tk-box>
|
|
29
|
-
<input
|
|
30
|
-
id=${this._id}
|
|
31
|
-
slot="none"
|
|
32
|
-
style="display: none;"
|
|
33
|
-
?checked=${this.checked}
|
|
34
|
-
type="checkbox"
|
|
35
|
-
name="${ifDefined(this.name)}"
|
|
36
|
-
value="${ifDefined(this.value)}"
|
|
37
|
-
aria-hidden="true"
|
|
38
|
-
tabindex="-1"
|
|
39
|
-
/>
|
|
40
|
-
`;
|
|
41
|
-
}
|
|
42
|
-
connectedCallback() {
|
|
43
|
-
super.connectedCallback();
|
|
44
|
-
this.addEventListener("click", this.handleClick.bind(this));
|
|
45
|
-
this.addEventListener("keydown", this.onKeyDown.bind(this));
|
|
46
|
-
}
|
|
47
|
-
disconnectedCallback() {
|
|
48
|
-
super.disconnectedCallback();
|
|
49
|
-
this.removeEventListener("click", this.handleClick);
|
|
50
|
-
this.removeEventListener("keydown", this.onKeyDown);
|
|
51
|
-
}
|
|
52
|
-
firstUpdated() {
|
|
53
|
-
this.appendChild(this.$input);
|
|
54
|
-
}
|
|
55
|
-
onKeyDown(e) {
|
|
56
|
-
if (e.code === "Space" || e.code === "Enter") {
|
|
57
|
-
e.preventDefault();
|
|
58
|
-
e.stopPropagation();
|
|
59
|
-
this.click();
|
|
60
|
-
}
|
|
61
|
-
}
|
|
62
|
-
handleClick() {
|
|
63
|
-
this.checked = !this.checked;
|
|
64
|
-
setTimeout(() => this.dispatchEvent(new Event("change", { bubbles: true, composed: true })));
|
|
65
|
-
}
|
|
66
|
-
};
|
|
67
|
-
TkCheckbox.styles = css `
|
|
68
|
-
${unsafeCSS(css_248z)}
|
|
69
|
-
`;
|
|
70
|
-
__decorate([
|
|
71
|
-
property({ attribute: true, type: String })
|
|
72
|
-
], TkCheckbox.prototype, "name", void 0);
|
|
73
|
-
__decorate([
|
|
74
|
-
property({ attribute: true, type: String, reflect: true })
|
|
75
|
-
], TkCheckbox.prototype, "value", void 0);
|
|
76
|
-
__decorate([
|
|
77
|
-
property({ attribute: true, type: Boolean, reflect: true })
|
|
78
|
-
], TkCheckbox.prototype, "checked", void 0);
|
|
79
|
-
__decorate([
|
|
80
|
-
property({ type: Boolean })
|
|
81
|
-
], TkCheckbox.prototype, "disabled", void 0);
|
|
82
|
-
__decorate([
|
|
83
|
-
query("input")
|
|
84
|
-
], TkCheckbox.prototype, "$input", void 0);
|
|
85
|
-
TkCheckbox = __decorate([
|
|
86
|
-
customElement("tk-checkbox")
|
|
87
|
-
], TkCheckbox);
|
|
88
|
-
|
|
89
|
-
export { TkCheckbox };
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
var css_248z = "*{-webkit-tap-highlight-color:rgba(0,0,0,0);-webkit-tap-highlight-color:transparent;box-sizing:border-box}:host{display:inline-flex}:host .state{align-items:center;border-radius:100%;display:inline-flex;height:40px;justify-content:center;outline:none;overflow:hidden;width:40px}:host .checkbox{align-items:center;border:2px solid hsl(var(--primary));display:inline-flex;height:18px;justify-content:center;margin:0 5px;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:18px}:host .label{user-select:none}:host([checked]) .checkbox{background-color:hsl(var(--primary))}:host([checked]:not([indeterminate])) #checkmark-path,:host([indeterminate]) #indeterminate-path{stroke-dashoffset:0}:host(:focus) #checkmark-path,:host(:hover) #checkmark-path{will-change:stroke-dashoffset}#checkmark{padding:1px}#checkmark-path,#indeterminate-path{stroke-width:5px;stroke:hsl(var(--on-primary));stroke-dasharray:30;stroke-dashoffset: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)}:host(:not([disabled])){cursor:pointer}:host(:focus) .state,:host(:hover) .state{background:hsla(var(--on-surface),.3)}:host([checked]:focus) .state,:host([checked]:hover) .state{background:hsla(var(--primary),.3)}:host([checked]:focus) .checked,:host([checked]:hover) .checked{background-color:hsl(var(--primary))}:host([disabled]){pointer-events:none}:host([disabled]) .checkbox{background-color:hsla(var(--on-surface),.3);border-color:hsla(var(--on-surface),0)}:host([disabled]) #checkmark-path,:host([disabled]) #indeterminate-path{stroke:hsla(var(--on-surface-variant,.3))}:host([disabled]) .label{opacity:.6}";
|
|
2
|
-
var stylesheet="*{-webkit-tap-highlight-color:rgba(0,0,0,0);-webkit-tap-highlight-color:transparent;box-sizing:border-box}:host{display:inline-flex}:host .state{align-items:center;border-radius:100%;display:inline-flex;height:40px;justify-content:center;outline:none;overflow:hidden;width:40px}:host .checkbox{align-items:center;border:2px solid hsl(var(--primary));display:inline-flex;height:18px;justify-content:center;margin:0 5px;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:18px}:host .label{user-select:none}:host([checked]) .checkbox{background-color:hsl(var(--primary))}:host([checked]:not([indeterminate])) #checkmark-path,:host([indeterminate]) #indeterminate-path{stroke-dashoffset:0}:host(:focus) #checkmark-path,:host(:hover) #checkmark-path{will-change:stroke-dashoffset}#checkmark{padding:1px}#checkmark-path,#indeterminate-path{stroke-width:5px;stroke:hsl(var(--on-primary));stroke-dasharray:30;stroke-dashoffset: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)}:host(:not([disabled])){cursor:pointer}:host(:focus) .state,:host(:hover) .state{background:hsla(var(--on-surface),.3)}:host([checked]:focus) .state,:host([checked]:hover) .state{background:hsla(var(--primary),.3)}:host([checked]:focus) .checked,:host([checked]:hover) .checked{background-color:hsl(var(--primary))}:host([disabled]){pointer-events:none}:host([disabled]) .checkbox{background-color:hsla(var(--on-surface),.3);border-color:hsla(var(--on-surface),0)}:host([disabled]) #checkmark-path,:host([disabled]) #indeterminate-path{stroke:hsla(var(--on-surface-variant,.3))}:host([disabled]) .label{opacity:.6}";
|
|
3
|
-
|
|
4
|
-
export { css_248z as default, stylesheet };
|
package/chip/chip.js
DELETED
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import { __decorate } from 'tslib';
|
|
2
|
-
import { LitElement, html, css, unsafeCSS } from 'lit';
|
|
3
|
-
import { customElement } from 'lit/decorators.js';
|
|
4
|
-
import css_248z from './chip.scss.js';
|
|
5
|
-
|
|
6
|
-
let TkChip = class TkChip extends LitElement {
|
|
7
|
-
render() {
|
|
8
|
-
return html `
|
|
9
|
-
<div class="chip"><slot></slot></div>
|
|
10
|
-
`;
|
|
11
|
-
}
|
|
12
|
-
};
|
|
13
|
-
TkChip.styles = css `
|
|
14
|
-
${unsafeCSS(css_248z)}
|
|
15
|
-
`;
|
|
16
|
-
TkChip = __decorate([
|
|
17
|
-
customElement("tk-chip")
|
|
18
|
-
], TkChip);
|
|
19
|
-
|
|
20
|
-
export { TkChip };
|
package/chip/chip.scss.js
DELETED
|
@@ -1,4 +0,0 @@
|
|
|
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);--text:var(--on-primary);background:var(--color);box-sizing:border-box;color:var(--text);display:flex;flex-grow:1;height:var(--navbar-height,48px);justify-content:space-between;padding:var(--navbar-padding,var(--spacing-s,.5rem));position:relative;transition:var(--nav-transition,background var(--transition-duration-fast,.12s) var(--transition-timing-function-deceleration-curve,cubic-bezier(0,0,.2,1)),transform var(--transition-duration-medium,.18s) var(--transition-timing-function-deceleration-curve,cubic-bezier(0,0,.2,1)),box-shadow var(--transition-duration-medium,.18s) var(--transition-timing-function-deceleration-curve,cubic-bezier(0,0,.2,1)));z-index:var(--navbar-z-index,100)}:host([inverted]){--color:var(--on-primary);--text:var(--primary)}:host([fixed]){left:0;position:fixed;top:0;width:100%}:host([shadow]){box-shadow:var(--nav-elevation,0 1px 3px 0 #0000004d,0 4px 8px 3px #00000026)}#left,#right,#title,::slotted([slot=left]),::slotted([slot=right]),::slotted([slot=title]){align-items:center;display:flex;height:100%}#title,::slotted([slot=title]){font-size:var(--nav-title-font-size,var(--font-size-l,1.25rem));margin:var(--nav-title-margin,0 0 0 var(--spacing-l,1.25rem))}";
|
|
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);--text:var(--on-primary);background:var(--color);box-sizing:border-box;color:var(--text);display:flex;flex-grow:1;height:var(--navbar-height,48px);justify-content:space-between;padding:var(--navbar-padding,var(--spacing-s,.5rem));position:relative;transition:var(--nav-transition,background var(--transition-duration-fast,.12s) var(--transition-timing-function-deceleration-curve,cubic-bezier(0,0,.2,1)),transform var(--transition-duration-medium,.18s) var(--transition-timing-function-deceleration-curve,cubic-bezier(0,0,.2,1)),box-shadow var(--transition-duration-medium,.18s) var(--transition-timing-function-deceleration-curve,cubic-bezier(0,0,.2,1)));z-index:var(--navbar-z-index,100)}:host([inverted]){--color:var(--on-primary);--text:var(--primary)}:host([fixed]){left:0;position:fixed;top:0;width:100%}:host([shadow]){box-shadow:var(--nav-elevation,0 1px 3px 0 #0000004d,0 4px 8px 3px #00000026)}#left,#right,#title,::slotted([slot=left]),::slotted([slot=right]),::slotted([slot=title]){align-items:center;display:flex;height:100%}#title,::slotted([slot=title]){font-size:var(--nav-title-font-size,var(--font-size-l,1.25rem));margin:var(--nav-title-margin,0 0 0 var(--spacing-l,1.25rem))}";
|
|
3
|
-
|
|
4
|
-
export { css_248z as default, stylesheet };
|
package/dialog/dialog.js
DELETED
|
@@ -1,59 +0,0 @@
|
|
|
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(_changedProperties) {
|
|
26
|
-
if (_changedProperties.has("open") && this.open)
|
|
27
|
-
this.dispatchEvent(new Event("did-show"));
|
|
28
|
-
if (_changedProperties.has("open") && _changedProperties.get("open") == true && !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
|
-
if (this.resolve)
|
|
40
|
-
this.resolve(value);
|
|
41
|
-
}
|
|
42
|
-
};
|
|
43
|
-
TkDialog.styles = css `
|
|
44
|
-
${unsafeCSS(css_248z)}
|
|
45
|
-
`;
|
|
46
|
-
__decorate([
|
|
47
|
-
property({ type: Boolean, attribute: true })
|
|
48
|
-
], TkDialog.prototype, "modal", void 0);
|
|
49
|
-
__decorate([
|
|
50
|
-
property({ type: Boolean, attribute: true, reflect: true })
|
|
51
|
-
], TkDialog.prototype, "open", void 0);
|
|
52
|
-
__decorate([
|
|
53
|
-
property({ type: Boolean, attribute: "blur-overlay" })
|
|
54
|
-
], TkDialog.prototype, "blurOverlay", void 0);
|
|
55
|
-
TkDialog = __decorate([
|
|
56
|
-
customElement("tk-dialog")
|
|
57
|
-
], TkDialog);
|
|
58
|
-
|
|
59
|
-
export { TkDialog };
|
package/dialog/dialog.scss.js
DELETED
|
@@ -1,4 +0,0 @@
|
|
|
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]){display:block;height:100%;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;height:100%;margin:0;max-height:100%;max-width:100%;overflow-y:auto;overscroll-behavior:contain;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]){display:block;height:100%;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;height:100%;margin:0;max-height:100%;max-width:100%;overflow-y:auto;overscroll-behavior:contain;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 };
|
package/drawer/drawer.js
DELETED
|
@@ -1,168 +0,0 @@
|
|
|
1
|
-
import { __decorate } from 'tslib';
|
|
2
|
-
import { LitElement, html, css, unsafeCSS } from 'lit';
|
|
3
|
-
import { property, query, eventOptions, customElement } from 'lit/decorators.js';
|
|
4
|
-
import css_248z from './drawer.scss.js';
|
|
5
|
-
|
|
6
|
-
let TkDrawer = class TkDrawer extends LitElement {
|
|
7
|
-
constructor() {
|
|
8
|
-
super(...arguments);
|
|
9
|
-
this._open = false;
|
|
10
|
-
this.over = false;
|
|
11
|
-
this.right = false;
|
|
12
|
-
this.swipeable = false;
|
|
13
|
-
this.swipeX = 0;
|
|
14
|
-
this.swipeY = 0;
|
|
15
|
-
this.isHorizontalSwipe = false;
|
|
16
|
-
}
|
|
17
|
-
set open(value) {
|
|
18
|
-
if (value === this._open)
|
|
19
|
-
return;
|
|
20
|
-
const oldValue = this._open;
|
|
21
|
-
this._open = value;
|
|
22
|
-
this.requestUpdate("open", oldValue);
|
|
23
|
-
if (this._open)
|
|
24
|
-
this.dispatchEvent(new Event("did-show"));
|
|
25
|
-
if (!this._open)
|
|
26
|
-
this.dispatchEvent(new Event("did-close"));
|
|
27
|
-
}
|
|
28
|
-
get open() {
|
|
29
|
-
return this._open;
|
|
30
|
-
}
|
|
31
|
-
render() {
|
|
32
|
-
return html `
|
|
33
|
-
<div class="container">
|
|
34
|
-
<slot name="drawer-container"></slot>
|
|
35
|
-
</div>
|
|
36
|
-
<div class="overlay" @click=${() => (this.open = false)}></div>
|
|
37
|
-
<div class="drawer" @touchstart=${this.touchStart} @touchmove=${this.touchMove} @touchend=${this.touchEnd}>
|
|
38
|
-
<div class="drawer-header">
|
|
39
|
-
<slot name="drawer-header"></slot>
|
|
40
|
-
</div>
|
|
41
|
-
<div class="drawer-content">
|
|
42
|
-
<slot name="drawer-content"></slot>
|
|
43
|
-
</div>
|
|
44
|
-
<div class="drawer-footer">
|
|
45
|
-
<slot name="drawer-footer"></slot>
|
|
46
|
-
</div>
|
|
47
|
-
<div class="drawer-swipe"></div>
|
|
48
|
-
</div>
|
|
49
|
-
|
|
50
|
-
`;
|
|
51
|
-
}
|
|
52
|
-
updated(props) {
|
|
53
|
-
if (props.has("overQuery"))
|
|
54
|
-
this.overMediaQuery();
|
|
55
|
-
if (props.has("openQuery")) {
|
|
56
|
-
if (window.matchMedia(this.openQuery).matches)
|
|
57
|
-
this.show();
|
|
58
|
-
}
|
|
59
|
-
if (props.has("open") && this.swipeable) {
|
|
60
|
-
requestAnimationFrame(_ => {
|
|
61
|
-
this.$drawer.removeAttribute('style');
|
|
62
|
-
});
|
|
63
|
-
}
|
|
64
|
-
}
|
|
65
|
-
overMediaQuery() {
|
|
66
|
-
if (this.mql)
|
|
67
|
-
this.mql.removeEventListener("change", this.overMediaQueryListener.bind(this));
|
|
68
|
-
this.mql = window.matchMedia(this.overQuery);
|
|
69
|
-
this.mql.matches ? this.setAttribute("over", "") : this.removeAttribute("over");
|
|
70
|
-
this.mql.addEventListener("change", this.overMediaQueryListener.bind(this));
|
|
71
|
-
}
|
|
72
|
-
overMediaQueryListener(e) {
|
|
73
|
-
e.matches ? this.setAttribute("over", "") : this.removeAttribute("over");
|
|
74
|
-
}
|
|
75
|
-
hideIfOver() {
|
|
76
|
-
var _a;
|
|
77
|
-
if ((this.overQuery && ((_a = this.mql) === null || _a === void 0 ? void 0 : _a.matches)) || this.over)
|
|
78
|
-
this.open = false;
|
|
79
|
-
}
|
|
80
|
-
show() {
|
|
81
|
-
this.open = true;
|
|
82
|
-
}
|
|
83
|
-
hide() {
|
|
84
|
-
this.open = false;
|
|
85
|
-
}
|
|
86
|
-
toggle() {
|
|
87
|
-
this.open = !this.open;
|
|
88
|
-
}
|
|
89
|
-
touchStart(event) {
|
|
90
|
-
if (!this.swipeable)
|
|
91
|
-
return;
|
|
92
|
-
this.$drawer.style.transition = "transform 0ms ease";
|
|
93
|
-
this.swipeX = event.touches[0].clientX;
|
|
94
|
-
this.swipeY = event.touches[0].clientY;
|
|
95
|
-
}
|
|
96
|
-
touchMove(event) {
|
|
97
|
-
if (!this.swipeable)
|
|
98
|
-
return;
|
|
99
|
-
const deltaX = event.touches[0].clientX - this.swipeX;
|
|
100
|
-
const deltaY = event.touches[0].clientY - this.swipeY;
|
|
101
|
-
this.isHorizontalSwipe = Math.abs(deltaX) > Math.abs(deltaY);
|
|
102
|
-
if (!this.isHorizontalSwipe)
|
|
103
|
-
return;
|
|
104
|
-
var x = this.open ?
|
|
105
|
-
deltaX > 0 ? 0 : deltaX :
|
|
106
|
-
deltaX < 0 ? 0 : deltaX;
|
|
107
|
-
var transformString;
|
|
108
|
-
this.open ?
|
|
109
|
-
transformString = "translateX(" + x + "px)" :
|
|
110
|
-
transformString = `translateX(min(calc(-100% + 10px + ${x}px), 0px)`;
|
|
111
|
-
requestAnimationFrame(_ => {
|
|
112
|
-
this.$drawer.style.transform = transformString;
|
|
113
|
-
});
|
|
114
|
-
}
|
|
115
|
-
touchEnd(event) {
|
|
116
|
-
if (!this.swipeable)
|
|
117
|
-
return;
|
|
118
|
-
requestAnimationFrame(_ => {
|
|
119
|
-
this.$drawer.removeAttribute('style');
|
|
120
|
-
});
|
|
121
|
-
const deltaX = event.changedTouches[0].clientX - this.swipeX;
|
|
122
|
-
if (this.isHorizontalSwipe && this.open)
|
|
123
|
-
this.open = -50 > deltaX ? false : true;
|
|
124
|
-
else if (this.isHorizontalSwipe && !this.open) {
|
|
125
|
-
console.log("bbb", deltaX, 50 < Math.abs(deltaX) ? true : false);
|
|
126
|
-
this.open = 50 < deltaX ? true : false;
|
|
127
|
-
}
|
|
128
|
-
this.isHorizontalSwipe = false;
|
|
129
|
-
}
|
|
130
|
-
};
|
|
131
|
-
TkDrawer.styles = css `
|
|
132
|
-
${unsafeCSS(css_248z)}
|
|
133
|
-
`;
|
|
134
|
-
__decorate([
|
|
135
|
-
property({ type: Boolean, reflect: true })
|
|
136
|
-
], TkDrawer.prototype, "open", null);
|
|
137
|
-
__decorate([
|
|
138
|
-
property({ type: Boolean, reflect: true })
|
|
139
|
-
], TkDrawer.prototype, "over", void 0);
|
|
140
|
-
__decorate([
|
|
141
|
-
property({ type: String, attribute: "open-query" })
|
|
142
|
-
], TkDrawer.prototype, "openQuery", void 0);
|
|
143
|
-
__decorate([
|
|
144
|
-
property({ type: String, attribute: "over-query" })
|
|
145
|
-
], TkDrawer.prototype, "overQuery", void 0);
|
|
146
|
-
__decorate([
|
|
147
|
-
property({ type: Boolean, reflect: true })
|
|
148
|
-
], TkDrawer.prototype, "right", void 0);
|
|
149
|
-
__decorate([
|
|
150
|
-
property({ type: Boolean, reflect: true })
|
|
151
|
-
], TkDrawer.prototype, "swipeable", void 0);
|
|
152
|
-
__decorate([
|
|
153
|
-
query("div.drawer")
|
|
154
|
-
], TkDrawer.prototype, "$drawer", void 0);
|
|
155
|
-
__decorate([
|
|
156
|
-
eventOptions({ passive: true })
|
|
157
|
-
], TkDrawer.prototype, "touchStart", null);
|
|
158
|
-
__decorate([
|
|
159
|
-
eventOptions({ passive: true })
|
|
160
|
-
], TkDrawer.prototype, "touchMove", null);
|
|
161
|
-
__decorate([
|
|
162
|
-
eventOptions({ passive: true })
|
|
163
|
-
], TkDrawer.prototype, "touchEnd", null);
|
|
164
|
-
TkDrawer = __decorate([
|
|
165
|
-
customElement("tk-drawer")
|
|
166
|
-
], TkDrawer);
|
|
167
|
-
|
|
168
|
-
export { TkDrawer };
|
package/drawer/drawer.scss.js
DELETED
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
var css_248z = "*{-webkit-tap-highlight-color:rgba(0,0,0,0);-webkit-tap-highlight-color:transparent;box-sizing:border-box}:host{background-color:hsl(var(--surface));display:block;height:100%;overflow:hidden;position:relative;width:100%}.drawer{background-color:hsl(var(--surface));bottom:0;display:grid;grid-template-areas:\"header swipe\" \"content swipe\" \"footer swipe\";grid-template-columns:var(--drawer-width,256px) 10px;grid-template-rows:auto 1fr auto;position:absolute;top:0;touch-action:pan-y;transform:translateX(calc(-100% + 10px));transition:transform cubic-bezier(.4,0,.2,1) var(--transition-duration-medium,.18s);will-change:transform;z-index:var(--drawer-z-index,200)}.drawer .drawer-header{grid-area:header}.drawer .drawer-content{grid-area:content;overflow:auto}.drawer .drawer-footer{grid-area:footer}.drawer .drawer-swipe{background-color:initial;grid-area:swipe}:host([right]) .drawer{right:0;transform:translateX(calc(100% + 10px))}.overlay{background-color:#00000080;bottom:0;display:none;left:0;position:absolute;right:0;top:0;z-index:var(--drawer-overlay-z-index,200)}.container{height:100%;overflow:auto;transition:padding cubic-bezier(.4,0,.2,1) var(--transition-duration-slow,.25s)}:host([open]) .drawer{transform:none}:host([open]) .container{padding-left:var(--drawer-width,256px)}:host([open][over]) .drawer{background-color:hsl(var(--surface-container-low));box-shadow:0 1px 2px 0 #0000004d,0 1px 3px 1px #00000026}:host([open][over]) .container{padding-left:0}:host([open][over]) .overlay{display:block}@media (max-width:var(--drawer-trigger-width,400px)){:host([open]) .container{padding-left:0}:host([open]) .overlay{display:block}}";
|
|
2
|
-
var stylesheet="*{-webkit-tap-highlight-color:rgba(0,0,0,0);-webkit-tap-highlight-color:transparent;box-sizing:border-box}:host{background-color:hsl(var(--surface));display:block;height:100%;overflow:hidden;position:relative;width:100%}.drawer{background-color:hsl(var(--surface));bottom:0;display:grid;grid-template-areas:\"header swipe\" \"content swipe\" \"footer swipe\";grid-template-columns:var(--drawer-width,256px) 10px;grid-template-rows:auto 1fr auto;position:absolute;top:0;touch-action:pan-y;transform:translateX(calc(-100% + 10px));transition:transform cubic-bezier(.4,0,.2,1) var(--transition-duration-medium,.18s);will-change:transform;z-index:var(--drawer-z-index,200)}.drawer .drawer-header{grid-area:header}.drawer .drawer-content{grid-area:content;overflow:auto}.drawer .drawer-footer{grid-area:footer}.drawer .drawer-swipe{background-color:initial;grid-area:swipe}:host([right]) .drawer{right:0;transform:translateX(calc(100% + 10px))}.overlay{background-color:#00000080;bottom:0;display:none;left:0;position:absolute;right:0;top:0;z-index:var(--drawer-overlay-z-index,200)}.container{height:100%;overflow:auto;transition:padding cubic-bezier(.4,0,.2,1) var(--transition-duration-slow,.25s)}:host([open]) .drawer{transform:none}:host([open]) .container{padding-left:var(--drawer-width,256px)}:host([open][over]) .drawer{background-color:hsl(var(--surface-container-low));box-shadow:0 1px 2px 0 #0000004d,0 1px 3px 1px #00000026}:host([open][over]) .container{padding-left:0}:host([open][over]) .overlay{display:block}@media (max-width:var(--drawer-trigger-width,400px)){:host([open]) .container{padding-left:0}:host([open]) .overlay{display:block}}";
|
|
3
|
-
|
|
4
|
-
export { css_248z as default, stylesheet };
|
package/form/form.js
DELETED
|
@@ -1,54 +0,0 @@
|
|
|
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
|
-
connectedCallback() {
|
|
7
|
-
super.connectedCallback();
|
|
8
|
-
this.addEventListener("submit", this.submit);
|
|
9
|
-
}
|
|
10
|
-
disconnectedCallback() {
|
|
11
|
-
super.disconnectedCallback();
|
|
12
|
-
this.removeEventListener("submit", this.submit);
|
|
13
|
-
}
|
|
14
|
-
submit(e) {
|
|
15
|
-
e.preventDefault();
|
|
16
|
-
const result = this.getFormDataAsObject();
|
|
17
|
-
this.dispatchEvent(new CustomEvent("fulfill", { detail: result }));
|
|
18
|
-
}
|
|
19
|
-
getFormDataAsObject() {
|
|
20
|
-
const $form = this.querySelector("form");
|
|
21
|
-
const result = {};
|
|
22
|
-
const data = new FormData($form);
|
|
23
|
-
data.forEach((value, key) => {
|
|
24
|
-
var _a;
|
|
25
|
-
const $inputElement = this.querySelector(`[name=${key}]`);
|
|
26
|
-
if ($inputElement.tagName == "TK-SLIDER") {
|
|
27
|
-
value = Number(value);
|
|
28
|
-
}
|
|
29
|
-
if ($inputElement.tagName == "TK-CHECKBOX" && (value == "on" || value == "true")) {
|
|
30
|
-
value = true;
|
|
31
|
-
}
|
|
32
|
-
if ($inputElement.tagName == "TK-RADIO" && (value == "on" || value == "true")) {
|
|
33
|
-
value = true;
|
|
34
|
-
}
|
|
35
|
-
if (key.indexOf("-") > 0) {
|
|
36
|
-
const _ks = key.split("-");
|
|
37
|
-
result[_ks[0]] = (_a = result[_ks[0]]) !== null && _a !== void 0 ? _a : {};
|
|
38
|
-
result[_ks[0]][_ks[1]] = value;
|
|
39
|
-
}
|
|
40
|
-
else {
|
|
41
|
-
result[key] = value;
|
|
42
|
-
}
|
|
43
|
-
});
|
|
44
|
-
return result;
|
|
45
|
-
}
|
|
46
|
-
};
|
|
47
|
-
__decorate([
|
|
48
|
-
property()
|
|
49
|
-
], TkForm.prototype, "value", void 0);
|
|
50
|
-
TkForm = __decorate([
|
|
51
|
-
customElement("tk-form")
|
|
52
|
-
], TkForm);
|
|
53
|
-
|
|
54
|
-
export { TkForm };
|
package/icon/icon.js
DELETED
|
@@ -1,77 +0,0 @@
|
|
|
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 };
|
package/icon/icon.scss.js
DELETED
|
@@ -1,4 +0,0 @@
|
|
|
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;flex-shrink:0;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;flex-shrink:0;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.js
DELETED
|
@@ -1,24 +0,0 @@
|
|
|
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/index.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../tinkiet/index.ts"],"names":[],"mappings":"AAAA,qCAA4B;AAC5B,iCAAwB;AACxB,+BAAsB;AACtB,kCAAyB;AACzB,oCAA2B;AAC3B,gCAAuB;AACvB,kCAAyB;AACzB,kCAAyB;AACzB,gCAAuB;AACvB,gCAAuB;AACvB,qCAA4B;AAC5B,mCAA0B;AAC1B,sCAA6B;AAC7B,kCAAyB;AACzB,iCAAwB;AACxB,iCAAwB;AACxB,iCAAwB;AACxB,kCAAyB;AACzB,kCAAyB;AACzB,kCAAyB;AACzB,qCAA4B;AAC5B,oCAA2B;AAC3B,qCAA4B;AAC5B,iCAAwB;AACxB,mCAA0B"}
|
package/list-item/list-item.js
DELETED
|
@@ -1,86 +0,0 @@
|
|
|
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 { TkBox } from '../box/box.js';
|
|
6
|
-
import css_248z from './list-item.scss.js';
|
|
7
|
-
|
|
8
|
-
let TkListItem = class TkListItem extends TkBox {
|
|
9
|
-
static get styles() {
|
|
10
|
-
return [
|
|
11
|
-
...TkBox.styles,
|
|
12
|
-
css `
|
|
13
|
-
${unsafeCSS(css_248z)}
|
|
14
|
-
`
|
|
15
|
-
];
|
|
16
|
-
}
|
|
17
|
-
render() {
|
|
18
|
-
return html `
|
|
19
|
-
<slot name="before" @click=${this.handleClick}></slot>
|
|
20
|
-
<div id="content">
|
|
21
|
-
<slot></slot>
|
|
22
|
-
</div>
|
|
23
|
-
<slot name="after" @click=${this.handleClick}></slot>
|
|
24
|
-
${this.href
|
|
25
|
-
? html `
|
|
26
|
-
<a tabindex="-1" id="ahref" href="${this.href}" target=${ifDefined(this.target)} rel="noreferrer" aria-label=${this.ariaLabel}></a>
|
|
27
|
-
`
|
|
28
|
-
: ""}
|
|
29
|
-
`;
|
|
30
|
-
}
|
|
31
|
-
constructor() {
|
|
32
|
-
super();
|
|
33
|
-
this.href = "";
|
|
34
|
-
this.target = "";
|
|
35
|
-
}
|
|
36
|
-
firstUpdated() {
|
|
37
|
-
if (!this.ariaLabel && this.innerText)
|
|
38
|
-
this.ariaLabel = this.innerText;
|
|
39
|
-
}
|
|
40
|
-
connectedCallback() {
|
|
41
|
-
super.connectedCallback();
|
|
42
|
-
this.addEventListener("keydown", this.onKeyDown.bind(this));
|
|
43
|
-
this.addEventListener("click", this.handleClick.bind(this));
|
|
44
|
-
}
|
|
45
|
-
disconnectedCallback() {
|
|
46
|
-
super.disconnectedCallback();
|
|
47
|
-
this.removeEventListener("click", this.handleClick);
|
|
48
|
-
this.removeEventListener("keydown", this.onKeyDown);
|
|
49
|
-
}
|
|
50
|
-
onKeyDown(e) {
|
|
51
|
-
if (e.code === "Space" || e.code === "Enter") {
|
|
52
|
-
e.preventDefault();
|
|
53
|
-
e.stopPropagation();
|
|
54
|
-
this.click();
|
|
55
|
-
}
|
|
56
|
-
}
|
|
57
|
-
handleClick(e) {
|
|
58
|
-
const target = e.target;
|
|
59
|
-
// In case click cames from a slotted element with href attribute we stop propagation
|
|
60
|
-
if (target.tagName == "BUTTON" || target.tagName == "TK-BUTTON" || target.tagName == "TK-SWITCH" || target.tagName == "TK-CHECKBOX") {
|
|
61
|
-
return;
|
|
62
|
-
}
|
|
63
|
-
if (this.href && e.isTrusted) {
|
|
64
|
-
e.stopPropagation();
|
|
65
|
-
e.preventDefault();
|
|
66
|
-
this.$ahref.click();
|
|
67
|
-
}
|
|
68
|
-
}
|
|
69
|
-
};
|
|
70
|
-
__decorate([
|
|
71
|
-
property({ attribute: true })
|
|
72
|
-
], TkListItem.prototype, "href", void 0);
|
|
73
|
-
__decorate([
|
|
74
|
-
property({ attribute: true })
|
|
75
|
-
], TkListItem.prototype, "target", void 0);
|
|
76
|
-
__decorate([
|
|
77
|
-
property({ attribute: "aria-label" })
|
|
78
|
-
], TkListItem.prototype, "ariaLabel", void 0);
|
|
79
|
-
__decorate([
|
|
80
|
-
query("#ahref")
|
|
81
|
-
], TkListItem.prototype, "$ahref", void 0);
|
|
82
|
-
TkListItem = __decorate([
|
|
83
|
-
customElement("tk-list-item")
|
|
84
|
-
], TkListItem);
|
|
85
|
-
|
|
86
|
-
export { TkListItem };
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
var css_248z = "*{-webkit-tap-highlight-color:rgba(0,0,0,0);-webkit-tap-highlight-color:transparent;box-sizing:border-box}:host{align-items:center;border-radius:28px;color:hsl(var(--on-surface-variant));display:flex;flex-direction:row;height:56px;outline:none;overflow:hidden;padding:0 24px 0 16px;position:relative;text-align:left}:host([clickable]),:host([href]){user-select:none}:host([clickable]:not([active]):not([disabled])),:host([href]:not([active]):not([disabled])){cursor:pointer}:host(:focus),:host(:hover){background-color:hsla(var(--on-surface),.08);color:hsl(var(--on-surface));will-change:background,color}:host([active]){background-color:hsla(var(--secondary-container),1);color:hsl(var(--on-secondary-container))}:host([active]:focus),:host([active]:hover){background-color:hsla(var(--secondary-container),1);color:hsl(var(--on-secondary-container))}:host([disabled]){background:hsla(var(--surface-container-highest),.12);color:hsl(var(--on-surface-variant));opacity:.4;pointer-events:none}::slotted([slot=after]),::slotted([slot=before]){flex-shrink:0}::slotted([slot=before]){align-self:var(--list-item-left-align-self,center);margin:0 var(--spacing-m,1rem) 0 0}::slotted([slot=after]){align-self:var(--list-item-left-align-self,center);margin:0 0 0 var(--spacing-m,1rem)}#content{display:flex;flex-direction:column;flex-grow:1;max-width:100%}";
|
|
2
|
-
var stylesheet="*{-webkit-tap-highlight-color:rgba(0,0,0,0);-webkit-tap-highlight-color:transparent;box-sizing:border-box}:host{align-items:center;border-radius:28px;color:hsl(var(--on-surface-variant));display:flex;flex-direction:row;height:56px;outline:none;overflow:hidden;padding:0 24px 0 16px;position:relative;text-align:left}:host([clickable]),:host([href]){user-select:none}:host([clickable]:not([active]):not([disabled])),:host([href]:not([active]):not([disabled])){cursor:pointer}:host(:focus),:host(:hover){background-color:hsla(var(--on-surface),.08);color:hsl(var(--on-surface));will-change:background,color}:host([active]){background-color:hsla(var(--secondary-container),1);color:hsl(var(--on-secondary-container))}:host([active]:focus),:host([active]:hover){background-color:hsla(var(--secondary-container),1);color:hsl(var(--on-secondary-container))}:host([disabled]){background:hsla(var(--surface-container-highest),.12);color:hsl(var(--on-surface-variant));opacity:.4;pointer-events:none}::slotted([slot=after]),::slotted([slot=before]){flex-shrink:0}::slotted([slot=before]){align-self:var(--list-item-left-align-self,center);margin:0 var(--spacing-m,1rem) 0 0}::slotted([slot=after]){align-self:var(--list-item-left-align-self,center);margin:0 0 0 var(--spacing-m,1rem)}#content{display:flex;flex-direction:column;flex-grow:1;max-width:100%}";
|
|
3
|
-
|
|
4
|
-
export { css_248z as default, stylesheet };
|