aloha-vue 1.0.41 → 1.0.44
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/docs/package.json +1 -1
- package/docs/src/views/PageAccordion/PageAccordion.pug +8 -0
- package/docs/src/views/PageForm/PageForm.js +1 -0
- package/package.json +1 -1
- package/src/AAccordion/AAccordion.js +19 -1
- package/src/AAccordion/{AAccordionItem/AAccordionItem.js → AAccordionItem.js} +28 -9
- package/src/ui/ACheckbox/ACheckbox.js +1 -1
- package/src/ui/AFieldset/AFieldset.js +1 -1
- package/src/ui/AInput/AInput.js +1 -1
- package/src/ui/AOneCheckbox/AOneCheckbox.js +1 -1
- package/src/ui/ARadio/ARadio.js +1 -1
- package/src/ui/ASelect/ASelect.js +1 -1
- package/src/ui/ASelect/compositionAPI/ASelectToggleAPI.js +2 -0
- package/src/ui/ASwitch/ASwitch.js +1 -1
- package/src/ui/ATemplate/ATemplate.js +1 -1
- package/src/ui/ATextarea/ATextarea.js +1 -1
- package/src/ui/mixins/UiMixinProps.js +4 -0
- package/src/AAccordion/AAccordion.pug +0 -27
- package/src/AAccordion/AAccordion.vue +0 -2
- package/src/AAccordion/AAccordionItem/AAccordionItem.pug +0 -76
- package/src/AAccordion/AAccordionItem/AAccordionItem.vue +0 -2
package/docs/package.json
CHANGED
package/package.json
CHANGED
|
@@ -3,7 +3,7 @@ import {
|
|
|
3
3
|
h,
|
|
4
4
|
} from "vue";
|
|
5
5
|
|
|
6
|
-
import AAccordionItem from "./AAccordionItem
|
|
6
|
+
import AAccordionItem from "./AAccordionItem";
|
|
7
7
|
|
|
8
8
|
import {
|
|
9
9
|
cloneDeep,
|
|
@@ -16,11 +16,15 @@ export default {
|
|
|
16
16
|
name: "AAccordion",
|
|
17
17
|
provide() {
|
|
18
18
|
return {
|
|
19
|
+
classButton: computed(() => this.classButton),
|
|
20
|
+
disabled: computed(() => this.disabled),
|
|
19
21
|
id: computed(() => this.id),
|
|
20
22
|
indexesForOpen: computed(() => this.indexesForOpen),
|
|
23
|
+
isCaret: computed(() => this.isCaret),
|
|
21
24
|
keyList: computed(() => this.keyList),
|
|
22
25
|
keyLabel: computed(() => this.keyLabel),
|
|
23
26
|
keyContent: computed(() => this.keyContent),
|
|
27
|
+
readonly: computed(() => this.readonly),
|
|
24
28
|
};
|
|
25
29
|
},
|
|
26
30
|
props: {
|
|
@@ -41,6 +45,10 @@ export default {
|
|
|
41
45
|
type: Boolean,
|
|
42
46
|
required: false,
|
|
43
47
|
},
|
|
48
|
+
readonly: {
|
|
49
|
+
type: Boolean,
|
|
50
|
+
required: false,
|
|
51
|
+
},
|
|
44
52
|
keyList: {
|
|
45
53
|
type: String,
|
|
46
54
|
required: false,
|
|
@@ -56,6 +64,11 @@ export default {
|
|
|
56
64
|
required: false,
|
|
57
65
|
default: "content",
|
|
58
66
|
},
|
|
67
|
+
isCaret: {
|
|
68
|
+
type: Boolean,
|
|
69
|
+
required: false,
|
|
70
|
+
default: true,
|
|
71
|
+
},
|
|
59
72
|
stop: {
|
|
60
73
|
type: Boolean,
|
|
61
74
|
required: false,
|
|
@@ -64,6 +77,11 @@ export default {
|
|
|
64
77
|
type: Boolean,
|
|
65
78
|
required: false,
|
|
66
79
|
},
|
|
80
|
+
classButton: {
|
|
81
|
+
type: [String, Object],
|
|
82
|
+
required: false,
|
|
83
|
+
default: undefined,
|
|
84
|
+
},
|
|
67
85
|
},
|
|
68
86
|
emits: ["toggle"],
|
|
69
87
|
data() {
|
|
@@ -34,11 +34,15 @@ export default {
|
|
|
34
34
|
},
|
|
35
35
|
emits: ["toggle"],
|
|
36
36
|
inject: [
|
|
37
|
+
"classButton",
|
|
38
|
+
"disabled",
|
|
37
39
|
"id",
|
|
38
40
|
"indexesForOpen",
|
|
41
|
+
"isCaret",
|
|
39
42
|
"keyList",
|
|
40
43
|
"keyLabel",
|
|
41
44
|
"keyContent",
|
|
45
|
+
"readonly",
|
|
42
46
|
],
|
|
43
47
|
setup(props) {
|
|
44
48
|
const {
|
|
@@ -101,6 +105,29 @@ export default {
|
|
|
101
105
|
return get(this.item, this.keyContent);
|
|
102
106
|
}
|
|
103
107
|
},
|
|
108
|
+
|
|
109
|
+
buttonTag() {
|
|
110
|
+
return this.readonly ? "div" : "button";
|
|
111
|
+
},
|
|
112
|
+
|
|
113
|
+
buttonAttributes() {
|
|
114
|
+
const ATTRIBUTES = {
|
|
115
|
+
class: ["a_accordion__button", this.classButton, {
|
|
116
|
+
a_accordion__button_collapsed: !this.isOpen,
|
|
117
|
+
a_accordion__button_has_not_caret: !this.isCaret,
|
|
118
|
+
}],
|
|
119
|
+
};
|
|
120
|
+
|
|
121
|
+
if (!this.readonly) {
|
|
122
|
+
ATTRIBUTES.ariaExpanded = this.isOpen;
|
|
123
|
+
ATTRIBUTES["aria-controls"] = this.idForCollapse;
|
|
124
|
+
ATTRIBUTES.type = "button";
|
|
125
|
+
ATTRIBUTES.disabled = this.disabled;
|
|
126
|
+
ATTRIBUTES.onClick = this.toggle;
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
return ATTRIBUTES;
|
|
130
|
+
},
|
|
104
131
|
},
|
|
105
132
|
methods: {
|
|
106
133
|
toggle($event) {
|
|
@@ -122,15 +149,7 @@ export default {
|
|
|
122
149
|
h("div", {
|
|
123
150
|
class: "a_accordion__header",
|
|
124
151
|
}, [
|
|
125
|
-
h(
|
|
126
|
-
class: ["a_accordion__button", {
|
|
127
|
-
a_accordion__button_collapsed: !this.isOpen,
|
|
128
|
-
}],
|
|
129
|
-
ariaExpanded: this.isOpen,
|
|
130
|
-
"aria-controls": this.idForCollapse,
|
|
131
|
-
type: "button",
|
|
132
|
-
onClick: this.toggle,
|
|
133
|
-
}, [
|
|
152
|
+
h(this.buttonTag, this.buttonAttributes, [
|
|
134
153
|
this.$slots.button && this.$slots.button({
|
|
135
154
|
item: this.item,
|
|
136
155
|
itemIndex: this.itemIndex,
|
package/src/ui/AInput/AInput.js
CHANGED
package/src/ui/ARadio/ARadio.js
CHANGED
|
@@ -84,6 +84,8 @@ export default function ASelectToggleAPI(props, {
|
|
|
84
84
|
} else if (KEY_CODE === AKeysCode.escape) {
|
|
85
85
|
closePopover();
|
|
86
86
|
setFocusToButton();
|
|
87
|
+
$event.preventDefault();
|
|
88
|
+
$event.stopPropagation();
|
|
87
89
|
} else if (KEY_CODE === AKeysCode.tab) {
|
|
88
90
|
closePopover();
|
|
89
91
|
setFocusToButton();
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
component.a_accordion(
|
|
2
|
-
:is="tagsLocal.main"
|
|
3
|
-
:class="classMainLocal"
|
|
4
|
-
)
|
|
5
|
-
a-accordion-item(
|
|
6
|
-
v-for="(item, itemIndex) in items"
|
|
7
|
-
:key="itemIndex"
|
|
8
|
-
:item="item"
|
|
9
|
-
:item-index="itemIndex"
|
|
10
|
-
:is-parent-open="true"
|
|
11
|
-
@toggle="toggle"
|
|
12
|
-
)
|
|
13
|
-
template(
|
|
14
|
-
v-slot:button="slotProps"
|
|
15
|
-
)
|
|
16
|
-
slot(
|
|
17
|
-
name="button"
|
|
18
|
-
v-bind="slotProps"
|
|
19
|
-
)
|
|
20
|
-
|
|
21
|
-
template(
|
|
22
|
-
v-slot:content="slotProps"
|
|
23
|
-
)
|
|
24
|
-
slot(
|
|
25
|
-
name="content"
|
|
26
|
-
v-bind="slotProps"
|
|
27
|
-
)
|
|
@@ -1,76 +0,0 @@
|
|
|
1
|
-
component.a_accordion__item(
|
|
2
|
-
:is="tagsLocal.item"
|
|
3
|
-
:class="classItemLocal"
|
|
4
|
-
)
|
|
5
|
-
component.a_accordion__item__header(
|
|
6
|
-
:is="tagsLocal.itemHeader"
|
|
7
|
-
:class="classItemHeaderLocal"
|
|
8
|
-
)
|
|
9
|
-
component.a_accordion__item__header_btn(
|
|
10
|
-
:is="tagsLocal.itemHeaderButton"
|
|
11
|
-
:class="classItemHeaderButtonLocal"
|
|
12
|
-
:aria-expanded="ariaExpanded"
|
|
13
|
-
:aria-controls="idForCollapse"
|
|
14
|
-
@click="toggle"
|
|
15
|
-
)
|
|
16
|
-
slot(
|
|
17
|
-
name="button"
|
|
18
|
-
:item="item"
|
|
19
|
-
:item-index="itemIndex"
|
|
20
|
-
:parent-indexes="parentIndexes"
|
|
21
|
-
)
|
|
22
|
-
span(
|
|
23
|
-
v-if="labelLocal"
|
|
24
|
-
) {{ labelLocal }}
|
|
25
|
-
|
|
26
|
-
component.a_accordion__box_collapse(
|
|
27
|
-
:is="tagsLocal.boxCollapse"
|
|
28
|
-
:id="idForCollapse"
|
|
29
|
-
:class="classBoxCollapseLocal"
|
|
30
|
-
:style="styleBoxCollapse"
|
|
31
|
-
)
|
|
32
|
-
component.a_accordion__box_collapse__body(
|
|
33
|
-
:is="tagsLocal.boxCollapseBody"
|
|
34
|
-
:class="classBoxCollapseBodyLocal"
|
|
35
|
-
)
|
|
36
|
-
slot(
|
|
37
|
-
name="content"
|
|
38
|
-
:item="item"
|
|
39
|
-
:item-index="itemIndex"
|
|
40
|
-
:parent-indexes="parentIndexes"
|
|
41
|
-
)
|
|
42
|
-
component.a_accordion__box_collapse__body__content(
|
|
43
|
-
:is="tagsLocal.boxCollapseBodyContent"
|
|
44
|
-
v-if="contentLocal"
|
|
45
|
-
:class="classBoxCollapseBodyContent"
|
|
46
|
-
v-html="contentLocal"
|
|
47
|
-
)
|
|
48
|
-
component.a_accordion(
|
|
49
|
-
:is="tagsLocal.main"
|
|
50
|
-
v-if="hasChildren"
|
|
51
|
-
:class="classMainLocal"
|
|
52
|
-
)
|
|
53
|
-
a-accordion-item(
|
|
54
|
-
v-for="(itemChild, itemChildIndex) in children"
|
|
55
|
-
:key="itemChildIndex"
|
|
56
|
-
:item="itemChild"
|
|
57
|
-
:item-index="itemChildIndex"
|
|
58
|
-
:is-parent-open="isOpen"
|
|
59
|
-
:parent-indexes="parentIndexesForChild"
|
|
60
|
-
@toggle="toggleFromChild"
|
|
61
|
-
)
|
|
62
|
-
template(
|
|
63
|
-
v-slot:button="slotProps"
|
|
64
|
-
)
|
|
65
|
-
slot(
|
|
66
|
-
name="button"
|
|
67
|
-
v-bind="slotProps"
|
|
68
|
-
)
|
|
69
|
-
|
|
70
|
-
template(
|
|
71
|
-
v-slot:content="slotProps"
|
|
72
|
-
)
|
|
73
|
-
slot(
|
|
74
|
-
name="content"
|
|
75
|
-
v-bind="slotProps"
|
|
76
|
-
)
|