@ouestfrance/sipa-bms-ui 8.29.4 → 8.30.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.
@@ -1,3 +1,4 @@
1
+ import { defaultSearchFunction } from '../../composables/search.helper';
1
2
  import { Filter, SavedFilter, SelectMode, Sort, TableHeader, TableMode } from '../../models';
2
3
  interface UiTableProps {
3
4
  disableSearch?: boolean;
@@ -16,6 +17,7 @@ interface UiTableProps {
16
17
  selectable?: boolean;
17
18
  selectableDisabled?: boolean;
18
19
  selectMode?: SelectMode.DEFAULT | SelectMode.SINGLE;
20
+ customSearch?: (item: unknown, searchValue: string, defaultSearch: typeof defaultSearchFunction) => boolean;
19
21
  }
20
22
  type __VLS_Props = UiTableProps;
21
23
  declare const __VLS_defaults: {
@@ -1,4 +1,5 @@
1
1
  import { Filter } from '../models';
2
+ export declare const defaultSearchFunction: (item: unknown, searchValue: string) => boolean;
2
3
  export declare const isBetweenFilter: (filter: Filter) => boolean;
3
4
  export declare const defaultNumberFilterFunction: (itemNumber: number, search: number, isAfterSearch: boolean) => boolean;
4
5
  export declare const defaultIsAfterDateFilterFunction: (dateItem: Date, search: Date, isGreaterThan: boolean) => boolean;
@@ -2737,7 +2737,7 @@ nav .additional[data-v-8b4752b4] {
2737
2737
  padding-right: 32px;
2738
2738
  }.table-search[data-v-c674a0d1] {
2739
2739
  width: 260px;
2740
- }.table-search[data-v-f6338466] {
2740
+ }.table-search[data-v-10d05366] {
2741
2741
  width: 260px;
2742
2742
  }.cocarde[data-v-d1c7b421] {
2743
2743
  display: flex;
@@ -99810,6 +99810,7 @@ function requireCloneDeep () {
99810
99810
  var cloneDeepExports = requireCloneDeep();
99811
99811
  const _cloneDeep = /*@__PURE__*/getDefaultExportFromCjs(cloneDeepExports);
99812
99812
 
99813
+ const defaultSearchFunction = (item, searchValue) => JSON.stringify(Object.values(item)).toLowerCase().includes(searchValue.toLowerCase());
99813
99814
  const isBetweenFilter = (filter) => filter.type === "betweenDate" || filter.type === "betweenNumber" || filter.type === "betweenDateTime";
99814
99815
  const defaultNumberFilterFunction = (itemNumber, search, isAfterSearch) => {
99815
99816
  if (isEmptyStringOrNotDefined(itemNumber) || isEmptyStringOrNotDefined(search)) {
@@ -105402,7 +105403,8 @@ const _sfc_main$9 = /* @__PURE__ */ defineComponent({
105402
105403
  }) },
105403
105404
  selectable: { type: Boolean, default: false },
105404
105405
  selectableDisabled: { type: Boolean, default: false },
105405
- selectMode: { default: SelectMode.DEFAULT }
105406
+ selectMode: { default: SelectMode.DEFAULT },
105407
+ customSearch: {}
105406
105408
  }, {
105407
105409
  "selectedItems": {
105408
105410
  required: false,
@@ -105454,11 +105456,8 @@ const _sfc_main$9 = /* @__PURE__ */ defineComponent({
105454
105456
  description: search.value ? `Votre recherche n'a retourné aucun résultat.` : `Il semblerait qu'il n'y ait rien ici...`
105455
105457
  }));
105456
105458
  const getFilteredItems = () => {
105457
- return sortItems(
105458
- filterItems(props.items).filter(
105459
- (item) => JSON.stringify(Object.values(item)).toLowerCase().includes(search.value.toLowerCase())
105460
- )
105461
- );
105459
+ const applySearch = props.customSearch ? (item) => props.customSearch(item, search.value, defaultSearchFunction) : (item) => defaultSearchFunction(item, search.value);
105460
+ return sortItems(filterItems(props.items).filter(applySearch));
105462
105461
  };
105463
105462
  const isMounting = ref(true);
105464
105463
  watch(
@@ -105653,7 +105652,7 @@ const _sfc_main$9 = /* @__PURE__ */ defineComponent({
105653
105652
  }
105654
105653
  });
105655
105654
 
105656
- const BmsTable = /* @__PURE__ */ _export_sfc(_sfc_main$9, [["__scopeId", "data-v-f6338466"]]);
105655
+ const BmsTable = /* @__PURE__ */ _export_sfc(_sfc_main$9, [["__scopeId", "data-v-10d05366"]]);
105657
105656
 
105658
105657
  const _sfc_main$8 = /* @__PURE__ */ defineComponent({
105659
105658
  __name: "BmsCocarde",