@antify/ui-module 1.4.0 → 1.5.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/module.json +1 -1
- package/dist/module.mjs +2 -1
- package/dist/runtime/components/AntAccordionItem.vue +17 -14
- package/dist/runtime/components/AntDropdown.vue +6 -6
- package/dist/runtime/components/AntListGroupItem.vue +16 -10
- package/dist/runtime/components/AntModal.vue +10 -9
- package/dist/runtime/components/AntPopover.vue +10 -8
- package/dist/runtime/components/AntTooltip.vue +2 -2
- package/dist/runtime/components/buttons/AntActionButton.vue +5 -0
- package/dist/runtime/components/buttons/AntButton.vue +126 -126
- package/dist/runtime/components/buttons/AntCreateButton.vue +1 -0
- package/dist/runtime/components/buttons/AntDeleteButton.vue +11 -1
- package/dist/runtime/components/buttons/AntDuplicateButton.vue +42 -0
- package/dist/runtime/components/buttons/__stories/AntActionButton.stories.mjs +6 -4
- package/dist/runtime/components/buttons/__stories/AntButton.stories.mjs +130 -130
- package/dist/runtime/components/buttons/__stories/AntCreateButton.stories.mjs +4 -3
- package/dist/runtime/components/buttons/__stories/AntDeleteButton.stories.d.ts +1 -0
- package/dist/runtime/components/buttons/__stories/AntDeleteButton.stories.mjs +11 -3
- package/dist/runtime/components/buttons/__stories/AntDuplicateButton.stories.d.ts +11 -0
- package/dist/runtime/components/buttons/__stories/AntDuplicateButton.stories.mjs +67 -0
- package/dist/runtime/components/buttons/__stories/AntSaveAndNewButton.stories.mjs +4 -3
- package/dist/runtime/components/buttons/__stories/AntSaveButton.stories.mjs +4 -3
- package/dist/runtime/components/crud/AntCrud.vue +13 -10
- package/dist/runtime/components/crud/AntCrudDetail.vue +1 -1
- package/dist/runtime/components/crud/AntCrudDetailActions.vue +1 -1
- package/dist/runtime/components/crud/AntCrudDetailNav.vue +1 -1
- package/dist/runtime/components/crud/AntCrudTableFilter.vue +1 -1
- package/dist/runtime/components/crud/AntCrudTableNav.vue +15 -4
- package/dist/runtime/components/dialogs/AntDialog.vue +7 -7
- package/dist/runtime/components/form/AntCheckboxWidget/AntCheckbox.vue +1 -2
- package/dist/runtime/components/form/AntSelect.vue +57 -53
- package/dist/runtime/components/form/AntSwitch.vue +13 -10
- package/dist/runtime/components/form/AntSwitcher.vue +4 -4
- package/dist/runtime/components/form/AntTextarea.vue +6 -3
- package/dist/runtime/components/form/Elements/AntBaseInput.vue +45 -41
- package/dist/runtime/components/form/Elements/AntDropDown.vue +1 -1
- package/dist/runtime/components/layouts/AntNavLeftLayout.vue +4 -4
- package/dist/runtime/components/table/AntTable.vue +95 -73
- package/dist/runtime/components/table/AntTableSortButton.vue +16 -4
- package/dist/runtime/components/tabs/AntTabItem.vue +7 -4
- package/dist/runtime/tailwind.config.mjs +1 -1
- package/package.json +1 -1
- package/src/runtime/components/AntAccordionItem.vue +17 -14
- package/src/runtime/components/AntDropdown.vue +6 -6
- package/src/runtime/components/AntListGroupItem.vue +16 -10
- package/src/runtime/components/AntModal.vue +10 -9
- package/src/runtime/components/AntPopover.vue +10 -8
- package/src/runtime/components/AntTooltip.vue +2 -2
- package/src/runtime/components/buttons/AntActionButton.vue +5 -0
- package/src/runtime/components/buttons/AntButton.vue +126 -126
- package/src/runtime/components/buttons/AntCreateButton.vue +1 -0
- package/src/runtime/components/buttons/AntDeleteButton.vue +11 -1
- package/src/runtime/components/buttons/AntDuplicateButton.vue +42 -0
- package/src/runtime/components/crud/AntCrud.vue +13 -10
- package/src/runtime/components/crud/AntCrudDetail.vue +1 -1
- package/src/runtime/components/crud/AntCrudDetailActions.vue +1 -1
- package/src/runtime/components/crud/AntCrudDetailNav.vue +1 -1
- package/src/runtime/components/crud/AntCrudTableFilter.vue +1 -1
- package/src/runtime/components/crud/AntCrudTableNav.vue +15 -4
- package/src/runtime/components/dialogs/AntDialog.vue +7 -7
- package/src/runtime/components/form/AntCheckboxWidget/AntCheckbox.vue +1 -2
- package/src/runtime/components/form/AntSelect.vue +57 -53
- package/src/runtime/components/form/AntSwitch.vue +13 -10
- package/src/runtime/components/form/AntSwitcher.vue +4 -4
- package/src/runtime/components/form/AntTextarea.vue +6 -3
- package/src/runtime/components/form/Elements/AntBaseInput.vue +45 -41
- package/src/runtime/components/form/Elements/AntDropDown.vue +1 -1
- package/src/runtime/components/layouts/AntNavLeftLayout.vue +4 -4
- package/src/runtime/components/table/AntTable.vue +95 -73
- package/src/runtime/components/table/AntTableSortButton.vue +16 -4
- package/src/runtime/components/tabs/AntTabItem.vue +7 -4
|
@@ -95,81 +95,98 @@ function rowClick(elem: Record<string, unknown>): void {
|
|
|
95
95
|
:class="{'h-full': data.length === 0 && !_loading}"
|
|
96
96
|
>
|
|
97
97
|
<thead class="bg-neutral-100 sticky top-0 z-10">
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
98
|
+
<tr>
|
|
99
|
+
<slot name="headerFirstCell" />
|
|
100
|
+
|
|
101
|
+
<template v-for="(header, index) in _headers">
|
|
102
|
+
<AntTh
|
|
103
|
+
v-if="!_showLightVersion || (_showLightVersion && header.lightVersion)"
|
|
104
|
+
:key="`table-header-${header.identifier}-${index}`"
|
|
105
|
+
:header="header"
|
|
106
|
+
@sort="sortTable"
|
|
107
|
+
>
|
|
108
|
+
<template #headerContent>
|
|
109
|
+
<slot
|
|
110
|
+
name="headerContent"
|
|
111
|
+
v-bind="header"
|
|
112
|
+
/>
|
|
113
|
+
</template>
|
|
114
|
+
</AntTh>
|
|
115
|
+
</template>
|
|
116
|
+
|
|
117
|
+
<slot name="headerLastCell"></slot>
|
|
118
|
+
</tr>
|
|
116
119
|
</thead>
|
|
117
120
|
|
|
118
121
|
<tbody class="bg-white relative">
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
>
|
|
132
|
-
<slot name="rowFirstCell" v-bind="{ elem }"/>
|
|
133
|
-
|
|
134
|
-
<template v-for="(header, index) in _headers">
|
|
135
|
-
<AntTd
|
|
136
|
-
v-if="!_showLightVersion || (_showLightVersion && header.lightVersion)"
|
|
137
|
-
:header="header"
|
|
138
|
-
:element="elem"
|
|
139
|
-
:align="header.align"
|
|
140
|
-
:key="`table-cell-${header.identifier}-${index}`"
|
|
141
|
-
@click="rowClick(elem)"
|
|
142
|
-
>
|
|
143
|
-
<template #beforeCellContent="props">
|
|
144
|
-
<slot name="beforeCellContent" v-bind="props"/>
|
|
145
|
-
</template>
|
|
146
|
-
|
|
147
|
-
<template #cellContent="props">
|
|
148
|
-
<slot name="cellContent" v-bind="props"/>
|
|
149
|
-
</template>
|
|
150
|
-
|
|
151
|
-
<template #afterCellContent="props">
|
|
152
|
-
<slot name="afterCellContent" v-bind="props"/>
|
|
153
|
-
</template>
|
|
154
|
-
</AntTd>
|
|
155
|
-
</template>
|
|
156
|
-
|
|
157
|
-
<slot name="rowLastCell" v-bind="{ elem }"/>
|
|
158
|
-
</tr>
|
|
159
|
-
|
|
160
|
-
<tr v-if="data.length <= 0 && !_loading">
|
|
161
|
-
<td
|
|
162
|
-
colspan="100"
|
|
163
|
-
class="w-full h-full py-2 text-center text-neutral-50-font text-lg"
|
|
122
|
+
<!-- TODO:: Add some kind of virtual list for very large tree data (or required pagination??) -->
|
|
123
|
+
<tr
|
|
124
|
+
v-for="(elem, index) in data"
|
|
125
|
+
:id="elem[rowKey] as string"
|
|
126
|
+
:key="`table-row-${elem[rowKey]}-${index}`"
|
|
127
|
+
class="transition-all"
|
|
128
|
+
:class="{
|
|
129
|
+
'bg-primary-300 text-primary-300-font': elem === selected,
|
|
130
|
+
'bg-white text-for-white-bg-font': elem !== selected && index % 2 === 0,
|
|
131
|
+
'bg-neutral-100 text-neutral-100-font': elem !== selected && index % 2 !== 0,
|
|
132
|
+
'cursor-pointer': selectableRows
|
|
133
|
+
}"
|
|
164
134
|
>
|
|
165
|
-
<slot
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
135
|
+
<slot
|
|
136
|
+
name="rowFirstCell"
|
|
137
|
+
v-bind="{ elem }"
|
|
138
|
+
/>
|
|
139
|
+
|
|
140
|
+
<template v-for="(header, index) in _headers">
|
|
141
|
+
<AntTd
|
|
142
|
+
v-if="!_showLightVersion || (_showLightVersion && header.lightVersion)"
|
|
143
|
+
:key="`table-cell-${header.identifier}-${index}`"
|
|
144
|
+
:header="header"
|
|
145
|
+
:element="elem"
|
|
146
|
+
:align="header.align"
|
|
147
|
+
@click="rowClick(elem)"
|
|
148
|
+
>
|
|
149
|
+
<template #beforeCellContent="props">
|
|
150
|
+
<slot
|
|
151
|
+
name="beforeCellContent"
|
|
152
|
+
v-bind="props"
|
|
153
|
+
/>
|
|
154
|
+
</template>
|
|
155
|
+
|
|
156
|
+
<template #cellContent="props">
|
|
157
|
+
<slot
|
|
158
|
+
name="cellContent"
|
|
159
|
+
v-bind="props"
|
|
160
|
+
/>
|
|
161
|
+
</template>
|
|
162
|
+
|
|
163
|
+
<template #afterCellContent="props">
|
|
164
|
+
<slot
|
|
165
|
+
name="afterCellContent"
|
|
166
|
+
v-bind="props"
|
|
167
|
+
/>
|
|
168
|
+
</template>
|
|
169
|
+
</AntTd>
|
|
170
|
+
</template>
|
|
171
|
+
|
|
172
|
+
<slot
|
|
173
|
+
name="rowLastCell"
|
|
174
|
+
v-bind="{ elem }"
|
|
175
|
+
/>
|
|
176
|
+
</tr>
|
|
177
|
+
|
|
178
|
+
<tr v-if="data.length <= 0 && !_loading">
|
|
179
|
+
<td
|
|
180
|
+
colspan="100"
|
|
181
|
+
class="w-full h-full py-2 text-center text-for-white-bg-font text-lg"
|
|
182
|
+
>
|
|
183
|
+
<slot name="emptyState">
|
|
184
|
+
<div class="flex items-center flex-col">
|
|
185
|
+
<span class="font-semibold">We couldn't find any entry</span>
|
|
186
|
+
</div>
|
|
187
|
+
</slot>
|
|
188
|
+
</td>
|
|
189
|
+
</tr>
|
|
173
190
|
</tbody>
|
|
174
191
|
</table>
|
|
175
192
|
</div>
|
|
@@ -178,7 +195,10 @@ function rowClick(elem: Record<string, unknown>): void {
|
|
|
178
195
|
v-if="data.length > 0 && _loading"
|
|
179
196
|
class="absolute bg-opacity-50 w-full top-0 bottom-0 bg-neutral-300 flex items-center justify-center"
|
|
180
197
|
>
|
|
181
|
-
<AntSpinner
|
|
198
|
+
<AntSpinner
|
|
199
|
+
class="!w-24 !h-24"
|
|
200
|
+
:color-type="ColorType.primary"
|
|
201
|
+
/>
|
|
182
202
|
</div>
|
|
183
203
|
|
|
184
204
|
<div
|
|
@@ -186,7 +206,9 @@ function rowClick(elem: Record<string, unknown>): void {
|
|
|
186
206
|
class="absolute bg-opacity-50 w-full top-[40px] bottom-0 bg-neutral-300 flex items-center justify-center"
|
|
187
207
|
>
|
|
188
208
|
<AntSkeleton
|
|
189
|
-
v-model="_loading"
|
|
209
|
+
v-model="_loading"
|
|
210
|
+
absolute
|
|
211
|
+
/>
|
|
190
212
|
</div>
|
|
191
213
|
</div>
|
|
192
214
|
</template>
|
|
@@ -16,11 +16,23 @@ withDefaults(
|
|
|
16
16
|
|
|
17
17
|
<template>
|
|
18
18
|
<button
|
|
19
|
-
class="bg-
|
|
19
|
+
class="bg-white text-for-white-bg-font rounded h-[26px] w-[26px] flex items-center justify-center"
|
|
20
20
|
@click="$emit('sortClick')"
|
|
21
21
|
>
|
|
22
|
-
<AntIcon
|
|
23
|
-
|
|
24
|
-
|
|
22
|
+
<AntIcon
|
|
23
|
+
v-if="sortDirection === AntTableSortDirection.asc"
|
|
24
|
+
:icon="faAngleDown"
|
|
25
|
+
:size="IconSize.sm"
|
|
26
|
+
/>
|
|
27
|
+
<AntIcon
|
|
28
|
+
v-if="sortDirection === AntTableSortDirection.desc"
|
|
29
|
+
:icon="faAngleUp"
|
|
30
|
+
:size="IconSize.sm"
|
|
31
|
+
/>
|
|
32
|
+
<AntIcon
|
|
33
|
+
v-if="sortDirection === AntTableSortDirection.neutral"
|
|
34
|
+
:icon="faMinus"
|
|
35
|
+
:size="IconSize.sm"
|
|
36
|
+
/>
|
|
25
37
|
</button>
|
|
26
38
|
</template>
|
|
@@ -52,13 +52,13 @@ const containerClasses = computed(() => {
|
|
|
52
52
|
[ColorType.danger]: 'text-danger-500 border-danger-500',
|
|
53
53
|
};
|
|
54
54
|
const notActiveVariants: Record<ColorType, string> = {
|
|
55
|
-
[ColorType.base]: 'text-
|
|
55
|
+
[ColorType.base]: 'text-for-white-bg-font border-white',
|
|
56
56
|
[ColorType.warning]: 'text-warning-500',
|
|
57
57
|
[ColorType.danger]: 'text-danger-500',
|
|
58
58
|
};
|
|
59
59
|
|
|
60
60
|
return {
|
|
61
|
-
'p-2.5 hover:cursor-pointer text-center flex items-center justify-center gap-2.5 bg-
|
|
61
|
+
'p-2.5 hover:cursor-pointer text-center flex items-center justify-center gap-2.5 bg-white transition-[background-color] relative': true,
|
|
62
62
|
'grow': props.expanded,
|
|
63
63
|
[variants[props.colorType]]: true,
|
|
64
64
|
[activeVariants[props.colorType]]: _active.value,
|
|
@@ -98,7 +98,7 @@ const iconColor = computed(() => {
|
|
|
98
98
|
<AntIcon
|
|
99
99
|
v-if="icon"
|
|
100
100
|
:icon="icon"
|
|
101
|
-
:color="_active ? 'text-primary-500' : 'text-
|
|
101
|
+
:color="_active ? 'text-primary-500' : 'text-for-white-bg-font'"
|
|
102
102
|
/>
|
|
103
103
|
</slot>
|
|
104
104
|
|
|
@@ -110,6 +110,9 @@ const iconColor = computed(() => {
|
|
|
110
110
|
:color="iconColor"
|
|
111
111
|
/>
|
|
112
112
|
|
|
113
|
-
<div
|
|
113
|
+
<div
|
|
114
|
+
v-if="_active"
|
|
115
|
+
:class="borderBoxClasses"
|
|
116
|
+
/>
|
|
114
117
|
</component>
|
|
115
118
|
</template>
|