@workday/canvas-kit-react
Version:
The parent module that contains all Workday Canvas Kit React components
43 lines (42 loc) • 2.25 kB
JavaScript
;
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
var desc = Object.getOwnPropertyDescriptor(m, k);
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
desc = { enumerable: true, get: function() { return m[k]; } };
}
Object.defineProperty(o, k2, desc);
}) : (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
o[k2] = m[k];
}));
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
Object.defineProperty(o, "default", { enumerable: true, value: v });
}) : function(o, v) {
o["default"] = v;
});
var __importStar = (this && this.__importStar) || function (mod) {
if (mod && mod.__esModule) return mod;
var result = {};
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
__setModuleDefault(result, mod);
return result;
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.GoToLabel = exports.paginationGoToLabelStencil = void 0;
const jsx_runtime_1 = require("react/jsx-runtime");
const React = __importStar(require("react"));
const canvas_kit_styling_1 = require("@workday/canvas-kit-styling");
const common_1 = require("@workday/canvas-kit-react/common");
const text_1 = require("@workday/canvas-kit-react/text");
const usePaginationModel_1 = require("../usePaginationModel");
exports.paginationGoToLabelStencil = (0, canvas_kit_styling_1.createStencil)({
base: { name: "nohl", styles: "box-sizing:border-box;white-space:nowrap;" }
}, "pagination-go-to-label-b25b17");
exports.GoToLabel = (0, common_1.createComponent)('label')({
displayName: 'Pagination.GoToLabel',
Component({ children, ...elemProps }, ref, Element) {
const model = React.useContext(usePaginationModel_1.PaginationContext);
return ((0, jsx_runtime_1.jsx)(text_1.Subtext, { ref: ref, as: Element, size: "medium", variant: "hint", ...(0, canvas_kit_styling_1.handleCsProp)(elemProps, (0, exports.paginationGoToLabelStencil)()), children: typeof children === 'function' ? children(model) : children }));
},
});