@antify/ui 2.2.0 → 2.2.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/AntAccordion.vue +25 -12
- package/dist/components/AntAccordionItem.vue +28 -13
- package/dist/components/AntAlert.vue +25 -15
- package/dist/components/AntCard.vue +26 -14
- package/dist/components/AntContent.vue +4 -4
- package/dist/components/AntDropdown.vue +41 -23
- package/dist/components/AntIcon.vue +18 -6
- package/dist/components/AntKeycap.vue +31 -16
- package/dist/components/AntListGroup.vue +13 -11
- package/dist/components/AntListGroupItem.vue +19 -9
- package/dist/components/AntModal.vue +26 -15
- package/dist/components/AntPagination.vue +28 -15
- package/dist/components/AntPopover.vue +74 -51
- package/dist/components/AntSkeleton.vue +8 -4
- package/dist/components/AntSpinner.vue +14 -6
- package/dist/components/AntTag.vue +25 -13
- package/dist/components/AntToast.vue +19 -11
- package/dist/components/AntToaster.vue +13 -5
- package/dist/components/AntTooltip.vue +78 -54
- package/dist/components/__stories/AntAccordion.stories.js +4 -4
- package/dist/components/__stories/AntAccordion.stories.mjs +50 -17
- package/dist/components/__stories/AntAlert.stories.mjs +18 -5
- package/dist/components/__stories/AntCard.stories.mjs +36 -10
- package/dist/components/__stories/AntContent.stories.mjs +14 -4
- package/dist/components/__stories/AntDropdown.stories.mjs +20 -4
- package/dist/components/__stories/AntIcon.stories.mjs +38 -12
- package/dist/components/__stories/AntKeycap.stories.mjs +35 -10
- package/dist/components/__stories/AntListGroup.stories.d.ts +1 -1
- package/dist/components/__stories/AntListGroup.stories.mjs +22 -4
- package/dist/components/__stories/AntListGroupItem.stories.mjs +27 -8
- package/dist/components/__stories/AntModal.stories.mjs +17 -4
- package/dist/components/__stories/AntPagination.stories.mjs +21 -6
- package/dist/components/__stories/AntPopover.stories.mjs +20 -4
- package/dist/components/__stories/AntSkeleton.stories.mjs +17 -5
- package/dist/components/__stories/AntSpinner.stories.mjs +33 -9
- package/dist/components/__stories/AntTag.stories.mjs +28 -8
- package/dist/components/__stories/AntToast.stories.mjs +19 -5
- package/dist/components/__stories/AntToaster.stories.d.ts +1 -1
- package/dist/components/__stories/AntToaster.stories.mjs +35 -9
- package/dist/components/__stories/AntTooltip.stories.js +1 -1
- package/dist/components/__stories/AntTooltip.stories.mjs +44 -13
- package/dist/components/buttons/AntActionButton.vue +38 -29
- package/dist/components/buttons/AntButton.vue +34 -13
- package/dist/components/buttons/AntCreateButton.vue +11 -4
- package/dist/components/buttons/AntDeleteButton.vue +11 -4
- package/dist/components/buttons/AntDuplicateButton.vue +11 -4
- package/dist/components/buttons/AntEditButton.vue +11 -4
- package/dist/components/buttons/AntSaveAndNewButton.vue +11 -4
- package/dist/components/buttons/AntSaveButton.vue +11 -4
- package/dist/components/buttons/__stories/AntActionButton.stories.mjs +35 -10
- package/dist/components/buttons/__stories/AntButton.stories.mjs +77 -23
- package/dist/components/buttons/__stories/AntCreateButton.stories.mjs +25 -7
- package/dist/components/buttons/__stories/AntDeleteButton.stories.mjs +25 -7
- package/dist/components/buttons/__stories/AntDuplicateButton.stories.mjs +25 -7
- package/dist/components/buttons/__stories/AntEditButton.stories.mjs +25 -7
- package/dist/components/buttons/__stories/AntSaveAndNewButton.stories.mjs +25 -7
- package/dist/components/buttons/__stories/AntSaveButton.stories.mjs +25 -7
- package/dist/components/crud/AntCrud.vue +6 -6
- package/dist/components/crud/AntCrudDetail.vue +8 -5
- package/dist/components/crud/AntCrudDetailActions.vue +14 -8
- package/dist/components/crud/AntCrudDetailNav.vue +21 -13
- package/dist/components/crud/AntCrudTableFilter.vue +29 -17
- package/dist/components/crud/AntCrudTableNav.vue +36 -22
- package/dist/components/crud/__stories/AntCrud.stories.mjs +17 -5
- package/dist/components/crud/__stories/AntCrudDetail.stories.mjs +11 -3
- package/dist/components/crud/__stories/AntCrudDetailActions.stories.mjs +10 -2
- package/dist/components/crud/__stories/AntCrudDetailNav.stories.mjs +11 -3
- package/dist/components/crud/__stories/AntCrudTableFilter.stories.mjs +17 -5
- package/dist/components/crud/__stories/AntCrudTableNav.stories.mjs +23 -7
- package/dist/components/dialogs/AntDeleteDialog.vue +13 -5
- package/dist/components/dialogs/AntDialog.vue +23 -13
- package/dist/components/dialogs/__stories/AndDeleteDialog.stories.mjs +12 -3
- package/dist/components/dialogs/__stories/AntDialog.stories.mjs +28 -7
- package/dist/components/forms/AntField.vue +18 -7
- package/dist/components/forms/AntFormGroup.vue +9 -5
- package/dist/components/forms/AntFormGroupLabel.vue +1 -1
- package/dist/components/forms/__stories/AntField.stories.mjs +37 -9
- package/dist/components/forms/__stories/AntFormGroup.stories.mjs +20 -5
- package/dist/components/forms/__stories/AntFormGroupLabel.stories.mjs +11 -3
- package/dist/components/index.d.ts +1 -1
- package/dist/components/inputs/AntCheckbox.vue +61 -36
- package/dist/components/inputs/AntCheckboxGroup.vue +40 -15
- package/dist/components/inputs/AntDateInput.vue +35 -12
- package/dist/components/inputs/AntNumberInput.vue +33 -12
- package/dist/components/inputs/AntPasswordInput.vue +32 -11
- package/dist/components/inputs/AntRadio.vue +57 -34
- package/dist/components/inputs/AntRadioGroup.vue +60 -35
- package/dist/components/inputs/AntRangeSlider.vue +31 -12
- package/dist/components/inputs/AntSearch.vue +19 -7
- package/dist/components/inputs/AntSelect.vue +107 -83
- package/dist/components/inputs/AntSwitch.vue +36 -18
- package/dist/components/inputs/AntSwitcher.vue +30 -15
- package/dist/components/inputs/AntTagInput.vue +91 -61
- package/dist/components/inputs/AntTextInput.vue +31 -11
- package/dist/components/inputs/AntTextarea.vue +53 -25
- package/dist/components/inputs/AntUnitInput.vue +33 -12
- package/dist/components/inputs/Elements/AntBaseInput.vue +47 -18
- package/dist/components/inputs/Elements/AntInputDescription.vue +16 -8
- package/dist/components/inputs/Elements/AntInputLabel.vue +13 -5
- package/dist/components/inputs/Elements/AntInputLimiter.vue +13 -5
- package/dist/components/inputs/Elements/AntSelectMenu.vue +65 -41
- package/dist/components/inputs/Elements/__stories/AntBaseInput.stories.mjs +104 -27
- package/dist/components/inputs/Elements/__stories/AntInputDescription.stories.mjs +33 -9
- package/dist/components/inputs/Elements/__stories/AntInputLabel.stories.mjs +34 -9
- package/dist/components/inputs/Elements/__stories/AntInputLimiter.stories.mjs +33 -9
- package/dist/components/inputs/Elements/index.d.ts +1 -1
- package/dist/components/inputs/__stories/AntCheckbox.stories.mjs +34 -9
- package/dist/components/inputs/__stories/AntCheckboxGroup.stories.mjs +45 -21
- package/dist/components/inputs/__stories/AntDateInput.stories.mjs +52 -14
- package/dist/components/inputs/__stories/AntNumberInput.stories.mjs +66 -17
- package/dist/components/inputs/__stories/AntPasswordInput.stories.mjs +51 -13
- package/dist/components/inputs/__stories/AntRadioGroup.stories.mjs +45 -12
- package/dist/components/inputs/__stories/AntRangeSlider.stories.mjs +16 -5
- package/dist/components/inputs/__stories/AntSearch.stories.mjs +41 -10
- package/dist/components/inputs/__stories/AntSelect.stories.mjs +59 -15
- package/dist/components/inputs/__stories/AntSwitch.stories.js +126 -102
- package/dist/components/inputs/__stories/AntSwitch.stories.mjs +162 -112
- package/dist/components/inputs/__stories/AntSwitcher.stories.mjs +38 -10
- package/dist/components/inputs/__stories/AntTagInput.stories.mjs +46 -12
- package/dist/components/inputs/__stories/AntTextInput.stories.mjs +59 -16
- package/dist/components/inputs/__stories/AntTextarea.stories.mjs +47 -13
- package/dist/components/inputs/__stories/AntUnitInput.stories.mjs +46 -12
- package/dist/components/layouts/AntNavLeftLayout.vue +12 -6
- package/dist/components/layouts/__stories/AntNavLeftLayout.stories.mjs +10 -2
- package/dist/components/navbar/AntNavbar.vue +7 -3
- package/dist/components/navbar/AntNavbarItem.vue +12 -6
- package/dist/components/navbar/__stories/AntNavbar.stories.mjs +59 -37
- package/dist/components/table/AntCollapsibleTableRowContent.vue +7 -5
- package/dist/components/table/AntTable.vue +227 -165
- package/dist/components/table/AntTableSkeleton.vue +126 -0
- package/dist/components/table/AntTableSortButton.vue +22 -13
- package/dist/components/table/AntTd.vue +21 -17
- package/dist/components/table/AntTh.vue +19 -12
- package/dist/components/table/__stories/AntTable.stories.js +132 -14
- package/dist/components/table/__stories/AntTable.stories.mjs +253 -31
- package/dist/components/table/__types/index.d.ts +0 -1
- package/dist/components/table/__types/index.js +0 -11
- package/dist/components/table/__types/index.mjs +0 -1
- package/dist/components/tabs/AntTabItem.vue +20 -8
- package/dist/components/tabs/AntTabs.vue +35 -21
- package/dist/components/tabs/__stories/AntTabItem.stories.mjs +23 -7
- package/dist/components/tabs/__stories/AntTabs.stories.mjs +45 -13
- package/dist/components/transitions/AntTransitionCollapseHeight.vue +1 -1
- package/dist/composables/useToaster.mjs +25 -7
- package/dist/index.css +1 -0
- package/dist/utils.mjs +3 -1
- package/package.json +23 -16
- package/dist/tailwind.config.d.ts +0 -3
- package/dist/tailwind.config.js +0 -198
- package/dist/tailwind.config.mjs +0 -189
|
@@ -1,19 +1,24 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
|
|
2
|
+
import {
|
|
3
|
+
AntTableAlign, AntTableRowTypes, AntTableSize, type TableHeader,
|
|
4
|
+
} from './__types/TableHeader.types';
|
|
5
|
+
import {
|
|
6
|
+
computed,
|
|
7
|
+
} from 'vue';
|
|
8
|
+
import {
|
|
9
|
+
type RouteLocationRaw, RouterLink,
|
|
10
|
+
} from 'vue-router';
|
|
5
11
|
|
|
6
12
|
const props =
|
|
7
|
-
withDefaults(
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
});
|
|
13
|
+
withDefaults(defineProps<{
|
|
14
|
+
element: Record<string, unknown>;
|
|
15
|
+
header: TableHeader;
|
|
16
|
+
align?: AntTableAlign;
|
|
17
|
+
size?: AntTableSize;
|
|
18
|
+
}>(), {
|
|
19
|
+
align: AntTableAlign.left,
|
|
20
|
+
size: AntTableSize.md,
|
|
21
|
+
});
|
|
17
22
|
|
|
18
23
|
const cellClasses = computed(() => ({
|
|
19
24
|
'whitespace-nowrap text-sm font-medium relative': true,
|
|
@@ -21,7 +26,7 @@ const cellClasses = computed(() => ({
|
|
|
21
26
|
'text-center': props.align === AntTableAlign.center,
|
|
22
27
|
'px-2.5 py-0 h-10': props.size === AntTableSize.lg,
|
|
23
28
|
'px-2 py-0 h-9': props.size === AntTableSize.md,
|
|
24
|
-
'px-1.5 py-0 h-8': props.size === AntTableSize.sm
|
|
29
|
+
'px-1.5 py-0 h-8': props.size === AntTableSize.sm,
|
|
25
30
|
}));
|
|
26
31
|
</script>
|
|
27
32
|
|
|
@@ -47,8 +52,7 @@ const cellClasses = computed(() => ({
|
|
|
47
52
|
<RouterLink
|
|
48
53
|
:to="element[header.toProp] as RouteLocationRaw"
|
|
49
54
|
class="absolute inset-0"
|
|
50
|
-
|
|
51
|
-
</RouterLink>
|
|
55
|
+
/>
|
|
52
56
|
{{ element[header.identifier] }}
|
|
53
57
|
</div>
|
|
54
58
|
|
|
@@ -65,7 +69,7 @@ const cellClasses = computed(() => ({
|
|
|
65
69
|
<slot
|
|
66
70
|
name="cellContent"
|
|
67
71
|
v-bind="{ element, header }"
|
|
68
|
-
|
|
72
|
+
/>
|
|
69
73
|
</div>
|
|
70
74
|
|
|
71
75
|
<slot
|
|
@@ -1,18 +1,22 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
2
|
|
|
3
|
-
import {
|
|
4
|
-
|
|
3
|
+
import {
|
|
4
|
+
AntTableAlign, AntTableSize, AntTableSortDirection, type TableHeader,
|
|
5
|
+
} from './__types/TableHeader.types';
|
|
6
|
+
import {
|
|
7
|
+
computed, ref, type Ref,
|
|
8
|
+
} from 'vue';
|
|
5
9
|
import AntTableSortButton from './AntTableSortButton.vue';
|
|
6
10
|
|
|
7
|
-
defineEmits([
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
);
|
|
11
|
+
defineEmits([
|
|
12
|
+
'sort',
|
|
13
|
+
]);
|
|
14
|
+
const props = withDefaults(defineProps<{
|
|
15
|
+
header: TableHeader;
|
|
16
|
+
size?: AntTableSize;
|
|
17
|
+
}>(), {
|
|
18
|
+
size: AntTableSize.md,
|
|
19
|
+
});
|
|
16
20
|
|
|
17
21
|
const headerClasses = computed(() => ({
|
|
18
22
|
[props.header.headerClassList || '']: true,
|
|
@@ -22,7 +26,7 @@ const headerClasses = computed(() => ({
|
|
|
22
26
|
'text-right': props.header.align === AntTableAlign.right,
|
|
23
27
|
'px-2.5 py-0 h-10': props.size === AntTableSize.lg,
|
|
24
28
|
'px-2 py-0 h-9': props.size === AntTableSize.md,
|
|
25
|
-
'px-1.5 py-0 h-8': props.size === AntTableSize.sm
|
|
29
|
+
'px-1.5 py-0 h-8': props.size === AntTableSize.sm,
|
|
26
30
|
}));
|
|
27
31
|
|
|
28
32
|
const cellClasses = computed(() => ({
|
|
@@ -41,15 +45,18 @@ const sortDirection: Ref<AntTableSortDirection> = ref(AntTableSortDirection.neut
|
|
|
41
45
|
function getNewSortDirection(): AntTableSortDirection {
|
|
42
46
|
if (sortDirection.value === AntTableSortDirection.neutral) {
|
|
43
47
|
sortDirection.value = AntTableSortDirection.asc;
|
|
48
|
+
|
|
44
49
|
return AntTableSortDirection.asc;
|
|
45
50
|
}
|
|
46
51
|
|
|
47
52
|
if (sortDirection.value === AntTableSortDirection.asc) {
|
|
48
53
|
sortDirection.value = AntTableSortDirection.desc;
|
|
54
|
+
|
|
49
55
|
return AntTableSortDirection.desc;
|
|
50
56
|
}
|
|
51
57
|
|
|
52
58
|
sortDirection.value = AntTableSortDirection.neutral;
|
|
59
|
+
|
|
53
60
|
return AntTableSortDirection.neutral;
|
|
54
61
|
}
|
|
55
62
|
</script>
|
|
@@ -5,12 +5,20 @@ 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("../../buttons/AntButton.vue"));
|
|
9
|
+
var _AntSelect = _interopRequireDefault(require("../../inputs/AntSelect.vue"));
|
|
10
|
+
var _AntCheckboxGroup = _interopRequireDefault(require("../../inputs/AntCheckboxGroup.vue"));
|
|
8
11
|
var _TableHeader = require("../__types/TableHeader.types");
|
|
9
12
|
var _vue = require("vue");
|
|
10
13
|
var _faker = require("@faker-js/faker");
|
|
11
14
|
var _AntSwitch = _interopRequireDefault(require("../../inputs/AntSwitch.vue"));
|
|
15
|
+
var _test = require("@storybook/test");
|
|
12
16
|
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
13
17
|
const meta = {
|
|
18
|
+
components: {
|
|
19
|
+
AntSelect: _AntSelect.default,
|
|
20
|
+
AntCheckboxGroup: _AntCheckboxGroup.default
|
|
21
|
+
},
|
|
14
22
|
title: "Components/Table",
|
|
15
23
|
component: _AntTable.default,
|
|
16
24
|
parameters: {
|
|
@@ -137,7 +145,7 @@ const meta = {
|
|
|
137
145
|
};
|
|
138
146
|
module.exports = meta;
|
|
139
147
|
const testData = (0, _vue.ref)([]);
|
|
140
|
-
|
|
148
|
+
function getRandomEntry() {
|
|
141
149
|
const randomName = _faker.faker.person.firstName() + " " + _faker.faker.person.lastName();
|
|
142
150
|
const randomNumber = _faker.faker.number.int({
|
|
143
151
|
min: 18,
|
|
@@ -145,24 +153,41 @@ for (let i = 0; i < 100; i++) {
|
|
|
145
153
|
});
|
|
146
154
|
const randomEmail = _faker.faker.internet.email();
|
|
147
155
|
const randomBoolean = _faker.faker.datatype.boolean();
|
|
148
|
-
|
|
156
|
+
const randomPermissions = _faker.faker.helpers.arrayElements(["read", "write"], {
|
|
157
|
+
min: 0,
|
|
158
|
+
max: 2
|
|
159
|
+
});
|
|
160
|
+
return {
|
|
149
161
|
name: randomName,
|
|
150
162
|
age: randomNumber,
|
|
151
163
|
email: randomEmail,
|
|
152
|
-
employed: randomBoolean
|
|
153
|
-
|
|
164
|
+
employed: randomBoolean,
|
|
165
|
+
permissions: randomPermissions
|
|
166
|
+
};
|
|
167
|
+
}
|
|
168
|
+
for (let i = 0; i < 100; i++) {
|
|
169
|
+
testData.value.push(getRandomEntry());
|
|
154
170
|
}
|
|
155
171
|
const Docs = exports.Docs = {
|
|
156
172
|
render: args => ({
|
|
157
173
|
components: {
|
|
158
174
|
AntTable: _AntTable.default,
|
|
159
|
-
AntSwitch: _AntSwitch.default
|
|
175
|
+
AntSwitch: _AntSwitch.default,
|
|
176
|
+
AntCheckboxGroup: _AntCheckboxGroup.default
|
|
160
177
|
},
|
|
161
178
|
setup() {
|
|
162
179
|
const selected = (0, _vue.ref)();
|
|
180
|
+
const checkboxes = [{
|
|
181
|
+
label: "Read",
|
|
182
|
+
value: "read"
|
|
183
|
+
}, {
|
|
184
|
+
label: "Write",
|
|
185
|
+
value: "write"
|
|
186
|
+
}];
|
|
163
187
|
return {
|
|
164
188
|
args,
|
|
165
|
-
selected
|
|
189
|
+
selected,
|
|
190
|
+
checkboxes
|
|
166
191
|
};
|
|
167
192
|
},
|
|
168
193
|
template: `
|
|
@@ -172,11 +197,52 @@ const Docs = exports.Docs = {
|
|
|
172
197
|
<div v-if="header.identifier === 'employed'">
|
|
173
198
|
<AntSwitch v-model="entry.employed"/>
|
|
174
199
|
</div>
|
|
200
|
+
|
|
201
|
+
<div v-if="header.identifier === 'permissions'">
|
|
202
|
+
<AntCheckboxGroup v-model="entry.permissions" :checkboxes="checkboxes" direction="row"/>
|
|
203
|
+
</div>
|
|
175
204
|
</template>
|
|
176
205
|
</AntTable>
|
|
177
206
|
</div>
|
|
178
207
|
`
|
|
179
208
|
}),
|
|
209
|
+
play: async ({
|
|
210
|
+
step
|
|
211
|
+
}) => {
|
|
212
|
+
const firstRow = document.querySelectorAll('[data-e2e="table-row"]')[0];
|
|
213
|
+
const employedCell = firstRow.querySelector('[data-e2e="table-cell-employed"]');
|
|
214
|
+
const employedSwitch = employedCell?.querySelector('[data-e2e="switch"]')?.querySelector("button");
|
|
215
|
+
const permissionsCell = firstRow.querySelector('[data-e2e="table-cell-permissions"]');
|
|
216
|
+
const permissionCheckboxWithLabel = permissionsCell?.querySelector('[data-e2e="checkbox"]');
|
|
217
|
+
const permissionCheckbox = permissionCheckboxWithLabel?.querySelector('[type="checkbox"]');
|
|
218
|
+
const permissionLabel = permissionCheckboxWithLabel?.querySelector("label");
|
|
219
|
+
await step("Click on a table cell and expect the row to be selected", async () => {
|
|
220
|
+
await _test.userEvent.click(employedCell);
|
|
221
|
+
await (0, _test.waitFor)(() => (0, _test.expect)(firstRow).toHaveClass("bg-primary-200"), {
|
|
222
|
+
timeout: 600
|
|
223
|
+
});
|
|
224
|
+
});
|
|
225
|
+
await step("Click on employed switch and expect the value to toggle", async () => {
|
|
226
|
+
const initialAriaChecked = JSON.parse(employedSwitch?.getAttribute("aria-checked"));
|
|
227
|
+
await _test.userEvent.click(employedSwitch);
|
|
228
|
+
await (0, _test.waitFor)(() => {
|
|
229
|
+
const toggledAriaChecked = JSON.parse(employedSwitch?.getAttribute("aria-checked"));
|
|
230
|
+
(0, _test.expect)(toggledAriaChecked).toBe(!initialAriaChecked);
|
|
231
|
+
}, {
|
|
232
|
+
timeout: 600
|
|
233
|
+
});
|
|
234
|
+
});
|
|
235
|
+
await step("Click on one of the permissions and expect the value to toggle", async () => {
|
|
236
|
+
const initialAriaChecked = JSON.parse(permissionCheckbox?.getAttribute("aria-checked"));
|
|
237
|
+
await _test.userEvent.click(permissionLabel);
|
|
238
|
+
await (0, _test.waitFor)(() => {
|
|
239
|
+
const toggledAriaChecked = JSON.parse(permissionCheckbox?.getAttribute("aria-checked"));
|
|
240
|
+
(0, _test.expect)(toggledAriaChecked).toBe(!initialAriaChecked);
|
|
241
|
+
}, {
|
|
242
|
+
timeout: 600
|
|
243
|
+
});
|
|
244
|
+
});
|
|
245
|
+
},
|
|
180
246
|
args: {
|
|
181
247
|
headers: [{
|
|
182
248
|
title: "Name",
|
|
@@ -200,6 +266,11 @@ const Docs = exports.Docs = {
|
|
|
200
266
|
identifier: "employed",
|
|
201
267
|
rowClassList: "",
|
|
202
268
|
type: _TableHeader.AntTableRowTypes.slot
|
|
269
|
+
}, {
|
|
270
|
+
title: "Permissions",
|
|
271
|
+
identifier: "permissions",
|
|
272
|
+
rowClassList: "",
|
|
273
|
+
type: _TableHeader.AntTableRowTypes.slot
|
|
203
274
|
}],
|
|
204
275
|
data: testData.value
|
|
205
276
|
}
|
|
@@ -338,13 +409,22 @@ const Collapsible = exports.Collapsible = {
|
|
|
338
409
|
render: args => ({
|
|
339
410
|
components: {
|
|
340
411
|
AntTable: _AntTable.default,
|
|
341
|
-
AntSwitch: _AntSwitch.default
|
|
412
|
+
AntSwitch: _AntSwitch.default,
|
|
413
|
+
AntCheckboxGroup: _AntCheckboxGroup.default
|
|
342
414
|
},
|
|
343
415
|
setup() {
|
|
344
416
|
const selected = (0, _vue.ref)();
|
|
417
|
+
const checkboxes = [{
|
|
418
|
+
label: "Read",
|
|
419
|
+
value: "read"
|
|
420
|
+
}, {
|
|
421
|
+
label: "Write",
|
|
422
|
+
value: "write"
|
|
423
|
+
}];
|
|
345
424
|
return {
|
|
346
425
|
args,
|
|
347
|
-
selected
|
|
426
|
+
selected,
|
|
427
|
+
checkboxes
|
|
348
428
|
};
|
|
349
429
|
},
|
|
350
430
|
template: `
|
|
@@ -354,6 +434,10 @@ const Collapsible = exports.Collapsible = {
|
|
|
354
434
|
<div v-if="header.identifier === 'employed'">
|
|
355
435
|
<AntSwitch v-model="entry.employed"/>
|
|
356
436
|
</div>
|
|
437
|
+
|
|
438
|
+
<div v-if="header.identifier === 'permissions'">
|
|
439
|
+
<AntCheckboxGroup v-model="entry.permissions" :checkboxes="checkboxes" direction="row"/>
|
|
440
|
+
</div>
|
|
357
441
|
</template>
|
|
358
442
|
|
|
359
443
|
<template #afterRowContent="{element, rowIndex}">
|
|
@@ -373,13 +457,22 @@ const MultipleCollapseStrategy = exports.MultipleCollapseStrategy = {
|
|
|
373
457
|
render: args => ({
|
|
374
458
|
components: {
|
|
375
459
|
AntTable: _AntTable.default,
|
|
376
|
-
AntSwitch: _AntSwitch.default
|
|
460
|
+
AntSwitch: _AntSwitch.default,
|
|
461
|
+
AntCheckboxGroup: _AntCheckboxGroup.default
|
|
377
462
|
},
|
|
378
463
|
setup() {
|
|
379
464
|
const selected = (0, _vue.ref)();
|
|
465
|
+
const checkboxes = [{
|
|
466
|
+
label: "Read",
|
|
467
|
+
value: "read"
|
|
468
|
+
}, {
|
|
469
|
+
label: "Write",
|
|
470
|
+
value: "write"
|
|
471
|
+
}];
|
|
380
472
|
return {
|
|
381
473
|
args,
|
|
382
|
-
selected
|
|
474
|
+
selected,
|
|
475
|
+
checkboxes
|
|
383
476
|
};
|
|
384
477
|
},
|
|
385
478
|
template: `
|
|
@@ -389,6 +482,10 @@ const MultipleCollapseStrategy = exports.MultipleCollapseStrategy = {
|
|
|
389
482
|
<div v-if="header.identifier === 'employed'">
|
|
390
483
|
<AntSwitch v-model="entry.employed"/>
|
|
391
484
|
</div>
|
|
485
|
+
|
|
486
|
+
<div v-if="header.identifier === 'permissions'">
|
|
487
|
+
<AntCheckboxGroup v-model="entry.permissions" :checkboxes="checkboxes" direction="row"/>
|
|
488
|
+
</div>
|
|
392
489
|
</template>
|
|
393
490
|
|
|
394
491
|
<template #afterRowContent="{element, rowIndex}">
|
|
@@ -408,22 +505,43 @@ const DefaultCollapseOpen = exports.DefaultCollapseOpen = {
|
|
|
408
505
|
render: args => ({
|
|
409
506
|
components: {
|
|
410
507
|
AntTable: _AntTable.default,
|
|
411
|
-
AntSwitch: _AntSwitch.default
|
|
508
|
+
AntSwitch: _AntSwitch.default,
|
|
509
|
+
AntCheckboxGroup: _AntCheckboxGroup.default,
|
|
510
|
+
AntButton: _AntButton.default
|
|
412
511
|
},
|
|
413
512
|
setup() {
|
|
414
513
|
const selected = (0, _vue.ref)();
|
|
514
|
+
const data = (0, _vue.ref)(args.data.splice(0, 5));
|
|
515
|
+
const checkboxes = [{
|
|
516
|
+
label: "Read",
|
|
517
|
+
value: "read"
|
|
518
|
+
}, {
|
|
519
|
+
label: "Write",
|
|
520
|
+
value: "write"
|
|
521
|
+
}];
|
|
522
|
+
function addRandomEntry() {
|
|
523
|
+
data.value = [...data.value, getRandomEntry()];
|
|
524
|
+
}
|
|
415
525
|
return {
|
|
416
526
|
args,
|
|
417
|
-
|
|
527
|
+
data,
|
|
528
|
+
selected,
|
|
529
|
+
checkboxes,
|
|
530
|
+
addRandomEntry
|
|
418
531
|
};
|
|
419
532
|
},
|
|
420
533
|
template: `
|
|
421
|
-
<div class="h-96 border border-dashed border-base-300">
|
|
422
|
-
<
|
|
534
|
+
<div class="h-96 border border-dashed border-base-300 flex flex-col gap-2">
|
|
535
|
+
<AntButton state="primary" @click="addRandomEntry" filled>Add Random Entry</AntButton>
|
|
536
|
+
<AntTable v-bind="args" :data="data" v-model="selected" :selected-row="selected" @row-click="(val) => selected = val" collapse-strategy="multiple" expandedRows>
|
|
423
537
|
<template #cellContent="{element: entry, header}">
|
|
424
538
|
<div v-if="header.identifier === 'employed'">
|
|
425
539
|
<AntSwitch v-model="entry.employed"/>
|
|
426
540
|
</div>
|
|
541
|
+
|
|
542
|
+
<div v-if="header.identifier === 'permissions'">
|
|
543
|
+
<AntCheckboxGroup v-model="entry.permissions" :checkboxes="checkboxes" direction="row"/>
|
|
544
|
+
</div>
|
|
427
545
|
</template>
|
|
428
546
|
|
|
429
547
|
<template #afterRowContent="{element, rowIndex}">
|