@tabworthy/components 0.2.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 (84) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +69 -0
  3. package/dist/cjs/app-globals-V2Kpy_OQ.js +5 -0
  4. package/dist/cjs/index-C15oswCE.js +2148 -0
  5. package/dist/cjs/index.cjs.js +2 -0
  6. package/dist/cjs/loader.cjs.js +13 -0
  7. package/dist/cjs/moment-CdViwxPQ.js +5681 -0
  8. package/dist/cjs/tabworthy-components.cjs.js +25 -0
  9. package/dist/cjs/tabworthy-dates-calendar_2.cjs.entry.js +884 -0
  10. package/dist/cjs/tabworthy-dates.cjs.entry.js +10906 -0
  11. package/dist/cjs/tabworthy-times-picker.cjs.entry.js +181 -0
  12. package/dist/cjs/tabworthy-times.cjs.entry.js +242 -0
  13. package/dist/cjs/utils-y5Vtky2t.js +214 -0
  14. package/dist/collection/collection-manifest.json +16 -0
  15. package/dist/collection/components/tabworthy-dates/tabworthy-dates.css +10 -0
  16. package/dist/collection/components/tabworthy-dates/tabworthy-dates.js +1197 -0
  17. package/dist/collection/components/tabworthy-dates-calendar/tabworthy-dates-calendar.css +10 -0
  18. package/dist/collection/components/tabworthy-dates-calendar/tabworthy-dates-calendar.js +986 -0
  19. package/dist/collection/components/tabworthy-modal/tabworthy-dates-modal.css +14 -0
  20. package/dist/collection/components/tabworthy-modal/tabworthy-dates-modal.js +237 -0
  21. package/dist/collection/components/tabworthy-times/tabworthy-times.js +832 -0
  22. package/dist/collection/components/tabworthy-times-picker/tabworthy-times-picker.js +356 -0
  23. package/dist/collection/index.js +1 -0
  24. package/dist/components/index.d.ts +35 -0
  25. package/dist/components/index.js +1 -0
  26. package/dist/components/moment.js +8 -0
  27. package/dist/components/tabworthy-dates-calendar.d.ts +11 -0
  28. package/dist/components/tabworthy-dates-calendar.js +1 -0
  29. package/dist/components/tabworthy-dates-calendar2.js +1 -0
  30. package/dist/components/tabworthy-dates-modal.d.ts +11 -0
  31. package/dist/components/tabworthy-dates-modal.js +1 -0
  32. package/dist/components/tabworthy-dates-modal2.js +1 -0
  33. package/dist/components/tabworthy-dates.d.ts +11 -0
  34. package/dist/components/tabworthy-dates.js +1 -0
  35. package/dist/components/tabworthy-times-picker.d.ts +11 -0
  36. package/dist/components/tabworthy-times-picker.js +1 -0
  37. package/dist/components/tabworthy-times-picker2.js +1 -0
  38. package/dist/components/tabworthy-times.d.ts +11 -0
  39. package/dist/components/tabworthy-times.js +1 -0
  40. package/dist/esm/app-globals-DQuL1Twl.js +3 -0
  41. package/dist/esm/index-BusoZVTR.js +2139 -0
  42. package/dist/esm/index.js +1 -0
  43. package/dist/esm/loader.js +11 -0
  44. package/dist/esm/moment-Mki5YqAR.js +5679 -0
  45. package/dist/esm/tabworthy-components.js +21 -0
  46. package/dist/esm/tabworthy-dates-calendar_2.entry.js +881 -0
  47. package/dist/esm/tabworthy-dates.entry.js +10904 -0
  48. package/dist/esm/tabworthy-times-picker.entry.js +179 -0
  49. package/dist/esm/tabworthy-times.entry.js +240 -0
  50. package/dist/esm/utils-BVHu5CWV.js +188 -0
  51. package/dist/index.cjs.js +1 -0
  52. package/dist/index.js +1 -0
  53. package/dist/loader/cdn.js +1 -0
  54. package/dist/loader/index.cjs.js +1 -0
  55. package/dist/loader/index.d.ts +24 -0
  56. package/dist/loader/index.es2017.js +1 -0
  57. package/dist/loader/index.js +2 -0
  58. package/dist/shared/utils/chrono-parser/chrono-parser.js +146 -0
  59. package/dist/shared/utils/chrono-parser/chrono-parser.type.js +1 -0
  60. package/dist/shared/utils/utils.js +186 -0
  61. package/dist/tabworthy-components/index.esm.js +0 -0
  62. package/dist/tabworthy-components/p-170bc6ca.entry.js +1 -0
  63. package/dist/tabworthy-components/p-3ce9a767.entry.js +1 -0
  64. package/dist/tabworthy-components/p-77bd1bd4.entry.js +1 -0
  65. package/dist/tabworthy-components/p-BVHu5CWV.js +1 -0
  66. package/dist/tabworthy-components/p-BusoZVTR.js +2 -0
  67. package/dist/tabworthy-components/p-DQuL1Twl.js +1 -0
  68. package/dist/tabworthy-components/p-Mki5YqAR.js +8 -0
  69. package/dist/tabworthy-components/p-ebbb4c46.entry.js +1 -0
  70. package/dist/tabworthy-components/tabworthy-components.esm.js +1 -0
  71. package/dist/themes/dark.css +1 -0
  72. package/dist/themes/light.css +1 -0
  73. package/dist/types/Users/damirbogdanov_1/work/tabworthy-components/.stencil/shared/utils/chrono-parser/chrono-parser.d.ts +3 -0
  74. package/dist/types/Users/damirbogdanov_1/work/tabworthy-components/.stencil/shared/utils/chrono-parser/chrono-parser.type.d.ts +40 -0
  75. package/dist/types/Users/damirbogdanov_1/work/tabworthy-components/.stencil/shared/utils/utils.d.ts +28 -0
  76. package/dist/types/components/tabworthy-dates/tabworthy-dates.d.ts +80 -0
  77. package/dist/types/components/tabworthy-dates-calendar/tabworthy-dates-calendar.d.ts +89 -0
  78. package/dist/types/components/tabworthy-modal/tabworthy-dates-modal.d.ts +29 -0
  79. package/dist/types/components/tabworthy-times/tabworthy-times.d.ts +65 -0
  80. package/dist/types/components/tabworthy-times-picker/tabworthy-times-picker.d.ts +46 -0
  81. package/dist/types/components.d.ts +879 -0
  82. package/dist/types/index.d.ts +1 -0
  83. package/dist/types/stencil-public-runtime.d.ts +1858 -0
  84. package/package.json +132 -0
