mirror of
https://github.com/IRBorisov/ConceptPortal.git
synced 2025-06-26 13:00:39 +03:00
F: Upgrade to tailwind 4. Fix type imports
Some checks are pending
Frontend CI / build (22.x) (push) Waiting to run
Some checks are pending
Frontend CI / build (22.x) (push) Waiting to run
This commit is contained in:
parent
74186b268b
commit
536705c00b
|
@ -62,8 +62,6 @@ This readme file is used mostly to document project dependencies and conventions
|
||||||
<summary>npm install -D</summary>
|
<summary>npm install -D</summary>
|
||||||
<pre>
|
<pre>
|
||||||
- tailwindcss
|
- tailwindcss
|
||||||
- postcss
|
|
||||||
- autoprefixer
|
|
||||||
- eslint-plugin-import
|
- eslint-plugin-import
|
||||||
- eslint-plugin-react-compiler
|
- eslint-plugin-react-compiler
|
||||||
- eslint-plugin-simple-import-sort
|
- eslint-plugin-simple-import-sort
|
||||||
|
@ -73,6 +71,7 @@ This readme file is used mostly to document project dependencies and conventions
|
||||||
- vite
|
- vite
|
||||||
- jest
|
- jest
|
||||||
- ts-jest
|
- ts-jest
|
||||||
|
- @vitejs/plugin-react
|
||||||
- @types/jest
|
- @types/jest
|
||||||
- @lezer/generator
|
- @lezer/generator
|
||||||
- @playwright/test
|
- @playwright/test
|
||||||
|
|
|
@ -11,15 +11,7 @@ export default [
|
||||||
...typescriptPlugin.configs.recommendedTypeChecked,
|
...typescriptPlugin.configs.recommendedTypeChecked,
|
||||||
...typescriptPlugin.configs.stylisticTypeChecked,
|
...typescriptPlugin.configs.stylisticTypeChecked,
|
||||||
{
|
{
|
||||||
ignores: [
|
ignores: ['**/parser.ts', '**/node_modules/**', '**/public/**', '**/dist/**', 'eslint.config.js']
|
||||||
'**/parser.ts',
|
|
||||||
'**/node_modules/**',
|
|
||||||
'**/public/**',
|
|
||||||
'**/dist/**',
|
|
||||||
'eslint.config.js',
|
|
||||||
'tailwind.config.js',
|
|
||||||
'postcss.config.js'
|
|
||||||
]
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
languageOptions: {
|
languageOptions: {
|
||||||
|
@ -43,6 +35,12 @@ export default [
|
||||||
settings: { react: { version: 'detect' } },
|
settings: { react: { version: 'detect' } },
|
||||||
rules: {
|
rules: {
|
||||||
'react-compiler/react-compiler': 'error',
|
'react-compiler/react-compiler': 'error',
|
||||||
|
'@typescript-eslint/consistent-type-imports': [
|
||||||
|
'warn',
|
||||||
|
{
|
||||||
|
fixStyle: 'inline-type-imports'
|
||||||
|
}
|
||||||
|
],
|
||||||
'@typescript-eslint/no-empty-object-type': ['error', { allowInterfaces: 'with-single-extends' }],
|
'@typescript-eslint/no-empty-object-type': ['error', { allowInterfaces: 'with-single-extends' }],
|
||||||
'@typescript-eslint/prefer-nullish-coalescing': 'off',
|
'@typescript-eslint/prefer-nullish-coalescing': 'off',
|
||||||
'@typescript-eslint/no-inferrable-types': 'off',
|
'@typescript-eslint/no-inferrable-types': 'off',
|
||||||
|
|
1277
rsconcept/frontend/package-lock.json
generated
1277
rsconcept/frontend/package-lock.json
generated
File diff suppressed because it is too large
Load Diff
|
@ -48,6 +48,7 @@
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@lezer/generator": "^1.7.2",
|
"@lezer/generator": "^1.7.2",
|
||||||
"@playwright/test": "^1.50.1",
|
"@playwright/test": "^1.50.1",
|
||||||
|
"@tailwindcss/vite": "^4.0.7",
|
||||||
"@types/jest": "^29.5.14",
|
"@types/jest": "^29.5.14",
|
||||||
"@types/node": "^22.13.4",
|
"@types/node": "^22.13.4",
|
||||||
"@types/react": "^19.0.10",
|
"@types/react": "^19.0.10",
|
||||||
|
@ -55,7 +56,6 @@
|
||||||
"@typescript-eslint/eslint-plugin": "^8.0.1",
|
"@typescript-eslint/eslint-plugin": "^8.0.1",
|
||||||
"@typescript-eslint/parser": "^8.0.1",
|
"@typescript-eslint/parser": "^8.0.1",
|
||||||
"@vitejs/plugin-react": "^4.3.4",
|
"@vitejs/plugin-react": "^4.3.4",
|
||||||
"autoprefixer": "^10.4.20",
|
|
||||||
"babel-plugin-react-compiler": "^19.0.0-beta-21e868a-20250216",
|
"babel-plugin-react-compiler": "^19.0.0-beta-21e868a-20250216",
|
||||||
"eslint": "^9.20.1",
|
"eslint": "^9.20.1",
|
||||||
"eslint-plugin-import": "^2.31.0",
|
"eslint-plugin-import": "^2.31.0",
|
||||||
|
@ -65,8 +65,7 @@
|
||||||
"eslint-plugin-simple-import-sort": "^12.1.1",
|
"eslint-plugin-simple-import-sort": "^12.1.1",
|
||||||
"globals": "^16.0.0",
|
"globals": "^16.0.0",
|
||||||
"jest": "^29.7.0",
|
"jest": "^29.7.0",
|
||||||
"postcss": "^8.5.3",
|
"tailwindcss": "^4.0.7",
|
||||||
"tailwindcss": "^3.4.17",
|
|
||||||
"ts-jest": "^29.2.5",
|
"ts-jest": "^29.2.5",
|
||||||
"typescript": "^5.7.3",
|
"typescript": "^5.7.3",
|
||||||
"typescript-eslint": "^8.24.1",
|
"typescript-eslint": "^8.24.1",
|
||||||
|
|
|
@ -1,8 +0,0 @@
|
||||||
export default {
|
|
||||||
plugins: {
|
|
||||||
'postcss-import': {},
|
|
||||||
'tailwindcss/nesting': {},
|
|
||||||
'tailwindcss': {},
|
|
||||||
'autoprefixer': {}
|
|
||||||
}
|
|
||||||
};
|
|
|
@ -1,7 +1,7 @@
|
||||||
import clsx from 'clsx';
|
import clsx from 'clsx';
|
||||||
|
|
||||||
import { IconLibrary2, IconManuals, IconNewItem2 } from '@/components/Icons';
|
import { IconLibrary2, IconManuals, IconNewItem2 } from '@/components/Icons';
|
||||||
import { CProps } from '@/components/props';
|
import { type EventMouse } from '@/components/props';
|
||||||
import { useWindowSize } from '@/hooks/useWindowSize';
|
import { useWindowSize } from '@/hooks/useWindowSize';
|
||||||
import { useAppLayoutStore } from '@/stores/appLayout';
|
import { useAppLayoutStore } from '@/stores/appLayout';
|
||||||
import { PARAMETER } from '@/utils/constants';
|
import { PARAMETER } from '@/utils/constants';
|
||||||
|
@ -19,11 +19,10 @@ export function Navigation() {
|
||||||
const size = useWindowSize();
|
const size = useWindowSize();
|
||||||
const noNavigationAnimation = useAppLayoutStore(state => state.noNavigationAnimation);
|
const noNavigationAnimation = useAppLayoutStore(state => state.noNavigationAnimation);
|
||||||
|
|
||||||
const navigateHome = (event: CProps.EventMouse) => router.push(urls.home, event.ctrlKey || event.metaKey);
|
const navigateHome = (event: EventMouse) => router.push(urls.home, event.ctrlKey || event.metaKey);
|
||||||
const navigateLibrary = (event: CProps.EventMouse) => router.push(urls.library, event.ctrlKey || event.metaKey);
|
const navigateLibrary = (event: EventMouse) => router.push(urls.library, event.ctrlKey || event.metaKey);
|
||||||
const navigateHelp = (event: CProps.EventMouse) => router.push(urls.manuals, event.ctrlKey || event.metaKey);
|
const navigateHelp = (event: EventMouse) => router.push(urls.manuals, event.ctrlKey || event.metaKey);
|
||||||
const navigateCreateNew = (event: CProps.EventMouse) =>
|
const navigateCreateNew = (event: EventMouse) => router.push(urls.create_schema, event.ctrlKey || event.metaKey);
|
||||||
router.push(urls.create_schema, event.ctrlKey || event.metaKey);
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<nav
|
<nav
|
||||||
|
|
|
@ -1,12 +1,12 @@
|
||||||
import clsx from 'clsx';
|
import clsx from 'clsx';
|
||||||
|
|
||||||
import { CProps } from '@/components/props';
|
import { type EventMouse, type Styling, type Titled } from '@/components/props';
|
||||||
import { globalIDs } from '@/utils/constants';
|
import { globalIDs } from '@/utils/constants';
|
||||||
|
|
||||||
interface NavigationButtonProps extends CProps.Titled, CProps.Styling {
|
interface NavigationButtonProps extends Titled, Styling {
|
||||||
text?: string;
|
text?: string;
|
||||||
icon: React.ReactNode;
|
icon: React.ReactNode;
|
||||||
onClick?: (event: CProps.EventMouse) => void;
|
onClick?: (event: EventMouse) => void;
|
||||||
}
|
}
|
||||||
|
|
||||||
export function NavigationButton({
|
export function NavigationButton({
|
||||||
|
@ -29,8 +29,9 @@ export function NavigationButton({
|
||||||
data-tooltip-hidden={hideTitle}
|
data-tooltip-hidden={hideTitle}
|
||||||
onClick={onClick}
|
onClick={onClick}
|
||||||
className={clsx(
|
className={clsx(
|
||||||
'mr-1 h-full', //
|
'mr-1 h-full',
|
||||||
'flex items-center gap-1',
|
'flex items-center gap-1',
|
||||||
|
'cursor-pointer',
|
||||||
'clr-btn-nav cc-animate-color duration-500',
|
'clr-btn-nav cc-animate-color duration-500',
|
||||||
'rounded-xl',
|
'rounded-xl',
|
||||||
'font-controls whitespace-nowrap',
|
'font-controls whitespace-nowrap',
|
||||||
|
|
|
@ -15,7 +15,7 @@ import {
|
||||||
IconRESTapi,
|
IconRESTapi,
|
||||||
IconUser
|
IconUser
|
||||||
} from '@/components/Icons';
|
} from '@/components/Icons';
|
||||||
import { CProps } from '@/components/props';
|
import { type EventMouse } from '@/components/props';
|
||||||
import { usePreferencesStore } from '@/stores/preferences';
|
import { usePreferencesStore } from '@/stores/preferences';
|
||||||
|
|
||||||
import { urls } from '../urls';
|
import { urls } from '../urls';
|
||||||
|
@ -39,7 +39,7 @@ export function UserDropdown({ isOpen, hideDropdown }: UserDropdownProps) {
|
||||||
const adminMode = usePreferencesStore(state => state.adminMode);
|
const adminMode = usePreferencesStore(state => state.adminMode);
|
||||||
const toggleAdminMode = usePreferencesStore(state => state.toggleAdminMode);
|
const toggleAdminMode = usePreferencesStore(state => state.toggleAdminMode);
|
||||||
|
|
||||||
function navigateProfile(event: CProps.EventMouse) {
|
function navigateProfile(event: EventMouse) {
|
||||||
hideDropdown();
|
hideDropdown();
|
||||||
router.push(urls.profile, event.ctrlKey || event.metaKey);
|
router.push(urls.profile, event.ctrlKey || event.metaKey);
|
||||||
}
|
}
|
||||||
|
@ -54,7 +54,7 @@ export function UserDropdown({ isOpen, hideDropdown }: UserDropdownProps) {
|
||||||
void logout().then(() => router.push(urls.admin, true));
|
void logout().then(() => router.push(urls.admin, true));
|
||||||
}
|
}
|
||||||
|
|
||||||
function gotoIcons(event: CProps.EventMouse) {
|
function gotoIcons(event: EventMouse) {
|
||||||
hideDropdown();
|
hideDropdown();
|
||||||
router.push(urls.icons, event.ctrlKey || event.metaKey);
|
router.push(urls.icons, event.ctrlKey || event.metaKey);
|
||||||
}
|
}
|
||||||
|
@ -64,7 +64,7 @@ export function UserDropdown({ isOpen, hideDropdown }: UserDropdownProps) {
|
||||||
router.push(urls.rest_api, true);
|
router.push(urls.rest_api, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
function gotoDatabaseSchema(event: CProps.EventMouse) {
|
function gotoDatabaseSchema(event: EventMouse) {
|
||||||
hideDropdown();
|
hideDropdown();
|
||||||
router.push(urls.database_schema, event.ctrlKey || event.metaKey);
|
router.push(urls.database_schema, event.ctrlKey || event.metaKey);
|
||||||
}
|
}
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
* Module: generic API for backend REST communications using axios library.
|
* Module: generic API for backend REST communications using axios library.
|
||||||
*/
|
*/
|
||||||
import { toast } from 'react-toastify';
|
import { toast } from 'react-toastify';
|
||||||
import axios, { AxiosError, AxiosRequestConfig } from 'axios';
|
import axios, { AxiosError, type AxiosRequestConfig } from 'axios';
|
||||||
import { z, ZodError } from 'zod';
|
import { z, ZodError } from 'zod';
|
||||||
|
|
||||||
import { buildConstants } from '@/utils/buildConstants';
|
import { buildConstants } from '@/utils/buildConstants';
|
||||||
|
|
|
@ -1,8 +1,8 @@
|
||||||
import clsx from 'clsx';
|
import clsx from 'clsx';
|
||||||
|
|
||||||
import { CProps } from '../props';
|
import { type Styling } from '../props';
|
||||||
|
|
||||||
interface DividerProps extends CProps.Styling {
|
interface DividerProps extends Styling {
|
||||||
/** Indicates whether the divider is vertical. */
|
/** Indicates whether the divider is vertical. */
|
||||||
vertical?: boolean;
|
vertical?: boolean;
|
||||||
|
|
||||||
|
|
|
@ -1,12 +1,12 @@
|
||||||
import clsx from 'clsx';
|
import clsx from 'clsx';
|
||||||
|
|
||||||
import { CProps } from '../props';
|
import { type Div } from '../props';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* `flex` column container.
|
* `flex` column container.
|
||||||
* This component is useful for creating vertical layouts with flexbox.
|
* This component is useful for creating vertical layouts with flexbox.
|
||||||
*/
|
*/
|
||||||
export function FlexColumn({ className, children, ...restProps }: CProps.Div) {
|
export function FlexColumn({ className, children, ...restProps }: Div) {
|
||||||
return (
|
return (
|
||||||
<div className={clsx('cc-column', className)} {...restProps}>
|
<div className={clsx('cc-column', className)} {...restProps}>
|
||||||
{children}
|
{children}
|
||||||
|
|
|
@ -1,8 +1,8 @@
|
||||||
import clsx from 'clsx';
|
import clsx from 'clsx';
|
||||||
|
|
||||||
import { CProps } from '../props';
|
import { type Styling } from '../props';
|
||||||
|
|
||||||
interface OverlayProps extends CProps.Styling {
|
interface OverlayProps extends Styling {
|
||||||
/** Id of the overlay. */
|
/** Id of the overlay. */
|
||||||
id?: string;
|
id?: string;
|
||||||
|
|
||||||
|
|
|
@ -1,8 +1,8 @@
|
||||||
'use client';
|
'use client';
|
||||||
|
|
||||||
import { ReactNode } from 'react';
|
import { type ReactNode } from 'react';
|
||||||
import { createPortal } from 'react-dom';
|
import { createPortal } from 'react-dom';
|
||||||
import { ITooltip, Tooltip as TooltipImpl } from 'react-tooltip';
|
import { type ITooltip, Tooltip as TooltipImpl } from 'react-tooltip';
|
||||||
import clsx from 'clsx';
|
import clsx from 'clsx';
|
||||||
|
|
||||||
import { usePreferencesStore } from '@/stores/preferences';
|
import { usePreferencesStore } from '@/stores/preferences';
|
||||||
|
|
|
@ -2,9 +2,9 @@ import clsx from 'clsx';
|
||||||
|
|
||||||
import { globalIDs } from '@/utils/constants';
|
import { globalIDs } from '@/utils/constants';
|
||||||
|
|
||||||
import { CProps } from '../props';
|
import { type Button as ButtonStyle, type Colors, type Control } from '../props';
|
||||||
|
|
||||||
interface ButtonProps extends CProps.Control, CProps.Colors, CProps.Button {
|
interface ButtonProps extends Control, Colors, ButtonStyle {
|
||||||
/** Icon to display first. */
|
/** Icon to display first. */
|
||||||
icon?: React.ReactNode;
|
icon?: React.ReactNode;
|
||||||
|
|
||||||
|
@ -45,12 +45,12 @@ export function Button({
|
||||||
'select-none disabled:cursor-auto',
|
'select-none disabled:cursor-auto',
|
||||||
'cc-animate-color',
|
'cc-animate-color',
|
||||||
{
|
{
|
||||||
'border rounded': !noBorder,
|
'border rounded-sm': !noBorder,
|
||||||
'px-1': dense,
|
'px-1': dense,
|
||||||
'px-3 py-1': !dense,
|
'px-3 py-1': !dense,
|
||||||
'cursor-progress': loading,
|
'cursor-progress': loading,
|
||||||
'cursor-pointer': !loading,
|
'cursor-pointer': !loading,
|
||||||
'outline-none': noOutline,
|
'outline-hidden': noOutline,
|
||||||
'clr-outline': !noOutline
|
'clr-outline': !noOutline
|
||||||
},
|
},
|
||||||
className,
|
className,
|
||||||
|
|
|
@ -2,9 +2,9 @@ import clsx from 'clsx';
|
||||||
|
|
||||||
import { globalIDs } from '@/utils/constants';
|
import { globalIDs } from '@/utils/constants';
|
||||||
|
|
||||||
import { CProps } from '../props';
|
import { type Button } from '../props';
|
||||||
|
|
||||||
interface MiniButtonProps extends CProps.Button {
|
interface MiniButtonProps extends Button {
|
||||||
/** Button type. */
|
/** Button type. */
|
||||||
type?: 'button' | 'submit';
|
type?: 'button' | 'submit';
|
||||||
|
|
||||||
|
@ -43,7 +43,7 @@ export function MiniButton({
|
||||||
'cursor-pointer disabled:cursor-auto',
|
'cursor-pointer disabled:cursor-auto',
|
||||||
{
|
{
|
||||||
'px-1 py-1': !noPadding,
|
'px-1 py-1': !noPadding,
|
||||||
'outline-none': noHover,
|
'outline-hidden': noHover,
|
||||||
'clr-hover': !noHover
|
'clr-hover': !noHover
|
||||||
},
|
},
|
||||||
className
|
className
|
||||||
|
|
|
@ -2,9 +2,9 @@ import clsx from 'clsx';
|
||||||
|
|
||||||
import { globalIDs } from '@/utils/constants';
|
import { globalIDs } from '@/utils/constants';
|
||||||
|
|
||||||
import { CProps } from '../props';
|
import { type Button } from '../props';
|
||||||
|
|
||||||
interface SelectorButtonProps extends CProps.Button {
|
interface SelectorButtonProps extends Button {
|
||||||
/** Text to display in the button. */
|
/** Text to display in the button. */
|
||||||
text?: string;
|
text?: string;
|
||||||
|
|
||||||
|
|
|
@ -1,8 +1,8 @@
|
||||||
import clsx from 'clsx';
|
import clsx from 'clsx';
|
||||||
|
|
||||||
import { CProps } from '../props';
|
import { type Button } from '../props';
|
||||||
|
|
||||||
interface SubmitButtonProps extends CProps.Button {
|
interface SubmitButtonProps extends Button {
|
||||||
/** Text to display in the button. */
|
/** Text to display in the button. */
|
||||||
text?: string;
|
text?: string;
|
||||||
|
|
||||||
|
|
|
@ -3,21 +3,21 @@
|
||||||
|
|
||||||
import { useMemo, useState } from 'react';
|
import { useMemo, useState } from 'react';
|
||||||
import {
|
import {
|
||||||
ColumnSort,
|
type ColumnSort,
|
||||||
createColumnHelper,
|
createColumnHelper,
|
||||||
getCoreRowModel,
|
getCoreRowModel,
|
||||||
getPaginationRowModel,
|
getPaginationRowModel,
|
||||||
getSortedRowModel,
|
getSortedRowModel,
|
||||||
PaginationState,
|
type PaginationState,
|
||||||
RowData,
|
type RowData,
|
||||||
type RowSelectionState,
|
type RowSelectionState,
|
||||||
SortingState,
|
type SortingState,
|
||||||
TableOptions,
|
type TableOptions,
|
||||||
useReactTable,
|
useReactTable,
|
||||||
type VisibilityState
|
type VisibilityState
|
||||||
} from '@tanstack/react-table';
|
} from '@tanstack/react-table';
|
||||||
|
|
||||||
import { CProps } from '../props';
|
import { type EventMouse, type Styling } from '../props';
|
||||||
|
|
||||||
import { DefaultNoData } from './DefaultNoData';
|
import { DefaultNoData } from './DefaultNoData';
|
||||||
import { PaginationTools } from './PaginationTools';
|
import { PaginationTools } from './PaginationTools';
|
||||||
|
@ -37,7 +37,7 @@ export interface IConditionalStyle<TData> {
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface DataTableProps<TData extends RowData>
|
export interface DataTableProps<TData extends RowData>
|
||||||
extends CProps.Styling,
|
extends Styling,
|
||||||
Pick<TableOptions<TData>, 'data' | 'columns' | 'onRowSelectionChange' | 'onColumnVisibilityChange'> {
|
Pick<TableOptions<TData>, 'data' | 'columns' | 'onRowSelectionChange' | 'onColumnVisibilityChange'> {
|
||||||
/** Id of the component. */
|
/** Id of the component. */
|
||||||
id?: string;
|
id?: string;
|
||||||
|
@ -67,10 +67,10 @@ export interface DataTableProps<TData extends RowData>
|
||||||
noDataComponent?: React.ReactNode;
|
noDataComponent?: React.ReactNode;
|
||||||
|
|
||||||
/** Callback to be called when a row is clicked. */
|
/** Callback to be called when a row is clicked. */
|
||||||
onRowClicked?: (rowData: TData, event: CProps.EventMouse) => void;
|
onRowClicked?: (rowData: TData, event: EventMouse) => void;
|
||||||
|
|
||||||
/** Callback to be called when a row is double clicked. */
|
/** Callback to be called when a row is double clicked. */
|
||||||
onRowDoubleClicked?: (rowData: TData, event: CProps.EventMouse) => void;
|
onRowDoubleClicked?: (rowData: TData, event: EventMouse) => void;
|
||||||
|
|
||||||
/** Enable row selection. */
|
/** Enable row selection. */
|
||||||
enableRowSelection?: boolean;
|
enableRowSelection?: boolean;
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
'use no memo';
|
'use no memo';
|
||||||
|
|
||||||
import { useCallback } from 'react';
|
import { useCallback } from 'react';
|
||||||
import { Table } from '@tanstack/react-table';
|
import { type Table } from '@tanstack/react-table';
|
||||||
import clsx from 'clsx';
|
import clsx from 'clsx';
|
||||||
|
|
||||||
import { prefixes } from '@/utils/constants';
|
import { prefixes } from '@/utils/constants';
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
'use no memo';
|
'use no memo';
|
||||||
|
|
||||||
import { Table } from '@tanstack/react-table';
|
import { type Table } from '@tanstack/react-table';
|
||||||
|
|
||||||
import { CheckboxTristate } from '../Input';
|
import { CheckboxTristate } from '../Input';
|
||||||
|
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
'use no memo';
|
'use no memo';
|
||||||
|
|
||||||
import { Row } from '@tanstack/react-table';
|
import { type Row } from '@tanstack/react-table';
|
||||||
|
|
||||||
import { Checkbox } from '../Input';
|
import { Checkbox } from '../Input';
|
||||||
|
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
'use no memo';
|
'use no memo';
|
||||||
|
|
||||||
import { Column } from '@tanstack/react-table';
|
import { type Column } from '@tanstack/react-table';
|
||||||
|
|
||||||
import { IconSortAsc, IconSortDesc } from '../Icons';
|
import { IconSortAsc, IconSortDesc } from '../Icons';
|
||||||
|
|
||||||
|
|
|
@ -1,12 +1,12 @@
|
||||||
'use no memo';
|
'use no memo';
|
||||||
|
|
||||||
import { Cell, flexRender, Row, Table } from '@tanstack/react-table';
|
import { type Cell, flexRender, type Row, type Table } from '@tanstack/react-table';
|
||||||
import clsx from 'clsx';
|
import clsx from 'clsx';
|
||||||
|
|
||||||
import { CProps } from '../props';
|
import { type EventMouse } from '../props';
|
||||||
|
|
||||||
import { SelectRow } from './SelectRow';
|
import { SelectRow } from './SelectRow';
|
||||||
import { IConditionalStyle } from '.';
|
import { type IConditionalStyle } from '.';
|
||||||
|
|
||||||
interface TableBodyProps<TData> {
|
interface TableBodyProps<TData> {
|
||||||
table: Table<TData>;
|
table: Table<TData>;
|
||||||
|
@ -18,8 +18,8 @@ interface TableBodyProps<TData> {
|
||||||
lastSelected: string | null;
|
lastSelected: string | null;
|
||||||
onChangeLastSelected: (newValue: string | null) => void;
|
onChangeLastSelected: (newValue: string | null) => void;
|
||||||
|
|
||||||
onRowClicked?: (rowData: TData, event: CProps.EventMouse) => void;
|
onRowClicked?: (rowData: TData, event: EventMouse) => void;
|
||||||
onRowDoubleClicked?: (rowData: TData, event: CProps.EventMouse) => void;
|
onRowDoubleClicked?: (rowData: TData, event: EventMouse) => void;
|
||||||
}
|
}
|
||||||
|
|
||||||
export function TableBody<TData>({
|
export function TableBody<TData>({
|
||||||
|
@ -33,7 +33,7 @@ export function TableBody<TData>({
|
||||||
onRowClicked,
|
onRowClicked,
|
||||||
onRowDoubleClicked
|
onRowDoubleClicked
|
||||||
}: TableBodyProps<TData>) {
|
}: TableBodyProps<TData>) {
|
||||||
function handleRowClicked(target: Row<TData>, event: CProps.EventMouse) {
|
function handleRowClicked(target: Row<TData>, event: EventMouse) {
|
||||||
onRowClicked?.(target.original, event);
|
onRowClicked?.(target.original, event);
|
||||||
if (enableRowSelection && target.getCanSelect()) {
|
if (enableRowSelection && target.getCanSelect()) {
|
||||||
if (event.shiftKey && !!lastSelected && lastSelected !== target.id) {
|
if (event.shiftKey && !!lastSelected && lastSelected !== target.id) {
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
'use no memo';
|
'use no memo';
|
||||||
|
|
||||||
import { flexRender, Header, HeaderGroup, Table } from '@tanstack/react-table';
|
import { flexRender, type Header, type HeaderGroup, type Table } from '@tanstack/react-table';
|
||||||
|
|
||||||
interface TableFooterProps<TData> {
|
interface TableFooterProps<TData> {
|
||||||
table: Table<TData>;
|
table: Table<TData>;
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
'use no memo';
|
'use no memo';
|
||||||
|
|
||||||
import { flexRender, Header, HeaderGroup, Table } from '@tanstack/react-table';
|
import { flexRender, type Header, type HeaderGroup, type Table } from '@tanstack/react-table';
|
||||||
|
|
||||||
import { SelectAll } from './SelectAll';
|
import { SelectAll } from './SelectAll';
|
||||||
import { SortingIcon } from './SortingIcon';
|
import { SortingIcon } from './SortingIcon';
|
||||||
|
|
|
@ -14,7 +14,7 @@ import {
|
||||||
IconHide,
|
IconHide,
|
||||||
IconMoveDown,
|
IconMoveDown,
|
||||||
IconMoveUp,
|
IconMoveUp,
|
||||||
IconProps,
|
type IconProps,
|
||||||
IconPublic,
|
IconPublic,
|
||||||
IconSettings,
|
IconSettings,
|
||||||
IconShow,
|
IconShow,
|
||||||
|
|
|
@ -2,9 +2,9 @@ import clsx from 'clsx';
|
||||||
|
|
||||||
import { PARAMETER } from '@/utils/constants';
|
import { PARAMETER } from '@/utils/constants';
|
||||||
|
|
||||||
import { CProps } from '../props';
|
import { type Styling } from '../props';
|
||||||
|
|
||||||
interface DropdownProps extends CProps.Styling {
|
interface DropdownProps extends Styling {
|
||||||
/** Indicates whether the dropdown should stretch to the left. */
|
/** Indicates whether the dropdown should stretch to the left. */
|
||||||
stretchLeft?: boolean;
|
stretchLeft?: boolean;
|
||||||
|
|
||||||
|
|
|
@ -1,9 +1,9 @@
|
||||||
import clsx from 'clsx';
|
import clsx from 'clsx';
|
||||||
|
|
||||||
import { CProps } from '@/components/props';
|
import { type Button } from '@/components/props';
|
||||||
import { globalIDs } from '@/utils/constants';
|
import { globalIDs } from '@/utils/constants';
|
||||||
|
|
||||||
interface DropdownButtonProps extends CProps.Button {
|
interface DropdownButtonProps extends Button {
|
||||||
/** Icon to display first (not used if children are provided). */
|
/** Icon to display first (not used if children are provided). */
|
||||||
icon?: React.ReactNode;
|
icon?: React.ReactNode;
|
||||||
|
|
||||||
|
@ -36,7 +36,7 @@ export function DropdownButton({
|
||||||
onClick={onClick}
|
onClick={onClick}
|
||||||
className={clsx(
|
className={clsx(
|
||||||
'px-3 py-1 inline-flex items-center gap-2',
|
'px-3 py-1 inline-flex items-center gap-2',
|
||||||
'text-left text-sm overflow-ellipsis whitespace-nowrap',
|
'text-left text-sm text-ellipsis whitespace-nowrap',
|
||||||
'disabled:clr-text-controls',
|
'disabled:clr-text-controls',
|
||||||
'cc-animate-color',
|
'cc-animate-color',
|
||||||
{
|
{
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
import clsx from 'clsx';
|
import clsx from 'clsx';
|
||||||
|
|
||||||
import { Checkbox, CheckboxProps } from '../Input';
|
import { Checkbox, type CheckboxProps } from '../Input';
|
||||||
|
|
||||||
/** Animated {@link Checkbox} inside a {@link Dropdown} item. */
|
/** Animated {@link Checkbox} inside a {@link Dropdown} item. */
|
||||||
export function DropdownCheckbox({ onChange: setValue, disabled, ...restProps }: CheckboxProps) {
|
export function DropdownCheckbox({ onChange: setValue, disabled, ...restProps }: CheckboxProps) {
|
||||||
|
@ -8,7 +8,7 @@ export function DropdownCheckbox({ onChange: setValue, disabled, ...restProps }:
|
||||||
<div
|
<div
|
||||||
className={clsx(
|
className={clsx(
|
||||||
'px-3 py-1',
|
'px-3 py-1',
|
||||||
'text-left overflow-ellipsis whitespace-nowrap',
|
'text-left text-ellipsis whitespace-nowrap',
|
||||||
'disabled:clr-text-controls cc-animate-color',
|
'disabled:clr-text-controls cc-animate-color',
|
||||||
!!setValue && !disabled && 'clr-hover'
|
!!setValue && !disabled && 'clr-hover'
|
||||||
)}
|
)}
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
import { EdgeProps, getStraightPath } from 'reactflow';
|
import { type EdgeProps, getStraightPath } from 'reactflow';
|
||||||
|
|
||||||
import { PARAMETER } from '@/utils/constants';
|
import { PARAMETER } from '@/utils/constants';
|
||||||
|
|
||||||
|
|
|
@ -3,9 +3,9 @@ import clsx from 'clsx';
|
||||||
import { globalIDs } from '@/utils/constants';
|
import { globalIDs } from '@/utils/constants';
|
||||||
|
|
||||||
import { CheckboxChecked } from '../Icons';
|
import { CheckboxChecked } from '../Icons';
|
||||||
import { CProps } from '../props';
|
import { type Button, type EventMouse } from '../props';
|
||||||
|
|
||||||
export interface CheckboxProps extends Omit<CProps.Button, 'value' | 'onClick' | 'onChange'> {
|
export interface CheckboxProps extends Omit<Button, 'value' | 'onClick' | 'onChange'> {
|
||||||
/** Label to display next to the checkbox. */
|
/** Label to display next to the checkbox. */
|
||||||
label?: string;
|
label?: string;
|
||||||
|
|
||||||
|
@ -35,7 +35,7 @@ export function Checkbox({
|
||||||
}: CheckboxProps) {
|
}: CheckboxProps) {
|
||||||
const cursor = disabled ? 'cursor-arrow' : onChange ? 'cursor-pointer' : '';
|
const cursor = disabled ? 'cursor-arrow' : onChange ? 'cursor-pointer' : '';
|
||||||
|
|
||||||
function handleClick(event: CProps.EventMouse): void {
|
function handleClick(event: EventMouse): void {
|
||||||
event.preventDefault();
|
event.preventDefault();
|
||||||
event.stopPropagation();
|
event.stopPropagation();
|
||||||
if (disabled || !onChange) {
|
if (disabled || !onChange) {
|
||||||
|
@ -49,7 +49,7 @@ export function Checkbox({
|
||||||
type='button'
|
type='button'
|
||||||
className={clsx(
|
className={clsx(
|
||||||
'flex items-center gap-2', //
|
'flex items-center gap-2', //
|
||||||
'outline-none',
|
'outline-hidden',
|
||||||
'focus-frame',
|
'focus-frame',
|
||||||
cursor,
|
cursor,
|
||||||
className
|
className
|
||||||
|
@ -66,7 +66,7 @@ export function Checkbox({
|
||||||
className={clsx(
|
className={clsx(
|
||||||
'max-w-[1rem] min-w-[1rem] h-4', //
|
'max-w-[1rem] min-w-[1rem] h-4', //
|
||||||
'pt-[0.05rem] pl-[0.05rem]',
|
'pt-[0.05rem] pl-[0.05rem]',
|
||||||
'border rounded-sm',
|
'border rounded-xs',
|
||||||
'cc-animate-color',
|
'cc-animate-color',
|
||||||
{
|
{
|
||||||
'bg-sec-600 text-sec-0': value !== false,
|
'bg-sec-600 text-sec-0': value !== false,
|
||||||
|
|
|
@ -3,9 +3,9 @@ import clsx from 'clsx';
|
||||||
import { globalIDs } from '@/utils/constants';
|
import { globalIDs } from '@/utils/constants';
|
||||||
|
|
||||||
import { CheckboxChecked, CheckboxNull } from '../Icons';
|
import { CheckboxChecked, CheckboxNull } from '../Icons';
|
||||||
import { CProps } from '../props';
|
import { type EventMouse } from '../props';
|
||||||
|
|
||||||
import { CheckboxProps } from './Checkbox';
|
import { type CheckboxProps } from './Checkbox';
|
||||||
|
|
||||||
export interface CheckboxTristateProps extends Omit<CheckboxProps, 'value' | 'onChange'> {
|
export interface CheckboxTristateProps extends Omit<CheckboxProps, 'value' | 'onChange'> {
|
||||||
/** Current value - `null`, `true` or `false`. */
|
/** Current value - `null`, `true` or `false`. */
|
||||||
|
@ -31,7 +31,7 @@ export function CheckboxTristate({
|
||||||
}: CheckboxTristateProps) {
|
}: CheckboxTristateProps) {
|
||||||
const cursor = disabled ? 'cursor-arrow' : onChange ? 'cursor-pointer' : '';
|
const cursor = disabled ? 'cursor-arrow' : onChange ? 'cursor-pointer' : '';
|
||||||
|
|
||||||
function handleClick(event: CProps.EventMouse): void {
|
function handleClick(event: EventMouse): void {
|
||||||
event.preventDefault();
|
event.preventDefault();
|
||||||
event.stopPropagation();
|
event.stopPropagation();
|
||||||
if (disabled || !onChange) {
|
if (disabled || !onChange) {
|
||||||
|
@ -51,7 +51,7 @@ export function CheckboxTristate({
|
||||||
type='button'
|
type='button'
|
||||||
className={clsx(
|
className={clsx(
|
||||||
'flex items-center gap-2', //
|
'flex items-center gap-2', //
|
||||||
'outline-none',
|
'outline-hidden',
|
||||||
'focus-frame',
|
'focus-frame',
|
||||||
cursor,
|
cursor,
|
||||||
className
|
className
|
||||||
|
@ -68,7 +68,7 @@ export function CheckboxTristate({
|
||||||
className={clsx(
|
className={clsx(
|
||||||
'w-4 h-4', //
|
'w-4 h-4', //
|
||||||
'pt-[0.05rem] pl-[0.05rem]',
|
'pt-[0.05rem] pl-[0.05rem]',
|
||||||
'border rounded-sm',
|
'border rounded-xs',
|
||||||
'cc-animate-color',
|
'cc-animate-color',
|
||||||
{
|
{
|
||||||
'bg-sec-600 text-sec-0': value !== false,
|
'bg-sec-600 text-sec-0': value !== false,
|
||||||
|
|
|
@ -1,9 +1,9 @@
|
||||||
import { FieldError, GlobalError } from 'react-hook-form';
|
import { type FieldError, type GlobalError } from 'react-hook-form';
|
||||||
import clsx from 'clsx';
|
import clsx from 'clsx';
|
||||||
|
|
||||||
import { CProps } from '../props';
|
import { type Styling } from '../props';
|
||||||
|
|
||||||
interface ErrorFieldProps extends CProps.Styling {
|
interface ErrorFieldProps extends Styling {
|
||||||
error?: FieldError | GlobalError;
|
error?: FieldError | GlobalError;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -5,11 +5,11 @@ import clsx from 'clsx';
|
||||||
|
|
||||||
import { Button } from '../Control';
|
import { Button } from '../Control';
|
||||||
import { IconUpload } from '../Icons';
|
import { IconUpload } from '../Icons';
|
||||||
import { CProps } from '../props';
|
import { type Input } from '../props';
|
||||||
|
|
||||||
import { Label } from './Label';
|
import { Label } from './Label';
|
||||||
|
|
||||||
interface FileInputProps extends Omit<CProps.Input, 'accept' | 'type'> {
|
interface FileInputProps extends Omit<Input, 'accept' | 'type'> {
|
||||||
/** Label to display in file upload button. */
|
/** Label to display in file upload button. */
|
||||||
label: string;
|
label: string;
|
||||||
|
|
||||||
|
|
|
@ -1,8 +1,8 @@
|
||||||
import clsx from 'clsx';
|
import clsx from 'clsx';
|
||||||
|
|
||||||
import { CProps } from '../props';
|
import { type Label as LabelStyle } from '../props';
|
||||||
|
|
||||||
interface LabelProps extends CProps.Label {
|
interface LabelProps extends LabelStyle {
|
||||||
/** Text to display. */
|
/** Text to display. */
|
||||||
text?: string;
|
text?: string;
|
||||||
}
|
}
|
||||||
|
|
|
@ -2,11 +2,11 @@ import clsx from 'clsx';
|
||||||
|
|
||||||
import { Overlay } from '@/components/Container';
|
import { Overlay } from '@/components/Container';
|
||||||
import { IconSearch } from '@/components/Icons';
|
import { IconSearch } from '@/components/Icons';
|
||||||
import { CProps } from '@/components/props';
|
import { type Styling } from '@/components/props';
|
||||||
|
|
||||||
import { TextInput } from './TextInput';
|
import { TextInput } from './TextInput';
|
||||||
|
|
||||||
interface SearchBarProps extends CProps.Styling {
|
interface SearchBarProps extends Styling {
|
||||||
/** Id of the search bar. */
|
/** Id of the search bar. */
|
||||||
id?: string;
|
id?: string;
|
||||||
|
|
||||||
|
@ -50,7 +50,8 @@ export function SearchBar({
|
||||||
noOutline
|
noOutline
|
||||||
placeholder={placeholder}
|
placeholder={placeholder}
|
||||||
type='search'
|
type='search'
|
||||||
className={clsx('outline-none bg-transparent', !noIcon && 'pl-10')}
|
colors='bg-transparent'
|
||||||
|
className={clsx(!noIcon && 'pl-10')}
|
||||||
noBorder={noBorder}
|
noBorder={noBorder}
|
||||||
value={query}
|
value={query}
|
||||||
onChange={event => onChangeQuery?.(event.target.value)}
|
onChange={event => onChangeQuery?.(event.target.value)}
|
||||||
|
|
|
@ -1,12 +1,12 @@
|
||||||
'use client';
|
'use client';
|
||||||
|
|
||||||
import Select, {
|
import Select, {
|
||||||
ClearIndicatorProps,
|
type ClearIndicatorProps,
|
||||||
components,
|
components,
|
||||||
DropdownIndicatorProps,
|
type DropdownIndicatorProps,
|
||||||
GroupBase,
|
type GroupBase,
|
||||||
Props,
|
type Props,
|
||||||
StylesConfig
|
type StylesConfig
|
||||||
} from 'react-select';
|
} from 'react-select';
|
||||||
|
|
||||||
import { useWindowSize } from '@/hooks/useWindowSize';
|
import { useWindowSize } from '@/hooks/useWindowSize';
|
||||||
|
|
|
@ -1,12 +1,12 @@
|
||||||
'use client';
|
'use client';
|
||||||
|
|
||||||
import Select, {
|
import Select, {
|
||||||
ClearIndicatorProps,
|
type ClearIndicatorProps,
|
||||||
components,
|
components,
|
||||||
DropdownIndicatorProps,
|
type DropdownIndicatorProps,
|
||||||
GroupBase,
|
type GroupBase,
|
||||||
Props,
|
type Props,
|
||||||
StylesConfig
|
type StylesConfig
|
||||||
} from 'react-select';
|
} from 'react-select';
|
||||||
|
|
||||||
import { useWindowSize } from '@/hooks/useWindowSize';
|
import { useWindowSize } from '@/hooks/useWindowSize';
|
||||||
|
|
|
@ -6,9 +6,9 @@ import { globalIDs, PARAMETER } from '@/utils/constants';
|
||||||
import { Overlay } from '../Container';
|
import { Overlay } from '../Container';
|
||||||
import { MiniButton } from '../Control';
|
import { MiniButton } from '../Control';
|
||||||
import { IconDropArrow, IconPageRight } from '../Icons';
|
import { IconDropArrow, IconPageRight } from '../Icons';
|
||||||
import { CProps } from '../props';
|
import { type EventMouse, type Styling } from '../props';
|
||||||
|
|
||||||
interface SelectTreeProps<ItemType> extends CProps.Styling {
|
interface SelectTreeProps<ItemType> extends Styling {
|
||||||
/** Current value. */
|
/** Current value. */
|
||||||
value: ItemType;
|
value: ItemType;
|
||||||
|
|
||||||
|
@ -66,13 +66,13 @@ export function SelectTree<ItemType>({
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
function handleClickFold(event: CProps.EventMouse, target: ItemType, showChildren: boolean) {
|
function handleClickFold(event: EventMouse, target: ItemType, showChildren: boolean) {
|
||||||
event.preventDefault();
|
event.preventDefault();
|
||||||
event.stopPropagation();
|
event.stopPropagation();
|
||||||
onFoldItem(target, showChildren);
|
onFoldItem(target, showChildren);
|
||||||
}
|
}
|
||||||
|
|
||||||
function handleSetValue(event: CProps.EventMouse, target: ItemType) {
|
function handleSetValue(event: EventMouse, target: ItemType) {
|
||||||
event.preventDefault();
|
event.preventDefault();
|
||||||
event.stopPropagation();
|
event.stopPropagation();
|
||||||
onChange(target);
|
onChange(target);
|
||||||
|
|
|
@ -1,11 +1,11 @@
|
||||||
import clsx from 'clsx';
|
import clsx from 'clsx';
|
||||||
|
|
||||||
import { Label } from '../Input/Label';
|
import { Label } from '../Input/Label';
|
||||||
import { CProps } from '../props';
|
import { type Colors, type Editor, type ErrorProcessing, type TextArea as TextAreaStyle } from '../props';
|
||||||
|
|
||||||
import { ErrorField } from './ErrorField';
|
import { ErrorField } from './ErrorField';
|
||||||
|
|
||||||
export interface TextAreaProps extends CProps.Editor, CProps.ErrorProcessing, CProps.Colors, CProps.TextArea {
|
export interface TextAreaProps extends Editor, ErrorProcessing, Colors, TextAreaStyle {
|
||||||
/** Indicates that padding should be minimal. */
|
/** Indicates that padding should be minimal. */
|
||||||
dense?: boolean;
|
dense?: boolean;
|
||||||
|
|
||||||
|
@ -40,7 +40,7 @@ export function TextArea({
|
||||||
'w-full',
|
'w-full',
|
||||||
{
|
{
|
||||||
'flex flex-col': !dense,
|
'flex flex-col': !dense,
|
||||||
'flex flex-grow items-center gap-3': dense
|
'flex grow items-center gap-3': dense
|
||||||
},
|
},
|
||||||
dense && className
|
dense && className
|
||||||
)}
|
)}
|
||||||
|
@ -56,7 +56,7 @@ export function TextArea({
|
||||||
'cc-fit-content': fitContent,
|
'cc-fit-content': fitContent,
|
||||||
'resize-none': noResize,
|
'resize-none': noResize,
|
||||||
'border': !noBorder,
|
'border': !noBorder,
|
||||||
'flex-grow max-w-full': dense,
|
'grow max-w-full': dense,
|
||||||
'mt-2': !dense && !!label,
|
'mt-2': !dense && !!label,
|
||||||
'clr-outline': !noOutline
|
'clr-outline': !noOutline
|
||||||
},
|
},
|
||||||
|
|
|
@ -1,11 +1,11 @@
|
||||||
import clsx from 'clsx';
|
import clsx from 'clsx';
|
||||||
|
|
||||||
import { Label } from '../Input/Label';
|
import { Label } from '../Input/Label';
|
||||||
import { CProps } from '../props';
|
import { type Colors, type Editor, type ErrorProcessing, type Input } from '../props';
|
||||||
|
|
||||||
import { ErrorField } from './ErrorField';
|
import { ErrorField } from './ErrorField';
|
||||||
|
|
||||||
interface TextInputProps extends CProps.Editor, CProps.ErrorProcessing, CProps.Colors, CProps.Input {
|
interface TextInputProps extends Editor, ErrorProcessing, Colors, Input {
|
||||||
/** Indicates that padding should be minimal. */
|
/** Indicates that padding should be minimal. */
|
||||||
dense?: boolean;
|
dense?: boolean;
|
||||||
|
|
||||||
|
@ -54,7 +54,7 @@ export function TextInput({
|
||||||
'leading-tight truncate hover:text-clip',
|
'leading-tight truncate hover:text-clip',
|
||||||
{
|
{
|
||||||
'px-3': !noBorder || !disabled,
|
'px-3': !noBorder || !disabled,
|
||||||
'flex-grow max-w-full': dense,
|
'grow max-w-full': dense,
|
||||||
'mt-2': !dense && !!label,
|
'mt-2': !dense && !!label,
|
||||||
'border': !noBorder,
|
'border': !noBorder,
|
||||||
'clr-outline': !noOutline
|
'clr-outline': !noOutline
|
||||||
|
|
|
@ -11,11 +11,11 @@ import { prepareTooltip } from '@/utils/utils';
|
||||||
|
|
||||||
import { Button, MiniButton, SubmitButton } from '../Control';
|
import { Button, MiniButton, SubmitButton } from '../Control';
|
||||||
import { IconClose } from '../Icons';
|
import { IconClose } from '../Icons';
|
||||||
import { CProps } from '../props';
|
import { type Styling } from '../props';
|
||||||
|
|
||||||
import { ModalBackdrop } from './ModalBackdrop';
|
import { ModalBackdrop } from './ModalBackdrop';
|
||||||
|
|
||||||
export interface ModalProps extends CProps.Styling {
|
export interface ModalProps extends Styling {
|
||||||
/** Title of the modal window. */
|
/** Title of the modal window. */
|
||||||
header?: string;
|
header?: string;
|
||||||
|
|
||||||
|
@ -115,7 +115,7 @@ export function ModalForm({
|
||||||
|
|
||||||
<div
|
<div
|
||||||
className={clsx(
|
className={clsx(
|
||||||
'overscroll-contain max-h-[calc(100svh-8rem)] max-w-[100svw] xs:max-w-[calc(100svw-2rem)] outline-none',
|
'overscroll-contain max-h-[calc(100svh-8rem)] max-w-[100svw] xs:max-w-[calc(100svw-2rem)] outline-hidden',
|
||||||
{
|
{
|
||||||
'overflow-auto': !overflowVisible,
|
'overflow-auto': !overflowVisible,
|
||||||
'overflow-visible': overflowVisible
|
'overflow-visible': overflowVisible
|
||||||
|
|
|
@ -13,7 +13,7 @@ import { Button, MiniButton } from '../Control';
|
||||||
import { IconClose } from '../Icons';
|
import { IconClose } from '../Icons';
|
||||||
|
|
||||||
import { ModalBackdrop } from './ModalBackdrop';
|
import { ModalBackdrop } from './ModalBackdrop';
|
||||||
import { ModalProps } from './ModalForm';
|
import { type ModalProps } from './ModalForm';
|
||||||
|
|
||||||
interface ModalViewProps extends ModalProps {}
|
interface ModalViewProps extends ModalProps {}
|
||||||
|
|
||||||
|
@ -60,7 +60,7 @@ export function ModalView({
|
||||||
|
|
||||||
<div
|
<div
|
||||||
className={clsx(
|
className={clsx(
|
||||||
'overscroll-contain max-h-[calc(100svh-8rem)] max-w-[100svw] xs:max-w-[calc(100svw-2rem)] outline-none',
|
'overscroll-contain max-h-[calc(100svh-8rem)] max-w-[100svw] xs:max-w-[calc(100svw-2rem)] outline-hidden',
|
||||||
{
|
{
|
||||||
'overflow-auto': !overflowVisible,
|
'overflow-auto': !overflowVisible,
|
||||||
'overflow-visible': overflowVisible
|
'overflow-visible': overflowVisible
|
||||||
|
|
|
@ -4,9 +4,9 @@ import clsx from 'clsx';
|
||||||
|
|
||||||
import { globalIDs } from '@/utils/constants';
|
import { globalIDs } from '@/utils/constants';
|
||||||
|
|
||||||
import { CProps } from '../props';
|
import { type Titled } from '../props';
|
||||||
|
|
||||||
interface TabLabelProps extends Omit<TabPropsImpl, 'children'>, CProps.Titled {
|
interface TabLabelProps extends Omit<TabPropsImpl, 'children'>, Titled {
|
||||||
/** Label to display in the tab. */
|
/** Label to display in the tab. */
|
||||||
label?: string;
|
label?: string;
|
||||||
}
|
}
|
||||||
|
@ -23,7 +23,7 @@ export function TabLabel({ label, title, titleHtml, hideTitle, className, ...oth
|
||||||
'clr-hover cc-animate-color duration-150',
|
'clr-hover cc-animate-color duration-150',
|
||||||
'text-sm whitespace-nowrap font-controls',
|
'text-sm whitespace-nowrap font-controls',
|
||||||
'select-none hover:cursor-pointer',
|
'select-none hover:cursor-pointer',
|
||||||
'outline-none',
|
'outline-hidden',
|
||||||
className
|
className
|
||||||
)}
|
)}
|
||||||
tabIndex='-1'
|
tabIndex='-1'
|
||||||
|
|
|
@ -1,9 +1,9 @@
|
||||||
import clsx from 'clsx';
|
import clsx from 'clsx';
|
||||||
|
|
||||||
import { CProps } from '@/components/props';
|
import { type Styling, type Titled } from '@/components/props';
|
||||||
import { globalIDs } from '@/utils/constants';
|
import { globalIDs } from '@/utils/constants';
|
||||||
|
|
||||||
interface IndicatorProps extends CProps.Titled, CProps.Styling {
|
interface IndicatorProps extends Titled, Styling {
|
||||||
/** Icon to display. */
|
/** Icon to display. */
|
||||||
icon: React.ReactNode;
|
icon: React.ReactNode;
|
||||||
|
|
||||||
|
@ -19,7 +19,7 @@ export function Indicator({ icon, title, titleHtml, hideTitle, noPadding, classN
|
||||||
<div
|
<div
|
||||||
className={clsx(
|
className={clsx(
|
||||||
'clr-text-controls',
|
'clr-text-controls',
|
||||||
'outline-none',
|
'outline-hidden',
|
||||||
{
|
{
|
||||||
'px-1 py-1': !noPadding
|
'px-1 py-1': !noPadding
|
||||||
},
|
},
|
||||||
|
|
|
@ -1,11 +1,11 @@
|
||||||
import clsx from 'clsx';
|
import clsx from 'clsx';
|
||||||
|
|
||||||
import { CProps } from '@/components/props';
|
import { type Div } from '@/components/props';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Wraps content in a div with a centered text.
|
* Wraps content in a div with a centered text.
|
||||||
*/
|
*/
|
||||||
export function NoData({ className, children, ...restProps }: CProps.Div) {
|
export function NoData({ className, children, ...restProps }: Div) {
|
||||||
return (
|
return (
|
||||||
<div className={clsx('p-3 flex flex-col items-center text-center select-none w-full', className)} {...restProps}>
|
<div className={clsx('p-3 flex flex-col items-center text-center select-none w-full', className)} {...restProps}>
|
||||||
{children}
|
{children}
|
||||||
|
|
|
@ -1,10 +1,11 @@
|
||||||
import clsx from 'clsx';
|
import clsx from 'clsx';
|
||||||
|
|
||||||
import { CProps } from '@/components/props';
|
|
||||||
import { globalIDs } from '@/utils/constants';
|
import { globalIDs } from '@/utils/constants';
|
||||||
import { truncateToLastWord } from '@/utils/utils';
|
import { truncateToLastWord } from '@/utils/utils';
|
||||||
|
|
||||||
export interface TextContentProps extends CProps.Styling {
|
import { type Styling } from '../props';
|
||||||
|
|
||||||
|
export interface TextContentProps extends Styling {
|
||||||
/** Text to display. */
|
/** Text to display. */
|
||||||
text: string;
|
text: string;
|
||||||
|
|
||||||
|
|
|
@ -1,11 +1,11 @@
|
||||||
import clsx from 'clsx';
|
import clsx from 'clsx';
|
||||||
|
|
||||||
import { CProps } from '@/components/props';
|
|
||||||
import { globalIDs } from '@/utils/constants';
|
import { globalIDs } from '@/utils/constants';
|
||||||
|
|
||||||
import { MiniButton } from '../Control';
|
import { MiniButton } from '../Control';
|
||||||
|
import { type EventMouse, type Styling, type Titled } from '../props';
|
||||||
|
|
||||||
interface ValueIconProps extends CProps.Styling, CProps.Titled {
|
interface ValueIconProps extends Styling, Titled {
|
||||||
/** Id of the component. */
|
/** Id of the component. */
|
||||||
id?: string;
|
id?: string;
|
||||||
|
|
||||||
|
@ -19,7 +19,7 @@ interface ValueIconProps extends CProps.Styling, CProps.Titled {
|
||||||
textClassName?: string;
|
textClassName?: string;
|
||||||
|
|
||||||
/** Callback to be called when the component is clicked. */
|
/** Callback to be called when the component is clicked. */
|
||||||
onClick?: (event: CProps.EventMouse) => void;
|
onClick?: (event: EventMouse) => void;
|
||||||
|
|
||||||
/** Number of symbols to display in a small size. */
|
/** Number of symbols to display in a small size. */
|
||||||
smallThreshold?: number;
|
smallThreshold?: number;
|
||||||
|
|
|
@ -1,8 +1,8 @@
|
||||||
import clsx from 'clsx';
|
import clsx from 'clsx';
|
||||||
|
|
||||||
import { CProps } from '@/components/props';
|
import { type Styling } from '@/components/props';
|
||||||
|
|
||||||
interface ValueLabeledProps extends CProps.Styling {
|
interface ValueLabeledProps extends Styling {
|
||||||
/** Id of the component. */
|
/** Id of the component. */
|
||||||
id?: string;
|
id?: string;
|
||||||
|
|
||||||
|
|
|
@ -1,9 +1,9 @@
|
||||||
import { CProps } from '@/components/props';
|
import { type Styling, type Titled } from '@/components/props';
|
||||||
import { PARAMETER } from '@/utils/constants';
|
import { PARAMETER } from '@/utils/constants';
|
||||||
|
|
||||||
import { ValueIcon } from './ValueIcon';
|
import { ValueIcon } from './ValueIcon';
|
||||||
|
|
||||||
interface ValueStatsProps extends CProps.Styling, CProps.Titled {
|
interface ValueStatsProps extends Styling, Titled {
|
||||||
/** Id of the component. */
|
/** Id of the component. */
|
||||||
id: string;
|
id: string;
|
||||||
|
|
||||||
|
|
2
rsconcept/frontend/src/components/props.d.ts
vendored
2
rsconcept/frontend/src/components/props.d.ts
vendored
|
@ -2,7 +2,6 @@
|
||||||
import React from 'react';
|
import React from 'react';
|
||||||
import { FieldError } from 'react-hook-form';
|
import { FieldError } from 'react-hook-form';
|
||||||
|
|
||||||
export namespace CProps {
|
|
||||||
/**
|
/**
|
||||||
* Represents an object that can have inline styles and CSS class names for styling.
|
* Represents an object that can have inline styles and CSS class names for styling.
|
||||||
*/
|
*/
|
||||||
|
@ -100,4 +99,3 @@ export namespace CProps {
|
||||||
* Represents `mouse event` in React.
|
* Represents `mouse event` in React.
|
||||||
*/
|
*/
|
||||||
export type EventMouse = React.MouseEvent<Element, MouseEvent>;
|
export type EventMouse = React.MouseEvent<Element, MouseEvent>;
|
||||||
}
|
|
||||||
|
|
|
@ -5,12 +5,12 @@ import { DELAYS, KEYS } from '@/backend/configuration';
|
||||||
import { infoMsg } from '@/utils/labels';
|
import { infoMsg } from '@/utils/labels';
|
||||||
|
|
||||||
import {
|
import {
|
||||||
IChangePasswordDTO,
|
type IChangePasswordDTO,
|
||||||
ICurrentUser,
|
type ICurrentUser,
|
||||||
IPasswordTokenDTO,
|
type IPasswordTokenDTO,
|
||||||
IRequestPasswordDTO,
|
type IRequestPasswordDTO,
|
||||||
IResetPasswordDTO,
|
type IResetPasswordDTO,
|
||||||
IUserLoginDTO
|
type IUserLoginDTO
|
||||||
} from './types';
|
} from './types';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -3,7 +3,7 @@ import { useMutation, useQueryClient } from '@tanstack/react-query';
|
||||||
import { KEYS } from '@/backend/configuration';
|
import { KEYS } from '@/backend/configuration';
|
||||||
|
|
||||||
import { authApi } from './api';
|
import { authApi } from './api';
|
||||||
import { IChangePasswordDTO } from './types';
|
import { type IChangePasswordDTO } from './types';
|
||||||
|
|
||||||
export const useChangePassword = () => {
|
export const useChangePassword = () => {
|
||||||
const client = useQueryClient();
|
const client = useQueryClient();
|
||||||
|
|
|
@ -3,7 +3,7 @@ import { useMutation, useQueryClient } from '@tanstack/react-query';
|
||||||
import { KEYS } from '@/backend/configuration';
|
import { KEYS } from '@/backend/configuration';
|
||||||
|
|
||||||
import { authApi } from './api';
|
import { authApi } from './api';
|
||||||
import { IUserLoginDTO } from './types';
|
import { type IUserLoginDTO } from './types';
|
||||||
|
|
||||||
export const useLogin = () => {
|
export const useLogin = () => {
|
||||||
const client = useQueryClient();
|
const client = useQueryClient();
|
||||||
|
|
|
@ -3,7 +3,7 @@ import { useMutation } from '@tanstack/react-query';
|
||||||
import { KEYS } from '@/backend/configuration';
|
import { KEYS } from '@/backend/configuration';
|
||||||
|
|
||||||
import { authApi } from './api';
|
import { authApi } from './api';
|
||||||
import { IRequestPasswordDTO } from './types';
|
import { type IRequestPasswordDTO } from './types';
|
||||||
|
|
||||||
export const useRequestPasswordReset = () => {
|
export const useRequestPasswordReset = () => {
|
||||||
const mutation = useMutation({
|
const mutation = useMutation({
|
||||||
|
|
|
@ -3,7 +3,7 @@ import { useMutation } from '@tanstack/react-query';
|
||||||
import { KEYS } from '@/backend/configuration';
|
import { KEYS } from '@/backend/configuration';
|
||||||
|
|
||||||
import { authApi } from './api';
|
import { authApi } from './api';
|
||||||
import { IPasswordTokenDTO, IResetPasswordDTO } from './types';
|
import { type IPasswordTokenDTO, type IResetPasswordDTO } from './types';
|
||||||
|
|
||||||
export const useResetPassword = () => {
|
export const useResetPassword = () => {
|
||||||
const validateMutation = useMutation({
|
const validateMutation = useMutation({
|
||||||
|
|
|
@ -8,12 +8,12 @@ import { urls, useConceptNavigation } from '@/app';
|
||||||
|
|
||||||
import { isAxiosError } from '@/backend/apiTransport';
|
import { isAxiosError } from '@/backend/apiTransport';
|
||||||
import { SubmitButton, TextURL } from '@/components/Control';
|
import { SubmitButton, TextURL } from '@/components/Control';
|
||||||
import { ErrorData } from '@/components/InfoError';
|
import { type ErrorData } from '@/components/InfoError';
|
||||||
import { TextInput } from '@/components/Input';
|
import { TextInput } from '@/components/Input';
|
||||||
import { useQueryStrings } from '@/hooks/useQueryStrings';
|
import { useQueryStrings } from '@/hooks/useQueryStrings';
|
||||||
import { resources } from '@/utils/constants';
|
import { resources } from '@/utils/constants';
|
||||||
|
|
||||||
import { IUserLoginDTO, schemaUserLogin } from '../backend/types';
|
import { type IUserLoginDTO, schemaUserLogin } from '../backend/types';
|
||||||
import { useAuthSuspense } from '../backend/useAuth';
|
import { useAuthSuspense } from '../backend/useAuth';
|
||||||
import { useLogin } from '../backend/useLogin';
|
import { useLogin } from '../backend/useLogin';
|
||||||
import { ExpectedAnonymous } from '../components/ExpectedAnonymous';
|
import { ExpectedAnonymous } from '../components/ExpectedAnonymous';
|
||||||
|
|
|
@ -7,7 +7,7 @@ import { urls, useConceptNavigation } from '@/app';
|
||||||
|
|
||||||
import { isAxiosError } from '@/backend/apiTransport';
|
import { isAxiosError } from '@/backend/apiTransport';
|
||||||
import { SubmitButton } from '@/components/Control';
|
import { SubmitButton } from '@/components/Control';
|
||||||
import { ErrorData, InfoError } from '@/components/InfoError';
|
import { type ErrorData, InfoError } from '@/components/InfoError';
|
||||||
import { TextInput } from '@/components/Input';
|
import { TextInput } from '@/components/Input';
|
||||||
import { Loader } from '@/components/Loader';
|
import { Loader } from '@/components/Loader';
|
||||||
import { useQueryStrings } from '@/hooks/useQueryStrings';
|
import { useQueryStrings } from '@/hooks/useQueryStrings';
|
||||||
|
|
|
@ -5,7 +5,7 @@ import clsx from 'clsx';
|
||||||
|
|
||||||
import { isAxiosError } from '@/backend/apiTransport';
|
import { isAxiosError } from '@/backend/apiTransport';
|
||||||
import { SubmitButton, TextURL } from '@/components/Control';
|
import { SubmitButton, TextURL } from '@/components/Control';
|
||||||
import { ErrorData } from '@/components/InfoError';
|
import { type ErrorData } from '@/components/InfoError';
|
||||||
import { TextInput } from '@/components/Input';
|
import { TextInput } from '@/components/Input';
|
||||||
|
|
||||||
import { useRequestPasswordReset } from '../backend/useRequestPasswordReset';
|
import { useRequestPasswordReset } from '../backend/useRequestPasswordReset';
|
||||||
|
|
|
@ -1,10 +1,10 @@
|
||||||
import React, { Suspense } from 'react';
|
import React, { Suspense } from 'react';
|
||||||
|
|
||||||
import { PlacesType, Tooltip } from '@/components/Container';
|
import { type PlacesType, Tooltip } from '@/components/Container';
|
||||||
import { TextURL } from '@/components/Control';
|
import { TextURL } from '@/components/Control';
|
||||||
import { IconHelp } from '@/components/Icons';
|
import { IconHelp } from '@/components/Icons';
|
||||||
import { Loader } from '@/components/Loader';
|
import { Loader } from '@/components/Loader';
|
||||||
import { CProps } from '@/components/props';
|
import { type Styling } from '@/components/props';
|
||||||
import { usePreferencesStore } from '@/stores/preferences';
|
import { usePreferencesStore } from '@/stores/preferences';
|
||||||
|
|
||||||
import { HelpTopic } from '../models/helpTopic';
|
import { HelpTopic } from '../models/helpTopic';
|
||||||
|
@ -13,7 +13,7 @@ const TopicPage = React.lazy(() =>
|
||||||
import('@/features/help/pages/ManualsPage/TopicPage').then(module => ({ default: module.TopicPage }))
|
import('@/features/help/pages/ManualsPage/TopicPage').then(module => ({ default: module.TopicPage }))
|
||||||
);
|
);
|
||||||
|
|
||||||
interface BadgeHelpProps extends CProps.Styling {
|
interface BadgeHelpProps extends Styling {
|
||||||
/** Topic to display in a tooltip. */
|
/** Topic to display in a tooltip. */
|
||||||
topic: HelpTopic;
|
topic: HelpTopic;
|
||||||
|
|
||||||
|
|
|
@ -1,8 +1,8 @@
|
||||||
import { queryOptions } from '@tanstack/react-query';
|
import { queryOptions } from '@tanstack/react-query';
|
||||||
|
|
||||||
import {
|
import {
|
||||||
IRSFormDTO,
|
type IRSFormDTO,
|
||||||
IVersionCreatedResponse,
|
type IVersionCreatedResponse,
|
||||||
schemaRSForm,
|
schemaRSForm,
|
||||||
schemaVersionCreatedResponse
|
schemaVersionCreatedResponse
|
||||||
} from '@/features/rsform/backend/types';
|
} from '@/features/rsform/backend/types';
|
||||||
|
@ -13,14 +13,14 @@ import { infoMsg } from '@/utils/labels';
|
||||||
|
|
||||||
import {
|
import {
|
||||||
AccessPolicy,
|
AccessPolicy,
|
||||||
ICloneLibraryItemDTO,
|
type ICloneLibraryItemDTO,
|
||||||
ICreateLibraryItemDTO,
|
type ICreateLibraryItemDTO,
|
||||||
ILibraryItem,
|
type ILibraryItem,
|
||||||
IRenameLocationDTO,
|
type IRenameLocationDTO,
|
||||||
IUpdateLibraryItemDTO,
|
type IUpdateLibraryItemDTO,
|
||||||
IVersionCreateDTO,
|
type IVersionCreateDTO,
|
||||||
IVersionInfo,
|
type IVersionInfo,
|
||||||
IVersionUpdateDTO,
|
type IVersionUpdateDTO,
|
||||||
schemaLibraryItem,
|
schemaLibraryItem,
|
||||||
schemaLibraryItemArray,
|
schemaLibraryItemArray,
|
||||||
schemaVersionInfo
|
schemaVersionInfo
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
import { useAuthSuspense } from '@/features/auth';
|
import { useAuthSuspense } from '@/features/auth';
|
||||||
|
|
||||||
import { ILibraryFilter } from '../models/library';
|
import { type ILibraryFilter } from '../models/library';
|
||||||
import { matchLibraryItem, matchLibraryItemLocation } from '../models/libraryAPI';
|
import { matchLibraryItem, matchLibraryItemLocation } from '../models/libraryAPI';
|
||||||
|
|
||||||
import { useLibrary } from './useLibrary';
|
import { useLibrary } from './useLibrary';
|
||||||
|
|
|
@ -3,7 +3,7 @@ import { useMutation, useQueryClient } from '@tanstack/react-query';
|
||||||
import { KEYS } from '@/backend/configuration';
|
import { KEYS } from '@/backend/configuration';
|
||||||
|
|
||||||
import { libraryApi } from './api';
|
import { libraryApi } from './api';
|
||||||
import { ICloneLibraryItemDTO } from './types';
|
import { type ICloneLibraryItemDTO } from './types';
|
||||||
|
|
||||||
export const useCloneItem = () => {
|
export const useCloneItem = () => {
|
||||||
const client = useQueryClient();
|
const client = useQueryClient();
|
||||||
|
|
|
@ -3,7 +3,7 @@ import { useMutation, useQueryClient } from '@tanstack/react-query';
|
||||||
import { KEYS } from '@/backend/configuration';
|
import { KEYS } from '@/backend/configuration';
|
||||||
|
|
||||||
import { libraryApi } from './api';
|
import { libraryApi } from './api';
|
||||||
import { ICreateLibraryItemDTO } from './types';
|
import { type ICreateLibraryItemDTO } from './types';
|
||||||
|
|
||||||
export const useCreateItem = () => {
|
export const useCreateItem = () => {
|
||||||
const client = useQueryClient();
|
const client = useQueryClient();
|
||||||
|
|
|
@ -3,7 +3,7 @@ import { useMutation, useQueryClient } from '@tanstack/react-query';
|
||||||
import { KEYS } from '@/backend/configuration';
|
import { KEYS } from '@/backend/configuration';
|
||||||
|
|
||||||
import { libraryApi } from './api';
|
import { libraryApi } from './api';
|
||||||
import { IRenameLocationDTO } from './types';
|
import { type IRenameLocationDTO } from './types';
|
||||||
|
|
||||||
export const useRenameLocation = () => {
|
export const useRenameLocation = () => {
|
||||||
const client = useQueryClient();
|
const client = useQueryClient();
|
||||||
|
|
|
@ -1,12 +1,12 @@
|
||||||
import { useMutation, useQueryClient } from '@tanstack/react-query';
|
import { useMutation, useQueryClient } from '@tanstack/react-query';
|
||||||
|
|
||||||
import { IOperationSchemaDTO } from '@/features/oss/backend/types';
|
import { type IOperationSchemaDTO } from '@/features/oss/backend/types';
|
||||||
import { IRSFormDTO } from '@/features/rsform/backend/types';
|
import { type IRSFormDTO } from '@/features/rsform/backend/types';
|
||||||
|
|
||||||
import { KEYS } from '@/backend/configuration';
|
import { KEYS } from '@/backend/configuration';
|
||||||
|
|
||||||
import { libraryApi } from './api';
|
import { libraryApi } from './api';
|
||||||
import { AccessPolicy, ILibraryItem } from './types';
|
import { AccessPolicy, type ILibraryItem } from './types';
|
||||||
|
|
||||||
export const useSetAccessPolicy = () => {
|
export const useSetAccessPolicy = () => {
|
||||||
const client = useQueryClient();
|
const client = useQueryClient();
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
import { useMutation, useQueryClient } from '@tanstack/react-query';
|
import { useMutation, useQueryClient } from '@tanstack/react-query';
|
||||||
|
|
||||||
import { IOperationSchemaDTO } from '@/features/oss/backend/types';
|
import { type IOperationSchemaDTO } from '@/features/oss/backend/types';
|
||||||
import { IRSFormDTO } from '@/features/rsform/backend/types';
|
import { type IRSFormDTO } from '@/features/rsform/backend/types';
|
||||||
|
|
||||||
import { KEYS } from '@/backend/configuration';
|
import { KEYS } from '@/backend/configuration';
|
||||||
|
|
||||||
|
|
|
@ -1,12 +1,12 @@
|
||||||
import { useMutation, useQueryClient } from '@tanstack/react-query';
|
import { useMutation, useQueryClient } from '@tanstack/react-query';
|
||||||
|
|
||||||
import { IOperationSchemaDTO } from '@/features/oss/backend/types';
|
import { type IOperationSchemaDTO } from '@/features/oss/backend/types';
|
||||||
import { IRSFormDTO } from '@/features/rsform/backend/types';
|
import { type IRSFormDTO } from '@/features/rsform/backend/types';
|
||||||
|
|
||||||
import { KEYS } from '@/backend/configuration';
|
import { KEYS } from '@/backend/configuration';
|
||||||
|
|
||||||
import { libraryApi } from './api';
|
import { libraryApi } from './api';
|
||||||
import { ILibraryItem } from './types';
|
import { type ILibraryItem } from './types';
|
||||||
|
|
||||||
export const useSetLocation = () => {
|
export const useSetLocation = () => {
|
||||||
const client = useQueryClient();
|
const client = useQueryClient();
|
||||||
|
|
|
@ -1,12 +1,12 @@
|
||||||
import { useMutation, useQueryClient } from '@tanstack/react-query';
|
import { useMutation, useQueryClient } from '@tanstack/react-query';
|
||||||
|
|
||||||
import { IOperationSchemaDTO } from '@/features/oss/backend/types';
|
import { type IOperationSchemaDTO } from '@/features/oss/backend/types';
|
||||||
import { IRSFormDTO } from '@/features/rsform/backend/types';
|
import { type IRSFormDTO } from '@/features/rsform/backend/types';
|
||||||
|
|
||||||
import { KEYS } from '@/backend/configuration';
|
import { KEYS } from '@/backend/configuration';
|
||||||
|
|
||||||
import { libraryApi } from './api';
|
import { libraryApi } from './api';
|
||||||
import { ILibraryItem } from './types';
|
import { type ILibraryItem } from './types';
|
||||||
|
|
||||||
export const useSetOwner = () => {
|
export const useSetOwner = () => {
|
||||||
const client = useQueryClient();
|
const client = useQueryClient();
|
||||||
|
|
|
@ -1,12 +1,12 @@
|
||||||
import { useMutation, useQueryClient } from '@tanstack/react-query';
|
import { useMutation, useQueryClient } from '@tanstack/react-query';
|
||||||
|
|
||||||
import { IOperationSchemaDTO } from '@/features/oss/backend/types';
|
import { type IOperationSchemaDTO } from '@/features/oss/backend/types';
|
||||||
import { IRSFormDTO } from '@/features/rsform/backend/types';
|
import { type IRSFormDTO } from '@/features/rsform/backend/types';
|
||||||
|
|
||||||
import { KEYS } from '@/backend/configuration';
|
import { KEYS } from '@/backend/configuration';
|
||||||
|
|
||||||
import { libraryApi } from './api';
|
import { libraryApi } from './api';
|
||||||
import { ILibraryItem, IUpdateLibraryItemDTO, LibraryItemType } from './types';
|
import { type ILibraryItem, type IUpdateLibraryItemDTO, LibraryItemType } from './types';
|
||||||
|
|
||||||
export const useUpdateItem = () => {
|
export const useUpdateItem = () => {
|
||||||
const client = useQueryClient();
|
const client = useQueryClient();
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
import { useQueryClient } from '@tanstack/react-query';
|
import { useQueryClient } from '@tanstack/react-query';
|
||||||
|
|
||||||
import { libraryApi } from './api';
|
import { libraryApi } from './api';
|
||||||
import { ILibraryItem } from './types';
|
import { type ILibraryItem } from './types';
|
||||||
|
|
||||||
export function useUpdateTimestamp() {
|
export function useUpdateTimestamp() {
|
||||||
const client = useQueryClient();
|
const client = useQueryClient();
|
||||||
|
|
|
@ -3,7 +3,7 @@ import { useMutation, useQueryClient } from '@tanstack/react-query';
|
||||||
import { KEYS } from '@/backend/configuration';
|
import { KEYS } from '@/backend/configuration';
|
||||||
|
|
||||||
import { libraryApi } from './api';
|
import { libraryApi } from './api';
|
||||||
import { IVersionCreateDTO } from './types';
|
import { type IVersionCreateDTO } from './types';
|
||||||
import { useUpdateTimestamp } from './useUpdateTimestamp';
|
import { useUpdateTimestamp } from './useUpdateTimestamp';
|
||||||
|
|
||||||
export const useVersionCreate = () => {
|
export const useVersionCreate = () => {
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
import { useMutation, useQueryClient } from '@tanstack/react-query';
|
import { useMutation, useQueryClient } from '@tanstack/react-query';
|
||||||
|
|
||||||
import { IRSFormDTO } from '@/features/rsform/backend/types';
|
import { type IRSFormDTO } from '@/features/rsform/backend/types';
|
||||||
|
|
||||||
import { KEYS } from '@/backend/configuration';
|
import { KEYS } from '@/backend/configuration';
|
||||||
|
|
||||||
|
|
|
@ -1,11 +1,11 @@
|
||||||
import { useMutation, useQueryClient } from '@tanstack/react-query';
|
import { useMutation, useQueryClient } from '@tanstack/react-query';
|
||||||
|
|
||||||
import { IRSFormDTO } from '@/features/rsform/backend/types';
|
import { type IRSFormDTO } from '@/features/rsform/backend/types';
|
||||||
|
|
||||||
import { KEYS } from '@/backend/configuration';
|
import { KEYS } from '@/backend/configuration';
|
||||||
|
|
||||||
import { libraryApi } from './api';
|
import { libraryApi } from './api';
|
||||||
import { IVersionUpdateDTO } from './types';
|
import { type IVersionUpdateDTO } from './types';
|
||||||
|
|
||||||
export const useVersionUpdate = () => {
|
export const useVersionUpdate = () => {
|
||||||
const client = useQueryClient();
|
const client = useQueryClient();
|
||||||
|
|
|
@ -16,14 +16,14 @@ import {
|
||||||
IconOwner
|
IconOwner
|
||||||
} from '@/components/Icons';
|
} from '@/components/Icons';
|
||||||
import { Loader } from '@/components/Loader';
|
import { Loader } from '@/components/Loader';
|
||||||
import { CProps } from '@/components/props';
|
import { type EventMouse } from '@/components/props';
|
||||||
import { ValueIcon } from '@/components/View';
|
import { ValueIcon } from '@/components/View';
|
||||||
import { useDialogsStore } from '@/stores/dialogs';
|
import { useDialogsStore } from '@/stores/dialogs';
|
||||||
import { useModificationStore } from '@/stores/modification';
|
import { useModificationStore } from '@/stores/modification';
|
||||||
import { prefixes } from '@/utils/constants';
|
import { prefixes } from '@/utils/constants';
|
||||||
import { promptText } from '@/utils/labels';
|
import { promptText } from '@/utils/labels';
|
||||||
|
|
||||||
import { ILibraryItemData } from '../backend/types';
|
import { type ILibraryItemData } from '../backend/types';
|
||||||
import { useMutatingLibrary } from '../backend/useMutatingLibrary';
|
import { useMutatingLibrary } from '../backend/useMutatingLibrary';
|
||||||
import { useSetLocation } from '../backend/useSetLocation';
|
import { useSetLocation } from '../backend/useSetLocation';
|
||||||
import { useSetOwner } from '../backend/useSetOwner';
|
import { useSetOwner } from '../backend/useSetOwner';
|
||||||
|
@ -62,7 +62,7 @@ export function EditorLibraryItem({ schema, isAttachedToOSS }: EditorLibraryItem
|
||||||
void setOwner({ itemID: schema.id, owner: newValue });
|
void setOwner({ itemID: schema.id, owner: newValue });
|
||||||
};
|
};
|
||||||
|
|
||||||
function handleOpenLibrary(event: CProps.EventMouse) {
|
function handleOpenLibrary(event: EventMouse) {
|
||||||
setGlobalLocation(schema.location);
|
setGlobalLocation(schema.location);
|
||||||
router.push(urls.library, event.ctrlKey || event.metaKey);
|
router.push(urls.library, event.ctrlKey || event.metaKey);
|
||||||
}
|
}
|
||||||
|
@ -92,7 +92,7 @@ export function EditorLibraryItem({ schema, isAttachedToOSS }: EditorLibraryItem
|
||||||
onClick={handleOpenLibrary}
|
onClick={handleOpenLibrary}
|
||||||
/>
|
/>
|
||||||
<ValueIcon
|
<ValueIcon
|
||||||
className='text-ellipsis flex-grow'
|
className='text-ellipsis grow'
|
||||||
icon={<IconFolderEdit size='1.25rem' className='icon-primary' />}
|
icon={<IconFolderEdit size='1.25rem' className='icon-primary' />}
|
||||||
value={schema.location}
|
value={schema.location}
|
||||||
title={isAttachedToOSS ? 'Путь наследуется от ОСС' : 'Путь'}
|
title={isAttachedToOSS ? 'Путь наследуется от ОСС' : 'Путь'}
|
||||||
|
|
|
@ -6,20 +6,20 @@ import { MiniButton } from '@/components/Control';
|
||||||
import { Dropdown, DropdownButton, useDropdown } from '@/components/Dropdown';
|
import { Dropdown, DropdownButton, useDropdown } from '@/components/Dropdown';
|
||||||
import { IconOSS } from '@/components/Icons';
|
import { IconOSS } from '@/components/Icons';
|
||||||
import { Label } from '@/components/Input';
|
import { Label } from '@/components/Input';
|
||||||
import { CProps } from '@/components/props';
|
import { type EventMouse, type Styling } from '@/components/props';
|
||||||
import { prefixes } from '@/utils/constants';
|
import { prefixes } from '@/utils/constants';
|
||||||
|
|
||||||
import { ILibraryItemReference } from '../models/library';
|
import { type ILibraryItemReference } from '../models/library';
|
||||||
|
|
||||||
interface MiniSelectorOSSProps extends CProps.Styling {
|
interface MiniSelectorOSSProps extends Styling {
|
||||||
items: ILibraryItemReference[];
|
items: ILibraryItemReference[];
|
||||||
onSelect: (event: CProps.EventMouse, newValue: ILibraryItemReference) => void;
|
onSelect: (event: EventMouse, newValue: ILibraryItemReference) => void;
|
||||||
}
|
}
|
||||||
|
|
||||||
export function MiniSelectorOSS({ items, onSelect, className, ...restProps }: MiniSelectorOSSProps) {
|
export function MiniSelectorOSS({ items, onSelect, className, ...restProps }: MiniSelectorOSSProps) {
|
||||||
const ossMenu = useDropdown();
|
const ossMenu = useDropdown();
|
||||||
|
|
||||||
function onToggle(event: CProps.EventMouse) {
|
function onToggle(event: EventMouse) {
|
||||||
if (items.length > 1) {
|
if (items.length > 1) {
|
||||||
ossMenu.toggle();
|
ossMenu.toggle();
|
||||||
} else {
|
} else {
|
||||||
|
|
|
@ -4,20 +4,20 @@ import clsx from 'clsx';
|
||||||
|
|
||||||
import { FlexColumn } from '@/components/Container';
|
import { FlexColumn } from '@/components/Container';
|
||||||
import { MiniButton } from '@/components/Control';
|
import { MiniButton } from '@/components/Control';
|
||||||
import { createColumnHelper, DataTable, IConditionalStyle } from '@/components/DataTable';
|
import { createColumnHelper, DataTable, type IConditionalStyle } from '@/components/DataTable';
|
||||||
import { Dropdown, useDropdown } from '@/components/Dropdown';
|
import { Dropdown, useDropdown } from '@/components/Dropdown';
|
||||||
import { IconClose, IconFolderTree } from '@/components/Icons';
|
import { IconClose, IconFolderTree } from '@/components/Icons';
|
||||||
import { SearchBar } from '@/components/Input';
|
import { SearchBar } from '@/components/Input';
|
||||||
import { CProps } from '@/components/props';
|
import { type EventMouse, type Styling } from '@/components/props';
|
||||||
import { APP_COLORS } from '@/styling/colors';
|
import { APP_COLORS } from '@/styling/colors';
|
||||||
import { prefixes } from '@/utils/constants';
|
import { prefixes } from '@/utils/constants';
|
||||||
|
|
||||||
import { ILibraryItem, LibraryItemType } from '../backend/types';
|
import { type ILibraryItem, LibraryItemType } from '../backend/types';
|
||||||
import { matchLibraryItem } from '../models/libraryAPI';
|
import { matchLibraryItem } from '../models/libraryAPI';
|
||||||
|
|
||||||
import { SelectLocation } from './SelectLocation';
|
import { SelectLocation } from './SelectLocation';
|
||||||
|
|
||||||
interface PickSchemaProps extends CProps.Styling {
|
interface PickSchemaProps extends Styling {
|
||||||
id?: string;
|
id?: string;
|
||||||
value: number | null;
|
value: number | null;
|
||||||
onChange: (newValue: number) => void;
|
onChange: (newValue: number) => void;
|
||||||
|
@ -96,7 +96,7 @@ export function PickSchema({
|
||||||
}
|
}
|
||||||
];
|
];
|
||||||
|
|
||||||
function handleLocationClick(event: CProps.EventMouse, newValue: string) {
|
function handleLocationClick(event: EventMouse, newValue: string) {
|
||||||
event.preventDefault();
|
event.preventDefault();
|
||||||
event.stopPropagation();
|
event.stopPropagation();
|
||||||
locationMenu.hide();
|
locationMenu.hide();
|
||||||
|
@ -108,7 +108,7 @@ export function PickSchema({
|
||||||
<div className='flex justify-between clr-input items-center pr-1 rounded-t-md'>
|
<div className='flex justify-between clr-input items-center pr-1 rounded-t-md'>
|
||||||
<SearchBar
|
<SearchBar
|
||||||
id={id ? `${id}__search` : undefined}
|
id={id ? `${id}__search` : undefined}
|
||||||
className='clr-input flex-grow rounded-t-md'
|
className='clr-input grow rounded-t-md'
|
||||||
noBorder
|
noBorder
|
||||||
query={filterText}
|
query={filterText}
|
||||||
onChangeQuery={newValue => setFilterText(newValue)}
|
onChangeQuery={newValue => setFilterText(newValue)}
|
||||||
|
|
|
@ -1,16 +1,16 @@
|
||||||
'use client';
|
'use client';
|
||||||
|
|
||||||
import { MiniButton } from '@/components/Control';
|
import { MiniButton } from '@/components/Control';
|
||||||
import { DomIconProps } from '@/components/DomainIcons';
|
import { type DomIconProps } from '@/components/DomainIcons';
|
||||||
import { Dropdown, DropdownButton, useDropdown } from '@/components/Dropdown';
|
import { Dropdown, DropdownButton, useDropdown } from '@/components/Dropdown';
|
||||||
import { IconPrivate, IconProtected, IconPublic } from '@/components/Icons';
|
import { IconPrivate, IconProtected, IconPublic } from '@/components/Icons';
|
||||||
import { CProps } from '@/components/props';
|
import { type Styling } from '@/components/props';
|
||||||
import { prefixes } from '@/utils/constants';
|
import { prefixes } from '@/utils/constants';
|
||||||
|
|
||||||
import { AccessPolicy } from '../backend/types';
|
import { AccessPolicy } from '../backend/types';
|
||||||
import { describeAccessPolicy, labelAccessPolicy } from '../labels';
|
import { describeAccessPolicy, labelAccessPolicy } from '../labels';
|
||||||
|
|
||||||
interface SelectAccessPolicyProps extends CProps.Styling {
|
interface SelectAccessPolicyProps extends Styling {
|
||||||
value: AccessPolicy;
|
value: AccessPolicy;
|
||||||
onChange: (value: AccessPolicy) => void;
|
onChange: (value: AccessPolicy) => void;
|
||||||
|
|
||||||
|
|
|
@ -1,16 +1,16 @@
|
||||||
'use client';
|
'use client';
|
||||||
|
|
||||||
import { SelectorButton } from '@/components/Control';
|
import { SelectorButton } from '@/components/Control';
|
||||||
import { DomIconProps } from '@/components/DomainIcons';
|
import { type DomIconProps } from '@/components/DomainIcons';
|
||||||
import { Dropdown, DropdownButton, useDropdown } from '@/components/Dropdown';
|
import { Dropdown, DropdownButton, useDropdown } from '@/components/Dropdown';
|
||||||
import { IconOSS, IconRSForm } from '@/components/Icons';
|
import { IconOSS, IconRSForm } from '@/components/Icons';
|
||||||
import { CProps } from '@/components/props';
|
import { type Styling } from '@/components/props';
|
||||||
import { prefixes } from '@/utils/constants';
|
import { prefixes } from '@/utils/constants';
|
||||||
|
|
||||||
import { LibraryItemType } from '../backend/types';
|
import { LibraryItemType } from '../backend/types';
|
||||||
import { describeLibraryItemType, labelLibraryItemType } from '../labels';
|
import { describeLibraryItemType, labelLibraryItemType } from '../labels';
|
||||||
|
|
||||||
interface SelectItemTypeProps extends CProps.Styling {
|
interface SelectItemTypeProps extends Styling {
|
||||||
value: LibraryItemType;
|
value: LibraryItemType;
|
||||||
onChange: (value: LibraryItemType) => void;
|
onChange: (value: LibraryItemType) => void;
|
||||||
disabled?: boolean;
|
disabled?: boolean;
|
||||||
|
|
|
@ -3,12 +3,12 @@
|
||||||
import clsx from 'clsx';
|
import clsx from 'clsx';
|
||||||
|
|
||||||
import { SelectSingle } from '@/components/Input';
|
import { SelectSingle } from '@/components/Input';
|
||||||
import { CProps } from '@/components/props';
|
import { type Styling } from '@/components/props';
|
||||||
|
|
||||||
import { ILibraryItem } from '../backend/types';
|
import { type ILibraryItem } from '../backend/types';
|
||||||
import { matchLibraryItem } from '../models/libraryAPI';
|
import { matchLibraryItem } from '../models/libraryAPI';
|
||||||
|
|
||||||
interface SelectLibraryItemProps extends CProps.Styling {
|
interface SelectLibraryItemProps extends Styling {
|
||||||
value: ILibraryItem | null;
|
value: ILibraryItem | null;
|
||||||
onChange: (newValue: ILibraryItem | null) => void;
|
onChange: (newValue: ILibraryItem | null) => void;
|
||||||
|
|
||||||
|
|
|
@ -5,15 +5,15 @@ import clsx from 'clsx';
|
||||||
|
|
||||||
import { MiniButton } from '@/components/Control';
|
import { MiniButton } from '@/components/Control';
|
||||||
import { IconFolder, IconFolderClosed, IconFolderEmpty, IconFolderOpened } from '@/components/Icons';
|
import { IconFolder, IconFolderClosed, IconFolderEmpty, IconFolderOpened } from '@/components/Icons';
|
||||||
import { CProps } from '@/components/props';
|
import { type EventMouse, type Styling } from '@/components/props';
|
||||||
|
|
||||||
import { useFolders } from '../backend/useFolders';
|
import { useFolders } from '../backend/useFolders';
|
||||||
import { labelFolderNode } from '../labels';
|
import { labelFolderNode } from '../labels';
|
||||||
import { FolderNode } from '../models/FolderTree';
|
import { FolderNode } from '../models/FolderTree';
|
||||||
|
|
||||||
interface SelectLocationProps extends CProps.Styling {
|
interface SelectLocationProps extends Styling {
|
||||||
value: string;
|
value: string;
|
||||||
onClick: (event: CProps.EventMouse, target: FolderNode) => void;
|
onClick: (event: EventMouse, target: FolderNode) => void;
|
||||||
|
|
||||||
prefix: string;
|
prefix: string;
|
||||||
dense?: boolean;
|
dense?: boolean;
|
||||||
|
@ -44,7 +44,7 @@ export function SelectLocation({ value, dense, prefix, onClick, className, style
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
function handleClickFold(event: CProps.EventMouse, target: FolderNode, showChildren: boolean) {
|
function handleClickFold(event: EventMouse, target: FolderNode, showChildren: boolean) {
|
||||||
event.preventDefault();
|
event.preventDefault();
|
||||||
event.stopPropagation();
|
event.stopPropagation();
|
||||||
onFoldItem(target, showChildren);
|
onFoldItem(target, showChildren);
|
||||||
|
|
|
@ -5,12 +5,12 @@ import clsx from 'clsx';
|
||||||
import { MiniButton } from '@/components/Control';
|
import { MiniButton } from '@/components/Control';
|
||||||
import { Dropdown, useDropdown } from '@/components/Dropdown';
|
import { Dropdown, useDropdown } from '@/components/Dropdown';
|
||||||
import { IconFolderTree } from '@/components/Icons';
|
import { IconFolderTree } from '@/components/Icons';
|
||||||
import { CProps } from '@/components/props';
|
import { type EventMouse, type Styling } from '@/components/props';
|
||||||
import { prefixes } from '@/utils/constants';
|
import { prefixes } from '@/utils/constants';
|
||||||
|
|
||||||
import { SelectLocation } from './SelectLocation';
|
import { SelectLocation } from './SelectLocation';
|
||||||
|
|
||||||
interface SelectLocationContextProps extends CProps.Styling {
|
interface SelectLocationContextProps extends Styling {
|
||||||
value: string;
|
value: string;
|
||||||
onChange: (newValue: string) => void;
|
onChange: (newValue: string) => void;
|
||||||
title?: string;
|
title?: string;
|
||||||
|
@ -26,7 +26,7 @@ export function SelectLocationContext({
|
||||||
}: SelectLocationContextProps) {
|
}: SelectLocationContextProps) {
|
||||||
const menu = useDropdown();
|
const menu = useDropdown();
|
||||||
|
|
||||||
function handleClick(event: CProps.EventMouse, newValue: string) {
|
function handleClick(event: EventMouse, newValue: string) {
|
||||||
event.preventDefault();
|
event.preventDefault();
|
||||||
event.stopPropagation();
|
event.stopPropagation();
|
||||||
menu.hide();
|
menu.hide();
|
||||||
|
|
|
@ -5,13 +5,13 @@ import clsx from 'clsx';
|
||||||
import { SelectorButton } from '@/components/Control';
|
import { SelectorButton } from '@/components/Control';
|
||||||
import { LocationIcon } from '@/components/DomainIcons';
|
import { LocationIcon } from '@/components/DomainIcons';
|
||||||
import { Dropdown, DropdownButton, useDropdown } from '@/components/Dropdown';
|
import { Dropdown, DropdownButton, useDropdown } from '@/components/Dropdown';
|
||||||
import { CProps } from '@/components/props';
|
import { type Styling } from '@/components/props';
|
||||||
import { prefixes } from '@/utils/constants';
|
import { prefixes } from '@/utils/constants';
|
||||||
|
|
||||||
import { describeLocationHead, labelLocationHead } from '../labels';
|
import { describeLocationHead, labelLocationHead } from '../labels';
|
||||||
import { LocationHead } from '../models/library';
|
import { LocationHead } from '../models/library';
|
||||||
|
|
||||||
interface SelectLocationHeadProps extends CProps.Styling {
|
interface SelectLocationHeadProps extends Styling {
|
||||||
value: LocationHead;
|
value: LocationHead;
|
||||||
onChange: (newValue: LocationHead) => void;
|
onChange: (newValue: LocationHead) => void;
|
||||||
excluded?: LocationHead[];
|
excluded?: LocationHead[];
|
||||||
|
|
|
@ -3,13 +3,13 @@
|
||||||
import clsx from 'clsx';
|
import clsx from 'clsx';
|
||||||
|
|
||||||
import { SelectSingle } from '@/components/Input';
|
import { SelectSingle } from '@/components/Input';
|
||||||
import { CProps } from '@/components/props';
|
import { type Styling } from '@/components/props';
|
||||||
|
|
||||||
import { labelVersion } from '../../rsform/labels';
|
import { labelVersion } from '../../rsform/labels';
|
||||||
import { IVersionInfo } from '../backend/types';
|
import { type IVersionInfo } from '../backend/types';
|
||||||
import { CurrentVersion } from '../models/library';
|
import { type CurrentVersion } from '../models/library';
|
||||||
|
|
||||||
interface SelectVersionProps extends CProps.Styling {
|
interface SelectVersionProps extends Styling {
|
||||||
id?: string;
|
id?: string;
|
||||||
value: CurrentVersion;
|
value: CurrentVersion;
|
||||||
onChange: (newValue: CurrentVersion) => void;
|
onChange: (newValue: CurrentVersion) => void;
|
||||||
|
|
|
@ -8,7 +8,7 @@ import { IconImmutable, IconMutable } from '@/components/Icons';
|
||||||
import { Label } from '@/components/Input';
|
import { Label } from '@/components/Input';
|
||||||
import { PARAMETER } from '@/utils/constants';
|
import { PARAMETER } from '@/utils/constants';
|
||||||
|
|
||||||
import { AccessPolicy, ILibraryItem } from '../backend/types';
|
import { AccessPolicy, type ILibraryItem } from '../backend/types';
|
||||||
import { useMutatingLibrary } from '../backend/useMutatingLibrary';
|
import { useMutatingLibrary } from '../backend/useMutatingLibrary';
|
||||||
import { useSetAccessPolicy } from '../backend/useSetAccessPolicy';
|
import { useSetAccessPolicy } from '../backend/useSetAccessPolicy';
|
||||||
|
|
||||||
|
|
|
@ -13,7 +13,7 @@ import { Checkbox, Label, TextArea, TextInput } from '@/components/Input';
|
||||||
import { ModalForm } from '@/components/Modal';
|
import { ModalForm } from '@/components/Modal';
|
||||||
import { useDialogsStore } from '@/stores/dialogs';
|
import { useDialogsStore } from '@/stores/dialogs';
|
||||||
|
|
||||||
import { AccessPolicy, ICloneLibraryItemDTO, ILibraryItem, schemaCloneLibraryItem } from '../backend/types';
|
import { AccessPolicy, type ICloneLibraryItemDTO, type ILibraryItem, schemaCloneLibraryItem } from '../backend/types';
|
||||||
import { useCloneItem } from '../backend/useCloneItem';
|
import { useCloneItem } from '../backend/useCloneItem';
|
||||||
import { SelectAccessPolicy } from '../components/SelectAccessPolicy';
|
import { SelectAccessPolicy } from '../components/SelectAccessPolicy';
|
||||||
import { SelectLocationContext } from '../components/SelectLocationContext';
|
import { SelectLocationContext } from '../components/SelectLocationContext';
|
||||||
|
|
|
@ -9,7 +9,7 @@ import { ModalForm } from '@/components/Modal';
|
||||||
import { useDialogsStore } from '@/stores/dialogs';
|
import { useDialogsStore } from '@/stores/dialogs';
|
||||||
import { errorMsg } from '@/utils/labels';
|
import { errorMsg } from '@/utils/labels';
|
||||||
|
|
||||||
import { IVersionCreateDTO, IVersionInfo, schemaVersionCreate } from '../backend/types';
|
import { type IVersionCreateDTO, type IVersionInfo, schemaVersionCreate } from '../backend/types';
|
||||||
import { useVersionCreate } from '../backend/useVersionCreate';
|
import { useVersionCreate } from '../backend/useVersionCreate';
|
||||||
import { nextVersion } from '../models/libraryAPI';
|
import { nextVersion } from '../models/libraryAPI';
|
||||||
|
|
||||||
|
|
|
@ -14,7 +14,7 @@ import { ModalView } from '@/components/Modal';
|
||||||
import { useDialogsStore } from '@/stores/dialogs';
|
import { useDialogsStore } from '@/stores/dialogs';
|
||||||
import { errorMsg } from '@/utils/labels';
|
import { errorMsg } from '@/utils/labels';
|
||||||
|
|
||||||
import { IVersionUpdateDTO, schemaVersionUpdate } from '../../backend/types';
|
import { type IVersionUpdateDTO, schemaVersionUpdate } from '../../backend/types';
|
||||||
import { useMutatingLibrary } from '../../backend/useMutatingLibrary';
|
import { useMutatingLibrary } from '../../backend/useMutatingLibrary';
|
||||||
import { useVersionDelete } from '../../backend/useVersionDelete';
|
import { useVersionDelete } from '../../backend/useVersionDelete';
|
||||||
import { useVersionUpdate } from '../../backend/useVersionUpdate';
|
import { useVersionUpdate } from '../../backend/useVersionUpdate';
|
||||||
|
|
|
@ -4,11 +4,11 @@ import { useIntl } from 'react-intl';
|
||||||
import clsx from 'clsx';
|
import clsx from 'clsx';
|
||||||
|
|
||||||
import { MiniButton } from '@/components/Control';
|
import { MiniButton } from '@/components/Control';
|
||||||
import { createColumnHelper, DataTable, IConditionalStyle } from '@/components/DataTable';
|
import { createColumnHelper, DataTable, type IConditionalStyle } from '@/components/DataTable';
|
||||||
import { IconRemove } from '@/components/Icons';
|
import { IconRemove } from '@/components/Icons';
|
||||||
import { APP_COLORS } from '@/styling/colors';
|
import { APP_COLORS } from '@/styling/colors';
|
||||||
|
|
||||||
import { IVersionInfo } from '../../backend/types';
|
import { type IVersionInfo } from '../../backend/types';
|
||||||
|
|
||||||
interface TableVersionsProps {
|
interface TableVersionsProps {
|
||||||
processing: boolean;
|
processing: boolean;
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
import { AccessPolicy, ILibraryItem, LibraryItemType } from '../backend/types';
|
import { AccessPolicy, type ILibraryItem, LibraryItemType } from '../backend/types';
|
||||||
|
|
||||||
import { LocationHead } from './library';
|
import { LocationHead } from './library';
|
||||||
import { matchLibraryItem, validateLocation } from './libraryAPI';
|
import { matchLibraryItem, validateLocation } from './libraryAPI';
|
||||||
|
|
|
@ -5,7 +5,7 @@
|
||||||
import { limits } from '@/utils/constants';
|
import { limits } from '@/utils/constants';
|
||||||
import { TextMatcher } from '@/utils/utils';
|
import { TextMatcher } from '@/utils/utils';
|
||||||
|
|
||||||
import { ILibraryItem } from '../backend/types';
|
import { type ILibraryItem } from '../backend/types';
|
||||||
|
|
||||||
const LOCATION_REGEXP = /^\/[PLUS]((\/[!\d\p{L}]([!\d\p{L}\- ]*[!\d\p{L}])?)*)?$/u; // cspell:disable-line
|
const LOCATION_REGEXP = /^\/[PLUS]((\/[!\d\p{L}]([!\d\p{L}\- ]*[!\d\p{L}])?)*)?$/u; // cspell:disable-line
|
||||||
|
|
||||||
|
|
|
@ -16,7 +16,12 @@ import { InfoError } from '@/components/InfoError';
|
||||||
import { Label, TextArea, TextInput } from '@/components/Input';
|
import { Label, TextArea, TextInput } from '@/components/Input';
|
||||||
import { EXTEOR_TRS_FILE } from '@/utils/constants';
|
import { EXTEOR_TRS_FILE } from '@/utils/constants';
|
||||||
|
|
||||||
import { AccessPolicy, ICreateLibraryItemDTO, LibraryItemType, schemaCreateLibraryItem } from '../../backend/types';
|
import {
|
||||||
|
AccessPolicy,
|
||||||
|
type ICreateLibraryItemDTO,
|
||||||
|
LibraryItemType,
|
||||||
|
schemaCreateLibraryItem
|
||||||
|
} from '../../backend/types';
|
||||||
import { useCreateItem } from '../../backend/useCreateItem';
|
import { useCreateItem } from '../../backend/useCreateItem';
|
||||||
import { SelectAccessPolicy } from '../../components/SelectAccessPolicy';
|
import { SelectAccessPolicy } from '../../components/SelectAccessPolicy';
|
||||||
import { SelectItemType } from '../../components/SelectItemType';
|
import { SelectItemType } from '../../components/SelectItemType';
|
||||||
|
@ -200,7 +205,7 @@ export function FormCreateItem() {
|
||||||
error={errors.comment}
|
error={errors.comment}
|
||||||
/>
|
/>
|
||||||
|
|
||||||
<div className='flex justify-between gap-3 flex-grow'>
|
<div className='flex justify-between gap-3 grow'>
|
||||||
<div className='flex flex-col gap-2 min-w-[7rem] h-min'>
|
<div className='flex flex-col gap-2 min-w-[7rem] h-min'>
|
||||||
<Label text='Корень' />
|
<Label text='Корень' />
|
||||||
<Controller
|
<Controller
|
||||||
|
|
|
@ -9,15 +9,15 @@ import { useLabelUser } from '@/features/users';
|
||||||
|
|
||||||
import { FlexColumn } from '@/components/Container';
|
import { FlexColumn } from '@/components/Container';
|
||||||
import { MiniButton, TextURL } from '@/components/Control';
|
import { MiniButton, TextURL } from '@/components/Control';
|
||||||
import { createColumnHelper, DataTable, IConditionalStyle, VisibilityState } from '@/components/DataTable';
|
import { createColumnHelper, DataTable, type IConditionalStyle, type VisibilityState } from '@/components/DataTable';
|
||||||
import { IconFolderTree } from '@/components/Icons';
|
import { IconFolderTree } from '@/components/Icons';
|
||||||
import { CProps } from '@/components/props';
|
import { type EventMouse } from '@/components/props';
|
||||||
import { useWindowSize } from '@/hooks/useWindowSize';
|
import { useWindowSize } from '@/hooks/useWindowSize';
|
||||||
import { useFitHeight } from '@/stores/appLayout';
|
import { useFitHeight } from '@/stores/appLayout';
|
||||||
import { usePreferencesStore } from '@/stores/preferences';
|
import { usePreferencesStore } from '@/stores/preferences';
|
||||||
import { APP_COLORS } from '@/styling/colors';
|
import { APP_COLORS } from '@/styling/colors';
|
||||||
|
|
||||||
import { ILibraryItem, LibraryItemType } from '../../backend/types';
|
import { type ILibraryItem, LibraryItemType } from '../../backend/types';
|
||||||
import { BadgeLocation } from '../../components/BadgeLocation';
|
import { BadgeLocation } from '../../components/BadgeLocation';
|
||||||
import { useLibrarySearchStore } from '../../stores/librarySearch';
|
import { useLibrarySearchStore } from '../../stores/librarySearch';
|
||||||
|
|
||||||
|
@ -39,7 +39,7 @@ export function TableLibraryItems({ items }: TableLibraryItemsProps) {
|
||||||
const itemsPerPage = usePreferencesStore(state => state.libraryPagination);
|
const itemsPerPage = usePreferencesStore(state => state.libraryPagination);
|
||||||
const setItemsPerPage = usePreferencesStore(state => state.setLibraryPagination);
|
const setItemsPerPage = usePreferencesStore(state => state.setLibraryPagination);
|
||||||
|
|
||||||
function handleOpenItem(item: ILibraryItem, event: CProps.EventMouse) {
|
function handleOpenItem(item: ILibraryItem, event: EventMouse) {
|
||||||
const selection = window.getSelection();
|
const selection = window.getSelection();
|
||||||
if (!!selection && selection.toString().length > 0) {
|
if (!!selection && selection.toString().length > 0) {
|
||||||
return;
|
return;
|
||||||
|
@ -61,7 +61,7 @@ export function TableLibraryItems({ items }: TableLibraryItemsProps) {
|
||||||
});
|
});
|
||||||
}, [windowSize]);
|
}, [windowSize]);
|
||||||
|
|
||||||
function handleToggleFolder(event: CProps.EventMouse) {
|
function handleToggleFolder(event: EventMouse) {
|
||||||
event.preventDefault();
|
event.preventDefault();
|
||||||
event.stopPropagation();
|
event.stopPropagation();
|
||||||
toggleFolderMode();
|
toggleFolderMode();
|
||||||
|
|
|
@ -17,7 +17,7 @@ import {
|
||||||
IconUserSearch
|
IconUserSearch
|
||||||
} from '@/components/Icons';
|
} from '@/components/Icons';
|
||||||
import { SearchBar } from '@/components/Input';
|
import { SearchBar } from '@/components/Input';
|
||||||
import { CProps } from '@/components/props';
|
import { type EventMouse } from '@/components/props';
|
||||||
import { prefixes } from '@/utils/constants';
|
import { prefixes } from '@/utils/constants';
|
||||||
import { tripleToggleColor } from '@/utils/utils';
|
import { tripleToggleColor } from '@/utils/utils';
|
||||||
|
|
||||||
|
@ -66,7 +66,7 @@ export function ToolbarSearch({ total, filtered }: ToolbarSearchProps) {
|
||||||
toggleFolderMode();
|
toggleFolderMode();
|
||||||
}
|
}
|
||||||
|
|
||||||
function handleFolderClick(event: CProps.EventMouse) {
|
function handleFolderClick(event: EventMouse) {
|
||||||
if (event.ctrlKey || event.metaKey) {
|
if (event.ctrlKey || event.metaKey) {
|
||||||
toggleFolderMode();
|
toggleFolderMode();
|
||||||
} else {
|
} else {
|
||||||
|
@ -139,12 +139,12 @@ export function ToolbarSearch({ total, filtered }: ToolbarSearchProps) {
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div className='flex h-full flex-grow pr-4'>
|
<div className='flex h-full grow pr-4'>
|
||||||
<SearchBar
|
<SearchBar
|
||||||
id='library_search'
|
id='library_search'
|
||||||
placeholder='Поиск'
|
placeholder='Поиск'
|
||||||
noBorder
|
noBorder
|
||||||
className={clsx('min-w-[7rem] sm:min-w-[10rem] max-w-[20rem]', folderMode && 'flex-grow')}
|
className={clsx('min-w-[7rem] sm:min-w-[10rem] max-w-[20rem]', folderMode && 'grow')}
|
||||||
query={query}
|
query={query}
|
||||||
onChangeQuery={setQuery}
|
onChangeQuery={setQuery}
|
||||||
/>
|
/>
|
||||||
|
@ -203,7 +203,7 @@ export function ToolbarSearch({ total, filtered }: ToolbarSearchProps) {
|
||||||
placeholder='Путь'
|
placeholder='Путь'
|
||||||
noIcon
|
noIcon
|
||||||
noBorder
|
noBorder
|
||||||
className='w-[4.5rem] sm:w-[5rem] flex-grow'
|
className='w-[4.5rem] sm:w-[5rem] grow'
|
||||||
query={path}
|
query={path}
|
||||||
onChangeQuery={setPath}
|
onChangeQuery={setPath}
|
||||||
/>
|
/>
|
||||||
|
|
|
@ -7,7 +7,7 @@ import { BadgeHelp, HelpTopic } from '@/features/help';
|
||||||
import { MiniButton } from '@/components/Control';
|
import { MiniButton } from '@/components/Control';
|
||||||
import { SubfoldersIcon } from '@/components/DomainIcons';
|
import { SubfoldersIcon } from '@/components/DomainIcons';
|
||||||
import { IconFolderEdit, IconFolderTree } from '@/components/Icons';
|
import { IconFolderEdit, IconFolderTree } from '@/components/Icons';
|
||||||
import { CProps } from '@/components/props';
|
import { type EventMouse } from '@/components/props';
|
||||||
import { useWindowSize } from '@/hooks/useWindowSize';
|
import { useWindowSize } from '@/hooks/useWindowSize';
|
||||||
import { useFitHeight } from '@/stores/appLayout';
|
import { useFitHeight } from '@/stores/appLayout';
|
||||||
import { PARAMETER, prefixes } from '@/utils/constants';
|
import { PARAMETER, prefixes } from '@/utils/constants';
|
||||||
|
@ -48,7 +48,7 @@ export function ViewSideLocation({ isVisible, onRenameLocation }: ViewSideLocati
|
||||||
|
|
||||||
const maxHeight = useFitHeight('4.5rem');
|
const maxHeight = useFitHeight('4.5rem');
|
||||||
|
|
||||||
function handleClickFolder(event: CProps.EventMouse, target: FolderNode) {
|
function handleClickFolder(event: EventMouse, target: FolderNode) {
|
||||||
event.preventDefault();
|
event.preventDefault();
|
||||||
event.stopPropagation();
|
event.stopPropagation();
|
||||||
if (event.ctrlKey || event.metaKey) {
|
if (event.ctrlKey || event.metaKey) {
|
||||||
|
|
|
@ -3,7 +3,7 @@ import { persist } from 'zustand/middleware';
|
||||||
|
|
||||||
import { toggleTristateFlag } from '@/utils/utils';
|
import { toggleTristateFlag } from '@/utils/utils';
|
||||||
|
|
||||||
import { ILibraryFilter, LocationHead } from '../models/library';
|
import { type ILibraryFilter, LocationHead } from '../models/library';
|
||||||
|
|
||||||
interface LibrarySearchStore {
|
interface LibrarySearchStore {
|
||||||
folderMode: boolean;
|
folderMode: boolean;
|
||||||
|
|
|
@ -2,13 +2,13 @@
|
||||||
* Module: OSS data loading and processing.
|
* Module: OSS data loading and processing.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import { ILibraryItem } from '@/features/library/backend/types';
|
import { type ILibraryItem } from '@/features/library/backend/types';
|
||||||
|
|
||||||
import { Graph } from '@/models/Graph';
|
import { Graph } from '@/models/Graph';
|
||||||
|
|
||||||
import { IOperation, IOperationSchema, IOperationSchemaStats } from '../models/oss';
|
import { type IOperation, type IOperationSchema, type IOperationSchemaStats } from '../models/oss';
|
||||||
|
|
||||||
import { IOperationSchemaDTO, OperationType } from './types';
|
import { type IOperationSchemaDTO, OperationType } from './types';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Loads data into an {@link IOperationSchema} based on {@link IOperationSchemaDTO}.
|
* Loads data into an {@link IOperationSchema} based on {@link IOperationSchemaDTO}.
|
||||||
|
|
|
@ -1,23 +1,23 @@
|
||||||
import { queryOptions } from '@tanstack/react-query';
|
import { queryOptions } from '@tanstack/react-query';
|
||||||
|
|
||||||
import { ITargetCst } from '@/features/rsform/backend/types';
|
import { type ITargetCst } from '@/features/rsform/backend/types';
|
||||||
|
|
||||||
import { axiosGet, axiosPatch, axiosPost } from '@/backend/apiTransport';
|
import { axiosGet, axiosPatch, axiosPost } from '@/backend/apiTransport';
|
||||||
import { DELAYS, KEYS } from '@/backend/configuration';
|
import { DELAYS, KEYS } from '@/backend/configuration';
|
||||||
import { infoMsg } from '@/utils/labels';
|
import { infoMsg } from '@/utils/labels';
|
||||||
|
|
||||||
import {
|
import {
|
||||||
IConstituentaReference,
|
type IConstituentaReference,
|
||||||
ICstRelocateDTO,
|
type ICstRelocateDTO,
|
||||||
IInputCreatedResponse,
|
type IInputCreatedResponse,
|
||||||
IInputUpdateDTO,
|
type IInputUpdateDTO,
|
||||||
IOperationCreatedResponse,
|
type IOperationCreatedResponse,
|
||||||
IOperationCreateDTO,
|
type IOperationCreateDTO,
|
||||||
IOperationDeleteDTO,
|
type IOperationDeleteDTO,
|
||||||
IOperationPosition,
|
type IOperationPosition,
|
||||||
IOperationSchemaDTO,
|
type IOperationSchemaDTO,
|
||||||
IOperationUpdateDTO,
|
type IOperationUpdateDTO,
|
||||||
ITargetOperation,
|
type ITargetOperation,
|
||||||
schemaConstituentaReference,
|
schemaConstituentaReference,
|
||||||
schemaOperationCreatedResponse,
|
schemaOperationCreatedResponse,
|
||||||
schemaOperationSchema
|
schemaOperationSchema
|
||||||
|
|
|
@ -3,7 +3,7 @@ import { useMutation, useQueryClient } from '@tanstack/react-query';
|
||||||
import { KEYS } from '@/backend/configuration';
|
import { KEYS } from '@/backend/configuration';
|
||||||
|
|
||||||
import { ossApi } from './api';
|
import { ossApi } from './api';
|
||||||
import { ITargetOperation } from './types';
|
import { type ITargetOperation } from './types';
|
||||||
|
|
||||||
export const useInputCreate = () => {
|
export const useInputCreate = () => {
|
||||||
const client = useQueryClient();
|
const client = useQueryClient();
|
||||||
|
|
|
@ -3,7 +3,7 @@ import { useMutation, useQueryClient } from '@tanstack/react-query';
|
||||||
import { KEYS } from '@/backend/configuration';
|
import { KEYS } from '@/backend/configuration';
|
||||||
|
|
||||||
import { ossApi } from './api';
|
import { ossApi } from './api';
|
||||||
import { IInputUpdateDTO } from './types';
|
import { type IInputUpdateDTO } from './types';
|
||||||
|
|
||||||
export const useInputUpdate = () => {
|
export const useInputUpdate = () => {
|
||||||
const client = useQueryClient();
|
const client = useQueryClient();
|
||||||
|
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user