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.
Files changed (144) hide show
  1. package/accordion/accordion.d.ts +3 -4
  2. package/accordion/index.d.ts +1 -1
  3. package/accordion/index.js +491 -1
  4. package/badge/badge.d.ts +2 -3
  5. package/badge/index.d.ts +1 -1
  6. package/badge/index.js +134 -1
  7. package/box/box.d.ts +3 -3
  8. package/box/focusable-box.d.ts +2 -3
  9. package/box/index.d.ts +1 -1
  10. package/box/index.js +289 -1
  11. package/button/button.d.ts +3 -4
  12. package/button/index.d.ts +1 -1
  13. package/button/index.js +502 -1
  14. package/checkbox/checkbox.d.ts +3 -3
  15. package/checkbox/index.d.ts +1 -1
  16. package/checkbox/index.js +450 -1
  17. package/chip/chip.d.ts +2 -3
  18. package/chip/index.d.ts +1 -1
  19. package/chip/index.js +123 -1
  20. package/dialog/dialog.d.ts +2 -3
  21. package/dialog/index.d.ts +1 -1
  22. package/dialog/index.js +162 -1
  23. package/drawer/drawer.d.ts +2 -3
  24. package/drawer/index.d.ts +1 -1
  25. package/drawer/index.js +272 -1
  26. package/form/form.d.ts +1 -2
  27. package/form/index.d.ts +1 -1
  28. package/form/index.js +149 -1
  29. package/icon/icon.d.ts +3 -4
  30. package/icon/icons.d.ts +1 -2
  31. package/icon/index.d.ts +2 -2
  32. package/icon/index.js +457 -2
  33. package/index.d.ts +52 -26
  34. package/index.js +3682 -52
  35. package/list-item/index.d.ts +1 -1
  36. package/list-item/index.js +414 -1
  37. package/list-item/list-item.d.ts +3 -4
  38. package/loading/index.d.ts +1 -1
  39. package/loading/index.js +389 -1
  40. package/loading/loading.d.ts +3 -4
  41. package/navigation/index.d.ts +2 -2
  42. package/navigation/index.js +201 -2
  43. package/navigation/navigation-bar.d.ts +2 -3
  44. package/navigation/navigation-item.d.ts +2 -3
  45. package/notie/index.d.ts +1 -1
  46. package/notie/index.js +744 -1
  47. package/notie/notie.d.ts +12 -11
  48. package/package.json +8 -5
  49. package/pages/index.d.ts +1 -1
  50. package/pages/index.js +178 -1
  51. package/pages/pages.d.ts +2 -3
  52. package/radio/index.d.ts +1 -1
  53. package/radio/index.js +466 -1
  54. package/radio/radio.d.ts +3 -3
  55. package/select/index.d.ts +1 -1
  56. package/select/index.js +493 -1
  57. package/select/select.d.ts +3 -3
  58. package/slider/index.d.ts +1 -1
  59. package/slider/index.js +274 -1
  60. package/slider/slider.d.ts +2 -3
  61. package/snackbar/index.d.ts +1 -0
  62. package/snackbar/snackbar.d.ts +34 -0
  63. package/switch/index.d.ts +1 -1
  64. package/switch/index.js +462 -1
  65. package/switch/switch.d.ts +3 -3
  66. package/tab-group/index.d.ts +1 -1
  67. package/tab-group/index.js +182 -1
  68. package/tab-group/tab-group.d.ts +2 -3
  69. package/tab-group/tab-item.d.ts +7 -0
  70. package/textarea/index.d.ts +1 -1
  71. package/textarea/index.js +272 -1
  72. package/textarea/textarea.d.ts +2 -3
  73. package/textfield/index.d.ts +1 -1
  74. package/textfield/index.js +278 -1
  75. package/textfield/textfield.d.ts +2 -3
  76. package/theme/index.d.ts +1 -1
  77. package/theme/index.js +240 -1
  78. package/theme/theme.d.ts +2 -3
  79. package/tooltip/index.d.ts +1 -1
  80. package/tooltip/index.js +136 -1
  81. package/tooltip/tooltip.d.ts +2 -3
  82. package/topbar/index.d.ts +1 -1
  83. package/topbar/index.js +358 -1
  84. package/topbar/topbar.d.ts +3 -4
  85. package/umd/tinkiet.min.js +420 -1
  86. package/utils/aria.d.ts +11 -0
  87. package/utils/unique.d.ts +1 -2
  88. package/accordion/accordion.js +0 -94
  89. package/accordion/accordion.scss.js +0 -4
  90. package/badge/badge.js +0 -31
  91. package/badge/badge.scss.js +0 -4
  92. package/box/box.js +0 -186
  93. package/box/box.scss.js +0 -4
  94. package/box/focusable-box.js +0 -30
  95. package/button/button.js +0 -141
  96. package/button/button.scss.js +0 -4
  97. package/checkbox/checkbox.js +0 -89
  98. package/checkbox/checkbox.scss.js +0 -4
  99. package/chip/chip.js +0 -20
  100. package/chip/chip.scss.js +0 -4
  101. package/dialog/dialog.js +0 -59
  102. package/dialog/dialog.scss.js +0 -4
  103. package/drawer/drawer.js +0 -168
  104. package/drawer/drawer.scss.js +0 -4
  105. package/form/form.js +0 -54
  106. package/icon/icon.js +0 -77
  107. package/icon/icon.scss.js +0 -4
  108. package/icon/icons.js +0 -24
  109. package/index.d.ts.map +0 -1
  110. package/list-item/list-item.js +0 -86
  111. package/list-item/list-item.scss.js +0 -4
  112. package/loading/loading.js +0 -61
  113. package/loading/loading.scss.js +0 -4
  114. package/navigation/navigation-bar.js +0 -20
  115. package/navigation/navigation-bar.scss.js +0 -4
  116. package/navigation/navigation-item.js +0 -51
  117. package/navigation/navigation-item.scss.js +0 -4
  118. package/notie/notie.js +0 -201
  119. package/notie/notie.scss.js +0 -4
  120. package/pages/pages.js +0 -75
  121. package/pages/pages.scss.js +0 -4
  122. package/radio/radio.js +0 -105
  123. package/radio/radio.scss.js +0 -4
  124. package/select/select.js +0 -132
  125. package/select/select.scss.js +0 -4
  126. package/slider/slider.js +0 -135
  127. package/slider/slider.scss.js +0 -4
  128. package/switch/switch.js +0 -101
  129. package/switch/switch.scss.js +0 -4
  130. package/tab-group/tab-group.js +0 -79
  131. package/tab-group/tab-group.scss.js +0 -4
  132. package/textarea/textarea.js +0 -133
  133. package/textarea/textarea.scss.js +0 -4
  134. package/textfield/textfield.js +0 -138
  135. package/textfield/textfield.scss.js +0 -4
  136. package/theme/theme.js +0 -137
  137. package/theme/theme.scss.js +0 -4
  138. package/tooltip/tooltip.js +0 -33
  139. package/tooltip/tooltip.scss.js +0 -4
  140. package/topbar/topbar.js +0 -33
  141. package/topbar/topbar.scss.js +0 -4
  142. package/umd/tinkiet.min.d.ts +0 -660
  143. package/umd/tinkiet.min.d.ts.map +0 -1
  144. package/utils/unique.js +0 -12
