@ouestfrance/sipa-bms-ui 8.6.0 → 8.8.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/form/BmsAutocomplete.vue.d.ts +2 -0
- package/dist/components/form/BmsInputBooleanCheckbox.vue.d.ts +1 -1
- package/dist/components/form/BmsInputCheckboxGroup.vue.d.ts +2 -2
- package/dist/components/form/BmsInputCode.vue.d.ts +2 -2
- package/dist/components/form/BmsInputNumber.vue.d.ts +2 -2
- package/dist/components/form/BmsInputRadio.vue.d.ts +2 -2
- package/dist/components/form/BmsInputText.vue.d.ts +24 -22
- package/dist/components/form/BmsMultiSelect.vue.d.ts +3 -1
- package/dist/components/form/BmsSearch.vue.d.ts +28 -24
- package/dist/components/form/BmsSelect.vue.d.ts +7 -17
- package/dist/components/form/RawAutocomplete.vue.d.ts +17 -21
- package/dist/components/form/RawInputText.vue.d.ts +9 -9
- package/dist/components/form/RawSelect.vue.d.ts +30 -0
- package/dist/components/navigation/UiTenantSwitcher.vue.d.ts +28 -24
- package/dist/components/table/BmsServerTable.vue.d.ts +18 -0
- package/dist/components/table/BmsTable.vue.d.ts +18 -1
- package/dist/components/table/BmsTableFilters.vue.d.ts +47 -25
- package/dist/composables/search.composable.d.ts +1 -0
- package/dist/mockServiceWorker.js +16 -12
- package/dist/plugins/field/FieldDatalist.vue.d.ts +2 -0
- package/dist/plugins/field/field-component.model.d.ts +2 -2
- package/dist/sipa-bms-ui.css +220 -168
- package/dist/sipa-bms-ui.es.js +729 -524
- package/dist/sipa-bms-ui.es.js.map +1 -1
- package/dist/sipa-bms-ui.umd.js +734 -529
- package/dist/sipa-bms-ui.umd.js.map +1 -1
- package/package.json +11 -11
- package/src/assets/scss/global-variables.scss +6 -0
- package/src/components/feedback/UiTooltip.vue +1 -1
- package/src/components/form/BmsAutocomplete.vue +3 -0
- package/src/components/form/BmsInputNumber.spec.ts +26 -0
- package/src/components/form/BmsInputNumber.stories.js +20 -3
- package/src/components/form/BmsInputNumber.vue +36 -4
- package/src/components/form/BmsInputRadio.vue +1 -1
- package/src/components/form/BmsInputText.spec.ts +25 -0
- package/src/components/form/BmsInputText.stories.js +28 -3
- package/src/components/form/BmsInputText.vue +73 -12
- package/src/components/form/BmsMultiSelect.vue +66 -28
- package/src/components/form/BmsSelect.vue +60 -57
- package/src/components/form/RawAutocomplete.spec.ts +0 -8
- package/src/components/form/RawAutocomplete.vue +42 -24
- package/src/components/form/RawInputText.vue +14 -21
- package/src/components/form/RawSelect.vue +111 -0
- package/src/components/layout/BmsOverlay.vue +2 -2
- package/src/components/layout/UiPopoverMenu.vue +1 -1
- package/src/components/navigation/BmsMenu.vue +1 -1
- package/src/components/table/BmsServerTable.vue +18 -3
- package/src/components/table/BmsTable.vue +15 -2
- package/src/components/table/BmsTableFilters.vue +19 -7
- package/src/composables/search.composable.spec.ts +75 -0
- package/src/composables/search.composable.ts +54 -11
- package/src/plugins/field/FieldComponent.vue +7 -5
- package/src/plugins/field/FieldDatalist.stories.js +0 -9
- package/src/plugins/field/FieldDatalist.vue +16 -13
- package/src/plugins/field/field-component.model.ts +2 -2
- package/src/plugins/notifications/NotificationWidget.vue +1 -1
- package/src/showroom/pages/autocomplete.vue +22 -1
- package/src/showroom/pages/server-table.vue +53 -22
- package/src/showroom/pages/table.vue +42 -3
- package/src/showroom/pages/zindex.vue +39 -0
- package/dist/plugins/field/FieldDatalist.spec.d.ts +0 -1
- package/src/plugins/field/FieldDatalist.spec.ts +0 -35
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<BmsBackButton :fallback="{ path: '/' }" />
|
|
3
|
+
<br />
|
|
4
|
+
<BmsButton @click="changeChoice">Change choice</BmsButton>
|
|
3
5
|
<bms-table
|
|
4
6
|
:headers="headers"
|
|
5
7
|
:filters="filters"
|
|
@@ -13,6 +15,8 @@
|
|
|
13
15
|
v-model:selectedItems="selectedItems"
|
|
14
16
|
@saveFilter="onSaveFilter"
|
|
15
17
|
@deleteSavedFilter="onDeleteSavedFilter"
|
|
18
|
+
@filterInput="onFilterInput"
|
|
19
|
+
@filterChange="onFilterChange"
|
|
16
20
|
>
|
|
17
21
|
<template #choice2="{ row }">
|
|
18
22
|
<BmsTooltip tooltipText="tooltip">
|
|
@@ -140,7 +144,6 @@ const items = Array(100)
|
|
|
140
144
|
|
|
141
145
|
const savedFilters: Ref<SavedFilter[]> = ref<SavedFilter[]>([]);
|
|
142
146
|
const selectedItems: Ref<any[]> = ref([]);
|
|
143
|
-
|
|
144
147
|
const onSaveFilter = (savedFilter: SavedFilter) => {
|
|
145
148
|
savedFilters.value.push(savedFilter);
|
|
146
149
|
};
|
|
@@ -151,7 +154,28 @@ const onDeleteSavedFilter = (savedFilter: SavedFilter) => {
|
|
|
151
154
|
);
|
|
152
155
|
};
|
|
153
156
|
|
|
154
|
-
const
|
|
157
|
+
const onFilterInput = ({
|
|
158
|
+
filterKey,
|
|
159
|
+
e,
|
|
160
|
+
value,
|
|
161
|
+
}: {
|
|
162
|
+
filterKey: string;
|
|
163
|
+
e: InputEvent;
|
|
164
|
+
value: any;
|
|
165
|
+
}) => {
|
|
166
|
+
console.log(`Input in filter ${filterKey} with val ${value}`);
|
|
167
|
+
};
|
|
168
|
+
const onFilterChange = ({
|
|
169
|
+
filterKey,
|
|
170
|
+
value,
|
|
171
|
+
}: {
|
|
172
|
+
filterKey: string;
|
|
173
|
+
value: any;
|
|
174
|
+
}) => {
|
|
175
|
+
console.log(`Change in filter ${filterKey} with val`, value);
|
|
176
|
+
};
|
|
177
|
+
|
|
178
|
+
const filters = ref<Filter[]>([
|
|
155
179
|
{
|
|
156
180
|
label: 'inputText Colonne 1',
|
|
157
181
|
key: 'column1',
|
|
@@ -199,5 +223,20 @@ const filters: Filter[] = [
|
|
|
199
223
|
customFilter: (item: any, value: any, target: string) =>
|
|
200
224
|
item[target] > 0.5 === value,
|
|
201
225
|
},
|
|
202
|
-
];
|
|
226
|
+
]);
|
|
227
|
+
const changeChoice = () => {
|
|
228
|
+
filters.value = filters.value.map((f) =>
|
|
229
|
+
f.key === 'choice2'
|
|
230
|
+
? {
|
|
231
|
+
...f,
|
|
232
|
+
selectOptions: [
|
|
233
|
+
{ label: 'huey', value: 'huey' },
|
|
234
|
+
{ label: 'riri', value: 'riri' },
|
|
235
|
+
{ label: 'fifi', value: 'fifi' },
|
|
236
|
+
{ label: 'loulou', value: 'loulou' },
|
|
237
|
+
],
|
|
238
|
+
}
|
|
239
|
+
: f,
|
|
240
|
+
);
|
|
241
|
+
};
|
|
203
242
|
</script>
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import BmsButton from '@/components/button/BmsButton.vue';
|
|
3
|
+
import BmsTooltip from '@/components/feedback/BmsTooltip.vue';
|
|
4
|
+
import BmsHeader from '@/components/layout/BmsHeader.vue';
|
|
5
|
+
import BmsModal from '@/components/layout/BmsModal.vue';
|
|
6
|
+
import UiPopoverMenu from '@/components/layout/UiPopoverMenu.vue';
|
|
7
|
+
import BmsTenantSwitcher from '@/components/navigation/BmsTenantSwitcher.vue';
|
|
8
|
+
import { Tenant } from '@/models';
|
|
9
|
+
import { useNotifications } from '@/plugins/notifications';
|
|
10
|
+
import { ref } from 'vue';
|
|
11
|
+
|
|
12
|
+
const isModalOpen = ref(false);
|
|
13
|
+
const { success, error } = useNotifications();
|
|
14
|
+
|
|
15
|
+
const onClick = () => {
|
|
16
|
+
isModalOpen.value = true;
|
|
17
|
+
success('toto');
|
|
18
|
+
};
|
|
19
|
+
|
|
20
|
+
const tenants: Tenant[] = [{ id: '1', information: '1', label: 'Tenant 1' }];
|
|
21
|
+
</script>
|
|
22
|
+
|
|
23
|
+
<template>
|
|
24
|
+
<BmsTooltip
|
|
25
|
+
:tooltip-text="'hello hello hello hello hello hello hello hello hello hello hello hello hello hello'"
|
|
26
|
+
>
|
|
27
|
+
<BmsButton @click="onClick">Hello</BmsButton>
|
|
28
|
+
</BmsTooltip>
|
|
29
|
+
<BmsTenantSwitcher
|
|
30
|
+
:tenants="tenants"
|
|
31
|
+
:current-tenant="null"
|
|
32
|
+
select-tenant-label="Coucou"
|
|
33
|
+
select-tenant-placeholder="toto"
|
|
34
|
+
/>
|
|
35
|
+
|
|
36
|
+
<BmsHeader> fixed header</BmsHeader>
|
|
37
|
+
|
|
38
|
+
<BmsModal v-model="isModalOpen"> Ouvrir la modale </BmsModal>
|
|
39
|
+
</template>
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
import FieldDatalist, { type Props } from '@/plugins/field/FieldDatalist.vue';
|
|
2
|
-
import { mount } from '@vue/test-utils';
|
|
3
|
-
import { field } from '@/plugins/field';
|
|
4
|
-
|
|
5
|
-
const factory = (props?: Props) => {
|
|
6
|
-
const wrapper = mount(FieldDatalist, {
|
|
7
|
-
global: {
|
|
8
|
-
plugins: [field],
|
|
9
|
-
},
|
|
10
|
-
props: {
|
|
11
|
-
isInputFocused: false,
|
|
12
|
-
options: [
|
|
13
|
-
{ label: 'titi', value: 'i' },
|
|
14
|
-
{ label: 'toto', value: 'o' },
|
|
15
|
-
{ label: 'tutu', value: 'u' },
|
|
16
|
-
],
|
|
17
|
-
modelValue: '',
|
|
18
|
-
...props,
|
|
19
|
-
},
|
|
20
|
-
attachTo: document.body,
|
|
21
|
-
});
|
|
22
|
-
|
|
23
|
-
return { wrapper };
|
|
24
|
-
};
|
|
25
|
-
|
|
26
|
-
describe('FieldDatalist', () => {
|
|
27
|
-
it('should be able to select with keyboard', async () => {
|
|
28
|
-
const { wrapper } = factory();
|
|
29
|
-
const titi = wrapper.get('[data-testid="i"]');
|
|
30
|
-
|
|
31
|
-
expect(titi.classes()).toStrictEqual([]);
|
|
32
|
-
await wrapper.trigger('keydown.down');
|
|
33
|
-
expect(titi.classes()).toStrictEqual(['selected']);
|
|
34
|
-
});
|
|
35
|
-
});
|