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