@axzydev/axzy_ui_system 1.8.14 → 1.8.16
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 +172 -166
- package/dist/index.cjs.map +1 -1
- package/dist/index.css +1 -1
- package/dist/index.d.cts +31 -3
- package/dist/index.d.ts +31 -3
- package/dist/index.js +172 -166
- package/dist/index.js.map +1 -1
- package/dist/layered.css +1 -1
- package/package.json +1 -1
- package/src/components/molecules/calendar/calendar.props.ts +32 -2
- package/src/components/molecules/calendar/calendar.tsx +107 -76
- package/src/components/organisms/sidebar/sidebar.tsx +1 -1
- package/src/index.ts +3 -1
package/dist/index.d.cts
CHANGED
|
@@ -892,6 +892,22 @@ interface CalendarEvent {
|
|
|
892
892
|
color?: string;
|
|
893
893
|
/** Arbitrary extra data passed through to event callbacks. */
|
|
894
894
|
data?: any;
|
|
895
|
+
/** Column the event belongs to when `resources` are shown (day mode). */
|
|
896
|
+
resourceId?: string;
|
|
897
|
+
/** Second line under the title. Defaults to the "HH:mm - HH:mm" range. */
|
|
898
|
+
subtitle?: string;
|
|
899
|
+
/** Extra classes for the event block (e.g. a status tone). Replaces the default color styling when set without `color`. */
|
|
900
|
+
className?: string;
|
|
901
|
+
}
|
|
902
|
+
interface CalendarResource {
|
|
903
|
+
/** Unique identifier, matched against `CalendarEvent.resourceId`. */
|
|
904
|
+
id: string;
|
|
905
|
+
/** Column title (e.g. a person's name). */
|
|
906
|
+
title: string;
|
|
907
|
+
/** Small line under the title. */
|
|
908
|
+
subtitle?: string;
|
|
909
|
+
/** Leading element in the column header (avatar, initials, icon). */
|
|
910
|
+
avatar?: React__default.ReactNode;
|
|
895
911
|
}
|
|
896
912
|
interface ITCalendarProps {
|
|
897
913
|
/** Array of calendar events to display in the scheduler view. */
|
|
@@ -900,12 +916,24 @@ interface ITCalendarProps {
|
|
|
900
916
|
mode?: 'week' | 'day' | 'month';
|
|
901
917
|
/** Callback fired when an event is clicked. */
|
|
902
918
|
onEventClick?: (event: CalendarEvent) => void;
|
|
903
|
-
/** Callback fired when an empty time slot is clicked. */
|
|
904
|
-
onSlotClick?: (date: Date) => void;
|
|
919
|
+
/** Callback fired when an empty time slot is clicked. In resource columns it also receives the resource id. */
|
|
920
|
+
onSlotClick?: (date: Date, resourceId?: string) => void;
|
|
905
921
|
/** Callback fired when the mouse enters a time slot. */
|
|
906
922
|
onSlotHover?: (date: Date) => void;
|
|
907
923
|
/** Callback fired when a time range is selected via drag. */
|
|
908
924
|
onSelectRange?: (start: Date, end: Date) => void;
|
|
925
|
+
/** Day mode only: one column per resource (e.g. per staff member) instead of one per day. */
|
|
926
|
+
resources?: CalendarResource[];
|
|
927
|
+
/** First hour shown in week/day views. @default 6 */
|
|
928
|
+
startHour?: number;
|
|
929
|
+
/** Last hour shown (exclusive) in week/day views. @default 22 */
|
|
930
|
+
endHour?: number;
|
|
931
|
+
/** Height in px of one hour row in week/day views. @default 80 */
|
|
932
|
+
hourHeight?: number;
|
|
933
|
+
/** Hides the top navigation bar (month/year, arrows, "today"), for when the page drives the date through `value`. @default false */
|
|
934
|
+
hideToolbar?: boolean;
|
|
935
|
+
/** Shows the current time as a badge on the "now" line. @default false */
|
|
936
|
+
showNowTime?: boolean;
|
|
909
937
|
/** Currently selected date (date picker mode). */
|
|
910
938
|
value?: Date;
|
|
911
939
|
/** Callback fired when a date is selected in picker mode. */
|
|
@@ -6000,4 +6028,4 @@ declare const es: ITMessages;
|
|
|
6000
6028
|
*/
|
|
6001
6029
|
declare const en: ITMessages;
|
|
6002
6030
|
|
|
6003
|
-
export { AXZY_CATALOG_ENTRIES, AXZY_EXCLUDED_TYPES, type ActionSchema, type BindingResolver, type BindingScope, CURRENT_SCHEMA_VERSION, type Catalog, type CatalogEntry, type Column, type ColumnFilterMode, type ColumnFilterValue, type ColumnFilters, type ComponentContract, DEFAULT_LIMITS, DEFAULT_MIGRATIONS, type DataHandler, type DataLoader, type DataSourceSchema, type EffectRegistry, type EffectSchema, type EngineLimits, type FieldConfig, type FieldConfigV2, FileTypeEnum, type FlatRoute, GLOBALLY_FORBIDDEN_PROPS, ITAccordion, type ITAccordionItem, type ITAccordionProps, ITAlert, type ITAlertProps, ITAvatar, type ITAvatarProps, ITBadget, type ITBadgetProps, ITBentoDonut, ITBentoFeed, ITBentoGauge, ITBentoGrid, ITBentoLive, ITBentoPill, ITBentoPillRow, ITBentoSegments, ITBentoSpark, ITBentoStatStrip, ITBentoTile, ITBentoWaves, ITBentoWeekBars, type ITBreadcrumbItem, ITBreadcrumbs, type ITBreadcrumbsProps, ITButton, type ITButtonProps, ITCalendar, type ITCalendarProps, ITCard, type ITCardProps, type ITCardTone, ITCheckbox, type ITCheckboxProps, ITChip, ITChipInput, type ITChipInputProps, type ITChipProps, ITConfirmDialog, type ITConfirmDialogProps, ITDataTable, type ITDataTableFetchParams, type ITDataTableProps, type ITDataTableResponse, ITDatePicker, type ITDatePickerProps, ITDialog, type ITDialogProps, ITDivider, type ITDividerProps, ITDrawer, type ITDrawerProps, ITDropdownMenu, type ITDropdownMenuItem, type ITDropdownMenuProps, ITDropfile, ITEmptyState, type ITEmptyStateProps, ITField, type ITFieldProps, ITFlex, type ITFlexProps, ITFormBuilder, type ITFormBuilderProps, ITFormHeader, type ITFormHeaderProps, ITGrid, type ITGridProps, ITI18nProvider, type ITI18nProviderProps, type ITI18nValue, ITImage, type ITImageProps, ITInput, ITInputNumber, type ITInputNumberProps, type ITInputProps, ITJSONEditor, type ITJSONEditorProps, type ITJsonRenderEngineProps, ITJsonRenderer, type ITJsonRendererProps, ITLayout, type ITLayoutProps, ITLineBarChart, type ITLineBarChartProps, type ITLineBarDatum, ITLoader, type LoaderProps as ITLoaderProps, type ITLocale, ITMaskedInput, type ITMaskedInputProps, type ITMessages, type ITMessagesByLocale, ITMultiSelect, type ITMultiSelectOption, type ITMultiSelectProps, ITNavbar, type ITNavbarProps, type ITNavigationItem, type ITNavigationSubItem, type ITNavigationSubItemEntry, type ITNavigationSubItemGroup, ITPage, ITPageHeader, type ITPageHeaderProps, type ITPageProps, ITPagination, type ITPaginationProps, ITPopover, type ITPopoverProps, ITProgress, type ITProgressProps, ITRadioGroup, type ITRadioGroupProps, type ITRadioOption, ITSchemaRenderer, ITSearchSelect, type ITSearchSelectProps, ITSearchTable, type ITSearchTableProps, ITSegmentedControl, type ITSegmentedControlProps, ITSelect, type ITSelectProps, ITSidebar, type ITSidebarBrand, type ITSidebarNotification, type ITSidebarProps, ITSkeleton, type ITSkeletonProps, ITSlideToggle, type ITSlideToggleProps, ITSlider, type ITSliderProps, ITStack, type ITStackProps, ITStatCard, type ITStatCardProps, ITStepper, type ITStepperProps, type ITTabItem, ITTable, type ITTableProps, ITTabs, type ITTabsProps, ITText, type ITTextProps, ITTextarea, type ITTextareaProps, type ITThemeAppearance, type ITThemeConfig, type ITThemePalette, ITThemeProvider, type ITThemeProviderProps, ITTimePicker, type ITTimePickerProps, ITToast, type ITToastProps, ITTripleFilter, type ITTripleFilterOption, type ITTripleFilterProps, ITWysiwyg, type ITWysiwygProps, type JsonComponentNode, type JsonComponentType, type JsonEngineCode, JsonEngineError, type JsonEngineIssue, type JsonEngineSeverity, type LimitTracker, type MigrationRegistry, type MigrationResult, type NavNode, NodeBoundary, type NodeSchema, type NodeStatus, type PartialParseResult, type PathSegment, type PropContract, type PropKind, type PropSpec, type ResolvedNode, type RouteMatch, type RouteNavSchema, type RouteSchema, type RoutesSchema, type SchemaMigration, type SchemaPath, type SchemaReference, type SchemaValue, type ScreenSchema, type SlotComponent, type SlotRegistry, type StreamSource, type StreamState, type TableColors, type TableDensity, type TableDesign, type TableDesignProps, type TableDesignSlot, type ToastVariant, type UnresolvedNode, UploadStatus, type UseTableStateOptions, type UseTableStateResult, type ValidateOptions, type ValidationReport, type ValidationVerdict, type VocabularyContract, type WhenSchema, auditTree, axzyCatalog, axzyCatalogTypes, buildNavigationTree, buildVocabularyContract, countPendingNodes, createBindingResolver, createCatalog, createLimitTracker, createValidationSchema, en as enMessages, es as esMessages, flattenRoutes, formatPath, formatVocabularyForPrompt, getCatalogEntry, getContrastTextColor, getExclusionReason, hasPath, isExcludedType, isLightColor, isNodePending, issue, joinRoutePath, matchRoute, migrateSchema, navContainsRoute, parsePartialSchema, parsePath, propPath, pushPath, readPath, renderNode, resolveCssColor, resolveLimits, resolveNode, routeHref, useClickOutside, useDebouncedSearch, useEditableRow, useFloatingPanel, useITAppearance, useITBentoCountUp, useITFlatAppearance, useITTheme, useITThemeSafe, useITTranslation, useJsonRender, useSchemaStream, useTableState, validateRoutes, validateSchema };
|
|
6031
|
+
export { AXZY_CATALOG_ENTRIES, AXZY_EXCLUDED_TYPES, type ActionSchema, type BindingResolver, type BindingScope, CURRENT_SCHEMA_VERSION, type CalendarEvent, type CalendarResource, type Catalog, type CatalogEntry, type Column, type ColumnFilterMode, type ColumnFilterValue, type ColumnFilters, type ComponentContract, DEFAULT_LIMITS, DEFAULT_MIGRATIONS, type DataHandler, type DataLoader, type DataSourceSchema, type EffectRegistry, type EffectSchema, type EngineLimits, type FieldConfig, type FieldConfigV2, FileTypeEnum, type FlatRoute, GLOBALLY_FORBIDDEN_PROPS, ITAccordion, type ITAccordionItem, type ITAccordionProps, ITAlert, type ITAlertProps, ITAvatar, type ITAvatarProps, ITBadget, type ITBadgetProps, ITBentoDonut, ITBentoFeed, ITBentoGauge, ITBentoGrid, ITBentoLive, ITBentoPill, ITBentoPillRow, ITBentoSegments, ITBentoSpark, ITBentoStatStrip, ITBentoTile, ITBentoWaves, ITBentoWeekBars, type ITBreadcrumbItem, ITBreadcrumbs, type ITBreadcrumbsProps, ITButton, type ITButtonProps, ITCalendar, type ITCalendarProps, ITCard, type ITCardProps, type ITCardTone, ITCheckbox, type ITCheckboxProps, ITChip, ITChipInput, type ITChipInputProps, type ITChipProps, ITConfirmDialog, type ITConfirmDialogProps, ITDataTable, type ITDataTableFetchParams, type ITDataTableProps, type ITDataTableResponse, ITDatePicker, type ITDatePickerProps, ITDialog, type ITDialogProps, ITDivider, type ITDividerProps, ITDrawer, type ITDrawerProps, ITDropdownMenu, type ITDropdownMenuItem, type ITDropdownMenuProps, ITDropfile, ITEmptyState, type ITEmptyStateProps, ITField, type ITFieldProps, ITFlex, type ITFlexProps, ITFormBuilder, type ITFormBuilderProps, ITFormHeader, type ITFormHeaderProps, ITGrid, type ITGridProps, ITI18nProvider, type ITI18nProviderProps, type ITI18nValue, ITImage, type ITImageProps, ITInput, ITInputNumber, type ITInputNumberProps, type ITInputProps, ITJSONEditor, type ITJSONEditorProps, type ITJsonRenderEngineProps, ITJsonRenderer, type ITJsonRendererProps, ITLayout, type ITLayoutProps, ITLineBarChart, type ITLineBarChartProps, type ITLineBarDatum, ITLoader, type LoaderProps as ITLoaderProps, type ITLocale, ITMaskedInput, type ITMaskedInputProps, type ITMessages, type ITMessagesByLocale, ITMultiSelect, type ITMultiSelectOption, type ITMultiSelectProps, ITNavbar, type ITNavbarProps, type ITNavigationItem, type ITNavigationSubItem, type ITNavigationSubItemEntry, type ITNavigationSubItemGroup, ITPage, ITPageHeader, type ITPageHeaderProps, type ITPageProps, ITPagination, type ITPaginationProps, ITPopover, type ITPopoverProps, ITProgress, type ITProgressProps, ITRadioGroup, type ITRadioGroupProps, type ITRadioOption, ITSchemaRenderer, ITSearchSelect, type ITSearchSelectProps, ITSearchTable, type ITSearchTableProps, ITSegmentedControl, type ITSegmentedControlProps, ITSelect, type ITSelectProps, ITSidebar, type ITSidebarBrand, type ITSidebarNotification, type ITSidebarProps, ITSkeleton, type ITSkeletonProps, ITSlideToggle, type ITSlideToggleProps, ITSlider, type ITSliderProps, ITStack, type ITStackProps, ITStatCard, type ITStatCardProps, ITStepper, type ITStepperProps, type ITTabItem, ITTable, type ITTableProps, ITTabs, type ITTabsProps, ITText, type ITTextProps, ITTextarea, type ITTextareaProps, type ITThemeAppearance, type ITThemeConfig, type ITThemePalette, ITThemeProvider, type ITThemeProviderProps, ITTimePicker, type ITTimePickerProps, ITToast, type ITToastProps, ITTripleFilter, type ITTripleFilterOption, type ITTripleFilterProps, ITWysiwyg, type ITWysiwygProps, type JsonComponentNode, type JsonComponentType, type JsonEngineCode, JsonEngineError, type JsonEngineIssue, type JsonEngineSeverity, type LimitTracker, type MigrationRegistry, type MigrationResult, type NavNode, NodeBoundary, type NodeSchema, type NodeStatus, type PartialParseResult, type PathSegment, type PropContract, type PropKind, type PropSpec, type ResolvedNode, type RouteMatch, type RouteNavSchema, type RouteSchema, type RoutesSchema, type SchemaMigration, type SchemaPath, type SchemaReference, type SchemaValue, type ScreenSchema, type SlotComponent, type SlotRegistry, type StreamSource, type StreamState, type TableColors, type TableDensity, type TableDesign, type TableDesignProps, type TableDesignSlot, type ToastVariant, type UnresolvedNode, UploadStatus, type UseTableStateOptions, type UseTableStateResult, type ValidateOptions, type ValidationReport, type ValidationVerdict, type VocabularyContract, type WhenSchema, auditTree, axzyCatalog, axzyCatalogTypes, buildNavigationTree, buildVocabularyContract, countPendingNodes, createBindingResolver, createCatalog, createLimitTracker, createValidationSchema, en as enMessages, es as esMessages, flattenRoutes, formatPath, formatVocabularyForPrompt, getCatalogEntry, getContrastTextColor, getExclusionReason, hasPath, isExcludedType, isLightColor, isNodePending, issue, joinRoutePath, matchRoute, migrateSchema, navContainsRoute, parsePartialSchema, parsePath, propPath, pushPath, readPath, renderNode, resolveCssColor, resolveLimits, resolveNode, routeHref, useClickOutside, useDebouncedSearch, useEditableRow, useFloatingPanel, useITAppearance, useITBentoCountUp, useITFlatAppearance, useITTheme, useITThemeSafe, useITTranslation, useJsonRender, useSchemaStream, useTableState, validateRoutes, validateSchema };
|
package/dist/index.d.ts
CHANGED
|
@@ -892,6 +892,22 @@ interface CalendarEvent {
|
|
|
892
892
|
color?: string;
|
|
893
893
|
/** Arbitrary extra data passed through to event callbacks. */
|
|
894
894
|
data?: any;
|
|
895
|
+
/** Column the event belongs to when `resources` are shown (day mode). */
|
|
896
|
+
resourceId?: string;
|
|
897
|
+
/** Second line under the title. Defaults to the "HH:mm - HH:mm" range. */
|
|
898
|
+
subtitle?: string;
|
|
899
|
+
/** Extra classes for the event block (e.g. a status tone). Replaces the default color styling when set without `color`. */
|
|
900
|
+
className?: string;
|
|
901
|
+
}
|
|
902
|
+
interface CalendarResource {
|
|
903
|
+
/** Unique identifier, matched against `CalendarEvent.resourceId`. */
|
|
904
|
+
id: string;
|
|
905
|
+
/** Column title (e.g. a person's name). */
|
|
906
|
+
title: string;
|
|
907
|
+
/** Small line under the title. */
|
|
908
|
+
subtitle?: string;
|
|
909
|
+
/** Leading element in the column header (avatar, initials, icon). */
|
|
910
|
+
avatar?: React__default.ReactNode;
|
|
895
911
|
}
|
|
896
912
|
interface ITCalendarProps {
|
|
897
913
|
/** Array of calendar events to display in the scheduler view. */
|
|
@@ -900,12 +916,24 @@ interface ITCalendarProps {
|
|
|
900
916
|
mode?: 'week' | 'day' | 'month';
|
|
901
917
|
/** Callback fired when an event is clicked. */
|
|
902
918
|
onEventClick?: (event: CalendarEvent) => void;
|
|
903
|
-
/** Callback fired when an empty time slot is clicked. */
|
|
904
|
-
onSlotClick?: (date: Date) => void;
|
|
919
|
+
/** Callback fired when an empty time slot is clicked. In resource columns it also receives the resource id. */
|
|
920
|
+
onSlotClick?: (date: Date, resourceId?: string) => void;
|
|
905
921
|
/** Callback fired when the mouse enters a time slot. */
|
|
906
922
|
onSlotHover?: (date: Date) => void;
|
|
907
923
|
/** Callback fired when a time range is selected via drag. */
|
|
908
924
|
onSelectRange?: (start: Date, end: Date) => void;
|
|
925
|
+
/** Day mode only: one column per resource (e.g. per staff member) instead of one per day. */
|
|
926
|
+
resources?: CalendarResource[];
|
|
927
|
+
/** First hour shown in week/day views. @default 6 */
|
|
928
|
+
startHour?: number;
|
|
929
|
+
/** Last hour shown (exclusive) in week/day views. @default 22 */
|
|
930
|
+
endHour?: number;
|
|
931
|
+
/** Height in px of one hour row in week/day views. @default 80 */
|
|
932
|
+
hourHeight?: number;
|
|
933
|
+
/** Hides the top navigation bar (month/year, arrows, "today"), for when the page drives the date through `value`. @default false */
|
|
934
|
+
hideToolbar?: boolean;
|
|
935
|
+
/** Shows the current time as a badge on the "now" line. @default false */
|
|
936
|
+
showNowTime?: boolean;
|
|
909
937
|
/** Currently selected date (date picker mode). */
|
|
910
938
|
value?: Date;
|
|
911
939
|
/** Callback fired when a date is selected in picker mode. */
|
|
@@ -6000,4 +6028,4 @@ declare const es: ITMessages;
|
|
|
6000
6028
|
*/
|
|
6001
6029
|
declare const en: ITMessages;
|
|
6002
6030
|
|
|
6003
|
-
export { AXZY_CATALOG_ENTRIES, AXZY_EXCLUDED_TYPES, type ActionSchema, type BindingResolver, type BindingScope, CURRENT_SCHEMA_VERSION, type Catalog, type CatalogEntry, type Column, type ColumnFilterMode, type ColumnFilterValue, type ColumnFilters, type ComponentContract, DEFAULT_LIMITS, DEFAULT_MIGRATIONS, type DataHandler, type DataLoader, type DataSourceSchema, type EffectRegistry, type EffectSchema, type EngineLimits, type FieldConfig, type FieldConfigV2, FileTypeEnum, type FlatRoute, GLOBALLY_FORBIDDEN_PROPS, ITAccordion, type ITAccordionItem, type ITAccordionProps, ITAlert, type ITAlertProps, ITAvatar, type ITAvatarProps, ITBadget, type ITBadgetProps, ITBentoDonut, ITBentoFeed, ITBentoGauge, ITBentoGrid, ITBentoLive, ITBentoPill, ITBentoPillRow, ITBentoSegments, ITBentoSpark, ITBentoStatStrip, ITBentoTile, ITBentoWaves, ITBentoWeekBars, type ITBreadcrumbItem, ITBreadcrumbs, type ITBreadcrumbsProps, ITButton, type ITButtonProps, ITCalendar, type ITCalendarProps, ITCard, type ITCardProps, type ITCardTone, ITCheckbox, type ITCheckboxProps, ITChip, ITChipInput, type ITChipInputProps, type ITChipProps, ITConfirmDialog, type ITConfirmDialogProps, ITDataTable, type ITDataTableFetchParams, type ITDataTableProps, type ITDataTableResponse, ITDatePicker, type ITDatePickerProps, ITDialog, type ITDialogProps, ITDivider, type ITDividerProps, ITDrawer, type ITDrawerProps, ITDropdownMenu, type ITDropdownMenuItem, type ITDropdownMenuProps, ITDropfile, ITEmptyState, type ITEmptyStateProps, ITField, type ITFieldProps, ITFlex, type ITFlexProps, ITFormBuilder, type ITFormBuilderProps, ITFormHeader, type ITFormHeaderProps, ITGrid, type ITGridProps, ITI18nProvider, type ITI18nProviderProps, type ITI18nValue, ITImage, type ITImageProps, ITInput, ITInputNumber, type ITInputNumberProps, type ITInputProps, ITJSONEditor, type ITJSONEditorProps, type ITJsonRenderEngineProps, ITJsonRenderer, type ITJsonRendererProps, ITLayout, type ITLayoutProps, ITLineBarChart, type ITLineBarChartProps, type ITLineBarDatum, ITLoader, type LoaderProps as ITLoaderProps, type ITLocale, ITMaskedInput, type ITMaskedInputProps, type ITMessages, type ITMessagesByLocale, ITMultiSelect, type ITMultiSelectOption, type ITMultiSelectProps, ITNavbar, type ITNavbarProps, type ITNavigationItem, type ITNavigationSubItem, type ITNavigationSubItemEntry, type ITNavigationSubItemGroup, ITPage, ITPageHeader, type ITPageHeaderProps, type ITPageProps, ITPagination, type ITPaginationProps, ITPopover, type ITPopoverProps, ITProgress, type ITProgressProps, ITRadioGroup, type ITRadioGroupProps, type ITRadioOption, ITSchemaRenderer, ITSearchSelect, type ITSearchSelectProps, ITSearchTable, type ITSearchTableProps, ITSegmentedControl, type ITSegmentedControlProps, ITSelect, type ITSelectProps, ITSidebar, type ITSidebarBrand, type ITSidebarNotification, type ITSidebarProps, ITSkeleton, type ITSkeletonProps, ITSlideToggle, type ITSlideToggleProps, ITSlider, type ITSliderProps, ITStack, type ITStackProps, ITStatCard, type ITStatCardProps, ITStepper, type ITStepperProps, type ITTabItem, ITTable, type ITTableProps, ITTabs, type ITTabsProps, ITText, type ITTextProps, ITTextarea, type ITTextareaProps, type ITThemeAppearance, type ITThemeConfig, type ITThemePalette, ITThemeProvider, type ITThemeProviderProps, ITTimePicker, type ITTimePickerProps, ITToast, type ITToastProps, ITTripleFilter, type ITTripleFilterOption, type ITTripleFilterProps, ITWysiwyg, type ITWysiwygProps, type JsonComponentNode, type JsonComponentType, type JsonEngineCode, JsonEngineError, type JsonEngineIssue, type JsonEngineSeverity, type LimitTracker, type MigrationRegistry, type MigrationResult, type NavNode, NodeBoundary, type NodeSchema, type NodeStatus, type PartialParseResult, type PathSegment, type PropContract, type PropKind, type PropSpec, type ResolvedNode, type RouteMatch, type RouteNavSchema, type RouteSchema, type RoutesSchema, type SchemaMigration, type SchemaPath, type SchemaReference, type SchemaValue, type ScreenSchema, type SlotComponent, type SlotRegistry, type StreamSource, type StreamState, type TableColors, type TableDensity, type TableDesign, type TableDesignProps, type TableDesignSlot, type ToastVariant, type UnresolvedNode, UploadStatus, type UseTableStateOptions, type UseTableStateResult, type ValidateOptions, type ValidationReport, type ValidationVerdict, type VocabularyContract, type WhenSchema, auditTree, axzyCatalog, axzyCatalogTypes, buildNavigationTree, buildVocabularyContract, countPendingNodes, createBindingResolver, createCatalog, createLimitTracker, createValidationSchema, en as enMessages, es as esMessages, flattenRoutes, formatPath, formatVocabularyForPrompt, getCatalogEntry, getContrastTextColor, getExclusionReason, hasPath, isExcludedType, isLightColor, isNodePending, issue, joinRoutePath, matchRoute, migrateSchema, navContainsRoute, parsePartialSchema, parsePath, propPath, pushPath, readPath, renderNode, resolveCssColor, resolveLimits, resolveNode, routeHref, useClickOutside, useDebouncedSearch, useEditableRow, useFloatingPanel, useITAppearance, useITBentoCountUp, useITFlatAppearance, useITTheme, useITThemeSafe, useITTranslation, useJsonRender, useSchemaStream, useTableState, validateRoutes, validateSchema };
|
|
6031
|
+
export { AXZY_CATALOG_ENTRIES, AXZY_EXCLUDED_TYPES, type ActionSchema, type BindingResolver, type BindingScope, CURRENT_SCHEMA_VERSION, type CalendarEvent, type CalendarResource, type Catalog, type CatalogEntry, type Column, type ColumnFilterMode, type ColumnFilterValue, type ColumnFilters, type ComponentContract, DEFAULT_LIMITS, DEFAULT_MIGRATIONS, type DataHandler, type DataLoader, type DataSourceSchema, type EffectRegistry, type EffectSchema, type EngineLimits, type FieldConfig, type FieldConfigV2, FileTypeEnum, type FlatRoute, GLOBALLY_FORBIDDEN_PROPS, ITAccordion, type ITAccordionItem, type ITAccordionProps, ITAlert, type ITAlertProps, ITAvatar, type ITAvatarProps, ITBadget, type ITBadgetProps, ITBentoDonut, ITBentoFeed, ITBentoGauge, ITBentoGrid, ITBentoLive, ITBentoPill, ITBentoPillRow, ITBentoSegments, ITBentoSpark, ITBentoStatStrip, ITBentoTile, ITBentoWaves, ITBentoWeekBars, type ITBreadcrumbItem, ITBreadcrumbs, type ITBreadcrumbsProps, ITButton, type ITButtonProps, ITCalendar, type ITCalendarProps, ITCard, type ITCardProps, type ITCardTone, ITCheckbox, type ITCheckboxProps, ITChip, ITChipInput, type ITChipInputProps, type ITChipProps, ITConfirmDialog, type ITConfirmDialogProps, ITDataTable, type ITDataTableFetchParams, type ITDataTableProps, type ITDataTableResponse, ITDatePicker, type ITDatePickerProps, ITDialog, type ITDialogProps, ITDivider, type ITDividerProps, ITDrawer, type ITDrawerProps, ITDropdownMenu, type ITDropdownMenuItem, type ITDropdownMenuProps, ITDropfile, ITEmptyState, type ITEmptyStateProps, ITField, type ITFieldProps, ITFlex, type ITFlexProps, ITFormBuilder, type ITFormBuilderProps, ITFormHeader, type ITFormHeaderProps, ITGrid, type ITGridProps, ITI18nProvider, type ITI18nProviderProps, type ITI18nValue, ITImage, type ITImageProps, ITInput, ITInputNumber, type ITInputNumberProps, type ITInputProps, ITJSONEditor, type ITJSONEditorProps, type ITJsonRenderEngineProps, ITJsonRenderer, type ITJsonRendererProps, ITLayout, type ITLayoutProps, ITLineBarChart, type ITLineBarChartProps, type ITLineBarDatum, ITLoader, type LoaderProps as ITLoaderProps, type ITLocale, ITMaskedInput, type ITMaskedInputProps, type ITMessages, type ITMessagesByLocale, ITMultiSelect, type ITMultiSelectOption, type ITMultiSelectProps, ITNavbar, type ITNavbarProps, type ITNavigationItem, type ITNavigationSubItem, type ITNavigationSubItemEntry, type ITNavigationSubItemGroup, ITPage, ITPageHeader, type ITPageHeaderProps, type ITPageProps, ITPagination, type ITPaginationProps, ITPopover, type ITPopoverProps, ITProgress, type ITProgressProps, ITRadioGroup, type ITRadioGroupProps, type ITRadioOption, ITSchemaRenderer, ITSearchSelect, type ITSearchSelectProps, ITSearchTable, type ITSearchTableProps, ITSegmentedControl, type ITSegmentedControlProps, ITSelect, type ITSelectProps, ITSidebar, type ITSidebarBrand, type ITSidebarNotification, type ITSidebarProps, ITSkeleton, type ITSkeletonProps, ITSlideToggle, type ITSlideToggleProps, ITSlider, type ITSliderProps, ITStack, type ITStackProps, ITStatCard, type ITStatCardProps, ITStepper, type ITStepperProps, type ITTabItem, ITTable, type ITTableProps, ITTabs, type ITTabsProps, ITText, type ITTextProps, ITTextarea, type ITTextareaProps, type ITThemeAppearance, type ITThemeConfig, type ITThemePalette, ITThemeProvider, type ITThemeProviderProps, ITTimePicker, type ITTimePickerProps, ITToast, type ITToastProps, ITTripleFilter, type ITTripleFilterOption, type ITTripleFilterProps, ITWysiwyg, type ITWysiwygProps, type JsonComponentNode, type JsonComponentType, type JsonEngineCode, JsonEngineError, type JsonEngineIssue, type JsonEngineSeverity, type LimitTracker, type MigrationRegistry, type MigrationResult, type NavNode, NodeBoundary, type NodeSchema, type NodeStatus, type PartialParseResult, type PathSegment, type PropContract, type PropKind, type PropSpec, type ResolvedNode, type RouteMatch, type RouteNavSchema, type RouteSchema, type RoutesSchema, type SchemaMigration, type SchemaPath, type SchemaReference, type SchemaValue, type ScreenSchema, type SlotComponent, type SlotRegistry, type StreamSource, type StreamState, type TableColors, type TableDensity, type TableDesign, type TableDesignProps, type TableDesignSlot, type ToastVariant, type UnresolvedNode, UploadStatus, type UseTableStateOptions, type UseTableStateResult, type ValidateOptions, type ValidationReport, type ValidationVerdict, type VocabularyContract, type WhenSchema, auditTree, axzyCatalog, axzyCatalogTypes, buildNavigationTree, buildVocabularyContract, countPendingNodes, createBindingResolver, createCatalog, createLimitTracker, createValidationSchema, en as enMessages, es as esMessages, flattenRoutes, formatPath, formatVocabularyForPrompt, getCatalogEntry, getContrastTextColor, getExclusionReason, hasPath, isExcludedType, isLightColor, isNodePending, issue, joinRoutePath, matchRoute, migrateSchema, navContainsRoute, parsePartialSchema, parsePath, propPath, pushPath, readPath, renderNode, resolveCssColor, resolveLimits, resolveNode, routeHref, useClickOutside, useDebouncedSearch, useEditableRow, useFloatingPanel, useITAppearance, useITBentoCountUp, useITFlatAppearance, useITTheme, useITThemeSafe, useITTranslation, useJsonRender, useSchemaStream, useTableState, validateRoutes, validateSchema };
|
package/dist/index.js
CHANGED
|
@@ -2543,10 +2543,8 @@ import { jsx as jsx16, jsxs as jsxs9 } from "react/jsx-runtime";
|
|
|
2543
2543
|
function cn(...inputs) {
|
|
2544
2544
|
return twMerge(clsx13(inputs));
|
|
2545
2545
|
}
|
|
2546
|
-
var
|
|
2547
|
-
var
|
|
2548
|
-
var HOURS_COUNT = END_HOUR - START_HOUR;
|
|
2549
|
-
var TIME_SLOTS = Array.from({ length: HOURS_COUNT + 1 }, (_, i) => START_HOUR + i);
|
|
2546
|
+
var DEFAULT_START_HOUR = 6;
|
|
2547
|
+
var DEFAULT_END_HOUR = 22;
|
|
2550
2548
|
var ITCalendar = ({
|
|
2551
2549
|
events = [],
|
|
2552
2550
|
mode: modeProp,
|
|
@@ -2562,8 +2560,18 @@ var ITCalendar = ({
|
|
|
2562
2560
|
minDate,
|
|
2563
2561
|
maxDate,
|
|
2564
2562
|
className,
|
|
2565
|
-
variant = "primary"
|
|
2563
|
+
variant = "primary",
|
|
2564
|
+
resources,
|
|
2565
|
+
startHour = DEFAULT_START_HOUR,
|
|
2566
|
+
endHour = DEFAULT_END_HOUR,
|
|
2567
|
+
hourHeight = 80,
|
|
2568
|
+
hideToolbar = false,
|
|
2569
|
+
showNowTime = false
|
|
2566
2570
|
}) => {
|
|
2571
|
+
const START_HOUR = startHour;
|
|
2572
|
+
const END_HOUR = endHour;
|
|
2573
|
+
const TIME_SLOTS = Array.from({ length: END_HOUR - START_HOUR + 1 }, (_, i) => START_HOUR + i);
|
|
2574
|
+
const toPx = (minutes) => minutes / 60 * hourHeight;
|
|
2567
2575
|
const { t, dateLocale } = useITTranslation();
|
|
2568
2576
|
const mode = modeProp || (onChange ? "month" : "week");
|
|
2569
2577
|
const [currentDate, setCurrentDate] = useState9(value || /* @__PURE__ */ new Date());
|
|
@@ -2648,8 +2656,8 @@ var ITCalendar = ({
|
|
|
2648
2656
|
const dayStartMinutes = START_HOUR * 60;
|
|
2649
2657
|
const duration = differenceInMinutes(end, start);
|
|
2650
2658
|
return {
|
|
2651
|
-
top: `${(startMinutes - dayStartMinutes)
|
|
2652
|
-
height: `${duration
|
|
2659
|
+
top: `${toPx(startMinutes - dayStartMinutes)}px`,
|
|
2660
|
+
height: `${toPx(duration)}px`
|
|
2653
2661
|
};
|
|
2654
2662
|
};
|
|
2655
2663
|
const weekEvents = useMemo5(() => {
|
|
@@ -2723,7 +2731,7 @@ var ITCalendar = ({
|
|
|
2723
2731
|
setDragCurrent(null);
|
|
2724
2732
|
},
|
|
2725
2733
|
children: [
|
|
2726
|
-
/* @__PURE__ */ jsxs9(
|
|
2734
|
+
!hideToolbar && /* @__PURE__ */ jsxs9(
|
|
2727
2735
|
"div",
|
|
2728
2736
|
{
|
|
2729
2737
|
className: "flex items-center justify-between px-2 py-2 border-b",
|
|
@@ -2914,183 +2922,181 @@ var ITCalendar = ({
|
|
|
2914
2922
|
}) })
|
|
2915
2923
|
] }) : (
|
|
2916
2924
|
/* Week/Day View (Scheduler) */
|
|
2917
|
-
|
|
2918
|
-
|
|
2919
|
-
|
|
2920
|
-
|
|
2921
|
-
|
|
2922
|
-
|
|
2923
|
-
|
|
2924
|
-
|
|
2925
|
-
|
|
2926
|
-
|
|
2927
|
-
|
|
2928
|
-
|
|
2929
|
-
/* @__PURE__ */
|
|
2930
|
-
|
|
2931
|
-
|
|
2932
|
-
|
|
2933
|
-
|
|
2934
|
-
|
|
2935
|
-
|
|
2936
|
-
"
|
|
2937
|
-
|
|
2938
|
-
|
|
2939
|
-
|
|
2940
|
-
|
|
2941
|
-
|
|
2942
|
-
|
|
2943
|
-
|
|
2944
|
-
|
|
2945
|
-
|
|
2946
|
-
|
|
2947
|
-
|
|
2948
|
-
|
|
2949
|
-
style: {
|
|
2950
|
-
color: isToday(day) ? "var(--it-calendar-today-text, #2563eb)" : "var(--it-calendar-days-text, #334155)",
|
|
2951
|
-
opacity: isToday(day) ? 1 : 0.6
|
|
2952
|
-
},
|
|
2953
|
-
children: format(day, "EEE", { locale: dateLocale })
|
|
2954
|
-
}
|
|
2955
|
-
),
|
|
2956
|
-
/* @__PURE__ */ jsx16(
|
|
2957
|
-
ITText,
|
|
2958
|
-
{
|
|
2959
|
-
as: "span",
|
|
2960
|
-
className: "text-sm font-bold w-6 h-6 flex items-center justify-center rounded-full mt-0.5",
|
|
2961
|
-
style: {
|
|
2962
|
-
color: isToday(day) ? "var(--it-calendar-selected-text, #ffffff)" : "var(--it-calendar-days-text, #334155)",
|
|
2963
|
-
backgroundColor: isToday(day) ? "var(--it-calendar-selected-bg, #2563eb)" : "transparent"
|
|
2964
|
-
},
|
|
2965
|
-
children: format(day, "d")
|
|
2966
|
-
}
|
|
2967
|
-
)
|
|
2968
|
-
]
|
|
2969
|
-
}
|
|
2970
|
-
),
|
|
2971
|
-
/* @__PURE__ */ jsxs9("div", { className: "relative", children: [
|
|
2972
|
-
TIME_SLOTS.map((hour) => hour < END_HOUR && /* @__PURE__ */ jsxs9(
|
|
2925
|
+
(() => {
|
|
2926
|
+
const byResource = mode === "day" && !!resources?.length;
|
|
2927
|
+
const headerHeight = byResource ? 64 : 40;
|
|
2928
|
+
const columns = byResource ? resources.map((r) => ({ key: r.id, day: viewDays[0], resource: r })) : viewDays.map((d) => ({ key: d.toISOString(), day: d, resource: void 0 }));
|
|
2929
|
+
const now = /* @__PURE__ */ new Date();
|
|
2930
|
+
const nowMinutes = now.getHours() * 60 + now.getMinutes();
|
|
2931
|
+
const nowVisible = nowMinutes >= START_HOUR * 60 && nowMinutes <= END_HOUR * 60;
|
|
2932
|
+
const slotDate = (day, hour, minute) => {
|
|
2933
|
+
const d = new Date(day);
|
|
2934
|
+
d.setHours(hour, minute, 0, 0);
|
|
2935
|
+
return d;
|
|
2936
|
+
};
|
|
2937
|
+
return /* @__PURE__ */ jsxs9("div", { className: cn("flex", mode === "week" ? "min-w-[800px]" : byResource ? "w-full" : "w-full"), style: byResource ? { minWidth: `${64 + columns.length * 160}px` } : void 0, children: [
|
|
2938
|
+
/* @__PURE__ */ jsx16(
|
|
2939
|
+
"div",
|
|
2940
|
+
{
|
|
2941
|
+
className: "flex-none w-16 select-none",
|
|
2942
|
+
style: {
|
|
2943
|
+
paddingTop: `${headerHeight}px`,
|
|
2944
|
+
backgroundColor: "var(--it-calendar-header-hover, #f1f5f9)",
|
|
2945
|
+
borderRight: "1px solid var(--it-calendar-border, #e2e8f0)"
|
|
2946
|
+
},
|
|
2947
|
+
children: TIME_SLOTS.map((hour) => hour < END_HOUR && /* @__PURE__ */ jsx16("div", { className: "relative text-right pr-2", style: { height: `${hourHeight}px` }, children: /* @__PURE__ */ jsx16(ITText, { as: "span", className: "text-xs text-slate-400 dark:text-slate-500 inline-block pt-1", children: format((/* @__PURE__ */ new Date()).setHours(hour, 0), "HH:mm") }) }, hour))
|
|
2948
|
+
}
|
|
2949
|
+
),
|
|
2950
|
+
/* @__PURE__ */ jsx16("div", { className: "flex flex-1", children: columns.map(({ key, day, resource }, colIndex) => /* @__PURE__ */ jsxs9(
|
|
2951
|
+
"div",
|
|
2952
|
+
{
|
|
2953
|
+
className: cn("flex-1 relative", byResource ? "min-w-[160px]" : "min-w-[120px]"),
|
|
2954
|
+
style: { borderRight: colIndex < columns.length - 1 || !byResource ? "1px solid var(--it-calendar-border, #e2e8f0)" : void 0 },
|
|
2955
|
+
children: [
|
|
2956
|
+
resource ? /* @__PURE__ */ jsxs9(
|
|
2973
2957
|
"div",
|
|
2974
2958
|
{
|
|
2975
|
-
className: "
|
|
2976
|
-
style: {
|
|
2959
|
+
className: "flex items-center gap-3 px-3 sticky top-0 z-10",
|
|
2960
|
+
style: {
|
|
2961
|
+
height: `${headerHeight}px`,
|
|
2962
|
+
backgroundColor: "var(--it-calendar-bg, #ffffff)",
|
|
2963
|
+
borderBottom: "1px solid var(--it-calendar-border, #e2e8f0)"
|
|
2964
|
+
},
|
|
2965
|
+
children: [
|
|
2966
|
+
resource.avatar,
|
|
2967
|
+
/* @__PURE__ */ jsxs9("div", { className: "min-w-0", children: [
|
|
2968
|
+
/* @__PURE__ */ jsx16(ITText, { as: "div", className: "text-sm font-semibold truncate", style: { color: "var(--it-calendar-header-text, #1e293b)" }, children: resource.title }),
|
|
2969
|
+
resource.subtitle && /* @__PURE__ */ jsx16(ITText, { as: "div", className: "text-xs truncate", style: { color: "var(--it-calendar-days-text, #334155)", opacity: 0.7 }, children: resource.subtitle })
|
|
2970
|
+
] })
|
|
2971
|
+
]
|
|
2972
|
+
}
|
|
2973
|
+
) : /* @__PURE__ */ jsxs9(
|
|
2974
|
+
"div",
|
|
2975
|
+
{
|
|
2976
|
+
className: "flex flex-col items-center justify-center sticky top-0 z-10",
|
|
2977
|
+
style: {
|
|
2978
|
+
height: `${headerHeight}px`,
|
|
2979
|
+
backgroundColor: isToday(day) ? "var(--it-calendar-today-bg, #eff6ff)" : "var(--it-calendar-bg, #ffffff)",
|
|
2980
|
+
borderBottom: "1px solid var(--it-calendar-border, #e2e8f0)"
|
|
2981
|
+
},
|
|
2977
2982
|
children: [
|
|
2978
2983
|
/* @__PURE__ */ jsx16(
|
|
2979
|
-
|
|
2984
|
+
ITText,
|
|
2980
2985
|
{
|
|
2981
|
-
|
|
2982
|
-
|
|
2983
|
-
|
|
2984
|
-
|
|
2985
|
-
|
|
2986
|
-
},
|
|
2987
|
-
onMouseEnter: () => {
|
|
2988
|
-
const d = new Date(day);
|
|
2989
|
-
d.setHours(hour, 0, 0, 0);
|
|
2990
|
-
handleMouseEnter(d);
|
|
2986
|
+
as: "span",
|
|
2987
|
+
className: "text-xs font-semibold uppercase",
|
|
2988
|
+
style: {
|
|
2989
|
+
color: isToday(day) ? "var(--it-calendar-today-text, #2563eb)" : "var(--it-calendar-days-text, #334155)",
|
|
2990
|
+
opacity: isToday(day) ? 1 : 0.6
|
|
2991
2991
|
},
|
|
2992
|
-
|
|
2993
|
-
if (!isDraggingRef.current) {
|
|
2994
|
-
const d = new Date(day);
|
|
2995
|
-
d.setHours(hour, 0, 0, 0);
|
|
2996
|
-
if (onSlotClick) onSlotClick(d);
|
|
2997
|
-
}
|
|
2998
|
-
}
|
|
2992
|
+
children: format(day, "EEE", { locale: dateLocale })
|
|
2999
2993
|
}
|
|
3000
2994
|
),
|
|
3001
2995
|
/* @__PURE__ */ jsx16(
|
|
3002
|
-
|
|
2996
|
+
ITText,
|
|
3003
2997
|
{
|
|
3004
|
-
|
|
3005
|
-
|
|
3006
|
-
|
|
3007
|
-
|
|
3008
|
-
|
|
3009
|
-
},
|
|
3010
|
-
onMouseEnter: () => {
|
|
3011
|
-
const d = new Date(day);
|
|
3012
|
-
d.setHours(hour, 30, 0, 0);
|
|
3013
|
-
handleMouseEnter(d);
|
|
2998
|
+
as: "span",
|
|
2999
|
+
className: "text-sm font-bold w-6 h-6 flex items-center justify-center rounded-full mt-0.5",
|
|
3000
|
+
style: {
|
|
3001
|
+
color: isToday(day) ? "var(--it-calendar-selected-text, #ffffff)" : "var(--it-calendar-days-text, #334155)",
|
|
3002
|
+
backgroundColor: isToday(day) ? "var(--it-calendar-selected-bg, #2563eb)" : "transparent"
|
|
3014
3003
|
},
|
|
3015
|
-
|
|
3016
|
-
if (!isDraggingRef.current) {
|
|
3017
|
-
const d = new Date(day);
|
|
3018
|
-
d.setHours(hour, 30, 0, 0);
|
|
3019
|
-
if (onSlotClick) onSlotClick(d);
|
|
3020
|
-
}
|
|
3021
|
-
}
|
|
3004
|
+
children: format(day, "d")
|
|
3022
3005
|
}
|
|
3023
3006
|
)
|
|
3024
3007
|
]
|
|
3025
|
-
}
|
|
3026
|
-
|
|
3027
|
-
|
|
3028
|
-
|
|
3029
|
-
let start = dragStart;
|
|
3030
|
-
let end = dragCurrent;
|
|
3031
|
-
if (isBefore(end, start)) [start, end] = [end, start];
|
|
3032
|
-
const finalEnd = addMinutes(end, 30);
|
|
3033
|
-
const startMinutes = start.getHours() * 60 + start.getMinutes();
|
|
3034
|
-
const dayStartMinutes = START_HOUR * 60;
|
|
3035
|
-
const duration = differenceInMinutes(finalEnd, start);
|
|
3036
|
-
const top = (startMinutes - dayStartMinutes) / 60 * 80;
|
|
3037
|
-
const height = duration / 60 * 80;
|
|
3038
|
-
return /* @__PURE__ */ jsx16(
|
|
3008
|
+
}
|
|
3009
|
+
),
|
|
3010
|
+
/* @__PURE__ */ jsxs9("div", { className: "relative", children: [
|
|
3011
|
+
TIME_SLOTS.map((hour) => hour < END_HOUR && /* @__PURE__ */ jsx16(
|
|
3039
3012
|
"div",
|
|
3040
3013
|
{
|
|
3041
|
-
className: "
|
|
3042
|
-
style: {
|
|
3043
|
-
|
|
3044
|
-
|
|
3045
|
-
|
|
3046
|
-
|
|
3047
|
-
|
|
3048
|
-
|
|
3014
|
+
className: "relative group",
|
|
3015
|
+
style: { height: `${hourHeight}px`, borderBottom: "1px dashed var(--it-calendar-border, #e2e8f0)" },
|
|
3016
|
+
children: [0, 30].map((minute) => /* @__PURE__ */ jsx16(
|
|
3017
|
+
"div",
|
|
3018
|
+
{
|
|
3019
|
+
className: cn(
|
|
3020
|
+
"absolute inset-x-0 border-b border-transparent hover:border-[var(--it-calendar-today-bg)] hover:bg-[var(--it-calendar-today-bg)] transition-colors cursor-pointer z-0",
|
|
3021
|
+
minute === 0 ? "top-0" : "bottom-0"
|
|
3022
|
+
),
|
|
3023
|
+
style: { height: `${hourHeight / 2}px` },
|
|
3024
|
+
onMouseDown: (e) => handleMouseDown(slotDate(day, hour, minute), e),
|
|
3025
|
+
onMouseEnter: () => handleMouseEnter(slotDate(day, hour, minute)),
|
|
3026
|
+
onClick: () => {
|
|
3027
|
+
if (!isDraggingRef.current && onSlotClick) onSlotClick(slotDate(day, hour, minute), resource?.id);
|
|
3028
|
+
}
|
|
3029
|
+
},
|
|
3030
|
+
minute
|
|
3031
|
+
))
|
|
3032
|
+
},
|
|
3033
|
+
hour
|
|
3034
|
+
)),
|
|
3035
|
+
!byResource && dragStart && dragCurrent && isSameDay(dragStart, day) && (() => {
|
|
3036
|
+
let start = dragStart;
|
|
3037
|
+
let end = dragCurrent;
|
|
3038
|
+
if (isBefore(end, start)) [start, end] = [end, start];
|
|
3039
|
+
const finalEnd = addMinutes(end, 30);
|
|
3040
|
+
const startMinutes = start.getHours() * 60 + start.getMinutes();
|
|
3041
|
+
const top = toPx(startMinutes - START_HOUR * 60);
|
|
3042
|
+
const height = toPx(differenceInMinutes(finalEnd, start));
|
|
3043
|
+
return /* @__PURE__ */ jsx16(
|
|
3044
|
+
"div",
|
|
3045
|
+
{
|
|
3046
|
+
className: "absolute left-1 right-1 bg-[var(--it-calendar-selected-bg)]/30 border border-[var(--it-calendar-selected-bg)] rounded z-10 pointer-events-none",
|
|
3047
|
+
style: { top: `${top}px`, height: `${height}px` }
|
|
3048
|
+
}
|
|
3049
|
+
);
|
|
3050
|
+
})(),
|
|
3051
|
+
weekEvents.filter((event) => isSameDay(typeof event.start === "string" ? parseISO(event.start) : event.start, day)).filter((event) => !resource || event.resourceId === resource.id).map((event) => {
|
|
3052
|
+
const style = getEventStyle(event);
|
|
3053
|
+
const custom = !!event.className && !event.color;
|
|
3054
|
+
return /* @__PURE__ */ jsxs9(
|
|
3055
|
+
"div",
|
|
3056
|
+
{
|
|
3057
|
+
className: cn(
|
|
3058
|
+
"absolute left-1 right-1 rounded px-2 py-1 text-xs cursor-pointer hover:brightness-110 transition-all shadow-sm overflow-hidden z-20",
|
|
3059
|
+
!custom && "border-l-4",
|
|
3060
|
+
!event.color && !custom && "bg-[var(--it-calendar-today-bg)] text-[var(--it-calendar-today-text)] border-[var(--it-calendar-selected-bg)]",
|
|
3061
|
+
event.className
|
|
3062
|
+
),
|
|
3063
|
+
style: {
|
|
3064
|
+
top: style.top,
|
|
3065
|
+
height: style.height,
|
|
3066
|
+
backgroundColor: event.color ? `${event.color}20` : void 0,
|
|
3067
|
+
borderColor: event.color,
|
|
3068
|
+
color: event.color ? event.color : void 0
|
|
3069
|
+
},
|
|
3070
|
+
onClick: (e) => {
|
|
3071
|
+
e.stopPropagation();
|
|
3072
|
+
if (onEventClick) onEventClick(event);
|
|
3073
|
+
},
|
|
3074
|
+
children: [
|
|
3075
|
+
/* @__PURE__ */ jsx16(ITText, { as: "div", className: "font-semibold truncate", children: event.title }),
|
|
3076
|
+
/* @__PURE__ */ jsx16(ITText, { as: "div", className: "opacity-80 truncate", children: event.subtitle ?? `${format(typeof event.start === "string" ? parseISO(event.start) : event.start, "HH:mm")} - ${format(typeof event.end === "string" ? parseISO(event.end) : event.end, "HH:mm")}` })
|
|
3077
|
+
]
|
|
3078
|
+
},
|
|
3079
|
+
event.id
|
|
3080
|
+
);
|
|
3081
|
+
}),
|
|
3082
|
+
isToday(day) && nowVisible && /* @__PURE__ */ jsxs9(
|
|
3049
3083
|
"div",
|
|
3050
3084
|
{
|
|
3051
|
-
className:
|
|
3052
|
-
|
|
3053
|
-
!event.color && "bg-[var(--it-calendar-today-bg)] text-[var(--it-calendar-today-text)] border-[var(--it-calendar-selected-bg)]"
|
|
3054
|
-
),
|
|
3055
|
-
style: {
|
|
3056
|
-
top: style.top,
|
|
3057
|
-
height: style.height,
|
|
3058
|
-
backgroundColor: event.color ? `${event.color}20` : void 0,
|
|
3059
|
-
borderColor: event.color,
|
|
3060
|
-
color: event.color ? event.color : void 0
|
|
3061
|
-
},
|
|
3062
|
-
onClick: (e) => {
|
|
3063
|
-
e.stopPropagation();
|
|
3064
|
-
if (onEventClick) onEventClick(event);
|
|
3065
|
-
},
|
|
3085
|
+
className: "absolute left-0 right-0 border-t-2 border-danger-500 z-30 pointer-events-none",
|
|
3086
|
+
style: { top: `${toPx(nowMinutes - START_HOUR * 60)}px` },
|
|
3066
3087
|
children: [
|
|
3067
|
-
/* @__PURE__ */ jsx16(
|
|
3068
|
-
/* @__PURE__ */
|
|
3069
|
-
format(typeof event.start === "string" ? parseISO(event.start) : event.start, "HH:mm"),
|
|
3070
|
-
" -",
|
|
3071
|
-
format(typeof event.end === "string" ? parseISO(event.end) : event.end, "HH:mm")
|
|
3072
|
-
] })
|
|
3088
|
+
(!byResource || colIndex === 0) && /* @__PURE__ */ jsx16("div", { className: "absolute -left-1.5 -top-1.5 w-3 h-3 bg-danger-500 rounded-full" }),
|
|
3089
|
+
showNowTime && (!byResource || colIndex === columns.length - 1) && /* @__PURE__ */ jsx16(ITText, { as: "span", className: "absolute right-1 -top-2.5 rounded-full bg-danger-500 px-1.5 text-[10px] font-bold text-white leading-4", children: format(now, "HH:mm") })
|
|
3073
3090
|
]
|
|
3074
|
-
}
|
|
3075
|
-
|
|
3076
|
-
|
|
3077
|
-
|
|
3078
|
-
|
|
3079
|
-
|
|
3080
|
-
|
|
3081
|
-
|
|
3082
|
-
|
|
3083
|
-
style: {
|
|
3084
|
-
top: `${((/* @__PURE__ */ new Date()).getHours() * 60 + (/* @__PURE__ */ new Date()).getMinutes() - START_HOUR * 60) / 60 * 80}px`
|
|
3085
|
-
},
|
|
3086
|
-
children: /* @__PURE__ */ jsx16("div", { className: "absolute -left-1.5 -top-1.5 w-3 h-3 bg-danger-500 rounded-full" })
|
|
3087
|
-
}
|
|
3088
|
-
)
|
|
3089
|
-
]
|
|
3090
|
-
},
|
|
3091
|
-
day.toISOString()
|
|
3092
|
-
)) })
|
|
3093
|
-
] })
|
|
3091
|
+
}
|
|
3092
|
+
)
|
|
3093
|
+
] })
|
|
3094
|
+
]
|
|
3095
|
+
},
|
|
3096
|
+
key
|
|
3097
|
+
)) })
|
|
3098
|
+
] });
|
|
3099
|
+
})()
|
|
3094
3100
|
)
|
|
3095
3101
|
}
|
|
3096
3102
|
)
|
|
@@ -9099,7 +9105,7 @@ function ITSidebar({
|
|
|
9099
9105
|
style: { backgroundColor: "var(--it-sidebar-active-icon, var(--color-primary-500))", boxShadow: "0 0 10px var(--it-sidebar-active-icon, var(--color-primary-500))" }
|
|
9100
9106
|
}
|
|
9101
9107
|
),
|
|
9102
|
-
/* @__PURE__ */ jsxs43("div", { className:
|
|
9108
|
+
/* @__PURE__ */ jsxs43("div", { className: `flex items-center gap-2.5 relative z-10 w-full ${isSidebarCollapsed ? "justify-center" : ""}`, children: [
|
|
9103
9109
|
item.icon && /* @__PURE__ */ jsx61(
|
|
9104
9110
|
"div",
|
|
9105
9111
|
{
|