not-bulma 1.0.40 → 1.0.43
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 +1 -1
- package/src/elements/form/index.js +2 -0
- package/src/elements/form/ui.date.svelte +85 -67
- package/src/elements/form/ui.number.svelte +102 -0
- package/src/frame/components/navigation/side/index.js +170 -166
- package/src/frame/components/table/notTable.js +802 -707
- package/src/scss/{bulma-list.scss → _bulma-list.scss} +0 -0
- package/src/scss/style.scss +3 -0
package/package.json
CHANGED
|
@@ -14,6 +14,7 @@ import UITelephone from "./ui.telephone.svelte";
|
|
|
14
14
|
import UITextarea from "./ui.textarea.svelte";
|
|
15
15
|
import UITextfield from "./ui.textfield.svelte";
|
|
16
16
|
import UIRange from "./ui.range.svelte";
|
|
17
|
+
import UINumber from "./ui.number.svelte";
|
|
17
18
|
|
|
18
19
|
export {
|
|
19
20
|
UIAutocomplete,
|
|
@@ -32,4 +33,5 @@ export {
|
|
|
32
33
|
UITextarea,
|
|
33
34
|
UITextfield,
|
|
34
35
|
UIRange,
|
|
36
|
+
UINumber,
|
|
35
37
|
};
|
|
@@ -1,82 +1,100 @@
|
|
|
1
1
|
<script>
|
|
2
|
+
import UICommon from "../common.js";
|
|
3
|
+
import ErrorsList from "../various/ui.errors.list.svelte";
|
|
2
4
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
+
import { createEventDispatcher } from "svelte";
|
|
6
|
+
let dispatch = createEventDispatcher();
|
|
5
7
|
|
|
6
|
-
|
|
7
|
-
let dispatch = createEventDispatcher();
|
|
8
|
+
export let inputStarted = false;
|
|
8
9
|
|
|
9
|
-
|
|
10
|
+
export let value = new Date();
|
|
11
|
+
export let placeholder = "Date and time of event";
|
|
12
|
+
export let fieldname = "datetime";
|
|
13
|
+
export let icon = false;
|
|
14
|
+
export let required = true;
|
|
15
|
+
export let readonly = false;
|
|
16
|
+
export let valid = true;
|
|
17
|
+
export let validated = false;
|
|
18
|
+
export let errors = false;
|
|
19
|
+
export let formErrors = false;
|
|
20
|
+
export let formLevelError = false;
|
|
10
21
|
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
+
$: iconClasses = (icon ? " has-icons-left " : "") + " has-icons-right ";
|
|
23
|
+
$: allErrors = [].concat(
|
|
24
|
+
errors ? errors : [],
|
|
25
|
+
formErrors ? formErrors : []
|
|
26
|
+
);
|
|
27
|
+
$: invalid = valid === false || formLevelError;
|
|
28
|
+
$: showErrors = !(validated && valid) && inputStarted;
|
|
29
|
+
$: validationClasses =
|
|
30
|
+
valid === true || !inputStarted
|
|
31
|
+
? UICommon.CLASS_OK
|
|
32
|
+
: UICommon.CLASS_ERR;
|
|
22
33
|
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
value: ev.currentTarget.value
|
|
33
|
-
};
|
|
34
|
-
inputStarted = true;
|
|
35
|
-
dispatch('change', data);
|
|
36
|
-
return true;
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
function onInput(ev){
|
|
40
|
-
let data = {
|
|
41
|
-
field: fieldname,
|
|
42
|
-
value: ev.currentTarget.value
|
|
43
|
-
};
|
|
44
|
-
inputStarted = true;
|
|
45
|
-
dispatch('change', data);
|
|
46
|
-
return true;
|
|
47
|
-
}
|
|
34
|
+
function onBlur(ev) {
|
|
35
|
+
let data = {
|
|
36
|
+
field: fieldname,
|
|
37
|
+
value: ev.currentTarget.value,
|
|
38
|
+
};
|
|
39
|
+
inputStarted = true;
|
|
40
|
+
dispatch("change", data);
|
|
41
|
+
return true;
|
|
42
|
+
}
|
|
48
43
|
|
|
44
|
+
function onInput(ev) {
|
|
45
|
+
let data = {
|
|
46
|
+
field: fieldname,
|
|
47
|
+
value: ev.currentTarget.value,
|
|
48
|
+
};
|
|
49
|
+
inputStarted = true;
|
|
50
|
+
dispatch("change", data);
|
|
51
|
+
return true;
|
|
52
|
+
}
|
|
49
53
|
</script>
|
|
50
54
|
|
|
51
|
-
|
|
52
|
-
{#if readonly
|
|
53
|
-
|
|
55
|
+
<div class="control {iconClasses}">
|
|
56
|
+
{#if readonly}
|
|
57
|
+
<p>
|
|
58
|
+
<time datetime={value}
|
|
59
|
+
>{UICommon.tryFormatLocaleDateTime(value)}</time
|
|
60
|
+
>
|
|
61
|
+
</p>
|
|
54
62
|
{:else}
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
63
|
+
<input
|
|
64
|
+
class="input {validationClasses}"
|
|
65
|
+
id="form-field-date-{fieldname}"
|
|
66
|
+
type="date"
|
|
67
|
+
name={fieldname}
|
|
68
|
+
{invalid}
|
|
69
|
+
{required}
|
|
70
|
+
{placeholder}
|
|
71
|
+
bind:value
|
|
72
|
+
{readonly}
|
|
73
|
+
autocomplete={fieldname}
|
|
74
|
+
aria-controls="input-field-helper-{fieldname}"
|
|
75
|
+
on:change={onBlur}
|
|
76
|
+
on:input={onInput}
|
|
77
|
+
aria-describedby="input-field-helper-{fieldname}"
|
|
78
|
+
/>
|
|
79
|
+
{#if icon}
|
|
80
|
+
<span class="icon is-small is-left"
|
|
81
|
+
><i class="fas fa-{icon}" /></span
|
|
82
|
+
>
|
|
83
|
+
{/if}
|
|
84
|
+
{#if validated === true}
|
|
85
|
+
<span class="icon is-small is-right">
|
|
86
|
+
{#if valid === true}
|
|
87
|
+
<i class="fas fa-check" />
|
|
88
|
+
{:else if valid === false}
|
|
89
|
+
<i class="fas fa-exclamation-triangle" />
|
|
90
|
+
{/if}
|
|
91
|
+
</span>
|
|
92
|
+
{/if}
|
|
75
93
|
{/if}
|
|
76
|
-
|
|
77
|
-
|
|
94
|
+
</div>
|
|
95
|
+
<ErrorsList
|
|
78
96
|
bind:errors={allErrors}
|
|
79
97
|
bind:show={showErrors}
|
|
80
98
|
bind:classes={validationClasses}
|
|
81
99
|
id="input-field-helper-{fieldname}"
|
|
82
|
-
|
|
100
|
+
/>
|
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
<script>
|
|
2
|
+
import UICommon from "../common.js";
|
|
3
|
+
import ErrorsList from "../various/ui.errors.list.svelte";
|
|
4
|
+
import { createEventDispatcher } from "svelte";
|
|
5
|
+
let dispatch = createEventDispatcher();
|
|
6
|
+
|
|
7
|
+
export let inputStarted = false;
|
|
8
|
+
export let value = 0;
|
|
9
|
+
export let placeholder = "0.0";
|
|
10
|
+
export let min = 0;
|
|
11
|
+
export let max = 100;
|
|
12
|
+
export let step = 1;
|
|
13
|
+
export let fieldname = "number";
|
|
14
|
+
export let icon = false;
|
|
15
|
+
export let required = true;
|
|
16
|
+
export let disabled = false;
|
|
17
|
+
export let readonly = false;
|
|
18
|
+
export let valid = true;
|
|
19
|
+
export let validated = false;
|
|
20
|
+
export let errors = false;
|
|
21
|
+
export let formErrors = false;
|
|
22
|
+
export let formLevelError = false;
|
|
23
|
+
|
|
24
|
+
$: iconClasses = (icon ? " has-icons-left " : "") + " has-icons-right ";
|
|
25
|
+
$: allErrors = [].concat(
|
|
26
|
+
errors ? errors : [],
|
|
27
|
+
formErrors ? formErrors : []
|
|
28
|
+
);
|
|
29
|
+
$: showErrors = !(validated && valid) && inputStarted;
|
|
30
|
+
$: invalid = valid === false || formLevelError;
|
|
31
|
+
$: validationClasses =
|
|
32
|
+
valid === true || !inputStarted
|
|
33
|
+
? UICommon.CLASS_OK
|
|
34
|
+
: UICommon.CLASS_ERR;
|
|
35
|
+
|
|
36
|
+
function onBlur(/*ev*/) {
|
|
37
|
+
let data = {
|
|
38
|
+
field: fieldname,
|
|
39
|
+
value,
|
|
40
|
+
};
|
|
41
|
+
inputStarted = true;
|
|
42
|
+
dispatch("change", data);
|
|
43
|
+
return true;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
function onInput(ev) {
|
|
47
|
+
let data = {
|
|
48
|
+
field: fieldname,
|
|
49
|
+
value: ev.currentTarget.value,
|
|
50
|
+
};
|
|
51
|
+
inputStarted = true;
|
|
52
|
+
dispatch("change", data);
|
|
53
|
+
return true;
|
|
54
|
+
}
|
|
55
|
+
</script>
|
|
56
|
+
|
|
57
|
+
<div class="control {iconClasses}">
|
|
58
|
+
{#if readonly}
|
|
59
|
+
<p>{value}</p>
|
|
60
|
+
{:else}
|
|
61
|
+
<input
|
|
62
|
+
id="form-field-textfield-{fieldname}"
|
|
63
|
+
class="input {validationClasses}"
|
|
64
|
+
type="number"
|
|
65
|
+
{min}
|
|
66
|
+
{max}
|
|
67
|
+
{step}
|
|
68
|
+
name={fieldname}
|
|
69
|
+
{invalid}
|
|
70
|
+
{disabled}
|
|
71
|
+
{required}
|
|
72
|
+
{readonly}
|
|
73
|
+
{placeholder}
|
|
74
|
+
bind:value
|
|
75
|
+
autocomplete={fieldname}
|
|
76
|
+
aria-controls="input-field-helper-{fieldname}"
|
|
77
|
+
on:change={onBlur}
|
|
78
|
+
on:input={onInput}
|
|
79
|
+
aria-describedby="input-field-helper-{fieldname}"
|
|
80
|
+
/>
|
|
81
|
+
{#if icon}
|
|
82
|
+
<span class="icon is-small is-left"
|
|
83
|
+
><i class="fas fa-{icon}" /></span
|
|
84
|
+
>
|
|
85
|
+
{/if}
|
|
86
|
+
{#if validated === true}
|
|
87
|
+
<span class="icon is-small is-right">
|
|
88
|
+
{#if valid === true}
|
|
89
|
+
<i class="fas fa-check" />
|
|
90
|
+
{:else if valid === false}
|
|
91
|
+
<i class="fas fa-exclamation-triangle" />
|
|
92
|
+
{/if}
|
|
93
|
+
</span>
|
|
94
|
+
{/if}
|
|
95
|
+
{/if}
|
|
96
|
+
</div>
|
|
97
|
+
<ErrorsList
|
|
98
|
+
bind:errors={allErrors}
|
|
99
|
+
bind:show={showErrors}
|
|
100
|
+
bind:classes={validationClasses}
|
|
101
|
+
id="input-field-helper-{fieldname}"
|
|
102
|
+
/>
|
|
@@ -1,185 +1,189 @@
|
|
|
1
|
-
import Menu from
|
|
2
|
-
import UISideMenu from
|
|
1
|
+
import Menu from "../menu.js";
|
|
2
|
+
import UISideMenu from "./ui.side.menu.svelte";
|
|
3
3
|
|
|
4
|
-
const TYPE =
|
|
4
|
+
const TYPE = "side";
|
|
5
5
|
|
|
6
6
|
class notSideMenu extends Menu {
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
7
|
+
static nav;
|
|
8
|
+
static main;
|
|
9
|
+
static aside;
|
|
10
|
+
|
|
11
|
+
static DEFAULT = {
|
|
12
|
+
section: "any",
|
|
13
|
+
sectionTitle: "Меню",
|
|
14
|
+
priority: 0,
|
|
15
|
+
open: false,
|
|
16
|
+
};
|
|
17
|
+
|
|
18
|
+
static options = {
|
|
19
|
+
type: TYPE,
|
|
20
|
+
items: [],
|
|
21
|
+
sections: [],
|
|
22
|
+
targetSelector: `#${TYPE}-menu`,
|
|
23
|
+
toggleSelector: `.${TYPE}-menu-toggle`,
|
|
24
|
+
root: "/",
|
|
25
|
+
open: false,
|
|
26
|
+
navigate: (urls) => {
|
|
27
|
+
this.hide();
|
|
28
|
+
if (!this.isDirectNavigation() && this.app) {
|
|
29
|
+
let func = this.app.getWorking("router");
|
|
30
|
+
if (func) {
|
|
31
|
+
return func.navigate(urls.short);
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
document.location.assign(urls.full);
|
|
35
|
+
},
|
|
36
|
+
};
|
|
37
|
+
|
|
38
|
+
static render(app) {
|
|
39
|
+
if (app) {
|
|
40
|
+
this.setApp(app);
|
|
41
|
+
}
|
|
42
|
+
this.prepareData();
|
|
43
|
+
if (!this.menu) {
|
|
44
|
+
this.createUI();
|
|
32
45
|
}
|
|
33
|
-
}
|
|
34
|
-
document.location.assign(urls.full);
|
|
35
46
|
}
|
|
36
|
-
};
|
|
37
47
|
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
48
|
+
static update() {
|
|
49
|
+
if (this.menu) {
|
|
50
|
+
this.menu.$destroy();
|
|
51
|
+
this.createUI();
|
|
52
|
+
}
|
|
41
53
|
}
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
54
|
+
|
|
55
|
+
static createUI() {
|
|
56
|
+
let target = document.querySelector(this.getOptions().targetSelector);
|
|
57
|
+
if (!target) {
|
|
58
|
+
return;
|
|
59
|
+
}
|
|
60
|
+
this.menu = new UISideMenu({
|
|
61
|
+
target,
|
|
62
|
+
props: {
|
|
63
|
+
items: this.items,
|
|
64
|
+
sections: this.sections,
|
|
65
|
+
root: this.getOptions().root,
|
|
66
|
+
navigate: this.getOptions().navigate,
|
|
67
|
+
},
|
|
68
|
+
});
|
|
69
|
+
this.initSizeResponse();
|
|
70
|
+
this.interval = setInterval(this.updateMenuActiveItem.bind(this), 200);
|
|
71
|
+
this.bindToggle();
|
|
45
72
|
}
|
|
46
|
-
}
|
|
47
73
|
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
this.menu.$destroy();
|
|
51
|
-
this.createUI();
|
|
74
|
+
static itemIsActive(itemURL) {
|
|
75
|
+
return (this.location + "/").indexOf(itemURL + "/") > -1;
|
|
52
76
|
}
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
navigate: this.getOptions().navigate
|
|
65
|
-
}
|
|
66
|
-
});
|
|
67
|
-
this.initSizeResponse();
|
|
68
|
-
this.interval = setInterval(this.updateMenuActiveItem.bind(this), 200);
|
|
69
|
-
this.bindToggle();
|
|
70
|
-
}
|
|
71
|
-
|
|
72
|
-
static itemIsActive(itemURL) {
|
|
73
|
-
return ((this.location + '/').indexOf(itemURL + '/') > -1);
|
|
74
|
-
}
|
|
75
|
-
|
|
76
|
-
static updateMenu() {
|
|
77
|
-
Array.from(document.querySelectorAll(this.getOptions().targetSelector + ' a')).forEach((item) => {
|
|
78
|
-
if (this.itemIsActive(item.getAttribute('href'))) {
|
|
79
|
-
item.classList.add('is-active');
|
|
80
|
-
} else {
|
|
81
|
-
item.classList.remove('is-active');
|
|
82
|
-
}
|
|
83
|
-
});
|
|
84
|
-
}
|
|
85
|
-
|
|
86
|
-
static updateMenuActiveItem() {
|
|
87
|
-
let url = window.location.toString(),
|
|
88
|
-
lastLocation = this.location;
|
|
89
|
-
if (lastLocation) {
|
|
90
|
-
if (url !== lastLocation) {
|
|
91
|
-
this.location = url;
|
|
92
|
-
this.updateMenu();
|
|
93
|
-
}
|
|
94
|
-
} else {
|
|
95
|
-
this.location = url;
|
|
96
|
-
this.updateMenu();
|
|
77
|
+
|
|
78
|
+
static updateMenu() {
|
|
79
|
+
Array.from(
|
|
80
|
+
document.querySelectorAll(this.getOptions().targetSelector + " a")
|
|
81
|
+
).forEach((item) => {
|
|
82
|
+
if (this.itemIsActive(item.getAttribute("href"))) {
|
|
83
|
+
item.classList.add("is-active");
|
|
84
|
+
} else {
|
|
85
|
+
item.classList.remove("is-active");
|
|
86
|
+
}
|
|
87
|
+
});
|
|
97
88
|
}
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
89
|
+
|
|
90
|
+
static updateMenuActiveItem() {
|
|
91
|
+
let url = window.location.toString(),
|
|
92
|
+
lastLocation = this.location;
|
|
93
|
+
if (lastLocation) {
|
|
94
|
+
if (url !== lastLocation) {
|
|
95
|
+
this.location = url;
|
|
96
|
+
this.updateMenu();
|
|
97
|
+
}
|
|
98
|
+
} else {
|
|
99
|
+
this.location = url;
|
|
100
|
+
this.updateMenu();
|
|
101
|
+
}
|
|
111
102
|
}
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
this.
|
|
118
|
-
|
|
119
|
-
this.
|
|
120
|
-
this.
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
103
|
+
|
|
104
|
+
static initSizeResponse() {
|
|
105
|
+
this.nav = document.querySelector("nav.navbar");
|
|
106
|
+
this.aside = document.querySelector("aside");
|
|
107
|
+
this.main = document.querySelector("main");
|
|
108
|
+
this.resizeAsideAndMain(this.aside, this.main, this.nav);
|
|
109
|
+
this.resizeMain(this.main, this.aside);
|
|
110
|
+
window.addEventListener("resize", this.resizeMain.bind(this));
|
|
111
|
+
if (this.getOptions().open) {
|
|
112
|
+
this.show();
|
|
113
|
+
} else {
|
|
114
|
+
this.hide();
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
static resizeMain() {
|
|
119
|
+
if (this.isTouch()) {
|
|
120
|
+
if (this.aside.classList.contains("is-active")) {
|
|
121
|
+
this.main.style.display = "none";
|
|
122
|
+
} else {
|
|
123
|
+
this.main.style.display = "block";
|
|
124
|
+
this.main.style.marginLeft = "0px";
|
|
125
|
+
}
|
|
126
|
+
} else {
|
|
127
|
+
let rect = this.aside.getBoundingClientRect();
|
|
128
|
+
this.main.style.display = "block";
|
|
129
|
+
if (this.main.style.height === "0px") {
|
|
130
|
+
this.main.style.height = "auto";
|
|
131
|
+
}
|
|
132
|
+
this.main.style.marginLeft = rect.width + rect.left + "px";
|
|
133
|
+
}
|
|
129
134
|
}
|
|
130
|
-
}
|
|
131
135
|
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
136
|
+
static resizeAside() {
|
|
137
|
+
if (this.aside.style.display !== "none") {
|
|
138
|
+
let rect = this.nav.getBoundingClientRect();
|
|
139
|
+
this.aside.style.height = window.innerHeight - rect.height + "px";
|
|
140
|
+
this.aside.style.marginTop = rect.height + "px";
|
|
141
|
+
}
|
|
137
142
|
}
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
}
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
143
|
+
|
|
144
|
+
static resizeAsideAndMain() {
|
|
145
|
+
let rect = this.nav.getBoundingClientRect();
|
|
146
|
+
this.aside.style.height = window.innerHeight - rect.height + "px";
|
|
147
|
+
//this.aside.style.paddingTop = (rect.height) + 'px';
|
|
148
|
+
//this.main.style.marginTop = (rect.height) + 'px';
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
static bindToggle() {
|
|
152
|
+
let els = document.querySelectorAll(this.getOptions().toggleSelector);
|
|
153
|
+
Array.from(els).forEach((el) => {
|
|
154
|
+
el.removeEventListener("click", this.toggle.bind(this));
|
|
155
|
+
el.addEventListener("click", this.toggle.bind(this));
|
|
156
|
+
});
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
static toggle(e) {
|
|
160
|
+
e && e.preventDefault();
|
|
161
|
+
this.aside.classList.toggle("is-active");
|
|
162
|
+
this.resizeMain();
|
|
163
|
+
return false;
|
|
164
|
+
}
|
|
165
|
+
|
|
166
|
+
static hide(e) {
|
|
167
|
+
e && e.preventDefault();
|
|
168
|
+
this.aside.classList.remove("is-active");
|
|
169
|
+
this.resizeMain();
|
|
170
|
+
return false;
|
|
171
|
+
}
|
|
172
|
+
|
|
173
|
+
static show(e) {
|
|
174
|
+
e && e.preventDefault();
|
|
175
|
+
this.classList.add("is-active");
|
|
176
|
+
this.resizeMain();
|
|
177
|
+
return false;
|
|
178
|
+
}
|
|
179
|
+
|
|
180
|
+
static isOpen() {
|
|
181
|
+
if (this.aside) {
|
|
182
|
+
return this.aside.classList.contains("is-active");
|
|
183
|
+
} else {
|
|
184
|
+
return true;
|
|
185
|
+
}
|
|
181
186
|
}
|
|
182
|
-
}
|
|
183
187
|
}
|
|
184
188
|
|
|
185
189
|
export default notSideMenu;
|