tinkiet 0.7.6 → 0.7.8
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/drawer/drawer.d.ts +29 -0
- package/drawer/drawer.js +152 -0
- package/drawer/drawer.scss.js +4 -0
- package/drawer/index.d.ts +1 -0
- package/drawer/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 +75 -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 +24 -0
- package/index.d.ts.map +1 -0
- package/index.js +47 -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 +1 -1
- 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.map +1 -1
- package/utils/unique.d.ts +7 -0
- package/utils/unique.js +12 -0
package/notie/notie.js
ADDED
|
@@ -0,0 +1,193 @@
|
|
|
1
|
+
import { __decorate } from 'tslib';
|
|
2
|
+
import { css, unsafeCSS, html } from 'lit';
|
|
3
|
+
import { state, property, query, customElement } from 'lit/decorators.js';
|
|
4
|
+
import '../box/index.js';
|
|
5
|
+
import '../textfield/index.js';
|
|
6
|
+
import css_248z from './notie.scss.js';
|
|
7
|
+
import { TkBox } from '../box/box.js';
|
|
8
|
+
|
|
9
|
+
var TkNotie_1;
|
|
10
|
+
var NotieType;
|
|
11
|
+
(function (NotieType) {
|
|
12
|
+
NotieType["show"] = "show";
|
|
13
|
+
NotieType["force"] = "force";
|
|
14
|
+
NotieType["confirm"] = "confirm";
|
|
15
|
+
NotieType["input"] = "input";
|
|
16
|
+
})(NotieType || (NotieType = {}));
|
|
17
|
+
var NotieLevel;
|
|
18
|
+
(function (NotieLevel) {
|
|
19
|
+
NotieLevel["success"] = "success";
|
|
20
|
+
NotieLevel["warning"] = "warning";
|
|
21
|
+
NotieLevel["error"] = "error";
|
|
22
|
+
NotieLevel["info"] = "info";
|
|
23
|
+
NotieLevel["neutral"] = "neutral";
|
|
24
|
+
})(NotieLevel || (NotieLevel = {}));
|
|
25
|
+
let TkNotie = TkNotie_1 = class TkNotie extends TkBox {
|
|
26
|
+
static get styles() {
|
|
27
|
+
return [
|
|
28
|
+
...TkBox.styles,
|
|
29
|
+
css `
|
|
30
|
+
${unsafeCSS(css_248z)}
|
|
31
|
+
`
|
|
32
|
+
];
|
|
33
|
+
}
|
|
34
|
+
render() {
|
|
35
|
+
return html `
|
|
36
|
+
<div class="overlay" @click=${() => this.hide(false)}></div>
|
|
37
|
+
<tk-box class="container ${this.level}">
|
|
38
|
+
${this.text
|
|
39
|
+
? html `
|
|
40
|
+
<tk-box class="text" @click="${() => (this.type == NotieType.show ? this.hide(true) : null)}">${this.text}</tk-box>
|
|
41
|
+
`
|
|
42
|
+
: ""}
|
|
43
|
+
${this.template
|
|
44
|
+
? html `
|
|
45
|
+
<tk-box class="template" @click="${() => (this.type == NotieType.show ? this.hide(true) : null)}">${this.template}</tk-box>
|
|
46
|
+
`
|
|
47
|
+
: ""}
|
|
48
|
+
${this.type == NotieType.force
|
|
49
|
+
? html `
|
|
50
|
+
<tk-box @click="${() => this.hide(true)}" class="button force">${this.buttonText}</tk-box>
|
|
51
|
+
`
|
|
52
|
+
: ""}
|
|
53
|
+
${this.type == NotieType.input
|
|
54
|
+
? html `
|
|
55
|
+
<tk-textfield class="input" ></tk-textfield>
|
|
56
|
+
`
|
|
57
|
+
: ""}
|
|
58
|
+
${this.type == NotieType.confirm || this.type == NotieType.input
|
|
59
|
+
? html `
|
|
60
|
+
<tk-box direction="row">
|
|
61
|
+
<tk-box justify="center" align-items="center" flex="grow" @click="${() => this.hide(true)}" class="button confirm">
|
|
62
|
+
${this.confirmText}
|
|
63
|
+
</tk-box>
|
|
64
|
+
<tk-box justify="center" align-items="center" flex="grow" @click="${() => this.hide(false)}" class="button confirm cancel">
|
|
65
|
+
${this.cancelText}
|
|
66
|
+
</tk-box>
|
|
67
|
+
</tk-box>
|
|
68
|
+
`
|
|
69
|
+
: ""}
|
|
70
|
+
</tk-box>
|
|
71
|
+
`;
|
|
72
|
+
}
|
|
73
|
+
show() {
|
|
74
|
+
return new Promise(resolve => {
|
|
75
|
+
this.resolve = resolve;
|
|
76
|
+
this.style.setProperty("display", "flex");
|
|
77
|
+
setTimeout(() => (this.open = true));
|
|
78
|
+
this.dispatchEvent(new Event("didShow"));
|
|
79
|
+
if (this.$input)
|
|
80
|
+
setTimeout(() => this.$input.focus());
|
|
81
|
+
if (this.type == NotieType.show)
|
|
82
|
+
setTimeout(() => this.hide(false), this.delay);
|
|
83
|
+
});
|
|
84
|
+
}
|
|
85
|
+
hide(value) {
|
|
86
|
+
if (value && this.type === NotieType.input)
|
|
87
|
+
value = this.$input.value;
|
|
88
|
+
if (!value && this.type === NotieType.input)
|
|
89
|
+
value = null;
|
|
90
|
+
this.$input ? (this.$input.value = "") : null;
|
|
91
|
+
this.$container.addEventListener("transitionend", () => {
|
|
92
|
+
this.dispatchEvent(new Event("didHide"));
|
|
93
|
+
this.resolve(value);
|
|
94
|
+
if (!this.persistent)
|
|
95
|
+
this.remove();
|
|
96
|
+
}, { once: true });
|
|
97
|
+
this.open = false;
|
|
98
|
+
}
|
|
99
|
+
constructor(text = "") {
|
|
100
|
+
super();
|
|
101
|
+
this.persistent = true;
|
|
102
|
+
this.open = false;
|
|
103
|
+
this.position = "bottom";
|
|
104
|
+
this.type = NotieType.show;
|
|
105
|
+
this.level = NotieLevel.info;
|
|
106
|
+
this.delay = 3000;
|
|
107
|
+
this.animationDelay = 300;
|
|
108
|
+
this.buttonText = "OK";
|
|
109
|
+
this.confirmText = "OK";
|
|
110
|
+
this.cancelText = "CANCEL";
|
|
111
|
+
this.text = text;
|
|
112
|
+
}
|
|
113
|
+
static show(options) {
|
|
114
|
+
const notie = this.getNotie(options, NotieType.show);
|
|
115
|
+
return notie.show();
|
|
116
|
+
}
|
|
117
|
+
static force(options) {
|
|
118
|
+
const notie = this.getNotie(options, NotieType.force);
|
|
119
|
+
options.buttonText ? (notie.buttonText = options.buttonText) : null;
|
|
120
|
+
return notie.show();
|
|
121
|
+
}
|
|
122
|
+
static confirm(options) {
|
|
123
|
+
const notie = this.getNotie(options, NotieType.confirm);
|
|
124
|
+
options.confirmText ? (notie.confirmText = options.confirmText) : null;
|
|
125
|
+
options.cancelText ? (notie.cancelText = options.cancelText) : null;
|
|
126
|
+
return notie.show();
|
|
127
|
+
}
|
|
128
|
+
static input(options) {
|
|
129
|
+
const notie = this.getNotie(options, NotieType.input);
|
|
130
|
+
options.password ? (notie.$input.type = "password") : null;
|
|
131
|
+
options.confirmText ? (notie.confirmText = options.confirmText) : null;
|
|
132
|
+
options.cancelText ? (notie.cancelText = options.cancelText) : null;
|
|
133
|
+
return notie.show();
|
|
134
|
+
}
|
|
135
|
+
static getNotie(options, type) {
|
|
136
|
+
var _a, _b;
|
|
137
|
+
const notie = new TkNotie_1(options.text);
|
|
138
|
+
notie.persistent = false;
|
|
139
|
+
notie.type = type;
|
|
140
|
+
notie.delay = (_a = options.delay) !== null && _a !== void 0 ? _a : 999999999;
|
|
141
|
+
options.template ? (notie.template = options.template) : null;
|
|
142
|
+
options.position ? (notie.position = options.position) : null;
|
|
143
|
+
options.background && notie.$container ? notie.$container.setAttribute("background-color", options.background) : null;
|
|
144
|
+
options.color && notie.$container ? notie.$container.setAttribute("color", options.color) : null;
|
|
145
|
+
options.container ? (_b = options.container.shadowRoot) === null || _b === void 0 ? void 0 : _b.appendChild(notie) : window.document.body.appendChild(notie);
|
|
146
|
+
options.zIndex ? notie.style.setProperty("z-index", options.zIndex.toString()) : null;
|
|
147
|
+
return notie;
|
|
148
|
+
}
|
|
149
|
+
};
|
|
150
|
+
__decorate([
|
|
151
|
+
state()
|
|
152
|
+
], TkNotie.prototype, "persistent", void 0);
|
|
153
|
+
__decorate([
|
|
154
|
+
property({ type: Boolean, reflect: true })
|
|
155
|
+
], TkNotie.prototype, "open", void 0);
|
|
156
|
+
__decorate([
|
|
157
|
+
property({ reflect: true })
|
|
158
|
+
], TkNotie.prototype, "position", void 0);
|
|
159
|
+
__decorate([
|
|
160
|
+
property({ type: String })
|
|
161
|
+
], TkNotie.prototype, "type", void 0);
|
|
162
|
+
__decorate([
|
|
163
|
+
property({ type: String })
|
|
164
|
+
], TkNotie.prototype, "level", void 0);
|
|
165
|
+
__decorate([
|
|
166
|
+
property({ type: Number })
|
|
167
|
+
], TkNotie.prototype, "delay", void 0);
|
|
168
|
+
__decorate([
|
|
169
|
+
property()
|
|
170
|
+
], TkNotie.prototype, "text", void 0);
|
|
171
|
+
__decorate([
|
|
172
|
+
property()
|
|
173
|
+
], TkNotie.prototype, "buttonText", void 0);
|
|
174
|
+
__decorate([
|
|
175
|
+
property()
|
|
176
|
+
], TkNotie.prototype, "confirmText", void 0);
|
|
177
|
+
__decorate([
|
|
178
|
+
property()
|
|
179
|
+
], TkNotie.prototype, "cancelText", void 0);
|
|
180
|
+
__decorate([
|
|
181
|
+
property({ type: Object })
|
|
182
|
+
], TkNotie.prototype, "template", void 0);
|
|
183
|
+
__decorate([
|
|
184
|
+
query("tk-textfield")
|
|
185
|
+
], TkNotie.prototype, "$input", void 0);
|
|
186
|
+
__decorate([
|
|
187
|
+
query(".container")
|
|
188
|
+
], TkNotie.prototype, "$container", void 0);
|
|
189
|
+
TkNotie = TkNotie_1 = __decorate([
|
|
190
|
+
customElement("tk-notie")
|
|
191
|
+
], TkNotie);
|
|
192
|
+
|
|
193
|
+
export { TkNotie };
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
var css_248z = ":host{bottom:0;display:none;font-size:1.6rem;left:0;margin:0;position:fixed;right:0;top:0}:host .overlay{background-color:rgba(0,0,0,.502);bottom:0;left:0;position:fixed;right:0;top:0;z-index:var(--notie-z-index,400)}:host .container{background-color:var(--primary,hsl(var(--primary-h,258.987),var(--primary-s,38.1643%),var(--primary-l,59.4118%)));bottom:0;box-shadow:10px 10px 10px 10px var(--shadow);color:var(--on-primary,hsl(var(--on-primary-h,0),var(--on-primary-s,0%),var(--on-primary-l,100%)));height:fit-content;left:0;position:fixed;right:0;text-align:center;transform:translateY(100%);transition:all .15s ease-in;z-index:calc(var(--notie-z-index, 400) + 1)}:host .container.info{background-color:#4d82d6}:host .container.error{background-color:#e1715b}:host .container.warning{background-color:#d6a14d}:host .container.success{background-color:#57bf57}:host .text{padding:.5em}:host .input{--input-font-size:$font-size-widescreen;background-color:var(--background);color:var(--foreground);text-align:center}:host .button{cursor:pointer;padding:.5em}:host .button.confirm,:host .button.forcer{background-color:#57bf57;color:#fff}:host .button.cancel{background-color:var(--error,#e1715b);color:var(--on-error,#fff)}@media screen and (max-width:900px){:host{font-size:1.4rem}}@media screen and (max-width:750px){:host{font-size:1.2rem}}@media screen and (max-width:400px){:host{font-size:1rem}}:host([position=top]) .container{bottom:inherit;position:fixed;top:0;transform:translateY(-100%)}:host([open]) .container{transform:translateY(0)}";
|
|
2
|
+
var stylesheet=":host{bottom:0;display:none;font-size:1.6rem;left:0;margin:0;position:fixed;right:0;top:0}:host .overlay{background-color:rgba(0,0,0,.502);bottom:0;left:0;position:fixed;right:0;top:0;z-index:var(--notie-z-index,400)}:host .container{background-color:var(--primary,hsl(var(--primary-h,258.987),var(--primary-s,38.1643%),var(--primary-l,59.4118%)));bottom:0;box-shadow:10px 10px 10px 10px var(--shadow);color:var(--on-primary,hsl(var(--on-primary-h,0),var(--on-primary-s,0%),var(--on-primary-l,100%)));height:fit-content;left:0;position:fixed;right:0;text-align:center;transform:translateY(100%);transition:all .15s ease-in;z-index:calc(var(--notie-z-index, 400) + 1)}:host .container.info{background-color:#4d82d6}:host .container.error{background-color:#e1715b}:host .container.warning{background-color:#d6a14d}:host .container.success{background-color:#57bf57}:host .text{padding:.5em}:host .input{--input-font-size:$font-size-widescreen;background-color:var(--background);color:var(--foreground);text-align:center}:host .button{cursor:pointer;padding:.5em}:host .button.confirm,:host .button.forcer{background-color:#57bf57;color:#fff}:host .button.cancel{background-color:var(--error,#e1715b);color:var(--on-error,#fff)}@media screen and (max-width:900px){:host{font-size:1.4rem}}@media screen and (max-width:750px){:host{font-size:1.2rem}}@media screen and (max-width:400px){:host{font-size:1rem}}:host([position=top]) .container{bottom:inherit;position:fixed;top:0;transform:translateY(-100%)}:host([open]) .container{transform:translateY(0)}";
|
|
3
|
+
|
|
4
|
+
export { css_248z as default, stylesheet };
|
package/package.json
CHANGED
package/pages/index.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./pages";
|
package/pages/index.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { TkPages } from './pages.js';
|
package/pages/pages.d.ts
ADDED
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { LitElement } from "lit";
|
|
2
|
+
declare class TkPages extends LitElement {
|
|
3
|
+
static styles: import("lit").CSSResult;
|
|
4
|
+
private _page;
|
|
5
|
+
set page(val: string);
|
|
6
|
+
get page(): string;
|
|
7
|
+
selected: string;
|
|
8
|
+
handleScroll: boolean;
|
|
9
|
+
private scrollHistory;
|
|
10
|
+
render(): import("lit-html").TemplateResult<1>;
|
|
11
|
+
updated(props: any): void;
|
|
12
|
+
}
|
|
13
|
+
declare global {
|
|
14
|
+
interface HTMLElementTagNameMap {
|
|
15
|
+
"tk-pages": TkPages;
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
export { TkPages };
|
package/pages/pages.js
ADDED
|
@@ -0,0 +1,75 @@
|
|
|
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 './pages.scss.js';
|
|
5
|
+
|
|
6
|
+
let TkPages = class TkPages extends LitElement {
|
|
7
|
+
constructor() {
|
|
8
|
+
super(...arguments);
|
|
9
|
+
this._page = "";
|
|
10
|
+
this.selected = "";
|
|
11
|
+
this.handleScroll = false;
|
|
12
|
+
this.scrollHistory = {};
|
|
13
|
+
}
|
|
14
|
+
set page(val) {
|
|
15
|
+
let oldVal = this._page;
|
|
16
|
+
this._page = val;
|
|
17
|
+
if (oldVal && this.handleScroll) {
|
|
18
|
+
const el = this.querySelector(`[page=${oldVal}]`);
|
|
19
|
+
if (el) {
|
|
20
|
+
const scrollElement = document.scrollingElement || document.documentElement;
|
|
21
|
+
this.scrollHistory[oldVal] = scrollElement.scrollTop;
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
this.requestUpdate("page", oldVal);
|
|
25
|
+
}
|
|
26
|
+
get page() {
|
|
27
|
+
return this._page;
|
|
28
|
+
}
|
|
29
|
+
render() {
|
|
30
|
+
return html `
|
|
31
|
+
<slot></slot>
|
|
32
|
+
`;
|
|
33
|
+
}
|
|
34
|
+
updated(props) {
|
|
35
|
+
if (props.has("page")) {
|
|
36
|
+
this.querySelectorAll(":scope > *").forEach(el => {
|
|
37
|
+
var _a;
|
|
38
|
+
const elPageAttribute = (_a = el.getAttribute("page")) !== null && _a !== void 0 ? _a : "default";
|
|
39
|
+
const scrollElement = document.scrollingElement || document.documentElement;
|
|
40
|
+
if (elPageAttribute == this.page) {
|
|
41
|
+
el.removeAttribute("hidden");
|
|
42
|
+
if (this.selected != "") {
|
|
43
|
+
el.setAttribute(this.selected, "");
|
|
44
|
+
}
|
|
45
|
+
if (this.handleScroll && !el.hasAttribute("no-scroll")) {
|
|
46
|
+
scrollElement.scrollTop = this.scrollHistory[elPageAttribute] ? this.scrollHistory[elPageAttribute] : 0;
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
else {
|
|
50
|
+
el.setAttribute("hidden", "");
|
|
51
|
+
if (this.selected != "") {
|
|
52
|
+
el.removeAttribute(this.selected);
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
});
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
};
|
|
59
|
+
TkPages.styles = css `
|
|
60
|
+
${unsafeCSS(css_248z)}
|
|
61
|
+
`;
|
|
62
|
+
__decorate([
|
|
63
|
+
property({ attribute: "page", type: String })
|
|
64
|
+
], TkPages.prototype, "page", null);
|
|
65
|
+
__decorate([
|
|
66
|
+
property({ attribute: true, type: String })
|
|
67
|
+
], TkPages.prototype, "selected", void 0);
|
|
68
|
+
__decorate([
|
|
69
|
+
property({ attribute: "handle-scroll", type: Boolean })
|
|
70
|
+
], TkPages.prototype, "handleScroll", void 0);
|
|
71
|
+
TkPages = __decorate([
|
|
72
|
+
customElement("tk-pages")
|
|
73
|
+
], TkPages);
|
|
74
|
+
|
|
75
|
+
export { TkPages };
|
|
@@ -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}";
|
|
2
|
+
var stylesheet="*{-webkit-tap-highlight-color:rgba(0,0,0,0);-webkit-tap-highlight-color:transparent;box-sizing:border-box}";
|
|
3
|
+
|
|
4
|
+
export { css_248z as default, stylesheet };
|
package/radio/index.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./radio";
|
package/radio/index.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { TkRadio } from './radio.js';
|
package/radio/radio.d.ts
ADDED
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { LitElement } from "lit";
|
|
2
|
+
declare class TkRadio extends LitElement {
|
|
3
|
+
static styles: import("lit").CSSResult;
|
|
4
|
+
private _id;
|
|
5
|
+
name: string;
|
|
6
|
+
checked: boolean;
|
|
7
|
+
required: boolean;
|
|
8
|
+
disabled: boolean;
|
|
9
|
+
readonly: boolean;
|
|
10
|
+
value: string;
|
|
11
|
+
private $input;
|
|
12
|
+
render(): import("lit-html").TemplateResult<1>;
|
|
13
|
+
connectedCallback(): void;
|
|
14
|
+
disconnectedCallback(): void;
|
|
15
|
+
firstUpdated(): void;
|
|
16
|
+
protected onKeyDown(e: KeyboardEvent): void;
|
|
17
|
+
protected handleClick(): void;
|
|
18
|
+
}
|
|
19
|
+
declare global {
|
|
20
|
+
interface HTMLElementTagNameMap {
|
|
21
|
+
"tk-radio": TkRadio;
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
export { TkRadio };
|
package/radio/radio.js
ADDED
|
@@ -0,0 +1,98 @@
|
|
|
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 './radio.scss.js';
|
|
8
|
+
|
|
9
|
+
let TkRadio = class TkRadio extends LitElement {
|
|
10
|
+
constructor() {
|
|
11
|
+
super(...arguments);
|
|
12
|
+
this._id = uniqueID();
|
|
13
|
+
this.checked = false;
|
|
14
|
+
this.required = false;
|
|
15
|
+
this.disabled = false;
|
|
16
|
+
this.readonly = false;
|
|
17
|
+
}
|
|
18
|
+
render() {
|
|
19
|
+
return html `
|
|
20
|
+
<tk-box direction="row" align-items="center">
|
|
21
|
+
<div tabindex="0" class="radio">
|
|
22
|
+
<div id="dot"></div>
|
|
23
|
+
</div>
|
|
24
|
+
<span class="label"><slot></slot></span>
|
|
25
|
+
</tk-box>
|
|
26
|
+
<input
|
|
27
|
+
id=${this._id}
|
|
28
|
+
type="radio"
|
|
29
|
+
style="position: absolute;left: 0;z-index: -1;"
|
|
30
|
+
?checked="${this.checked}"
|
|
31
|
+
.checked=${this.checked}
|
|
32
|
+
?required="${this.required}"
|
|
33
|
+
?disabled="${this.disabled}"
|
|
34
|
+
?readonly="${this.readonly}"
|
|
35
|
+
value="${ifDefined(this.value)}"
|
|
36
|
+
name="${ifDefined(this.name)}"
|
|
37
|
+
tabindex="-1"
|
|
38
|
+
/>
|
|
39
|
+
`;
|
|
40
|
+
}
|
|
41
|
+
connectedCallback() {
|
|
42
|
+
super.connectedCallback();
|
|
43
|
+
this.addEventListener("click", this.handleClick.bind(this));
|
|
44
|
+
this.addEventListener("keydown", this.onKeyDown.bind(this));
|
|
45
|
+
}
|
|
46
|
+
disconnectedCallback() {
|
|
47
|
+
super.disconnectedCallback();
|
|
48
|
+
this.removeEventListener("click", this.handleClick);
|
|
49
|
+
this.removeEventListener("keydown", this.onKeyDown);
|
|
50
|
+
}
|
|
51
|
+
firstUpdated() {
|
|
52
|
+
this.appendChild(this.$input);
|
|
53
|
+
}
|
|
54
|
+
onKeyDown(e) {
|
|
55
|
+
if (e.code === "Space" || e.code === "Enter") {
|
|
56
|
+
e.preventDefault();
|
|
57
|
+
e.stopPropagation();
|
|
58
|
+
this.click();
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
handleClick() {
|
|
62
|
+
this.checked = !this.checked;
|
|
63
|
+
if (this.checked && this.name)
|
|
64
|
+
this.getRootNode()
|
|
65
|
+
.querySelectorAll(`tk-radio[name="${this.name}"]`)
|
|
66
|
+
.forEach(el => (el != this ? (el.checked = false) : null));
|
|
67
|
+
setTimeout(() => this.dispatchEvent(new Event("change", { bubbles: true, composed: true })));
|
|
68
|
+
}
|
|
69
|
+
};
|
|
70
|
+
TkRadio.styles = css `
|
|
71
|
+
${unsafeCSS(css_248z)}
|
|
72
|
+
`;
|
|
73
|
+
__decorate([
|
|
74
|
+
property({ attribute: true, type: String })
|
|
75
|
+
], TkRadio.prototype, "name", void 0);
|
|
76
|
+
__decorate([
|
|
77
|
+
property({ attribute: true, type: Boolean, reflect: true })
|
|
78
|
+
], TkRadio.prototype, "checked", void 0);
|
|
79
|
+
__decorate([
|
|
80
|
+
property({ type: Boolean })
|
|
81
|
+
], TkRadio.prototype, "required", void 0);
|
|
82
|
+
__decorate([
|
|
83
|
+
property({ type: Boolean })
|
|
84
|
+
], TkRadio.prototype, "disabled", void 0);
|
|
85
|
+
__decorate([
|
|
86
|
+
property({ type: Boolean })
|
|
87
|
+
], TkRadio.prototype, "readonly", void 0);
|
|
88
|
+
__decorate([
|
|
89
|
+
property({ type: String, reflect: true })
|
|
90
|
+
], TkRadio.prototype, "value", void 0);
|
|
91
|
+
__decorate([
|
|
92
|
+
query("input")
|
|
93
|
+
], TkRadio.prototype, "$input", void 0);
|
|
94
|
+
TkRadio = __decorate([
|
|
95
|
+
customElement("tk-radio")
|
|
96
|
+
], TkRadio);
|
|
97
|
+
|
|
98
|
+
export { TkRadio };
|
|
@@ -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{--_radio-bg:var(--radio-bg,#0000);--_radio-color:var(--radio-color,var(--shade,hsl(var(--shade-h,0),var(--shade-s,0%),var(--shade-l,66.6667%))));display:inline-flex}:host .radio{align-items:center;background:var(--_radio-bg);border:var(--radio-border-config,.125rem solid) currentColor;border-radius:var(--radio-border-radius,100%);color:var(--_radio-color);display:inline-flex;height:var(--radio-size,1.25rem);justify-content:center;outline:none;position:relative;transition:var(--radio-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(--radio-size,1.25rem)}:host .label{font-size:1.1em;margin-left:10px}:host(:not([disabled])){cursor:pointer}:host([checked]){--_radio-bg:var(--radio-bg-checked,#0000);--_radio-color:var(--radio-color-checked,var(--primary,hsl(var(--primary-h,258.987),var(--primary-s,38.1643%),var(--primary-l,59.4118%))))}:host([checked]) #dot{transform:scale(1)}:host(:focus),:host(:hover){will-change:border,background}:host(:focus) #dot,:host(:hover) #dot{will-change:transform,background}:host([disabled]){--_radio-bg:var(--radio-bg-disabled,#0000);--_radio-color:var(--radio-color-disabled,var(--shade,hsl(var(--shade-h,0),var(--shade-s,0%),var(--shade-l,66.6667%))));pointer-events:none}:host([disabled][checked]){--_radio-bg:var(--radio-bg-disabled-checked,#0000);--_radio-color:var(--radio-color-disabled-checked,var(--shade,hsl(var(--shade-h,0),var(--shade-s,0%),var(--shade-l,66.6667%))))}#dot{background:currentColor;border-radius:var(--radio-dot-border-radius,100%);height:var(--radio-dot-size,.625rem);transform:scale(0);transition:var(--radio-dot-transition,transform var(--transition-duration-medium,.18s) var(--transition-timing-function-deceleration-curve,cubic-bezier(0,0,.2,1)));width:var(--radio-dot-size,.625rem)}#ripple{transform:var(--radio-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{--_radio-bg:var(--radio-bg,#0000);--_radio-color:var(--radio-color,var(--shade,hsl(var(--shade-h,0),var(--shade-s,0%),var(--shade-l,66.6667%))));display:inline-flex}:host .radio{align-items:center;background:var(--_radio-bg);border:var(--radio-border-config,.125rem solid) currentColor;border-radius:var(--radio-border-radius,100%);color:var(--_radio-color);display:inline-flex;height:var(--radio-size,1.25rem);justify-content:center;outline:none;position:relative;transition:var(--radio-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(--radio-size,1.25rem)}:host .label{font-size:1.1em;margin-left:10px}:host(:not([disabled])){cursor:pointer}:host([checked]){--_radio-bg:var(--radio-bg-checked,#0000);--_radio-color:var(--radio-color-checked,var(--primary,hsl(var(--primary-h,258.987),var(--primary-s,38.1643%),var(--primary-l,59.4118%))))}:host([checked]) #dot{transform:scale(1)}:host(:focus),:host(:hover){will-change:border,background}:host(:focus) #dot,:host(:hover) #dot{will-change:transform,background}:host([disabled]){--_radio-bg:var(--radio-bg-disabled,#0000);--_radio-color:var(--radio-color-disabled,var(--shade,hsl(var(--shade-h,0),var(--shade-s,0%),var(--shade-l,66.6667%))));pointer-events:none}:host([disabled][checked]){--_radio-bg:var(--radio-bg-disabled-checked,#0000);--_radio-color:var(--radio-color-disabled-checked,var(--shade,hsl(var(--shade-h,0),var(--shade-s,0%),var(--shade-l,66.6667%))))}#dot{background:currentColor;border-radius:var(--radio-dot-border-radius,100%);height:var(--radio-dot-size,.625rem);transform:scale(0);transition:var(--radio-dot-transition,transform var(--transition-duration-medium,.18s) var(--transition-timing-function-deceleration-curve,cubic-bezier(0,0,.2,1)));width:var(--radio-dot-size,.625rem)}#ripple{transform:var(--radio-ripple-transform,translate(-50%,-50%) scale(1.8))}";
|
|
3
|
+
|
|
4
|
+
export { css_248z as default, stylesheet };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./select";
|
package/select/index.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { TkSelect } from './select.js';
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { LitElement } from "lit";
|
|
2
|
+
declare class TkSelect extends LitElement {
|
|
3
|
+
static styles: import("lit").CSSResult;
|
|
4
|
+
private _id;
|
|
5
|
+
set value(value: string);
|
|
6
|
+
get value(): string;
|
|
7
|
+
name: string;
|
|
8
|
+
list: string;
|
|
9
|
+
type: "email" | "number" | "password" | "text" | "search";
|
|
10
|
+
required: boolean;
|
|
11
|
+
disabled: boolean;
|
|
12
|
+
readonly: boolean;
|
|
13
|
+
autocomplete: "on" | "off";
|
|
14
|
+
pattern: string;
|
|
15
|
+
initialValue: string;
|
|
16
|
+
label: string;
|
|
17
|
+
min: number;
|
|
18
|
+
max: number;
|
|
19
|
+
minLength: number;
|
|
20
|
+
maxLength: number;
|
|
21
|
+
private $select;
|
|
22
|
+
render(): import("lit-html").TemplateResult<1>;
|
|
23
|
+
private handleChange;
|
|
24
|
+
firstUpdated(): void;
|
|
25
|
+
private refreshAttributes;
|
|
26
|
+
}
|
|
27
|
+
declare global {
|
|
28
|
+
interface HTMLElementTagNameMap {
|
|
29
|
+
"tk-select": TkSelect;
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
export { TkSelect };
|
package/select/select.js
ADDED
|
@@ -0,0 +1,132 @@
|
|
|
1
|
+
import { __decorate } from 'tslib';
|
|
2
|
+
import { LitElement, html, css, unsafeCSS } from 'lit';
|
|
3
|
+
import { property, state, eventOptions, 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 './select.scss.js';
|
|
8
|
+
|
|
9
|
+
let TkSelect = class TkSelect extends LitElement {
|
|
10
|
+
constructor() {
|
|
11
|
+
super(...arguments);
|
|
12
|
+
this._id = uniqueID();
|
|
13
|
+
this.type = "text";
|
|
14
|
+
this.required = false;
|
|
15
|
+
this.disabled = false;
|
|
16
|
+
this.readonly = false;
|
|
17
|
+
}
|
|
18
|
+
set value(value) {
|
|
19
|
+
if (!this.$select) {
|
|
20
|
+
this.initialValue = value;
|
|
21
|
+
}
|
|
22
|
+
else {
|
|
23
|
+
this.$select.value = value;
|
|
24
|
+
this.refreshAttributes();
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
get value() {
|
|
28
|
+
return this.$select != null ? this.$select.value : this.initialValue || "";
|
|
29
|
+
}
|
|
30
|
+
render() {
|
|
31
|
+
return html `
|
|
32
|
+
<div id="container">
|
|
33
|
+
<slot id="before" name="before"></slot>
|
|
34
|
+
<div id="wrapper">
|
|
35
|
+
<div id="label">${this.label}</div>
|
|
36
|
+
<slot id="slot"></slot>
|
|
37
|
+
<select
|
|
38
|
+
id="${this._id}"
|
|
39
|
+
@keydown=${this.handleChange.bind(this)}
|
|
40
|
+
@input=${this.handleChange.bind(this)}
|
|
41
|
+
@focusout=${this.handleChange.bind(this)}
|
|
42
|
+
@change=${this.handleChange.bind(this)}
|
|
43
|
+
.value="${this.initialValue}"
|
|
44
|
+
?required="${this.required}"
|
|
45
|
+
?disabled="${this.disabled}"
|
|
46
|
+
?readonly="${this.readonly}"
|
|
47
|
+
name="${ifDefined(this.name)}"
|
|
48
|
+
autocomplete="${ifDefined(this.autocomplete)}"
|
|
49
|
+
tabindex="${this.disabled ? -1 : 0}"
|
|
50
|
+
></select>
|
|
51
|
+
<svg id="arrow" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 50 25" preserveAspectRatio="none">
|
|
52
|
+
<polygon points="0,0 50,0 25,25" />
|
|
53
|
+
</svg>
|
|
54
|
+
</div>
|
|
55
|
+
<slot id="after" name="after"></slot>
|
|
56
|
+
</div>
|
|
57
|
+
`;
|
|
58
|
+
}
|
|
59
|
+
handleChange() {
|
|
60
|
+
this.refreshAttributes();
|
|
61
|
+
}
|
|
62
|
+
firstUpdated() {
|
|
63
|
+
var _a;
|
|
64
|
+
this.$select = (_a = this.shadowRoot) === null || _a === void 0 ? void 0 : _a.querySelector("select");
|
|
65
|
+
this.appendChild(this.$select);
|
|
66
|
+
const options = this.querySelectorAll("option");
|
|
67
|
+
options.forEach(option => this.$select.appendChild(option));
|
|
68
|
+
if (this.initialValue)
|
|
69
|
+
this.value = this.initialValue;
|
|
70
|
+
}
|
|
71
|
+
refreshAttributes() {
|
|
72
|
+
this.$select.value ? this.setAttribute("dirty", "") : this.removeAttribute("dirty");
|
|
73
|
+
this.$select.checkValidity() ? this.removeAttribute("invalid") : this.setAttribute("invalid", "");
|
|
74
|
+
setTimeout(() => this.dispatchEvent(new Event("change", { bubbles: true, composed: true })));
|
|
75
|
+
}
|
|
76
|
+
};
|
|
77
|
+
TkSelect.styles = css `
|
|
78
|
+
${unsafeCSS(css_248z)}
|
|
79
|
+
`;
|
|
80
|
+
__decorate([
|
|
81
|
+
property({ type: String })
|
|
82
|
+
], TkSelect.prototype, "value", null);
|
|
83
|
+
__decorate([
|
|
84
|
+
property({ attribute: true, type: String })
|
|
85
|
+
], TkSelect.prototype, "name", void 0);
|
|
86
|
+
__decorate([
|
|
87
|
+
property({ type: String })
|
|
88
|
+
], TkSelect.prototype, "list", void 0);
|
|
89
|
+
__decorate([
|
|
90
|
+
property({ type: String })
|
|
91
|
+
], TkSelect.prototype, "type", void 0);
|
|
92
|
+
__decorate([
|
|
93
|
+
property({ type: Boolean })
|
|
94
|
+
], TkSelect.prototype, "required", void 0);
|
|
95
|
+
__decorate([
|
|
96
|
+
property({ type: Boolean })
|
|
97
|
+
], TkSelect.prototype, "disabled", void 0);
|
|
98
|
+
__decorate([
|
|
99
|
+
property({ type: Boolean })
|
|
100
|
+
], TkSelect.prototype, "readonly", void 0);
|
|
101
|
+
__decorate([
|
|
102
|
+
property({ type: String })
|
|
103
|
+
], TkSelect.prototype, "autocomplete", void 0);
|
|
104
|
+
__decorate([
|
|
105
|
+
property({ type: String })
|
|
106
|
+
], TkSelect.prototype, "pattern", void 0);
|
|
107
|
+
__decorate([
|
|
108
|
+
state()
|
|
109
|
+
], TkSelect.prototype, "initialValue", void 0);
|
|
110
|
+
__decorate([
|
|
111
|
+
property({ type: String })
|
|
112
|
+
], TkSelect.prototype, "label", void 0);
|
|
113
|
+
__decorate([
|
|
114
|
+
property({ type: Number })
|
|
115
|
+
], TkSelect.prototype, "min", void 0);
|
|
116
|
+
__decorate([
|
|
117
|
+
property({ type: Number })
|
|
118
|
+
], TkSelect.prototype, "max", void 0);
|
|
119
|
+
__decorate([
|
|
120
|
+
property({ type: Number })
|
|
121
|
+
], TkSelect.prototype, "minLength", void 0);
|
|
122
|
+
__decorate([
|
|
123
|
+
property({ type: Number })
|
|
124
|
+
], TkSelect.prototype, "maxLength", void 0);
|
|
125
|
+
__decorate([
|
|
126
|
+
eventOptions({ passive: true })
|
|
127
|
+
], TkSelect.prototype, "handleChange", null);
|
|
128
|
+
TkSelect = __decorate([
|
|
129
|
+
customElement("tk-select")
|
|
130
|
+
], TkSelect);
|
|
131
|
+
|
|
132
|
+
export { TkSelect };
|
|
@@ -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{--_input-state-color:var(--input-state-color-inactive,var(--shade,hsl(var(--shade-h,0),var(--shade-s,0%),var(--shade-l,66.6667%))));--_input-padding-left-right:var(--input-padding-left-right,0);--_input-bg:var(--input-bg,#0000);--_input-border-radius:0;--_input-color:var(--input-color,var(--foreground,#454545));--_input-label-color:var(--input-label-color,var(--shade,hsl(var(--shade-h,0),var(--shade-s,0%),var(--shade-l,66.6667%))));--_input-border-style:var(--input-border-style,solid);display:block;outline:none;transform:translateZ(0)}:host([disabled]){--_input-state-color:var(--input-state-color-disabled,var(--shade-light,hsl(var(--shade-h,0),var(--shade-s,0%),calc(var(--shade-l, 66.6667%)*1.15))));--_input-label-color:var(--input-label-color-disabled,var(--shade,hsl(var(--shade-h,0),var(--shade-s,0%),var(--shade-l,66.6667%))));--_input-color:var(--input-color-disabled,var(--shade-lighter,hsl(var(--shade-h,0),var(--shade-s,0%),calc(var(--shade-l, 66.6667%)*1.3))));--_input-border-style:var(--input-border-style-disabled,dashed);pointer-events:none}#container{align-items:center;background:var(--_input-bg);border-bottom:var(--input-border-width,.0625rem) var(--_input-border-style) var(--_input-state-color);border-radius:var(--_input-border-radius);color:var(--_input-color);display:flex;font-size:var(--input-font-size,1rem);overflow:hidden;position:relative;transition:var(--input-transition,border-color var(--transition-duration-medium,.18s) var(--transition-timing-function-ease,ease),background var(--transition-duration-medium,.18s) var(--transition-timing-function-ease,ease))}#wrapper{flex-grow:1;position:relative}#label{color:var(--_input-label-color);font-size:inherit;left:var(--_input-padding-left-right);line-height:1;pointer-events:none;position:absolute;top:50%;transform:translateY(-50%);transition:var(--input-label-transition,top var(--transition-duration-fast,.12s) var(--transition-timing-function-linear,linear),font-size var(--transition-duration-fast,.12s) var(--transition-timing-function-linear,linear),transform var(--transition-duration-fast,.12s) var(--transition-timing-function-linear,linear));-webkit-user-select:none;user-select:none;white-space:nowrap;z-index:1}:host(:hover){--_input-state-color:var(--input-state-color-hover,var(--primary,hsl(var(--primary-h,258.987),var(--primary-s,38.1643%),var(--primary-l,59.4118%))))}:host([filled]),:host([outlined]){--_input-padding-left-right:var(--input-padding-left-right-outlined,0.75rem)}:host([filled]){--_input-border-radius:var(--input-border-radius-outlined,0.5rem 0.5rem 0 0);--_input-bg:var(--input-bg,var(--shade-lighter,hsl(var(--shade-h,0),var(--shade-s,0%),calc(var(--shade-l, 66.6667%)*1.3))))}:host([filled]:hover){--_input-bg:var(--input-bg-filled-hover,var(--shade-light,hsl(var(--shade-h,0),var(--shade-s,0%),calc(var(--shade-l, 66.6667%)*1.15))))}:host([outlined]){--_input-border-radius:var(--input-border-radius-outlined,0.5rem)}:host([outlined]) #container{border:var(--input-border-width,.0625rem) var(--_input-border-style) var(--_input-state-color)}:host(:focus-within){--_input-state-color:var(--input-state-color-active,var(--primary,hsl(var(--primary-h,258.987),var(--primary-s,38.1643%),var(--primary-l,59.4118%))))}:host(:focus-within) #label,:host([dirty]) #label,:host([type=color]) #label,:host([type=date]) #label,:host([type=file]) #label,:host([type=range]) #label{font-size:var(--input-label-font-size,.75rem);top:var(--input-padding-top-bottom,.5rem);transform:translateY(0)}#slot-wrapper,::slotted(input),::slotted(select),::slotted(textarea){-webkit-tap-highlight-color:rgba(0,0,0,0);-webkit-tap-highlight-color:transparent;-webkit-text-fill-color:var(--_input-color);-webkit-overflow-scrolling:touch;-webkit-appearance:none;-moz-appearance:none;appearance:none;background:#0000;border:none;box-sizing:border-box;caret-color:var(--_input-color-state);color:inherit;display:block;font-size:var(--input-font-size,1rem);margin:0;outline:none;padding:var(--input-padding-top-bottom,.5rem) var(--_input-padding-left-right);position:relative;text-align:var(--input-text-align,inherit);width:100%}:host([label]) #slot-wrapper,:host([label]) ::slotted(input),:host([label]) ::slotted(select),:host([label]) ::slotted(textarea){padding-top:calc(var(--input-label-space, .875rem) + var(--input-padding-top-bottom, .5rem))}:host([invalid]){--_input-state-color:var(--input-state-color-invalid,var(--error,hsl(var(--error-h,4.10526),var(--error-s,89.6226%),var(--error-l,58.4314%))))}::slotted(input[type=color]){cursor:pointer;height:3.75rem}::slotted([slot=after]),::slotted([slot=before]){color:var(--input-before-after-color,var(--shade,hsl(var(--shade-h,0),var(--shade-s,0%),var(--shade-l,66.6667%))))}:host(:not([outlined]):not([filled])) ::slotted([slot=before]){margin-right:var(--input-padding-left-right-outlined,.75rem)}:host(:not([outlined]):not([filled])) ::slotted([slot=after]),:host([filled]) ::slotted([slot=before]),:host([outlined]) ::slotted([slot=before]){margin-left:var(--input-padding-left-right-outlined,.75rem)}:host([filled]) ::slotted([slot=after]),:host([outlined]) ::slotted([slot=after]){margin-right:var(--input-padding-left-right-outlined,.75rem)}#arrow{fill:var(--_input-state-color);height:8px;position:absolute;right:0;top:50%;transform:translate(-100%,-50%);z-index:-1}::slotted(option){display:none}:host(:not([dirty])) ::slotted(select){opacity:0}";
|
|
2
|
+
var stylesheet="*{-webkit-tap-highlight-color:rgba(0,0,0,0);-webkit-tap-highlight-color:transparent;box-sizing:border-box}:host{--_input-state-color:var(--input-state-color-inactive,var(--shade,hsl(var(--shade-h,0),var(--shade-s,0%),var(--shade-l,66.6667%))));--_input-padding-left-right:var(--input-padding-left-right,0);--_input-bg:var(--input-bg,#0000);--_input-border-radius:0;--_input-color:var(--input-color,var(--foreground,#454545));--_input-label-color:var(--input-label-color,var(--shade,hsl(var(--shade-h,0),var(--shade-s,0%),var(--shade-l,66.6667%))));--_input-border-style:var(--input-border-style,solid);display:block;outline:none;transform:translateZ(0)}:host([disabled]){--_input-state-color:var(--input-state-color-disabled,var(--shade-light,hsl(var(--shade-h,0),var(--shade-s,0%),calc(var(--shade-l, 66.6667%)*1.15))));--_input-label-color:var(--input-label-color-disabled,var(--shade,hsl(var(--shade-h,0),var(--shade-s,0%),var(--shade-l,66.6667%))));--_input-color:var(--input-color-disabled,var(--shade-lighter,hsl(var(--shade-h,0),var(--shade-s,0%),calc(var(--shade-l, 66.6667%)*1.3))));--_input-border-style:var(--input-border-style-disabled,dashed);pointer-events:none}#container{align-items:center;background:var(--_input-bg);border-bottom:var(--input-border-width,.0625rem) var(--_input-border-style) var(--_input-state-color);border-radius:var(--_input-border-radius);color:var(--_input-color);display:flex;font-size:var(--input-font-size,1rem);overflow:hidden;position:relative;transition:var(--input-transition,border-color var(--transition-duration-medium,.18s) var(--transition-timing-function-ease,ease),background var(--transition-duration-medium,.18s) var(--transition-timing-function-ease,ease))}#wrapper{flex-grow:1;position:relative}#label{color:var(--_input-label-color);font-size:inherit;left:var(--_input-padding-left-right);line-height:1;pointer-events:none;position:absolute;top:50%;transform:translateY(-50%);transition:var(--input-label-transition,top var(--transition-duration-fast,.12s) var(--transition-timing-function-linear,linear),font-size var(--transition-duration-fast,.12s) var(--transition-timing-function-linear,linear),transform var(--transition-duration-fast,.12s) var(--transition-timing-function-linear,linear));-webkit-user-select:none;user-select:none;white-space:nowrap;z-index:1}:host(:hover){--_input-state-color:var(--input-state-color-hover,var(--primary,hsl(var(--primary-h,258.987),var(--primary-s,38.1643%),var(--primary-l,59.4118%))))}:host([filled]),:host([outlined]){--_input-padding-left-right:var(--input-padding-left-right-outlined,0.75rem)}:host([filled]){--_input-border-radius:var(--input-border-radius-outlined,0.5rem 0.5rem 0 0);--_input-bg:var(--input-bg,var(--shade-lighter,hsl(var(--shade-h,0),var(--shade-s,0%),calc(var(--shade-l, 66.6667%)*1.3))))}:host([filled]:hover){--_input-bg:var(--input-bg-filled-hover,var(--shade-light,hsl(var(--shade-h,0),var(--shade-s,0%),calc(var(--shade-l, 66.6667%)*1.15))))}:host([outlined]){--_input-border-radius:var(--input-border-radius-outlined,0.5rem)}:host([outlined]) #container{border:var(--input-border-width,.0625rem) var(--_input-border-style) var(--_input-state-color)}:host(:focus-within){--_input-state-color:var(--input-state-color-active,var(--primary,hsl(var(--primary-h,258.987),var(--primary-s,38.1643%),var(--primary-l,59.4118%))))}:host(:focus-within) #label,:host([dirty]) #label,:host([type=color]) #label,:host([type=date]) #label,:host([type=file]) #label,:host([type=range]) #label{font-size:var(--input-label-font-size,.75rem);top:var(--input-padding-top-bottom,.5rem);transform:translateY(0)}#slot-wrapper,::slotted(input),::slotted(select),::slotted(textarea){-webkit-tap-highlight-color:rgba(0,0,0,0);-webkit-tap-highlight-color:transparent;-webkit-text-fill-color:var(--_input-color);-webkit-overflow-scrolling:touch;-webkit-appearance:none;-moz-appearance:none;appearance:none;background:#0000;border:none;box-sizing:border-box;caret-color:var(--_input-color-state);color:inherit;display:block;font-size:var(--input-font-size,1rem);margin:0;outline:none;padding:var(--input-padding-top-bottom,.5rem) var(--_input-padding-left-right);position:relative;text-align:var(--input-text-align,inherit);width:100%}:host([label]) #slot-wrapper,:host([label]) ::slotted(input),:host([label]) ::slotted(select),:host([label]) ::slotted(textarea){padding-top:calc(var(--input-label-space, .875rem) + var(--input-padding-top-bottom, .5rem))}:host([invalid]){--_input-state-color:var(--input-state-color-invalid,var(--error,hsl(var(--error-h,4.10526),var(--error-s,89.6226%),var(--error-l,58.4314%))))}::slotted(input[type=color]){cursor:pointer;height:3.75rem}::slotted([slot=after]),::slotted([slot=before]){color:var(--input-before-after-color,var(--shade,hsl(var(--shade-h,0),var(--shade-s,0%),var(--shade-l,66.6667%))))}:host(:not([outlined]):not([filled])) ::slotted([slot=before]){margin-right:var(--input-padding-left-right-outlined,.75rem)}:host(:not([outlined]):not([filled])) ::slotted([slot=after]),:host([filled]) ::slotted([slot=before]),:host([outlined]) ::slotted([slot=before]){margin-left:var(--input-padding-left-right-outlined,.75rem)}:host([filled]) ::slotted([slot=after]),:host([outlined]) ::slotted([slot=after]){margin-right:var(--input-padding-left-right-outlined,.75rem)}#arrow{fill:var(--_input-state-color);height:8px;position:absolute;right:0;top:50%;transform:translate(-100%,-50%);z-index:-1}::slotted(option){display:none}:host(:not([dirty])) ::slotted(select){opacity:0}";
|
|
3
|
+
|
|
4
|
+
export { css_248z as default, stylesheet };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./slider";
|
package/slider/index.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { TkSlider } from './slider.js';
|