Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@frui.ts/dataviews

Package Overview
Dependencies
Maintainers
5
Versions
66
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@frui.ts/dataviews - npm Package Compare versions

Comparing version 0.17.0-generator.2 to 1.0.0-alpha.1

2

dist/dataList/dataListRow.js

@@ -9,4 +9,4 @@ "use strict";

function Header(_a) {
var _b, _c, _d, _e, _f;
var column = _a.column, context = _a.context;
var _b, _c, _d, _e, _f;
if (column.headerFormatter) {

@@ -13,0 +13,0 @@ return react_1.default.createElement(react_1.default.Fragment, null, column.headerFormatter({ key: "list-header", column: column, context: context }));

@@ -1,2 +0,2 @@

import * as React from "react";
import React from "react";
import { DataTablePropsBase } from "../dataTypes";

@@ -3,0 +3,0 @@ export interface DataRepeaterProps<TItem, TContext, TWrapper extends React.ElementType, THeadWrapper extends React.ElementType, THeadCell extends React.ElementType, TBodyWrapper extends React.ElementType, TItemWrapper extends React.ElementType, TItemCell extends React.ElementType> extends DataTablePropsBase<TItem, TContext> {

@@ -13,9 +13,2 @@ "use strict";

};
var __importStar = (this && this.__importStar) || function (mod) {
if (mod && mod.__esModule) return mod;
var result = {};
if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];
result["default"] = mod;
return result;
};
var __importDefault = (this && this.__importDefault) || function (mod) {

@@ -26,3 +19,3 @@ return (mod && mod.__esModule) ? mod : { "default": mod };

var mobx_react_lite_1 = require("mobx-react-lite");
var React = __importStar(require("react"));
var react_1 = __importDefault(require("react"));
var repeaterHeader_1 = __importDefault(require("./repeaterHeader"));

@@ -37,5 +30,5 @@ var repeaterRow_1 = __importDefault(require("./repeaterRow"));

var ItemWrapper = (_b = props.bodyWrapperType) !== null && _b !== void 0 ? _b : "tbody";
return (React.createElement(Wrapper, __assign({ id: props.id }, props.wrapperProps),
props.displayHeader && (React.createElement(repeaterHeader_1.default, { columns: props.columns, context: props.context, pagingFilter: props.pagingFilter, onColumnSort: props.onColumnSort, wrapperType: props.headWrapperType, wrapperProps: props.headWrapperProps, itemCellType: props.headCellType, itemCellProps: props.headCellProps })),
React.createElement(ItemWrapper, __assign({}, props.bodyWrapperProps), props.items.map(function (item) { return (React.createElement(repeaterRow_1.default, { key: String(item[props.itemKey]), item: item, columns: props.columns, context: props.context, wrapperType: props.itemWrapperType, wrapperProps: props.itemWrapperProps, itemCellType: props.itemCellType, itemCellProps: props.itemCellProps })); }))));
return (react_1.default.createElement(Wrapper, __assign({ id: props.id }, props.wrapperProps),
props.displayHeader && (react_1.default.createElement(repeaterHeader_1.default, { columns: props.columns, context: props.context, pagingFilter: props.pagingFilter, onColumnSort: props.onColumnSort, wrapperType: props.headWrapperType, wrapperProps: props.headWrapperProps, itemCellType: props.headCellType, itemCellProps: props.headCellProps })),
react_1.default.createElement(ItemWrapper, __assign({}, props.bodyWrapperProps), props.items.map(function (item) { return (react_1.default.createElement(repeaterRow_1.default, { key: String(item[props.itemKey]), item: item, columns: props.columns, context: props.context, wrapperType: props.itemWrapperType, wrapperProps: props.itemWrapperProps, itemCellType: props.itemCellType, itemCellProps: props.itemCellProps })); }))));
}

@@ -42,0 +35,0 @@ dataRepeater.defaultProps = defaultProps;

import { IPagingFilter } from "@frui.ts/data";
import * as React from "react";
import React from "react";
import { ColumnDefinition, PropsWithColumns } from "../dataTypes";

@@ -4,0 +4,0 @@ export interface HeaderRowProps<TItem, TContext, TWrapper extends React.ElementType, TItemCell extends React.ElementType> extends PropsWithColumns<TItem, TContext> {

@@ -13,8 +13,4 @@ "use strict";

};
var __importStar = (this && this.__importStar) || function (mod) {
if (mod && mod.__esModule) return mod;
var result = {};
if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];
result["default"] = mod;
return result;
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};

