@antify/ui 2.2.0 → 2.2.3
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/AntAccordion.vue +25 -12
- package/dist/components/AntAccordionItem.vue +28 -13
- package/dist/components/AntAlert.vue +25 -15
- package/dist/components/AntCard.vue +26 -14
- package/dist/components/AntContent.vue +4 -4
- package/dist/components/AntDropdown.vue +41 -23
- package/dist/components/AntIcon.vue +18 -6
- package/dist/components/AntKeycap.vue +31 -16
- package/dist/components/AntListGroup.vue +13 -11
- package/dist/components/AntListGroupItem.vue +19 -9
- package/dist/components/AntModal.vue +26 -15
- package/dist/components/AntPagination.vue +28 -15
- package/dist/components/AntPopover.vue +74 -51
- package/dist/components/AntSkeleton.vue +8 -4
- package/dist/components/AntSpinner.vue +14 -6
- package/dist/components/AntTag.vue +25 -13
- package/dist/components/AntToast.vue +19 -11
- package/dist/components/AntToaster.vue +13 -5
- package/dist/components/AntTooltip.vue +78 -54
- package/dist/components/__stories/AntAccordion.stories.js +4 -4
- package/dist/components/__stories/AntAccordion.stories.mjs +50 -17
- package/dist/components/__stories/AntAlert.stories.mjs +18 -5
- package/dist/components/__stories/AntCard.stories.mjs +36 -10
- package/dist/components/__stories/AntContent.stories.mjs +14 -4
- package/dist/components/__stories/AntDropdown.stories.mjs +20 -4
- package/dist/components/__stories/AntIcon.stories.mjs +38 -12
- package/dist/components/__stories/AntKeycap.stories.mjs +35 -10
- package/dist/components/__stories/AntListGroup.stories.d.ts +1 -1
- package/dist/components/__stories/AntListGroup.stories.mjs +22 -4
- package/dist/components/__stories/AntListGroupItem.stories.mjs +27 -8
- package/dist/components/__stories/AntModal.stories.mjs +17 -4
- package/dist/components/__stories/AntPagination.stories.mjs +21 -6
- package/dist/components/__stories/AntPopover.stories.mjs +20 -4
- package/dist/components/__stories/AntSkeleton.stories.mjs +17 -5
- package/dist/components/__stories/AntSpinner.stories.mjs +33 -9
- package/dist/components/__stories/AntTag.stories.mjs +28 -8
- package/dist/components/__stories/AntToast.stories.mjs +19 -5
- package/dist/components/__stories/AntToaster.stories.d.ts +1 -1
- package/dist/components/__stories/AntToaster.stories.mjs +35 -9
- package/dist/components/__stories/AntTooltip.stories.js +1 -1
- package/dist/components/__stories/AntTooltip.stories.mjs +44 -13
- package/dist/components/buttons/AntActionButton.vue +38 -29
- package/dist/components/buttons/AntButton.vue +34 -13
- package/dist/components/buttons/AntCreateButton.vue +11 -4
- package/dist/components/buttons/AntDeleteButton.vue +11 -4
- package/dist/components/buttons/AntDuplicateButton.vue +11 -4
- package/dist/components/buttons/AntEditButton.vue +11 -4
- package/dist/components/buttons/AntSaveAndNewButton.vue +11 -4
- package/dist/components/buttons/AntSaveButton.vue +11 -4
- package/dist/components/buttons/__stories/AntActionButton.stories.mjs +35 -10
- package/dist/components/buttons/__stories/AntButton.stories.mjs +77 -23
- package/dist/components/buttons/__stories/AntCreateButton.stories.mjs +25 -7
- package/dist/components/buttons/__stories/AntDeleteButton.stories.mjs +25 -7
- package/dist/components/buttons/__stories/AntDuplicateButton.stories.mjs +25 -7
- package/dist/components/buttons/__stories/AntEditButton.stories.mjs +25 -7
- package/dist/components/buttons/__stories/AntSaveAndNewButton.stories.mjs +25 -7
- package/dist/components/buttons/__stories/AntSaveButton.stories.mjs +25 -7
- package/dist/components/crud/AntCrud.vue +6 -6
- package/dist/components/crud/AntCrudDetail.vue +8 -5
- package/dist/components/crud/AntCrudDetailActions.vue +14 -8
- package/dist/components/crud/AntCrudDetailNav.vue +21 -13
- package/dist/components/crud/AntCrudTableFilter.vue +29 -17
- package/dist/components/crud/AntCrudTableNav.vue +36 -22
- package/dist/components/crud/__stories/AntCrud.stories.mjs +17 -5
- package/dist/components/crud/__stories/AntCrudDetail.stories.mjs +11 -3
- package/dist/components/crud/__stories/AntCrudDetailActions.stories.mjs +10 -2
- package/dist/components/crud/__stories/AntCrudDetailNav.stories.mjs +11 -3
- package/dist/components/crud/__stories/AntCrudTableFilter.stories.mjs +17 -5
- package/dist/components/crud/__stories/AntCrudTableNav.stories.mjs +23 -7
- package/dist/components/dialogs/AntDeleteDialog.vue +13 -5
- package/dist/components/dialogs/AntDialog.vue +23 -13
- package/dist/components/dialogs/__stories/AndDeleteDialog.stories.mjs +12 -3
- package/dist/components/dialogs/__stories/AntDialog.stories.mjs +28 -7
- package/dist/components/forms/AntField.vue +18 -7
- package/dist/components/forms/AntFormGroup.vue +9 -5
- package/dist/components/forms/AntFormGroupLabel.vue +1 -1
- package/dist/components/forms/__stories/AntField.stories.mjs +37 -9
- package/dist/components/forms/__stories/AntFormGroup.stories.mjs +20 -5
- package/dist/components/forms/__stories/AntFormGroupLabel.stories.mjs +11 -3
- package/dist/components/index.d.ts +1 -1
- package/dist/components/inputs/AntCheckbox.vue +61 -36
- package/dist/components/inputs/AntCheckboxGroup.vue +40 -15
- package/dist/components/inputs/AntDateInput.vue +35 -12
- package/dist/components/inputs/AntNumberInput.vue +33 -12
- package/dist/components/inputs/AntPasswordInput.vue +32 -11
- package/dist/components/inputs/AntRadio.vue +57 -34
- package/dist/components/inputs/AntRadioGroup.vue +60 -35
- package/dist/components/inputs/AntRangeSlider.vue +31 -12
- package/dist/components/inputs/AntSearch.vue +19 -7
- package/dist/components/inputs/AntSelect.vue +107 -83
- package/dist/components/inputs/AntSwitch.vue +36 -18
- package/dist/components/inputs/AntSwitcher.vue +30 -15
- package/dist/components/inputs/AntTagInput.vue +91 -61
- package/dist/components/inputs/AntTextInput.vue +31 -11
- package/dist/components/inputs/AntTextarea.vue +53 -25
- package/dist/components/inputs/AntUnitInput.vue +33 -12
- package/dist/components/inputs/Elements/AntBaseInput.vue +47 -18
- package/dist/components/inputs/Elements/AntInputDescription.vue +16 -8
- package/dist/components/inputs/Elements/AntInputLabel.vue +13 -5
- package/dist/components/inputs/Elements/AntInputLimiter.vue +13 -5
- package/dist/components/inputs/Elements/AntSelectMenu.vue +65 -41
- package/dist/components/inputs/Elements/__stories/AntBaseInput.stories.mjs +104 -27
- package/dist/components/inputs/Elements/__stories/AntInputDescription.stories.mjs +33 -9
- package/dist/components/inputs/Elements/__stories/AntInputLabel.stories.mjs +34 -9
- package/dist/components/inputs/Elements/__stories/AntInputLimiter.stories.mjs +33 -9
- package/dist/components/inputs/Elements/index.d.ts +1 -1
- package/dist/components/inputs/__stories/AntCheckbox.stories.mjs +34 -9
- package/dist/components/inputs/__stories/AntCheckboxGroup.stories.mjs +45 -21
- package/dist/components/inputs/__stories/AntDateInput.stories.mjs +52 -14
- package/dist/components/inputs/__stories/AntNumberInput.stories.mjs +66 -17
- package/dist/components/inputs/__stories/AntPasswordInput.stories.mjs +51 -13
- package/dist/components/inputs/__stories/AntRadioGroup.stories.mjs +45 -12
- package/dist/components/inputs/__stories/AntRangeSlider.stories.mjs +16 -5
- package/dist/components/inputs/__stories/AntSearch.stories.mjs +41 -10
- package/dist/components/inputs/__stories/AntSelect.stories.mjs +59 -15
- package/dist/components/inputs/__stories/AntSwitch.stories.js +126 -102
- package/dist/components/inputs/__stories/AntSwitch.stories.mjs +162 -112
- package/dist/components/inputs/__stories/AntSwitcher.stories.mjs +38 -10
- package/dist/components/inputs/__stories/AntTagInput.stories.mjs +46 -12
- package/dist/components/inputs/__stories/AntTextInput.stories.mjs +59 -16
- package/dist/components/inputs/__stories/AntTextarea.stories.mjs +47 -13
- package/dist/components/inputs/__stories/AntUnitInput.stories.mjs +46 -12
- package/dist/components/layouts/AntNavLeftLayout.vue +12 -6
- package/dist/components/layouts/__stories/AntNavLeftLayout.stories.mjs +10 -2
- package/dist/components/navbar/AntNavbar.vue +7 -3
- package/dist/components/navbar/AntNavbarItem.vue +12 -6
- package/dist/components/navbar/__stories/AntNavbar.stories.mjs +59 -37
- package/dist/components/table/AntCollapsibleTableRowContent.vue +7 -5
- package/dist/components/table/AntTable.vue +227 -165
- package/dist/components/table/AntTableSkeleton.vue +126 -0
- package/dist/components/table/AntTableSortButton.vue +22 -13
- package/dist/components/table/AntTd.vue +21 -17
- package/dist/components/table/AntTh.vue +19 -12
- package/dist/components/table/__stories/AntTable.stories.js +132 -14
- package/dist/components/table/__stories/AntTable.stories.mjs +253 -31
- package/dist/components/table/__types/index.d.ts +0 -1
- package/dist/components/table/__types/index.js +0 -11
- package/dist/components/table/__types/index.mjs +0 -1
- package/dist/components/tabs/AntTabItem.vue +20 -8
- package/dist/components/tabs/AntTabs.vue +35 -21
- package/dist/components/tabs/__stories/AntTabItem.stories.mjs +23 -7
- package/dist/components/tabs/__stories/AntTabs.stories.mjs +45 -13
- package/dist/components/transitions/AntTransitionCollapseHeight.vue +1 -1
- package/dist/composables/useToaster.mjs +25 -7
- package/dist/index.css +1 -0
- package/dist/utils.mjs +3 -1
- package/package.json +23 -16
- package/dist/tailwind.config.d.ts +0 -3
- package/dist/tailwind.config.js +0 -198
- package/dist/tailwind.config.mjs +0 -189
|
@@ -1,31 +1,53 @@
|
|
|
1
1
|
import AntField from "../AntField.vue";
|
|
2
2
|
import AntBaseInput from "../../inputs/Elements/AntBaseInput.vue";
|
|
3
|
-
import {
|
|
4
|
-
|
|
5
|
-
|
|
3
|
+
import {
|
|
4
|
+
Size
|
|
5
|
+
} from "../../../enums/Size.enum.mjs";
|
|
6
|
+
import {
|
|
7
|
+
computed,
|
|
8
|
+
ref
|
|
9
|
+
} from "vue";
|
|
10
|
+
import {
|
|
11
|
+
InputState
|
|
12
|
+
} from "../../../enums/index.mjs";
|
|
6
13
|
const meta = {
|
|
7
14
|
title: "Forms/Field",
|
|
8
15
|
component: AntField,
|
|
9
|
-
parameters: {
|
|
16
|
+
parameters: {
|
|
17
|
+
controls: {
|
|
18
|
+
sort: "requiredFirst"
|
|
19
|
+
}
|
|
20
|
+
},
|
|
10
21
|
argTypes: {
|
|
11
22
|
size: {
|
|
12
|
-
control: {
|
|
23
|
+
control: {
|
|
24
|
+
type: "select"
|
|
25
|
+
},
|
|
13
26
|
options: Object.values(Size)
|
|
14
27
|
},
|
|
15
28
|
state: {
|
|
16
|
-
control: {
|
|
29
|
+
control: {
|
|
30
|
+
type: "select"
|
|
31
|
+
},
|
|
17
32
|
options: Object.values(InputState)
|
|
18
33
|
},
|
|
19
34
|
skeleton: {
|
|
20
35
|
control: "boolean",
|
|
21
|
-
table: {
|
|
36
|
+
table: {
|
|
37
|
+
defaultValue: {
|
|
38
|
+
summary: false
|
|
39
|
+
}
|
|
40
|
+
}
|
|
22
41
|
}
|
|
23
42
|
}
|
|
24
43
|
};
|
|
25
44
|
export default meta;
|
|
26
45
|
export const Docs = {
|
|
27
46
|
render: (args) => ({
|
|
28
|
-
components: {
|
|
47
|
+
components: {
|
|
48
|
+
AntField,
|
|
49
|
+
AntBaseInput
|
|
50
|
+
},
|
|
29
51
|
setup: () => {
|
|
30
52
|
const skeleton = computed({
|
|
31
53
|
get() {
|
|
@@ -44,7 +66,13 @@ export const Docs = {
|
|
|
44
66
|
}
|
|
45
67
|
});
|
|
46
68
|
const value = ref(null);
|
|
47
|
-
return {
|
|
69
|
+
return {
|
|
70
|
+
args,
|
|
71
|
+
value,
|
|
72
|
+
skeleton,
|
|
73
|
+
size,
|
|
74
|
+
InputState
|
|
75
|
+
};
|
|
48
76
|
},
|
|
49
77
|
template: `
|
|
50
78
|
<AntField
|
|
@@ -2,14 +2,22 @@ import AntFormGroup from "../AntFormGroup.vue";
|
|
|
2
2
|
import AntFormGroupLabel from "../AntFormGroupLabel.vue";
|
|
3
3
|
import AntTextInput from "../../inputs/AntTextInput.vue";
|
|
4
4
|
import AntButton from "../../buttons/AntButton.vue";
|
|
5
|
-
import {
|
|
5
|
+
import {
|
|
6
|
+
Direction
|
|
7
|
+
} from "../../../enums/Direction.enum.mjs";
|
|
6
8
|
const meta = {
|
|
7
9
|
title: "Forms/Form Group",
|
|
8
10
|
component: AntFormGroup,
|
|
9
|
-
parameters: {
|
|
11
|
+
parameters: {
|
|
12
|
+
controls: {
|
|
13
|
+
sort: "requiredFirst"
|
|
14
|
+
}
|
|
15
|
+
},
|
|
10
16
|
argTypes: {
|
|
11
17
|
direction: {
|
|
12
|
-
control: {
|
|
18
|
+
control: {
|
|
19
|
+
type: "select"
|
|
20
|
+
},
|
|
13
21
|
options: Object.values(Direction)
|
|
14
22
|
}
|
|
15
23
|
}
|
|
@@ -17,9 +25,16 @@ const meta = {
|
|
|
17
25
|
export default meta;
|
|
18
26
|
export const Docs = {
|
|
19
27
|
render: (args) => ({
|
|
20
|
-
components: {
|
|
28
|
+
components: {
|
|
29
|
+
AntFormGroup,
|
|
30
|
+
AntFormGroupLabel,
|
|
31
|
+
AntTextInput,
|
|
32
|
+
AntButton
|
|
33
|
+
},
|
|
21
34
|
setup() {
|
|
22
|
-
return {
|
|
35
|
+
return {
|
|
36
|
+
args
|
|
37
|
+
};
|
|
23
38
|
},
|
|
24
39
|
template: `
|
|
25
40
|
<AntFormGroup v-bind="args">
|
|
@@ -2,15 +2,23 @@ import AntFormGroupLabel from "../AntFormGroupLabel.vue";
|
|
|
2
2
|
const meta = {
|
|
3
3
|
title: "Forms/Form Group Label",
|
|
4
4
|
component: AntFormGroupLabel,
|
|
5
|
-
parameters: {
|
|
5
|
+
parameters: {
|
|
6
|
+
controls: {
|
|
7
|
+
sort: "requiredFirst"
|
|
8
|
+
}
|
|
9
|
+
},
|
|
6
10
|
argTypes: {}
|
|
7
11
|
};
|
|
8
12
|
export default meta;
|
|
9
13
|
export const Docs = {
|
|
10
14
|
render: (args) => ({
|
|
11
|
-
components: {
|
|
15
|
+
components: {
|
|
16
|
+
AntFormGroupLabel
|
|
17
|
+
},
|
|
12
18
|
setup() {
|
|
13
|
-
return {
|
|
19
|
+
return {
|
|
20
|
+
args
|
|
21
|
+
};
|
|
14
22
|
},
|
|
15
23
|
template: `
|
|
16
24
|
<AntFormGroupLabel v-bind="args">Example label</AntFormGroupLabel>
|
|
@@ -63,4 +63,4 @@ import AntTag from './AntTag.vue';
|
|
|
63
63
|
import AntToast from './AntToast.vue';
|
|
64
64
|
import AntToaster from './AntToaster.vue';
|
|
65
65
|
import AntTooltip from './AntTooltip.vue';
|
|
66
|
-
export { AntActionButton, AntButton, AntCreateButton, AntDeleteButton, AntDuplicateButton, AntEditButton, AntSaveAndNewButton, AntSaveButton, AntCrud, AntCrudDetail, AntCrudDetailActions, AntCrudDetailNav, AntCrudTableFilter, AntCrudTableNav, AntDeleteDialog, AntDialog, AntField, AntFormGroup, AntFormGroupLabel, AntBaseInput, AntSelectMenu, AntInputDescription, AntInputLabel, AntInputLimiter, AntCheckbox, AntCheckboxGroup, AntDateInput, AntNumberInput, AntPasswordInput, AntRadio, AntRadioGroup, AntRangeSlider, AntSearch, AntSelect, AntSwitch, AntSwitcher, AntTagInput, AntTextarea, AntTextInput, AntUnitInput, AntNavLeftLayout, AntNavbar, AntNavbarItem, AntTable, AntTabs, AntTransitionCollapseHeight, AntAccordion, AntAccordionItem, AntAlert, AntCard, AntContent, AntDropdown, AntIcon, AntKeycap, AntListGroup, AntListGroupItem, AntModal, AntPagination, AntPopover, AntSkeleton, AntSpinner, AntTag, AntToast, AntToaster, AntTooltip };
|
|
66
|
+
export { AntActionButton, AntButton, AntCreateButton, AntDeleteButton, AntDuplicateButton, AntEditButton, AntSaveAndNewButton, AntSaveButton, AntCrud, AntCrudDetail, AntCrudDetailActions, AntCrudDetailNav, AntCrudTableFilter, AntCrudTableNav, AntDeleteDialog, AntDialog, AntField, AntFormGroup, AntFormGroupLabel, AntBaseInput, AntSelectMenu, AntInputDescription, AntInputLabel, AntInputLimiter, AntCheckbox, AntCheckboxGroup, AntDateInput, AntNumberInput, AntPasswordInput, AntRadio, AntRadioGroup, AntRangeSlider, AntSearch, AntSelect, AntSwitch, AntSwitcher, AntTagInput, AntTextarea, AntTextInput, AntUnitInput, AntNavLeftLayout, AntNavbar, AntNavbarItem, AntTable, AntTabs, AntTransitionCollapseHeight, AntAccordion, AntAccordionItem, AntAlert, AntCard, AntContent, AntDropdown, AntIcon, AntKeycap, AntListGroup, AntListGroupItem, AntModal, AntPagination, AntPopover, AntSkeleton, AntSpinner, AntTag, AntToast, AntToaster, AntTooltip, };
|
|
@@ -1,35 +1,53 @@
|
|
|
1
1
|
<script lang="ts" setup>
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
|
|
2
|
+
import {
|
|
3
|
+
useVModel,
|
|
4
|
+
} from '@vueuse/core';
|
|
5
|
+
import {
|
|
6
|
+
AntField,
|
|
7
|
+
} from './Elements';
|
|
8
|
+
import {
|
|
9
|
+
InputState, Size,
|
|
10
|
+
} from '../../enums';
|
|
5
11
|
import AntSkeleton from '../AntSkeleton.vue';
|
|
6
|
-
import {
|
|
7
|
-
|
|
8
|
-
|
|
12
|
+
import {
|
|
13
|
+
computed, onMounted, ref, watch,
|
|
14
|
+
} from 'vue';
|
|
15
|
+
import {
|
|
16
|
+
handleEnumValidation,
|
|
17
|
+
} from '../../handler';
|
|
18
|
+
import {
|
|
19
|
+
faCheck,
|
|
20
|
+
} from '@fortawesome/free-solid-svg-icons';
|
|
9
21
|
import AntIcon from '../AntIcon.vue';
|
|
10
|
-
import {
|
|
22
|
+
import {
|
|
23
|
+
IconSize,
|
|
24
|
+
} from '../__types';
|
|
11
25
|
|
|
12
|
-
const emit = defineEmits([
|
|
26
|
+
const emit = defineEmits([
|
|
27
|
+
'update:modelValue',
|
|
28
|
+
'update:skeleton',
|
|
29
|
+
'validate',
|
|
30
|
+
'blur',
|
|
31
|
+
]);
|
|
13
32
|
const props =
|
|
14
|
-
withDefaults(
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
});
|
|
33
|
+
withDefaults(defineProps<{
|
|
34
|
+
modelValue: boolean | null;
|
|
35
|
+
label?: string;
|
|
36
|
+
description?: string;
|
|
37
|
+
state?: InputState;
|
|
38
|
+
size?: Size;
|
|
39
|
+
skeleton?: boolean;
|
|
40
|
+
disabled?: boolean;
|
|
41
|
+
readonly?: boolean;
|
|
42
|
+
messages?: string[];
|
|
43
|
+
}>(), {
|
|
44
|
+
state: InputState.base,
|
|
45
|
+
size: Size.md,
|
|
46
|
+
skeleton: false,
|
|
47
|
+
disabled: false,
|
|
48
|
+
readonly: false,
|
|
49
|
+
messages: () => [],
|
|
50
|
+
});
|
|
33
51
|
const _modelValue = useVModel(props, 'modelValue', emit);
|
|
34
52
|
const delayedValue = ref(_modelValue.value);
|
|
35
53
|
const hasInputState = computed(() => props.skeleton || props.readonly || props.disabled);
|
|
@@ -57,10 +75,10 @@ const inputClasses = computed(() => {
|
|
|
57
75
|
};
|
|
58
76
|
|
|
59
77
|
return {
|
|
60
|
-
'relative inline-flex
|
|
61
|
-
'outline outline-1 outline-offset-[-1px] rounded': true,
|
|
78
|
+
'relative inline-flex shrink-0 bg-base-100 border-0': true,
|
|
79
|
+
'outline outline-1 outline-offset-[-1px] rounded-sm': true,
|
|
62
80
|
'focus:ring-offset-0': true,
|
|
63
|
-
|
|
81
|
+
invisible: props.skeleton,
|
|
64
82
|
'cursor-pointer': !hasInputState.value,
|
|
65
83
|
'focus:ring-2': !hasInputState.value && (props.size === Size.sm || props.size === Size.xs || props.size === Size.xs2),
|
|
66
84
|
'focus:ring-4': !hasInputState.value && (props.size === Size.lg || props.size === Size.md),
|
|
@@ -93,13 +111,13 @@ const iconColor = computed(() => {
|
|
|
93
111
|
case InputState.info:
|
|
94
112
|
return 'text-info-500-font';
|
|
95
113
|
case InputState.success:
|
|
96
|
-
return 'text-success-500-font'
|
|
114
|
+
return 'text-success-500-font';
|
|
97
115
|
case InputState.warning:
|
|
98
116
|
return 'text-warning-500-font';
|
|
99
117
|
default:
|
|
100
118
|
return 'text-danger-500-font';
|
|
101
119
|
}
|
|
102
|
-
})
|
|
120
|
+
});
|
|
103
121
|
|
|
104
122
|
/**
|
|
105
123
|
* Delay value to change the checkboxes background color after
|
|
@@ -113,10 +131,16 @@ watch(_modelValue, (val) => {
|
|
|
113
131
|
}
|
|
114
132
|
});
|
|
115
133
|
watch(_modelValue, (val) => {
|
|
116
|
-
if ([
|
|
134
|
+
if ([
|
|
135
|
+
InputState.danger,
|
|
136
|
+
InputState.warning,
|
|
137
|
+
InputState.info,
|
|
138
|
+
].includes(props.state)) {
|
|
117
139
|
emit('validate', val);
|
|
118
140
|
}
|
|
119
|
-
}, {
|
|
141
|
+
}, {
|
|
142
|
+
deep: true,
|
|
143
|
+
});
|
|
120
144
|
watch(() => props.skeleton, (val) => {
|
|
121
145
|
if (!val && props.modelValue !== null) {
|
|
122
146
|
emit('validate', props.modelValue);
|
|
@@ -140,6 +164,7 @@ onMounted(() => {
|
|
|
140
164
|
|
|
141
165
|
<template>
|
|
142
166
|
<AntField
|
|
167
|
+
data-e2e="checkbox"
|
|
143
168
|
:label="label"
|
|
144
169
|
:description="description"
|
|
145
170
|
:skeleton="skeleton"
|
|
@@ -157,7 +182,7 @@ onMounted(() => {
|
|
|
157
182
|
:aria-checked="_modelValue"
|
|
158
183
|
:disabled="disabled || readonly"
|
|
159
184
|
@blur="onBlur"
|
|
160
|
-
|
|
185
|
+
>
|
|
161
186
|
|
|
162
187
|
<div
|
|
163
188
|
class="absolute flex items-center justify-center !text-white pointer-events-none"
|
|
@@ -183,7 +208,7 @@ onMounted(() => {
|
|
|
183
208
|
:class="props.size === Size.md ? 'h-5' : 'h-4'"
|
|
184
209
|
>
|
|
185
210
|
<span :class="contentClasses">
|
|
186
|
-
<slot/>
|
|
211
|
+
<slot />
|
|
187
212
|
</span>
|
|
188
213
|
|
|
189
214
|
<AntSkeleton
|
|
@@ -1,13 +1,29 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
|
|
2
|
+
import {
|
|
3
|
+
type AntCheckboxType,
|
|
4
|
+
} from './__types/AntCheckbox.types';
|
|
5
|
+
import {
|
|
6
|
+
AntField,
|
|
7
|
+
} from './Elements';
|
|
8
|
+
import {
|
|
9
|
+
useVModel,
|
|
10
|
+
} from '@vueuse/core';
|
|
5
11
|
import AntCheckbox from './AntCheckbox.vue';
|
|
6
|
-
import {
|
|
7
|
-
|
|
8
|
-
|
|
12
|
+
import {
|
|
13
|
+
computed, onMounted, ref, watch,
|
|
14
|
+
} from 'vue';
|
|
15
|
+
import {
|
|
16
|
+
Direction,
|
|
17
|
+
} from '../../enums/Direction.enum';
|
|
18
|
+
import {
|
|
19
|
+
InputState, Size,
|
|
20
|
+
} from '../../enums';
|
|
9
21
|
|
|
10
|
-
const emit = defineEmits([
|
|
22
|
+
const emit = defineEmits([
|
|
23
|
+
'update:modelValue',
|
|
24
|
+
'validate',
|
|
25
|
+
'blur',
|
|
26
|
+
]);
|
|
11
27
|
const props = withDefaults(
|
|
12
28
|
defineProps<{
|
|
13
29
|
modelValue: string[] | null;
|
|
@@ -16,11 +32,11 @@ const props = withDefaults(
|
|
|
16
32
|
description?: string;
|
|
17
33
|
direction?: Direction;
|
|
18
34
|
state?: InputState;
|
|
19
|
-
size?: Size
|
|
35
|
+
size?: Size;
|
|
20
36
|
skeleton?: boolean;
|
|
21
37
|
readonly?: boolean;
|
|
22
38
|
disabled?: boolean;
|
|
23
|
-
messages?: string[]
|
|
39
|
+
messages?: string[];
|
|
24
40
|
}>(),
|
|
25
41
|
{
|
|
26
42
|
direction: Direction.column,
|
|
@@ -29,22 +45,28 @@ const props = withDefaults(
|
|
|
29
45
|
skeleton: false,
|
|
30
46
|
readonly: false,
|
|
31
47
|
disabled: false,
|
|
32
|
-
messages: () => []
|
|
33
|
-
}
|
|
48
|
+
messages: () => [],
|
|
49
|
+
},
|
|
34
50
|
);
|
|
35
51
|
const _modelValue = useVModel(props, 'modelValue', emit);
|
|
36
52
|
const containerClasses = computed(() => ({
|
|
37
53
|
'flex gap-2.5': true,
|
|
38
54
|
'flex-row': props.direction === Direction.row,
|
|
39
|
-
'flex-col': props.direction === Direction.column
|
|
55
|
+
'flex-col': props.direction === Direction.column,
|
|
40
56
|
}));
|
|
41
57
|
const containerRef = ref<null | HTMLElement>(null);
|
|
42
58
|
|
|
43
59
|
watch(_modelValue, (val) => {
|
|
44
|
-
if ([
|
|
60
|
+
if ([
|
|
61
|
+
InputState.danger,
|
|
62
|
+
InputState.warning,
|
|
63
|
+
InputState.info,
|
|
64
|
+
].includes(props.state)) {
|
|
45
65
|
emit('validate', val);
|
|
46
66
|
}
|
|
47
|
-
}, {
|
|
67
|
+
}, {
|
|
68
|
+
deep: true,
|
|
69
|
+
});
|
|
48
70
|
watch(() => props.skeleton, (val) => {
|
|
49
71
|
if (!val && props.modelValue !== null) {
|
|
50
72
|
emit('validate', props.modelValue);
|
|
@@ -53,7 +75,9 @@ watch(() => props.skeleton, (val) => {
|
|
|
53
75
|
|
|
54
76
|
function updateValue(value: string) {
|
|
55
77
|
if (_modelValue.value === null) {
|
|
56
|
-
return _modelValue.value = [
|
|
78
|
+
return _modelValue.value = [
|
|
79
|
+
value,
|
|
80
|
+
];
|
|
57
81
|
}
|
|
58
82
|
|
|
59
83
|
const index = _modelValue.value.indexOf(value);
|
|
@@ -86,6 +110,7 @@ onMounted(() => {
|
|
|
86
110
|
|
|
87
111
|
<template>
|
|
88
112
|
<AntField
|
|
113
|
+
data-e2e="checkbox-group"
|
|
89
114
|
:label="label"
|
|
90
115
|
:description="description"
|
|
91
116
|
:skeleton="skeleton"
|
|
@@ -1,18 +1,38 @@
|
|
|
1
1
|
<script lang="ts" setup>
|
|
2
|
-
import {
|
|
2
|
+
import {
|
|
3
|
+
computed, onMounted, ref,
|
|
4
|
+
} from 'vue';
|
|
3
5
|
import AntField from '../forms/AntField.vue';
|
|
4
6
|
import AntBaseInput from './Elements/AntBaseInput.vue';
|
|
5
7
|
import AntIcon from '../AntIcon.vue';
|
|
6
|
-
import {
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
import {
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
import {
|
|
13
|
-
|
|
8
|
+
import {
|
|
9
|
+
Size,
|
|
10
|
+
} from '../../enums/Size.enum';
|
|
11
|
+
import {
|
|
12
|
+
useVModel,
|
|
13
|
+
} from '@vueuse/core';
|
|
14
|
+
import {
|
|
15
|
+
InputState,
|
|
16
|
+
} from '../../enums';
|
|
17
|
+
import {
|
|
18
|
+
BaseInputType,
|
|
19
|
+
} from './Elements/__types';
|
|
20
|
+
import {
|
|
21
|
+
handleEnumValidation,
|
|
22
|
+
} from '../../handler';
|
|
23
|
+
import {
|
|
24
|
+
AntDateInputTypes,
|
|
25
|
+
} from './__types/AntDateInput.types';
|
|
26
|
+
import {
|
|
27
|
+
faCalendar, faClock,
|
|
28
|
+
} from '@fortawesome/free-solid-svg-icons';
|
|
29
|
+
import {
|
|
30
|
+
IconSize,
|
|
31
|
+
} from '../__types/AntIcon.types';
|
|
14
32
|
|
|
15
|
-
defineOptions({
|
|
33
|
+
defineOptions({
|
|
34
|
+
inheritAttrs: false,
|
|
35
|
+
});
|
|
16
36
|
|
|
17
37
|
const props = withDefaults(defineProps<{
|
|
18
38
|
modelValue: string | null;
|
|
@@ -32,9 +52,12 @@ const props = withDefaults(defineProps<{
|
|
|
32
52
|
readonly: false,
|
|
33
53
|
skeleton: false,
|
|
34
54
|
size: Size.md,
|
|
35
|
-
messages: () => []
|
|
55
|
+
messages: () => [],
|
|
36
56
|
});
|
|
37
|
-
const emit = defineEmits([
|
|
57
|
+
const emit = defineEmits([
|
|
58
|
+
'update:modelValue',
|
|
59
|
+
'validate',
|
|
60
|
+
]);
|
|
38
61
|
const _modelValue = useVModel(props, 'modelValue', emit);
|
|
39
62
|
const inputRef = ref<null | HTMLInputElement>(null);
|
|
40
63
|
const iconColor = computed(() => {
|
|
@@ -1,19 +1,37 @@
|
|
|
1
1
|
<script lang="ts" setup>
|
|
2
|
-
import {
|
|
2
|
+
import {
|
|
3
|
+
computed, onMounted,
|
|
4
|
+
} from 'vue';
|
|
3
5
|
import AntButton from '../buttons/AntButton.vue';
|
|
4
6
|
import AntField from '../forms/AntField.vue';
|
|
5
7
|
import AntBaseInput from './Elements/AntBaseInput.vue';
|
|
6
|
-
import {
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
import {
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
import {
|
|
8
|
+
import {
|
|
9
|
+
Size,
|
|
10
|
+
} from '../../enums/Size.enum';
|
|
11
|
+
import {
|
|
12
|
+
faPlus, faMinus,
|
|
13
|
+
} from '@fortawesome/free-solid-svg-icons';
|
|
14
|
+
import {
|
|
15
|
+
State, InputState,
|
|
16
|
+
} from '../../enums/State.enum';
|
|
17
|
+
import {
|
|
18
|
+
handleEnumValidation,
|
|
19
|
+
} from '../../handler';
|
|
20
|
+
import {
|
|
21
|
+
useVModel,
|
|
22
|
+
} from '@vueuse/core';
|
|
23
|
+
import {
|
|
24
|
+
Grouped,
|
|
25
|
+
} from '../../enums/Grouped.enum';
|
|
26
|
+
import {
|
|
27
|
+
BaseInputType,
|
|
28
|
+
} from './Elements/__types';
|
|
13
29
|
import Big from 'big.js';
|
|
14
30
|
Big.RM = Big.roundHalfEven;
|
|
15
31
|
|
|
16
|
-
defineOptions({
|
|
32
|
+
defineOptions({
|
|
33
|
+
inheritAttrs: false,
|
|
34
|
+
});
|
|
17
35
|
|
|
18
36
|
/**
|
|
19
37
|
* We use a string as the modelValue to ensure that numbers are correctly padded with a trailing 0 instead of cut off (e.g. 0.10 would be converted to 0.1).
|
|
@@ -44,9 +62,12 @@ const props = withDefaults(defineProps<{
|
|
|
44
62
|
steps: 1,
|
|
45
63
|
limiter: false,
|
|
46
64
|
messages: () => [],
|
|
47
|
-
indicators: false
|
|
65
|
+
indicators: false,
|
|
48
66
|
});
|
|
49
|
-
const emit = defineEmits([
|
|
67
|
+
const emit = defineEmits([
|
|
68
|
+
'update:modelValue',
|
|
69
|
+
'validate',
|
|
70
|
+
]);
|
|
50
71
|
const _modelValue = useVModel(props, 'modelValue', emit);
|
|
51
72
|
|
|
52
73
|
const isPrevButtonDisabled = computed(() => {
|
|
@@ -154,7 +175,7 @@ function onButtonBlur() {
|
|
|
154
175
|
v-model.number="_modelValue"
|
|
155
176
|
:type="BaseInputType.number"
|
|
156
177
|
:grouped="indicators ? Grouped.center : Grouped.none"
|
|
157
|
-
wrapper-class="
|
|
178
|
+
wrapper-class="grow"
|
|
158
179
|
:state="state"
|
|
159
180
|
:size="size"
|
|
160
181
|
:skeleton="skeleton"
|
|
@@ -1,17 +1,35 @@
|
|
|
1
1
|
<script lang="ts" setup>
|
|
2
|
-
import {
|
|
2
|
+
import {
|
|
3
|
+
computed, onMounted, ref,
|
|
4
|
+
} from 'vue';
|
|
3
5
|
import AntField from '../forms/AntField.vue';
|
|
4
6
|
import AntBaseInput from './Elements/AntBaseInput.vue';
|
|
5
7
|
import AntIcon from '../AntIcon.vue';
|
|
6
|
-
import {
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
import {
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
import {
|
|
8
|
+
import {
|
|
9
|
+
Size,
|
|
10
|
+
} from '../../enums/Size.enum';
|
|
11
|
+
import {
|
|
12
|
+
faEye, faEyeSlash,
|
|
13
|
+
} from '@fortawesome/free-solid-svg-icons';
|
|
14
|
+
import {
|
|
15
|
+
useVModel,
|
|
16
|
+
} from '@vueuse/core';
|
|
17
|
+
import {
|
|
18
|
+
InputState,
|
|
19
|
+
} from '../../enums';
|
|
20
|
+
import {
|
|
21
|
+
BaseInputType,
|
|
22
|
+
} from './Elements/__types';
|
|
23
|
+
import {
|
|
24
|
+
handleEnumValidation,
|
|
25
|
+
} from '../../handler';
|
|
26
|
+
import {
|
|
27
|
+
IconSize,
|
|
28
|
+
} from '../__types/AntIcon.types';
|
|
13
29
|
|
|
14
|
-
defineOptions({
|
|
30
|
+
defineOptions({
|
|
31
|
+
inheritAttrs: false,
|
|
32
|
+
});
|
|
15
33
|
|
|
16
34
|
const props = withDefaults(defineProps<{
|
|
17
35
|
modelValue: string | null;
|
|
@@ -28,9 +46,12 @@ const props = withDefaults(defineProps<{
|
|
|
28
46
|
disabled: false,
|
|
29
47
|
skeleton: false,
|
|
30
48
|
size: Size.md,
|
|
31
|
-
messages: () => []
|
|
49
|
+
messages: () => [],
|
|
32
50
|
});
|
|
33
|
-
const emit = defineEmits([
|
|
51
|
+
const emit = defineEmits([
|
|
52
|
+
'update:modelValue',
|
|
53
|
+
'validate',
|
|
54
|
+
]);
|
|
34
55
|
const _modelValue = useVModel(props, 'modelValue', emit);
|
|
35
56
|
const isVisible = ref(false);
|
|
36
57
|
const iconSize = computed(() => {
|