UNPKG

@yamada-ui/native-table

Version:

Yamada UI native table component

85 lines (82 loc) 2.94 kB
"use client" "use strict"; var __defProp = Object.defineProperty; var __getOwnPropDesc = Object.getOwnPropertyDescriptor; var __getOwnPropNames = Object.getOwnPropertyNames; var __hasOwnProp = Object.prototype.hasOwnProperty; var __export = (target, all) => { for (var name in all) __defProp(target, name, { get: all[name], enumerable: true }); }; var __copyProps = (to, from, except, desc) => { if (from && typeof from === "object" || typeof from === "function") { for (let key of __getOwnPropNames(from)) if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); } return to; }; var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); // src/td.tsx var td_exports = {}; __export(td_exports, { Td: () => Td }); module.exports = __toCommonJS(td_exports); var import_core2 = require("@yamada-ui/core"); var import_utils2 = require("@yamada-ui/utils"); // src/native-table.tsx var import_core = require("@yamada-ui/core"); var import_utils = require("@yamada-ui/utils"); var import_jsx_runtime = require("react/jsx-runtime"); var [TableStyleProvider, useTableStyles] = (0, import_utils.createContext)({ name: "TableStyleContext", errorMessage: `useTableStyles returned is 'undefined'. Seems you forgot to wrap the components in "<Table />" or "<NativeTable />" or "<PagingTable />"` }); var NativeTable = (0, import_core.forwardRef)( (props, ref) => { const [styles, mergedProps] = (0, import_core.useComponentMultiStyle)("NativeTable", props); const { className, layout, ...rest } = (0, import_core.omitThemeProps)(mergedProps, [ "withBorder", "withColumnBorders", "highlightOnHover" ]); const css = { tableLayout: layout, ...styles.table }; return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(TableStyleProvider, { value: styles, children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)( import_core.ui.table, { ref, className: (0, import_utils.cx)("ui-table", className), __css: css, ...rest } ) }); } ); NativeTable.displayName = "NativeTable"; NativeTable.__ui__ = "NativeTable"; // src/td.tsx var import_jsx_runtime2 = require("react/jsx-runtime"); var Td = (0, import_core2.forwardRef)( ({ className, isNumeric, numeric = isNumeric, ...rest }, ref) => { const styles = useTableStyles(); const css = { ...styles.td }; return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)( import_core2.ui.td, { ref, className: (0, import_utils2.cx)("ui-table__td", className), "data-is-numeric": numeric, __css: css, ...rest } ); } ); Td.displayName = "Td"; Td.__ui__ = "Td"; // Annotate the CommonJS export names for ESM import in node: 0 && (module.exports = { Td }); //# sourceMappingURL=td.js.map