@toife/vue 3.3.3 → 3.3.6
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/dist/components/action/action.composable.d.ts +44 -0
- package/dist/components/action/action.vue.d.ts +16 -0
- package/dist/components/action/index.d.ts +2 -0
- package/dist/components/app/app.vue.d.ts +11 -0
- package/dist/components/app/index.d.ts +1 -0
- package/dist/components/avatar/avatar.vue.d.ts +8 -0
- package/dist/components/avatar/index.d.ts +1 -0
- package/dist/components/button/button.vue.d.ts +9 -0
- package/dist/components/button/index.d.ts +1 -0
- package/dist/components/cable/cable.vue.d.ts +6 -0
- package/dist/components/cable/index.d.ts +1 -0
- package/dist/components/card/card/card.vue.d.ts +7 -0
- package/dist/components/card/card/index.d.ts +1 -0
- package/dist/components/card/card-body/card-body.vue.d.ts +2 -0
- package/dist/components/card/card-body/index.d.ts +1 -0
- package/dist/components/card/card-footer/card-footer.vue.d.ts +2 -0
- package/dist/components/card/card-footer/index.d.ts +1 -0
- package/dist/components/card/card-header/card-header.vue.d.ts +2 -0
- package/dist/components/card/card-header/index.d.ts +1 -0
- package/dist/components/card/index.d.ts +4 -0
- package/dist/components/checkbox/checkbox.vue.d.ts +18 -0
- package/dist/components/checkbox/index.d.ts +1 -0
- package/dist/components/collapse/collapse.vue.d.ts +12 -0
- package/dist/components/collapse/index.d.ts +1 -0
- package/dist/components/container/container.vue.d.ts +2 -0
- package/dist/components/container/index.d.ts +1 -0
- package/dist/components/decision-modal/decision-modal.composable.d.ts +48 -0
- package/dist/components/decision-modal/decision-modal.vue.d.ts +17 -0
- package/dist/components/decision-modal/index.d.ts +2 -0
- package/dist/components/divider/divider.vue.d.ts +5 -0
- package/dist/components/divider/index.d.ts +1 -0
- package/dist/components/dropdown/dropdown.vue.d.ts +20 -0
- package/dist/components/dropdown/index.d.ts +1 -0
- package/dist/components/field/field.vue.d.ts +30 -0
- package/dist/components/field/index.d.ts +1 -0
- package/dist/components/form-group/form-group.vue.d.ts +5 -0
- package/dist/components/form-group/index.d.ts +1 -0
- package/dist/components/gesture-indicator/gesture-indicator.vue.d.ts +6 -0
- package/dist/components/gesture-indicator/index.d.ts +1 -0
- package/dist/components/image/image.vue.d.ts +3 -0
- package/dist/components/image/index.d.ts +1 -0
- package/dist/components/index.d.ts +33 -0
- package/dist/components/layout/flex/flex.vue.d.ts +5 -0
- package/dist/components/layout/flex/index.d.ts +1 -0
- package/dist/components/layout/flex-item/flex-item.vue.d.ts +5 -0
- package/dist/components/layout/flex-item/index.d.ts +1 -0
- package/dist/components/layout/grid/grid.vue.d.ts +5 -0
- package/dist/components/layout/grid/index.d.ts +1 -0
- package/dist/components/layout/grid-item/grid-item.vue.d.ts +5 -0
- package/dist/components/layout/grid-item/index.d.ts +1 -0
- package/dist/components/layout/index.d.ts +4 -0
- package/dist/components/modal/index.d.ts +1 -0
- package/dist/components/modal/modal.vue.d.ts +17 -0
- package/dist/components/page/index.d.ts +1 -0
- package/dist/components/page/page.vue.d.ts +2 -0
- package/dist/components/present/index.d.ts +2 -0
- package/dist/components/present/present.composable.d.ts +5 -0
- package/dist/components/present/present.vue.d.ts +18 -0
- package/dist/components/radio/index.d.ts +2 -0
- package/dist/components/radio/radio/index.d.ts +1 -0
- package/dist/components/radio/radio/radio.vue.d.ts +7 -0
- package/dist/components/radio/radio-group/index.d.ts +1 -0
- package/dist/components/radio/radio-group/radio-group.vue.d.ts +13 -0
- package/dist/components/refresher/index.d.ts +1 -0
- package/dist/components/refresher/refresher.vue.d.ts +12 -0
- package/dist/components/route/index.d.ts +5 -0
- package/dist/components/route/route-navigator/index.d.ts +1 -0
- package/dist/components/route/route-navigator/route-navigator.vue.d.ts +12 -0
- package/dist/components/route/route-outlet/index.d.ts +1 -0
- package/dist/components/route/route-outlet/route-outlet.vue.d.ts +5 -0
- package/dist/components/route/route-provider/index.d.ts +1 -0
- package/dist/components/route/route-provider/route-provider.vue.d.ts +3 -0
- package/dist/components/route/route-wrapper/index.d.ts +2 -0
- package/dist/components/route/route-wrapper/route-wrapper.composable.d.ts +6 -0
- package/dist/components/route/route-wrapper/route-wrapper.vue.d.ts +5 -0
- package/dist/components/route/route.util.d.ts +3 -0
- package/dist/components/segmented-field/index.d.ts +1 -0
- package/dist/components/segmented-field/segmented-field.vue.d.ts +28 -0
- package/dist/components/select/index.d.ts +1 -0
- package/dist/components/select/select.vue.d.ts +19 -0
- package/dist/components/skeleton/index.d.ts +1 -0
- package/dist/components/skeleton/skeleton.vue.d.ts +6 -0
- package/dist/components/slide-range/index.d.ts +1 -0
- package/dist/components/slide-range/slide-range.vue.d.ts +18 -0
- package/dist/components/switch/index.d.ts +1 -0
- package/dist/components/switch/switch.vue.d.ts +13 -0
- package/dist/components/tabs/index.d.ts +2 -0
- package/dist/components/tabs/tab/index.d.ts +1 -0
- package/dist/components/tabs/tab/tab.vue.d.ts +5 -0
- package/dist/components/tabs/tabs/index.d.ts +1 -0
- package/dist/components/tabs/tabs/tabs.vue.d.ts +14 -0
- package/dist/components/tag/index.d.ts +1 -0
- package/dist/components/tag/tag.vue.d.ts +6 -0
- package/dist/components/toast/index.d.ts +3 -0
- package/dist/components/toast/toast/index.d.ts +1 -0
- package/dist/components/toast/toast/toast.vue.d.ts +5 -0
- package/dist/components/toast/toast-content/index.d.ts +1 -0
- package/dist/components/toast/toast-content/toast-content.vue.d.ts +11 -0
- package/dist/components/toast/toast.composable.d.ts +22 -0
- package/dist/components/toolbar/index.d.ts +1 -0
- package/dist/components/toolbar/toolbar.vue.d.ts +7 -0
- package/dist/components/tooltip/index.d.ts +1 -0
- package/dist/components/tooltip/tooltip.vue.d.ts +7 -0
- package/dist/factory.d.ts +38 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.es.js +3611 -0
- package/dist/index.umd.js +1 -0
- package/dist/shared/provider-state.d.ts +5 -0
- package/dist/styles/action.css +1 -0
- package/dist/styles/app.css +1 -0
- package/dist/styles/avatar.css +1 -0
- package/dist/styles/button.css +1 -0
- package/dist/styles/cable.css +1 -0
- package/dist/styles/card-body.css +1 -0
- package/dist/styles/card-footer.css +1 -0
- package/dist/styles/card-header.css +1 -0
- package/dist/styles/card.css +1 -0
- package/dist/styles/checkbox.css +1 -0
- package/dist/styles/collapse.css +1 -0
- package/dist/styles/container.css +1 -0
- package/dist/styles/decision-modal.css +1 -0
- package/dist/styles/divider.css +1 -0
- package/dist/styles/dropdown.css +1 -0
- package/dist/styles/field.css +1 -0
- package/dist/styles/flex-item.css +1 -0
- package/dist/styles/flex.css +1 -0
- package/dist/styles/form-group.css +1 -0
- package/dist/styles/gesture-indicator.css +1 -0
- package/dist/styles/grid-item.css +1 -0
- package/dist/styles/grid.css +1 -0
- package/dist/styles/index.css +41 -0
- package/dist/styles/modal.css +1 -0
- package/dist/styles/page.css +1 -0
- package/dist/styles/present.css +1 -0
- package/dist/styles/radio-group.css +1 -0
- package/dist/styles/radio.css +1 -0
- package/dist/styles/refresher.css +1 -0
- package/dist/styles/route-navigator.css +1 -0
- package/dist/styles/segmented-field.css +1 -0
- package/dist/styles/select.css +1 -0
- package/dist/styles/skeleton.css +1 -0
- package/dist/styles/slide-range.css +1 -0
- package/dist/styles/switch.css +1 -0
- package/dist/styles/tab.css +1 -0
- package/dist/styles/tabs.css +1 -0
- package/dist/styles/tag.css +1 -0
- package/dist/styles/toast-content.css +1 -0
- package/dist/styles/toast.css +1 -0
- package/dist/styles/toolbar.css +1 -0
- package/dist/styles/tooltip.css +1 -0
- package/dist/types.d.ts +4 -0
- package/package.json +22 -26
- package/src/components/action/action.composable.ts +0 -32
- package/src/components/action/action.html +0 -25
- package/src/components/action/action.vue +0 -69
- package/src/components/action/index.ts +0 -2
- package/src/components/app/app.html +0 -24
- package/src/components/app/app.vue +0 -45
- package/src/components/app/index.ts +0 -1
- package/src/components/avatar/avatar.html +0 -3
- package/src/components/avatar/avatar.vue +0 -35
- package/src/components/avatar/index.ts +0 -1
- package/src/components/button/button.html +0 -6
- package/src/components/button/button.vue +0 -54
- package/src/components/button/index.ts +0 -1
- package/src/components/cable/cable.html +0 -3
- package/src/components/cable/cable.vue +0 -33
- package/src/components/cable/index.ts +0 -1
- package/src/components/card/card/card.html +0 -3
- package/src/components/card/card/card.vue +0 -52
- package/src/components/card/card/index.ts +0 -1
- package/src/components/card/card-body/card-body.html +0 -3
- package/src/components/card/card-body/card-body.vue +0 -6
- package/src/components/card/card-body/index.ts +0 -1
- package/src/components/card/card-footer/card-footer.html +0 -3
- package/src/components/card/card-footer/card-footer.vue +0 -18
- package/src/components/card/card-footer/index.ts +0 -1
- package/src/components/card/card-header/card-header.html +0 -3
- package/src/components/card/card-header/card-header.vue +0 -18
- package/src/components/card/card-header/index.ts +0 -1
- package/src/components/card/index.ts +0 -4
- package/src/components/checkbox/checkbox.html +0 -12
- package/src/components/checkbox/checkbox.vue +0 -74
- package/src/components/checkbox/index.ts +0 -1
- package/src/components/collapse/collapse.html +0 -16
- package/src/components/collapse/collapse.vue +0 -126
- package/src/components/collapse/index.ts +0 -1
- package/src/components/container/container.html +0 -1
- package/src/components/container/container.vue +0 -7
- package/src/components/container/index.ts +0 -1
- package/src/components/decision-modal/decision-modal.composable.ts +0 -33
- package/src/components/decision-modal/decision-modal.html +0 -29
- package/src/components/decision-modal/decision-modal.vue +0 -76
- package/src/components/decision-modal/index.ts +0 -2
- package/src/components/divider/divider.html +0 -1
- package/src/components/divider/divider.vue +0 -26
- package/src/components/divider/index.ts +0 -1
- package/src/components/dropdown/dropdown.html +0 -6
- package/src/components/dropdown/dropdown.vue +0 -101
- package/src/components/dropdown/index.ts +0 -1
- package/src/components/field/field.html +0 -30
- package/src/components/field/field.vue +0 -121
- package/src/components/field/index.ts +0 -1
- package/src/components/form-group/form-group.html +0 -3
- package/src/components/form-group/form-group.vue +0 -15
- package/src/components/form-group/index.ts +0 -1
- package/src/components/gesture-indicator/gesture-indicator.html +0 -1
- package/src/components/gesture-indicator/gesture-indicator.vue +0 -32
- package/src/components/gesture-indicator/index.ts +0 -1
- package/src/components/image/image.html +0 -1
- package/src/components/image/image.vue +0 -32
- package/src/components/image/index.ts +0 -1
- package/src/components/index.ts +0 -33
- package/src/components/layout/flex/flex.html +0 -1
- package/src/components/layout/flex/flex.vue +0 -15
- package/src/components/layout/flex/index.ts +0 -1
- package/src/components/layout/flex-item/flex-item.html +0 -1
- package/src/components/layout/flex-item/flex-item.vue +0 -11
- package/src/components/layout/flex-item/index.ts +0 -1
- package/src/components/layout/grid/grid.html +0 -1
- package/src/components/layout/grid/grid.vue +0 -15
- package/src/components/layout/grid/index.ts +0 -1
- package/src/components/layout/grid-item/grid-item.html +0 -1
- package/src/components/layout/grid-item/grid-item.vue +0 -11
- package/src/components/layout/grid-item/index.ts +0 -1
- package/src/components/layout/index.ts +0 -4
- package/src/components/modal/index.ts +0 -1
- package/src/components/modal/modal.html +0 -21
- package/src/components/modal/modal.vue +0 -248
- package/src/components/page/index.ts +0 -1
- package/src/components/page/page.html +0 -3
- package/src/components/page/page.vue +0 -7
- package/src/components/present/index.ts +0 -2
- package/src/components/present/present.composable.ts +0 -22
- package/src/components/present/present.html +0 -11
- package/src/components/present/present.vue +0 -234
- package/src/components/radio/index.ts +0 -2
- package/src/components/radio/radio/index.ts +0 -1
- package/src/components/radio/radio/radio.html +0 -11
- package/src/components/radio/radio/radio.vue +0 -86
- package/src/components/radio/radio-group/index.ts +0 -1
- package/src/components/radio/radio-group/radio-group.html +0 -3
- package/src/components/radio/radio-group/radio-group.vue +0 -64
- package/src/components/refresher/index.ts +0 -1
- package/src/components/refresher/refresher.html +0 -3
- package/src/components/refresher/refresher.vue +0 -100
- package/src/components/route/index.ts +0 -5
- package/src/components/route/route-navigator/index.ts +0 -1
- package/src/components/route/route-navigator/route-navigator.html +0 -19
- package/src/components/route/route-navigator/route-navigator.vue +0 -254
- package/src/components/route/route-outlet/index.ts +0 -1
- package/src/components/route/route-outlet/route-outlet.html +0 -1
- package/src/components/route/route-outlet/route-outlet.vue +0 -39
- package/src/components/route/route-provider/index.ts +0 -1
- package/src/components/route/route-provider/route-provider.html +0 -1
- package/src/components/route/route-provider/route-provider.vue +0 -24
- package/src/components/route/route-wrapper/index.ts +0 -2
- package/src/components/route/route-wrapper/route-wrapper.composable.ts +0 -49
- package/src/components/route/route-wrapper/route-wrapper.html +0 -3
- package/src/components/route/route-wrapper/route-wrapper.vue +0 -44
- package/src/components/route/route.util.ts +0 -9
- package/src/components/segmented-field/index.ts +0 -1
- package/src/components/segmented-field/segmented-field.html +0 -16
- package/src/components/segmented-field/segmented-field.vue +0 -243
- package/src/components/select/index.ts +0 -1
- package/src/components/select/select.html +0 -28
- package/src/components/select/select.vue +0 -101
- package/src/components/skeleton/index.ts +0 -1
- package/src/components/skeleton/skeleton.html +0 -1
- package/src/components/skeleton/skeleton.vue +0 -33
- package/src/components/slide-range/index.ts +0 -1
- package/src/components/slide-range/slide-range.html +0 -20
- package/src/components/slide-range/slide-range.vue +0 -269
- package/src/components/switch/index.ts +0 -1
- package/src/components/switch/switch.html +0 -14
- package/src/components/switch/switch.vue +0 -86
- package/src/components/tabs/index.ts +0 -2
- package/src/components/tabs/tab/index.ts +0 -1
- package/src/components/tabs/tab/tab.html +0 -5
- package/src/components/tabs/tab/tab.vue +0 -34
- package/src/components/tabs/tabs/index.ts +0 -1
- package/src/components/tabs/tabs/tabs.html +0 -3
- package/src/components/tabs/tabs/tabs.vue +0 -151
- package/src/components/tag/index.ts +0 -1
- package/src/components/tag/tag.html +0 -1
- package/src/components/tag/tag.vue +0 -33
- package/src/components/toast/index.ts +0 -3
- package/src/components/toast/toast/index.ts +0 -1
- package/src/components/toast/toast/toast.html +0 -9
- package/src/components/toast/toast/toast.vue +0 -28
- package/src/components/toast/toast-content/index.ts +0 -1
- package/src/components/toast/toast-content/toast-content.html +0 -1
- package/src/components/toast/toast-content/toast-content.vue +0 -51
- package/src/components/toast/toast.composable.ts +0 -22
- package/src/components/toolbar/index.ts +0 -1
- package/src/components/toolbar/toolbar.html +0 -3
- package/src/components/toolbar/toolbar.vue +0 -39
- package/src/components/tooltip/index.ts +0 -1
- package/src/components/tooltip/tooltip.html +0 -15
- package/src/components/tooltip/tooltip.vue +0 -63
- package/src/env.d.ts +0 -7
- package/src/factory.ts +0 -164
- package/src/index.ts +0 -4
- package/src/shared/provider-state.ts +0 -8
- package/src/types.ts +0 -4
|
@@ -1,74 +0,0 @@
|
|
|
1
|
-
<style lang="scss" src="@toife/core/features/checkbox/checkbox.scss" scoped></style>
|
|
2
|
-
<template src="./checkbox.html"></template>
|
|
3
|
-
<script lang="ts" setup>
|
|
4
|
-
import { unref, computed, inject, ref } from "vue";
|
|
5
|
-
import {
|
|
6
|
-
CHECKBOX_DEFAULT_PROPS,
|
|
7
|
-
APP_PROVIDER_STATE_KEY,
|
|
8
|
-
getCheckboxAttrs,
|
|
9
|
-
getCheckboxIconAttrs,
|
|
10
|
-
type AppProviderState,
|
|
11
|
-
type CheckboxEvent,
|
|
12
|
-
type CheckboxProps,
|
|
13
|
-
} from "@toife/core";
|
|
14
|
-
import type { ProviderStateRefs } from "../../shared/provider-state";
|
|
15
|
-
|
|
16
|
-
// Component setup (props, emits, injects)
|
|
17
|
-
// ----------------------------------------------------------------------------
|
|
18
|
-
const props = withDefaults(defineProps<CheckboxProps>(), {
|
|
19
|
-
...CHECKBOX_DEFAULT_PROPS,
|
|
20
|
-
});
|
|
21
|
-
const emit = defineEmits<CheckboxEvent>();
|
|
22
|
-
const appState = inject<ProviderStateRefs<AppProviderState>>(APP_PROVIDER_STATE_KEY);
|
|
23
|
-
|
|
24
|
-
// Reactive state
|
|
25
|
-
// ----------------------------------------------------------------------------
|
|
26
|
-
const isFocused = ref(false);
|
|
27
|
-
|
|
28
|
-
// Computed properties
|
|
29
|
-
// ----------------------------------------------------------------------------
|
|
30
|
-
const checkboxAttrs = computed(() => {
|
|
31
|
-
const baseRole = unref(appState?.role) || "";
|
|
32
|
-
const role = props.role || baseRole;
|
|
33
|
-
const shape = props.shape || unref(appState?.shape) || "";
|
|
34
|
-
const shadow = (props?.shadow !== undefined ? props.shadow : unref(appState?.shadow)) ?? false;
|
|
35
|
-
return getCheckboxAttrs({
|
|
36
|
-
role,
|
|
37
|
-
shape,
|
|
38
|
-
size: props.size,
|
|
39
|
-
variant: props.variant,
|
|
40
|
-
modelValue: props.modelValue,
|
|
41
|
-
disabled: props.disabled,
|
|
42
|
-
readonly: props.readonly,
|
|
43
|
-
shadow: shadow && !props.disabled && isFocused.value,
|
|
44
|
-
focus: isFocused.value,
|
|
45
|
-
});
|
|
46
|
-
});
|
|
47
|
-
|
|
48
|
-
const checkboxIconAttrs = getCheckboxIconAttrs();
|
|
49
|
-
|
|
50
|
-
// Methods
|
|
51
|
-
// ----------------------------------------------------------------------------
|
|
52
|
-
const onCheckbox = () => {
|
|
53
|
-
if (props.disabled || props.readonly) return;
|
|
54
|
-
emit("update:modelValue", !props.modelValue);
|
|
55
|
-
};
|
|
56
|
-
|
|
57
|
-
const onFocus = () => {
|
|
58
|
-
if (props.disabled || props.readonly) return;
|
|
59
|
-
isFocused.value = true;
|
|
60
|
-
emit("focus");
|
|
61
|
-
};
|
|
62
|
-
|
|
63
|
-
const onBlur = () => {
|
|
64
|
-
if (props.disabled || props.readonly) return;
|
|
65
|
-
isFocused.value = false;
|
|
66
|
-
emit("blur");
|
|
67
|
-
};
|
|
68
|
-
|
|
69
|
-
const onKeydown = (e: KeyboardEvent) => {
|
|
70
|
-
if (e.key !== " " && e.key !== "Enter") return;
|
|
71
|
-
e.preventDefault();
|
|
72
|
-
onCheckbox();
|
|
73
|
-
};
|
|
74
|
-
</script>
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { default as Checkbox } from "./checkbox.vue";
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
<div v-bind="wrapperAttrs">
|
|
2
|
-
<div
|
|
3
|
-
v-bind="triggerAttrs"
|
|
4
|
-
role="button"
|
|
5
|
-
tabindex="0"
|
|
6
|
-
@pointerup="toggle"
|
|
7
|
-
@keydown.enter.space.prevent="toggle"
|
|
8
|
-
>
|
|
9
|
-
<slot name="trigger" />
|
|
10
|
-
</div>
|
|
11
|
-
<div v-bind="contentAttrs" @transitionend="onTransitionEnd">
|
|
12
|
-
<div ref="contentRef" :class="contentInnerClass">
|
|
13
|
-
<slot />
|
|
14
|
-
</div>
|
|
15
|
-
</div>
|
|
16
|
-
</div>
|
|
@@ -1,126 +0,0 @@
|
|
|
1
|
-
<style lang="scss" src="@toife/core/features/collapse/collapse.scss" scoped></style>
|
|
2
|
-
<template src="./collapse.html"></template>
|
|
3
|
-
<script lang="ts" setup>
|
|
4
|
-
import { unref, computed, inject, nextTick, onMounted, ref, watch } from "vue";
|
|
5
|
-
import {
|
|
6
|
-
COLLAPSE_DEFAULT_PROPS,
|
|
7
|
-
APP_PROVIDER_STATE_KEY,
|
|
8
|
-
getCollapseAttrs,
|
|
9
|
-
getCollapseContentAttrs,
|
|
10
|
-
getCollapseContentInnerClass,
|
|
11
|
-
getCollapseTriggerAttrs,
|
|
12
|
-
type AppProviderState,
|
|
13
|
-
type CollapseEvent,
|
|
14
|
-
type CollapseProps,
|
|
15
|
-
} from "@toife/core";
|
|
16
|
-
import type { ProviderStateRefs } from "../../shared/provider-state";
|
|
17
|
-
|
|
18
|
-
// Component setup (props, emits, injects)
|
|
19
|
-
// ----------------------------------------------------------------------------
|
|
20
|
-
const props = withDefaults(defineProps<CollapseProps>(), {
|
|
21
|
-
...COLLAPSE_DEFAULT_PROPS,
|
|
22
|
-
});
|
|
23
|
-
const emit = defineEmits<CollapseEvent>();
|
|
24
|
-
const appState = inject<ProviderStateRefs<AppProviderState>>(APP_PROVIDER_STATE_KEY);
|
|
25
|
-
|
|
26
|
-
// Reactive state
|
|
27
|
-
// ----------------------------------------------------------------------------
|
|
28
|
-
const contentRef = ref<HTMLElement | null>(null);
|
|
29
|
-
const contentHeight = ref(0);
|
|
30
|
-
const isOpen = ref(false);
|
|
31
|
-
const isFirstOpen = ref(true);
|
|
32
|
-
|
|
33
|
-
// Computed properties
|
|
34
|
-
// ----------------------------------------------------------------------------
|
|
35
|
-
const role = computed(() => {
|
|
36
|
-
return props.role ?? unref(appState?.role) ?? "";
|
|
37
|
-
});
|
|
38
|
-
|
|
39
|
-
const durationCss = computed(() =>
|
|
40
|
-
props.duration !== undefined ? `${props.duration / 1000}s` : undefined
|
|
41
|
-
);
|
|
42
|
-
|
|
43
|
-
const wrapperAttrs = computed(() =>
|
|
44
|
-
getCollapseAttrs({
|
|
45
|
-
role: role.value,
|
|
46
|
-
open: isOpen.value,
|
|
47
|
-
disabled: props.disabled,
|
|
48
|
-
})
|
|
49
|
-
);
|
|
50
|
-
|
|
51
|
-
const triggerAttrs = computed(() =>
|
|
52
|
-
getCollapseTriggerAttrs({
|
|
53
|
-
open: isOpen.value,
|
|
54
|
-
disabled: props.disabled,
|
|
55
|
-
})
|
|
56
|
-
);
|
|
57
|
-
|
|
58
|
-
const contentAttrs = computed(() =>
|
|
59
|
-
getCollapseContentAttrs({
|
|
60
|
-
transition: !isFirstOpen.value,
|
|
61
|
-
duration: durationCss.value,
|
|
62
|
-
height: isOpen.value ? `${contentHeight.value}px` : "0px",
|
|
63
|
-
})
|
|
64
|
-
);
|
|
65
|
-
|
|
66
|
-
const contentInnerClass = computed(() => getCollapseContentInnerClass());
|
|
67
|
-
|
|
68
|
-
// Methods
|
|
69
|
-
// ----------------------------------------------------------------------------
|
|
70
|
-
const measureContent = () => {
|
|
71
|
-
if (contentRef.value) {
|
|
72
|
-
contentHeight.value = contentRef.value.scrollHeight;
|
|
73
|
-
}
|
|
74
|
-
};
|
|
75
|
-
|
|
76
|
-
const toggle = () => {
|
|
77
|
-
if (props.disabled) return;
|
|
78
|
-
isOpen.value = !isOpen.value;
|
|
79
|
-
emit("update:modelValue", isOpen.value);
|
|
80
|
-
};
|
|
81
|
-
|
|
82
|
-
const onTransitionEnd = () => {
|
|
83
|
-
// Optional: hook for transition end (e.g. a11y)
|
|
84
|
-
};
|
|
85
|
-
|
|
86
|
-
// Lifecycle
|
|
87
|
-
// ----------------------------------------------------------------------------
|
|
88
|
-
watch(
|
|
89
|
-
() => props.modelValue,
|
|
90
|
-
async (open) => {
|
|
91
|
-
isOpen.value = open;
|
|
92
|
-
if (open) {
|
|
93
|
-
await nextTick();
|
|
94
|
-
measureContent();
|
|
95
|
-
isFirstOpen.value = false;
|
|
96
|
-
}
|
|
97
|
-
},
|
|
98
|
-
{ immediate: true }
|
|
99
|
-
);
|
|
100
|
-
|
|
101
|
-
watch(
|
|
102
|
-
() => contentRef.value,
|
|
103
|
-
(el) => {
|
|
104
|
-
if (el && isOpen.value) {
|
|
105
|
-
measureContent();
|
|
106
|
-
}
|
|
107
|
-
}
|
|
108
|
-
);
|
|
109
|
-
|
|
110
|
-
watch(
|
|
111
|
-
() => [contentRef.value?.innerHTML, isOpen.value],
|
|
112
|
-
async () => {
|
|
113
|
-
if (isOpen.value) {
|
|
114
|
-
await nextTick();
|
|
115
|
-
measureContent();
|
|
116
|
-
}
|
|
117
|
-
}
|
|
118
|
-
);
|
|
119
|
-
|
|
120
|
-
onMounted(async () => {
|
|
121
|
-
await nextTick();
|
|
122
|
-
if (isOpen.value) {
|
|
123
|
-
measureContent();
|
|
124
|
-
}
|
|
125
|
-
});
|
|
126
|
-
</script>
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { default as Collapse } from "./collapse.vue";
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
<div v-bind="containerAttrs"><slot /></div>
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
<style lang="scss" src="@toife/core/features/container/container.scss" scoped></style>
|
|
2
|
-
<template src="./container.html"></template>
|
|
3
|
-
<script lang="ts" setup>
|
|
4
|
-
import { getContainerAttrs } from "@toife/core";
|
|
5
|
-
// Static layout wrapper classes
|
|
6
|
-
const containerAttrs = getContainerAttrs();
|
|
7
|
-
</script>
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { default as Container } from "./container.vue";
|
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
import { ref } from "vue";
|
|
2
|
-
import { type DecisionModalButton, type DecisionModalComposableProps } from "@toife/core";
|
|
3
|
-
|
|
4
|
-
const data = ref<DecisionModalComposableProps | null>(null);
|
|
5
|
-
const visible = ref(false);
|
|
6
|
-
|
|
7
|
-
export const useDecisionModal = () => {
|
|
8
|
-
const open = (props: DecisionModalComposableProps) => {
|
|
9
|
-
data.value = props;
|
|
10
|
-
// Defer visibility so the modal mounts with props before entering the open transition
|
|
11
|
-
setTimeout(() => {
|
|
12
|
-
visible.value = true;
|
|
13
|
-
}, 50);
|
|
14
|
-
};
|
|
15
|
-
|
|
16
|
-
const close = (type?: string) => {
|
|
17
|
-
data.value?.onClose?.();
|
|
18
|
-
visible.value = false;
|
|
19
|
-
};
|
|
20
|
-
|
|
21
|
-
const choose = (btn: DecisionModalButton) => {
|
|
22
|
-
data.value?.onChoose?.(btn);
|
|
23
|
-
visible.value = false;
|
|
24
|
-
};
|
|
25
|
-
|
|
26
|
-
return {
|
|
27
|
-
open,
|
|
28
|
-
close,
|
|
29
|
-
choose,
|
|
30
|
-
visible,
|
|
31
|
-
data,
|
|
32
|
-
};
|
|
33
|
-
};
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
<Present
|
|
2
|
-
:placement="placement"
|
|
3
|
-
backdrop="display"
|
|
4
|
-
:keepalive="keepalive"
|
|
5
|
-
:visible="visible"
|
|
6
|
-
@close="onClose"
|
|
7
|
-
>
|
|
8
|
-
<div v-bind="decisionModalAttrs">
|
|
9
|
-
<slot name="header">
|
|
10
|
-
<div v-bind="decisionModalHeaderAttrs" v-if="title">{{ title }}</div>
|
|
11
|
-
</slot>
|
|
12
|
-
<slot name="body">
|
|
13
|
-
<div v-bind="decisionModalBodyAttrs">{{ message }}</div>
|
|
14
|
-
</slot>
|
|
15
|
-
<slot name="footer">
|
|
16
|
-
<div v-bind="decisionModalFooterAttrs">
|
|
17
|
-
<CustomButton
|
|
18
|
-
v-for="(btn, btnIndex) in actions"
|
|
19
|
-
:key="`${btnIndex}`"
|
|
20
|
-
:role="btn.role"
|
|
21
|
-
:variant="btn.variant"
|
|
22
|
-
@click="onChoose(btn)"
|
|
23
|
-
:shape="shape"
|
|
24
|
-
>{{ btn.text }}</CustomButton
|
|
25
|
-
>
|
|
26
|
-
</div>
|
|
27
|
-
</slot>
|
|
28
|
-
</div>
|
|
29
|
-
</Present>
|
|
@@ -1,76 +0,0 @@
|
|
|
1
|
-
<style lang="scss" src="@toife/core/features/decision-modal/decision-modal.scss" scoped></style>
|
|
2
|
-
<template src="./decision-modal.html"></template>
|
|
3
|
-
<script lang="ts" setup>
|
|
4
|
-
import { unref, computed, inject, ref } from "vue";
|
|
5
|
-
import { Present } from "../present";
|
|
6
|
-
import { Button as CustomButton } from "../button";
|
|
7
|
-
import {
|
|
8
|
-
DECISION_MODAL_DEFAULT_PROPS,
|
|
9
|
-
APP_PROVIDER_STATE_KEY,
|
|
10
|
-
getDecisionModalAttrs,
|
|
11
|
-
getDecisionModalBodyAttrs,
|
|
12
|
-
getDecisionModalFooterAttrs,
|
|
13
|
-
getDecisionModalHeaderAttrs,
|
|
14
|
-
type DecisionModalButton,
|
|
15
|
-
type AppProviderState,
|
|
16
|
-
type DecisionModalEvent,
|
|
17
|
-
type DecisionModalProps,
|
|
18
|
-
} from "@toife/core";
|
|
19
|
-
import type { ProviderStateRefs } from "../../shared/provider-state";
|
|
20
|
-
|
|
21
|
-
// Component setup (props, emits, injects)
|
|
22
|
-
// ----------------------------------------------------------------------------
|
|
23
|
-
const props = withDefaults(defineProps<DecisionModalProps>(), {
|
|
24
|
-
...DECISION_MODAL_DEFAULT_PROPS,
|
|
25
|
-
});
|
|
26
|
-
const emit = defineEmits<DecisionModalEvent>();
|
|
27
|
-
const appState = inject<ProviderStateRefs<AppProviderState>>(APP_PROVIDER_STATE_KEY);
|
|
28
|
-
|
|
29
|
-
// Reactive state
|
|
30
|
-
// ----------------------------------------------------------------------------
|
|
31
|
-
const pop = ref(false);
|
|
32
|
-
|
|
33
|
-
// Computed properties
|
|
34
|
-
// ----------------------------------------------------------------------------
|
|
35
|
-
const shape = computed(() => {
|
|
36
|
-
return props.shape || unref(appState?.shape) || "";
|
|
37
|
-
});
|
|
38
|
-
|
|
39
|
-
const divider = computed(() => {
|
|
40
|
-
return (props.divider !== undefined ? props.divider : unref(appState?.divider)) ?? false;
|
|
41
|
-
});
|
|
42
|
-
|
|
43
|
-
const decisionModalAttrs = computed(() => {
|
|
44
|
-
const role = props.role || unref(appState?.role) || "";
|
|
45
|
-
|
|
46
|
-
return getDecisionModalAttrs({
|
|
47
|
-
role,
|
|
48
|
-
shape: shape.value,
|
|
49
|
-
pop: pop.value,
|
|
50
|
-
divider: divider.value,
|
|
51
|
-
});
|
|
52
|
-
});
|
|
53
|
-
|
|
54
|
-
const decisionModalHeaderAttrs = computed(() => getDecisionModalHeaderAttrs());
|
|
55
|
-
const decisionModalBodyAttrs = computed(() => getDecisionModalBodyAttrs());
|
|
56
|
-
const decisionModalFooterAttrs = computed(() => getDecisionModalFooterAttrs({ flow: props.flow }));
|
|
57
|
-
|
|
58
|
-
// Methods
|
|
59
|
-
// ----------------------------------------------------------------------------
|
|
60
|
-
const onClose = (val: string) => {
|
|
61
|
-
if (props.dismiss && props.dismiss.includes(val)) {
|
|
62
|
-
emit("close", val);
|
|
63
|
-
} else if (val === "backdrop") {
|
|
64
|
-
pop.value = true;
|
|
65
|
-
setTimeout(() => {
|
|
66
|
-
pop.value = false;
|
|
67
|
-
}, 300);
|
|
68
|
-
}
|
|
69
|
-
};
|
|
70
|
-
|
|
71
|
-
const onChoose = (btn: DecisionModalButton) => {
|
|
72
|
-
emit("close");
|
|
73
|
-
btn.handler?.();
|
|
74
|
-
emit("choose", btn);
|
|
75
|
-
};
|
|
76
|
-
</script>
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
<div v-bind="dividerAttrs"></div>
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
<style lang="scss" src="@toife/core/features/divider/divider.scss" scoped></style>
|
|
2
|
-
<template src="./divider.html"></template>
|
|
3
|
-
<script lang="ts" setup>
|
|
4
|
-
import { unref, computed, inject } from "vue";
|
|
5
|
-
import {
|
|
6
|
-
DIVIDER_DEFAULT_PROPS,
|
|
7
|
-
APP_PROVIDER_STATE_KEY,
|
|
8
|
-
getDividerAttrs,
|
|
9
|
-
type AppProviderState,
|
|
10
|
-
type DividerProps,
|
|
11
|
-
} from "@toife/core";
|
|
12
|
-
import type { ProviderStateRefs } from "../../shared/provider-state";
|
|
13
|
-
// Component setup (props, emits, injects)
|
|
14
|
-
// ----------------------------------------------------------------------------
|
|
15
|
-
const props = withDefaults(defineProps<DividerProps>(), {
|
|
16
|
-
...DIVIDER_DEFAULT_PROPS,
|
|
17
|
-
});
|
|
18
|
-
const appState = inject<ProviderStateRefs<AppProviderState>>(APP_PROVIDER_STATE_KEY);
|
|
19
|
-
|
|
20
|
-
// Computed properties
|
|
21
|
-
// ----------------------------------------------------------------------------
|
|
22
|
-
const dividerAttrs = computed(() => {
|
|
23
|
-
const role = props.role || unref(appState?.role) || "";
|
|
24
|
-
return getDividerAttrs({ role, direction: props.direction });
|
|
25
|
-
});
|
|
26
|
-
</script>
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { default as Divider } from "./divider.vue";
|
|
@@ -1,101 +0,0 @@
|
|
|
1
|
-
<style lang="scss" src="@toife/core/features/dropdown/dropdown.scss" scoped></style>
|
|
2
|
-
<template src="./dropdown.html"></template>
|
|
3
|
-
<script lang="ts" setup>
|
|
4
|
-
import { unref, computed, inject, onMounted, onUnmounted, ref, watch } from "vue";
|
|
5
|
-
import {
|
|
6
|
-
DROPDOWN_DEFAULT_PROPS,
|
|
7
|
-
APP_PROVIDER_STATE_KEY,
|
|
8
|
-
getDropdownAttrs,
|
|
9
|
-
getDropdownPanelAttrs,
|
|
10
|
-
type AppProviderState,
|
|
11
|
-
type DropdownEvent,
|
|
12
|
-
type DropdownProps,
|
|
13
|
-
} from "@toife/core";
|
|
14
|
-
import type { ProviderStateRefs } from "../../shared/provider-state";
|
|
15
|
-
|
|
16
|
-
// Component setup (props, emits, injects)
|
|
17
|
-
// ----------------------------------------------------------------------------
|
|
18
|
-
const props = withDefaults(defineProps<DropdownProps>(), {
|
|
19
|
-
...DROPDOWN_DEFAULT_PROPS,
|
|
20
|
-
});
|
|
21
|
-
const emit = defineEmits<DropdownEvent>();
|
|
22
|
-
const appState = inject<ProviderStateRefs<AppProviderState>>(APP_PROVIDER_STATE_KEY);
|
|
23
|
-
|
|
24
|
-
// Reactive state
|
|
25
|
-
// ----------------------------------------------------------------------------
|
|
26
|
-
const rootRef = ref<HTMLElement | null>(null);
|
|
27
|
-
const isOpen = ref(false);
|
|
28
|
-
|
|
29
|
-
// Computed properties
|
|
30
|
-
// ----------------------------------------------------------------------------
|
|
31
|
-
const wrapperAttrs = computed(() => {
|
|
32
|
-
const role = props.role ?? unref(appState?.role) ?? "";
|
|
33
|
-
const shadow = props.shadow ?? unref(appState?.shadow) ?? false;
|
|
34
|
-
const shape = props.shape ?? unref(appState?.shape) ?? "";
|
|
35
|
-
|
|
36
|
-
return getDropdownAttrs({
|
|
37
|
-
role,
|
|
38
|
-
shape,
|
|
39
|
-
size: props.size,
|
|
40
|
-
open: isOpen.value,
|
|
41
|
-
disabled: props.disabled,
|
|
42
|
-
shadow,
|
|
43
|
-
});
|
|
44
|
-
});
|
|
45
|
-
|
|
46
|
-
const panelAttrs = computed(() => getDropdownPanelAttrs({ placement: props.placement }));
|
|
47
|
-
|
|
48
|
-
// Methods
|
|
49
|
-
// ----------------------------------------------------------------------------
|
|
50
|
-
const toggle = () => {
|
|
51
|
-
if (props.disabled) return;
|
|
52
|
-
isOpen.value = !isOpen.value;
|
|
53
|
-
emit("update:modelValue", isOpen.value);
|
|
54
|
-
};
|
|
55
|
-
|
|
56
|
-
const close = () => {
|
|
57
|
-
if (!isOpen.value) return;
|
|
58
|
-
isOpen.value = false;
|
|
59
|
-
emit("update:modelValue", false);
|
|
60
|
-
};
|
|
61
|
-
|
|
62
|
-
const onDocPointerDown = (e: PointerEvent) => {
|
|
63
|
-
if (!isOpen.value) return;
|
|
64
|
-
const root = rootRef.value;
|
|
65
|
-
if (root && !root.contains(e.target as Node)) {
|
|
66
|
-
close();
|
|
67
|
-
}
|
|
68
|
-
};
|
|
69
|
-
|
|
70
|
-
const onDocKeydown = (e: KeyboardEvent) => {
|
|
71
|
-
if (e.key === "Escape" && isOpen.value) {
|
|
72
|
-
e.preventDefault();
|
|
73
|
-
close();
|
|
74
|
-
}
|
|
75
|
-
};
|
|
76
|
-
|
|
77
|
-
// Lifecycle
|
|
78
|
-
// ----------------------------------------------------------------------------
|
|
79
|
-
watch(
|
|
80
|
-
() => props.modelValue,
|
|
81
|
-
(open) => {
|
|
82
|
-
isOpen.value = open;
|
|
83
|
-
},
|
|
84
|
-
{ immediate: true }
|
|
85
|
-
);
|
|
86
|
-
|
|
87
|
-
watch(isOpen, (next, prev) => {
|
|
88
|
-
if (next && !prev) emit("open");
|
|
89
|
-
if (!next && prev) emit("close");
|
|
90
|
-
});
|
|
91
|
-
|
|
92
|
-
onMounted(() => {
|
|
93
|
-
document.addEventListener("pointerdown", onDocPointerDown, true);
|
|
94
|
-
document.addEventListener("keydown", onDocKeydown, true);
|
|
95
|
-
});
|
|
96
|
-
|
|
97
|
-
onUnmounted(() => {
|
|
98
|
-
document.removeEventListener("pointerdown", onDocPointerDown, true);
|
|
99
|
-
document.removeEventListener("keydown", onDocKeydown, true);
|
|
100
|
-
});
|
|
101
|
-
</script>
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { default as Dropdown } from "./dropdown.vue";
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
<div v-bind="fieldAttrs">
|
|
2
|
-
<div v-bind="fieldContentAttrs">
|
|
3
|
-
<slot name="start-input"></slot>
|
|
4
|
-
<slot name="input">
|
|
5
|
-
<textarea
|
|
6
|
-
v-bind="fieldInputAttrs"
|
|
7
|
-
@input="onInput"
|
|
8
|
-
@focus="onFocus"
|
|
9
|
-
@blur="onBlur"
|
|
10
|
-
@beforeinput="onBeforeinput"
|
|
11
|
-
v-model="content"
|
|
12
|
-
:rows="line"
|
|
13
|
-
v-if="type === 'paragraph'"
|
|
14
|
-
/>
|
|
15
|
-
<input
|
|
16
|
-
v-bind="fieldInputAttrs"
|
|
17
|
-
@input="onInput"
|
|
18
|
-
@focus="onFocus"
|
|
19
|
-
@blur="onBlur"
|
|
20
|
-
@beforeinput="onBeforeinput"
|
|
21
|
-
v-model="content"
|
|
22
|
-
:type="type"
|
|
23
|
-
v-else
|
|
24
|
-
/>
|
|
25
|
-
</slot>
|
|
26
|
-
<slot name="end-input"></slot>
|
|
27
|
-
</div>
|
|
28
|
-
<div v-bind="fieldMessageAttrs" v-if="message">{{ message }}</div>
|
|
29
|
-
<slot></slot>
|
|
30
|
-
</div>
|
|
@@ -1,121 +0,0 @@
|
|
|
1
|
-
<style lang="scss" src="@toife/core/features/field/field.scss" scoped></style>
|
|
2
|
-
<template src="./field.html"></template>
|
|
3
|
-
<script lang="ts" setup>
|
|
4
|
-
import { unref, computed, inject, nextTick, onMounted, ref, watch } from "vue";
|
|
5
|
-
import {
|
|
6
|
-
FIELD_DEFAULT_PROPS,
|
|
7
|
-
APP_PROVIDER_STATE_KEY,
|
|
8
|
-
getFieldAttrs,
|
|
9
|
-
getFieldContentAttrs,
|
|
10
|
-
getFieldInputAttrs,
|
|
11
|
-
getFieldMessageAttrs,
|
|
12
|
-
type AppProviderState,
|
|
13
|
-
type FieldEvent,
|
|
14
|
-
type FieldProps,
|
|
15
|
-
} from "@toife/core";
|
|
16
|
-
import type { ProviderStateRefs } from "../../shared/provider-state";
|
|
17
|
-
|
|
18
|
-
// Component setup (props, emits, injects)
|
|
19
|
-
// ----------------------------------------------------------------------------
|
|
20
|
-
const props = withDefaults(defineProps<FieldProps>(), {
|
|
21
|
-
...FIELD_DEFAULT_PROPS,
|
|
22
|
-
});
|
|
23
|
-
const emit = defineEmits<FieldEvent>();
|
|
24
|
-
const appState = inject<ProviderStateRefs<AppProviderState>>(APP_PROVIDER_STATE_KEY);
|
|
25
|
-
|
|
26
|
-
// Reactive state
|
|
27
|
-
// ----------------------------------------------------------------------------
|
|
28
|
-
const isFocus = ref(false);
|
|
29
|
-
const caret = ref(0);
|
|
30
|
-
const content = ref("");
|
|
31
|
-
|
|
32
|
-
// Computed properties
|
|
33
|
-
// ----------------------------------------------------------------------------
|
|
34
|
-
const fieldAttrs = computed(() => {
|
|
35
|
-
const role = props.role || unref(appState?.role) || "";
|
|
36
|
-
const shape = props.shape || unref(appState?.shape) || "";
|
|
37
|
-
const shadow = (props?.shadow !== undefined ? props.shadow : unref(appState?.shadow)) ?? false;
|
|
38
|
-
const direction = props.direction || unref(appState?.direction) || "left";
|
|
39
|
-
|
|
40
|
-
return getFieldAttrs({
|
|
41
|
-
role,
|
|
42
|
-
shape,
|
|
43
|
-
size: props.size,
|
|
44
|
-
direction,
|
|
45
|
-
variant: props.variant,
|
|
46
|
-
type: props.type,
|
|
47
|
-
disabled: props.disabled,
|
|
48
|
-
focus: isFocus.value,
|
|
49
|
-
shadow,
|
|
50
|
-
readonly: props.readonly,
|
|
51
|
-
line: Number(props.line),
|
|
52
|
-
maxLine: props.maxLine !== undefined ? Number(props.maxLine) : undefined,
|
|
53
|
-
});
|
|
54
|
-
});
|
|
55
|
-
|
|
56
|
-
const rawContent = computed(() => {
|
|
57
|
-
const model = props.modelValue;
|
|
58
|
-
if (model !== null && model !== undefined && model !== "") {
|
|
59
|
-
return String(model);
|
|
60
|
-
}
|
|
61
|
-
const value = props.value;
|
|
62
|
-
if (value !== null && value !== undefined && value !== "") {
|
|
63
|
-
return String(value);
|
|
64
|
-
}
|
|
65
|
-
return "";
|
|
66
|
-
});
|
|
67
|
-
|
|
68
|
-
const fieldContentAttrs = computed(() => getFieldContentAttrs());
|
|
69
|
-
|
|
70
|
-
const fieldInputAttrs = computed(() => ({
|
|
71
|
-
...getFieldInputAttrs(),
|
|
72
|
-
name: props.name,
|
|
73
|
-
id: props.id,
|
|
74
|
-
placeholder: props.placeholder,
|
|
75
|
-
autocomplete: props.autocomplete,
|
|
76
|
-
type: props.type,
|
|
77
|
-
readonly: props.readonly,
|
|
78
|
-
disabled: props.disabled,
|
|
79
|
-
maxlength: props.maxLength,
|
|
80
|
-
tabindex: props.tabindex,
|
|
81
|
-
}));
|
|
82
|
-
|
|
83
|
-
const fieldMessageAttrs = computed(() => getFieldMessageAttrs());
|
|
84
|
-
|
|
85
|
-
// Methods
|
|
86
|
-
// ----------------------------------------------------------------------------
|
|
87
|
-
const onFocus = (ev: FocusEvent) => {
|
|
88
|
-
if (props.disabled) return;
|
|
89
|
-
isFocus.value = true;
|
|
90
|
-
emit("focus", ev);
|
|
91
|
-
};
|
|
92
|
-
|
|
93
|
-
const onBlur = (ev: FocusEvent) => {
|
|
94
|
-
if (props.disabled) return;
|
|
95
|
-
isFocus.value = false;
|
|
96
|
-
emit("blur", ev);
|
|
97
|
-
};
|
|
98
|
-
|
|
99
|
-
const onInput = (ev: Event) => {
|
|
100
|
-
emit("input", ev);
|
|
101
|
-
};
|
|
102
|
-
|
|
103
|
-
const onBeforeinput = (ev: Event) => {
|
|
104
|
-
emit("beforeinput", ev);
|
|
105
|
-
};
|
|
106
|
-
|
|
107
|
-
watch(
|
|
108
|
-
() => rawContent.value,
|
|
109
|
-
(value) => {
|
|
110
|
-
content.value = value.toString();
|
|
111
|
-
},
|
|
112
|
-
{ immediate: true }
|
|
113
|
-
);
|
|
114
|
-
|
|
115
|
-
watch(
|
|
116
|
-
() => content.value,
|
|
117
|
-
(value) => {
|
|
118
|
-
emit("update:modelValue", value.toString());
|
|
119
|
-
}
|
|
120
|
-
);
|
|
121
|
-
</script>
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { default as Field } from "./field.vue";
|