@beweco/aurora-ui 0.6.62 → 0.6.63
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/index.cjs.js +35 -6
- package/dist/index.esm.js +35 -6
- package/dist/types/components/tags-filter/TagsFilter.d.ts.map +1 -1
- package/dist/types/components/tags-filter/TagsFilter.types.d.ts +6 -0
- package/dist/types/components/tags-filter/TagsFilter.types.d.ts.map +1 -1
- package/package.json +1 -1
package/dist/index.cjs.js
CHANGED
|
@@ -8337,11 +8337,13 @@ var SegmentationBuilder = React.forwardRef(function (_a, ref) {
|
|
|
8337
8337
|
SegmentationBuilder.displayName = "SegmentationBuilder";
|
|
8338
8338
|
|
|
8339
8339
|
var SENTINEL_KEY = "__tags-filter-sentinel__";
|
|
8340
|
+
var EMPTY_KEY = "__tags-filter-empty__";
|
|
8340
8341
|
var DEFAULT_TRANSLATIONS = {
|
|
8341
8342
|
placeholder: "Nombre de la etiqueta",
|
|
8342
8343
|
labelSelect: "Selecciona etiqueta",
|
|
8343
8344
|
labelSelected: "Etiquetas actuales",
|
|
8344
8345
|
emptySelectedMessage: "No hay etiquetas seleccionadas",
|
|
8346
|
+
emptyAvailableMessage: "No hay etiquetas disponibles",
|
|
8345
8347
|
errorLoadingPrefix: "Error al cargar etiquetas",
|
|
8346
8348
|
loadingMoreLabel: "Cargando más etiquetas…",
|
|
8347
8349
|
endOfListMessage: "",
|
|
@@ -8408,9 +8410,26 @@ function TagsFilter(_a) {
|
|
|
8408
8410
|
});
|
|
8409
8411
|
}, [items, inputValue, compareTags, onInputChange]);
|
|
8410
8412
|
var filteredItems = getFilteredAvailable(selectedList);
|
|
8411
|
-
|
|
8412
|
-
|
|
8413
|
-
|
|
8413
|
+
// El sentinel es quien monta el IntersectionObserver, así que tiene que
|
|
8414
|
+
// seguir en la colección mientras quede algo por traer o haya una carga en
|
|
8415
|
+
// curso: sin él, `onLoadMore` no se vuelve a disparar nunca.
|
|
8416
|
+
var showSentinel = Boolean(onLoadMore) &&
|
|
8417
|
+
(hasMore || isLoadingMore || Boolean(t.endOfListMessage));
|
|
8418
|
+
var isAvailableEmpty = filteredItems.length === 0;
|
|
8419
|
+
// Sin nada que ofrecer se inyecta un item de solo lectura con el mensaje de
|
|
8420
|
+
// vacío: así el desplegable explica por qué está vacío en vez de no abrirse
|
|
8421
|
+
// (o abrirse en blanco), y la colección nunca queda realmente vacía.
|
|
8422
|
+
//
|
|
8423
|
+
// Es el último recurso, no el primero: si aún hay páginas por cargar o una
|
|
8424
|
+
// petición en vuelo, gana el sentinel. De lo contrario bastaría con que la
|
|
8425
|
+
// página cargada no tuviera coincidencias (o con seleccionar todas sus
|
|
8426
|
+
// etiquetas) para anunciar "no hay etiquetas" y cortar la paginación.
|
|
8427
|
+
var canPaginate = Boolean(onLoadMore) && hasMore;
|
|
8428
|
+
var showEmptyItem = isAvailableEmpty && !canPaginate && !isLoadingMore;
|
|
8429
|
+
var itemsWithSentinel = showEmptyItem
|
|
8430
|
+
? [{ id: EMPTY_KEY, value: "" }]
|
|
8431
|
+
: showSentinel
|
|
8432
|
+
? __spreadArray(__spreadArray([], filteredItems, true), [{ id: SENTINEL_KEY, value: "" }], false) : filteredItems;
|
|
8414
8433
|
var handleAutocompleteSelection = React.useCallback(function (key) {
|
|
8415
8434
|
if (key == null) {
|
|
8416
8435
|
return;
|
|
@@ -8429,9 +8448,16 @@ function TagsFilter(_a) {
|
|
|
8429
8448
|
setInputValue(v);
|
|
8430
8449
|
onInputChange === null || onInputChange === void 0 ? void 0 : onInputChange(v);
|
|
8431
8450
|
}, selectedKey: null, items: itemsWithSentinel, onSelectionChange: handleAutocompleteSelection,
|
|
8432
|
-
//
|
|
8433
|
-
|
|
8434
|
-
|
|
8451
|
+
// El item de vacío no es seleccionable ni navegable con teclado:
|
|
8452
|
+
// es un mensaje, no una opción.
|
|
8453
|
+
disabledKeys: [EMPTY_KEY],
|
|
8454
|
+
// TECH-1640: el desplegable abre al enfocar/hacer clic, no solo al
|
|
8455
|
+
// escribir. Un selector de etiquetas debe enseñar lo que hay sin
|
|
8456
|
+
// exigir que el usuario recuerde el nombre.
|
|
8457
|
+
menuTrigger: "focus",
|
|
8458
|
+
// Salvo carga en curso, la colección siempre trae algo que mostrar
|
|
8459
|
+
// (ver `itemsWithSentinel`). Se mantiene el flag para que un hueco
|
|
8460
|
+
// transitorio no abra un overlay vacío sobre el modal padre.
|
|
8435
8461
|
allowsEmptyCollection: false, shouldCloseOnBlur: true, popoverProps: {
|
|
8436
8462
|
// isNonModal: false would render a full-screen invisible backdrop that
|
|
8437
8463
|
// intercepts pointer events, blocking the parent modal's close button.
|
|
@@ -8442,6 +8468,9 @@ function TagsFilter(_a) {
|
|
|
8442
8468
|
className: "max-h-[200px] overflow-y-auto",
|
|
8443
8469
|
}, className: "w-full", children: function (item) {
|
|
8444
8470
|
var candidate = item;
|
|
8471
|
+
if (candidate.id === EMPTY_KEY) {
|
|
8472
|
+
return (jsxRuntime.jsx(react.AutocompleteItem, { textValue: t.emptyAvailableMessage, isReadOnly: true, className: "opacity-100 cursor-default data-[hover=true]:bg-transparent", children: jsxRuntime.jsx("span", { className: "text-tiny text-default-500", children: t.emptyAvailableMessage }) }, EMPTY_KEY));
|
|
8473
|
+
}
|
|
8445
8474
|
if (candidate.id === SENTINEL_KEY) {
|
|
8446
8475
|
return (jsxRuntime.jsx(react.AutocompleteItem, { textValue: "", isReadOnly: true, className: "opacity-100 cursor-default data-[hover=true]:bg-transparent", children: jsxRuntime.jsx("div", { ref: function (node) {
|
|
8447
8476
|
var _a;
|
package/dist/index.esm.js
CHANGED
|
@@ -8338,11 +8338,13 @@ var SegmentationBuilder = forwardRef(function (_a, ref) {
|
|
|
8338
8338
|
SegmentationBuilder.displayName = "SegmentationBuilder";
|
|
8339
8339
|
|
|
8340
8340
|
var SENTINEL_KEY = "__tags-filter-sentinel__";
|
|
8341
|
+
var EMPTY_KEY = "__tags-filter-empty__";
|
|
8341
8342
|
var DEFAULT_TRANSLATIONS = {
|
|
8342
8343
|
placeholder: "Nombre de la etiqueta",
|
|
8343
8344
|
labelSelect: "Selecciona etiqueta",
|
|
8344
8345
|
labelSelected: "Etiquetas actuales",
|
|
8345
8346
|
emptySelectedMessage: "No hay etiquetas seleccionadas",
|
|
8347
|
+
emptyAvailableMessage: "No hay etiquetas disponibles",
|
|
8346
8348
|
errorLoadingPrefix: "Error al cargar etiquetas",
|
|
8347
8349
|
loadingMoreLabel: "Cargando más etiquetas…",
|
|
8348
8350
|
endOfListMessage: "",
|
|
@@ -8409,9 +8411,26 @@ function TagsFilter(_a) {
|
|
|
8409
8411
|
});
|
|
8410
8412
|
}, [items, inputValue, compareTags, onInputChange]);
|
|
8411
8413
|
var filteredItems = getFilteredAvailable(selectedList);
|
|
8412
|
-
|
|
8413
|
-
|
|
8414
|
-
|
|
8414
|
+
// El sentinel es quien monta el IntersectionObserver, así que tiene que
|
|
8415
|
+
// seguir en la colección mientras quede algo por traer o haya una carga en
|
|
8416
|
+
// curso: sin él, `onLoadMore` no se vuelve a disparar nunca.
|
|
8417
|
+
var showSentinel = Boolean(onLoadMore) &&
|
|
8418
|
+
(hasMore || isLoadingMore || Boolean(t.endOfListMessage));
|
|
8419
|
+
var isAvailableEmpty = filteredItems.length === 0;
|
|
8420
|
+
// Sin nada que ofrecer se inyecta un item de solo lectura con el mensaje de
|
|
8421
|
+
// vacío: así el desplegable explica por qué está vacío en vez de no abrirse
|
|
8422
|
+
// (o abrirse en blanco), y la colección nunca queda realmente vacía.
|
|
8423
|
+
//
|
|
8424
|
+
// Es el último recurso, no el primero: si aún hay páginas por cargar o una
|
|
8425
|
+
// petición en vuelo, gana el sentinel. De lo contrario bastaría con que la
|
|
8426
|
+
// página cargada no tuviera coincidencias (o con seleccionar todas sus
|
|
8427
|
+
// etiquetas) para anunciar "no hay etiquetas" y cortar la paginación.
|
|
8428
|
+
var canPaginate = Boolean(onLoadMore) && hasMore;
|
|
8429
|
+
var showEmptyItem = isAvailableEmpty && !canPaginate && !isLoadingMore;
|
|
8430
|
+
var itemsWithSentinel = showEmptyItem
|
|
8431
|
+
? [{ id: EMPTY_KEY, value: "" }]
|
|
8432
|
+
: showSentinel
|
|
8433
|
+
? __spreadArray(__spreadArray([], filteredItems, true), [{ id: SENTINEL_KEY, value: "" }], false) : filteredItems;
|
|
8415
8434
|
var handleAutocompleteSelection = useCallback(function (key) {
|
|
8416
8435
|
if (key == null) {
|
|
8417
8436
|
return;
|
|
@@ -8430,9 +8449,16 @@ function TagsFilter(_a) {
|
|
|
8430
8449
|
setInputValue(v);
|
|
8431
8450
|
onInputChange === null || onInputChange === void 0 ? void 0 : onInputChange(v);
|
|
8432
8451
|
}, selectedKey: null, items: itemsWithSentinel, onSelectionChange: handleAutocompleteSelection,
|
|
8433
|
-
//
|
|
8434
|
-
|
|
8435
|
-
|
|
8452
|
+
// El item de vacío no es seleccionable ni navegable con teclado:
|
|
8453
|
+
// es un mensaje, no una opción.
|
|
8454
|
+
disabledKeys: [EMPTY_KEY],
|
|
8455
|
+
// TECH-1640: el desplegable abre al enfocar/hacer clic, no solo al
|
|
8456
|
+
// escribir. Un selector de etiquetas debe enseñar lo que hay sin
|
|
8457
|
+
// exigir que el usuario recuerde el nombre.
|
|
8458
|
+
menuTrigger: "focus",
|
|
8459
|
+
// Salvo carga en curso, la colección siempre trae algo que mostrar
|
|
8460
|
+
// (ver `itemsWithSentinel`). Se mantiene el flag para que un hueco
|
|
8461
|
+
// transitorio no abra un overlay vacío sobre el modal padre.
|
|
8436
8462
|
allowsEmptyCollection: false, shouldCloseOnBlur: true, popoverProps: {
|
|
8437
8463
|
// isNonModal: false would render a full-screen invisible backdrop that
|
|
8438
8464
|
// intercepts pointer events, blocking the parent modal's close button.
|
|
@@ -8443,6 +8469,9 @@ function TagsFilter(_a) {
|
|
|
8443
8469
|
className: "max-h-[200px] overflow-y-auto",
|
|
8444
8470
|
}, className: "w-full", children: function (item) {
|
|
8445
8471
|
var candidate = item;
|
|
8472
|
+
if (candidate.id === EMPTY_KEY) {
|
|
8473
|
+
return (jsx(AutocompleteItem, { textValue: t.emptyAvailableMessage, isReadOnly: true, className: "opacity-100 cursor-default data-[hover=true]:bg-transparent", children: jsx("span", { className: "text-tiny text-default-500", children: t.emptyAvailableMessage }) }, EMPTY_KEY));
|
|
8474
|
+
}
|
|
8446
8475
|
if (candidate.id === SENTINEL_KEY) {
|
|
8447
8476
|
return (jsx(AutocompleteItem, { textValue: "", isReadOnly: true, className: "opacity-100 cursor-default data-[hover=true]:bg-transparent", children: jsx("div", { ref: function (node) {
|
|
8448
8477
|
var _a;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TagsFilter.d.ts","sourceRoot":"","sources":["../../../../src/components/tags-filter/TagsFilter.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAM/B,OAAO,KAAK,EACX,eAAe,EAEf,MAAM,oBAAoB,CAAC;
|
|
1
|
+
{"version":3,"file":"TagsFilter.d.ts","sourceRoot":"","sources":["../../../../src/components/tags-filter/TagsFilter.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAM/B,OAAO,KAAK,EACX,eAAe,EAEf,MAAM,oBAAoB,CAAC;AAuC5B;;;;;GAKG;AACH,wBAAgB,UAAU,CAAC,CAAC,SAAS;IAAE,EAAE,CAAC,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,MAAM,CAAA;CAAE,EAAE,EACpE,KAAK,EACL,KAAK,EACL,QAAQ,EACR,YAAiB,EACjB,KAAK,EACL,SAAiB,EACjB,SAAc,EACd,YAAY,EAAE,SAAS,EACvB,QAAgB,EAChB,WAA2D,EAC3D,SAAkD,EAClD,aAAa,EACb,OAAe,EACf,aAAqB,EACrB,UAAU,EACV,kBAA0B,GAC1B,EAAE,eAAe,CAAC,CAAC,CAAC,GAAG,KAAK,CAAC,YAAY,CAiPzC;yBAlQe,UAAU"}
|
|
@@ -20,6 +20,12 @@ export type TagsFilterTranslations = {
|
|
|
20
20
|
labelSelected?: string;
|
|
21
21
|
/** Mensaje cuando no hay etiquetas seleccionadas */
|
|
22
22
|
emptySelectedMessage?: string;
|
|
23
|
+
/**
|
|
24
|
+
* Mensaje dentro del desplegable cuando no queda ninguna etiqueta que
|
|
25
|
+
* ofrecer (el centro no tiene etiquetas, ya están todas asignadas o la
|
|
26
|
+
* búsqueda no encontró nada).
|
|
27
|
+
*/
|
|
28
|
+
emptyAvailableMessage?: string;
|
|
23
29
|
/** Prefijo del mensaje de error (ej. "Error al cargar etiquetas") */
|
|
24
30
|
errorLoadingPrefix?: string;
|
|
25
31
|
/** Texto sr-only del spinner inline mientras se cargan más páginas. */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TagsFilter.types.d.ts","sourceRoot":"","sources":["../../../../src/components/tags-filter/TagsFilter.types.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,MAAM,WAAW,OAAO;IACvB,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,KAAK,EAAE,MAAM,CAAC;IACd,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC;CACvB;AAED;;;GAGG;AACH,MAAM,MAAM,sBAAsB,GAAG;IACpC,kDAAkD;IAClD,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,iEAAiE;IACjE,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,wEAAwE;IACxE,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,oDAAoD;IACpD,oBAAoB,CAAC,EAAE,MAAM,CAAC;IAC9B,qEAAqE;IACrE,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B,uEAAuE;IACvE,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,sFAAsF;IACtF,gBAAgB,CAAC,EAAE,MAAM,CAAC;CAC1B,CAAC;AAEF,MAAM,WAAW,eAAe,CAAC,CAAC,SAAS,OAAO,GAAG,OAAO;IAC3D,qDAAqD;IACrD,KAAK,EAAE,CAAC,EAAE,CAAC;IACX,0CAA0C;IAC1C,KAAK,EAAE,CAAC,EAAE,CAAC;IACX,2DAA2D;IAC3D,QAAQ,EAAE,CAAC,QAAQ,EAAE,CAAC,EAAE,KAAK,IAAI,CAAC;IAClC,uFAAuF;IACvF,YAAY,CAAC,EAAE,sBAAsB,CAAC;IACtC,sDAAsD;IACtD,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,+BAA+B;IAC/B,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,oCAAoC;IACpC,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,kCAAkC;IAClC,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,2GAA2G;IAC3G,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,wEAAwE;IACxE,WAAW,CAAC,EAAE,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,KAAK,OAAO,CAAC;IACtC,kFAAkF;IAClF,SAAS,CAAC,EAAE,CAAC,GAAG,EAAE,CAAC,KAAK,MAAM,CAAC;IAC/B;;;;;;;;OAQG;IACH,aAAa,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IACxC,uEAAuE;IACvE,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,8EAA8E;IAC9E,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB,mIAAmI;IACnI,UAAU,CAAC,EAAE,MAAM,IAAI,CAAC;IACxB,qEAAqE;IACrE,kBAAkB,CAAC,EAAE,MAAM,CAAC;CAC5B"}
|
|
1
|
+
{"version":3,"file":"TagsFilter.types.d.ts","sourceRoot":"","sources":["../../../../src/components/tags-filter/TagsFilter.types.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,MAAM,WAAW,OAAO;IACvB,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,KAAK,EAAE,MAAM,CAAC;IACd,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC;CACvB;AAED;;;GA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