@tsed/react-formio 1.10.14 → 1.11.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,5 +1,6 @@
1
- import { PropsWithChildren } from "react";
1
+ import React, { PropsWithChildren } from "react";
2
2
  export interface CardProps {
3
+ children: React.ReactNode;
3
4
  label: string;
4
5
  className?: string;
5
6
  }
@@ -1,16 +1,16 @@
1
- /// <reference types="react" />
2
1
  import PropTypes from "prop-types";
2
+ import { PropsWithChildren } from "react";
3
3
  export interface LoaderProps {
4
4
  isActive?: boolean;
5
5
  color?: string;
6
6
  icon?: string;
7
7
  className?: string;
8
8
  }
9
- export declare function Loader({ isActive, color, icon, className }: LoaderProps): JSX.Element;
9
+ export declare function Loader({ isActive, color, icon, className }: PropsWithChildren<LoaderProps>): JSX.Element;
10
10
  export declare namespace Loader {
11
11
  var propTypes: {
12
12
  isActive: PropTypes.Requireable<boolean>;
13
- icon: PropTypes.Requireable<boolean>;
13
+ icon: PropTypes.Requireable<string>;
14
14
  color: PropTypes.Requireable<string>;
15
15
  className: PropTypes.Requireable<string>;
16
16
  };
@@ -0,0 +1,15 @@
1
+ /// <reference types="react" />
2
+ import { Loader } from "./loader.component";
3
+ declare const _default: {
4
+ title: string;
5
+ component: typeof Loader;
6
+ argTypes: {};
7
+ parameters: {};
8
+ };
9
+ export default _default;
10
+ export declare const Sandbox: {
11
+ (args: any): JSX.Element;
12
+ args: {
13
+ isActive: boolean;
14
+ };
15
+ };
@@ -3,33 +3,6 @@ import { Pagination } from "./pagination.component";
3
3
  declare const _default: {
4
4
  title: string;
5
5
  component: typeof Pagination;
6
- argTypes: {
7
- pageSizes: {
8
- control: {
9
- type: string;
10
- };
11
- };
12
- pageCount: {
13
- control: {
14
- type: string;
15
- };
16
- };
17
- pageIndex: {
18
- control: {
19
- type: string;
20
- };
21
- };
22
- canPreviousPage: {
23
- control: {
24
- type: string;
25
- };
26
- };
27
- canNextPage: {
28
- control: {
29
- type: string;
30
- };
31
- };
32
- };
33
6
  parameters: {};
34
7
  };
35
8
  export default _default;
@@ -0,0 +1 @@
1
+ import "@testing-library/jest-dom/extend-expect";
package/dist/index.js CHANGED
@@ -1857,6 +1857,7 @@ function PaginationButton(props) {
1857
1857
  otherProps = _objectWithoutPropertiesLoose(props, ["component", "children", "disabled", "active"]);
1858
1858
 
1859
1859
  return React__default['default'].createElement(Component, Object.assign({}, otherProps, {
1860
+ "data-testid": 'pagination-button',
1860
1861
  disabled: disabled,
1861
1862
  className: classnames("page-link", disabled ? "disabled" : "", active ? "" : "", props.className)
1862
1863
  }), children);
@@ -1872,7 +1873,8 @@ function Pagination(props) {
1872
1873
  nextPage = props.nextPage,
1873
1874
  canNextPage = props.canNextPage,
1874
1875
  pageCount = props.pageCount,
1875
- pageIndex = props.pageIndex,
1876
+ _props$pageIndex = props.pageIndex,
1877
+ pageIndex = _props$pageIndex === void 0 ? 1 : _props$pageIndex,
1876
1878
  pageOptions = props.pageOptions,
1877
1879
  pageSize = props.pageSize,
1878
1880
  setPageSize = props.setPageSize,
@@ -3892,10 +3894,21 @@ function FormSettings(props) {
3892
3894
 
3893
3895
  function SelectColumnFilter(_ref) {
3894
3896
  var column = _ref.column;
3895
- var filterValue = column.filterValue,
3897
+ var id = column.id,
3898
+ preFilteredRows = column.preFilteredRows,
3899
+ filterValue = column.filterValue,
3896
3900
  setFilter = column.setFilter;
3897
- var _column$choices = column.choices,
3898
- choices = _column$choices === void 0 ? [] : _column$choices;
3901
+ var customChoices = column.choices;
3902
+ var choices = customChoices || [].concat(new Set(preFilteredRows.map(function (row) {
3903
+ return row.values[id];
3904
+ }))).filter(function (value) {
3905
+ return value;
3906
+ }).map(function (value) {
3907
+ return {
3908
+ label: value,
3909
+ value: value
3910
+ };
3911
+ });
3899
3912
  return React__default['default'].createElement(Select, {
3900
3913
  key: "filter-" + column.id,
3901
3914
  name: "filter-" + column.id,
@@ -9656,7 +9669,7 @@ function Loader(_ref) {
9656
9669
  }
9657
9670
  Loader.propTypes = {
9658
9671
  isActive: PropTypes__default['default'].bool,
9659
- icon: PropTypes__default['default'].bool,
9672
+ icon: PropTypes__default['default'].string,
9660
9673
  color: PropTypes__default['default'].string,
9661
9674
  className: PropTypes__default['default'].string
9662
9675
  };