@ouestfrance/sipa-bms-ui 8.22.3 → 8.23.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/button/BmsIconButton.vue.d.ts +1 -1
- package/dist/components/button/BmsToggleIcon.vue.d.ts +24 -0
- package/dist/components/button/UiButton.vue.d.ts +1 -1
- package/dist/components/form/BmsInputText.vue.d.ts +1 -1
- package/dist/components/form/BmsSearch.vue.d.ts +3 -3
- package/dist/components/form/BmsSelect.vue.d.ts +1 -1
- package/dist/components/form/RawSelect.vue.d.ts +1 -1
- package/dist/components/navigation/UiTenantSwitcher.vue.d.ts +3 -3
- package/dist/components/table/BmsPagination.vue.d.ts +2 -0
- package/dist/components/table/BmsServerTable.vue.d.ts +3 -3
- package/dist/components/table/BmsTable.vue.d.ts +3 -3
- package/dist/components/table/BmsTableFilters.vue.d.ts +5 -3
- package/dist/components/table/UiBmsTable.vue.d.ts +3 -3
- package/dist/components/table/UiFilterButton.vue.d.ts +2 -0
- package/dist/index.d.ts +2 -1
- package/dist/models/table.model.d.ts +5 -0
- package/dist/plugins/field/FieldComponent.vue.d.ts +1 -1
- package/dist/showroom/pages/table.vue.d.ts +2 -0
- package/dist/sipa-bms-ui.css +151 -87
- package/dist/sipa-bms-ui.es.js +230 -159
- package/dist/sipa-bms-ui.es.js.map +1 -1
- package/dist/sipa-bms-ui.umd.js +234 -161
- package/dist/sipa-bms-ui.umd.js.map +1 -1
- package/package.json +2 -2
- package/src/components/button/BmsToggleIcon.stories.js +145 -0
- package/src/components/button/BmsToggleIcon.vue +108 -0
- package/src/components/form/BmsInputNumber.stories.js +12 -2
- package/src/components/form/BmsInputNumber.vue +2 -1
- package/src/components/form/BmsInputText.stories.js +9 -0
- package/src/components/form/BmsInputText.vue +2 -0
- package/src/components/layout/BmsFloatingWindow.vue +12 -1
- package/src/components/layout/BmsSplitWindow.vue +1 -1
- package/src/components/table/BmsPagination.vue +3 -0
- package/src/components/table/BmsServerTable.stories.js +59 -3
- package/src/components/table/BmsServerTable.vue +9 -2
- package/src/components/table/BmsTable.stories.js +65 -1
- package/src/components/table/BmsTable.vue +14 -3
- package/src/components/table/BmsTableFilters.vue +15 -5
- package/src/components/table/UiBmsTable.stories.js +3 -0
- package/src/components/table/UiBmsTable.vue +14 -5
- package/src/components/table/UiFilterButton.vue +6 -1
- package/src/index.ts +3 -0
- package/src/models/table.model.ts +6 -0
- package/src/showroom/pages/floating-window.vue +36 -0
|
@@ -13,6 +13,7 @@ import {
|
|
|
13
13
|
Sort,
|
|
14
14
|
SortValue,
|
|
15
15
|
TableHeader,
|
|
16
|
+
TableMode,
|
|
16
17
|
} from '@/models';
|
|
17
18
|
import { computed, Ref, ref, watch, watchEffect } from 'vue';
|
|
18
19
|
import BmsTableFilters from './BmsTableFilters.vue';
|
|
@@ -21,6 +22,7 @@ import { BmsTag } from '@/index';
|
|
|
21
22
|
import * as lucideIcons from 'lucide-vue-next';
|
|
22
23
|
import { Trash } from 'lucide-vue-next';
|
|
23
24
|
import { useRoute } from 'vue-router';
|
|
25
|
+
import Table from '@/showroom/pages/table.vue';
|
|
24
26
|
|
|
25
27
|
const route = useRoute();
|
|
26
28
|
const slots = defineSlots();
|
|
@@ -32,7 +34,7 @@ interface UiTableProps {
|
|
|
32
34
|
savedFilters?: SavedFilter[];
|
|
33
35
|
canSaveFilters?: boolean;
|
|
34
36
|
items: unknown[];
|
|
35
|
-
mode?:
|
|
37
|
+
mode?: TableMode;
|
|
36
38
|
persistent?: boolean;
|
|
37
39
|
pagination?: number[];
|
|
38
40
|
size?: number;
|
|
@@ -45,7 +47,7 @@ interface UiTableProps {
|
|
|
45
47
|
}
|
|
46
48
|
|
|
47
49
|
const props = withDefaults(defineProps<UiTableProps>(), {
|
|
48
|
-
mode:
|
|
50
|
+
mode: TableMode.NORMAL,
|
|
49
51
|
persistent: true,
|
|
50
52
|
pagination: () => [25, 50, 100],
|
|
51
53
|
size: 25,
|
|
@@ -233,6 +235,8 @@ const onSelectAll = () => {
|
|
|
233
235
|
};
|
|
234
236
|
|
|
235
237
|
const totalSize = computed(() => elementsAndChildElements.value.length);
|
|
238
|
+
|
|
239
|
+
const isTableSmall = computed(() => props.mode === TableMode.SMALL);
|
|
236
240
|
</script>
|
|
237
241
|
|
|
238
242
|
<template>
|
|
@@ -264,6 +268,7 @@ const totalSize = computed(() => elementsAndChildElements.value.length);
|
|
|
264
268
|
<div v-show="isFilterVisible" class="filters-container">
|
|
265
269
|
<BmsTableFilters
|
|
266
270
|
v-model="filters"
|
|
271
|
+
:small="isTableSmall"
|
|
267
272
|
:canSaveFilters="canSaveFilters"
|
|
268
273
|
@saveFilter="onSaveFilter"
|
|
269
274
|
@reset-filters="resetFilters"
|
|
@@ -300,10 +305,15 @@ const totalSize = computed(() => elementsAndChildElements.value.length);
|
|
|
300
305
|
:activeFiltersNb="numberOfActiveFilters"
|
|
301
306
|
:isFilterVisible="isFilterVisible"
|
|
302
307
|
@toggleFilters="toggleFilters"
|
|
308
|
+
:small="isTableSmall"
|
|
303
309
|
/>
|
|
304
310
|
<template v-if="!disableSearch">
|
|
305
311
|
<slot name="search">
|
|
306
|
-
<BmsSearch
|
|
312
|
+
<BmsSearch
|
|
313
|
+
v-model="search"
|
|
314
|
+
class="table-search"
|
|
315
|
+
:small="isTableSmall"
|
|
316
|
+
/>
|
|
307
317
|
</slot>
|
|
308
318
|
</template>
|
|
309
319
|
</template>
|
|
@@ -325,6 +335,7 @@ const totalSize = computed(() => elementsAndChildElements.value.length);
|
|
|
325
335
|
:currentPage="currentPage"
|
|
326
336
|
:sizes="paginationsOptions"
|
|
327
337
|
:pages="totalPages"
|
|
338
|
+
:small="isTableSmall"
|
|
328
339
|
@prev="onPrevClick"
|
|
329
340
|
@next="onNextClick"
|
|
330
341
|
@go="go($event)"
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<div class="filters">
|
|
2
|
+
<div class="filters" :class="{ 'filters--small': small }">
|
|
3
3
|
<div class="filters__header">
|
|
4
4
|
<div class="filters__header-title">
|
|
5
5
|
<FilterIcon />
|
|
@@ -23,7 +23,7 @@
|
|
|
23
23
|
</BmsIconButton>
|
|
24
24
|
</span>
|
|
25
25
|
</div>
|
|
26
|
-
<div class="filters__inputs">
|
|
26
|
+
<div class="filters__inputs" :class="{ 'filters__inputs--small': small }">
|
|
27
27
|
<span
|
|
28
28
|
v-for="filter in modelValue"
|
|
29
29
|
class="input"
|
|
@@ -34,6 +34,7 @@
|
|
|
34
34
|
>
|
|
35
35
|
<component
|
|
36
36
|
:is="getFilterComponent(filter.type)"
|
|
37
|
+
:small="small"
|
|
37
38
|
:label="filter.label"
|
|
38
39
|
:inputType="filter.inputType"
|
|
39
40
|
:modelValue="transformValueForComponent(filter?.value, filter.type)"
|
|
@@ -104,9 +105,11 @@ const props = withDefaults(
|
|
|
104
105
|
defineProps<{
|
|
105
106
|
modelValue: Filter[];
|
|
106
107
|
canSaveFilters?: boolean;
|
|
108
|
+
small?: boolean;
|
|
107
109
|
}>(),
|
|
108
110
|
{
|
|
109
111
|
canSaveFilters: false,
|
|
112
|
+
small: false,
|
|
110
113
|
},
|
|
111
114
|
);
|
|
112
115
|
|
|
@@ -246,11 +249,15 @@ watch(
|
|
|
246
249
|
|
|
247
250
|
<style lang="scss" scoped>
|
|
248
251
|
.filters {
|
|
249
|
-
padding:
|
|
252
|
+
padding: 1em;
|
|
250
253
|
background: var(--bms-white);
|
|
251
254
|
border: 1px solid var(--bms-grey-10);
|
|
252
255
|
border-radius: var(--bms-border-radius-large);
|
|
253
|
-
margin-bottom:
|
|
256
|
+
margin-bottom: 1em;
|
|
257
|
+
&--small {
|
|
258
|
+
margin-bottom: 0.5em;
|
|
259
|
+
padding: 0.5em;
|
|
260
|
+
}
|
|
254
261
|
|
|
255
262
|
&__header {
|
|
256
263
|
display: flex;
|
|
@@ -268,9 +275,12 @@ watch(
|
|
|
268
275
|
&__inputs {
|
|
269
276
|
display: flex;
|
|
270
277
|
flex-wrap: wrap;
|
|
271
|
-
padding-top: 16px;
|
|
272
278
|
align-items: flex-end;
|
|
273
279
|
row-gap: 8px;
|
|
280
|
+
padding-top: 1em;
|
|
281
|
+
&--small {
|
|
282
|
+
padding-top: 0.5em;
|
|
283
|
+
}
|
|
274
284
|
|
|
275
285
|
.input {
|
|
276
286
|
width: 25%;
|
|
@@ -5,6 +5,7 @@ import {
|
|
|
5
5
|
SortValue,
|
|
6
6
|
StatusType,
|
|
7
7
|
type TableHeader,
|
|
8
|
+
TableMode,
|
|
8
9
|
} from '@/models';
|
|
9
10
|
import _get from 'lodash/get';
|
|
10
11
|
import _isEqual from 'lodash/isEqual';
|
|
@@ -27,7 +28,7 @@ import UiBmsTableRow from './UiBmsTableRow.vue';
|
|
|
27
28
|
interface UiBmsTableProps {
|
|
28
29
|
headers: TableHeader[];
|
|
29
30
|
items: any[];
|
|
30
|
-
mode?:
|
|
31
|
+
mode?: TableMode;
|
|
31
32
|
loading?: boolean;
|
|
32
33
|
hasFilters?: boolean;
|
|
33
34
|
sort?: Sort;
|
|
@@ -40,7 +41,7 @@ interface UiBmsTableProps {
|
|
|
40
41
|
}
|
|
41
42
|
|
|
42
43
|
const props = withDefaults(defineProps<UiBmsTableProps>(), {
|
|
43
|
-
mode:
|
|
44
|
+
mode: TableMode.NORMAL,
|
|
44
45
|
hasFilters: false,
|
|
45
46
|
sort: () => ({
|
|
46
47
|
key: null,
|
|
@@ -211,7 +212,10 @@ onMounted(() => {
|
|
|
211
212
|
|
|
212
213
|
<template>
|
|
213
214
|
<div class="bms-table">
|
|
214
|
-
<div
|
|
215
|
+
<div
|
|
216
|
+
class="bms-table__actions"
|
|
217
|
+
:class="{ 'bms-table__actions--small': mode === TableMode.SMALL }"
|
|
218
|
+
>
|
|
215
219
|
<div class="bms-table__actions__saved-filters">
|
|
216
220
|
<div class="bms-table__actions__custom">
|
|
217
221
|
<slot name="custom-actions"></slot>
|
|
@@ -321,7 +325,7 @@ onMounted(() => {
|
|
|
321
325
|
:headers="filteredHeaders"
|
|
322
326
|
:select-mode="selectMode"
|
|
323
327
|
:selectable-disabled="selectableDisabled"
|
|
324
|
-
:dense="mode ===
|
|
328
|
+
:dense="mode === TableMode.DENSE || mode === TableMode.SMALL"
|
|
325
329
|
@select="onItemSelect"
|
|
326
330
|
>
|
|
327
331
|
<template v-for="cell in headers" v-slot:[cell.key]="slotData">
|
|
@@ -400,7 +404,11 @@ onMounted(() => {
|
|
|
400
404
|
display: flex;
|
|
401
405
|
align-items: center;
|
|
402
406
|
justify-content: space-between;
|
|
403
|
-
margin-bottom:
|
|
407
|
+
margin-bottom: 1em;
|
|
408
|
+
|
|
409
|
+
&--small {
|
|
410
|
+
margin-bottom: 0.5em;
|
|
411
|
+
}
|
|
404
412
|
|
|
405
413
|
&__saved-filters {
|
|
406
414
|
display: flex;
|
|
@@ -528,6 +536,7 @@ onMounted(() => {
|
|
|
528
536
|
visibility: hidden;
|
|
529
537
|
--table-blob-height: 80px;
|
|
530
538
|
|
|
539
|
+
&.small,
|
|
531
540
|
&.dense {
|
|
532
541
|
--table-blob-height: 50px;
|
|
533
542
|
}
|
|
@@ -4,6 +4,7 @@
|
|
|
4
4
|
class="filter-button"
|
|
5
5
|
:color="isFilterVisible ? StatusType.Default : StatusType.Information"
|
|
6
6
|
:mode="isFilterVisible ? 'fill' : 'ghost'"
|
|
7
|
+
:small="small"
|
|
7
8
|
@click="$emits('toggleFilters')"
|
|
8
9
|
>
|
|
9
10
|
<FilterIcon />
|
|
@@ -23,11 +24,13 @@ import { StatusType } from '@/models';
|
|
|
23
24
|
interface UiFilterButtonProps {
|
|
24
25
|
isFilterVisible: boolean;
|
|
25
26
|
activeFiltersNb: number;
|
|
27
|
+
small?: boolean;
|
|
26
28
|
}
|
|
27
29
|
|
|
28
30
|
const props = withDefaults(defineProps<UiFilterButtonProps>(), {
|
|
29
31
|
isFilterVisible: false,
|
|
30
32
|
activeFiltersNb: 0,
|
|
33
|
+
small: false,
|
|
31
34
|
});
|
|
32
35
|
|
|
33
36
|
const $emits = defineEmits<{
|
|
@@ -43,8 +46,10 @@ const showIndicator = computed(
|
|
|
43
46
|
.filter-button-container {
|
|
44
47
|
position: relative;
|
|
45
48
|
|
|
49
|
+
:deep(.bms-button .content) {
|
|
50
|
+
margin: 0;
|
|
51
|
+
}
|
|
46
52
|
.filter-button {
|
|
47
|
-
padding: 0.5em 0;
|
|
48
53
|
font-size: 20px;
|
|
49
54
|
}
|
|
50
55
|
.indicator {
|
package/src/index.ts
CHANGED
|
@@ -2,6 +2,7 @@ import { App } from 'vue';
|
|
|
2
2
|
|
|
3
3
|
import BmsButton from './components/button/BmsButton.vue';
|
|
4
4
|
import BmsIconButton from './components/button/BmsIconButton.vue';
|
|
5
|
+
import BmsToggleIcon from './components/button/BmsToggleIcon.vue';
|
|
5
6
|
|
|
6
7
|
import BmsAlert from './components/feedback/BmsAlert.vue';
|
|
7
8
|
import BmsBadge from './components/feedback/BmsBadge.vue';
|
|
@@ -75,6 +76,7 @@ export const createBmsUi = () => ({
|
|
|
75
76
|
install: (app: App) => {
|
|
76
77
|
app.component('BmsButton', BmsButton);
|
|
77
78
|
app.component('BmsIconButton', BmsIconButton);
|
|
79
|
+
app.component('BmsToggleIcon', BmsToggleIcon);
|
|
78
80
|
|
|
79
81
|
app.component('BmsAlert', BmsAlert);
|
|
80
82
|
app.component('BmsBadge', BmsBadge);
|
|
@@ -159,6 +161,7 @@ export * from './services';
|
|
|
159
161
|
export {
|
|
160
162
|
BmsButton,
|
|
161
163
|
BmsIconButton,
|
|
164
|
+
BmsToggleIcon,
|
|
162
165
|
BmsAlert,
|
|
163
166
|
BmsBadge,
|
|
164
167
|
BmsCaption,
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<BmsSplitWindow>
|
|
3
|
+
<template #first>
|
|
4
|
+
<div class="first">
|
|
5
|
+
first
|
|
6
|
+
<BmsFloatingWindow
|
|
7
|
+
title="coucou"
|
|
8
|
+
:model-value="true"
|
|
9
|
+
expandable
|
|
10
|
+
:expand-target="'.second'"
|
|
11
|
+
height="500px"
|
|
12
|
+
>
|
|
13
|
+
cc
|
|
14
|
+
</BmsFloatingWindow>
|
|
15
|
+
</div>
|
|
16
|
+
</template>
|
|
17
|
+
<template #second> <div class="second">second</div> </template>
|
|
18
|
+
</BmsSplitWindow>
|
|
19
|
+
</template>
|
|
20
|
+
|
|
21
|
+
<script setup lang="ts">
|
|
22
|
+
import BmsFloatingWindow from '@/components/layout/BmsFloatingWindow.vue';
|
|
23
|
+
import BmsSplitWindow from '@/components/layout/BmsSplitWindow.vue';
|
|
24
|
+
</script>
|
|
25
|
+
|
|
26
|
+
<style scoped lang="scss">
|
|
27
|
+
.first {
|
|
28
|
+
background-color: red;
|
|
29
|
+
height: 200px;
|
|
30
|
+
width: 100%;
|
|
31
|
+
}
|
|
32
|
+
.second {
|
|
33
|
+
background-color: blue;
|
|
34
|
+
width: 100%;
|
|
35
|
+
}
|
|
36
|
+
</style>
|