@antify/ui 2.5.6 → 3.0.0
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 +5 -6
- package/dist/components/AntAccordionItem.vue +5 -7
- package/dist/components/AntAlert.vue +53 -54
- package/dist/components/{buttons/AntButton.vue → AntButton.vue} +69 -71
- package/dist/components/AntCard.vue +10 -11
- package/dist/components/{dialogs/AntDialog.vue → AntDialog.vue} +4 -4
- package/dist/components/AntIcon.vue +8 -8
- package/dist/components/AntKeycap.vue +15 -15
- package/dist/components/AntListGroup.vue +10 -10
- package/dist/components/AntModal.vue +6 -6
- package/dist/components/AntPagination.vue +39 -41
- package/dist/components/AntSkeleton.vue +5 -25
- package/dist/components/AntToast.vue +1 -1
- package/dist/components/{buttons/__stories → __stories}/AntButton.stories.js +6 -6
- package/dist/components/{buttons/__stories → __stories}/AntButton.stories.mjs +6 -6
- package/dist/components/{dialogs/__stories → __stories}/AntDialog.stories.js +3 -3
- package/dist/components/{dialogs/__stories → __stories}/AntDialog.stories.mjs +3 -3
- package/dist/components/__stories/AntDropdown.stories.js +1 -1
- package/dist/components/__stories/AntDropdown.stories.mjs +1 -1
- package/dist/components/__stories/AntListGroup.stories.js +6 -9
- package/dist/components/__stories/AntListGroup.stories.mjs +6 -9
- package/dist/components/__stories/AntListGroupItem.stories.js +1 -1
- package/dist/components/__stories/AntListGroupItem.stories.mjs +1 -1
- package/dist/components/__stories/AntModal.stories.js +1 -1
- package/dist/components/__stories/AntModal.stories.mjs +1 -1
- package/dist/components/__stories/AntPopover.stories.js +1 -1
- package/dist/components/__stories/AntPopover.stories.mjs +1 -1
- package/dist/components/__stories/AntProgress.stories.js +1 -1
- package/dist/components/__stories/AntProgress.stories.mjs +1 -1
- package/dist/components/__stories/AntToaster.stories.js +1 -1
- package/dist/components/__stories/AntToaster.stories.mjs +1 -1
- package/dist/components/__stories/AntTooltip.stories.js +1 -1
- package/dist/components/__stories/AntTooltip.stories.mjs +1 -1
- package/dist/components/__types/index.d.ts +1 -0
- package/dist/components/__types/index.js +11 -0
- package/dist/components/__types/index.mjs +1 -0
- package/dist/components/forms/__stories/AntFormGroup.stories.js +1 -1
- package/dist/components/forms/__stories/AntFormGroup.stories.mjs +1 -1
- package/dist/components/index.d.ts +3 -17
- package/dist/components/index.js +2 -100
- package/dist/components/index.mjs +2 -30
- package/dist/components/inputs/AntCheckbox.vue +8 -9
- package/dist/components/inputs/AntColorInput/AntColorInput.vue +6 -11
- package/dist/components/inputs/AntDateInput.vue +1 -1
- package/dist/components/inputs/AntImageInput.vue +35 -37
- package/dist/components/inputs/AntNumberInput.vue +1 -1
- package/dist/components/inputs/AntRadio.vue +8 -9
- package/dist/components/inputs/AntSelect.vue +65 -64
- package/dist/components/inputs/AntSwitch.vue +26 -27
- package/dist/components/inputs/AntSwitcher.vue +13 -12
- package/dist/components/inputs/AntTagInput.vue +6 -10
- package/dist/components/inputs/AntTextarea.vue +5 -9
- package/dist/components/inputs/AntUnitInput.vue +1 -1
- package/dist/components/inputs/Elements/AntBaseInput.vue +60 -60
- package/dist/components/inputs/Elements/__stories/AntBaseInput.stories.js +1 -1
- package/dist/components/inputs/Elements/__stories/AntBaseInput.stories.mjs +1 -1
- package/dist/components/inputs/__stories/AntCheckbox.stories.js +41 -14
- package/dist/components/inputs/__stories/AntCheckbox.stories.mjs +41 -14
- package/dist/components/inputs/__stories/AntPasswordInput.stories.js +1 -1
- package/dist/components/inputs/__stories/AntPasswordInput.stories.mjs +1 -1
- package/dist/components/inputs/__stories/AntTextInput.stories.js +1 -1
- package/dist/components/inputs/__stories/AntTextInput.stories.mjs +1 -1
- package/dist/components/table/AntTable.vue +12 -8
- package/dist/components/table/AntTableSkeleton.vue +5 -1
- package/dist/components/table/AntTableSortButton.vue +1 -1
- package/dist/components/table/__stories/AntTable.stories.js +1 -1
- package/dist/components/table/__stories/AntTable.stories.mjs +1 -1
- package/dist/components/tabs/AntTabItem.vue +5 -7
- package/dist/composables/index.d.ts +1 -0
- package/dist/composables/index.js +11 -0
- package/dist/composables/index.mjs +1 -0
- package/dist/composables/useFlickerProtection.d.ts +22 -0
- package/dist/composables/useFlickerProtection.js +48 -0
- package/dist/composables/useFlickerProtection.mjs +48 -0
- package/dist/types.d.ts +0 -1
- package/dist/types.js +5 -16
- package/dist/types.mjs +0 -1
- package/package.json +5 -1
- package/dist/components/buttons/AntActionButton.vue +0 -83
- package/dist/components/buttons/AntCreateButton.vue +0 -61
- package/dist/components/buttons/AntDeleteButton.vue +0 -61
- package/dist/components/buttons/AntDuplicateButton.vue +0 -61
- package/dist/components/buttons/AntEditButton.vue +0 -61
- package/dist/components/buttons/AntSaveAndNewButton.vue +0 -63
- package/dist/components/buttons/AntSaveButton.vue +0 -62
- package/dist/components/buttons/__stories/AntActionButton.stories.d.ts +0 -11
- package/dist/components/buttons/__stories/AntActionButton.stories.js +0 -111
- package/dist/components/buttons/__stories/AntActionButton.stories.mjs +0 -111
- package/dist/components/buttons/__stories/AntCreateButton.stories.d.ts +0 -12
- package/dist/components/buttons/__stories/AntCreateButton.stories.js +0 -97
- package/dist/components/buttons/__stories/AntCreateButton.stories.mjs +0 -94
- package/dist/components/buttons/__stories/AntDeleteButton.stories.d.ts +0 -12
- package/dist/components/buttons/__stories/AntDeleteButton.stories.js +0 -97
- package/dist/components/buttons/__stories/AntDeleteButton.stories.mjs +0 -94
- package/dist/components/buttons/__stories/AntDuplicateButton.stories.d.ts +0 -12
- package/dist/components/buttons/__stories/AntDuplicateButton.stories.js +0 -97
- package/dist/components/buttons/__stories/AntDuplicateButton.stories.mjs +0 -94
- package/dist/components/buttons/__stories/AntEditButton.stories.d.ts +0 -12
- package/dist/components/buttons/__stories/AntEditButton.stories.js +0 -97
- package/dist/components/buttons/__stories/AntEditButton.stories.mjs +0 -94
- package/dist/components/buttons/__stories/AntSaveAndNewButton.stories.d.ts +0 -12
- package/dist/components/buttons/__stories/AntSaveAndNewButton.stories.js +0 -97
- package/dist/components/buttons/__stories/AntSaveAndNewButton.stories.mjs +0 -94
- package/dist/components/buttons/__stories/AntSaveButton.stories.d.ts +0 -12
- package/dist/components/buttons/__stories/AntSaveButton.stories.js +0 -97
- package/dist/components/buttons/__stories/AntSaveButton.stories.mjs +0 -94
- package/dist/components/buttons/__types/index.d.ts +0 -1
- package/dist/components/buttons/__types/index.js +0 -16
- package/dist/components/buttons/__types/index.mjs +0 -1
- package/dist/components/crud/AntCrud.vue +0 -75
- package/dist/components/crud/AntCrudDetail.vue +0 -14
- package/dist/components/crud/AntCrudDetailActions.vue +0 -65
- package/dist/components/crud/AntCrudDetailNav.vue +0 -72
- package/dist/components/crud/AntCrudTableFilter.vue +0 -141
- package/dist/components/crud/AntCrudTableNav.vue +0 -163
- package/dist/components/crud/__stories/AntCrud.stories.d.ts +0 -6
- package/dist/components/crud/__stories/AntCrud.stories.js +0 -131
- package/dist/components/crud/__stories/AntCrud.stories.mjs +0 -142
- package/dist/components/crud/__stories/AntCrudDetail.stories.d.ts +0 -7
- package/dist/components/crud/__stories/AntCrudDetail.stories.js +0 -90
- package/dist/components/crud/__stories/AntCrudDetail.stories.mjs +0 -92
- package/dist/components/crud/__stories/AntCrudDetailActions.stories.d.ts +0 -6
- package/dist/components/crud/__stories/AntCrudDetailActions.stories.js +0 -38
- package/dist/components/crud/__stories/AntCrudDetailActions.stories.mjs +0 -33
- package/dist/components/crud/__stories/AntCrudDetailNav.stories.d.ts +0 -6
- package/dist/components/crud/__stories/AntCrudDetailNav.stories.js +0 -51
- package/dist/components/crud/__stories/AntCrudDetailNav.stories.mjs +0 -53
- package/dist/components/crud/__stories/AntCrudTableFilter.stories.d.ts +0 -6
- package/dist/components/crud/__stories/AntCrudTableFilter.stories.js +0 -42
- package/dist/components/crud/__stories/AntCrudTableFilter.stories.mjs +0 -39
- package/dist/components/crud/__stories/AntCrudTableNav.stories.d.ts +0 -8
- package/dist/components/crud/__stories/AntCrudTableNav.stories.js +0 -77
- package/dist/components/crud/__stories/AntCrudTableNav.stories.mjs +0 -74
- package/dist/components/dialogs/AntDeleteDialog.vue +0 -37
- package/dist/components/dialogs/__stories/AndDeleteDialog.stories.d.ts +0 -6
- package/dist/components/dialogs/__stories/AndDeleteDialog.stories.js +0 -48
- package/dist/components/dialogs/__stories/AndDeleteDialog.stories.mjs +0 -41
- /package/dist/components/{buttons/__stories → __stories}/AntButton.stories.d.ts +0 -0
- /package/dist/components/{dialogs/__stories → __stories}/AntDialog.stories.d.ts +0 -0
- /package/dist/components/{buttons/__types → __types}/AntButton.types.d.ts +0 -0
- /package/dist/components/{buttons/__types → __types}/AntButton.types.js +0 -0
- /package/dist/components/{buttons/__types → __types}/AntButton.types.mjs +0 -0
|
@@ -7,6 +7,7 @@ import AntTh from './AntTh.vue';
|
|
|
7
7
|
import AntSkeleton from '../AntSkeleton.vue';
|
|
8
8
|
|
|
9
9
|
withDefaults(defineProps<{
|
|
10
|
+
visible: boolean;
|
|
10
11
|
headers: TableHeader[];
|
|
11
12
|
getRowClasses: (element: Record<string, unknown>, rowIndex: number) => {};
|
|
12
13
|
size?: AntTableSize;
|
|
@@ -20,7 +21,10 @@ withDefaults(defineProps<{
|
|
|
20
21
|
</script>
|
|
21
22
|
|
|
22
23
|
<template>
|
|
23
|
-
<div
|
|
24
|
+
<div
|
|
25
|
+
v-if="visible"
|
|
26
|
+
class="overflow-hidden h-full overflow-x-auto overflow-y-auto"
|
|
27
|
+
>
|
|
24
28
|
<table
|
|
25
29
|
class="min-w-full max-h-full relative"
|
|
26
30
|
>
|
|
@@ -5,7 +5,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
module.exports = exports.Skeleton = exports.MultipleCollapseStrategy = exports.Loading = exports.Empty = exports.Docs = exports.DefaultCollapseOpen = exports.Collapsible = void 0;
|
|
7
7
|
var _AntTable = _interopRequireDefault(require("../AntTable.vue"));
|
|
8
|
-
var _AntButton = _interopRequireDefault(require("../../
|
|
8
|
+
var _AntButton = _interopRequireDefault(require("../../AntButton.vue"));
|
|
9
9
|
var _AntSelect = _interopRequireDefault(require("../../inputs/AntSelect.vue"));
|
|
10
10
|
var _AntCheckboxGroup = _interopRequireDefault(require("../../inputs/AntCheckboxGroup.vue"));
|
|
11
11
|
var _TableHeader = require("../__types/TableHeader.types");
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import AntTable from "../AntTable.vue";
|
|
2
|
-
import AntButton from "../../
|
|
2
|
+
import AntButton from "../../AntButton.vue";
|
|
3
3
|
import AntSelect from "../../inputs/AntSelect.vue";
|
|
4
4
|
import AntCheckboxGroup from "../../inputs/AntCheckboxGroup.vue";
|
|
5
5
|
import {
|
|
@@ -122,14 +122,12 @@ const iconColor = computed(() => {
|
|
|
122
122
|
/>
|
|
123
123
|
</slot>
|
|
124
124
|
|
|
125
|
-
<
|
|
125
|
+
<AntSkeleton
|
|
126
|
+
:visible="skeleton"
|
|
127
|
+
rounded
|
|
128
|
+
>
|
|
126
129
|
<slot>{{ label }}</slot>
|
|
127
|
-
|
|
128
|
-
v-if="skeleton"
|
|
129
|
-
rounded
|
|
130
|
-
absolute
|
|
131
|
-
/>
|
|
132
|
-
</div>
|
|
130
|
+
</AntSkeleton>
|
|
133
131
|
|
|
134
132
|
<AntIcon
|
|
135
133
|
v-if="iconRight && showIcon"
|
|
@@ -13,4 +13,15 @@ Object.keys(_useToaster).forEach(function (key) {
|
|
|
13
13
|
return _useToaster[key];
|
|
14
14
|
}
|
|
15
15
|
});
|
|
16
|
+
});
|
|
17
|
+
var _useFlickerProtection = require("./useFlickerProtection");
|
|
18
|
+
Object.keys(_useFlickerProtection).forEach(function (key) {
|
|
19
|
+
if (key === "default" || key === "__esModule") return;
|
|
20
|
+
if (key in exports && exports[key] === _useFlickerProtection[key]) return;
|
|
21
|
+
Object.defineProperty(exports, key, {
|
|
22
|
+
enumerable: true,
|
|
23
|
+
get: function () {
|
|
24
|
+
return _useFlickerProtection[key];
|
|
25
|
+
}
|
|
26
|
+
});
|
|
16
27
|
});
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { type Ref, type ComputedRef } from 'vue';
|
|
2
|
+
/**
|
|
3
|
+
* Add flicker protection to a ref or computed ref to ensure
|
|
4
|
+
* the value change is not too fast and does not cause flicker.
|
|
5
|
+
*
|
|
6
|
+
* [refToWatch = true]
|
|
7
|
+
* [visible = false] [if refToWatch = false -> Finish] [visible = true] [freeze now, ignore any change] [visible = refToWatch] [unlock]
|
|
8
|
+
* [------------------ flickerThreshold ------------------][------------------ minShowTime ------------------]
|
|
9
|
+
*
|
|
10
|
+
* This logic is separated into 4 phases:
|
|
11
|
+
* - null: The initial phase where the value is hidden.
|
|
12
|
+
* - threshold: The initial phase where the value is hidden and waits for flicker threshold time.
|
|
13
|
+
* If in this phase, refToWatch changes to false, the process get canceled.
|
|
14
|
+
* - minShowTime: The phase where the value is shown for a minimum time.
|
|
15
|
+
* - over: The final phase where the value is shown or hidden based on the refToWatch.
|
|
16
|
+
*
|
|
17
|
+
* @param refToWatch - The ref or computed ref to watch for changes.
|
|
18
|
+
* @param minShowTime - The minimum time (in ms) the value should remain visible.
|
|
19
|
+
* @param flickerThreshold - The threshold (in ms) to ignore rapid changes.
|
|
20
|
+
* @returns A ref that manages the visibility state with flicker protection.
|
|
21
|
+
*/
|
|
22
|
+
export declare const useFlickerProtection: (refToWatch: Ref<boolean> | ComputedRef<boolean>, minShowTime?: number, flickerThreshold?: number) => Ref<boolean>;
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.useFlickerProtection = void 0;
|
|
7
|
+
var _vue = require("vue");
|
|
8
|
+
const useFlickerProtection = (refToWatch, minShowTime = 300, flickerThreshold = 50) => {
|
|
9
|
+
const visible = (0, _vue.ref)(refToWatch.value);
|
|
10
|
+
const phase = (0, _vue.ref)(null);
|
|
11
|
+
function startThresholdPhase() {
|
|
12
|
+
phase.value = "threshold";
|
|
13
|
+
visible.value = false;
|
|
14
|
+
setTimeout(() => {
|
|
15
|
+
if (refToWatch.value) {
|
|
16
|
+
startMinShowTimePhase();
|
|
17
|
+
}
|
|
18
|
+
}, flickerThreshold);
|
|
19
|
+
}
|
|
20
|
+
function startMinShowTimePhase() {
|
|
21
|
+
phase.value = "minShowTime";
|
|
22
|
+
visible.value = true;
|
|
23
|
+
setTimeout(() => {
|
|
24
|
+
visible.value = refToWatch.value;
|
|
25
|
+
phase.value = refToWatch.value ? "over" : null;
|
|
26
|
+
}, minShowTime);
|
|
27
|
+
}
|
|
28
|
+
(0, _vue.watch)(refToWatch, newValue => {
|
|
29
|
+
if (phase.value === "minShowTime") {
|
|
30
|
+
return;
|
|
31
|
+
}
|
|
32
|
+
if (phase.value === null && newValue) {
|
|
33
|
+
return startThresholdPhase();
|
|
34
|
+
}
|
|
35
|
+
if (phase.value === "threshold" && !newValue) {
|
|
36
|
+
phase.value = null;
|
|
37
|
+
return visible.value = false;
|
|
38
|
+
}
|
|
39
|
+
if (phase.value === "over" && !newValue) {
|
|
40
|
+
phase.value = null;
|
|
41
|
+
visible.value = false;
|
|
42
|
+
}
|
|
43
|
+
}, {
|
|
44
|
+
immediate: true
|
|
45
|
+
});
|
|
46
|
+
return visible;
|
|
47
|
+
};
|
|
48
|
+
exports.useFlickerProtection = useFlickerProtection;
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import {
|
|
2
|
+
ref,
|
|
3
|
+
watch
|
|
4
|
+
} from "vue";
|
|
5
|
+
export const useFlickerProtection = (refToWatch, minShowTime = 300, flickerThreshold = 50) => {
|
|
6
|
+
const visible = ref(refToWatch.value);
|
|
7
|
+
const phase = ref(null);
|
|
8
|
+
function startThresholdPhase() {
|
|
9
|
+
phase.value = "threshold";
|
|
10
|
+
visible.value = false;
|
|
11
|
+
setTimeout(() => {
|
|
12
|
+
if (refToWatch.value) {
|
|
13
|
+
startMinShowTimePhase();
|
|
14
|
+
}
|
|
15
|
+
}, flickerThreshold);
|
|
16
|
+
}
|
|
17
|
+
function startMinShowTimePhase() {
|
|
18
|
+
phase.value = "minShowTime";
|
|
19
|
+
visible.value = true;
|
|
20
|
+
setTimeout(() => {
|
|
21
|
+
visible.value = refToWatch.value;
|
|
22
|
+
phase.value = refToWatch.value ? "over" : null;
|
|
23
|
+
}, minShowTime);
|
|
24
|
+
}
|
|
25
|
+
watch(
|
|
26
|
+
refToWatch,
|
|
27
|
+
(newValue) => {
|
|
28
|
+
if (phase.value === "minShowTime") {
|
|
29
|
+
return;
|
|
30
|
+
}
|
|
31
|
+
if (phase.value === null && newValue) {
|
|
32
|
+
return startThresholdPhase();
|
|
33
|
+
}
|
|
34
|
+
if (phase.value === "threshold" && !newValue) {
|
|
35
|
+
phase.value = null;
|
|
36
|
+
return visible.value = false;
|
|
37
|
+
}
|
|
38
|
+
if (phase.value === "over" && !newValue) {
|
|
39
|
+
phase.value = null;
|
|
40
|
+
visible.value = false;
|
|
41
|
+
}
|
|
42
|
+
},
|
|
43
|
+
{
|
|
44
|
+
immediate: true
|
|
45
|
+
}
|
|
46
|
+
);
|
|
47
|
+
return visible;
|
|
48
|
+
};
|
package/dist/types.d.ts
CHANGED
package/dist/types.js
CHANGED
|
@@ -25,7 +25,7 @@ Object.keys(_types).forEach(function (key) {
|
|
|
25
25
|
}
|
|
26
26
|
});
|
|
27
27
|
});
|
|
28
|
-
var _types2 = require("./components/
|
|
28
|
+
var _types2 = require("./components/inputs/__types");
|
|
29
29
|
Object.keys(_types2).forEach(function (key) {
|
|
30
30
|
if (key === "default" || key === "__esModule") return;
|
|
31
31
|
if (key in exports && exports[key] === _types2[key]) return;
|
|
@@ -36,7 +36,7 @@ Object.keys(_types2).forEach(function (key) {
|
|
|
36
36
|
}
|
|
37
37
|
});
|
|
38
38
|
});
|
|
39
|
-
var _types3 = require("./components/inputs/__types");
|
|
39
|
+
var _types3 = require("./components/inputs/Elements/__types");
|
|
40
40
|
Object.keys(_types3).forEach(function (key) {
|
|
41
41
|
if (key === "default" || key === "__esModule") return;
|
|
42
42
|
if (key in exports && exports[key] === _types3[key]) return;
|
|
@@ -47,7 +47,7 @@ Object.keys(_types3).forEach(function (key) {
|
|
|
47
47
|
}
|
|
48
48
|
});
|
|
49
49
|
});
|
|
50
|
-
var _types4 = require("./components/
|
|
50
|
+
var _types4 = require("./components/navbar/__types");
|
|
51
51
|
Object.keys(_types4).forEach(function (key) {
|
|
52
52
|
if (key === "default" || key === "__esModule") return;
|
|
53
53
|
if (key in exports && exports[key] === _types4[key]) return;
|
|
@@ -58,7 +58,7 @@ Object.keys(_types4).forEach(function (key) {
|
|
|
58
58
|
}
|
|
59
59
|
});
|
|
60
60
|
});
|
|
61
|
-
var _types5 = require("./components/
|
|
61
|
+
var _types5 = require("./components/table/__types");
|
|
62
62
|
Object.keys(_types5).forEach(function (key) {
|
|
63
63
|
if (key === "default" || key === "__esModule") return;
|
|
64
64
|
if (key in exports && exports[key] === _types5[key]) return;
|
|
@@ -69,7 +69,7 @@ Object.keys(_types5).forEach(function (key) {
|
|
|
69
69
|
}
|
|
70
70
|
});
|
|
71
71
|
});
|
|
72
|
-
var _types6 = require("./components/
|
|
72
|
+
var _types6 = require("./components/tabs/__types");
|
|
73
73
|
Object.keys(_types6).forEach(function (key) {
|
|
74
74
|
if (key === "default" || key === "__esModule") return;
|
|
75
75
|
if (key in exports && exports[key] === _types6[key]) return;
|
|
@@ -79,15 +79,4 @@ Object.keys(_types6).forEach(function (key) {
|
|
|
79
79
|
return _types6[key];
|
|
80
80
|
}
|
|
81
81
|
});
|
|
82
|
-
});
|
|
83
|
-
var _types7 = require("./components/tabs/__types");
|
|
84
|
-
Object.keys(_types7).forEach(function (key) {
|
|
85
|
-
if (key === "default" || key === "__esModule") return;
|
|
86
|
-
if (key in exports && exports[key] === _types7[key]) return;
|
|
87
|
-
Object.defineProperty(exports, key, {
|
|
88
|
-
enumerable: true,
|
|
89
|
-
get: function () {
|
|
90
|
-
return _types7[key];
|
|
91
|
-
}
|
|
92
|
-
});
|
|
93
82
|
});
|
package/dist/types.mjs
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
export * from "./enums/index.mjs";
|
|
2
2
|
export * from "./components/__types/index.mjs";
|
|
3
|
-
export * from "./components/buttons/__types/index.mjs";
|
|
4
3
|
export * from "./components/inputs/__types/index.mjs";
|
|
5
4
|
export * from "./components/inputs/Elements/__types/index.mjs";
|
|
6
5
|
export * from "./components/navbar/__types/index.mjs";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@antify/ui",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "3.0.0",
|
|
4
4
|
"private": false,
|
|
5
5
|
"type": "module",
|
|
6
6
|
"exports": {
|
|
@@ -96,6 +96,10 @@
|
|
|
96
96
|
"vitest": "^1.6.1",
|
|
97
97
|
"vue-tsc": "^2.2.8"
|
|
98
98
|
},
|
|
99
|
+
"engines": {
|
|
100
|
+
"node": "^22.14.0",
|
|
101
|
+
"pnpm": ">=10.10.0"
|
|
102
|
+
},
|
|
99
103
|
"scripts": {
|
|
100
104
|
"dev": "storybook dev -p 6006 --no-open",
|
|
101
105
|
"build": "unbuild",
|
|
@@ -1,83 +0,0 @@
|
|
|
1
|
-
<script lang="ts" setup>
|
|
2
|
-
/**
|
|
3
|
-
* This button is used for everything what is the primary
|
|
4
|
-
* action like save, confirm, create, etc.
|
|
5
|
-
*/
|
|
6
|
-
import {
|
|
7
|
-
Position, State, InputState, Size, Grouped,
|
|
8
|
-
} from '../../enums';
|
|
9
|
-
import AntButton from './AntButton.vue';
|
|
10
|
-
import type {
|
|
11
|
-
IconDefinition,
|
|
12
|
-
} from '@fortawesome/free-solid-svg-icons';
|
|
13
|
-
import {
|
|
14
|
-
computed, useSlots,
|
|
15
|
-
} from 'vue';
|
|
16
|
-
import {
|
|
17
|
-
hasSlotContent,
|
|
18
|
-
} from '../../utils';
|
|
19
|
-
|
|
20
|
-
defineEmits([
|
|
21
|
-
'click',
|
|
22
|
-
'blur',
|
|
23
|
-
]);
|
|
24
|
-
const props = withDefaults(defineProps<{
|
|
25
|
-
iconLeft?: IconDefinition;
|
|
26
|
-
iconRight?: IconDefinition;
|
|
27
|
-
size?: Size;
|
|
28
|
-
disabled?: boolean;
|
|
29
|
-
grouped?: Grouped;
|
|
30
|
-
state?: State;
|
|
31
|
-
skeleton?: boolean;
|
|
32
|
-
expanded?: boolean;
|
|
33
|
-
filled?: boolean;
|
|
34
|
-
hasPermission?: boolean;
|
|
35
|
-
tooltipPosition?: Position;
|
|
36
|
-
tooltipState?: InputState;
|
|
37
|
-
tooltipDelay?: number;
|
|
38
|
-
submit?: boolean;
|
|
39
|
-
}>(), {
|
|
40
|
-
state: State.primary,
|
|
41
|
-
hasPermission: true,
|
|
42
|
-
filled: true,
|
|
43
|
-
submit: false,
|
|
44
|
-
});
|
|
45
|
-
const slots = useSlots();
|
|
46
|
-
const hasTooltip = computed(() => !props.skeleton && !props.disabled && props.hasPermission && hasSlotContent(slots['tooltipContent']));
|
|
47
|
-
const hasPermissionTooltip = computed(() => !props.skeleton && !props.disabled && !props.hasPermission && hasSlotContent(slots['invalidPermissionTooltipContent']));
|
|
48
|
-
</script>
|
|
49
|
-
|
|
50
|
-
<template>
|
|
51
|
-
<AntButton
|
|
52
|
-
:icon-left="iconLeft"
|
|
53
|
-
:icon-right="iconRight"
|
|
54
|
-
:size="size"
|
|
55
|
-
:disabled="disabled || !hasPermission"
|
|
56
|
-
:grouped="grouped"
|
|
57
|
-
:skeleton="skeleton"
|
|
58
|
-
:expanded="expanded"
|
|
59
|
-
:state="state"
|
|
60
|
-
:filled="filled"
|
|
61
|
-
:tooltip-position="tooltipPosition"
|
|
62
|
-
:tooltip-state="hasPermissionTooltip ? InputState.info : tooltipState"
|
|
63
|
-
:tooltip-delay="hasPermissionTooltip ? 300 : tooltipDelay"
|
|
64
|
-
:submit="submit"
|
|
65
|
-
data-e2e="action-button"
|
|
66
|
-
@click="$emit('click')"
|
|
67
|
-
@blur="$emit('blur')"
|
|
68
|
-
>
|
|
69
|
-
<slot />
|
|
70
|
-
|
|
71
|
-
<template #tooltip-content>
|
|
72
|
-
<slot
|
|
73
|
-
v-if="hasTooltip"
|
|
74
|
-
name="tooltipContent"
|
|
75
|
-
/>
|
|
76
|
-
|
|
77
|
-
<slot
|
|
78
|
-
v-if="hasPermissionTooltip"
|
|
79
|
-
name="invalidPermissionTooltipContent"
|
|
80
|
-
/>
|
|
81
|
-
</template>
|
|
82
|
-
</AntButton>
|
|
83
|
-
</template>
|
|
@@ -1,61 +0,0 @@
|
|
|
1
|
-
<script lang="ts" setup>
|
|
2
|
-
import AntActionButton from './AntActionButton.vue';
|
|
3
|
-
import {
|
|
4
|
-
Position, Size, Grouped, State,
|
|
5
|
-
} from '../../enums';
|
|
6
|
-
import {
|
|
7
|
-
faPlus,
|
|
8
|
-
} from '@fortawesome/free-solid-svg-icons';
|
|
9
|
-
|
|
10
|
-
defineEmits([
|
|
11
|
-
'click',
|
|
12
|
-
'blur',
|
|
13
|
-
]);
|
|
14
|
-
withDefaults(defineProps<{
|
|
15
|
-
iconVariant?: boolean;
|
|
16
|
-
size?: Size;
|
|
17
|
-
disabled?: boolean;
|
|
18
|
-
grouped?: Grouped;
|
|
19
|
-
skeleton?: boolean;
|
|
20
|
-
expanded?: boolean;
|
|
21
|
-
canCreate?: boolean;
|
|
22
|
-
tooltipPosition?: Position;
|
|
23
|
-
}>(), {
|
|
24
|
-
iconVariant: false,
|
|
25
|
-
canCreate: true,
|
|
26
|
-
});
|
|
27
|
-
</script>
|
|
28
|
-
|
|
29
|
-
<template>
|
|
30
|
-
<AntActionButton
|
|
31
|
-
:filled="false"
|
|
32
|
-
:state="State.primary"
|
|
33
|
-
:size="size"
|
|
34
|
-
:disabled="disabled"
|
|
35
|
-
:icon-left="iconVariant ? faPlus : undefined"
|
|
36
|
-
:grouped="grouped"
|
|
37
|
-
:skeleton="skeleton"
|
|
38
|
-
:expanded="expanded"
|
|
39
|
-
:has-permission="canCreate"
|
|
40
|
-
:tooltip-position="tooltipPosition"
|
|
41
|
-
data-e2e="create-button"
|
|
42
|
-
@click="$emit('click')"
|
|
43
|
-
@blur="$emit('blur')"
|
|
44
|
-
>
|
|
45
|
-
<template
|
|
46
|
-
v-if="!iconVariant"
|
|
47
|
-
#default
|
|
48
|
-
>
|
|
49
|
-
Create
|
|
50
|
-
</template>
|
|
51
|
-
|
|
52
|
-
<template #invalidPermissionTooltipContent>
|
|
53
|
-
You have no permission to create new entries.<br>
|
|
54
|
-
Please contact your administrator.
|
|
55
|
-
</template>
|
|
56
|
-
|
|
57
|
-
<template #tooltipContent>
|
|
58
|
-
Create new entry
|
|
59
|
-
</template>
|
|
60
|
-
</AntActionButton>
|
|
61
|
-
</template>
|
|
@@ -1,61 +0,0 @@
|
|
|
1
|
-
<script lang="ts" setup>
|
|
2
|
-
import AntActionButton from './AntActionButton.vue';
|
|
3
|
-
import {
|
|
4
|
-
Position, Size, Grouped, State,
|
|
5
|
-
} from '../../enums';
|
|
6
|
-
import {
|
|
7
|
-
faTrash,
|
|
8
|
-
} from '@fortawesome/free-solid-svg-icons';
|
|
9
|
-
|
|
10
|
-
defineEmits([
|
|
11
|
-
'click',
|
|
12
|
-
'blur',
|
|
13
|
-
]);
|
|
14
|
-
withDefaults(defineProps<{
|
|
15
|
-
iconVariant?: boolean;
|
|
16
|
-
size?: Size;
|
|
17
|
-
disabled?: boolean;
|
|
18
|
-
grouped?: Grouped;
|
|
19
|
-
skeleton?: boolean;
|
|
20
|
-
expanded?: boolean;
|
|
21
|
-
canDelete?: boolean;
|
|
22
|
-
tooltipPosition?: Position;
|
|
23
|
-
}>(), {
|
|
24
|
-
iconVariant: false,
|
|
25
|
-
canDelete: true,
|
|
26
|
-
});
|
|
27
|
-
</script>
|
|
28
|
-
|
|
29
|
-
<template>
|
|
30
|
-
<AntActionButton
|
|
31
|
-
:filled="false"
|
|
32
|
-
:state="State.danger"
|
|
33
|
-
:size="size"
|
|
34
|
-
:disabled="disabled"
|
|
35
|
-
:icon-left="iconVariant ? faTrash : undefined"
|
|
36
|
-
:grouped="grouped"
|
|
37
|
-
:skeleton="skeleton"
|
|
38
|
-
:expanded="expanded"
|
|
39
|
-
:has-permission="canDelete"
|
|
40
|
-
:tooltip-position="tooltipPosition"
|
|
41
|
-
data-e2e="delete-button"
|
|
42
|
-
@click="$emit('click')"
|
|
43
|
-
@blur="$emit('blur')"
|
|
44
|
-
>
|
|
45
|
-
<template
|
|
46
|
-
v-if="!iconVariant"
|
|
47
|
-
#default
|
|
48
|
-
>
|
|
49
|
-
Delete
|
|
50
|
-
</template>
|
|
51
|
-
|
|
52
|
-
<template #invalidPermissionTooltipContent>
|
|
53
|
-
You have no permission to delete entries.<br>
|
|
54
|
-
Please contact your administrator.
|
|
55
|
-
</template>
|
|
56
|
-
|
|
57
|
-
<template #tooltipContent>
|
|
58
|
-
Delete entry
|
|
59
|
-
</template>
|
|
60
|
-
</AntActionButton>
|
|
61
|
-
</template>
|
|
@@ -1,61 +0,0 @@
|
|
|
1
|
-
<script lang="ts" setup>
|
|
2
|
-
import AntActionButton from './AntActionButton.vue';
|
|
3
|
-
import {
|
|
4
|
-
Position, Size, Grouped, State,
|
|
5
|
-
} from '../../enums';
|
|
6
|
-
import {
|
|
7
|
-
faCopy,
|
|
8
|
-
} from '@fortawesome/free-solid-svg-icons';
|
|
9
|
-
|
|
10
|
-
defineEmits([
|
|
11
|
-
'click',
|
|
12
|
-
'blur',
|
|
13
|
-
]);
|
|
14
|
-
withDefaults(defineProps<{
|
|
15
|
-
iconVariant?: boolean;
|
|
16
|
-
size?: Size;
|
|
17
|
-
disabled?: boolean;
|
|
18
|
-
grouped?: Grouped;
|
|
19
|
-
skeleton?: boolean;
|
|
20
|
-
expanded?: boolean;
|
|
21
|
-
canDuplicate?: boolean;
|
|
22
|
-
tooltipPosition?: Position;
|
|
23
|
-
}>(), {
|
|
24
|
-
iconVariant: false,
|
|
25
|
-
canDuplicate: true,
|
|
26
|
-
});
|
|
27
|
-
</script>
|
|
28
|
-
|
|
29
|
-
<template>
|
|
30
|
-
<AntActionButton
|
|
31
|
-
:filled="false"
|
|
32
|
-
:state="State.base"
|
|
33
|
-
:size="size"
|
|
34
|
-
:disabled="disabled"
|
|
35
|
-
:icon-left="iconVariant ? faCopy : undefined"
|
|
36
|
-
:grouped="grouped"
|
|
37
|
-
:skeleton="skeleton"
|
|
38
|
-
:expanded="expanded"
|
|
39
|
-
:has-permission="canDuplicate"
|
|
40
|
-
:tooltip-position="tooltipPosition"
|
|
41
|
-
data-e2e="duplicate-button"
|
|
42
|
-
@click="$emit('click')"
|
|
43
|
-
@blur="$emit('blur')"
|
|
44
|
-
>
|
|
45
|
-
<template
|
|
46
|
-
v-if="!iconVariant"
|
|
47
|
-
#default
|
|
48
|
-
>
|
|
49
|
-
Duplicate
|
|
50
|
-
</template>
|
|
51
|
-
|
|
52
|
-
<template #invalidPermissionTooltipContent>
|
|
53
|
-
You have no permission to duplicate entries.<br>
|
|
54
|
-
Please contact your administrator.
|
|
55
|
-
</template>
|
|
56
|
-
|
|
57
|
-
<template #tooltipContent>
|
|
58
|
-
Duplicate entry
|
|
59
|
-
</template>
|
|
60
|
-
</AntActionButton>
|
|
61
|
-
</template>
|
|
@@ -1,61 +0,0 @@
|
|
|
1
|
-
<script lang="ts" setup>
|
|
2
|
-
import AntActionButton from './AntActionButton.vue';
|
|
3
|
-
import {
|
|
4
|
-
Position, Size, Grouped, State,
|
|
5
|
-
} from '../../enums';
|
|
6
|
-
import {
|
|
7
|
-
faPencil,
|
|
8
|
-
} from '@fortawesome/free-solid-svg-icons';
|
|
9
|
-
|
|
10
|
-
defineEmits([
|
|
11
|
-
'click',
|
|
12
|
-
'blur',
|
|
13
|
-
]);
|
|
14
|
-
withDefaults(defineProps<{
|
|
15
|
-
iconVariant?: boolean;
|
|
16
|
-
size?: Size;
|
|
17
|
-
disabled?: boolean;
|
|
18
|
-
grouped?: Grouped;
|
|
19
|
-
skeleton?: boolean;
|
|
20
|
-
expanded?: boolean;
|
|
21
|
-
canEdit?: boolean;
|
|
22
|
-
tooltipPosition?: Position;
|
|
23
|
-
}>(), {
|
|
24
|
-
iconVariant: false,
|
|
25
|
-
canEdit: true,
|
|
26
|
-
});
|
|
27
|
-
</script>
|
|
28
|
-
|
|
29
|
-
<template>
|
|
30
|
-
<AntActionButton
|
|
31
|
-
:filled="false"
|
|
32
|
-
:state="State.base"
|
|
33
|
-
:size="size"
|
|
34
|
-
:disabled="disabled"
|
|
35
|
-
:icon-left="iconVariant ? faPencil : undefined"
|
|
36
|
-
:grouped="grouped"
|
|
37
|
-
:skeleton="skeleton"
|
|
38
|
-
:expanded="expanded"
|
|
39
|
-
:has-permission="canEdit"
|
|
40
|
-
:tooltip-position="tooltipPosition"
|
|
41
|
-
data-e2e="edit-button"
|
|
42
|
-
@click="$emit('click')"
|
|
43
|
-
@blur="$emit('blur')"
|
|
44
|
-
>
|
|
45
|
-
<template
|
|
46
|
-
v-if="!iconVariant"
|
|
47
|
-
#default
|
|
48
|
-
>
|
|
49
|
-
Edit
|
|
50
|
-
</template>
|
|
51
|
-
|
|
52
|
-
<template #invalidPermissionTooltipContent>
|
|
53
|
-
You have no permission to edit entries.<br>
|
|
54
|
-
Please contact your administrator.
|
|
55
|
-
</template>
|
|
56
|
-
|
|
57
|
-
<template #tooltipContent>
|
|
58
|
-
Edit entry
|
|
59
|
-
</template>
|
|
60
|
-
</AntActionButton>
|
|
61
|
-
</template>
|