@carto/meridian-ds 1.5.1-alpha-virtual-autocomplete.9 → 1.5.1-alpha-virtual-autocomplete.10
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/index.cjs +9 -2
- package/dist/components/index.js +9 -2
- package/dist/types/components/molecules/Autocomplete/types.d.ts +4 -4
- package/dist/types/components/molecules/Autocomplete/utils.d.ts +29 -1
- package/dist/types/components/molecules/Autocomplete/utils.d.ts.map +1 -1
- package/package.json +1 -1
|
@@ -1189,7 +1189,11 @@ function createCounterFormatter({
|
|
|
1189
1189
|
}
|
|
1190
1190
|
};
|
|
1191
1191
|
}
|
|
1192
|
-
function createAutocompleteGroupByList(
|
|
1192
|
+
function createAutocompleteGroupByList({
|
|
1193
|
+
options,
|
|
1194
|
+
groupBy,
|
|
1195
|
+
extended
|
|
1196
|
+
}) {
|
|
1193
1197
|
const grouped = options.reduce(
|
|
1194
1198
|
(acc, option) => {
|
|
1195
1199
|
const group = groupBy(option);
|
|
@@ -1219,7 +1223,10 @@ function warnDeprecatedGroupBy(componentName) {
|
|
|
1219
1223
|
\`\`\`
|
|
1220
1224
|
import { createAutocompleteGroupByList, ${componentName} } from "@carto/meridian-ds/components"
|
|
1221
1225
|
|
|
1222
|
-
const groupedOptions = createAutocompleteGroupByList(
|
|
1226
|
+
const groupedOptions = createAutocompleteGroupByList({
|
|
1227
|
+
options,
|
|
1228
|
+
groupBy: (option) => option.category
|
|
1229
|
+
})
|
|
1223
1230
|
|
|
1224
1231
|
<${componentName} options={groupedOptions} />
|
|
1225
1232
|
\`\`\`
|
package/dist/components/index.js
CHANGED
|
@@ -1188,7 +1188,11 @@ function createCounterFormatter({
|
|
|
1188
1188
|
}
|
|
1189
1189
|
};
|
|
1190
1190
|
}
|
|
1191
|
-
function createAutocompleteGroupByList(
|
|
1191
|
+
function createAutocompleteGroupByList({
|
|
1192
|
+
options,
|
|
1193
|
+
groupBy,
|
|
1194
|
+
extended
|
|
1195
|
+
}) {
|
|
1192
1196
|
const grouped = options.reduce(
|
|
1193
1197
|
(acc, option) => {
|
|
1194
1198
|
const group = groupBy(option);
|
|
@@ -1218,7 +1222,10 @@ function warnDeprecatedGroupBy(componentName) {
|
|
|
1218
1222
|
\`\`\`
|
|
1219
1223
|
import { createAutocompleteGroupByList, ${componentName} } from "@carto/meridian-ds/components"
|
|
1220
1224
|
|
|
1221
|
-
const groupedOptions = createAutocompleteGroupByList(
|
|
1225
|
+
const groupedOptions = createAutocompleteGroupByList({
|
|
1226
|
+
options,
|
|
1227
|
+
groupBy: (option) => option.category
|
|
1228
|
+
})
|
|
1222
1229
|
|
|
1223
1230
|
<${componentName} options={groupedOptions} />
|
|
1224
1231
|
\`\`\`
|
|
@@ -27,10 +27,10 @@ type BaseAutocompleteProps<Value, Multiple extends boolean | undefined = undefin
|
|
|
27
27
|
* ```tsx
|
|
28
28
|
* import { createAutocompleteGroupByList } from "@carto/meridian-ds"
|
|
29
29
|
*
|
|
30
|
-
* const groupedOptions = createAutocompleteGroupByList(
|
|
31
|
-
* rawOptions,
|
|
32
|
-
* (option) => option.category
|
|
33
|
-
* )
|
|
30
|
+
* const groupedOptions = createAutocompleteGroupByList({
|
|
31
|
+
* options: rawOptions,
|
|
32
|
+
* groupBy: (option) => option.category
|
|
33
|
+
* })
|
|
34
34
|
*
|
|
35
35
|
* <MultipleAutocomplete
|
|
36
36
|
* options={groupedOptions}
|
|
@@ -101,8 +101,36 @@ export declare function createCounterFormatter({ counterText, allText, showSingl
|
|
|
101
101
|
* @param groupBy - Function that returns the group key for each option
|
|
102
102
|
* @param extended - Optional boolean to make group headers extended (larger height)
|
|
103
103
|
* @returns Flat array with group headers and options ready for autocomplete
|
|
104
|
+
*
|
|
105
|
+
* @example
|
|
106
|
+
* // Basic usage
|
|
107
|
+
* const groupedOptions = createAutocompleteGroupByList({
|
|
108
|
+
* options: rawOptions,
|
|
109
|
+
* groupBy: (option) => option.category
|
|
110
|
+
* })
|
|
111
|
+
*
|
|
112
|
+
* @example
|
|
113
|
+
* // With extended group headers
|
|
114
|
+
* const groupedOptions = createAutocompleteGroupByList({
|
|
115
|
+
* options: rawOptions,
|
|
116
|
+
* groupBy: (option) => option.category,
|
|
117
|
+
* extended: true
|
|
118
|
+
* })
|
|
119
|
+
*
|
|
120
|
+
* @example
|
|
121
|
+
* // Usage in MultipleAutocomplete
|
|
122
|
+
* <MultipleAutocomplete
|
|
123
|
+
* options={createAutocompleteGroupByList({
|
|
124
|
+
* options: rawOptions,
|
|
125
|
+
* groupBy: (option) => option.category
|
|
126
|
+
* })}
|
|
127
|
+
* />
|
|
104
128
|
*/
|
|
105
|
-
export declare function createAutocompleteGroupByList<T>(options
|
|
129
|
+
export declare function createAutocompleteGroupByList<T>({ options, groupBy, extended, }: {
|
|
130
|
+
options: T[];
|
|
131
|
+
groupBy: (option: T) => string;
|
|
132
|
+
extended?: boolean;
|
|
133
|
+
}): (T | AutocompleteListGroupHeaderProps)[];
|
|
106
134
|
/**
|
|
107
135
|
* Shows a runtime warning for deprecated groupBy prop usage
|
|
108
136
|
* @param componentName - Name of the component (e.g., 'Autocomplete', 'MultipleAutocomplete')
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../../../src/components/molecules/Autocomplete/utils.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,gCAAgC,EAAE,MAAM,SAAS,CAAA;AAE1D;;GAEG;AACH,eAAO,MAAM,kCAAkC,oBAAoB,CAAA;AAEnE;;;;GAIG;AACH,wBAAgB,6BAA6B,CAC3C,MAAM,EAAE,OAAO,GACd,MAAM,IAAI,gCAAgC,CAM5C;AAGD,eAAO,MAAM,qBAAqB,GAAI,KAAK,UAAW,KAAK,KAAG,MAI7D,CAAA;AAGD,eAAO,MAAM,wBAAwB,GAAI,KAAK,UACpC,KAAK,YACH,OAAO,KAChB,MAAM,CAAC,MAAM,EAAE,OAAO,CAIxB,CAAA;AAGD,eAAO,MAAM,uBAAuB,SAAU,MAAM,4CAEnD,CAAA;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgCG;AACH,wBAAgB,uBAAuB,CAAC,EACtC,aAAa,EACb,OAAY,EACZ,IAAc,EACd,cAAsC,GACvC,EAAE;IACD,aAAa,EAAE,CAAC,MAAM,EAAE;QACtB,aAAa,EAAE,MAAM,CAAA;QACrB,UAAU,EAAE,MAAM,CAAA;QAClB,aAAa,EAAE,SAAS,OAAO,EAAE,CAAA;QACjC,QAAQ,EAAE,SAAS,OAAO,EAAE,CAAA;QAC5B,cAAc,EAAE,CAAC,MAAM,EAAE,OAAO,KAAK,MAAM,CAAA;KAC5C,KAAK,MAAM,CAAA;IACZ,OAAO,CAAC,EAAE,SAAS,OAAO,EAAE,CAAA;IAC5B,IAAI,CAAC,EAAE,OAAO,GAAG,QAAQ,CAAA;IACzB,cAAc,CAAC,EAAE,CAAC,MAAM,EAAE,OAAO,KAAK,MAAM,CAAA;CAC7C,WACmC,SAAS,OAAO,EAAE,oDAmCrD;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AACH,wBAAgB,sBAAsB,CAAC,EACrC,WAAW,EACX,OAAO,EACP,kBAAyB,GAC1B,EAAE;IACD,WAAW,EAAE,MAAM,CAAA;IACnB,OAAO,EAAE,MAAM,CAAA;IACf,kBAAkB,CAAC,EAAE,OAAO,CAAA;CAC7B,mEAMI;IACD,aAAa,EAAE,MAAM,CAAA;IACrB,UAAU,EAAE,MAAM,CAAA;IAClB,aAAa,EAAE,SAAS,OAAO,EAAE,CAAA;IACjC,cAAc,EAAE,CAAC,MAAM,EAAE,OAAO,KAAK,MAAM,CAAA;CAC5C,YASF;AAED
|
|
1
|
+
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../../../src/components/molecules/Autocomplete/utils.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,gCAAgC,EAAE,MAAM,SAAS,CAAA;AAE1D;;GAEG;AACH,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