@ryuzaki13/react-foundation-ui 3.4.3 → 3.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/badge/index.js +65 -2
- package/dist/badge/index.js.map +1 -0
- package/dist/barcode-scanner/index.js +18 -18
- package/dist/base-table/index.js +2 -2
- package/dist/button/index.js +1 -1
- package/dist/check-box/index.js +1 -1
- package/dist/chunks/{CalendarView-Dm55k0bN.js → CalendarView-CwbPJG2Y.js} +86 -86
- package/dist/chunks/{CalendarView-Dm55k0bN.js.map → CalendarView-CwbPJG2Y.js.map} +1 -1
- package/dist/chunks/{ImageViewerRuntime-HGBWp9NM.js → ImageViewerRuntime-DZpgxzF1.js} +25 -25
- package/dist/chunks/{ImageViewerRuntime-HGBWp9NM.js.map → ImageViewerRuntime-DZpgxzF1.js.map} +1 -1
- package/dist/chunks/{TextEditorLexicalClient-C8nSoz85.js → TextEditorLexicalClient-BRp8jHId.js} +354 -354
- package/dist/chunks/{TextEditorLexicalClient-C8nSoz85.js.map → TextEditorLexicalClient-BRp8jHId.js.map} +1 -1
- package/dist/chunks/{base-table-BWvKfI2W.js → base-table-BHmboNzl.js} +138 -138
- package/dist/chunks/{base-table-BWvKfI2W.js.map → base-table-BHmboNzl.js.map} +1 -1
- package/dist/chunks/{button-DF21yxVp.js → button-D7GAU2Wa.js} +20 -20
- package/dist/chunks/{button-DF21yxVp.js.map → button-D7GAU2Wa.js.map} +1 -1
- package/dist/chunks/{check-box-CZyhzmR0.js → check-box-D_Y6iIWv.js} +19 -19
- package/dist/chunks/{check-box-CZyhzmR0.js.map → check-box-D_Y6iIWv.js.map} +1 -1
- package/dist/chunks/{context-menu-DgvXGCuI.js → context-menu-BQePxRpu.js} +159 -159
- package/dist/chunks/{context-menu-DgvXGCuI.js.map → context-menu-BQePxRpu.js.map} +1 -1
- package/dist/chunks/{date-input-D7aBsPJc.js → date-input-Crijdmmq.js} +67 -67
- package/dist/chunks/{date-input-D7aBsPJc.js.map → date-input-Crijdmmq.js.map} +1 -1
- package/dist/chunks/{date-range-preset-select-BLnY47cv.js → date-range-preset-select-CyzGMvVp.js} +6 -6
- package/dist/chunks/{date-range-preset-select-BLnY47cv.js.map → date-range-preset-select-CyzGMvVp.js.map} +1 -1
- package/dist/chunks/{dialog-1Z1zCNCe.js → dialog-BcQGVNbu.js} +13 -13
- package/dist/chunks/{dialog-1Z1zCNCe.js.map → dialog-BcQGVNbu.js.map} +1 -1
- package/dist/chunks/{flex-C7njxZ74.js → flex-DtXK7OM4.js} +29 -29
- package/dist/chunks/{flex-C7njxZ74.js.map → flex-DtXK7OM4.js.map} +1 -1
- package/dist/chunks/{floating-arrow-DPKwJfww.js → floating-arrow-DKUKx2ZQ.js} +7 -7
- package/dist/chunks/{floating-arrow-DPKwJfww.js.map → floating-arrow-DKUKx2ZQ.js.map} +1 -1
- package/dist/chunks/{input-DSPKgiCK.js → input-CuRK9Vbz.js} +78 -78
- package/dist/chunks/{input-DSPKgiCK.js.map → input-CuRK9Vbz.js.map} +1 -1
- package/dist/chunks/{input-files-tIS17-zX.js → input-files-B8j6Pb_M.js} +31 -31
- package/dist/chunks/{input-files-tIS17-zX.js.map → input-files-B8j6Pb_M.js.map} +1 -1
- package/dist/chunks/{misc-DeGboAt-.js → misc-CGQOXXCy.js} +110 -110
- package/dist/chunks/{misc-DeGboAt-.js.map → misc-CGQOXXCy.js.map} +1 -1
- package/dist/chunks/{modal-dplfAaER.js → modal-febBsMyR.js} +58 -58
- package/dist/chunks/{modal-dplfAaER.js.map → modal-febBsMyR.js.map} +1 -1
- package/dist/chunks/{picker-lvm82d0A.js → picker-BA6okKnz.js} +91 -91
- package/dist/chunks/{picker-lvm82d0A.js.map → picker-BA6okKnz.js.map} +1 -1
- package/dist/chunks/popover-yl5DVe06.js +245 -0
- package/dist/chunks/{popover-Bne-Ljbs.js.map → popover-yl5DVe06.js.map} +1 -1
- package/dist/chunks/radio-group-CW-K1n9c.js +125 -0
- package/dist/chunks/{radio-group-sSnlYjAX.js.map → radio-group-CW-K1n9c.js.map} +1 -1
- package/dist/chunks/select-DblNSc5H.js +363 -0
- package/dist/chunks/{select-aTGupQan.js.map → select-DblNSc5H.js.map} +1 -1
- package/dist/chunks/{separator-B72Aq-6a.js → separator-CIqnk2z9.js} +2 -2
- package/dist/chunks/{separator-B72Aq-6a.js.map → separator-CIqnk2z9.js.map} +1 -1
- package/dist/chunks/{sortable-BKIwlqhI.js → sortable-CQmMHAF8.js} +38 -38
- package/dist/chunks/{sortable-BKIwlqhI.js.map → sortable-CQmMHAF8.js.map} +1 -1
- package/dist/chunks/{table-DxoSOvQK.js → table-BnvjPaE1.js} +18 -18
- package/dist/chunks/{table-DxoSOvQK.js.map → table-BnvjPaE1.js.map} +1 -1
- package/dist/chunks/{table-column-interactions-DzEvVuXe.js → table-column-interactions-Do8LFtiv.js} +20 -20
- package/dist/chunks/{table-column-interactions-DzEvVuXe.js.map → table-column-interactions-Do8LFtiv.js.map} +1 -1
- package/dist/chunks/{types-D9Wj9wrg.js → types-CxXyru6U.js} +21 -21
- package/dist/chunks/{types-D9Wj9wrg.js.map → types-CxXyru6U.js.map} +1 -1
- package/dist/chunks/{useODataSelectBase-DR4PrY1j.js → useODataSelectBase-DwR4Lfv-.js} +5 -5
- package/dist/chunks/{useODataSelectBase-DR4PrY1j.js.map → useODataSelectBase-DwR4Lfv-.js.map} +1 -1
- package/dist/chunks/{wheel-picker-FS58cRsQ.js → wheel-picker-DUHGy7wE.js} +23 -23
- package/dist/chunks/{wheel-picker-FS58cRsQ.js.map → wheel-picker-DUHGy7wE.js.map} +1 -1
- package/dist/context-menu/index.js +1 -1
- package/dist/date-input/index.js +2 -2
- package/dist/date-range-preset-select/index.js +1 -1
- package/dist/date-time-input/index.js +122 -122
- package/dist/date-time-input/index.js.map +1 -1
- package/dist/detail/index.js +22 -22
- package/dist/dialog/index.js +1 -1
- package/dist/disclosure/index.js +9 -9
- package/dist/drop-zone/index.js +21 -21
- package/dist/errors/index.js +50 -50
- package/dist/expandable-action-panel/index.js +24 -24
- package/dist/flex/index.js +1 -1
- package/dist/flex/useFlexClasses.d.ts +1 -1
- package/dist/floating-arrow/index.js +1 -1
- package/dist/fullscreen-portal/index.js +8 -8
- package/dist/image/index.js +119 -119
- package/dist/input/index.js +1 -1
- package/dist/input-date-time/index.js +55 -55
- package/dist/input-file/index.js +16 -16
- package/dist/input-files/index.js +1 -1
- package/dist/input-image/index.js +17 -17
- package/dist/input-search/index.js +30 -2
- package/dist/input-search/index.js.map +1 -0
- package/dist/layout-picker/index.js +93 -93
- package/dist/layout-picker/index.js.map +1 -1
- package/dist/list/index.js +39 -39
- package/dist/listbox/index.js +33 -33
- package/dist/misc/index.js +1 -1
- package/dist/modal/index.js +1 -1
- package/dist/multi-select/index.js +466 -2
- package/dist/multi-select/index.js.map +1 -0
- package/dist/notifications/index.js +45 -45
- package/dist/option/index.js +30 -30
- package/dist/period-select/index.js +7 -7
- package/dist/picker/index.js +1 -1
- package/dist/popover/index.js +1 -1
- package/dist/preset-range-date-input/index.js +10 -10
- package/dist/preset-select/index.js +1 -1
- package/dist/radio-button/index.js +9 -9
- package/dist/radio-group/index.js +1 -1
- package/dist/select/index.js +1 -1
- package/dist/separator/index.js +1 -1
- package/dist/simple-table/index.js +5 -5
- package/dist/slider/index.js +82 -82
- package/dist/slider/index.js.map +1 -1
- package/dist/sortable/index.js +1 -1
- package/dist/splitter/index.js +55 -55
- package/dist/state-select/index.js +17 -17
- package/dist/styles.css +1 -1
- package/dist/switch/index.js +18 -18
- package/dist/table/index.js +1 -1
- package/dist/table-column-interactions/index.js +1 -1
- package/dist/table-editor/index.js +99 -99
- package/dist/table-sorting/index.js +13 -13
- package/dist/tabs/index.js +83 -83
- package/dist/tag-input/index.js +58 -58
- package/dist/tag-input/index.js.map +1 -1
- package/dist/text/index.js +18 -18
- package/dist/text-editor/index.js +3 -3
- package/dist/textarea/index.js +1 -1
- package/dist/three-scene/index.js +7 -7
- package/dist/toggle/index.js +20 -20
- package/dist/toolbar/index.js +16 -16
- package/dist/tree/index.js +24 -24
- package/dist/tree-select/index.js +189 -189
- package/dist/tree-select/index.js.map +1 -1
- package/dist/tree-table/index.js +33 -33
- package/dist/tree-table/index.js.map +1 -1
- package/dist/wheel-picker/index.js +1 -1
- package/package.json +1 -5
- package/storybook-static/project.json +1 -1
- package/dist/advanced-search/index.d.ts +0 -3
- package/dist/advanced-search/index.d.ts.map +0 -1
- package/dist/advanced-search/index.js +0 -399
- package/dist/advanced-search/index.js.map +0 -1
- package/dist/advanced-search/lib/index.d.ts +0 -2
- package/dist/advanced-search/lib/index.d.ts.map +0 -1
- package/dist/advanced-search/lib/searchParts.d.ts +0 -3
- package/dist/advanced-search/lib/searchParts.d.ts.map +0 -1
- package/dist/advanced-search/model/index.d.ts +0 -5
- package/dist/advanced-search/model/index.d.ts.map +0 -1
- package/dist/advanced-search/model/types.d.ts +0 -55
- package/dist/advanced-search/model/types.d.ts.map +0 -1
- package/dist/advanced-search/model/useAdvancedSearch.d.ts +0 -11
- package/dist/advanced-search/model/useAdvancedSearch.d.ts.map +0 -1
- package/dist/advanced-search/model/useAdvancedSearchInitialSelected.d.ts +0 -6
- package/dist/advanced-search/model/useAdvancedSearchInitialSelected.d.ts.map +0 -1
- package/dist/advanced-search/model/useAdvancedSearchSelection.d.ts +0 -13
- package/dist/advanced-search/model/useAdvancedSearchSelection.d.ts.map +0 -1
- package/dist/advanced-search/ui/AdvancedSearchModal.d.ts +0 -23
- package/dist/advanced-search/ui/AdvancedSearchModal.d.ts.map +0 -1
- package/dist/advanced-search/ui/AdvancedSearchModalSession.d.ts +0 -16
- package/dist/advanced-search/ui/AdvancedSearchModalSession.d.ts.map +0 -1
- package/dist/advanced-search/ui/AdvancedSearchSelect.d.ts +0 -9
- package/dist/advanced-search/ui/AdvancedSearchSelect.d.ts.map +0 -1
- package/dist/advanced-search/ui/AdvancedSearchSelectUI.d.ts +0 -9
- package/dist/advanced-search/ui/AdvancedSearchSelectUI.d.ts.map +0 -1
- package/dist/advanced-search/ui/index.d.ts +0 -2
- package/dist/advanced-search/ui/index.d.ts.map +0 -1
- package/dist/chunks/badge-6mXO9BWP.js +0 -65
- package/dist/chunks/badge-6mXO9BWP.js.map +0 -1
- package/dist/chunks/input-search-Cat4c7SM.js +0 -30
- package/dist/chunks/input-search-Cat4c7SM.js.map +0 -1
- package/dist/chunks/multi-select-BZ9N6Dal.js +0 -466
- package/dist/chunks/multi-select-BZ9N6Dal.js.map +0 -1
- package/dist/chunks/popover-Bne-Ljbs.js +0 -245
- package/dist/chunks/radio-group-sSnlYjAX.js +0 -125
- package/dist/chunks/select-aTGupQan.js +0 -363
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"input-files-tIS17-zX.js","names":[],"sources":["../../src/input-files/InputFiles.module.scss","../../src/input-files/InputFilesList.tsx","../../src/input-files/InputFiles.tsx"],"sourcesContent":["/* Контрол, имитирующий внешний вид InputText */\n.control {\n\theight: var(--control-height);\n\twidth: 100%;\n\tpadding: 0 var(--space-sm);\n\tfont-size: var(--font-size-md);\n\tcursor: pointer;\n\n\tdisplay: flex;\n\talign-items: center;\n}\n\n/* Скрытый нативный input[type=\"file\"] */\n.hiddenInput {\n\tposition: absolute;\n\twidth: 0;\n\theight: 0;\n\topacity: 0;\n\toverflow: hidden;\n\tpointer-events: none;\n}\n\n/* Список выбранных файлов */\n.fileList {\n\tdisplay: flex;\n\tflex-direction: column;\n\tgap: var(--space-xs);\n\tmargin-top: var(--space-xs);\n}\n\n/* Элемент списка — строка с именем файла и кнопкой удаления */\n.fileItem {\n\tdisplay: flex;\n\talign-items: center;\n\tgap: var(--space-xs);\n\tpadding: var(--space-xs) var(--space-sm);\n\tbackground-color: var(--surface-2);\n\tborder-radius: var(--radius-sm);\n\t// font-size: var(--font-size-sm);\n}\n\n/* Имя файла — обрезка с троеточием */\n.fileItemName {\n\tflex: 1;\n\toverflow: hidden;\n\ttext-overflow: ellipsis;\n\twhite-space: nowrap;\n}\n\n/* Кнопка удаления файла из списка */\n.removeButton {\n\tflex-shrink: 0;\n\twidth: 1.25em;\n\theight: 1.25em;\n\tcolor: var(--content-2);\n\n\t&:hover {\n\t\tcolor: var(--accent-text);\n\t}\n}\n","import { useCallback } from \"react\";\n\nimport { ReadFileResult } from \"@ryuzaki13/react-foundation-lib/file\";\nimport { cn } from \"@ryuzaki13/react-foundation-lib/utils\";\nimport { XIcon } from \"lucide-react\";\n\nimport styles from \"./InputFiles.module.scss\";\n\ninterface InputFilesListProps<TFile extends ReadFileResult> {\n\tfiles: TFile[];\n\tonChange: (files: TFile[]) => void;\n}\n\nexport function InputFilesList<TFile extends ReadFileResult>({ files, onChange }: InputFilesListProps<TFile>) {\n\tconst handleRemove = useCallback(\n\t\t(index: number) => {\n\t\t\tonChange(files.filter((_, i) => i !== index));\n\t\t},\n\t\t[files, onChange]\n\t);\n\n\tif (!files || !files.length) return null;\n\n\treturn (\n\t\t<ul className={styles.fileList}>\n\t\t\t{files.map((item, index) => (\n\t\t\t\t<li key={`${item.meta.name}-${item.meta.lastModified}`} className={styles.fileItem}>\n\t\t\t\t\t<span className={styles.fileItemName}>{item.meta.name}</span>\n\t\t\t\t\t<button\n\t\t\t\t\t\ttype=\"button\"\n\t\t\t\t\t\tclassName={cn(styles.removeButton, \"flexCenter\")}\n\t\t\t\t\t\tonClick={() => handleRemove(index)}\n\t\t\t\t\t\taria-label={`Удалить ${item.meta.name}`}>\n\t\t\t\t\t\t<XIcon />\n\t\t\t\t\t</button>\n\t\t\t\t</li>\n\t\t\t))}\n\t\t</ul>\n\t);\n}\n","import { useCallback, useRef } from \"react\";\n\nimport { assertValidAccept, assertValidAllowedMime, readFile, ReadFileError, ReadFileResult } from \"@ryuzaki13/react-foundation-lib/file\";\nimport { cn, handleKeyboardActivation } from \"@ryuzaki13/react-foundation-lib/utils\";\n\nimport { InputControl, InputUI, useInputFieldIds } from \"../input\";\nimport { UiBaseProps } from \"../types\";\nimport uiStyles from \"../ui.module.scss\";\n\nimport styles from \"./InputFiles.module.scss\";\nimport { InputFilesList } from \"./InputFilesList\";\n\ninterface InputFilesCommonProps extends Omit<UiBaseProps<undefined>, \"value\" | \"onChange\"> {\n\t/** Callback ошибки чтения файла */\n\tonReadError?: (error: ReadFileError) => void;\n\n\t/** HTML-атрибут accept для нативного input[type=\"file\"] (например `[\".pdf\", \".docx\"]`) */\n\taccept?: readonly string[];\n\t/** Список допустимых MIME-типов — передаётся в readFile */\n\tallowedMime?: readonly string[];\n\t/** Максимальный размер одного файла в байтах */\n\tmaxBytes?: number;\n\t/** Максимальное количество файлов. При достижении лимита input блокируется */\n\tmaxFiles?: number;\n\n\t/** Текст ошибки под полем */\n\terror?: string;\n\t/** Callback сброса ошибки */\n\tonClearError?: () => void;\n\t/** CSS-класс обёртки */\n\tclassName?: string;\n}\n\ntype InputFilesDataUrlResult = Extract<ReadFileResult, { mode: \"data-url\" }>;\ntype InputFilesArrayBufferResult = Extract<ReadFileResult, { mode: \"array-buffer\" }>;\n\n/**\n * Пропсы компонента InputFiles.\n *\n * Компонент предназначен для выбора нескольких файлов.\n * Выбранные файлы отображаются списком под полем ввода,\n * каждый с кнопкой удаления (крестик).\n *\n * В onChange передаётся обновлённый массив результатов readFile.\n */\nexport type InputFilesProps =\n\t| (InputFilesCommonProps & {\n\t\t\tvalue: InputFilesDataUrlResult[];\n\t\t\tonChange: (value: InputFilesDataUrlResult[]) => void;\n\t\t\t/** Режим чтения: \"data-url\" по умолчанию */\n\t\t\treadMode?: \"data-url\";\n\t })\n\t| (InputFilesCommonProps & {\n\t\t\tvalue: InputFilesArrayBufferResult[];\n\t\t\tonChange: (value: InputFilesArrayBufferResult[]) => void;\n\t\t\t/** Режим чтения файла как ArrayBuffer */\n\t\t\treadMode: \"array-buffer\";\n\t });\n\n/**\n * InputFiles — компонент выбора нескольких файлов.\n *\n * Поле стилизовано как InputText. При клике открывается нативный\n * диалог с multiple. Каждый выбранный файл читается через readFile\n * и добавляется в массив value.\n *\n * Список выбранных файлов отображается под полем.\n * Каждый файл можно удалить кнопкой «крестик».\n *\n * InputFiles типизирует массив по `readMode`.\n * Если `readMode` не задан или равен `\"data-url\"`, в `value` и `onChange`\n * используется массив объектов с `dataUrl`. Если `readMode` равен\n * `\"array-buffer\"`, используется массив объектов с `buffer`.\n */\nexport function InputFiles(props: InputFilesProps) {\n\tconst {\n\t\tvalue,\n\t\tonReadError,\n\t\taccept,\n\t\tallowedMime,\n\t\tmaxBytes,\n\t\tmaxFiles,\n\t\tlabel,\n\t\tdescription,\n\t\tplaceholder = \"Выберите файлы\",\n\t\tdisabled,\n\t\tsize,\n\t\terror,\n\t\tonClearError,\n\t\tclassName\n\t} = props;\n\n\tassertValidAllowedMime(allowedMime);\n\tassertValidAccept(accept);\n\n\t/** Реф на скрытый нативный input[type=\"file\"] */\n\tconst inputRef = useRef<HTMLInputElement>(null);\n\tconst { controlId, labelId, descriptionId, errorId, describedBy } = useInputFieldIds({\n\t\thasLabel: label !== undefined && label !== null,\n\t\thasDescription: !!description,\n\t\thasError: !!error\n\t});\n\n\t/** Достигнут ли лимит файлов */\n\tconst isLimitReached = typeof maxFiles === \"number\" && value.length >= maxFiles;\n\n\t/**\n\t * Обработчик выбора файлов из нативного диалога.\n\t * Каждый файл читается через readFile.\n\t * Успешно прочитанные файлы добавляются к текущему массиву value.\n\t */\n\tconst handleChange = useCallback(\n\t\tasync (e: React.ChangeEvent<HTMLInputElement>) => {\n\t\t\tconst files = e.target.files;\n\t\t\tif (!files || files.length === 0) return;\n\n\t\t\tconst selectedFiles = Array.from(files);\n\n\t\t\t// Сбрасываем значение input чтобы можно было выбрать те же файлы повторно\n\t\t\te.target.value = \"\";\n\n\t\t\t// Сбрасываем ошибку при выборе новых файлов\n\t\t\tif (error && onClearError) onClearError();\n\n\t\t\t// Определяем сколько файлов можно ещё добавить\n\t\t\tconst remaining = typeof maxFiles === \"number\" ? maxFiles - value.length : selectedFiles.length;\n\t\t\tconst filesToProcess = selectedFiles.slice(0, remaining);\n\n\t\t\tif (props.readMode === \"array-buffer\") {\n\t\t\t\t// Читаем файлы как ArrayBuffer и сохраняем точный тип массива для потребителя.\n\t\t\t\tconst results: InputFilesArrayBufferResult[] = [];\n\n\t\t\t\tfor (const file of filesToProcess) {\n\t\t\t\t\ttry {\n\t\t\t\t\t\tconst result = await readFile(file, { allowedMime, maxBytes, mode: \"array-buffer\" });\n\t\t\t\t\t\tresults.push(result);\n\t\t\t\t\t} catch (err) {\n\t\t\t\t\t\tif (err instanceof ReadFileError && onReadError) {\n\t\t\t\t\t\t\tonReadError(err);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tif (results.length > 0) {\n\t\t\t\t\tprops.onChange([...props.value, ...results]);\n\t\t\t\t}\n\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t// Читаем файлы как Data URL и сохраняем точный тип массива для потребителя.\n\t\t\tconst results: InputFilesDataUrlResult[] = [];\n\t\t\tfor (const file of filesToProcess) {\n\t\t\t\ttry {\n\t\t\t\t\tconst result = await readFile(file, { allowedMime, maxBytes });\n\t\t\t\t\tresults.push(result);\n\t\t\t\t} catch (err) {\n\t\t\t\t\tif (err instanceof ReadFileError && onReadError) {\n\t\t\t\t\t\tonReadError(err);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (results.length > 0) {\n\t\t\t\tprops.onChange([...props.value, ...results]);\n\t\t\t}\n\t\t},\n\t\t[props, maxFiles, value.length, allowedMime, maxBytes, onReadError, error, onClearError]\n\t);\n\n\t/** Клик по видимому контролу открывает нативный диалог */\n\tconst handleClick = useCallback(() => {\n\t\tinputRef.current?.click();\n\t}, []);\n\n\tconst filesList =\n\t\tprops.readMode === \"array-buffer\" ? (\n\t\t\t<InputFilesList files={props.value} onChange={props.onChange} />\n\t\t) : (\n\t\t\t<InputFilesList files={props.value} onChange={props.onChange} />\n\t\t);\n\n\treturn (\n\t\t<InputUI\n\t\t\tlabel={label}\n\t\t\tdescription={description}\n\t\t\tdisabled={disabled}\n\t\t\tclassName={className}\n\t\t\tsize={size}\n\t\t\terror={error}\n\t\t\tcontrolId={controlId}\n\t\t\tlabelId={labelId}\n\t\t\tdescriptionId={descriptionId}\n\t\t\terrorId={errorId}>\n\t\t\t<input\n\t\t\t\tref={inputRef}\n\t\t\t\tid={controlId}\n\t\t\t\ttype=\"file\"\n\t\t\t\taccept={(accept ?? allowedMime)?.join(\",\")}\n\t\t\t\tmultiple\n\t\t\t\tdisabled={disabled || isLimitReached}\n\t\t\t\tclassName={styles.hiddenInput}\n\t\t\t\tonChange={handleChange}\n\t\t\t\ttabIndex={-1}\n\t\t\t/>\n\n\t\t\t<InputControl>\n\t\t\t\t{() => (\n\t\t\t\t\t<div\n\t\t\t\t\t\trole=\"button\"\n\t\t\t\t\t\ttabIndex={disabled || isLimitReached ? -1 : 0}\n\t\t\t\t\t\tonClick={handleClick}\n\t\t\t\t\t\tonKeyDown={(event) => handleKeyboardActivation(event, handleClick, { disabled: disabled || isLimitReached })}\n\t\t\t\t\t\tclassName={cn(uiStyles.uiInputControl, styles.control, !!error && \"invalid\")}\n\t\t\t\t\t\tdata-disabled={disabled || undefined}\n\t\t\t\t\t\taria-invalid={!!error || undefined}\n\t\t\t\t\t\taria-disabled={disabled || isLimitReached}\n\t\t\t\t\t\taria-labelledby={labelId}\n\t\t\t\t\t\taria-describedby={describedBy}>\n\t\t\t\t\t\t<span className={uiStyles.uiPlaceholder}>{isLimitReached ? `Максимум ${maxFiles} файлов` : placeholder}</span>\n\t\t\t\t\t</div>\n\t\t\t\t)}\n\t\t\t</InputControl>\n\n\t\t\t{/* Список выбранных файлов */}\n\t\t\t{filesList}\n\t\t</InputUI>\n\t);\n}\n"],"mappings":";;;;;;;;;;;;;;;;;ACaA,SAAgB,EAA6C,EAAE,UAAO,eAAwC;CAC7G,IAAM,IAAe,GACnB,MAAkB;EAClB,EAAS,EAAM,QAAQ,GAAG,MAAM,MAAM,CAAK,CAAC;CA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,YAAY,MAAU,EAAyB,GAAO,GAAa,EAAE,UAAU,KAAY,EAAe,CAAC;IAC3G,WAAW,EAAG,EAAS,gBAAgB,EAAO,SAAS,CAAC,CAAC,KAAS,SAAS;IAC3E,iBAAe,KAAY,KAAA;IAC3B,gBAAc,CAAC,CAAC,KAAS,KAAA;IACzB,iBAAe,KAAY;IAC3B,mBAAiB;IACjB,oBAAkB;IAClB,UAAA,kBAAC,QAAD;KAAM,WAAW,EAAS;KAAgB,UAAA,IAAiB,YAAY,EAAS,WAAW;IAAkB,CAAA;GACzG,CAAA,EAEO,CAAA;GAGb;EACO;;AAEX"}
|
|
1
|
+
{"version":3,"file":"input-files-B8j6Pb_M.js","names":[],"sources":["../../src/input-files/InputFiles.module.scss","../../src/input-files/InputFilesList.tsx","../../src/input-files/InputFiles.tsx"],"sourcesContent":["/* Контрол, имитирующий внешний вид InputText */\n.control {\n\theight: var(--control-height);\n\twidth: 100%;\n\tpadding: 0 var(--space-sm);\n\tfont-size: var(--font-size-md);\n\tcursor: pointer;\n\n\tdisplay: flex;\n\talign-items: center;\n}\n\n/* Скрытый нативный input[type=\"file\"] */\n.hiddenInput {\n\tposition: absolute;\n\twidth: 0;\n\theight: 0;\n\topacity: 0;\n\toverflow: hidden;\n\tpointer-events: none;\n}\n\n/* Список выбранных файлов */\n.fileList {\n\tdisplay: flex;\n\tflex-direction: column;\n\tgap: var(--space-xs);\n\tmargin-top: var(--space-xs);\n}\n\n/* Элемент списка — строка с именем файла и кнопкой удаления */\n.fileItem {\n\tdisplay: flex;\n\talign-items: center;\n\tgap: var(--space-xs);\n\tpadding: var(--space-xs) var(--space-sm);\n\tbackground-color: var(--surface-2);\n\tborder-radius: var(--radius-sm);\n\t// font-size: var(--font-size-sm);\n}\n\n/* Имя файла — обрезка с троеточием */\n.fileItemName {\n\tflex: 1;\n\toverflow: hidden;\n\ttext-overflow: ellipsis;\n\twhite-space: nowrap;\n}\n\n/* Кнопка удаления файла из списка */\n.removeButton {\n\tflex-shrink: 0;\n\twidth: 1.25em;\n\theight: 1.25em;\n\tcolor: var(--content-2);\n\n\t&:hover {\n\t\tcolor: var(--accent-text);\n\t}\n}\n","import { useCallback } from \"react\";\n\nimport { ReadFileResult } from \"@ryuzaki13/react-foundation-lib/file\";\nimport { cn } from \"@ryuzaki13/react-foundation-lib/utils\";\nimport { XIcon } from \"lucide-react\";\n\nimport styles from \"./InputFiles.module.scss\";\n\ninterface InputFilesListProps<TFile extends ReadFileResult> {\n\tfiles: TFile[];\n\tonChange: (files: TFile[]) => void;\n}\n\nexport function InputFilesList<TFile extends ReadFileResult>({ files, onChange }: InputFilesListProps<TFile>) {\n\tconst handleRemove = useCallback(\n\t\t(index: number) => {\n\t\t\tonChange(files.filter((_, i) => i !== index));\n\t\t},\n\t\t[files, onChange]\n\t);\n\n\tif (!files || !files.length) return null;\n\n\treturn (\n\t\t<ul className={styles.fileList}>\n\t\t\t{files.map((item, index) => (\n\t\t\t\t<li key={`${item.meta.name}-${item.meta.lastModified}`} className={styles.fileItem}>\n\t\t\t\t\t<span className={styles.fileItemName}>{item.meta.name}</span>\n\t\t\t\t\t<button\n\t\t\t\t\t\ttype=\"button\"\n\t\t\t\t\t\tclassName={cn(styles.removeButton, \"flexCenter\")}\n\t\t\t\t\t\tonClick={() => handleRemove(index)}\n\t\t\t\t\t\taria-label={`Удалить ${item.meta.name}`}>\n\t\t\t\t\t\t<XIcon />\n\t\t\t\t\t</button>\n\t\t\t\t</li>\n\t\t\t))}\n\t\t</ul>\n\t);\n}\n","import { useCallback, useRef } from \"react\";\n\nimport { assertValidAccept, assertValidAllowedMime, readFile, ReadFileError, ReadFileResult } from \"@ryuzaki13/react-foundation-lib/file\";\nimport { cn, handleKeyboardActivation } from \"@ryuzaki13/react-foundation-lib/utils\";\n\nimport { InputControl, InputUI, useInputFieldIds } from \"../input\";\nimport { UiBaseProps } from \"../types\";\nimport uiStyles from \"../ui.module.scss\";\n\nimport styles from \"./InputFiles.module.scss\";\nimport { InputFilesList } from \"./InputFilesList\";\n\ninterface InputFilesCommonProps extends Omit<UiBaseProps<undefined>, \"value\" | \"onChange\"> {\n\t/** Callback ошибки чтения файла */\n\tonReadError?: (error: ReadFileError) => void;\n\n\t/** HTML-атрибут accept для нативного input[type=\"file\"] (например `[\".pdf\", \".docx\"]`) */\n\taccept?: readonly string[];\n\t/** Список допустимых MIME-типов — передаётся в readFile */\n\tallowedMime?: readonly string[];\n\t/** Максимальный размер одного файла в байтах */\n\tmaxBytes?: number;\n\t/** Максимальное количество файлов. При достижении лимита input блокируется */\n\tmaxFiles?: number;\n\n\t/** Текст ошибки под полем */\n\terror?: string;\n\t/** Callback сброса ошибки */\n\tonClearError?: () => void;\n\t/** CSS-класс обёртки */\n\tclassName?: string;\n}\n\ntype InputFilesDataUrlResult = Extract<ReadFileResult, { mode: \"data-url\" }>;\ntype InputFilesArrayBufferResult = Extract<ReadFileResult, { mode: \"array-buffer\" }>;\n\n/**\n * Пропсы компонента InputFiles.\n *\n * Компонент предназначен для выбора нескольких файлов.\n * Выбранные файлы отображаются списком под полем ввода,\n * каждый с кнопкой удаления (крестик).\n *\n * В onChange передаётся обновлённый массив результатов readFile.\n */\nexport type InputFilesProps =\n\t| (InputFilesCommonProps & {\n\t\t\tvalue: InputFilesDataUrlResult[];\n\t\t\tonChange: (value: InputFilesDataUrlResult[]) => void;\n\t\t\t/** Режим чтения: \"data-url\" по умолчанию */\n\t\t\treadMode?: \"data-url\";\n\t })\n\t| (InputFilesCommonProps & {\n\t\t\tvalue: InputFilesArrayBufferResult[];\n\t\t\tonChange: (value: InputFilesArrayBufferResult[]) => void;\n\t\t\t/** Режим чтения файла как ArrayBuffer */\n\t\t\treadMode: \"array-buffer\";\n\t });\n\n/**\n * InputFiles — компонент выбора нескольких файлов.\n *\n * Поле стилизовано как InputText. При клике открывается нативный\n * диалог с multiple. Каждый выбранный файл читается через readFile\n * и добавляется в массив value.\n *\n * Список выбранных файлов отображается под полем.\n * Каждый файл можно удалить кнопкой «крестик».\n *\n * InputFiles типизирует массив по `readMode`.\n * Если `readMode` не задан или равен `\"data-url\"`, в `value` и `onChange`\n * используется массив объектов с `dataUrl`. Если `readMode` равен\n * `\"array-buffer\"`, используется массив объектов с `buffer`.\n */\nexport function InputFiles(props: InputFilesProps) {\n\tconst {\n\t\tvalue,\n\t\tonReadError,\n\t\taccept,\n\t\tallowedMime,\n\t\tmaxBytes,\n\t\tmaxFiles,\n\t\tlabel,\n\t\tdescription,\n\t\tplaceholder = \"Выберите файлы\",\n\t\tdisabled,\n\t\tsize,\n\t\terror,\n\t\tonClearError,\n\t\tclassName\n\t} = props;\n\n\tassertValidAllowedMime(allowedMime);\n\tassertValidAccept(accept);\n\n\t/** Реф на скрытый нативный input[type=\"file\"] */\n\tconst inputRef = useRef<HTMLInputElement>(null);\n\tconst { controlId, labelId, descriptionId, errorId, describedBy } = useInputFieldIds({\n\t\thasLabel: label !== undefined && label !== null,\n\t\thasDescription: !!description,\n\t\thasError: !!error\n\t});\n\n\t/** Достигнут ли лимит файлов */\n\tconst isLimitReached = typeof maxFiles === \"number\" && value.length >= maxFiles;\n\n\t/**\n\t * Обработчик выбора файлов из нативного диалога.\n\t * Каждый файл читается через readFile.\n\t * Успешно прочитанные файлы добавляются к текущему массиву value.\n\t */\n\tconst handleChange = useCallback(\n\t\tasync (e: React.ChangeEvent<HTMLInputElement>) => {\n\t\t\tconst files = e.target.files;\n\t\t\tif (!files || files.length === 0) return;\n\n\t\t\tconst selectedFiles = Array.from(files);\n\n\t\t\t// Сбрасываем значение input чтобы можно было выбрать те же файлы повторно\n\t\t\te.target.value = \"\";\n\n\t\t\t// Сбрасываем ошибку при выборе новых файлов\n\t\t\tif (error && onClearError) onClearError();\n\n\t\t\t// Определяем сколько файлов можно ещё добавить\n\t\t\tconst remaining = typeof maxFiles === \"number\" ? maxFiles - value.length : selectedFiles.length;\n\t\t\tconst filesToProcess = selectedFiles.slice(0, remaining);\n\n\t\t\tif (props.readMode === \"array-buffer\") {\n\t\t\t\t// Читаем файлы как ArrayBuffer и сохраняем точный тип массива для потребителя.\n\t\t\t\tconst results: InputFilesArrayBufferResult[] = [];\n\n\t\t\t\tfor (const file of filesToProcess) {\n\t\t\t\t\ttry {\n\t\t\t\t\t\tconst result = await readFile(file, { allowedMime, maxBytes, mode: \"array-buffer\" });\n\t\t\t\t\t\tresults.push(result);\n\t\t\t\t\t} catch (err) {\n\t\t\t\t\t\tif (err instanceof ReadFileError && onReadError) {\n\t\t\t\t\t\t\tonReadError(err);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tif (results.length > 0) {\n\t\t\t\t\tprops.onChange([...props.value, ...results]);\n\t\t\t\t}\n\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t// Читаем файлы как Data URL и сохраняем точный тип массива для потребителя.\n\t\t\tconst results: InputFilesDataUrlResult[] = [];\n\t\t\tfor (const file of filesToProcess) {\n\t\t\t\ttry {\n\t\t\t\t\tconst result = await readFile(file, { allowedMime, maxBytes });\n\t\t\t\t\tresults.push(result);\n\t\t\t\t} catch (err) {\n\t\t\t\t\tif (err instanceof ReadFileError && onReadError) {\n\t\t\t\t\t\tonReadError(err);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (results.length > 0) {\n\t\t\t\tprops.onChange([...props.value, ...results]);\n\t\t\t}\n\t\t},\n\t\t[props, maxFiles, value.length, allowedMime, maxBytes, onReadError, error, onClearError]\n\t);\n\n\t/** Клик по видимому контролу открывает нативный диалог */\n\tconst handleClick = useCallback(() => {\n\t\tinputRef.current?.click();\n\t}, []);\n\n\tconst filesList =\n\t\tprops.readMode === \"array-buffer\" ? (\n\t\t\t<InputFilesList files={props.value} onChange={props.onChange} />\n\t\t) : (\n\t\t\t<InputFilesList files={props.value} onChange={props.onChange} />\n\t\t);\n\n\treturn (\n\t\t<InputUI\n\t\t\tlabel={label}\n\t\t\tdescription={description}\n\t\t\tdisabled={disabled}\n\t\t\tclassName={className}\n\t\t\tsize={size}\n\t\t\terror={error}\n\t\t\tcontrolId={controlId}\n\t\t\tlabelId={labelId}\n\t\t\tdescriptionId={descriptionId}\n\t\t\terrorId={errorId}>\n\t\t\t<input\n\t\t\t\tref={inputRef}\n\t\t\t\tid={controlId}\n\t\t\t\ttype=\"file\"\n\t\t\t\taccept={(accept ?? allowedMime)?.join(\",\")}\n\t\t\t\tmultiple\n\t\t\t\tdisabled={disabled || isLimitReached}\n\t\t\t\tclassName={styles.hiddenInput}\n\t\t\t\tonChange={handleChange}\n\t\t\t\ttabIndex={-1}\n\t\t\t/>\n\n\t\t\t<InputControl>\n\t\t\t\t{() => (\n\t\t\t\t\t<div\n\t\t\t\t\t\trole=\"button\"\n\t\t\t\t\t\ttabIndex={disabled || isLimitReached ? -1 : 0}\n\t\t\t\t\t\tonClick={handleClick}\n\t\t\t\t\t\tonKeyDown={(event) => handleKeyboardActivation(event, handleClick, { disabled: disabled || isLimitReached })}\n\t\t\t\t\t\tclassName={cn(uiStyles.uiInputControl, styles.control, !!error && \"invalid\")}\n\t\t\t\t\t\tdata-disabled={disabled || undefined}\n\t\t\t\t\t\taria-invalid={!!error || undefined}\n\t\t\t\t\t\taria-disabled={disabled || isLimitReached}\n\t\t\t\t\t\taria-labelledby={labelId}\n\t\t\t\t\t\taria-describedby={describedBy}>\n\t\t\t\t\t\t<span className={uiStyles.uiPlaceholder}>{isLimitReached ? `Максимум ${maxFiles} файлов` : placeholder}</span>\n\t\t\t\t\t</div>\n\t\t\t\t)}\n\t\t\t</InputControl>\n\n\t\t\t{/* Список выбранных файлов */}\n\t\t\t{filesList}\n\t\t</InputUI>\n\t);\n}\n"],"mappings":";;;;;;;;;;;;;;;;;ACaA,SAAgB,EAA6C,EAAE,UAAO,eAAwC;CAC7G,IAAM,IAAe,GACnB,MAAkB;EAClB,EAAS,EAAM,QAAQ,GAAG,MAAM,MAAM,CAAK,CAAC;CAC7C,GACA,CAAC,GAAO,CAAQ,CACjB;CAIA,OAFI,CAAC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AAe,CAAC;IAC3G,WAAW,EAAG,EAAS,gBAAgB,EAAO,SAAS,CAAC,CAAC,KAAS,SAAS;IAC3E,iBAAe,KAAY,KAAA;IAC3B,gBAAc,CAAC,CAAC,KAAS,KAAA;IACzB,iBAAe,KAAY;IAC3B,mBAAiB;IACjB,oBAAkB;IAClB,UAAA,kBAAC,QAAD;KAAM,WAAW,EAAS;KAAgB,UAAA,IAAiB,YAAY,EAAS,WAAW;IAAkB,CAAA;GACzG,CAAA,EAEO,CAAA;GAGb;EACO;;AAEX"}
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { n as e } from "./popover-
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
1
|
+
import { n as e } from "./popover-yl5DVe06.js";
|
|
2
|
+
import { Text as t } from "../text/index.js";
|
|
3
|
+
import { n } from "./flex-DtXK7OM4.js";
|
|
4
4
|
import { PolymorphicComponent as r } from "../polymorphic/index.js";
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import { jsx as
|
|
8
|
-
import {
|
|
5
|
+
import { cn as i } from "@ryuzaki13/react-foundation-lib/utils";
|
|
6
|
+
import { CheckCheckIcon as a, ChevronLeftIcon as o, ChevronRightIcon as s, CircleAlertIcon as c, CircleCheckIcon as l, CircleXIcon as u, CopyIcon as d, InfoIcon as f } from "lucide-react";
|
|
7
|
+
import { jsx as p, jsxs as m } from "react/jsx-runtime";
|
|
8
|
+
import { Suspense as h, forwardRef as g, useCallback as _, useEffect as v, useRef as y, useState as b, useSyncExternalStore as x } from "react";
|
|
9
9
|
import { useCopyElementTextWithFeedback as S } from "@ryuzaki13/react-foundation-lib/copy";
|
|
10
10
|
import { useLazyComponent as C } from "@ryuzaki13/react-foundation-lib/hooks";
|
|
11
11
|
var w = {
|
|
@@ -16,18 +16,18 @@ var w = {
|
|
|
16
16
|
//#endregion
|
|
17
17
|
//#region src/misc/AnimatedLogo.tsx
|
|
18
18
|
function T({ children: e, className: t, ...n }) {
|
|
19
|
-
return /* @__PURE__ */
|
|
19
|
+
return /* @__PURE__ */ p("div", {
|
|
20
20
|
...n,
|
|
21
|
-
className:
|
|
21
|
+
className: i(w.logo, t),
|
|
22
22
|
children: e
|
|
23
23
|
});
|
|
24
24
|
}
|
|
25
25
|
//#endregion
|
|
26
26
|
//#region src/misc/AnimatedLogoSegment.tsx
|
|
27
|
-
function E({ children: e, className: t, order: n, style: r, ...
|
|
28
|
-
return /* @__PURE__ */
|
|
29
|
-
...
|
|
30
|
-
className:
|
|
27
|
+
function E({ children: e, className: t, order: n, style: r, ...a }) {
|
|
28
|
+
return /* @__PURE__ */ p("g", {
|
|
29
|
+
...a,
|
|
30
|
+
className: i(w.segment, t),
|
|
31
31
|
style: {
|
|
32
32
|
...r,
|
|
33
33
|
animationDelay: `${n * 200}ms`
|
|
@@ -38,18 +38,18 @@ function E({ children: e, className: t, order: n, style: r, ...i }) {
|
|
|
38
38
|
//#endregion
|
|
39
39
|
//#region src/misc/CopyTextWrapper.tsx
|
|
40
40
|
var D = ({ children: t, position: n = "top", showOnHover: r = !0, className: i }) => {
|
|
41
|
-
let { containerRef:
|
|
42
|
-
return /* @__PURE__ */
|
|
43
|
-
ref:
|
|
41
|
+
let { containerRef: o, copyElementText: s, isCopied: c } = S();
|
|
42
|
+
return /* @__PURE__ */ m("span", {
|
|
43
|
+
ref: o,
|
|
44
44
|
className: i,
|
|
45
|
-
children: [t, /* @__PURE__ */
|
|
45
|
+
children: [t, /* @__PURE__ */ p(e, {
|
|
46
46
|
openOnHover: r,
|
|
47
47
|
placement: n,
|
|
48
|
-
content:
|
|
49
|
-
children: /* @__PURE__ */
|
|
50
|
-
onClick:
|
|
51
|
-
"aria-label":
|
|
52
|
-
children:
|
|
48
|
+
content: c ? "Скопировано!" : "Копировать текст",
|
|
49
|
+
children: /* @__PURE__ */ p("button", {
|
|
50
|
+
onClick: s,
|
|
51
|
+
"aria-label": c ? "Скопировано!" : "Копировать текст",
|
|
52
|
+
children: c ? /* @__PURE__ */ p(a, { className: "block statusSuccess" }) : /* @__PURE__ */ p(d, { className: "block statusInfo" })
|
|
53
53
|
})
|
|
54
54
|
})]
|
|
55
55
|
});
|
|
@@ -57,24 +57,24 @@ var D = ({ children: t, position: n = "top", showOnHover: r = !0, className: i }
|
|
|
57
57
|
//#endregion
|
|
58
58
|
//#region src/misc/IconWrapper.tsx
|
|
59
59
|
function k({ className: e, children: t }) {
|
|
60
|
-
return /* @__PURE__ */
|
|
61
|
-
className:
|
|
60
|
+
return /* @__PURE__ */ p("div", {
|
|
61
|
+
className: i(O.wrapper, e),
|
|
62
62
|
children: t
|
|
63
63
|
});
|
|
64
64
|
}
|
|
65
65
|
var A = { componentLoader: "qgIKVo" };
|
|
66
66
|
//#endregion
|
|
67
67
|
//#region src/misc/Message.tsx
|
|
68
|
-
function j({ className: e, children: r, color:
|
|
69
|
-
return /* @__PURE__ */
|
|
70
|
-
className:
|
|
71
|
-
minHeight:
|
|
72
|
-
children: /* @__PURE__ */
|
|
68
|
+
function j({ className: e, children: r, color: a = "muted", role: o, minHeight: s, uppercase: c = !0 }) {
|
|
69
|
+
return /* @__PURE__ */ p(n, {
|
|
70
|
+
className: i("paddingMd textCenter", e),
|
|
71
|
+
minHeight: s,
|
|
72
|
+
children: /* @__PURE__ */ p(t, {
|
|
73
73
|
as: "p",
|
|
74
74
|
weight: "bold",
|
|
75
|
-
color:
|
|
76
|
-
uppercase:
|
|
77
|
-
role:
|
|
75
|
+
color: a,
|
|
76
|
+
uppercase: c,
|
|
77
|
+
role: o,
|
|
78
78
|
children: r
|
|
79
79
|
})
|
|
80
80
|
});
|
|
@@ -82,37 +82,37 @@ function j({ className: e, children: r, color: i = "muted", role: a, minHeight:
|
|
|
82
82
|
//#endregion
|
|
83
83
|
//#region src/misc/LoadingMessage.tsx
|
|
84
84
|
function M({ className: e, logo: t, text: n }) {
|
|
85
|
-
return /* @__PURE__ */
|
|
86
|
-
className:
|
|
85
|
+
return /* @__PURE__ */ m(j, {
|
|
86
|
+
className: i(A.componentLoader, t ? void 0 : "skeletonLine", e),
|
|
87
87
|
children: [t, n || "Загрузка..."]
|
|
88
88
|
});
|
|
89
89
|
}
|
|
90
90
|
//#endregion
|
|
91
91
|
//#region src/misc/LazyDynamicComponent.tsx
|
|
92
92
|
var N = (e) => (e(), () => void 0), P = () => !0, F = () => !1;
|
|
93
|
-
function I({ fallback: e, importFunc: t, componentName: n, clientOnly: r = !1, cacheKey:
|
|
94
|
-
let
|
|
95
|
-
return r && !
|
|
96
|
-
fallback:
|
|
97
|
-
children: /* @__PURE__ */
|
|
93
|
+
function I({ fallback: e, importFunc: t, componentName: n, clientOnly: r = !1, cacheKey: i, props: a }) {
|
|
94
|
+
let o = C(t, n, i), s = x(N, P, F), c = e ?? /* @__PURE__ */ p(M, { text: "Ожидание компонента..." });
|
|
95
|
+
return r && !s ? c : /* @__PURE__ */ p(h, {
|
|
96
|
+
fallback: c,
|
|
97
|
+
children: /* @__PURE__ */ p(o, { ...a ?? {} })
|
|
98
98
|
});
|
|
99
99
|
}
|
|
100
100
|
//#endregion
|
|
101
101
|
//#region src/misc/SkeletonLine.tsx
|
|
102
|
-
var L = ({ as: e, className: t, ...n }) => /* @__PURE__ */
|
|
102
|
+
var L = ({ as: e, className: t, ...n }) => /* @__PURE__ */ p(r, {
|
|
103
103
|
as: e || "div",
|
|
104
|
-
className:
|
|
104
|
+
className: i("skeletonLine colorTransparent radiusSm", t),
|
|
105
105
|
...n
|
|
106
106
|
});
|
|
107
107
|
//#endregion
|
|
108
108
|
//#region src/misc/LazyValue.tsx
|
|
109
109
|
function R({ value: e, isLoading: t }) {
|
|
110
|
-
return t ? /* @__PURE__ */
|
|
110
|
+
return t ? /* @__PURE__ */ p(L, { children: "Загрузка..." }) : e ?? "-";
|
|
111
111
|
}
|
|
112
112
|
//#endregion
|
|
113
113
|
//#region src/misc/NoData.tsx
|
|
114
114
|
function z({ className: e, text: t, role: n, minHeight: r = "5em" }) {
|
|
115
|
-
return /* @__PURE__ */
|
|
115
|
+
return /* @__PURE__ */ p(j, {
|
|
116
116
|
className: e,
|
|
117
117
|
color: "muted",
|
|
118
118
|
minHeight: r,
|
|
@@ -123,7 +123,7 @@ function z({ className: e, text: t, role: n, minHeight: r = "5em" }) {
|
|
|
123
123
|
//#endregion
|
|
124
124
|
//#region src/misc/Notice.tsx
|
|
125
125
|
function B({ className: e, isError: t, role: n, children: r }) {
|
|
126
|
-
return /* @__PURE__ */
|
|
126
|
+
return /* @__PURE__ */ p(j, {
|
|
127
127
|
className: e,
|
|
128
128
|
color: t ? "error" : "secondary",
|
|
129
129
|
role: n,
|
|
@@ -139,12 +139,12 @@ var V = {
|
|
|
139
139
|
function U(e) {
|
|
140
140
|
return Math.max(0, e.scrollWidth - e.clientWidth);
|
|
141
141
|
}
|
|
142
|
-
var W = ({ children: e, className: t, itemSelector: n, scrollPadding: r = 6, smooth:
|
|
143
|
-
let
|
|
144
|
-
let e =
|
|
142
|
+
var W = ({ children: e, className: t, itemSelector: n, scrollPadding: r = 6, smooth: a = !0 }) => {
|
|
143
|
+
let c = y(null), l = y(null), [u, d] = b(!1), [f, h] = b(!1), g = _(() => {
|
|
144
|
+
let e = c.current;
|
|
145
145
|
return e ? n ? Array.from(e.querySelectorAll(n)) : Array.from(e.children).filter((e) => e instanceof HTMLElement) : [];
|
|
146
|
-
}, [n]), x =
|
|
147
|
-
let t =
|
|
146
|
+
}, [n]), x = _((e) => {
|
|
147
|
+
let t = c.current;
|
|
148
148
|
if (!t) return null;
|
|
149
149
|
if (n) {
|
|
150
150
|
let r = e.closest(n);
|
|
@@ -153,43 +153,43 @@ var W = ({ children: e, className: t, itemSelector: n, scrollPadding: r = 6, smo
|
|
|
153
153
|
let r = e;
|
|
154
154
|
for (; r && r.parentElement && r.parentElement !== t;) r = r.parentElement;
|
|
155
155
|
return r && r.parentElement === t ? r : null;
|
|
156
|
-
}, [n]), S =
|
|
157
|
-
let e =
|
|
156
|
+
}, [n]), S = _(() => {
|
|
157
|
+
let e = c.current;
|
|
158
158
|
if (!e) {
|
|
159
|
-
|
|
159
|
+
d(!1), h(!1);
|
|
160
160
|
return;
|
|
161
161
|
}
|
|
162
162
|
let t = Math.max(0, e.scrollWidth - e.clientWidth), n = Math.max(0, Math.min(e.scrollLeft, t)), r = n > H, i = n < t - H;
|
|
163
|
-
|
|
164
|
-
}, []), C =
|
|
165
|
-
|
|
166
|
-
|
|
163
|
+
d((e) => e === r ? e : r), h((e) => e === i ? e : i);
|
|
164
|
+
}, []), C = _(() => {
|
|
165
|
+
l.current === null && (l.current = requestAnimationFrame(() => {
|
|
166
|
+
l.current = null, S();
|
|
167
167
|
}));
|
|
168
|
-
}, [S]), w =
|
|
169
|
-
let t =
|
|
168
|
+
}, [S]), w = _((e) => {
|
|
169
|
+
let t = c.current;
|
|
170
170
|
if (!t) return;
|
|
171
|
-
let n =
|
|
171
|
+
let n = g()[0];
|
|
172
172
|
if (!n) return;
|
|
173
173
|
let r = n.getBoundingClientRect().width;
|
|
174
174
|
if (!r) return;
|
|
175
|
-
let
|
|
175
|
+
let i = Math.round(e * r), o = Math.max(0, t.scrollWidth - t.clientWidth), s = Math.max(0, Math.min(t.scrollLeft + i, o));
|
|
176
176
|
t.scrollTo({
|
|
177
|
-
left:
|
|
178
|
-
behavior:
|
|
177
|
+
left: s,
|
|
178
|
+
behavior: a ? "smooth" : "auto"
|
|
179
179
|
});
|
|
180
|
-
}, [
|
|
181
|
-
let t =
|
|
180
|
+
}, [g, a]), T = _((e) => {
|
|
181
|
+
let t = c.current;
|
|
182
182
|
if (!t) return;
|
|
183
|
-
let n = t.getBoundingClientRect(),
|
|
184
|
-
if (
|
|
183
|
+
let n = t.getBoundingClientRect(), i = e.getBoundingClientRect(), o = i.left - n.left + t.scrollLeft, s = o + i.width, l = t.scrollLeft, u = t.scrollLeft + t.clientWidth;
|
|
184
|
+
if (o >= l + H && s <= u - H) return;
|
|
185
185
|
let d = t.scrollLeft;
|
|
186
|
-
|
|
186
|
+
o < l ? d = Math.max(0, o - r) : s > u && (d = Math.min(U(t), s - t.clientWidth + r)), t.scrollTo({
|
|
187
187
|
left: Math.round(d),
|
|
188
|
-
behavior:
|
|
188
|
+
behavior: a ? "smooth" : "auto"
|
|
189
189
|
});
|
|
190
|
-
}, [r,
|
|
191
|
-
|
|
192
|
-
let e =
|
|
190
|
+
}, [r, a]);
|
|
191
|
+
v(() => {
|
|
192
|
+
let e = c.current;
|
|
193
193
|
if (!e) return;
|
|
194
194
|
let t = (e) => {
|
|
195
195
|
let t = e.target;
|
|
@@ -198,8 +198,8 @@ var W = ({ children: e, className: t, itemSelector: n, scrollPadding: r = 6, smo
|
|
|
198
198
|
n && T(n);
|
|
199
199
|
};
|
|
200
200
|
return e.addEventListener("focusin", t), () => e.removeEventListener("focusin", t);
|
|
201
|
-
}, [T, x]),
|
|
202
|
-
let e =
|
|
201
|
+
}, [T, x]), v(() => {
|
|
202
|
+
let e = c.current;
|
|
203
203
|
if (!e) return;
|
|
204
204
|
let t = () => C();
|
|
205
205
|
e.addEventListener("scroll", t, { passive: !0 });
|
|
@@ -210,57 +210,57 @@ var W = ({ children: e, className: t, itemSelector: n, scrollPadding: r = 6, smo
|
|
|
210
210
|
childList: !0,
|
|
211
211
|
subtree: !1
|
|
212
212
|
})), C(), () => {
|
|
213
|
-
e.removeEventListener("scroll", t), n?.disconnect(), r?.disconnect(),
|
|
213
|
+
e.removeEventListener("scroll", t), n?.disconnect(), r?.disconnect(), l.current !== null && (cancelAnimationFrame(l.current), l.current = null);
|
|
214
214
|
};
|
|
215
|
-
}, [C]),
|
|
215
|
+
}, [C]), v(() => {
|
|
216
216
|
C();
|
|
217
217
|
}, [e, C]);
|
|
218
218
|
let E = () => w(-1), D = () => w(1), O = (e) => {
|
|
219
219
|
e.key === "ArrowLeft" ? (e.preventDefault(), E()) : e.key === "ArrowRight" && (e.preventDefault(), D());
|
|
220
|
-
}, k =
|
|
221
|
-
return /* @__PURE__ */
|
|
222
|
-
className:
|
|
220
|
+
}, k = u || f;
|
|
221
|
+
return /* @__PURE__ */ m("div", {
|
|
222
|
+
className: i(V.oneStepScroller, t),
|
|
223
223
|
style: { position: "relative" },
|
|
224
224
|
children: [
|
|
225
|
-
k && /* @__PURE__ */
|
|
225
|
+
k && /* @__PURE__ */ p("button", {
|
|
226
226
|
type: "button",
|
|
227
227
|
"aria-label": "Прокрутить шаг влево",
|
|
228
228
|
className: V.ossButton,
|
|
229
229
|
onClick: E,
|
|
230
|
-
disabled: !
|
|
231
|
-
children: /* @__PURE__ */
|
|
230
|
+
disabled: !u,
|
|
231
|
+
children: /* @__PURE__ */ p(o, {})
|
|
232
232
|
}),
|
|
233
|
-
/* @__PURE__ */
|
|
233
|
+
/* @__PURE__ */ p("div", {
|
|
234
234
|
className: V.ossViewport,
|
|
235
235
|
onKeyDown: O,
|
|
236
236
|
role: "group",
|
|
237
237
|
"aria-label": "Элементы прокрутки",
|
|
238
|
-
children: /* @__PURE__ */
|
|
238
|
+
children: /* @__PURE__ */ p("div", {
|
|
239
239
|
className: V.ossScroller,
|
|
240
|
-
ref:
|
|
240
|
+
ref: c,
|
|
241
241
|
"aria-live": "polite",
|
|
242
242
|
children: e
|
|
243
243
|
})
|
|
244
244
|
}),
|
|
245
|
-
k && /* @__PURE__ */
|
|
245
|
+
k && /* @__PURE__ */ p("button", {
|
|
246
246
|
type: "button",
|
|
247
247
|
"aria-label": "Прокрутить шаг вправо",
|
|
248
248
|
className: V.ossButton,
|
|
249
249
|
onClick: D,
|
|
250
|
-
disabled: !
|
|
251
|
-
children: /* @__PURE__ */
|
|
250
|
+
disabled: !f,
|
|
251
|
+
children: /* @__PURE__ */ p(s, {})
|
|
252
252
|
})
|
|
253
253
|
]
|
|
254
254
|
});
|
|
255
|
-
}, G =
|
|
256
|
-
ref:
|
|
257
|
-
className:
|
|
255
|
+
}, G = g(({ children: e, height: t, stable: n, overscroll: r, className: a }, o) => /* @__PURE__ */ p("div", {
|
|
256
|
+
ref: o,
|
|
257
|
+
className: i("scrollable", n && "stable", r && "overscroll", a),
|
|
258
258
|
style: { height: t },
|
|
259
259
|
children: e
|
|
260
260
|
}));
|
|
261
|
-
|
|
262
|
-
className:
|
|
263
|
-
children: /* @__PURE__ */
|
|
261
|
+
g(({ blockClassName: e, ...t }, n) => /* @__PURE__ */ p("div", {
|
|
262
|
+
className: i(e, "overflowHidden w100 h100"),
|
|
263
|
+
children: /* @__PURE__ */ p(G, {
|
|
264
264
|
ref: n,
|
|
265
265
|
...t
|
|
266
266
|
})
|
|
@@ -273,37 +273,37 @@ var K = {
|
|
|
273
273
|
warning: "_03z-1l",
|
|
274
274
|
error: "_0RqsqJ",
|
|
275
275
|
state: "mXkUoM"
|
|
276
|
-
}, q = ({ state: e = "none", text: t, className: n }) => /* @__PURE__ */
|
|
277
|
-
className:
|
|
276
|
+
}, q = ({ state: e = "none", text: t, className: n }) => /* @__PURE__ */ m("div", {
|
|
277
|
+
className: i("flexCenter gapSm", n),
|
|
278
278
|
children: [(() => {
|
|
279
279
|
switch (e) {
|
|
280
|
-
case "error": return /* @__PURE__ */
|
|
281
|
-
case "warning": return /* @__PURE__ */
|
|
282
|
-
case "success": return /* @__PURE__ */
|
|
283
|
-
case "information": return /* @__PURE__ */
|
|
280
|
+
case "error": return /* @__PURE__ */ p(Y, {});
|
|
281
|
+
case "warning": return /* @__PURE__ */ p(X, {});
|
|
282
|
+
case "success": return /* @__PURE__ */ p(Z, {});
|
|
283
|
+
case "information": return /* @__PURE__ */ p(Q, {});
|
|
284
284
|
default: return null;
|
|
285
285
|
}
|
|
286
286
|
})(), t]
|
|
287
287
|
}), J = ({ state: e }) => {
|
|
288
288
|
switch (e) {
|
|
289
|
-
case "error": return /* @__PURE__ */
|
|
290
|
-
case "warning": return /* @__PURE__ */
|
|
291
|
-
case "success": return /* @__PURE__ */
|
|
292
|
-
case "information": return /* @__PURE__ */
|
|
289
|
+
case "error": return /* @__PURE__ */ p(Y, {});
|
|
290
|
+
case "warning": return /* @__PURE__ */ p(X, {});
|
|
291
|
+
case "success": return /* @__PURE__ */ p(Z, {});
|
|
292
|
+
case "information": return /* @__PURE__ */ p(Q, {});
|
|
293
293
|
default: return null;
|
|
294
294
|
}
|
|
295
|
-
}, Y = () => /* @__PURE__ */
|
|
295
|
+
}, Y = () => /* @__PURE__ */ p(u, { className: i(K.state, K.error) }), X = () => /* @__PURE__ */ p(c, { className: i(K.state, K.warning) }), Z = () => /* @__PURE__ */ p(l, { className: i(K.state, K.success) }), Q = () => /* @__PURE__ */ p(f, { className: i(K.state, K.information) });
|
|
296
296
|
//#endregion
|
|
297
297
|
//#region src/misc/StateWrapper.tsx
|
|
298
|
-
function $({ as: e, state: t, className: n, ...
|
|
299
|
-
let
|
|
300
|
-
return /* @__PURE__ */
|
|
298
|
+
function $({ as: e, state: t, className: n, ...a }) {
|
|
299
|
+
let o = t?.toLowerCase() ?? "none", s = K[o], c = o && o !== "none";
|
|
300
|
+
return /* @__PURE__ */ p(r, {
|
|
301
301
|
as: e || "div",
|
|
302
|
-
className:
|
|
303
|
-
...
|
|
302
|
+
className: i(K.stateWrapper, c && K.status, s, n),
|
|
303
|
+
...a
|
|
304
304
|
});
|
|
305
305
|
}
|
|
306
306
|
//#endregion
|
|
307
307
|
export { k as _, q as a, T as b, G as c, z as d, R as f, j as g, M as h, J as i, W as l, I as m, Y as n, Z as o, L as p, Q as r, X as s, $ as t, B as u, D as v, E as y };
|
|
308
308
|
|
|
309
|
-
//# sourceMappingURL=misc-
|
|
309
|
+
//# sourceMappingURL=misc-CGQOXXCy.js.map
|