UNPKG

@hitachivantara/uikit-react-core

Version:

Core React components for the NEXT Design System.

56 lines (55 loc) 1.92 kB
"use strict"; Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" }); const jsxRuntime = require("react/jsx-runtime"); const setId = require("../../../utils/setId.cjs"); const utils = require("../../utils.cjs"); const ComposedNavigation_styles = require("./ComposedNavigation.styles.cjs"); const Navigation = require("../Navigation/Navigation.cjs"); const HvComposedNavigation = ({ classes: classesProp, id, locale, onChange, onViewModeChange, visibleYear, visibleMonth, ...others }) => { const { classes } = ComposedNavigation_styles.useClasses(classesProp); const listMonthNamesLong = utils.getMonthNamesList(locale, "long"); const monthName = listMonthNamesLong[visibleMonth - 1]; return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: classes.navigationContainer, ...others, children: [ /* @__PURE__ */ jsxRuntime.jsx("div", { className: classes.navigationMonth, children: /* @__PURE__ */ jsxRuntime.jsx( Navigation.Navigation, { id: setId.setId(id, "navigation-month"), navigationText: monthName, onNavigatePrevious: (event) => { onChange?.(event, "previous_month"); }, onNavigateNext: (event) => { onChange?.(event, "next_month"); }, onTextClick: () => { onViewModeChange("monthly"); }, className: classes.navigationMonth } ) }), /* @__PURE__ */ jsxRuntime.jsx( Navigation.Navigation, { id: setId.setId(id, "navigation-year"), navigationText: visibleYear.toString(), onNavigatePrevious: (event) => { onChange?.(event, "previous_year"); }, onNavigateNext: (event) => { onChange?.(event, "next_year"); } } ) ] }); }; exports.composedNavigationClasses = ComposedNavigation_styles.staticClasses; exports.HvComposedNavigation = HvComposedNavigation;