aloha-vue 2.57.3 → 2.57.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/CHANGELOG.md +13 -0
- package/dist/aloha-vue.es.js +12519 -12436
- package/dist/aloha-vue.umd.js +52 -52
- package/package.json +1 -1
- package/src/AButton/AButton.js +275 -270
- package/src/AElement/AElement.js +23 -11
- package/src/AElement/{comositionAPI → compositionAPI}/AttributesAPI.js +51 -51
- package/src/AElement/{comositionAPI → compositionAPI}/ClickAPI.js +30 -30
- package/src/AElement/{comositionAPI → compositionAPI}/ComponentLocalAPI.js +23 -23
- package/src/AElement/{comositionAPI → compositionAPI}/DisabledAPI.js +22 -22
- package/src/AElement/{comositionAPI → compositionAPI}/HtmlTitleAPI.js +33 -33
- package/src/AElement/compositionAPI/KeydownAPI.js +35 -0
- package/src/AElement/{comositionAPI → compositionAPI}/LoadingAPI.js +22 -22
- package/src/AElement/{comositionAPI → compositionAPI}/RouterLinkAPI.js +20 -20
- package/src/AElement/{comositionAPI → compositionAPI}/SwitchAPI.js +33 -33
- package/src/AElement/{comositionAPI → compositionAPI}/TagAPI.js +34 -34
- package/src/AElement/{comositionAPI → compositionAPI}/TextAPI.js +78 -78
- package/src/AElement/{comositionAPI → compositionAPI}/TitleAPI.js +29 -29
- package/src/ALink/ALink.js +253 -248
- package/src/ATableForm/ATableForm.js +11 -6
- package/src/ATableForm/ATableFormCellAction/ATableFormCellAction.js +18 -0
- package/src/ATableForm/ATableFormCellAction/compositionAPI/DeleteAPI.js +5 -5
- package/src/ATableForm/ATableFormCellAction/compositionAPI/IdsAPI.js +31 -0
- package/src/ATableForm/ATableFormCellDnd/ATableFormCellDnd.js +2 -0
- package/src/ATableForm/ATableFormRow/compositionAPI/EditAPI.js +5 -4
- package/src/ATableForm/ATableFormTh/ATableFormTh.js +0 -6
- package/src/ATableForm/compositionAPI/ClassesAPI.js +4 -4
- package/src/ATableForm/compositionAPI/ColumnsGrowAPI.js +4 -1
- package/src/ATableForm/compositionAPI/DeleteAPI.js +2 -2
- package/src/ATableForm/compositionAPI/DragAndDropAPI.js +24 -14
- package/src/ATableForm/compositionAPI/EditAPI.js +119 -107
- package/src/ui/AInputCurrency/AInputCurrency.js +4 -0
- package/src/ui/AInputCurrency/compositionAPI/InputEventsAPI.js +4 -3
- package/src/ui/AInputCurrency/compositionAPI/ModelAPI.js +3 -2
|
@@ -1,51 +1,51 @@
|
|
|
1
|
-
import {
|
|
2
|
-
computed,
|
|
3
|
-
toRef,
|
|
4
|
-
} from "vue";
|
|
5
|
-
|
|
6
|
-
const TYPES_BUTTON_MAP = {
|
|
7
|
-
button: true,
|
|
8
|
-
submit: true,
|
|
9
|
-
reset: true,
|
|
10
|
-
};
|
|
11
|
-
|
|
12
|
-
export default function AttributesAPI(props, {
|
|
13
|
-
isRouterLink = computed(() => false),
|
|
14
|
-
tagLocal = computed(() => ""),
|
|
15
|
-
}) {
|
|
16
|
-
const disabled = toRef(props, "disabled");
|
|
17
|
-
const href = toRef(props, "href");
|
|
18
|
-
const target = toRef(props, "target");
|
|
19
|
-
const to = toRef(props, "to");
|
|
20
|
-
const type = toRef(props, "type");
|
|
21
|
-
|
|
22
|
-
const typeAttribut = computed(() => {
|
|
23
|
-
if (tagLocal.value === "button" && TYPES_BUTTON_MAP[type.value]) {
|
|
24
|
-
return type.value;
|
|
25
|
-
}
|
|
26
|
-
return undefined;
|
|
27
|
-
});
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
const toHrefAttributes = computed(() => {
|
|
31
|
-
if (isRouterLink.value) {
|
|
32
|
-
return {
|
|
33
|
-
target: target.value,
|
|
34
|
-
to: to.value,
|
|
35
|
-
};
|
|
36
|
-
}
|
|
37
|
-
if (disabled.value) {
|
|
38
|
-
return {};
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
return {
|
|
42
|
-
href: href.value,
|
|
43
|
-
target: target.value,
|
|
44
|
-
};
|
|
45
|
-
});
|
|
46
|
-
|
|
47
|
-
return {
|
|
48
|
-
toHrefAttributes,
|
|
49
|
-
typeAttribut,
|
|
50
|
-
};
|
|
51
|
-
}
|
|
1
|
+
import {
|
|
2
|
+
computed,
|
|
3
|
+
toRef,
|
|
4
|
+
} from "vue";
|
|
5
|
+
|
|
6
|
+
const TYPES_BUTTON_MAP = {
|
|
7
|
+
button: true,
|
|
8
|
+
submit: true,
|
|
9
|
+
reset: true,
|
|
10
|
+
};
|
|
11
|
+
|
|
12
|
+
export default function AttributesAPI(props, {
|
|
13
|
+
isRouterLink = computed(() => false),
|
|
14
|
+
tagLocal = computed(() => ""),
|
|
15
|
+
}) {
|
|
16
|
+
const disabled = toRef(props, "disabled");
|
|
17
|
+
const href = toRef(props, "href");
|
|
18
|
+
const target = toRef(props, "target");
|
|
19
|
+
const to = toRef(props, "to");
|
|
20
|
+
const type = toRef(props, "type");
|
|
21
|
+
|
|
22
|
+
const typeAttribut = computed(() => {
|
|
23
|
+
if (tagLocal.value === "button" && TYPES_BUTTON_MAP[type.value]) {
|
|
24
|
+
return type.value;
|
|
25
|
+
}
|
|
26
|
+
return undefined;
|
|
27
|
+
});
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
const toHrefAttributes = computed(() => {
|
|
31
|
+
if (isRouterLink.value) {
|
|
32
|
+
return {
|
|
33
|
+
target: target.value,
|
|
34
|
+
to: to.value,
|
|
35
|
+
};
|
|
36
|
+
}
|
|
37
|
+
if (disabled.value) {
|
|
38
|
+
return {};
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
return {
|
|
42
|
+
href: href.value,
|
|
43
|
+
target: target.value,
|
|
44
|
+
};
|
|
45
|
+
});
|
|
46
|
+
|
|
47
|
+
return {
|
|
48
|
+
toHrefAttributes,
|
|
49
|
+
typeAttribut,
|
|
50
|
+
};
|
|
51
|
+
}
|
|
@@ -1,30 +1,30 @@
|
|
|
1
|
-
import {
|
|
2
|
-
toRef,
|
|
3
|
-
} from "vue";
|
|
4
|
-
|
|
5
|
-
export default function ClickAPI(props, { emit }) {
|
|
6
|
-
const prevent = toRef(props, "prevent");
|
|
7
|
-
const stop = toRef(props, "stop");
|
|
8
|
-
const disabled = toRef(props, "disabled");
|
|
9
|
-
const ariaDisabled = toRef(props, "ariaDisabled");
|
|
10
|
-
|
|
11
|
-
const onClick = $event => {
|
|
12
|
-
if (prevent.value) {
|
|
13
|
-
$event.preventDefault();
|
|
14
|
-
}
|
|
15
|
-
if (stop.value) {
|
|
16
|
-
$event.stopPropagation();
|
|
17
|
-
}
|
|
18
|
-
if (disabled.value || ariaDisabled.value) {
|
|
19
|
-
return;
|
|
20
|
-
}
|
|
21
|
-
emit("click", {
|
|
22
|
-
props,
|
|
23
|
-
$event,
|
|
24
|
-
});
|
|
25
|
-
};
|
|
26
|
-
|
|
27
|
-
return {
|
|
28
|
-
onClick,
|
|
29
|
-
};
|
|
30
|
-
}
|
|
1
|
+
import {
|
|
2
|
+
toRef,
|
|
3
|
+
} from "vue";
|
|
4
|
+
|
|
5
|
+
export default function ClickAPI(props, { emit }) {
|
|
6
|
+
const prevent = toRef(props, "prevent");
|
|
7
|
+
const stop = toRef(props, "stop");
|
|
8
|
+
const disabled = toRef(props, "disabled");
|
|
9
|
+
const ariaDisabled = toRef(props, "ariaDisabled");
|
|
10
|
+
|
|
11
|
+
const onClick = $event => {
|
|
12
|
+
if (prevent.value) {
|
|
13
|
+
$event.preventDefault();
|
|
14
|
+
}
|
|
15
|
+
if (stop.value) {
|
|
16
|
+
$event.stopPropagation();
|
|
17
|
+
}
|
|
18
|
+
if (disabled.value || ariaDisabled.value) {
|
|
19
|
+
return;
|
|
20
|
+
}
|
|
21
|
+
emit("click", {
|
|
22
|
+
props,
|
|
23
|
+
$event,
|
|
24
|
+
});
|
|
25
|
+
};
|
|
26
|
+
|
|
27
|
+
return {
|
|
28
|
+
onClick,
|
|
29
|
+
};
|
|
30
|
+
}
|
|
@@ -1,23 +1,23 @@
|
|
|
1
|
-
import {
|
|
2
|
-
computed,
|
|
3
|
-
toRef,
|
|
4
|
-
} from "vue";
|
|
5
|
-
|
|
6
|
-
import ATooltip from "../../ATooltip/ATooltip";
|
|
7
|
-
|
|
8
|
-
export default function ComponentLocalAPI(props, {
|
|
9
|
-
tagLocal = computed(() => ""),
|
|
10
|
-
}) {
|
|
11
|
-
const isTitleHtml = toRef(props, "isTitleHtml");
|
|
12
|
-
|
|
13
|
-
const componentLocal = computed(() => {
|
|
14
|
-
if (isTitleHtml.value) {
|
|
15
|
-
return ATooltip;
|
|
16
|
-
}
|
|
17
|
-
return tagLocal.value;
|
|
18
|
-
});
|
|
19
|
-
|
|
20
|
-
return {
|
|
21
|
-
componentLocal,
|
|
22
|
-
};
|
|
23
|
-
}
|
|
1
|
+
import {
|
|
2
|
+
computed,
|
|
3
|
+
toRef,
|
|
4
|
+
} from "vue";
|
|
5
|
+
|
|
6
|
+
import ATooltip from "../../ATooltip/ATooltip";
|
|
7
|
+
|
|
8
|
+
export default function ComponentLocalAPI(props, {
|
|
9
|
+
tagLocal = computed(() => ""),
|
|
10
|
+
}) {
|
|
11
|
+
const isTitleHtml = toRef(props, "isTitleHtml");
|
|
12
|
+
|
|
13
|
+
const componentLocal = computed(() => {
|
|
14
|
+
if (isTitleHtml.value) {
|
|
15
|
+
return ATooltip;
|
|
16
|
+
}
|
|
17
|
+
return tagLocal.value;
|
|
18
|
+
});
|
|
19
|
+
|
|
20
|
+
return {
|
|
21
|
+
componentLocal,
|
|
22
|
+
};
|
|
23
|
+
}
|
|
@@ -1,22 +1,22 @@
|
|
|
1
|
-
import {
|
|
2
|
-
computed,
|
|
3
|
-
toRef,
|
|
4
|
-
} from "vue";
|
|
5
|
-
|
|
6
|
-
export default function DisabledAPI(props) {
|
|
7
|
-
const type = toRef(props, "type");
|
|
8
|
-
const disabled = toRef(props, "disabled");
|
|
9
|
-
|
|
10
|
-
const disabledLocal = computed(() => {
|
|
11
|
-
if (["button", "submit", "reset"].indexOf(type.value) !== -1 &&
|
|
12
|
-
disabled.value) {
|
|
13
|
-
return true;
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
return undefined;
|
|
17
|
-
});
|
|
18
|
-
|
|
19
|
-
return {
|
|
20
|
-
disabledLocal,
|
|
21
|
-
};
|
|
22
|
-
}
|
|
1
|
+
import {
|
|
2
|
+
computed,
|
|
3
|
+
toRef,
|
|
4
|
+
} from "vue";
|
|
5
|
+
|
|
6
|
+
export default function DisabledAPI(props) {
|
|
7
|
+
const type = toRef(props, "type");
|
|
8
|
+
const disabled = toRef(props, "disabled");
|
|
9
|
+
|
|
10
|
+
const disabledLocal = computed(() => {
|
|
11
|
+
if (["button", "submit", "reset"].indexOf(type.value) !== -1 &&
|
|
12
|
+
disabled.value) {
|
|
13
|
+
return true;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
return undefined;
|
|
17
|
+
});
|
|
18
|
+
|
|
19
|
+
return {
|
|
20
|
+
disabledLocal,
|
|
21
|
+
};
|
|
22
|
+
}
|
|
@@ -1,33 +1,33 @@
|
|
|
1
|
-
import {
|
|
2
|
-
computed,
|
|
3
|
-
ref,
|
|
4
|
-
toRef,
|
|
5
|
-
} from "vue";
|
|
6
|
-
|
|
7
|
-
export default function HtmlTitleAPI(props, {
|
|
8
|
-
tagLocal = computed(() => ""),
|
|
9
|
-
}) {
|
|
10
|
-
const isTitleHtml = toRef(props, "isTitleHtml");
|
|
11
|
-
const titleAttributes = toRef(props, "titleAttributes");
|
|
12
|
-
const titlePlacement = toRef(props, "titlePlacement");
|
|
13
|
-
|
|
14
|
-
const elementRef = ref(undefined);
|
|
15
|
-
|
|
16
|
-
const htmlTitleAttributes = computed(() => {
|
|
17
|
-
if (isTitleHtml.value) {
|
|
18
|
-
return {
|
|
19
|
-
tag: tagLocal.value,
|
|
20
|
-
placement: titlePlacement.value,
|
|
21
|
-
withoutAriaDescribedby: true,
|
|
22
|
-
...titleAttributes.value,
|
|
23
|
-
};
|
|
24
|
-
}
|
|
25
|
-
return {};
|
|
26
|
-
});
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
return {
|
|
30
|
-
elementRef,
|
|
31
|
-
htmlTitleAttributes,
|
|
32
|
-
};
|
|
33
|
-
}
|
|
1
|
+
import {
|
|
2
|
+
computed,
|
|
3
|
+
ref,
|
|
4
|
+
toRef,
|
|
5
|
+
} from "vue";
|
|
6
|
+
|
|
7
|
+
export default function HtmlTitleAPI(props, {
|
|
8
|
+
tagLocal = computed(() => ""),
|
|
9
|
+
}) {
|
|
10
|
+
const isTitleHtml = toRef(props, "isTitleHtml");
|
|
11
|
+
const titleAttributes = toRef(props, "titleAttributes");
|
|
12
|
+
const titlePlacement = toRef(props, "titlePlacement");
|
|
13
|
+
|
|
14
|
+
const elementRef = ref(undefined);
|
|
15
|
+
|
|
16
|
+
const htmlTitleAttributes = computed(() => {
|
|
17
|
+
if (isTitleHtml.value) {
|
|
18
|
+
return {
|
|
19
|
+
tag: tagLocal.value,
|
|
20
|
+
placement: titlePlacement.value,
|
|
21
|
+
withoutAriaDescribedby: true,
|
|
22
|
+
...titleAttributes.value,
|
|
23
|
+
};
|
|
24
|
+
}
|
|
25
|
+
return {};
|
|
26
|
+
});
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
return {
|
|
30
|
+
elementRef,
|
|
31
|
+
htmlTitleAttributes,
|
|
32
|
+
};
|
|
33
|
+
}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import {
|
|
2
|
+
toRef,
|
|
3
|
+
} from "vue";
|
|
4
|
+
|
|
5
|
+
import AKeysCode from "../../const/AKeysCode";
|
|
6
|
+
import {
|
|
7
|
+
isArray,
|
|
8
|
+
} from "lodash-es";
|
|
9
|
+
|
|
10
|
+
export default function KeydownAPI(props, { attrs }) {
|
|
11
|
+
const preventKeyboardRepeat = toRef(props, "preventKeyboardRepeat");
|
|
12
|
+
|
|
13
|
+
const onKeydown = $event => {
|
|
14
|
+
if (preventKeyboardRepeat.value &&
|
|
15
|
+
$event.repeat &&
|
|
16
|
+
($event.keyCode === AKeysCode.enter || $event.keyCode === AKeysCode.space)) {
|
|
17
|
+
$event.preventDefault();
|
|
18
|
+
$event.stopPropagation();
|
|
19
|
+
return;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
const onKeydownAttr = attrs.onKeydown;
|
|
23
|
+
|
|
24
|
+
if (isArray(onKeydownAttr)) {
|
|
25
|
+
onKeydownAttr.forEach(callback => callback?.($event));
|
|
26
|
+
return;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
onKeydownAttr?.($event);
|
|
30
|
+
};
|
|
31
|
+
|
|
32
|
+
return {
|
|
33
|
+
onKeydown,
|
|
34
|
+
};
|
|
35
|
+
}
|
|
@@ -1,22 +1,22 @@
|
|
|
1
|
-
import {
|
|
2
|
-
computed,
|
|
3
|
-
toRef,
|
|
4
|
-
} from "vue";
|
|
5
|
-
|
|
6
|
-
export default function LoadingAPI(props) {
|
|
7
|
-
const loading = toRef(props, "loading");
|
|
8
|
-
const loadingAlign = toRef(props, "loadingAlign");
|
|
9
|
-
|
|
10
|
-
const isLoadingLeft = computed(() => {
|
|
11
|
-
return loading.value && loadingAlign.value === "left";
|
|
12
|
-
});
|
|
13
|
-
|
|
14
|
-
const isLoadingRight = computed(() => {
|
|
15
|
-
return loading.value && loadingAlign.value === "right";
|
|
16
|
-
});
|
|
17
|
-
|
|
18
|
-
return {
|
|
19
|
-
isLoadingLeft,
|
|
20
|
-
isLoadingRight,
|
|
21
|
-
};
|
|
22
|
-
}
|
|
1
|
+
import {
|
|
2
|
+
computed,
|
|
3
|
+
toRef,
|
|
4
|
+
} from "vue";
|
|
5
|
+
|
|
6
|
+
export default function LoadingAPI(props) {
|
|
7
|
+
const loading = toRef(props, "loading");
|
|
8
|
+
const loadingAlign = toRef(props, "loadingAlign");
|
|
9
|
+
|
|
10
|
+
const isLoadingLeft = computed(() => {
|
|
11
|
+
return loading.value && loadingAlign.value === "left";
|
|
12
|
+
});
|
|
13
|
+
|
|
14
|
+
const isLoadingRight = computed(() => {
|
|
15
|
+
return loading.value && loadingAlign.value === "right";
|
|
16
|
+
});
|
|
17
|
+
|
|
18
|
+
return {
|
|
19
|
+
isLoadingLeft,
|
|
20
|
+
isLoadingRight,
|
|
21
|
+
};
|
|
22
|
+
}
|
|
@@ -1,20 +1,20 @@
|
|
|
1
|
-
import {
|
|
2
|
-
computed,
|
|
3
|
-
toRef,
|
|
4
|
-
} from "vue";
|
|
5
|
-
|
|
6
|
-
export default function RouterLinkAPI(props) {
|
|
7
|
-
const disabled = toRef(props, "disabled");
|
|
8
|
-
const to = toRef(props, "to");
|
|
9
|
-
const type = toRef(props, "type");
|
|
10
|
-
|
|
11
|
-
const isRouterLink = computed(() => {
|
|
12
|
-
return type.value === "link" &&
|
|
13
|
-
!!to.value &&
|
|
14
|
-
!disabled.value;
|
|
15
|
-
});
|
|
16
|
-
|
|
17
|
-
return {
|
|
18
|
-
isRouterLink,
|
|
19
|
-
};
|
|
20
|
-
}
|
|
1
|
+
import {
|
|
2
|
+
computed,
|
|
3
|
+
toRef,
|
|
4
|
+
} from "vue";
|
|
5
|
+
|
|
6
|
+
export default function RouterLinkAPI(props) {
|
|
7
|
+
const disabled = toRef(props, "disabled");
|
|
8
|
+
const to = toRef(props, "to");
|
|
9
|
+
const type = toRef(props, "type");
|
|
10
|
+
|
|
11
|
+
const isRouterLink = computed(() => {
|
|
12
|
+
return type.value === "link" &&
|
|
13
|
+
!!to.value &&
|
|
14
|
+
!disabled.value;
|
|
15
|
+
});
|
|
16
|
+
|
|
17
|
+
return {
|
|
18
|
+
isRouterLink,
|
|
19
|
+
};
|
|
20
|
+
}
|
|
@@ -1,33 +1,33 @@
|
|
|
1
|
-
import {
|
|
2
|
-
computed,
|
|
3
|
-
toRef,
|
|
4
|
-
} from "vue";
|
|
5
|
-
|
|
6
|
-
const SWITCH_CLASS = "a_btn a_btn_switch";
|
|
7
|
-
|
|
8
|
-
export default function SwitchAPI(props) {
|
|
9
|
-
const isSwitch = toRef(props, "isSwitch");
|
|
10
|
-
const modelSwitch = toRef(props, "modelSwitch");
|
|
11
|
-
|
|
12
|
-
const isSwitchActive = computed(() => {
|
|
13
|
-
if (isSwitch.value) {
|
|
14
|
-
return !!modelSwitch.value;
|
|
15
|
-
}
|
|
16
|
-
return undefined;
|
|
17
|
-
});
|
|
18
|
-
|
|
19
|
-
const switchClass = computed(() => {
|
|
20
|
-
if (isSwitch.value) {
|
|
21
|
-
if (modelSwitch.value) {
|
|
22
|
-
return `${ SWITCH_CLASS } a_btn_switch_active`;
|
|
23
|
-
}
|
|
24
|
-
return SWITCH_CLASS;
|
|
25
|
-
}
|
|
26
|
-
return undefined;
|
|
27
|
-
});
|
|
28
|
-
|
|
29
|
-
return {
|
|
30
|
-
isSwitchActive,
|
|
31
|
-
switchClass,
|
|
32
|
-
};
|
|
33
|
-
}
|
|
1
|
+
import {
|
|
2
|
+
computed,
|
|
3
|
+
toRef,
|
|
4
|
+
} from "vue";
|
|
5
|
+
|
|
6
|
+
const SWITCH_CLASS = "a_btn a_btn_switch";
|
|
7
|
+
|
|
8
|
+
export default function SwitchAPI(props) {
|
|
9
|
+
const isSwitch = toRef(props, "isSwitch");
|
|
10
|
+
const modelSwitch = toRef(props, "modelSwitch");
|
|
11
|
+
|
|
12
|
+
const isSwitchActive = computed(() => {
|
|
13
|
+
if (isSwitch.value) {
|
|
14
|
+
return !!modelSwitch.value;
|
|
15
|
+
}
|
|
16
|
+
return undefined;
|
|
17
|
+
});
|
|
18
|
+
|
|
19
|
+
const switchClass = computed(() => {
|
|
20
|
+
if (isSwitch.value) {
|
|
21
|
+
if (modelSwitch.value) {
|
|
22
|
+
return `${ SWITCH_CLASS } a_btn_switch_active`;
|
|
23
|
+
}
|
|
24
|
+
return SWITCH_CLASS;
|
|
25
|
+
}
|
|
26
|
+
return undefined;
|
|
27
|
+
});
|
|
28
|
+
|
|
29
|
+
return {
|
|
30
|
+
isSwitchActive,
|
|
31
|
+
switchClass,
|
|
32
|
+
};
|
|
33
|
+
}
|
|
@@ -1,34 +1,34 @@
|
|
|
1
|
-
import {
|
|
2
|
-
computed,
|
|
3
|
-
resolveComponent,
|
|
4
|
-
toRef,
|
|
5
|
-
} from "vue";
|
|
6
|
-
|
|
7
|
-
const TYPES_TAGS_MAP = {
|
|
8
|
-
button: "button",
|
|
9
|
-
submit: "button",
|
|
10
|
-
reset: "button",
|
|
11
|
-
link: "a",
|
|
12
|
-
text: "span",
|
|
13
|
-
};
|
|
14
|
-
|
|
15
|
-
export default function TagAPI(props, {
|
|
16
|
-
isRouterLink = computed(() => false),
|
|
17
|
-
}) {
|
|
18
|
-
const tag = toRef(props, "tag");
|
|
19
|
-
const type = toRef(props, "type");
|
|
20
|
-
|
|
21
|
-
const tagLocal = computed(() => {
|
|
22
|
-
if (tag.value) {
|
|
23
|
-
return tag.value;
|
|
24
|
-
}
|
|
25
|
-
if (isRouterLink.value) {
|
|
26
|
-
return resolveComponent("RouterLink");
|
|
27
|
-
}
|
|
28
|
-
return TYPES_TAGS_MAP[type.value] || "span";
|
|
29
|
-
});
|
|
30
|
-
|
|
31
|
-
return {
|
|
32
|
-
tagLocal,
|
|
33
|
-
};
|
|
34
|
-
}
|
|
1
|
+
import {
|
|
2
|
+
computed,
|
|
3
|
+
resolveComponent,
|
|
4
|
+
toRef,
|
|
5
|
+
} from "vue";
|
|
6
|
+
|
|
7
|
+
const TYPES_TAGS_MAP = {
|
|
8
|
+
button: "button",
|
|
9
|
+
submit: "button",
|
|
10
|
+
reset: "button",
|
|
11
|
+
link: "a",
|
|
12
|
+
text: "span",
|
|
13
|
+
};
|
|
14
|
+
|
|
15
|
+
export default function TagAPI(props, {
|
|
16
|
+
isRouterLink = computed(() => false),
|
|
17
|
+
}) {
|
|
18
|
+
const tag = toRef(props, "tag");
|
|
19
|
+
const type = toRef(props, "type");
|
|
20
|
+
|
|
21
|
+
const tagLocal = computed(() => {
|
|
22
|
+
if (tag.value) {
|
|
23
|
+
return tag.value;
|
|
24
|
+
}
|
|
25
|
+
if (isRouterLink.value) {
|
|
26
|
+
return resolveComponent("RouterLink");
|
|
27
|
+
}
|
|
28
|
+
return TYPES_TAGS_MAP[type.value] || "span";
|
|
29
|
+
});
|
|
30
|
+
|
|
31
|
+
return {
|
|
32
|
+
tagLocal,
|
|
33
|
+
};
|
|
34
|
+
}
|