@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
package/dist/module.d.mts
CHANGED
|
@@ -129,10 +129,6 @@ type AntCheckboxType = {
|
|
|
129
129
|
disabled?: boolean;
|
|
130
130
|
readonly?: boolean;
|
|
131
131
|
};
|
|
132
|
-
declare enum AntCheckboxSize {
|
|
133
|
-
md = "md",
|
|
134
|
-
sm = "sm"
|
|
135
|
-
}
|
|
136
132
|
|
|
137
133
|
declare enum AntDateInputTypes {
|
|
138
134
|
date = "date",
|
|
@@ -142,10 +138,6 @@ declare enum AntDateInputTypes {
|
|
|
142
138
|
week = "week"
|
|
143
139
|
}
|
|
144
140
|
|
|
145
|
-
declare enum AntRadioSize {
|
|
146
|
-
md = "md",
|
|
147
|
-
sm = "sm"
|
|
148
|
-
}
|
|
149
141
|
type AntRadioTypes = {
|
|
150
142
|
value: string;
|
|
151
143
|
label?: string;
|
|
@@ -160,11 +152,6 @@ type SelectOption = {
|
|
|
160
152
|
value: string | number;
|
|
161
153
|
};
|
|
162
154
|
|
|
163
|
-
declare enum AntSwitchSize {
|
|
164
|
-
md = "md",
|
|
165
|
-
sm = "sm"
|
|
166
|
-
}
|
|
167
|
-
|
|
168
155
|
type SwitcherOption = {
|
|
169
156
|
label: string;
|
|
170
157
|
value: string | number;
|
|
@@ -266,4 +253,4 @@ declare enum TabItemState {
|
|
|
266
253
|
type ModuleOptions = {};
|
|
267
254
|
declare const module: NuxtModule<ModuleOptions>;
|
|
268
255
|
|
|
269
|
-
export {
|
|
256
|
+
export { type AntCheckboxType, AntDateInputTypes, AntKeycapSize, type AntRadioTypes, AntSpinnerSize, AntTableAlign, AntTableRowTypes, AntTableSize, AntTableSortDirection, AntTagInputSize, AntTagSize, BaseInputType, ButtonType, CollapseStrategy, CornerPosition, Direction, Grouped, IconSize, InputState, ListGroupItemState, type NavbarItemTypes, Position, type SelectOption, Size, State, type SwitcherOption, type TabItem, TabItemState, type TableHeader, TagState, TextInputType, type Toast, module as default };
|
package/dist/module.d.ts
CHANGED
|
@@ -129,10 +129,6 @@ type AntCheckboxType = {
|
|
|
129
129
|
disabled?: boolean;
|
|
130
130
|
readonly?: boolean;
|
|
131
131
|
};
|
|
132
|
-
declare enum AntCheckboxSize {
|
|
133
|
-
md = "md",
|
|
134
|
-
sm = "sm"
|
|
135
|
-
}
|
|
136
132
|
|
|
137
133
|
declare enum AntDateInputTypes {
|
|
138
134
|
date = "date",
|
|
@@ -142,10 +138,6 @@ declare enum AntDateInputTypes {
|
|
|
142
138
|
week = "week"
|
|
143
139
|
}
|
|
144
140
|
|
|
145
|
-
declare enum AntRadioSize {
|
|
146
|
-
md = "md",
|
|
147
|
-
sm = "sm"
|
|
148
|
-
}
|
|
149
141
|
type AntRadioTypes = {
|
|
150
142
|
value: string;
|
|
151
143
|
label?: string;
|
|
@@ -160,11 +152,6 @@ type SelectOption = {
|
|
|
160
152
|
value: string | number;
|
|
161
153
|
};
|
|
162
154
|
|
|
163
|
-
declare enum AntSwitchSize {
|
|
164
|
-
md = "md",
|
|
165
|
-
sm = "sm"
|
|
166
|
-
}
|
|
167
|
-
|
|
168
155
|
type SwitcherOption = {
|
|
169
156
|
label: string;
|
|
170
157
|
value: string | number;
|
|
@@ -266,4 +253,4 @@ declare enum TabItemState {
|
|
|
266
253
|
type ModuleOptions = {};
|
|
267
254
|
declare const module: NuxtModule<ModuleOptions>;
|
|
268
255
|
|
|
269
|
-
export {
|
|
256
|
+
export { type AntCheckboxType, AntDateInputTypes, AntKeycapSize, type AntRadioTypes, AntSpinnerSize, AntTableAlign, AntTableRowTypes, AntTableSize, AntTableSortDirection, AntTagInputSize, AntTagSize, BaseInputType, ButtonType, CollapseStrategy, CornerPosition, Direction, Grouped, IconSize, InputState, ListGroupItemState, type NavbarItemTypes, Position, type SelectOption, Size, State, type SwitcherOption, type TabItem, TabItemState, type TableHeader, TagState, TextInputType, type Toast, module as default };
|
package/dist/module.json
CHANGED
package/dist/module.mjs
CHANGED
|
@@ -333,12 +333,6 @@ var ButtonType = /* @__PURE__ */ ((ButtonType2) => {
|
|
|
333
333
|
return ButtonType2;
|
|
334
334
|
})(ButtonType || {});
|
|
335
335
|
|
|
336
|
-
var AntCheckboxSize = /* @__PURE__ */ ((AntCheckboxSize2) => {
|
|
337
|
-
AntCheckboxSize2["md"] = "md";
|
|
338
|
-
AntCheckboxSize2["sm"] = "sm";
|
|
339
|
-
return AntCheckboxSize2;
|
|
340
|
-
})(AntCheckboxSize || {});
|
|
341
|
-
|
|
342
336
|
var AntDateInputTypes = /* @__PURE__ */ ((AntDateInputTypes2) => {
|
|
343
337
|
AntDateInputTypes2["date"] = "date";
|
|
344
338
|
AntDateInputTypes2["datetimeLocal"] = "datetime-local";
|
|
@@ -348,18 +342,6 @@ var AntDateInputTypes = /* @__PURE__ */ ((AntDateInputTypes2) => {
|
|
|
348
342
|
return AntDateInputTypes2;
|
|
349
343
|
})(AntDateInputTypes || {});
|
|
350
344
|
|
|
351
|
-
var AntRadioSize = /* @__PURE__ */ ((AntRadioSize2) => {
|
|
352
|
-
AntRadioSize2["md"] = "md";
|
|
353
|
-
AntRadioSize2["sm"] = "sm";
|
|
354
|
-
return AntRadioSize2;
|
|
355
|
-
})(AntRadioSize || {});
|
|
356
|
-
|
|
357
|
-
var AntSwitchSize = /* @__PURE__ */ ((AntSwitchSize2) => {
|
|
358
|
-
AntSwitchSize2["md"] = "md";
|
|
359
|
-
AntSwitchSize2["sm"] = "sm";
|
|
360
|
-
return AntSwitchSize2;
|
|
361
|
-
})(AntSwitchSize || {});
|
|
362
|
-
|
|
363
345
|
var AntTagInputSize = /* @__PURE__ */ ((AntTagInputSize2) => {
|
|
364
346
|
AntTagInputSize2["lg"] = "lg";
|
|
365
347
|
AntTagInputSize2["md"] = "md";
|
|
@@ -453,4 +435,4 @@ const module = defineNuxtModule({
|
|
|
453
435
|
}
|
|
454
436
|
});
|
|
455
437
|
|
|
456
|
-
export {
|
|
438
|
+
export { AntDateInputTypes, AntKeycapSize, AntSpinnerSize, AntTableAlign, AntTableRowTypes, AntTableSize, AntTableSortDirection, AntTagInputSize, AntTagSize, BaseInputType, ButtonType, CollapseStrategy, CornerPosition, Direction, Grouped, IconSize, InputState, ListGroupItemState, Position, Size, State, TabItemState, TagState, TextInputType, module as default };
|
|
@@ -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
|
|
|
@@ -8,4 +8,9 @@ export declare const Docs: Story;
|
|
|
8
8
|
* Make sure, no tooltip get shown if no content is provided.
|
|
9
9
|
*/
|
|
10
10
|
export declare const WithoutContent: Story;
|
|
11
|
+
/**
|
|
12
|
+
* Test multiple tooltips in one page to make sure that
|
|
13
|
+
* each tooltips delay does not bug with others.
|
|
14
|
+
*/
|
|
15
|
+
export declare const Multiple: Story;
|
|
11
16
|
export declare const Summary: Story;
|
|
@@ -100,6 +100,30 @@ export const WithoutContent = {
|
|
|
100
100
|
},
|
|
101
101
|
args: {}
|
|
102
102
|
};
|
|
103
|
+
export const Multiple = {
|
|
104
|
+
render: (args) => ({
|
|
105
|
+
components: { AntTooltip },
|
|
106
|
+
setup() {
|
|
107
|
+
return { args };
|
|
108
|
+
},
|
|
109
|
+
template: `
|
|
110
|
+
<div class="p-12 flex flex-col justify-center items-center gap-1">
|
|
111
|
+
<div class="flex gap-1">
|
|
112
|
+
<div
|
|
113
|
+
v-for="row in 5"
|
|
114
|
+
class="flex flex-col gap-1"
|
|
115
|
+
>
|
|
116
|
+
<AntTooltip v-for="item of 5">
|
|
117
|
+
<div class="box">Hover me</div>
|
|
118
|
+
|
|
119
|
+
<template #content>Lorem</template>
|
|
120
|
+
</AntTooltip>
|
|
121
|
+
</div>
|
|
122
|
+
</div>
|
|
123
|
+
</div>
|
|
124
|
+
`
|
|
125
|
+
})
|
|
126
|
+
};
|
|
103
127
|
export const Summary = {
|
|
104
128
|
render: (args) => ({
|
|
105
129
|
components: {
|
|
@@ -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"
|
|
@@ -25,6 +25,9 @@ const meta = {
|
|
|
25
25
|
tooltipState: {
|
|
26
26
|
control: { type: "select" },
|
|
27
27
|
options: Object.values(InputState)
|
|
28
|
+
},
|
|
29
|
+
submit: {
|
|
30
|
+
description: 'Change the button type to type="submit"'
|
|
28
31
|
}
|
|
29
32
|
}
|
|
30
33
|
};
|
|
@@ -35,11 +38,12 @@ export const Docs = {
|
|
|
35
38
|
setup() {
|
|
36
39
|
return { args };
|
|
37
40
|
},
|
|
38
|
-
template:
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
41
|
+
template: `
|
|
42
|
+
<AntActionButton v-bind="args">
|
|
43
|
+
<template #default>Action Button</template>
|
|
44
|
+
<template #tooltipContent>This is an action button</template>
|
|
45
|
+
<template #invalidPermissionTooltipContent>You have no permission <br>to click this button</template>
|
|
46
|
+
</AntActionButton>`
|
|
43
47
|
}),
|
|
44
48
|
args: {
|
|
45
49
|
tooltipPosition: Position.right
|
|
@@ -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]"
|
|
@@ -41,16 +41,29 @@ const fontSize = computed(() => {
|
|
|
41
41
|
|
|
42
42
|
return Size.sm;
|
|
43
43
|
});
|
|
44
|
+
const fieldClasses = computed(() => ({
|
|
45
|
+
'w-full': props.expanded,
|
|
46
|
+
'gap-2.5': props.size === Size.lg,
|
|
47
|
+
'gap-2': props.size === Size.md,
|
|
48
|
+
'gap-1.5': (props.size === Size.sm || props.size === Size.xs),
|
|
49
|
+
'gap-1': props.size === Size.xs2,
|
|
50
|
+
}));
|
|
51
|
+
const descriptionClasses = computed(() => ({
|
|
52
|
+
'gap-2.5': props.size === Size.lg,
|
|
53
|
+
'gap-2': props.size === Size.md,
|
|
54
|
+
'gap-1.5': (props.size === Size.sm || props.size === Size.xs),
|
|
55
|
+
'gap-1': props.size === Size.xs2,
|
|
56
|
+
}));
|
|
44
57
|
</script>
|
|
45
58
|
|
|
46
59
|
<template>
|
|
47
60
|
<div
|
|
48
|
-
class="flex flex-col items-start
|
|
49
|
-
:class="
|
|
61
|
+
class="flex flex-col items-start"
|
|
62
|
+
:class="fieldClasses"
|
|
50
63
|
>
|
|
51
64
|
<AntInputLabel
|
|
52
65
|
:label="label"
|
|
53
|
-
:size="
|
|
66
|
+
:size="size"
|
|
54
67
|
:skeleton="skeleton"
|
|
55
68
|
:for="labelFor"
|
|
56
69
|
@click-content="$emit('clickLabel')"
|
|
@@ -63,6 +76,7 @@ const fontSize = computed(() => {
|
|
|
63
76
|
<div
|
|
64
77
|
v-if="description || messages.length > 0 || (limiterMaxValue !== undefined && limiterValue !== undefined)"
|
|
65
78
|
class="flex justify-between w-full"
|
|
79
|
+
:class="descriptionClasses"
|
|
66
80
|
>
|
|
67
81
|
<AntInputDescription
|
|
68
82
|
v-if="description || messages.length > 0"
|