@webiny/ui 5.39.0-beta.0 → 5.39.0-beta.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.
- package/Accordion/Accordion.d.ts +1 -1
- package/Accordion/Accordion.js.map +1 -1
- package/Accordion/AccordionItem.d.ts +2 -2
- package/Accordion/AccordionItem.js +1 -4
- package/Accordion/AccordionItem.js.map +1 -1
- package/Accordion/AccordionItemActions.d.ts +5 -1
- package/Accordion/AccordionItemActions.js.map +1 -1
- package/Alert/Alert.d.ts +1 -1
- package/Alert/Alert.js.map +1 -1
- package/AutoComplete/AutoComplete.js +1 -2
- package/AutoComplete/AutoComplete.js.map +1 -1
- package/AutoComplete/MultiAutoComplete.d.ts +1 -1
- package/AutoComplete/MultiAutoComplete.js +2 -2
- package/AutoComplete/MultiAutoComplete.js.map +1 -1
- package/AutoComplete/types.d.ts +3 -3
- package/AutoComplete/types.js.map +1 -1
- package/Avatar/Avatar.d.ts +7 -1
- package/Avatar/Avatar.js.map +1 -1
- package/Button/Button.d.ts +5 -6
- package/Button/Button.js.map +1 -1
- package/Button/CopyButton/CopyButton.d.ts +2 -2
- package/Button/CopyButton/CopyButton.js.map +1 -1
- package/Button/IconButton/IconButton.d.ts +2 -1
- package/Button/IconButton/IconButton.js.map +1 -1
- package/Checkbox/Checkbox.d.ts +0 -1
- package/Checkbox/Checkbox.js +1 -3
- package/Checkbox/Checkbox.js.map +1 -1
- package/Chips/Chip.d.ts +2 -2
- package/Chips/Chip.js.map +1 -1
- package/Chips/Chips.d.ts +1 -1
- package/Chips/Chips.js.map +1 -1
- package/ColorPicker/ColorPicker.js +1 -1
- package/ColorPicker/ColorPicker.js.map +1 -1
- package/ConfirmationDialog/ConfirmationDialog.js +20 -47
- package/ConfirmationDialog/ConfirmationDialog.js.map +1 -1
- package/ConfirmationDialog/withConfirmation.d.ts +2 -2
- package/ConfirmationDialog/withConfirmation.js.map +1 -1
- package/DataTable/ColumnDirection.d.ts +5 -0
- package/DataTable/ColumnDirection.js +20 -0
- package/DataTable/ColumnDirection.js.map +1 -0
- package/DataTable/ColumnsVisibility.d.ts +7 -0
- package/DataTable/ColumnsVisibility.js +65 -0
- package/DataTable/ColumnsVisibility.js.map +1 -0
- package/DataTable/DataTable.d.ts +16 -7
- package/DataTable/DataTable.js +87 -43
- package/DataTable/DataTable.js.map +1 -1
- package/DataTable/styled.d.ts +16 -3
- package/DataTable/styled.js +24 -6
- package/DataTable/styled.js.map +1 -1
- package/DateTime/Date.d.ts +7 -0
- package/DateTime/Date.js +41 -0
- package/DateTime/Date.js.map +1 -0
- package/DateTime/index.d.ts +1 -0
- package/DateTime/index.js +14 -0
- package/DateTime/index.js.map +1 -0
- package/DelayedOnChange/DelayedOnChange.d.ts +1 -2
- package/DelayedOnChange/DelayedOnChange.js.map +1 -1
- package/DelayedOnChange/withDelayedOnChange.d.ts +1 -1
- package/DelayedOnChange/withDelayedOnChange.js.map +1 -1
- package/Dialog/Dialog.d.ts +6 -7
- package/Dialog/Dialog.js.map +1 -1
- package/Drawer/Drawer.d.ts +6 -14
- package/Drawer/Drawer.js +31 -4
- package/Drawer/Drawer.js.map +1 -1
- package/DynamicFieldset/Fieldset.d.ts +3 -3
- package/DynamicFieldset/Fieldset.js.map +1 -1
- package/Icon/Icon.d.ts +2 -2
- package/Icon/Icon.js.map +1 -1
- package/Image/Image.d.ts +1 -2
- package/Image/Image.js.map +1 -1
- package/ImageEditor/ImageEditor.d.ts +3 -4
- package/ImageEditor/ImageEditor.js +26 -60
- package/ImageEditor/ImageEditor.js.map +1 -1
- package/ImageEditor/toolbar/filter.js +8 -8
- package/ImageEditor/toolbar/filter.js.map +1 -1
- package/ImageEditor/toolbar/rotate.js +11 -21
- package/ImageEditor/toolbar/rotate.js.map +1 -1
- package/ImageEditor/toolbar/types.d.ts +1 -2
- package/ImageEditor/toolbar/types.js.map +1 -1
- package/ImageUpload/Image.d.ts +2 -1
- package/ImageUpload/Image.js.map +1 -1
- package/ImageUpload/MultiImageUpload.d.ts +4 -2
- package/ImageUpload/MultiImageUpload.js +59 -132
- package/ImageUpload/MultiImageUpload.js.map +1 -1
- package/ImageUpload/SingleImageUpload.d.ts +4 -2
- package/ImageUpload/SingleImageUpload.js +14 -31
- package/ImageUpload/SingleImageUpload.js.map +1 -1
- package/ImageUpload/styled.d.ts +0 -2
- package/ImageUpload/styled.js +1 -2
- package/ImageUpload/styled.js.map +1 -1
- package/Input/Input.d.ts +7 -2
- package/Input/Input.js +15 -34
- package/Input/Input.js.map +1 -1
- package/Input/__tests__/Input.test.js +0 -2
- package/Input/__tests__/Input.test.js.map +1 -1
- package/List/CollapsibleList/index.d.ts +1 -1
- package/List/CollapsibleList/index.js.map +1 -1
- package/List/DataList/DataList.d.ts +31 -3
- package/List/DataList/DataList.js.map +1 -1
- package/List/DataList/DataList.stories.js +1 -1
- package/List/DataList/DataList.stories.js.map +1 -1
- package/List/DataList/DataListModalOverlay/DataListModalOverlay.d.ts +2 -2
- package/List/DataList/DataListModalOverlay/DataListModalOverlay.js +1 -1
- package/List/DataList/DataListModalOverlay/DataListModalOverlay.js.map +1 -1
- package/List/DataList/DataListModalOverlay/DataListModalOverlayAction.d.ts +1 -1
- package/List/DataList/DataListModalOverlay/DataListModalOverlayAction.js.map +1 -1
- package/List/DataList/DataListModalOverlay/DataListModalOverlayContext.d.ts +1 -1
- package/List/DataList/DataListModalOverlay/DataListModalOverlayContext.js.map +1 -1
- package/List/DataList/DataListWithSections.d.ts +31 -3
- package/List/DataList/DataListWithSections.js.map +1 -1
- package/List/DataList/NoData.d.ts +2 -2
- package/List/DataList/NoData.js.map +1 -1
- package/List/DataList/types.d.ts +6 -6
- package/List/DataList/types.js.map +1 -1
- package/List/List.d.ts +0 -1
- package/Menu/Menu.d.ts +2 -2
- package/Menu/Menu.js +1 -1
- package/Menu/Menu.js.map +1 -1
- package/Mosaic/Mosaic.d.ts +12 -1
- package/Mosaic/Mosaic.js +1 -1
- package/Mosaic/Mosaic.js.map +1 -1
- package/Progress/CircularProgress.d.ts +9 -1
- package/Progress/CircularProgress.js.map +1 -1
- package/Radio/Radio.d.ts +0 -1
- package/Radio/Radio.js +1 -3
- package/Radio/Radio.js.map +1 -1
- package/RichTextEditor/RichTextEditor.d.ts +2 -2
- package/RichTextEditor/RichTextEditor.js +10 -36
- package/RichTextEditor/RichTextEditor.js.map +1 -1
- package/Ripple/Ripple.d.ts +2 -1
- package/Ripple/Ripple.js.map +1 -1
- package/Scrollbar/Scrollbar.d.ts +1 -1
- package/Scrollbar/Scrollbar.js.map +1 -1
- package/Section/index.d.ts +3 -2
- package/Section/index.js.map +1 -1
- package/Select/Select.d.ts +5 -3
- package/Select/Select.js +1 -1
- package/Select/Select.js.map +1 -1
- package/Slider/Slider.d.ts +1 -1
- package/Slider/Slider.js.map +1 -1
- package/Snackbar/Snackbar.d.ts +0 -1
- package/Switch/Switch.d.ts +0 -1
- package/Switch/Switch.js.map +1 -1
- package/Tabs/Tab.d.ts +1 -1
- package/Tabs/Tab.js +1 -2
- package/Tabs/Tab.js.map +1 -1
- package/Tabs/Tabs.js +1 -2
- package/Tabs/Tabs.js.map +1 -1
- package/Tabs/Tabs.stories.js.map +1 -1
- package/Tags/Tags.d.ts +4 -4
- package/Tags/Tags.js.map +1 -1
- package/Tooltip/Tooltip.js +1 -1
- package/Tooltip/Tooltip.js.map +1 -1
- package/Typography/Typography.d.ts +1 -1
- package/Typography/Typography.js.map +1 -1
- package/package.json +7 -7
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_react","_interopRequireWildcard","require","_dataTable","_reactTable","_Checkbox","_Skeleton","_styled","defineColumns","columns","options","canSelectAllRows","onSelectRow","onToggleRow","loadingInitial","useMemo","columnsList","Object","keys","map","key","_objectSpread3","default","id","defaults","column","cell","className","_column$enableResizin","enableResizing","_column$enableSorting","enableSorting","header","meta","_column$size","size","accessorKey","info","row","original","getValue","isSelectable","select","_ref","table","createElement","Checkbox","indeterminate","getIsSomeRowsSelected","value","getIsAllRowsSelected","onChange","e","toggleAllPageRowsSelected","getCanSelect","Fragment","getIsSomeSelected","getIsSelected","getToggleSelectedHandler","hasFormControl","concat","_toConsumableArray2","Skeleton","defineData","data","Array","fill","ColumnDirection","_ref2","direction","ColumnDirectionWrapper","ColumnDirectionIcon","typedMemo","memo","TableCell","_ref3","DataTableCell","assign","columnDef","style","width","getSize","flexRender","getContext","MemoTableCell","TableRow","_ref4","selected","DataTableRow","getVisibleCells","MemoTableRow","DataTable","_ref5","stickyColumns","stickyRows","bordered","sorting","onSortingChange","isRowSelectable","_ref5$canSelectAllRow","_ref5$selectedRows","selectedRows","initialSorting","rowSelection","reduce","acc","item","recordIndex","findIndex","rec","_defineProperty2","onRowSelectionChange","updater","newSelection","toggledRows","filter","x","length","parseInt","selection","tableSorting","isArray","useReactTable","enableColumnResizing","columnResizeMode","getCoreRowModel","getSortedRowModel","state","enableRowSelection","manualSorting","Table","DataTableContent","DataTableHead","getHeaderGroups","headerGroup","headers","_ref6","isPlaceholder","colSpan","getResizeHandler","TableHeadCell","ColumnHeaderWrapper","onClick","getToggleSortingHandler","sortable","getCanSort","getIsSorted","undefined","getCanResize","Resizer","onMouseDown","onTouchStart","isResizing","getIsResizing","DataTableBody","getRowModel","rows","exports"],"sources":["DataTable.tsx"],"sourcesContent":["import React, { memo, ReactElement, useMemo } from \"react\";\n\nimport {\n DataTableContent,\n DataTableHead,\n DataTableRow,\n DataTableBody,\n DataTableCell,\n DataTableCellProps\n} from \"@rmwc/data-table\";\n\nimport {\n flexRender,\n getCoreRowModel,\n useReactTable,\n ColumnDef,\n getSortedRowModel,\n OnChangeFn,\n SortingState,\n RowSelectionState,\n Row,\n Cell\n} from \"@tanstack/react-table\";\n\nimport { Checkbox } from \"~/Checkbox\";\nimport { Skeleton } from \"~/Skeleton\";\n\nimport \"@rmwc/data-table/data-table.css\";\nimport {\n ColumnDirectionIcon,\n ColumnDirectionWrapper,\n ColumnHeaderWrapper,\n Resizer,\n Table,\n TableHeadCell\n} from \"./styled\";\n\ninterface Column<T> {\n /*\n * Column header component.\n */\n header: string | number | JSX.Element;\n /*\n * Cell renderer, receives the full row and returns the value to render inside the cell.\n */\n cell?: (row: T) => string | number | JSX.Element | null;\n /*\n * Additional props to add to both header and row cells. Refer to RMWC documentation.\n */\n meta?: DataTableCellProps;\n /*\n * Column size.\n */\n size?: number;\n /*\n * Column class names.\n */\n className?: string;\n /*\n * Enable column sorting.\n */\n enableSorting?: boolean;\n /*\n * Enable column resizing.\n */\n enableResizing?: boolean;\n}\n\nexport type Columns<T> = {\n [P in keyof T]?: Column<T>;\n};\n\nexport type DefaultData = {\n id: string;\n /*\n * Define if a specific row can be selected.\n */\n selectable?: boolean;\n};\n\nexport type Sorting = SortingState;\n\nexport type OnSortingChange = OnChangeFn<Sorting>;\n\ninterface Props<T> {\n /**\n * Show or hide borders.\n */\n bordered?: boolean;\n /**\n * Controls whether \"select all\" action is allowed.\n */\n canSelectAllRows?: boolean;\n /**\n * Columns definition.\n */\n columns: Columns<T>;\n /**\n * Data to display into DataTable body.\n */\n data: T[];\n /**\n * Callback that is called to determine if the row is selectable.\n */\n isRowSelectable?: (row: Row<T>) => boolean;\n /**\n * Render the skeleton state at the initial data loading.\n */\n loadingInitial?: boolean;\n /**\n * Callback that receives the selected rows.\n */\n onSelectRow?: (rows: T[]) => void;\n /**\n * Callback that receives the toggled row.\n */\n onToggleRow?: (row: T) => void;\n /**\n * Callback that receives current sorting state.\n */\n onSortingChange?: OnSortingChange;\n /**\n * Selected rows.\n */\n selectedRows?: T[];\n /**\n * Sorting state.\n */\n sorting?: Sorting;\n /**\n * Initial sorting state.\n */\n initialSorting?: Sorting;\n /**\n * The number of columns to affix to the side of the table when scrolling.\n */\n stickyColumns?: number;\n /**\n * The number of rows to affix to the top of the table when scrolling.\n */\n stickyRows?: number;\n}\n\nexport interface ColumnDirectionProps {\n direction?: \"asc\" | \"desc\";\n}\n\ninterface DefineColumnsOptions<T> {\n canSelectAllRows: boolean;\n onSelectRow?: Props<T>[\"onSelectRow\"];\n onToggleRow: Props<T>[\"onToggleRow\"];\n loadingInitial: Props<T>[\"loadingInitial\"];\n}\n\nconst defineColumns = <T,>(\n columns: Props<T>[\"columns\"],\n options: DefineColumnsOptions<T>\n): ColumnDef<T>[] => {\n const { canSelectAllRows, onSelectRow, onToggleRow, loadingInitial } = options;\n\n return useMemo(() => {\n const columnsList = Object.keys(columns).map(key => ({\n id: key,\n ...columns[key as keyof typeof columns]\n }));\n\n const defaults: ColumnDef<T>[] = columnsList.map(column => {\n const {\n cell,\n className,\n enableResizing = true,\n enableSorting = false,\n header,\n id,\n meta,\n size = 200\n } = column;\n\n return {\n accessorKey: id,\n header: () => header,\n cell: info => {\n if (cell && typeof cell === \"function\") {\n return cell(info.row.original);\n } else {\n return info.getValue();\n }\n },\n enableSorting,\n meta: {\n ...meta,\n className\n },\n enableResizing,\n size\n };\n });\n\n const isSelectable = onToggleRow || onSelectRow;\n\n const select: ColumnDef<T>[] = isSelectable\n ? [\n {\n id: \"datatable-select-column\",\n header: ({ table }) => {\n if (!canSelectAllRows) {\n return null;\n }\n\n return (\n !loadingInitial && (\n <Checkbox\n indeterminate={table.getIsSomeRowsSelected()}\n value={table.getIsAllRowsSelected()}\n onChange={e => table.toggleAllPageRowsSelected(e)}\n />\n )\n );\n },\n cell: info => {\n if (!info.row.getCanSelect()) {\n return <></>;\n }\n return (\n <Checkbox\n indeterminate={info.row.getIsSomeSelected()}\n value={info.row.getIsSelected()}\n onChange={info.row.getToggleSelectedHandler()}\n />\n );\n },\n meta: {\n hasFormControl: true\n },\n enableSorting: false,\n enableResizing: false,\n size: 56\n }\n ]\n : [];\n\n return [...select, ...defaults].map(column => {\n if (loadingInitial) {\n return {\n ...column,\n cell: () => <Skeleton />\n };\n }\n\n return column;\n });\n }, [columns, onSelectRow, onToggleRow, loadingInitial]);\n};\n\nconst defineData = <T,>(\n data: Props<T>[\"data\"],\n loadingInitial: Props<T>[\"loadingInitial\"]\n): T[] => {\n return useMemo(() => {\n if (loadingInitial) {\n return Array(10).fill({});\n }\n return data;\n }, [data, loadingInitial]);\n};\n\nconst ColumnDirection = ({ direction }: ColumnDirectionProps): ReactElement | null => {\n if (direction) {\n return (\n <ColumnDirectionWrapper>\n <ColumnDirectionIcon direction={direction} />\n </ColumnDirectionWrapper>\n );\n }\n\n return null;\n};\n\nconst typedMemo: <T>(component: T) => T = memo;\n\ninterface TableCellProps<T> {\n cell: Cell<T, unknown>;\n}\n\nconst TableCell = <T,>({ cell }: TableCellProps<T>) => (\n <DataTableCell {...cell.column.columnDef.meta} style={{ width: cell.column.getSize() }}>\n {flexRender(cell.column.columnDef.cell, cell.getContext())}\n </DataTableCell>\n);\n\nconst MemoTableCell = typedMemo(TableCell);\n\ninterface TableRowProps<T> {\n row: Row<T>;\n selected: boolean;\n}\n\nconst TableRow = <T,>({ row, selected }: TableRowProps<T>) => {\n return (\n <DataTableRow selected={selected}>\n {row.getVisibleCells().map(cell => (\n <MemoTableCell<T> key={cell.id} cell={cell} />\n ))}\n </DataTableRow>\n );\n};\n\nconst MemoTableRow = typedMemo(TableRow);\n\nexport const DataTable = <T extends Object & DefaultData>({\n data,\n columns,\n onSelectRow,\n onToggleRow,\n loadingInitial,\n stickyColumns,\n stickyRows,\n bordered,\n sorting,\n onSortingChange,\n isRowSelectable,\n canSelectAllRows = true,\n selectedRows = [],\n initialSorting\n}: Props<T>) => {\n const rowSelection = useMemo(() => {\n return selectedRows.reduce<RowSelectionState>((acc, item) => {\n const recordIndex = data.findIndex(rec => rec.id === item.id);\n return { ...acc, [recordIndex]: true };\n }, {});\n }, [selectedRows, data]);\n\n const onRowSelectionChange: OnChangeFn<RowSelectionState> = updater => {\n const newSelection = typeof updater === \"function\" ? updater(rowSelection) : updater;\n\n /**\n * `@tanstack/react-table` isn't telling us what row was selected or deselected. It simply gives us\n * the new selection state (an object with row indexes that are currently selected).\n *\n * To figure out what row was toggled, we need to calculate the difference between the old selection\n * and the new selection. What we're doing here is:\n * - find all items that were present in the previous selection, but are no longer present in the new selection\n * - find all items that are present in the new selection, but were not present in the previous selection\n */\n const toggledRows = [\n ...Object.keys(rowSelection).filter(x => !(x in newSelection)),\n ...Object.keys(newSelection).filter(x => !(x in rowSelection))\n ];\n\n // If the difference is only 1 item, and `onToggleRow` is available, execute that.\n if (toggledRows.length === 1 && typeof onToggleRow === \"function\") {\n onToggleRow(data[parseInt(toggledRows[0])]);\n return;\n } else if (typeof onSelectRow === \"function\") {\n const selection = Object.keys(newSelection).map(key => data[parseInt(key)]);\n onSelectRow(selection);\n }\n };\n\n const tableSorting = useMemo(() => {\n if (!Array.isArray(sorting) || !sorting.length) {\n return initialSorting;\n }\n return sorting;\n }, [sorting]);\n\n const table = useReactTable({\n data: defineData(data, loadingInitial),\n columns: defineColumns(columns, {\n canSelectAllRows,\n onSelectRow,\n onToggleRow,\n loadingInitial\n }),\n enableColumnResizing: true,\n columnResizeMode: \"onChange\",\n getCoreRowModel: getCoreRowModel(),\n getSortedRowModel: getSortedRowModel(),\n state: {\n rowSelection,\n sorting: tableSorting\n },\n enableRowSelection: isRowSelectable,\n onRowSelectionChange,\n enableSorting: !!onSortingChange,\n manualSorting: true,\n onSortingChange\n });\n\n return (\n <Table stickyColumns={stickyColumns} stickyRows={stickyRows} bordered={bordered}>\n <DataTableContent>\n <DataTableHead>\n {table.getHeaderGroups().map(headerGroup => (\n <DataTableRow key={headerGroup.id}>\n {headerGroup.headers.map(\n ({\n id,\n isPlaceholder,\n column,\n getContext,\n colSpan,\n getSize,\n getResizeHandler\n }) => (\n <TableHeadCell\n key={id}\n {...column.columnDef.meta}\n colSpan={colSpan}\n style={{ width: getSize() }}\n >\n {isPlaceholder ? null : (\n <ColumnHeaderWrapper\n onClick={column.getToggleSortingHandler()}\n sortable={column.getCanSort()}\n >\n {flexRender(column.columnDef.header, getContext())}\n <ColumnDirection\n direction={column.getIsSorted() || undefined}\n />\n </ColumnHeaderWrapper>\n )}\n {column.getCanResize() && (\n <Resizer\n onMouseDown={getResizeHandler()}\n onTouchStart={getResizeHandler()}\n isResizing={column.getIsResizing()}\n />\n )}\n </TableHeadCell>\n )\n )}\n </DataTableRow>\n ))}\n </DataTableHead>\n <DataTableBody>\n {table.getRowModel().rows.map(row => (\n <MemoTableRow<T>\n key={row.original.id || row.id}\n row={row}\n selected={row.getIsSelected()}\n />\n ))}\n </DataTableBody>\n </DataTableContent>\n </Table>\n );\n};\n"],"mappings":";;;;;;;;;;;AAAA,IAAAA,MAAA,GAAAC,uBAAA,CAAAC,OAAA;AAEA,IAAAC,UAAA,GAAAD,OAAA;AASA,IAAAE,WAAA,GAAAF,OAAA;AAaA,IAAAG,SAAA,GAAAH,OAAA;AACA,IAAAI,SAAA,GAAAJ,OAAA;AAEAA,OAAA;AACA,IAAAK,OAAA,GAAAL,OAAA;AA8HA,IAAMM,aAAa,GAAG,SAAhBA,aAAaA,CACfC,OAA4B,EAC5BC,OAAgC,EACf;EACjB,IAAQC,gBAAgB,GAA+CD,OAAO,CAAtEC,gBAAgB;IAAEC,WAAW,GAAkCF,OAAO,CAApDE,WAAW;IAAEC,WAAW,GAAqBH,OAAO,CAAvCG,WAAW;IAAEC,cAAc,GAAKJ,OAAO,CAA1BI,cAAc;EAElE,OAAO,IAAAC,cAAO,EAAC,YAAM;IACjB,IAAMC,WAAW,GAAGC,MAAM,CAACC,IAAI,CAACT,OAAO,CAAC,CAACU,GAAG,CAAC,UAAAC,GAAG;MAAA,WAAAC,cAAA,CAAAC,OAAA;QAC5CC,EAAE,EAAEH;MAAG,GACJX,OAAO,CAACW,GAAG,CAAyB;IAAA,CACzC,CAAC;IAEH,IAAMI,QAAwB,GAAGR,WAAW,CAACG,GAAG,CAAC,UAAAM,MAAM,EAAI;MACvD,IACIC,KAAI,GAQJD,MAAM,CARNC,IAAI;QACJC,SAAS,GAOTF,MAAM,CAPNE,SAAS;QAAAC,qBAAA,GAOTH,MAAM,CANNI,cAAc;QAAdA,cAAc,GAAAD,qBAAA,cAAG,IAAI,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,aAAa,CAAC;IAAE,CACjC,CAAC;EAAA,CACL,CACU,CACD,CACf,CAAC;AAEhB,CAAC;AAACoG,OAAA,CAAAlE,SAAA,GAAAA,SAAA"}
|
|
1
|
+
{"version":3,"names":["_react","_interopRequireWildcard","require","_dataTable","_reactTable","_Checkbox","_Skeleton","_ColumnsVisibility","_styled","defineColumns","columns","options","canSelectAllRows","onSelectRow","onToggleRow","loadingInitial","useMemo","columnsList","Object","keys","map","key","_objectSpread3","default","id","defaults","column","cell","className","_column$enableHiding","enableHiding","_column$enableResizin","enableResizing","_column$enableSorting","enableSorting","header","meta","_column$size","size","accessorKey","info","row","original","getValue","isSelectable","select","_ref","table","createElement","Checkbox","indeterminate","getIsSomeRowsSelected","value","getIsAllRowsSelected","onChange","e","toggleAllPageRowsSelected","getCanSelect","Fragment","getIsSomeSelected","getIsSelected","getToggleSelectedHandler","hasFormControl","concat","_toConsumableArray2","Skeleton","defineData","data","Array","fill","ColumnDirection","_ref2","direction","ColumnDirectionWrapper","ColumnDirectionIcon","typedMemo","memo","TableCell","_ref3","getColumnWidth","width","DataTableCell","assign","columnDef","style","maxWidth","flexRender","getContext","MemoTableCell","TableRow","_ref4","selected","cells","DataTableRow","MemoTableRow","DataTable","_ref5","stickyColumns","stickyRows","bordered","sorting","columnVisibility","onColumnVisibilityChange","onSortingChange","isRowSelectable","_ref5$canSelectAllRow","_ref5$selectedRows","selectedRows","initialSorting","tableRef","useRef","_useState","useState","_useState2","_slicedToArray2","tableWidth","setTableWidth","useEffect","updateElementWidth","current","clientWidth","window","addEventListener","removeEventListener","rowSelection","reduce","acc","item","recordIndex","findIndex","rec","_defineProperty2","onRowSelectionChange","updater","newSelection","toggledRows","filter","x","length","parseInt","selection","tableSorting","isArray","useReactTable","enableColumnResizing","columnResizeMode","getCoreRowModel","getSortedRowModel","state","enableRowSelection","manualSorting","useCallback","getCanResize","getSize","tableSize","getTotalSize","columnSize","Math","ceil","ref","Table","DataTableContent","DataTableHead","getHeaderGroups","headerGroup","headers","index","isLastCell","TableHeadCell","colSpan","isPlaceholder","ColumnHeaderWrapper","onClick","getToggleSortingHandler","sortable","getCanSort","getIsSorted","undefined","ColumnsVisibility","getAllColumns","Resizer","onMouseDown","getResizeHandler","onTouchStart","isResizing","getIsResizing","DataTableBody","getRowModel","rows","getVisibleCells","exports"],"sources":["DataTable.tsx"],"sourcesContent":["import React, {\n ReactElement,\n memo,\n useCallback,\n useEffect,\n useMemo,\n useRef,\n useState\n} from \"react\";\n\nimport {\n DataTableBody,\n DataTableCellProps,\n DataTableContent,\n DataTableHead,\n DataTableRow\n} from \"@rmwc/data-table\";\n\nimport {\n Cell,\n Column as DefaultColumn,\n ColumnDef,\n OnChangeFn,\n Row,\n RowSelectionState,\n SortingState,\n VisibilityState,\n flexRender,\n getCoreRowModel,\n getSortedRowModel,\n useReactTable\n} from \"@tanstack/react-table\";\n\nimport { Checkbox } from \"~/Checkbox\";\nimport { Skeleton } from \"~/Skeleton\";\nimport { ColumnDirectionProps } from \"~/DataTable/ColumnDirection\";\nimport { ColumnsVisibility } from \"~/DataTable/ColumnsVisibility\";\n\nimport \"@rmwc/data-table/data-table.css\";\nimport {\n ColumnDirectionIcon,\n ColumnDirectionWrapper,\n ColumnHeaderWrapper,\n DataTableCell,\n Resizer,\n Table,\n TableHeadCell\n} from \"./styled\";\n\nexport interface Column<T> {\n /*\n * Column header component.\n */\n header: string | number | JSX.Element;\n /*\n * Cell renderer, receives the full row and returns the value to render inside the cell.\n */\n cell?: (row: T) => string | number | JSX.Element | null;\n /*\n * Additional props to add to both header and row cells. Refer to RMWC documentation.\n */\n meta?: DataTableCellProps;\n /*\n * Column size.\n */\n size?: number;\n /*\n * Column class names.\n */\n className?: string;\n /*\n * Enable column sorting.\n */\n enableSorting?: boolean;\n /*\n * Enable column resizing.\n */\n enableResizing?: boolean;\n /*\n * Enable column visibility toggling.\n */\n enableHiding?: boolean;\n}\n\nexport type Columns<T> = {\n [P in keyof T]?: Column<T>;\n};\n\nexport type DefaultData = {\n id: string;\n /*\n * Define if a specific row can be selected.\n */\n $selectable?: boolean;\n};\n\nexport type TableRow<T> = Row<DefaultData & T>;\n\nexport type Sorting = SortingState;\n\nexport type OnSortingChange = OnChangeFn<Sorting>;\n\nexport type ColumnVisibility = VisibilityState;\n\nexport type OnColumnVisibilityChange = OnChangeFn<ColumnVisibility>;\n\ninterface Props<T> {\n /**\n * Show or hide borders.\n */\n bordered?: boolean;\n /**\n * Controls whether \"select all\" action is allowed.\n */\n canSelectAllRows?: boolean;\n /**\n * Columns definition.\n */\n columns: Columns<T>;\n /**\n * The column visibility state.\n */\n columnVisibility?: ColumnVisibility;\n /**\n * Callback that receives current column visibility state.\n */\n onColumnVisibilityChange?: OnColumnVisibilityChange;\n /**\n * Data to display into DataTable body.\n */\n data: T[];\n /**\n * Callback that is called to determine if the row is selectable.\n */\n isRowSelectable?: (row: Row<T>) => boolean;\n /**\n * Render the skeleton state at the initial data loading.\n */\n loadingInitial?: boolean;\n /**\n * Callback that receives the selected rows.\n */\n onSelectRow?: (rows: T[]) => void;\n /**\n * Callback that receives the toggled row.\n */\n onToggleRow?: (row: T) => void;\n /**\n * Callback that receives current sorting state.\n */\n onSortingChange?: OnSortingChange;\n /**\n * Selected rows.\n */\n selectedRows?: T[];\n /**\n * Sorting state.\n */\n sorting?: Sorting;\n /**\n * Initial sorting state.\n */\n initialSorting?: Sorting;\n /**\n * The number of columns to affix to the side of the table when scrolling.\n */\n stickyColumns?: number;\n /**\n * The number of rows to affix to the top of the table when scrolling.\n */\n stickyRows?: number;\n}\n\ninterface DefineColumnsOptions<T> {\n canSelectAllRows: boolean;\n onSelectRow?: Props<T>[\"onSelectRow\"];\n onToggleRow: Props<T>[\"onToggleRow\"];\n loadingInitial: Props<T>[\"loadingInitial\"];\n}\n\nconst defineColumns = <T,>(\n columns: Props<T>[\"columns\"],\n options: DefineColumnsOptions<T>\n): ColumnDef<T>[] => {\n const { canSelectAllRows, onSelectRow, onToggleRow, loadingInitial } = options;\n\n return useMemo(() => {\n const columnsList = Object.keys(columns).map(key => ({\n id: key,\n ...columns[key as keyof typeof columns]\n }));\n\n const defaults: ColumnDef<T>[] = columnsList.map(column => {\n const {\n cell,\n className,\n enableHiding = true,\n enableResizing = true,\n enableSorting = false,\n header,\n id,\n meta,\n size = 100\n } = column;\n\n return {\n id,\n accessorKey: id,\n header: () => header,\n cell: info => {\n if (cell && typeof cell === \"function\") {\n return cell(info.row.original);\n } else {\n return info.getValue() || null;\n }\n },\n enableSorting,\n meta: {\n ...meta,\n className\n },\n enableResizing,\n size,\n enableHiding\n };\n });\n\n const isSelectable = onToggleRow || onSelectRow;\n\n const select: ColumnDef<T>[] = isSelectable\n ? [\n {\n id: \"datatable-select-column\",\n header: ({ table }) => {\n if (!canSelectAllRows) {\n return null;\n }\n\n return (\n !loadingInitial && (\n <Checkbox\n indeterminate={table.getIsSomeRowsSelected()}\n value={table.getIsAllRowsSelected()}\n onChange={e => table.toggleAllPageRowsSelected(e)}\n />\n )\n );\n },\n cell: info => {\n if (!info.row.getCanSelect()) {\n return <></>;\n }\n return (\n <Checkbox\n indeterminate={info.row.getIsSomeSelected()}\n value={info.row.getIsSelected()}\n onChange={info.row.getToggleSelectedHandler()}\n />\n );\n },\n meta: {\n hasFormControl: true\n },\n enableSorting: false,\n enableResizing: false,\n enableHiding: false,\n size: 56\n }\n ]\n : [];\n\n return [...select, ...defaults].map(column => {\n if (loadingInitial) {\n return {\n ...column,\n cell: () => <Skeleton />\n };\n }\n\n return column;\n });\n }, [columns, onSelectRow, onToggleRow, loadingInitial]);\n};\n\nconst defineData = <T,>(\n data: Props<T>[\"data\"],\n loadingInitial: Props<T>[\"loadingInitial\"]\n): T[] => {\n if (loadingInitial) {\n return Array(10).fill({});\n }\n return data;\n};\n\nconst ColumnDirection = ({ direction }: ColumnDirectionProps): ReactElement | null => {\n if (direction) {\n return (\n <ColumnDirectionWrapper>\n <ColumnDirectionIcon direction={direction} />\n </ColumnDirectionWrapper>\n );\n }\n\n return null;\n};\n\nconst typedMemo: <T>(component: T) => T = memo;\n\ninterface TableCellProps<T> {\n cell: Cell<T, unknown>;\n getColumnWidth: (column: DefaultColumn<T>) => number;\n selected: boolean;\n}\n\nconst TableCell = <T,>({ cell, getColumnWidth }: TableCellProps<T>) => {\n const width = getColumnWidth(cell.column);\n\n return (\n <DataTableCell {...cell.column.columnDef.meta} style={{ width, maxWidth: width }}>\n {flexRender(cell.column.columnDef.cell, cell.getContext())}\n </DataTableCell>\n );\n};\n\nconst MemoTableCell = typedMemo(TableCell);\n\ninterface TableRowProps<T> {\n selected: boolean;\n cells: Cell<T, unknown>[];\n getColumnWidth: (column: DefaultColumn<T>) => number;\n}\n\nconst TableRow = <T,>({ selected, cells, getColumnWidth }: TableRowProps<T>) => {\n return (\n <DataTableRow selected={selected}>\n {cells.map(cell => (\n <MemoTableCell<T>\n key={cell.id}\n cell={cell}\n getColumnWidth={getColumnWidth}\n selected={selected}\n />\n ))}\n </DataTableRow>\n );\n};\n\nconst MemoTableRow = typedMemo(TableRow);\n\nexport const DataTable = <T extends Record<string, any> & DefaultData>({\n data,\n columns,\n onSelectRow,\n onToggleRow,\n loadingInitial,\n stickyColumns,\n stickyRows,\n bordered,\n sorting,\n columnVisibility,\n onColumnVisibilityChange,\n onSortingChange,\n isRowSelectable,\n canSelectAllRows = true,\n selectedRows = [],\n initialSorting\n}: Props<T>) => {\n const tableRef = useRef<HTMLDivElement>(null);\n const [tableWidth, setTableWidth] = useState(1);\n\n useEffect(() => {\n const updateElementWidth = () => {\n if (tableRef.current) {\n const width = tableRef.current.clientWidth;\n setTableWidth(width);\n }\n };\n\n updateElementWidth();\n\n window.addEventListener(\"resize\", updateElementWidth);\n\n return () => {\n window.removeEventListener(\"resize\", updateElementWidth);\n };\n }, [tableRef.current]);\n\n const rowSelection = useMemo(() => {\n return selectedRows.reduce<RowSelectionState>((acc, item) => {\n const recordIndex = data.findIndex(rec => rec.id === item.id);\n return { ...acc, [recordIndex]: true };\n }, {});\n }, [selectedRows, data]);\n\n const onRowSelectionChange: OnChangeFn<RowSelectionState> = updater => {\n const newSelection = typeof updater === \"function\" ? updater(rowSelection) : updater;\n\n /**\n * `@tanstack/react-table` isn't telling us what row was selected or deselected. It simply gives us\n * the new selection state (an object with row indexes that are currently selected).\n *\n * To figure out what row was toggled, we need to calculate the difference between the old selection\n * and the new selection. What we're doing here is:\n * - find all items that were present in the previous selection, but are no longer present in the new selection\n * - find all items that are present in the new selection, but were not present in the previous selection\n */\n const toggledRows = [\n ...Object.keys(rowSelection).filter(x => !(x in newSelection)),\n ...Object.keys(newSelection).filter(x => !(x in rowSelection))\n ];\n\n // If the difference is only 1 item, and `onToggleRow` is available, execute that.\n if (toggledRows.length === 1 && typeof onToggleRow === \"function\") {\n onToggleRow(data[parseInt(toggledRows[0])]);\n return;\n } else if (typeof onSelectRow === \"function\") {\n const selection = Object.keys(newSelection).map(key => data[parseInt(key)]);\n onSelectRow(selection);\n }\n };\n\n const tableSorting = useMemo(() => {\n if (!Array.isArray(sorting) || !sorting.length) {\n return initialSorting;\n }\n return sorting;\n }, [sorting]);\n\n const table = useReactTable({\n data: defineData(data, loadingInitial),\n columns: defineColumns(columns, {\n canSelectAllRows,\n onSelectRow,\n onToggleRow,\n loadingInitial\n }),\n enableColumnResizing: true,\n columnResizeMode: \"onChange\",\n getCoreRowModel: getCoreRowModel(),\n getSortedRowModel: getSortedRowModel(),\n state: {\n rowSelection,\n sorting: tableSorting,\n columnVisibility\n },\n enableRowSelection: isRowSelectable,\n onRowSelectionChange,\n enableSorting: !!onSortingChange,\n manualSorting: true,\n onSortingChange,\n enableHiding: !!onColumnVisibilityChange,\n onColumnVisibilityChange\n });\n\n const getColumnWidth = useCallback(\n (column: DefaultColumn<T>): number => {\n if (!column.getCanResize()) {\n return column.getSize();\n }\n\n const tableSize = table.getTotalSize();\n const columnSize = column.getSize();\n\n return Math.ceil((columnSize * tableWidth) / tableSize);\n },\n [table, tableWidth]\n );\n\n return (\n <div ref={tableRef}>\n <Table stickyColumns={stickyColumns} stickyRows={stickyRows} bordered={bordered}>\n <DataTableContent>\n <DataTableHead>\n {table.getHeaderGroups().map(headerGroup => (\n <DataTableRow key={headerGroup.id}>\n {headerGroup.headers.map((header, index) => {\n const isLastCell = index === headerGroup.headers.length - 1;\n const width = getColumnWidth(header.column);\n\n return (\n <TableHeadCell\n key={header.id}\n {...header.column.columnDef.meta}\n colSpan={header.colSpan}\n style={{ width, maxWidth: width }}\n >\n {header.isPlaceholder ? null : (\n <ColumnHeaderWrapper\n onClick={header.column.getToggleSortingHandler()}\n sortable={header.column.getCanSort()}\n isLastCell={isLastCell}\n >\n {flexRender(\n header.column.columnDef.header,\n header.getContext()\n )}\n <ColumnDirection\n direction={\n header.column.getIsSorted() || undefined\n }\n />\n {isLastCell && (\n <ColumnsVisibility\n columns={table.getAllColumns()}\n />\n )}\n </ColumnHeaderWrapper>\n )}\n {header.column.getCanResize() && (\n <Resizer\n onMouseDown={header.getResizeHandler()}\n onTouchStart={header.getResizeHandler()}\n isResizing={header.column.getIsResizing()}\n />\n )}\n </TableHeadCell>\n );\n })}\n </DataTableRow>\n ))}\n </DataTableHead>\n <DataTableBody>\n {table.getRowModel().rows.map(row => (\n <MemoTableRow<T>\n key={row.original.id || row.id}\n cells={row.getVisibleCells()}\n selected={row.getIsSelected()}\n getColumnWidth={getColumnWidth}\n />\n ))}\n </DataTableBody>\n </DataTableContent>\n </Table>\n </div>\n );\n};\n"],"mappings":";;;;;;;;;;;;AAAA,IAAAA,MAAA,GAAAC,uBAAA,CAAAC,OAAA;AAUA,IAAAC,UAAA,GAAAD,OAAA;AAQA,IAAAE,WAAA,GAAAF,OAAA;AAeA,IAAAG,SAAA,GAAAH,OAAA;AACA,IAAAI,SAAA,GAAAJ,OAAA;AAEA,IAAAK,kBAAA,GAAAL,OAAA;AAEAA,OAAA;AACA,IAAAM,OAAA,GAAAN,OAAA;AA6IA,IAAMO,aAAa,GAAG,SAAhBA,aAAaA,CACfC,OAA4B,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GAAG,EAAEoB,GAAG,CAACC,QAAQ,CAAClB,EAAE,IAAIiB,GAAG,CAACjB,EAAG;MAC/BoE,KAAK,EAAEnD,GAAG,CAACoJ,eAAe,CAAC,CAAE;MAC7BlG,QAAQ,EAAElD,GAAG,CAACmB,aAAa,CAAC,CAAE;MAC9BmB,cAAc,EAAEA;IAAe,CAClC,CAAC;EAAA,CACL,CACU,CACD,CACf,CACN,CAAC;AAEd,CAAC;AAAC+G,OAAA,CAAA/F,SAAA,GAAAA,SAAA"}
|
package/DataTable/styled.d.ts
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
/// <reference types="web" />
|
|
2
|
-
import { DataTableProps, DataTableHeadCellProps } from "@rmwc/data-table";
|
|
3
|
-
import { ColumnDirectionProps } from "./DataTable";
|
|
4
1
|
import { CSSProperties } from "react";
|
|
2
|
+
import { DataTableProps, DataTableHeadCellProps, DataTableCellProps } from "@rmwc/data-table";
|
|
3
|
+
import { ColumnDirectionProps } from "./ColumnDirection";
|
|
5
4
|
interface TableProps extends DataTableProps {
|
|
6
5
|
bordered?: boolean;
|
|
7
6
|
}
|
|
@@ -22,8 +21,15 @@ interface TableHeadCell extends DataTableHeadCellProps {
|
|
|
22
21
|
export declare const TableHeadCell: import("@emotion/styled").StyledComponent<{
|
|
23
22
|
theme?: import("@emotion/react").Theme | undefined;
|
|
24
23
|
} & TableHeadCell, {}, {}>;
|
|
24
|
+
interface DataTableCell extends DataTableCellProps {
|
|
25
|
+
style?: CSSProperties;
|
|
26
|
+
}
|
|
27
|
+
export declare const DataTableCell: import("@emotion/styled").StyledComponent<{
|
|
28
|
+
theme?: import("@emotion/react").Theme | undefined;
|
|
29
|
+
} & DataTableCell, {}, {}>;
|
|
25
30
|
interface ColumnHeaderWrapperProps {
|
|
26
31
|
sortable: boolean;
|
|
32
|
+
isLastCell: boolean;
|
|
27
33
|
}
|
|
28
34
|
export declare const ColumnHeaderWrapper: import("@emotion/styled").StyledComponent<{
|
|
29
35
|
theme?: import("@emotion/react").Theme | undefined;
|
|
@@ -40,4 +46,11 @@ export declare const ColumnDirectionIcon: import("@emotion/styled").StyledCompon
|
|
|
40
46
|
} & {
|
|
41
47
|
theme?: import("@emotion/react").Theme | undefined;
|
|
42
48
|
} & ColumnDirectionProps, {}, {}>;
|
|
49
|
+
export declare const ColumnsVisibilityMenuHeader: import("@emotion/styled").StyledComponent<import("../Typography/Typography").TypographyProps & {
|
|
50
|
+
theme?: import("@emotion/react").Theme | undefined;
|
|
51
|
+
}, {}, {}>;
|
|
52
|
+
export declare const ColumnsVisibilityMenuItem: import("@emotion/styled").StyledComponent<{
|
|
53
|
+
theme?: import("@emotion/react").Theme | undefined;
|
|
54
|
+
as?: import("react").ElementType<any> | undefined;
|
|
55
|
+
}, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
|
|
43
56
|
export {};
|
package/DataTable/styled.js
CHANGED
|
@@ -4,10 +4,11 @@ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefau
|
|
|
4
4
|
Object.defineProperty(exports, "__esModule", {
|
|
5
5
|
value: true
|
|
6
6
|
});
|
|
7
|
-
exports.TableHeadCell = exports.Table = exports.Resizer = exports.ColumnHeaderWrapper = exports.ColumnDirectionWrapper = exports.ColumnDirectionIcon = void 0;
|
|
7
|
+
exports.TableHeadCell = exports.Table = exports.Resizer = exports.DataTableCell = exports.ColumnsVisibilityMenuItem = exports.ColumnsVisibilityMenuHeader = exports.ColumnHeaderWrapper = exports.ColumnDirectionWrapper = exports.ColumnDirectionIcon = void 0;
|
|
8
8
|
var _styled = _interopRequireDefault(require("@emotion/styled"));
|
|
9
9
|
var _arrow_downward = require("@material-design-icons/svg/outlined/arrow_downward.svg");
|
|
10
10
|
var _dataTable = require("@rmwc/data-table");
|
|
11
|
+
var _Typography = require("../Typography");
|
|
11
12
|
var Table = /*#__PURE__*/(0, _styled.default)(_dataTable.DataTable, {
|
|
12
13
|
label: "Table",
|
|
13
14
|
target: "er5nqo40"
|
|
@@ -27,26 +28,43 @@ exports.Resizer = Resizer;
|
|
|
27
28
|
var TableHeadCell = /*#__PURE__*/(0, _styled.default)(_dataTable.DataTableHeadCell, {
|
|
28
29
|
label: "TableHeadCell",
|
|
29
30
|
target: "er5nqo42"
|
|
30
|
-
})("position:relative;&:hover ", Resizer, "{opacity:1;}");
|
|
31
|
+
})("position:relative;width:auto;&:hover ", Resizer, "{opacity:1;}");
|
|
31
32
|
exports.TableHeadCell = TableHeadCell;
|
|
33
|
+
var DataTableCell = /*#__PURE__*/(0, _styled.default)(_dataTable.DataTableCell, {
|
|
34
|
+
label: "DataTableCell",
|
|
35
|
+
target: "er5nqo43"
|
|
36
|
+
})("white-space:nowrap;overflow:hidden;text-overflow:ellipsis;");
|
|
37
|
+
exports.DataTableCell = DataTableCell;
|
|
32
38
|
var ColumnHeaderWrapper = /*#__PURE__*/(0, _styled.default)("div", {
|
|
33
39
|
label: "ColumnHeaderWrapper",
|
|
34
|
-
target: "
|
|
40
|
+
target: "er5nqo44"
|
|
35
41
|
})("cursor:", function (props) {
|
|
36
42
|
return props.sortable ? "pointer" : "cursor";
|
|
37
|
-
}, ";display:flex;align-items:center;justify-content:
|
|
43
|
+
}, ";display:flex;align-items:center;justify-content:", function (props) {
|
|
44
|
+
return props.isLastCell ? "flex-end" : "start";
|
|
45
|
+
}, ";");
|
|
38
46
|
exports.ColumnHeaderWrapper = ColumnHeaderWrapper;
|
|
39
47
|
var ColumnDirectionWrapper = /*#__PURE__*/(0, _styled.default)("span", {
|
|
40
48
|
label: "ColumnDirectionWrapper",
|
|
41
|
-
target: "
|
|
49
|
+
target: "er5nqo45"
|
|
42
50
|
})("display:inline-flex;align-items:center;justify-content:center;height:16px;width:16px;margin:0 0 0 4px;");
|
|
43
51
|
exports.ColumnDirectionWrapper = ColumnDirectionWrapper;
|
|
44
52
|
var ColumnDirectionIcon = /*#__PURE__*/(0, _styled.default)(_arrow_downward.ReactComponent, {
|
|
45
53
|
label: "ColumnDirectionIcon",
|
|
46
|
-
target: "
|
|
54
|
+
target: "er5nqo46"
|
|
47
55
|
})("transform:", function (props) {
|
|
48
56
|
return props.direction === "asc" ? "rotate(180deg)" : "rotate(0deg)";
|
|
49
57
|
}, ";");
|
|
50
58
|
exports.ColumnDirectionIcon = ColumnDirectionIcon;
|
|
59
|
+
var ColumnsVisibilityMenuHeader = /*#__PURE__*/(0, _styled.default)(_Typography.Typography, {
|
|
60
|
+
label: "ColumnsVisibilityMenuHeader",
|
|
61
|
+
target: "er5nqo47"
|
|
62
|
+
})("padding:4px 16px;font-weight:600;");
|
|
63
|
+
exports.ColumnsVisibilityMenuHeader = ColumnsVisibilityMenuHeader;
|
|
64
|
+
var ColumnsVisibilityMenuItem = /*#__PURE__*/(0, _styled.default)("div", {
|
|
65
|
+
label: "ColumnsVisibilityMenuItem",
|
|
66
|
+
target: "er5nqo48"
|
|
67
|
+
})("padding:0 16px;");
|
|
68
|
+
exports.ColumnsVisibilityMenuItem = ColumnsVisibilityMenuItem;
|
|
51
69
|
|
|
52
70
|
//# sourceMappingURL=styled.js.map
|
package/DataTable/styled.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_styled","_interopRequireDefault","require","_arrow_downward","_dataTable","Table","styled","RmwcDataTable","label","target","props","bordered","exports","Resizer","isResizing","TableHeadCell","RmwcDataTableHeadCell","ColumnHeaderWrapper","sortable","ColumnDirectionWrapper","ColumnDirectionIcon","ArrowDown","direction"],"sources":["styled.tsx"],"sourcesContent":["import styled from \"@emotion/styled\";\n\nimport { ReactComponent as ArrowDown } from \"@material-design-icons/svg/outlined/arrow_downward.svg\";\nimport {\n DataTable as RmwcDataTable,\n DataTableHeadCell as RmwcDataTableHeadCell,\n DataTableProps,\n DataTableHeadCellProps\n} from \"@rmwc/data-table\";\nimport { ColumnDirectionProps } from \"~/DataTable/
|
|
1
|
+
{"version":3,"names":["_styled","_interopRequireDefault","require","_arrow_downward","_dataTable","_Typography","Table","styled","RmwcDataTable","label","target","props","bordered","exports","Resizer","isResizing","TableHeadCell","RmwcDataTableHeadCell","DataTableCell","RmwcDataTableCell","ColumnHeaderWrapper","sortable","isLastCell","ColumnDirectionWrapper","ColumnDirectionIcon","ArrowDown","direction","ColumnsVisibilityMenuHeader","Typography","ColumnsVisibilityMenuItem"],"sources":["styled.tsx"],"sourcesContent":["import { CSSProperties } from \"react\";\nimport styled from \"@emotion/styled\";\n\nimport { ReactComponent as ArrowDown } from \"@material-design-icons/svg/outlined/arrow_downward.svg\";\nimport {\n DataTable as RmwcDataTable,\n DataTableCell as RmwcDataTableCell,\n DataTableHeadCell as RmwcDataTableHeadCell,\n DataTableProps,\n DataTableHeadCellProps,\n DataTableCellProps\n} from \"@rmwc/data-table\";\nimport { ColumnDirectionProps } from \"~/DataTable/ColumnDirection\";\nimport { Typography } from \"~/Typography\";\n\ninterface TableProps extends DataTableProps {\n bordered?: boolean;\n}\n\nexport const Table = styled(RmwcDataTable)<TableProps>`\n overflow-y: hidden;\n overflow-x: scroll;\n max-width: 100%;\n display: block !important;\n border-width: ${props => (props.bordered ? \"1px\" : \"0px\")};\n\n th,\n td {\n vertical-align: middle;\n }\n`;\n\ninterface ResizerProps {\n isResizing: boolean;\n}\n\nexport const Resizer = styled(\"div\")<ResizerProps>`\n position: absolute;\n right: 0;\n top: 0;\n height: 100%;\n width: 4px;\n background: ${props =>\n props.isResizing\n ? \"var(--mdc-theme-text-hint-on-light)\"\n : \"var(--mdc-theme-on-background)\"};\n cursor: col-resize;\n user-select: none;\n touch-action: none;\n opacity: ${props => (props.isResizing ? 1 : 0)};\n`;\n\ninterface TableHeadCell extends DataTableHeadCellProps {\n colSpan: number;\n style?: CSSProperties;\n}\n\nexport const TableHeadCell = styled(RmwcDataTableHeadCell)<TableHeadCell>`\n position: relative;\n width: auto;\n\n &:hover ${Resizer} {\n opacity: 1;\n }\n`;\n\ninterface DataTableCell extends DataTableCellProps {\n style?: CSSProperties;\n}\n\nexport const DataTableCell = styled(RmwcDataTableCell)<DataTableCell>`\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n`;\n\ninterface ColumnHeaderWrapperProps {\n sortable: boolean;\n isLastCell: boolean;\n}\n\nexport const ColumnHeaderWrapper = styled(\"div\")<ColumnHeaderWrapperProps>`\n cursor: ${props => (props.sortable ? \"pointer\" : \"cursor\")};\n display: flex;\n align-items: center;\n justify-content: ${props => (props.isLastCell ? \"flex-end\" : \"start\")};\n`;\n\nexport const ColumnDirectionWrapper = styled(\"span\")`\n display: inline-flex;\n align-items: center;\n justify-content: center;\n height: 16px;\n width: 16px;\n margin: 0 0 0 4px;\n`;\n\nexport const ColumnDirectionIcon = styled(ArrowDown)<ColumnDirectionProps>`\n transform: ${props => (props.direction === \"asc\" ? \"rotate(180deg)\" : \"rotate(0deg)\")};\n`;\n\nexport const ColumnsVisibilityMenuHeader = styled(Typography)`\n padding: 4px 16px;\n font-weight: 600;\n`;\n\nexport const ColumnsVisibilityMenuItem = styled(\"div\")`\n padding: 0 16px;\n`;\n"],"mappings":";;;;;;;AACA,IAAAA,OAAA,GAAAC,sBAAA,CAAAC,OAAA;AAEA,IAAAC,eAAA,GAAAD,OAAA;AACA,IAAAE,UAAA,GAAAF,OAAA;AASA,IAAAG,WAAA,GAAAH,OAAA;AAMO,IAAMI,KAAK,oBAAGC,eAAM,EAACC,oBAAa;EAAAC,KAAA;EAAAC,MAAA;AAAA,gGAKrB,UAAAC,KAAK;EAAA,OAAKA,KAAK,CAACC,QAAQ,GAAG,KAAK,GAAG,KAAK;AAAA,CAAC,mCAM5D;AAACC,OAAA,CAAAP,KAAA,GAAAA,KAAA;AAMK,IAAMQ,OAAO,oBAAGP,eAAM,EAAC,KAAK;EAAAE,KAAA;EAAAC,MAAA;AAAA,wEAMjB,UAAAC,KAAK;EAAA,OACfA,KAAK,CAACI,UAAU,GACV,qCAAqC,GACrC,gCAAgC;AAAA,qEAI/B,UAAAJ,KAAK;EAAA,OAAKA,KAAK,CA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MAAA;AAAA,qBAEpD;AAACG,OAAA,CAAAgB,yBAAA,GAAAA,yBAAA"}
|
package/DateTime/Date.js
ADDED
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard").default;
|
|
4
|
+
Object.defineProperty(exports, "__esModule", {
|
|
5
|
+
value: true
|
|
6
|
+
});
|
|
7
|
+
exports.DateComponent = void 0;
|
|
8
|
+
var _react = _interopRequireWildcard(require("react"));
|
|
9
|
+
var DateComponent = function DateComponent(_ref) {
|
|
10
|
+
var date = _ref.date,
|
|
11
|
+
_ref$options = _ref.options,
|
|
12
|
+
options = _ref$options === void 0 ? {
|
|
13
|
+
day: "numeric",
|
|
14
|
+
month: "long",
|
|
15
|
+
year: "numeric"
|
|
16
|
+
} : _ref$options,
|
|
17
|
+
locale = _ref.locale;
|
|
18
|
+
var formatDate = (0, _react.useMemo)(function () {
|
|
19
|
+
// Convert the input string to a Date object
|
|
20
|
+
var dateObject = new Date(date);
|
|
21
|
+
|
|
22
|
+
// Check if the input date is valid
|
|
23
|
+
if (isNaN(dateObject.getDate())) {
|
|
24
|
+
console.log("Invalid date");
|
|
25
|
+
return "";
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
/**
|
|
29
|
+
* Determine the final locale:
|
|
30
|
+
* - use the prop `locale` if provided.
|
|
31
|
+
* - try to guess the navigator language, use it only if it's a subset of `en`locale, since the admin is not localized.
|
|
32
|
+
* - use `en-US`as default.
|
|
33
|
+
*/
|
|
34
|
+
var localeCode = locale || (navigator.language && navigator.language.startsWith("en") ? navigator.language : "en-US");
|
|
35
|
+
return new Intl.DateTimeFormat(localeCode, options).format(dateObject);
|
|
36
|
+
}, [date, locale, options]);
|
|
37
|
+
return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, formatDate);
|
|
38
|
+
};
|
|
39
|
+
exports.DateComponent = DateComponent;
|
|
40
|
+
|
|
41
|
+
//# sourceMappingURL=Date.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["_react","_interopRequireWildcard","require","DateComponent","_ref","date","_ref$options","options","day","month","year","locale","formatDate","useMemo","dateObject","Date","isNaN","getDate","console","log","localeCode","navigator","language","startsWith","Intl","DateTimeFormat","format","default","createElement","Fragment","exports"],"sources":["Date.tsx"],"sourcesContent":["import React, { useMemo } from \"react\";\n\nexport interface DateComponentProps {\n date: string;\n options?: Intl.DateTimeFormatOptions;\n locale?: string;\n}\n\nexport const DateComponent = ({\n date,\n options = {\n day: \"numeric\",\n month: \"long\",\n year: \"numeric\"\n },\n locale\n}: DateComponentProps) => {\n const formatDate = useMemo(() => {\n // Convert the input string to a Date object\n const dateObject = new Date(date);\n\n // Check if the input date is valid\n if (isNaN(dateObject.getDate())) {\n console.log(\"Invalid date\");\n return \"\";\n }\n\n /**\n * Determine the final locale:\n * - use the prop `locale` if provided.\n * - try to guess the navigator language, use it only if it's a subset of `en`locale, since the admin is not localized.\n * - use `en-US`as default.\n */\n const localeCode =\n locale ||\n (navigator.language && navigator.language.startsWith(\"en\")\n ? navigator.language\n : \"en-US\");\n\n return new Intl.DateTimeFormat(localeCode, options).format(dateObject);\n }, [date, locale, options]);\n\n return <>{formatDate}</>;\n};\n"],"mappings":";;;;;;;AAAA,IAAAA,MAAA,GAAAC,uBAAA,CAAAC,OAAA;AAQO,IAAMC,aAAa,GAAG,SAAhBA,aAAaA,CAAAC,IAAA,EAQA;EAAA,IAPtBC,IAAI,GAAAD,IAAA,CAAJC,IAAI;IAAAC,YAAA,GAAAF,IAAA,CACJG,OAAO;IAAPA,OAAO,GAAAD,YAAA,cAAG;MACNE,GAAG,EAAE,SAAS;MACdC,KAAK,EAAE,MAAM;MACbC,IAAI,EAAE;IACV,CAAC,GAAAJ,YAAA;IACDK,MAAM,GAAAP,IAAA,CAANO,MAAM;EAEN,IAAMC,UAAU,GAAG,IAAAC,cAAO,EAAC,YAAM;IAC7B;IACA,IAAMC,UAAU,GAAG,IAAIC,IAAI,CAACV,IAAI,CAAC;;IAEjC;IACA,IAAIW,KAAK,CAACF,UAAU,CAACG,OAAO,CAAC,CAAC,CAAC,EAAE;MAC7BC,OAAO,CAACC,GAAG,CAAC,cAAc,CAAC;MAC3B,OAAO,EAAE;IACb;;IAEA;AACR;AACA;AACA;AACA;AACA;IACQ,IAAMC,UAAU,GACZT,MAAM,KACLU,SAAS,CAACC,QAAQ,IAAID,SAAS,CAACC,QAAQ,CAACC,UAAU,CAAC,IAAI,CAAC,GACpDF,SAAS,CAACC,QAAQ,GAClB,OAAO,CAAC;IAElB,OAAO,IAAIE,IAAI,CAACC,cAAc,CAACL,UAAU,EAAEb,OAAO,CAAC,CAACmB,MAAM,CAACZ,UAAU,CAAC;EAC1E,CAAC,EAAE,CAACT,IAAI,EAAEM,MAAM,EAAEJ,OAAO,CAAC,CAAC;EAE3B,oBAAOP,MAAA,CAAA2B,OAAA,CAAAC,aAAA,CAAA5B,MAAA,CAAA2B,OAAA,CAAAE,QAAA,QAAGjB,UAAa,CAAC;AAC5B,CAAC;AAACkB,OAAA,CAAA3B,aAAA,GAAAA,aAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { DateComponent as Date } from "./Date";
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
Object.defineProperty(exports, "Date", {
|
|
7
|
+
enumerable: true,
|
|
8
|
+
get: function get() {
|
|
9
|
+
return _Date.DateComponent;
|
|
10
|
+
}
|
|
11
|
+
});
|
|
12
|
+
var _Date = require("./Date");
|
|
13
|
+
|
|
14
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["_Date","require"],"sources":["index.ts"],"sourcesContent":["export { DateComponent as Date } from \"./Date\";\n"],"mappings":";;;;;;;;;;;AAAA,IAAAA,KAAA,GAAAC,OAAA"}
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
/// <reference types="web" />
|
|
2
1
|
import React from "react";
|
|
3
2
|
interface ApplyValueCb {
|
|
4
3
|
(value: string, cb: (value: string) => void): void;
|
|
@@ -36,5 +35,5 @@ export interface DelayedOnChangeProps {
|
|
|
36
35
|
onKeyDown?: OnKeyDownCallable;
|
|
37
36
|
children: React.ReactNode | ChildrenCallable;
|
|
38
37
|
}
|
|
39
|
-
export declare const DelayedOnChange: React.
|
|
38
|
+
export declare const DelayedOnChange: ({ children, ...other }: DelayedOnChangeProps) => React.ReactElement<any, string | React.JSXElementConstructor<any>>;
|
|
40
39
|
export default DelayedOnChange;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_react","_interopRequireWildcard","require","_excluded","emptyFunction","undefined","DelayedOnChange","_ref","children","other","_objectWithoutProperties2","default","onChange","_other$delay","delay","initialValue","value","_useState","useState","_useState2","_slicedToArray2","setValue","useEffect","localTimeout","React","useRef","applyValue","callback","arguments","length","current","clearTimeout","onChangeLocal","useCallback","onValueStateChanged","nextValue","setTimeout","newProps","_objectSpread2","renderProp","child","cloneElement","props","realOnKeyDown","onKeyDown","realOnBlur","onBlur","ev","persist","target","key","exports","_default"],"sources":["DelayedOnChange.ts"],"sourcesContent":["import React, { useEffect, useState } from \"react\";\n\nconst emptyFunction = (): undefined => {\n return undefined;\n};\n\ninterface ApplyValueCb {\n (value: string, cb: (value: string) => void): void;\n}\n/**\n * This component is used to wrap Input and Textarea components to optimize form re-render.\n * These 2 are the only components that trigger form model change on each character input.\n * This means, whenever you type a letter an entire form re-renders.\n * On complex forms you will feel and see a significant delay if this component is not used.\n *\n * The logic behind this component is to serve as a middleware between Form and Input/Textarea, and only notify form of a change when\n * a user stops typing for given period of time (400ms by default).\n */\ninterface OnChangeCallable {\n (value: string, cb?: ApplyValueCb): void;\n}\ninterface OnBlurCallable {\n (ev: React.SyntheticEvent): void;\n}\ninterface OnKeyDownCallable {\n (ev: React.KeyboardEvent<HTMLInputElement>): void;\n}\ninterface ChildrenCallableParams {\n value: string;\n onChange: OnChangeCallable;\n}\ninterface ChildrenCallable {\n (params: ChildrenCallableParams): React.ReactElement;\n}\nexport interface DelayedOnChangeProps {\n value?: string;\n delay?: number;\n onChange?: OnChangeCallable;\n onBlur?: OnBlurCallable;\n onKeyDown?: OnKeyDownCallable;\n children: React.ReactNode | ChildrenCallable;\n}\nexport const DelayedOnChange
|
|
1
|
+
{"version":3,"names":["_react","_interopRequireWildcard","require","_excluded","emptyFunction","undefined","DelayedOnChange","_ref","children","other","_objectWithoutProperties2","default","onChange","_other$delay","delay","initialValue","value","_useState","useState","_useState2","_slicedToArray2","setValue","useEffect","localTimeout","React","useRef","applyValue","callback","arguments","length","current","clearTimeout","onChangeLocal","useCallback","onValueStateChanged","nextValue","setTimeout","newProps","_objectSpread2","renderProp","child","cloneElement","props","realOnKeyDown","onKeyDown","realOnBlur","onBlur","ev","persist","target","key","exports","_default"],"sources":["DelayedOnChange.ts"],"sourcesContent":["import React, { useEffect, useState } from \"react\";\n\nconst emptyFunction = (): undefined => {\n return undefined;\n};\n\ninterface ApplyValueCb {\n (value: string, cb: (value: string) => void): void;\n}\n/**\n * This component is used to wrap Input and Textarea components to optimize form re-render.\n * These 2 are the only components that trigger form model change on each character input.\n * This means, whenever you type a letter an entire form re-renders.\n * On complex forms you will feel and see a significant delay if this component is not used.\n *\n * The logic behind this component is to serve as a middleware between Form and Input/Textarea, and only notify form of a change when\n * a user stops typing for given period of time (400ms by default).\n */\ninterface OnChangeCallable {\n (value: string, cb?: ApplyValueCb): void;\n}\ninterface OnBlurCallable {\n (ev: React.SyntheticEvent): void;\n}\ninterface OnKeyDownCallable {\n (ev: React.KeyboardEvent<HTMLInputElement>): void;\n}\ninterface ChildrenCallableParams {\n value: string;\n onChange: OnChangeCallable;\n}\ninterface ChildrenCallable {\n (params: ChildrenCallableParams): React.ReactElement;\n}\nexport interface DelayedOnChangeProps {\n value?: string;\n delay?: number;\n onChange?: OnChangeCallable;\n onBlur?: OnBlurCallable;\n onKeyDown?: OnKeyDownCallable;\n children: React.ReactNode | ChildrenCallable;\n}\nexport const DelayedOnChange = ({ children, ...other }: DelayedOnChangeProps) => {\n const { onChange, delay = 400, value: initialValue } = other;\n const [value, setValue] = useState<string | undefined>(initialValue);\n // Sync state and props\n useEffect(() => {\n if (initialValue !== value) {\n setValue(initialValue);\n }\n }, [initialValue]);\n\n const localTimeout = React.useRef<number | null>(null);\n\n const applyValue = (value: string, callback: ApplyValueCb = emptyFunction) => {\n localTimeout.current && clearTimeout(localTimeout.current);\n localTimeout.current = null;\n if (!onChange) {\n return;\n }\n onChange(value, callback);\n };\n\n const onChangeLocal = React.useCallback((value: string) => {\n setValue(value);\n }, []);\n\n // this is fired upon change value state\n const onValueStateChanged = (nextValue: string) => {\n localTimeout.current && clearTimeout(localTimeout.current);\n localTimeout.current = null;\n localTimeout.current = setTimeout(() => applyValue(nextValue), delay) as unknown as number;\n };\n\n // need to clear the timeout when unmounting the component\n useEffect(() => {\n return () => {\n if (!localTimeout.current) {\n return;\n }\n clearTimeout(localTimeout.current);\n localTimeout.current = null;\n };\n }, []);\n\n useEffect(() => {\n onValueStateChanged(value || \"\");\n }, [value]);\n\n const newProps = {\n ...other,\n value: value || \"\",\n onChange: onChangeLocal\n };\n\n const renderProp = typeof children === \"function\" ? (children as ChildrenCallable) : null;\n const child = renderProp\n ? renderProp(newProps)\n : React.cloneElement(children as unknown as React.ReactElement, newProps);\n\n const props = { ...child.props };\n const realOnKeyDown = props.onKeyDown || emptyFunction;\n const realOnBlur = props.onBlur || emptyFunction;\n\n // Need to apply value if input lost focus\n const onBlur: OnBlurCallable = ev => {\n if (!ev[\"persist\"]) {\n return;\n }\n ev.persist();\n applyValue((ev.target as HTMLInputElement).value, () => realOnBlur(ev));\n };\n\n // Need to listen for TAB key to apply new value immediately, without delay. Otherwise validation will be triggered with old value.\n const onKeyDown: OnKeyDownCallable = ev => {\n ev.persist();\n if (ev.key === \"Tab\") {\n applyValue((ev.target as HTMLInputElement).value, () => realOnKeyDown(ev));\n } else if (ev.key === \"Enter\" && props[\"data-on-enter\"]) {\n applyValue((ev.target as HTMLInputElement).value, () => realOnKeyDown(ev));\n } else {\n realOnKeyDown(ev);\n }\n };\n\n return React.cloneElement(child, { ...props, onBlur, onKeyDown });\n};\n\nexport default DelayedOnChange;\n"],"mappings":";;;;;;;;;;;AAAA,IAAAA,MAAA,GAAAC,uBAAA,CAAAC,OAAA;AAAmD,IAAAC,SAAA;AAEnD,IAAMC,aAAa,GAAG,SAAhBA,aAAaA,CAAA,EAAoB;EACnC,OAAOC,SAAS;AACpB,CAAC;;AAKD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAyBO,IAAMC,eAAe,GAAG,SAAlBA,eAAeA,CAAAC,IAAA,EAAqD;EAAA,IAA/CC,QAAQ,GAAAD,IAAA,CAARC,QAAQ;IAAKC,KAAK,OAAAC,yBAAA,CAAAC,OAAA,EAAAJ,IAAA,EAAAJ,SAAA;EAChD,IAAQS,QAAQ,GAAuCH,KAAK,CAApDG,QAAQ;IAAAC,YAAA,GAAuCJ,KAAK,CAA1CK,KAAK;IAALA,KAAK,GAAAD,YAAA,cAAG,GAAG,GAAAA,YAAA;IAASE,YAAY,GAAKN,KAAK,CAA7BO,KAAK;EACpC,IAAAC,SAAA,GAA0B,IAAAC,eAAQ,EAAqBH,YAAY,CAAC;IAAAI,UAAA,OAAAC,eAAA,CAAAT,OAAA,EAAAM,SAAA;IAA7DD,KAAK,GAAAG,UAAA;IAAEE,QAAQ,GAAAF,UAAA;EACtB;EACA,IAAAG,gBAAS,EAAC,YAAM;IACZ,IAAIP,YAAY,KAAKC,KAAK,EAAE;MACxBK,QAAQ,CAACN,YAAY,CAAC;IAC1B;EACJ,CAAC,EAAE,CAACA,YAAY,CAAC,CAAC;EAElB,IAAMQ,YAAY,GAAGC,cAAK,CAACC,MAAM,C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KAAK,EAAE;QAAA,OAAM2B,aAAa,CAACI,EAAE,CAAC;MAAA,EAAC;IAC9E,CAAC,MAAM;MACHJ,aAAa,CAACI,EAAE,CAAC;IACrB;EACJ,CAAC;EAED,oBAAOvB,cAAK,CAACiB,YAAY,CAACD,KAAK,MAAAF,cAAA,CAAA3B,OAAA,MAAA2B,cAAA,CAAA3B,OAAA,MAAO+B,KAAK;IAAEI,MAAM,EAANA,MAAM;IAAEF,SAAS,EAATA;EAAS,EAAE,CAAC;AACrE,CAAC;AAACO,OAAA,CAAA7C,eAAA,GAAAA,eAAA;AAAA,IAAA8C,QAAA,GAEa9C,eAAe;AAAA6C,OAAA,CAAAxC,OAAA,GAAAyC,QAAA"}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import { DelayedOnChangeProps } from "./DelayedOnChange";
|
|
3
|
-
export default function withDelayedOnChange(): (Component: React.
|
|
3
|
+
export default function withDelayedOnChange(): (Component: React.ComponentType<DelayedOnChangeProps>) => (props: DelayedOnChangeProps) => JSX.Element;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_react","_interopRequireDefault","require","_DelayedOnChange","_excluded","withDelayedOnChange","decorator","Component","WithDelayedOnChange","props","value","onChange","rest","_objectWithoutProperties2","default","createElement","_ref","Object","assign"],"sources":["withDelayedOnChange.tsx"],"sourcesContent":["import React from \"react\";\nimport Delayed, { DelayedOnChangeProps } from \"./DelayedOnChange\";\n\nexport default function withDelayedOnChange() {\n return function decorator(Component: React.
|
|
1
|
+
{"version":3,"names":["_react","_interopRequireDefault","require","_DelayedOnChange","_excluded","withDelayedOnChange","decorator","Component","WithDelayedOnChange","props","value","onChange","rest","_objectWithoutProperties2","default","createElement","_ref","Object","assign"],"sources":["withDelayedOnChange.tsx"],"sourcesContent":["import React from \"react\";\nimport Delayed, { DelayedOnChangeProps } from \"./DelayedOnChange\";\n\nexport default function withDelayedOnChange() {\n return function decorator(Component: React.ComponentType<DelayedOnChangeProps>) {\n return function WithDelayedOnChange(props: DelayedOnChangeProps) {\n const { value, onChange, ...rest } = props;\n return (\n <Delayed value={value} onChange={onChange}>\n {({ value, onChange }) => (\n <Component {...rest} value={value} onChange={onChange} />\n )}\n </Delayed>\n );\n };\n };\n}\n"],"mappings":";;;;;;;;AAAA,IAAAA,MAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,gBAAA,GAAAF,sBAAA,CAAAC,OAAA;AAAkE,IAAAE,SAAA;AAEnD,SAASC,mBAAmBA,CAAA,EAAG;EAC1C,OAAO,SAASC,SAASA,CAACC,SAAoD,EAAE;IAC5E,OAAO,SAASC,mBAAmBA,CAACC,KAA2B,EAAE;MAC7D,IAAQC,KAAK,GAAwBD,KAAK,CAAlCC,KAAK;QAAEC,QAAQ,GAAcF,KAAK,CAA3BE,QAAQ;QAAKC,IAAI,OAAAC,yBAAA,CAAAC,OAAA,EAAKL,KAAK,EAAAL,SAAA;MAC1C,oBACIJ,MAAA,CAAAc,OAAA,CAAAC,aAAA,CAACZ,gBAAA,CAAAW,OAAO;QAACJ,KAAK,EAAEA,KAAM;QAACC,QAAQ,EAAEA;MAAS,GACrC,UAAAK,IAAA;QAAA,IAAGN,KAAK,GAAAM,IAAA,CAALN,KAAK;UAAEC,QAAQ,GAAAK,IAAA,CAARL,QAAQ;QAAA,oBACfX,MAAA,CAAAc,OAAA,CAAAC,aAAA,CAACR,SAAS,EAAAU,MAAA,CAAAC,MAAA,KAAKN,IAAI;UAAEF,KAAK,EAAEA,KAAM;UAACC,QAAQ,EAAEA;QAAS,EAAE,CAAC;MAAA,CAExD,CAAC;IAElB,CAAC;EACL,CAAC;AACL"}
|
package/Dialog/Dialog.d.ts
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
/// <reference types="web" />
|
|
2
1
|
import React from "react";
|
|
3
2
|
import { DialogProps as RmwcDialogProps, DialogOnCloseEventT, DialogContentProps as RmwcDialogContentProps, DialogTitleProps as RmwcDialogTitleProps, DialogActionsProps as RmwcDialogActionsProps, DialogButtonProps as RmwcDialogButtonProps } from "@rmwc/dialog";
|
|
4
3
|
export declare type DialogOnClose = (event: DialogOnCloseEventT) => void;
|
|
@@ -23,7 +22,7 @@ export interface DialogTitleProps extends RmwcDialogTitleProps {
|
|
|
23
22
|
/**
|
|
24
23
|
* Dialog's header, which can accept DialogHeaderTitle component or any other set of components.
|
|
25
24
|
*/
|
|
26
|
-
export declare const DialogTitle:
|
|
25
|
+
export declare const DialogTitle: (props: DialogTitleProps) => JSX.Element;
|
|
27
26
|
export declare type DialogContentProps = RmwcDialogContentProps & {
|
|
28
27
|
/**
|
|
29
28
|
* Dialog content.
|
|
@@ -34,7 +33,7 @@ export declare type DialogContentProps = RmwcDialogContentProps & {
|
|
|
34
33
|
/**
|
|
35
34
|
* A simple component for showing dialog's body.
|
|
36
35
|
*/
|
|
37
|
-
export declare const DialogContent:
|
|
36
|
+
export declare const DialogContent: (props: DialogContentProps) => JSX.Element;
|
|
38
37
|
export interface DialogActionsProps extends RmwcDialogActionsProps {
|
|
39
38
|
/**
|
|
40
39
|
* Action buttons.
|
|
@@ -45,7 +44,7 @@ export interface DialogActionsProps extends RmwcDialogActionsProps {
|
|
|
45
44
|
/**
|
|
46
45
|
* Can be used to show accept and cancel buttons.
|
|
47
46
|
*/
|
|
48
|
-
export declare const DialogActions:
|
|
47
|
+
export declare const DialogActions: (props: DialogActionsProps) => JSX.Element;
|
|
49
48
|
interface DialogButtonProps extends RmwcDialogButtonProps {
|
|
50
49
|
/**
|
|
51
50
|
* Callback to execute then button is clicked.
|
|
@@ -56,7 +55,7 @@ interface DialogButtonProps extends RmwcDialogButtonProps {
|
|
|
56
55
|
/**
|
|
57
56
|
* Use this to show a simple button.
|
|
58
57
|
*/
|
|
59
|
-
export declare const DialogButton:
|
|
58
|
+
export declare const DialogButton: (props: DialogButtonProps) => JSX.Element;
|
|
60
59
|
interface DialogCancelProps extends RmwcDialogButtonProps {
|
|
61
60
|
/**
|
|
62
61
|
* Callback to execute then button is clicked.
|
|
@@ -66,7 +65,7 @@ interface DialogCancelProps extends RmwcDialogButtonProps {
|
|
|
66
65
|
/**
|
|
67
66
|
* Use this to close the dialog without taking any additional action.
|
|
68
67
|
*/
|
|
69
|
-
export declare const DialogCancel:
|
|
68
|
+
export declare const DialogCancel: (props: DialogCancelProps) => JSX.Element;
|
|
70
69
|
interface DialogAcceptProps extends RmwcDialogButtonProps {
|
|
71
70
|
/**
|
|
72
71
|
* Callback to execute then button is clicked.
|
|
@@ -76,5 +75,5 @@ interface DialogAcceptProps extends RmwcDialogButtonProps {
|
|
|
76
75
|
/**
|
|
77
76
|
* Use this to close the dialog without taking any additional action.
|
|
78
77
|
*/
|
|
79
|
-
export declare const DialogAccept:
|
|
78
|
+
export declare const DialogAccept: (props: DialogAcceptProps) => JSX.Element;
|
|
80
79
|
export {};
|
package/Dialog/Dialog.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_react","_interopRequireDefault","require","_reactDom","_dialog","_emotion","_Helpers","_excluded","Dialog","_React$Component","_inherits2","default","_super","_createSuper2","props","_this","_classCallCheck2","call","container","document","getElementById","createElement","setAttribute","body","appendChild","_createClass2","key","value","render","_this$props","children","_objectWithoutProperties2","ReactDOM","createPortal","getClasses","React","Component","exports","DialogTitle","DialogContent","addMargin","css","DialogActions","DialogButton","DialogCancel","Object","assign","action","DialogAccept"],"sources":["Dialog.tsx"],"sourcesContent":["import React from \"react\";\nimport ReactDOM from \"react-dom\";\nimport {\n Dialog as RmwcDialog,\n DialogProps as RmwcDialogProps,\n DialogOnCloseEventT,\n DialogContent as RmwcDialogContent,\n DialogContentProps as RmwcDialogContentProps,\n DialogTitle as RmwcDialogTitle,\n DialogTitleProps as RmwcDialogTitleProps,\n DialogActions as RmwcDialogActions,\n DialogActionsProps as RmwcDialogActionsProps,\n DialogButton as RmwcDialogButton,\n DialogButtonProps as RmwcDialogButtonProps\n} from \"@rmwc/dialog\";\nimport { css } from \"emotion\";\nimport { getClasses } from \"~/Helpers\";\n\nexport type DialogOnClose = (event: DialogOnCloseEventT) => void;\n\nexport interface DialogProps extends RmwcDialogProps {\n className?: string;\n\n // Component's custom in-line styles.\n style?: React.CSSProperties;\n\n // If true, dialog will be permanently fixed inside of a view (works for temporary and persistent modes).\n open?: boolean;\n\n onClose?: (evt: DialogOnCloseEventT) => void;\n\n preventOutsideDismiss?: boolean;\n}\n\nexport class Dialog extends React.Component<DialogProps> {\n container: HTMLElement;\n\n constructor(props: DialogProps) {\n super(props);\n /**\n * We can safely cast\n */\n this.container = document.getElementById(\"dialog-container\") as HTMLElement;\n\n if (!this.container) {\n this.container = document.createElement(\"div\");\n this.container.setAttribute(\"id\", \"dialog-container\");\n const container = this.container;\n document.body && document.body.appendChild(container);\n }\n }\n\n public override render() {\n const { children, ...props } = this.props;\n const container = this.container;\n\n // Let's pass \"permanent\" / \"persistent\" / \"temporary\" flags as \"mode\" prop instead.\n return ReactDOM.createPortal(\n <RmwcDialog {...getClasses(props, \"webiny-ui-dialog\")}>{children}</RmwcDialog>,\n container\n );\n }\n}\n\nexport interface DialogTitleProps extends RmwcDialogTitleProps {\n /**\n * Title text.\n */\n children: React.ReactNode[] | React.ReactNode;\n}\n\n/**\n * Dialog's header, which can accept DialogHeaderTitle component or any other set of components.\n */\nexport const DialogTitle
|
|
1
|
+
{"version":3,"names":["_react","_interopRequireDefault","require","_reactDom","_dialog","_emotion","_Helpers","_excluded","Dialog","_React$Component","_inherits2","default","_super","_createSuper2","props","_this","_classCallCheck2","call","container","document","getElementById","createElement","setAttribute","body","appendChild","_createClass2","key","value","render","_this$props","children","_objectWithoutProperties2","ReactDOM","createPortal","getClasses","React","Component","exports","DialogTitle","DialogContent","addMargin","css","DialogActions","DialogButton","DialogCancel","Object","assign","action","DialogAccept"],"sources":["Dialog.tsx"],"sourcesContent":["import React from \"react\";\nimport ReactDOM from \"react-dom\";\nimport {\n Dialog as RmwcDialog,\n DialogProps as RmwcDialogProps,\n DialogOnCloseEventT,\n DialogContent as RmwcDialogContent,\n DialogContentProps as RmwcDialogContentProps,\n DialogTitle as RmwcDialogTitle,\n DialogTitleProps as RmwcDialogTitleProps,\n DialogActions as RmwcDialogActions,\n DialogActionsProps as RmwcDialogActionsProps,\n DialogButton as RmwcDialogButton,\n DialogButtonProps as RmwcDialogButtonProps\n} from \"@rmwc/dialog\";\nimport { css } from \"emotion\";\nimport { getClasses } from \"~/Helpers\";\n\nexport type DialogOnClose = (event: DialogOnCloseEventT) => void;\n\nexport interface DialogProps extends RmwcDialogProps {\n className?: string;\n\n // Component's custom in-line styles.\n style?: React.CSSProperties;\n\n // If true, dialog will be permanently fixed inside of a view (works for temporary and persistent modes).\n open?: boolean;\n\n onClose?: (evt: DialogOnCloseEventT) => void;\n\n preventOutsideDismiss?: boolean;\n}\n\nexport class Dialog extends React.Component<DialogProps> {\n container: HTMLElement;\n\n constructor(props: DialogProps) {\n super(props);\n /**\n * We can safely cast\n */\n this.container = document.getElementById(\"dialog-container\") as HTMLElement;\n\n if (!this.container) {\n this.container = document.createElement(\"div\");\n this.container.setAttribute(\"id\", \"dialog-container\");\n const container = this.container;\n document.body && document.body.appendChild(container);\n }\n }\n\n public override render() {\n const { children, ...props } = this.props;\n const container = this.container;\n\n // Let's pass \"permanent\" / \"persistent\" / \"temporary\" flags as \"mode\" prop instead.\n return ReactDOM.createPortal(\n <RmwcDialog {...getClasses(props, \"webiny-ui-dialog\")}>{children}</RmwcDialog>,\n container\n );\n }\n}\n\nexport interface DialogTitleProps extends RmwcDialogTitleProps {\n /**\n * Title text.\n */\n children: React.ReactNode[] | React.ReactNode;\n}\n\n/**\n * Dialog's header, which can accept DialogHeaderTitle component or any other set of components.\n */\nexport const DialogTitle = (props: DialogTitleProps) => (\n <RmwcDialogTitle {...getClasses(props, \"webiny-ui-dialog__title\")} />\n);\n\nexport type DialogContentProps = RmwcDialogContentProps & {\n /**\n * Dialog content.\n */\n children: React.ReactNode[] | React.ReactNode;\n\n className?: string;\n};\n\n/**\n * A simple component for showing dialog's body.\n */\nexport const DialogContent = (props: DialogContentProps) => (\n <RmwcDialogContent {...getClasses(props, \"webiny-ui-dialog__content\")} />\n);\n\nexport interface DialogActionsProps extends RmwcDialogActionsProps {\n /**\n * Action buttons.\n */\n children: React.ReactNode[] | React.ReactNode;\n\n // Dialog component's custom in-line styles.\n style?: React.CSSProperties;\n}\n\nconst addMargin = css`\n button:last-of-type {\n margin-left: 8px;\n }\n`;\n\n/**\n * Can be used to show accept and cancel buttons.\n */\nexport const DialogActions = (props: DialogActionsProps) => (\n <RmwcDialogActions {...getClasses(props, [addMargin, \"webiny-ui-dialog__actions\"])} />\n);\n\ninterface DialogButtonProps extends RmwcDialogButtonProps {\n /**\n * Callback to execute then button is clicked.\n */\n onClick?: (e: React.MouseEvent) => void;\n\n className?: string;\n}\n\n/**\n * Use this to show a simple button.\n */\nexport const DialogButton = (props: DialogButtonProps) => (\n <RmwcDialogButton {...getClasses(props, \"webiny-ui-dialog__button\")} />\n);\n\ninterface DialogCancelProps extends RmwcDialogButtonProps {\n /**\n * Callback to execute then button is clicked.\n */\n onClick?: (e: React.MouseEvent) => void;\n}\n\n/**\n * Use this to close the dialog without taking any additional action.\n */\nexport const DialogCancel = (props: DialogCancelProps) => {\n return (\n <DialogButton\n {...getClasses(props, \"webiny-ui-dialog__button webiny-ui-dialog__button--cancel\")}\n action=\"close\"\n data-testid=\"dialog-cancel\"\n >\n {props.children}\n </DialogButton>\n );\n};\n\ninterface DialogAcceptProps extends RmwcDialogButtonProps {\n /**\n * Callback to execute then button is clicked.\n */\n onClick?: (e: React.MouseEvent) => void;\n}\n\n/**\n * Use this to close the dialog without taking any additional action.\n */\nexport const DialogAccept = (props: DialogAcceptProps) => {\n return (\n <DialogButton\n {...getClasses(props, \"webiny-ui-dialog__button webiny-ui-dialog__button--accept\")}\n action=\"accept\"\n data-testid=\"dialog-accept\"\n >\n {props.children}\n </DialogButton>\n );\n};\n"],"mappings":";;;;;;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GAAG,SAAfA,YAAYA,CAAI7B,KAAwB;EAAA,oBACjDd,MAAA,CAAAW,OAAA,CAAAU,aAAA,CAACjB,OAAA,CAAAuC,YAAgB,EAAK,IAAAT,mBAAU,EAACpB,KAAK,EAAE,0BAA0B,CAAI,CAAC;AAAA,CAC1E;AAACuB,OAAA,CAAAM,YAAA,GAAAA,YAAA;AASF;AACA;AACA;AACO,IAAMC,YAAY,GAAG,SAAfA,YAAYA,CAAI9B,KAAwB,EAAK;EACtD,oBACId,MAAA,CAAAW,OAAA,CAAAU,aAAA,CAACsB,YAAY,EAAAE,MAAA,CAAAC,MAAA,KACL,IAAAZ,mBAAU,EAACpB,KAAK,EAAE,2DAA2D,CAAC;IAClFiC,MAAM,EAAC,OAAO;IACd,eAAY;EAAe,IAE1BjC,KAAK,CAACgB,QACG,CAAC;AAEvB,CAAC;AAACO,OAAA,CAAAO,YAAA,GAAAA,YAAA;AASF;AACA;AACA;AACO,IAAMI,YAAY,GAAG,SAAfA,YAAYA,CAAIlC,KAAwB,EAAK;EACtD,oBACId,MAAA,CAAAW,OAAA,CAAAU,aAAA,CAACsB,YAAY,EAAAE,MAAA,CAAAC,MAAA,KACL,IAAAZ,mBAAU,EAACpB,KAAK,EAAE,2DAA2D,CAAC;IAClFiC,MAAM,EAAC,QAAQ;IACf,eAAY;EAAe,IAE1BjC,KAAK,CAACgB,QACG,CAAC;AAEvB,CAAC;AAACO,OAAA,CAAAW,YAAA,GAAAA,YAAA"}
|
package/Drawer/Drawer.d.ts
CHANGED
|
@@ -1,10 +1,7 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
+
import { CSSObject } from "@emotion/react";
|
|
2
3
|
import { DrawerProps as RmwcDrawerProps, DrawerHeaderProps as RmwcDrawerHeaderProps, DrawerContentProps as RmwcDrawerContentProps } from "@rmwc/drawer";
|
|
3
4
|
declare type DrawerHeaderProps = RmwcDrawerHeaderProps & {
|
|
4
|
-
/**
|
|
5
|
-
* Drawer direction.
|
|
6
|
-
*/
|
|
7
|
-
dir?: string;
|
|
8
5
|
/**
|
|
9
6
|
* Drawer content.
|
|
10
7
|
*/
|
|
@@ -19,10 +16,6 @@ declare type DrawerHeaderProps = RmwcDrawerHeaderProps & {
|
|
|
19
16
|
*/
|
|
20
17
|
declare const DrawerHeader: (props: DrawerHeaderProps) => JSX.Element;
|
|
21
18
|
export declare type DrawerContentProps = RmwcDrawerContentProps & {
|
|
22
|
-
/**
|
|
23
|
-
* Drawer direction.
|
|
24
|
-
*/
|
|
25
|
-
dir?: string;
|
|
26
19
|
/**
|
|
27
20
|
* Drawer content.
|
|
28
21
|
*/
|
|
@@ -37,10 +30,6 @@ export declare type DrawerContentProps = RmwcDrawerContentProps & {
|
|
|
37
30
|
*/
|
|
38
31
|
declare const DrawerContent: (props: DrawerContentProps) => JSX.Element;
|
|
39
32
|
declare type DrawerProps = RmwcDrawerProps & {
|
|
40
|
-
/**
|
|
41
|
-
* Drawer direction.
|
|
42
|
-
*/
|
|
43
|
-
dir?: string;
|
|
44
33
|
/**
|
|
45
34
|
* Drawer content.
|
|
46
35
|
*/
|
|
@@ -49,9 +38,12 @@ declare type DrawerProps = RmwcDrawerProps & {
|
|
|
49
38
|
* CSS class name
|
|
50
39
|
*/
|
|
51
40
|
className?: string;
|
|
41
|
+
style?: CSSObject;
|
|
52
42
|
};
|
|
53
43
|
/**
|
|
54
44
|
* Use Drawer component to display navigation for the whole app or just a small section of it.
|
|
55
45
|
*/
|
|
56
|
-
declare const Drawer: (props: DrawerProps) => JSX.Element;
|
|
57
|
-
|
|
46
|
+
declare const Drawer: ({ style, children, ...props }: DrawerProps) => JSX.Element;
|
|
47
|
+
declare const DrawerRight: (props: DrawerProps) => JSX.Element;
|
|
48
|
+
declare const DrawerLeft: (props: DrawerProps) => JSX.Element;
|
|
49
|
+
export { Drawer, DrawerHeader, DrawerContent, DrawerRight, DrawerLeft };
|