@@ -1,11 +1,11 @@
1
1
  import { CSSResultGroup, LitElement, PropertyValueMap } from "lit";
2
- declare class TkDialog extends LitElement {
2
+ export declare class TkDialog extends LitElement {
3
3
  static styles: CSSResultGroup;
4
4
  modal: boolean;
5
5
  open: boolean;
6
6
  blurOverlay: boolean;
7
7
  private resolve;
8
- render(): import("lit-html").TemplateResult<1>;
8
+ render(): import("lit").TemplateResult<1>;
9
9
  protected updated(_changedProperties: PropertyValueMap<any> | Map<PropertyKey, unknown>): void;
10
10
  show(): Promise<string | boolean | null>;
11
11
  hide(value?: boolean | string | null): void;
@@ -15,4 +15,3 @@ declare global {
15
15
  "tk-dialog": TkDialog;
16
16
  }
17
17
  }
18
- export { TkDialog };
package/dialog/index.d.ts CHANGED
@@ -1 +1 @@
1
- export * from "./dialog.js";
1
+ export * from "./dialog";
package/dialog/index.js CHANGED
@@ -1 +1,162 @@
1
- export { TkDialog } from './dialog.js';
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
+ /***/ 8899:
17
+ /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
18
+
19
+ var x = (y) => {
20
+ var x = {}; __webpack_require__.d(x, y); return x
21
+ }
22
+ var y = (x) => (() => (x))
23
+ module.exports = x({ ["customElement"]: () => (__WEBPACK_EXTERNAL_MODULE_lit_decorators_js_226d44c5__.customElement), ["property"]: () => (__WEBPACK_EXTERNAL_MODULE_lit_decorators_js_226d44c5__.property) });
24
+
25
+ /***/ }),
26
+
27
+ /***/ 9203:
28
+ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
29
+
30
+
31
+ // EXPORTS
32
+ __webpack_require__.d(__webpack_exports__, {
33
+ o: () => (/* binding */ TkDialog)
34
+ });
35
+
36
+ // EXTERNAL MODULE: external "lit"
37
+ var external_lit_ = __webpack_require__(2927);
38
+ // EXTERNAL MODULE: external "lit/decorators.js"
39
+ var decorators_js_ = __webpack_require__(8899);
40
+ ;// ./tinkiet/dialog/dialog.scss
41
+ /* harmony default export */ const dialog = ("*{-webkit-tap-highlight-color:rgba(0,0,0,0);-webkit-tap-highlight-color:rgba(0,0,0,0);box-sizing:border-box}:host{display:none;position:relative;outline:none}:host([open]){display:block;z-index:var(--dialog-z-index, 300);position:fixed;top:0;left:0;width:100%;height:100%}:host([open]) .overlay{background-color:rgba(0,0,0,.5);position:absolute;top:0;left:0;bottom:0;right:0}:host([open]) .overlay.blur{backdrop-filter:blur(2px)}:host([open]) .container{animation:fade-in .3s forwards;position:fixed;margin:0;max-width:100%;height:100%;max-height:100%;width:fit-content;will-change:transform,opacity;overflow-y:auto;overscroll-behavior:contain}@keyframes fade-in{0%{opacity:0}100%{opacity:1}}@media(max-width: 400px){:host([open]) .container{padding:.1rem}}");
42
+ ;// ./tinkiet/dialog/dialog.ts
43
+ var __decorate = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {
44
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
45
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
46
+ 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;
47
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
48
+ };
49
+
50
+
51
+
52
+ let TkDialog = class TkDialog extends external_lit_.LitElement {
53
+ constructor() {
54
+ super(...arguments);
55
+ this.modal = false;
56
+ this.open = false;
57
+ this.blurOverlay = false;
58
+ }
59
+ render() {
60
+ return (0,external_lit_.html) `
61
+ ${this.open
62
+ ? (0,external_lit_.html) `
63
+ <div class="overlay ${this.blurOverlay ? "blur" : ""}" @click=${() => (this.modal ? null : this.hide())}></div>
64
+ <div class="container">
65
+ <slot></slot>
66
+ </div>
67
+ `
68
+ : ""}
69
+ `;
70
+ }
71
+ updated(_changedProperties) {
72
+ if (_changedProperties.has("open") && this.open)
73
+ this.dispatchEvent(new Event("did-show"));
74
+ if (_changedProperties.has("open") && _changedProperties.get("open") == true && !this.open)
75
+ this.dispatchEvent(new Event("did-close"));
76
+ }
77
+ show() {
78
+ this.open = true;
79
+ return new Promise(resolve => {
80
+ this.resolve = resolve;
81
+ });
82
+ }
83
+ hide(value = null) {
84
+ this.open = false;
85
+ if (this.resolve)
86
+ this.resolve(value);
87
+ }
88
+ };
89
+ TkDialog.styles = (0,external_lit_.css) `
90
+ ${(0,external_lit_.unsafeCSS)(dialog)}
91
+ `;
92
+ __decorate([
93
+ (0,decorators_js_.property)({ type: Boolean, attribute: true })
94
+ ], TkDialog.prototype, "modal", void 0);
95
+ __decorate([
96
+ (0,decorators_js_.property)({ type: Boolean, attribute: true, reflect: true })
97
+ ], TkDialog.prototype, "open", void 0);
98
+ __decorate([
99
+ (0,decorators_js_.property)({ type: Boolean, attribute: "blur-overlay" })
100
+ ], TkDialog.prototype, "blurOverlay", void 0);
101
+ TkDialog = __decorate([
102
+ (0,decorators_js_.customElement)("tk-dialog")
103
+ ], TkDialog);
104
+
105
+
106
+
107
+ /***/ })
108
+
109
+ /******/ });
110
+ /************************************************************************/
111
+ /******/ // The module cache
112
+ /******/ var __webpack_module_cache__ = {};
113
+ /******/
114
+ /******/ // The require function
115
+ /******/ function __webpack_require__(moduleId) {
116
+ /******/ // Check if module is in cache
117
+ /******/ var cachedModule = __webpack_module_cache__[moduleId];
118
+ /******/ if (cachedModule !== undefined) {
119
+ /******/ return cachedModule.exports;
120
+ /******/ }
121
+ /******/ // Create a new module (and put it into the cache)
122
+ /******/ var module = __webpack_module_cache__[moduleId] = {
123
+ /******/ // no module.id needed
124
+ /******/ // no module.loaded needed
125
+ /******/ exports: {}
126
+ /******/ };
127
+ /******/
128
+ /******/ // Execute the module function
129
+ /******/ __webpack_modules__[moduleId](module, module.exports, __webpack_require__);
130
+ /******/
131
+ /******/ // Return the exports of the module
132
+ /******/ return module.exports;
133
+ /******/ }
134
+ /******/
135
+ /************************************************************************/
136
+ /******/ /* webpack/runtime/define property getters */
137
+ /******/ (() => {
138
+ /******/ // define getter functions for harmony exports
139
+ /******/ __webpack_require__.d = (exports, definition) => {
140
+ /******/ for(var key in definition) {
141
+ /******/ if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {
142
+ /******/ Object.defineProperty(exports, key, { enumerable: true, get: definition[key] });
143
+ /******/ }
144
+ /******/ }
145
+ /******/ };
146
+ /******/ })();
147
+ /******/
148
+ /******/ /* webpack/runtime/hasOwnProperty shorthand */
149
+ /******/ (() => {
150
+ /******/ __webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))
151
+ /******/ })();
152
+ /******/
153
+ /************************************************************************/
154
+ var __webpack_exports__ = {};
155
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
156
+ /* harmony export */ o: () => (/* reexport safe */ _dialog__WEBPACK_IMPORTED_MODULE_0__.o)
157
+ /* harmony export */ });
158
+ /* harmony import */ var _dialog__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(9203);
159
+
160
+
161
+ const __webpack_exports__TkDialog = __webpack_exports__.o;
162
+ export { __webpack_exports__TkDialog as TkDialog };
@@ -1,5 +1,5 @@
1
1
  import { LitElement } from "lit";
