перенос ui
This commit is contained in:
6
shared/lib/utils.ts
Normal file
6
shared/lib/utils.ts
Normal file
@@ -0,0 +1,6 @@
|
||||
import { type ClassValue, clsx } from 'clsx'
|
||||
import { twMerge } from 'tailwind-merge'
|
||||
|
||||
export function cn(...inputs: ClassValue[]) {
|
||||
return twMerge(clsx(inputs))
|
||||
}
|
||||
@@ -1,6 +1,6 @@
|
||||
import { cn } from '@/lib/utils'
|
||||
import { cva, type VariantProps } from 'class-variance-authority'
|
||||
import * as React from 'react'
|
||||
import { cn } from 'shared/lib/utils'
|
||||
|
||||
const alertVariants = cva(
|
||||
'relative w-full rounded-lg border px-4 py-3 text-sm [&>svg+div]:translate-y-[-3px] [&>svg]:absolute [&>svg]:left-4 [&>svg]:top-4 [&>svg]:text-foreground [&>svg~*]:pl-7',
|
||||
@@ -1,7 +1,7 @@
|
||||
import { cva, type VariantProps } from 'class-variance-authority'
|
||||
import * as React from 'react'
|
||||
|
||||
import { cn } from '../../lib/utils'
|
||||
import { cn } from 'shared/lib/utils'
|
||||
|
||||
const badgeVariants = cva(
|
||||
'inline-flex items-center rounded-full border px-2.5 py-0.5 text-xs font-semibold transition-colors focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2',
|
||||
@@ -2,7 +2,7 @@ import { Slot } from '@radix-ui/react-slot'
|
||||
import { cva, type VariantProps } from 'class-variance-authority'
|
||||
import * as React from 'react'
|
||||
|
||||
import { cn } from '@/lib/utils'
|
||||
import { cn } from 'shared/lib/utils'
|
||||
|
||||
const buttonVariants = cva(
|
||||
'inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-colors focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0',
|
||||
@@ -8,8 +8,8 @@ import {
|
||||
import * as React from 'react'
|
||||
import { DayButton, DayPicker, getDefaultClassNames } from 'react-day-picker'
|
||||
|
||||
import { Button, buttonVariants } from '@/component/ui/button'
|
||||
import { cn } from '@/lib/utils'
|
||||
import { cn } from 'shared/lib/utils'
|
||||
import { Button, buttonVariants } from './button'
|
||||
|
||||
function Calendar({
|
||||
className,
|
||||
@@ -1,6 +1,6 @@
|
||||
import * as React from 'react'
|
||||
|
||||
import { cn } from '@/lib/utils'
|
||||
import { cn } from 'shared/lib/utils'
|
||||
|
||||
const Card = React.forwardRef<
|
||||
HTMLDivElement,
|
||||
@@ -1,7 +1,7 @@
|
||||
import * as CheckboxPrimitive from '@radix-ui/react-checkbox'
|
||||
import { Check } from 'lucide-react'
|
||||
import * as React from 'react'
|
||||
import { cn } from '../../lib/utils'
|
||||
import { cn } from 'shared/lib/utils'
|
||||
|
||||
const Checkbox = React.forwardRef<
|
||||
React.ElementRef<typeof CheckboxPrimitive.Root>,
|
||||
@@ -1,7 +1,7 @@
|
||||
import * as DialogPrimitive from '@radix-ui/react-dialog'
|
||||
import { X } from 'lucide-react'
|
||||
import * as React from 'react'
|
||||
import { cn } from '../../lib/utils'
|
||||
import { cn } from 'shared/lib/utils'
|
||||
|
||||
const Dialog = DialogPrimitive.Root
|
||||
|
||||
@@ -18,7 +18,7 @@ const DialogOverlay = React.forwardRef<
|
||||
<DialogPrimitive.Overlay
|
||||
ref={ref}
|
||||
className={cn(
|
||||
'data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 bg-background/80 backdrop-blur-sm',
|
||||
'fixed inset-0 z-50 bg-background/80 backdrop-blur-sm data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0',
|
||||
className
|
||||
)}
|
||||
{...props}
|
||||
@@ -35,7 +35,7 @@ const DialogContent = React.forwardRef<
|
||||
<DialogPrimitive.Content
|
||||
ref={ref}
|
||||
className={cn(
|
||||
'data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 sm:rounded-lg',
|
||||
'fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg',
|
||||
className
|
||||
)}
|
||||
{...props}
|
||||
@@ -1,5 +1,5 @@
|
||||
import * as React from 'react'
|
||||
import { cn } from '../../lib/utils'
|
||||
import { cn } from 'shared/lib/utils'
|
||||
|
||||
export interface InputProps
|
||||
extends React.InputHTMLAttributes<HTMLInputElement> {}
|
||||
@@ -2,7 +2,7 @@ import * as LabelPrimitive from '@radix-ui/react-label'
|
||||
import { cva, type VariantProps } from 'class-variance-authority'
|
||||
import * as React from 'react'
|
||||
|
||||
import { cn } from '@/lib/utils'
|
||||
import { cn } from 'shared/lib/utils'
|
||||
|
||||
const labelVariants = cva(
|
||||
'text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70'
|
||||
@@ -1,6 +1,6 @@
|
||||
import { cn } from '@/lib/utils'
|
||||
import * as PopoverPrimitive from '@radix-ui/react-popover'
|
||||
import * as React from 'react'
|
||||
import { cn } from 'shared/lib/utils'
|
||||
|
||||
const Popover = PopoverPrimitive.Root
|
||||
const PopoverTrigger = PopoverPrimitive.Trigger
|
||||
@@ -1,7 +1,7 @@
|
||||
import * as RadioGroupPrimitive from '@radix-ui/react-radio-group'
|
||||
import { Circle } from 'lucide-react'
|
||||
import * as React from 'react'
|
||||
import { cn } from '../../lib/utils'
|
||||
import { cn } from 'shared/lib/utils'
|
||||
|
||||
const RadioGroup = React.forwardRef<
|
||||
React.ElementRef<typeof RadioGroupPrimitive.Root>,
|
||||
@@ -4,7 +4,7 @@ import * as SelectPrimitive from '@radix-ui/react-select'
|
||||
import { CheckIcon, ChevronDownIcon, ChevronUpIcon } from 'lucide-react'
|
||||
import * as React from 'react'
|
||||
|
||||
import { cn } from '@/lib/utils'
|
||||
import { cn } from 'shared/lib/utils'
|
||||
|
||||
function Select({
|
||||
...props
|
||||
@@ -61,7 +61,7 @@ function SelectContent({
|
||||
<SelectPrimitive.Content
|
||||
data-slot="select-content"
|
||||
className={cn(
|
||||
'data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 max-h-(--radix-select-content-available-height) origin-(--radix-select-content-transform-origin) relative z-50 min-w-[8rem] overflow-y-auto overflow-x-hidden rounded-md border bg-popover text-popover-foreground shadow-md',
|
||||
'max-h-(--radix-select-content-available-height) origin-(--radix-select-content-transform-origin) relative z-50 min-w-[8rem] overflow-y-auto overflow-x-hidden rounded-md border bg-popover text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2',
|
||||
position === 'popper' &&
|
||||
'data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1',
|
||||
className
|
||||
@@ -1,7 +1,7 @@
|
||||
import * as SeparatorPrimitive from '@radix-ui/react-separator'
|
||||
import * as React from 'react'
|
||||
|
||||
import { cn } from '@/lib/utils'
|
||||
import { cn } from 'shared/lib/utils'
|
||||
|
||||
const Separator = React.forwardRef<
|
||||
React.ElementRef<typeof SeparatorPrimitive.Root>,
|
||||
@@ -2,10 +2,10 @@ import { Slot } from '@radix-ui/react-slot'
|
||||
import { PanelLeftIcon } from 'lucide-react'
|
||||
import * as React from 'react'
|
||||
|
||||
import { Button } from '@/component/ui/button'
|
||||
import { Input } from '@/component/ui/input'
|
||||
import { Separator } from '@/component/ui/separator'
|
||||
import { cn } from '@/lib/utils'
|
||||
import { cn } from 'shared/lib/utils'
|
||||
import { Button } from 'shared/ui/button'
|
||||
import { Input } from 'shared/ui/input'
|
||||
import { Separator } from 'shared/ui/separator'
|
||||
|
||||
const SIDEBAR_COOKIE_NAME = 'sidebar_state'
|
||||
const SIDEBAR_COOKIE_MAX_AGE = 60 * 60 * 24 * 7
|
||||
@@ -1,5 +1,5 @@
|
||||
import * as React from 'react'
|
||||
import { cn } from '../../lib/utils'
|
||||
import { cn } from 'shared/lib/utils'
|
||||
|
||||
export interface TextareaProps
|
||||
extends React.TextareaHTMLAttributes<HTMLTextAreaElement> {}
|
||||
@@ -1,8 +1,8 @@
|
||||
import { Button } from '@/component/ui/button'
|
||||
import { Input } from '@/component/ui/input'
|
||||
import { Label } from '@/component/ui/label'
|
||||
import { ChevronDown, X } from 'lucide-react'
|
||||
import React, { useEffect, useRef, useState } from 'react'
|
||||
import { Button } from 'shared/ui/button'
|
||||
import { Input } from 'shared/ui/input'
|
||||
import { Label } from 'shared/ui/label'
|
||||
|
||||
interface AutocompleteInputProps {
|
||||
label: string
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
import { Input } from '@/component/ui/input'
|
||||
import { Label } from '@/component/ui/label'
|
||||
import { useCategoryContext } from '@/entity/template/model/CategoryContext'
|
||||
import { Attribute } from '@/type/template'
|
||||
import { AlertCircle } from 'lucide-react'
|
||||
import React from 'react'
|
||||
import { Input } from 'shared/ui/input'
|
||||
import { Label } from 'shared/ui/label'
|
||||
|
||||
interface AttributeValue {
|
||||
attributeId: string
|
||||
|
||||
@@ -23,27 +23,27 @@ import {
|
||||
Type,
|
||||
} from 'lucide-react'
|
||||
import React, { useState } from 'react'
|
||||
import { v4 as uuidv4 } from 'uuid'
|
||||
import { Button } from '../ui/button'
|
||||
import { Card, CardContent, CardHeader, CardTitle } from '../ui/card'
|
||||
import { Checkbox } from '../ui/checkbox'
|
||||
import { Button } from 'shared/ui/button'
|
||||
import { Card, CardContent, CardHeader, CardTitle } from 'shared/ui/card'
|
||||
import { Checkbox } from 'shared/ui/checkbox'
|
||||
import {
|
||||
Dialog,
|
||||
DialogContent,
|
||||
DialogDescription,
|
||||
DialogHeader,
|
||||
DialogTitle,
|
||||
} from '../ui/dialog'
|
||||
import { Input } from '../ui/input'
|
||||
import { Label } from '../ui/label'
|
||||
} from 'shared/ui/dialog'
|
||||
import { Input } from 'shared/ui/input'
|
||||
import { Label } from 'shared/ui/label'
|
||||
import {
|
||||
Select,
|
||||
SelectContent,
|
||||
SelectItem,
|
||||
SelectTrigger,
|
||||
SelectValue,
|
||||
} from '../ui/select'
|
||||
import { Separator } from '../ui/separator'
|
||||
} from 'shared/ui/select'
|
||||
import { Separator } from 'shared/ui/separator'
|
||||
import { v4 as uuidv4 } from 'uuid'
|
||||
import { ElementFormulaBar } from './ElementFormulaBar'
|
||||
import { VisualLayoutEditor } from './VisualLayoutEditor'
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { Eye, EyeOff, Magnet, Plus, Save, Wrench } from 'lucide-react'
|
||||
import { memo } from 'react'
|
||||
import { Button } from '../ui/button'
|
||||
import { Button } from 'shared/ui/button'
|
||||
|
||||
interface ElementFormulaBarProps {
|
||||
elementCount: number
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import { Button } from '@/component/ui/button'
|
||||
import { Popover, PopoverContent, PopoverTrigger } from '@/component/ui/popover'
|
||||
import { FileText, Upload } from 'lucide-react'
|
||||
import React, { useRef } from 'react'
|
||||
import { Button } from 'shared/ui/button'
|
||||
import { Popover, PopoverContent, PopoverTrigger } from 'shared/ui/popover'
|
||||
|
||||
interface ExcelUploadPanelProps {
|
||||
fileName?: string
|
||||
|
||||
@@ -1,5 +1,3 @@
|
||||
import { Button } from '@/component/ui/button'
|
||||
import { Separator } from '@/component/ui/separator'
|
||||
import {
|
||||
AlignCenter,
|
||||
AlignLeft,
|
||||
@@ -12,6 +10,8 @@ import {
|
||||
Underline,
|
||||
} from 'lucide-react'
|
||||
import React from 'react'
|
||||
import { Button } from 'shared/ui/button'
|
||||
import { Separator } from 'shared/ui/separator'
|
||||
|
||||
export const FormattingToolbar: React.FC = () => (
|
||||
<div className="flex items-center gap-0.5 rounded-lg border bg-background p-0.5">
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
import { Button } from '@/component/ui/button'
|
||||
import { Template } from '@/type/template'
|
||||
import { ArrowLeft, FileText, Settings, Wrench } from 'lucide-react'
|
||||
import React from 'react'
|
||||
import { useNavigate } from 'react-router-dom'
|
||||
import { Button } from 'shared/ui/button'
|
||||
|
||||
interface HeaderBarProps {
|
||||
template: Template
|
||||
|
||||
@@ -1,5 +1,10 @@
|
||||
import { AutocompleteInput } from '@/component/TemplateManager/AutocompleteInput'
|
||||
import { Button } from '@/component/ui/button'
|
||||
import { useCategoryContext } from '@/entity/template/model/CategoryContext'
|
||||
import { Template } from '@/type/template'
|
||||
import { Filter, X } from 'lucide-react'
|
||||
import React, { useMemo } from 'react'
|
||||
import { Button } from 'shared/ui/button'
|
||||
import { Label } from 'shared/ui/label'
|
||||
import {
|
||||
Sidebar,
|
||||
SidebarContent,
|
||||
@@ -8,12 +13,7 @@ import {
|
||||
SidebarGroupLabel,
|
||||
SidebarHeader,
|
||||
SidebarSeparator,
|
||||
} from '@/component/ui/sidebar'
|
||||
import { useCategoryContext } from '@/entity/template/model/CategoryContext'
|
||||
import { Template } from '@/type/template'
|
||||
import { Filter, X } from 'lucide-react'
|
||||
import React, { useMemo } from 'react'
|
||||
import { Label } from '../ui/label'
|
||||
} from 'shared/ui/sidebar'
|
||||
|
||||
export interface TemplateFilters {
|
||||
name: string
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
import { useTemplateContext } from '@/entity/template/model/TemplateContext'
|
||||
import { Template } from '@/type/template'
|
||||
import TemplateCard from '@/widget/template/ui/TemplateCard'
|
||||
import { Circle, CircleCheck, FileText, Plus, Trash2 } from 'lucide-react'
|
||||
import React, { useEffect, useState } from 'react'
|
||||
import { useNavigate } from 'react-router-dom'
|
||||
import TemplateCard from '../../widget/template/ui/TemplateCard'
|
||||
import { Button } from '../ui/button'
|
||||
import { Button } from 'shared/ui/button'
|
||||
import {
|
||||
Dialog,
|
||||
DialogContent,
|
||||
@@ -12,8 +12,8 @@ import {
|
||||
DialogHeader,
|
||||
DialogTitle,
|
||||
DialogTrigger,
|
||||
} from '../ui/dialog'
|
||||
import { Input } from '../ui/input'
|
||||
} from 'shared/ui/dialog'
|
||||
import { Input } from 'shared/ui/input'
|
||||
import { TemplateEditor } from './TemplateEditor'
|
||||
|
||||
interface TemplateManagerProps {
|
||||
|
||||
@@ -1,13 +1,13 @@
|
||||
import { Edit, Grid, Move, Trash2 } from 'lucide-react'
|
||||
import React, { useCallback, useEffect, useMemo, useState } from 'react'
|
||||
import { Rnd } from 'react-rnd'
|
||||
import { getElementDefinition } from '../../entity/element/model/interface'
|
||||
import { getElementDefinition } from '@/entity/element/model/interface'
|
||||
import {
|
||||
ElementLayout,
|
||||
FormLayoutSettings,
|
||||
TemplateElement,
|
||||
} from '../../type/template'
|
||||
import { Button } from '../ui/button'
|
||||
} from '@/type/template'
|
||||
import { Edit, Grid, Move, Trash2 } from 'lucide-react'
|
||||
import React, { useCallback, useEffect, useMemo, useState } from 'react'
|
||||
import { Rnd } from 'react-rnd'
|
||||
import { Button } from 'shared/ui/button'
|
||||
|
||||
// Минимальные размеры для разных типов элементов.
|
||||
// Если понадобится скорректировать размеры для конкретного элемента,
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
import { Button } from '@/component/ui/button'
|
||||
import { Input } from '@/component/ui/input'
|
||||
import { ElementDefinition } from '@/entity/element/model/interface'
|
||||
import { CellsBadge } from '@/entity/element/ui/cellsBadge'
|
||||
import { ElementOption } from '@/type/template'
|
||||
import { Plus, Square, Trash2 } from 'lucide-react'
|
||||
import { Button } from 'shared/ui/button'
|
||||
import { Input } from 'shared/ui/input'
|
||||
|
||||
interface ButtonGroupConfig {
|
||||
placeholder?: string
|
||||
|
||||
@@ -1,5 +1,10 @@
|
||||
import { Button } from '@/component/ui/button'
|
||||
import { Input } from '@/component/ui/input'
|
||||
import { ElementDefinition } from '@/entity/element/model/interface'
|
||||
import { CellsBadge } from '@/entity/element/ui/cellsBadge'
|
||||
import { useToast } from '@/lib/hooks/useToast'
|
||||
import { ElementOption } from '@/type/template'
|
||||
import { ChevronDown, Plus, Trash2 } from 'lucide-react'
|
||||
import { Button } from 'shared/ui/button'
|
||||
import { Input } from 'shared/ui/input'
|
||||
import {
|
||||
Select,
|
||||
SelectContent,
|
||||
@@ -7,12 +12,7 @@ import {
|
||||
SelectItem,
|
||||
SelectTrigger,
|
||||
SelectValue,
|
||||
} from '@/component/ui/select'
|
||||
import { ElementDefinition } from '@/entity/element/model/interface'
|
||||
import { CellsBadge } from '@/entity/element/ui/cellsBadge'
|
||||
import { useToast } from '@/lib/hooks/useToast'
|
||||
import { ElementOption } from '@/type/template'
|
||||
import { ChevronDown, Plus, Trash2 } from 'lucide-react'
|
||||
} from 'shared/ui/select'
|
||||
|
||||
interface SelectConfig {
|
||||
placeholder?: string
|
||||
|
||||
@@ -1,13 +1,13 @@
|
||||
import { Button } from '@/component/ui/button'
|
||||
import { Info, Settings } from 'lucide-react'
|
||||
import { useState } from 'react'
|
||||
import { Button } from 'shared/ui/button'
|
||||
import {
|
||||
Select,
|
||||
SelectContent,
|
||||
SelectItem,
|
||||
SelectTrigger,
|
||||
SelectValue,
|
||||
} from '@/component/ui/select'
|
||||
import { Info, Settings } from 'lucide-react'
|
||||
import { useState } from 'react'
|
||||
} from 'shared/ui/select'
|
||||
import { StandardsSelector } from './StandardsSelector'
|
||||
import { StandardsConfig } from './definition'
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { Button } from '@/component/ui/button'
|
||||
import { Label } from '@/component/ui/label'
|
||||
import { FileText, Settings } from 'lucide-react'
|
||||
import { Button } from 'shared/ui/button'
|
||||
import { Label } from 'shared/ui/label'
|
||||
import { StandardsConfig } from './definition'
|
||||
|
||||
interface StandardsPreviewProps {
|
||||
|
||||
@@ -1,13 +1,3 @@
|
||||
import { Badge } from '@/component/ui/badge'
|
||||
import { Button } from '@/component/ui/button'
|
||||
import {
|
||||
Dialog,
|
||||
DialogContent,
|
||||
DialogHeader,
|
||||
DialogTitle,
|
||||
} from '@/component/ui/dialog'
|
||||
import { Input } from '@/component/ui/input'
|
||||
import { Separator } from '@/component/ui/separator'
|
||||
import { useToast } from '@/lib/hooks/useToast'
|
||||
import {
|
||||
DndContext,
|
||||
@@ -36,6 +26,16 @@ import {
|
||||
X,
|
||||
} from 'lucide-react'
|
||||
import { useEffect, useMemo, useRef, useState } from 'react'
|
||||
import { Badge } from 'shared/ui/badge'
|
||||
import { Button } from 'shared/ui/button'
|
||||
import {
|
||||
Dialog,
|
||||
DialogContent,
|
||||
DialogHeader,
|
||||
DialogTitle,
|
||||
} from 'shared/ui/dialog'
|
||||
import { Input } from 'shared/ui/input'
|
||||
import { Separator } from 'shared/ui/separator'
|
||||
import { useStandards } from './hooks'
|
||||
import { Standard } from './types'
|
||||
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
import { Badge } from '@/component/ui/badge'
|
||||
import { Button } from '@/component/ui/button'
|
||||
import { Label } from '@/component/ui/label'
|
||||
import { ElementDefinition } from '@/entity/element/model/interface'
|
||||
import { CellsBadge } from '@/entity/element/ui/cellsBadge'
|
||||
import { CellTarget } from '@/type/template'
|
||||
import { FileText, Settings, Weight } from 'lucide-react'
|
||||
import { useEffect, useState } from 'react'
|
||||
import { Badge } from 'shared/ui/badge'
|
||||
import { Button } from 'shared/ui/button'
|
||||
import { Label } from 'shared/ui/label'
|
||||
import { useStandards } from './hooks'
|
||||
import { StandardsEditor } from './StandardsEditor'
|
||||
import { StandardsPreview } from './StandardsPreview'
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
import { Checkbox } from '@/component/ui/checkbox'
|
||||
import { Input } from '@/component/ui/input'
|
||||
import { ElementDefinition } from '@/entity/element/model/interface'
|
||||
import { CellsBadge } from '@/entity/element/ui/cellsBadge'
|
||||
import { Plus, Save, SaveOff, Type } from 'lucide-react'
|
||||
import { useEffect, useState } from 'react'
|
||||
import { Checkbox } from 'shared/ui/checkbox'
|
||||
import { Input } from 'shared/ui/input'
|
||||
|
||||
interface TextConfig {
|
||||
placeholder?: string
|
||||
|
||||
@@ -1,14 +1,14 @@
|
||||
import { Badge } from '@/component/ui/badge'
|
||||
import { Label } from '@/component/ui/label'
|
||||
import { CellTarget } from '@/type/template'
|
||||
import { Building2, Calendar } from 'lucide-react'
|
||||
import { Badge } from 'shared/ui/badge'
|
||||
import { Label } from 'shared/ui/label'
|
||||
import {
|
||||
Select,
|
||||
SelectContent,
|
||||
SelectItem,
|
||||
SelectTrigger,
|
||||
SelectValue,
|
||||
} from '@/component/ui/select'
|
||||
import { CellTarget } from '@/type/template'
|
||||
import { Building2, Calendar } from 'lucide-react'
|
||||
} from 'shared/ui/select'
|
||||
import { useLaboratories, useLaboratoryConditions } from './hooks'
|
||||
import { ConditionMapping, VerificationConditionsConfig } from './types'
|
||||
|
||||
|
||||
@@ -1,5 +1,3 @@
|
||||
import { Button } from '@/component/ui/button'
|
||||
import { Card, CardContent } from '@/component/ui/card'
|
||||
import {
|
||||
AlertCircle,
|
||||
Building2,
|
||||
@@ -9,6 +7,8 @@ import {
|
||||
Settings,
|
||||
Thermometer,
|
||||
} from 'lucide-react'
|
||||
import { Button } from 'shared/ui/button'
|
||||
import { Card, CardContent } from 'shared/ui/card'
|
||||
import { VerificationConditionsConfig } from './types'
|
||||
|
||||
interface VerificationConditionsPreviewProps {
|
||||
|
||||
@@ -1,14 +1,3 @@
|
||||
import { Button } from '@/component/ui/button'
|
||||
import { Card, CardContent } from '@/component/ui/card'
|
||||
import {
|
||||
Dialog,
|
||||
DialogContent,
|
||||
DialogHeader,
|
||||
DialogTitle,
|
||||
DialogTrigger,
|
||||
} from '@/component/ui/dialog'
|
||||
import { Input } from '@/component/ui/input'
|
||||
import { Label } from '@/component/ui/label'
|
||||
import { CellsBadge } from '@/entity/element/ui/cellsBadge'
|
||||
import {
|
||||
AlertCircle,
|
||||
@@ -21,6 +10,17 @@ import {
|
||||
Thermometer,
|
||||
} from 'lucide-react'
|
||||
import { useEffect, useState } from 'react'
|
||||
import { Button } from 'shared/ui/button'
|
||||
import { Card, CardContent } from 'shared/ui/card'
|
||||
import {
|
||||
Dialog,
|
||||
DialogContent,
|
||||
DialogHeader,
|
||||
DialogTitle,
|
||||
DialogTrigger,
|
||||
} from 'shared/ui/dialog'
|
||||
import { Input } from 'shared/ui/input'
|
||||
import { Label } from 'shared/ui/label'
|
||||
import {
|
||||
useDailyConditions,
|
||||
useLaboratories,
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
import { Toast, ToastContainer, ToastType } from '@/component/ui/toast'
|
||||
import {
|
||||
createContext,
|
||||
FC,
|
||||
@@ -7,6 +6,7 @@ import {
|
||||
useContext,
|
||||
useState,
|
||||
} from 'react'
|
||||
import { Toast, ToastContainer, ToastType } from 'shared/ui/toast'
|
||||
|
||||
interface ToastContextType {
|
||||
showToast: (
|
||||
|
||||
@@ -1,15 +1,9 @@
|
||||
import { type ClassValue, clsx } from 'clsx'
|
||||
import { twMerge } from 'tailwind-merge'
|
||||
import {
|
||||
CellTarget,
|
||||
ElementLayout,
|
||||
FormLayoutSettings,
|
||||
TemplateElement,
|
||||
} from '../type/template'
|
||||
|
||||
export function cn(...inputs: ClassValue[]) {
|
||||
return twMerge(clsx(inputs))
|
||||
}
|
||||
} from '@/type/template'
|
||||
|
||||
// Миграция элементов из старого формата в новый
|
||||
export function migrateTemplateElement(element: any): TemplateElement {
|
||||
|
||||
@@ -1,13 +1,3 @@
|
||||
import { Badge } from '@/component/ui/badge'
|
||||
import { Button } from '@/component/ui/button'
|
||||
import {
|
||||
Dialog,
|
||||
DialogContent,
|
||||
DialogHeader,
|
||||
DialogTitle,
|
||||
} from '@/component/ui/dialog'
|
||||
import { Input } from '@/component/ui/input'
|
||||
import { Label } from '@/component/ui/label'
|
||||
import {
|
||||
useCreateStandard,
|
||||
useDeleteStandard,
|
||||
@@ -30,6 +20,16 @@ import {
|
||||
Weight,
|
||||
} from 'lucide-react'
|
||||
import { useEffect, useState } from 'react'
|
||||
import { Badge } from 'shared/ui/badge'
|
||||
import { Button } from 'shared/ui/button'
|
||||
import {
|
||||
Dialog,
|
||||
DialogContent,
|
||||
DialogHeader,
|
||||
DialogTitle,
|
||||
} from 'shared/ui/dialog'
|
||||
import { Input } from 'shared/ui/input'
|
||||
import { Label } from 'shared/ui/label'
|
||||
|
||||
export const StandardsManagementPage = () => {
|
||||
const [searchTerm, setSearchTerm] = useState('')
|
||||
|
||||
@@ -3,24 +3,6 @@ import {
|
||||
TemplateFilterSidebar,
|
||||
TemplateFilters,
|
||||
} from '@/component/TemplateManager/TemplateFilterSidebar'
|
||||
import { Button } from '@/component/ui/button'
|
||||
import { Card, CardContent, CardHeader, CardTitle } from '@/component/ui/card'
|
||||
import {
|
||||
Dialog,
|
||||
DialogClose,
|
||||
DialogContent,
|
||||
DialogDescription,
|
||||
DialogHeader,
|
||||
DialogTitle,
|
||||
DialogTrigger,
|
||||
} from '@/component/ui/dialog'
|
||||
import { Input } from '@/component/ui/input'
|
||||
import { Separator } from '@/component/ui/separator'
|
||||
import {
|
||||
SidebarInset,
|
||||
SidebarProvider,
|
||||
SidebarTrigger,
|
||||
} from '@/component/ui/sidebar'
|
||||
import {
|
||||
apiTemplateWithAttributesToTemplate,
|
||||
getTemplateWithAttributesApi,
|
||||
@@ -41,6 +23,24 @@ import {
|
||||
Type,
|
||||
} from 'lucide-react'
|
||||
import { useCallback, useMemo, useState } from 'react'
|
||||
import { Button } from 'shared/ui/button'
|
||||
import { Card, CardContent, CardHeader, CardTitle } from 'shared/ui/card'
|
||||
import {
|
||||
Dialog,
|
||||
DialogClose,
|
||||
DialogContent,
|
||||
DialogDescription,
|
||||
DialogHeader,
|
||||
DialogTitle,
|
||||
DialogTrigger,
|
||||
} from 'shared/ui/dialog'
|
||||
import { Input } from 'shared/ui/input'
|
||||
import { Separator } from 'shared/ui/separator'
|
||||
import {
|
||||
SidebarInset,
|
||||
SidebarProvider,
|
||||
SidebarTrigger,
|
||||
} from 'shared/ui/sidebar'
|
||||
|
||||
interface AttributeValue {
|
||||
attributeId: string
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
import { ElementConstructor } from '@/component/TemplateManager/ElementConstructor'
|
||||
import { Button } from '@/component/ui/button'
|
||||
import { useTemplateContext } from '@/entity/template/model/TemplateContext'
|
||||
import { useDelayedSave } from '@/hook/useDelayedSave'
|
||||
import { FormLayoutSettings, Template, TemplateElement } from '@/type/template'
|
||||
import { ArrowLeft, FileText, Settings, Wrench } from 'lucide-react'
|
||||
import { FC, useCallback, useEffect, useState } from 'react'
|
||||
import { useNavigate, useParams } from 'react-router-dom'
|
||||
import { Button } from 'shared/ui/button'
|
||||
|
||||
export const ElementsCreation: FC = () => {
|
||||
const navigate = useNavigate()
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
import DualSpreadsheet from '@/component/DualSpreadsheet/DualSpreadsheet'
|
||||
import { Button } from '@/component/ui/button'
|
||||
import { getElementDefinition } from '@/entity/element/model/interface'
|
||||
import { useTemplateContext } from '@/entity/template/model/TemplateContext'
|
||||
import { cellAddressToCoordinates } from '@/lib/cell-utils'
|
||||
@@ -9,6 +8,7 @@ import { Template, TemplateElement } from '@/type/template'
|
||||
import { ArrowLeft, FileText, Grid, Save, Settings, Wrench } from 'lucide-react'
|
||||
import { FC, useEffect, useMemo, useRef, useState } from 'react'
|
||||
import { useNavigate, useParams } from 'react-router-dom'
|
||||
import { Button } from 'shared/ui/button'
|
||||
|
||||
interface ProtocolFormProps {
|
||||
template: Template
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
import { Button } from '@/component/ui/button'
|
||||
import { Card, CardContent, CardHeader, CardTitle } from '@/component/ui/card'
|
||||
import { Popover, PopoverContent, PopoverTrigger } from '@/component/ui/popover'
|
||||
import { Template, TemplateAttributeDetail } from '@/type/template'
|
||||
import clsx from 'clsx'
|
||||
import { Check, Copy, MoreVertical, Pencil, Trash2 } from 'lucide-react'
|
||||
import React from 'react'
|
||||
import { useNavigate } from 'react-router-dom'
|
||||
import { Button } from 'shared/ui/button'
|
||||
import { Card, CardContent, CardHeader, CardTitle } from 'shared/ui/card'
|
||||
import { Popover, PopoverContent, PopoverTrigger } from 'shared/ui/popover'
|
||||
|
||||
interface TemplateCardProps {
|
||||
template: Template & { attributes?: TemplateAttributeDetail[] }
|
||||
|
||||
@@ -14,7 +14,8 @@
|
||||
"outDir": "./dist/",
|
||||
"baseUrl": ".",
|
||||
"paths": {
|
||||
"@/*": ["./src/*"]
|
||||
"@/*": ["./src/*"],
|
||||
"shared/*": ["./shared/*"]
|
||||
},
|
||||
"skipLibCheck": true
|
||||
},
|
||||
|
||||
@@ -2,22 +2,18 @@ import react from '@vitejs/plugin-react-swc'
|
||||
import path from 'path'
|
||||
import { defineConfig } from 'vite'
|
||||
|
||||
// https://vitejs.dev/config/
|
||||
export default defineConfig({
|
||||
plugins: [react()],
|
||||
resolve: {
|
||||
alias: {
|
||||
'@': path.resolve(__dirname, 'src'),
|
||||
'@widgets': path.resolve('src/widgets'),
|
||||
'@features': path.resolve('src/features'),
|
||||
'@entities': path.resolve('src/entities'),
|
||||
shared: path.resolve(__dirname, 'shared'),
|
||||
},
|
||||
},
|
||||
server: {
|
||||
host: '0.0.0.0', // Открыть для всех IP адресов
|
||||
host: '0.0.0.0',
|
||||
proxy: {
|
||||
'/api': {
|
||||
//192.168.2.66
|
||||
target: 'http://localhost:8000',
|
||||
changeOrigin: true,
|
||||
rewrite: path => path.replace(/^\/api/, ''),
|
||||
|
||||
Reference in New Issue
Block a user