@ouestfrance/sipa-bms-ui 8.1.4 → 8.3.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.
Files changed (45) hide show
  1. package/dist/components/form/BmsMultiSelect.vue.d.ts +29 -0
  2. package/dist/components/form/BmsSelect.vue.d.ts +15 -4
  3. package/dist/components/table/BmsServerTable.vue.d.ts +2 -2
  4. package/dist/components/table/UiBmsTable.vue.d.ts +8 -4
  5. package/dist/components/table/UiBmsTableRow.vue.d.ts +38 -0
  6. package/dist/composables/search.composable.d.ts +2 -2
  7. package/dist/index.d.ts +2 -1
  8. package/dist/mockServiceWorker.js +1 -1
  9. package/dist/models/table.model.d.ts +2 -1
  10. package/dist/sipa-bms-ui.css +116 -57
  11. package/dist/sipa-bms-ui.es.js +1677 -1451
  12. package/dist/sipa-bms-ui.es.js.map +1 -1
  13. package/dist/sipa-bms-ui.umd.js +1682 -1455
  14. package/dist/sipa-bms-ui.umd.js.map +1 -1
  15. package/package.json +13 -13
  16. package/src/assets/scss/global-variables.scss +1 -1
  17. package/src/components/button/UiButton.stories.js +7 -0
  18. package/src/components/feedback/BmsBadge.stories.js +1 -2
  19. package/src/components/feedback/BmsTooltip.stories.js +1 -2
  20. package/src/components/feedback/UiTooltip.stories.js +6 -0
  21. package/src/components/form/BmsInputToggle.stories.js +1 -1
  22. package/src/components/form/BmsMultiSelect.stories.js +82 -0
  23. package/src/components/form/BmsMultiSelect.vue +140 -0
  24. package/src/components/form/BmsSelect.vue +30 -25
  25. package/src/components/form/UiBmsInputCheckbox.stories.js +1 -1
  26. package/src/components/form/UiBmsSwitch.stories.js +6 -1
  27. package/src/components/layout/BmsForm.stories.js +1 -1
  28. package/src/components/layout/BmsHeaderTitle.stories.js +1 -1
  29. package/src/components/navigation/BmsShortLinkMenu.stories.js +1 -1
  30. package/src/components/navigation/UiMenuItem.stories.js +6 -0
  31. package/src/components/navigation/UiMenuItemStatus.stories.js +6 -0
  32. package/src/components/navigation/UiTab.stories.js +7 -0
  33. package/src/components/navigation/UiTenantSwitcher.stories.js +6 -0
  34. package/src/components/table/BmsTable.stories.js +113 -0
  35. package/src/components/table/UiBmsTable.stories.js +49 -1
  36. package/src/components/table/UiBmsTable.vue +68 -70
  37. package/src/components/table/UiBmsTableRow.stories.js +143 -0
  38. package/src/components/table/UiBmsTableRow.vue +150 -0
  39. package/src/components/table/UiFilterButton.stories.js +6 -0
  40. package/src/components/utils/BmsProblem.stories.js +1 -1
  41. package/src/documentation/template_internal_component.mdx +19 -0
  42. package/src/index.ts +3 -0
  43. package/src/models/table.model.ts +2 -1
  44. package/src/showroom/pages/forms.vue +23 -1
  45. package/src/showroom/pages/table.vue +30 -5
@@ -1,7 +1,7 @@
1
1
  import BmsProblem from '@/components/utils/BmsProblem.vue';
2
2
 
3
3
  export default {
4
- title: 'Composants/utils/BmsProblem',
4
+ title: 'Composants/utils/Problem',
5
5
  component: BmsProblem,
6
6
  };
7
7
 
