not-bulma 1.2.63 → 1.2.64

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "not-bulma",
3
- "version": "1.2.63",
3
+ "version": "1.2.64",
4
4
  "description": "not-* family UI components on Bulma CSS Framework",
5
5
  "main": "src/index.js",
6
6
  "svelte": "src/index.js",
@@ -12,6 +12,24 @@ export default class UICommon {
12
12
  behavior: "smooth",
13
13
  };
14
14
 
15
+ static MOBILE_WIDTH_BREAK_POINT = 760;
16
+
17
+ static isMobile() {
18
+ const testMobile = window.matchMedia || window.msMatchMedia;
19
+ if (testMobile) {
20
+ let testQuery = "(pointer:coarse)";
21
+ if (arguments.length) {
22
+ const max_width =
23
+ typeof arguments[0] === "boolean"
24
+ ? this.MOBILE_WIDTH_BREAK_POINT
25
+ : arguments[0];
26
+ testQuery = `only screen and (max-width: ${max_width}px)`;
27
+ }
28
+ return testMobile(testQuery).matches;
29
+ }
30
+ return false;
31
+ }
32
+
15
33
  static removeBodyScroll() {
16
34
  document.body.classList.add(this.SCROLL_DISABLER_CLASS);
17
35
  }
@@ -54,7 +54,7 @@
54
54
 
55
55
  {#if buttonsPosition === "bottom"}
56
56
  <UIButtonsRow
57
- classes={buttonsClasses || "is-footer"}
57
+ classes={buttonsClasses || "is-footer is-mobile"}
58
58
  left={closeButton ? [closeButton] : []}
59
59
  right={applyButton ? [applyButton] : []}
60
60
  ></UIButtonsRow>