2
- declare class TkDrawer extends LitElement {
2
+ export declare class TkDrawer extends LitElement {
3
3
  static styles: import("lit").CSSResult;
4
4
  _open: boolean;
5
5
  set open(value: boolean);
@@ -11,7 +11,7 @@ declare class TkDrawer extends LitElement {
11
11
  swipeable: boolean;
12
12
  private $drawer;
13
13
  private mql;
14
- render(): import("lit-html").TemplateResult<1>;
14
+ render(): import("lit").TemplateResult<1>;
15
15
  updated(props: any): void;
16
16
  protected overMediaQuery(): void;
17
17
  private overMediaQueryListener;
@@ -31,4 +31,3 @@ declare global {
31
31
  "tk-drawer": TkDrawer;
32
32
  }
33
33
  }
34
- export { TkDrawer };
package/drawer/index.d.ts CHANGED
@@ -1 +1 @@
1
- export * from "./drawer.js";
1
+ export * from "./drawer";
package/drawer/index.js CHANGED
@@ -1 +1,272 @@
1
- export { TkDrawer } from './drawer.js';
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
+ /***/ 5603:
17
+ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
18
+
19
+
20
+ // EXPORTS
21
+ __webpack_require__.d(__webpack_exports__, {
22
+ l: () => (/* binding */ TkDrawer)
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/drawer/drawer.scss
30
+ /* harmony default export */ const drawer = ("*{-webkit-tap-highlight-color:rgba(0,0,0,0);-webkit-tap-highlight-color:rgba(0,0,0,0);box-sizing:border-box}:host{display:block;height:100%;width:100%;position:relative;overflow:hidden;background-color:hsl(var(--surface))}.drawer{display:grid;grid-template-columns:var(--drawer-width, 256px) 10px;grid-template-rows:auto 1fr auto;grid-template-areas:\"header swipe\" \"content swipe\" \"footer swipe\";position:absolute;top:0;bottom:0;transform:translateX(calc(-100% + 10px));transition:transform cubic-bezier(0.4, 0, 0.2, 1) var(--transition-duration-medium, 180ms);will-change:transform;touch-action:pan-y;z-index:var(--drawer-z-index, 200);background-color:hsl(var(--surface))}.drawer .drawer-header{grid-area:header}.drawer .drawer-content{grid-area:content;overflow:auto}.drawer .drawer-footer{grid-area:footer}.drawer .drawer-swipe{grid-area:swipe;background-color:rgba(0,0,0,0)}:host([right]) .drawer{right:0;transform:translateX(calc(100% + 10px))}.overlay{position:absolute;top:0;left:0;right:0;bottom:0;z-index:var(--drawer-overlay-z-index, 200);background-color:rgba(0,0,0,.5);display:none}.container{transition:padding cubic-bezier(0.4, 0, 0.2, 1) var(--transition-duration-slow, 250ms);overflow:auto;height:100%}: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:0px 1px 2px 0px rgba(0, 0, 0, 0.3), 0px 1px 3px 1px rgba(0, 0, 0, 0.15)}: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}}");
31
+ ;// ./tinkiet/drawer/drawer.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
+
42
+ let TkDrawer = class TkDrawer extends external_lit_.LitElement {
43
+ constructor() {
44
+ super(...arguments);
45
+ this._open = false;
46
+ this.over = false;
47
+ this.right = false;
48
+ this.swipeable = false;
49
+ this.swipeX = 0;
50
+ this.swipeY = 0;
51
+ this.isHorizontalSwipe = false;
52
+ }
53
+ set open(value) {
54
+ if (value === this._open)
55
+ return;
56
+ const oldValue = this._open;
57
+ this._open = value;
58
+ this.requestUpdate("open", oldValue);
59
+ if (this._open)
60
+ this.dispatchEvent(new Event("did-show"));
61
+ if (!this._open)
62
+ this.dispatchEvent(new Event("did-close"));
63
+ }
64
+ get open() {
65
+ return this._open;
66
+ }
67
+ render() {
68
+ return (0,external_lit_.html) `
69
+ <div class="container">
70
+ <slot name="drawer-container"></slot>
71
+ </div>
72
+ <div class="overlay" @click=${() => (this.open = false)}></div>
73
+ <div class="drawer" @touchstart=${this.touchStart} @touchmove=${this.touchMove} @touchend=${this.touchEnd}>
74
+ <div class="drawer-header">
75
+ <slot name="drawer-header"></slot>
76
+ </div>
77
+ <div class="drawer-content">
78
+ <slot name="drawer-content"></slot>
79
+ </div>
80
+ <div class="drawer-footer">
81
+ <slot name="drawer-footer"></slot>
82
+ </div>
83
+ <div class="drawer-swipe"></div>
84
+ </div>
85
+
86
+ `;
87
+ }
88
+ updated(props) {
89
+ if (props.has("overQuery"))
90
+ this.overMediaQuery();
91
+ if (props.has("openQuery")) {
92
+ if (window.matchMedia(this.openQuery).matches)
93
+ this.show();
94
+ }
95
+ if (props.has("open") && this.swipeable) {
96
+ requestAnimationFrame(_ => {
97
+ this.$drawer.removeAttribute('style');
98
+ });
99
+ }
100
+ }
101
+ overMediaQuery() {
102
+ if (this.mql)
103
+ this.mql.removeEventListener("change", this.overMediaQueryListener.bind(this));
104
+ this.mql = window.matchMedia(this.overQuery);
105
+ this.mql.matches ? this.setAttribute("over", "") : this.removeAttribute("over");
106
+ this.mql.addEventListener("change", this.overMediaQueryListener.bind(this));
107
+ }
108
+ overMediaQueryListener(e) {
109
+ e.matches ? this.setAttribute("over", "") : this.removeAttribute("over");
110
+ }
111
+ hideIfOver() {
112
+ var _a;
113
+ if ((this.overQuery && ((_a = this.mql) === null || _a === void 0 ? void 0 : _a.matches)) || this.over)
114
+ this.open = false;
115
+ }
116
+ show() {
117
+ this.open = true;
118
+ }
119
+ hide() {
120
+ this.open = false;
121
+ }
122
+ toggle() {
123
+ this.open = !this.open;
124
+ }
125
+ touchStart(event) {
126
+ if (!this.swipeable)
127
+ return;
128
+ this.$drawer.style.transition = "transform 0ms ease";
129
+ this.swipeX = event.touches[0].clientX;
130
+ this.swipeY = event.touches[0].clientY;
131
+ }
132
+ touchMove(event) {
133
+ if (!this.swipeable)
134
+ return;
135
+ const deltaX = event.touches[0].clientX - this.swipeX;
136
+ const deltaY = event.touches[0].clientY - this.swipeY;
137
+ this.isHorizontalSwipe = Math.abs(deltaX) > Math.abs(deltaY);
138
+ if (!this.isHorizontalSwipe)
139
+ return;
140
+ var x = this.open ?
141
+ deltaX > 0 ? 0 : deltaX :
142
+ deltaX < 0 ? 0 : deltaX;
143
+ var transformString;
144
+ this.open ?
145
+ transformString = "translateX(" + x + "px)" :
146
+ transformString = `translateX(min(calc(-100% + 10px + ${x}px), 0px)`;
147
+ requestAnimationFrame(_ => {
148
+ this.$drawer.style.transform = transformString;
149
+ });
150
+ }
151
+ touchEnd(event) {
152
+ if (!this.swipeable)
153
+ return;
154
+ requestAnimationFrame(_ => {
155
+ this.$drawer.removeAttribute('style');
156
+ });
157
+ const deltaX = event.changedTouches[0].clientX - this.swipeX;
158
+ if (this.isHorizontalSwipe && this.open)
159
+ this.open = -50 > deltaX ? false : true;
160
+ else if (this.isHorizontalSwipe && !this.open) {
161
+ console.log("bbb", deltaX, 50 < Math.abs(deltaX) ? true : false);
162
+ this.open = 50 < deltaX ? true : false;
163
+ }
164
+ this.isHorizontalSwipe = false;
165
+ }
166
+ };
167
+ TkDrawer.styles = (0,external_lit_.css) `
168
+ ${(0,external_lit_.unsafeCSS)(drawer)}
169
+ `;
170
+ __decorate([
171
+ (0,decorators_js_.property)({ type: Boolean, reflect: true })
172
+ ], TkDrawer.prototype, "open", null);
173
+ __decorate([
174
+ (0,decorators_js_.property)({ type: Boolean, reflect: true })
175
+ ], TkDrawer.prototype, "over", void 0);
176
+ __decorate([
177
+ (0,decorators_js_.property)({ type: String, attribute: "open-query" })
178
+ ], TkDrawer.prototype, "openQuery", void 0);
179
+ __decorate([
180
+ (0,decorators_js_.property)({ type: String, attribute: "over-query" })
181
+ ], TkDrawer.prototype, "overQuery", void 0);
182
+ __decorate([
183
+ (0,decorators_js_.property)({ type: Boolean, reflect: true })
184
+ ], TkDrawer.prototype, "right", void 0);
185
+ __decorate([
186
+ (0,decorators_js_.property)({ type: Boolean, reflect: true })
187
+ ], TkDrawer.prototype, "swipeable", void 0);
188
+ __decorate([
189
+ (0,decorators_js_.query)("div.drawer")
190
+ ], TkDrawer.prototype, "$drawer", void 0);
191
+ __decorate([
192
+ (0,decorators_js_.eventOptions)({ passive: true })
193
+ ], TkDrawer.prototype, "touchStart", null);
194
+ __decorate([
195
+ (0,decorators_js_.eventOptions)({ passive: true })
196
+ ], TkDrawer.prototype, "touchMove", null);
197
+ __decorate([
198
+ (0,decorators_js_.eventOptions)({ passive: true })
199
+ ], TkDrawer.prototype, "touchEnd", null);
200
+ TkDrawer = __decorate([
201
+ (0,decorators_js_.customElement)("tk-drawer")
202
+ ], TkDrawer);
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), ["query"]: () => (__WEBPACK_EXTERNAL_MODULE_lit_decorators_js_226d44c5__.query) });
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 */ l: () => (/* reexport safe */ _drawer__WEBPACK_IMPORTED_MODULE_0__.l)
267
+ /* harmony export */ });
268
+ /* harmony import */ var _drawer__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(5603);
269
+
270
+
271
+ const __webpack_exports__TkDrawer = __webpack_exports__.l;
272
+ export { __webpack_exports__TkDrawer as TkDrawer };
package/form/form.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  import { LitElement } from "lit";
2
- declare class TkForm extends LitElement {
2
+ export declare class TkForm extends LitElement {
3
3
  value: any;
4
4
  connectedCallback(): void;
5
5
  disconnectedCallback(): void;
@@ -11,4 +11,3 @@ declare global {
11
11
  "tk-form": TkForm;
12
12
  }
13
13
  }
14
- export { TkForm };
package/form/index.d.ts CHANGED
@@ -1 +1 @@
1
- export { TkForm } from "./form.js";
1
+ export { TkForm } from "./form";
package/form/index.js CHANGED
@@ -1 +1,149 @@
1
- export { TkForm } from './form.js';
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) });
13
+
14
+ /***/ }),
15
+
16
+ /***/ 4686:
17
+ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
18
+
19
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
20
+ /* harmony export */ i: () => (/* binding */ TkForm)
21
+ /* harmony export */ });
22
+ /* harmony import */ var lit__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(2927);
23
+ /* harmony import */ var lit_decorators_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(8899);
24
+ var __decorate = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {
25
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
26
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
27
+ 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;
28
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
29
+ };
30
+
31
+
32
+ let TkForm = class TkForm extends lit__WEBPACK_IMPORTED_MODULE_0__.LitElement {
33
+ connectedCallback() {
34
+ super.connectedCallback();
35
+ this.addEventListener("submit", this.submit);
36
+ }
37
+ disconnectedCallback() {
38
+ super.disconnectedCallback();
39
+ this.removeEventListener("submit", this.submit);
40
+ }
41
+ submit(e) {
42
+ e.preventDefault();
43
+ const result = this.getFormDataAsObject();
44
+ this.dispatchEvent(new CustomEvent("fulfill", { detail: result }));
45
+ }
46
+ getFormDataAsObject() {
47
+ const $form = this.querySelector("form");
48
+ const result = {};
49
+ const data = new FormData($form);
50
+ data.forEach((value, key) => {
51
+ var _a;
52
+ const $inputElement = this.querySelector(`[name=${key}]`);
53
+ if ($inputElement.tagName == "TK-SLIDER") {
54
+ value = Number(value);
55
+ }
56
+ if ($inputElement.tagName == "TK-CHECKBOX" && (value == "on" || value == "true")) {
57
+ value = true;
58
+ }
59
+ if ($inputElement.tagName == "TK-RADIO" && (value == "on" || value == "true")) {
60
+ value = true;
61
+ }
62
+ if (key.indexOf("-") > 0) {
63
+ const _ks = key.split("-");
64
+ result[_ks[0]] = (_a = result[_ks[0]]) !== null && _a !== void 0 ? _a : {};
65
+ result[_ks[0]][_ks[1]] = value;
66
+ }
67
+ else {
68
+ result[key] = value;
69
+ }
70
+ });
71
+ return result;
72
+ }
73
+ };
74
+ __decorate([
75
+ (0,lit_decorators_js__WEBPACK_IMPORTED_MODULE_1__.property)()
76
+ ], TkForm.prototype, "value", void 0);
77
+ TkForm = __decorate([
78
+ (0,lit_decorators_js__WEBPACK_IMPORTED_MODULE_1__.customElement)("tk-form")
79
+ ], TkForm);
80
+
81
+
82
+
83
+ /***/ }),
84
+
85
+ /***/ 8899:
86
+ /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
87
+
88
+ var x = (y) => {
89
+ var x = {}; __webpack_require__.d(x, y); return x
90
+ }
91
+ var y = (x) => (() => (x))
92
+ module.exports = x({ ["customElement"]: () => (__WEBPACK_EXTERNAL_MODULE_lit_decorators_js_226d44c5__.customElement), ["property"]: () => (__WEBPACK_EXTERNAL_MODULE_lit_decorators_js_226d44c5__.property) });
93
+
94
+ /***/ })
95
+
96
+ /******/ });
97
+ /************************************************************************/
98
+ /******/ // The module cache
99
+ /******/ var __webpack_module_cache__ = {};
100
+ /******/
101
+ /******/ // The require function
102
+ /******/ function __webpack_require__(moduleId) {
103
+ /******/ // Check if module is in cache
104
+ /******/ var cachedModule = __webpack_module_cache__[moduleId];
105
+ /******/ if (cachedModule !== undefined) {
106
+ /******/ return cachedModule.exports;
107
+ /******/ }
108
+ /******/ // Create a new module (and put it into the cache)
109
+ /******/ var module = __webpack_module_cache__[moduleId] = {
110
+ /******/ // no module.id needed
111
+ /******/ // no module.loaded needed
112
+ /******/ exports: {}
113
+ /******/ };
114
+ /******/
115
+ /******/ // Execute the module function
116
+ /******/ __webpack_modules__[moduleId](module, module.exports, __webpack_require__);
117
+ /******/
118
+ /******/ // Return the exports of the module
119
+ /******/ return module.exports;
120
+ /******/ }
121
+ /******/
122
+ /************************************************************************/
123
+ /******/ /* webpack/runtime/define property getters */
124
+ /******/ (() => {
125
+ /******/ // define getter functions for harmony exports
126
+ /******/ __webpack_require__.d = (exports, definition) => {
127
+ /******/ for(var key in definition) {
128
+ /******/ if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {
129
+ /******/ Object.defineProperty(exports, key, { enumerable: true, get: definition[key] });
130
+ /******/ }
131
+ /******/ }
132
+ /******/ };
133
+ /******/ })();
134
+ /******/
135
+ /******/ /* webpack/runtime/hasOwnProperty shorthand */
136
+ /******/ (() => {
137
+ /******/ __webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))
138
+ /******/ })();
139
+ /******/
140
+ /************************************************************************/
141
+ var __webpack_exports__ = {};
142
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
143
+ /* harmony export */ i: () => (/* reexport safe */ _form__WEBPACK_IMPORTED_MODULE_0__.i)
144
+ /* harmony export */ });
145
+ /* harmony import */ var _form__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(4686);
146
+
147
+
148
+ const __webpack_exports__TkForm = __webpack_exports__.i;
149
+ export { __webpack_exports__TkForm as TkForm };
package/icon/icon.d.ts CHANGED
@@ -1,11 +1,11 @@
1
- import { TkBox } from "../box/index.js";
2
- declare class TkIcon extends TkBox {
1
+ import { TkBox } from "../box";
2
+ export declare class TkIcon extends TkBox {
3
3
  static get styles(): import("lit").CSSResult[];
4
4
  name: string;
5
5
  library: string;
6
6
  path: string;
7
7
  private svg;
8
- render(): import("lit-html").TemplateResult<1>;
8
+ render(): import("lit").TemplateResult<1>;
9
9
  updated(props: any): void;
10
10
  loadIcon(): Promise<void>;
11
11
  }
@@ -14,4 +14,3 @@ declare global {
14
14
  "tk-icon": TkIcon;
15
15
  }
16
16
  }
17
- export { TkIcon };