tinkiet 0.7.2 → 0.7.6

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