@@ -0,0 +1,19 @@
1
+ import {
2
+ Meta,
3
+ Title,
4
+ Primary,
5
+ Controls,
6
+ Stories,
7
+ } from '@storybook/addon-docs/blocks';
8
+
9
+ <Meta isTemplate />
10
+
11
+ <Title />
12
+
13
+ Ce composant est un composant **interne** à la librairie qui n'est pas exposé.
14
+
15
+ <Primary />
16
+
17
+ <Controls />
18
+
19
+ <Stories />
package/src/index.ts CHANGED
@@ -28,6 +28,7 @@ import BmsInputRadioCaption from './components/form/BmsInputRadioCaption.vue';
28
28
  import BmsInputRadioCaptionGroup from './components/form/BmsInputRadioCaptionGroup.vue';
29
29
  import BmsInputText from './components/form/BmsInputText.vue';
30
30
  import BmsInputToggle from '@/components/form/BmsInputToggle.vue';
31
+ import BmsMultiSelect from '@/components/form/BmsMultiSelect.vue';
31
32
  import BmsSearch from './components/form/BmsSearch.vue';
32
33
  import BmsSelect from './components/form/BmsSelect.vue';
33
34
  import BmsTag from './components/form/BmsTag.vue';
@@ -95,6 +96,7 @@ export const createBmsUi = () => ({
95
96
  app.component('BmsInputRadioCaptionGroup', BmsInputRadioCaptionGroup);
96
97
  app.component('BmsInputText', BmsInputText);
97
98
  app.component('BmsInputToggle', BmsInputToggle);
99
+ app.component('BmsMultiSelect', BmsMultiSelect);
98
100
  app.component('BmsSearch', BmsSearch);
99
101
  app.component('BmsSelect', BmsSelect);
100
102
  app.component('BmsTag', BmsTag);
@@ -170,6 +172,7 @@ export {
170
172
  BmsInputRadioCaptionGroup,
171
173
  BmsInputText,
172
174
  BmsInputToggle,
175
+ BmsMultiSelect,
173
176
  BmsSearch,
174
177
  BmsSelect,
175
178
  BmsTag,
@@ -1,3 +1,4 @@
1
+ import { InputType } from './form.model';
1
2
  import { Sort, SortFunction } from './sort.model';
2
3
 
3
4
  export interface TableHeader {
@@ -32,7 +33,7 @@ export type FilterType =
32
33
 
33
34
  export interface Filter {
34
35
  label: string;
35
- inputType?: string;
36
+ inputType?: InputType;
36
37
  key: string;
37
38
  type: FilterType;
38
39
  value?: any;
@@ -257,6 +257,26 @@
257
257
 
258
258
  <hr />
259
259
 
260
+ <BmsMultiSelect
261
+ label="multi select"
262
+ required
263
+ placeholder="This is a placeholder"
264
+ v-model="multiSelect"
265
+ :options="[
266
+ { label: 'toto1', value: 'value1', icon: BellIcon },
267
+ { label: 'titi2', value: 'value2', icon: Magnet },
268
+ { label: 'toto3', value: 'value3', icon: Egg },
269
+ { label: 'toto4', value: 'value4', icon: Egg },
270
+ { label: 'toto5', value: 'value5', icon: Egg },
271
+ { label: 'toto6', value: 'value6', icon: Egg },
272
+ { label: 'toto7', value: 'value7', icon: Egg },
273
+ { label: 'toto8', value: 'value8', icon: Egg },
274
+ { label: 'toto9', value: 'value9', icon: Egg },
275
+ ]"
276
+ />
277
+
278
+ <hr />
279
+
260
280
  <BmsTextArea
261
281
  label="textArea"
262
282
  required
@@ -330,9 +350,10 @@ import BmsInputDateTime from '@/components/form/BmsInputDateTime.vue';
330
350
  import BmsInputCheckboxGroup from '@/components/form/BmsInputCheckboxGroup.vue';
331
351
  import BmsInputCheckboxCaption from '@/components/form/BmsInputCheckboxCaption.vue';
332
352
  import BmsInputCheckboxCaptionGroup from '@/components/form/BmsInputCheckboxCaptionGroup.vue';
333
- import { Copy } from 'lucide-vue-next';
353
+ import { Copy, BellIcon, Egg, Magnet } from 'lucide-vue-next';
334
354
  import BmsIconButton from '@/components/button/BmsIconButton.vue';
335
355
  import { BMS_FORM_VALID_URL_REGEX } from '@/helpers/form.helper';
356
+ import BmsMultiSelect from '@/components/form/BmsMultiSelect.vue';
336
357
 
337
358
  const { success } = useNotifications();
338
359
  const text = ref('');
@@ -340,6 +361,7 @@ const text2 = ref('');
340
361
  const captionsText2 = ref();
341
362
  const selected = ref('value1');
342
363
  const selected2 = ref('');
364
+ const multiSelect = ref([]);
343
365
  const files: Ref<File[]> = ref([]);
344
366
  const selectedRadio = ref('titi');
345
367
  const selectedRadio2 = ref('titi');
@@ -8,7 +8,6 @@
8
8
  :size="5"
9
9
  :canSaveFilters="true"
10
10
  :savedFilters="savedFilters"
11
- :selectable="true"
12
11
  help-link="/help-path"
13
12
  activity-link="/activity-path"
14
13
  v-model:selectedItems="selectedItems"
@@ -43,9 +42,16 @@
43
42
  tooltip
44
43
  </BmsTooltip>
45
44
  </template>
46
- <template #action>
47
- <BmsIconButton> <Save /> </BmsIconButton>
48
- <BmsIconButton :mode="StatusType.Danger"> <Trash /> </BmsIconButton>
45
+ <template #action="{ isChildElement }">
46
+ <template v-if="isChildElement">
47
+ <BmsChip>Hérité</BmsChip>
48
+ </template>
49
+ <template v-else>
50
+ <BmsIconButton @click="success('Sauvegarde')"> <Save /> </BmsIconButton>
51
+ <BmsIconButton :mode="StatusType.Danger" @click="error('Suppression')">
52
+ <Trash />
53
+ </BmsIconButton>
54
+ </template>
49
55
  </template>
50
56
  </bms-table>
51
57
  <BmsButton @click="goBack">Go Back</BmsButton>
@@ -57,7 +63,7 @@
57
63
  </template>
58
64
 
59
65
  <script lang="ts" setup>
60
- import { BmsBackButton, BmsButton } from '@/index';
66
+ import { BmsBackButton, BmsButton, useNotifications } from '@/index';
61
67
  import {
62
68
  Filter,
63
69
  InputType,
@@ -71,8 +77,10 @@ import BmsShortLinkMenu from '@/components/navigation/BmsShortLinkMenu.vue';
71
77
  import BmsTooltip from '@/components/feedback/BmsTooltip.vue';
72
78
  import BmsIconButton from '@/components/button/BmsIconButton.vue';
73
79
  import { Delete, Save, Trash } from 'lucide-vue-next';
80
+ import BmsChip from '@/components/form/BmsChip.vue';
74
81
 
75
82
  const { goBack } = useRouterHistory();
83
+ const { error, success } = useNotifications();
76
84
 
77
85
  const headers = [
78
86
  { label: 'Colonne 1', key: 'column1', sortable: true },
@@ -125,6 +133,23 @@ const items = Array(100)
125
133
  },
126
134
  isOk: Math.random() < 0.5,
127
135
  number: Math.random(),
136
+ childElement:
137
+ Math.random() < 0.5
138
+ ? {
139
+ column1: 'Element enfant',
140
+ column2: index,
141
+ date: randomDate(),
142
+ dateUpdate: randomDate(),
143
+ dateDelete: randomDate(),
144
+ choice1: 'N/A',
145
+ choice2: 'N/A',
146
+ deepValue: {
147
+ deepAttr: index % 2 === 0,
148
+ },
149
+ isOk: true,
150
+ number: 0,
151
+ }
152
+ : undefined,
128
153
  }));
129
154
 
130
155
  const savedFilters: Ref<SavedFilter[]> = ref<SavedFilter[]>([]);