@dodlhuat/basix 1.2.3 → 1.2.5
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/README.md +3 -1
- package/css/calendar.css +928 -0
- package/css/calendar.scss +114 -63
- package/css/form.scss +224 -54
- package/css/style.css +284 -230
- package/js/calendar.js +276 -187
- package/js/calendar.ts +370 -307
- package/js/docs-nav.js +1 -0
- package/js/timepicker.js +4 -2
- package/js/timepicker.ts +8 -2
- package/package.json +1 -1
package/js/docs-nav.js
CHANGED
|
@@ -57,6 +57,7 @@ const NAV = [
|
|
|
57
57
|
{ label: 'Gallery', href: 'components/gallery.html' },
|
|
58
58
|
{ label: 'Scrollbar', href: 'components/scrollbar.html' },
|
|
59
59
|
{ label: 'Chat Bubbles', href: 'components/chat-bubbles.html' },
|
|
60
|
+
{ label: 'Calendar', href: 'components/calendar.html' },
|
|
60
61
|
{ label: 'Charts', href: 'components/charts.html' },
|
|
61
62
|
{ label: 'Group Picker', href: 'components/group-picker.html' },
|
|
62
63
|
{ label: 'Virtual Dropdown', href: 'components/virtual-dropdown.html' },
|
package/js/timepicker.js
CHANGED
|
@@ -13,6 +13,8 @@ class TimeSpanPicker {
|
|
|
13
13
|
this.container = element;
|
|
14
14
|
this.onChange = options?.onChange;
|
|
15
15
|
this.uid = `tsp-${Math.random().toString(36).slice(2, 9)}`;
|
|
16
|
+
this.fromString = options?.fromString ?? 'From';
|
|
17
|
+
this.toString = options?.toString ?? 'To';
|
|
16
18
|
this.render();
|
|
17
19
|
this.startTimeInput = this.queryInput('.timespan-start');
|
|
18
20
|
this.endTimeInput = this.queryInput('.timespan-end');
|
|
@@ -41,7 +43,7 @@ class TimeSpanPicker {
|
|
|
41
43
|
this.container.innerHTML = `
|
|
42
44
|
<div class="timespan-picker">
|
|
43
45
|
<div class="timespan-field timespan-field-start">
|
|
44
|
-
<label for="${startId}"
|
|
46
|
+
<label for="${startId}">${this.fromString}</label>
|
|
45
47
|
<input type="time" class="timespan-start" id="${startId}"/>
|
|
46
48
|
</div>
|
|
47
49
|
|
|
@@ -51,7 +53,7 @@ class TimeSpanPicker {
|
|
|
51
53
|
</div>
|
|
52
54
|
|
|
53
55
|
<div class="timespan-field timespan-field-end">
|
|
54
|
-
<label for="${endId}"
|
|
56
|
+
<label for="${endId}">${this.toString}</label>
|
|
55
57
|
<input type="time" class="timespan-end" id="${endId}"/>
|
|
56
58
|
</div>
|
|
57
59
|
</div>
|
package/js/timepicker.ts
CHANGED
|
@@ -7,6 +7,8 @@ interface TimeSpanPickerOptions {
|
|
|
7
7
|
onChange?: (start: string, end: string) => void;
|
|
8
8
|
defaultStart?: string;
|
|
9
9
|
defaultEnd?: string;
|
|
10
|
+
fromString?: string;
|
|
11
|
+
toString?: string;
|
|
10
12
|
}
|
|
11
13
|
|
|
12
14
|
class TimeSpanPicker {
|
|
@@ -15,6 +17,8 @@ class TimeSpanPicker {
|
|
|
15
17
|
private endTimeInput: HTMLInputElement;
|
|
16
18
|
private onChange?: (start: string, end: string) => void;
|
|
17
19
|
private readonly uid: string;
|
|
20
|
+
private fromString: string;
|
|
21
|
+
private toString: string;
|
|
18
22
|
|
|
19
23
|
constructor(elementOrSelector: string | HTMLElement, options?: TimeSpanPickerOptions) {
|
|
20
24
|
const element = typeof elementOrSelector === 'string'
|
|
@@ -30,6 +34,8 @@ class TimeSpanPicker {
|
|
|
30
34
|
this.container = element;
|
|
31
35
|
this.onChange = options?.onChange;
|
|
32
36
|
this.uid = `tsp-${Math.random().toString(36).slice(2, 9)}`;
|
|
37
|
+
this.fromString = options?.fromString ?? 'From';
|
|
38
|
+
this.toString = options?.toString ?? 'To';
|
|
33
39
|
|
|
34
40
|
this.render();
|
|
35
41
|
|
|
@@ -65,7 +71,7 @@ class TimeSpanPicker {
|
|
|
65
71
|
this.container.innerHTML = `
|
|
66
72
|
<div class="timespan-picker">
|
|
67
73
|
<div class="timespan-field timespan-field-start">
|
|
68
|
-
<label for="${startId}"
|
|
74
|
+
<label for="${startId}">${this.fromString}</label>
|
|
69
75
|
<input type="time" class="timespan-start" id="${startId}"/>
|
|
70
76
|
</div>
|
|
71
77
|
|
|
@@ -75,7 +81,7 @@ class TimeSpanPicker {
|
|
|
75
81
|
</div>
|
|
76
82
|
|
|
77
83
|
<div class="timespan-field timespan-field-end">
|
|
78
|
-
<label for="${endId}"
|
|
84
|
+
<label for="${endId}">${this.toString}</label>
|
|
79
85
|
<input type="time" class="timespan-end" id="${endId}"/>
|
|
80
86
|
</div>
|
|
81
87
|
</div>
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dodlhuat/basix",
|
|
3
|
-
"version": "1.2.
|
|
3
|
+
"version": "1.2.5",
|
|
4
4
|
"description": "Basix is intended as a starter for the rapid development of a design. Each design element can be added individually to include only the data required. It is using plain javascript / typescript and therefore is not dependent on any plugin.",
|
|
5
5
|
"exports": {
|
|
6
6
|
"./css/*": "./css/*",
|