@antify/ui-module 1.7.1 → 1.7.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/module.d.mts +1 -14
- package/dist/module.d.ts +1 -14
- package/dist/module.json +1 -1
- package/dist/module.mjs +1 -19
- package/dist/runtime/components/AntTooltip.vue +72 -66
- package/dist/runtime/components/__stories/AntTooltip.stories.d.ts +5 -0
- package/dist/runtime/components/__stories/AntTooltip.stories.mjs +24 -0
- package/dist/runtime/components/buttons/AntActionButton.vue +22 -19
- package/dist/runtime/components/buttons/AntSaveAndNewButton.vue +12 -11
- package/dist/runtime/components/buttons/AntSaveButton.vue +11 -10
- package/dist/runtime/components/buttons/__stories/AntActionButton.stories.mjs +9 -5
- package/dist/runtime/components/crud/AntCrudDetailActions.vue +1 -1
- package/dist/runtime/components/crud/AntCrudDetailNav.vue +9 -2
- package/dist/runtime/components/dialogs/AntDialog.vue +1 -1
- package/dist/runtime/components/forms/AntField.vue +17 -3
- package/dist/runtime/components/inputs/AntCheckbox.vue +18 -19
- package/dist/runtime/components/inputs/AntCheckboxGroup.vue +4 -4
- package/dist/runtime/components/inputs/AntDateInput.vue +8 -1
- package/dist/runtime/components/inputs/AntNumberInput.vue +5 -0
- package/dist/runtime/components/inputs/AntRadio.vue +45 -31
- package/dist/runtime/components/inputs/AntRadioGroup.vue +19 -8
- package/dist/runtime/components/inputs/AntSearch.vue +3 -0
- package/dist/runtime/components/inputs/AntSelect.vue +13 -5
- package/dist/runtime/components/inputs/AntSwitch.vue +31 -19
- package/dist/runtime/components/inputs/AntTagInput.vue +18 -10
- package/dist/runtime/components/inputs/AntTextInput.vue +3 -0
- package/dist/runtime/components/inputs/AntTextarea.vue +11 -5
- package/dist/runtime/components/inputs/AntUnitInput.vue +3 -0
- package/dist/runtime/components/inputs/Elements/AntBaseInput.vue +22 -7
- package/dist/runtime/components/inputs/Elements/AntInputLabel.vue +12 -8
- package/dist/runtime/components/inputs/Elements/__stories/AntInputLabel.stories.mjs +1 -1
- package/dist/runtime/components/inputs/__stories/AntCheckbox.stories.mjs +49 -8
- package/dist/runtime/components/inputs/__stories/AntCheckboxGroup.stories.mjs +2 -3
- package/dist/runtime/components/inputs/__stories/AntNumberInput.stories.d.ts +1 -0
- package/dist/runtime/components/inputs/__stories/AntNumberInput.stories.mjs +141 -1
- package/dist/runtime/components/inputs/__stories/AntRadioGroup.stories.mjs +14 -6
- package/dist/runtime/components/inputs/__stories/AntSwitch.stories.mjs +55 -7
- package/dist/runtime/components/inputs/__types/AntCheckbox.types.d.ts +0 -4
- package/dist/runtime/components/inputs/__types/AntCheckbox.types.mjs +0 -5
- package/dist/runtime/components/inputs/__types/AntRadio.types.d.ts +0 -4
- package/dist/runtime/components/inputs/__types/AntRadio.types.mjs +0 -5
- package/dist/runtime/components/inputs/__types/index.d.ts +0 -1
- package/dist/runtime/components/inputs/__types/index.mjs +0 -1
- package/dist/runtime/components/table/AntTable.vue +3 -3
- package/dist/runtime/components/table/AntTableSortButton.vue +1 -1
- package/dist/runtime/components/table/AntTd.vue +1 -1
- package/dist/runtime/components/table/AntTh.vue +9 -5
- package/dist/types.d.mts +1 -1
- package/dist/types.d.ts +1 -1
- package/package.json +1 -1
- package/src/runtime/components/AntTooltip.vue +72 -66
- package/src/runtime/components/buttons/AntActionButton.vue +22 -19
- package/src/runtime/components/buttons/AntSaveAndNewButton.vue +12 -11
- package/src/runtime/components/buttons/AntSaveButton.vue +11 -10
- package/src/runtime/components/crud/AntCrudDetailActions.vue +1 -1
- package/src/runtime/components/crud/AntCrudDetailNav.vue +9 -2
- package/src/runtime/components/dialogs/AntDialog.vue +1 -1
- package/src/runtime/components/forms/AntField.vue +17 -3
- package/src/runtime/components/inputs/AntCheckbox.vue +18 -19
- package/src/runtime/components/inputs/AntCheckboxGroup.vue +4 -4
- package/src/runtime/components/inputs/AntDateInput.vue +8 -1
- package/src/runtime/components/inputs/AntNumberInput.vue +5 -0
- package/src/runtime/components/inputs/AntRadio.vue +45 -31
- package/src/runtime/components/inputs/AntRadioGroup.vue +19 -8
- package/src/runtime/components/inputs/AntSearch.vue +3 -0
- package/src/runtime/components/inputs/AntSelect.vue +13 -5
- package/src/runtime/components/inputs/AntSwitch.vue +31 -19
- package/src/runtime/components/inputs/AntTagInput.vue +18 -10
- package/src/runtime/components/inputs/AntTextInput.vue +3 -0
- package/src/runtime/components/inputs/AntTextarea.vue +11 -5
- package/src/runtime/components/inputs/AntUnitInput.vue +3 -0
- package/src/runtime/components/inputs/Elements/AntBaseInput.vue +22 -7
- package/src/runtime/components/inputs/Elements/AntInputLabel.vue +12 -8
- package/src/runtime/components/table/AntTable.vue +3 -3
- package/src/runtime/components/table/AntTableSortButton.vue +1 -1
- package/src/runtime/components/table/AntTd.vue +1 -1
- package/src/runtime/components/table/AntTh.vue +9 -5
- package/dist/runtime/components/inputs/__types/AntSwitch.types.d.ts +0 -4
- package/dist/runtime/components/inputs/__types/AntSwitch.types.mjs +0 -5
|
@@ -2,7 +2,7 @@ import AntSwitch from "../AntSwitch.vue";
|
|
|
2
2
|
import { computed, reactive, ref } from "vue";
|
|
3
3
|
import { InputState } from "../../../enums/index.mjs";
|
|
4
4
|
import { useFieldValidator } from "@antify/validate";
|
|
5
|
-
import {
|
|
5
|
+
import { Size } from "../../../enums/Size.enum.mjs";
|
|
6
6
|
import AntFormGroup from "../../forms/AntFormGroup.vue";
|
|
7
7
|
import AntFormGroupLabel from "../../forms/AntFormGroupLabel.vue";
|
|
8
8
|
const meta = {
|
|
@@ -15,7 +15,7 @@ const meta = {
|
|
|
15
15
|
},
|
|
16
16
|
size: {
|
|
17
17
|
control: { type: "select" },
|
|
18
|
-
options: Object.values(
|
|
18
|
+
options: Object.values(Size)
|
|
19
19
|
}
|
|
20
20
|
}
|
|
21
21
|
};
|
|
@@ -78,7 +78,7 @@ export const Summary = {
|
|
|
78
78
|
setup() {
|
|
79
79
|
const value = ref(true);
|
|
80
80
|
const notValue = ref(false);
|
|
81
|
-
return { args, value, notValue, InputState,
|
|
81
|
+
return { args, value, notValue, InputState, Size };
|
|
82
82
|
},
|
|
83
83
|
template: `
|
|
84
84
|
<AntFormGroup>
|
|
@@ -163,7 +163,7 @@ export const Summary = {
|
|
|
163
163
|
<AntSwitch
|
|
164
164
|
v-model="notValue"
|
|
165
165
|
class="w-28"
|
|
166
|
-
:size="
|
|
166
|
+
:size="Size.lg"
|
|
167
167
|
label="Label"
|
|
168
168
|
description="Lorem ipsum dolor sit amet"
|
|
169
169
|
>Content
|
|
@@ -171,7 +171,7 @@ export const Summary = {
|
|
|
171
171
|
<AntSwitch
|
|
172
172
|
v-model="value"
|
|
173
173
|
class="w-28"
|
|
174
|
-
:size="
|
|
174
|
+
:size="Size.lg"
|
|
175
175
|
label="Label"
|
|
176
176
|
description="Lorem ipsum dolor sit amet"
|
|
177
177
|
>Content
|
|
@@ -179,7 +179,7 @@ export const Summary = {
|
|
|
179
179
|
<AntSwitch
|
|
180
180
|
v-model="notValue"
|
|
181
181
|
class="w-28"
|
|
182
|
-
:size="
|
|
182
|
+
:size="Size.md"
|
|
183
183
|
label="Label"
|
|
184
184
|
description="Lorem ipsum dolor sit amet"
|
|
185
185
|
>Content
|
|
@@ -187,7 +187,55 @@ export const Summary = {
|
|
|
187
187
|
<AntSwitch
|
|
188
188
|
v-model="value"
|
|
189
189
|
class="w-28"
|
|
190
|
-
:size="
|
|
190
|
+
:size="Size.md"
|
|
191
|
+
label="Label"
|
|
192
|
+
description="Lorem ipsum dolor sit amet"
|
|
193
|
+
>Content
|
|
194
|
+
</AntSwitch>
|
|
195
|
+
<AntSwitch
|
|
196
|
+
v-model="notValue"
|
|
197
|
+
class="w-28"
|
|
198
|
+
:size="Size.sm"
|
|
199
|
+
label="Label"
|
|
200
|
+
description="Lorem ipsum dolor sit amet"
|
|
201
|
+
>Content
|
|
202
|
+
</AntSwitch>
|
|
203
|
+
<AntSwitch
|
|
204
|
+
v-model="value"
|
|
205
|
+
class="w-28"
|
|
206
|
+
:size="Size.sm"
|
|
207
|
+
label="Label"
|
|
208
|
+
description="Lorem ipsum dolor sit amet"
|
|
209
|
+
>Content
|
|
210
|
+
</AntSwitch>
|
|
211
|
+
<AntSwitch
|
|
212
|
+
v-model="notValue"
|
|
213
|
+
class="w-28"
|
|
214
|
+
:size="Size.xs"
|
|
215
|
+
label="Label"
|
|
216
|
+
description="Lorem ipsum dolor sit amet"
|
|
217
|
+
>Content
|
|
218
|
+
</AntSwitch>
|
|
219
|
+
<AntSwitch
|
|
220
|
+
v-model="value"
|
|
221
|
+
class="w-28"
|
|
222
|
+
:size="Size.xs"
|
|
223
|
+
label="Label"
|
|
224
|
+
description="Lorem ipsum dolor sit amet"
|
|
225
|
+
>Content
|
|
226
|
+
</AntSwitch>
|
|
227
|
+
<AntSwitch
|
|
228
|
+
v-model="notValue"
|
|
229
|
+
class="w-28"
|
|
230
|
+
:size="Size.xs2"
|
|
231
|
+
label="Label"
|
|
232
|
+
description="Lorem ipsum dolor sit amet"
|
|
233
|
+
>Content
|
|
234
|
+
</AntSwitch>
|
|
235
|
+
<AntSwitch
|
|
236
|
+
v-model="value"
|
|
237
|
+
class="w-28"
|
|
238
|
+
:size="Size.xs2"
|
|
191
239
|
label="Label"
|
|
192
240
|
description="Lorem ipsum dolor sit amet"
|
|
193
241
|
>Content
|
|
@@ -2,7 +2,6 @@ export * from './AntCheckbox.types';
|
|
|
2
2
|
export * from './AntDateInput.types';
|
|
3
3
|
export * from './AntRadio.types';
|
|
4
4
|
export * from './AntSelect.types';
|
|
5
|
-
export * from './AntSwitch.types';
|
|
6
5
|
export * from './AntSwitcher.types';
|
|
7
6
|
export * from './AntTagInput.types';
|
|
8
7
|
export * from './AntTextInput.types';
|
|
@@ -2,7 +2,6 @@ export * from "./AntCheckbox.types.mjs";
|
|
|
2
2
|
export * from "./AntDateInput.types.mjs";
|
|
3
3
|
export * from "./AntRadio.types.mjs";
|
|
4
4
|
export * from "./AntSelect.types.mjs";
|
|
5
|
-
export * from "./AntSwitch.types.mjs";
|
|
6
5
|
export * from "./AntSwitcher.types.mjs";
|
|
7
6
|
export * from "./AntTagInput.types.mjs";
|
|
8
7
|
export * from "./AntTextInput.types.mjs";
|
|
@@ -27,7 +27,7 @@ const props = withDefaults(
|
|
|
27
27
|
loading?: boolean;
|
|
28
28
|
selectableRows?: boolean;
|
|
29
29
|
showLightVersion?: boolean;
|
|
30
|
-
size
|
|
30
|
+
size?: AntTableSize
|
|
31
31
|
}>(), {
|
|
32
32
|
rowKey: 'id',
|
|
33
33
|
loading: false,
|
|
@@ -96,7 +96,7 @@ function rowClick(elem: Record<string, unknown>): void {
|
|
|
96
96
|
class="min-w-full max-h-full relative"
|
|
97
97
|
:class="{'h-full': data.length === 0 && !_loading}"
|
|
98
98
|
>
|
|
99
|
-
<thead class="bg-neutral-
|
|
99
|
+
<thead class="bg-neutral-200 sticky top-0 z-10">
|
|
100
100
|
<tr>
|
|
101
101
|
<slot name="headerFirstCell" />
|
|
102
102
|
|
|
@@ -129,7 +129,7 @@ function rowClick(elem: Record<string, unknown>): void {
|
|
|
129
129
|
:key="`table-row-${elem[rowKey]}-${index}`"
|
|
130
130
|
class="transition-all"
|
|
131
131
|
:class="{
|
|
132
|
-
'bg-primary-
|
|
132
|
+
'bg-primary-200 text-primary-200-font': elem === selected,
|
|
133
133
|
'bg-white text-for-white-bg-font': elem !== selected && index % 2 === 0,
|
|
134
134
|
'bg-neutral-100 text-neutral-100-font': elem !== selected && index % 2 !== 0,
|
|
135
135
|
'cursor-pointer': selectableRows
|
|
@@ -5,14 +5,18 @@ import {computed, ref, type Ref} from 'vue';
|
|
|
5
5
|
import AntTableSortButton from './AntTableSortButton.vue';
|
|
6
6
|
|
|
7
7
|
defineEmits([ 'sort' ]);
|
|
8
|
-
const props =
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
8
|
+
const props = withDefaults(
|
|
9
|
+
defineProps<{
|
|
10
|
+
header: TableHeader
|
|
11
|
+
size?: AntTableSize
|
|
12
|
+
}>(), {
|
|
13
|
+
size: AntTableSize.md
|
|
14
|
+
}
|
|
15
|
+
);
|
|
12
16
|
|
|
13
17
|
const headerClasses = computed(() => ({
|
|
14
18
|
[props.header.headerClassList || '']: true,
|
|
15
|
-
'text-sm text-neutral-
|
|
19
|
+
'text-sm text-neutral-200-font uppercase font-semi-bold': true,
|
|
16
20
|
'text-left': !props.header.align || props.header.align === AntTableAlign.left,
|
|
17
21
|
'text-center': props.header.align === AntTableAlign.center,
|
|
18
22
|
'text-right': props.header.align === AntTableAlign.right,
|
package/dist/types.d.mts
CHANGED
|
@@ -5,4 +5,4 @@ import type { } from './module.js'
|
|
|
5
5
|
|
|
6
6
|
|
|
7
7
|
|
|
8
|
-
export type {
|
|
8
|
+
export type { AntCheckboxType, AntDateInputTypes, AntKeycapSize, AntRadioTypes, AntSpinnerSize, AntTableAlign, AntTableRowTypes, AntTableSize, AntTableSortDirection, AntTagInputSize, AntTagSize, BaseInputType, ButtonType, CollapseStrategy, CornerPosition, Direction, Grouped, IconSize, InputState, ListGroupItemState, NavbarItemTypes, Position, SelectOption, Size, State, SwitcherOption, TabItem, TabItemState, TableHeader, TagState, TextInputType, Toast, default } from './module.js'
|
package/dist/types.d.ts
CHANGED
|
@@ -5,4 +5,4 @@ import type { } from './module'
|
|
|
5
5
|
|
|
6
6
|
|
|
7
7
|
|
|
8
|
-
export type {
|
|
8
|
+
export type { AntCheckboxType, AntDateInputTypes, AntKeycapSize, AntRadioTypes, AntSpinnerSize, AntTableAlign, AntTableRowTypes, AntTableSize, AntTableSortDirection, AntTagInputSize, AntTagSize, BaseInputType, ButtonType, CollapseStrategy, CornerPosition, Direction, Grouped, IconSize, InputState, ListGroupItemState, NavbarItemTypes, Position, SelectOption, Size, State, SwitcherOption, TabItem, TabItemState, TableHeader, TagState, TextInputType, Toast, default } from './module'
|
package/package.json
CHANGED
|
@@ -6,104 +6,110 @@ import {classesToObjectSyntax} from '../utils';
|
|
|
6
6
|
import {hasSlotContent} from '../utils';
|
|
7
7
|
|
|
8
8
|
const props = withDefaults(defineProps<{
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
9
|
+
position?: Position
|
|
10
|
+
tooltipClasses?: string | Record<string, boolean>
|
|
11
|
+
state?: InputState
|
|
12
|
+
expanded?: boolean
|
|
13
|
+
delay?: number
|
|
14
14
|
}>(), {
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
15
|
+
position: Position.left,
|
|
16
|
+
tooltipClasses: '',
|
|
17
|
+
state: InputState.base,
|
|
18
|
+
expanded: false,
|
|
19
|
+
delay: 800
|
|
20
20
|
});
|
|
21
21
|
const visible = ref(false);
|
|
22
22
|
const _tooltipClasses = computed(() => ({
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
23
|
+
'absolute w-max inline-flex': true,
|
|
24
|
+
// Position
|
|
25
|
+
'bottom-full pb-3.5': props.position === Position.top,
|
|
26
|
+
'top-full pt-3.5': props.position === Position.bottom,
|
|
27
|
+
'right-full pr-3.5': props.position === Position.left,
|
|
28
|
+
'left-full pl-3.5': props.position === Position.right,
|
|
29
|
+
...classesToObjectSyntax(props.tooltipClasses)
|
|
30
30
|
}));
|
|
31
31
|
const classes = computed(() => ({
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
32
|
+
'z-10 absolute flex': true,
|
|
33
|
+
'top-0 left-0 right-0 -m-[2px] justify-center': props.position === Position.bottom,
|
|
34
|
+
'bottom-0 left-0 right-0 -m-[2px] justify-center': props.position === Position.top,
|
|
35
|
+
'top-0 left-0 bottom-0 -ml-[2.2px] items-center': props.position === Position.right,
|
|
36
|
+
'top-0 right-0 bottom-0 -mr-[2.2px] items-center': props.position === Position.left,
|
|
37
37
|
}));
|
|
38
38
|
const itemContainerClasses = computed(() => ({
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
39
|
+
'relative flex items-center': true,
|
|
40
|
+
'justify-center': props.position === Position.bottom,
|
|
41
|
+
'justify-center rotate-180': props.position === Position.top,
|
|
42
|
+
'justify-center -rotate-90': props.position === Position.right,
|
|
43
|
+
'justify-center rotate-90': props.position === Position.left,
|
|
44
44
|
}));
|
|
45
45
|
const contentClasses = computed(() => {
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
46
|
+
const variants: Record<InputState, string> = {
|
|
47
|
+
[InputState.base]: 'text-for-white-bg-font bg-white border-neutral-300',
|
|
48
|
+
[InputState.danger]: 'text-danger-500-font bg-danger-500 border-danger-500',
|
|
49
|
+
[InputState.info]: 'text-info-500-font bg-info-500 border-info-500',
|
|
50
|
+
[InputState.success]: 'text-success-500-font bg-success-500 border-success-500',
|
|
51
|
+
[InputState.warning]: 'text-warning-500-font bg-warning-500 border-warning-500',
|
|
52
|
+
};
|
|
53
|
+
|
|
54
|
+
return {[variants[props.state]]: true};
|
|
55
55
|
});
|
|
56
56
|
const svgPathClasses = computed(() => {
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
57
|
+
const variants: Record<InputState, string> = {
|
|
58
|
+
[InputState.base]: 'fill-white stroke-white',
|
|
59
|
+
[InputState.danger]: 'fill-danger-500 stroke-danger-500',
|
|
60
|
+
[InputState.info]: 'fill-info-500 stroke-info-500',
|
|
61
|
+
[InputState.success]: 'fill-success-500 stroke-success-500',
|
|
62
|
+
[InputState.warning]: 'fill-warning-500 stroke-warning-500',
|
|
63
|
+
};
|
|
64
|
+
|
|
65
|
+
return {[variants[props.state]]: true};
|
|
66
66
|
});
|
|
67
67
|
const arrowSvgPathClasses = computed(() => {
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
68
|
+
const variants: Record<InputState, string> = {
|
|
69
|
+
[InputState.base]: 'stroke-neutral-300',
|
|
70
|
+
[InputState.danger]: 'stroke-danger-500',
|
|
71
|
+
[InputState.info]: 'stroke-info-500',
|
|
72
|
+
[InputState.success]: 'stroke-success-500',
|
|
73
|
+
[InputState.warning]: 'stroke-warning-500',
|
|
74
|
+
};
|
|
75
|
+
|
|
76
|
+
return {[variants[props.state]]: true};
|
|
77
77
|
});
|
|
78
78
|
const timeout = ref<number | undefined>();
|
|
79
79
|
const clickLock = ref(false);
|
|
80
80
|
const uuid = ref(getCurrentInstance()?.uid);
|
|
81
81
|
|
|
82
82
|
onMounted(() => {
|
|
83
|
-
|
|
84
|
-
|
|
83
|
+
handleEnumValidation(props.position, Position, 'position');
|
|
84
|
+
handleEnumValidation(props.state, InputState, 'state');
|
|
85
85
|
});
|
|
86
86
|
|
|
87
87
|
function onMouseOver() {
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
88
|
+
if (visible.value || clickLock.value) {
|
|
89
|
+
return;
|
|
90
|
+
}
|
|
91
91
|
|
|
92
|
-
|
|
92
|
+
/**
|
|
93
|
+
* To prevent buggy behavior when hovering over multiple tooltips in quick succession,
|
|
94
|
+
* we clear the timeout before setting a new one.
|
|
95
|
+
*/
|
|
96
|
+
clearTimeout(timeout.value);
|
|
97
|
+
|
|
98
|
+
timeout.value = setTimeout(() => visible.value = true, props.delay) as unknown as number;
|
|
93
99
|
}
|
|
94
100
|
|
|
95
101
|
function onMouseLeave() {
|
|
96
|
-
|
|
102
|
+
clearTimeout(timeout.value);
|
|
97
103
|
|
|
98
|
-
|
|
99
|
-
|
|
104
|
+
visible.value = false;
|
|
105
|
+
clickLock.value = false;
|
|
100
106
|
}
|
|
101
107
|
|
|
102
108
|
function onClick() {
|
|
103
|
-
|
|
109
|
+
clearTimeout(timeout.value);
|
|
104
110
|
|
|
105
|
-
|
|
106
|
-
|
|
111
|
+
visible.value = false;
|
|
112
|
+
clickLock.value = true;
|
|
107
113
|
}
|
|
108
114
|
</script>
|
|
109
115
|
|
|
@@ -11,25 +11,27 @@ import {hasSlotContent} from '../../utils';
|
|
|
11
11
|
|
|
12
12
|
defineEmits(['click', 'blur']);
|
|
13
13
|
const props = withDefaults(
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
14
|
+
defineProps<{
|
|
15
|
+
iconLeft?: IconDefinition;
|
|
16
|
+
iconRight?: IconDefinition;
|
|
17
|
+
size?: Size;
|
|
18
|
+
disabled?: boolean;
|
|
19
|
+
grouped?: Grouped;
|
|
20
|
+
state?: State;
|
|
21
|
+
skeleton?: boolean;
|
|
22
|
+
expanded?: boolean;
|
|
23
|
+
filled?: boolean;
|
|
24
|
+
hasPermission?: boolean;
|
|
25
|
+
tooltipPosition?: Position;
|
|
26
|
+
tooltipState?: InputState;
|
|
27
|
+
tooltipDelay?: number;
|
|
28
|
+
submit?: boolean;
|
|
29
|
+
}>(), {
|
|
30
|
+
state: State.primary,
|
|
31
|
+
hasPermission: true,
|
|
32
|
+
filled: true,
|
|
33
|
+
submit: false
|
|
34
|
+
}
|
|
33
35
|
);
|
|
34
36
|
const slots = useSlots();
|
|
35
37
|
const hasTooltip = computed(() => !props.skeleton && !props.disabled && props.hasPermission && hasSlotContent(slots['tooltipContent']));
|
|
@@ -50,6 +52,7 @@ const hasPermissionTooltip = computed(() => !props.skeleton && !props.disabled &
|
|
|
50
52
|
:tooltip-position="tooltipPosition"
|
|
51
53
|
:tooltip-state="hasPermissionTooltip ? InputState.info : tooltipState"
|
|
52
54
|
:tooltip-delay="hasPermissionTooltip ? 300 : tooltipDelay"
|
|
55
|
+
:submit="submit"
|
|
53
56
|
data-e2e="action-button"
|
|
54
57
|
@click="$emit('click')"
|
|
55
58
|
@blur="$emit('blur')"
|
|
@@ -5,23 +5,23 @@ import {faFloppyDisk, faPlus} from '@fortawesome/free-solid-svg-icons';
|
|
|
5
5
|
|
|
6
6
|
defineEmits(['click', 'blur']);
|
|
7
7
|
withDefaults(defineProps<{
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
8
|
+
iconVariant?: boolean;
|
|
9
|
+
size?: Size;
|
|
10
|
+
disabled?: boolean;
|
|
11
|
+
grouped?: Grouped;
|
|
12
|
+
skeleton?: boolean;
|
|
13
|
+
expanded?: boolean;
|
|
14
|
+
canSave?: boolean;
|
|
15
|
+
tooltipPosition?: Position;
|
|
16
16
|
}>(), {
|
|
17
|
-
|
|
18
|
-
|
|
17
|
+
iconVariant: false,
|
|
18
|
+
canSave: true
|
|
19
19
|
});
|
|
20
20
|
</script>
|
|
21
21
|
|
|
22
22
|
<template>
|
|
23
23
|
<AntActionButton
|
|
24
|
-
:filled="
|
|
24
|
+
:filled="true"
|
|
25
25
|
:state="State.primary"
|
|
26
26
|
:size="size"
|
|
27
27
|
:disabled="disabled"
|
|
@@ -30,6 +30,7 @@ withDefaults(defineProps<{
|
|
|
30
30
|
:grouped="grouped"
|
|
31
31
|
:skeleton="skeleton"
|
|
32
32
|
:expanded="expanded"
|
|
33
|
+
:submit="true"
|
|
33
34
|
:has-permission="canSave"
|
|
34
35
|
:tooltip-position="tooltipPosition"
|
|
35
36
|
data-e2e="save-and-new-button"
|
|
@@ -5,17 +5,17 @@ import {faFloppyDisk} from '@fortawesome/free-solid-svg-icons';
|
|
|
5
5
|
|
|
6
6
|
defineEmits(['click', 'blur']);
|
|
7
7
|
withDefaults(defineProps<{
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
8
|
+
iconVariant?: boolean;
|
|
9
|
+
size?: Size;
|
|
10
|
+
disabled?: boolean;
|
|
11
|
+
grouped?: Grouped;
|
|
12
|
+
skeleton?: boolean;
|
|
13
|
+
expanded?: boolean;
|
|
14
|
+
canSave?: boolean;
|
|
15
|
+
tooltipPosition?: Position;
|
|
16
16
|
}>(), {
|
|
17
|
-
|
|
18
|
-
|
|
17
|
+
iconVariant: false,
|
|
18
|
+
canSave: true
|
|
19
19
|
});
|
|
20
20
|
</script>
|
|
21
21
|
|
|
@@ -29,6 +29,7 @@ withDefaults(defineProps<{
|
|
|
29
29
|
:grouped="grouped"
|
|
30
30
|
:skeleton="skeleton"
|
|
31
31
|
:expanded="expanded"
|
|
32
|
+
:submit="true"
|
|
32
33
|
:has-permission="canSave"
|
|
33
34
|
:tooltip-position="tooltipPosition"
|
|
34
35
|
data-e2e="save-button"
|
|
@@ -13,9 +13,14 @@ withDefaults(defineProps<{
|
|
|
13
13
|
deleteButtonDisabled?: boolean
|
|
14
14
|
getEntityName: () => string
|
|
15
15
|
canDelete?: boolean
|
|
16
|
+
showDeleteButton?: boolean
|
|
17
|
+
skeleton?: boolean
|
|
16
18
|
}>(), {
|
|
19
|
+
tabItems: () => [],
|
|
17
20
|
deleteButtonDisabled: false,
|
|
18
|
-
canDelete: true
|
|
21
|
+
canDelete: true,
|
|
22
|
+
showDeleteButton: true,
|
|
23
|
+
skeleton: false
|
|
19
24
|
});
|
|
20
25
|
|
|
21
26
|
const dialogOpen = ref(false);
|
|
@@ -23,7 +28,7 @@ const dialogOpen = ref(false);
|
|
|
23
28
|
|
|
24
29
|
<template>
|
|
25
30
|
<div
|
|
26
|
-
class="flex justify-between items-stretch gap-2 bg-white"
|
|
31
|
+
class="flex justify-between items-stretch gap-2 bg-white h-[52px]"
|
|
27
32
|
data-e2e="crud-detail-nav"
|
|
28
33
|
>
|
|
29
34
|
<slot name="tabs">
|
|
@@ -37,7 +42,9 @@ const dialogOpen = ref(false);
|
|
|
37
42
|
<slot name="before-delete-button" />
|
|
38
43
|
|
|
39
44
|
<AntDeleteButton
|
|
45
|
+
v-if="showDeleteButton"
|
|
40
46
|
:disabled="deleteButtonDisabled || !canDelete"
|
|
47
|
+
:skeleton="skeleton"
|
|
41
48
|
filled
|
|
42
49
|
:can-delete="canDelete"
|
|
43
50
|
:invalid-permission-tooltip-position="Position.left"
|
|
@@ -101,7 +101,7 @@ function confirmDialog() {
|
|
|
101
101
|
</slot>
|
|
102
102
|
</div>
|
|
103
103
|
|
|
104
|
-
<div class="bg-white p-2 grow flex items-
|
|
104
|
+
<div class="bg-white p-2 grow flex items-start gap-2 text-sm text-for-white-bg-font">
|
|
105
105
|
<slot name="icon">
|
|
106
106
|
<AntIcon
|
|
107
107
|
v-if="icons[state]"
|