@@ -0,0 +1,14 @@
1
+ :host::part(body) {
2
+ position: absolute;
3
+ width: -moz-fit-content;
4
+ width: fit-content;
5
+ z-index: 1200;
6
+ margin-top: 0.5rem;
7
+ }
8
+ :host::part(backdrop) {
9
+ /* Placeholder */
10
+ }
11
+
12
+ :host::part(content) {
13
+ /* Placeholder */
14
+ }
@@ -0,0 +1,237 @@
1
+ import { h, Host } from "@stencil/core";
2
+ import "@a11y/focus-trap";
3
+ import { hideOthers } from "aria-hidden";
4
+ /**
5
+ * @slot slot - The dialog content
6
+ */
7
+ export class InclusiveDatesModal {
8
+ constructor() {
9
+ this.inline = false;
10
+ this.closing = false;
11
+ this.showing = this.inline || false;
12
+ this.onKeyDown = (event) => {
13
+ if (event.code === "Escape") {
14
+ this.close();
15
+ }
16
+ };
17
+ }
18
+ /**
19
+ * Open the dialog.
20
+ */
21
+ async open() {
22
+ if (this.inline)
23
+ return;
24
+ this.showing = true;
25
+ this.undo = hideOthers(this.el);
26
+ this.opened.emit(undefined);
27
+ }
28
+ /**
29
+ * Close the dialog.
30
+ */
31
+ async close() {
32
+ if (this.inline)
33
+ return;
34
+ this.showing = false;
35
+ this.closed.emit(undefined);
36
+ this.undo();
37
+ if (this.triggerElement)
38
+ this.triggerElement.focus();
39
+ }
40
+ async getState() {
41
+ return this.showing;
42
+ }
43
+ async setTriggerElement(element) {
44
+ this.triggerElement = element;
45
+ }
46
+ handleClick(event) {
47
+ if (this.showing && !this.el.contains(event.target)) {
48
+ this.close();
49
+ }
50
+ }
51
+ render() {
52
+ return (h(Host, { key: 'dd44f82a23c471268369362e7f0899d197b6686a', showing: this.showing, ref: (r) => r && (this.el = r) }, !this.inline && this.showing && (h("div", { key: '6c5d845e75737c366defff2434f51ca345a172f3', part: "body", onKeyDown: this.onKeyDown, role: "dialog", tabindex: -1, "aria-hidden": !this.showing, "aria-label": this.label, "aria-modal": this.showing }, h("focus-trap", { key: '56beecf073b790849d2761b3ac135641612744e1' }, h("div", { key: '85aca24946135337732f404ac164553f4374c9ec', part: "content" }, h("slot", { key: 'cb7b7c57ed1012256e3e045f64b40ce8c5d8dd8b' }))))), this.inline && (h("div", { key: '0a6d50757d0c77f1cc781dfe7676a4b3f8e74c22', part: "content" }, h("slot", { key: '17e71b147f00061c3f3f4deb3b66abb465714f8a' })))));
53
+ }
54
+ static get is() { return "tabworthy-dates-modal"; }
55
+ static get encapsulation() { return "shadow"; }
56
+ static get originalStyleUrls() {
57
+ return {
58
+ "$": ["tabworthy-dates-modal.css"]
59
+ };
60
+ }
61
+ static get styleUrls() {
62
+ return {
63
+ "$": ["tabworthy-dates-modal.css"]
64
+ };
65
+ }
66
+ static get properties() {
67
+ return {
68
+ "label": {
69
+ "type": "string",
70
+ "mutable": false,
71
+ "complexType": {
72
+ "original": "string",
73
+ "resolved": "string",
74
+ "references": {}
75
+ },
76
+ "required": true,
77
+ "optional": false,
78
+ "docs": {
79
+ "tags": [],
80
+ "text": ""
81
+ },
82
+ "getter": false,
83
+ "setter": false,
84
+ "reflect": false,
85
+ "attribute": "label"
86
+ },
87
+ "inline": {
88
+ "type": "boolean",
89
+ "mutable": false,
90
+ "complexType": {
91
+ "original": "boolean",
92
+ "resolved": "boolean",
93
+ "references": {}
94
+ },
95
+ "required": false,
96
+ "optional": true,
97
+ "docs": {
98
+ "tags": [],
99
+ "text": ""
100
+ },
101
+ "getter": false,
102
+ "setter": false,
103
+ "reflect": false,
104
+ "attribute": "inline",
105
+ "defaultValue": "false"
106
+ }
107
+ };
108
+ }
109
+ static get states() {
110
+ return {
111
+ "closing": {},
112
+ "showing": {}
113
+ };
114
+ }
115
+ static get events() {
116
+ return [{
117
+ "method": "opened",
118
+ "name": "opened",
119
+ "bubbles": true,
120
+ "cancelable": true,
121
+ "composed": true,
122
+ "docs": {
123
+ "tags": [],
124
+ "text": ""
125
+ },
126
+ "complexType": {
127
+ "original": "any",
128
+ "resolved": "any",
129
+ "references": {}
130
+ }
131
+ }, {
132
+ "method": "closed",
133
+ "name": "closed",
134
+ "bubbles": true,
135
+ "cancelable": true,
136
+ "composed": true,
137
+ "docs": {
138
+ "tags": [],
139
+ "text": ""
140
+ },
141
+ "complexType": {
142
+ "original": "any",
143
+ "resolved": "any",
144
+ "references": {}
145
+ }
146
+ }];
147
+ }
148
+ static get methods() {
149
+ return {
150
+ "open": {
151
+ "complexType": {
152
+ "signature": "() => Promise<void>",
153
+ "parameters": [],
154
+ "references": {
155
+ "Promise": {
156
+ "location": "global",
157
+ "id": "global::Promise"
158
+ }
159
+ },
160
+ "return": "Promise<void>"
161
+ },
162
+ "docs": {
163
+ "text": "Open the dialog.",
164
+ "tags": []
165
+ }
166
+ },
167
+ "close": {
168
+ "complexType": {
169
+ "signature": "() => Promise<void>",
170
+ "parameters": [],
171
+ "references": {
172
+ "Promise": {
173
+ "location": "global",
174
+ "id": "global::Promise"
175
+ }
176
+ },
177
+ "return": "Promise<void>"
178
+ },
179
+ "docs": {
180
+ "text": "Close the dialog.",
181
+ "tags": []
182
+ }
183
+ },
184
+ "getState": {
185
+ "complexType": {
186
+ "signature": "() => Promise<boolean>",
187
+ "parameters": [],
188
+ "references": {
189
+ "Promise": {
190
+ "location": "global",
191
+ "id": "global::Promise"
192
+ }
193
+ },
194
+ "return": "Promise<boolean>"
195
+ },
196
+ "docs": {
197
+ "text": "",
198
+ "tags": []
199
+ }
200
+ },
201
+ "setTriggerElement": {
202
+ "complexType": {
203
+ "signature": "(element: HTMLElement) => Promise<void>",
204
+ "parameters": [{
205
+ "name": "element",
206
+ "type": "HTMLElement",
207
+ "docs": ""
208
+ }],
209
+ "references": {
210
+ "Promise": {
211
+ "location": "global",
212
+ "id": "global::Promise"
213
+ },
214
+ "HTMLElement": {
215
+ "location": "global",
216
+ "id": "global::HTMLElement"
217
+ }
218
+ },
219
+ "return": "Promise<void>"
220
+ },
221
+ "docs": {
222
+ "text": "",
223
+ "tags": []
224
+ }
225
+ }
226
+ };
227
+ }
228
+ static get listeners() {
229
+ return [{
230
+ "name": "click",
231
+ "method": "handleClick",
232
+ "target": "window",
233
+ "capture": true,
234
+ "passive": false
235
+ }];
236
+ }
237
+ }