@cobre-npm/ds-v3 0.154.0 → 0.156.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.
@@ -14,6 +14,7 @@ interface Props {
14
14
  activeFilter?: string;
15
15
  clearLabel?: string;
16
16
  emptyFallbackText?: string;
17
+ emptySearchText?: string;
17
18
  }
18
19
  declare const _default: import("vue").DefineComponent<Props, {
19
20
  areFiltersValid: () => boolean;
@@ -53,5 +54,6 @@ declare const _default: import("vue").DefineComponent<Props, {
53
54
  activeFilter: string;
54
55
  clearLabel: string;
55
56
  emptyFallbackText: string;
57
+ emptySearchText: string;
56
58
  }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
57
59
  export default _default;
@@ -5,6 +5,8 @@ type __VLS_Props = {
5
5
  /** Prefix of each option's control id, as `${idPrefix}-${option.value}`. */
6
6
  idPrefix: string;
7
7
  disabled?: boolean;
8
+ /** Forced column count; unset keeps two with sections, one without. */
9
+ columns?: 1 | 2;
8
10
  };
9
11
  declare var __VLS_1: {
10
12
  id: string;
@@ -60,12 +60,21 @@ export type CobreInputType = 'anyCharacter' | 'alphanumeric' | 'numeric' | 'lett
60
60
  /** Shared search-box props mixed into filters whose options can be searched. */
61
61
  export interface CommonSearchProps {
62
62
  searchable?: boolean;
63
+ /**
64
+ * `remote` (default) emits `filter-search` on every keystroke so the consumer fetches matches;
65
+ * `local` narrows the options already loaded by label, without emitting.
66
+ */
67
+ searchMode?: 'remote' | 'local';
63
68
  /** Configuration for the option search box. */
64
69
  search?: {
65
70
  placeholder?: string;
66
71
  disabled?: boolean;
67
72
  value?: string;
68
73
  inputType?: CobreInputType;
74
+ /** Local mode only: characters needed before filtering starts. Defaults to 3. */
75
+ minChars?: number;
76
+ /** Local mode only: text shown when nothing matches; falls back to the panel's `emptySearchText`. */
77
+ emptyText?: string;
69
78
  };
70
79
  }
71
80
  /** A multi-select checkbox-group filter; value holds the selected option values. */
@@ -73,6 +82,11 @@ export interface CheckboxFilter extends BaseFilter<'checkbox'> {
73
82
  value: (string | number)[];
74
83
  options: FilterOption[];
75
84
  sections?: FilterSection[];
85
+ /**
86
+ * Number of columns the option list renders in. Unset keeps the default:
87
+ * two with `sections`, one without.
88
+ */
89
+ columns?: 1 | 2;
76
90
  tabs?: FilterTab[];
77
91
  props?: CommonDisabledProps & CommonSearchProps;
78
92
  validation?: CommonValidation;
@@ -81,8 +95,13 @@ export interface CheckboxFilter extends BaseFilter<'checkbox'> {
81
95
  export interface RadioFilter extends BaseFilter<'radio'> {
82
96
  value: string | number | null;
83
97
  options: FilterOption[];
84
- /** Section headings, in render order. Enables the two-column grouped layout. */
98
+ /** Section headings, in render order. Enables the grouped layout (two columns unless `columns` says otherwise). */
85
99
  sections?: FilterSection[];
100
+ /**
101
+ * Number of columns the option list renders in. Unset keeps the default:
102
+ * two with `sections`, one without.
103
+ */
104
+ columns?: 1 | 2;
86
105
  props?: CommonDisabledProps & CommonSearchProps;
87
106
  validation?: CommonValidation;
88
107
  }
@@ -4,3 +4,5 @@ export interface OptionGroup {
4
4
  options: FilterOption[];
5
5
  }
6
6
  export declare const groupOptionsBySection: (options: FilterOption[], sections: FilterSection[]) => OptionGroup[];
7
+ /** Forced column count, or the default: two with sections, one without. */
8
+ export declare const resolveColumns: (columns: 1 | 2 | undefined, hasSections: boolean) => 1 | 2;
@@ -0,0 +1,18 @@
1
+ import type { FilterOption, FilterSection, FilterTab } from '../interfaces/filter.interface';
2
+ export declare const DEFAULT_MIN_CHARS = 3;
3
+ /** Lower case, no accents, no surrounding spaces: " Devolución " → "devolucion". */
4
+ export declare const normalizeForSearch: (text: string) => string;
5
+ /** Whether the text is long enough (after trimming) to filter by. Blank text never is. */
6
+ export declare const isSearchActive: (text: string | undefined, minChars?: number) => boolean;
7
+ /** The options whose label contains `query`, ignoring case, accents and surrounding spaces. */
8
+ export declare const matchOptions: (options: FilterOption[], query: string) => FilterOption[];
9
+ /**
10
+ * The list shown while a local search is active, in place of the tabs.
11
+ * Returns the options matching `query` from every tab, plus the headings to group them under:
12
+ * "Tab · Section" per tab × section pair (tab label alone without sections), ordered by tab then
13
+ * section. Without tabs, the sections are kept as is. E.g. "spei" → "Pagos · MXN: SPEI enviado".
14
+ */
15
+ export declare const buildSearchView: (options: FilterOption[], sections: FilterSection[], tabs: FilterTab[], query: string) => {
16
+ options: FilterOption[];
17
+ sections: FilterSection[];
18
+ };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cobre-npm/ds-v3",
3
- "version": "0.154.0",
3
+ "version": "0.156.0",
4
4
  "type": "module",
5
5
  "packageManager": "pnpm@11.0.4",
6
6
  "engines": {