tinkiet 0.9.14 → 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/tab-group/index.js
CHANGED
|
@@ -1 +1,182 @@
|
|
|
1
|
-
|
|
1
|
+
import * as __WEBPACK_EXTERNAL_MODULE_lit__ from "lit";
|
|
2
|
+
import * as __WEBPACK_EXTERNAL_MODULE_lit_decorators_js_226d44c5__ from "lit/decorators.js";
|
|
3
|
+
/******/ var __webpack_modules__ = ({
|
|
4
|
+
|
|
5
|
+
/***/ 2927:
|
|
6
|
+
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
|
|
7
|
+
|
|
8
|
+
var x = (y) => {
|
|
9
|
+
var x = {}; __webpack_require__.d(x, y); return x
|
|
10
|
+
}
|
|
11
|
+
var y = (x) => (() => (x))
|
|
12
|
+
module.exports = x({ ["LitElement"]: () => (__WEBPACK_EXTERNAL_MODULE_lit__.LitElement), ["css"]: () => (__WEBPACK_EXTERNAL_MODULE_lit__.css), ["html"]: () => (__WEBPACK_EXTERNAL_MODULE_lit__.html), ["unsafeCSS"]: () => (__WEBPACK_EXTERNAL_MODULE_lit__.unsafeCSS) });
|
|
13
|
+
|
|
14
|
+
/***/ }),
|
|
15
|
+
|
|
16
|
+
/***/ 6361:
|
|
17
|
+
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
// EXPORTS
|
|
21
|
+
__webpack_require__.d(__webpack_exports__, {
|
|
22
|
+
I: () => (/* binding */ TkTabGroup)
|
|
23
|
+
});
|
|
24
|
+
|
|
25
|
+
// EXTERNAL MODULE: external "lit"
|
|
26
|
+
var external_lit_ = __webpack_require__(2927);
|
|
27
|
+
// EXTERNAL MODULE: external "lit/decorators.js"
|
|
28
|
+
var decorators_js_ = __webpack_require__(8899);
|
|
29
|
+
;// ./tinkiet/tab-group/tab-group.scss
|
|
30
|
+
/* harmony default export */ const tab_group = ("*{-webkit-tap-highlight-color:rgba(0,0,0,0);-webkit-tap-highlight-color:rgba(0,0,0,0);box-sizing:border-box}:host{display:inline-block;position:relative;overflow-x:hidden}:host([overflow]){overflow-x:auto}.tabs{display:flex}:host(:not([circle])) .tabs{border-bottom:solid 2px hsl(var(--primary-container))}.underline{will-change:transform;margin-top:-2px;background-color:hsl(var(--primary));height:2px;transition:transform ease 200ms;width:0}.circle{background-color:hsl(var(--primary));height:8px;width:8px;border-radius:var(--border-radius-circle, 50%);transition:transform ease 300ms}");
|
|
31
|
+
;// ./tinkiet/tab-group/tab-group.ts
|
|
32
|
+
var __decorate = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {
|
|
33
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
34
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
35
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
36
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
37
|
+
};
|
|
38
|
+
|
|
39
|
+
|
|
40
|
+
|
|
41
|
+
let TkTabGroup = class TkTabGroup extends external_lit_.LitElement {
|
|
42
|
+
render() {
|
|
43
|
+
return (0,external_lit_.html) `
|
|
44
|
+
<div class="tabs">
|
|
45
|
+
<slot @click=${(e) => this.clickOnTab(e.target)} @slotchange=${() => this.updateUnderline()}></slot>
|
|
46
|
+
</div>
|
|
47
|
+
<div class="underline"></div>
|
|
48
|
+
`;
|
|
49
|
+
}
|
|
50
|
+
constructor() {
|
|
51
|
+
super();
|
|
52
|
+
this.secondary = false;
|
|
53
|
+
this.observe = "";
|
|
54
|
+
this.selected = "";
|
|
55
|
+
}
|
|
56
|
+
firstUpdated() {
|
|
57
|
+
if (IntersectionObserver) {
|
|
58
|
+
const observer = new IntersectionObserver(this.updateUnderline.bind(this));
|
|
59
|
+
observer.observe(this);
|
|
60
|
+
}
|
|
61
|
+
else {
|
|
62
|
+
this.updateUnderline.bind(this);
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
updated(props) {
|
|
66
|
+
var _a, _b;
|
|
67
|
+
if (props.has("selected") && this.selected !== "") {
|
|
68
|
+
this.querySelectorAll("*").forEach(node => node.removeAttribute("selected"));
|
|
69
|
+
(_a = this.querySelector(`[tab="${this.selected}"]`)) === null || _a === void 0 ? void 0 : _a.setAttribute("selected", "");
|
|
70
|
+
}
|
|
71
|
+
if (props.has("observe")) {
|
|
72
|
+
(_b = this.querySelector(`[tab="${this.selected}"]`)) === null || _b === void 0 ? void 0 : _b.focus();
|
|
73
|
+
this.updateUnderline();
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
clickOnTab(tab) {
|
|
77
|
+
this.querySelectorAll("*").forEach(node => node.removeAttribute("selected"));
|
|
78
|
+
tab.setAttribute("selected", "");
|
|
79
|
+
this.updateUnderline();
|
|
80
|
+
this.dispatchEvent(new CustomEvent("change", { detail: tab.getAttribute("tab"), composed: true, bubbles: true }));
|
|
81
|
+
}
|
|
82
|
+
updateUnderline() {
|
|
83
|
+
const selected = this.querySelector("[selected]");
|
|
84
|
+
if (selected) {
|
|
85
|
+
setTimeout(() => {
|
|
86
|
+
this.$underline.style.width = selected.clientWidth + "px";
|
|
87
|
+
this.$underline.style.transform = `translateX(${selected.offsetLeft}px)`;
|
|
88
|
+
});
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
};
|
|
92
|
+
TkTabGroup.styles = (0,external_lit_.css) `
|
|
93
|
+
${(0,external_lit_.unsafeCSS)(tab_group)}
|
|
94
|
+
`;
|
|
95
|
+
__decorate([
|
|
96
|
+
(0,decorators_js_.property)({ attribute: true, type: Boolean })
|
|
97
|
+
], TkTabGroup.prototype, "secondary", void 0);
|
|
98
|
+
__decorate([
|
|
99
|
+
(0,decorators_js_.property)({ attribute: true, type: String })
|
|
100
|
+
], TkTabGroup.prototype, "observe", void 0);
|
|
101
|
+
__decorate([
|
|
102
|
+
(0,decorators_js_.property)({ attribute: true, type: String })
|
|
103
|
+
], TkTabGroup.prototype, "selected", void 0);
|
|
104
|
+
__decorate([
|
|
105
|
+
(0,decorators_js_.query)(".underline")
|
|
106
|
+
], TkTabGroup.prototype, "$underline", void 0);
|
|
107
|
+
__decorate([
|
|
108
|
+
(0,decorators_js_.query)(".circle")
|
|
109
|
+
], TkTabGroup.prototype, "$circle", void 0);
|
|
110
|
+
TkTabGroup = __decorate([
|
|
111
|
+
(0,decorators_js_.customElement)("tk-tab-group")
|
|
112
|
+
], TkTabGroup);
|
|
113
|
+
|
|
114
|
+
|
|
115
|
+
|
|
116
|
+
/***/ }),
|
|
117
|
+
|
|
118
|
+
/***/ 8899:
|
|
119
|
+
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
|
|
120
|
+
|
|
121
|
+
var x = (y) => {
|
|
122
|
+
var x = {}; __webpack_require__.d(x, y); return x
|
|
123
|
+
}
|
|
124
|
+
var y = (x) => (() => (x))
|
|
125
|
+
module.exports = x({ ["customElement"]: () => (__WEBPACK_EXTERNAL_MODULE_lit_decorators_js_226d44c5__.customElement), ["property"]: () => (__WEBPACK_EXTERNAL_MODULE_lit_decorators_js_226d44c5__.property), ["query"]: () => (__WEBPACK_EXTERNAL_MODULE_lit_decorators_js_226d44c5__.query) });
|
|
126
|
+
|
|
127
|
+
/***/ })
|
|
128
|
+
|
|
129
|
+
/******/ });
|
|
130
|
+
/************************************************************************/
|
|
131
|
+
/******/ // The module cache
|
|
132
|
+
/******/ var __webpack_module_cache__ = {};
|
|
133
|
+
/******/
|
|
134
|
+
/******/ // The require function
|
|
135
|
+
/******/ function __webpack_require__(moduleId) {
|
|
136
|
+
/******/ // Check if module is in cache
|
|
137
|
+
/******/ var cachedModule = __webpack_module_cache__[moduleId];
|
|
138
|
+
/******/ if (cachedModule !== undefined) {
|
|
139
|
+
/******/ return cachedModule.exports;
|
|
140
|
+
/******/ }
|
|
141
|
+
/******/ // Create a new module (and put it into the cache)
|
|
142
|
+
/******/ var module = __webpack_module_cache__[moduleId] = {
|
|
143
|
+
/******/ // no module.id needed
|
|
144
|
+
/******/ // no module.loaded needed
|
|
145
|
+
/******/ exports: {}
|
|
146
|
+
/******/ };
|
|
147
|
+
/******/
|
|
148
|
+
/******/ // Execute the module function
|
|
149
|
+
/******/ __webpack_modules__[moduleId](module, module.exports, __webpack_require__);
|
|
150
|
+
/******/
|
|
151
|
+
/******/ // Return the exports of the module
|
|
152
|
+
/******/ return module.exports;
|
|
153
|
+
/******/ }
|
|
154
|
+
/******/
|
|
155
|
+
/************************************************************************/
|
|
156
|
+
/******/ /* webpack/runtime/define property getters */
|
|
157
|
+
/******/ (() => {
|
|
158
|
+
/******/ // define getter functions for harmony exports
|
|
159
|
+
/******/ __webpack_require__.d = (exports, definition) => {
|
|
160
|
+
/******/ for(var key in definition) {
|
|
161
|
+
/******/ if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {
|
|
162
|
+
/******/ Object.defineProperty(exports, key, { enumerable: true, get: definition[key] });
|
|
163
|
+
/******/ }
|
|
164
|
+
/******/ }
|
|
165
|
+
/******/ };
|
|
166
|
+
/******/ })();
|
|
167
|
+
/******/
|
|
168
|
+
/******/ /* webpack/runtime/hasOwnProperty shorthand */
|
|
169
|
+
/******/ (() => {
|
|
170
|
+
/******/ __webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))
|
|
171
|
+
/******/ })();
|
|
172
|
+
/******/
|
|
173
|
+
/************************************************************************/
|
|
174
|
+
var __webpack_exports__ = {};
|
|
175
|
+
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
176
|
+
/* harmony export */ I: () => (/* reexport safe */ _tab_group__WEBPACK_IMPORTED_MODULE_0__.I)
|
|
177
|
+
/* harmony export */ });
|
|
178
|
+
/* harmony import */ var _tab_group__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(6361);
|
|
179
|
+
|
|
180
|
+
|
|
181
|
+
const __webpack_exports__TkTabGroup = __webpack_exports__.I;
|
|
182
|
+
export { __webpack_exports__TkTabGroup as TkTabGroup };
|
package/tab-group/tab-group.d.ts
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { LitElement } from "lit";
|
|
2
|
-
declare class TkTabGroup extends LitElement {
|
|
2
|
+
export declare class TkTabGroup extends LitElement {
|
|
3
3
|
static styles: import("lit").CSSResult;
|
|
4
4
|
secondary: boolean;
|
|
5
5
|
observe: string;
|
|
6
6
|
selected: string;
|
|
7
7
|
private $underline;
|
|
8
8
|
private $circle;
|
|
9
|
-
render(): import("lit
|
|
9
|
+
render(): import("lit").TemplateResult<1>;
|
|
10
10
|
constructor();
|
|
11
11
|
firstUpdated(): void;
|
|
12
12
|
updated(props: any): void;
|
|
@@ -18,4 +18,3 @@ declare global {
|
|
|
18
18
|
"tk-tab-group": TkTabGroup;
|
|
19
19
|
}
|
|
20
20
|
}
|
|
21
|
-
export { TkTabGroup };
|
package/textarea/index.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export * from "./textarea
|
|
1
|
+
export * from "./textarea";
|
package/textarea/index.js
CHANGED
|
@@ -1 +1,272 @@
|
|
|
1
|
-
|
|
1
|
+
import * as __WEBPACK_EXTERNAL_MODULE_lit__ from "lit";
|
|
2
|
+
import * as __WEBPACK_EXTERNAL_MODULE_lit_directives_if_defined_js_76c6050d__ from "lit/directives/if-defined.js";
|
|
3
|
+
import * as __WEBPACK_EXTERNAL_MODULE_lit_decorators_js_226d44c5__ from "lit/decorators.js";
|
|
4
|
+
/******/ var __webpack_modules__ = ({
|
|
5
|
+
|
|
6
|
+
/***/ 2927:
|
|
7
|
+
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
|
|
8
|
+
|
|
9
|
+
var x = (y) => {
|
|
10
|
+
var x = {}; __webpack_require__.d(x, y); return x
|
|
11
|
+
}
|
|
12
|
+
var y = (x) => (() => (x))
|
|
13
|
+
module.exports = x({ ["LitElement"]: () => (__WEBPACK_EXTERNAL_MODULE_lit__.LitElement), ["css"]: () => (__WEBPACK_EXTERNAL_MODULE_lit__.css), ["html"]: () => (__WEBPACK_EXTERNAL_MODULE_lit__.html), ["unsafeCSS"]: () => (__WEBPACK_EXTERNAL_MODULE_lit__.unsafeCSS) });
|
|
14
|
+
|
|
15
|
+
/***/ }),
|
|
16
|
+
|
|
17
|
+
/***/ 3517:
|
|
18
|
+
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
|
|
19
|
+
|
|
20
|
+
var x = (y) => {
|
|
21
|
+
var x = {}; __webpack_require__.d(x, y); return x
|
|
22
|
+
}
|
|
23
|
+
var y = (x) => (() => (x))
|
|
24
|
+
module.exports = x({ ["ifDefined"]: () => (__WEBPACK_EXTERNAL_MODULE_lit_directives_if_defined_js_76c6050d__.ifDefined) });
|
|
25
|
+
|
|
26
|
+
/***/ }),
|
|
27
|
+
|
|
28
|
+
/***/ 3770:
|
|
29
|
+
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
30
|
+
|
|
31
|
+
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
32
|
+
/* harmony export */ z: () => (/* binding */ uniqueID)
|
|
33
|
+
/* harmony export */ });
|
|
34
|
+
/**
|
|
35
|
+
* Returns a unique ID.
|
|
36
|
+
* @param {number} length
|
|
37
|
+
* @returns {string}
|
|
38
|
+
*/
|
|
39
|
+
function uniqueID(length = 10) {
|
|
40
|
+
return `_${Math.random()
|
|
41
|
+
.toString(36)
|
|
42
|
+
.substr(2, length)}`;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
|
|
46
|
+
/***/ }),
|
|
47
|
+
|
|
48
|
+
/***/ 5524:
|
|
49
|
+
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
50
|
+
|
|
51
|
+
|
|
52
|
+
// EXPORTS
|
|
53
|
+
__webpack_require__.d(__webpack_exports__, {
|
|
54
|
+
W: () => (/* binding */ TkTextarea)
|
|
55
|
+
});
|
|
56
|
+
|
|
57
|
+
// EXTERNAL MODULE: external "lit"
|
|
58
|
+
var external_lit_ = __webpack_require__(2927);
|
|
59
|
+
// EXTERNAL MODULE: external "lit/decorators.js"
|
|
60
|
+
var decorators_js_ = __webpack_require__(8899);
|
|
61
|
+
// EXTERNAL MODULE: external "lit/directives/if-defined.js"
|
|
62
|
+
var if_defined_js_ = __webpack_require__(3517);
|
|
63
|
+
// EXTERNAL MODULE: ./tinkiet/utils/unique.ts
|
|
64
|
+
var unique = __webpack_require__(3770);
|
|
65
|
+
;// ./tinkiet/textarea/textarea.scss
|
|
66
|
+
/* harmony default export */ const textarea_textarea = ("*{-webkit-tap-highlight-color:rgba(0,0,0,0);-webkit-tap-highlight-color:rgba(0,0,0,0);box-sizing:border-box}:host{transform:translateZ(0);display:block;outline:none}:host #container{background-color:hsla(var(--surface-container-highest), 0.5);color:hsl(var(--on-surface));border-radius:4px 4px 0 0;font-size:var(--input-font-size, 1rem);border-bottom:solid 1px hsl(var(--on-surface-variant));transition:var(--input-transition, border-color var(--transition-duration-medium, 0.18s) var(--transition-timing-function-ease, ease), background var(--transition-duration-medium, 0.18s) var(--transition-timing-function-ease, ease));position:relative;display:flex;align-items:center;overflow:hidden;padding:8px 16px 8px 16px;height:56px}:host #wrapper{position:relative;flex-grow:1}:host #label{color:hsl(var(--on-surface-variant));font-weight:400;line-height:64px;transition:var(--input-label-transition, top var(--transition-duration-fast, 0.12s) var(--transition-timing-function-linear, linear), font-size var(--transition-duration-fast, 0.12s) var(--transition-timing-function-linear, linear), transform var(--transition-duration-fast, 0.12s) var(--transition-timing-function-linear, linear));top:50%;transform:translateY(-50%);z-index:1;position:absolute;pointer-events:none;font-size:inherit;line-height:1;white-space:nowrap;-webkit-user-select:none;user-select:none}:host([disabled]){pointer-events:none;opacity:.38}:host(:hover) #container{background-color:hsla(var(--surface-container-highest), 0.5);color:hsl(var(--on-surface));border-radius:4px 4px 0 0;font-size:var(--input-font-size, 1rem);border-bottom:solid 1px hsl(var(--on-surface))}:host(:focus-within) #container{border-bottom:solid 2px hsl(var(--primary));background-color:hsla(var(--on-surface), 0.3);padding:8px 16px 7px 16px}:host([outlined]) #container{background-color:rgba(0,0,0,0);border:solid 1px hsl(var(--outline));border-radius:4px}:host([outlined]:focus-within) #container{border:solid 2px hsl(var(--primary));padding:7px 15px 7px 15px}: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, 0.75rem);top:0;transform:translateY(0);color:hsl(var(--primary))}#slot-wrapper,::slotted(input),::slotted(select),::slotted(textarea){caret-color:hsl(var(--primary));padding:var(--input-padding-top-bottom, 0.5rem) var(--_input-padding-left-right);font-size:var(--input-font-size, 1rem);text-align:var(--input-text-align, inherit);-webkit-tap-highlight-color:rgba(0,0,0,0);-webkit-tap-highlight-color:rgba(0,0,0,0);box-sizing:border-box;display:block;color:inherit;-webkit-text-fill-color:var(--_input-color);-webkit-overflow-scrolling:touch;position:relative;-webkit-appearance:none;-moz-appearance:none;appearance:none;border:none;outline:none;margin:0;background:rgba(0,0,0,0);width:100%}:host([label]) #slot-wrapper,:host([label]) ::slotted(input),:host([label]) ::slotted(select),:host([label]) ::slotted(textarea){padding-top:16px}:host([invalid]){color:hsl(var(--error))}::slotted(input[type=color]){height:3.75rem;cursor:pointer}::slotted([slot=after]),::slotted([slot=before]){color:var(--input-before-after-color, hsl(var(--shadow)))}:host(:not([outlined]):not([filled])) ::slotted([slot=before]){margin-right:var(--input-padding-left-right-outlined, 0.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, 0.75rem)}:host([filled]) ::slotted([slot=after]),:host([outlined]) ::slotted([slot=after]){margin-right:var(--input-padding-left-right-outlined, 0.75rem)}:host #container{height:auto;min-height:56px}#wrapper ::slotted(textarea){height:var(--textarea-height, var(--_textarea-height));min-height:var(--textarea-min-height, var(--textarea-height, var(--_textarea-height)));max-height:var(--textarea-max-height);resize:var(--textarea-resize, none);font-family:inherit}:host(:focus) ::slotted(textarea),:host(:hover) ::slotted(textarea){will-change:height}");
|
|
67
|
+
;// ./tinkiet/textarea/textarea.ts
|
|
68
|
+
var __decorate = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {
|
|
69
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
70
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
71
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
72
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
73
|
+
};
|
|
74
|
+
|
|
75
|
+
|
|
76
|
+
|
|
77
|
+
|
|
78
|
+
|
|
79
|
+
let TkTextarea = class TkTextarea extends external_lit_.LitElement {
|
|
80
|
+
constructor() {
|
|
81
|
+
super(...arguments);
|
|
82
|
+
this._id = (0,unique/* uniqueID */.z)();
|
|
83
|
+
this.type = "text";
|
|
84
|
+
this.required = false;
|
|
85
|
+
this.disabled = false;
|
|
86
|
+
this.readonly = false;
|
|
87
|
+
this.rows = 1;
|
|
88
|
+
}
|
|
89
|
+
set value(value) {
|
|
90
|
+
if (!this.$input) {
|
|
91
|
+
this.initialValue = value;
|
|
92
|
+
}
|
|
93
|
+
else {
|
|
94
|
+
this.$input.value = value;
|
|
95
|
+
this.refreshAttributes();
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
get value() {
|
|
99
|
+
return this.$input != null ? this.$input.value : this.initialValue || "";
|
|
100
|
+
}
|
|
101
|
+
render() {
|
|
102
|
+
return (0,external_lit_.html) `
|
|
103
|
+
<div id="container">
|
|
104
|
+
<slot id="before" name="before"></slot>
|
|
105
|
+
<div id="wrapper">
|
|
106
|
+
<div id="label">${this.label}</div>
|
|
107
|
+
<slot id="slot"></slot>
|
|
108
|
+
<textarea
|
|
109
|
+
id=${this._id}
|
|
110
|
+
@keydown=${this.handleChange.bind(this)}
|
|
111
|
+
@input=${this.handleChange.bind(this)}
|
|
112
|
+
@focusout=${this.handleChange.bind(this)}
|
|
113
|
+
?required="${this.required}"
|
|
114
|
+
?disabled="${this.disabled}"
|
|
115
|
+
?readonly="${this.readonly}"
|
|
116
|
+
aria-label="${(0,if_defined_js_.ifDefined)(this.label)}"
|
|
117
|
+
name="${(0,if_defined_js_.ifDefined)(this.name)}"
|
|
118
|
+
pattern="${(0,if_defined_js_.ifDefined)(this.pattern)}"
|
|
119
|
+
autocomplete="${(0,if_defined_js_.ifDefined)(this.autocomplete)}"
|
|
120
|
+
autocapitalize="${(0,if_defined_js_.ifDefined)(this.autocapitalize)}"
|
|
121
|
+
minlength="${(0,if_defined_js_.ifDefined)(this.minLength)}"
|
|
122
|
+
maxlength="${(0,if_defined_js_.ifDefined)(this.maxLength)}"
|
|
123
|
+
rows="${this.rows}"
|
|
124
|
+
tabindex="${this.disabled ? -1 : 0}"
|
|
125
|
+
></textarea>
|
|
126
|
+
</div>
|
|
127
|
+
<slot id="after" name="after"></slot>
|
|
128
|
+
</div>
|
|
129
|
+
`;
|
|
130
|
+
}
|
|
131
|
+
handleChange() {
|
|
132
|
+
this.refreshAttributes();
|
|
133
|
+
}
|
|
134
|
+
firstUpdated() {
|
|
135
|
+
var _a;
|
|
136
|
+
this.$input = (_a = this.shadowRoot) === null || _a === void 0 ? void 0 : _a.querySelector("textarea");
|
|
137
|
+
this.appendChild(this.$input);
|
|
138
|
+
if (this.initialValue)
|
|
139
|
+
this.value = this.initialValue;
|
|
140
|
+
}
|
|
141
|
+
refreshAttributes() {
|
|
142
|
+
this.$input.value ? this.setAttribute("dirty", "") : this.removeAttribute("dirty");
|
|
143
|
+
this.$input.checkValidity() ? this.removeAttribute("invalid") : this.setAttribute("invalid", "");
|
|
144
|
+
}
|
|
145
|
+
focus() {
|
|
146
|
+
this.$input.focus();
|
|
147
|
+
}
|
|
148
|
+
};
|
|
149
|
+
TkTextarea.styles = (0,external_lit_.css) `
|
|
150
|
+
${(0,external_lit_.unsafeCSS)(textarea_textarea)}
|
|
151
|
+
`;
|
|
152
|
+
__decorate([
|
|
153
|
+
(0,decorators_js_.property)({ type: String })
|
|
154
|
+
], TkTextarea.prototype, "value", null);
|
|
155
|
+
__decorate([
|
|
156
|
+
(0,decorators_js_.property)({ attribute: true, type: String })
|
|
157
|
+
], TkTextarea.prototype, "name", void 0);
|
|
158
|
+
__decorate([
|
|
159
|
+
(0,decorators_js_.property)({ type: String })
|
|
160
|
+
], TkTextarea.prototype, "list", void 0);
|
|
161
|
+
__decorate([
|
|
162
|
+
(0,decorators_js_.property)({ type: String })
|
|
163
|
+
], TkTextarea.prototype, "type", void 0);
|
|
164
|
+
__decorate([
|
|
165
|
+
(0,decorators_js_.property)({ type: Boolean })
|
|
166
|
+
], TkTextarea.prototype, "required", void 0);
|
|
167
|
+
__decorate([
|
|
168
|
+
(0,decorators_js_.property)({ type: Boolean, reflect: true })
|
|
169
|
+
], TkTextarea.prototype, "disabled", void 0);
|
|
170
|
+
__decorate([
|
|
171
|
+
(0,decorators_js_.property)({ type: Boolean })
|
|
172
|
+
], TkTextarea.prototype, "readonly", void 0);
|
|
173
|
+
__decorate([
|
|
174
|
+
(0,decorators_js_.property)({ type: String })
|
|
175
|
+
], TkTextarea.prototype, "autocomplete", void 0);
|
|
176
|
+
__decorate([
|
|
177
|
+
(0,decorators_js_.property)({ type: String })
|
|
178
|
+
], TkTextarea.prototype, "autocapitalize", void 0);
|
|
179
|
+
__decorate([
|
|
180
|
+
(0,decorators_js_.property)({ type: String })
|
|
181
|
+
], TkTextarea.prototype, "pattern", void 0);
|
|
182
|
+
__decorate([
|
|
183
|
+
(0,decorators_js_.state)()
|
|
184
|
+
], TkTextarea.prototype, "initialValue", void 0);
|
|
185
|
+
__decorate([
|
|
186
|
+
(0,decorators_js_.property)({ type: String })
|
|
187
|
+
], TkTextarea.prototype, "label", void 0);
|
|
188
|
+
__decorate([
|
|
189
|
+
(0,decorators_js_.property)({ type: Number })
|
|
190
|
+
], TkTextarea.prototype, "minLength", void 0);
|
|
191
|
+
__decorate([
|
|
192
|
+
(0,decorators_js_.property)({ type: Number })
|
|
193
|
+
], TkTextarea.prototype, "maxLength", void 0);
|
|
194
|
+
__decorate([
|
|
195
|
+
(0,decorators_js_.property)({ type: Number })
|
|
196
|
+
], TkTextarea.prototype, "rows", void 0);
|
|
197
|
+
__decorate([
|
|
198
|
+
(0,decorators_js_.eventOptions)({ passive: true })
|
|
199
|
+
], TkTextarea.prototype, "handleChange", null);
|
|
200
|
+
TkTextarea = __decorate([
|
|
201
|
+
(0,decorators_js_.customElement)("tk-textarea")
|
|
202
|
+
], TkTextarea);
|
|
203
|
+
|
|
204
|
+
|
|
205
|
+
|
|
206
|
+
/***/ }),
|
|
207
|
+
|
|
208
|
+
/***/ 8899:
|
|
209
|
+
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
|
|
210
|
+
|
|
211
|
+
var x = (y) => {
|
|
212
|
+
var x = {}; __webpack_require__.d(x, y); return x
|
|
213
|
+
}
|
|
214
|
+
var y = (x) => (() => (x))
|
|
215
|
+
module.exports = x({ ["customElement"]: () => (__WEBPACK_EXTERNAL_MODULE_lit_decorators_js_226d44c5__.customElement), ["eventOptions"]: () => (__WEBPACK_EXTERNAL_MODULE_lit_decorators_js_226d44c5__.eventOptions), ["property"]: () => (__WEBPACK_EXTERNAL_MODULE_lit_decorators_js_226d44c5__.property), ["state"]: () => (__WEBPACK_EXTERNAL_MODULE_lit_decorators_js_226d44c5__.state) });
|
|
216
|
+
|
|
217
|
+
/***/ })
|
|
218
|
+
|
|
219
|
+
/******/ });
|
|
220
|
+
/************************************************************************/
|
|
221
|
+
/******/ // The module cache
|
|
222
|
+
/******/ var __webpack_module_cache__ = {};
|
|
223
|
+
/******/
|
|
224
|
+
/******/ // The require function
|
|
225
|
+
/******/ function __webpack_require__(moduleId) {
|
|
226
|
+
/******/ // Check if module is in cache
|
|
227
|
+
/******/ var cachedModule = __webpack_module_cache__[moduleId];
|
|
228
|
+
/******/ if (cachedModule !== undefined) {
|
|
229
|
+
/******/ return cachedModule.exports;
|
|
230
|
+
/******/ }
|
|
231
|
+
/******/ // Create a new module (and put it into the cache)
|
|
232
|
+
/******/ var module = __webpack_module_cache__[moduleId] = {
|
|
233
|
+
/******/ // no module.id needed
|
|
234
|
+
/******/ // no module.loaded needed
|
|
235
|
+
/******/ exports: {}
|
|
236
|
+
/******/ };
|
|
237
|
+
/******/
|
|
238
|
+
/******/ // Execute the module function
|
|
239
|
+
/******/ __webpack_modules__[moduleId](module, module.exports, __webpack_require__);
|
|
240
|
+
/******/
|
|
241
|
+
/******/ // Return the exports of the module
|
|
242
|
+
/******/ return module.exports;
|
|
243
|
+
/******/ }
|
|
244
|
+
/******/
|
|
245
|
+
/************************************************************************/
|
|
246
|
+
/******/ /* webpack/runtime/define property getters */
|
|
247
|
+
/******/ (() => {
|
|
248
|
+
/******/ // define getter functions for harmony exports
|
|
249
|
+
/******/ __webpack_require__.d = (exports, definition) => {
|
|
250
|
+
/******/ for(var key in definition) {
|
|
251
|
+
/******/ if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {
|
|
252
|
+
/******/ Object.defineProperty(exports, key, { enumerable: true, get: definition[key] });
|
|
253
|
+
/******/ }
|
|
254
|
+
/******/ }
|
|
255
|
+
/******/ };
|
|
256
|
+
/******/ })();
|
|
257
|
+
/******/
|
|
258
|
+
/******/ /* webpack/runtime/hasOwnProperty shorthand */
|
|
259
|
+
/******/ (() => {
|
|
260
|
+
/******/ __webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))
|
|
261
|
+
/******/ })();
|
|
262
|
+
/******/
|
|
263
|
+
/************************************************************************/
|
|
264
|
+
var __webpack_exports__ = {};
|
|
265
|
+
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
266
|
+
/* harmony export */ W: () => (/* reexport safe */ _textarea__WEBPACK_IMPORTED_MODULE_0__.W)
|
|
267
|
+
/* harmony export */ });
|
|
268
|
+
/* harmony import */ var _textarea__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(5524);
|
|
269
|
+
|
|
270
|
+
|
|
271
|
+
const __webpack_exports__TkTextarea = __webpack_exports__.W;
|
|
272
|
+
export { __webpack_exports__TkTextarea as TkTextarea };
|
package/textarea/textarea.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { LitElement } from "lit";
|
|
2
|
-
declare class TkTextarea extends LitElement {
|
|
2
|
+
export declare class TkTextarea extends LitElement {
|
|
3
3
|
static styles: import("lit").CSSResult;
|
|
4
4
|
private _id;
|
|
5
5
|
set value(value: string);
|
|
@@ -19,7 +19,7 @@ declare class TkTextarea extends LitElement {
|
|
|
19
19
|
maxLength: number;
|
|
20
20
|
rows: number;
|
|
21
21
|
private $input;
|
|
22
|
-
render(): import("lit
|
|
22
|
+
render(): import("lit").TemplateResult<1>;
|
|
23
23
|
private handleChange;
|
|
24
24
|
firstUpdated(): void;
|
|
25
25
|
private refreshAttributes;
|
|
@@ -30,4 +30,3 @@ declare global {
|
|
|
30
30
|
"tk-textarea": TkTextarea;
|
|
31
31
|
}
|
|
32
32
|
}
|
|
33
|
-
export { TkTextarea };
|
package/textfield/index.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export * from "./textfield
|
|
1
|
+
export * from "./textfield";
|