@dodlhuat/basix 1.2.0 → 1.2.2
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 +266 -6
- package/css/accordion.scss +86 -87
- package/css/alert.scss +137 -137
- package/css/button.scss +48 -0
- package/css/calendar.scss +957 -0
- package/css/card.scss +65 -65
- package/css/chart.scss +270 -157
- package/css/chat-bubbles.scss +134 -68
- package/css/chips.scss +109 -19
- package/css/colors.scss +32 -32
- package/css/datepicker.scss +336 -336
- package/css/defaults.scss +90 -90
- package/css/docs.scss +529 -0
- package/css/editor.scss +36 -0
- package/css/file-uploader.scss +1 -1
- package/css/flyout-menu.scss +361 -361
- package/css/form.scss +0 -15
- package/css/gallery.scss +65 -6
- package/css/grid.scss +41 -40
- package/css/group-picker.scss +345 -0
- package/css/guitar-chords.css +250 -250
- package/css/icons.scss +330 -330
- package/css/parameters.scss +3 -3
- package/css/placeholder.scss +33 -33
- package/css/popover.scss +206 -0
- package/css/progress.scss +76 -32
- package/css/properties.scss +51 -36
- package/css/push-menu.scss +302 -174
- package/css/reset.scss +39 -39
- package/css/scrollbar.scss +62 -5
- package/css/sidebar-nav.scss +92 -0
- package/css/spinner.scss +65 -65
- package/css/stepper.scss +48 -12
- package/css/style.css +3155 -254
- package/css/style.css.map +1 -1
- package/css/style.min.css +1 -1
- package/css/style.scss +51 -45
- package/css/table.scss +199 -199
- package/css/tabs.scss +154 -123
- package/css/timeline.scss +83 -38
- package/css/timepicker.scss +100 -5
- package/css/toast.scss +81 -81
- package/css/virtual-dropdown.scss +35 -29
- package/js/calendar.js +532 -0
- package/js/calendar.ts +706 -0
- package/js/chart.js +573 -257
- package/js/chart.ts +692 -0
- package/js/code-viewer.js +10 -10
- package/js/code-viewer.ts +188 -188
- package/js/datepicker.ts +627 -627
- package/js/docs-nav.js +204 -0
- package/js/dropdown.ts +179 -179
- package/js/editor.js +50 -6
- package/js/editor.ts +483 -444
- package/js/file-uploader.js +1 -0
- package/js/file-uploader.ts +1 -0
- package/js/flyout-menu.js +14 -14
- package/js/flyout-menu.ts +249 -249
- package/js/form-builder.js +106 -106
- package/js/gallery.js +14 -8
- package/js/gallery.ts +245 -236
- package/js/group-picker.js +342 -0
- package/js/group-picker.ts +447 -0
- package/js/guitar-chords.js +268 -268
- package/js/lazy-loader.js +121 -121
- package/js/modal.ts +166 -166
- package/js/popover.js +163 -0
- package/js/popover.ts +219 -0
- package/js/position.js +108 -0
- package/js/position.ts +111 -0
- package/js/push-menu.js +113 -0
- package/js/push-menu.ts +284 -145
- package/js/request.js +50 -50
- package/js/scroll.ts +47 -47
- package/js/scrollbar.js +13 -0
- package/js/scrollbar.ts +324 -307
- package/js/select.ts +216 -216
- package/js/sidebar-nav.js +41 -0
- package/js/sidebar-nav.ts +66 -0
- package/js/table.ts +452 -452
- package/js/tabs.ts +279 -279
- package/js/theme.js +17 -6
- package/js/theme.ts +234 -224
- package/js/toast.ts +137 -137
- package/js/tooltip.js +6 -60
- package/js/tooltip.ts +184 -251
- package/js/tsconfig.json +18 -18
- package/js/utils.ts +83 -83
- package/js/virtual-dropdown.js +25 -25
- package/js/virtual-dropdown.ts +365 -365
- package/package.json +37 -39
- package/js/index.js +0 -816
- package/js/index.ts +0 -987
package/js/request.js
CHANGED
|
@@ -1,51 +1,51 @@
|
|
|
1
|
-
class Request {
|
|
2
|
-
constructor(url, parameters, success, error) {
|
|
3
|
-
this.url = url;
|
|
4
|
-
this.parameters = parameters;
|
|
5
|
-
this.success = success;
|
|
6
|
-
this.error = error;
|
|
7
|
-
}
|
|
8
|
-
|
|
9
|
-
get() {
|
|
10
|
-
const checked = this.#checkSuccessError(this.success, this.error);
|
|
11
|
-
if (this.parameters.data !== undefined) {
|
|
12
|
-
this.url += '?' + new URLSearchParams(this.parameters.data);
|
|
13
|
-
}
|
|
14
|
-
fetch(this.url)
|
|
15
|
-
.then(function(response) {
|
|
16
|
-
return response.json();
|
|
17
|
-
})
|
|
18
|
-
.then(checked.success)
|
|
19
|
-
.catch(checked.error);
|
|
20
|
-
}
|
|
21
|
-
post() {
|
|
22
|
-
const checked = this.#checkSuccessError(this.success, this.error);
|
|
23
|
-
fetch(this.url,
|
|
24
|
-
{
|
|
25
|
-
method: 'post',
|
|
26
|
-
headers: {
|
|
27
|
-
'Accept': 'application/json',
|
|
28
|
-
'Content-Type': 'application/json'
|
|
29
|
-
},
|
|
30
|
-
body: JSON.stringify(this.parameters.data)
|
|
31
|
-
})
|
|
32
|
-
.then(checked.success)
|
|
33
|
-
.catch(checked.error);
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
#checkSuccessError(success, error) {
|
|
37
|
-
if (success === undefined) {
|
|
38
|
-
success = function(data) {
|
|
39
|
-
console.log(data);
|
|
40
|
-
};
|
|
41
|
-
}
|
|
42
|
-
if (error === undefined) {
|
|
43
|
-
error = function(error) {
|
|
44
|
-
console.error(error);
|
|
45
|
-
}
|
|
46
|
-
}
|
|
47
|
-
return {success, error};
|
|
48
|
-
}
|
|
49
|
-
}
|
|
50
|
-
|
|
1
|
+
class Request {
|
|
2
|
+
constructor(url, parameters, success, error) {
|
|
3
|
+
this.url = url;
|
|
4
|
+
this.parameters = parameters;
|
|
5
|
+
this.success = success;
|
|
6
|
+
this.error = error;
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
get() {
|
|
10
|
+
const checked = this.#checkSuccessError(this.success, this.error);
|
|
11
|
+
if (this.parameters.data !== undefined) {
|
|
12
|
+
this.url += '?' + new URLSearchParams(this.parameters.data);
|
|
13
|
+
}
|
|
14
|
+
fetch(this.url)
|
|
15
|
+
.then(function(response) {
|
|
16
|
+
return response.json();
|
|
17
|
+
})
|
|
18
|
+
.then(checked.success)
|
|
19
|
+
.catch(checked.error);
|
|
20
|
+
}
|
|
21
|
+
post() {
|
|
22
|
+
const checked = this.#checkSuccessError(this.success, this.error);
|
|
23
|
+
fetch(this.url,
|
|
24
|
+
{
|
|
25
|
+
method: 'post',
|
|
26
|
+
headers: {
|
|
27
|
+
'Accept': 'application/json',
|
|
28
|
+
'Content-Type': 'application/json'
|
|
29
|
+
},
|
|
30
|
+
body: JSON.stringify(this.parameters.data)
|
|
31
|
+
})
|
|
32
|
+
.then(checked.success)
|
|
33
|
+
.catch(checked.error);
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
#checkSuccessError(success, error) {
|
|
37
|
+
if (success === undefined) {
|
|
38
|
+
success = function(data) {
|
|
39
|
+
console.log(data);
|
|
40
|
+
};
|
|
41
|
+
}
|
|
42
|
+
if (error === undefined) {
|
|
43
|
+
error = function(error) {
|
|
44
|
+
console.error(error);
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
return {success, error};
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
|
|
51
51
|
export {Request}
|
package/js/scroll.ts
CHANGED
|
@@ -1,47 +1,47 @@
|
|
|
1
|
-
interface ScrollOptions {
|
|
2
|
-
behavior?: ScrollBehavior;
|
|
3
|
-
offset?: number;
|
|
4
|
-
block?: ScrollLogicalPosition;
|
|
5
|
-
}
|
|
6
|
-
|
|
7
|
-
class Scroll {
|
|
8
|
-
public static to(target: string | Element, options: ScrollOptions = {}): void {
|
|
9
|
-
const fixed_header = document.querySelector('.main-header') as HTMLElement | null;
|
|
10
|
-
const offset = fixed_header ? fixed_header.offsetHeight : 0;
|
|
11
|
-
|
|
12
|
-
const settings: Required<ScrollOptions> = {
|
|
13
|
-
behavior: "smooth",
|
|
14
|
-
offset: offset,
|
|
15
|
-
block: "start",
|
|
16
|
-
...options
|
|
17
|
-
};
|
|
18
|
-
|
|
19
|
-
let el: Element | null = target instanceof Element ? target : null;
|
|
20
|
-
|
|
21
|
-
if (typeof target === "string") {
|
|
22
|
-
el = document.querySelector(target);
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
if (!el) return;
|
|
26
|
-
|
|
27
|
-
const rect = el.getBoundingClientRect();
|
|
28
|
-
const scrollTop = window.scrollY;
|
|
29
|
-
const offsetTop = rect.top + scrollTop - settings.offset;
|
|
30
|
-
|
|
31
|
-
window.scrollTo({
|
|
32
|
-
top: offsetTop,
|
|
33
|
-
behavior: settings.behavior
|
|
34
|
-
});
|
|
35
|
-
}
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
declare global {
|
|
39
|
-
interface Window {
|
|
40
|
-
Scroll: typeof Scroll;
|
|
41
|
-
}
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
window.Scroll = Scroll;
|
|
45
|
-
|
|
46
|
-
export { Scroll };
|
|
47
|
-
export type { ScrollOptions };
|
|
1
|
+
interface ScrollOptions {
|
|
2
|
+
behavior?: ScrollBehavior;
|
|
3
|
+
offset?: number;
|
|
4
|
+
block?: ScrollLogicalPosition;
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
class Scroll {
|
|
8
|
+
public static to(target: string | Element, options: ScrollOptions = {}): void {
|
|
9
|
+
const fixed_header = document.querySelector('.main-header') as HTMLElement | null;
|
|
10
|
+
const offset = fixed_header ? fixed_header.offsetHeight : 0;
|
|
11
|
+
|
|
12
|
+
const settings: Required<ScrollOptions> = {
|
|
13
|
+
behavior: "smooth",
|
|
14
|
+
offset: offset,
|
|
15
|
+
block: "start",
|
|
16
|
+
...options
|
|
17
|
+
};
|
|
18
|
+
|
|
19
|
+
let el: Element | null = target instanceof Element ? target : null;
|
|
20
|
+
|
|
21
|
+
if (typeof target === "string") {
|
|
22
|
+
el = document.querySelector(target);
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
if (!el) return;
|
|
26
|
+
|
|
27
|
+
const rect = el.getBoundingClientRect();
|
|
28
|
+
const scrollTop = window.scrollY;
|
|
29
|
+
const offsetTop = rect.top + scrollTop - settings.offset;
|
|
30
|
+
|
|
31
|
+
window.scrollTo({
|
|
32
|
+
top: offsetTop,
|
|
33
|
+
behavior: settings.behavior
|
|
34
|
+
});
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
declare global {
|
|
39
|
+
interface Window {
|
|
40
|
+
Scroll: typeof Scroll;
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
window.Scroll = Scroll;
|
|
45
|
+
|
|
46
|
+
export { Scroll };
|
|
47
|
+
export type { ScrollOptions };
|
package/js/scrollbar.js
CHANGED
|
@@ -31,6 +31,7 @@ class Scrollbar {
|
|
|
31
31
|
this.boundTrackClick = this.handleTrackClick.bind(this);
|
|
32
32
|
this.boundViewportScroll = this.updateThumb.bind(this);
|
|
33
33
|
this.boundUpdateThumb = this.updateThumb.bind(this);
|
|
34
|
+
this.boundContainerWheel = this.handleContainerWheel.bind(this);
|
|
34
35
|
// Setup ResizeObserver
|
|
35
36
|
this.ro = new ResizeObserver(this.boundUpdateThumb);
|
|
36
37
|
// Initialize
|
|
@@ -80,6 +81,7 @@ class Scrollbar {
|
|
|
80
81
|
this.viewport.addEventListener('scroll', this.boundViewportScroll, { passive: true });
|
|
81
82
|
this.thumb.addEventListener('pointerdown', this.boundThumbPointerDown);
|
|
82
83
|
this.track.addEventListener('click', this.boundTrackClick);
|
|
84
|
+
this.container.addEventListener('wheel', this.boundContainerWheel, { passive: false });
|
|
83
85
|
// Observe size changes
|
|
84
86
|
this.ro.observe(this.viewport);
|
|
85
87
|
this.ro.observe(this.content);
|
|
@@ -182,11 +184,22 @@ class Scrollbar {
|
|
|
182
184
|
const scrollTop = scrollRatio * (maxScroll || 0);
|
|
183
185
|
this.viewport.scrollTo({ top: scrollTop, behavior: 'smooth' });
|
|
184
186
|
}
|
|
187
|
+
handleContainerWheel(e) {
|
|
188
|
+
const { scrollTop, scrollHeight, clientHeight } = this.viewport;
|
|
189
|
+
const scrollable = scrollHeight > clientHeight;
|
|
190
|
+
const atTop = scrollTop === 0 && e.deltaY < 0;
|
|
191
|
+
const atBottom = scrollTop + clientHeight >= scrollHeight - 1 && e.deltaY > 0;
|
|
192
|
+
if (scrollable && !atTop && !atBottom) {
|
|
193
|
+
e.preventDefault();
|
|
194
|
+
}
|
|
195
|
+
this.viewport.scrollTop += e.deltaY;
|
|
196
|
+
}
|
|
185
197
|
destroy() {
|
|
186
198
|
// Remove event listeners
|
|
187
199
|
this.viewport.removeEventListener('scroll', this.boundViewportScroll);
|
|
188
200
|
this.thumb.removeEventListener('pointerdown', this.boundThumbPointerDown);
|
|
189
201
|
this.track.removeEventListener('click', this.boundTrackClick);
|
|
202
|
+
this.container.removeEventListener('wheel', this.boundContainerWheel);
|
|
190
203
|
window.removeEventListener('resize', this.boundUpdateThumb);
|
|
191
204
|
// Disconnect observer
|
|
192
205
|
this.ro.disconnect();
|