@ouestfrance/sipa-bms-ui 8.14.3 → 8.15.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/sipa-bms-ui.css +8 -8
- package/dist/sipa-bms-ui.es.js +37 -32
- package/dist/sipa-bms-ui.es.js.map +1 -1
- package/dist/sipa-bms-ui.umd.js +37 -32
- package/dist/sipa-bms-ui.umd.js.map +1 -1
- package/package.json +5 -2
- package/src/components/form/BmsInputToggle.vue +1 -0
- package/src/components/table/BmsServerTable.stories.js +44 -0
- package/src/components/table/BmsServerTable.vue +4 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ouestfrance/sipa-bms-ui",
|
|
3
|
-
"version": "8.
|
|
3
|
+
"version": "8.15.0",
|
|
4
4
|
"author": "Ouest-France BMS",
|
|
5
5
|
"license": "ISC",
|
|
6
6
|
"scripts": {
|
|
@@ -95,7 +95,10 @@
|
|
|
95
95
|
"types": "./dist/index.d.ts",
|
|
96
96
|
"exports": {
|
|
97
97
|
".": {
|
|
98
|
-
"import":
|
|
98
|
+
"import": {
|
|
99
|
+
"types": "./dist/index.d.ts",
|
|
100
|
+
"default": "./dist/sipa-bms-ui.es.js"
|
|
101
|
+
},
|
|
99
102
|
"require": "./dist/sipa-bms-ui.umd.js"
|
|
100
103
|
},
|
|
101
104
|
"./dist/sipa-bms-ui.css": "./dist/sipa-bms-ui.css",
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import BmsServerTable from '@/components/table/BmsServerTable.vue';
|
|
2
|
+
import BmsButton from '@/components/button/BmsButton.vue';
|
|
2
3
|
import { SelectMode } from '@/models/table.model';
|
|
3
4
|
import { http, HttpResponse } from 'msw';
|
|
4
5
|
|
|
@@ -420,3 +421,46 @@ SelectAllMode.args = {
|
|
|
420
421
|
size: 2,
|
|
421
422
|
page: 1,
|
|
422
423
|
};
|
|
424
|
+
|
|
425
|
+
const TemplateWithCustomActions = (args) => ({
|
|
426
|
+
components: {
|
|
427
|
+
BmsServerTable,
|
|
428
|
+
BmsButton,
|
|
429
|
+
},
|
|
430
|
+
setup() {
|
|
431
|
+
return { args };
|
|
432
|
+
},
|
|
433
|
+
template: `
|
|
434
|
+
<BmsServerTable v-bind="args">
|
|
435
|
+
<template #custom-actions>
|
|
436
|
+
<BmsButton type="secondary">Custom action</BmsButton>
|
|
437
|
+
</template>
|
|
438
|
+
</BmsServerTable>
|
|
439
|
+
`,
|
|
440
|
+
});
|
|
441
|
+
export const WithCustomActions = TemplateWithCustomActions.bind({});
|
|
442
|
+
WithCustomActions.parameters = {
|
|
443
|
+
msw: {
|
|
444
|
+
handlers: [mswRequestHandler()],
|
|
445
|
+
},
|
|
446
|
+
};
|
|
447
|
+
WithCustomActions.args = {
|
|
448
|
+
headers: [
|
|
449
|
+
{
|
|
450
|
+
label: 'Column 1',
|
|
451
|
+
key: 'col1',
|
|
452
|
+
align: 'start',
|
|
453
|
+
},
|
|
454
|
+
{
|
|
455
|
+
label: 'Column 2',
|
|
456
|
+
key: 'col2',
|
|
457
|
+
align: 'center',
|
|
458
|
+
},
|
|
459
|
+
{
|
|
460
|
+
label: 'Column 3',
|
|
461
|
+
key: 'col3',
|
|
462
|
+
align: 'end',
|
|
463
|
+
},
|
|
464
|
+
],
|
|
465
|
+
url: 'https://fakeapi.com/items',
|
|
466
|
+
};
|
|
@@ -327,6 +327,10 @@ const onSelectAll = () => emits('update:selectMode', SelectMode.ALL);
|
|
|
327
327
|
@selectAll="onSelectAll"
|
|
328
328
|
@clearSelection="onClearSelection"
|
|
329
329
|
>
|
|
330
|
+
<template #custom-actions>
|
|
331
|
+
<slot name="custom-action"></slot>
|
|
332
|
+
</template>
|
|
333
|
+
|
|
330
334
|
<template v-for="(_, name) in $slots" v-slot:[name]="slotData">
|
|
331
335
|
<slot :name="name" v-bind="slotData" />
|
|
332
336
|
</template>
|