@@ -24,3 +20,3 @@ Object.defineProperty(exports, "__esModule", { value: true });

var mobx_react_lite_1 = require("mobx-react-lite");
var React = __importStar(require("react"));
var react_1 = __importDefault(require("react"));
function getSortIndicatorClass(pagingFilter, columnName) {

@@ -39,3 +35,3 @@ if (pagingFilter.sortColumn === columnName) {

var context = props.context;
return (React.createElement(Wrapper, __assign({}, props.wrapperProps), props.columns.map(function (column, i) {
return (react_1.default.createElement(Wrapper, __assign({}, props.wrapperProps), props.columns.map(function (column, i) {
var _a;

@@ -47,8 +43,8 @@ var key = (_a = column.property) !== null && _a !== void 0 ? _a : i;

else if (props.pagingFilter && column.sortable && column.property) {
return (React.createElement(Item, __assign({ key: key, className: column.headerClassName ? "sortable " + column.headerClassName : "sortable", onClick: function () { var _a; return (_a = props.onColumnSort) === null || _a === void 0 ? void 0 : _a.call(props, column); } }, props.itemCellProps),
return (react_1.default.createElement(Item, __assign({ key: key, className: column.headerClassName ? "sortable " + column.headerClassName : "sortable", onClick: function () { var _a; return void ((_a = props.onColumnSort) === null || _a === void 0 ? void 0 : _a.call(props, column)); } }, props.itemCellProps),
column.titleFactory ? column.titleFactory(context) : column.title,
React.createElement("span", { className: getSortIndicatorClass(props.pagingFilter, column.property) })));
react_1.default.createElement("span", { className: getSortIndicatorClass(props.pagingFilter, column.property) })));
}
else {
return (React.createElement(Item, __assign({ key: key, className: column.headerClassName }, props.itemCellProps), column.titleFactory ? column.titleFactory(context) : column.title));
return (react_1.default.createElement(Item, __assign({ key: key, className: column.headerClassName }, props.itemCellProps), column.titleFactory ? column.titleFactory(context) : column.title));
}

@@ -55,0 +51,0 @@ })));

@@ -1,2 +0,2 @@

import * as React from "react";
import React from "react";
import { PropsWithColumns } from "../dataTypes";

@@ -3,0 +3,0 @@ export interface DataRowProps<TItem, TContext, TWrapper extends React.ElementType, TItemCell extends React.ElementType> extends PropsWithColumns<TItem, TContext> {

@@ -13,12 +13,8 @@ "use strict";

};
var __importStar = (this && this.__importStar) || function (mod) {
if (mod && mod.__esModule) return mod;
var result = {};
if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];
result["default"] = mod;
return result;
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
var mobx_react_lite_1 = require("mobx-react-lite");
var React = __importStar(require("react"));
var react_1 = __importDefault(require("react"));
function repeaterRow(props) {

@@ -30,3 +26,3 @@ var _a, _b;

var columns = props.columns, item = props.item, itemCellProps = props.itemCellProps;
return (React.createElement(Wrapper, __assign({}, props.wrapperProps), columns.map(function (column, i) {
return (react_1.default.createElement(Wrapper, __assign({}, props.wrapperProps), columns.map(function (column, i) {
var _a, _b;

@@ -39,3 +35,3 @@ var key = (_a = column.property) !== null && _a !== void 0 ? _a : i;

else {
return (React.createElement(Item, __assign({ key: key, className: column.cellClassName }, itemCellProps, (_b = column.cellProps) === null || _b === void 0 ? void 0 : _b.call(column, { value: value, item: item, column: column, context: context })), column.valueFormatter ? column.valueFormatter({ value: value, item: item, column: column, context: context }) : value));
return (react_1.default.createElement(Item, __assign({ key: key, className: column.cellClassName }, itemCellProps, (_b = column.cellProps) === null || _b === void 0 ? void 0 : _b.call(column, { value: value, item: item, column: column, context: context })), column.valueFormatter ? column.valueFormatter({ value: value, item: item, column: column, context: context }) : value));
}

@@ -42,0 +38,0 @@ })));

"use strict";
var __importStar = (this && this.__importStar) || function (mod) {
if (mod && mod.__esModule) return mod;
var result = {};
if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];
result["default"] = mod;
return result;
};
var __importDefault = (this && this.__importDefault) || function (mod) {

@@ -14,3 +7,3 @@ return (mod && mod.__esModule) ? mod : { "default": mod };

var mobx_react_lite_1 = require("mobx-react-lite");
var React = __importStar(require("react"));
var react_1 = __importDefault(require("react"));
var tableHeader_1 = __importDefault(require("./tableHeader"));

@@ -23,6 +16,6 @@ var tableRow_1 = __importDefault(require("./tableRow"));

var _a;
return (React.createElement("table", { id: props.id, className: props.className },
props.displayHeader && (React.createElement("thead", null,
React.createElement(tableHeader_1.default, { columns: props.columns, context: props.context, pagingFilter: props.pagingFilter, onColumnSort: props.onColumnSort, className: props.headerRowClassName }))),
React.createElement("tbody", null, (_a = props.items) === null || _a === void 0 ? void 0 : _a.map(function (item) { return (React.createElement(tableRow_1.default, { key: String(item[props.itemKey]), item: item, columns: props.columns, context: props.context, rowProps: props.rowProps })); }))));
return (react_1.default.createElement("table", { id: props.id, className: props.className },
props.displayHeader && (react_1.default.createElement("thead", null,
react_1.default.createElement(tableHeader_1.default, { columns: props.columns, context: props.context, pagingFilter: props.pagingFilter, onColumnSort: props.onColumnSort, className: props.headerRowClassName }))),
react_1.default.createElement("tbody", null, (_a = props.items) === null || _a === void 0 ? void 0 : _a.map(function (item) { return (react_1.default.createElement(tableRow_1.default, { key: String(item[props.itemKey]), item: item, columns: props.columns, context: props.context, rowProps: props.rowProps })); }))));
}

@@ -29,0 +22,0 @@ dataTable.defaultProps = defaultProps;

"use strict";
var __importStar = (this && this.__importStar) || function (mod) {
if (mod && mod.__esModule) return mod;
var result = {};
if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];
result["default"] = mod;
return result;
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};

@@ -12,3 +8,3 @@ Object.defineProperty(exports, "__esModule", { value: true });

var mobx_react_lite_1 = require("mobx-react-lite");
var React = __importStar(require("react"));
var react_1 = __importDefault(require("react"));
function getSortIndicatorClass(pagingFilter, columnName) {

@@ -23,3 +19,3 @@ if (pagingFilter.sortColumn === columnName) {

function tableHeader(props) {
return (React.createElement("tr", { className: props.className }, props.columns.map(function (column, i) {
return (react_1.default.createElement("tr", { className: props.className }, props.columns.map(function (column, i) {
var _a;

@@ -31,8 +27,8 @@ var key = (_a = column.property) !== null && _a !== void 0 ? _a : i;

else if (props.pagingFilter && column.sortable && column.property) {
return (React.createElement("th", { key: key, className: column.headerClassName ? "sortable " + column.headerClassName : "sortable", onClick: function () { var _a; return (_a = props.onColumnSort) === null || _a === void 0 ? void 0 : _a.call(props, column); } },
return (react_1.default.createElement("th", { key: key, className: column.headerClassName ? "sortable " + column.headerClassName : "sortable", onClick: function () { var _a; return void ((_a = props.onColumnSort) === null || _a === void 0 ? void 0 : _a.call(props, column)); } },
column.titleFactory ? column.titleFactory(props.context) : column.title,
React.createElement("span", { className: getSortIndicatorClass(props.pagingFilter, column.property) })));
react_1.default.createElement("span", { className: getSortIndicatorClass(props.pagingFilter, column.property) })));
}
else {
return (React.createElement("th", { key: key, className: column.headerClassName }, column.titleFactory ? column.titleFactory(props.context) : column.title));
return (react_1.default.createElement("th", { key: key, className: column.headerClassName }, column.titleFactory ? column.titleFactory(props.context) : column.title));
}

@@ -39,0 +35,0 @@ })));

@@ -1,2 +0,2 @@

import * as React from "react";
import React from "react";
import { PropsWithColumns } from "../dataTypes";

@@ -3,0 +3,0 @@ export interface TableRowProps<TItem, TContext> extends PropsWithColumns<TItem, TContext> {

@@ -13,15 +13,11 @@ "use strict";

};
var __importStar = (this && this.__importStar) || function (mod) {
if (mod && mod.__esModule) return mod;
var result = {};
if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];
result["default"] = mod;
return result;
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
var mobx_react_lite_1 = require("mobx-react-lite");
var React = __importStar(require("react"));
var react_1 = __importDefault(require("react"));
function tableRow(_a) {
var item = _a.item, columns = _a.columns, context = _a.context, rowProps = _a.rowProps;
return (React.createElement("tr", __assign({}, rowProps === null || rowProps === void 0 ? void 0 : rowProps(item, context)), columns.map(function (column, i) {
return (react_1.default.createElement("tr", __assign({}, rowProps === null || rowProps === void 0 ? void 0 : rowProps(item, context)), columns.map(function (column, i) {
var _a, _b;

@@ -34,3 +30,3 @@ var key = (_a = column.property) !== null && _a !== void 0 ? _a : i;

else {
return (React.createElement("td", __assign({ key: key, className: column.cellClassName }, (_b = column.cellProps) === null || _b === void 0 ? void 0 : _b.call(column, { value: value, item: item, column: column, context: context })), column.valueFormatter ? column.valueFormatter({ value: value, item: item, column: column, context: context }) : value));
return (react_1.default.createElement("td", __assign({ key: key, className: column.cellClassName }, (_b = column.cellProps) === null || _b === void 0 ? void 0 : _b.call(column, { value: value, item: item, column: column, context: context })), column.valueFormatter ? column.valueFormatter({ value: value, item: item, column: column, context: context }) : value));
}

@@ -37,0 +33,0 @@ })));

import { IPagingFilter } from "@frui.ts/data";
import { ReactNode } from "react";
import React, { ReactNode } from "react";
export declare type PropertyKey<TItem> = keyof TItem & (string | number);

@@ -4,0 +4,0 @@ export interface KeyRenderProps {

"use strict";
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
}) : (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
o[k2] = m[k];
}));
var __exportStar = (this && this.__exportStar) || function(m, exports) {
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
};
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.ResponsiveTable = exports.DataTable = exports.DataRepeater = exports.DataList = void 0;
var dataList_1 = require("./dataList");
exports.DataList = dataList_1.default;
Object.defineProperty(exports, "DataList", { enumerable: true, get: function () { return __importDefault(dataList_1).default; } });
var dataRepeater_1 = require("./dataRepeater");
exports.DataRepeater = dataRepeater_1.default;
Object.defineProperty(exports, "DataRepeater", { enumerable: true, get: function () { return __importDefault(dataRepeater_1).default; } });
var dataTable_1 = require("./dataTable");
exports.DataTable = dataTable_1.default;
Object.defineProperty(exports, "DataTable", { enumerable: true, get: function () { return __importDefault(dataTable_1).default; } });
__exportStar(require("./dataTypes"), exports);
var responsiveTable_1 = require("./responsiveTable");
exports.ResponsiveTable = responsiveTable_1.default;
Object.defineProperty(exports, "ResponsiveTable", { enumerable: true, get: function () { return __importDefault(responsiveTable_1).default; } });
//# sourceMappingURL=index.js.map

@@ -13,2 +13,21 @@ "use strict";

};
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
}) : (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;
};
var __rest = (this && this.__rest) || function (s, e) {

@@ -41,9 +60,2 @@ var t = {};

};
var __importStar = (this && this.__importStar) || function (mod) {
if (mod && mod.__esModule) return mod;
var result = {};
if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];
result["default"] = mod;
return result;
};
var __importDefault = (this && this.__importDefault) || function (mod) {

@@ -50,0 +62,0 @@ return (mod && mod.__esModule) ? mod : { "default": mod };

@@ -6,3 +6,3 @@ {

},
"version": "0.17.0-generator.2",
"version": "1.0.0-alpha.1",
"description": "View components for data display",

@@ -41,9 +41,9 @@ "keywords": [

"dependencies": {
"@frui.ts/data": "^0.17.0-generator.2",
"@frui.ts/helpers": "^0.17.0-generator.2",
"mobx-react-lite": "^2.0.6"
"@frui.ts/data": "^1.0.0-alpha.1",
"@frui.ts/helpers": "^1.0.0-alpha.1",
"mobx-react-lite": "^2.2.2"
},
"devDependencies": {
"@types/react": "^16.9.34",
"copyfiles": "^2.3.0"
"@types/react": "^16.14.2",
"copyfiles": "^2.4.1"
},

@@ -53,3 +53,3 @@ "peerDependencies": {

},
"gitHead": "826d4eeca379d5d758641e928e810b4ac5ee90c2"
"gitHead": "debcc8b7993b1b0708853dddb9d29dc2a5727477"
}

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc