lizaui 12.0.4 → 12.0.5
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/travel-calendar/calendar-format.d.ts +9 -2
- package/dist/components/travel-calendar/calendar-format.d.ts.map +1 -1
- package/dist/components/travel-calendar/calendar-travel-form.d.ts +5 -0
- package/dist/components/travel-calendar/calendar-travel-form.d.ts.map +1 -1
- package/dist/components/travel-calendar/hook/use-calendar-dropdown.d.ts +6 -1
- package/dist/components/travel-calendar/hook/use-calendar-dropdown.d.ts.map +1 -1
- package/dist/components/travel-calendar/hook/use-calendar-presets.d.ts +4 -5
- package/dist/components/travel-calendar/hook/use-calendar-presets.d.ts.map +1 -1
- package/dist/components/travel-calendar/hook/use-calendar-pricing.d.ts +19 -4
- package/dist/components/travel-calendar/hook/use-calendar-pricing.d.ts.map +1 -1
- package/dist/components/travel-calendar/hook/use-calendar-value.d.ts +3 -2
- package/dist/components/travel-calendar/hook/use-calendar-value.d.ts.map +1 -1
- package/dist/lizaui.css +61 -0
- package/dist/table/index.cjs.js +54 -2
- package/dist/table/index.cjs.js.map +1 -1
- package/dist/table/index.es.js +53 -1
- package/dist/table/index.es.js.map +1 -1
- package/dist/travel-calendar/index.cjs.js +354 -288
- package/dist/travel-calendar/index.cjs.js.map +1 -1
- package/dist/travel-calendar/index.es.js +354 -288
- package/dist/travel-calendar/index.es.js.map +1 -1
- package/package.json +1 -1
- package/dist/chunks/loader-circle-DgmOcU-K.js +0 -59
- package/dist/chunks/loader-circle-DgmOcU-K.js.map +0 -1
- package/dist/chunks/loader-circle-Dxh3rZ7y.js +0 -60
- package/dist/chunks/loader-circle-Dxh3rZ7y.js.map +0 -1
|
@@ -37,8 +37,15 @@ export declare const formatDateString: (date: Date, format: CalendarFormat) => s
|
|
|
37
37
|
* la fecha sin desfases de zona horaria.
|
|
38
38
|
*/
|
|
39
39
|
export declare const formatDisplayDate: (date: Date, format: CalendarFormat) => string;
|
|
40
|
-
/**
|
|
41
|
-
|
|
40
|
+
/**
|
|
41
|
+
* Clave `YYYY-MM-DD` de la fecha CIVIL para comparar/indexar días.
|
|
42
|
+
*
|
|
43
|
+
* - String con fecha al inicio ("2026-06-04", "2026-06-04 06:47:00"): se toma tal cual, sin pasar por `Date`
|
|
44
|
+
* (así "2026-06-04" no se convierte en medianoche UTC y cambia de día según la zona).
|
|
45
|
+
* - `Date`: se leen los campos LOCALES, que es como la construyen el calendario y los atajos
|
|
46
|
+
* (`new Date(y, m, d)`). Con getters UTC, en zonas al este de UTC la medianoche local caía en el día anterior.
|
|
47
|
+
*/
|
|
48
|
+
export declare const formatDateKey: (value: string | Date) => string;
|
|
42
49
|
export declare const startOfDay: (d: Date) => Date;
|
|
43
50
|
export declare const addDays: (d: Date, n: number) => Date;
|
|
44
51
|
export declare const isSameDay: (a?: Date | null, b?: Date | null) => boolean;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"calendar-format.d.ts","sourceRoot":"","sources":["../../../src/components/travel-calendar/calendar-format.ts"],"names":[],"mappings":"AAEA;;;;;GAKG;AAEH,eAAO,MAAM,uBAAuB;;;;;;;;;;;;;CAa1B,CAAC;AAEX,MAAM,MAAM,mBAAmB,GAAG,MAAM,OAAO,uBAAuB,CAAC;AACvE,MAAM,MAAM,cAAc,GAAG,CAAC,OAAO,uBAAuB,CAAC,CAAC,mBAAmB,CAAC,CAAC;AACnF,KAAK,gBAAgB,GAAG,KAAK,GAAG,OAAO,GAAG,MAAM,CAAC;AAEjD,eAAO,MAAM,sBAAsB,EAAE,MAAM,CAC1C,cAAc,EACd;IACC,SAAS,EAAE,GAAG,GAAG,GAAG,CAAC;IACrB,KAAK,EAAE,SAAS,CAAC,gBAAgB,EAAE,gBAAgB,EAAE,gBAAgB,CAAC,CAAC;CACvE,CAQD,CAAC;AAIF,eAAO,MAAM,uBAAuB,GAAI,QAAQ,mBAAmB,KAAG,cAAiD,CAAC;AAgBxH,eAAO,MAAM,mBAAmB,GAAI,KAAK,MAAM,EAAE,QAAQ,cAAc,KAAG,IAAI,GAAG,IA0BhF,CAAC;AAkBF,+FAA+F;AAC/F,eAAO,MAAM,kBAAkB,GAAI,cAAc,OAAO,EAAE,QAAQ,cAAc,KAAG,IAAI,GAAG,IA0BzF,CAAC;AAEF,mEAAmE;AACnE,eAAO,MAAM,gBAAgB,GAAI,MAAM,IAAI,EAAE,QAAQ,cAAc,KAAG,MAcrE,CAAC;AAEF;;;;GAIG;AACH,eAAO,MAAM,iBAAiB,GAAI,MAAM,IAAI,EAAE,QAAQ,cAAc,KAAG,MAC2B,CAAC;
|
|
1
|
+
{"version":3,"file":"calendar-format.d.ts","sourceRoot":"","sources":["../../../src/components/travel-calendar/calendar-format.ts"],"names":[],"mappings":"AAEA;;;;;GAKG;AAEH,eAAO,MAAM,uBAAuB;;;;;;;;;;;;;CAa1B,CAAC;AAEX,MAAM,MAAM,mBAAmB,GAAG,MAAM,OAAO,uBAAuB,CAAC;AACvE,MAAM,MAAM,cAAc,GAAG,CAAC,OAAO,uBAAuB,CAAC,CAAC,mBAAmB,CAAC,CAAC;AACnF,KAAK,gBAAgB,GAAG,KAAK,GAAG,OAAO,GAAG,MAAM,CAAC;AAEjD,eAAO,MAAM,sBAAsB,EAAE,MAAM,CAC1C,cAAc,EACd;IACC,SAAS,EAAE,GAAG,GAAG,GAAG,CAAC;IACrB,KAAK,EAAE,SAAS,CAAC,gBAAgB,EAAE,gBAAgB,EAAE,gBAAgB,CAAC,CAAC;CACvE,CAQD,CAAC;AAIF,eAAO,MAAM,uBAAuB,GAAI,QAAQ,mBAAmB,KAAG,cAAiD,CAAC;AAgBxH,eAAO,MAAM,mBAAmB,GAAI,KAAK,MAAM,EAAE,QAAQ,cAAc,KAAG,IAAI,GAAG,IA0BhF,CAAC;AAkBF,+FAA+F;AAC/F,eAAO,MAAM,kBAAkB,GAAI,cAAc,OAAO,EAAE,QAAQ,cAAc,KAAG,IAAI,GAAG,IA0BzF,CAAC;AAEF,mEAAmE;AACnE,eAAO,MAAM,gBAAgB,GAAI,MAAM,IAAI,EAAE,QAAQ,cAAc,KAAG,MAcrE,CAAC;AAEF;;;;GAIG;AACH,eAAO,MAAM,iBAAiB,GAAI,MAAM,IAAI,EAAE,QAAQ,cAAc,KAAG,MAC2B,CAAC;AAKnG;;;;;;;GAOG;AACH,eAAO,MAAM,aAAa,GAAI,OAAO,MAAM,GAAG,IAAI,KAAG,MAYpD,CAAC;AAEF,eAAO,MAAM,UAAU,GAAI,GAAG,IAAI,KAAG,IAAwE,CAAC;AAE9G,eAAO,MAAM,OAAO,GAAI,GAAG,IAAI,EAAE,GAAG,MAAM,KAAG,IAA4E,CAAC;AAE1H,eAAO,MAAM,SAAS,GAAI,IAAI,IAAI,GAAG,IAAI,EAAE,IAAI,IAAI,GAAG,IAAI,KAAG,OAI5D,CAAC"}
|
|
@@ -24,6 +24,11 @@ interface Props extends CalendarProps {
|
|
|
24
24
|
isClose?: boolean;
|
|
25
25
|
lang?: CalendarLang;
|
|
26
26
|
format?: CalendarFormatInput;
|
|
27
|
+
/**
|
|
28
|
+
* Precios por fecha. Define también qué días se pueden elegir:
|
|
29
|
+
* - `undefined` (por defecto): sin restricción, todos los días habilitados.
|
|
30
|
+
* - Array: solo esas fechas; `[]` = ninguna disponible (se muestra el estado vacío).
|
|
31
|
+
*/
|
|
27
32
|
travelPrices?: TravelPrice[];
|
|
28
33
|
/** Fecha mínima seleccionable, ej. "2026-02-28 06:47:00". Hacia atrás se deshabilitan. null/undefined = sin límite. */
|
|
29
34
|
minSelectableDate?: string | null;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"calendar-travel-form.d.ts","sourceRoot":"","sources":["../../../src/components/travel-calendar/calendar-travel-form.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAoC,KAAK,aAAa,EAAE,MAAM,OAAO,CAAC;AAE7E,OAAO,EAAY,UAAU,EAAE,KAAK,aAAa,EAAE,MAAM,yBAAyB,CAAC;
|
|
1
|
+
{"version":3,"file":"calendar-travel-form.d.ts","sourceRoot":"","sources":["../../../src/components/travel-calendar/calendar-travel-form.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAoC,KAAK,aAAa,EAAE,MAAM,OAAO,CAAC;AAE7E,OAAO,EAAY,UAAU,EAAE,KAAK,aAAa,EAAE,MAAM,yBAAyB,CAAC;AAInF,OAAO,EAA2B,KAAK,mBAAmB,EAAE,MAAM,mBAAmB,CAAC;AAGtF,OAAO,EAAsB,KAAK,WAAW,EAAE,MAAM,6BAA6B,CAAC;AAEnF,OAAO,EAAkB,KAAK,YAAY,EAAE,MAAM,UAAU,CAAC;AAE7D,OAAO,wBAAwB,CAAC;AAEhC,UAAU,KAAM,SAAQ,aAAa;IACpC,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,CAAC,EAAE,aAAa,CAAC;IACtB,KAAK,EAAE,UAAU,GAAG,MAAM,CAAC;IAC3B,YAAY,CAAC,EAAE,CAAC,aAAa,EAAE,UAAU,GAAG,UAAU,EAAE,GAAG,IAAI,KAAK,IAAI,CAAC;IACzE,iBAAiB,CAAC,EAAE,CAAC,aAAa,EAAE,UAAU,KAAK,IAAI,CAAC;IACxD,MAAM,CAAC,EAAE,CAAC,CAAC,EAAE,KAAK,CAAC,UAAU,KAAK,IAAI,CAAC;IACvC,cAAc,CAAC,EAAE,MAAM,IAAI,CAAC;IAC5B,SAAS,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC,WAAW,CAAC,CAAC;IACzC,KAAK,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IACxB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,MAAM,CAAC,EAAE,GAAG,CAAC;IACb,OAAO,CAAC,EAAE,GAAG,CAAC;IACd,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,UAAU,CAAC,EAAE,aAAa,CAAC;IAC3B,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,qBAAqB,CAAC,EAAE,OAAO,CAAC,mBAAmB,CAAC,GAAG,SAAS,CAAC;IACjE,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,IAAI,CAAC,EAAE,YAAY,CAAC;IACpB,MAAM,CAAC,EAAE,mBAAmB,CAAC;IAC7B;;;;OAIG;IACH,YAAY,CAAC,EAAE,WAAW,EAAE,CAAC;IAC7B,uHAAuH;IACvH,iBAAiB,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAClC,kBAAkB,CAAC,EAAE,OAAO,CAAC;IAC7B,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,QAAQ,CAAC,EAAE,OAAO,CAAC;CACnB;AAED,eAAO,MAAM,kBAAkB,wGAoL9B,CAAC"}
|
|
@@ -5,7 +5,12 @@ interface UseCalendarDropdownProps {
|
|
|
5
5
|
}
|
|
6
6
|
/**
|
|
7
7
|
* Maneja la apertura/cierre del popover del calendario y dispara
|
|
8
|
-
* `onOpenCalendar` (vía ref,
|
|
8
|
+
* `onOpenCalendar` (vía ref, siempre la última versión) cada vez que se abre.
|
|
9
|
+
*
|
|
10
|
+
* `onOpenCalendar` se llama en el MISMO evento que abre el popover, no en un
|
|
11
|
+
* efecto posterior: así el `setLoading(true)` del padre entra en el mismo render
|
|
12
|
+
* que la apertura y el primer cuadro ya sale en estado "cargando", sin un
|
|
13
|
+
* parpadeo previo con todos los días habilitados y sin precios.
|
|
9
14
|
*/
|
|
10
15
|
export declare function useCalendarDropdown({ onOpenCalendar, readOnly, disabled }: UseCalendarDropdownProps): {
|
|
11
16
|
isOpen: boolean;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"use-calendar-dropdown.d.ts","sourceRoot":"","sources":["../../../../src/components/travel-calendar/hook/use-calendar-dropdown.ts"],"names":[],"mappings":"AAEA,UAAU,wBAAwB;IACjC,cAAc,CAAC,EAAE,MAAM,IAAI,CAAC;IAC5B,QAAQ,EAAE,OAAO,CAAC;IAClB,QAAQ,EAAE,OAAO,CAAC;CAClB;AAED
|
|
1
|
+
{"version":3,"file":"use-calendar-dropdown.d.ts","sourceRoot":"","sources":["../../../../src/components/travel-calendar/hook/use-calendar-dropdown.ts"],"names":[],"mappings":"AAEA,UAAU,wBAAwB;IACjC,cAAc,CAAC,EAAE,MAAM,IAAI,CAAC;IAC5B,QAAQ,EAAE,OAAO,CAAC;IAClB,QAAQ,EAAE,OAAO,CAAC;CAClB;AAED;;;;;;;;GAQG;AACH,wBAAgB,mBAAmB,CAAC,EAAE,cAAc,EAAE,QAAQ,EAAE,QAAQ,EAAE,EAAE,wBAAwB;;;;;EAoBnG"}
|
|
@@ -8,9 +8,8 @@ export interface PresetItem {
|
|
|
8
8
|
}
|
|
9
9
|
interface UseCalendarPresetsProps {
|
|
10
10
|
selectedDate: Date | null;
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
hasTravelPrices: boolean;
|
|
11
|
+
/** Misma regla que el calendario: mínimo, fechas con salida y carga en curso. */
|
|
12
|
+
isDateKeySelectable: (key: string) => boolean;
|
|
14
13
|
handleChange?: (selectedDates: DateObject | DateObject[] | null) => void;
|
|
15
14
|
/** Aplica la fecha elegida (refleja en el input y cierra el popover). */
|
|
16
15
|
onSelect: (date: Date) => void;
|
|
@@ -18,9 +17,9 @@ interface UseCalendarPresetsProps {
|
|
|
18
17
|
/**
|
|
19
18
|
* Construye los atajos del calendario ("Hoy", "+7 días", "Navidad", …) y la
|
|
20
19
|
* lógica para saber si cada atajo está activo/deshabilitado y para aplicarlo
|
|
21
|
-
* respetando
|
|
20
|
+
* respetando las fechas seleccionables del calendario.
|
|
22
21
|
*/
|
|
23
|
-
export declare function useCalendarPresets({ selectedDate,
|
|
22
|
+
export declare function useCalendarPresets({ selectedDate, isDateKeySelectable, handleChange, onSelect }: UseCalendarPresetsProps): {
|
|
24
23
|
presets: PresetItem[];
|
|
25
24
|
getPresetState: (preset: PresetItem) => {
|
|
26
25
|
active: boolean;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"use-calendar-presets.d.ts","sourceRoot":"","sources":["../../../../src/components/travel-calendar/hook/use-calendar-presets.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAC;AAGrD,MAAM,WAAW,UAAU;IAC1B,GAAG,EAAE,MAAM,CAAC;IACZ,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,CAAC,EAAE,MAAM,UAAU,GAAG,UAAU,EAAE,GAAG,IAAI,CAAC;IAClD,MAAM,CAAC,EAAE,MAAM,IAAI,CAAC;IACpB,SAAS,CAAC,EAAE,OAAO,CAAC;CACpB;AAED,UAAU,uBAAuB;IAChC,YAAY,EAAE,IAAI,GAAG,IAAI,CAAC;IAC1B,
|
|
1
|
+
{"version":3,"file":"use-calendar-presets.d.ts","sourceRoot":"","sources":["../../../../src/components/travel-calendar/hook/use-calendar-presets.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAC;AAGrD,MAAM,WAAW,UAAU;IAC1B,GAAG,EAAE,MAAM,CAAC;IACZ,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,CAAC,EAAE,MAAM,UAAU,GAAG,UAAU,EAAE,GAAG,IAAI,CAAC;IAClD,MAAM,CAAC,EAAE,MAAM,IAAI,CAAC;IACpB,SAAS,CAAC,EAAE,OAAO,CAAC;CACpB;AAED,UAAU,uBAAuB;IAChC,YAAY,EAAE,IAAI,GAAG,IAAI,CAAC;IAC1B,iFAAiF;IACjF,mBAAmB,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,OAAO,CAAC;IAC9C,YAAY,CAAC,EAAE,CAAC,aAAa,EAAE,UAAU,GAAG,UAAU,EAAE,GAAG,IAAI,KAAK,IAAI,CAAC;IACzE,yEAAyE;IACzE,QAAQ,EAAE,CAAC,IAAI,EAAE,IAAI,KAAK,IAAI,CAAC;CAC/B;AAED;;;;GAIG;AACH,wBAAgB,kBAAkB,CAAC,EAAE,YAAY,EAAE,mBAAmB,EAAE,YAAY,EAAE,QAAQ,EAAE,EAAE,uBAAuB;;6BA0D9G,UAAU;;;;gCAsBV,UAAU;EA8BpB"}
|
|
@@ -5,23 +5,38 @@ export interface TravelPrice {
|
|
|
5
5
|
priceTravel: number;
|
|
6
6
|
}
|
|
7
7
|
interface UseCalendarPricingProps {
|
|
8
|
-
|
|
8
|
+
/**
|
|
9
|
+
* `undefined` = sin restricción (todos los días seleccionables, sin precios).
|
|
10
|
+
* Array = solo esas fechas se pueden elegir; `[]` significa que no hay ninguna disponible.
|
|
11
|
+
*/
|
|
12
|
+
travelPrices: TravelPrice[] | undefined;
|
|
9
13
|
/** Fecha mínima seleccionable, ej. "2026-02-28 06:47:00". null/undefined = sin límite. */
|
|
10
14
|
minSelectableDate: string | null;
|
|
15
|
+
/** Los precios se están consultando: los días no se pueden elegir y el precio se muestra como skeleton. */
|
|
16
|
+
loading: boolean;
|
|
11
17
|
normalizedFormat: CalendarFormat;
|
|
12
18
|
lang: CalendarLang;
|
|
13
19
|
}
|
|
14
20
|
/**
|
|
15
21
|
* Deriva, a partir de `travelPrices` y `minSelectableDate`, las estructuras
|
|
16
22
|
* necesarias para pintar el calendario: el set de fechas habilitadas, la clave
|
|
17
|
-
* de fecha mínima y el `mapDays` que renderiza
|
|
23
|
+
* de fecha mínima, si una fecha se puede elegir y el `mapDays` que renderiza
|
|
24
|
+
* cada día con su precio/estado.
|
|
25
|
+
*
|
|
26
|
+
* Cada día tiene SIEMPRE la misma estructura (número + hueco de precio de alto
|
|
27
|
+
* fijo), cargue o no, tenga precio o no: así la llegada de los precios no mueve
|
|
28
|
+
* nada (sin layout shift).
|
|
18
29
|
*/
|
|
19
|
-
export declare function useCalendarPricing({ travelPrices, minSelectableDate, normalizedFormat, lang }: UseCalendarPricingProps): {
|
|
30
|
+
export declare function useCalendarPricing({ travelPrices, minSelectableDate, loading, normalizedFormat, lang }: UseCalendarPricingProps): {
|
|
20
31
|
enabledDatesSet: Set<string>;
|
|
32
|
+
isRestricted: boolean;
|
|
33
|
+
isEmpty: boolean;
|
|
21
34
|
minDateKey: string | null;
|
|
35
|
+
isDateKeyAllowed: (key: string) => boolean;
|
|
36
|
+
isDateKeySelectable: (key: string) => boolean;
|
|
22
37
|
mapDays: ({ date, today, selectedDate, isSameDate }: any) => {
|
|
23
38
|
disabled: boolean;
|
|
24
|
-
title:
|
|
39
|
+
title: any;
|
|
25
40
|
children: import("react").JSX.Element;
|
|
26
41
|
};
|
|
27
42
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"use-calendar-pricing.d.ts","sourceRoot":"","sources":["../../../../src/components/travel-calendar/hook/use-calendar-pricing.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"use-calendar-pricing.d.ts","sourceRoot":"","sources":["../../../../src/components/travel-calendar/hook/use-calendar-pricing.tsx"],"names":[],"mappings":"AACA,OAAO,EAAiB,KAAK,cAAc,EAAE,MAAM,oBAAoB,CAAC;AACxE,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,WAAW,CAAC;AAE9C,MAAM,WAAW,WAAW;IAC3B,UAAU,EAAE,MAAM,GAAG,IAAI,CAAC;IAC1B,WAAW,EAAE,MAAM,CAAC;CACpB;AAED,UAAU,uBAAuB;IAChC;;;OAGG;IACH,YAAY,EAAE,WAAW,EAAE,GAAG,SAAS,CAAC;IACxC,0FAA0F;IAC1F,iBAAiB,EAAE,MAAM,GAAG,IAAI,CAAC;IACjC,2GAA2G;IAC3G,OAAO,EAAE,OAAO,CAAC;IACjB,gBAAgB,EAAE,cAAc,CAAC;IACjC,IAAI,EAAE,YAAY,CAAC;CACnB;AAOD;;;;;;;;;GASG;AACH,wBAAgB,kBAAkB,CAAC,EAAE,YAAY,EAAE,iBAAiB,EAAE,OAAO,EAAE,gBAAgB,EAAE,IAAI,EAAE,EAAE,uBAAuB;;;;;4BAoCxH,MAAM;+BAUiC,MAAM;yDAOP,GAAG;;;;;EAkDhD"}
|
|
@@ -3,7 +3,8 @@ import { CalendarFormat } from '../calendar-format';
|
|
|
3
3
|
interface UseCalendarValueProps {
|
|
4
4
|
value: unknown;
|
|
5
5
|
normalizedFormat: CalendarFormat;
|
|
6
|
-
|
|
6
|
+
/** Lo que se escribe tampoco puede saltarse el mínimo ni las fechas sin salida (la carga en curso no bloquea escribir). */
|
|
7
|
+
isDateKeyAllowed: (key: string) => boolean;
|
|
7
8
|
handleChange?: (selectedDates: DateObject | DateObject[] | null) => void;
|
|
8
9
|
/** Se invoca tras elegir una fecha en el calendario (p.ej. para cerrar el popover). */
|
|
9
10
|
onClose: () => void;
|
|
@@ -13,7 +14,7 @@ interface UseCalendarValueProps {
|
|
|
13
14
|
* (`inputDraft`), lo sincroniza con el `value` controlado, deriva la fecha
|
|
14
15
|
* seleccionada y expone los manejadores de escritura/selección.
|
|
15
16
|
*/
|
|
16
|
-
export declare function useCalendarValue({ value, normalizedFormat,
|
|
17
|
+
export declare function useCalendarValue({ value, normalizedFormat, isDateKeyAllowed, handleChange, onClose }: UseCalendarValueProps): {
|
|
17
18
|
inputRef: import('react').RefObject<HTMLInputElement | null>;
|
|
18
19
|
valueInput: string;
|
|
19
20
|
selectedDate: Date | null;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"use-calendar-value.d.ts","sourceRoot":"","sources":["../../../../src/components/travel-calendar/hook/use-calendar-value.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAC;AACrD,OAAO,EAA0E,KAAK,cAAc,EAAE,MAAM,oBAAoB,CAAC;AAEjI,UAAU,qBAAqB;IAC9B,KAAK,EAAE,OAAO,CAAC;IACf,gBAAgB,EAAE,cAAc,CAAC;IACjC,
|
|
1
|
+
{"version":3,"file":"use-calendar-value.d.ts","sourceRoot":"","sources":["../../../../src/components/travel-calendar/hook/use-calendar-value.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAC;AACrD,OAAO,EAA0E,KAAK,cAAc,EAAE,MAAM,oBAAoB,CAAC;AAEjI,UAAU,qBAAqB;IAC9B,KAAK,EAAE,OAAO,CAAC;IACf,gBAAgB,EAAE,cAAc,CAAC;IACjC,2HAA2H;IAC3H,gBAAgB,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,OAAO,CAAC;IAC3C,YAAY,CAAC,EAAE,CAAC,aAAa,EAAE,UAAU,GAAG,UAAU,EAAE,GAAG,IAAI,KAAK,IAAI,CAAC;IACzE,uFAAuF;IACvF,OAAO,EAAE,MAAM,IAAI,CAAC;CACpB;AAED;;;;GAIG;AACH,wBAAgB,gBAAgB,CAAC,EAAE,KAAK,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,YAAY,EAAE,OAAO,EAAE,EAAE,qBAAqB;;;;2BA+BtH,KAAK,CAAC,WAAW,CAAC,gBAAgB,CAAC;8BA6BnC,UAAU,GAAG,UAAU,EAAE,GAAG,IAAI;wBAtC7B,IAAI;;EAqDZ"}
|
package/dist/lizaui.css
CHANGED
|
@@ -2477,6 +2477,8 @@
|
|
|
2477
2477
|
--tc-day-size: 45px;
|
|
2478
2478
|
--tc-font-size-number: 11px;
|
|
2479
2479
|
--tc-font-size-price: 9px;
|
|
2480
|
+
/* Alto fijo del hueco de precio: igual con precio, sin precio o cargando (evita layout shift). */
|
|
2481
|
+
--tc-price-height: 10px;
|
|
2480
2482
|
--tc-color-price: #5f6368;
|
|
2481
2483
|
--tc-color-price-empty: #9ca3af;
|
|
2482
2484
|
--tc-bg-selected: rgba(59, 130, 246, 0.2);
|
|
@@ -2589,9 +2591,39 @@
|
|
|
2589
2591
|
margin-bottom: 2px;
|
|
2590
2592
|
}
|
|
2591
2593
|
.react-multi-date-picker-travel-calendar-popover .travel-calendar-day__price {
|
|
2594
|
+
display: block;
|
|
2595
|
+
height: var(--tc-price-height);
|
|
2596
|
+
line-height: var(--tc-price-height);
|
|
2592
2597
|
font-size: var(--tc-font-size-price) !important;
|
|
2593
2598
|
color: var(--tc-color-price) !important;
|
|
2594
2599
|
font-weight: 500;
|
|
2600
|
+
white-space: nowrap;
|
|
2601
|
+
}
|
|
2602
|
+
.react-multi-date-picker-travel-calendar-popover {
|
|
2603
|
+
/* El precio aparece con un fundido corto cuando llega (sin mover nada). */
|
|
2604
|
+
}
|
|
2605
|
+
.react-multi-date-picker-travel-calendar-popover .travel-calendar-day__price:not(.travel-calendar-day__price--loading, .travel-calendar-day__price--empty) {
|
|
2606
|
+
animation: tc-price-in 180ms ease-out;
|
|
2607
|
+
}
|
|
2608
|
+
.react-multi-date-picker-travel-calendar-popover {
|
|
2609
|
+
/* Skeleton del precio mientras se consulta la API. */
|
|
2610
|
+
}
|
|
2611
|
+
.react-multi-date-picker-travel-calendar-popover .travel-calendar-day__price--loading {
|
|
2612
|
+
width: 22px;
|
|
2613
|
+
height: 6px;
|
|
2614
|
+
margin-block: 2px;
|
|
2615
|
+
border-radius: 9999px;
|
|
2616
|
+
background-color: var(--color-default-200);
|
|
2617
|
+
animation: tc-skeleton-pulse 1.2s ease-in-out infinite;
|
|
2618
|
+
}
|
|
2619
|
+
.react-multi-date-picker-travel-calendar-popover .travel-calendar-day--loading {
|
|
2620
|
+
cursor: progress;
|
|
2621
|
+
}
|
|
2622
|
+
.react-multi-date-picker-travel-calendar-popover {
|
|
2623
|
+
/* Mientras carga no se tacha ni se atenúa: todavía no sabemos si el día tiene salida. */
|
|
2624
|
+
}
|
|
2625
|
+
.react-multi-date-picker-travel-calendar-popover .rmdp-day.rmdp-disabled:has(.travel-calendar-day--loading) {
|
|
2626
|
+
cursor: progress;
|
|
2595
2627
|
}
|
|
2596
2628
|
.react-multi-date-picker-travel-calendar-popover .rmdp-day,
|
|
2597
2629
|
.react-multi-date-picker-travel-calendar-popover .rmdp-week-day {
|
|
@@ -2609,6 +2641,12 @@
|
|
|
2609
2641
|
.react-multi-date-picker-travel-calendar-popover .travel-calendar-day__price--empty {
|
|
2610
2642
|
color: var(--tc-color-price-empty);
|
|
2611
2643
|
}
|
|
2644
|
+
.react-multi-date-picker-travel-calendar-popover {
|
|
2645
|
+
/* El hueco vacío es un espacio de reserva: sin tachado (si no, se ve un "-" bajo el número). */
|
|
2646
|
+
}
|
|
2647
|
+
.react-multi-date-picker-travel-calendar-popover .travel-calendar-day--disabled .travel-calendar-day__price--empty {
|
|
2648
|
+
text-decoration: none !important;
|
|
2649
|
+
}
|
|
2612
2650
|
.react-multi-date-picker-travel-calendar-popover {
|
|
2613
2651
|
/* Accesibilidad: foco navegable si se usa keyboard nav de librería */
|
|
2614
2652
|
}
|
|
@@ -2637,6 +2675,29 @@
|
|
|
2637
2675
|
.react-multi-date-picker-travel-calendar-popover .rmdp-day.rmdp-today span {
|
|
2638
2676
|
background-color: var(--color-primary-100) !important;
|
|
2639
2677
|
color: var(--color-primary-500) !important;
|
|
2678
|
+
}
|
|
2679
|
+
|
|
2680
|
+
@keyframes tc-skeleton-pulse {
|
|
2681
|
+
0%, 100% {
|
|
2682
|
+
opacity: 1;
|
|
2683
|
+
}
|
|
2684
|
+
50% {
|
|
2685
|
+
opacity: 0.45;
|
|
2686
|
+
}
|
|
2687
|
+
}
|
|
2688
|
+
@keyframes tc-price-in {
|
|
2689
|
+
from {
|
|
2690
|
+
opacity: 0;
|
|
2691
|
+
}
|
|
2692
|
+
to {
|
|
2693
|
+
opacity: 1;
|
|
2694
|
+
}
|
|
2695
|
+
}
|
|
2696
|
+
@media (prefers-reduced-motion: reduce) {
|
|
2697
|
+
.react-multi-date-picker-travel-calendar-popover .travel-calendar-day__price,
|
|
2698
|
+
.react-multi-date-picker-travel-calendar-popover .travel-calendar-day__price--loading {
|
|
2699
|
+
animation: none !important;
|
|
2700
|
+
}
|
|
2640
2701
|
}.table__container_main {
|
|
2641
2702
|
}
|
|
2642
2703
|
|
package/dist/table/index.cjs.js
CHANGED
|
@@ -4,12 +4,64 @@ const jsxRuntime = require("react/jsx-runtime");
|
|
|
4
4
|
const compilerRuntime = require("react/compiler-runtime");
|
|
5
5
|
const React = require("react");
|
|
6
6
|
const tailwindMerge = require("tailwind-merge");
|
|
7
|
-
const loaderCircle = require("../chunks/loader-circle-DgmOcU-K.js");
|
|
8
7
|
const checkbox = require("../chunks/checkbox-BM8KELqq.js");
|
|
9
8
|
const clsx = require("clsx");
|
|
10
9
|
const tooltip = require("../chunks/tooltip-CkpPQC4G.js");
|
|
11
10
|
const chevronUp = require("../chunks/chevron-up-D8XaBFJG.js");
|
|
12
11
|
const chevronsUpDown = require("../chunks/chevrons-up-down-BEtKEloL.js");
|
|
12
|
+
const colorMap = {
|
|
13
|
+
default: "var(--color-default-default)",
|
|
14
|
+
primary: "var(--color-primary-default)",
|
|
15
|
+
danger: "var(--color-danger-default)",
|
|
16
|
+
success: "var(--color-success-default)",
|
|
17
|
+
warning: "var(--color-warning-default)",
|
|
18
|
+
secondary: "var(--color-secondary-default)"
|
|
19
|
+
};
|
|
20
|
+
const LoaderCircle = (t0) => {
|
|
21
|
+
const $ = compilerRuntime.c(7);
|
|
22
|
+
const {
|
|
23
|
+
size: t1,
|
|
24
|
+
color: t2,
|
|
25
|
+
borderWidth: t3
|
|
26
|
+
} = t0;
|
|
27
|
+
const size = t1 === void 0 ? 44 : t1;
|
|
28
|
+
const color = t2 === void 0 ? "primary" : t2;
|
|
29
|
+
const borderWidth = t3 === void 0 ? 2 : t3;
|
|
30
|
+
const colorValue = colorMap[color] ?? colorMap.default;
|
|
31
|
+
const t4 = `${size}px`;
|
|
32
|
+
const t5 = `${borderWidth}px`;
|
|
33
|
+
let t6;
|
|
34
|
+
if ($[0] !== colorValue || $[1] !== t4 || $[2] !== t5) {
|
|
35
|
+
t6 = {
|
|
36
|
+
"--size-loading-circle": t4,
|
|
37
|
+
"--color-loading-circle": colorValue,
|
|
38
|
+
"--border-width-loading-circle": t5
|
|
39
|
+
};
|
|
40
|
+
$[0] = colorValue;
|
|
41
|
+
$[1] = t4;
|
|
42
|
+
$[2] = t5;
|
|
43
|
+
$[3] = t6;
|
|
44
|
+
} else {
|
|
45
|
+
t6 = $[3];
|
|
46
|
+
}
|
|
47
|
+
const style = t6;
|
|
48
|
+
let t7;
|
|
49
|
+
if ($[4] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel")) {
|
|
50
|
+
t7 = /* @__PURE__ */ jsxRuntime.jsx("div", { className: "loading-circle-app-div", children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: "loading-circle-app" }) });
|
|
51
|
+
$[4] = t7;
|
|
52
|
+
} else {
|
|
53
|
+
t7 = $[4];
|
|
54
|
+
}
|
|
55
|
+
let t8;
|
|
56
|
+
if ($[5] !== style) {
|
|
57
|
+
t8 = /* @__PURE__ */ jsxRuntime.jsx("div", { className: "container-loading-circle", style, children: t7 });
|
|
58
|
+
$[5] = style;
|
|
59
|
+
$[6] = t8;
|
|
60
|
+
} else {
|
|
61
|
+
t8 = $[6];
|
|
62
|
+
}
|
|
63
|
+
return t8;
|
|
64
|
+
};
|
|
13
65
|
const initialValues = {
|
|
14
66
|
color: "primary",
|
|
15
67
|
disabledKeys: [],
|
|
@@ -202,7 +254,7 @@ function TableBodyComponent(t0) {
|
|
|
202
254
|
if (isLoading) {
|
|
203
255
|
let t82;
|
|
204
256
|
if ($[28] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel")) {
|
|
205
|
-
t82 = /* @__PURE__ */ jsxRuntime.jsx("div", { className: "mt-3.5", children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
257
|
+
t82 = /* @__PURE__ */ jsxRuntime.jsx("div", { className: "mt-3.5", children: /* @__PURE__ */ jsxRuntime.jsx(LoaderCircle, { size: 45 }) });
|
|
206
258
|
$[28] = t82;
|
|
207
259
|
} else {
|
|
208
260
|
t82 = $[28];
|