@cobre-npm/ds-v3 0.155.0 → 0.157.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.
@@ -1104,4 +1104,27 @@
1104
1104
  --cobre-filter-option-groups-label-fs: var(--cobre-label-small-fs);
1105
1105
  --cobre-filter-option-groups-label-lh: var(--cobre-label-small-lh);
1106
1106
  --cobre-filter-option-groups-label-fw: 500;
1107
- }
1107
+ --cobre-filter-option-groups-option-color: var(--cobre-gray-95);
1108
+ }
1109
+
1110
+ /**
1111
+ * Filter panel
1112
+ */
1113
+
1114
+ :root {
1115
+ --cobre-filter-panel-width: 615px;
1116
+ --cobre-filter-panel-max-height: 500px;
1117
+ --cobre-filter-panel-padding-x: 20px;
1118
+ --cobre-filter-panel-padding-y: 16px;
1119
+ --cobre-filter-panel-tab-edge-width: 4px;
1120
+ --cobre-filter-panel-content-gap: 12px;
1121
+ --cobre-filter-panel-tab-badge-padding-x: 5px;
1122
+ --cobre-filter-panel-tab-active-bg: var(--cobre-teal-5);
1123
+ --cobre-filter-panel-tab-active-border-color: var(--cobre-teal-20);
1124
+ --cobre-filter-panel-tab-active-color: var(--cobre-teal-50);
1125
+ --cobre-filter-panel-tab-badge-bg: var(--cobre-teal-50);
1126
+ --cobre-filter-panel-tab-badge-color: var(--cobre-white);
1127
+ --cobre-filter-panel-divider-color: var(--cobre-gray-20);
1128
+ --cobre-filter-panel-section-title-color: var(--cobre-gray-60);
1129
+ --cobre-filter-panel-tab-color: var(--cobre-primary-80);
1130
+ }
@@ -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;
@@ -13,7 +13,6 @@ declare var __VLS_1: {
13
13
  option: FilterOption;
14
14
  label: string;
15
15
  description: string | undefined;
16
- sectioned: boolean;
17
16
  disabled: boolean | undefined;
18
17
  };
19
18
  type __VLS_Slots = {} & {
@@ -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. */
@@ -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.155.0",
3
+ "version": "0.157.0",
4
4
  "type": "module",
5
5
  "packageManager": "pnpm@11.0.4",
6
6
  "engines": {