UNPKG

@yamada-ui/native-table

Version:

Yamada UI native table component

82 lines (79 loc) 2.85 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/tr.tsx var tr_exports = {}; __export(tr_exports, { Tr: () => Tr }); module.exports = __toCommonJS(tr_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/tr.tsx var import_jsx_runtime2 = require("react/jsx-runtime"); var Tr = (0, import_core2.forwardRef)(({ className, ...rest }, ref) => { const styles = useTableStyles(); const css = { ...styles.tr }; return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)( import_core2.ui.tr, { ref, className: (0, import_utils2.cx)("ui-table__tr", className), __css: css, ...rest } ); }); Tr.displayName = "Tr"; Tr.__ui__ = "Tr"; // Annotate the CommonJS export names for ESM import in node: 0 && (module.exports = { Tr }); //# sourceMappingURL=tr.js.map